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
83
[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.
  • jonas jonas:
    Oh, I see. I thought Chinese version of A-levels :D
  • jonas jonas:
    I've been using the translate app a lot on my phone. take a photo, translate. take another photo, translate again :D
  • jonas jonas:
    it also has voice translation, my colleagues sometimes use that
  • jonas jonas:
    You came during the 0 covid policy right? How'd you get through quarantine? Did you have some help with the apps and green codes?
  • tom_mai78101 tom_mai78101:
    If you have any Chinese you need help with, let me know.
    +1
  • vypur85 vypur85:
    @jonas Those were the things I did too. Translate app and VPN are always the most important things to have to survive. Lol.
  • vypur85 vypur85:
    Yea I came last year. I was quarantined for about 30 days. Fml. The first day of my quarantine was the eve of Chinese new year last year. Fml again... Lol.
  • vypur85 vypur85:
    @tom_mai78101 IIRC you're from Taiwan right.
  • The Helper The Helper:
    I thought China had cracked down on having any foreign teachers?
  • vypur85 vypur85:
    Yeah I've heard of the news before. My school is still actively hiring foreign teachers. Not sure how things work now.
  • The Helper The Helper:
    yeah it is hard to get reliable information about that kind of stuff
  • The Helper The Helper:
    but you are doing it so it is still doable
  • vypur85 vypur85:
    I think it doesn't affect existing foreign teachers. Then again, its still weird that my school is hiring.
  • The Helper The Helper:
    Happy Monday people hope everyone has a fantastic week!
  • Ghan Ghan:
    Happy Monday?! That's a contradiction.
  • jonas jonas:
  • jonas jonas:
    please put this in the news section, it's crazy
  • tom_mai78101 tom_mai78101:
    Technically, you can post in the Headline News. Just posted your news there.
  • tom_mai78101 tom_mai78101:
    I'm not aware of you not being able to post news.
  • jonas jonas:
    I think technically I can I just forget how
    +1
  • The Helper The Helper:
    Happy Thursday!
  • The Helper The Helper:
    Happy Friday Night!
    +1
  • V-SNES V-SNES:
    Happy Friday night!
    +1
  • vypur85 vypur85:
    Happy Sunday. Sigh. Work day tomorrow.
    +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