Warcraft III resources & community, 2003–2006 · archived

a trigger request

7 posts
#1

a trigger request

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.
#2
the only way i know how you could do this is by making seperate triggers for each unit but otherwise i dont know how
#3
I got the idea from the cheats of Tree Tag where you can do it. It was in JASS which is probaly what i have to do
#4

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.
#6
Raydrik

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?
#7
spawn 01 f o o t.m.a.n.
123456789101112........

Got it ? ;)