error message upon saving due to multiboard(i guess)

Status
Not open for further replies.
Level 4
Joined
Dec 10, 2015
Messages
85
So, I never had any error message like that before. The only thing I did that was different from map I made before is the uses of Custom Script.
I followed this tutorial : http://www.hiveworkshop.com/forums/general-mapping-tutorials-278/all-about-multiboards-84942/
The custom script is in the section about how to make the multiboard to appear for specified player.
Here's the error message :


EDIT: Sorry for that long script, all you had to know (i think) was : Line 1564: Missing: Endblock

If you know what it means, please let me know, also is there a way to fix this? If there is anything to fix...
 
Level 4
Joined
Dec 10, 2015
Messages
85
well, here, this is the only place where I used the custom script
  • Board Creation
    • Events
      • Time - Elapsed game time is 0.01 seconds
    • Conditions
    • Actions
      • Multiboard - Create a multiboard with 2 columns and 6 rows, titled (Income - + T1_name)
      • Set T1IncomeBoard = (Last created multiboard)
      • Multiboard - Set the width for T1IncomeBoard item in column 1, row 1 to 15.00% of the total screen width
      • Multiboard - Set the width for T1IncomeBoard item in column 1, row 2 to 15.00% of the total screen width
      • Multiboard - Set the width for T1IncomeBoard item in column 1, row 3 to 15.00% of the total screen width
      • Multiboard - Set the width for T1IncomeBoard item in column 1, row 4 to 15.00% of the total screen width
      • Multiboard - Set the width for T1IncomeBoard item in column 1, row 5 to 15.00% of the total screen width
      • Multiboard - Set the width for T1IncomeBoard item in column 1, row 6 to 15.00% of the total screen width
      • Multiboard - Set the width for T1IncomeBoard item in column 2, row 1 to 8.00% of the total screen width
      • Multiboard - Set the width for T1IncomeBoard item in column 2, row 2 to 8.00% of the total screen width
      • Multiboard - Set the width for T1IncomeBoard item in column 2, row 3 to 8.00% of the total screen width
      • Multiboard - Set the width for T1IncomeBoard item in column 2, row 4 to 8.00% of the total screen width
      • Multiboard - Set the width for T1IncomeBoard item in column 2, row 5 to 8.00% of the total screen width
      • Multiboard - Set the width for T1IncomeBoard item in column 2, row 6 to 8.00% of the total screen width
      • Multiboard - Create a multiboard with 2 columns and 6 rows, titled (Income - + T2_name)
      • Set T2IncomeBoard = (Last created multiboard)
      • Multiboard - Set the width for T2IncomeBoard item in column 1, row 1 to 15.00% of the total screen width
      • Multiboard - Set the width for T2IncomeBoard item in column 1, row 2 to 15.00% of the total screen width
      • Multiboard - Set the width for T2IncomeBoard item in column 1, row 3 to 15.00% of the total screen width
      • Multiboard - Set the width for T2IncomeBoard item in column 1, row 4 to 15.00% of the total screen width
      • Multiboard - Set the width for T2IncomeBoard item in column 1, row 5 to 15.00% of the total screen width
      • Multiboard - Set the width for T2IncomeBoard item in column 1, row 6 to 15.00% of the total screen width
      • Multiboard - Set the width for T2IncomeBoard item in column 2, row 1 to 8.00% of the total screen width
      • Multiboard - Set the width for T2IncomeBoard item in column 2, row 2 to 8.00% of the total screen width
      • Multiboard - Set the width for T2IncomeBoard item in column 2, row 3 to 8.00% of the total screen width
      • Multiboard - Set the width for T2IncomeBoard item in column 2, row 4 to 8.00% of the total screen width
      • Multiboard - Set the width for T2IncomeBoard item in column 2, row 5 to 8.00% of the total screen width
      • Multiboard - Set the width for T2IncomeBoard item in column 2, row 6 to 8.00% of the total screen width
      • Multiboard - Set the text for T1IncomeBoard item in column 1, row 2 to (Name of Player 1 (Red))
      • Multiboard - Set the text for T1IncomeBoard item in column 1, row 3 to (Name of Player 2 (Blue))
      • Multiboard - Set the text for T1IncomeBoard item in column 1, row 4 to (Name of Player 3 (Teal))
      • Multiboard - Set the text for T1IncomeBoard item in column 1, row 5 to (Name of Player 4 (Purple))
      • Multiboard - Set the text for T1IncomeBoard item in column 1, row 6 to (Name of Player 5 (Yellow))
      • Multiboard - Set the text for T2IncomeBoard item in column 1, row 2 to (Name of Player 6 (Orange))
      • Multiboard - Set the text for T2IncomeBoard item in column 1, row 3 to (Name of Player 7 (Green))
      • Multiboard - Set the text for T2IncomeBoard item in column 1, row 4 to (Name of Player 8 (Pink))
      • Multiboard - Set the text for T2IncomeBoard item in column 1, row 5 to (Name of Player 9 (Gray))
      • Multiboard - Set the text for T2IncomeBoard item in column 1, row 6 to (Name of Player 10 (Light Blue))
      • Multiboard - Set the color for T1IncomeBoard item in column 1, row 2 to (100.00%, 0.00%, 0.00%) with 0.00% transparency
      • Multiboard - Set the color for T1IncomeBoard item in column 1, row 3 to (0.00%, 0.00%, 100.00%) with 0.00% transparency
      • Multiboard - Set the color for T1IncomeBoard item in column 1, row 4 to (0.00%, 100.00%, 100.00%) with 0.00% transparency
      • Multiboard - Set the color for T1IncomeBoard item in column 1, row 5 to (100.00%, 0.00%, 100.00%) with 0.00% transparency
      • Multiboard - Set the color for T1IncomeBoard item in column 1, row 6 to (100.00%, 100.00%, 0.00%) with 0.00% transparency
      • Multiboard - Set the color for T2IncomeBoard item in column 1, row 2 to (100.00%, 50.00%, 0.00%) with 0.00% transparency
      • Multiboard - Set the color for T2IncomeBoard item in column 1, row 3 to (0.00%, 100.00%, 0.00%) with 0.00% transparency
      • Multiboard - Set the color for T2IncomeBoard item in column 1, row 4 to (100.00%, 50.00%, 50.00%) with 0.00% transparency
      • Multiboard - Set the color for T2IncomeBoard item in column 1, row 5 to (50.00%, 50.00%, 50.00%) with 0.00% transparency
      • Multiboard - Set the color for T2IncomeBoard item in column 1, row 6 to (50.00%, 50.00%, 100.00%) with 0.00% transparency
      • Multiboard - Hide all multiboards
      • Custom script: if ( GetLocalPlayer() == Player(0) ) then
      • Multiboard - Show T1IncomeBoard
      • Custom script: endf
      • Custom script: if ( GetLocalPlayer() == Player(1) ) then
      • Multiboard - Show T1IncomeBoard
      • Custom script: endf
      • Custom script: if ( GetLocalPlayer() == Player(2) ) then
      • Multiboard - Show T1IncomeBoard
      • Custom script: endf
      • Custom script: if ( GetLocalPlayer() == Player(3) ) then
      • Multiboard - Show T1IncomeBoard
      • Custom script: endf
      • Custom script: if ( GetLocalPlayer() == Player(4) ) then
      • Multiboard - Show T1IncomeBoard
      • Custom script: endf
      • Custom script: if ( GetLocalPlayer() == Player(5) ) then
      • Multiboard - Show T2IncomeBoard
      • Custom script: endf
      • Custom script: if ( GetLocalPlayer() == Player(6) ) then
      • Multiboard - Show T2IncomeBoard
      • Custom script: endf
      • Custom script: if ( GetLocalPlayer() == Player(7) ) then
      • Multiboard - Show T2IncomeBoard
      • Custom script: endf
      • Custom script: if ( GetLocalPlayer() == Player(8) ) then
      • Multiboard - Show T2IncomeBoard
      • Custom script: endf
      • Custom script: if ( GetLocalPlayer() == Player(9) ) then
      • Multiboard - Show T2IncomeBoard
      • Custom script: endf
 
