• 🏆 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!
  • 🏆 Hive's 6th HD Modeling Contest: Mechanical is now open! Design and model a mechanical creature, mechanized animal, a futuristic robotic being, or anything else your imagination can tinker with! 📅 Submissions close on June 30, 2024. Don't miss this opportunity to let your creativity shine! Enter now and show us your mechanical masterpiece! 🔗 Click here to enter!

Referencing specific multiboard rows/items

Status
Not open for further replies.
Is it possible to reference specific multiboard items/rows? I have a trigger that dynamically creates multiboard items/rows, but I can't find a way to reference the specific rows that was created, only how to reduce the row count by one.

Here is my create row trigger:

  • Create Key Items Multiboard
    • Events
      • Time - Elapsed game time is 0.00 seconds
    • Conditions
    • Actions
      • Set MultiBoardRows = 0
      • Multiboard - Create a multiboard with 1 columns and 1 rows, titled Key Items:
      • Set KeyItemsMultiBoard = (Last created multiboard)
      • Multiboard - Minimize KeyItemsMultiBoard
      • Multiboard - Set the width for KeyItemsMultiBoard item in column 1, row 1 to 15.00% of the total screen width

  • Create Item 1
    • Events
      • Player - Player 1 (Red) types a chat message containing 1 as An exact match
    • Conditions
    • Actions
      • Trigger - Turn off (This trigger)
      • Set MultiBoardRows = (MultiBoardRows + 1)
      • Multiboard - Change the number of rows for KeyItemsMultiBoard to MultiBoardRows
      • Multiboard - Set the display style for KeyItemsMultiBoard item in column 1, row MultiBoardRows to Show text and Show icons
      • Multiboard - Set the text for KeyItemsMultiBoard item in column 1, row MultiBoardRows to Key Item 1
      • Multiboard - Set the icon for KeyItemsMultiBoard item in column 1, row MultiBoardRows to ReplaceableTextures\CommandButtons\BTNAcorn.blp
      • Multiboard - Set the width for KeyItemsMultiBoard item in column 1, row MultiBoardRows to 15.00% of the total screen width

  • Create Item 2
    • Events
      • Player - Player 1 (Red) types a chat message containing 2 as An exact match
    • Conditions
    • Actions
      • Trigger - Turn off (This trigger)
      • Set MultiBoardRows = (MultiBoardRows + 1)
      • Multiboard - Change the number of rows for KeyItemsMultiBoard to MultiBoardRows
      • Multiboard - Set the display style for KeyItemsMultiBoard item in column 1, row MultiBoardRows to Show text and Show icons
      • Multiboard - Set the text for KeyItemsMultiBoard item in column 1, row MultiBoardRows to Key Item 2
      • Multiboard - Set the icon for KeyItemsMultiBoard item in column 1, row MultiBoardRows to ReplaceableTextures\CommandButtons\BTNSpellShieldAmulet.blp
      • Multiboard - Set the width for KeyItemsMultiBoard item in column 1, row MultiBoardRows to 15.00% of the total screen width

  • Create Item 3
    • Events
      • Player - Player 1 (Red) types a chat message containing 3 as An exact match
    • Conditions
    • Actions
      • Trigger - Turn off (This trigger)
      • Set MultiBoardRows = (MultiBoardRows + 1)
      • Multiboard - Change the number of rows for KeyItemsMultiBoard to MultiBoardRows
      • Multiboard - Set the display style for KeyItemsMultiBoard item in column 1, row MultiBoardRows to Show text and Show icons
      • Multiboard - Set the text for KeyItemsMultiBoard item in column 1, row MultiBoardRows to Key Item 3
      • Multiboard - Set the icon for KeyItemsMultiBoard item in column 1, row MultiBoardRows to ReplaceableTextures\CommandButtons\BTNJanggo.blp
      • Multiboard - Set the width for KeyItemsMultiBoard item in column 1, row MultiBoardRows to 15.00% of the total screen width

I was thinking maybe saving the row to a hashtable and loading it again but I know nothing about hashtables so how to go about it is very unclear to me. I still find hashtables immensely confusing, and don't know how to use them.
 
Last edited:

Wrda

