Discussion Coolest natives

Sgqvur

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

And make blizzard host your map? ^^
 

Azlier

Old World Ghost
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
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
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
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
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
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
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
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.
@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.
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
Staff member
[LJASS]native SetMapName takes string name returns nothing[/LJASS]
 
[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:
    that sucks
  • jonas jonas:
    @midnight8 how is it looking
  • midnight8 midnight8:
    meh, me, wife and her friend thaty traveled with us all have covid, seems to be winding down some for me at least. Felt like complete shit, been sleeping a lot, just bieng lazy as hell. I feel like that today has probably been like 11 or 12 days since exposure. Have not had any fever today, and have not taken any meds, so hopefully by monday or tuesday I will be good to go, sadly have passed it on to our teen son, I guess that was pretty much unavoidable
  • The Helper The Helper:
    hope you get to feeling better and get vaccinated my friend
  • midnight8 midnight8:
    I will at some point, but so many vaccinated people still getting it. One of the bands we watch in vegas, all 4 had been vaccinated and are now positive.
  • Ghan Ghan:
    Symptoms?
  • Ghan Ghan:
    I think the symptoms are typically less severe if previously vaccinated.
  • midnight8 midnight8:
    I have had all of the symptoms, taste is slightly starting to come back, but smell, no. Honestly, just been a little miserable, have never felt in any danger from it. Being trapped at home sucks. lol
  • midnight8 midnight8:
    meh, got a little fever again this morning, guess gonna be a few more days
  • The Helper The Helper:
    I went to Comicon this last weekend I hope I dont get it I feel fine and I am not vaccinated and did not wear a mask
  • The Helper The Helper:
    Comicon really was not packed though like it was in the past. I am not really worried though it was the most people I have been around in a year.
  • tom_mai78101 tom_mai78101:
    Still, getting vaccinated is a good idea. We're getting Delta variant spikes here in Boston.
  • The Helper The Helper:
    I am not against vaccination at all I just have a serious procrastination problem I plan on getting vaccinated soon
  • midnight8 midnight8:
    was kinda same with me, I was gonna do it, and life got in the way.
  • midnight8 midnight8:
    we wore mask in some places, but at 118 degrees outside, little rough. :)
  • The Helper The Helper:
    yeah i had another friend in Vegas talking about that heat damn
  • The Helper The Helper:
    Well I do not think I got Covid from the Comicon
    +1
  • tom_mai78101 tom_mai78101:
    Pushed out a new Pokemon Walking algorithm build. With a new system in place, I'll probably start tackling triggers and NPCs,
    +1
  • Varine Varine:
    Is it fucking hot everywhere?
  • Varine Varine:
    What's a pokemon walking algorithm?
  • jonas jonas:
    it's an engine for pokemon games that closely emulates the walking behavior of pokemon red/blue/yellow
  • jonas jonas:
    basically if you wanted to implement pokemon yellow from scratch, and you'd want it to feel as close as possible to the real thing, you'd start with that
  • Varine Varine:
    Like from the Gameboy games? I'm not at all familiar with Pokemon.
  • jonas jonas:
    yeah
  • The Helper The Helper:
    I only played the Pokemon games on the Gamecube and Wii and such not on the portables my kids had all those games but I never really played on the portables. Now that I think about maybe once sooooo long ago.

    Members online

    No members online now.

    Affiliates

    Hive Workshop NUON Dome
    Top