HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

2 Questions - Multiboards & Abilities

07-31-2007, 03:44 AM#1
burningice95
1) Why does my mulitboard trigger mess up when updating the death column


This trigger works, i just put in in for reference.
Trigger:
Create Multiboard Copy
Collapse Events
Time - Elapsed game time is 1.00 seconds
Conditions
Collapse Actions
Set Player_Count = (Number of players in (All players matching ((((Matching player) controller) Equal to User) and (((Matching player) slot status) Equal to Is playing))))
Multiboard - Create a multiboard with 6 columns and (1 + Player_Count) rows, titled Tutorial Multiboard
Multiboard - Set the text for (Last created multiboard) item in column 2, row 1 to Player Name
Multiboard - Set the text for (Last created multiboard) item in column 3, row 1 to Kills
Multiboard - Set the text for (Last created multiboard) item in column 4, row 1 to Deaths
Multiboard - Set the text for (Last created multiboard) item in column 5, row 1 to God
Multiboard - Set the text for (Last created multiboard) item in column 6, row 1 to Favor
Collapse For each (Integer A) from 1 to (1 + Player_Count), do (Actions)
Collapse Loop - Actions
Multiboard - Set the display style for (Last created multiboard) item in column 1, row 1 to Show text and Hide icons
Multiboard - Set the display style for (Last created multiboard) item in column 1, row (Integer A) to Show text and Show icons
Multiboard - Set the display style for (Last created multiboard) item in column 2, row (Integer A) to Show text and Hide icons
Multiboard - Set the display style for (Last created multiboard) item in column 3, row (Integer A) to Show text and Hide icons
Multiboard - Set the display style for (Last created multiboard) item in column 4, row (Integer A) to Show text and Hide icons
Multiboard - Set the display style for (Last created multiboard) item in column 5, row (Integer A) to Show text and Hide icons
Multiboard - Set the display style for (Last created multiboard) item in column 6, row (Integer A) to Show text and Hide icons
Multiboard - Set the width for (Last created multiboard) item in column 1, row (Integer A) to 2.00% of the total screen width
Multiboard - Set the width for (Last created multiboard) item in column 2, row (Integer A) to 8.00% of the total screen width
Multiboard - Set the width for (Last created multiboard) item in column 3, row (Integer A) to 3.00% of the total screen width
Multiboard - Set the width for (Last created multiboard) item in column 4, row (Integer A) to 4.00% of the total screen width
Multiboard - Set the width for (Last created multiboard) item in column 5, row (Integer A) to 5.00% of the total screen width
Multiboard - Set the width for (Last created multiboard) item in column 6, row (Integer A) to 2.50% of the total screen width
Set List = 2
Collapse Player Group - Pick every player in (All players matching ((((Matching player) slot status) Equal to Is playing) and (((Matching player) controller) Equal to User))) and do (Actions)
Collapse Loop - Actions
Set Multiboard_Spots[(Player number of (Picked player))] = List
Multiboard - Set the icon for (Last created multiboard) item in column 1, row List to ReplaceableTextures\CommandButtons\BTNVillagerMan.blp
Multiboard - Set the text for (Last created multiboard) item in column 2, row List to (Player_Colors[(Player number of (Picked player))] + ((Name of (Picked player)) + |r))
Multiboard - Set the text for (Last created multiboard) item in column 3, row List to 0
Set List = (List + 1)
Multiboard - Show (Last created multiboard)
Collapse For each (Integer A) from 2 to Player_Count, do (Actions)
Collapse Loop - Actions
Multiboard - Set the text for (Last created multiboard) item in column 3, row (Integer A) to 0
Multiboard - Set the text for (Last created multiboard) item in column 4, row (Integer A) to 0
Multiboard - Set the text for (Last created multiboard) item in column 6, row (Integer A) to 0

This is where it messes up. It updates the kill column correctly, but not the death column. why?!?!
Trigger:
Player Kills Update Copy
Collapse Events
Unit - A unit Dies
Collapse Conditions
((Dying unit) is A Hero) Equal to True
Collapse Actions
Set Kill_Count[(Player number of (Owner of (Killing unit)))] = (Kill_Count[(Player number of (Owner of (Killing unit)))] + 1)
Set Death_Count[(Player number of (Owner of (Dying unit)))] = (Death_Count[(Player number of (Owner of (Dying unit)))] + 1)
Multiboard - Set the text for (Last created multiboard) item in column 3, row Multiboard_Spots[(Player number of (Owner of (Killing unit)))] to (String(Kill_Count[(Player number of (Owner of (Killing unit)))]))
Multiboard - Set the text for (Last created multiboard) item in column 4, row Multiboard_Spots[(Player number of (Owner of (Dying unit)))] to (String(Death_Count[(Player number of (Owner of (Dying unit)))]))

It looks like this when i kill. Column 4 row 1 says "Deaths" before the trigger the above trigger fires. This is what it looks like afterwards
http://img528.imageshack.us/my.php?i...ntitlednf2.png

2) How do i add an ability to a Hero's learn ability section (the one that opens up when you click on the red cross). The Unit - Add ability doesn't seem to work
07-31-2007, 10:20 AM#2
Histenchist
Question 1:
The player number is 0 try [(Player number of (Owner of (Dying unit))) + 1]
Player 1 (Red): 0
Player 2 (Blue): 1
Player 3 (Teal): 2
Player 4 (Purple): 3
and so on.

Question 2:
You need to use engineer upgrade Try this
07-31-2007, 01:45 PM#3
CommanderZ
Quote:
Question 1:
The player number is 0 try [(Player number of (Owner of (Dying unit))) + 1]
Player 1 (Red): 0
Player 2 (Blue): 1
Player 3 (Teal): 2
Player 4 (Purple): 3
and so on.

No, this is in JASS, GUI uses GetPlayerConvertedId() instead of GetPlayerId(). GetPlayerConvertedId just adds 1 to the GetPlayerId() to make player numbers fit for GUI. Hope you understand :)
07-31-2007, 04:50 PM#4
burningice95
Well I changed it to:

Multiboard - Set the text for (Last created multiboard) item in column 4, row ((Player number of (Owner of (Dying unit))) + 1) to (String(Death_Count[(Player number of (Owner of (Dying unit)))]))

and it worked o_O.

And thanks for the tip about engineering upgrade.
07-31-2007, 05:16 PM#5
Histenchist
CommanderZ: I think it's you that's wrong ;P
07-31-2007, 05:22 PM#6
Earth-Fury
Quote:
Originally Posted by Histenchist
CommanderZ: I think it's you that's wrong ;P
Collapse JASS:
constant native GetPlayerId takes player whichPlayer returns integer

Collapse JASS:
function GetConvertedPlayerId takes player whichPlayer returns integer
    return GetPlayerId(whichPlayer) + 1
endfunction

from common.j and blizzard.j. GUI uses GetConvertedPlayerId().
07-31-2007, 05:45 PM#7
burningice95
On my second question: I have 12 gods and my map, and whenever a player chooses to worship a certain god, I want them to get the ability Favor of *god's name*. If I understand correctly, I need to give the units a dummy ability before the map starts, which I can't do because I would need 12 dummy abilities, and there aren't sufficient slots for that.

Maybe i could give everyone a default ability, based off atribute bonus, and whenever they level it, a trigger removes it and adds the appropriate ability?