Event and region

NoobImbaPro

You can change this now in User CP.
Reaction score
60
let's say I create a event witch is for entering a region. Is there anyway to use a function like GetTriggerRegion or something like that?
(to get the region the unit entered directly)
 

Jedi

New Member
Reaction score
63
No, you need to save region somewhere to get it.(I hope you mean "rects", you can get region with GetTriggeringRegion)
 

NoobImbaPro

You can change this now in User CP.
Reaction score
60
Yes I mean Rects, so I can't even get or make a GetTriggerRegion() like GetTriggerUnit() ?
Damn
 

NoobImbaPro

You can change this now in User CP.
Reaction score
60
That's great thanks, but is there any way to get the name of gg_rtc data's ?
 

NoobImbaPro

You can change this now in User CP.
Reaction score
60
I registered in a trigger all my regions, depending from their name they do something, I want to get the triggering rect and check its name to do a bunch of actions I need.
 

NoobImbaPro

You can change this now in User CP.
Reaction score
60
rectwraps does not have any GetRegionName(GetTriggeringRegion).

Nevermind I created this and works very well.
JASS:

scope Regions initializer action

    struct Region
        rect rec
        region reg
        string name
        static trigger t
        
        static method get takes region reg returns thistype
            local integer i = 0
            loop
                set i = i + 1
            exitwhen thistype(i) == 0
                if thistype(i).reg == reg then
                    return thistype(i)
                endif
            endloop
            
            return 0
        endmethod
        
        static method create takes string s, rect r returns thistype
            local thistype this = thistype.allocate()
            set this.name = s
            set this.rec = r
            set this.reg = CreateRegion()
            call RegionAddRect(this.reg, r)
            call TriggerRegisterEnterRegion(Region.t, this.reg, null)
            
            return this
        endmethod
        
        static method Actions takes nothing returns nothing
            local Region  r = Region.get(GetTriggeringRegion())
            local string  s = r.name
            local integer i
            
            if SubString(s, 7, 15) == "OpenGate" then
                set i = S2I(SubString(s, 15, 17))
                call ModifyGateBJ( bj_GATEOPERATION_DESTROY, gate<i> )
            elseif SubString(s, 7, 16) == &quot;StartArea&quot; then
                call CreateFogModifierRectBJ( true, GetLocalPlayer(), FOG_OF_WAR_VISIBLE, r.rec )
            endif
        endmethod
        
        static method onInit takes nothing returns nothing
            set Region.t = CreateTrigger()
            call TriggerAddAction(Region.t, function Region.Actions)
        endmethod
        
        //! textmacro RegionCreate takes id, name
            local Region $id$ = Region.create(&quot;$name$&quot;, $name$)
        //! endtextmacro
    endstruct
    
    globals
        destructable array gate
    endglobals

    private function action takes nothing returns nothing
        //! runtextmacro RegionCreate(&quot;Area2&quot;, &quot;gg_rct_StartArea2&quot;)
        //! runtextmacro RegionCreate(&quot;Area3&quot;, &quot;gg_rct_StartArea3&quot;)
        //! runtextmacro RegionCreate(&quot;Area4&quot;, &quot;gg_rct_OpenGate01&quot;)
        
        set gate[1] = gg_dest_LTe4_0836
        
        call UnitShareVision(gg_unit_ntav_0000, GetLocalPlayer(), true)
        call CreateFogModifierRectBJ( true, GetLocalPlayer(), FOG_OF_WAR_VISIBLE, gg_rct_StartArea )
    endfunction
endscope</i>
 

Sevion

The DIY Ninja
Reaction score
413
I don't think you realize how to use Rectwraps...

But whatever, if that works, then you can use that.
 

NoobImbaPro

You can change this now in User CP.
Reaction score
60
Of course I don't know, if you think you know a solution you could write it and not go to the safest way "I don't think you realize how to use Rectwraps..."
I just want a string and there is no function that takes region/rect and returns string
 

NoobImbaPro

You can change this now in User CP.
Reaction score
60
@Sevion: I just made a handmade version of what I need.

@tooltiperror: you use now zinc? is it better?

Also thanks for the help, but I already know that way of solving my problem. I thougth there was a "hidden" native or something like IsUnitAlive and asked.

WTF: is your text highlighted in your editor?? because I don't get any functions using jasshelper...
EDIT: Updated TESH...
 

Sevion

The DIY Ninja
Reaction score
413
Zinc is in no way better or worse than vJASS or JASS2. The only differences are the syntax's.
 
General chit-chat
Help Users

      The Helper Discord

      Staff online

      Members online

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top