So, I created this new unit, fresh. I added an actor, 2 buttons, 'move' and 'stop' it has its own model and sound.
My problem is the 'stop' button ability shows up on the bar however the move button does not show up although in the data editor I have added the move icon and ability to the unit but in game it just does not show up. Any idea why?
Rebel
Events
Timer - Every 5.0 seconds of Game Time
Local Variables
Conditions
Actions
Player Group - Pick each player in (Active Players) and do (Actions)
Actions
General - If (Conditions) then do (Actions) else do (Actions)
If
(Status of player (Picked player)) == Playing
Then
Unit Group - Pick each unit in (Any units in (Entire map) owned by player Any Player matching Excluded: Heroic, Missile, Dead, Hidden, with at most Any Amount) and do (Actions)
Actions
General - If (Conditions) then do (Actions) else do (Actions)
If
(Owner of (Picked unit)) == Uncommandable
Then
Unit - Change ownership of (Picked unit) to player 15 and Change Color
Else
Else
UI - Display "1" for (All players) to Debug area
The marines remain under my control after 5 seconds of being Uncommandable.
What I like to do is make it so after 60 seconds or in this case 5 seconds, the trigger will change ownership of the marines to player 15 hostile making them rebel troops.
If this trigger could be combined with the other one you showed me to make I am willing to do that.
Events
Timer - Every 5.0 seconds of Game Time
Local Variables
Conditions
Actions
Player Group - Pick each player in (Active Players) and do (Actions)
Actions
General - If (Conditions) then do (Actions) else do (Actions)
If
(Status of player (Triggering player)) == Playing
Then
Unit Group - Pick each unit in (Any units in (Entire map) owned by player Any Player matching Excluded: Heroic, Missile, Dead, Hidden, with at most Any Amount) and do (Actions)
Actions
General - If (Conditions) then do (Actions) else do (Actions)
If
(Owner of (Picked unit)) == Uncommandable
Then
Unit - Change ownership of (Picked unit) to player 15 and Change Color
Else
Else
UI - Display "1" for (All players) to Debug area
As you can see I am in no shape or form on how to create proper triggers that would work on the first try.
So, too sum it all up, this is what I want this trigger function do..
-Player (A) has 10 Marines on the field
-10 Marines are not 'Commandable'
-Trigger Detects Marines are now Uncommandable
-Changes ownership of those marines to Hostile Computer 'player 15'
It works, the only problem I was having was the fact that I was starting at 0 minerals and the trigger didnt like that idea. I added 5 minerals and the trigger responded in kind with 3,2 and 1. The marines we're not able to be commanded.
Now, however this trigger creates a small problem, although marines cannot be commaned, also the scv's cannot be also.
I like to target only the military units and leave the scv's out of the trigger.
I notice I could change from "Any" to a 1 type of unit. How can I do many types of units?
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[(Triggering player)] == False
And
Conditions
(Player (Triggering player) Minerals) > 0
Command Disabled[(Triggering player)] == True
Actions
UI - Display "3" for (All players) to Chat area
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
UI - Display "1" for (All players) to Chat area
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
General - If (True)
Actions
General - If (Conditions) then do (Actions) else do (Actions)
If
(Player (Triggering player) Minerals) > 0
Then
UI - Display "2" for (All players) to Chat area
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: Missile, Dead, Hidden, with at most Any Amount) and do (Actions)
Actions
Unit - Make (Picked unit) Commandable
Else
Default
If instead trying to do a command or uncommand, would it be easier to have the unit change its ownership instead? If the player cannot afford to pay their marines, then they would rebel and change ownership to a AI control.
I fixed the error but the trigger still does not work.
I have 0 minerals and still able to command the marines around.
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[(Triggering player)] == False
And
Conditions
(Player (Triggering player) Minerals) > 0
Command Disabled[(Triggering player)] == 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
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: Missile, Dead, Hidden, with at most Any Amount) and do (Actions)
Actions
Unit - Make (Picked unit) Commandable
Else
Default
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
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: Missile, Dead, Hidden, with at most Any Amount) and do (Actions)
Actions
Unit - Make (Picked unit) Commandable
Else
Default
--------------------------------------------
This is what I had created and the marines on my map can still be commandable. Any ideas?
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?
0
So, I created this new unit, fresh. I added an actor, 2 buttons, 'move' and 'stop' it has its own model and sound.
My problem is the 'stop' button ability shows up on the bar however the move button does not show up although in the data editor I have added the move icon and ability to the unit but in game it just does not show up. Any idea why?
0
New code you told me to use,
Rebel
Events
Timer - Every 5.0 seconds of Game Time
Local Variables
Conditions
Actions
Player Group - Pick each player in (Active Players) and do (Actions)
Actions
General - If (Conditions) then do (Actions) else do (Actions)
If
(Status of player (Picked player)) == Playing
Then
Unit Group - Pick each unit in (Any units in (Entire map) owned by player Any Player matching Excluded: Heroic, Missile, Dead, Hidden, with at most Any Amount) and do (Actions)
Actions
General - If (Conditions) then do (Actions) else do (Actions)
If
(Owner of (Picked unit)) == Uncommandable
Then
Unit - Change ownership of (Picked unit) to player 15 and Change Color
Else
Else
UI - Display "1" for (All players) to Debug area
The marines remain under my control after 5 seconds of being Uncommandable.
What I like to do is make it so after 60 seconds or in this case 5 seconds, the trigger will change ownership of the marines to player 15 hostile making them rebel troops.
If this trigger could be combined with the other one you showed me to make I am willing to do that.
0
Here is my Code,
Rebel
Events
Timer - Every 5.0 seconds of Game Time
Local Variables
Conditions
Actions
Player Group - Pick each player in (Active Players) and do (Actions)
Actions
General - If (Conditions) then do (Actions) else do (Actions)
If
(Status of player (Triggering player)) == Playing
Then
Unit Group - Pick each unit in (Any units in (Entire map) owned by player Any Player matching Excluded: Heroic, Missile, Dead, Hidden, with at most Any Amount) and do (Actions)
Actions
General - If (Conditions) then do (Actions) else do (Actions)
If
(Owner of (Picked unit)) == Uncommandable
Then
Unit - Change ownership of (Picked unit) to player 15 and Change Color
Else
Else
UI - Display "1" for (All players) to Debug area
As you can see I am in no shape or form on how to create proper triggers that would work on the first try.
So, too sum it all up, this is what I want this trigger function do..
-Player (A) has 10 Marines on the field
-10 Marines are not 'Commandable'
-Trigger Detects Marines are now Uncommandable
-Changes ownership of those marines to Hostile Computer 'player 15'
0
Never mind I know how to do this, I just add a Excluded for that type of unit and it should be ignored.
You sir earn my respect and credit on my map. Thank you for your time.
+1 Rep
I don't know how to give it but you earn it!
0
Good news.
It works, the only problem I was having was the fact that I was starting at 0 minerals and the trigger didnt like that idea. I added 5 minerals and the trigger responded in kind with 3,2 and 1. The marines we're not able to be commanded.
Now, however this trigger creates a small problem, although marines cannot be commaned, also the scv's cannot be also.
I like to target only the military units and leave the scv's out of the trigger.
I notice I could change from "Any" to a 1 type of unit. How can I do many types of units?
0
I changed the Text from Chat to Debug and still, 3 & 2 are firing, 1 is not.
0
3 & 2 are firing, 1 is not.
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[(Triggering player)] == False
And
Conditions
(Player (Triggering player) Minerals) > 0
Command Disabled[(Triggering player)] == True
Actions
UI - Display "3" for (All players) to Chat area
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
UI - Display "1" for (All players) to Chat area
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
General - If (True)
Actions
General - If (Conditions) then do (Actions) else do (Actions)
If
(Player (Triggering player) Minerals) > 0
Then
UI - Display "2" for (All players) to Chat area
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: Missile, Dead, Hidden, with at most Any Amount) and do (Actions)
Actions
Unit - Make (Picked unit) Commandable
Else
Default
0
If instead trying to do a command or uncommand, would it be easier to have the unit change its ownership instead? If the player cannot afford to pay their marines, then they would rebel and change ownership to a AI control.
0
Map starts out with 0 minerals
I changed the Global variable to True instead false
Still, marines are commandable
0
I fixed the error but the trigger still does not work.
I have 0 minerals and still able to command the marines around.
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[(Triggering player)] == False
And
Conditions
(Player (Triggering player) Minerals) > 0
Command Disabled[(Triggering player)] == 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
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: Missile, Dead, Hidden, with at most Any Amount) and do (Actions)
Actions
Unit - Make (Picked unit) Commandable
Else
Default
0
I appear to have all the code written down now.
However -
Now I am getting this error about the Array.
"Trying to access an element past the end an array"
Near line 56
0
I thought it might of been because you had this
(Player (Triggering player) Minerals) == 0
Command Disabled[(Triggering player)] == False
And
Conditions
(Player (Triggering player) Minerals) > 0
Command Disabled[(Triggering player)] == True
So I fixed mine, but still no luck of not being able to command my marines. They are still commandable.
0
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
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: Missile, Dead, Hidden, with at most Any Amount) and do (Actions)
Actions
Unit - Make (Picked unit) Commandable
Else
Default
--------------------------------------------
This is what I had created and the marines on my map can still be commandable. Any ideas?
0
whoops, I think I know what I missed lol
0
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?