Hi there,
I've got a problem with a trigger that's using Maker's "Get the Region that triggers the 'Unit enters Region'-Event"-System *yeah...
*
I've got a problem with a trigger that's using Maker's "Get the Region that triggers the 'Unit enters Region'-Event"-System *yeah...
*-
Melee Initialization
-

Events
-


Map initialization
-
-

Conditions
-

Actions
-


Custom script: local region r
-


Hashtable - Create a hashtable
-


Set RectHash = (Last created hashtable)
-


Set Trig___Region_Entering = Invis Entering <gen>
-


Set rectGrass[0] = Grass0 <gen>
-


For each (Integer A) from 1 to 1, do (Actions)
-



Loop - Actions
-




Custom script: set r = CreateRegion()
-




Custom script: call RegionAddRect(r, udg_rectGrass[bj_forLoopAIndex])
-




Custom script: call TriggerRegisterEnterRegion(udg_Trig___Region_Entering, r, null)
-




Custom script: call SaveRectHandle(udg_RectHash , GetHandleId(r), 0, udg_rectGrass[bj_forLoopAIndex] )
-




-------- Q1: This won't work, huh?^^ --------
-




-------- I want to save the Index of this region for requesting it inside of the Trigger "Invis Entering" --------
-




-------- Then I would be able to look via Integer-Array[saved Index] which team to choose --------
-




-------- Is there any solution? I'd prever the most efficient way, for learning^^ --------
-




Custom script: call SaveIntegerHandle(udg_RectHash, GetHandleId(bj_forLoopAIndex), 0, udg_rectGrass[bj_forLoopAIndex])
-




-------- *Custom Script above* --------
-
-
-


Custom script: set r = null
-
-
-
Invis Entering
-

Events
-


Unit - A unit enters Grass0 <gen>
-
-

Conditions
-

Actions
-


Custom script: set udg_Rect = LoadRectHandle(udg_RectHash , GetHandleId(GetTriggeringRegion()) , 0)
-


If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-



If - Conditions
-




iGrass[0] Equal to (Team number of (Owner of (Triggering unit)))
-
-



Then - Actions
-




-------- Q2: How to get entering unit for this trigger using JASS? (for the local) --------
-




Custom script: local unit udg_tempUnit = GetEnteringUnit()
-




-------- "GetEnteringUnit()" and "GetTriggerUnit()" are causing errors while saving the map --------
-




Custom script: call UnitAddAbility (udg_tempUnit, 'Apiv')
-




Set iGrass[0] = (Team number of (Owner of tempUnit))
-
-



Else - Actions
-




-------- Q3: This causes an error while saving the map too... why? --------
-




Custom script: local location udg_P = Location( GetRectCenterX(udg_Rect), GetRectCenterY(udg_Rect))
-




-------- *Custom Script above* --------
-




Unit Group - Pick every unit in (Units within 512.00 of P matching (((Matching unit) belongs to an enemy of (Owner of tempUnit)) Equal to True)) and do (Actions)
-





Loop - Actions
-






Custom script: call UnitRemoveAbility (GetEnumUnit(), 'Apiv')
-
-
-




Custom script: set udg_tempUnit = null
-




Custom script: call RemoveLocation(udg_P)
-




Custom script: set udg_P = null
-




Set iGrass[0] = 0
-
-
-
-
Last edited:

