• 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.

a trigger request

Status
Not open for further replies.
Level 2
Joined
Mar 15, 2006
Messages
12
Im looking for a trigger so that when you type in a units name, it spawns the unit. Ive Tried this.

Player - Player 1 (Red) types a chat message containing (Name of No unit) as An exact match

(Entered chat string) Equal to (Name of No unit)

Unit - Create 1 (Unit-type of (Matching unit)) for (Triggering player) at (Center of (Playable map area)) facing Default building facing degrees

If sombody could help me out that would be great.
 
Level 4
Joined
Nov 22, 2004
Messages
62
Code:
spawn
    Events
        Player - Player 1 (Red) types a chat message containing spawn as A substring
        Player - Player 2 (Blue) types a chat message containing spawn as A substring
        Player - Player 3 (Teal) types a chat message containing spawn as A substring
        Player - Player 4 (Purple) types a chat message containing spawn as A substring
        Player - Player 5 (Yellow) types a chat message containing spawn as A substring
        Player - Player 6 (Orange) types a chat message containing spawn as A substring
    Conditions
    Actions
        Unit - Create (Integer((Substring((Entered chat string), 7, 8)))) (Unit-type((Substring((Entered chat string), 10, (Length of (Entered chat string)))))) for (Triggering player) at ((Triggering player) start location) facing Default building facing degrees


so if you type:
spawn 01 footman
it will spawn one footman for you at designed loaction (i used trigering player start loaction as an example)

spawning too many units at the same time may crash/lag game so choose a low ammount of units.
it works, i tested it, you must type the unit's name exactly.
 
Level 4
Joined
Nov 9, 2005
Messages
113
Raydrik said:
Code:
Unit - Create (Integer((Substring((Entered chat string), 7, 8)))) (Unit-type((Substring((Entered chat string), 10, (Length of (Entered chat string)))))) for (Triggering player) at ((Triggering player) start location) facing Default building facing degrees

What's the 7, 8 for? Or that 10?
 
Status
Not open for further replies.
Top