• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.

[Trigger] Need help with camera swithing!

Status
Not open for further replies.
Level 5
Joined
Jul 14, 2014
Messages
115
You see, I have this issue with my triggers. I have two triggers :

  • FollowCam
    • Events
      • Time - Every 0.10 seconds of game time
    • Conditions
    • Actions
      • Set Location = (Position of (Random unit from (Units of type Fisherman)))
      • Custom script: set udg_Height = GetLocationZ(udg_Location)
      • Camara - Lock camera target for Player 2 (Blue) to (Random unit from (Units of type Fisherman)), offset by (0.00, 0.00) using Default rotation
      • Camera - Player 2 (Blue)'s camera Distance to target to 300.00 over 0.10 seconds
      • Camera - Set Player 2 (Blue)'s camera Angle of attack to 330.00 over 0.10 seconds
      • Camera - Set Player 2 (Blue)'s camera Height offset to (Height(variable) + 100.00) over 0.10 seconds
      • Camera - Set Player 2 (Blue)'s camera Rotation to (Facing of (Random unit from (Units of type Fisherman))) over 0.10 seconds
      • Custom script: call RemoveLocation(udg_Location)


  • FollowCam2
    • Events
      • Time - Every 0.02 seconds of game time
    • Conditions
    • Actions
      • Camera - Lock camera target for Player 2 (Blue) to (Random unit from (Units of type Fisherman)), offset by (0.00, 0.00) using Default rotation
      • Camera - Set Player 2 (Blue)'s camera Rotation to (Facing of (Random unit from (Units of type Fisherman))) over 0.10 seconds

These are initially off. But every time I write /cams a window shows up asking which cam you want(you can change it).
Here are da triggas :

  • CameraChoose
    • Events
    • Conditions
    • Actions
      • Dialog - Clear CamChoose
      • Dialog - Change the title of CamChoose to Choose your camera
      • Dialog - Create a dialog button for CamChoose labelled Normal Camera
      • Set CamChoose_Normal(variable) = (Last created dialog Button)
      • Dialog - Create a dialog button for CamChoose labelled 3rd person camera
      • Set CamChoose_3rdP(variable) = (Last created dialog Button)
      • Dialog - Show CamChoose for Player 2 (Blue)


  • CameraChooseButton
    • Events
      • Dialog - A dialog button is clicked for CamChoose
    • Conditions
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Clicked dialog button) Equals CamChoose_Normal
        • Then - Actions
          • Trigger - Turn off FollowCam <gen>
          • Set ChosenCam = FollowCam2 <gen>
          • Trigger - Turn on FollowCam2 <gen>
          • Dialog - Hide CamChoose for Player 2 (Blue)
          • Quest - Display to (All players) the Tip message: You may change your...
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditons
          • (Clicked dialog button) Equals CamChoose_3rdP
        • Then - Actions
          • Trigger - Turn off FollowCam2 <gen>
          • Set ChosenCam = FollowCam <gen>
          • Trigger - Turn on FollowCam <gen>
          • Dialog - Hide CamChoose for Player 2 (Blue)
          • Quest - Display to (All players) the Tip message: You may change your...
        • Else - Actions


  • Command1
    • Events
      • Player - Player 2 (Blue) types a chat message containing /CAMS
    • Conditions
    • Actions
      • Trigger - Run CameraChoose <gen> (ignoring conditions)

Basically my problem is that I type /cams and it shows the dialog and I can select everything but if select 3rd person cam it will work but when i change it to normal cam it doesn't work and starts lagging really bad. typing /cams and selecting 3rd person fixes the lag.
BTW that map is SP.
PLZZZ HELP MMEEE
 
Give us some time before you bumb your thread.

Each time you use "(Random unit from (Units of type Fisherman)" you create a new unit group, which is just not needed.
Create a unit variable and set it in a setup trigger to your "Fisherman".
Then all "(Random unit from (Units of type Fisherman))" should be replaced by this unit variable.
Also you can try if a higher value than 0.02 would also do a good job.
 
Level 5
Joined
Jul 14, 2014
Messages
115
Give us some time before you bumb your thread.

Each time you use "(Random unit from (Units of type Fisherman)" you create a new unit group, which is just not needed.
Create a unit variable and set it in a setup trigger to your "Fisherman".
Then all "(Random unit from (Units of type Fisherman))" should be replaced by this unit variable.
Also you can try if a higher value than 0.02 would also do a good job.
Thanks. I'll try dat
 
Level 15
Joined
Oct 29, 2012
Messages
1,474
Well I don't know while you bumped, have you faced the same problem even with IceManBo's problem ? Your trigger shouldn't lag, it must be other triggers that cause the lag. Try these triggers in an Empty Test map, and tell us if it lags or not
If they lag, then you should use a Camera System in there the hive, if it doesn't lag, then there must be a trigger or Unit-spam in your map.
 
Level 5
Joined
Jul 14, 2014
Messages
115
FollowCam leaks 30 unit groups per second.
FollowCam2 leaks 100 unit groups per second.

Poor performance is to be expected with such number of leaks.

And... How do I fix these leaks?
This causes a leak.
  • (Random unit from (Units of type Fisherman))
Also please do not bump a thread unless it is 24 hrs old.

Fixed dat already, still lags

Well I don't know while you bumped, have you faced the same problem even with IceManBo's problem ? Your trigger shouldn't lag, it must be other triggers that cause the lag. Try these triggers in an Empty Test map, and tell us if it lags or not
If they lag, then you should use a Camera System in there the hive, if it doesn't lag, then there must be a trigger or Unit-spam in your map.

I'll do that
 
Okay, if there's just one you can set it to a variable. Also please use the
edit.gif
button.
 
Status
Not open for further replies.
Top