Scripts / Save and loading scripts

Author
Message
Saintyboy
8
Years of Service
User Offline
Joined: 18th Jun 2015
Playing:
Posted: 6th Jul 2016 00:53
Hi guys,
I want to save and retrieve my own variables but cant locate the lua scripts that save and load variables - any ideas anyone?
smallg
Community Leader
18
Years of Service
User Offline
Joined: 8th Dec 2005
Location:
Posted: 6th Jul 2016 10:08
Its in the titlesbank folder under default.
Basically loads any (non array) variable with g_ in front of it
lua guide for GG
https://steamcommunity.com/sharedfiles/filedetails/?id=398177770
windows 10
i5 @4ghz, 8gb ram, AMD R9 200 series , directx 11
Belidos
3D Media Maker
8
Years of Service
User Offline
Joined: 23rd Nov 2015
Playing: The Game
Posted: 6th Jul 2016 10:24 Edited at: 6th Jul 2016 10:25
Yup as Smallg said, for basic variables you don't need to edit the save/load scripts.

All you do is add g_ to the variable names.

For example if you had the following script:



To get the spoken variable to save, just change it to:



I think that's right

i5, NV960 2GB, 16GB memory, 2x 2TB Hybrid, Win10.
i3 , Intel integrated graphics, 6GB memory, 512GB Generic SATAIII Win8.1.
Intel Celeron (duel Core), Radeon integrated graphics, 4GB memory, 180gB Generic SATAII, WinVista.
Q6600, Intel integrated graphics, 8GB memory, 512GB Generic SATAII, Win7.
Saintyboy
8
Years of Service
User Offline
Joined: 18th Jun 2015
Playing:
Posted: 7th Jul 2016 01:15
Ah thanks guys - I have been using the prefix 'g_' to define my global variables! What do we use to define global Variables then?
smallg
Community Leader
18
Years of Service
User Offline
Joined: 8th Dec 2005
Location:
Posted: 7th Jul 2016 12:49
nothing, variables are automatically global unless you put local in front of them - in which case they become used only in that script

i.e.
health = 100
means the variable 'health' can be used and adjusted in any script (and it will automatically adjust all the others)
but
local health = 100
means health can only be called and adjusted in that 1 script and if you try to use it in another script it will return a nil error
lua guide for GG
https://steamcommunity.com/sharedfiles/filedetails/?id=398177770
windows 10
i5 @4ghz, 8gb ram, AMD R9 200 series , directx 11

Login to post a reply

Server time is: 2024-05-04 13:31:40
Your offset time is: 2024-05-04 13:31:40