System Unit Enters Range

Darthfett

Aerospace/Cybersecurity Software Engineer
Reaction score
615
The requirement of PUI and Cs_Data is annoying imho.
Also i would allow the user to add more than one event for the same trigger.

1. CSData attaches the unit to the trigger, so that if you have the trigger, you can get the unit back (in order to know which unit the pseudo-circle was centered on). PUI attaches the trigger to the unit, so that if you want to remove the trigger-event from the unit, you can. I used PUI because of its garbage collection with units.

2. Not possible. You can add your own events to the supplied trigger, but in order for the system to know which unit triggered the event, it has to store the unit to the trigger.

I will be posting a demo map soon, but it may take me a bit to make some spells that use the system. I have a busy schedule.
 

Azlier

Old World Ghost
Reaction score
461
You don't really need boolexpr utils. Troll-Brain proved that null boolexprs only leak when used in groups and such. Even then, we don't truly need boolexpr utils because any vJasser worth his keyboard uses the filters themselves to manipulate grouped units.
 

Darthfett

Aerospace/Cybersecurity Software Engineer
Reaction score
615
You don't really need boolexpr utils. Troll-Brain proved that null boolexprs only leak when used in groups and such.

Code:
function TriggerRegisterUnitEnterRangeEvent takes unit whichUnit, real range, boolexpr filter returns trigger
    local Data d = Data.create(whichUnit)
    if filter == null then
        [B]call TriggerRegisterUnitInRange(d.t,whichUnit,range,BOOLEXPR_TRUE)[/B]
    else
        call TriggerRegisterUnitInRange(d.t,whichUnit,range,filter)
    endif
    return d.t
endfunction

This is not using a group?

Even then, we don't truly need boolexpr utils because any vJasser worth his keyboard uses the filters themselves to manipulate grouped units.

What? Are you trying to say any JASS already knows how to make a filter? I know. However, it's better to use a standard filter, than to create a filter for every single imported spell needing it. In the words of Vexorian, "Consider it a good way to have something close to a standard rather than every single spell creating its own garbage boolexpr."
 

Azlier

Old World Ghost
Reaction score
461
Meh. I'm sure by garbage boolexpr he meant a function returning true and a global pointing to it. I see a filter being used instead of a separate ForGroup function as a good thing.

>call TriggerRegisterUnitInRange(d.t,whichUnit,range,BOOLEXPR_TRUE)
That's registering an event, not filtering a group...
 

Andrewgosu

The Silent Pandaren Helper
Reaction score
716
This has been waiting here long enough.

Quite useful and efficiently coded now.

Approved.
 

SanKakU

Member
Reaction score
21
while the complicated version i'm sure is great...i don't understand it, can you make a simpler version? this is what i mean...
ok this is your spell for your map, right? now i put in a few comments throughout explaining why this is too complicated for me
JASS:
scope FireShock initializer Init

//==================================================||
//                                                  ||
//           Spell Created by Darthfett             ||
//                                                  ||
//             Easy to end spell, use:              ||
//                                                  ||
//    call FireShock_Data[UNIT].release()           ||
//      - to finish a spell abruptly                ||
//                                                  ||
//    call Fireshock_Data.finish(Data[UNIT])        ||
//      - to finish a spell with FX.                ||
//                                                  ||
//==================================================||
///////wow look at all the spell information...all i want to do is kill the unit.
globals
    private integer AID_FIRE_SHOCK = 'A000'
    private real TIMEOUT = 0.03125
    private integer DUM_COUNT = 8 //8 units in the circle
    private integer SHOCK_INTERVAL = R2I(2 / TIMEOUT) //2.5 seconds
    private real SHOCK_DAMAGE = 15
    private integer UID_AURA_DUMMY = 'dumy'
    private integer UID_STUN_DUMMY = 'cast'//
    private unit temp_u
    
endglobals
//private function FILTER...is this checking the firelord or the footmen? i can't tell
private function FILTER takes nothing returns boolean
    return IsUnitEnemy(temp_u,GetOwningPlayer(GetFilterUnit())) and GetWidgetLife(GetFilterUnit()) >= .405
endfunction

private keyword LWrapper
public keyword Data

private function LDestroy takes nothing returns nothing
    local LWrapper l = GetCSData(GetExpiredTimer())
    call DestroyLightning(l.l)
    call DestroyTimer(GetExpiredTimer())
    call l.destroy()
