Staredit Network > Forums > SC2 Assistance > Topic: Help Req: how to detect a killed player
Help Req: how to detect a killed player
Oct 22 2010, 4:54 pm
By: reapur  

Oct 22 2010, 4:54 pm reapur Post #1



Hi Guys,
is there a trick to determine if a player no longer has any more structures?
Or player is dead (not surrendered)

I need to execute a trigger when player x has killed all structures of player y

thanks



None.

Oct 22 2010, 5:12 pm NicholasBeige Post #2



Pretty easy if I think about it.

You want a Global Variable (of Type Boolean), with default value as false... Call it Player_X_isdead?

Next, you make a trigger that will change the state of this variable (ie, if the player is = dead or = alive). In your example I think you will want it to be something like

Event -Any Unit Dies...
Condition - Dying Unit = Structure owned by Player_X
Actions -
If - units of type structure owned by player_x = 0
then - set Player_X_isdead? to True
else - do nothing.



None.

Oct 22 2010, 5:20 pm Temp Post #3



Pretty sure there is an easier way to do this with the melee events. I don't have access to the editor right now so if someone wants to check they can or I will edit this later.

EDIT: There does not seem to be an easy way to tell if a player has suffered a defeat but has not left them game.. very odd

Post has been edited 1 time(s), last time on Oct 22 2010, 6:00 pm by Temp.



None.

Oct 22 2010, 6:24 pm Billy Post #4



Variable is pointless :S

You need a trigger to run when player x has no more buildings? then use cardinals action but replace the set variable code with "run trigger" or w/e you want. Also, it might not be clear what cardinal meant by this condition
"Number of units in unit group -> units in region owned by player -> set filter to whatever you want.



None.

Oct 22 2010, 6:56 pm reapur Post #5



cardinal, this is where I'm stuck, I can't find a way to specify this
Condition - Dying Unit = Structure owned by Player_X

Billy, I know, that's what I'm struggling with, unless you accept surrender there doesn't seem to be any way to rule a player "dead"
so what I'm trying to do is see if a player has zero structures left then mark him as dead :0



None.

Oct 22 2010, 7:11 pm Billy Post #6



Ok, you got to use this condition:
Attribute check for Unit Type ( Triggering Unit, Structure) == true

As for player, another simple condition:
Owner of unit ( Triggering Unit ) = X


And for your condition which you asked in first manner, this is simple:
Number of units in unit group
-> units in location owned by player
--> Any units in Entire map owned by PLAYER with Filters (edit these!) to .... Structure: required.... with at most no limit
== 0.



None.

Oct 23 2010, 5:38 am Roy Post #7

An artist's depiction of an Extended Unit Death

Is something like this what you want?

KilledPlayer
    Events
        Unit - Any Unit dies
    Local Variables
    Conditions
        ((Unit type of (Triggering unit)) has Structure attribute) == true
        (Number of Living units in (Any units in (Entire map) owned by player (Owner of (Triggering unit)) matching Required: Structure, with at most Any Amount)) <= 0
    Actions
        ------- Actions for losing player

For your actions, you can set a boolean or whatever you want to happen when a player has no more structures.




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: Excalibur