Frictional Games Forum (read-only)
Scripting! - 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: Scripting! (/thread-20634.html)



Scripting! - bradders2010 - 03-05-2013

HELP!!! im half way through making my Full conversion and there is a couple of things bugging me! throughout the game you eventually turn the power on in the map. the map where the power switch is i can turn on the lights and thats works. but what about other maps because i go back into the previous maps where the lights arnt lit but i need a script where once the switch is pressed it turns them on no matter what map? PLEASE HELP Smile


RE: Scripting! - NaxEla - 03-05-2013

You can use global variables because they work throughout maps. Try doing something like SetGlobalVarInt("LightsOn", 1). Then when maps load, check whether LightsOn is equal to 1, and if it is, turn the lights on.


RE: Scripting! - bradders2010 - 03-06-2013

(03-05-2013, 07:39 PM)NaxEla Wrote: You can use global variables because they work throughout maps. Try doing something like SetGlobalVarInt("LightsOn", 1). Then when maps load, check whether LightsOn is equal to 1, and if it is, turn the lights on.

Global variables are so confusing!. i dont know what im doing with them, not much info online eitherSad


RE: Scripting! - OriginalUsername - 03-06-2013

It's basically a counter throughout multiple maps. You can like do something in 1 map to add 1 to the globalvarint and let it check the amount you added to do something else in another map.