• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

[Solved] Unit Cage Spawning

Status
Not open for further replies.
Level 1
Joined
Jun 4, 2017
Messages
1
Can someone pls tell me how to do this i know how to spawn it for a specific player using triggers but not for the player that destroyed the cage. If there is a way please tell me.

P.S. It doesnt need to be a cage just a doodad when "killed" drops a unit
 
Level 14
Joined
Nov 17, 2010
Messages
1,265
Basically it just has to be triggered to create a unit when a certain destructible dies.
  • Cage Dies
    • Events
      • Destructible - Cage 42272 <gen> dies
    • Conditions
    • Actions
      • Set TempLoc = (Position of (Dying destructible))
      • Unit - Create 1 Footman for Player at TempLoc facing Default building facing (270.0) degrees
      • Custom script: call RemoveLocation(udg_TempLoc)
 
Level 11
Joined
Jun 2, 2004
Messages
849
If you want to do this for EVERY cage without having to manually add them, you can do this at the start of the map:

  • Untitled Trigger 002
    • Events
      • Time - Elapsed game time is 0.00 seconds
    • Conditions
    • Actions
      • Destructible - Pick every destructible in (Entire map) and do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Destructible-type of (Picked destructible)) Equal to Cage
            • Then - Actions
              • Trigger - Add to Cage Dies <gen> the event (Destructible - (Picked destructible) dies)
            • Else - Actions
And you can make different cages in the object editor and have them spawn different units, of course.
 

Dr Super Good

Spell Reviewer
Level 64
Joined
Jan 18, 2005
Messages
27,198
I assume "killing unit" does not work for destructable death events? If not then it is not really possible to do what you want.

Best compromise would be to weigh up possible killing units and choose which is the most likely. For example if a player has 50 units near it and another player only has 1 then give it to the player with 50 units as he is most likely to have killed it as he most likely has area control. applying weights to units might help so that 1 hero is worth more for the calculation than 5 trash units.
 
Status
Not open for further replies.
Top