• 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.

Lock camera on variable unit

Status
Not open for further replies.
Level 10
Joined
Jul 5, 2014
Messages
425
I currently have some problem with the camera lock of certain units. I making an rpg and I want to lock the camera on heroes the same way warchasers do. The problem is that this campaign has multiple heroes, so I made a trigger to lock the camera on the hero currently selected. It worked fine with specific unit event, but since there are walking between maps (and because it's much more comfortable), I keep my heroes in variables and specific unit event has no reference to variable units. Is there a way to make this work?
 
Just user Player - Selection event and then Camera - Lock camera to unit.

  • One
    • Events
      • Map initialization
    • Conditions
    • Actions
      • For each (Integer A) from 1 to 12, do (Actions)
        • Loop - Actions
          • Trigger - Add to Two <gen> the event (Player - (Player((Integer A))) Selects a unit)
  • Two
    • Events
    • Conditions
      • ((Triggering unit) is A Hero) Equal to True
      • (Owner of (Triggering unit)) Equal to (Triggering player)
    • Actions
      • Camera - Lock camera target for (Triggering player) to (Triggering unit), offset by (0.00, 0.00) using Default rotation
 
Level 10
Joined
Jul 5, 2014
Messages
425
  • Camera Locking Hero1
    • Events
      • Player - Player 2 (Blue) Selects a unit
    • Conditions
      • (Hero1 is selected by Player 2 (Blue)) Equal to True
      • (Owner of Hero1) Equal to Player 2 (Blue)
    • Actions
      • Camera - Lock camera target for Player 2 (Blue) to Hero1, offset by (0.00, 0.00) using Default rotation
  • Camera Locking Hero2
    • Events
      • Player - Player 2 (Blue) Selects a unit
    • Conditions
      • (Hero2 is selected by Player 2 (Blue)) Equal to True
      • (Owner of Hero2) Equal to Player 2 (Blue)
    • Actions
      • Camera - Lock camera target for Player 2 (Blue) to Hero2, offset by (0.00, 0.00) using Default rotation
 
Level 10
Joined
Jul 5, 2014
Messages
425
The separation is because I originally had this trigger, I just modified it with your player event suggestion. But I packed them together and used "triggering unit" instead of referring the individuals and this somehow solved the double-click problem o_O This version also saves me the trouble to trigger potential temporary heroes' camera. Thank you so much!
 
Status
Not open for further replies.
Top