• 💀 Happy Halloween! 💀 It's time to vote for the best terrain! Check out the entries to Hive's HD Terrain Contest #2 - Vampire Folklore.❗️Poll closes on November 14, 2023. 🔗Click here to cast your vote!
  • 🏆 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!
  • 🏆 HD Level Design Contest #1 is OPEN! Contestants must create a maze with at least one entry point, and at least one exit point. The map should be made in HD mode, and should not be openable in SD. Only custom models from Hive's HD model and texture sections are allowed. The only exceptions are DNC models and omnilights. This is mainly a visual and design oriented contest, not technical. The UI and video walkthrough rules are there to give everyone an equal shot at victory by standardizing how viewers see the terrain. 🔗Click here to enter!

[Trigger] Camera System Height Help?!

Status
Not open for further replies.
Level 4
Joined
Jul 19, 2010
Messages
99
Okay so i have tested my Camera system that i am making and so far everything works about perfectly (Having a bit of trouble with the turning as it is a first and third person system which means it takes forever to turn regularly, i devised a somewhat assisted turning but the camera can become messed up when the unit auto acquires a target (if anyone knows how to turn off the auto targeting on a unit, you would help me so much!)). Anyways the problem lies with when the unit goes up on a hill, the camera height doesn't change, it goes through the hill and catches up with the unit on the other side. Or when the unit goes down into a river or canyon, the camera stays on top of the canyon until the unit exits the other side and catches up with the unit. Is there any way to make it so the camera height automatically adjusts to the current height of the unit? I will show my trigger below as well as the trigger for assisted turning.

(This camera system is based off of a camera system i found in the spell section, just i made it into a third person camera and chopped it up so that it actually shows the hands and weapon of the unit).

  • Cameras
    • Events
      • Time - Every 0.01 seconds of game time
    • Conditions
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • RedCamStat Equal to 1
        • Then - Actions
          • Camera - Set Player 1 (Red)'s camera Distance to target to 75.00 over 0.00 seconds
          • Camera - Set Player 1 (Red)'s camera Angle of attack to 350.00 over 0.00 seconds
          • Camera - Set Player 1 (Red)'s camera Rotation to (Facing of (Load 1 of 5 in UnitTracker)) over 0.50 seconds
          • Camera - Set Player 1 (Red)'s camera Height Offset to 80.00 over 0.00 seconds
          • Camera - Pan camera for Player 1 (Red) to ((Position of (Load 1 of 5 in UnitTracker)) offset by 35.00 towards (Facing of (Load 1 of 5 in UnitTracker)) degrees) over 0.00 seconds
        • Else - Actions
          • Do nothing
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • RedCamStat Equal to 2
        • Then - Actions
          • Camera - Set Player 1 (Red)'s camera Distance to target to 75.00 over 0.00 seconds
          • Camera - Set Player 1 (Red)'s camera Angle of attack to 350.00 over 0.00 seconds
          • Camera - Set Player 1 (Red)'s camera Rotation to (Facing of (Load 1 of 5 in UnitTracker)) over 0.50 seconds
          • Camera - Set Player 1 (Red)'s camera Height Offset to 80.00 over 0.00 seconds
          • Camera - Pan camera for Player 1 (Red) to ((Position of (Load 1 of 5 in UnitTracker)) offset by -100.00 towards (Facing of (Load 1 of 5 in UnitTracker)) degrees) over 0.00 seconds
        • Else - Actions
          • Do nothing
 
You need GetLocationZ() function to add with the height offset:
  • Set Pt1 = (Position of Unit)
  • Custom script: set udg_RealVariable = GetLocationZ (udg_Pt1)
  • Camera - Set Player 1 (Red)'s camera Height Offset to (RealVariable + 80.00) over 0.00 seconds
  • Custom script: call RemoveLocation (udg_Pt1)
Take care of your leaks.
Prefer an approved system from the Spells section.
 
Level 4
Joined
Jul 19, 2010
Messages
99
There was only one version, and all the models worked fine, i haven't added any since i started the triggers two days ago. And for some reason when i try to upload the map, it doesn't show it in the directory, it shows all the other maps except that one.
 
Each time you test a map from the World Editor, it creates a back up file, saved in the Test Map folder, usually named as TestMap.w3x, unless you changed your preferences from the File menu. If this map was the last to test, then there still is a copy in there. Copy and paste that file.

Like I said, a custom script can't crash the file by opening it in the world editor.
 
Status
Not open for further replies.
Top