Hard Light Productions Forums

Modding, Mission Design, and Coding => FS2 Open Coding - The Source Code Project (SCP) => Topic started by: Black Wolf on June 08, 2006, 04:46:24 pm

Title: set-object-facing-object
Post by: Black Wolf on June 08, 2006, 04:46:24 pm
This could be the coolest sexp I've seen in awhilem if it really does what I think it does. In my current version of FRED, it defaults to two entries, a ship to set facing, and a ship to have it face. However, it lets you add turn time and bank time, which suggests to me that maybe we can finally give a ship a sexped order to turn around and face another ship, making forward facing guns a practical reality.  Only problem is... it's not working. :(

First I set the turn time low (in my example, it was 15, thinking it was seconds), and the ship spins around way, way too fast and ends up way overshooting. Second, now thinking it was in milliseconds, I set it high, 30000. As far as I could tell, in this instance, the ship did nothing at all, despite leaving time compression on at 64x till about 30 mins, whichm for a 90 degree turn, should have shown me something).

So then, baffled, I tried a midrange number of 150. The ship jerked towards the direction it was supposed to turn a little way, then stopped, well short of facing the other ship.

Net result, I'm confused. So, my questions are - can this sexp do what I want it to, What units are the "time" measurements in, and do I need to put a specific number in there for it to work properly (I thought maybe it had to be the amount of time the ship would take given its rotation time in its table or something), and do I need a bank entry if I have a time entry?
Title: Re: set-object-facing-object
Post by: SadisticSid on June 09, 2006, 05:11:23 am
AFAIK this uses the same code for the camera sexps, which when I tried them last, still don't work when turning on more than one axial plane.
Title: Re: set-object-facing-object
Post by: Colonol Dekker on June 09, 2006, 05:14:43 am
Anyway you can post the SEXP info here so i can have a quick look, (the little info window in the events editor) I managed to make a camera pan in a mission track a hecate, just through trial and error. That was a case of setting degrees of rotation though.
Title: Re: set-object-facing-object
Post by: Black Wolf on June 09, 2006, 12:00:05 pm
What sexp info do you mean? It's in the latest (I think) vrsion of FRED, under change, coordinate manipulation.

set-object-facing-object
   Sets an object's orientation to face the specified object.  Takes 2 arguments...
   1: The name of an object.
   2: The object to face.
   3: Turn time (optional)
   4: Bank (optional)
Title: Re: set-object-facing-object
Post by: SadisticSid on June 09, 2006, 12:19:02 pm
set-camera-facing-object
   Makes the camera face the given object  Takes 1 to 3 arguments...
   1:   Object to face
   2:   Total turn time
   3:   Time to spend accelerating/decelerating

and it never worked for me. It seemed to fall short or overshoot what the camera was meant to be looking at. WMC made a test case mission where it worked properly, but it only altered the heading, and not the pitch/roll(?) of the camera.
Title: Re: set-object-facing-object
Post by: Goober5000 on June 10, 2006, 12:24:16 am
Yeah, this was a sexp I couldn't get to work and eventually dropped.  It's a bit tricky because it's hooked into the ai code.

Try using it as the action operator for an every-time sexp (and specifying times in milliseconds).