Level 4
Joined
Dec 10, 2015
Messages
85
Custom Scipt set p = GetLocalPlayer() <--- not needed but shorter texet and it's slightly faster.
Custom script: if (p == Player(0) and p == Player(1) and p == Player(2) and p == Player(3) and p == Player(4)) then
Multiboard - Show T1IncomeBoard
Custom script: endf

AND or OR?
I'm not an expert but, won't it make it look if the player is 1 2 3 4 5 at the same time? which is impossible, right?
 
Level 4
Joined
Dec 10, 2015
Messages
85
Okay, so, I just tried with "or" instead of "and" and I get another error upon saving.

Undeclared variable p
Comparing two variable of different primitive type (except real and integer) is not allowed
 
Level 4
Joined
Dec 10, 2015
Messages
85
okay... So I just created a variable named "p" in the variable tab of "player" type. And when I save, I get the same two error message...
 

Chaosy

Tutorial Reviewer
Level 41
Joined
Jun 9, 2011
Messages
13,239
that's a GUI variable that's why.
You have to use udg_p instead of p in that case.

This is what I'd look like:
(it looks weird, but I just added the lines so..)
  • Board Creation
    • Events
      • Time - Elapsed game time is 0.01 seconds
    • Conditions
    • Actions
      • Custom script: local Player p = GetLocalPlayer()
      • Multiboard - Create a multiboard with 2 columns and 6 rows, titled (Income - + T1_name)
      • Set T1IncomeBoard = (Last created multiboard)
      • Multiboard - Set the width for T1IncomeBoard item in column 1, row 1 to 15.00% of the total screen width
      • Multiboard - Set the width for T1IncomeBoard item in column 1, row 2 to 15.00% of the total screen width
      • Multiboard - Set the width for T1IncomeBoard item in column 1, row 3 to 15.00% of the total screen width
      • Multiboard - Set the width for T1IncomeBoard item in column 1, row 4 to 15.00% of the total screen width
      • Multiboard - Set the width for T1IncomeBoard item in column 1, row 5 to 15.00% of the total screen width
      • Multiboard - Set the width for T1IncomeBoard item in column 1, row 6 to 15.00% of the total screen width
      • Multiboard - Set the width for T1IncomeBoard item in column 2, row 1 to 8.00% of the total screen width
      • Multiboard - Set the width for T1IncomeBoard item in column 2, row 2 to 8.00% of the total screen width
      • Multiboard - Set the width for T1IncomeBoard item in column 2, row 3 to 8.00% of the total screen width
      • Multiboard - Set the width for T1IncomeBoard item in column 2, row 4 to 8.00% of the total screen width
      • Multiboard - Set the width for T1IncomeBoard item in column 2, row 5 to 8.00% of the total screen width
      • Multiboard - Set the width for T1IncomeBoard item in column 2, row 6 to 8.00% of the total screen width
      • Multiboard - Create a multiboard with 2 columns and 6 rows, titled (Income - + T2_name)
      • Set T2IncomeBoard = (Last created multiboard)
      • Multiboard - Set the width for T2IncomeBoard item in column 1, row 1 to 15.00% of the total screen width
      • Multiboard - Set the width for T2IncomeBoard item in column 1, row 2 to 15.00% of the total screen width
      • Multiboard - Set the width for T2IncomeBoard item in column 1, row 3 to 15.00% of the total screen width
      • Multiboard - Set the width for T2IncomeBoard item in column 1, row 4 to 15.00% of the total screen width
      • Multiboard - Set the width for T2IncomeBoard item in column 1, row 5 to 15.00% of the total screen width
      • Multiboard - Set the width for T2IncomeBoard item in column 1, row 6 to 15.00% of the total screen width
      • Multiboard - Set the width for T2IncomeBoard item in column 2, row 1 to 8.00% of the total screen width
      • Multiboard - Set the width for T2IncomeBoard item in column 2, row 2 to 8.00% of the total screen width
      • Multiboard - Set the width for T2IncomeBoard item in column 2, row 3 to 8.00% of the total screen width
      • Multiboard - Set the width for T2IncomeBoard item in column 2, row 4 to 8.00% of the total screen width
      • Multiboard - Set the width for T2IncomeBoard item in column 2, row 5 to 8.00% of the total screen width
      • Multiboard - Set the width for T2IncomeBoard item in column 2, row 6 to 8.00% of the total screen width
      • Multiboard - Set the text for T1IncomeBoard item in column 1, row 2 to (Name of Player 1 (Red))
      • Multiboard - Set the text for T1IncomeBoard item in column 1, row 3 to (Name of Player 2 (Blue))
      • Multiboard - Set the text for T1IncomeBoard item in column 1, row 4 to (Name of Player 3 (Teal))
      • Multiboard - Set the text for T1IncomeBoard item in column 1, row 5 to (Name of Player 4 (Purple))
      • Multiboard - Set the text for T1IncomeBoard item in column 1, row 6 to (Name of Player 5 (Yellow))
      • Multiboard - Set the text for T2IncomeBoard item in column 1, row 2 to (Name of Player 6 (Orange))
      • Multiboard - Set the text for T2IncomeBoard item in column 1, row 3 to (Name of Player 7 (Green))
      • Multiboard - Set the text for T2IncomeBoard item in column 1, row 4 to (Name of Player 8 (Pink))
      • Multiboard - Set the text for T2IncomeBoard item in column 1, row 5 to (Name of Player 9 (Gray))
      • Multiboard - Set the text for T2IncomeBoard item in column 1, row 6 to (Name of Player 10 (Light Blue))
      • Multiboard - Set the color for T1IncomeBoard item in column 1, row 2 to (100.00%, 0.00%, 0.00%) with 0.00% transparency
      • Multiboard - Set the color for T1IncomeBoard item in column 1, row 3 to (0.00%, 0.00%, 100.00%) with 0.00% transparency
      • Multiboard - Set the color for T1IncomeBoard item in column 1, row 4 to (0.00%, 100.00%, 100.00%) with 0.00% transparency
      • Multiboard - Set the color for T1IncomeBoard item in column 1, row 5 to (100.00%, 0.00%, 100.00%) with 0.00% transparency
      • Multiboard - Set the color for T1IncomeBoard item in column 1, row 6 to (100.00%, 100.00%, 0.00%) with 0.00% transparency
      • Multiboard - Set the color for T2IncomeBoard item in column 1, row 2 to (100.00%, 50.00%, 0.00%) with 0.00% transparency
      • Multiboard - Set the color for T2IncomeBoard item in column 1, row 3 to (0.00%, 100.00%, 0.00%) with 0.00% transparency
      • Multiboard - Set the color for T2IncomeBoard item in column 1, row 4 to (100.00%, 50.00%, 50.00%) with 0.00% transparency
      • Multiboard - Set the color for T2IncomeBoard item in column 1, row 5 to (50.00%, 50.00%, 50.00%) with 0.00% transparency
      • Multiboard - Set the color for T2IncomeBoard item in column 1, row 6 to (50.00%, 50.00%, 100.00%) with 0.00% transparency
      • Multiboard - Hide all multiboards
      • Custom script: if (p == Player(0) and p == Player(1) and p == Player(2) and p == Player(3) and p == Player(4)) then
        • Multiboard - Show T1IncomeBoard
      • Custom script: endf
        • Custom script: if ( GetLocalPlayer() == Player(5) ) then
        • Multiboard - Show T2IncomeBoard
        • Custom script: endf
        • Custom script: if ( GetLocalPlayer() == Player(6) ) then
        • Multiboard - Show T2IncomeBoard
        • Custom script: endf
        • Custom script: if ( GetLocalPlayer() == Player(7) ) then
        • Multiboard - Show T2IncomeBoard
        • Custom script: endf
        • Custom script: if ( GetLocalPlayer() == Player(8) ) then
        • Multiboard - Show T2IncomeBoard
        • Custom script: endf
        • Custom script: if ( GetLocalPlayer() == Player(9) ) then
        • Multiboard - Show T2IncomeBoard
        • Custom script: endf
 
