• 🏆 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!

3rd person camera

Status
Not open for further replies.
Level 4
Joined
Jun 14, 2008
Messages
72
I have been working on a 3rd person camera system... it works great, the only problem is if you turn it on, even once commands like move, attack or other things cannot interupt each other... say I am in combat and I want to heal my character must finish fighting before he heals......or say I am walking towrds a point and an enemy steps infront and starts attacking me, I have to walk to that point before I can attack the enemy witch is imposable because I cant walk around him untill I get there....I dont know why its doing this, thease are my camera triggers
  • lock
    • Events
      • Unit - A unit Begins casting an ability
    • Conditions
      • check Equal to 1
      • (Ability being cast) Equal to Third Person Camera
    • Actions
      • Camera - Lock camera target for (Owner of (Triggering unit)) to (Triggering unit), offset by (0.00, 0.00) using Default rotation
      • Camera - Set (Owner of (Triggering unit))'s camera Distance to target to 750.00 over 0.10 seconds
      • Camera - Set (Owner of (Triggering unit))'s camera Angle of attack to -30.00 over 0.10 seconds
      • Camera - Set (Owner of (Triggering unit))'s camera Rotation to (Facing of (Triggering unit)) over 0.40 seconds
      • Wait 0.03 seconds
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • check Equal to 1
        • Then - Actions
          • Trigger - Turn on lock Copy <gen>
          • Trigger - Run (This trigger) (ignoring conditions)
        • Else - Actions
          • Do nothing
and
  • lock Copy
    • Events
      • Unit - A unit Begins casting an ability
    • Conditions
      • (Ability being cast) Equal to Third Person Camera
    • Actions
      • Set check = 2
      • Camera - Reset camera for (Owner of (Triggering unit)) to standard game-view over 0.10 seconds
      • Camera - Pan camera for (Owner of (Triggering unit)) to (Position of (Triggering unit)) over 0.00 seconds
      • Wait 2.00 seconds
      • Set check = 1
      • Trigger - Turn off (This trigger)
please help
 
Use a periodic event to constantly set the distance to target/angle of attack and rotation. Running this trigger might actually causing a new order to the unit. Just add the player to a player group:
  • Trigger0
  • Events
    • Map Initialization
  • Conditions
  • Actions
    • Hashtable - Create a hashtable
    • Set Hashtable = (Last created hashtable)
  • Trigger1
  • Events
    • Unit - A unit starts the effect of an ability
  • Conditions
    • (Ability being cast) Equal to Third Person Camera
  • Actions
    • If (All conditions are true) then do (Actions) else do (Actions)
      • If - Conditions
        • (Check) Equal to 1
      • Then - Actions
        • Set Check = 2
        • Player Group - Add (Owner of (Triggering unit)) to CameraGroup
        • Trigger - Turn on (Trigger 2 <gen>)
        • Camera - Lock camera target for (Owner of (Triggering unit)) to (Triggering unit), offset by (0.00, 0.00) using Default rotation
        • Hashtable - Save Handle of (Triggering unit) as 0 of (Key(Owner of (Triggering unit))) in Hashtable
      • Else - Actions
        • Set Check = 1
        • Player Group - Remove (Owner of (Triggering unit)) from CameraGroup
        • Hahtable - Clear all child hashtables of (Key(Owner of (Triggering unit))) in Hashtable
  • Trigger2
  • Events
    • Time - Every 0.05 seconds of game-time
  • Conditions
  • Actions
    • If (All conditions are true) then do (Actions) else do (Actions)
      • If - Conditions
        • (Number of players in CameraGroup) Not Equal to 0
      • Then - Actions
        • Player Group - Pick every player in (CameraGroup) and do (Actions)
          • Loop - Actions
            • Set Unit = (Load 0 of (Key(Picked player)) from Hashtable
            • Camera - Set (Picked player)'s camera Distance to target to 750.00 over 0.10 seconds
            • Camera - Set (Picked player)'s camera Angle of attack to -30.00 over 0.10 seconds
            • Camera - Set (Picked player)'s camera Rotation to (Facing of (Unit)) over 0.00 seconds
      • Else - Actions
        • Trigger - Turn off (This trigger)
Reference:
http://www.hiveworkshop.com/forums/trigger-gui-editor-tutorials-279/hashtables-mui-133407/
 
Level 4
Joined
Jun 14, 2008
Messages
72
Commands like move attack heal, any command you can do cannot interrupt each other example: I am fighting an enemy, I run low on health, I can cast heal but nothing will happen until i finish fighting, then I will heal.... Or if I am walking from point A to point B and an enemy steps in my way, I cannot attack that enemy until I reach point B, I also can't walk around then enemy so i must wait for myself to die... Check is initialy one BTW
 
Level 4
Joined
Jun 14, 2008
Messages
72
Once I use the ability it happens before that, its fine its like the commands are put into a list instead of immediate reaction. Oh and after I disable the ability it continues to do this
 
Level 4
Joined
Jun 14, 2008
Messages
72
Well for some reason that fixed the movement, still my cameras defective now... is there something wrong with my previous triggers? any reason i shouldn't use it?
 
First of all, since I used hashtables = MPI, change the "Check" comparison to the boolean:
  • ((Owner of (Triggering unit) is in CameraGroup) Equal to False
  • If (All conditions are true) then do (Actions) else do (Actions)
    • If - Conditions
      • ((Owner of (Triggering unit) is in CameraGroup) Equal to False
    • Then - Actions
      • Player Group - Add (Owner of (Triggering unit)) to CameraGroup
      • Trigger - Turn on (Trigger 2 <gen>)
      • Camera - Lock camera target for (Owner of (Triggering unit)) to (Triggering unit), offset by (0.00, 0.00) using Default rotation
      • Hashtable - Save Handle of (Triggering unit) as 0 of (Key(Owner of (Triggering unit))) in Hashtable
    • Else - Actions
      • Player Group - Remove (Owner of (Triggering unit)) from CameraGroup
      • Hahtable - Clear all child hashtables of (Key(Owner of (Triggering unit))) in Hashtable
The triggers have nothing wrong; are you sure you did them exactly as I suggested?
 
Status
Not open for further replies.
Top