On an unit creation, unit life == full ?

Troll-Brain

You can change this now in User CP.
Reaction score
85
I'm wondering if only structures which are building enter the map with not full hp.
I think so, but maybe i miss a case ?

For starters :
And no even preplaced unit enter the map with full hp, their life is modified later internally in the map script
 

Komaqtion

You can change this now in User CP.
Reaction score
469
What ?!

Sorry, but I can't understand a thing there :S
Please, you really need to improve your grammar...
 

Troll-Brain

You can change this now in User CP.
Reaction score
85
Hmm interesting, inside a TriggerRegisterEnterRegion boolexpr, the unit life is full, but inside a trigger condition, with the same event, the life is equal to 10 % of unit life max.
 

Komaqtion

You can change this now in User CP.
Reaction score
469
You mean you set a unit's health to 10% when it enters the map ?
 

Troll-Brain

You can change this now in User CP.
Reaction score
85
I think you're onto something, troll. Problem is, systems like AIDS fire an event in the event boolexpr of unit enters region... So it is not really safe. :)

I did, do, and will do, lot of experiments about events.

About the problem you mentioned i'm quite surprised using a library and the keyword "requires" doesn't help here. (tested with AutoIndex not AIDS, GetUnitId(GetFilterUnit()) == 0)
So what ?!
It means if you use several TriggerRegister boolexpr, they are fired simultaneously ?!

I think i will try to use it though, because in case of structure built with an human, i have a use, it's long to explain.
I haven't played with PlayerUnitEvent boolexpr yet though, i will test them first.

EDIT :

How Surprising !

JASS:
//! runtextmacro t_filter("0")
//! runtextmacro t_filter("1")
//! runtextmacro t_filter("2")
//! runtextmacro t_filter("3")
//! runtextmacro t_filter("4")
//! runtextmacro t_filter("5")
//! runtextmacro t_filter("6")
//! runtextmacro t_filter("7")
//! runtextmacro t_filter("8")
//! runtextmacro t_filter("9")

//! textmacro t_filter takes INDEX
library EnterMap$INDEX$ initializer onInit requires AIDS

private function filter takes nothing returns boolean
    call BJDebugMsg(" ")
    call BJDebugMsg("filter$INDEX$ 1")
    call BJDebugMsg("filter$INDEX$ 2")
    call BJDebugMsg("filter$INDEX$ 3")
    call BJDebugMsg(GetUnitName(GetFilterUnit()) + " " + I2S(GetUnitId(GetFilterUnit())))
    return false
endfunction

private function onInit takes nothing returns nothing
    local trigger trig = CreateTrigger()
    local region reg = CreateRegion()
    
    call RegionAddRect(reg,GetWorldBounds())
    call TriggerRegisterEnterRegion(trig,reg,function filter)
    call BJDebugMsg("INIT$INDEX$")
endfunction

endlibrary
//! endtextmacro


It displays INIT0 to INIT9, but on an unit creation, filter9 to filter0 !!!
That's why "requires" doesn't work o_O (the unit indexer "enter region" filter fire the last)

Also that's not the fault of ExecuteFunc (library initializer), it's the same with scopes (without the "requires" keyword ofc).

I would bet the last created trigger fired the last and not the first :banghead:

EDIT 2 :

Aha, there is no rule for that, it depends the event, for example for the event EVENT_PLAYER_END_CINEMATIC, it display "0" to "9" .
Hmm ...
It could depend if the TriggerRegister functions has a boolexpr argument or not, but it's too much tests for today, maybe an other day ...
 

Troll-Brain

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

Huhh :confused:
I tried to destroy / recreate the indexer enter region trigger, create mine , recreate the indexer trigger but it still doesn't work, the indexer trigger fire the last (i tried that just to know).
I tried also to create my filter first, i mean using Filter(myFilter)).

JASS:
library WTF initializer onInit requires AutoIndex // or AIDS

globals
    boolean array IsIndexerEnterRegionHooked // can't use readonly with a global array
    private trigger Indexer
    private boolexpr EnterRegionFilter
    private region Reg
    private boolean array IgnoreHook
