FreeSpace Releases > Scripting Releases

Movements-SEXPs, capship useful (v1.7)

<< < (4/5) > >>

wookieejedi:
Note, updated script to version 1.3, which fixes occasional ship spinning occurrences.

EatThePath:
These seem very useful, thank you for making them. I have some questions, though.

What is relative orientation relative to? Are you setting what where ship A is going to point it's nose relative to it's vector to ship B, or are you setting ship A's orientation to be an offset to ship B? I can imagine both being useful, the former for things like broadside fighting and the latter for holding formations of ships. I think you can probably ultimately accomplish both with either, but some are more straight-forward to use in certain ways than others.

With relative position offsets for tracking, does that relative position account for the orientation of the target ship as well, or is it in defaultly oriented coordinates just centered on the tracked ship?

Lastly, I find myself wanting a version of ai-goal-track that takes a distance rather than a vector for positional offset.

wookieejedi:
Thanks, and all good questions.

What is relative orientation relative to?

Relative orientation is relative strictly to the target's orientation (so an offset to ship B). For example, if you want Ship A to be broadsides against Ship B then you would tell the sexp to use relative orientation and set the heading value as 90. Ship A will move to the waypoint, then rotate to an orientation that is 90 degrees different than Ship B.

Yes, relative position offsets account for the target ship's direction. So if you want Ship A to follow right behind Ship B then make the offset have a z value of some negative number. For example, if I set it to -300 for the z offset it will be 300 meters behind the ship, no matter what orientation that target ship is in.

For your last point, I think I see what you mean, but could you give an example just so I am sure?

EatThePath:
For examples example, say I want a Ravana fly to 2000 m away from a target and point it's nose at that target, without caring if the target is twisting around itself, or a moloch to hold a broadside at a specific distance in a similar situation.

wookieejedi:

--- Quote from: EatThePath on May 07, 2020, 12:41:13 pm ---For examples example, say I want a Ravana fly to 2000 m away from a target and point it's nose at that target, without caring if the target is twisting around itself, or a moloch to hold a broadside at a specific distance in a similar situation.

--- End quote ---

Ah I see, thank you for the examples. That would indeed be useful, and I have added that as an option in v1.4. There are two options to set to achieve that behavior. The sexp `ai-goal-track` now has two additional optional arguments to set to achieve that kind of behavior.

* Whether or not to use relative offsets. Default is true, which means all offsets will be relative to the target ship's orientation. To force the use of absolute offsets and not take account the ship's orientation, set to false.

* Boolean if the ship should actively mantain this orientation when at rest. Default is true. Keeping this value to true is useful for having a ship mantain an orientation relative to another ship, even if the target ship rotates.
Also the option to disable or set the priority of the play_dead order used during ship rotations as also been added to the ship_track_ship sexp.