How to have two different jump delays?

16-bit Fighter

Active member
I want for a char to have two jump delays, one for normal jump and another for the runjump. I tried to put a jumpframe command in the runjump anim but it doesn't work since the char jumps from the first frame.
Does the engine need a runjump delay animation?

Thanks for any help!
 
You would have to check previous animation to get it working, so its walk or run, based on this it would change from default runjump to follow animation with different runjump.

"prevanimationid" to getentityproperty useful to know previous animation ID
This should help
 
Thanks, the idea about using "prevanimationid" should be the right one!

bWWd said:
You would have to check previous animation to get it working, so its walk or run, based on this it would change from default runjump to follow animation with different runjump.
I don't want two different runjumps but two different jump delays depending on the player is running or not.
 
I unsuccessfully tested something. The jumpdelay anim is meant to stop and the follow4 one to start if the previous animation was "run". But follow4 never play if the player jump after running...

Here is the script:

Code:
anim jumpdelay
	offset	74 102
	delay	6
	bbox	65 55 18 47
	@script
	void self = getlocalvar("self");
	void prevanim = getentityproperty(self,"prevanimationid");
	if (frame == 0){   
 	if (prevanim == "ANI_RUN"){   
	executeanimation (self, "ANI_FOLLOW4", 1);
	}
	}
   	@end_script
	frame	data/chars/sk/jump01.png

anim	follow4
	offset	74 102
	delay	6
	bbox	65 40 18 54
	@script
	void self = getlocalvar("self");
	void prevanim = getentityproperty(self,"prevanimationid");
 	if (frame == 2){   
	executeanimation (self, "ANI_RUNJUMP", 1);
	}
   	@end_script
	frame	data/chars/sk/runfwdj01.png
	frame	data/chars/sk/runfwdj02.png
	frame	data/chars/sk/runfwdj02.png


anim jump
	offset	74 102
	delay	6
	bbox	65 40 18 54
	mponly	1
	@cmd	mpcost 30
	landframe 7
	frame	data/chars/sk/jump02.png
	frame	data/chars/sk/jump03.png
	frame	data/chars/sk/jump04.png
	frame	data/chars/sk/jump05.png
	frame	data/chars/sk/jump06.png
	frame	data/chars/sk/jump07.png
	delay	999
	frame	data/chars/sk/jump08.png
	delay	15
	frame	data/chars/sk/get01.png

anim runjump
	offset	74 102
	delay	6
	bbox	65 40 18 54
	mponly	1
	@cmd	mpcost 50
	landframe 7
	delay	2
	move	15
	frame	data/chars/sk/runfwdj03.png
	delay	6
	move	0
	frame	data/chars/sk/runfwdj03.png
	delay	6
	frame	data/chars/sk/runfwdj04.png
	frame	data/chars/sk/runfwdj05.png
	frame	data/chars/sk/runfwdj06.png
	frame	data/chars/sk/runfwdj07.png
	delay	999
	frame	data/chars/sk/runfwdj08.png
	delay	6
	frame	data/chars/sk/runfwdj09.png
 
Do it like this, it works:
Code:
	@script
	void self = getlocalvar("self");
	void prevanim = getentityproperty(self,"prevanimationid");
	if (frame == 1 && prevanim == 40 ){   
	 settextobj(1, 250 , 280 , 1, 1, prevanim , openborvariant("elapsed_time")+2000);
	   performattack(self, openborconstant("ANI_ATTACK1"));
	}
   	@end_script

40 is ID of run, you can use that text object to display different ID's for different animations and just remove it when not used.
I often check with text objects if scripts are working and variables are obtained.
 
I've tried that script bWWd and it caused player to get stuck in ATTACK1 animation and doesn't continue jumping

I've fixed the script to make it working, here's how it should be:
Code:
anim	jumpdelay
@script
  void self = getlocalvar("self");
  void prevanim = getentityproperty(self,"prevanimationid");

  if(frame == 1 && prevanim == openborconstant("ANI_RUN")){
    changeentityproperty(self, "animation", openborconstant("ANI_FOLLOW2"));
  }
@end_script

FOLLOW2 is the alternate jumpdelay animation

HTH
 
Back
Top Bottom