character jumps by himself because of cancel & script conflict

ABK

Well-known member
I have it like that :
Code:
anim	forwardjump
@script
             void self = getlocalvar("self");
                                int iPIndex = getentityproperty(self,"playerindex"); //Get player index
                void p1 = playerkeys(iPIndex, 0, "moveright");
                void p2 = playerkeys(iPIndex, 0, "moveleft");
                void p3 = playerkeys(iPIndex, 0, "jump");
                float tossv = getentityproperty(self, "tossv");
                float sx = getentityproperty(self, "x");
		if ((getentityproperty(self, "direction")==0)&&(!p3)){
		changeentityproperty(self, "velocity",-2, 0,tossv/4);
		}
		if ((getentityproperty(self, "direction")==1)&&(!p3)){
		changeentityproperty(self, "velocity",2, 0,tossv/4);
		}
	@end_script
	cancel	2 11 0 J freespecial1
followanim	1
	attackone	1
	loop	0
	offset	139 234
	bbox	116 141 50 92
	delay	5
	subentity	spark
	spawnframe	4 -20
	throwframe	1
	sound	data/sounds/jump.wav
	frame	data/chars/turt/j1.gif
	frame	data/chars/turt/j2.gif
	frame	data/chars/turt/j3.gif
	frame	data/chars/turt/j4.gif
	hitfx	data/sounds/get.wav
	frame	data/chars/turt/j5.gif
	frame	data/chars/turt/j6.gif
	attack	120 177 35 56 10 0 1 0 0 0
	frame	data/chars/turt/j7.gif
	frame	data/chars/turt/j8.gif
	delay	60
	frame	data/chars/turt/j9.gif
With script cancel is executed everytime because im holding jump button.How i can fix this ?
If i remove the script then its still happening but rarely  and my cancel with J is executed even if im just holding jump from the first jump itself without pressing it twice like cancel requires, its for double jump.
So you cant have cancel in jump animation using jump button?
My animation has 9 frames but cancel has 11 mayube thats the problem ? but last frame is kinda long with 60 delay.
Well its not cause i checked and had cancel 2 6 0 J freespecial1  and its still happening, my character is making cancel even if i just hold the button after jump.

Manual says "~Be careful in using single button input cause engine can easily accept the input when this animation is played. For example, cancel with just attack button as input in GRABATTACK will make cancel activated immediately as soon as it's played. To avoid this, set {start frame} late enough for engine to remove the input which activated GRABATTACK. "

So is there some way to clear input on first frame or something? how many frames it takes to remove input cayse iu had cancel on frame 4 and it still happens.
Whats strange is it never happens when i jump straight up (only jump button) and happens only when i jump forward.
 
Use playerkeys(iPIndex, 1, "jump"); not playerkeys(iPIndex, 0, "jump");
than check the frame window with:

int animpos = getentityproperty(self, "animpos");
if ( animpos >= 2 && animpos <= 11 ) {
...
}
 
This problem is happening even without script so its a bug in cancel, it doesnt clear jump press fast enough and its still being registered as press even after 20 delay (4 frames with delay 5), thats quite long.
 
I'm afraid the best solution for now is using a key script instead of cancel command because there's no way for now to set individual delay for input steps.
Unfortunately, you need at least 25 for a combo to time-out.  :)
 
ill try, maybe would work cause if i have cancel on frame 1 it happens more often than on frame 4
---
OK i tried, if its cancel 4 8 then it happens very rarely and with cancel 5 8 it doesnt happen, frames are with delay 5.With cancel 1 8 it happens always.
 
Back
Top Bottom