Gamestudio Links
Zorro Links
Newest Posts
Change chart colours
by 7th_zorro. 05/11/24 09:25
Data from CSV not parsed correctly
by dr_panther. 05/06/24 18:50
Help with plotting multiple ZigZag
by degenerate_762. 04/30/24 23:23
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
2 registered members (AndrewAMD, 1 invisible), 1,086 guests, and 5 spiders.
Key: Admin, Global Mod, Mod
Newest Members
firatv, wandaluciaia, Mega_Rod, EternallyCurious, howardR
19050 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
how do you remove an wmb entity? #127504
05/01/07 10:32
05/01/07 10:32
Joined: Oct 2005
Posts: 42
A
aslan123 Offline OP
Newbie
aslan123  Offline OP
Newbie
A

Joined: Oct 2005
Posts: 42
ive tried ent_remove(killer.wmb); but i get an error saying parameter unknown keyword killer

can someone help with this simple problem

Re: how do you remove an wmb entity? [Re: aslan123] #127505
05/01/07 10:38
05/01/07 10:38
Joined: May 2005
Posts: 2,713
Lübeck
Slin Offline
Expert
Slin  Offline
Expert

Joined: May 2005
Posts: 2,713
Lübeck
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);

Re: how do you remove an wmb entity? [Re: Slin] #127506
05/01/07 10:48
05/01/07 10:48
Joined: Oct 2005
Posts: 42
A
aslan123 Offline OP
Newbie
aslan123  Offline OP
Newbie
A

Joined: Oct 2005
Posts: 42
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
}

Re: how do you remove an wmb entity? [Re: aslan123] #127507
05/01/07 10:51
05/01/07 10:51
Joined: May 2005
Posts: 2,713
Lübeck
Slin Offline
Expert
Slin  Offline
Expert

Joined: May 2005
Posts: 2,713
Lübeck
You have to assign this action to your killer.wmb:
action killer()
{
killer_ent = me;
}

Re: how do you remove an wmb entity? [Re: aslan123] #127508
05/01/07 10:52
05/01/07 10:52
Joined: Aug 2006
Posts: 652
Netherlands
bstudio Offline
User
bstudio  Offline
User

Joined: Aug 2006
Posts: 652
Netherlands
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/07 11:11
05/01/07 11:11
Joined: Oct 2005
Posts: 42
A
aslan123 Offline OP
Newbie
aslan123  Offline OP
Newbie
A

Joined: Oct 2005
Posts: 42
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;

}

Re: how do you remove an wmb entity? [Re: aslan123] #127510
05/01/07 14:49
05/01/07 14:49
Joined: Feb 2006
Posts: 2,185
mpdeveloper_B Offline
Expert
mpdeveloper_B  Offline
Expert

Joined: Feb 2006
Posts: 2,185
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


- aka Manslayer101

Moderated by  HeelX, Lukas, rayp, Rei_Ayanami, Superku, Tobias, TWO, VeT 

Gamestudio download | chip programmers | Zorro platform | shop | Data Protection Policy

oP group Germany GmbH | Birkenstr. 25-27 | 63549 Ronneburg / Germany | info (at) opgroup.de

Powered by UBB.threads™ PHP Forum Software 7.7.1