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.
  • Varine Varine:
    How can you tell the difference between real traffic and indexing or AI generation bots?
  • The Helper The Helper:
    The bots will show up as users online in the forum software but they do not show up in my stats tracking. I am sure there are bots in the stats but the way alot of the bots treat the site do not show up on the stats
  • Varine Varine:
    I want to build a filtration system for my 3d printer, and that shit is so much more complicated than I thought it would be
  • Varine Varine:
    Apparently ABS emits styrene particulates which can be like .2 micrometers, which idk if the VOC detectors I have can even catch that
  • Varine Varine:
    Anyway I need to get some of those sensors and two air pressure sensors installed before an after the filters, which I need to figure out how to calculate the necessary pressure for and I have yet to find anything that tells me how to actually do that, just the cfm ratings
  • Varine Varine:
    And then I have to set up an arduino board to read those sensors, which I also don't know very much about but I have a whole bunch of crash course things for that
  • Varine Varine:
    These sensors are also a lot more than I thought they would be. Like 5 to 10 each, idk why but I assumed they would be like 2 dollars
  • Varine Varine:
    Another issue I'm learning is that a lot of the air quality sensors don't work at very high ambient temperatures. I'm planning on heating this enclosure to like 60C or so, and that's the upper limit of their functionality
  • Varine Varine:
    Although I don't know if I need to actually actively heat it or just let the plate and hotend bring the ambient temp to whatever it will, but even then I need to figure out an exfiltration for hot air. I think I kind of know what to do but it's still fucking confusing
  • The Helper The Helper:
    Maybe you could find some of that information from AC tech - like how they detect freon and such
  • Varine Varine:
    That's mostly what I've been looking at
  • Varine Varine:
    I don't think I'm dealing with quite the same pressures though, at the very least its a significantly smaller system. For the time being I'm just going to put together a quick scrubby box though and hope it works good enough to not make my house toxic
  • Varine Varine:
    I mean I don't use this enough to pose any significant danger I don't think, but I would still rather not be throwing styrene all over the air
  • The Helper The Helper:
    New dessert added to recipes Southern Pecan Praline Cake https://www.thehelper.net/threads/recipe-southern-pecan-praline-cake.193555/
  • The Helper The Helper:
    Another bot invasion 493 members online most of them bots that do not show up on stats
  • Varine Varine:
    I'm looking at a solid 378 guests, but 3 members. Of which two are me and VSNES. The third is unlisted, which makes me think its a ghost.
    +1
  • The Helper The Helper:
    Some members choose invisibility mode
    +1
  • The Helper The Helper:
    I bitch about Xenforo sometimes but it really is full featured you just have to really know what you are doing to get the most out of it.
  • The Helper The Helper:
    It is just not easy to fix styles and customize but it definitely can be done
  • The Helper The Helper:
    I do know this - xenforo dropped the ball by not keeping the vbulletin reputation comments as a feature. The loss of the Reputation comments data when we switched to Xenforo really was the death knell for the site when it came to all the users that left. I know I missed it so much and I got way less interested in the site when that feature was gone and I run the site.
  • Blackveiled Blackveiled:
    People love rep, lol
    +1
  • The Helper The Helper:
    The recipe today is Sloppy Joe Casserole - one of my faves LOL https://www.thehelper.net/threads/sloppy-joe-casserole-with-manwich.193585/
  • The Helper The Helper:
    Decided to put up a healthier type recipe to mix it up - Honey Garlic Shrimp Stir-Fry https://www.thehelper.net/threads/recipe-honey-garlic-shrimp-stir-fry.193595/

      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