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.
  • Ghan Ghan:
    Howdy
  • Ghan Ghan:
    Still lurking
    +3
  • The Helper The Helper:
    I am great and it is fantastic to see you my friend!
    +1
  • The Helper The Helper:
    If you are new to the site please check out the Recipe and Food Forum https://www.thehelper.net/forums/recipes-and-food.220/
  • Monovertex Monovertex:
    How come you're so into recipes lately? Never saw this much interest in this topic in the old days of TH.net
  • Monovertex Monovertex:
    Hmm, how do I change my signature?
  • tom_mai78101 tom_mai78101:
    Signatures can be edit in your account profile. As for the old stuffs, I'm thinking it's because Blizzard is now under Microsoft, and because of Microsoft Xbox going the way it is, it's dreadful.
  • The Helper The Helper:
    I am not big on the recipes I am just promoting them - I use the site as a practice place promoting stuff
    +2
  • Monovertex Monovertex:
    @tom_mai78101 I must be blind. If I go on my profile I don't see any area to edit the signature; If I go to account details (settings) I don't see any signature area either.
  • The Helper The Helper:
    You can get there if you click the bell icon (alerts) and choose preferences from the bottom, signature will be in the menu on the left there https://www.thehelper.net/account/preferences
  • The Helper The Helper:
    I think I need to split the Sci/Tech news forum into 2 one for Science and one for Tech but I am hating all the moving of posts I would have to do
  • The Helper The Helper:
    What is up Old Mountain Shadow?
  • The Helper The Helper:
    Happy Thursday!
    +1
  • Varine Varine:
    Crazy how much 3d printing has come in the last few years. Sad that it's not as easily modifiable though
  • Varine Varine:
    I bought an Ender 3 during the pandemic and tinkered with it all the time. Just bought a Sovol, not as easy. I'm trying to make it use a different nozzle because I have a fuck ton of Volcanos, and they use what is basically a modified volcano that is just a smidge longer, and almost every part on this thing needs to be redone to make it work
  • Varine Varine:
    Luckily I have a 3d printer for that, I guess. But it's ridiculous. The regular volcanos are 21mm, these Sovol versions are about 23.5mm
  • Varine Varine:
    So, 2.5mm longer. But the thing that measures the bed is about 1.5mm above the nozzle, so if I swap it with a volcano then I'm 1mm behind it. So cool, new bracket to swap that, but THEN the fan shroud to direct air at the part is ALSO going to be .5mm to low, and so I need to redo that, but by doing that it is a little bit off where it should be blowing and it's throwing it at the heating block instead of the part, and fuck man
  • Varine Varine:
    I didn't realize they designed this entire thing to NOT be modded. I would have just got a fucking Bambu if I knew that, the whole point was I could fuck with this. And no one else makes shit for Sovol so I have to go through them, and they have... interesting pricing models. So I have a new extruder altogether that I'm taking apart and going to just design a whole new one to use my nozzles. Dumb design.
  • Varine Varine:
    Can't just buy a new heatblock, you need to get a whole hotend - so block, heater cartridge, thermistor, heatbreak, and nozzle. And they put this fucking paste in there so I can't take the thermistor or cartridge out with any ease, that's 30 dollars. Or you can get the whole extrudor with the direct driver AND that heatblock for like 50, but you still can't get any of it to come apart
  • Varine Varine:
    Partsbuilt has individual parts I found but they're expensive. I think I can get bits swapped around and make this work with generic shit though
  • Ghan Ghan:
    Heard Houston got hit pretty bad by storms last night. Hope all is well with TH.
  • The Helper The Helper:
    Power back on finally - all is good here no damage
    +2
  • V-SNES V-SNES:
    Happy Friday!
    +1

      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