The type of trigger i am trying to make needs to go like this,
Event
'Triggering player' property changes 'minerals' (Of course this whole thing can be rewritten to fit what it should look like)
Condition
Owner of triggering player 'property' changes <= 0
Action
Disable Commands for triggering player unit
----
So, allow me to explain what i am wanting to do, I want it so that whenever a player cannot pay for their troops on the field, the trigger would disallow them to issue any commands to that unit and alll other military units on the field that they own but their workers aka scv's.
If anyone could please create a sample map for me on how to create this, I will give credit on my map for doing so, thanks!
Thank you for your reply, I am sorry if I have you most confused.
What I like to see,
In my map players build citys and each Skyscraper increases the players money by 1 for example.
So, order for a player to support a army they must have x amount of Skyscrapers to support a army force for example 50 marines cost 1 mineral aka money every 10 seconds.
So, I need a trigger setup so it would detect if each player has 0 minerals to fund their troops or not. If they do not, the trigger would disallow the triggering player to issue any commands to all military units on the field owned by that player.
And if the player clearly has minerals again after the trigger has fired saying triggering player has 0 minerals, they would be allowed again to issue orders to their units on the field.
If you are confused even more, let me know, thanks!
Comment: The variable below should be a global variable, not a local, the array size should be equal to the max number of players in your game
Command Disabled = False <Boolean[8]>
Conditions
Actions
Comment: Setting a variable for easier reference
Variable - Set Player Minerals = (Player (Triggering player) Minerals)
Comment: There are 2 main cases here; either they can issue commands, or they cannot.
General - Switch (Actions) depending on Command Disabled[(Triggering player)]
Cases
Comment: If they can currently issue commands:
General - If (False)
Actions
General - If (Conditions) then do (Actions) else do (Actions)
If
(Player (Triggering player) Minerals) == 0
Then
Unit Group - Pick each unit in (Any units in (Entire map) owned by player (Triggering player) matching Excluded: Structure, Worker, Missile, Dead, Hidden, with at most Any Amount) and do (Actions)
Actions
Else
Comment: If they can not currently issue commands:
General - If (True)
Actions
General - If (Conditions) then do (Actions) else do (Actions)
If
(Player (Triggering player) Minerals) > 0
Then
Unit Group - Pick each unit in (Any units in (Entire map) owned by player (Triggering player) matching Excluded: Structure, Worker, Missile, Dead, Hidden, with at most Any Amount) and do (Actions)
Actions
Else
Default
There is the basic setup; based specifically on what you want done with the units; there is a lot to be done. If you simply want the command card hidden, but the units to still act on their own and the player to be able to select them; well... I am not sure that can be done (cannot be set through catalog field value set). It would be easy to pause the units, meaning they do nothing at all. It would also be easy to make it so if any of the units were selected by their owner; they were instantly deselected (thus rendered uncontrollable)
Also, to note: This isnt the most efficient way to code this, I am sure; but it is the easiest to understand and modify.
the problem you will encounter shortly after taking the 3 line trigger attempt; is that you will want to re-enable the commands. With that said; you would want to limit the enabling to only happen if a player is going from 0 to >0 minerals, if they have more than 0; they should already be enabled and you wouldnt want to be constantly enabling something that is already enabled.
Event Player - Player {Any Player} Minerals changes
Condition (Player (Triggering player) Minerals) <= 0
Action
Unit Group - Pick each unit in (Last created units) and do (Actions)
-Action ((????)) at this point I am lost what to do next as every option I look for it does not allow me to choose the units I want.
And Glorn, I added you to my B.net friends list, if we could talk further about your Trigger setup, it would be most helpful. I am stuck also on yours lol
General - Switch (Actions) depending on Command Disabled[(Triggering player)]
Cases
General - If (False)
Actions
General - If (Conditions) then do (Actions) else do (Actions)
If
(Player (Triggering player) Minerals) == 0
Then
Unit Group - Pick each unit in (Any units in (Entire map) owned by player (Triggering
player) matching Excluded: Missile, Dead, Hidden, with at most Any Amount) and do (Actions)
Actions
Else
Default
Variable - Set Player Minerals = (Player (Triggering player) Minerals)
General - If (Conditions) then do (Actions) else do (Actions)
If
(Marine units in (Last created units) owned by player (Triggering player) matching Excluded: Missile, Dead, Hidden, with at most Any Amount) == No Unit Group
Then
Else
UI - Disable Buttons for (Player group((Triggering player)))
This is the closes thing I can work up, could someone check it please
Unit Group - Pick each unit in (Last created units) and do (Actions)
Action
General - If (Conditions) then do (Actions) else do (Actions)
If
(Marine units in (Last created units) owned by player (Triggering player) matching Excluded: Missile, Dead, Hidden, with at most Any Amount) == No Unit Group
Then
Else
UI - Disable Buttons for (Player group((Triggering player)))
neat; you remade that mostly correct; here are the next few steps:
Events
------- --Comment: add an event for each player
Player - Player 1 Minerals changes
Local Variables
------- --Comment: The variable below should be a global variable, not a local, the array size should be equal to the max number of players in your game
Command Disabled = False <Boolean[8]>
Conditions
------- --Comment: The conditions will make sure this trigger only runs when it is being used; so that it does not create too much lag
Or
Conditions
And
Conditions
(Player (Triggering player) Minerals) == 0
Command Disabled[(Triggering player)] == False
And
Conditions
(Player (Triggering player) Minerals) > 0
Command Disabled[(Triggering player)] == True
Actions
------- --Comment: Setting a variable for easier reference
------- --Comment: There are 2 main cases here; either they can issue commands, or they cannot.
General - Switch (Actions) depending on Command Disabled[(Triggering player)]
Cases
------- --Comment: If they can currently issue commands:
General - If (False)
Actions
General - If (Conditions) then do (Actions) else do (Actions)
If
(Player (Triggering player) Minerals) == 0
Then
Variable - Set Command Disabled[(Triggering player)] = True
Unit Group - Pick each unit in (Any units in (Entire map) owned by player (Triggering player) matching Excluded: Structure, Worker, Missile, Dead, Hidden, with at most Any Amount) and do (Actions)
Actions
Unit - Make (Picked unit) Uncommandable
Else
------- --Comment: If they can not currently issue commands:
General - If (True)
Actions
General - If (Conditions) then do (Actions) else do (Actions)
If
(Player (Triggering player) Minerals) > 0
Then
Variable - Set Command Disabled[(Triggering player)] = False
Unit Group - Pick each unit in (Any units in (Entire map) owned by player (Triggering player) matching Excluded: Structure, Worker, Missile, Dead, Hidden, with at most Any Amount) and do (Actions)
Actions
Unit - Make (Picked unit) Commandable
Else
Default
The major changes to note are the addition of the conditions; which will greatly reduce lag; though are not required. Also; I removed a variable to keep track of minerals; as this will not be an action definition. You need to take the local variable "command Disables" and move it outside the trigger; on the right side; click and drag it above your trigger; so it is a global variable, not a local variable.
You need to take the local variable "command Disables" and move it outside the trigger; on the right side; click and drag it above your trigger; so it is a global variable, not a local variable.
I click & hold the variable and tried to drag just about everywhere of the editor I could and I had a red circle with a line going through it. lol!
I am soo confused on how to create this global variable
ahh, sorry, yeah, you cant click and drag. Copy and paste it; then delete the one inside the trigger. you may be required to change the references inside the trigger; should only take a minute.
Commandbar
Events
Player - Player 1 Minerals changes
Player - Player 2 Minerals changes
Player - Player 3 Minerals changes
Player - Player 4 Minerals changes
Player - Player 5 Minerals changes
Player - Player 6 Minerals changes
Player - Player 7 Minerals changes
Player - Player 8 Minerals changes
Player - Player 9 Minerals changes
Player - Player 10 Minerals changes
Player - Player 11 Minerals changes
Player - Player 12 Minerals changes
Player - Player 13 Minerals changes
Player - Player 14 Minerals changes
Player - Player 15 Minerals changes
Local Variables
Conditions
Or
Conditions
And
Conditions
(Player (Triggering player) Minerals) == 0
Command Disabled[0] == False
And
Conditions
(Player (Triggering player) Minerals) == 0
Command Disabled[0] == True
Actions
General - Switch (Actions) depending on Command Disabled[(Triggering player)]
Cases
General - If (False)
Actions
General - If (Conditions) then do (Actions) else do (Actions)
If
(Player (Triggering player) Minerals) == 0
Then
Variable - Set Command Disabled[(Triggering player)] = True
Unit Group - Pick each unit in (Any units in (Entire map) owned by player (Triggering player) matching Excluded: Missile, Dead, Hidden, with at most Any Amount) and do (Actions)
Actions
Unit - Make (Picked unit) Uncommandable
Else
Default
This is what I had made for the trigger.
I run the map and I am still able to command my marines, I do have 0 minerals too. Any ideas?
The type of trigger i am trying to make needs to go like this, Event 'Triggering player' property changes 'minerals' (Of course this whole thing can be rewritten to fit what it should look like)
Condition Owner of triggering player 'property' changes <= 0
Action Disable Commands for triggering player unit
----So, allow me to explain what i am wanting to do, I want it so that whenever a player cannot pay for their troops on the field, the trigger would disallow them to issue any commands to that unit and alll other military units on the field that they own but their workers aka scv's.
If anyone could please create a sample map for me on how to create this, I will give credit on my map for doing so, thanks!
Still alive and kicking, just busy.
My guide to the trigger editor (still a work in progress)
Thank you for your reply, I am sorry if I have you most confused.
What I like to see, In my map players build citys and each Skyscraper increases the players money by 1 for example.
So, order for a player to support a army they must have x amount of Skyscrapers to support a army force for example 50 marines cost 1 mineral aka money every 10 seconds.
So, I need a trigger setup so it would detect if each player has 0 minerals to fund their troops or not. If they do not, the trigger would disallow the triggering player to issue any commands to all military units on the field owned by that player.
And if the player clearly has minerals again after the trigger has fired saying triggering player has 0 minerals, they would be allowed again to issue orders to their units on the field.
If you are confused even more, let me know, thanks!
See if I can sum it up.
Player (A) Builds 2 HQ's (HQ's gives Player (A) 10 Minerals Each = 20 Minerals every 10 seconds).
Player (A) now trains 30 Marines at the cost of 1 mineral each every 10 seconds. Total Cost: 30 Minerals
Leaving player with 0 profit.
Trigger Detects Player (A) has 0 Minerals. Trigger (Runs) and disables all command functions for all Marines 'Owned' by Player (A) - (Except SCV's)
Player (A) Build 11 Skyscrapers giving 11 Minerals, Player (A) now has 31 Minerals coming in. Profit 1 Mineral.
Trigger now Detects Player (A) has +1 Mineral Trigger (Runs) Activates Marines Command functions for Player (A).
Trigger Repeats all above functions to keep check conditions.
Hopfully this can sum it up for everyone.
Still could use the help, if another way could be done to create this effect, I am all ears.
Events
Comment: add an event for each player
Player - Player 1 Minerals changes
Player - Player 2 Minerals changes
Local Variables
Player Minerals = 0 <Integer>
Comment: The variable below should be a global variable, not a local, the array size should be equal to the max number of players in your game
Command Disabled = False <Boolean[8]>
Conditions
Actions
Comment: Setting a variable for easier reference
Variable - Set Player Minerals = (Player (Triggering player) Minerals)
Comment: There are 2 main cases here; either they can issue commands, or they cannot.
General - Switch (Actions) depending on Command Disabled[(Triggering player)]
Cases
Comment: If they can currently issue commands:
General - If (False)
Actions
General - If (Conditions) then do (Actions) else do (Actions)
If
(Player (Triggering player) Minerals) == 0
Then
Unit Group - Pick each unit in (Any units in (Entire map) owned by player (Triggering player) matching Excluded: Structure, Worker, Missile, Dead, Hidden, with at most Any Amount) and do (Actions)
Actions
Else
Comment: If they can not currently issue commands:
General - If (True)
Actions
General - If (Conditions) then do (Actions) else do (Actions)
If
(Player (Triggering player) Minerals) > 0
Then
Unit Group - Pick each unit in (Any units in (Entire map) owned by player (Triggering player) matching Excluded: Structure, Worker, Missile, Dead, Hidden, with at most Any Amount) and do (Actions)
Actions
Else
Default
There is the basic setup; based specifically on what you want done with the units; there is a lot to be done. If you simply want the command card hidden, but the units to still act on their own and the player to be able to select them; well... I am not sure that can be done (cannot be set through catalog field value set). It would be easy to pause the units, meaning they do nothing at all. It would also be easy to make it so if any of the units were selected by their owner; they were instantly deselected (thus rendered uncontrollable)
Also, to note: This isnt the most efficient way to code this, I am sure; but it is the easiest to understand and modify.
Skype: [email protected] Current Project: Custom Hero Arena! US: battlenet:://starcraft/map/1/263274 EU: battlenet:://starcraft/map/2/186418
Event - Any player property changes
Condition - Minerals <= 0
Action - Pick all units owned by player and make uncommandable
Thank you Glorn, i will try your setup out and if works out well, I will write your name in for credit.
And
User_874412, for what you have under action, that would apply for all units, I don't want the scv's be counted.
Use "Units in Unit Group Matching Conditions" then to pick only units you want, instead of all units owned by the player.
the problem you will encounter shortly after taking the 3 line trigger attempt; is that you will want to re-enable the commands. With that said; you would want to limit the enabling to only happen if a player is going from 0 to >0 minerals, if they have more than 0; they should already be enabled and you wouldnt want to be constantly enabling something that is already enabled.
Skype: [email protected] Current Project: Custom Hero Arena! US: battlenet:://starcraft/map/1/263274 EU: battlenet:://starcraft/map/2/186418
This is what I have created ~
Event Player - Player {Any Player} Minerals changes Condition (Player (Triggering player) Minerals) <= 0
Action Unit Group - Pick each unit in (Last created units) and do (Actions) -Action ((????)) at this point I am lost what to do next as every option I look for it does not allow me to choose the units I want.
Of course I am just lost.
And Glorn, I added you to my B.net friends list, if we could talk further about your Trigger setup, it would be most helpful. I am stuck also on yours lol
Commandbar
Events
Player - Player 1 Minerals changes
Player - Player 2 Minerals changes
Player - Player 3 Minerals changes
Player - Player 4 Minerals changes
Player - Player 5 Minerals changes
Player - Player 6 Minerals changes
Player - Player 7 Minerals changes
Player - Player 8 Minerals changes
Player - Player 9 Minerals changes
Player - Player 10 Minerals changes
Player - Player 11 Minerals changes
Player - Player 12 Minerals changes
Player - Player 13 Minerals changes
Player - Player 14 Minerals changes
Player - Player 15 Minerals changes
Local Variables
Command Disabled = False <Boolean[16]>
Player Minerals = 0 <Integer>
Conditions
Actions
General - Switch (Actions) depending on Command Disabled[(Triggering player)]
Cases
General - If (False)
Actions
General - If (Conditions) then do (Actions) else do (Actions)
If (Player (Triggering player) Minerals) == 0
Then
Unit Group - Pick each unit in (Any units in (Entire map) owned by player (Triggering player) matching Excluded: Missile, Dead, Hidden, with at most Any Amount) and do (Actions)
Actions
Else
Default
Variable - Set Player Minerals = (Player (Triggering player) Minerals)
This is what I have done from your setup Glorn.
Commanding Units
Events
Player - Player {Any Player} Minerals changes
Local Variables
UnitGroup = (Empty unit group) <Unit Group[16]>
Conditions
(Player (Triggering player) Minerals) <= 0
Actions
General - If (Conditions) then do (Actions) else do (Actions)
If
(Marine units in (Last created units) owned by player (Triggering player) matching Excluded: Missile, Dead, Hidden, with at most Any Amount) == No Unit Group
Then
Else
UI - Disable Buttons for (Player group((Triggering player)))
This is the closes thing I can work up, could someone check it please
Commanding Units
Events
Player - Player {Any Player} Minerals changes
Local Variables
UnitGroup = (Empty unit group) <Unit Group[16]>
Conditions
(Player (Triggering player) Minerals) <= 0
Actions
Unit Group - Pick each unit in (Last created units) and do (Actions)
Action
General - If (Conditions) then do (Actions) else do (Actions)
If (Marine units in (Last created units) owned by player (Triggering player) matching Excluded: Missile, Dead, Hidden, with at most Any Amount) == No Unit Group
Then
Else
UI - Disable Buttons for (Player group((Triggering player)))
neat; you remade that mostly correct; here are the next few steps:
Events
------- --Comment: add an event for each player
Player - Player 1 Minerals changes
Local Variables
------- --Comment: The variable below should be a global variable, not a local, the array size should be equal to the max number of players in your game
Command Disabled = False <Boolean[8]>
Conditions
------- --Comment: The conditions will make sure this trigger only runs when it is being used; so that it does not create too much lag
Or
Conditions
And
Conditions
(Player (Triggering player) Minerals) == 0
Command Disabled[(Triggering player)] == False
And
Conditions
(Player (Triggering player) Minerals) > 0
Command Disabled[(Triggering player)] == True
Actions
------- --Comment: Setting a variable for easier reference
------- --Comment: There are 2 main cases here; either they can issue commands, or they cannot.
General - Switch (Actions) depending on Command Disabled[(Triggering player)]
Cases
------- --Comment: If they can currently issue commands:
General - If (False)
Actions
General - If (Conditions) then do (Actions) else do (Actions)
If
(Player (Triggering player) Minerals) == 0
Then
Variable - Set Command Disabled[(Triggering player)] = True
Unit Group - Pick each unit in (Any units in (Entire map) owned by player (Triggering player) matching Excluded: Structure, Worker, Missile, Dead, Hidden, with at most Any Amount) and do (Actions)
Actions
Unit - Make (Picked unit) Uncommandable
Else
------- --Comment: If they can not currently issue commands:
General - If (True)
Actions
General - If (Conditions) then do (Actions) else do (Actions)
If
(Player (Triggering player) Minerals) > 0
Then
Variable - Set Command Disabled[(Triggering player)] = False
Unit Group - Pick each unit in (Any units in (Entire map) owned by player (Triggering player) matching Excluded: Structure, Worker, Missile, Dead, Hidden, with at most Any Amount) and do (Actions)
Actions
Unit - Make (Picked unit) Commandable
Else
Default
The major changes to note are the addition of the conditions; which will greatly reduce lag; though are not required. Also; I removed a variable to keep track of minerals; as this will not be an action definition. You need to take the local variable "command Disables" and move it outside the trigger; on the right side; click and drag it above your trigger; so it is a global variable, not a local variable.
Skype: [email protected] Current Project: Custom Hero Arena! US: battlenet:://starcraft/map/1/263274 EU: battlenet:://starcraft/map/2/186418
I click & hold the variable and tried to drag just about everywhere of the editor I could and I had a red circle with a line going through it. lol!
I am soo confused on how to create this global variable
ahh, sorry, yeah, you cant click and drag. Copy and paste it; then delete the one inside the trigger. you may be required to change the references inside the trigger; should only take a minute.
err, copy and paste; not cut and paste.
Skype: [email protected] Current Project: Custom Hero Arena! US: battlenet:://starcraft/map/1/263274 EU: battlenet:://starcraft/map/2/186418
Commandbar
Events
Player - Player 1 Minerals changes
Player - Player 2 Minerals changes
Player - Player 3 Minerals changes
Player - Player 4 Minerals changes
Player - Player 5 Minerals changes
Player - Player 6 Minerals changes
Player - Player 7 Minerals changes
Player - Player 8 Minerals changes
Player - Player 9 Minerals changes
Player - Player 10 Minerals changes
Player - Player 11 Minerals changes
Player - Player 12 Minerals changes
Player - Player 13 Minerals changes
Player - Player 14 Minerals changes
Player - Player 15 Minerals changes
Local Variables
Conditions
Or
Conditions
And
Conditions
(Player (Triggering player) Minerals) == 0
Command Disabled[0] == False
And
Conditions
(Player (Triggering player) Minerals) == 0
Command Disabled[0] == True
Actions
General - Switch (Actions) depending on Command Disabled[(Triggering player)]
Cases
General - If (False)
Actions
General - If (Conditions) then do (Actions) else do (Actions)
If
(Player (Triggering player) Minerals) == 0
Then
Variable - Set Command Disabled[(Triggering player)] = True
Unit Group - Pick each unit in (Any units in (Entire map) owned by player (Triggering player) matching Excluded: Missile, Dead, Hidden, with at most Any Amount) and do (Actions)
Actions
Unit - Make (Picked unit) Uncommandable
Else
Default
This is what I had made for the trigger.
I run the map and I am still able to command my marines, I do have 0 minerals too. Any ideas?
whoops, I think I know what I missed lol