Why Does it Say Player 6?

Squeekems

TH.net Regular
Reaction score
11
In this 6 player map I am making, there are 6 villages (owned by computer-players 7-12). Each user-player is given a single unit which can be used to assist the villages. Assisting a village is as simple as killing creeps in the village. Doing so gives the user-player reputation with the town. Getting your reputation up with one village brings your reputation down with all the other villages since all of them are at war with each other.

So, when a creep is killed in a town, all of the reputations are displayed for the user-player. I also made it so user-players can simple type "!rep" to see this list. The problem is that the list that shows for the player in this way has a misprint. For the last town, instead of saying the correct name, "Yellowview" (Player 12's name), it says "Player 6." I have no idea why. Here are some of the triggers of the map.

I more to this trigger, but I did not want to spam. I thought it might be necessary for understanding the trigger that handles the list.

Trigger:
  • Initialization
    • Events
      • Map initialization
    • Conditions
    • Actions
      • Set Color[0] = |cffFF0000
      • Set Color[1] = |cff0000FF
      • Set Color[2] = |cff00FFFF
      • Set Color[3] = |cff8E35EF
      • Set Color[4] = |cffFFFF00
      • Set Color[5] = |cffFF8040
      • Set Color[6] = |cff00FF00
      • Set Color[7] = |cffFAAFBE
      • Set Color[8] = |cff736F6E
      • Set Color[9] = |cffADDFFF
      • Set Color[10] = |cff254117
      • Set Color[11] = |cff804000
      • Set Color[12] = |cff000000
      • For each (Integer A) from 0 to 5, do (Actions)
        • Loop - Actions
          • Set VillageController[(Integer A)] = (Integer A)


[ljass]Reputation[/ljass] is an array of integers. I am using it as a 2-dimensional array. Reputation[((Player Number x 7) + Village Number-6)]. If I need to explain this more, let me know. If you have a better way of doing it, PLEASE let me know. <( >_<)> Lol.

Trigger:
  • Display Reputation
    • Events
      • Player - Player 1 (Red) types a chat message containing !rep as An exact match
      • Player - Player 2 (Blue) types a chat message containing !rep as An exact match
      • Player - Player 3 (Teal) types a chat message containing !rep as An exact match
      • Player - Player 4 (Purple) types a chat message containing !rep as An exact match
      • Player - Player 5 (Yellow) types a chat message containing !rep as An exact match
      • Player - Player 6 (Orange) types a chat message containing !rep as An exact match
    • Conditions
    • Actions
      • Set TempForce = (Player group((Triggering player)))
      • For each (Integer A) from 1 to 6, do (Actions)
        • Loop - Actions
          • Game - Display to TempForce the text: ((Color[((Integer A) + 5)] + (Name of (Player((VillageController[(Integer A)] + 6))))) + (|r: + (String(Reputation[(((Player number of (Triggering player)) x 7) + VillageController[(Integer A)])]))))
      • Custom script: call DestroyForce(udg_TempForce)


EDIT:
Here's the loop that plays when a creep dies in a village. It works. Again, let me know if you need anything more clear.

Trigger:
  • For each (Integer A) from 0 to 5, do (Actions)
    • Loop - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Village[(Integer A)] contains TempPoint[2]) Equal to True
        • Then - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • Or - Any (Conditions) are true
                • Conditions
                  • (Owner of (Killing unit)) Equal to Player 1 (Red)
                  • (Owner of (Killing unit)) Equal to Player 2 (Blue)
                  • (Owner of (Killing unit)) Equal to Player 3 (Teal)
                  • (Owner of (Killing unit)) Equal to Player 4 (Purple)
                  • (Owner of (Killing unit)) Equal to Player 5 (Yellow)
                  • (Owner of (Killing unit)) Equal to Player 6 (Orange)
            • Then - Actions
              • Set Reputation[(((Player number of (Owner of (Killing unit))) x 7) + (VillageController[(Integer A)] + 1))] = (Reputation[(((Player number of (Owner of (Killing unit))) x 7) + (VillageController[(Integer A)] + 1))] + 2)
              • Set TempForce = (Player group((Owner of (Killing unit))))
              • Game - Display to TempForce the text: ((Color[((Integer A) + 6)] + (Name of (Player((VillageController[(Integer A)] + 7))))) + (|r: + (String(Reputation[(((Player number of (Owner of (Killing unit))) x 7) + ((Integer A) + 1))]))))
              • Custom script: call DestroyForce(udg_TempForce)
            • Else - Actions
        • Else - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • Or - Any (Conditions) are true
                • Conditions
                  • (Owner of (Killing unit)) Equal to Player 1 (Red)
                  • (Owner of (Killing unit)) Equal to Player 2 (Blue)
                  • (Owner of (Killing unit)) Equal to Player 3 (Teal)
                  • (Owner of (Killing unit)) Equal to Player 4 (Purple)
                  • (Owner of (Killing unit)) Equal to Player 5 (Yellow)
                  • (Owner of (Killing unit)) Equal to Player 6 (Orange)
            • Then - Actions
              • Set Reputation[(((Player number of (Owner of (Killing unit))) x 7) + (VillageController[(Integer A)] + 1))] = (Reputation[(((Player number of (Owner of (Killing unit))) x 7) + (VillageController[(Integer A)] + 1))] - 1)
              • Set TempForce = (Player group((Owner of (Killing unit))))
              • Game - Display to TempForce the text: ((Color[((Integer A) + 6)] + (Name of (Player((VillageController[(Integer A)] + 7))))) + (|r: + (String(Reputation[(((Player number of (Owner of (Killing unit))) x 7) + ((Integer A) + 1))]))))
              • Custom script: call DestroyForce(udg_TempForce)
            • Else - Actions
 

