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:
    I am great and it is fantastic to see you my friend!
    +1
  • The Helper The Helper:
    If you are new to the site please check out the Recipe and Food Forum https://www.thehelper.net/forums/recipes-and-food.220/
  • Monovertex Monovertex:
    How come you're so into recipes lately? Never saw this much interest in this topic in the old days of TH.net
  • Monovertex Monovertex:
    Hmm, how do I change my signature?
  • tom_mai78101 tom_mai78101:
    Signatures can be edit in your account profile. As for the old stuffs, I'm thinking it's because Blizzard is now under Microsoft, and because of Microsoft Xbox going the way it is, it's dreadful.
  • The Helper The Helper:
    I am not big on the recipes I am just promoting them - I use the site as a practice place promoting stuff
    +2
  • Monovertex Monovertex:
    @tom_mai78101 I must be blind. If I go on my profile I don't see any area to edit the signature; If I go to account details (settings) I don't see any signature area either.
  • The Helper The Helper:
    You can get there if you click the bell icon (alerts) and choose preferences from the bottom, signature will be in the menu on the left there https://www.thehelper.net/account/preferences
  • The Helper The Helper:
    I think I need to split the Sci/Tech news forum into 2 one for Science and one for Tech but I am hating all the moving of posts I would have to do
  • The Helper The Helper:
    What is up Old Mountain Shadow?
  • The Helper The Helper:
    Happy Thursday!
    +1
  • Varine Varine:
    Crazy how much 3d printing has come in the last few years. Sad that it's not as easily modifiable though
  • Varine Varine:
    I bought an Ender 3 during the pandemic and tinkered with it all the time. Just bought a Sovol, not as easy. I'm trying to make it use a different nozzle because I have a fuck ton of Volcanos, and they use what is basically a modified volcano that is just a smidge longer, and almost every part on this thing needs to be redone to make it work
  • Varine Varine:
    Luckily I have a 3d printer for that, I guess. But it's ridiculous. The regular volcanos are 21mm, these Sovol versions are about 23.5mm
  • Varine Varine:
    So, 2.5mm longer. But the thing that measures the bed is about 1.5mm above the nozzle, so if I swap it with a volcano then I'm 1mm behind it. So cool, new bracket to swap that, but THEN the fan shroud to direct air at the part is ALSO going to be .5mm to low, and so I need to redo that, but by doing that it is a little bit off where it should be blowing and it's throwing it at the heating block instead of the part, and fuck man
  • Varine Varine:
    I didn't realize they designed this entire thing to NOT be modded. I would have just got a fucking Bambu if I knew that, the whole point was I could fuck with this. And no one else makes shit for Sovol so I have to go through them, and they have... interesting pricing models. So I have a new extruder altogether that I'm taking apart and going to just design a whole new one to use my nozzles. Dumb design.
  • Varine Varine:
    Can't just buy a new heatblock, you need to get a whole hotend - so block, heater cartridge, thermistor, heatbreak, and nozzle. And they put this fucking paste in there so I can't take the thermistor or cartridge out with any ease, that's 30 dollars. Or you can get the whole extrudor with the direct driver AND that heatblock for like 50, but you still can't get any of it to come apart
  • Varine Varine:
    Partsbuilt has individual parts I found but they're expensive. I think I can get bits swapped around and make this work with generic shit though
  • Ghan Ghan:
    Heard Houston got hit pretty bad by storms last night. Hope all is well with TH.
  • The Helper The Helper:
    Power back on finally - all is good here no damage
    +2
  • V-SNES V-SNES:
    Happy Friday!
    +1
  • The Helper The Helper:
    New recipe is another summer dessert Berry and Peach Cheesecake - https://www.thehelper.net/threads/recipe-berry-and-peach-cheesecake.194169/

      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