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.
  • The Helper The Helper:
    Damn here come the bots again - 193 online but they are totally invisible to any stats - bunch of bots!'
  • C cubanismo:
    Re: Taco Tuesday, if there were some way to share edible tacos over the internet, technology would be complete.
    +2
  • The Helper The Helper:
    One can only wish!
  • tom_mai78101 tom_mai78101:
    I'm back from Taiwan
    +1
  • The Helper The Helper:
    I am reorganizing the site I know nobody will notice but I am not done quite yet but the main forums order has been changed and there is a new news category in Other News which is all the remaining headline news stuff not categorized - Headline News is just the stuff that shows on the main page now and the news archive is off the main forums page
  • The Helper The Helper:
    and the real archive lives off of headline news
  • The Helper The Helper:
    Happy Monday!
  • V-SNES V-SNES:
    Happy Saturday!
  • The Helper The Helper:
    Happy Saturday Night!
    +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