Hey,
Im using the library from MartinOlsson and had a fully working Third Person Mode. Then i added a hero selection trigger and after both players have selected their heros it picked the hero, chooses him as default and starts the regular triggers. All this works fine, BUT sudently the rotation of the unit stopped working after picked the hero.
This is the of the selection trigger:
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)))
Variable - Set Selection Done[(Triggering player)] = true
Cinematics - Fade Out over 1.0 seconds using color (0%, 0%, 0%) and 0.0% transparency (Normal style, Don't Wait until it finishes)
UI - Display "Waiting for your partner to choose ..." for (Player group((Triggering player))) to Cinematic area
Else
This is the "waiting for player" trigger:
Starting game
Events
Dialog - Any Dialog Item is used by Player Any Player with event type Clicked
Local Variables
Conditions
Selection Done[1] == true
Selection Done[2] == true
Actions
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)
Unit Selection - Deselect all units for player (Triggering player)
Trigger - Turn Map Initialization On
Trigger - Run Map Initialization (Check Conditions, Don't Wait until it finishes)
Trigger - Turn Zoom On
Trigger - Turn Unzoom On
Trigger - Turn Hero Selection Off
Trigger - Turn Dialoged clicked Off
Trigger - Turn Rotate Camera On
Trigger - Turn (Current trigger) Off
And finally the short, but very important, rotation trigger:
Rotate Camera
Events
Timer - Every 0.1 seconds of Game Time
Local Variables
Conditions
Actions
------- Rotate the camera, making your unit face the camera yaw (angle)
Player Group - Pick each player in (Active Players) and do (Actions)
Actions
Unit - Make PlayerUnit[(Picked player)] face (Current camera yaw of player (Picked player)) over 0.2 seconds
I have tried not to turn the initially off it, ive set it to wait 2 seconds before initially it, ive tried to wait 1 seconds before initially it and ive tried to also "Run trigger" it. But it doesnt seem to respond after you enable the third person mode and it all starts.
Every thing else works. Shooting, walking, zooming, you name it.. Only the rotation.
Alot of questions concerning the triggers back and forth (on irc) so ill clearify abit:
+ some updates
Now end of selection trigger is:
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)))
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 Unit[(Triggering player)] = (Last created unit)
Cinematics - Fade Out over 1.0 seconds using color (0%, 0%, 0%) and 0.0% transparency (Normal style, Don't Wait until it finishes)
UI - Display "Waiting for your partner to choose ..." for (Player group((Triggering player))) to Cinematic area
Else
And the melee trigger (Se post over which triggers run after both players have choosen)
Map Initialization
Events
Game - Map initialization
Local Variables
Conditions
Actions
------- Initialization actions
Cinematics - Fade In over 5.0 seconds using color (0%, 0%, 0%) and 0.0% transparency (Normal style, Don't Wait until it finishes)
UI - Clear All Messages for (All players)
Game - Set the game speed to Normal
Trigger - Run Set Enemy Unit Height (Ignore Conditions, Don't Wait until it finishes)
Player Group - Pick each player in (Active Players) and do (Actions)
Actions
Variable - Set PlayerUnit[(Picked player)] = Unit[(Picked player)]
Player - Make all players in (Active Players) treat each other as Ally With Shared Vision
Player Group - Pick each player in (All players) and do (Actions)
Actions
Visibility - Create a visibility revealer for player (Picked player) within Regions View
General - If (Conditions) then do (Actions) else do (Actions)
If
(Status of player 1) != Playing
Then
Unit - Remove PlayerUnit[1] from the game
Else
General - If (Conditions) then do (Actions) else do (Actions)
If
(Status of player 2) != Playing
Then
Unit - Remove PlayerUnit[2] from the game
Else
------- Camera
Player Group - Pick each player in (Active Players) and do (Actions)
Actions
Camera - Lock camera mouse relative mode On for player (Picked player)
Camera - Turn camera mouse rotation On for player (Picked player)
Camera - Turn camera height displacement Off for player (Picked player)
Camera - Turn camera height smoothing Off for player (Picked player)
Camera - Pan the camera for player (Picked player) to (Position of PlayerUnit[(Picked player)]) over 0.0 seconds with Existing Velocity% initial velocity, 0% deceleration, and Do Not use smart panning
Camera - Follow for player (Picked player) (Unit group(PlayerUnit[(Picked player)])) with the camera and Clear Current Target
Camera - Apply camera object Rotation (Facing of PlayerUnit[(Picked player)]) for player (Picked player) over 0.0 seconds with Existing Velocity% initial velocity and 10% deceleration
Camera - Apply camera object Angle Of Attack 0.0 for player (Picked player) over 0.0 seconds with Existing Velocity% initial velocity and 0% deceleration
Camera - Apply camera object Distance CamDistance for player (Picked player) over 0.0 seconds with Existing Velocity% initial velocity and 0% deceleration
Camera - Apply camera object Height Offset CamHeight for player (Picked player) over 0.0 seconds with Existing Velocity% initial velocity and 0% deceleration
------- UI
UI - Hide game UI for (All players)
------- UI - Health bar
UI - Display boss bar (Picked player) with title "Health", portrait Assets\Textures\icon-health-zerg.dds and maximum value 100 for (Player group((Picked player)))
UI - Set boss bar (Picked player) boss to PlayerUnit[(Picked player)] (Do refresh the boss bar)
UI - Set boss bar (Picked player) race to Terran (Do refresh the boss bar)
UI - Move boss bar (Picked player) to Bottom Left of screen with offset (20, 20)
------- UI - Ammunition bar
UI - Display boss bar ((Picked player) + 2) with title "Ammunition", portrait Assets\Textures\btn-techupgrade-terran-fullborecanisterammo.dds and maximum value 100 for (Player group((Picked player)))
UI - Set boss bar ((Picked player) + 2) maximum value to MaxAmmo (Do refresh the boss bar)
UI - Set boss bar ((Picked player) + 2) current value to CurAmmo[(Picked player)] (Do refresh the boss bar)
UI - Set boss bar ((Picked player) + 2) race to Terran (Do refresh the boss bar)
UI - Move boss bar ((Picked player) + 2) to Bottom Right of screen with offset (20, 20)
------- UI - Crosshair
Dialog - Display image 1 of size (32, 32) with image Assets\Textures\btn-border-protoss-normal.dds using blend mode Add at Center with (0, 0)
Hey,
Im using the library from MartinOlsson and had a fully working Third Person Mode. Then i added a hero selection trigger and after both players have selected their heros it picked the hero, chooses him as default and starts the regular triggers. All this works fine, BUT sudently the rotation of the unit stopped working after picked the hero.
This is the of the selection trigger:
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)))
Variable - Set Selection Done[(Triggering player)] = true
Cinematics - Fade Out over 1.0 seconds using color (0%, 0%, 0%) and 0.0% transparency (Normal style, Don't Wait until it finishes)
UI - Display "Waiting for your partner to choose ..." for (Player group((Triggering player))) to Cinematic area
Else
This is the "waiting for player" trigger:
Starting game
Events
Dialog - Any Dialog Item is used by Player Any Player with event type Clicked
Local Variables
Conditions
Selection Done[1] == true
Selection Done[2] == true
Actions
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)
Unit Selection - Deselect all units for player (Triggering player)
Trigger - Turn Map Initialization On
Trigger - Run Map Initialization (Check Conditions, Don't Wait until it finishes)
Trigger - Turn Zoom On
Trigger - Turn Unzoom On
Trigger - Turn Hero Selection Off
Trigger - Turn Dialoged clicked Off
Trigger - Turn Rotate Camera On
Trigger - Turn (Current trigger) Off
And finally the short, but very important, rotation trigger:
Rotate Camera
Events
Timer - Every 0.1 seconds of Game Time
Local Variables
Conditions
Actions
------- Rotate the camera, making your unit face the camera yaw (angle)
Player Group - Pick each player in (Active Players) and do (Actions)
Actions
Unit - Make PlayerUnit[(Picked player)] face (Current camera yaw of player (Picked player)) over 0.2 seconds
I have tried not to turn the initially off it, ive set it to wait 2 seconds before initially it, ive tried to wait 1 seconds before initially it and ive tried to also "Run trigger" it. But it doesnt seem to respond after you enable the third person mode and it all starts.
Every thing else works. Shooting, walking, zooming, you name it.. Only the rotation.
Please help
@doite
Alot of questions concerning the triggers back and forth (on irc) so ill clearify abit:
+ some updates
Now end of selection trigger is:
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)))
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 Unit[(Triggering player)] = (Last created unit)
Cinematics - Fade Out over 1.0 seconds using color (0%, 0%, 0%) and 0.0% transparency (Normal style, Don't Wait until it finishes)
UI - Display "Waiting for your partner to choose ..." for (Player group((Triggering player))) to Cinematic area
Else
And the melee trigger (Se post over which triggers run after both players have choosen)
Map Initialization
Events
Game - Map initialization
Local Variables
Conditions
Actions
------- Initialization actions
Cinematics - Fade In over 5.0 seconds using color (0%, 0%, 0%) and 0.0% transparency (Normal style, Don't Wait until it finishes)
UI - Clear All Messages for (All players)
Game - Set the game speed to Normal
Trigger - Run Set Enemy Unit Height (Ignore Conditions, Don't Wait until it finishes)
Player Group - Pick each player in (Active Players) and do (Actions)
Actions
Variable - Set PlayerUnit[(Picked player)] = Unit[(Picked player)]
Player - Make all players in (Active Players) treat each other as Ally With Shared Vision
Player Group - Pick each player in (All players) and do (Actions)
Actions
Visibility - Create a visibility revealer for player (Picked player) within Regions View
General - If (Conditions) then do (Actions) else do (Actions)
If
(Status of player 1) != Playing
Then
Unit - Remove PlayerUnit[1] from the game
Else
General - If (Conditions) then do (Actions) else do (Actions)
If
(Status of player 2) != Playing
Then
Unit - Remove PlayerUnit[2] from the game
Else
------- Camera
Player Group - Pick each player in (Active Players) and do (Actions)
Actions
Camera - Lock camera mouse relative mode On for player (Picked player)
Camera - Turn camera mouse rotation On for player (Picked player)
Camera - Turn camera height displacement Off for player (Picked player)
Camera - Turn camera height smoothing Off for player (Picked player)
Camera - Pan the camera for player (Picked player) to (Position of PlayerUnit[(Picked player)]) over 0.0 seconds with Existing Velocity% initial velocity, 0% deceleration, and Do Not use smart panning
Camera - Follow for player (Picked player) (Unit group(PlayerUnit[(Picked player)])) with the camera and Clear Current Target
Camera - Apply camera object Rotation (Facing of PlayerUnit[(Picked player)]) for player (Picked player) over 0.0 seconds with Existing Velocity% initial velocity and 10% deceleration
Camera - Apply camera object Angle Of Attack 0.0 for player (Picked player) over 0.0 seconds with Existing Velocity% initial velocity and 0% deceleration
Camera - Apply camera object Distance CamDistance for player (Picked player) over 0.0 seconds with Existing Velocity% initial velocity and 0% deceleration
Camera - Apply camera object Height Offset CamHeight for player (Picked player) over 0.0 seconds with Existing Velocity% initial velocity and 0% deceleration
------- UI
UI - Hide game UI for (All players)
------- UI - Health bar
UI - Display boss bar (Picked player) with title "Health", portrait Assets\Textures\icon-health-zerg.dds and maximum value 100 for (Player group((Picked player)))
UI - Set boss bar (Picked player) boss to PlayerUnit[(Picked player)] (Do refresh the boss bar)
UI - Set boss bar (Picked player) race to Terran (Do refresh the boss bar)
UI - Move boss bar (Picked player) to Bottom Left of screen with offset (20, 20)
------- UI - Ammunition bar
UI - Display boss bar ((Picked player) + 2) with title "Ammunition", portrait Assets\Textures\btn-techupgrade-terran-fullborecanisterammo.dds and maximum value 100 for (Player group((Picked player)))
UI - Set boss bar ((Picked player) + 2) maximum value to MaxAmmo (Do refresh the boss bar)
UI - Set boss bar ((Picked player) + 2) current value to CurAmmo[(Picked player)] (Do refresh the boss bar)
UI - Set boss bar ((Picked player) + 2) race to Terran (Do refresh the boss bar)
UI - Move boss bar ((Picked player) + 2) to Bottom Right of screen with offset (20, 20)
------- UI - Crosshair
Dialog - Display image 1 of size (32, 32) with image Assets\Textures\btn-border-protoss-normal.dds using blend mode Add at Center with (0, 0)
@doite:
Fixed.. sorry my bad