Galactygon Posted December 14, 2016 Share Posted December 14, 2016 (edited) The scripting action AddGlobals() only works for "GLOBAL" variables. This action does nothing for "LOCALS" or "MYAREA" or any other type of variable that is not a "GLOBAL" variable. This example from the IESDP works IF Global("Var1","GLOBAL",0) THEN RESPONSE #100 SetGlobal("Var1","GLOBAL",75) //Var1 = 75 SetGlobal("Var2","GLOBAL",25) //Var2 = 25 AddGlobals("Var1","Var2") //Var1 = 100 END But this does not: IF Global("Var1","LOCALS",0) THEN RESPONSE #100 SetGlobal("Var1","LOCALS",75) //Var1 = 75 SetGlobal("Var2","LOCALS",25) //Var2 = 25 AddGlobals("Var1","Var2") //Var1 will still be set to 75 END Edited December 14, 2016 by Galactygon Quote Link to comment
Fiann of the Silver Hand Posted December 14, 2016 Share Posted December 14, 2016 (edited) So this is like IncrementGlobal but able to use a GLOBAL variable instead of an integer? Edited December 14, 2016 by Fiann of the Silver Hand Quote Link to comment
Avenger Posted December 15, 2016 Share Posted December 15, 2016 So this is like IncrementGlobal but able to use a GLOBAL variable instead of an integer? I don't understand this question. All the involved variables are integer. Quote Link to comment
Ardanis Posted December 15, 2016 Share Posted December 15, 2016 So this is like IncrementGlobal but able to use a GLOBAL variable instead of an integer? Yes. Quote Link to comment
Fiann of the Silver Hand Posted December 16, 2016 Share Posted December 16, 2016 So this is like IncrementGlobal but able to use a GLOBAL variable instead of an integer? I don't understand this question. All the involved variables are integer. Ard got me, but yes, I meant literally "GLOBAL" in the script instead of a fixed modder-written number. Quote Link to comment
Avenger Posted December 19, 2016 Share Posted December 19, 2016 Ah yes. addglobals adds 2 global variables. But you don't have to (and can't) specify the scope (GLOBAL). Quote Link to comment
Recommended Posts
Join the conversation
You are posting as a guest. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.