endfunction
//is the struct and method something required to kill the unit? never used before
private struct LWrapper
    lightning l
    
    
    static method create takes string whichType, unit center, unit tar, real damage returns LWrapper
        local LWrapper l = LWrapper.allocate()
        local timer t = CreateTimer()
        local sound snd = CreateSoundFromLabel("Abilities\\Spells\\Orc\\LightningBolt\\LightningBolt.wav", false, true, true, 10000, 10000)
        set l.l = AddLightningEx(whichType,true,GetUnitX(center),GetUnitY(center),0,GetUnitX(tar),GetUnitY(tar),0)
        call SetSoundPosition(snd, GetUnitX(center), GetUnitY(center), 0.)
        call StartSound(snd)
        call UnitDamageTarget(center,tar,damage,false,false,ATTACK_TYPE_CHAOS,DAMAGE_TYPE_LIGHTNING,WEAPON_TYPE_WHOKNOWS)
        call KillSoundWhenDone(snd)
        call SetCSData(t,l)
        call TimerStart(t,0.25,false,function LDestroy)
        set t = null
        set snd = null
        return l
    endmethod
endstruct

private function Lightning takes nothing returns nothing
    local Data d = Data.create()
    call LWrapper.create("AFOD",GetCenterUnit(),GetTriggerUnit(),15 + 10 * d.lvl)
endfunction

public struct Data
    //! runtextmacro PUI()
    timer t
    unit c
    unit array dummy[8]
    integer ticks
    integer lvl
    trigger trig
    
    static method create takes nothing returns Data
        local Data d = Data.allocate()
        set d.t = CreateTimer()
        set d.ticks = 0
        return d
    endmethod
        
    
    method onDestroy takes nothing returns nothing
        local integer i = 0
//All the actual cleanup is done in .release/.destroy methods, 
//so that it is possible to stop a spell whenever.
//This makes the spell very flexible
        loop
            exitwhen i >= DUM_COUNT
//hmm...what's this?  killing a dummy huh?
//i got a better idea, let's kill the center unit!
//all i need is make sure the entering unit is a footman!
//and that's ALL i'm trying to do
//optional would be to show a blood spurt and delay a second
//and then kill the unit, while playing the sound varimathras
//pissed number 8
            call KillUnit(this.dummy<i>)
            set i = i + 1
        endloop
        call DestroyTimer(this.t)
        call RemoveTriggerEnterRangeEvent(this.trig)
    endmethod
    
    method finish takes nothing returns nothing
        local group g = CreateGroup()
        local unit fog
        local integer i = 0
        set temp_u = this.c
        call GroupEnumUnitsInRange(g,GetUnitX(this.c),GetUnitY(this.c),250,Condition(function FILTER))
        loop
            set fog = FirstOfGroup(g)
            exitwhen fog == null
            call LWrapper.create(&quot;CLPB&quot;,this.c,fog,30 + 15 * this.lvl)
            call GroupRemoveUnit(g,fog)
        endloop
        
        loop
            exitwhen i &gt;= DUM_COUNT
            call LWrapper.create(&quot;CLPB&quot;,this.c,this.dummy<i>,0)
            set i = i + 1
        endloop
        call DestroyGroup(g)
        set g = null
        call this.release()
    endmethod
endstruct

private function Conditions takes nothing returns boolean
    return GetSpellAbilityId() == AID_FIRE_SHOCK