endglobals

private function HookEnterRegion takes trigger whichTrigger, region whichRegion, boolexpr filter returns event   
    if IgnoreHook[0] then
        return null
    endif
    
    if not IsIndexerEnterRegionHooked[0] then // if it wasn't an array it would crash the thread until the variable is setted to true
        
        set IsIndexerEnterRegionHooked[0] = true
        set Indexer = whichTrigger
        set Reg = whichRegion
        set EnterRegionFilter = filter
        return null
    endif
    
    call DestroyTrigger(Indexer)
    set Indexer = null
    set Indexer = CreateTrigger()
    set IgnoreHook[0] = true
    call TriggerRegisterEnterRegion(Indexer,Reg,EnterRegionFilter)
    set IgnoreHook[0] = false
    
    return null
endfunction

hook TriggerRegisterEnterRegion HookEnterRegion

endlibrary


Oh, and don't forget a module initializer fire before ALL struct initializers.
I mean someone enough silly to use a TriggerRegisterEnterRegion boolexpr inside a module initializer can break AIDS, in the sense that the unit won't be indexed when this such boolexpr will be evaluated.

So it would better if you use a dummy module inside your dummy struct.
 

Troll-Brain

You can change this now in User CP.
Reaction score
85
I wouldn't do anything based on this information. This is going to change eventually once Vex has the time to update how initialization works.
But it wouldn't fuck up library requires, right ?
I mean i just use it as a dummy initializer (instead of a library initializer) but use requires of library for god sake.
I just use to prevent these initializations madness, not as some hack feature.
 

Anachron

New Member
Reaction score
53
Hmm, I guess its warcraft III hardcoded, never worked it it though.
Also, I think it has something to do with the Warcraft 3 engine.
Maybe they first create all handles, and after that, they load all handle values and put it into the handles?
 

Troll-Brain

You can change this now in User CP.
Reaction score
85
Hmm, I guess its warcraft III hardcoded, never worked it it though.
Also, I think it has something to do with the Warcraft 3 engine.
Maybe they first create all handles, and after that, they load all handle values and put it into the handles?

I think (only a guess not tested at all) that these boolexpr (inside a TriggerRegister) are a sort of a reverse stack, the last trigger created fire the first, and the other (inside a condition) fire like a stack, the last created trigger fire the last. (hmm maybe it's confused xD)

At least it seems the case for TriggerRegisterEnterRegion.

Also forgot about my post with hooks, i didn't read the compiled code but it shouldn't change the order of the trigger creation anyway, since hooks are done before the native call.

Again, it's just a personal theory i could be totally wrong, i'm too lazy to really test it, and it wouldn't be useful to know it anyway, just "good to know" ^^
 
General chit-chat
Help Users
  • No one is chatting at the moment.
  • The Helper The Helper:
    that sucks i bet they are expensive
  • Varine Varine:
    Not really
  • Varine Varine:
    The entire hot end is like 20 dollars, I just can't get anymore until next week
  • Varine Varine:
    I ordered like five blocks for 15 dollars. They're just little aluminum blocks with holes drilled into them
  • Varine Varine:
    They are pretty much disposable. I have shitty nozzles though, and I don't think these were designed for how hot I've run them
  • Varine Varine:
    I tried to extract it but the thing is pretty stuck. Idk what else I can use this for
  • Varine Varine:
    I'll throw it into my scrap stuff box, I'm sure can be used for something
  • Varine Varine:
    I have spare parts for like, everything BUT that block lol. Oh well, I'll print this shit next week I guess. Hopefully it fits
  • Varine Varine:
    I see that, despite your insistence to the contrary, we are becoming a recipe website
  • Varine Varine:
    Which is unique I guess.
  • The Helper The Helper:
    Actually I was just playing with having some kind of mention of the food forum and recipes on the main page to test and see if it would engage some of those people to post something. It is just weird to get so much traffic and no engagement
  • The Helper The Helper:
    So what it really is me trying to implement some kind of better site navigation not change the whole theme of the site
  • 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

      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