I'm having trouble with these two triggers; first off, only thr first city can be named and if I name a second city, the city doensn't have a floating text and it actually doesn't have a name...
---
If you could help, I would very appreciate it.
+Rep!
Code:
Name
Events
Unit - A unit Begins casting an ability
Conditions
(Unit-type of (Casting unit)) Equal to City
Actions
Set City[(Custom value of (Casting unit))] = (Casting unit)
Set CityName[(Custom value of (Casting unit))] = City
Floating Text - Destroy FT[(Custom value of (Casting unit))]
Unit Group - Pick every unit in (Units owned by (Owner of (Casting unit))) and do (Actions)
Loop - Actions
Unit - Remove Rename City from (Picked unit)
---
Code:
City
Events
Player - Player 1 (Red) types a chat message containing -name as A substring
Player - Player 2 (Blue) types a chat message containing -name as A substring
Player - Player 3 (Teal) types a chat message containing -name as A substring
Conditions
Actions
Unit Group - Pick every unit in (Units owned by Player 1 (Red) of type Town ( Other )) and do (Actions)
Loop - Actions
Unit - Add Rename City to (Picked unit)
Unit Group - Pick every unit in (Units owned by Player 1 (Red) of type City ( Other )) and do (Actions)
Loop - Actions
Unit - Add Rename City to (Picked unit)
Unit Group - Pick every unit in (Units owned by Player 1 (Red) of type City) and do (Actions)
Loop - Actions
Unit - Add Rename City to (Picked unit)
If ((Entered chat string) Equal to -name City) then do (Skip remaining actions) else do (Do nothing)
If ((Substring((Entered chat string), 7, 21)) Equal to ) then do (Skip remaining actions) else do (Do nothing)
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
CityName[(Custom value of (Casting unit))] Equal to City
Then - Actions
Set CityName[(Custom value of (Casting unit))] = (<Empty String> + (Substring((Entered chat string), 6, 21)))
Floating Text - Create floating text that reads (ColorStrings[(Player number of (Owner of City[(Custom value of (Casting unit))]))] + (Substring((Entered chat string), 6, 21))) above City[(Custom value of (Casting unit))] with Z offset -50.00, using font size 12.00, color (100.00%, 100.00%, 100.00%), and 0.00% transparency
Set FT[(Custom value of (Casting unit))] = (Last created floating text)
Else - Actions
If you could help, I would very appreciate it.
+Rep!