Level 4
Joined
Dec 10, 2015
Messages
85
Well, here's the trigger I made with the script you gave me
  • Board Creation
    • Events
      • Time - Elapsed game time is 0.01 seconds
    • Conditions
    • Actions
      • Multiboard - Create a multiboard with 3 columns and 6 rows, titled (Income - + T1_name)
      • Set T1IncomeBoard = (Last created multiboard)
      • For each (Integer A) from 1 to 6, do (Actions)
        • Loop - Actions
          • Multiboard - Set the width for T1IncomeBoard item in column 1, row (Integer A) to 15.00% of the total screen width
          • Multiboard - Set the width for T1IncomeBoard item in column 2, row (Integer A) to 8.00% of the total screen width
          • Multiboard - Set the width for T1IncomeBoard item in column 3, row (Integer A) to 8.00% of the total screen width
      • Multiboard - Create a multiboard with 3 columns and 6 rows, titled (Income - + T2_name)
      • Set T2IncomeBoard = (Last created multiboard)
      • For each (Integer A) from 1 to 6, do (Actions)
        • Loop - Actions
          • Multiboard - Set the width for T2IncomeBoard item in column 1, row (Integer A) to 15.00% of the total screen width
          • Multiboard - Set the width for T2IncomeBoard item in column 2, row (Integer A) to 8.00% of the total screen width
          • Multiboard - Set the width for T2IncomeBoard item in column 3, row (Integer A) to 8.00% of the total screen width
      • Multiboard - Set the text for T1IncomeBoard item in column 1, row 2 to (Name of Player 1 (Red))
      • Multiboard - Set the text for T1IncomeBoard item in column 1, row 3 to (Name of Player 2 (Blue))
      • Multiboard - Set the text for T1IncomeBoard item in column 1, row 4 to (Name of Player 3 (Teal))
      • Multiboard - Set the text for T1IncomeBoard item in column 1, row 5 to (Name of Player 4 (Purple))
      • Multiboard - Set the text for T1IncomeBoard item in column 1, row 6 to (Name of Player 5 (Yellow))
      • Multiboard - Set the text for T2IncomeBoard item in column 1, row 2 to (Name of Player 6 (Orange))
      • Multiboard - Set the text for T2IncomeBoard item in column 1, row 3 to (Name of Player 7 (Green))
      • Multiboard - Set the text for T2IncomeBoard item in column 1, row 4 to (Name of Player 8 (Pink))
      • Multiboard - Set the text for T2IncomeBoard item in column 1, row 5 to (Name of Player 9 (Gray))
      • Multiboard - Set the text for T2IncomeBoard item in column 1, row 6 to (Name of Player 10 (Light Blue))
      • Multiboard - Set the color for T1IncomeBoard item in column 1, row 2 to (100.00%, 0.00%, 0.00%) with 0.00% transparency
      • Multiboard - Set the color for T1IncomeBoard item in column 1, row 3 to (0.00%, 0.00%, 100.00%) with 0.00% transparency
      • Multiboard - Set the color for T1IncomeBoard item in column 1, row 4 to (0.00%, 100.00%, 100.00%) with 0.00% transparency
      • Multiboard - Set the color for T1IncomeBoard item in column 1, row 5 to (100.00%, 0.00%, 100.00%) with 0.00% transparency
      • Multiboard - Set the color for T1IncomeBoard item in column 1, row 6 to (100.00%, 100.00%, 0.00%) with 0.00% transparency
      • Multiboard - Set the color for T2IncomeBoard item in column 1, row 2 to (100.00%, 50.00%, 0.00%) with 0.00% transparency
      • Multiboard - Set the color for T2IncomeBoard item in column 1, row 3 to (0.00%, 100.00%, 0.00%) with 0.00% transparency
      • Multiboard - Set the color for T2IncomeBoard item in column 1, row 4 to (100.00%, 50.00%, 50.00%) with 0.00% transparency
      • Multiboard - Set the color for T2IncomeBoard item in column 1, row 5 to (50.00%, 50.00%, 50.00%) with 0.00% transparency
      • Multiboard - Set the color for T2IncomeBoard item in column 1, row 6 to (50.00%, 50.00%, 100.00%) with 0.00% transparency
      • Multiboard - Hide all multiboards
      • Custom script: set p = GetLocalPlayer()
      • Custom script: if (p == Player(0) or p == Player(1) or p == Player(2) or p == Player(3) or p == Player(4)) then
      • Multiboard - Show T1IncomeBoard
      • Custom script: endif
      • Custom script: set p = GetLocalPlayer()
      • Custom script: if (p == Player(5) or p == Player(6) or p == Player(7) or p == Player(8) or p == Player(9)) then
      • Multiboard - Show T2IncomeBoard
      • Custom script: endif
