Triggers: Abilities, Variables, Floating Text...

Paladin

New Member
Reaction score
8
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...

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! :D
 

AceHart

Your Friendly Neighborhood Admin
Reaction score
1,495
While I don't exactly see what those triggers are supposed to do,
these two can't really work together:
> Player - Player 1 (Red) types a chat message containing -name as A substring
> CityName[(Custom value of (Casting unit))] Equal to City
 

Squishy

You can change this now in User CP.
Reaction score
127
Like Acehart said, what are the triggers supposed to do?
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Members online

      No members online now.

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top