• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

[Trigger] Change certain Playernames on Mapstart

Status
Not open for further replies.
Level 14
Joined
Jul 28, 2009
Messages
1,085
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
 
Level 5
Joined
Jun 13, 2017
Messages
83
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.
 
Level 14
Joined
Jul 28, 2009
Messages
1,085
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.

What should i add for the variable? Not that experienced with this..

It should work fine, code is okay. Could you post a sample map?

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
            • 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
 
Last edited:
Level 5
Joined
Jun 13, 2017
Messages
83
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:
Status
Not open for further replies.
Top