HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

Local multiboards

10-24-2003, 08:05 PM#1
35263526
I am trying to create seperate multiboards for each player for a custom resource system I am working on. I am trying to use GUI to pick every player and do multiple actions, then use GetLocalPlayer and running the actions to create a multiboard. I am using WE Unlimited's GUI multiboard functions.
This is my trigger:

ACTIONS:
Time elapsed is 0.1 seconds

CONDITIONS:
None

ACTIONS:
Pick every player in All players and do multiple actions:
Custom Script: if (GetLocalPlayer()==GetEnumPlayer()) then
Create multiboard
Custom Script: endif

------------------------------------------------------------------------------------

I'm not sure what the problem is. I am using GetEnumPlayer because I wasn't sure what to use for picked player so I made a GUI trigger that used Picked Player, and that used GetEnumPlayer, so I used that. If you can help, please do. Or, is creating local Multiboards just not possible?
10-24-2003, 08:37 PM#2
Starcraftfreak
You only create a multiboard object. You can do local multiboards, but you have to create a local variable first. If you want to do local variables in GUI, you have to put them in a Custom Script action. Note: Local variables can only be defined at the beginning of a trigger:
Custom Script: local multiboard myboard = CreateMultiboard()

Then you have to do something with the multiboard. I suggest to look at common.j. There you can find all multiboard-related functions. Additionally WEU has actions to work with multiboards I think.

Notice that you can access those local multiboards only via Custom Script, so it might be good to convert that trigger to Jass anyway.
10-24-2003, 08:49 PM#3
35263526
Once I have added the custom script, can I just use the rest of my trigger after it? Or do I need to do something else? I get the basics of JASS but I'm still a noob.
10-24-2003, 09:07 PM#4
Starcraftfreak
If you want to do other actions that don't need to refer to that multiboard object you can just do them. Just take into account that locals have to be at the beginning.
Once you have initialized a multiboard with CreateMultiboard() you have to set some properties. Here is a list of functions, which deal with multiboards:
Taken from common.j
Code:
//============================================================================
// Multiboard API
//============================================================================

// Create a multiboard object
native CreateMultiboard                 takes nothing returns multiboard
native DestroyMultiboard                takes multiboard lb returns nothing

native MultiboardDisplay                takes multiboard lb, boolean show returns nothing
native IsMultiboardDisplayed            takes multiboard lb returns boolean

native MultiboardMinimize               takes multiboard lb, boolean minimize returns nothing
native IsMultiboardMinimized            takes multiboard lb returns boolean
native MultiboardClear                  takes multiboard lb returns nothing

native MultiboardSetTitleText           takes multiboard lb, string label returns nothing
native MultiboardGetTitleText           takes multiboard lb returns string
native MultiboardSetTitleTextColor      takes multiboard lb, integer red, integer green, integer blue, integer alpha returns nothing

native MultiboardGetRowCount            takes multiboard lb returns integer
native MultiboardGetColumnCount         takes multiboard lb returns integer

native MultiboardSetColumnCount         takes multiboard lb, integer count returns nothing
native MultiboardSetRowCount            takes multiboard lb, integer count returns nothing

// broadcast settings to all items
native MultiboardSetItemsStyle          takes multiboard lb, boolean showValues, boolean showIcons returns nothing
native MultiboardSetItemsValue          takes multiboard lb, string value returns nothing
native MultiboardSetItemsValueColor     takes multiboard lb, integer red, integer green, integer blue, integer alpha returns nothing
native MultiboardSetItemsWidth          takes multiboard lb, real width returns nothing
native MultiboardSetItemsIcon           takes multiboard lb, string iconPath returns nothing


// funcs for modifying individual items
native MultiboardGetItem                takes multiboard lb, integer row, integer column returns multiboarditem
native MultiboardReleaseItem            takes multiboarditem mbi returns nothing

