Local variables in drag-and-drop scripting

krainert

Member
Reaction score
10
Greetings,

What is the best way to use local variables in drag-and-drop (or, misleadingly, "GUI") scripting?
In this particular case I need to simulate arguments (considering Triggers as functions/methods). My strategy is basically to set a regular global variable for each argument before running the method-like Trigger and setting local variables based on these at the beginning of the scripts of that Trigger so that global variables are only relied on during the call (and thus not exposed) and then replaced by local variables used throughout the "method".

And no, I'm too much of a persistent slacker to start writing JASS (again).

Thanks, much.
 

Komaqtion

You can change this now in User CP.
Reaction score
469
I'd say that's the best option if you're too "lazy" to just learn JASS !
EGUI will let you use JASS in most regular GUI actions and conditions and such though ;)
 

krainert

Member
Reaction score
10
I'll look into EGUI.

its seems you're pretty knowledgeable in programming..
my advice is that you should learn vJASS a.s.a.p.
Argh, the JASS fans, they're all over me! Get 'em off, GET 'EM OFF!

...

Anyway, you're right, if I was to produce endless amounts of vast W3 maps I might just benefit from learning and consequently writing JASS. However, I'm currently working on my presumably last map for the game which is, in turn, slightly more complex than my previous endeavors - which means I'd rather do some more creative Triggers and work around JASS to save the effort of learning it in practice.

Thanks.
 

krainert

Member
Reaction score
10
I tried following this guide to EGUI, but I'm not entirely sure I understand the following:
Check that you have no WEU functions. If you do, remove them. WEU is broke.
What does WEU refer to? World Editor Upsala?

Anyhow, I don't see any methods defining local variables. How do they work in EGUI?

Thanks again.
 

Galdiuz

Creator of Photon Command
Reaction score
98
WEU is a modification to the World Editor. The full name is World Editor Unlimited. It's outdated though, so most of it's functions does not work.

Also, try not to doublepost. There's an edit button.
 

Lehona

New Member
Reaction score
12
Waiting here for an answer or even trying to do complex things without the use of JASS takes mostly more time than just learning (v)Jass. Noone wants you to be a master of it, but especially if you already know something about programming it's very easy and fast to learn.
 

krainert

Member
Reaction score
10
WEU is a modification to the World Editor. The full name is World Editor Unlimited. It's outdated though, so most of it's functions does not work.
Also, try not to doublepost. There's an edit button.
Right, thanks. Also, I merely doubleposted to let you know of the progress.

Waiting here for an answer or even trying to do complex things without the use of JASS takes mostly more time than just learning (v)Jass. Noone wants you to be a master of it, but especially if you already know something about programming it's very easy and fast to learn.
The problem isn't learning Jass (which I already have), it's figuring out Blizzard's class library, and for just one project (with this being the only case I can think of actually requiring more than the drag-and-drop system delivers) searching through whatever documentation is written for W3 seems a bit excessive.

Also, why is handling local variables a complex thing?
 

krainert

Member
Reaction score
10
Get NewGen and use the jass filler thing.
I've been trying to figure stuff out on my own for quite a while now, but I just can't find anything about a "JASS filler" or any other means of actually using custom variables anywhere. Help? :)
 

azareus

And you know it.
Reaction score
63
You could use custom script where you need the locals.
But i'm pretty sure there was something like:
Trigger:
  • Unit - Kill (Jass(u))

I can't find it again though.
 

tooltiperror

Super Moderator
Reaction score
231
Or just actually learn JASS instead of tons of work arounds.
 

krainert

Member
Reaction score
10
Thanks for the fast replies.

To summarize: I'm using NewGen World Editor with EGUI for patched W3:TFT.

Frankly, I'm going to need local variables pretty much everywhere so a way of accessing them (not necessarily declaring or mutating them) through "GUI" is pretty much essential. If I'm not mistaken, it's fairly simple to extend the "GUI" library with new JASS based functions - right? In that case, would adding support for local variables myself be hard to accomplish?

And yet again, I know using JASS would be easier (and probably better, if we're nitpicking) in the long run, but this is a one-map career.
 

Accname

2D-Graphics enthusiast
Reaction score
1,464
i have another question. i am working with the editor now for a pretty long time and i made big complicated and nice projects as well (as far as i can say) with normal standard GUI (not even EGUI or such) and never needed any local variables.
So why do you long for them so much that you couldnt work without?
It aint that terrible.
 

krainert

Member
Reaction score
10
i have another question. i am working with the editor now for a pretty long time and i made big complicated and nice projects as well (as far as i can say) with normal standard GUI (not even EGUI or such) and never needed any local variables.
So why do you long for them so much that you couldnt work without?
It aint that terrible.
At first I thought that too, "hey, local variables just make things simpler - there's nothing that can be done with them that can't be done with lots and lots of constants!" - wrong. Often, you can set constants for temporary storage, but Triggers in W3/WE work as threads in programming; you have to make sure that every cross-reference is thread-safe, or the world will end (more or less). As long as you don't pause your scripts, you should be good, but I am currently facing Triggers that need pausing while storing data, and that just cannot be done safely without Trigger specific variables since I have no way of ensuring that whatever global variable I'm using inside a trigger won't be mutated during waiting by another running instance of the Trigger.
Anyway, the bottom line is, not everything can be done with global variables when your Triggers don't run uninterrupted.

EDIT:
Oh, and I'd still really love to hear from anyone knowing of any way to access local variables using "GUI". How about that "JASS filler" whatever-it-is?
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Members online

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top