Frictional Games Forum (read-only)

Full Version: Erase entity ? Is possible ?
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
I got a key on my cs that jumps in a loop (PropImpulse y=9)
until player picks it up.

but i found out that player may block the key, ruining the loop and losing the key forever.

so i'm thinking about creating the key on the initial area and erasing the previous pushed key no matter where it is.
but i can't find any function that deletes the object.

any ideas?
SetEntityActive("Entityname", false);
it just disables it, i'll end up with 999 disabled keys if player lets it loop for a while

also the keys will get the same name, making hard to reference to the current key
Go into the modeleditor. Open the Key, save it as "Key_Jumping" or something. Remove player collision on the body of the key.

Place that key in your map. Works.. Hopefully?

Edit: You might want to remove all collision (so the player doesn't toss something at it). If it's the case that the player can't pick it up with collision removed; create a scriptarea at the location of the key. Enable interaction with that area. Interaction = get key & remove interaction possibilites with area.
(12-24-2012, 12:44 AM)Acies Wrote: [ -> ]Go into the modeleditor. Open the Key, save it as "Key_Jumping" or something. Remove player collision on the body of the key.

Place that key in your map. Works.. Hopefully?

Edit: You might want to remove all collision (so the player doesn't toss something at it). If it's the case that the player can't pick it up with collision removed; create a scriptarea at the location of the key. Enable interaction with that area. Interaction = get key & remove interaction possibilites with area.

Thank you, that's a good idea.

but the key falls to the void when i remove it's collision with other objects.


i guess i could check whether the key returned properly to his initial area or not. if fails to return, i just force the player to get the key, maybe put it on a visible area on the floor, easy to find.
Does this work with items?

ResetProp(string& asName);
(12-24-2012, 06:04 AM)Rapture Wrote: [ -> ]Does this work with items?

ResetProp(string& asName);

Actually, that solved everything and saved me a lot of work Rapture.
good job. thank u all

(i just reset the key every loop, avoiding any player intervation that may lose/bug the item)