Marine that uses custom sprites

Archive of the old editing forum
Forum rules
Before asking on how to use a ZDoom feature, read the ZDoom wiki first. This forum is archived - please use this set of forums to ask new questions.
User avatar
Glassyman
Posts: 52
Joined: Mon May 14, 2007 8:55 am
Location: My body is 6 feet under, my soul in heaven

Marine that uses custom sprites

Post by Glassyman »

I wish to create a chaingun marine that uses personal sprites. How can I make it? The wiki didn't help me.
User avatar
Amuscaria
Posts: 6634
Joined: Mon Jul 26, 2004 12:59 pm
Location: Growing from mycelium near you.

Post by Amuscaria »

You gotta make it more clear...did you simply want to change the graphics, or did you want a whole different class? If you Just wanted to make your marine use different graphics. Also, when you mean Chaingun marine, did you mean the player or the chaingun zombies in the game?
User avatar
Enjay
 
 
Posts: 26944
Joined: Tue Jul 15, 2003 4:58 pm
Location: Scotland
Contact:

Post by Enjay »

Or even the chaingun scripted marine (which I think can have a skin allocated to it by ACS).
User avatar
Glassyman
Posts: 52
Joined: Mon May 14, 2007 8:55 am
Location: My body is 6 feet under, my soul in heaven

Post by Glassyman »

Sorry, I wasn't clear in my first post. Here's an explanation: I wish to create a new actor that uses the Pikachu's sprites you can find in this wad and that has the same combat features of the chaingun marine (not the zombie). Please write in this thread the DECORATE code I should use. Fell free to ask me more info.
User avatar
Tormentor667
Posts: 13554
Joined: Wed Jul 16, 2003 3:52 am
Preferred Pronouns: He/Him
Operating System Version (Optional): Windows 11
Graphics Processor: nVidia (Modern GZDoom)
Location: Germany
Contact:

Post by Tormentor667 »

Create an inherited version of the chaingun marine and give him the +FRIENDLY tag :) That's it.
User avatar
Glassyman
Posts: 52
Joined: Mon May 14, 2007 8:55 am
Location: My body is 6 feet under, my soul in heaven

Post by Glassyman »

Tormentor667 wrote:Create an inherited version of the chaingun marine and give him the +FRIENDLY tag :) That's it.
It'll be a dormant character so +FRIENDLY isn't necessary. My true problem are the sprites. How can I replace the originals?
User avatar
HotWax
Posts: 10002
Joined: Fri Jul 18, 2003 6:18 pm
Location: Idaho Falls, ID

Post by HotWax »

If it's going to be dormant, why do you need it to be based on the chaingun marine?

This will define a simple decoration if that's all you really need:

Code: Select all

Actor Pikachu {
     height 32
     radius 12
     +SOLID

     States {
          Spawn:
               PIKA A -1
               stop
     }
}
User avatar
Glassyman
Posts: 52
Joined: Mon May 14, 2007 8:55 am
Location: My body is 6 feet under, my soul in heaven

Post by Glassyman »

HotWax wrote:If it's going to be dormant, why do you need it to be based on the chaingun marine?
It'll be activated later to fight against the player.
HotWax wrote:This will define a simple decoration if that's all you really need:
Thank you but I don't need a simple decoration. Have you ever seen a final boss that is as static as a lamp or a medikit? :wink:
But you've certainly seen a final boss that fights like a marine but that uses different sprites. :)
User avatar
HotWax
Posts: 10002
Joined: Fri Jul 18, 2003 6:18 pm
Location: Idaho Falls, ID

Post by HotWax »

Ah, well that clears that up then.

The difficulty you're going to find with doing this is that the chaingun marine's Decorate code is not known. All of the marines are defined internally, so it's not just as simple as looking inside ZDoom's Decorate files for them.

The best you might hope to do is to base it off of the chaingun zombie itself. These two actors should be nearly identical in behavior anyway.

You're going to have to essentially redefine the entire actor from scratch anyway, given that every frame needs to be replaced with a new graphic. Unfortunately, though requested, there is currently no way to simply tell ZDoom to use one sprite set in place of another.
User avatar
Glassyman
Posts: 52
Joined: Mon May 14, 2007 8:55 am
Location: My body is 6 feet under, my soul in heaven

Post by Glassyman »

This is the DECORATE code for a marine pistol.
I can use it instead of marine chaingun. The code says that the used sprites are those of the player. So I have to replace them all with those of Pikachu. Is it possible now?
User avatar
HotWax
Posts: 10002
Joined: Fri Jul 18, 2003 6:18 pm
Location: Idaho Falls, ID

