| 01-20-2006, 04:01 AM | #1 |
In my map, I'm trying to create a set of triggers so that when a player loses all of his non-building units, a coffin appears at the spot of his last dying unit. Any of his allies may then move any unit to the position of that coffin, and the coffin will disappear and a marine will be created for the player who lost all his units. Sounds simple enough, but it's not working :( Seems like everything works great except this line in my WhenUnitDies Trigger: Code:
Region - Center DeathRect[(Player number of (Triggering player))] on (Position of DeathMarker[(Player number of (Triggering player))]) This is the whole trigger for your reference: Code:
Lose All Guys
Events
Unit - A unit Dies
Conditions
And - All (Conditions) are true
Conditions
(Number of living Battlecruiser units owned by (Owner of (Triggering unit))) Equal to 0
(Number of living Firebat units owned by (Owner of (Triggering unit))) Equal to 0
(Number of living Ghost units owned by (Owner of (Triggering unit))) Equal to 0
(Number of living Goliath units owned by (Owner of (Triggering unit))) Equal to 0
(Number of living Marine units owned by (Owner of (Triggering unit))) Equal to 0
(Number of living Medic units owned by (Owner of (Triggering unit))) Equal to 0
(Number of living Siege Tank (Tank Mode) units owned by (Owner of (Triggering unit))) Equal to 0
(Number of living Valkyrie units owned by (Owner of (Triggering unit))) Equal to 0
(Number of living Wraith units owned by (Owner of (Triggering unit))) Equal to 0
Actions
Unit - Create 1 Death Marker for (Owner of (Triggering unit)) at (Position of (Triggering unit)) facing 180.00 degrees
Set DeathMarker[(Player number of (Triggering player))] = (Last created unit)
Unit - Make DeathMarker[(Player number of (Triggering player))] Invulnerable
Region - Center DeathRect[(Player number of (Triggering player))] on (Position of DeathMarker[(Player number of (Triggering player))])
Set ThisDudeIsDead[(Player number of (Owner of (Triggering unit)))] = True
The Revive trigger looks like this, say, for player 2, who is the test dummy when you select Test Map: Code:
Revive2
Events
Unit - A unit enters DeathP2 <gen>
Conditions
ThisDudeIsDead[2] Equal to True
Or - Any (Conditions) are true
Conditions
(Owner of (Triggering unit)) Equal to Player 1 (Red)
(Owner of (Triggering unit)) Equal to Player 3 (Teal)
(Owner of (Triggering unit)) Equal to Player 4 (Purple)
(Owner of (Triggering unit)) Equal to Player 5 (Yellow)
Actions
Unit - Remove DeathMarker[2] from the game
Floating Text - Create floating text that reads You're in DeathP2 above (Triggering unit) with Z offset 0.00, using font size 10.00, color (100.00%, 100.00%, 100.00%), and 0.00% transparency
Unit - Create 1 Marine for Player 2 (Blue) at (Center of DeathP2 <gen>) facing Default building facing degrees
Set ThisDudeIsDead[2] = False
By the way, I init. all the variables in Map Initialization. The reason I know (I think :P) that's the line is b/c I put in some floating text to tell me when I enter the region, and the entire trigger works... when I enter the area I created the region in WEU. Not where the coffin is. :( And yeah, I'm using WEU if that matters... just wondering if there's a bug or something since WEU felt the need to change "Region" to "Rect" >.> (doubt it...) |
| 01-20-2006, 04:25 AM | #2 |
Right off the bat. I don't think you can use triggering unit for a dead unit, since there is no unit there anymore to use. Use Dieing unit instead |
| 01-21-2006, 12:12 AM | #3 |
Hmm I'll try that. I thought I could since it's still decaying/waiting to see if it gets revived. EDIT: Didn't work still. Everything in the trigger seems to be working except the relocation of the DeathRect. >< |
| 01-21-2006, 01:07 AM | #4 | |
Quote:
Your problem is that you can move rects and it works and all. BUT the function that register the Enter rect event actually creates a region, then adds the rect to the region and register an enter even for tha region In other words, moving the rect does not update the region used by the event. |
| 01-21-2006, 08:07 PM | #5 |
So if i add something like Region - Add Last Created Rect to Region, that might fix it? |
| 01-21-2006, 08:35 PM | #6 |
If you know how to get that region. Which is impossible when you are using the GUI register rect event. You actually need to recode everything. So you don't depend on moving a rect that has the event registered or move to JASS |
| 01-22-2006, 12:13 AM | #7 |
Right now based on your conditions. You need all of the conditions as in all units of every type must be dead before a coffin forms.. Try using a <multiple or>.. (also this trigger restricts the number of units of each type to 1 unit.) This one looks kind of different from the rest (Number of living Siege Tank (Tank Mode) units owned by (Owner of (Triggering unit))) Equal to 0 |
| 03-03-2006, 03:08 AM | #8 |
Reviving this thread because I forgot to post the solution I found (rather obvious one, that took me until now xD): Changed the event to this: Trigger: Unit - A unit comes within 150.00 of Death Marker 0040 <gen>And got rid of the code that creates a Death Marker every time, and actually have 5 real markers with invis/locust/hidden on the map in an unbuildable spot that I move back and forth. Thx for the help! |
