dantedevil
Well-known member
I am working on creating an entity that has different animations depending on its "remap". 
In this way we can have different compartments of the same entity, without having to create several entities of the same type.
I've tried to create the correct script, but I can't.

In this way we can have different compartments of the same entity, without having to create several entities of the same type.
I've tried to create the correct script, but I can't.

Code:
anim death
@script
if(frame == 0){
void self = getlocalvar("self");
int iMap = getentityproperty(self, "map"); // Get caller's remap.
if(Map =="1"){
performattack(self, openborconstant("ANI_DIE73"));
}
if(Map =="2"){
performattack(self, openborconstant("ANI_DIE73"));
}
}
@end_script
jumpframe 0 4 -1
loop 0
delay 2
offset 62 60
frame data/chars/misc/obstacles/barrelroll05.png
frame data/chars/misc/empty.png
frame data/chars/misc/obstacles/barrelroll05.png
frame data/chars/misc/empty.png
frame data/chars/misc/obstacles/barrelroll05.png
frame data/chars/misc/empty.png
frame data/chars/misc/obstacles/barrelroll05.png
frame data/chars/misc/empty.png
frame data/chars/misc/obstacles/barrelroll05.png
frame data/chars/misc/empty.png
frame data/chars/misc/obstacles/barrelroll05.png
frame data/chars/misc/empty.png
frame data/chars/misc/obstacles/barrelroll05.png
frame data/chars/misc/empty.png
frame data/chars/misc/obstacles/barrelroll06.png
frame data/chars/misc/empty.png
frame data/chars/misc/empty.png
frame data/chars/misc/obstacles/barrelroll06.png
frame data/chars/misc/empty.png
frame data/chars/misc/empty.png
frame data/chars/misc/obstacles/barrelroll06.png
frame data/chars/misc/empty.png
frame data/chars/misc/empty.png
frame data/chars/misc/obstacles/barrelroll06.png
frame data/chars/misc/empty.png
frame data/chars/misc/empty.png
frame data/chars/misc/empty.png
frame data/chars/misc/obstacles/barrelroll06.png
frame data/chars/misc/empty.png
frame data/chars/misc/empty.png
frame data/chars/misc/empty.png
frame data/chars/misc/obstacles/barrelroll06.png
frame data/chars/misc/empty.png
offset 1 1
@cmd killentity getlocalvar("self")
frame data/chars/misc/empty.png