Discussion Coolest natives

Sgqvur

FullOfUltimateTruthsAndEt ernalPrinciples, i.e shi
Reaction score
62
>mostly to do with using them locally in melee ladder games

And make blizzard host your map? ^^
 

Azlier

Old World Ghost
Reaction score
461
JASS:
call FogEnable(false)
call FogMaskEnable(false)

There's really good reasons for it (mostly to do with using them locally in melee ladder games). Not that I've ever done it.. :p

That's my secret discovery! Don't tell nobody. Not even people you think you can trust. Don't even tell me.

I beg to differ; using TriggerExecute is the bigger problem if you have a [ljass]TriggerSleepAction[/ljass] call, because all associated threads will stop. Right now, I'm usuing a condition which then calls [ljass]ExecuteFunc[/ljass], and that's its only purpose (it's a dynamic trigger with a wait period inside of it).

What? I don't understand. I've never found a good reason to use ExecuteFunc. Ever. Especially since I hear Vex's map optimizer causes it to just crash.
 

Bribe

vJass errors are legion
Reaction score
67
What? I don't understand. I've never found a good reason to use ExecuteFunc. Ever. Especially since I hear Vex's map optimizer causes it to just crash.

JASS:
//!
        private static method retrofit takes nothing returns nothing
            local unit a=GetTriggerUnit()
            call retro.deallocate(retro[a])
            loop
                call TriggerSleepAction(0)
                exitwhen (UnitAlive(a) and retro.allocate(a)!=0) or retro[a]==0
            endloop
            set a=null
        endmethod
        
        /**
         * death -> deallocate()
         * 
         * triggeractions crash when I reset var_onDetect;
         * TriggerSleepAction does not work with triggerconditions;
         * so I present to you a triggercondition just to call ExecuteFunc();
         */
        private static method removeOnDeath takes nothing returns boolean
            call ExecuteFunc(retrofit.name)
            return false
        endmethod
        
        private static method remakeTrigger takes nothing returns nothing
            local retro dat=0
            
            // reset trigger;
            call DestroyTrigger(var_onDetect)
            set var_onDetect=CreateTrigger()
            call TriggerAddCondition(var_onDetect,Filter(function retro.removeOnDeath))
            
            // state-detection events need to be reset as they were destroyed with the trigger;
            loop
                set dat=dat.next
                exitwhen dat==0
                call TriggerRegisterUnitStateEvent(var_onDetect,dat.subject,UNIT_STATE_LIFE,LESS_THAN,0.405)
            endloop
        endmethod
 

Azlier

Old World Ghost
Reaction score
461
Bribe, and why won't TriggerExecute serve as a suitable replacement there?

>Shall we tell or not?

I suppose it's open to interpretation. Not that you know what my discovery is. I only told a few very trustworthy people, like one of the most hated trolls on Battle.net.
 

Bribe

vJass errors are legion
Reaction score
67
ExecuteFunc is a lovely replacement for TriggerExecute because it doesn't allocate any handles, and for a substantial event such as a unit's death (in a system that already filters dummies and the like) you can get away with murder on efficiency without any side-effects. Besides that, twice the speed as TriggerExecute is not even close to murder, unless you plan to call it thousands of times per instant.

Why waste handles, I ask, for something that doesn't even come close to needing them?
 

Azlier

Old World Ghost
Reaction score
461
Waste handles? Just use .execute then. That's one trigger per function. That's absolutely nothing. If you're so concerned about your handle count, you're pretty much insane.

Not to mention that the optimizer totally breaks ExecuteFunc.
 

Bribe

vJass errors are legion
Reaction score
67
A bug with a program I don't even use, how about just don't use a program with a stupid bug? ExecuteFunc is an important native to JASS and the fact that an optimizer breaks it just means to throw out the optimizer.

func.execute() is a waste, too, it eats the same amount of trigger/action space as if you set it up yourself, but it makes worthless duplicates of the function during compile-time (generated method executor of... generated method caller of...)
 

Azlier

Old World Ghost
Reaction score
461
A bug with a program I don't even use, how about just don't use a program with a stupid bug? ExecuteFunc is an important native to JASS and the fact that an optimizer breaks it just means to throw out the optimizer.

func.execute() is a waste, too, it eats the same amount of trigger/action space as if you set it up yourself, but it makes worthless duplicates of the function during compile-time (generated method executor of... generated method caller of...)

Plenty of people use the Optimizer. If your system uses ExecuteFunc, people are sure gonna have a hard time finding out why their map does nothing but crash.

And efficiency is more important than memory usage. Seriously. Code compresses to nothing, and handle count is generally nothing to worry about unless your code is seriously broken.

There's absolutely no reason to use ExecuteFunc over something like .execute.
 

Bribe

vJass errors are legion
Reaction score
67
I switched my gameplan to .execute for one reason only: stupid JassHelper was still cloning my functions even though I was using ExecuteFunc! There's just no winning this :D

My hacky-fix to the huge text cloning is just to have a short function that can get cloned to JassHelper's content, and that short function just calls the real function naturally. Less text is more important than an infinitesimal speed difference.

Thanks for your solid approach, you helped me see the light XD
 

Troll-Brain

You can change this now in User CP.
Reaction score
85
@Azlier :

So what, your trick doesn't make a desync by itself ?
I still have your pm about your discovery, but it wasn't clear about a possible desync. Have you test it ?
Not that i care so much, just a bit curious.
 

Troll-Brain

You can change this now in User CP.
Reaction score
85
Wc3mapoptimizer breaks the map if you use ExecuteFunc with something different than a constant string, like a string variable or a string concatenation.
As you might know it changes the name of functions to make the script shorter.

For example he can't know that he must care about such functions :

JASS:
function MyF1 // ...

endfunction

function TheCodeInsideItWillBeBreakedByWc3MapOptimizer takes nothing returns nothing
   local integer i = 0

   call ExecuteFunc("MyF"+"1")
   set i = i+1
   call ExecuteFunc("MyF" + I2S(i))
endfunction


I'm not sure about the concatenation though, just a theory not tested, maybe it works.
But obviously wc3mapotpimizer can't handle ExecuteFunc when you use a string variable.

But i know that you can add exclusions to wc3mapoptimizer, again i have never tested it.
You should be able to forbid wc3mapoptimizer to change the name of specific functions, but even if it works properly it's a pain in the ass though, because it's map specific.

EDIT :

Or not : http://www.hiveworkshop.com/forums/...277/optimizer-executefunc-193152/#post1899844
 

tooltiperror

Super Moderator
Reaction score
231
[LJASS]native SetMapName takes string name returns nothing[/LJASS]
 

Risen

New Member
Reaction score
4
[ljass]native CreateTimer takes nothing returns timer[/ljass]

JASS:
loop
... 
...
endloop
 

Nestharus

o-o
Reaction score
84
[ljass]TriggerSleepAction[/ljass] cuz it makes my maps not lag at all : D

evryu othur lin 4 native and not lag ^_^
 
General chit-chat
Help Users
  • No one is chatting at the moment.
  • 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 The Helper:
    New recipe is another summer dessert Berry and Peach Cheesecake - https://www.thehelper.net/threads/recipe-berry-and-peach-cheesecake.194169/

      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