This should do it, just update it periodically after a carrier becomes active. It will definitely work, but I'm not sure if there's a better way to do this because I haven't really looked.
Create a region around the unit. Update that region if your unit moves. Make trigger with periodic event. Check number of units in region, and if it's greater than 1, fire your actions.
You cannot load a string from the bank that's longer than 781 characters. It will not crash, but the string will be truncated. This very simple function will enable you to store and load such a string. It has no compression or encryption capabilities.
Map => Player Properties => Control (Types: Computer, Hostile, Neutral, None, User)
What I want: a neutral player whose units are controllable by multiple other players through triggers.
What I've tried:
computer - works, but messes up my active player counter
hostile - works, but refuses to relinquish control (like sieging after I tell it to unsiege)
neutral - works, but shared vision doesn't work correctly (can attack neutral units on high ground without vision)
none - doesn't work
user - works, but has no computer control ability
I would prefer it if a computer takes over control when no other player claims control. Preferably the computer would know how to micro as well. Which option am I supposed to use? What triggers should I use to fix its problems?
You pretty much can't go wrong using just variables. Global data tables are more powerful, similar to using variable arrays.
Global data table
pros: unlimited length, can recall values based on strings, strings could be made in-game, destroyable
cons: only one data table available for any given variable type
Variable array
pros: extremely versatile, can recall values based on integers, integers could be variables themselves
cons: must define its size beforehand
Note: the function retrieves a lot more than just the unit's icon. The only line of importance for you is that second to last line. The function was only used for units available in melee. Even then the image didn't work for the Void Ray (Warp Ray).
You could also link to the unit's button game link and retrieve its file that way. With only 30 units, especially if you're using things like the Automaton, I would either do that or select the images manually.
Your problem is that you need to specify condition "used dialog item == "Petit" from Global Data Table". The "dialog item used" event fires when ANY button is pressed. See here:
I think you could change the leaver's properties just fine, the problem is that the built-in trigger to divide resources is activating before yours. You could verify this with some debug messages; if it is the case, the best solution might be to give the resources back. If you can get a trigger to activate before, I would just change the leaver's alliance settings.
I'm thinking something along the lines of this:
1) Create two new image assets, one highlighted and one normal.
2) Set both buttons' images to the normal
3) Set a trigger to activate when mouse is over either button
4) Trigger changes both images to the highlighted
0
@grenegg: Go
Okay here's an actual question. How do I get minerals and vespene to appear under the "Resources" and "Income" tabs?
0
@gosperglider: Go
Do what you said, in almost exactly those words.
0
@PsychoMC: Go
This should do it, just update it periodically after a carrier becomes active. It will definitely work, but I'm not sure if there's a better way to do this because I haven't really looked.
0
@Anarcy: Go
Edit: what he said
Create a region around the unit. Update that region if your unit moves. Make trigger with periodic event. Check number of units in region, and if it's greater than 1, fire your actions.
0
@dgilbert418: Go
Fixed
0
Can you attach your map to your post? It's useful for any kind of debug.
0
You cannot load a string from the bank that's longer than 781 characters. It will not crash, but the string will be truncated. This very simple function will enable you to store and load such a string. It has no compression or encryption capabilities.
0
Map => Player Properties => Control (Types: Computer, Hostile, Neutral, None, User)
What I want: a neutral player whose units are controllable by multiple other players through triggers.
What I've tried:
computer - works, but messes up my active player counter
hostile - works, but refuses to relinquish control (like sieging after I tell it to unsiege)
neutral - works, but shared vision doesn't work correctly (can attack neutral units on high ground without vision)
none - doesn't work
user - works, but has no computer control ability
I would prefer it if a computer takes over control when no other player claims control. Preferably the computer would know how to micro as well. Which option am I supposed to use? What triggers should I use to fix its problems?
0
@Scbroodsc2: Go
You pretty much can't go wrong using just variables. Global data tables are more powerful, similar to using variable arrays.
Global data table
pros: unlimited length, can recall values based on strings, strings could be made in-game, destroyable
cons: only one data table available for any given variable type
Variable array
pros: extremely versatile, can recall values based on integers, integers could be variables themselves
cons: must define its size beforehand
0
@Alphadrant: Go
Damn, that was perfect. Thanks man.
0
[reply=312971]
Note: the function retrieves a lot more than just the unit's icon. The only line of importance for you is that second to last line. The function was only used for units available in melee. Even then the image didn't work for the Void Ray (Warp Ray).
You could also link to the unit's button game link and retrieve its file that way. With only 30 units, especially if you're using things like the Automaton, I would either do that or select the images manually.
0
@Telthalion: Go
Your problem is that you need to specify condition "used dialog item == "Petit" from Global Data Table". The "dialog item used" event fires when ANY button is pressed. See here:
0
@DragOnGamer626: Go
Your "key pressed == space" will always return true once the trigger starts. Here I fixed it for you:
0
@nThrX: Go
I think you could change the leaver's properties just fine, the problem is that the built-in trigger to divide resources is activating before yours. You could verify this with some debug messages; if it is the case, the best solution might be to give the resources back. If you can get a trigger to activate before, I would just change the leaver's alliance settings.
0
@Syncourt: Go
I'm thinking something along the lines of this:
1) Create two new image assets, one highlighted and one normal.
2) Set both buttons' images to the normal
3) Set a trigger to activate when mouse is over either button
4) Trigger changes both images to the highlighted