Hard Light Productions Forums

Modding, Mission Design, and Coding => FS2 Open Coding - The Source Code Project (SCP) => Topic started by: KeldorKatarn on February 16, 2007, 07:02:45 pm

Title: set-object-position + set-object-speed Problem
Post by: KeldorKatarn on February 16, 2007, 07:02:45 pm
Is there any way to use the set-object-speed-x/y/z SEXPs in a way so that the speed is instantaneously active?
Currently the ship only starts accelerating in the new speed direction and keeps sliding into the old one until deceleration has countered that movement vector.
I am trying to implement a cutscene and need to reposition a fighter wing but like this I keep seeing them sliding in their old direction before they fly were I want them to go.
If this is not possible yet, would it be hard to implement such SEXPs for WC Saga?
I would try doing this myself but since I can't find any working project file for VC2005 on the CVS I can't even begin trying.
One additional thing would be camera control. it would be really nice if one could have a SEXP specifying the up-axis for the camera. Right now Only the direction vector can be given by camera-face-object or what it's called. But rotation the camera around its viewing axis is not possible like that. It's only possible by giving degrees but if I only know directions I can't calculate a degree value with the present arithmetic SEXPs.

Anyway, and help would really be appreciated. These minor problems are all that's keeping us from getting the cutscene 100% smoothly and perfectly working.
Are there maybe some new camera and coordinate control SEXPs in the works already?
Title: Re: set-object-position + set-object-speed Problem
Post by: Backslash on February 16, 2007, 07:27:15 pm
Dunno about the cutscene stuff, but for the first problem would a SEXP that changes the ship's $Damp help?  I've been considering implementing something like that.

As for the VC2005, grab the one from HEAD and let me know what errors it still gives you.
Title: Re: set-object-position + set-object-speed Problem
Post by: KeldorKatarn on February 16, 2007, 09:44:44 pm
Dunno about the cutscene stuff, but for the first problem would a SEXP that changes the ship's $Damp help?  I've been considering implementing something like that.

Depending what the $Damp is. If it is something like inertia or something that determines how fast a ship decelerated after turning, then yes that would help.
To describe my problem in a little more detail:

The cutscene takes the player's ship (and his wingmen), alignes them, positiones them at a totally different point in space, lets them face in some direction and then lets them fly in that direction. Now all of that is no problem except for the "fly in that direction" part.
By continuously letting the wingmenships face a certain direction I could get rid of their trying to turn around in the stupid AI's way of holding formation, so that problem was solved, the formation is held perfectly, but the entire formation shifts sometimes and the wingmen (since I position them relative to the player) slide relative to the player because of their old directional vectors.
I can continuously reposition them for 1-2 seconds until their old speed-vector has become 0, but that results in strange flickering since the repositioning isn't fast enough.
Also in the vertical direction the effect is larger so the entire formation keeps sliding in the old direction before finally flying in the new one.

So what I need is a way to position a ship at a point, let it face into a new direction and immediately set its speed to that direction. Not accelerate no 50m/s in that direction but immediately BE at 50m/s. So I need some way to have an infinately high (or huge) acceleration/deceleration rate to make sure the player doesn't see the remains of the old flying direction and only sees the ship fly into the new one as if it had never done anything else.
set-object-speed-x/y/z only sets new acceleration vectore, not new speed vectors. I want immediate speed, no need for acceleration first.

Quote
As for the VC2005, grab the one from HEAD and let me know what errors it still gives you.

I'm having an exam next wednesday. As soon as that is done I'll look into it and report back to you.