Alright, so I've been having trouble with my cat and mouse triggers and am trying to figure out my mistakes.
The problem is when mouse 1 dies the game ends.
Starting Spawn trigger
Player Group - Pick each player in (All players) and do (Actions)
Actions
Visibility - Create a visibility revealer for player (Picked player) within Winter Best Jail
Player Group - Pick each player in Mice Team and do (Actions)
Actions
Unit - Create 1 Mouse for player (Picked player) at (Random point in Winter Mouse Spawn) using default facing (No Options)
Unit Group - Add (Last created unit) to Mice
Unit Selection - Select (Last created unit) for player (Picked player)
Camera - Pan the camera for player (Picked player) to (Center of (Last created units)) over 0.0001 seconds with 100% initial velocity, 0% deceleration, and Do use smart panning
Unit Selection - Clear control group 1 for player (Picked player)
Unit Selection - Add (Last created unit) to control group 1 for player (Picked player)
Player Group - Pick each player in Cat Team and do (Actions)
Actions
Unit - Create 1 Cat for player (Picked player) at (Center of Winter Best Jail) using default facing (No Options)
Unit Group - Add (Last created unit) to Cats
Unit Selection - Select (Last created unit) for player (Picked player)
Camera - Pan the camera for player (Picked player) to (Center of (Last created units)) over 0.0001 seconds with 100% initial velocity, 0% deceleration, and Do use smart panning
Unit Selection - Clear control group 1 for player (Picked player)
Unit Selection - Add (Last created unit) to control group 1 for player (Picked player)
save trigger
Unit Group - Pick each unit in Captured and do (Actions)
Actions
Unit Group - Remove (Picked unit) from Captured
Unit - Replace (Picked unit) with a Mouse using New Unit's Default vitals
Unit Group - Add (Last created unit) to Mice
death trigger
Unit Dies
Events
Unit - Any Unit dies
Local Variables
Conditions
Actions
Unit Group - Pick each unit in Mice and do (Actions)
Actions
General - If (Conditions) then do (Actions) else do (Actions)
If
(Triggering unit) == (Picked unit)
Then
Unit Group - Remove (Triggering unit) from Mice
Unit Group - Pick each unit in (Any units in (Entire map) owned by player (Owner of (Triggering unit)) matching Excluded: Missile, Dead, Hidden, with at most Any Amount) and do (Actions)
Actions
Unit - Remove (Picked unit) from the game
Unit - Create 1 Captured Mouse for player (Owner of (Triggering unit)) at (Center of Jail) using default facing (No Options)
Unit Group - Add (Last created unit) to Captured
Else
General - If (Conditions) then do (Actions) else do (Actions)
If
(Number of Living units in Mice) < 1
Then
Player Group - Pick each player in Cat Team and do (Actions)
Actions
Game - End game in Victory for player (Picked player) (Show dialogs, Hide score screen)
Player Group - Pick each player in Mice Team and do (Actions)
Actions
Game - End game in Defeat for player (Picked player) (Show dialogs, Hide score screen)
Else
Unit Group - Pick each unit in Cats and do (Actions)
Actions
General - If (Conditions) then do (Actions) else do (Actions)
If
And
Conditions
(Triggering unit) == (Picked unit)
(Number of players in Cat Team) < 1
Then
Player Group - Pick each player in Cat Team and do (Actions)
Actions
Game - End game in Victory for player (Picked player) (Show dialogs, Hide score screen)
Player Group - Pick each player in Mice Team and do (Actions)
Actions
Game - End game in Victory for player (Picked player) (Show dialogs, Hide score screen)
Else
None.
Unit - Replace (Picked unit) with a Mouse using New Unit's Default vitals
Unit Group - Add (Last created unit) to Mice
I don't know if "Replace" fills the "Last created unit" function, thus possibly leaving the Mice unit group empty.
Unit Group - Pick each unit in (Any units in (Entire map) owned by player (Owner of (Triggering unit)) matching Excluded: Missile, Dead, Hidden, with at most Any Amount) and do (Actions)
Actions
Unit - Remove (Picked unit) from the game
Event is "Unit dies", in what way is it useful at all to remove the unit if it's dead? And anyways, the unit isn't Picked because your filter excludes Dead.
(Number of players in Cat Team) < 1
Not sure, but this might be your error.
Also, I don't see any trigger removing the Cats from their unit group.
None.
Unit - Replace (Picked unit) with a Mouse using New Unit's Default vitals
Unit Group - Add (Last created unit) to Mice
I don't know if "Replace" fills the "Last created unit" function, thus possibly leaving the Mice unit group empty.
That may be it I'll try something else
[
Unit Group - Pick each unit in (Any units in (Entire map) owned by player (Owner of (Triggering unit)) matching Excluded: Missile, Dead, Hidden, with at most Any Amount) and do (Actions)
Actions
Unit - Remove (Picked unit) from the game
Event is "Unit dies", in what way is it useful at all to remove the unit if it's dead? And anyways, the unit isn't Picked because your filter excludes Dead.
Yes the unit is picked because this is killing all the units owned by the player who's mouse just died. But also this doesn't work either so I'm not sure what I did wrong there.
(Number of players in Cat Team) < 1
Not sure, but this might be your error.
Also, I don't see any trigger removing the Cats from their unit group.
I'll disable it and see if it works. [EDIT] Nope didn't fix it.
there isn't a trigger that removes cats from their unit group yet, haven't added it.
Post has been edited 1 time(s), last time on Jan 14 2011, 12:06 am by JB4times4.
None.
Alright so I ended up getting it to work as follows:
Starting Spawn trigger
Player Group - Pick each player in (All players) and do (Actions)
Actions
Visibility - Create a visibility revealer for player (Picked player) within Winter Best Jail
Player Group - Pick each player in Mice Team and do (Actions)
Actions
Unit - Create 1 Mouse for player (Picked player) at (Random point in Winter Mouse Spawn) using default facing (No Options)
Unit Group - Add (Last created unit) to Mice
Unit Selection - Select (Last created unit) for player (Picked player)
Camera - Pan the camera for player (Picked player) to (Center of (Last created units)) over 0.0001 seconds with 100% initial velocity, 0% deceleration, and Do use smart panning
Unit Selection - Clear control group 1 for player (Picked player)
Unit Selection - Add (Last created unit) to control group 1 for player (Picked player)
Player Group - Pick each player in Cat Team and do (Actions)
Actions
Unit - Create 1 Cat for player (Picked player) at (Center of Winter Best Jail) using default facing (No Options)
Unit Group - Add (Last created unit) to Cats
Unit Selection - Select (Last created unit) for player (Picked player)
Camera - Pan the camera for player (Picked player) to (Center of (Last created units)) over 0.0001 seconds with 100% initial velocity, 0% deceleration, and Do use smart panning
Unit Selection - Clear control group 1 for player (Picked player)
Unit Selection - Add (Last created unit) to control group 1 for player (Picked player)
save trigger
Unit Group - Pick each unit in Captured and do (Actions)
Actions
Unit Group - Remove (Picked unit) from Captured
Unit - Replace (Picked unit) with a Mouse using New Unit's Default vitals
Unit Group - Add (Last created unit) to Mice
death trigger
Unit Group - Pick each unit in Mice and do (Actions)
Actions
General - If (Conditions) then do (Actions) else do (Actions)
If
(Triggering unit) == (Picked unit)
Then
Unit Group - Remove (Triggering unit) from Mice
Unit - Create 1 Captured Mouse for player (Owner of (Triggering unit)) at (Center of Jail) using default facing (No Options)
Unit Group - Add (Last created unit) to Captured
Unit Group - Pick each unit in (Any units in (Entire map) owned by player (Owner of (Triggering unit)) matching Excluded: Missile, Dead, Hidden, with at most Any Amount) and do (Actions)
Actions
Unit - Remove (Picked unit) from the game
Else
General - If (Conditions) then do (Actions) else do (Actions)
If
(Number of players in Mice Team) < 1
Then
Player Group - Pick each player in Cat Team and do (Actions)
Actions
Game - End game in Victory for player (Picked player) (Show dialogs, Hide score screen)
Player Group - Pick each player in Mice Team and do (Actions)
Actions
Game - End game in Defeat for player (Picked player) (Show dialogs, Hide score screen)
Else
Unit Group - Pick each unit in Cats and do (Actions)
Actions
General - If (Conditions) then do (Actions) else do (Actions)
If
And
Conditions
(Triggering unit) == (Picked unit)
(Number of players in Cat Team) < 1
Then
Player Group - Pick each player in Cat Team and do (Actions)
Actions
Game - End game in Victory for player (Picked player) (Show dialogs, Hide score screen)
Player Group - Pick each player in Mice Team and do (Actions)
Actions
Game - End game in Victory for player (Picked player) (Show dialogs, Hide score screen)
Else
CURRENT
Unit Group - Pick each unit in Mice and do (Actions)
Actions
General - If (Conditions) then do (Actions) else do (Actions)
If
(Triggering unit) == (Picked unit)
Then
Unit Group - Pick each unit in (Any units in (Entire map) owned by player (Owner of (Triggering unit)) matching Excluded: Missile, Dead, Hidden, with at most Any Amount) and do (Actions)
Actions
Unit - Remove (Picked unit) from the game
Unit Group - Remove (Triggering unit) from Mice
Unit - Create 1 Captured Mouse for player (Owner of (Triggering unit)) at (Center of Jail) using default facing (No Options)
Unit Group - Add (Last created unit) to Captured
Post has been edited 1 time(s), last time on Jan 14 2011, 2:32 am by JB4times4.
None.
I do stuff and thingies... Try widening and reducing the number of small nooks and crannies to correct the problem.
@ur prob in shoutbox (CURRENT)
miceDeathToArmageddon
Events
TriggerAddEventUnitDied(null)
Local Variables
unit = null <unit>
Conditions
Actions
ForEachUnitInGroup(unit,miceGroup)
actions
IfThenElse()
if
Comparison((EventUnit()),==,unit)
then
ForEachUnitInGroup(unit,(UnitGroup(null,(EventPlayer()),(RegionEntireMap()),except: projectiles, dead, hidden,0)))
actions
UnitRemove(unit)
CreateUnitsWithDefaultFacing(1,"Mothership",no options,(EventPlayer()),(RegionGetCenter((RegionEntireMap()))))
UnitGroupAdd(capturedGroup,(UnitLastCreated()))
SkipRemaining()
else
Here is how I finally got it working:
[collapse Starting Spawn Trigger]
Player Group - Pick each player in (All players) and do (Actions)
Actions
Visibility - Create a visibility revealer for player (Picked player) within Winter Best Jail
Player Group - Pick each player in Mice Team and do (Actions)
Actions
Unit - Create 1 Mouse for player (Picked player) at (Random point in Winter Mouse Spawn) using default facing (No Options)
Unit Group - Add (Last created unit) to Mice
Unit Selection - Select (Last created unit) for player (Picked player)
Camera - Pan the camera for player (Picked player) to (Center of (Last created units)) over 0.0001 seconds with 100% initial velocity, 0% deceleration, and Do use smart panning
Unit Selection - Clear control group 1 for player (Picked player)
Unit Selection - Add (Last created unit) to control group 1 for player (Picked player)
Player Group - Pick each player in Cat Team and do (Actions)
Actions
Unit - Create 1 Cat for player (Picked player) at (Center of Winter Best Jail) using default facing (No Options)
Unit Group - Add (Last created unit) to Cats
Unit Selection - Select (Last created unit) for player (Picked player)
Camera - Pan the camera for player (Picked player) to (Center of (Last created units)) over 0.0001 seconds with 100% initial velocity, 0% deceleration, and Do use smart panning
Unit Selection - Clear control group 1 for player (Picked player)
Unit Selection - Add (Last created unit) to control group 1 for player (Picked player)
[/collapse]
[collapse save trigger]
Events
Unit - Any Unit Enters Rescue
Local Variables
Conditions
((Triggering unit) is in Mice) == true
Actions
Unit Group - Pick each unit in Captured and do (Actions)
Actions
Unit Group - Remove (Picked unit) from Captured
Unit - Replace (Picked unit) with a Mouse using New Unit's Default vitals
Unit Group - Add (Last created unit) to Mice
[/collapse]
[collapse death trigger]
Events
Unit - Any Unit dies
Local Variables
Conditions
Actions
Unit Group - Pick each unit in Mice and do (Actions)
Actions
General - If (Conditions) then do (Actions) else do (Actions)
If
(Triggering unit) == (Picked unit)
Then
Player Group - Add player (Owner of (Picked unit)) to Remove Units
Player Group - Remove player (Owner of (Picked unit)) from Mice Team
Trigger - Run Remove Units (Check Conditions, Wait until it finishes)
Unit Group - Remove (Triggering unit) from Mice
Unit - Create 1 Captured Mouse for player (Owner of (Triggering unit)) at (Center of Jail) using default facing (No Options)
Unit Group - Add (Last created unit) to Captured
Trigger - Run Mice loose (Check Conditions, Wait until it finishes)
Trigger - Stop all instances of Unit Dies
Else
Unit Group - Pick each unit in Cats and do (Actions)
Actions
General - If (Conditions) then do (Actions) else do (Actions)
If
(Triggering unit) == (Picked unit)
Then
Player Group - Remove player (Owner of (Picked unit)) from Cat Team
General - If (Conditions) then do (Actions) else do (Actions)
If
(Number of players in Cat Team) < 1
Then
Player Group - Pick each player in Cat Team and do (Actions)
Actions
Game - End game in Victory for player (Picked player) (Show dialogs, Hide score screen)
Player Group - Pick each player in Mice Team and do (Actions)
Actions
Game - End game in Victory for player (Picked player) (Show dialogs, Hide score screen)
Else
Else
[/collapse]
[collapse mice loose]
General - If (Conditions) then do (Actions) else do (Actions)
If
(Number of players in Mice Team) < 1
Then
Player Group - Pick each player in Cat Team and do (Actions)
Actions
Game - End game in Victory for player (Picked player) (Show dialogs, Hide score screen)
Player Group - Pick each player in Mice Team and do (Actions)
Actions
Game - End game in Defeat for player (Picked player) (Show dialogs, Hide score screen)
Else
[/collapse]
[collapse Remove Units]
Unit Group - Pick each unit in (Any units in (Entire map) owned by player (Player 1 from Remove Units) matching Excluded: Missile, Dead, Hidden, with at most Any Amount) and do (Actions)
Actions
Unit - Remove (Picked unit) from the game
Player Group - Remove player (Player 1 from Remove Units) from Remove Units
[/collapse]
I'm writing up a tutorial since most the help I got isn't in this thread.
None.