native MultiboardSetItemStyle           takes multiboarditem mbi, boolean showValue, boolean showIcon returns nothing
native MultiboardSetItemValue           takes multiboarditem mbi, string val returns nothing
native MultiboardSetItemValueColor      takes multiboarditem mbi, integer red, integer green, integer blue, integer alpha returns nothing
native MultiboardSetItemWidth           takes multiboarditem mbi, real width returns nothing
native MultiboardSetItemIcon            takes multiboarditem mbi, string iconFileName returns nothing

// meant to unequivocally suspend display of existing and
// subsequently displayed multiboards
//
native MultiboardSuppressDisplay        takes boolean flag returns nothing
10-24-2003, 09:13 PM#5
35263526
Thanks very much. I get it now. I wouldn't have been able to do my custom resources without this knowledge.
10-25-2003, 04:53 PM#6
AIAndy
You should not create the multiboard in an if with local player. Only display it there.
10-25-2003, 06:09 PM#7
35263526
oh. I was kinda wondering why my map was crashing on save. this seems to have fixed it.
10-25-2003, 08:31 PM#8
Cacodemon
Need another idea how to make separate multiboards? But it's just a suggestion.
10-25-2003, 08:50 PM#9
35263526
I'm open to all ideas, as my tweaked method is buggy. Please share.
10-25-2003, 09:48 PM#10
Cacodemon
I have tried to realize that idea but it fails :( I show player's own multiboard for each player, hiding other multiboards for a short period of time using several triggers... You may throw eggs in me :)
10-25-2003, 10:01 PM#11
35263526
Hey, you're still a hell of alot better at JASS than me. I'm just a poor lonely noob trying learn by looking through common.j

Its a harsh life, but I'll pull through.
10-26-2003, 12:02 AM#12
Cacodemon
Don't think so! As for me, I'm not a man who knows everything in JASS. For example, I don't know exists picture size limitation in multiboards or not? May be you can answer this question? I'm going to create multiboard shown on attached picture (this one is example created with PhotoShop) but I'm not sure about minimal item picture size!
10-26-2003, 12:26 AM#13
Magos
Whoa, lucky you said it was photoshopped. I was really amazed what multiboards could do otherwise ^^.

Anyway, when you set a leaderboard item width, the width is expressed as a percentage of the screen, right? That could really cause troubles when trying to have the icons placed in a certain way. It would look different for people with different resolution.

Dunno about minimal icon size.
10-26-2003, 12:45 AM#14
Cacodemon
I'm going to create real multiboard looks like this =) I't not a problem if no size limitation exists!
10-26-2003, 01:23 AM#15
Cubasis
Caco and magos, i'm sorry to break your hearts, but that's not how multiboards work... :P

You should atleast play with them and all the actions before you start planning them out in photoshop :P

I guess you do know that multiboards are set up as almost a spreadsheet with a set ammount of columns, and set ammount of rows.

Each "item" in this sheet can contain a icon, and a value. The icon is = 16x16 in size, and whatever images you give it (i think it must even be in the ususal sizes (32x32, 64x64, 128x128, 256x256)) will be resized to be 16x16. And there is ONLY 1 icon per item.

Secondly, Item "widths" are not in percentage of screen size (unfortunately), But i am not sure myself what it is, a documentary said it was "how many icons" it is... so 0.01 in width is 1 icon in size (wether you fill it with a icon or a value) etc, 16x16 pixels, and thus a value of 0.03 "would" (if you could put many icons in a item) fit 3 icons worth in it.

So basicly, you can not create this sexy of a multiboard. And if you'd wanna get near to that coolness, you would have to build bar "icons", alot of them, border-icons, different bar-position icons, and **** like that. (EDIT: F.ex. you'd create all the types of 16x16 "icons" you would need to manually puzzle them together to form this "UI") And even if you would do that, there is still like 1-2 pixels between item, so you'd see alot of icons with 1 pixel between them.

I reccomend you to check out darky's multiboard in his nature's call campaign. You will see better how your stuff would turn out by looking at it (the maze-map multiboard).

(EDIT: So basicly, the multiboards aren't your ultimate means of creating your custom UserInterface stuff on the screen.)

Cubasis