• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

I Keep Hitting the OP Limit!!

Status
Not open for further replies.
Level 17
Joined
Apr 27, 2008
Messages
2,455
Thats not what I meant.

Even if you use GUI variables, variables can have no initial value.

Take groups for example. If your initial value is "null" and you try to destroy or enum something with the group in the variable (which does not exist at this moment), the trigger will stop running.

Nope, as said GUI global variables always have a value, check the map script if you want.
But yes the "default" value (the one in the variable editor) is applied only on the main function, through InitGlobals calling or a function name like that, no matter if it could be done before or not (constant value).
And as far i know it won't crash the thread if you use a native function with a null/invalid argument, excepted maybe few of them.

Anyway, i'm just saying if for the sake of accuracy.
 

Zwiebelchen

Hosted Project GR
Level 35
Joined
Sep 17, 2009
Messages
7,236
And as far i know it won't crash the thread if you use a native function with a null/invalid argument, excepted maybe few of them.
I'm pretty sure it does. Actually, a LOT of natives crash if you use incorrect input values. Enuming is one of them, I'm pretty sure about that.

Double frees are also well-known for crashing a thread.
 
Level 17
Joined
Apr 27, 2008
Messages
2,455
I don't think it's "lot of" really, must likely few or maybe even none, but frankly i won't test it, i'm just quite sure that jass include many internal safety checks for native functions.
Hell, instead of some constants you can even just use 'null' instead.
I don't know about double free, i suppose you're right, i've never really "used" them.
Anf ofc it will crash the thread if you use a not initialized variable, but that's not the same thing.
 
Level 8
Joined
Jul 18, 2010
Messages
332
Should I just close the thread from here.

@Zweibelchan Yeah, I know that. I don't know how to minimize my triggers because they're too many and too long systems that's why I just decided to split them all including the variables. That's probably the reason why it's so messy. I'm still struggling with that.

And I created like 3 arguments in this thread that's why it reached the 7th page so sorry about that.

Regarding my problem, I'll just try again all your suggestions and then find the solution by myself. I've gotten alot of answers so this thread should be semi-solved already.

And in the case of converting to vJASS, I'll probably do that if I make a new map. I can't make it work in my map b4 so I gave up on doing that.
 
Level 14
Joined
Jun 27, 2008
Messages
1,325
And in the case of converting to vJASS, I'll probably do that if I make a new map. I can't make it work in my map b4 so I gave up on doing that.

no need to convert it to vjass, just learn efficient gui coding and you can get rid of 95% of your code. Learning efficient gui never a waste of time, the same mechanics it uses apply to vJass aswell, so the better you know gui, the faster you learn vJass eventually.
 
Status
Not open for further replies.
Top