• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.

Creating any Destructible/Doodad with a chat command.

Status
Not open for further replies.
Level 5
Joined
Oct 7, 2005
Messages
102
Can anyone give me a trigger that will let a player spawn any Destructible/Doodad by simply saying it's name in chat?

I would like it to also involve setting a variable to the created Destructible/Doodad so it can be spawned faster and more easily in a different way.

I would also like it to be spawned at a unit's location please, the name of the location is "TheCreator".

Thanks a lot guys.
 
You can't create a doodad in-game, only destructibles. Since destructibles don't have a similar action like units (CreateUnitByName()), you will need a list.
  • Trigger
  • Events
    • Map Initialization
  • Conditions
  • Actions
    • Set Strings[1] = bridge
    • Set Strings[2] = ship
    • Set Destructibles[1] = Force Bridge (Vertical)
    • Set Destructibles[2] = Ship
    • For each (Integer A) from 1 to 12, do (Actions)
      • Loop - Actions
        • Trigger - Add to Trigger2 <gen> the event (Player - Player(IntegerA) types a message containing <Empty String> as A substring
  • Trigger2
  • Events
  • Conditions
  • Actions
    • For each (IntegerB) from 1 to 2, do (Actions)
      • Loop - Actions
        • If (All conditions are true) then do (Actions) else do (Actions)
          • If - Conditions
            • (Entered chat string) Equal to Strings[(IntegerB)]
          • Then - Actions
            • Custom script: set bj_wantDestroyGroup = true
            • Unit Group - Pick every unit in (Units owned by (Triggering player) of type TheCreator) and do (Actions)
              • Loop - Actions
                • Set Point1 = (Position of (Picked unit))
                • Destructible - Create a Destructibles[(IntegerB)] at Point1 facing (Random angle) with scale 1.00 and variation 0
                • Custom script: call RemoveLocation (udg_Point1)
          • Else - Actions
 
Level 5
Joined
Oct 7, 2005
Messages
102
If you mean I would have to change the units models to that of destructables. Then no, it's still not worth the emense effort involved.
 
Status
Not open for further replies.
Top