Page 1 of 1

Global Variables in Trys?

Posted: Thu Jan 09, 2014 4:20 pm
by [][][][]
Okay, so I'm making a Try (don't ask), and of course there's the main boss who uses Global Variables to 'signal' the Try to spawn a specific drone.

Problem is, how does someone set up the 'receiving' of Global Variables?

Re: Global Variables in Trys?

Posted: Thu Jan 09, 2014 4:36 pm
by [][][][]
... Fair enough.

But then loops wouldn't know if it's already in a different phase (drones only spawn in phase 1 of 4 or 5)...
Loops within a continuous environment that can do, though.

But still, any detection for global variables?

Re: Global Variables in Trys?

Posted: Thu Jan 09, 2014 4:45 pm
by [][][][]
Lol seriously though I was referring to the Try itself and the code to receive GVars.

and yes, I'm a total noob at Trys, so what

Re: Global Variables in Trys?

Posted: Thu Jan 09, 2014 5:54 pm
by [][][][]
okay, so I did.
But then it doesn't work.
Am I mislabeling the variable?
Or it can't detect changes made by the boss toward the variable?
Or something else?

Re: Global Variables in Trys?

Posted: Thu Jan 09, 2014 8:48 pm
by AlexMdle
fraxy supports parallel execution of code now.

Set it to trigger the variable on demand then reset it when done.

Re: Global Variables in Trys?

Posted: Fri Jan 10, 2014 12:14 am
by Ex-Rumia
Liiiiiiiiiiiiiiiiiike this!

"REPEAT", -1

"IF",_global1=1
_global1=0
"GETINFO",12,varID,varx
"GETINFO",13,varID,vary
"GETINFO",14,varID,varangle
"CREATE2","Testarea2/PlasmacasterR.fed", varangle, varx, vary, 100, 0
"GETINFO",12,varID2,varx2
"GETINFO",13,varID2,vary2
"GETINFO",14,varID2,varangle2
"CREATE2","Testarea2/PlasmacasterL.fed",varangle2, varx2, vary2, 100, 0
"ENDIF"

"LOOP"

It'll keep looking for the condition to activate the global var, then when it hits it, it will activate, it'll set that global variable back, do its thing, then keep going.

Re: Global Variables in Trys?

Posted: Fri Jan 10, 2014 9:41 am
by [][][][]
Thanks, Rumia.
Triggers work... but how does one adjust drone spawn position with that code?

Re: Global Variables in Trys?

Posted: Fri Jan 10, 2014 10:20 am
by Ex-Rumia
Oh right, check out the readme try ENG version, I have that as part of a big core boss, so it would kinda only make sense if you saw the entire thing. Sorry.

Where the VarX is on the create area, you'd put your X Value there, same with Y and Angle. You can copy all of that, then delete all the Getinfo things and you'll have a Global variable trigger. Note, if you want other triggers, put them before the "Loop"