Frictional Games Forum (read-only)
How do you reset items after death? - Printable Version

+- Frictional Games Forum (read-only) (https://www.frictionalgames.com/forum)
+-- Forum: Amnesia: The Dark Descent (https://www.frictionalgames.com/forum/forum-6.html)
+--- Forum: Custom Stories, TCs & Mods - Development (https://www.frictionalgames.com/forum/forum-38.html)
+---- Forum: Development Support (https://www.frictionalgames.com/forum/forum-39.html)
+---- Thread: How do you reset items after death? (/thread-15935.html)



How do you reset items after death? - GrAVit - 06-07-2012

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
Code:
SetEntityActive("key_study_1", true);
without success so far.

I've managed to reset doors with
Code:
ResetProp("mansion_1")
and monsters with SetEntityActive.

Any help on the matter? I want my key to be active, not set active from an unactive state.


RE: How do you reset items after death? - Traggey - 06-07-2012

Moving thread to development support.


RE: How do you reset items after death? - GrAVit - 06-07-2012

Thought this was in Development Support?

Yeah nevermind, looks like I forgot to post it in the correct sub-forum.


RE: How do you reset items after death? - Rapture - 06-07-2012

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.


RE: How do you reset items after death? - GrAVit - 06-07-2012

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


RE: How do you reset items after death? - Rapture - 06-07-2012

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.


RE: How do you reset items after death? - GrAVit - 06-07-2012

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