Solved Spawn01 specific animation

Question that is answered or resolved.

dantedevil

Well-known member
It's possible modify the classic spawn01, to spawn enemies with an specific animations?

I have an entity enter in the screen.
This entity is a Truck with a lot of enemies.
I need spawn every enemy over the Tuck with a specific animation.
I can't use the simple spawn of this enemies, because is already in use with the bikers.
 
Last edited:
I don't really understand, but why don't you just change entities animation right after spawning them with your scripted spawn function ?

You could also wrap this spawn function into a new one that does this job (spawn then change animation).
 
Sorry my friend but I don't understand you.

The ANIM SPAWN of my enemies is actually used for the bikers.
All bikers have an enemy over the back seat, them simpy spawn the enemy with spawn01 and the enemy play the ANIM SPAWN.

Now I have this truck with 5 enemies over him. I want spawn every enemy with a specific animation, because if use simply spawn01 with every enemy, they show the  ANIM SPAWN.  And not looo good, because that animation was created for down of the bikes.

I only need spawn enemies from the Truck with a specific animation.
 
Exactly my friend.
I use that method you teach me to spawn enemies in the txt of  an stage.

But how can use something like this to spawn an enemy from other entity?
 
Code:
name entity_A
type enemy
...
...


anim spawn
	@script
		if(frame == 0){
			void ent = spawn01("entity_B", ...);
			performattack(ent, openborconstant("ANI_follow1"), 1);

		}
	@end_script
	offset x y
	frame data/chars/...
 
Sorry but not work.

Here the error log :

Code:
Fatal Error in load_cached_model, file: data/chars/misc/truckgang.txt, line 69, message: Error parsing function main of animation script in file '%s'!

And here the entity test:

Code:
name		truckgang
health	1
type		none
gfxshadow       1
hostile	player
candamage	player obstacle
noquake  	1
nolife  	1
flash		flash
noatflash	1
offscreenkill 200

speed  18
noquake  	1

load  bd5
load  bd2
load  bd4
load  bd3
load  bd1

animationscript data/scripts/obstacle.c 

anim idle
        loop    0 
	offset	150 175
	sound    data/sounds/car.wav
	hitflash  flash
        hitfx   data/sounds/indirect.wav
        attack  15 102 258 65 25 1 1 0 20 20
        dropv   4 1 0
	delay	5
        @cmd    dasher 2 0 0
        frame	data/chars/misc/truck01.png
        frame	data/chars/misc/truck02.png
        frame	data/chars/misc/truck01.png
        frame	data/chars/misc/truck02.png
        frame	data/chars/misc/truck01.png
        frame	data/chars/misc/truck02.png
        frame	data/chars/misc/truck01.png
        frame	data/chars/misc/truck02.png
        frame	data/chars/misc/truck01.png
        frame	data/chars/misc/truck02.png
        frame	data/chars/misc/truck01.png
        frame	data/chars/misc/truck02.png
        frame	data/chars/misc/truck01.png
        frame	data/chars/misc/truck02.png
        frame	data/chars/misc/truck01.png
        frame	data/chars/misc/truck02.png
        frame	data/chars/misc/truck01.png
        frame	data/chars/misc/truck02.png
        frame	data/chars/misc/truck01.png
        frame	data/chars/misc/truck02.png
        frame	data/chars/misc/truck01.png
        frame	data/chars/misc/truck02.png
        frame	data/chars/misc/truck01.png
        frame	data/chars/misc/truck02.png
        @cmd    dasher 1 0 0
        frame	data/chars/misc/truck01.png
        frame	data/chars/misc/truck02.png
        frame	data/chars/misc/truck01.png
        frame	data/chars/misc/truck02.png
        attack  0 0 0 0
        @cmd    stop
	delay	20
        frame	data/chars/misc/truck03.png

	@script
		if(frame == 30){
			void ent = spawn01("bd5", -100 40 -1);
			performattack(ent, openborconstant("ANI_follow11"), 1);

		}
	@end_script
        frame	data/chars/misc/truck04.png
        frame	data/chars/misc/truck04.png
        frame	data/chars/misc/truck04.png
        frame	data/chars/misc/truck04.png
        frame	data/chars/misc/truck04.png
        frame	data/chars/misc/truck04.png
 
Back
Top Bottom