It's with this one that I get this error message
 

Chaosy

Tutorial Reviewer
Level 41
Joined
Jun 9, 2011
Messages
13,239
My bad, I made a slight spelling mistake. It should be "player" and not "Player"
also you only need the set p = GetLocalPlayer() once.

I saved this and it works.
  • Melee Initialization
    • Events
      • Map initialization
    • Conditions
    • Actions
      • Custom script: local player p = GetLocalPlayer()
      • Custom script: if (p == Player(0) and p == Player(1) and p == Player(2) and p == Player(3) and p == Player(4)) then
      • Custom script: endif
      • Custom script: if (p == Player(5) and p == Player(6) and p == Player(7) and p == Player(8) and p == Player(9)) then
      • Custom script: endif
 
Level 4
Joined
Dec 10, 2015
Messages
85
Well, I get the same first error message :
Undeclared variable p
but the second one got changed to :
Undeclared function player
 
Level 4
Joined
Dec 10, 2015
Messages
85
okay, changed the script
set p = GetLocalPlayer()
to
local player p = GetLocalPlayer()
and now I get another error message, a single one this time :
locals are only supported at the top of the function
does that means I need to put it at the beginning of my trigger's action?

EDIT : I've put the variable declaration at the beginning of my Trigger's action and now I get the error message :
Undeclared function player
 

Chaosy

Tutorial Reviewer
Level 41
Joined
Jun 9, 2011
Messages
13,239
Oh. I found the issue, you and me misunderstood each other slightly.
When I said replace Player with player, I meant the local line. Not the if bla bla.

However when testing the map not all values are shown correctly, so there are still issues elsewhere.
 

Attachments

  • Ultimate Civilization Wars.w3x
    58.8 KB · Views: 29
Level 4
Joined
Dec 10, 2015
Messages
85
well, looks like the map is corrupted now...
When I try to test it through the map editor, nothing happens, War3 doesn't open at all.
And when I open war3, I go in single player, custom game, and when I select the map, the player panel isnt shown at all. You know, the panel where you select which slot is computer, which one is closed, etc
 
Status
Not open for further replies.
Top