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

[Trigger] Need some help with Town Renaming trigger

Status
Not open for further replies.
Level 2
Joined
Apr 27, 2008
Messages
29
I have been trying to create a trigger that will rename a town to whatever the player typed into the chat box. A dialog menu shows up it gives a list of current towns and their names (It is assumed that the player will eventually own more then one town). Once the player clicks on a town he/she then types something in the chat box that will be the town name. This is the trigger so far.

First Trigger
  • Events
  • Player - Player 1 (Red) types a chat message containing -Rename Town as An exact match
  • Conditions
  • NumberofTowns Greater than 0
  • Actions
  • Dialog - Show Towns for Player 1 (Red)
Second Trigger
  • Events
  • Dialog - A dialog button is clicked for Towns
  • Conditions
  • Actions
  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
    • If - Conditions
      • (Clicked dialog button) Equal to Dialogebutton[7]
    • Then - Actions
      • Game - Display to Player Group - Player 1 (Red) the text: (Please type in a new name for your town + TownName)
      • Wait 5.00 seconds
      • Trigger - Run Naming Your town contd <gen> (ignoring conditions)
    • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Clicked dialog button) Equal to Dialogebutton[8]
        • Then - Actions
          • Dialog - Hide Towns for Player 1 (Red)
        • Else - Actions
Third Trigger
  • Events
  • Conditions
  • Actions
    • Set TownName = (Entered chat string)
    • Game - Display to Player Group - Player 1 (Red) the text: (Your Town is now named + TownName)
Once the trigger is run it doesn't work and the name displayed is the original name. Can some help me in getting this trigger to work?
 
Level 3
Joined
Jun 6, 2007
Messages
48
Maybe the renaming trigger needs an event?

  • Change Name Dialog
    • Events
      • Dialog - A dialog button is clicked for Towns
    • Conditions
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
      • If - Conditions
        • (Clicked dialog button) Equal to Dialogebutton[7]
      • Then - Actions
        • Game - Display to Player Group - Player 1 (Red) the text: (Please type in a new name for your town + TownName)
        • Trigger - Turn on Town Rename<gen>
      • Else - Actions
        • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Clicked dialog button) Equal to Dialogebutton[8]
        • Then - Actions
          • Dialog - Hide Towns for Player 1 (Red)
        • Else - Actions
  • Rename Town
    • Events
      • Player - Player (#) types a chat message containing - as A substring
    • Conditions
      • (Entered chat string) Not equal to -Rename Town
    • Actions
      • Set TownName = (Entered chat string)
      • Game - Display to Player Group - Player 1 (Red) the text: (Your Town is now named + TownName)
 
Level 4
Joined
Sep 18, 2007
Messages
104
Not sure, but you might want to clear the dialog in the beginning of the trigger, but since you says it works fine it might not do anything.
 
Level 2
Joined
Apr 27, 2008
Messages
29
Yeah I did that after i knew exactly how to make the naming system work properly. If it wasn't cleared it would keep adding in 2 new buttons every time your typed in -rename town.:xxd:
 
Status
Not open for further replies.
Top