I will update this thread as a get more time for it. Also any replies with ideas or questions that are general (not person specific) I will probably add to this. Hey mods can I request a sticky?
How do I ...
...add a unit that isn't preplaced to a unit group?
This is relatively simple. Essentially you need a trigger with a unit enters the map event. you can then use switches or if then else statements to add it to unit groups of your choice
...count the number of units in a unit group?
....you really need help if you need help with this one. use the number of units in unit group function to find out ex: display text(number of unit in unit group) ex: set x = number of units in unit group
...use banks
It's relatively complicated and simple. You have to preload the bank (this is easy now), just go to maps->preload data->banks and enter you banks name. Then you have to open the bank to use it. (it's easier to open it and save it to a variable, make things easier, but whatever makess you happy), congratulations, you can store sinfo to the opened bank, and then you have to save the bank for changes to save.
...create a custom health ui bar
varies, depending on what you want, dot you want to change the standard ones attached to the unit, or do you want to make a ui bar? The bar is the one i'll actually cover. go here for the standard attached ones. The bar is what is known as a dialog. It can be many things varying from map the map. [()= the action i'm talking about] For this example i'm going to use a progress bar, as you get more advanced you can do more. First things first, you need to have your unit you're making the status bar for set to a variable, then you are going to need to make a dialog. For our purposes 500, 40 for it's size, and put it in the center. (you can also set it to a variable if you want to here to) Now set the last created dialog's background to hide. (show/hide dialog background action) Now we are going to create a dialog item of type progress bar for the last created dialog (create dialog item action) then set it's size to parent (set dialog item size to parent). now set it's minimum value to 0 and it's maximum value to your units maximum life.(set dialog item maximum value, set dialog item minimum value) Now set the last created dialog to a variable(set variable) in this case my variable's name is Fred Now show the last created dialog (show/hide dialog) next we need a new function, in it we are going to add a while loop with the condition that whatever unit you're doing this for is still alive. (while, unit is alive) Then set Fred's current value to the units current life (set dialog item current value) Then we add a wait of .0625 gametime secs (wait)
There is a lot of stuff searches should pop up. However sometimes people just don't search hence the thread i'm working on. I'll probably just start adding links to already answered questions.
There is a lot of stuff searches should pop up. However sometimes people just don't search hence the thread i'm working on. I'll probably just start adding links to already answered questions.
Oh, I know, I meant as far as finding the answers to put in this thread so you don't have to go through each one and figure it out anew.
Rollback Post to RevisionRollBack
To post a comment, please login or register a new account.
Triggering F.A.Q.
Maintenence
I will update this thread as a get more time for it. Also any replies with ideas or questions that are general (not person specific) I will probably add to this. Hey mods can I request a sticky?
How do I ...
...add a unit that isn't preplaced to a unit group?
This is relatively simple. Essentially you need a trigger with a unit enters the map event.
you can then use switches or if then else statements to add it to unit groups of your choice
...count the number of units in a unit group?
....you really need help if you need help with this one.
use the number of units in unit group function to find out
ex: display text(number of unit in unit group)
ex: set x = number of units in unit group
...use banks
It's relatively complicated and simple.
You have to preload the bank (this is easy now), just go to maps->preload data->banks and enter you banks name.
Then you have to open the bank to use it. (it's easier to open it and save it to a variable, make things easier, but whatever makess you happy), congratulations, you can store sinfo to the opened bank, and then you have to save the bank for changes to save.
...create a custom health ui bar
varies, depending on what you want, dot you want to change the standard ones attached to the unit, or do you want to make a ui bar?
The bar is the one i'll actually cover. go here for the standard attached ones.
The bar is what is known as a dialog. It can be many things varying from map the map. [()= the action i'm talking about] For this example i'm going to use a progress bar, as you get more advanced you can do more.
First things first, you need to have your unit you're making the status bar for set to a variable, then you are going to need to make a dialog. For our purposes 500, 40 for it's size, and put it in the center. (you can also set it to a variable if you want to here to)
Now set the last created dialog's background to hide. (show/hide dialog background action)
Now we are going to create a dialog item of type progress bar for the last created dialog (create dialog item action) then set it's size to parent (set dialog item size to parent).
now set it's minimum value to 0 and it's maximum value to your units maximum life.(set dialog item maximum value, set dialog item minimum value) Now set the last created dialog to a variable(set variable) in this case my variable's name is Fred
Now show the last created dialog (show/hide dialog)
next we need a new function, in it we are going to add a while loop with the condition that whatever unit you're doing this for is still alive. (while, unit is alive) Then set Fred's current value to the units current life (set dialog item current value)
Then we add a wait of .0625 gametime secs (wait)
...create a line-of-sight stealth system?
[[http://www.sc2mapster.com/forums/development/triggers/31646-if-unit-is-in-front-of-a-unit-detect-problem/?post=10|Click here]
...add hero stat attributes to a unit through triggers?
Click here
...create base capping/king of the hill functions?
http://www.sc2mapster.com/forums/resources/tutorials/13223-how-to-multiple-region-capture-capturing/?post=1
...modify unit types or get unit type info using catalog triggers?
Click here or Click here for a different one
...deal with actor messages using triggers?
Click here
Still alive and kicking, just busy.
My guide to the trigger editor (still a work in progress)
Reserved for future changes. Pausing work on this for right now. Doing other stuff
Still alive and kicking, just busy.
My guide to the trigger editor (still a work in progress)
Some more common questions, in my experience:
How do I...
...create a line-of-sight stealth system?
...add hero stat attributes to a unit through triggers?
...create base capping/king of the hill functions?
...modify unit types or get unit type info using catalog triggers? - Another source
...deal with actor messages using triggers?
These have all been answered before so a search should get the solutions. I'll edit in the links once I find them...
EDIT: Done! :)
@BasharTeg: Go
There is a lot of stuff searches should pop up. However sometimes people just don't search hence the thread i'm working on. I'll probably just start adding links to already answered questions.
Still alive and kicking, just busy.
My guide to the trigger editor (still a work in progress)
Oh, I know, I meant as far as finding the answers to put in this thread so you don't have to go through each one and figure it out anew.