Take the 2-minute tour ×
Game Development Stack Exchange is a question and answer site for professional and independent game developers. It's 100% free, no registration required.

I'm working with Starcraft 2 Map Editor, and am having a little bit of a trigger problem.

It's quite easy to detect when a specific unit kills a structure (simply check if triggering unit == whatever) but I'm not quite sure how to tell when a building dies to to either fire (terran buildings) or bleeding out (zerg buildings when off creep).

What condition should I be looking for in my "a unit dies" trigger to see if one of those two situations occured?

PS: Sorry for lack of available tags!

share|improve this question
1  
This seems better for the gaming SE maybe? Its a fine line, but there might be more expertise over there. –  coderanger Aug 24 '10 at 3:19
1  
Should be at gaming.stackexchange.com –  Noctrine Aug 24 '10 at 3:48
6  
Noctrine, the community there has said it's not on topic for them: meta.gaming.stackexchange.com/questions/562/… and the discussion on our meta points to yes: meta.gamedev.stackexchange.com/questions/58/…, reopening. –  Tetrad Aug 24 '10 at 4:24
    
@Tetrad, it feels so weird. But after reading the gaming communities thread I agree. –  Noctrine Aug 24 '10 at 4:34
3  
"Use map settings" from SC1 and now Custom maps on SC2 is a real game development community that have innovated in a lot of game-plays. I don't see why this would be off-topic. –  DFectuoso Aug 26 '10 at 5:58
show 1 more comment

2 Answers

up vote 4 down vote accepted

There is a behavior for Terran buildings that applies the burning effect periodically if the building's health is below 1/3. To see if a building is killed by this effect, you could do this:

Events
    Unit - Any Unit takes Fatal Any damage (from Any effects)
Local Variables
Conditions
    (Damaging effect) == BurndownDamage (Unnamed)
    (Unit type of (Triggering unit)) == <building>

Edit: I forgot the zerg building part, but it's exactly the same but with a different effect:

    (Damaging effect) == ZergBuildingNotOnCreepDamage (Unnamed)
share|improve this answer
    
Ha, how soon after my own answer did you post this? :P –  Raven Dreamer Aug 27 '10 at 1:26
    
I read the post and then opened the editor and looked it up, then typed up my reply and submitted it and saw yours there. So pretty much right after :P. –  BarakatX2 Aug 27 '10 at 2:37
add comment

I've been poking around. I've determined that every terran building has an effect "Terran Burn Down" or some such, that I assume is what is actually causing the damage.

I'm not sure of the specifics, exactly, but I imagine one of two things should be possible:

  • The building counts as its own killer (because its death is related to an effect it 'owns')
  • The death can be tracked by attributing it to the effect, something along the lines of "Unit dies" Condition: Killing Effect == Terran Burn Down.

I imagine the zerg buildings have a similar 'requires creep' ability.

I'll keep investigating and keep this open in case someone can provide a fuller answer.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.