HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

Multiboard To Display Hero Stats?

08-07-2006, 07:58 AM#1
AtOmIc_PeAnUt
Hi all, I have been trying to set up a multiboard which can display the proper names and the icons of the heroes on it, their current health/maximum health, current mana/maximum mana and some other custom values that I have and need to show. However, for the name of the hero (which is Thorohain) it displays something like Thd.000, lol, and the icon is just a green blob. Could anyone tell me how to put these things onto a multiboard properly?

Trigger:
Untitled Trigger 001
Events
Conditions
Collapse Actions
Multiboard - Set the text for (Last created multiboard) item in column 1, row 2 to (Proper name of Paladin 0010 <gen>)
Multiboard - Set the icon for (Last created multiboard) item in column 1, row 2 to (String((Unit-type of Paladin 0010 <gen>)))
Multiboard - Set the text for (Last created multiboard) item in column 2, row 2 to (String((Real((Hero level of Paladin 0010 <gen>)))))

These are the ones I need most help with, and the icon one was on complete guess work, I have no clue where to even start to do that!

EDIT: OK still no reply, but nvm I think I have pretty much fixed all but the icon, which I still have no clue about :D Also, is there a simple way to detect when a unit gains health or mana, without having to check it with an "every 1 second" kind of trigger?
08-07-2006, 01:57 PM#2
Soultaker
About the Icon.. There the string to be something like "ReplaceableTextures\\BTNIcon.blp". The easiest way as I see it would be to make two arrays, one with all the hero unittypes and one with all the according strings.

Then what you do is to make a loop that checks which unittype the hero is and add the according string.

Did you get that ?

EDIT: Seems like I got a lot of time today so I made a test map for you. Since it's a bit unclear what you want you properly want to change it, but it should give you the general idea !

- Soultaker
Attached Files
File type: w3xMultiboard Icon Map.w3x (17.7 KB)
08-07-2006, 02:07 PM#3
Rising_Dusk
Quote:
is there a simple way to detect when a unit gains health or mana, without having to check it with an "every 1 second" kind of trigger?

No, there are events for specific units allowing detection of a single unit's life and mana.
However, there is no way to globally check every unit for the event.

Therefore a periodic check (Every 1 second, ie.) would be the way to go.
08-07-2006, 02:11 PM#4
Wyvernoid
You can find the icon paths when you double click a "Art - Interface Icon"(or anything like this) in the Object Editor, in the text field "Custom:".
And for the life/mana:
1) Use the "Every 1 seconds", unfortuntely, 'cause:
2) Or you'll have to use a set of "Unit takes damage" "Unit Starts the effect of an ability" "Unit Uses an item" "Unit Aquires an item" "Unit Loses an item" and many other annoying events ;-)

Quote:
Originally Posted by Rising_Dusk
...there are events for specific units allowing detection of a single unit's life and mana...
What are they^_^? I think "Unit - Life" and "Unit - Mana" cannot do such work.
08-07-2006, 02:14 PM#5
Rising_Dusk
Notably, you repeated yourself and answered your own question.
Quote:
...there are events for specific units allowing detection of a single unit's life and mana...

The 'Unit - Life' and 'Unit - Mana' are specific unit events.
Meaning they can't work globally, as I said before. :P

Just so you know, here they are.
Collapse JASS:
    call TriggerRegisterUnitStateEvent(trig, whichUnit, UNIT_STATE_LIFE, opcode, limitval)
    call TriggerRegisterUnitStateEvent(trig, whichUnit, UNIT_STATE_MANA, opcode, limitval)
