what im trying to do is when i have collected a certain number of acorns the lazers blocking entry to level 2 will disappear. the entity is called killer.wmb it wont disappear can u help
here is the code below
entity* killer_ent;
DEFINE PickUp_Type,skill1; // 1=HEALTH, 2=ACORNS,
Function pick_up_event() { if(EVENT_TYPE == event_impact)//if the player walks into the entity then .......
{ if (int(you.ACORNS) == 1) { ent_remove(killer_ent);
}
if (my.pickup_type == 1) // HEALTH pickup { If ( int(you.HEALTH_MAX) < 100) // if my MAX_HEALTH is less than a 100
{ if ( int(you.HEALTH) + 20 > 100) // if i add 75 to your health and it goes over 100 then just give me 100 { you.HEALTH = 100; //then i am fully healed } else /// just add 75 to the HEALTH if it is below 24 { you.HEALTH += 20; } ent_remove(my); //remove entity } }
else{
if (my.pickup_type == 2) // ACORNS pickup { If ( int(you.ACORNS_MAX) < 100) // if mer MAX_ACORNS is less than a 100
{ if ( int(you.ACORNS) + 1 > 100) // if by adding 1 acorn brings it to over 100 just give me 100 { you.ACORNS = 100; //then me have full ACORNS } else // just add 1 { you.ACORNS += 1; if (int(you.ACORNS) > 99)//if acorns is greater than 99 {
first create it with ent_create, like this: entity* killer_ent; killer_ent = ent_create("killer.wmb",vector with position,the function for your entity);
BASIC programmers never die, they GOSUB and don't RETURN.
Re: how do you remove an wmb entity?
[Re: bstudio]
#127509 05/01/0711:1105/01/0711:11
okay here is my action killer script when my acorns = 1; i want the killer_ent to be removed i get an empty pointer error for the line (int(you.acorns)==1); why is this i dont get this error in my pickup script
ok, save killer.wmp, and build it as a map entity, then, in your level, add killer.wmp, then attach the action "killer" to it while you're in wed, it's the only way to move map stuff, is make it a map entity