endfunction
//ok it looks like this function does most things...it seems to explain that the above
//check that i didn&#039;t know if it was for firelord or footmen seems to be for footmen
private function Callback takes nothing returns nothing
    local Data d = Data(GetCSData(GetExpiredTimer()))
    local integer i = 0
    local unit fog
    local group g
    local unit temp
    if GetWidgetLife(d.c) &lt; .405 then //Ending abnormally
        call d.release()
    endif
    set d.ticks = d.ticks + 1
    if ModuloInteger(d.ticks,SHOCK_INTERVAL) == 0 then
        set g = CreateGroup()
        set temp_u = d.c
        call GroupEnumUnitsInRange(g,GetUnitX(d.c),GetUnitY(d.c),250,Condition(function FILTER))
        
        loop
            set fog = FirstOfGroup(g)
            exitwhen fog == null
            call LWrapper.create(&quot;CLPB&quot;,d.c,fog,SHOCK_DAMAGE)
            set temp = CreateUnit(GetOwningPlayer(d.c),UID_STUN_DUMMY,GetUnitX(fog),GetUnitY(fog),0)
            call IssueTargetOrder(temp,&quot;thunderbolt&quot;,fog)
            call UnitApplyTimedLife(temp,&#039;BTLF&#039;,1)
            call GroupRemoveUnit(g,fog)
        endloop
        call DestroyGroup(g)
        set temp = null
    endif
    loop
        exitwhen i &gt;= DUM_COUNT
        call SetUnitX(d.dummy<i>,GetUnitX(d.c) + 250 * Cos(360 / DUM_COUNT * i * bj_DEGTORAD))
        call SetUnitY(d.dummy<i>,GetUnitY(d.c) + 250 * Sin(360 / DUM_COUNT * i * bj_DEGTORAD))
        set i = i + 1
    endloop
    
    if d.ticks &gt;= (15 / TIMEOUT)   then //Ending normally
        call d.finish()
    endif
endfunction
//ok i guess this is the primary trigger here...but once again there is so
//much spell information which i don&#039;t understand fully
//mixed in with your system which i&#039;m trying to learn that i can&#039;t
//figure out what&#039;s necessary for my trigger and what&#039;s not
private function Actions takes nothing returns nothing
    local Data d = Data[GetTriggerUnit()]
    local integer i = 0
    if d != 0 then
        call d.release()
    endif
    set d = Data.create()
    set Data[GetTriggerUnit()] = d
    
    set d.c = GetTriggerUnit()  
    set d.lvl = GetUnitAbilityLevel(d.c,AID_FIRE_SHOCK)
    set d.trig = TriggerRegisterUnitEnterRangeEvent(d.c,250,null)
    call TriggerAddAction(d.trig,function Lightning)
    loop
        exitwhen i&gt;= DUM_COUNT
        set d.dummy<i> = CreateUnit(GetOwningPlayer(d.c),UID_AURA_DUMMY,GetUnitX(d.c) + 250 * Cos(360 / DUM_COUNT * i * bj_DEGTORAD),GetUnitY(d.c) + 250 * Sin(360 / DUM_COUNT * i * bj_DEGTORAD),0)
        call LWrapper.create(&quot;AFOD&quot;,d.c,d.dummy<i>,0)
        set i = i + 1
    endloop
    
    call SetCSData(d.t,d)
    call TimerStart(d.t,TIMEOUT,true,function Callback)
endfunction

private function Init takes nothing returns nothing
    local trigger t = CreateTrigger()
    call BJDebugMsg(I2S(SHOCK_INTERVAL))
    call TriggerRegisterAnyUnitEventBJ(t,EVENT_PLAYER_UNIT_SPELL_EFFECT)
    call TriggerAddCondition(t,Condition(function Conditions))
    call TriggerAddAction(t,function Actions)
endfunction

endscope</i></i></i></i></i></i>


ok so i gave up trying to understand it all at once...i decided to start changing it little by little...this is what i came up with so far...
JASS:

scope FireShock initializer Init

//==================================================||
//                                                  ||
//           Spell Created by Darthfett             ||
//                                                  ||
//             Easy to end spell, use:              ||
//                                                  ||
//    call FireShock_Data[UNIT].release()           ||
//      - to finish a spell abruptly                ||
//                                                  ||
//    call Fireshock_Data.finish(Data[UNIT])        ||
//      - to finish a spell with FX.                ||
//                                                  ||
//==================================================||

globals
    private integer AID_FIRE_SHOCK = &#039;ufro&#039;
    private real TIMEOUT = 0.03125
    private integer DUM_COUNT = 8 //8 units in the circle
    private integer SHOCK_INTERVAL = R2I(2 / TIMEOUT) //2.5 seconds
    private real SHOCK_DAMAGE = 1500
    private integer UID_AURA_DUMMY = &#039;dumy&#039;
    private integer UID_STUN_DUMMY = &#039;cast&#039;
    private unit temp_u
    
endglobals

private function FILTER takes nothing returns boolean
    return GetUnitTypeId(GetFilterUnit()) == &#039;otau&#039; and GetWidgetLife(GetFilterUnit()) &gt;= .405
endfunction

private keyword LWrapper
public keyword Data

private function LDestroy takes nothing returns nothing
    local LWrapper l = GetCSData(GetExpiredTimer())
    call DestroyLightning(l.l)
    call DestroyTimer(GetExpiredTimer())
    call l.destroy()
endfunction

private struct LWrapper
    lightning l
    
    
    static method create takes string whichType, unit center, unit tar, real damage returns LWrapper
        local LWrapper l = LWrapper.allocate()
        local timer t = CreateTimer()
        local sound snd = CreateSoundFromLabel(&quot;Abilities\\Spells\\Orc\\LightningBolt\\LightningBolt.wav&quot;, false, true, true, 10000, 10000)
        set l.l = AddLightningEx(whichType,true,GetUnitX(center),GetUnitY(center),0,GetUnitX(tar),GetUnitY(tar),0)
        call SetSoundPosition(snd, GetUnitX(center), GetUnitY(center), 0.)
        call StartSound(snd)
        call UnitDamageTarget(center,tar,damage,false,false,ATTACK_TYPE_CHAOS,DAMAGE_TYPE_LIGHTNING,WEAPON_TYPE_WHOKNOWS)
        call KillSoundWhenDone(snd)
        call SetCSData(t,l)
        call TimerStart(t,0.25,false,function LDestroy)
        set t = null
        set snd = null
        return l
    endmethod
endstruct

private function Lightning takes nothing returns nothing
    local Data d = Data.create()
    call LWrapper.create(&quot;AFOD&quot;,GetCenterUnit(),GetTriggerUnit(),15 + 10 * d.lvl)
endfunction

public struct Data
    //! runtextmacro PUI()
    timer t
    unit c
    unit array dummy[8]
    integer ticks
    integer lvl
    trigger trig
    
    static method create takes nothing returns Data
        local Data d = Data.allocate()
        set d.t = CreateTimer()
        set d.ticks = 0
        return d
    endmethod
        
    
    method onDestroy takes nothing returns nothing
        local integer i = 0
//All the actual cleanup is done in .release/.destroy methods, 
//so that it is possible to stop a spell whenever.
//This makes the spell very flexible
        loop
            exitwhen i &gt;= DUM_COUNT
            call KillUnit(this.dummy<i>)
            set i = i + 1
        endloop
        call DestroyTimer(this.t)
        call RemoveTriggerEnterRangeEvent(this.trig)
    endmethod
    
    method finish takes nothing returns nothing
        local group g = CreateGroup()
        local unit fog
        local integer i = 0
        set temp_u = this.c
        call GroupEnumUnitsInRange(g,GetUnitX(this.c),GetUnitY(this.c),250,Condition(function FILTER))
        loop
            set fog = FirstOfGroup(g)
            exitwhen fog == null
            call LWrapper.create(&quot;CLPB&quot;,this.c,fog,30 + 15 * this.lvl)
            call GroupRemoveUnit(g,fog)
        endloop
        
        loop
            exitwhen i &gt;= DUM_COUNT
            call LWrapper.create(&quot;CLPB&quot;,this.c,this.dummy<i>,0)
            set i = i + 1
        endloop
        call DestroyGroup(g)
        set g = null
        call this.release()
    endmethod
endstruct

private function Conditions takes nothing returns boolean
    return GetUnitTypeId(GetTriggerUnit()) == AID_FIRE_SHOCK
endfunction

private function Callback takes nothing returns nothing
    local Data d = Data(GetCSData(GetExpiredTimer()))
    local integer i = 0
    local unit fog
    local group g
    local unit temp
    if GetWidgetLife(d.c) &lt; .405 then //Ending abnormally
        call d.release()
    endif
    set d.ticks = d.ticks + 1
    if ModuloInteger(d.ticks,SHOCK_INTERVAL) == 0 then
        set g = CreateGroup()
        set temp_u = d.c
        call GroupEnumUnitsInRange(g,GetUnitX(d.c),GetUnitY(d.c),250,Condition(function FILTER))
        
        loop
            set fog = FirstOfGroup(g)
            exitwhen fog == null
            call LWrapper.create(&quot;CLPB&quot;,d.c,fog,SHOCK_DAMAGE)
            set temp = CreateUnit(GetOwningPlayer(d.c),UID_STUN_DUMMY,GetUnitX(fog),GetUnitY(fog),0)
            call IssueTargetOrder(temp,&quot;thunderbolt&quot;,fog)
            call UnitApplyTimedLife(temp,&#039;BTLF&#039;,1)
            call GroupRemoveUnit(g,fog)
        endloop
        call DestroyGroup(g)
        set temp = null
    endif
    loop
        exitwhen i &gt;= DUM_COUNT
        call SetUnitX(d.dummy<i>,GetUnitX(d.c) + 250 * Cos(360 / DUM_COUNT * i * bj_DEGTORAD))
        call SetUnitY(d.dummy<i>,GetUnitY(d.c) + 250 * Sin(360 / DUM_COUNT * i * bj_DEGTORAD))
        set i = i + 1
    endloop
    
    if d.ticks &gt;= (15 / TIMEOUT)   then //Ending normally
        call d.finish()
    endif
endfunction

private function Actions takes nothing returns nothing
    local Data d = Data[GetTriggerUnit()]
    local integer i = 0
    if d != 0 then
        call d.release()
    endif
    set d = Data.create()
    set Data[GetTriggerUnit()] = d
    
    set d.c = GetTriggerUnit()  
    set d.lvl = GetUnitAbilityLevel(d.c,AID_FIRE_SHOCK)
    set d.trig = TriggerRegisterUnitEnterRangeEvent(d.c,250,null)
    call TriggerAddAction(d.trig,function Lightning)
    loop
        exitwhen i&gt;= DUM_COUNT
        set d.dummy<i> = CreateUnit(GetOwningPlayer(d.c),UID_AURA_DUMMY,GetUnitX(d.c) + 250 * Cos(360 / DUM_COUNT * i * bj_DEGTORAD),GetUnitY(d.c) + 250 * Sin(360 / DUM_COUNT * i * bj_DEGTORAD),0)
        call LWrapper.create(&quot;AFOD&quot;,d.c,d.dummy<i>,0)
        set i = i + 1
    endloop
    
    call SetCSData(d.t,d)
    call TimerStart(d.t,TIMEOUT,true,function Callback)
endfunction

private function Init takes nothing returns nothing
    local trigger t = CreateTrigger()
    call BJDebugMsg(I2S(SHOCK_INTERVAL))
    call TriggerRegisterPlayerUnitEvent(t,Player(0),ConvertPlayerUnitEvent(39),null)
    call TriggerAddCondition(t,Condition(function Conditions))
    call TriggerAddAction(t,function Actions)
endfunction

endscope</i></i></i></i></i></i>


if you were to test that out you'd find that when the tauren goes to where the frost wyrm is...the frost wyrm dies, right?
well it doesn't work very well, and worse than that, there are crazy graphics popping up everytime you tell the tauren to go somewhere...
 

Darthfett

Aerospace/Cybersecurity Software Engineer
Reaction score
615
while the complicated version i'm sure is great...i don't understand it, can you make a simpler version? this is what i mean...
ok this is your spell for your map, right? now i put in a few comments throughout explaining why this is too complicated for me

This wasn't made to simply *kill* the unit. It is a demo spell that uses the system, so people can get an idea of what you can do with the system. Did you testplay the map?

Apparently you thought this spell was just a revised version of your trigger you PM'd to me.

Anyways, attached is a trigger that does what you want it to.
 

Attachments

  • Test Kill.w3x
    31 KB · Views: 245

SanKakU

Member
Reaction score
21
hey thanks man this looks so much better...

it shouldn't take much for me to modify it now. +rep +credits

Apparently you thought this spell was just a revised version of your trigger you PM'd to me.

nah, i just implied that you will make a simple version... in other words something like this what i asked you about.

i look forward to figuring out your system now that there is a simpler test spell to go along with it. as i said in the trigger comments...all the fireshock stuff was in he same trigger with all the EnterUnit stuff and i couldn't tell what was for what.

that's all i meant. a simple text message displaying the name of the center unit would've been just dandy. the test map doesn't need an entire spell attached, imo.

with all due respect though...that is a cool looking spell you made (yes i did check it out), but i think you should've made the hero level like 10. so people could see the power of all three levels without editing the map further...i only saw the first level which was really weak....but other than that it's fine for the most part. it's just that those footmen surround you and you would have to hit ESC like 5-10 times i guess until you kill them all.

oh my bad, you made this in october? i was really tired last night and thought some weird stuff, like that you made this system in 2005 ^_~ heh heh.
 

Darthfett

Aerospace/Cybersecurity Software Engineer
Reaction score
615
nah, i just implied that you will make a simple version... in other words something like this what i asked you about.

i look forward to figuring out your system now that there is a simpler test spell to go along with it. as i said in the trigger comments...all the fireshock stuff was in he same trigger with all the EnterUnit stuff and i couldn't tell what was for what.

that's all i meant. a simple text message displaying the name of the center unit would've been just dandy. the test map doesn't need an entire spell attached, imo.

Nah, when I make a sample, it really has to be a good sample. ;)

with all due respect though...that is a cool looking spell you made (yes i did check it out), but i think you should've made the hero level like 10. so people could see the power of all three levels without editing the map further...i only saw the first level which was really weak....but other than that it's fine for the most part. it's just that those footmen surround you and you would have to hit ESC like 5-10 times i guess until you kill them all.

oh my bad, you made this in october? i was really tired last night and thought some weird stuff, like that you made this system in 2005 ^_~ heh heh.

1. Your wish has been granted. I slightly changed the spell, and made him start out at level 10. I've also added another function to the system so that it can destroy the event with GetTriggeringTrigger() (I got this idea from the trigger I showed you, where I had to add the timer and all that stuff just to remove the event with GetTriggeringTrigger()).

2. Yeah, it's pretty recent. :p
 

SerraAvenger

Cuz I can
Reaction score
234
For me, it does not work. GetTriggeringTrigger() does not return the same trigger as the one that was created at the beginning - instead, it returns the same trigger at any instance oO

JASS:
private function CreateCP takes real x, real y returns nothing
    local unit new = CreateUnit( Players[ PLAYER_NEUTRAL_PASSIVE ], CP_ID, x, y, 270 )
    local trigger trig = TriggerRegisterEnterRange( new, 900, null )
    call TriggerAddAction( trig, function data_instance.actions )
    //call 
    
        call DisplayText( LOCAL_PLAYER, H2S( trig ) ) // Shows the right Ids
    
    set new = null
    set trig = null
endfunction


JASS:
        set .center = GetCenterUnit()
        call DisplayText( LOCAL_PLAYER, &quot;Entering range...&quot; )
        call DisplayText( LOCAL_PLAYER, GetUnitName( .center ) )
        call DisplayText( LOCAL_PLAYER, H2S( GetTriggeringTrigger() ) ) // Shows the same Id for all of the six instances I created
        if IsUnitEnemy( .center, Players[ .ownerId ] ) or GetPlayerController( GetOwningPlayer( .center ) ) == MAP_CONTROL_NEUTRAL then
            set .centerX = GetUnitX( .center )
            set .centerY = GetUnitY( .center )
            if IsUnitAlly( .caster, LOCAL_PLAYER ) then
                call PingMinimapEx( .centerX, .centerY, 10, 255, 51, 51, false )
            elseif IsUnitAlly( .caster, LOCAL_PLAYER ) then
                call PingMinimapEx( .centerX, .centerY, 10, 51, 255, 51, false )
            endif
            call .setRemaining( 5 ) // Replace 0 with the duration of the spell. 0 will instantly destroy the spell!
        else
            call .destroy()
        endif
 

Darthfett

Aerospace/Cybersecurity Software Engineer
Reaction score
615
I don't know what to tell you. It's working on my end:

JASS:
scope Test initializer Init
private function H2I takes handle h returns integer
    return h
    return 0
endfunction

private function H2S takes handle h returns string
    return I2S(H2I(h))
endfunction

private function Blah_Actions takes nothing returns nothing
    call BJDebugMsg(&quot;Enter: &quot; + GetUnitName(GetTriggerUnit()))
    call BJDebugMsg(&quot;Center: &quot; + GetUnitName(GetCenterUnit()))
    call BJDebugMsg(&quot;Center&#039;s: &quot; + H2S(GetTriggeringTrigger()))
endfunction

private function Actions takes nothing returns nothing
    local unit u = CreateUnit(Player(0),&#039;hfoo&#039;,400,0,0)
    local trigger t = TriggerRegisterUnitEnterRangeEvent(u,100,null)
    call TriggerAddAction(t,function Blah_Actions)
    call BJDebugMsg(&quot;Add: &quot; + H2S(t))
endfunction

//===========================================================================
private function Init takes nothing returns nothing
    local trigger t = CreateTrigger(  )
    call TriggerRegisterPlayerEventEndCinematic(t, Player(0) )
    call TriggerAddAction(t, function Actions )
endfunction

endscope


Creates a unit when you press ESC. Shows you the center unit/entering unit's name when one enters, and shows the trigger ID. It's the same trigger, unique to each unit every time for me.
 

SerraAvenger

Cuz I can
Reaction score
234
Found the bug. It is a JassHelper bug that has to do something with the way JH handles static methods as function argument when the method is declared AFTER the usage. (TriggerExecute?)

Just copied the whole struct two lines above the CreateCP function, and everything worked perfectly.

Please do mention this in the doku: In order to work with static methods as code argument, the static method has to be positioned higher in the map script than the code argument.
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      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