08-07-2006, 02:21 PM#6
Wyvernoid
I know... But I saw that "Unit - Life"(example, mana as well) was something like "Unit - Unit's Life becomes less than 60.00" Well, I don't think it can reflect changes that're not trapping 60 within(I mean, like if a unit's life became 30 from 50)
Or... are you making many many triggers?
Dunno if I'm being stupid... ;P Don't get angry at me^_^
08-07-2006, 02:25 PM#7
Rising_Dusk
See the 'opcode' argument in the event registrations?
Those are > or <, meaning if it goes from 5000 to 1, it will trigger the event if it was set to <4999.
(In jass, they're actually 'LESS_THAN' or 'GREATER_THAN', since the actual symbol means nothing)

And I was suggesting to NOT use these events, as they are unit specific.
Quote:
No, there are events for specific units allowing detection of a single unit's life and mana.
However, there is no way to globally check every unit for the event.

Therefore a periodic check (Every 1 second, ie.) would be the way to go.

Hope that clarifies it a bit. :P
08-07-2006, 02:31 PM#8
Wyvernoid
(*)^)%#@($&)@*%^@$^(*@!#$
I'm confused^^
and 'think that you didn't understand me
well let it be
not a problem worth mentioning ;-)
[and if you really want to clarify it for me, let's use PM^^ Ihave to wait 10 min. between posts. Thanks]
08-07-2006, 10:01 PM#9
AtOmIc_PeAnUt
ROFL, OK that caused a bit of a confuzling episode. Anyways I guess I'll just have to stick with every 1 second, thnx for the demo map soultaker :D I'll check it out now.

EDIT: OK, just one thing, before I can use that, I don't understand the substring bit, what are the numbers for, and what should I be setting them at? I mean the 6, 7 bit at the end of the icon setting action.

Trigger:
Actions
Multiboard - Set the icon for MultiBoard item in column 1, row 1 to IconStrings[(Integer((Substring((Entered chat string), 6, 7))))]
08-08-2006, 01:37 PM#10
Soultaker
Here, I updated the test map with comments and other stuff that should make it more simple for you. Whatever hero you would need to check just set the "test_Hero" to whatever hero you needs to check and run the "Check" trigger.

If you need this in your map, then just copy the "Stuff you need" to your map.

- Soultaker
Attached Files
File type: w3xMultiboard Icon Map v. 1.1.w3x (18.9 KB)
08-08-2006, 02:12 PM#11
Wyvernoid
For the substring functon,
It's like this form::
string substring(string strMain, int intBegin, int intEnd)
substring("Grunts stink", 2, 4)="run"
substring("Wyvernoid", 1, 6)="Wyvern" ^^
substring("AtOmIc_PeAnUt", 8, 13)="PeAnUt"
08-09-2006, 12:32 PM#12
AtOmIc_PeAnUt
OK, thnx again Soultaker for the demo map. Could any1 explain loop action though, I think I understand it but I'm not certain? :D Does the following thing mean that it will just repeat the action 4 times in a row, each time comparing the next number in the number alphabet () starting at the "from" integer stopping when it gets to the "to" integer?

Trigger:
For each (Integer A) from 1 to 4, do (Actions)

So, lol, would I set it to the same thing as above, but set the second number to the total number of heroes or units in the map that could possibly need to be added to the multiboard?

ROFL, As usual, I seem to have over-complexitied something, hope it makes sense

EDIT: It also seems I HAVEN'T actually sorted the life and mana, LOL. I have a trigger which sets an integer variable to the hero's life, and a seperate one for mana. Then sets the text in the multiboard to these values. But the life shows completely the wrong value, and gives it 3 decimal points, and the mana just doesn't show.
08-09-2006, 12:53 PM#13
Soultaker
Quote:
Originally Posted by AtOmIc_PeAnUt
OK, thnx again Soultaker for the demo map. Could any1 explain loop action though, I think I understand it but I'm not certain? :D Does the following thing mean that it will just repeat the action 4 times in a row, each time comparing the next number in the number alphabet () starting at the "from" integer stopping when it gets to the "to" integer?

Yup, this time you were correct :) You should just set the last number to whatever number of heroes you got and create the same thing in the setup trigger.

I might help you with the other multiboard problems, but it's my birthday tomorrow so don't expect any help there..

- Soultaker