FreeSpace Releases > Scripting Releases
Movements-SEXPs, capship useful (v2.6)
wookieejedi:
--- Quote from: General Battuta on December 01, 2019, 05:06:46 pm ---
--- Quote from: wookieejedi on December 01, 2019, 10:02:08 am ---Great! If there is any extra functionality you wanted added that may be useful just let me know.
--- End quote ---
My holy grail of movement SEXPs is 'hold relative orientation' (or 'hold relative aspect' or whatever). Tells a ship to position itself in a point, say, 500 meters beneath the target's origin, maintain that point relative to the target no matter how the target maneuvers, and hold its own orientation respect to the target.
Or, in other words: "go to 500 below the target's origin and keep your top facing that origin no matter what."
Probably really hard.
--- End quote ---
Alright, just added that functionality (github also updated). That is now the default behavior for `add-ai-goal-track-ship` and you can also turn that behavior on and off using `set-idle-track-orientation`. So now you can really tell a ship to go to a spot relative to another ship and keep it's nose pointed at it no matter what :)
General Battuta:
Without looking - how do you specify whether you want the mover to aim their nose, top, bottom, or ass at the target? Or is it nose only?
wookieejedi:
--- Quote from: General Battuta on December 06, 2019, 10:43:49 am ---Without looking - how do you specify whether you want the mover to aim their nose, top, bottom, or ass at the target? Or is it nose only?
--- End quote ---
Good question, the user can specify what direction to aim. The inputs for `add-ai-goal-track-ship` takes, among other things, a pitch, bank, and heading that is relative to the target ship's orientation. So, say you wanted Ship A to pull up beneath Ship B and then rotate so it's butt is facing Ship B. To do that you would set the relative y location in `add-ai-goal-track-ship` to some negative value and then the pitch and heading of 0 and a pitch of 90 degrees (again these are relative to Ship B's orientation). These inputs to the sexp would tell Ship A to go to that position relative to Ship A and then point it's butt up in the air so the butt is facing Ship B.
The full sexp and all it's arguments for that higher order sexp are:
--- Code: ---$Operator: add-ai-goal-track-ship
$Category: Change
$Subcategory: LUA-Movements
$Minimum Arguments: 3
$Maximum Arguments: 10
$Return Type: Nothing
$Description: Adds a custom ai-goal for a ship to track another ship. The ordered ship will move to follow the target ship and then once stopped will rotate to the target ship orientation, or a variant to that orientation. This is a higher level sexp that runs 'add-waypoint-track-ship' with 'add-ai-goal-track-waypoint' and 'set-idle-track-orientation'. This sexp uses a time interval of 1 second for updating positional data and a track distance of the radius of the ship following the track order. Note, use a waypoint path with only 1 waypoint. The order 'clear-goals' will also stop this custom order. Also the ship will continually maintain the specified orientation when at rest.
$Parameter:
+Description: Ship to order.
+Type: Ship
$Parameter:
+Description: Target ship to track.
+Type: Ship
$Parameter:
+Description: Waypoint path to use for the ship to follow.
+Type: Waypointpath
$Parameter:
+Description: Priority of order. Default is 100.
+Type: Number
$Parameter:
+Description: X offset in meters from the center of the target ship that the ordered ship will move to. Default is random value between the radius and diameter of the target ship.
+Type: Number
$Parameter:
+Description: Y offset in meters from the center of the target ship that the ordered ship will move to. Default is random value between the radius and diameter of the target ship.
+Type: Number
$Parameter:
+Description: Z offset in meters from the center of the target ship that the ordered ship will move to. Default is random value between the radius and diameter of the target ship.
+Type: Number
$Parameter:
+Description: Pitch of idle orientation in degrees relative to target ship orientation. Default is 0 (same pitch as target). Any value is valid and will be converted to range within 0-359.
+Type: Number
$Parameter:
+Description: Pitch of idle orientation in degrees relative to target ship orientation. Default is 0 (same bank as target). Any value is valid and will be converted to range within 0-359.
+Type: Number
$Parameter:
+Description: Pitch of idle orientation in degrees relative to target ship orientation. Default is 0 (same heading as target). Any value is valid and will be converted to range within 0-359.
+Type: Number
--- End code ---
General Battuta:
Fantastique! This will be amazing for capship choreography, especially in capship command missions.
wookieejedi:
Thanks, glad it will be helpful. If you or anyone else comes across anything that you’d like added just let me know and I can see what I can do!
Navigation
[0] Message Index
[#] Next page
[*] Previous page
Go to full version