O Ilusionista
Captain 100K
Guys, I need a help here.
I have a player with two weapons (so it has 3 modes). On a specific level, I set the weapon to 1 and it works.
But if the player is using a map > 2 (3, 4 or 5), I need him to change to weapon 2.
This is working for now, since I force the player to go to a different state,
where I change the weapon
But everything starts to fail once the player dies. On her respawn, the player returns with the first weapon, not the second.
If I put that code on the respawn, it gets ignored (I noticed that you can't change to a different animation while you are in RESPAWN anim, but you can do it while in SPAWN anim).
Even if I try to change the weapon by script, it gets ignored:
Should I use a spawnscript? Or even modelcopyscript?
Edit:
- spawnscript gets ignored
- onmodelcopy crashes the engine
- ondrawscript works, but the entity keeps changing from one weapon to another. If I try to check which weapon I am using, the engine closes saying "Script function 'getentityproperty' returned an exception, check the manual for details."
I have a player with two weapons (so it has 3 modes). On a specific level, I set the weapon to 1 and it works.
But if the player is using a map > 2 (3, 4 or 5), I need him to change to weapon 2.
This is working for now, since I force the player to go to a different state,
Code:
void self = getlocalvar("self");
int Map = getentityproperty(self, "map");
if(Map>2){
performattack(self, openborconstant("ANI_FOLLOW2"));
}
where I change the weapon
weaponframe 0 2
But everything starts to fail once the player dies. On her respawn, the player returns with the first weapon, not the second.
If I put that code on the respawn, it gets ignored (I noticed that you can't change to a different animation while you are in RESPAWN anim, but you can do it while in SPAWN anim).
Even if I try to change the weapon by script, it gets ignored:
Code:
void self = getlocalvar("self");
int Map = getentityproperty(self, "map");
if(Map>2){
changeentityproperty(self, "weapon", 2);
}
Should I use a spawnscript? Or even modelcopyscript?
Edit:
- spawnscript gets ignored
- onmodelcopy crashes the engine
- ondrawscript works, but the entity keeps changing from one weapon to another. If I try to check which weapon I am using, the engine closes saying "Script function 'getentityproperty' returned an exception, check the manual for details."
Code:
ondrawscript @script
void main()
{
void self = getlocalvar("self");
int Map = getentityproperty(self, "map");
int Weap = getentityproperty(self, "weapon");
if(Map>2 && Weap==1){
changeentityproperty(self, "weapon", 2);
}
}@end_script