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
[SOLVED] Increasing a global variable?
Mudbill Offline
Muderator

Posts: 3,881
Threads: 59
Joined: Apr 2013
Reputation: 179
#5
RE: [SOLVED] Increasing a global variable?

If the "Add" script is lacking, you could always do it with something like this:

PHP Code: (Select All)
cScript_SetGlobalVarInt("LocalVarComputer"cScript_GetGlobalVarInt("LocalVarComputer") + 1

Better yet, if this is something you use a lot, create your own quick function for it:

PHP Code: (Select All)
void cScript_AddGlobalVarInt(string varNameint valueToAdd) {
    
cScript_SetGlobalVarInt(varNamecScript_GetGlobalVarInt(varName) + valueToAdd);


Then you can use the code you originally had by just including this function somewhere in your file (or a global.hps if there is one). I haven't tested any of this in SOMA so it might be preferrably done differently.

(This post was last modified: 04-10-2016, 01:34 PM by Mudbill.)
04-10-2016, 01:29 PM
Find


Messages In This Thread
[SOLVED] Increasing a global variable? - by i3670 - 03-30-2016, 06:56 PM
RE: Static_Objects don't appear?! - by Mudbill - 03-30-2016, 10:02 PM
RE: Static_Objects don't appear?! - by i3670 - 04-03-2016, 11:06 PM
RE: Static_Objects don't appear?! - by i3670 - 04-08-2016, 02:17 PM
RE: [SOLVED] Increasing a global variable? - by Mudbill - 04-10-2016, 01:29 PM



Users browsing this thread: 1 Guest(s)