Debris for doodads

joaoac

Active Member
Reaction score
11
Oh, I tried search (learnt to allways do that, before ask on a new thread) and found nothing.

I have units as doodads models (wells, houses, etc.).
The point is that when they die, don't leave debris (debris is that desctructed stuff on the ground, right?) and don't have dying animations.
For the animations, ok, but how can I make them make debris.

If it's by triggers, I don't have any idea on how to code this.

Thanks in advance.
 

MurderMode

Giving new meaning to co-op... slowly
Reaction score
154
It's because the doodads don't have any animations, they are just static models. Bought the best you can do is when it dies, remove it from game and play a special effect of an explosion or something at the point of death
 

Sajberhippie

New Member
Reaction score
30
This MAY be a way to solve it. Haven't tried it, but in my mind it should work. Somebody please correct me if it don't.

Create a unit called "debris" or whatever, with the model of the debris you want (perhaps ruined building?). Set it to locust and all other things that a dummy unit has except it should have a graphic. Then, use this trigger:

Code:
Debris
    Events
        Destructible - A destructible within (Playable map area) dies
    Conditions
        (Destructible-type of (Dying destructible)) Equal to YOUR DESTRUCTIBLE-TYPE
    Actions
        Unit - Create 1 "debris" for Neutral Passive at (Position of (Dying destructible)) facing Default building facing degrees
        Unit - Add a 30.00 second Generic expiration timer to (Last created unit)
This should do the trick.
 

joaoac

Active Member
Reaction score
11
The code I made, based of your tips.
Code:
Well of Water dies
    Events
        Unit - A unit Dies
    Conditions
        (Unit-type of (Triggering unit)) Equal to Well of Fresh Water
    Actions
        Special Effect - Create a special effect at (Position of (Triggering unit)) using abilities\weapons\DemolisherMissile\DemolisherMissile.mdl
        Wait 1.00 seconds
        Unit - Remove (Triggering unit) from the game
        Special Effect - Destroy (Last created special effect)

Thanks Sajberhippie and MurderMode.
AdamGriffith, no it doesn't matter.

I couldn't find the building death's animation (explosion, woods on fire, etc,) so I used demolisher's missile. If someone can help me to find that, I ll be glad.
Thanks again!
 

MurderMode

Giving new meaning to co-op... slowly
Reaction score
154
Objects\Spawnmodels\Human\HCancelDeath\HCancelDeath.mdl

ok with your trigger, I'm not sure... but there may be instances where it doesn't work.

The reason I think this is because if 2 wells die on the map before the 1 second wait is up, then the first one destroyed won't be removed. (this is because the dying units id will be changed to that of the new dying unit, and it will complete the trigger in place of the first one.)

I might be wrong about that however, because using triggering unit like you have might be a solid way of doing it. You should just test it out incase, or get someone who has good knowledge of leaks just to check it out for you.
 

Andyoyo

TH.net Regular
Reaction score
22
yeah just use a custom unit & change its model file to the doodad you want. Also make sure it is neutral so you won't auto-target it as an enemy :D
 

joaoac

Active Member
Reaction score
11
Murdermode, sure it can do errors. It's not finished. I ll get an eye at your said.
I tested only for 1 player.
This unit is intended to be for 1 player's RPG. But if it grows for multi-player, it's better take care of the tweaks.
Thanks again.

Andyoyo, what are talking about dude?
 

vypur85

Hibernate
Reaction score
803
Code:
Well of Water dies
    Events
        Unit - A unit Dies
    Conditions
        (Unit-type of (Triggering unit)) Equal to Well of Fresh Water
    Actions
        Special Effect - Create a special effect at (Position of (Triggering unit)) using abilities\weapons\DemolisherMissile\DemolisherMissile.mdl
        Special Effect - Destroy (Last created special effect)
        Wait 1.00 seconds
        [B]Unit - Remove (Triggering unit) from the game[/B]

Destroy the effect immediately after use if possible. The trigger above is MUI. Anyway, you can remove the bolded line if you want to. Just change the unit's Art - Death time (forgot the exact name) to 1.0 second and make it does not decay. Not too sure if it would work though. Else just use the above trigger.
 

MurderMode

Giving new meaning to co-op... slowly
Reaction score
154
Ok, I think I have thought up a more efficient way to do it.

When your doodad building dies, remove that unit from the game and create a new human structure unit for nuetral passive at the point of the triggering unit, then instantly kill it. It will play the death animation for the human structure right after the well of water dies :D

Code:
Doodad Explosion
    Events
        Unit - A unit Dies
    Conditions
        (Unit-type of (Triggering unit)) Equal to Well of Water
    Actions
        Unit - Remove (Triggering unit) from the game
        Unit - Create 1 Cannon Tower for Nuetral Passive at (Position of (Triggering unit)) facing (Position of (Triggering unit))
        Unit - Kill (Last created unit)

I really think this will work better then using waits and adding special effects
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Members online

      No members online now.

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top