Creating Pain Skins for monsters using a_JumpIfLessThan()

Ask about ACS, DECORATE, ZScript, or any other scripting questions here!

Moderator: GZDoom Developers

Forum rules
Before asking on how to use a ZDoom feature, read the ZDoom wiki first. If you still don't understand how to use a feature, then ask here.

Please bear in mind that the people helping you do not automatically know how much you know. You may be asked to upload your project file to look at. Don't be afraid to ask questions about what things mean, but also please be patient with the people trying to help you. (And helpers, please be patient with the person you're trying to help!)
Post Reply
User avatar
Gifty
Posts: 615
Joined: Sat Jun 15, 2013 8:21 pm

Creating Pain Skins for monsters using a_JumpIfLessThan()

Post by Gifty »

Hi, I'm trying to use a simple jump function to move the Imp to a bloodied "pain" skin once he sustains enough damage, but for some reason it just isn't working.

Code: Select all

See:
		TNT1 a 0 A_JumpIf(health <= 20,"OuchSee");		
		TROO AABBCCDD 3 A_Chase;
		loop;
		
	OuchSee:
		TROX AABBCCDD 3 A_Chase;
		loop;
As you can see, the jump is supposed to happen when he hits 20hp or lower. This is a really simple function, I'm not sure what I'm missing.
User avatar
Matt
Posts: 9696
Joined: Sun Jan 04, 2004 5:37 pm
Preferred Pronouns: They/Them
Operating System Version (Optional): Debian Bullseye
Location: Gotham City SAR, Wyld-Lands of the Lotus People, Dominionist PetroConfederacy of Saudi Canadia
Contact:

Re: Creating Pain Skins for monsters using a_JumpIfLessThan(

Post by Matt »

May need to replace the missile and pain states so that the "goto See" calls at the end of them don't end up going back to the DoomImp see state.

If that doesn't solve the problem please post the entire actor.
User avatar
Gifty
Posts: 615
Joined: Sat Jun 15, 2013 8:21 pm

Re: Creating Pain Skins for monsters using a_JumpIfLessThan(

Post by Gifty »

That fixed it! Thank you very much :D
Post Reply

Return to “Scripting”