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

[JASS] How can I get a script working exactly?

Status
Not open for further replies.
Level 10
Joined
Jul 14, 2004
Messages
463
I have a problem, I want to save the current velocity of the camera movement in a real variable. I wrote this script:
Code:
Loop every 0.1 seconds:

    set udg_CurspeedCamera[1] = GetCurrentCameraSetup()

    //CurrentTargetSpeed Updates
    set udg_CurspeedTarget = ( DistanceBetweenPoints( CameraSetupGetDestPositionLoc( udg_CurspeedCamera[0] ), CameraSetupGetDestPositionLoc( udg_CurspeedCamera[1] ) ) * 10 ) //the *10 is to get a value in distance/seconds

    set udg_CurspeedTargDir = AngleBetweenPoints( CameraSetupGetDestPositionLoc( udg_CurspeedCamera[0] ), CameraSetupGetDestPositionLoc( udg_CurspeedCamera[1] ) )

    
    set udg_zz_DCCamSystem_CurspeedCamera[0] = udg_zz_DCCamSystem_CurspeedCamera[1]
Somehow it doesn't work properly: The speed output is way lower than the speed actually is and the direction is sometimes just zero.
Why does this occur? Any ideas to make a script that works reliable?
Thanks for help,
Waldbaer
 
Level 10
Joined
Jul 14, 2004
Messages
463
I'm working on a camera system for easy and realistic smooth camera movement. One function e.g. should just brake the camera's movement and if you have a standard camera sway using "apply camera over x seconds", I don't know the speed to brake from. The rest is working quite well, but it would be nice if I could combine the normal GUI actions with it. :)
 
Status
Not open for further replies.
Top