• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.

[JASS] MULTIBOARDS for me and not you

Status
Not open for further replies.
Level 4
Joined
May 6, 2006
Messages
79
Is there a way to create a multiboard for a specific player so that no others but him can see it?
 
Level 5
Joined
May 22, 2006
Messages
150
Not at all but near on it. ^^

Set your global to the player, you want to see the multiboard.

Then put all actions in the multiboard trigger into this conditional structure:

JASS:
if udg_ChosenPlayer == GetLocalPlayer() then

endif

It should work.
 
Level 5
Joined
May 22, 2006
Messages
150
It is not.

Code:
set udg_LocalPlayer = GetLocalPlayer()
Will cause... Well, I do not know, what it will cause.

This should happen:
The script is executed seperately on each computer.
so, on each computer udg_LocalPlayer will have another value - the "local player".
So, "udg_ChosenPlayer == GetLocalPlayer()" will always be true and everybody will get the multiboard.

So the player, who shall get the multiboard, must be specified manually by converting his id via "Player takes integer returns player".
 
Level 11
Joined
Feb 22, 2006
Messages
752
This trigger is the exact one i use in my map, so it should work perfectly. You will need a basic understanding of JASS to make sense of what's happening.

Note: you will need a global multiboard variable array named Multiboard for this trigger to work.

Events
Time- Elapsed game time is 0.50 seconds [You can use any event you want]

Conditions
None [You can have conditions, although I can't see why you would want any]

Actions
For each (Integer A) from 0 to 5, do (Actions) [I had 6 players in my map, if you have 12 players set it to: 0 to 11]
Loop - Actions
Multiboard - Create a multiboard with 3 columns and 12 rows, titled Combat Proficiencies [of course, you can change what your MB looks like]
Set Multiboard[(Integer A)] = (Last created multiboard)
[endloop Actions]
Player Group - Pick every player in All Players and do (Actions)
Loop - Actions
Custom script: if ( GetLocalPlayer() == GetEnumPlayer() then
Custom script: call MultiboardDisplay(udg_Multiboard[GetPlayerId(GetEnumPlayer())], true)
Custom script: endif
[endloop Actions]

Note: to manipulate the multiboards later, remember that Player(0) - Red can see udg_Multiboard[0], Player(1) - Blue can see udg_Multiboard[1] and so on...

Basically, this trigger creates an X number of multiboards (one for each player) and stores each multibaord into a global variable array.

Then, a series of complicated and hard to explain things happen that all result in each player only able to see the multiboard that was meant for them, and none of the other ones.
 
Level 5
Joined
May 22, 2006
Messages
150
This is a way of using it, I see.
... But what may you do with your "basic understanding of Jass", while using simplified GUI-Script?
Tree lines of custom script?
You could have replaced them with GUI-Script, too and then no idea of Jass will be necessary.

And what may the "series of complicated and hard to explain things"?

The script is executed on each PC separately and on each PC, "GetLocalPlayer()" returns the player, which is controlled by the human being sitting on it.
The same happens virtually (as they do not have own computers) for the computer players.
So, only one player will get his condition "udg_ChosenPlayer == GetLocalPlayer()" true and so only one of the script instances will create a multiboard.
Nothing difficult to explain.

Or did I get something wrong?
 
Level 11
Joined
Feb 22, 2006
Messages
752
Ok first of all, you can't use GetLocalPlayer() with GUI, so I can't convert all my lines into GUI. Also, if a person didn't know anything about JASS, they wouldn't know about function calls and parameters, or what the function GetEnumPlayer() does.

Second of all, I didn't feel like typing any more than I already had to explain something that is not essential to making the trigger work.

And btw, my way eliminates use of unnessary global variables.
 
Level 2
Joined
Jul 12, 2004
Messages
7
aznricepuff said:
Custom script: if ( GetLocalPlayer() == GetEnumPlayer() then
You forgot a ")" between the "GetEnumPlayer()" and "then" (i'm not a JASS user but World Editor says this so ...), and it works nicely, thanks :)
 
Level 5
Joined
May 22, 2006
Messages
150
... If somebody knows nothing about JASS, he asks in this forum, if somebody else can write what he wants.
If somebody has basic knowledge, he asks for partial tasks instead for the whole thing - or he can make it run by himself and does not ask anything. ^^
And as JASS prevents you from using BJ-code, it makes your script more effective (on my maps, I can really feel the difference - a not very new computer and around one hundred triggers running do not be best friends ^^).
At last, JASS-writers (okay, I admit that I do not know about the others) can read pure JASS better and quicklier than this GUI-pseudocode.

And your script does not solve the task initially requested.
There shall not be one multiboard for anybody but only one multiboard for only one player - if this player's number remains the same one everytime, you do not need a global to store him.
 
Status
Not open for further replies.
Top