Posted By: aslan123
how do you remove an wmb entity? - 05/01/07 10:32
ive tried ent_remove(killer.wmb); but i get an error saying parameter unknown keyword killer
can someone help with this simple problem
Posted By: Slin
Re: how do you remove an wmb entity? - 05/01/07 10:38
ent_remove needs a pointer to the entity:
entity* killer_ent;
action killer()
{
killer_ent = me;
}
now you just have to call ent_remove(killer_ent);
Posted By: aslan123
Re: how do you remove an wmb entity? - 05/01/07 10:48
thanks for your reply
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
{
you.LIVES += 1;//add 1 life
you.ACORNS = 0; //reset acorn counter
}
}
ent_remove(my); // remove entity
}
}
}
}
}
//uses: PickUp_Type
Action pick_up
{
my.enable_impact = on;//turn on entity impact
my.event = pick_up_event;//when it happens call the pick_up_events function
}
Posted By: Slin
Re: how do you remove an wmb entity? - 05/01/07 10:51
You have to assign this action to your killer.wmb:
action killer()
{
killer_ent = me;
}
Posted By: bstudio
Re: how do you remove an wmb entity? - 05/01/07 10:52
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);
Posted By: aslan123
Re: how do you remove an wmb entity? - 05/01/07 11: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
action killer
{
killer_ent = my;
if (int(you.ACORNS)== 1)
{
ent_remove(my);
}
my.invisible = on;
my.enable_impact = on;
my.enable_entity = on;
my.event = kill_them;
}
Posted By: mpdeveloper_B
Re: how do you remove an wmb entity? - 05/01/07 14:49
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