weeeeeell... Actually what your doing is that your not... controlling the unit to move.
Ex. Normal camera mode, u select unit and right click at a point to his right so he walks there
This mode. you press D so he walks to the same point as in the ex above.
The difference is that the unit its not moving by command, but by triggers. If you look at the triggers the unit is actually standing still. An animation is played to make it SEEM like hes moving and the unit is moved to the location. So no.. the ability is not on by default and cant be applied directly. But you could make a trigger for it =) To add an upgrade to make the unit jump like a repear jump.
Thats a long story though and nothing im good at.
Actually i could see where hes going with the movement triggers.
Press:
Press W
Events
UI - Player 1 presses W key Down with shift Allow, control Allow, alt Allow
UI - Player 2 presses W key Down with shift Allow, control Allow, alt Allow
Local Variables
Conditions
Actions
------- Command your unit to move
Variable - Set W[(Triggering player)] = true
Animation - Clear the Default animation for (Actor for PlayerUnit[(Triggering player)])
Trigger - Run Unzoom (Check Conditions, Don't Wait until it finishes)
Release:
Release W
Events
UI - Player 1 presses W key Up with shift Allow, control Allow, alt Allow
UI - Player 2 presses W key Up with shift Allow, control Allow, alt Allow
Local Variables
Conditions
Actions
------- Command your unit to stop moving
Variable - Set W[(Triggering player)] = false
Actuall Move tigger:
Move Player Unit
Events
Timer - Every 0.04 seconds of Game Time
Local Variables
Player = 0 <Integer>
Conditions
Actions
Player Group - Pick each player in (Active Players) and do (Actions)
Actions
Variable - Set Player = (Picked player)
------- W
General - If (Conditions) then do (Actions) else do (Actions)
If
And
Conditions
W[Player] == true
A[Player] == false
S[Player] == false
D[Player] == false
Then
Unit - Order PlayerUnit[Player] to ( Move targeting ((Position of PlayerUnit[Player]) offset by 0.5 towards (Current camera yaw of player Player) degrees)) (Replace Existing Orders)
Else
------- A
General - If (Conditions) then do (Actions) else do (Actions)
If
And
Conditions
W[Player] == false
A[Player] == true
S[Player] == false
D[Player] == false
Then
Unit - Order PlayerUnit[Player] to ( Move targeting ((Position of PlayerUnit[Player]) offset by 0.5 towards ((Current camera yaw of player Player) + 90.0) degrees)) (Replace Existing Orders)
Else
------- S
General - If (Conditions) then do (Actions) else do (Actions)
If
And
Conditions
W[Player] == false
A[Player] == false
S[Player] == true
D[Player] == false
Then
Unit - Order PlayerUnit[Player] to ( Move targeting ((Position of PlayerUnit[Player]) offset by 0.5 towards ((Current camera yaw of player Player) + 180.0) degrees)) (Replace Existing Orders)
Else
------- D
General - If (Conditions) then do (Actions) else do (Actions)
If
And
Conditions
W[Player] == false
A[Player] == false
S[Player] == false
D[Player] == true
Then
Unit - Order PlayerUnit[Player] to ( Move targeting ((Position of PlayerUnit[Player]) offset by 0.5 towards ((Current camera yaw of player Player) + -90.0) degrees)) (Replace Existing Orders)
Else
------- WA
General - If (Conditions) then do (Actions) else do (Actions)
If
And
Conditions
W[Player] == true
A[Player] == true
S[Player] == false
D[Player] == false
Then
Unit - Order PlayerUnit[Player] to ( Move targeting ((Position of PlayerUnit[Player]) offset by 0.5 towards ((Current camera yaw of player Player) + 45.0) degrees)) (Replace Existing Orders)
Else
------- WD
General - If (Conditions) then do (Actions) else do (Actions)
If
And
Conditions
W[Player] == true
A[Player] == false
S[Player] == false
D[Player] == true
Then
Unit - Order PlayerUnit[Player] to ( Move targeting ((Position of PlayerUnit[Player]) offset by 0.5 towards ((Current camera yaw of player Player) + -45.0) degrees)) (Replace Existing Orders)
Else
------- SA
General - If (Conditions) then do (Actions) else do (Actions)
If
And
Conditions
W[Player] == false
A[Player] == true
S[Player] == true
D[Player] == false
Then
Unit - Order PlayerUnit[Player] to ( Move targeting ((Position of PlayerUnit[Player]) offset by 0.5 towards ((Current camera yaw of player Player) + 135.0) degrees)) (Replace Existing Orders)
Else
------- SD
General - If (Conditions) then do (Actions) else do (Actions)
If
And
Conditions
W[Player] == false
A[Player] == false
S[Player] == true
D[Player] == true
Then
Unit - Order PlayerUnit[Player] to ( Move targeting ((Position of PlayerUnit[Player]) offset by 0.5 towards ((Current camera yaw of player Player) + -135.0) degrees)) (Replace Existing Orders)
Else
Nono! =) You missunderstood, Lost in translation i guess =)
I just ment its important for him to write the correct titel OR people with no lust to help (giving sloppy information) and people lacking of knowledge will click on the forum thread. Dont mean anyone in this thread.
Though the first part of the thread more angered me due to the fact that i recieved one or two of those when i didnt know anything. And ppl search to this forum since its highly popular and ppl know theres alot of good editors here, in the mix with noobs and semi noobs. Ignore the first part:)
Oh .. haha.. so you DO want to kill your own banelings and get a count for the,... lol thats... odd, well i guess the greatest ideas comes from the wierdest. Well then instead of != triggering unit. put == and delete all the others i told u about =)
If you read all this you might understand the basics, and high value of using varaibles, since they can enable alot of new features for future maps for you.
General - If (Conditions) then do (Actions) else do (Actions)
If
unit kills[(Killing player)] == 100
Then
UI - Display "100 kills.. Good?" for (Player group((Killing player))) to Subtitle area
Else
In the SAME trigger as u just created, u make this under the modify varaible action. The action is a "if then else" action and basicly waits until something is reached. (just as the trigger does)
In if (a condition) i put if -> (changed owned of units to the varaible) unit kills is for the KILLING player is = 100, then
Then is the action.. Text message -> "100 kills... Good?" or whatever u want to write is sent to -> instead of all players i made it into a player group -> sent to the KILLING player.
SO.. To summerize.. If player 1 kills an enemys units he gains 1 points. If he gains 100 HE (and only he) will recieve a message -> "100 kills.. blablaba"
Guys ffs stop this nonsence with the noob tutorial stuff.. This forum is open for all questions noob or not. Or am i wrong?
Well maraudorfreak first of all it would be better if you titel your forum post with the issue you have. This one for example -> "kill counter help" or something to be enhence your chance of getting helped by someone that wants to help you and not everyone. This might give you the wrong idea, since some of the people in here do feel they know alot more about the trigger then they actually do..
Also i might add that my english sucks, but ppl seem to be able to understand if they read it again=)
I created a trigger for you:
Part one:
Create a Varaible. (Press f6 to open trigger editor and press right click in the LEFT spalt (where all the other triggers are) and choose -> New->New Varaible) Now the variable functions as you bank that saves stuff in it for a certain player or unit. What you want to do is select this varaible and press F2, and name it "Unit kills" or something (nothing that matters). Now select it again and from the "Type" drop down choose Integer (Integer is just numbers that are full number (not 0.1, but 1 or 2 or 3.. and so on.. even -1, -2, -3)). The last step is to press the array check (under the type drop down) and make the array as many players as you have on the map. The array works as "saving slots" in a bank deposit section. If you have 2 players the array would be 2. And so on.. In other cases this might not be the case, but since "triggering player" or "killing player" is treated as the actual player number it will be allright.
Now you have your "bank" (varaible) which is global (not local which is something you dont have to care about for this matter...)
Part 2 - Trigger
Unit dies
Events
Unit - Any Unit dies
Local Variables
Conditions
(Owner of (Killing unit)) > 0
(Owner of (Killing unit)) != (Owner of (Triggering unit))
((Owner of (Triggering unit)) is in (Allies of player (Owner of (Killing unit)))) == false
((Unit type of (Triggering unit)) has Structure attribute) == false
Actions
Variable - Modify unit kills[(Killing player)]: + 1
Now what this does, and i do recommend you to read this to understand for future triggers, is to COUNT the players kills. You were very correct when explaining about the "dying unit" and just as kuaken explained its "triggering UNIT". Allwas when the function starts with "triggering" it has something to do with the event of whats happening.. In this case some dies.. Therefore the triggering unit = dying unit.
I also added that the (first condition) that the player thats killing has to be something over 0. This is incase of an error which can occur if u have cinamatics with neutral players as dying ones...
The THIRD trigger is to not recieve kills from when killing a TEAMMATES units. (Function is player in player group)
The 4 is if theres any structure that you would want to include in this killing madness your planing of..
Now the last part is the actual action. What this does is that (its a action "modify varaible" btw) is to add +1 everytime this .. thing dies to the "bank slot" of the KILLING player (as i explained eirlier with the bank and the bankslots). The varaible used is ofc the one we created (unit kills) and [0]<- Is where u change the player killer function thingy...
well as i said: Theres one way to fix that and thats to remove the offset and hight parts of the camera in a constant run
It will make it lag alittle more (very little) since its running the camera setting at all times, but basicly u;
*Create new trigger
*Set event to Every 0.1 sec
*Set actions to set the offset and hight to what they should be.
Its the only way im afraid since its not standard to have it in 3P mode
Btw the Zoom+ thing i describe before is to disable the ability to "Scroll" with mouse.
Ok... So you making a 3d, such as this one , right? (Dont mind why i write and stuff in the video, its an error showing case).
And when you "lean" against a wall with you hero (or a mountain) your camera goes up the hill and gets out of balance? Right?
Hey, I have a problem thats driving me insane!
I have a hero selection circle, that when you pick a hero, it creates it for the player, then saves the unit variable (NoUnit, Array 2) for last created unit. Now this runs another trigger, when both player have chosen, that creates a dialog for each player. Now the problem is the health updating. It works FINE, but an ability that my hero "chris" has is to spawn a Turret. (Swanns turret) When this dies, due to time expires, the hp bar of the unit gets affected by it and i loose It sais 0/750 hp. And my unit only has 200/200 Hp.. Unit itself is not damage, but somehow the created turret takes the HP bar...
This is the "choosing" part of: Selection of hero trigger : Event -> Dialog used
General - If (Conditions) then do (Actions) else do (Actions)
If
(Used dialog item) == Choose Buttom
Then
Dialog - Hide Chooser dialog for (Player group((Triggering player)))
Dialog - Hide Hero info Box for (Player group((Triggering player)))
Variable - Set Selection Done[(Triggering player)] = true
Unit - Create 1 (Unit type of Hero Units[Player viewing[(Triggering player)]]) for player (Triggering player) at Point 001 facing 68.0 degrees (No Options)
Variable - Set PlayerUnit[(Triggering player)] = (Last created unit)
UI - Display ("Waiting for players..." + (" You have chosen " + (Name of (Unit type of (Last created unit))))) for (Player group((Triggering player))) to Cinematic area
Else
The Dialog health update trigger:
Dialog Update Health
Events
Unit - Hero Units[1] Life changes
Unit - Hero Units[2] Life changes
Local Variables
Conditions
Actions
Dialog - Set Unit Bar Health Text[(Triggering player)] text to (Combine ((Text(((Triggering unit) Life (Current))) with Any Precision decimal places), "/", (Text(((Triggering unit) Maximum Life (Current))) with Any Precision decimal places))) for (Player group((Owner of (Triggering unit))))
Dialog - Set Unit Bar Health[(Triggering player)] size to ((/ ((* (370, (Integer(((Triggering unit) Life (Percent) (Current)))))), 100)), (Height of Unit Bar Health[(Triggering player)] for (Triggering player))) for (Player group((Owner of (Triggering unit))))
And if needed -> This is the turret creation trigger
Chris Turret
Events
UI - Player 1 clicks Right mouse button Down.
UI - Player 2 clicks Right mouse button Down.
Local Variables
Conditions
And
Conditions
(Unit type of PlayerUnit[(Triggering player)]) == Chris (Marine)
(PlayerUnit[(Triggering player)] is alive) == true
AttackOnCooldown[(Triggering player)] == false
CurAmmo Chris Turret[(Triggering player)] > 0
W[(Triggering player)] == false
A[(Triggering player)] == false
S[(Triggering player)] == false
D[(Triggering player)] == false
Actions
------- Fire a projectile if you have ammunition available
Variable - Set AttackOnCooldown[(Triggering player)] = true
Trigger - Run Cool Down Attack (Ignore Conditions, Don't Wait until it finishes)
Variable - Modify CurAmmo Chris Turret[(Triggering player)]: - 1
------- Reload
General - If (Conditions) then do (Actions) else do (Actions)
If
CurAmmo Chris Turret[(Triggering player)] == 0
Then
Variable - Set Reloading Ability[(Triggering player)] = true
Trigger - Run Reload Turret (Ignore Conditions, Don't Wait until it finishes)
Else
------- Shoot projectile
Animation - Play Thrown animation for (Actor for PlayerUnit[(Triggering player)]) as Default, using No Options options and Default Time blend time
Traceline((Triggering player))
------- Check if a unit was hit
General - If (Conditions) then do (Actions) else do (Actions)
If
TargetUnit[(Triggering player)] != No Unit
Then
Environment - Execute Swann - Place Turret (Create Unit) on TargetUnit[(Triggering player)] from PlayerUnit[(Triggering player)]
Unit - Order TargetUnit[(Triggering player)] to ( Attack targeting PlayerUnit[(Triggering player)]) (Replace Existing Orders)
Else
------- If above is false, shoot terrain
General - If (Conditions) then do (Actions) else do (Actions)
If
TargetPoint[(Triggering player)] != No Point
Then
Environment - Execute Swann - Place Turret (Create Unit) at TargetPoint[(Triggering player)] from PlayerUnit[(Triggering player)]
Else
Sound - Play Ghost_AttackLaunch for (All players) (at 100.0% volume, skip the first 0.0 seconds)
0
@dnladt2:
weeeeeell... Actually what your doing is that your not... controlling the unit to move.
Ex. Normal camera mode, u select unit and right click at a point to his right so he walks there
This mode. you press D so he walks to the same point as in the ex above.
The difference is that the unit its not moving by command, but by triggers. If you look at the triggers the unit is actually standing still. An animation is played to make it SEEM like hes moving and the unit is moved to the location. So no.. the ability is not on by default and cant be applied directly. But you could make a trigger for it =) To add an upgrade to make the unit jump like a repear jump.
Thats a long story though and nothing im good at.
0
@gamfvr:
Actually i could see where hes going with the movement triggers.
Press:
Press W
Events
UI - Player 1 presses W key Down with shift Allow, control Allow, alt Allow
UI - Player 2 presses W key Down with shift Allow, control Allow, alt Allow
Local Variables
Conditions
Actions
------- Command your unit to move
Variable - Set W[(Triggering player)] = true
Animation - Clear the Default animation for (Actor for PlayerUnit[(Triggering player)])
Trigger - Run Unzoom (Check Conditions, Don't Wait until it finishes)
Release:
Release W
Events
UI - Player 1 presses W key Up with shift Allow, control Allow, alt Allow
UI - Player 2 presses W key Up with shift Allow, control Allow, alt Allow
Local Variables
Conditions
Actions
------- Command your unit to stop moving
Variable - Set W[(Triggering player)] = false
Actuall Move tigger:
Move Player Unit
Events
Timer - Every 0.04 seconds of Game Time
Local Variables
Player = 0 <Integer>
Conditions
Actions
Player Group - Pick each player in (Active Players) and do (Actions)
Actions
Variable - Set Player = (Picked player)
------- W
General - If (Conditions) then do (Actions) else do (Actions)
If
And
Conditions
W[Player] == true
A[Player] == false
S[Player] == false
D[Player] == false
Then
Unit - Order PlayerUnit[Player] to ( Move targeting ((Position of PlayerUnit[Player]) offset by 0.5 towards (Current camera yaw of player Player) degrees)) (Replace Existing Orders)
Else
------- A
General - If (Conditions) then do (Actions) else do (Actions)
If
And
Conditions
W[Player] == false
A[Player] == true
S[Player] == false
D[Player] == false
Then
Unit - Order PlayerUnit[Player] to ( Move targeting ((Position of PlayerUnit[Player]) offset by 0.5 towards ((Current camera yaw of player Player) + 90.0) degrees)) (Replace Existing Orders)
Else
------- S
General - If (Conditions) then do (Actions) else do (Actions)
If
And
Conditions
W[Player] == false
A[Player] == false
S[Player] == true
D[Player] == false
Then
Unit - Order PlayerUnit[Player] to ( Move targeting ((Position of PlayerUnit[Player]) offset by 0.5 towards ((Current camera yaw of player Player) + 180.0) degrees)) (Replace Existing Orders)
Else
------- D
General - If (Conditions) then do (Actions) else do (Actions)
If
And
Conditions
W[Player] == false
A[Player] == false
S[Player] == false
D[Player] == true
Then
Unit - Order PlayerUnit[Player] to ( Move targeting ((Position of PlayerUnit[Player]) offset by 0.5 towards ((Current camera yaw of player Player) + -90.0) degrees)) (Replace Existing Orders)
Else
------- WA
General - If (Conditions) then do (Actions) else do (Actions)
If
And
Conditions
W[Player] == true
A[Player] == true
S[Player] == false
D[Player] == false
Then
Unit - Order PlayerUnit[Player] to ( Move targeting ((Position of PlayerUnit[Player]) offset by 0.5 towards ((Current camera yaw of player Player) + 45.0) degrees)) (Replace Existing Orders)
Else
------- WD
General - If (Conditions) then do (Actions) else do (Actions)
If
And
Conditions
W[Player] == true
A[Player] == false
S[Player] == false
D[Player] == true
Then
Unit - Order PlayerUnit[Player] to ( Move targeting ((Position of PlayerUnit[Player]) offset by 0.5 towards ((Current camera yaw of player Player) + -45.0) degrees)) (Replace Existing Orders)
Else
------- SA
General - If (Conditions) then do (Actions) else do (Actions)
If
And
Conditions
W[Player] == false
A[Player] == true
S[Player] == true
D[Player] == false
Then
Unit - Order PlayerUnit[Player] to ( Move targeting ((Position of PlayerUnit[Player]) offset by 0.5 towards ((Current camera yaw of player Player) + 135.0) degrees)) (Replace Existing Orders)
Else
------- SD
General - If (Conditions) then do (Actions) else do (Actions)
If
And
Conditions
W[Player] == false
A[Player] == false
S[Player] == true
D[Player] == true
Then
Unit - Order PlayerUnit[Player] to ( Move targeting ((Position of PlayerUnit[Player]) offset by 0.5 towards ((Current camera yaw of player Player) + -135.0) degrees)) (Replace Existing Orders)
Else
Theres allwas ways to do stuff simpler..
0
@Zetal:
Nono! =) You missunderstood, Lost in translation i guess =)
I just ment its important for him to write the correct titel OR people with no lust to help (giving sloppy information) and people lacking of knowledge will click on the forum thread. Dont mean anyone in this thread.
Though the first part of the thread more angered me due to the fact that i recieved one or two of those when i didnt know anything. And ppl search to this forum since its highly popular and ppl know theres alot of good editors here, in the mix with noobs and semi noobs. Ignore the first part:)
0
@doite:
Oh .. haha.. so you DO want to kill your own banelings and get a count for the,... lol thats... odd, well i guess the greatest ideas comes from the wierdest. Well then instead of != triggering unit. put == and delete all the others i told u about =)
0
@doite:
If you read all this you might understand the basics, and high value of using varaibles, since they can enable alot of new features for future maps for you.
GL HF
0
@doite:
Now for the last part
Part 3. The text thing.
General - If (Conditions) then do (Actions) else do (Actions)
If
unit kills[(Killing player)] == 100
Then
UI - Display "100 kills.. Good?" for (Player group((Killing player))) to Subtitle area
Else
In the SAME trigger as u just created, u make this under the modify varaible action. The action is a "if then else" action and basicly waits until something is reached. (just as the trigger does)
In if (a condition) i put if -> (changed owned of units to the varaible) unit kills is for the KILLING player is = 100, then
Then is the action.. Text message -> "100 kills... Good?" or whatever u want to write is sent to -> instead of all players i made it into a player group -> sent to the KILLING player.
SO.. To summerize.. If player 1 kills an enemys units he gains 1 points. If he gains 100 HE (and only he) will recieve a message -> "100 kills.. blablaba"
Hope this helps
0
@Zetal:
Guys ffs stop this nonsence with the noob tutorial stuff.. This forum is open for all questions noob or not. Or am i wrong?
Well maraudorfreak first of all it would be better if you titel your forum post with the issue you have. This one for example -> "kill counter help" or something to be enhence your chance of getting helped by someone that wants to help you and not everyone. This might give you the wrong idea, since some of the people in here do feel they know alot more about the trigger then they actually do..
Also i might add that my english sucks, but ppl seem to be able to understand if they read it again=)
I created a trigger for you:
Part one:
Create a Varaible. (Press f6 to open trigger editor and press right click in the LEFT spalt (where all the other triggers are) and choose -> New->New Varaible) Now the variable functions as you bank that saves stuff in it for a certain player or unit. What you want to do is select this varaible and press F2, and name it "Unit kills" or something (nothing that matters). Now select it again and from the "Type" drop down choose Integer (Integer is just numbers that are full number (not 0.1, but 1 or 2 or 3.. and so on.. even -1, -2, -3)). The last step is to press the array check (under the type drop down) and make the array as many players as you have on the map. The array works as "saving slots" in a bank deposit section. If you have 2 players the array would be 2. And so on.. In other cases this might not be the case, but since "triggering player" or "killing player" is treated as the actual player number it will be allright.
Now you have your "bank" (varaible) which is global (not local which is something you dont have to care about for this matter...)
Part 2 - Trigger
Unit dies
Events
Unit - Any Unit dies
Local Variables
Conditions
(Owner of (Killing unit)) > 0
(Owner of (Killing unit)) != (Owner of (Triggering unit))
((Owner of (Triggering unit)) is in (Allies of player (Owner of (Killing unit)))) == false
((Unit type of (Triggering unit)) has Structure attribute) == false
Actions
Variable - Modify unit kills[(Killing player)]: + 1
Now what this does, and i do recommend you to read this to understand for future triggers, is to COUNT the players kills. You were very correct when explaining about the "dying unit" and just as kuaken explained its "triggering UNIT". Allwas when the function starts with "triggering" it has something to do with the event of whats happening.. In this case some dies.. Therefore the triggering unit = dying unit.
I also added that the (first condition) that the player thats killing has to be something over 0. This is incase of an error which can occur if u have cinamatics with neutral players as dying ones...
The THIRD trigger is to not recieve kills from when killing a TEAMMATES units. (Function is player in player group)
The 4 is if theres any structure that you would want to include in this killing madness your planing of..
Now the last part is the actual action. What this does is that (its a action "modify varaible" btw) is to add +1 everytime this .. thing dies to the "bank slot" of the KILLING player (as i explained eirlier with the bank and the bankslots). The varaible used is ofc the one we created (unit kills) and [0]<- Is where u change the player killer function thingy...
0
Third Person Shooter
Published on european servers
Video:
For contact visit:
http://www.sc2mapster.com/maps/resident-evil-extinction/
0
Third Person Shooter
Published on european servers
Video:
For contact visit:
http://www.sc2mapster.com/maps/resident-evil-extinction/
0
@GothiThePriest:
well as i said: Theres one way to fix that and thats to remove the offset and hight parts of the camera in a constant run
It will make it lag alittle more (very little) since its running the camera setting at all times, but basicly u;
*Create new trigger
*Set event to Every 0.1 sec
*Set actions to set the offset and hight to what they should be.
Its the only way im afraid since its not standard to have it in 3P mode
Btw the Zoom+ thing i describe before is to disable the ability to "Scroll" with mouse.
0
@doite:
Solved
0
@GothiThePriest:
Ok... So you making a 3d, such as this one , right? (Dont mind why i write and stuff in the video, its an error showing case).
And when you "lean" against a wall with you hero (or a mountain) your camera goes up the hill and gets out of balance? Right?
0
0
Hey, I have a problem thats driving me insane!
I have a hero selection circle, that when you pick a hero, it creates it for the player, then saves the unit variable (NoUnit, Array 2) for last created unit. Now this runs another trigger, when both player have chosen, that creates a dialog for each player. Now the problem is the health updating. It works FINE, but an ability that my hero "chris" has is to spawn a Turret. (Swanns turret) When this dies, due to time expires, the hp bar of the unit gets affected by it and i loose It sais 0/750 hp. And my unit only has 200/200 Hp.. Unit itself is not damage, but somehow the created turret takes the HP bar...
This is the "choosing" part of: Selection of hero trigger : Event -> Dialog used
General - If (Conditions) then do (Actions) else do (Actions)
If
(Used dialog item) == Choose Buttom
Then
Dialog - Hide Chooser dialog for (Player group((Triggering player)))
Dialog - Hide Hero info Box for (Player group((Triggering player)))
Variable - Set Selection Done[(Triggering player)] = true
Unit - Create 1 (Unit type of Hero Units[Player viewing[(Triggering player)]]) for player (Triggering player) at Point 001 facing 68.0 degrees (No Options)
Variable - Set PlayerUnit[(Triggering player)] = (Last created unit)
UI - Display ("Waiting for players..." + (" You have chosen " + (Name of (Unit type of (Last created unit))))) for (Player group((Triggering player))) to Cinematic area
Else
The Dialog health update trigger:
Dialog Update Health
Events
Unit - Hero Units[1] Life changes
Unit - Hero Units[2] Life changes
Local Variables
Conditions
Actions
Dialog - Set Unit Bar Health Text[(Triggering player)] text to (Combine ((Text(((Triggering unit) Life (Current))) with Any Precision decimal places), "/", (Text(((Triggering unit) Maximum Life (Current))) with Any Precision decimal places))) for (Player group((Owner of (Triggering unit))))
Dialog - Set Unit Bar Health[(Triggering player)] size to ((/ ((* (370, (Integer(((Triggering unit) Life (Percent) (Current)))))), 100)), (Height of Unit Bar Health[(Triggering player)] for (Triggering player))) for (Player group((Owner of (Triggering unit))))
And if needed -> This is the turret creation trigger
Chris Turret
Events
UI - Player 1 clicks Right mouse button Down.
UI - Player 2 clicks Right mouse button Down.
Local Variables
Conditions
And
Conditions
(Unit type of PlayerUnit[(Triggering player)]) == Chris (Marine)
(PlayerUnit[(Triggering player)] is alive) == true
AttackOnCooldown[(Triggering player)] == false
CurAmmo Chris Turret[(Triggering player)] > 0
W[(Triggering player)] == false
A[(Triggering player)] == false
S[(Triggering player)] == false
D[(Triggering player)] == false
Actions
------- Fire a projectile if you have ammunition available
Variable - Set AttackOnCooldown[(Triggering player)] = true
Trigger - Run Cool Down Attack (Ignore Conditions, Don't Wait until it finishes)
Variable - Modify CurAmmo Chris Turret[(Triggering player)]: - 1
------- Reload
General - If (Conditions) then do (Actions) else do (Actions)
If
CurAmmo Chris Turret[(Triggering player)] == 0
Then
Variable - Set Reloading Ability[(Triggering player)] = true
Trigger - Run Reload Turret (Ignore Conditions, Don't Wait until it finishes)
Else
------- Shoot projectile
Animation - Play Thrown animation for (Actor for PlayerUnit[(Triggering player)]) as Default, using No Options options and Default Time blend time
Traceline((Triggering player))
------- Check if a unit was hit
General - If (Conditions) then do (Actions) else do (Actions)
If
TargetUnit[(Triggering player)] != No Unit
Then
Environment - Execute Swann - Place Turret (Create Unit) on TargetUnit[(Triggering player)] from PlayerUnit[(Triggering player)]
Unit - Order TargetUnit[(Triggering player)] to ( Attack targeting PlayerUnit[(Triggering player)]) (Replace Existing Orders)
Else
------- If above is false, shoot terrain
General - If (Conditions) then do (Actions) else do (Actions)
If
TargetPoint[(Triggering player)] != No Point
Then
Environment - Execute Swann - Place Turret (Create Unit) at TargetPoint[(Triggering player)] from PlayerUnit[(Triggering player)]
Else
Sound - Play Ghost_AttackLaunch for (All players) (at 100.0% volume, skip the first 0.0 seconds)
Last but not least, heres a photo of what happends when a turret dies
http://img17.imageshack.us/img17/9306/screenshot2010112400270.jpg
0
@Bronxsy:
Amazing!