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
 
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
 
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
 
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.
 
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
 
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.
  • V-SNES V-SNES:
    Happy Friday!
    +1
  • The Helper The Helper:
    News portal has been retired. Main page of site goes to Headline News forum now
  • The Helper The Helper:
    I am working on getting access to the old news portal under a different URL for those that would rather use that for news before we get a different news view.
  • Ghan Ghan:
    Easily done
    +1
  • The Helper The Helper:
    https://www.thehelper.net/pages/news/ is a link to the old news portal - i will integrate it into the interface somewhere when i figure it out
  • Ghan Ghan:
    Need to try something
  • Ghan Ghan:
    Hopefully this won't cause problems.
  • Ghan Ghan:
    Hmm
  • Ghan Ghan:
    I have converted the Headline News forum to an Article type forum. It will now show the top 20 threads with more detail of each thread.
  • Ghan Ghan:
    See how we like that.
  • The Helper The Helper:
    I do not see a way to go past the 1st page of posts on the forum though
  • The Helper The Helper:
    It is OK though for the main page to open up on the forum in the view it was before. As long as the portal has its own URL so it can be viewed that way I do want to try it as a regular forum view for a while
  • Ghan Ghan:
    Yeah I'm not sure what the deal is with the pagination.
  • Ghan Ghan:
    It SHOULD be there so I think it might just be an artifact of having an older style.
  • Ghan Ghan:
    I switched it to a "Standard" article forum. This will show the thread list like normal, but the threads themselves will have the first post set up above the rest of the "comments"
  • The Helper The Helper:
    I don't really get that article forum but I think it is because I have never really seen it used on a multi post thread
  • Ghan Ghan:
    RpNation makes more use of it right now as an example: https://www.rpnation.com/news/
  • The Helper The Helper:
  • The Helper The Helper:
    What do you think Tom?
  • tom_mai78101 tom_mai78101:
    I will have to get used to this.
  • tom_mai78101 tom_mai78101:
    The latest news feed looks good

      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