HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

Terrain comparison problem

11-06-2009, 05:47 PM#1
Sirenfal
So, i'm working on an Angel Arena-type map, and I have an array of units called Heroes, which is each players' hero. This trigger is supposed to kill heroes that leave the arena. The terrain outside the arena is always Square Tiles. This trigger never works. I know the terrain check is the part that is failing but I can't figure out why.

What's wrong with this?

Thanks.

Trigger:
Collapse Events
Time - Every 0.50 seconds of game time
Conditions
Collapse Actions
Collapse For each (Integer A) from 1 to 12, do (Actions)
Collapse Loop - Actions
Collapse If (All Conditions are True) then do (Then Actions) else do (Else Actions)
Collapse If - Conditions
(Heroes[(Integer A)] is alive) Equal to True
Collapse Then - Actions
Collapse If (All Conditions are True) then do (Then Actions) else do (Else Actions)
Collapse If - Conditions
// Fails here
(Terrain type at (Position of Heroes[(Integer A)])) Equal to Cityscape - Square Tiles
Collapse Then - Actions
Unit - Set life of Heroes[(Integer A)] to ((Percentage life of Heroes[(Integer A)]) - 20.00)%
Else - Actions
Else - Actions
11-06-2009, 06:28 PM#2
Tot
I'd use Unit Leaves Rect Events and use the arena as rect
11-10-2009, 01:17 AM#3
Sirenfal
Quote:
Originally Posted by Tot
I'd use Unit Leaves Rect Events and use the arena as rect

The arena is more complex with that. I'd end up with like 60 regions to cover it correctly. If I used one big region then there'd be a lot of parts you could blink out without suffering the penalty.

Not to mention other parts of the map, such as the duel arena that would technically fall out of the area of the arena.
11-10-2009, 06:24 AM#4
Tot
Quote:
Originally Posted by Sirenfal
So, i'm working on an Angel Arena-type map, and I have an array of units called Heroes, which is each players' hero. This trigger is supposed to kill heroes that leave the arena. The terrain outside the arena is always Square Tiles. This trigger never works. I know the terrain check is the part that is failing but I can't figure out why.

What's wrong with this?

Thanks.

Trigger:
Collapse Events
Time - Every 0.50 seconds of game time
Conditions
Collapse Actions
Collapse For each (Integer A) from 1 to 12, do (Actions)
Collapse Loop - Actions
Collapse If (All Conditions are True) then do (Then Actions) else do (Else Actions)
Collapse If - Conditions
(Heroes[(Integer A)] is alive) Equal to True
Collapse Then - Actions
Collapse If (All Conditions are True) then do (Then Actions) else do (Else Actions)
Collapse If - Conditions
// Fails here
(Terrain type at (Position of Heroes[(Integer A)])) Equal to Cityscape - Square Tiles
Collapse Then - Actions
Unit - Set life of Heroes[(Integer A)] to ((Percentage life of Heroes[(Integer A)]) - 20.00)%
Else - Actions
Else - Actions

Did you store the Heroes in the array? I couldn't think of any other problem you could have, cuz the triggers seems to be ok
11-10-2009, 06:27 PM#5
Sirenfal
Quote:
Originally Posted by Tot
Did you store the Heroes in the array? I couldn't think of any other problem you could have, cuz the triggers seems to be ok

Yeah, Heroes array seems fine, but i'll double check. If not I guess i'll have to go with the 60 region option. =(
11-10-2009, 07:39 PM#6
Tot
Quote:
Originally Posted by Sirenfal
Yeah, Heroes array seems fine, but i'll double check. If not I guess i'll have to go with the 60 region option. =(

Checked by hand or by debug messages?

I'll add some "...TextMessage(GetUnitName(Heroes[(Integer A)]))" thingy befor and after each "if"