Marine that uses custom sprites
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.
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.
- 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
I wish to create a chaingun marine that uses personal sprites. How can I make it? The wiki didn't help me.
- Glassyman
- Posts: 52
- Joined: Mon May 14, 2007 8:55 am
- Location: My body is 6 feet under, my soul in heaven
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.
- 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:
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:
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
}
}
- Glassyman
- Posts: 52
- Joined: Mon May 14, 2007 8:55 am
- Location: My body is 6 feet under, my soul in heaven
It'll be activated later to fight against the player.HotWax wrote:If it's going to be dormant, why do you need it to be based on the chaingun marine?
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?HotWax wrote:This will define a simple decoration if that's all you really need:

But you've certainly seen a final boss that fights like a marine but that uses different sprites.

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.
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.
- Glassyman
- Posts: 52
- Joined: Mon May 14, 2007 8:55 am
- Location: My body is 6 feet under, my soul in heaven
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?
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?
- Glassyman
- Posts: 52
- Joined: Mon May 14, 2007 8:55 am
- Location: My body is 6 feet under, my soul in heaven
This is the code of the zombie marine you can find in the "Monster resource wad"
Can anyone modify it with Pikachu's sprites?
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
}
}
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:
Then, start replacing states. If the frames match up, great! Your spawn state could look like this, for example:
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:
Here I adjusted the frame durations and made two frames shown (G & H) instead of one.
It should be self-explanatory from here.
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
Code: Select all
States {
Spawn:
PIKA AB 10 A_Look
loop
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
It should be self-explanatory from here.
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.
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.
- Glassyman
- Posts: 52
- Joined: Mon May 14, 2007 8:55 am
- Location: My body is 6 feet under, my soul in heaven
Yes, this may be the solution because I have a Pikachu skin.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.
It's a bit too hard for me.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.
