• 🏆 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!
  • ✅ The POLL for Hive's Texturing Contest #33 is OPEN! Vote for the TOP 3 SKINS! 🔗Click here to cast your vote!

chat message summon help

Status
Not open for further replies.
Level 2
Joined
Apr 25, 2009
Messages
20
Hey, i got some help earlier, and i think ive figured it out, but ive tested the map and it doesnt seem to work. the chat message contains -a1 ,(a letter ie: f, g)(and a space) at positions 4-5 and a number at position 6-6. the idea is to create a unit for neutral hostile within a spawn region, the type of unit being described by the letter in the chat message, and the number also in the chat message. here is my trigger

Player - Player 1 (Red) types a chat message containing -a1 as A substring
Conditions
Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(Substring((Entered chat string), 4, 5)) Equal to f
Then - Actions
Set pickedunittype = Footman
Else - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(Substring((Entered chat string), 4, 5)) Equal to g
Then - Actions
Set pickedunittype = Grunt
Else - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(Substring((Entered chat string), 4, 5)) Equal to r
Then - Actions
Set pickedunittype = Rifleman
Else - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(Substring((Entered chat string), 4, 5)) Equal to t
Then - Actions
Set pickedunittype = Troll Headhunter
Else - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(Substring((Entered chat string), 4, 5)) Equal to a
Then - Actions
Set pickedunittype = Abomination
Else - Actions
Set UnitNumber = (Integer((Substring((Entered chat string), 6, 6))))
Wait 1.00 game-time seconds
Unit - Create UnitNumber pickedunittype for Neutral Hostile at (Center of SpawnA1 <gen>) facing Default building facing degrees

any suggestions, even if it totally changes the trigger, would be greatly appreciated. I dont no how to use JASS yet (although im gona read the tutorial), so any comments about JASS wont be very useful

thanks :)
 
Level 37
Joined
Mar 6, 2006
Messages
9,240
Use
  • [/ TRIGGER] tags.
  • Can't see what's wrong there, this trigger spawns 6 footmen if I type
  • -a1 f6
  • [TRIGGER]Untitled Trigger 063
    • Events
      • Player - Player 1 (Red) types a chat message containing -a1 as A substring
    • Conditions
      • (Substring((Entered chat string), 4, 5)) Equal to f
    • Actions
      • Set Temp_UnitType = Footman
      • Set Temp_Integer_1 = (Integer((Substring((Entered chat string), 6, 6))))
      • Wait 1.00 seconds
      • Set Temp_Loc_1 = (Position of Barracks 0114 <gen>)
      • Unit - Create Temp_Integer_1 Temp_UnitType for Player 1 (Red) at Temp_Loc_1 facing Default building facing degrees
      • Custom script: call RemoveLocation(udg_Temp_Loc_1)
Make sure you have included the space in your "Equal to f" comparison.
 
Level 2
Joined
Apr 25, 2009
Messages
20
thanks,looking at your trigger, i just realized what a stupid mistake i made.
(-a1 ) takes up 4 spots. the dash, the a the 1 and the space.
i had the letter set to position 4, so my entire trigger just contradicted itself.

... and something totally different...i know this is gona sound stupid but. im new here, and i kant quiet figure out how to delete a thread... Wtf?!?!? thers no delete button or anything!!
 
Status
Not open for further replies.
Top