- Joined
- Jun 30, 2006
- Messages
- 230
Sometimes you wish to relate regions to particular players. In my case, I need 1 region per player that only his units can trigger. Each of these regions does the same thing, only they do them for the player related to the region. Using normal GUI regions, you cannot do a reasonable test to see which region was triggered without creating a trigger for each region. I'm doing the same thing, but all that is changing is a player and a region? Psh, in my mind that screams for a 1 trigger.
So I set out to make a mini-system which used global region arrays to be able to adequately determine which region belongs to which player. If
Now... unless I missed something crucial... the attached map should work, yet it does not....
Edit: I am beginning to believe that TriggerRegisterEnterRegion does not even work... TriggerRegisterEnterRectSimple is as follows:
So in theory, I could make my own regions, add a rect to it, and then use it globally... Unless my logic is wrong in my map, it proves you cannot do this, which sucks. It means you cannot efficiently relate Regions and Players...
Someone please prove me wrong.
So I set out to make a mini-system which used global region arrays to be able to adequately determine which region belongs to which player. If
region[0]
belongs to Player(0)
and so forth through all players, this should work. Before I set out to do this... I just experimented with global regions, as using local regions would require a handle system...Now... unless I missed something crucial... the attached map should work, yet it does not....
Edit: I am beginning to believe that TriggerRegisterEnterRegion does not even work... TriggerRegisterEnterRectSimple is as follows:
JASS:
function TriggerRegisterEnterRectSimple takes trigger trig, rect r returns event
local region rectRegion = CreateRegion()
call RegionAddRect(rectRegion, r)
return TriggerRegisterEnterRegion(trig, rectRegion, null)
endfunction
So in theory, I could make my own regions, add a rect to it, and then use it globally... Unless my logic is wrong in my map, it proves you cannot do this, which sucks. It means you cannot efficiently relate Regions and Players...
Someone please prove me wrong.