Facebook Twitter YouTube Frictional Games | Forum | Privacy Policy | Dev Blog | Dev Wiki | Support | Gametee


Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Erase entity ? Is possible ?
Daemian Offline
Posting Freak

Posts: 1,129
Threads: 42
Joined: Dec 2012
Reputation: 49
#1
Erase entity ? Is possible ?

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?

(This post was last modified: 12-24-2012, 06:36 AM by Daemian.)
12-24-2012, 12:03 AM
Find
Obliviator27 Offline
Posting Freak

Posts: 792
Threads: 10
Joined: Jul 2011
Reputation: 66
#2
RE: Erase entity ? Is possible ?

SetEntityActive("Entityname", false);

12-24-2012, 12:06 AM
Find
Daemian Offline
Posting Freak

Posts: 1,129
Threads: 42
Joined: Dec 2012
Reputation: 49
#3
RE: Erase entity ? Is possible ?

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

(This post was last modified: 12-24-2012, 12:28 AM by Daemian.)
12-24-2012, 12:27 AM
Find
Acies Offline
Posting Freak

Posts: 1,643
Threads: 60
Joined: Feb 2011
Reputation: 73
#4
RE: Erase entity ? Is possible ?

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.

[Image: mZiYnxe.png]


(This post was last modified: 12-24-2012, 12:46 AM by Acies.)
12-24-2012, 12:44 AM
Find
Daemian Offline
Posting Freak

Posts: 1,129
Threads: 42
Joined: Dec 2012
Reputation: 49
#5
RE: Erase entity ? Is possible ?

(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.

12-24-2012, 01:43 AM
Find
Rapture Offline
Posting Freak

Posts: 1,078
Threads: 79
Joined: May 2011
Reputation: 30
#6
RE: Erase entity ? Is possible ?

Does this work with items?

ResetProp(string& asName);
(This post was last modified: 12-24-2012, 06:04 AM by Rapture.)
12-24-2012, 06:04 AM
Find
Daemian Offline
Posting Freak

Posts: 1,129
Threads: 42
Joined: Dec 2012
Reputation: 49
#7
RE: Erase entity ? Is possible ?

(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)

12-24-2012, 06:36 AM
Find




Users browsing this thread: 1 Guest(s)