Spell Reviewer
Level 26
Joined
Nov 18, 2012
Messages
1,898
You don't need hashtables for this. Say you have 6 players and want to have 3 rows with specific things:
PlayerName Kills Deaths Points
Team 1 - - -
player1 0 1 -1
player2 1 0 2
player3 2 2 2
Team 2 - - -
player4 2 1 3
player5 2 0 4
player6 0 0 0

>First you have to store the total amount of players - TotalPlayers (You'll always check this on the update multiboard trigger)
>Create Multiboard with 3 + TotalPlayers row (Only once, but in your update multiboard trigger you will modify the number of rows if a player left)
>Do the first 2 rows as your liking (Only once)
>Loop through the players from the first team with a array variable tracking the row number that matches each player (slot[1] = 3 in this case player 1 red and always checking if they're still playing) and another variable to keep track the number of the current row you are on - RowNumber, after looping through the first team, RowNumber should have the value of 5 if all players still playing
>Do the "Team 2" rows as your liking, this will be in RowNumber + 1 (always updating)
>Loop through the remaining players from the second team with (...) same thing with RowNumber + 2. So it will basically be slot[4] = RowNumber + 2 and this will be row 7(also increasing the RowNumber each time it loops)
This basically covers it all, but probably isn't the exact thing you needed. Pretty much depends on what you want to do.
 
Pretty much depends on what you want to do.

I am making an RPG where certain quest related items are stored as integers instead of taking up inventory space. I want players to be able to track what quest items they have picked up in a multiboard, and when the quest item is returned to the quest giver the row referencing the quest item is deleted.

If I followed your example wouldn't that be too broad of a loop to check for that many items and making the appropriate changes?
 

Wrda

Spell Reviewer
Level 26
Joined
Nov 18, 2012
Messages
1,898
I am making an RPG where certain quest related items are stored as integers instead of taking up inventory space. I want players to be able to track what quest items they have picked up in a multiboard, and when the quest item is returned to the quest giver the row referencing the quest item is deleted.
Are the quests global? Meaning they affect all players?
If I followed your example wouldn't that be too broad of a loop to check for that many items and making the appropriate changes?
Maybe, how many items are you thinking about? I think my example still can apply for a good part of what you want to achieve, with a few modifications.
 
Are the quests global? Meaning they affect all players?

It is a single player RPG so no.

Maybe, how many items are you thinking about? I think my example still can apply for a good part of what you want to achieve, with a few modifications.

Possibly around 50-60, maybe more.
 
>Loop through the players from the first team with a array variable tracking the row number that matches each player (slot[1] = 3 in this case player 1 red and always checking if they're still playing) and another variable to keep track the number of the current row you are on - RowNumber, after looping through the first team, RowNumber should have the value of 5 if all players still playing

This is where I got confused. How do I track the row number? And how do I keep track of the number of the current row I am on? As I see it it's only possible to decrease the row number by 1 for each action, and I can't save individual row numbers to any variable at all.

Here is a map with two attempts. The first attempt is a hardcore fail and all the triggers for it is disabled, but the second can work. I will only have to look at a lot of rows named "Nothing" but I can live with that.
 

Attachments

  • Items.w3x
    22.9 KB · Views: 16

Wrda

Spell Reviewer
Level 26
Joined
Nov 18, 2012
Messages
1,898
This is where I got confused. How do I track the row number? And how do I keep track of the number of the current row I am on? As I see it it's only possible to decrease the row number by 1 for each action, and I can't save individual row numbers to any variable at all.

Here is a map with two attempts. The first attempt is a hardcore fail and all the triggers for it is disabled, but the second can work. I will only have to look at a lot of rows named "Nothing" but I can live with that.
If you start with some rows with specific stuff you want then you set a variable (integer) to that number of rows, then from there on you loop increasing the variable +1 and do your actions for the following rows. If you still have other rows with specific stuff then you just get that row with variable +1.
The most important thing in the multiboard is that you won't get the specific location of row out of nowhere, you are always going to update the multiboard by rewriting it (except if you have the first rows with specific values then you only do once).
I can't look at your attemp at the moment since I'm not at home but tomorrow night yes
 
Status
Not open for further replies.
Top