| 09-25-2008, 11:18 PM | #2 |
I don't understand what the problem is, from what I see the multiboard you get ingame matches the code you posted. I'm just guessing here, but maybe you should increase the Cont variable in your player loop, also you assign two values to column 2 and no value to column 3 in that loop. Also, your Integer A loop doesn't seem necessary, you can easily modify the properties of all your rows and/or columns by using 0 as the row/column number. |
| 09-26-2008, 05:11 PM | #3 | |
Quote:
I tried what you said, but it doesnt seem to work properly. Could you please tell me the way you would do it? (how you put the triggers so the multiboard looks like dota or Naruto shinobi wars) |
| 09-26-2008, 10:05 PM | #4 |
Sorry, can't help you there, I don't play those maps so I don't know what kind of multiboards they have. |
| 09-27-2008, 02:53 AM | #5 | |
Quote:
I dont want exactly those multiboards... just one with the name of the player, number of deaths and number of kills... sounds simple but for me its pretty hard. Bye.- |
| 09-27-2008, 03:08 AM | #6 |
Some random code i had lying around JASS:globals multiboard Multiboard constant integer Team1Offset = 2 constant integer Team2Offset = 1 constant integer PlayerOffset = 1 constant string GameName = "Generic AoS" constant string Version = "0.05" constant string Team1Name = "Team 1" constant string Team2Name = "Team 2" integer array PlayerRow integer PlayerNumber = 0 endglobals function MultiboardSetCRColor takes multiboard mb, integer col, integer row, integer red, integer green, integer blue, integer alpha returns nothing local multiboarditem MBItem = MultiboardGetItem( Multiboard, row, col ) call MultiboardSetItemValueColor( MBItem, red, green, blue, alpha ) call MultiboardReleaseItem( MBItem ) set MBItem = null endfunction function MultiboardSetCRWidth takes multiboard mb, integer col, integer row, real width returns nothing local multiboarditem MBItem = MultiboardGetItem( Multiboard, row, col ) call MultiboardSetItemWidth( MBItem, width ) call MultiboardReleaseItem( MBItem ) set MBItem = null endfunction function MultiboardSetCRText takes multiboard mb, integer col, integer row, string text returns nothing local multiboarditem MBItem = MultiboardGetItem( Multiboard, row, col ) call MultiboardSetItemValue( MBItem, text ) call MultiboardReleaseItem( MBItem ) set MBItem = null endfunction function MultiboardSetCRStyle takes multiboard mb, integer col, integer row, boolean showText, boolean showIcon returns nothing local multiboarditem MBItem = MultiboardGetItem( Multiboard, row, col ) call MultiboardSetItemStyle( MBItem, showText, showIcon ) call MultiboardReleaseItem( MBItem ) set MBItem = null endfunction function MultiboardSetCRIcon takes multiboard mb, integer col, integer row, string iconPath returns nothing local multiboarditem MBItem = MultiboardGetItem( Multiboard, row, col ) call MultiboardSetItemIcon( MBItem, iconPath ) call MultiboardReleaseItem( MBItem ) set MBItem = null endfunction function MultiboardActions takes nothing returns nothing local integer i = 0 local integer i2 = 0 set Multiboard = CreateMultiboard() call MultiboardSetTitleText( Multiboard, GameName + " v" + Version ) call MultiboardDisplay( Multiboard, true ) call MultiboardSetRowCount( Multiboard, 5 ) call MultiboardSetColumnCount( Multiboard, 3 + PlayerNumber ) call MultiboardMinimize( Multiboard, true ) call MultiboardSetCRText( Multiboard, 0, 0, " Player" ) call MultiboardSetCRText( Multiboard, 1, 0, "Dead?" ) call MultiboardSetCRColor( Multiboard, 1, 0, 255, 255, 0, 255 ) call MultiboardSetCRText( Multiboard, 2, 0, "Kills" ) call MultiboardSetCRColor( Multiboard, 2, 0, 255, 0, 0, 255 ) call MultiboardSetCRText( Multiboard, 3, 0, "Deaths" ) call MultiboardSetCRColor( Multiboard, 3, 0, 0, 0, 255, 255 ) call MultiboardSetCRText( Multiboard, 4, 0, "Assists" ) call MultiboardSetCRColor( Multiboard, 4, 0, 128, 128, 128, 190 ) //SpellCaster Multiboard Section set i = MultiboardGetRowCount( Multiboard ) - Team1Offset call MultiboardSetCRText( Multiboard, 0, i, Team1Name ) set i = 0 //End // //Brute Multiboard Section set i = MultiboardGetRowCount( Multiboard ) - Team2Offset call MultiboardSetCRText( Multiboard, 0, i, Team2Name ) set i = 0 //End loop //Set the colour of all Values in first Row to Goldish //call MultiboardSetCRColor( Multiboard, i, 0, 255, 204, 51, 255 ) //I don't like the gold! //End //Hide all icons loop call MultiboardSetCRStyle( Multiboard, i, i2, true, false ) set i2 = i2 + 1 exitwhen i2 > MultiboardGetRowCount( Multiboard ) endloop set i2 = 0 //End set i = i + 1 exitwhen i > MultiboardGetColumnCount( Multiboard ) endloop set i = 0 //Loop through all Rows loop //Set Column Sizes call MultiboardSetCRWidth( Multiboard, 0, i, .12 ) call MultiboardSetCRWidth( Multiboard, 1, i, .04 ) call MultiboardSetCRWidth( Multiboard, 2, i, .04 ) call MultiboardSetCRWidth( Multiboard, 3, i, .0525 ) call MultiboardSetCRWidth( Multiboard, 4, i, .06 ) //End //And Columns loop set i2 = i2 + 1 exitwhen i2 > MultiboardGetRowCount( Multiboard ) endloop //End //Set Player Names if i < PlayerNumber then //Dead/Kills/Deaths/Assists Colors call MultiboardSetCRColor( Multiboard, 1, i + PlayerOffset, 255, 255, 0, 255 ) call MultiboardSetCRColor( Multiboard, 2, i + PlayerOffset, 255, 0, 0, 255 ) call MultiboardSetCRColor( Multiboard, 3, i + PlayerOffset, 0, 0, 255, 255 ) call MultiboardSetCRColor( Multiboard, 4, i + PlayerOffset, 128, 128, 128, 190 ) //End set PlayerRow[i] = i + PlayerOffset call MultiboardSetCRText( Multiboard, 0, i + PlayerOffset, GetPlayerNameColored( Player( i ) ) ) call MultiboardSetCRText( Multiboard, 2, i + PlayerOffset, "0" ) call MultiboardSetCRText( Multiboard, 3, i + PlayerOffset, "0" ) call MultiboardSetCRText( Multiboard, 4, i + PlayerOffset, "0" ) call MultiboardSetCRStyle( Multiboard, 0, i + PlayerOffset, true, true ) call MultiboardSetCRIcon( Multiboard, 0, i + PlayerOffset, "ReplaceableTextures\\CommandButtons\\BTNSelectHeroOn.blp" ) endif //End set i = i + 1 exitwhen i > MultiboardGetRowCount( Multiboard ) endloop set i = 0 //End endfunction //=========================================================================== function Init takes nothing returns nothing local trigger t = CreateTrigger() local integer i = 0 loop exitwhen i > 11 if GetPlayerSlotState( Player( i ) ) == PLAYER_SLOT_STATE_PLAYING then set PlayerNumber = PlayerNumber + 1 endif set i = i + 1 endloop call TriggerRegisterTimerEvent( t, 0.10, false ) call TriggerAddAction( t, function MultiboardActions ) endfunction |
| 09-27-2008, 07:49 PM | #7 | |
Quote:
Thank you so much. Just one thing: How do I put this JASS code in my map? |
| 09-28-2008, 03:42 PM | #8 |
Press new trigger Then Edit -> Convert to custom text and paste it in (change the name of the last function to InitTrig_(Your trigger name) |
| 09-28-2008, 04:05 PM | #9 |
to add kills and deaths you need to add another 2 columns. from what i can see you used the sample multiboard that was provided on world-editor-tutorials.thehelper.net/multiboard.php. its a good start but you also need to play around with the values. like increase the width value of each columnxrow. as a side note the reason why your table doesnt look like the dota multiboard is because youve set the board to only display human players who are actually playing. if you look at your variables Player_Count and List theyre integer variables that make a new row for every human player in the game. if you want to add in the computer forces you need to add a coupla additional rows. |
| 09-28-2008, 07:26 PM | #11 |
In the player group loop, you're using the wrong variable for the multiboard row, you're using List instead of Cont. I assume the value of List is 0 at the time so it sets the same value for all rows. |
| 09-28-2008, 08:00 PM | #12 | |
Quote:
That was exactly the mistake. Now the multiboard works properly. Thank you. And thank you all people for helping me with the trigger. Bye.- |
