Jump to content
Search In
  • More options...
Find results that contain...
Find results in...
  • 0
zaszthedestroyer

Can I change actor sprites in mid game? {SOLVED}

Question

(so, I know this is undoubtedly a dumb question, with plenty of resources on ZDOOM wiki and such but i have no idea the proper terms)

Im having trouble learning how to change a actor from one state to another? like in some DOOM mods there are statues that come to life (yea, ive studied the code, but never really understood it)

what im looking to do specifically is to have an actor change sprites mid game. (like in brutal doom, for example where you can shoot the arm off a pinkie demon)

 

i hope im being specific enough.

thanks in advance!

 

 

Share this post


Link to post

11 answers to this question

Recommended Posts

  • 0

Hm, the easiest way for you - create the doppelganger actor.

 

I mean, you need to add "spawn DOppelganger Monster" code into death state of the Original Monster.

Example:

 

The first Cyberdemon is just made for the cutscene. He just uses this angry animation and DIES after that. At the same time game spawn the SECOND Cyberdemon which actually shoot at you.

 

Share this post


Link to post
  • 0

You can make a different state that includes the new sprites and make a different state jump to the sprites on the desired interval.

 

For example:

ACTOR ExampleImp : DoomImp
{
	States
	{
	  See:
	   TROO AABBCCDD 3 A_Chase
	   Loop
	  Pain: //state used to jump to different state
	   TNT1 A 0 A_JumpIfInventory("Health", 20, "Dying") //checks on pain whether the imp is healthy or not.
	   TROO H 2
	   TROO H 2 A_Pain
	  Dying:
	   IDTH ABABABAB 3
	   Goto Death+3 //imp falls over after struggle
	}
}

I'm still pretty new to decorate, though, so feel free to correct me if I'm wrong.

Share this post


Link to post
  • 0

@DeXiaZ Holy

Spoiler

mackerel

dude! that cyberdemon intro is BadA**!  and yea! that's EXACTLY like what im looking for! (aside from that being the coolest thing ive ever seen!)  @pc234 this looks like the same idea, but helps expand on the code. and that may actually be better than what i had in mind...anyway imma go try it when i wake up, but for now we can mark this one solved! eh...however that's done

Share this post


Link to post
  • 0
Posted (edited)

okay! i tried the code and it worked! problem is he has like 1 health no matter how much i tell decorate to increase it i think it's bc the test subject is inheriting from DOOMIMP if i made this it's own character i think i could specify values (which i need) 

 

EDIT: 

i impleneted a full pinkie demon code on a separate monster and created a dopplerganger that will spawn once the original is killed 

HOWEVER the new one (testsubjectdoppelganger) is immortal and cannot be killed, even with console commands!

i don't fully understand what i did wrong here?

Screenshot_Doom_20180828_125648.png

Edited by zaszthedestroyer : update

Share this post


Link to post
  • 0

What exactly do you want to create? Possibly it's easier to create for us an example wad for you instead of giving text advices...

Share this post


Link to post
  • 0
Posted (edited)

 

sorry for being vague.

 

im making a monster that comes out of walls and either kills you with a single touch or transports you to another level. i havent decided that yet.

 

it's the part where it crawls out of the wall im looking for. 

im thinking i craft a animation of the monster coming out of the wall, then have it spawn-switch with the ACTUAL monster.

example.png

 

EDIT:

also, i know this monster **Can** be invincible, but i need to do something down the road, i need to know

Share this post


Link to post
  • 0

hey guys. i know its been a while but ive been in decorate  all day and i think i found the culprit:


//---------------from code------------------
    Death:
        TSPR B 1
        TSPR B 1 A_Scream
        TSPR B 1
        TSPR C 1 A_NoBlocking
        TSPR C 1
        TSPR C 1
        Stop
    //Raise:
        //SARG N 5;
        //SARG MLKJI 5;
        Goto See  <====================
    }
}
//--------------------------------

 

@pc234 i was wondering what Death+3 does? it seems to spawn the doppelganger but i cant find any details on the doom wiki

Share this post


Link to post
  • 0
35 minutes ago, zaszthedestroyer said:

@pc234 i was wondering what Death+3 does? it seems to spawn the doppelganger but i cant find any details on the doom wiki

I mainly added that so that the imp dying in the Dying state wouldn't look like he was standing up and falling back down.

Share this post


Link to post
  • 0
1 hour ago, zaszthedestroyer said:

i was wondering what Death+3 does?

Death:
SPRT ABC 8
SPRT DE 8
goto Death+3 //This skips directly to the fourth frame.

 

Also notice that in pc234's code, there's this little section:

	TROO H 2 A_Pain
Dying:
	IDTH ABABABAB 3

This is called a fall-through, because the actor in question will move directly into the next state (here, the "Dying" state) because there's no stop (like stop, loop, or goto <state>), hence, it "falls through [the code] into the next frame."

If you don't want this to happen on general pain, you can specify a specific damage type pain state by using Pain.<DamageType> and when the damage type is dealt, ZDoom will call this specific pain state.

Share this post


Link to post
  • 0

uhh...? the fourth frame? of like the monsters death animation?

 

I see it! *they pulled a sneaky on me* Frame Troo switches to the Dopplerganger HOW DID I MISS THAT

 

Share this post


Link to post

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×