follow animation problem

ABK

Well-known member
My follow anim is not going back to idle and i have no clue why
Any ideas ? It hits player and then its stuck in last frame of follow1 animation, same happens if entity is npc, i've lost like 2 hours already trying to figure out what the hell is goin on over here with such simple thing, is this some engine problem ? Cause it doesnt make any sense why it stays in follow animation , i tried to change to idle manually by script in follow1 animation but it doesnt help.
Code:
name	wate
type  none
health  999
shadow	0
subject_to_hole 0
subject_to_gravity 0
 palette   data/sprites/wate7.gif

anim	follow1
	loop	0
	offset	85 4
	bbox	0 0 0 0
	attack	0 0 0 0 0 0 0 0 0 0
	delay	5
	frame	data/sprites/wate1.gif
	frame	data/sprites/wate2.gif
	frame	data/sprites/wate3.gif
	frame	data/sprites/wate4.gif
	frame	data/sprites/wate5.gif
	frame	data/sprites/wate6.gif
	frame	data/sprites/wate7.gif
	frame	data/sprites/wate8.gif
	frame	data/sprites/wate9.gif
	frame	data/sprites/wate10.gif
	frame	data/sprites/wate11.gif
	frame	data/sprites/wate12.gif
	frame	data/sprites/wate13.gif
		
anim	idle
	loop	0
	offset	85 4
	bbox	0 0 0 0
	delay	50
	followanim	1
	attack	40 -1 88 17 0 0 1 1 0 888
	frame	data/sprites/wate7.gif
 
There's no followcond in IDLE. My guess is the engine is looping right back to the follow animation because of that. Add an appropriate followcond and see if it helps.

If that doesn't fix it, forget the default follow system and just change the animation yourself with a didhitscript. That will work for sure.

DC
 
Well but why changing from follow1 to idle with script in follow1 doesnt work ? setidle have no effect.Also if there is attack in idle then there should be attack logic by default otherwise attack wouldnt work ? Such simple thing shouldnt require workarounds.
What i want to do is to have insivible water splash waiting and its invisible frame, and when character gets close to it then it attacks player by playing its follow animation with watersplash.After that it should go back to idle waiting for player again.
----
It works when its like this but id prefere if follow animation would work normal evertyime when theres attack box setup, maybe having attack in idle was a bit rushed and is still unfinished cause i remember it wasnt possible long time ago.
Code:
name	wate
type  none
health  999
shadow	0
subject_to_hole 0
subject_to_gravity 0
candamage player enemy
 palette   data/sprites/wate7.gif
didhitscript   data/sprites/wat.c

anim	attack1
			@script
                void self = getlocalvar("self");
                          if (frame >= 11){
                  performattack(self, openborconstant("ANI_IDLE"));
           	}
	@end_script	
	loop	0
	offset	85 4
	bbox	0 0 0 0
	attack	0 0 0 0 0 0 0 0 0 0
	delay	5
	frame	data/sprites/wate1.gif
	frame	data/sprites/wate2.gif
	frame	data/sprites/wate3.gif
	frame	data/sprites/wate4.gif
	frame	data/sprites/wate5.gif
	frame	data/sprites/wate6.gif
	frame	data/sprites/wate7.gif
	frame	data/sprites/wate8.gif
	frame	data/sprites/wate9.gif
	frame	data/sprites/wate10.gif
	frame	data/sprites/wate11.gif
	frame	data/sprites/wate12.gif
	frame	data/sprites/wate13.gif
		
anim	idle
	loop	1
	offset	85 4
	bbox	0 0 0 0
	delay	5
	frame	data/sprites/0.gif
	noreflect	1
	attack	40 -1 88 17 0 0 0 1 0 888
	hitfx	data/sounds/water.wav
	frame	data/sprites/0.gif
	delay	5
	attack	0 0 0 0 0 0 0 0 0 0 0
	frame	data/sprites/0.gif

didhit
Code:
void main()
{
           void self = getlocalvar("self");
                  performattack(self, openborconstant("ANI_ATTACK1"));
}
 
bWWd said:

The problem is in the followup code, which is what got rushed. It's another short sighted feature that never should have been made the way it was to begin with. But that said it works as advertised - it was only ever meant for attack animations. Making it fully compatible with everything else would take a reworking of the whole dang attack system. That's WAY not worth doing. The whole reason we have script is for situations like this.

DC
 
bWWd said:
Cause it doesnt make any sense why it stays in follow animation , i tried to change to idle manually by script in follow1 animation but it doesnt help.

Well, I was afraid that the water did change to IDLE with script but since the attackbox in IDLE hits player again, you see FOLLOW1 animation again as if it never work

Anyways, don't use performattack to revert to IDLE but instead use setidle .
 
Back
Top Bottom