Spawn Entity that checks player's Rush_Count

Aerisetta

Active member
Hello

I am making an entity that will spawn as a "combo finisher" and the finisher that comes out will be based on the current RUSH_COUNT of the player who spawned it

The below code works if it is in the attack animation of the player, however I need the entity to get the player and check the RUSH_COUNT of the player. My game only has 1 player. NOTE the player does not spawn this, the enemy that is getting hit does.

Can someone help me?

EDIT: Actually the enemy spawns this, so actually it needs to find the player, not whoever spawned it

Code:
anim    idle
@script
  if(frame==0){
    void self = getlocalvar("self");
    int hits = getentityproperty(self, "rush_count");
   


    if(hits >= 30){
      performattack(self, openborconstant("ANI_FOLLOW50"));
        } else if(hits >= 25){
      performattack(self, openborconstant("ANI_FOLLOW50"));
        } else if(hits >= 20){
      performattack(self, openborconstant("ANI_FOLLOW50"));
        } else if(hits >= 15){
      performattack(self, openborconstant("ANI_FOLLOW50"));
        } else if(hits >= 12){
      performattack(self, openborconstant("ANI_FOLLOW50"));
        } else if(hits >= 9){
      performattack(self, openborconstant("ANI_FOLLOW40"));
        } else if(hits >= 6){
      performattack(self, openborconstant("ANI_FOLLOW30"));
        } else if(hits >= 3){
      performattack(self, openborconstant("ANI_FOLLOW20"));
        } else if(hits == 0){
      performattack(self, openborconstant("ANI_FOLLOW10"));
        }
    }
@end_script
 
Last edited:
Solution
I think i solved it :)

Code:
anim    idle
@script
  if(frame==2){
    int iPlIndex = getlocalvar("player"); //Get calling player
    void vSelf = getplayerproperty(iPlIndex , "entity"); //Get calling entity
    int hits = getentityproperty(vSelf, "rush_count");
    

    void self = getlocalvar("self"); //Get calling entity
    if(hits >= 30){
      performattack(self, openborconstant("ANI_FOLLOW50"));
        } else if(hits >= 25){
      performattack(self, openborconstant("ANI_FOLLOW50"));
        } else if(hits >= 20){
      performattack(self, openborconstant("ANI_FOLLOW50"));
        } else if(hits >= 15){
      performattack(self, openborconstant("ANI_FOLLOW50"));
        } else if(hits >= 12){
      performattack(self...
I thought the below would work
int hits = getplayerproperty(0, "rush_count");

but it says

Player property name 'rush_count' is not supported yet.

Available properties:

colourmap
combokey
combostep
credits
disablekeys
ent
entity
hasplayed
hmapl
hmapu
inputtime
joining
keys
lives
mapcount
name
newkeys
numweapons
playkeys
releasekeys
score
spawnhealth
spawnmp
weapnum
weapon
common_think
player_think
steam_think
steamer_think
text_think
trap_think
Code:
anim    idle
@script
  if(frame==2){
    void self = getlocalvar("self"); //Get calling entity
    int hits = getplayerproperty(0, "rush_count");
   


    if(hits >= 30){
      performattack(self, openborconstant("ANI_FOLLOW50"));
        } else if(hits >= 25){
      performattack(self, openborconstant("ANI_FOLLOW50"));
        } else if(hits >= 20){
      performattack(self, openborconstant("ANI_FOLLOW50"));
        } else if(hits >= 15){
      performattack(self, openborconstant("ANI_FOLLOW50"));
        } else if(hits >= 12){
      performattack(self, openborconstant("ANI_FOLLOW50"));
        } else if(hits >= 9){
      performattack(self, openborconstant("ANI_FOLLOW40"));
        } else if(hits >= 6){
      performattack(self, openborconstant("ANI_FOLLOW30"));
        } else if(hits >= 3){
      performattack(self, openborconstant("ANI_FOLLOW20"));
        } else if(hits == 0){
      performattack(self, openborconstant("ANI_FOLLOW10"));
        }
    }
@end_script
 
I think i solved it :)

Code:
anim    idle
@script
  if(frame==2){
    int iPlIndex = getlocalvar("player"); //Get calling player
    void vSelf = getplayerproperty(iPlIndex , "entity"); //Get calling entity
    int hits = getentityproperty(vSelf, "rush_count");
    

    void self = getlocalvar("self"); //Get calling entity
    if(hits >= 30){
      performattack(self, openborconstant("ANI_FOLLOW50"));
        } else if(hits >= 25){
      performattack(self, openborconstant("ANI_FOLLOW50"));
        } else if(hits >= 20){
      performattack(self, openborconstant("ANI_FOLLOW50"));
        } else if(hits >= 15){
      performattack(self, openborconstant("ANI_FOLLOW50"));
        } else if(hits >= 12){
      performattack(self, openborconstant("ANI_FOLLOW50"));
        } else if(hits >= 9){
      performattack(self, openborconstant("ANI_FOLLOW40"));
        } else if(hits >= 6){
      performattack(self, openborconstant("ANI_FOLLOW30"));
        } else if(hits >= 3){
      performattack(self, openborconstant("ANI_FOLLOW20"));
        } else if(hits >= 0){
      performattack(self, openborconstant("ANI_FOLLOW10"));
        }
    }
@end_script
 
Solution
Back
Top Bottom