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
  • WildTurkey WildTurkey:
    is there a stephen green in the house?
    +1
  • The Helper The Helper:
    What is up WildTurkey?
  • The Helper The Helper:
    Looks like Google fixed whatever mistake that made the recipes on the site go crazy and we are no longer trending towards a recipe site lol - I don't care though because it motivated me to spend alot of time on the site improving it and at least now the content people are looking at is not stupid and embarrassing like it was when I first got back into this like 5 years ago.
  • The Helper The Helper:
    Plus - I have a pretty bad ass recipe collection now! That section of the site is 10 thousand times better than it was before
  • The Helper The Helper:
    We now have a web designer at my job. A legit talented professional! I am going to get him to redesign the site theme. It is time.
  • Varine Varine:
    I got one more day of community service and then I'm free from this nonsense! I polished a cop car today for a funeral or something I guess
  • Varine Varine:
    They also were digging threw old shit at the sheriff's office and I tried to get them to give me the old electronic stuff, but they said no. They can't give it to people because they might use it to impersonate a cop or break into their network or some shit? idk but it was a shame to see them take a whole bunch of radios and shit to get shredded and landfilled
  • The Helper The Helper:
    whatever at least you are free
  • Monovertex Monovertex:
    How are you all? :D
    +1
  • Ghan Ghan:
    Howdy
  • Ghan Ghan:
    Still lurking
    +3
  • 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 Discord

      Staff online

      Members online

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top