• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

[Trigger] Changing Camera Lock

Status
Not open for further replies.
I got this Brewmaster's spell storm, Earth and Fire. When the spell is cast the brewmaster disappears an there appear storm, earth and fire and what I want to do is an active trigger that actively changes the lock whenever I change my selection among any of them.

the triggers are two, when the spell si cast the trigger detects this and activates the trigger for cameras.
  • Cast Pandas
    • Events
      • Unit - Brewmaster 0009 <gen> Begins casting an ability
    • Conditions
      • (Ability being cast) Equal to Storm, Earth, And Fire (Chen)
    • Actions
      • Camera - Reset camera for Player 10 (Light Blue) to standard game-view over 0.00 seconds
      • Trigger - Turn on Change Cameras <gen>
      • Wait 60.00 seconds - spell duration
      • Trigger - Turn off Change Cameras <gen>
      • Camera - Lock camera target for Player 10 (Light Blue) to Brewmaster 0009 <gen>, offset by (0.00, 0.00) using Default rotation
This here is the questionable trigger
  • Change Cameras
    • Events
      • Time - Every 0.15 seconds of game time
    • Conditions
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
        • Then - Actions
        • Else - Actions
Any Ideas How this might happen?
 
Last edited:
Cause it's not a unit event but a player event.

:eekani:

A unit owned by player 10 also does not have "is selected" option.

Edit: yep, I found this.

Edit: is this right?
  • Change Cameras
    • Events
      • Player - Player 10 (Light Blue) Selects a unit
    • Conditions
      • (Triggering unit) Equal to (Matching unit)
    • Actions
      • Countdown Timer - Start (Expiring timer) as a Repeating timer that will expire in 0.10 seconds
      • Camera - Lock camera target for Player 10 (Light Blue) to (Triggering unit), offset by (0.00, 0.00) using Default rotation
 
Will this work then?
  • ((Unit-type of (Triggering unit)) Equal to Earth) or (((Unit-type of (Triggering unit)) Equal to Fire) or (((Unit-type of (Triggering unit)) Equal to Storm) or (((Unit-type of (Triggering unit)) Equal to Earth) or (((Unit-type of (Triggering unit)) Equal to Fire) or ((Unit-type of (Triggering unit)) Equal to St
 
Level 7
Joined
Mar 6, 2006
Messages
282
Sure, but I think you pasted your condition twice. Also, if you do "Or - Multiple Conditions" it's much easier to read and change if needed.

  • Events
    • Player - Player 10 (Light Blue) Selects a unit
  • Conditions
    • Or - Any (Conditions) are true
      • Conditions
        • (Unit-type of (Triggering unit)) Equal to Earth
        • (Unit-type of (Triggering unit)) Equal to Fire
        • (Unit-type of (Triggering unit)) Equal to Storm
  • Actions
    • Camera - Lock camera target for Player 10 (Light Blue) to (Triggering unit), offset by (0.00, 0.00) using Default rotation
 
Level 7
Joined
Mar 6, 2006
Messages
282
1. If I want the camera to slide(instead of jump, re-lock) to the next selected unit, what camera function should I use?

  • Camera - Pan Camera (Timed)
2. Does this function has to be in a periodic timer?

Usually you should handle waits with a timer, but in this case, you're only calling TriggeringUnit here, which is apparently local.

  • Actions
    • Set TempLocation = (Position of No unit)
    • Camera - Pan camera for Player 10 (Light Blue) to TempLocation over 2.00 seconds
    • Custom script: call RemoveLocation( udg_TempLocation )
    • Wait 2.00 seconds
    • Camera - Lock camera target for Player 10 (Light Blue) to (Triggering unit), offset by (0.00, 0.00) using Default rotation
So you PAN the camera, then you WAIT the duration of the pan, then you LOCK the camera.
 
  • Camera - Pan Camera (Timed)


Usually you should handle waits with a timer, but in this case, you're only calling TriggeringUnit here, which is apparently local.

  • Actions
    • Set TempLocation = (Position of No unit)
    • Camera - Pan camera for Player 10 (Light Blue) to TempLocation over 2.00 seconds
    • Custom script: call RemoveLocation( udg_TempLocation )
    • Wait 2.00 seconds
    • Camera - Lock camera target for Player 10 (Light Blue) to (Triggering unit), offset by (0.00, 0.00) using Default rotation
So you PAN the camera, then you WAIT the duration of the pan, then you LOCK the camera.
Ok got it, but wouldnt it be easier to use (position of (triggering unit) and Do you really need to put a wait after the pan?
 
Level 7
Joined
Mar 6, 2006
Messages
282
Ok got it, but wouldnt it be easier to use (position of (triggering unit)

I guess it depends on what kind of mapper you are. If you're making a serious map, then you should definitely learn about leaks.

What leaks are:

http://world-editor-tutorials.thehelper.net/cat_usersubmit.php?view=27242

Different kinds of leaks:

http://www.hiveworkshop.com/forums/triggers-scripts-269/things-leak-35124/

If this is just real casual and you don't care for such things, then you don't really have to avoid leaks. But when people give help around here, most will do it in the form of leakless triggers.

In my example, I set the location to a variable, used the variable, then destroyed it.

Do you really need to put a wait after the pan?

Yes, because the next action will lock the camera to that target. So if there was no wait, then the camera would begin to pan, then immidiately lock to the target (it would be so fast that it looks like the pan never happened, and would lock instantly).

So you pan, wait 2 seconds and let the camera pan, then lock once the camera is done panning.
 
Status
Not open for further replies.
Top