Hard Light Productions Forums

Modding, Mission Design, and Coding => FS2 Open Coding - The Source Code Project (SCP) => Topic started by: headdie on January 03, 2011, 05:59:22 pm

Title: A couple of requests
Post by: headdie on January 03, 2011, 05:59:22 pm
first one was inspired by this thread (http://www.hard-light.net/forums/index.php?topic=73681.msg1454660#msg1454660) and is for SEXPs to read player issued orders, not only for a situation as mentioned in the thread but might also be useful to adjust a mission depending on player orders and to trigger messages.

Second one that I have been thinking about is for rotating single part turrets so they can track a target within a specified field of view.
Title: Re: A couple of requests
Post by: FUBAR-BDHR on January 03, 2011, 06:06:21 pm
How would you define the rotation of a single part turret?  Is the whole turret supposed to rotate?  Just part of it?  For example a single part turret with 3 barrels in a straight line several meters apart. 
Title: Re: A couple of requests
Post by: karajorma on January 03, 2011, 07:27:59 pm
first one was inspired by this thread (http://www.hard-light.net/forums/index.php?topic=73681.msg1454660#msg1454660) and is for SEXPs to read player issued orders, not only for a situation as mentioned in the thread but might also be useful to adjust a mission depending on player orders and to trigger messages.

What's wrong with the Query-Orders SEXP? (It's in the training section IIRC so you might have missed it).
Title: Re: A couple of requests
Post by: headdie on January 03, 2011, 08:12:19 pm
first one was inspired by this thread (http://www.hard-light.net/forums/index.php?topic=73681.msg1454660#msg1454660) and is for SEXPs to read player issued orders, not only for a situation as mentioned in the thread but might also be useful to adjust a mission depending on player orders and to trigger messages.

What's wrong with the Query-Orders SEXP? (It's in the training section IIRC so you might have missed it).

found it, thanks for that

How would you define the rotation of a single part turret?  Is the whole turret supposed to rotate?  Just part of it?  For example a single part turret with 3 barrels in a straight line several meters apart. 

I was thinking the whole turret object around its centre with the rotation limits set in either the .pof or in the ship table

[attachment deleted by admin]
Title: Re: A couple of requests
Post by: FUBAR-BDHR on January 03, 2011, 08:48:39 pm
What if the barrels are separated in a long string like this:   |.........|.........|...........|..........|..........|.........| and the hull isn't that wide?
Title: Re: A couple of requests
Post by: Nuke on January 03, 2011, 10:50:52 pm
first one was inspired by this thread (http://www.hard-light.net/forums/index.php?topic=73681.msg1454660#msg1454660) and is for SEXPs to read player issued orders, not only for a situation as mentioned in the thread but might also be useful to adjust a mission depending on player orders and to trigger messages.

What's wrong with the Query-Orders SEXP? (It's in the training section IIRC so you might have missed it).

found it, thanks for that

How would you define the rotation of a single part turret?  Is the whole turret supposed to rotate?  Just part of it?  For example a single part turret with 3 barrels in a straight line several meters apart. 

I was thinking the whole turret object around its centre with the rotation limits set in either the .pof or in the ship table

so you want single part turrets that rotate? good luck, ive been asking for those forever.

though it would be fairly easy to compute an orientation based of target vector. you need to:

bring the target into the turret's frame of reference
pitch = atan2(target y, target z)
yaw = atan2(target x, target z)
matrixify pitch and yaw
apply matrix to turret submodel (you would need to multiply the base matrix (what would normally be derived from fvec and uvec) by this (i think) if you want anything other than an orthagonal axis facing turret)

actually i think i scripted something like this.
Title: Re: A couple of requests
Post by: FUBAR-BDHR on January 03, 2011, 10:58:13 pm
Why not make them multi-part?  The 50 rotation limit is or will soon be gone.  Using the base rotation and elevation should give you what you want.  Still doesn't work if you have 400+ barrels.
Title: Re: A couple of requests
Post by: FreeSpaceFreak on January 04, 2011, 03:31:36 am
Just make a dummy invisible turret base and a visible turret arm, that will look like a rotating singlepart. Take a look at ASW's Zakros, for instance.
Title: Re: A couple of requests
Post by: Nuke on January 04, 2011, 08:22:59 am
id just go the script route myself