TheLegend

New Member
Reaction score
10
first of all does it write the names of the other players right. If yes then check the VillageControler variable cause it may be 0 for "Integer A = 6"... WWW i just saw it, In the first trigger with the setting your loop goes from 0 to 5 instead of 1 to 6
 

TheLegend

New Member
Reaction score
10
sorry for the double post but in the first trigger the loop sets from integers 0 to 5 but in the second trigger you looped from 1 to 6 so thats the problem
VillageControlerg[6] was never declared and VillageControler[0] wasnt used
 

Squeekems

TH.net Regular
Reaction score
11
That is not right. I thought it was right when you pointed it out, but now the first entry says "Player 6." Also, all of the names are down one. I am switching it back to what I had.
 

TheLegend

New Member
Reaction score
10
ok in the first trigger you have to use loop 1 to 6 cause GUI cant pick player 0, minimum for gui is player 1 then the second trigger would write
Trigger:
  • Game - Display to TempForce the text: ((Color[6] + (Name of (Player(7)))) + |r)

i skipped that part with rep. it should work normally
 

Squeekems

TH.net Regular
Reaction score
11
I'm sure that would work, but I need it to work in this context. I don't know why, but it's working for every other name. I edited the first post with my loop that is played when a creep is killed in a village. It works. You'll see the same thing occurring with Integer A being 0-5 this time.

EDIT:
Never mind! I figured out where I was misunderstanding. Thanks for pointing me in the right direction. Here's the final product:

Trigger:
  • Display Reputation
    • Events
      • Player - Player 1 (Red) types a chat message containing !rep as An exact match
      • Player - Player 2 (Blue) types a chat message containing !rep as An exact match
      • Player - Player 3 (Teal) types a chat message containing !rep as An exact match
      • Player - Player 4 (Purple) types a chat message containing !rep as An exact match
      • Player - Player 5 (Yellow) types a chat message containing !rep as An exact match
      • Player - Player 6 (Orange) types a chat message containing !rep as An exact match
    • Conditions
    • Actions
      • Set TempForce = (Player group((Triggering player)))
      • For each (Integer A) from 1 to 6, do (Actions)
        • Loop - Actions
          • Game - Display to TempForce the text: (Color[((Integer A) + 5)] + ((Name of (Player((VillageController[((Integer A) - 1)] + 7)))) + (|r: + (String(Reputation[(((Player number of (Triggering player)) x 7) + VillageController[(Integer A)])])))))
      • Custom script: call DestroyForce(udg_TempForce)
 
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