GrAVit
Senior Member
Posts: 580
Threads: 15
Joined: Oct 2011
Reputation:
22
|
How do you reset items after death?
Hey, I'm trying to figure out how to reset items after you die. I have a checkpoint set up, and I'm trying to use
SetEntityActive("key_study_1", true);
without success so far.
I've managed to reset doors with and monsters with SetEntityActive.
Any help on the matter? I want my key to be active, not set active from an unactive state.
|
|
06-07-2012, 02:36 PM |
|
Traggey
is mildly amused
Posts: 3,257
Threads: 74
Joined: Feb 2012
Reputation:
185
|
RE: How do you reset items after death?
Moving thread to development support.
|
|
06-07-2012, 03:01 PM |
|
GrAVit
Senior Member
Posts: 580
Threads: 15
Joined: Oct 2011
Reputation:
22
|
RE: How do you reset items after death?
Thought this was in Development Support?
Yeah nevermind, looks like I forgot to post it in the correct sub-forum.
(This post was last modified: 06-07-2012, 03:03 PM by GrAVit.)
|
|
06-07-2012, 03:02 PM |
|
Rapture
Posting Freak
Posts: 1,078
Threads: 79
Joined: May 2011
Reputation:
30
|
RE: How do you reset items after death?
For the "CheckPoint (string& asName, string& asStartPos, string& asCallback, string& asDeathHintCat, string& asDeathHintEntry);" --- When it calls the function on death/respawn, have it do some bool checks.
Try a "bool HasItem(string& asName);" --- If false, give the specific item you want. If they already have it, do nothing.
Hope that helps.
|
|
06-07-2012, 03:06 PM |
|
GrAVit
Senior Member
Posts: 580
Threads: 15
Joined: Oct 2011
Reputation:
22
|
RE: How do you reset items after death?
(06-07-2012, 03:06 PM)Rapture Wrote: For the "CheckPoint (string& asName, string& asStartPos, string& asCallback, string& asDeathHintCat, string& asDeathHintEntry);" --- When it calls the function on death/respawn, have it do some bool checks.
Try a "bool HasItem(string& asName);" --- If false, give the specific item you want. If they already have it, do nothing.
Hope that helps. Yeah but I'd like the item to reset on the map, like I never even picked it up. The danger of death appears only after one picks up the key. I know how to get rid of it in the inventory aswell.
(This post was last modified: 06-07-2012, 03:09 PM by GrAVit.)
|
|
06-07-2012, 03:08 PM |
|
Rapture
Posting Freak
Posts: 1,078
Threads: 79
Joined: May 2011
Reputation:
30
|
RE: How do you reset items after death?
Oh, I misunderstood.
The "ResetProp(string& asName);" should work for the key right?
And if you picked the Key up, just do a bool again and check for it in your Inventory and remove it if its true.
|
|
06-07-2012, 03:20 PM |
|
GrAVit
Senior Member
Posts: 580
Threads: 15
Joined: Oct 2011
Reputation:
22
|
RE: How do you reset items after death?
(06-07-2012, 03:20 PM)Rapture Wrote: Oh, I misunderstood.
The "ResetProp(string& asName);" should work for the key right?
And if you picked the Key up, just do a bool again and check for it in your Inventory and remove it if its true. Nah, ResetProp doesn't work for items.
|
|
06-07-2012, 03:21 PM |
|
|