[SCRIPT] removeitem not working for lantern. - 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: [SCRIPT] removeitem not working for lantern. (/thread-16260.html) |
removeitem not working for lantern. - Matt201496 - 06-18-2012 I just want the lantern to be removed from the inventory after changing the map.Tried having just removeitem under void OnStart as well. Thought useing a timer might work , but it doesn't do anything. The only thing that happens is it puts the lantern away, but if i use the debug menu to reload the map it works. //////////////////////////// // Run when the map starts void OnStart() { SetLanternActive(false,true); AddTimer("",1,"RemoveLantern"); AutoSave(); } void RemoveLantern(string &in asTimer) { RemoveItem("lantern"); } RE: removeitem not working for lantern. - DaAinGame - 06-18-2012 Use the level editor name of the lantern, so unless you changed it, it should be "RemoveItem("lantern_1"); I would change the name of the item to something else though to prevent bugs later on if you will allow for a second lantern to be picked up. So rename the first one to something like: "Lantern01" then use RemoveItem("Lantern01"); If you continue to have issues please contact me so I can help! RE: removeitem not working for lantern. - Matt201496 - 06-18-2012 thanks worked perfectly! |