• 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 help needed

Status
Not open for further replies.
Level 3
Joined
Jul 27, 2007
Messages
40
Two questions here how do you make a change name trigger and will somone help me make a tutorial on how to play the map I'm working on.
 
Level 15
Joined
Dec 18, 2007
Messages
1,098
You have ALOT of -reps...
Anyway, for the name changing trigger, I think there's a tutorial on it in the tutorials section.
But basically put, its something like this.
  • [[trigger]
  • Rename Simple
    • 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
    • Conditions
      • (Substring((Entered chat string), 1, 6)) Equal to -name
    • Actions
      • -------- Note: Theres a space after -name. --------
      • -------- You will need for this trigger... --------
      • -------- //A String Variable named NewName --------
      • -------- --------
      • -------- This is a simple rename trigger. --------
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Length of (Entered chat string)) Greater than 27
        • Then - Actions
          • -------- This takes everything after -name_ and adds it to NewName as long as its no longer then 20 characters. --------
          • Set NewName = (Substring((Entered chat string), 7, 27))
          • -------- If it is longer, it only takes 20, as shown above. --------
        • Else - Actions
          • Set NewName = (Substring((Entered chat string), 7, (Length of (Entered chat string))))
          • -------- If not, it takes all. --------
      • Player - Set name of (Triggering player) to NewName
      • -------- But what if you wanted to make it so players couldn't frame other players? --------
      • -------- Or frame you even, the creator of your map? --------
      • -------- What if you wanted to know who someones Original Name was before they changed it? --------
      • -------- Well this is all going to be explained, yay! --------
So what if you want to make a trigger that checks if it’s ok for the player to have that name. By ok I mean that it does not conflict with another player’s current name, original name, or any name on the BlockedName list I told you to make before.

OriginalName keeps track of the players original name, incase anyone wants to check who they are, and so no one gets mixed up. BlockedName is a list of 12 names that you want no one to change their name to in-game, like your name, so no one can frame you. But what happens if you join the game and your name is blocked? Well we can fix that too!
  • Rename
    • 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
    • Conditions
      • (Substring((Entered chat string), 1, 6)) Equal to -name
    • Actions
      • -------- Note: Theres a space after -name. --------
      • -------- You will need for this trigger... --------
      • -------- //A String Variable named NewName --------
      • -------- //A Boolean Variable named NameVio (Stands for NameViolation) --------
      • -------- --------
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Length of (Entered chat string)) Greater than 27
        • Then - Actions
          • -------- This takes everything after -name_ and adds it to NewName as long as its no longer then 20 characters. --------
          • Set NewName = (Substring((Entered chat string), 7, 27))
          • -------- If it is longer, it only takes 20, as shown above. --------
        • Else - Actions
          • Set NewName = (Substring((Entered chat string), 7, (Length of (Entered chat string))))
          • -------- If not, it takes all. --------
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • NewName Equal to OriginalName[(Player number of (Triggering player))]
        • Then - Actions
          • -------- This simply checks if the NewName is actually the players original name. --------
          • Player - Set name of (Triggering player) to NewName
          • Set PlayerName[(Player number of (Triggering player))] = ((Substring(PlayerName[(Player number of (Triggering player))], 1, 10)) + (NewName + |r))
          • Skip remaining actions
          • -------- If so, then it skips the rest, theres no point in continuing. --------
        • Else - Actions
      • For each (Integer A) from 1 to 12, do (Actions)
        • Loop - Actions
          • -------- For each integer is a loop action that goes through once for each number --------
          • -------- (Integer A) = The number of the current loop. --------
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • Or - Any (Conditions) are true
                • Conditions
                  • NewName Equal to (Name of (Player((Integer A))))
                  • NewName Equal to OriginalName[(Integer A)]
                  • NewName Equal to BlockedName[(Integer A)]
            • Then - Actions
              • -------- If - Or Any Condtions are True is on the bottom of the action menu. --------
              • -------- If you have more then 12 BlockedNames, you will have to edit this to check all of them. --------
              • -------- If it detects that the requested NewName is equal to any of the following... --------
              • -------- --The Current name of a player. --------
              • -------- --The Original Name of a player. --------
              • -------- --A Name on your Blocked Names list --------
              • Set NameVio = True
              • -------- It will set NameVio = True, which means the players name isn't going to be changed... --------
              • -------- To what he/she wants anyway :). --------
            • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • NameVio Equal to False
        • Then - Actions
          • -------- NameVio = False, no collision! The game will allow them to have that new name. --------
          • Player - Set name of (Triggering player) to NewName
          • Set PlayerName[(Player number of (Triggering player))] = ((Substring(PlayerName[(Player number of (Triggering player))], 1, 10)) + (NewName + |r))
          • -------- The Substring 1,10 is the Color Code. --------
          • -------- This Sets PlayerName = (The First 10 Characters of PlayerName(The Color Code)) + NewName + (|r) --------
        • Else - Actions
          • Set NewName = Stupid Idiot
          • -------- Aha!, a collision was detected, then now their new name will be Stupid Idiot. --------
          • -------- That'll teach them for trying to mess with people. --------
          • Player - Set name of (Triggering player) to NewName
          • Set PlayerName[(Player number of (Triggering player))] = ((Substring(PlayerName[(Player number of (Triggering player))], 1, 10)) + (NewName + |r))
TRIGGER]

The above is the part you wanted, here's the full tutorial: http://wc3campaigns.net/showpost.php?p=830809&postcount=1.
Remember to take a look at it.
 
Level 3
Joined
Jul 27, 2007
Messages
40
I can't get the name change trigger to work,I want to get that to work before I start working on the units and stuff
 
Level 3
Joined
Jul 27, 2007
Messages
40
Zack give me your email and I'll send the map to ya and maybe u can get it to to work or you could email me ether works for me. Oh and i did check the tutorial
 
Level 3
Joined
Jul 27, 2007
Messages
40
Well I can't get the Change name trigger working I'll need somone to help finsh the trigger as I said before email on the page.
 
Level 6
Joined
Apr 14, 2008
Messages
172
.. guys just ignore this guy, his selfish, he expect to get everything served for him on a silver plate, and if it is not, he go completely insane.

Also Zack1996, your trigger works just fine.. its actually quite good tho I needed to make a few adjustments, I'd be happy to come tomorrow to fix it.
 
Status
Not open for further replies.
Top