You mean you have a bunch of regions, and you need to find the closest region to the point P?
There's no native function for "closest" something that I'm aware of. "Closest region" is kind of ambiguous, I hope you don't mean the shortest distance to a region edge, do you mean the closest region center point? That would imply going through the list of regions and computing distance to center point.
But is this just to find in which hex tile a click lies? Then I would just use a little math based on that point's coordinates to compute the hex tiles, don't mess with 500000 regions.
Don't use the dialog's title, create a "label" dialog item and set the priority of your dialog items so they render in the order desired.
Create unit group for all units of player X, loop through it (for each unit MyUnit in unit group MyUnitGroup), and kill/remove each unit.
Use unit groups to keep track of all of a player's units. If you need to store extra per-unit information, use "unit custom values" (extra custom data you can assign to units in triggers code).
That's a lot of doodads. If you are going to cover the world with hexagons, I would either :
- Use a bigger "grid" models that contain a lot of hexagon tiles.
- Or use textures, modified ones, with visible hexagon edges painted on them.
That's not very random... Here's a simple solution, and random enough.
Create an array of 8 values, assign values of 1 to 8 to each in sequence ( so array[3] = 3, etc. ). Then, for each entry in your array, swap its value with the value of another randomly picked entry. You'll still have the values 1 to 8 stored in the array, but shuffled around.
"Handle of player" is a string,"Name of player" is a text.
Texts are opaque chunks of text ; you can't read, parse or cut them. Strings are more flexible and can be converted to text, text can't be converted to strings. Most native dialog functions work with text.
Random integer between 1 and 8 is any number from 1 to 8 inclusively.
You could maintain an array of starting spots that are available or not, or you could either randomize an array of starting location numbers and assign the values in order. As for "returning to the beginning of the trigger", use a while() loop and "break" out of it whenever you want,
Player names : create a text variable (or preferably an array of 16), store "Name of player" for given player index.
5. When you create a new action, you can only see the functions that return nothing. To see all the functions that return an integer, you must be needing to insert an integer value within the trigger editor at that point. Steps :
- Create a new local variable type "integer"
- Create new action "Set Variable", select your integer as target variable.
- Assign a "Random Integer" to your variable.
7. Changing the selection in a list triggers also the "dialog item is used" event, "selection changed" event type. Just act upon receiving the event.
1. I believe you can get clicks on any dialog items, not just buttons. If you want a clickable text item, create a text item.
2. You can create your own styles (search forums for that), and each style can take a custom font=X value. You can probably add extra fonts ( Open Type Fonts, .otf ) though I haven't tried.
3.I assume you already know about tooltips, and you want something fancier. You could probably use the Mouse Moved trigger event, though if you do so, really turn off that trigger whenever you don't need the event. It generates a lot of traffic. It will also go through the battle.net latency.
4. What about an image behind your label dialog item?
5. Assign a random number to an integer variable. "Random Integer" : RandomInt().
6. There are a lot of dialog borders to pick from. Browse the included textures starting with the prefix ui_ (user interface).
Rollback Post to RevisionRollBack
To post a comment, please login or register a new account.
You mean you have a bunch of regions, and you need to find the closest region to the point P?
There's no native function for "closest" something that I'm aware of. "Closest region" is kind of ambiguous, I hope you don't mean the shortest distance to a region edge, do you mean the closest region center point? That would imply going through the list of regions and computing distance to center point.
But is this just to find in which hex tile a click lies? Then I would just use a little math based on that point's coordinates to compute the hex tiles, don't mess with 500000 regions.
Set Variable, select a point as destination variable, Center of Region X.
Don't use the dialog's title, create a "label" dialog item and set the priority of your dialog items so they render in the order desired.
Create unit group for all units of player X, loop through it (for each unit MyUnit in unit group MyUnitGroup), and kill/remove each unit.
Use unit groups to keep track of all of a player's units. If you need to store extra per-unit information, use "unit custom values" (extra custom data you can assign to units in triggers code).
That's a lot of doodads. If you are going to cover the world with hexagons, I would either :
- Use a bigger "grid" models that contain a lot of hexagon tiles.
- Or use textures, modified ones, with visible hexagon edges painted on them.
That's not very random... Here's a simple solution, and random enough.
Create an array of 8 values, assign values of 1 to 8 to each in sequence ( so array[3] = 3, etc. ). Then, for each entry in your array, swap its value with the value of another randomly picked entry. You'll still have the values 1 to 8 stored in the array, but shuffled around.
"Handle of player" is a string,"Name of player" is a text.
Texts are opaque chunks of text ; you can't read, parse or cut them. Strings are more flexible and can be converted to text, text can't be converted to strings. Most native dialog functions work with text.
Random integer between 1 and 8 is any number from 1 to 8 inclusively.
You could maintain an array of starting spots that are available or not, or you could either randomize an array of starting location numbers and assign the values in order. As for "returning to the beginning of the trigger", use a while() loop and "break" out of it whenever you want,
Player names : create a text variable (or preferably an array of 16), store "Name of player" for given player index.
Oh right, forgot about mouse enters/exits events.
5. When you create a new action, you can only see the functions that return nothing. To see all the functions that return an integer, you must be needing to insert an integer value within the trigger editor at that point. Steps :
- Create a new local variable type "integer"
- Create new action "Set Variable", select your integer as target variable.
- Assign a "Random Integer" to your variable.
7. Changing the selection in a list triggers also the "dialog item is used" event, "selection changed" event type. Just act upon receiving the event.
1. I believe you can get clicks on any dialog items, not just buttons. If you want a clickable text item, create a text item.
2. You can create your own styles (search forums for that), and each style can take a custom font=X value. You can probably add extra fonts ( Open Type Fonts, .otf ) though I haven't tried.
3.I assume you already know about tooltips, and you want something fancier. You could probably use the Mouse Moved trigger event, though if you do so, really turn off that trigger whenever you don't need the event. It generates a lot of traffic. It will also go through the battle.net latency.
4. What about an image behind your label dialog item?
5. Assign a random number to an integer variable. "Random Integer" : RandomInt().
6. There are a lot of dialog borders to pick from. Browse the included textures starting with the prefix ui_ (user interface).