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.
 
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 ;)
 
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.
 
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.
 
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.
 
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.
 
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?
 
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? :)
 
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.
 
Or just actually learn JASS instead of tons of work arounds.
 
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.
 
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.
 
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
  • The Helper The Helper:
    News portal has been retired. Main page of site goes to Headline News forum now
  • The Helper The Helper:
    I am working on getting access to the old news portal under a different URL for those that would rather use that for news before we get a different news view.
  • Ghan Ghan:
    Easily done
    +1
  • The Helper The Helper:
    https://www.thehelper.net/pages/news/ is a link to the old news portal - i will integrate it into the interface somewhere when i figure it out
  • Ghan Ghan:
    Need to try something
  • Ghan Ghan:
    Hopefully this won't cause problems.
  • Ghan Ghan:
    Hmm
  • Ghan Ghan:
    I have converted the Headline News forum to an Article type forum. It will now show the top 20 threads with more detail of each thread.
  • Ghan Ghan:
    See how we like that.
  • The Helper The Helper:
    I do not see a way to go past the 1st page of posts on the forum though
  • The Helper The Helper:
    It is OK though for the main page to open up on the forum in the view it was before. As long as the portal has its own URL so it can be viewed that way I do want to try it as a regular forum view for a while
  • Ghan Ghan:
    Yeah I'm not sure what the deal is with the pagination.
  • Ghan Ghan:
    It SHOULD be there so I think it might just be an artifact of having an older style.
  • Ghan Ghan:
    I switched it to a "Standard" article forum. This will show the thread list like normal, but the threads themselves will have the first post set up above the rest of the "comments"
  • The Helper The Helper:
    I don't really get that article forum but I think it is because I have never really seen it used on a multi post thread
  • Ghan Ghan:
    RpNation makes more use of it right now as an example: https://www.rpnation.com/news/
  • The Helper The Helper:
  • The Helper The Helper:
    What do you think Tom?
  • tom_mai78101 tom_mai78101:
    I will have to get used to this.
  • tom_mai78101 tom_mai78101:
    The latest news feed looks good
  • The Helper The Helper:
    I would like to see it again like Ghan had it the first time with pagination though - without the pagination that view will not work but with pagination it just might...
  • The Helper The Helper:
    This drink recipe I have had more than a few times back in the day! Mind Eraser https://www.thehelper.net/threads/cocktail-mind-eraser.194720/

      The Helper Discord

      Staff online

      Members online

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top