• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • 🏆 Hive's 6th HD Modeling Contest: Mechanical is now open! Design and model a mechanical creature, mechanized animal, a futuristic robotic being, or anything else your imagination can tinker with! 📅 Submissions close on June 30, 2024. Don't miss this opportunity to let your creativity shine! Enter now and show us your mechanical masterpiece! 🔗 Click here to enter!

[General] Multiboard Resources

Status
Not open for further replies.
Level 2
Joined
Jun 10, 2010
Messages
9
I have been working on a map of lately trying to work through some coding and things and came across multiboards. Having no clue what they were I went to the tutorials portion and promptly afterwards started to build my own. But now looking at tutorial, there isn't a mention at all if multiboards can be used for tracking resources (for a team), or how to implement that into them. Which is what I had wanted from multiboards in the first place o_O. So I guess this is half a help post half a request to show me how its done. Thanks in Advance if you can help!

[Yes, I did search the forums first for a post similar, but either they didn't have a tag I searched for, or skimming through for help didn't yield a topic either]
 
Level 14
Joined
Apr 20, 2009
Messages
1,543
I have been working on a map of lately trying to work through some coding and things and came across multiboards. Having no clue what they were I went to the tutorials portion and promptly afterwards started to build my own. But now looking at tutorial, there isn't a mention at all if multiboards can be used for tracking resources (for a team), or how to implement that into them. Which is what I had wanted from multiboards in the first place o_O. So I guess this is half a help post half a request to show me how its done. Thanks in Advance if you can help!

[Yes, I did search the forums first for a post similar, but either they didn't have a tag I searched for, or skimming through for help didn't yield a topic either]

Well if you can display a string on a multiboard, a icon, even entire bars for health or mana, then why couldn't you simply convert an integer to a string in order to show a number? Such as resources?
All you have to do is update the multiboard every ... in order to show the resource correctly. If you look in these tutorials it is explained how to show text inside a multiboard (if the tutorial is not total ****), just use the integer that you probably already use to track the resources and convert it to a string...
 
Level 2
Joined
Jun 10, 2010
Messages
9
Ehh, just getting player names to display is a stretch at the moment... In fact they haven't even been showing correctly in game, so I'm a touch lost on where to go from here. Would it help to show my poor GUI skills? lol
 
Level 14
Joined
Apr 20, 2009
Messages
1,543
Ehh, just getting player names to display is a stretch at the moment... In fact they haven't even been showing correctly in game, so I'm a touch lost on where to go from here. Would it help to show my poor GUI skills? lol

Yes it would, I'll correct them for you as a practical learning process ;)

By the way could you define resources for me?
Are you talking about lumber, gold, timers, upkeep? Or something more custom?
 
Level 2
Joined
Jun 10, 2010
Messages
9
I'll grab a picture quick and then post. And lumber hopefully will be the resource to be monitored by the multiboard.