Post by HotWax »

That's actually only a small part of the necessary Decorate code, as the rest is inherited from ScriptedMarine. For what you want to do you'd have to redefine every state, replacing PLAY with the name of your custom sprite. (e.g. PIKA)
User avatar
Glassyman
Posts: 52
Joined: Mon May 14, 2007 8:55 am
Location: My body is 6 feet under, my soul in heaven

Post by Glassyman »

This is the code of the zombie marine you can find in the "Monster resource wad"

Code: Select all

ACTOR ZombieMarine 3200
{ 

    Health 100
    Radius 20
    Height 56
    Speed 9
    PainChance 200
    Damage 1
    MONSTER 
    +FLOORCLIP
    Obituary "%o was killed by A Zombie Marine!"
    SeeSound "grunt/sight"
    AttackSound "zombie/rifle"
    PainSound "grunt/pain"
    DeathSound "grunt/death"
    ActiveSound "grunt/active"
    DropItem Clip
    DropItem Clip
    States
    {
    Spawn:
        UDM2 AB 10 A_Look
        Loop
    See:
        UDM2 AABBCCDD 4 A_Chase
        Loop
    Missile:
        UDM2 E 2 A_FaceTarget
        UDM2 F 2 A_BulletAttack
        UDM2 E 2 A_Cposrefire
        Loop
    Pain:
        UDM2 G 5
        UDM2 G 3 A_Pain
        Goto See
    Death:
        UDM2 H 5
        UDM2 I 5 A_Scream
        UDM2 J 5 A_Fall
        UDM2 KLM 5
        UDM2 N -1
        Stop
    XDeath:
        UDM2 O 5
        UDM2 P 5 A_XScream
        UDM2 Q 5 A_Fall
        UDM2 RSTU 5
        UDM2 V -1
        Stop
    Raise:
        UDM2 NMLKJIH 5
        Goto See
    }
} 
Can anyone modify it with Pikachu's sprites?
User avatar
HotWax
Posts: 10002
Joined: Fri Jul 18, 2003 6:18 pm
Location: Idaho Falls, ID

Post by HotWax »

Just replace the sprite name (UDM2) with the name of your Pikachu sprites, then make sure the frames match what he should be doing in each state.

So, start with this:

Code: Select all

actor Pikachu {
    // Change these to suit the new actor
    Health 100 
    Radius 20 
    Height 56 
    Speed 9 
    PainChance 200 
    Damage 1 
    MONSTER 
    +FLOORCLIP 
    Obituary "%o was killed by Pikachu!" 
    SeeSound "pika/sight" 
    AttackSound "pika/zap" 
    PainSound "pika/pain" 
    DeathSound "pika/death" 
    ActiveSound "pika/active"
    DropItem PokeBallPikachu 16
Then, start replacing states. If the frames match up, great! Your spawn state could look like this, for example:

Code: Select all

States {
     Spawn:
          PIKA AB 10 A_Look
          loop
The only difference from what you posted is the sprite name.

Do the same thing with each other state. Make sure the sprite frames match. So maybe your Pikachu has 2 pain frames instead of one. Your pain state might look like this:

Code: Select all

Pain:
     PIKA G 4
     PIKA H 4 A_Pain
     goto See
Here I adjusted the frame durations and made two frames shown (G & H) instead of one.

It should be self-explanatory from here.
User avatar
Enjay
 
 
Posts: 26944
Joined: Tue Jul 15, 2003 4:58 pm
Location: Scotland
Contact:

Post by Enjay »

I'm sure there is an ACS command to allocate skins to the scripted marines (but I can't find it in the Wiki). If all you want to do is have a scripted marine wear a pikachu skin then you could place the marine in a map, give him a tid and use an open script to make him look like Pikachu. I should be able to find the ACS when I get home.

Personally however, I would be making a new decorate actor as others have suggesed. Aside from anything else, that would mean you could put the sprites into your WAD. Skin sprites have to be kept separate.
User avatar
Glassyman
Posts: 52
Joined: Mon May 14, 2007 8:55 am
Location: My body is 6 feet under, my soul in heaven

Post by Glassyman »

Enjay wrote:If all you want to do is have a scripted marine wear a pikachu skin then you could place the marine in a map, give him a tid and use an open script to make him look like Pikachu.
Yes, this may be the solution because I have a Pikachu skin.
Enjay wrote:Personally however, I would be making a new decorate actor as others have suggesed. Aside from anything else, that would mean you could put the sprites into your WAD. Skin sprites have to be kept separate.
It's a bit too hard for me. :( Therefore I'm waiting for your ACS script.
Locked

Return to “Editing (Archive)”