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
Global variables in SOMA
Abion47 Offline
Senior Member

Posts: 369
Threads: 22
Joined: Oct 2015
Reputation: 46
#5
RE: Global variables in SOMA

Types that aren't one of the above types would be reference types, which would be awkward to handle as a global variable. The thing about reference types is that their state doesn't get saved when the map saves, and when a script loads that contains a reference type variable at the class level or higher without the "[nosave]" tag, it can cause the game to silently crash.

You can create a module that will act as an intermediary to store the values that you want (and get global variable behavior that way), but it wouldn't solve the saving/loading issue. You would have to save the fields within the object as primitives and regenerate the object when the map starts up again, which defeats the purpose of having objects in the first place.
07-11-2016, 03:28 AM
Find


Messages In This Thread
Global variables in SOMA - by Daemian - 07-10-2016, 11:36 PM
RE: Global variables in SOMA - by Abion47 - 07-10-2016, 11:49 PM
RE: Global variables in SOMA - by Daemian - 07-10-2016, 11:55 PM
RE: Global variables in SOMA - by Daemian - 07-11-2016, 02:50 AM
RE: Global variables in SOMA - by Abion47 - 07-11-2016, 03:28 AM
RE: Global variables in SOMA - by Daemian - 07-11-2016, 05:24 AM



Users browsing this thread: 1 Guest(s)