apescott
Member
I've been messing with this still lately lol, but I can't get it to work in game... It just crashes when an enemy dies.
Here's what I have... What do I do to get it to work?
I set it to ''load'' xflash in my models.txt, but it still crashes. I just want it to spawn the xflash entity at death. Pleae help it's driving me bonkers :'( lol Thanks guys
Here's what I have... What do I do to get it to work?
Code:
void spawn06(void vName, float fX, float fY, float fZ)
{
//Spawns entity based on left screen edge and z axis
//Auto adjust with camera's position
//vName: Model name of entity to be spawned in.
//fX: X distance relative to left edge
//fY: Y height from ground
//fZ: Z coordinate
void self = getlocalvar("self"); //Get calling entity.
void vSpawn; //Spawn object.
int Direction = getentityproperty(self, "direction");
int XPos = openborvariant("xpos"); //Get screen edge's position
int YPos = openborvariant("ypos"); // Get camera position
int Screen = openborvariant("hResolution"); // Get screen width
clearspawnentry(); //Clear current spawn entry.
setspawnentry("name", vName); //Acquire spawn entity by name.
if (Direction == 0){ //Is entity facing left?
fX = Screen-fX; //Reverse X direction to match facing and screen length
}
vSpawn = spawn(); //Spawn in entity.
changeentityproperty(vSpawn, "position", fX + XPos, fZ + YPos, fY); //Set spawn location.
return vSpawn; //Return spawn
}
Code:
name xflash
health 0
type none
shadow 0
animationscript data/scripts/spawn06.c
anim idle
loop 0
delay 3
offset 0 170
frame data/chars/misc/x1.gif
frame data/chars/misc/x2.gif
frame data/chars/misc/x1.gif
frame data/chars/misc/x2.gif
frame data/chars/misc/x1.gif
frame data/chars/misc/x2.gif
frame data/chars/misc/x1.gif
frame data/chars/misc/x2.gif
frame data/chars/misc/x1.gif
frame data/chars/misc/x2.gif
frame data/chars/misc/x1.gif
frame data/chars/misc/x2.gif
frame data/chars/misc/x1.gif
frame data/chars/misc/x2.gif
frame data/chars/misc/x1.gif
frame data/chars/misc/x2.gif
frame data/chars/misc/x1.gif
frame data/chars/misc/x2.gif
frame data/chars/misc/x1.gif
frame data/chars/misc/x2.gif
Code:
anim death
loop 0
offset 238 177
bbox 0 0 0 0
@cmd spawn06 "xflash" 5 20 0
delay 60
frame data/chars/simons/fall002.gif
I set it to ''load'' xflash in my models.txt, but it still crashes. I just want it to spawn the xflash entity at death. Pleae help it's driving me bonkers :'( lol Thanks guys