Staredit Network > Forums > SC2 Assistance > Topic: Help please. If <unit dies> then do <this>
Help please. If <unit dies> then do <this>
Oct 21 2010, 10:31 pm
By: reapur  

Oct 21 2010, 10:31 pm reapur Post #1



Hi guys,
I've been playing around with the editors and I got stuck on something, let me lay out what I have:

It's basic scenario where the player is in a defensive position and I generate zergs to come at him in waves. Now what I want to do, is if the player can manage to destroy a structure that belongs to the zerg player, then the waves should stop.
I'm stuck on that little logic

In the triggers editor, I have
in the left pane
>Melee init< which contains the basic setup for allies and the default melee init
>Attack Waves< This is where I gen the waves
Events
+ Timer - Every (Random real between 10.0 and 20.0) seconds of Game Time
Local variables
+ x = 0.0 <Real>
+ Bugs = (Empty unit group) <Unit Group>

Actions:
+ General - If (Conditions) then do (Actions) else do (Actions)
++ General - For each real x from 1.0 to (Random real between 25.0 and 40.0) with increment 1.0, do (Actions)
+++ Actions
++++ Unit - Create 1 Zergling for player 2 at Point 001 using default facing (No Options)
+++++ Unit - Create 1 Zergling for player 2 at Point 001 using default facing (No Options)
+ Unit - Order all units in Bugs to ( Attack targeting Point 002) (After Existing Orders)

So this works well, they keep coming and coming :)
I've tried playing around with the IF THEN ELSE and the WHILE loops but I can't get any to work.

Say I assign the zerg to player 9, and I build a hatchery for him.
How do I say, if Player 1 kills <player 9 hatchery> then stop the waves.

I've tried wrapping the "waves" actions with an if statement that monitors a Unit Dies, the setting a new variable to 1 but I can't seem to get the logic in the right place.

Any advice?
Cheers



None.

Oct 21 2010, 10:59 pm payne Post #2

:payne:

You could try:

Event: Any unit dies.
Condition: Triggering unit == [Select the Hatchery in the unit list]
Action: Turn off current trigger
Turn off trigger "Spawn at Hatchery #1"



None.

Oct 21 2010, 11:02 pm Billy Post #3



as far as I can see, you are trying to involve an event into an action, which does not work, technically nor logically, or am I getting it wrong? However:


So you basically want the waves to spawn as long as the hatchery lives there?
Assuming you have several different hatcheries, there is one simple easy and flexible way of doing this:

Event: Every BLAH seconds
Conditions: Whatever you want
Action:
Pick each Unit in unit group -> Pick each(units in location owned by player) -> pick each (hatchery owned by player (owner goes in here) in Entire Map with a limit of No Limit) and do actions:
-> Create stuff at position of unit ( picked unit ) and order to move for last created units to whatsoever...

Hope this helped ya.



None.

Oct 22 2010, 12:47 am reapur Post #4



Thanks guys, very valuable input.
I didn't realize there was a TURN OFF TRIGGER action available :) that was too cool.

Best Regards



None.

Options
  Back to forum
Please log in to reply to this topic or to report it.
Members in this topic: None.
[02:53 am]
Mr.BurnLiquid -- Symmetry
Symmetry shouted: I'll check it out this weekend!
Thanks
[02:47 am]
Symmetry -- I'll check it out this weekend!
[02:40 am]
Mr.BurnLiquid -- Symmetry
Symmetry shouted: Another map maker? Damn we really ARE back
I invite you to try out the map I modified. I don't have the creativity to create maps from scratch, but I do have the know-how to modify existing ones; my project is to tweak community campaigns (specifically those with errors—to make them playable.
[02:27 am]
Symmetry -- Another map maker? Damn we really ARE back
[01:51 am]
Mr.BurnLiquid -- Ultraviolet
Ultraviolet shouted: Mr.BurnLiquid actually yeah though I wasn't really saying it to narc on you. It just caught me off guard because I don't usually see it (because it's against the rules) "The avatar may not be bigger than 150x150 pixels". Kinda silly that it relies on users to be well behaved rather than just limiting the dimensions on uploads :lol:
Now that I wanted to change my avatar, the error image is showing up, haha.
[01:34 am]
Mr.BurnLiquid -- Ultraviolet
Ultraviolet shouted: Mr.BurnLiquid actually yeah though I wasn't really saying it to narc on you. It just caught me off guard because I don't usually see it (because it's against the rules) "The avatar may not be bigger than 150x150 pixels". Kinda silly that it relies on users to be well behaved rather than just limiting the dimensions on uploads :lol:
Mr.BurnLiquid
Mr.BurnLiquid shouted: Ultraviolet Thanks; I'm new to the site and a Spanish speaker. I must have missed the part where it was prohibited—I'll change it now.
I invite you to try out a mission I'm modifying from *StarCraft Reversed*; I'm trying to make it more playable and challenging.
[01:33 am]
Mr.BurnLiquid -- Ultraviolet
Ultraviolet shouted: Mr.BurnLiquid actually yeah though I wasn't really saying it to narc on you. It just caught me off guard because I don't usually see it (because it's against the rules) "The avatar may not be bigger than 150x150 pixels". Kinda silly that it relies on users to be well behaved rather than just limiting the dimensions on uploads :lol:
Thanks; I'm new to the site and a Spanish speaker. I must have missed the part where it was prohibited—I'll change it now.
[01:31 am]
Ultraviolet -- Mr.BurnLiquid
Mr.BurnLiquid shouted: Ultraviolet Is it forbidden to have a large avatar?
actually yeah though I wasn't really saying it to narc on you. It just caught me off guard because I don't usually see it (because it's against the rules) "The avatar may not be bigger than 150x150 pixels". Kinda silly that it relies on users to be well behaved rather than just limiting the dimensions on uploads :lol:
[12:20 am]
Mr.BurnLiquid -- Ultraviolet
Ultraviolet shouted: https://staredit.net/profile/133367/ dude's avatar is massive
Is it forbidden to have a large avatar?
[12:04 am]
Ultraviolet -- https://staredit.net/profile/133367/ dude's avatar is massive
Please log in to shout.


Members Online: Mr.BurnLiquid, Moose