1. The poll for our 11th Music Contest is up! Help us choose the most awesome cinematic tracks by casting a vote!
    Dismiss Notice
  2. Melee Mapping contest #3 - Poll is up! Vote for the best 4v4 melee maps!
    Dismiss Notice
  3. The 30th edition of the Modeling Contest is finally up! The Portable Buildings need your attention, so come along and have a blast!
    Dismiss Notice
  4. The Aftermath has been revealed for the 19th Terraining Contest! Be sure to check out the Results and see what came out of it.
    Dismiss Notice

[Trigger] Change certain Playernames on Mapstart

Discussion in 'Triggers & Scripts' started by Sorceress, Jan 17, 2019.

  1. Sorceress

    Sorceress

    Joined:
    Jul 28, 2009
    Messages:
    1,023
    Resources:
    1
    Template:
    1
    Resources:
    1
    I tried playing around with namechanging on certain players joining my map, but it doesn't seem to react.
    What am i doing wrong?

    - On mapstart
    - Checking player 1-8
    - Check if playername matches
    - Change playername to [whatever]
    then nothing

    Here's how i set it up:
    • VIP
      • Events
        • Map initialization
      • Conditions
      • Actions
        • For each (Integer A) from 1 to 8, do (Actions)
          • Loop - Actions
            • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
              • If - Conditions
                • (Name of (Player((Integer A)))) Equal to Cutic
              • Then - Actions
                • Player - Set name of (Player((Integer A))) to Test Name
              • Else - Actions
                • Do nothing

    Thanks
     
  2. Shunpomaster

    Shunpomaster

    Joined:
    Jun 13, 2017
    Messages:
    75
    Resources:
    1
    Spells:
    1
    Resources:
    1
    Try removing the condition, if it worked, then condition is the problem.
    Try changing the event to elapsed time.
     
  3. Daffa the Mage

    Daffa the Mage

    Map Moderator

    Joined:
    Jan 30, 2013
    Messages:
    7,312
    Resources:
    22
    Packs:
    1
    Maps:
    8
    Spells:
    12
    Tutorials:
    1
    Resources:
    22
    I would suggest doing such things at 0.00 elapsed time.
     
  4. Sorceress

    Sorceress

    Joined:
    Jul 28, 2009
    Messages:
    1,023
    Resources:
    1
    Template:
    1
    Resources:
    1
    Hi, sorry for the late reply. Won't i need the conditions to tell which playername it should trigger on?
    Also elapsed game time didn't do anything sadly.
     
  5. IcemanBo

    IcemanBo

    Joined:
    Sep 6, 2013
    Messages:
    5,856
    Resources:
    22
    Maps:
    3
    Spells:
    11
    Template:
    1
    Tutorials:
    4
    JASS:
    3
    Resources:
    22
    It should work fine, code is okay. Could you post a sample map?
     
  6. Shunpomaster

    Shunpomaster

    Joined:
    Jun 13, 2017
    Messages:
    75
    Resources:
    1
    Spells:
    1
    Resources:
    1
    Change integer A to Integer Variable, because if you have another integer A loop that could be the reason.

    I always remove the condition or change it when something is not working just to test if it was actually the condition what is messing it up.

    Do nothing at the end is not needed you can remove it.
     
  7. Sorceress

    Sorceress

    Joined:
    Jul 28, 2009
    Messages:
    1,023
    Resources:
    1
    Template:
    1
    Resources:
    1
    What should i add for the variable? Not that experienced with this..

    It's in a private project sadly, would prefer not sharing it


    ////

    Here's how it looks now:

    • VIP
      • Events
        • Time - Elapsed game time is 5.00 seconds
      • Conditions
      • Actions
        • For each (Integer A) from 1 to 8, do (Actions)
          • Loop - Actions
            • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
              • If - Conditions
                • (Name of (Player((Integer A)))) Equal to Cutic
                • (Name of (Player((Integer A)))) Equal to Koga73
              • Then - Actions
                • Player - Set name of (Player((Integer A))) to Test Name
                • Player - Set name of (Matching player) to Test Name
              • Else - Actions
                • Do nothing
     
  8. IcemanBo

    IcemanBo

    Joined:
    Sep 6, 2013
    Messages:
    5,856
    Resources:
    22
    Maps:
    3
    Spells:
    11
    Template:
    1
    Tutorials:
    4
    JASS:
    3
    Resources:
    22
    You create a new map for a sample map, so you don't have to share your project. There, you can re-create your bugged scenario and share it.
     
  9. Shunpomaster

    Shunpomaster

    Joined:
    Jun 13, 2017
    Messages:
    75
    Resources:
    1
    Spells:
    1
    Resources:
    1
    In action options after for each integer A, there is for each integer B, then after that there is for each integer Variable.

    Make an integer variable and name it loop or whatever you want, then put it in place of integer A.

    Every time you make a loop, just make an integer variable and use it for the loop instead of integer A or B.


    Your current condition won't work because using 2 conditions together without (Or), means both conditions need to be there for it to work, and by adding two names in condition it will never work since no player can have both conditions.

    Btw do you actually need to know the player name?
    If not just remove the condition to change all players name or you can add the condition if player is playing.
     
    Last edited: Jan 29, 2019