[Also, tutorial resource I've been using: Here]
 
Level 2
Joined
Jun 10, 2010
Messages
9
Here's my 3 kind of basic scripts I've made out of this. I feel like they are already kind of hap hazard but, eh I'm still trying to work through it.
Scripts.jpg
 
Level 14
Joined
Apr 20, 2009
Messages
1,543
You might want to do something like:

  • multiboard
    • Events
      • Time - Every 0.50 seconds of game time
    • Conditions
    • Actions
      • Multiboard - Set the text for My_Multiboard item in column 3, row 2 to (String((Player 1 (Red) Current lumber)))
      • Multiboard - Set the text for My_Multiboard item in column 3, row 3 to (String((Player 2 (Blue) Current lumber)))
      • Multiboard - Set the text for My_Multiboard item in column 3, row 4 to (String((Player 3 (Teal) Current lumber)))
      • Multiboard - Set the text for My_Multiboard item in column 3, row 5 to (String((Player 4 (Purple) Current lumber)))
      • Multiboard - Set the text for My_Multiboard item in column 3, row 6 to (String((Player 5 (Yellow) Current lumber)))
      • Multiboard - Set the text for My_Multiboard item in column 3, row 7 to (String((Player 6 (Orange) Current lumber)))
      • Multiboard - Set the text for My_Multiboard item in column 3, row 8 to (String((Player 7 (Green) Current lumber)))
      • Multiboard - Set the text for My_Multiboard item in column 3, row 9 to (String((Player 8 (Pink) Current lumber)))
Create a variable in the variable editor for the multiboard and set it to be the last created multiboard when you create the multiboard. I named mine My_Multiboard in this example. This way you can use the variable to change the multiboard in different triggers.

To show the amount of lumber like I said before: convert a integer to string,

Conversion - Integer to String to be exact

Then use Player - Player Property in order to set the lumber resource.

I hope this helps...

EDIT: Also there is a location leak in your Melee Initialization trigger. In order to remove it do this:

create a variable called temp_loc or temporary location, something like that. It should be a point variable.
Then in your melee initialization trigger do this:

  • Melee Initialization
    • Events
    • Conditions
    • Actions
      • Set Temp_Loc = (Center of Region 000 <gen>)
      • Unit - Create 1 Peasent corpse for Player 11 (Dark Green) at Temp_Loc facing Default building facing degrees
      • Custom script: call RemoveLocation(udg_Temp_Loc)
Would you like an explenation why this needs to be done?
 
Level 14
Joined
Apr 20, 2009
Messages
1,543
Instead of using a wait change the event to
  • Time - Elapsed game time is 0.00 seconds
Also, you want to create a periodic trigger to track their resources. (To show the change)

Eeerm didn't I show that in my previous post? :S
Good feedback on the map init though.. :)

Also: if you want to use a wait inbetween specific actions, I suggest using a countdown timer. Wait is inaccurate and can cause triggers to not be MUI, but let's not talk about that for once please...
I'm tired, need to go to bed, goodbye :)
 
Level 2
Joined
Jun 10, 2010
Messages
9
I would like any help I can get. I'm confused on your stringing thing. lol? And the melee leak?

Guess its easy to tell this is my first major experimentation into triggers.
 
Level 14
Joined
Apr 20, 2009
Messages
1,543
I would like any help I can get. I'm confused on your stringing thing. lol? And the melee leak?

Guess its easy to tell this is my first major experimentation into triggers.

I guess it is useful to read the tutorial forums then:

http://www.hiveworkshop.com/forums/warcraft-iii-tutorials-206/

Also, this tutorial might come in hand if your starting out for the first time:
How to begin triggering for the complete beginner

By the way what are you not getting about the string conversion I mentioned earlyer?

Here, maybe a picture helps?


A leak basically means that whenever something does not get removed and stays in memory for the entire game, it takes up some of your RAM memory.
A location is one of these things.

In your Melee Initialization trigger you create a unit which is created on a location.
In order to make sure that the location that you've used gets removed from the memory you would have to set a variable to that location, then use that variable instead of the location and afterwards use a custom script to remove the location.

This is done by pointing the script to your variable that you've used.

In order to create a variable you would have to get into the variable editor. To do so, click on the icon that I've made red and create a new variable by clicking on the green x + icon.



In your trigger use the action: Set Variable to give a value to the variable.

after you've done this you can use this same variable that you've set in your trigger in other triggers, so for example:

If I made 2 triggers where in the first trigger I set a integer variable to be 12
Then I would be abled to return that value in the second trigger by specifying the integer variable I created in the first trigger.

The custom script is called Jass script. This is basically the language in which GUI triggers are created. Some things you might want to do in GUI can only be done in Jass because they simply do not exist in GUI. To use Jass through GUI however, you can use a custom script action.

For example: the RemoveLocation() function can only be called in Jass because there simply is no action for it in GUI.

In Jass variables from the variable editor are specified by putting udg_ before the name of the variable. So in order to perform the RemoveLocation function you would have to create an action in GUI called Custom Script, and then manually type in the following:

call RemoveLocation(udg_My_Location_Variable)

where My_Location_Variable is the variable that you've used to create the unit.

I hope this helps :)

EDIT: to learn more about leaks I suggest you read this:
http://www.hiveworkshop.com/forums/...quick-tutorial-common-triggering-tips-190802/

This also might interest you:
http://www.hiveworkshop.com/forums/2070235-post10.html
 
Last edited:
Status
Not open for further replies.
Top