Staredit Network > Forums > SC2 Assistance > Topic: Kill/Rescue system
Kill/Rescue system
Jan 13 2011, 7:58 pm
By: LooKe  

Jan 13 2011, 7:58 pm LooKe Post #1



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

save trigger

death trigger




None.

Jan 13 2011, 8:40 pm payne Post #2

:payne:

Quote from 2nd trigger
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.

Quote from 3rd trigger
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.

Quote from 3rd trigger
(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.

Jan 13 2011, 9:00 pm LooKe Post #3



Quote from payne
Quote from 2nd trigger
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
Quote from payne
[
Quote from 3rd trigger
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.

Quote from payne
Quote from 3rd trigger
(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.

Jan 14 2011, 2:20 am LooKe Post #4



Alright so I ended up getting it to work as follows:


Starting Spawn trigger

save trigger

death trigger




CURRENT


Post has been edited 1 time(s), last time on Jan 14 2011, 2:32 am by JB4times4.



None.

Jan 14 2011, 3:02 am Ahli Post #5

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)
Code
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





Jan 14 2011, 4:31 am LooKe Post #6



Here is how I finally got it working:

[collapse Starting Spawn Trigger]
Code
       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]
Code
   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]
Code
   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]
Code
       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]
Code
       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.

Options
  Back to forum
Please log in to reply to this topic or to report it.
Members in this topic: None.
[11:17 am]
Zycorax -- :wob:
[2024-4-27. : 9:38 pm]
NudeRaider -- Ultraviolet
Ultraviolet shouted: NudeRaider sing it brother
trust me, you don't wanna hear that. I defer that to the pros.
[2024-4-27. : 7:56 pm]
Ultraviolet -- NudeRaider
NudeRaider shouted: "War nie wirklich weg" 🎵
sing it brother
[2024-4-27. : 6:24 pm]
NudeRaider -- "War nie wirklich weg" 🎵
[2024-4-27. : 3:33 pm]
O)FaRTy1billion[MM] -- o sen is back
[2024-4-27. : 1:53 am]
Ultraviolet -- :lol:
[2024-4-26. : 6:51 pm]
Vrael -- It is, and I could definitely use a company with a commitment to flexibility, quality, and customer satisfaction to provide effective solutions to dampness and humidity in my urban environment.
[2024-4-26. : 6:50 pm]
NudeRaider -- Vrael
Vrael shouted: Idk, I was looking more for a dehumidifer company which maybe stands out as a beacon of relief amidst damp and unpredictable climates of bustling metropolises. Not sure Amazon qualifies
sounds like moisture control is often a pressing concern in your city
[2024-4-26. : 6:50 pm]
Vrael -- Maybe here on the StarEdit Network I could look through the Forums for some Introductions to people who care about the Topics of Dehumidifiers and Carpet Cleaning?
[2024-4-26. : 6:49 pm]
Vrael -- Perhaps even here I on the StarEdit Network I could look for some Introductions.
Please log in to shout.


Members Online: Zycorax