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,463
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.
  • Ghan Ghan:
    Howdy
  • Ghan Ghan:
    Still lurking
    +3
  • The Helper The Helper:
    I am great and it is fantastic to see you my friend!
    +1
  • The Helper The Helper:
    If you are new to the site please check out the Recipe and Food Forum https://www.thehelper.net/forums/recipes-and-food.220/
  • Monovertex Monovertex:
    How come you're so into recipes lately? Never saw this much interest in this topic in the old days of TH.net
  • Monovertex Monovertex:
    Hmm, how do I change my signature?
  • tom_mai78101 tom_mai78101:
    Signatures can be edit in your account profile. As for the old stuffs, I'm thinking it's because Blizzard is now under Microsoft, and because of Microsoft Xbox going the way it is, it's dreadful.
  • The Helper The Helper:
    I am not big on the recipes I am just promoting them - I use the site as a practice place promoting stuff
    +2
  • Monovertex Monovertex:
    @tom_mai78101 I must be blind. If I go on my profile I don't see any area to edit the signature; If I go to account details (settings) I don't see any signature area either.
  • The Helper The Helper:
    You can get there if you click the bell icon (alerts) and choose preferences from the bottom, signature will be in the menu on the left there https://www.thehelper.net/account/preferences
  • The Helper The Helper:
    I think I need to split the Sci/Tech news forum into 2 one for Science and one for Tech but I am hating all the moving of posts I would have to do
  • The Helper The Helper:
    What is up Old Mountain Shadow?
  • The Helper The Helper:
    Happy Thursday!
    +1
  • Varine Varine:
    Crazy how much 3d printing has come in the last few years. Sad that it's not as easily modifiable though
  • Varine Varine:
    I bought an Ender 3 during the pandemic and tinkered with it all the time. Just bought a Sovol, not as easy. I'm trying to make it use a different nozzle because I have a fuck ton of Volcanos, and they use what is basically a modified volcano that is just a smidge longer, and almost every part on this thing needs to be redone to make it work
  • Varine Varine:
    Luckily I have a 3d printer for that, I guess. But it's ridiculous. The regular volcanos are 21mm, these Sovol versions are about 23.5mm
  • Varine Varine:
    So, 2.5mm longer. But the thing that measures the bed is about 1.5mm above the nozzle, so if I swap it with a volcano then I'm 1mm behind it. So cool, new bracket to swap that, but THEN the fan shroud to direct air at the part is ALSO going to be .5mm to low, and so I need to redo that, but by doing that it is a little bit off where it should be blowing and it's throwing it at the heating block instead of the part, and fuck man
  • Varine Varine:
    I didn't realize they designed this entire thing to NOT be modded. I would have just got a fucking Bambu if I knew that, the whole point was I could fuck with this. And no one else makes shit for Sovol so I have to go through them, and they have... interesting pricing models. So I have a new extruder altogether that I'm taking apart and going to just design a whole new one to use my nozzles. Dumb design.
  • Varine Varine:
    Can't just buy a new heatblock, you need to get a whole hotend - so block, heater cartridge, thermistor, heatbreak, and nozzle. And they put this fucking paste in there so I can't take the thermistor or cartridge out with any ease, that's 30 dollars. Or you can get the whole extrudor with the direct driver AND that heatblock for like 50, but you still can't get any of it to come apart
  • Varine Varine:
    Partsbuilt has individual parts I found but they're expensive. I think I can get bits swapped around and make this work with generic shit though
  • Ghan Ghan:
    Heard Houston got hit pretty bad by storms last night. Hope all is well with TH.
  • The Helper The Helper:
    Power back on finally - all is good here no damage
    +2
  • V-SNES V-SNES:
    Happy Friday!
    +1

      The Helper Discord

      Members online

      No members online now.

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top