hello
iam trying to modify the spawn01 script with the anichange script
so i can call the entity with any animation i whant...
like what iam using in level txt
iam trying to make this in enemy.txt
@cmd spawn06 "lgt1" 50 55 1 "ANI_FOLLOW2"
iam having trouble figuring out how to connect the 2 scripts
this is what ive done so far... but its not working
void spawn06(void vName, float fX, float fY, float fZ, float Ani)
{
//spawns entity with choosen animation
//vName: Model name of entity to be spawned in.
//fX: X location adjustment.
//fZ: Y location adjustment.
//fY: Z location adjustment.
void self = getlocalvar("self"); //Get calling entity.
void vSpawn; //Spawn object.
int iDirection = getentityproperty(self, "direction");
clearspawnentry(); //Clear current spawn entry.
setspawnentry("name", vName); //Acquire spawn entity by name.
if (iDirection == 0){ //Is entity facing left?
fX = -fX; //Reverse X direction to match facing.
}
Ani = Ani + getentityproperty(self, "animation", openborconstant(Ani));
fX = fX + getentityproperty(self, "x"); //Get X location and add adjustment.
fY = fY + getentityproperty(self, "a"); //Get Y location and add adjustment.
fZ = fZ + getentityproperty(self, "z"); //Get Z location and add adjustment.
vSpawn = spawn(); //Spawn in entity.
changeentityproperty(vSpawn, "position", fX, fZ, fY, Ani); //Set spawn location.
changeentityproperty(vSpawn, "direction", iDirection); //Set direction.
return vSpawn; //Return spawn.
}
spawn01
Anichange
anyone knows how to make this...
so it can work like
@cmd spawn06 "name" 50 55 1 "ANI_FOLLOW*"
iam trying to modify the spawn01 script with the anichange script
so i can call the entity with any animation i whant...
like what iam using in level txt
spawn biker1
@script void main() {
performattack(getlocalvar("self"), openborconstant("ANI_FOLLOW2"));
} @end_script
map 2
health 100
coords 450 420
at 0
iam trying to make this in enemy.txt
@cmd spawn06 "lgt1" 50 55 1 "ANI_FOLLOW2"
iam having trouble figuring out how to connect the 2 scripts
this is what ive done so far... but its not working
void spawn06(void vName, float fX, float fY, float fZ, float Ani)
{
//spawns entity with choosen animation
//vName: Model name of entity to be spawned in.
//fX: X location adjustment.
//fZ: Y location adjustment.
//fY: Z location adjustment.
void self = getlocalvar("self"); //Get calling entity.
void vSpawn; //Spawn object.
int iDirection = getentityproperty(self, "direction");
clearspawnentry(); //Clear current spawn entry.
setspawnentry("name", vName); //Acquire spawn entity by name.
if (iDirection == 0){ //Is entity facing left?
fX = -fX; //Reverse X direction to match facing.
}
Ani = Ani + getentityproperty(self, "animation", openborconstant(Ani));
fX = fX + getentityproperty(self, "x"); //Get X location and add adjustment.
fY = fY + getentityproperty(self, "a"); //Get Y location and add adjustment.
fZ = fZ + getentityproperty(self, "z"); //Get Z location and add adjustment.
vSpawn = spawn(); //Spawn in entity.
changeentityproperty(vSpawn, "position", fX, fZ, fY, Ani); //Set spawn location.
changeentityproperty(vSpawn, "direction", iDirection); //Set direction.
return vSpawn; //Return spawn.
}
spawn01
void spawn01(void vName, float fX, float fY, float fZ)
{
//spawn01 (Generic spawner)
//Damon Vaughn Caskey
//07/06/2007
//
//Spawns entity next to caller.
//
//vName: Model name of entity to be spawned in.
//fX: X location adjustment.
//fZ: Y location adjustment.
//fY: Z location adjustment.
void self = getlocalvar("self"); //Get calling entity.
void vSpawn; //Spawn object.
int iDirection = getentityproperty(self, "direction");
clearspawnentry(); //Clear current spawn entry.
setspawnentry("name", vName); //Acquire spawn entity by name.
if (iDirection == 0){ //Is entity facing left?
fX = -fX; //Reverse X direction to match facing.
}
fX = fX + getentityproperty(self, "x"); //Get X location and add adjustment.
fY = fY + getentityproperty(self, "a"); //Get Y location and add adjustment.
fZ = fZ + getentityproperty(self, "z"); //Get Z location and add adjustment.
vSpawn = spawn(); //Spawn in entity.
changeentityproperty(vSpawn, "position", fX, fZ, fY); //Set spawn location.
changeentityproperty(vSpawn, "direction", iDirection); //Set direction.
return vSpawn; //Return spawn.
}
Anichange
void anichange(void Ani)
{ // Animation changer
void self = getlocalvar("self");
changeentityproperty(self, "animation", openborconstant(Ani)); //Change the animation
}
anyone knows how to make this...
so it can work like
@cmd spawn06 "name" 50 55 1 "ANI_FOLLOW*"