Author Topic: Transfering ship speed and facing  (Read 3183 times)

0 Members and 1 Guest are viewing this topic.

Offline Ace

  • Truth of Babel
  • 212
    • http://www.lordofrigel.com
Transfering ship speed and facing
Here's a tricky one:
The idea is swapping out a ship with a new one. Keeping the same location, speed, and heading as the original ship.

For location, that's simple by using the old ship's position when creating the new one. For storing speed, that should be doable through a variable.

However, storing a ship's heading (facing) seems to be trickier, thus the question here.
Ace
Self-plagiarism is style.
-Alfred Hitchcock

 
Re: Transfering ship speed and facing
Is there any reason why you can't just use Change-ship-class?  :confused:

 

Offline Ace

  • Truth of Babel
  • 212
    • http://www.lordofrigel.com
Re: Transfering ship speed and facing
Because I need the replacement ship to warp out, with the original ship then re-appearing. This convoluted sequence is because the warp-effect SEXP doesn't work with the FTL effect being used.

To explicate: this is for a mis-jumping effect for Btrl. Since warp-effect doesn't properly work, the solution would be a dummy ship but position, facing, and speed all need to be transferred.
Ace
Self-plagiarism is style.
-Alfred Hitchcock

 

Offline Colonol Dekker

  • HLP is my mistress
  • 213
  • Aken Tigh Dekker- you've probably heard me
    • My old squad sub-domain
Re: Transfering ship speed and facing
Why not use one of the "make a warp effect" sexps using "get ship xyz" i think the warpy one is under cinematics or special effects. I've not Fredded properly in a good six weeks so forgive the vagueness.
Campaigns I've added my distinctiveness to-
- Blue Planet: Battle Captains
-Battle of Neptune
-Between the Ashes 2
-Blue planet: Age of Aquarius
-FOTG?
-Inferno R1
-Ribos: The aftermath / -Retreat from Deneb
-Sol: A History
-TBP EACW teaser
-Earth Brakiri war
-TBP Fortune Hunters (I think?)
-TBP Relic
-Trancsend (Possibly?)
-Uncharted Territory
-Vassagos Dirge
-War Machine
(Others lost to the mists of time and no discernible audit trail)

Your friendly Orestes tactical controller.

Secret bomb God.
That one time I got permabanned and got to read who was being bitxhy about me :p....
GO GO DEKKER RANGERSSSS!!!!!!!!!!!!!!!!!
President of the Scooby Doo Model Appreciation Society
The only good Zod is a dead Zod
NEWGROUNDS COMEDY GOLD, UPDATED DAILY
http://badges.steamprofile.com/profile/default/steam/76561198011784807.png

 

Offline Ace

  • Truth of Babel
  • 212
    • http://www.lordofrigel.com
Re: Transfering ship speed and facing
Because the warp-effect SEXP isn't compatible with this FTL effect.
Ace
Self-plagiarism is style.
-Alfred Hitchcock

 

Offline Colonol Dekker

  • HLP is my mistress
  • 213
  • Aken Tigh Dekker- you've probably heard me
    • My old squad sub-domain
Re: Transfering ship speed and facing
Feature request?
"because you're worth it"
Campaigns I've added my distinctiveness to-
- Blue Planet: Battle Captains
-Battle of Neptune
-Between the Ashes 2
-Blue planet: Age of Aquarius
-FOTG?
-Inferno R1
-Ribos: The aftermath / -Retreat from Deneb
-Sol: A History
-TBP EACW teaser
-Earth Brakiri war
-TBP Fortune Hunters (I think?)
-TBP Relic
-Trancsend (Possibly?)
-Uncharted Territory
-Vassagos Dirge
-War Machine
(Others lost to the mists of time and no discernible audit trail)

Your friendly Orestes tactical controller.

Secret bomb God.
That one time I got permabanned and got to read who was being bitxhy about me :p....
GO GO DEKKER RANGERSSSS!!!!!!!!!!!!!!!!!
President of the Scooby Doo Model Appreciation Society
The only good Zod is a dead Zod
NEWGROUNDS COMEDY GOLD, UPDATED DAILY
http://badges.steamprofile.com/profile/default/steam/76561198011784807.png

 

Offline FUBAR-BDHR

  • Self-Propelled Trouble Magnet
  • 212
  • Master Drunk
    • 165th Beer Drinking Hell Raisers
Re: Transfering ship speed and facing
Are you talking cap ship?  Is the ship doing any sort of waypoints?
No-one ever listens to Zathras. Quite mad, they say. It is good that Zathras does not mind. He's even grown to like it. Oh yes. -Zathras

 

Offline karajorma

  • King Louie - Jungle VIP
  • Administrator
  • 214
    • Karajorma's Freespace FAQ
Re: Transfering ship speed and facing
Feature request?

I seem to remember trying something similar 3-4 years ago. At the time I decided I'd need a new SEXP to make it work.

Since then I haven't tried it again though so there may be some way of getting it to work using the various object manipulation SEXPs. I'm pretty sure there wasn't back then though.
Karajorma's Freespace FAQ. It's almost like asking me yourself.

[ Diaspora ] - [ Seeds Of Rebellion ] - [ Mind Games ]

 

Offline Ace

  • Truth of Babel
  • 212
    • http://www.lordofrigel.com
Re: Transfering ship speed and facing
With the coordinate manipulation SEXPs, it could be possible with a "get-object-speed X, Y, Z" type command. (set that to variables, use the variables for the coordinate manip)

Similarly  a "get-object-facing X, Y, Z" under coordinate manipulation would make this fully work.

Since create-ship doesn't seem to allow for waypoints, the hack of making a waypoint a few meters in front of you for a reference spot doesn't seem to work. (this doesn't really solve the speed issue as you need coordinates in three axes to properly do the speed with the coordinate manipulation SEXP)

For the time being I have a solution by slowing your ship down to a halt when doing the effect. However, these SEXPs appear to be necessary to do this effect with a moving object.

With those two SEXPs added plenty of interesting things could be possible, such as the "multiple ships sharing one jump vortex" idea. No warp effect ships arrive after the main ship, use the get-object-facing and get-object-speed SEXPs on the jumping ship with the set-object-facing and set-object-speed SEXPs on the "riders" and it should have them move at the same speed as the main ship as long as the events are repeating. In the end, this would allow the other ships to mimic the same deceleration from the vortex.
« Last Edit: September 11, 2008, 08:49:42 pm by Ace »
Ace
Self-plagiarism is style.
-Alfred Hitchcock

 

Offline karajorma

  • King Louie - Jungle VIP
  • Administrator
  • 214
    • Karajorma's Freespace FAQ
Re: Transfering ship speed and facing
I tend to bounce between thinking we need a pair of get and set rotations SEXPs and being convinced we already have at last one of the two.

Either way this is probably one of the SEXPs I'm least suited to add myself since I've only got the vaguest idea how to do vector maths these days (I learned for my A levels and then promptly forgot it all).
Karajorma's Freespace FAQ. It's almost like asking me yourself.

[ Diaspora ] - [ Seeds Of Rebellion ] - [ Mind Games ]

 

Offline Trivial Psychic

  • 212
  • Snoop Junkie
Re: Transfering ship speed and facing
How about sexps less complicated for the FREDder?

transfer-co-ordinates
-<source ship which is leaving>
-<ship to transfer co-ordinates to>
-optional additional ships receiving co-ordinates

-transfer-vector

(does same as previous except it transfers the direction the first ship was pointing in 3D space)

-transfer-attitude

(does same as previous except it transfers essentially the ship's angle of bank)

Is this useful, or would it be WAY to difficult to code in?

With those two SEXPs added plenty of interesting things could be possible, such as the "multiple ships sharing one jump vortex" idea. No warp effect ships arrive after the main ship, use the get-object-facing and get-object-speed SEXPs on the jumping ship with the set-object-facing and set-object-speed SEXPs on the "riders" and it should have them move at the same speed as the main ship as long as the events are repeating. In the end, this would allow the other ships to mimic the same deceleration from the vortex.

I'd been pushing for an option in the ships (and wings) arrival and departure cues editor, which would include a "preserve warping motions" checkbox.  This would be greyed-out by default, until the "disable warp effect" checkbox is ticked.  The new checkbox would allow you to retain a ship's warping speed and accelleration/deceleration rate without having a warp vortex.  Then, if you want ships to appear to arrive or depart from the same group vortex, all you need to do is get them all to point the same direction (ie, head towards a distant waypoint) for departures, or simply place them properly for arrivals, use the "generate-warp-vortex sexp, and have all the ships warp without their own vortexes, but retaining the speeds and accel/decel rates, and presto... you have the desired effect.
The Trivial Psychic Strikes Again!

 

Offline Goober5000

  • HLP Loremaster
  • 214
    • Goober5000 Productions
Re: Transfering ship speed and facing
How about sexps less complicated for the FREDder?

transfer-co-ordinates
-<source ship which is leaving>
-<ship to transfer co-ordinates to>
-optional additional ships receiving co-ordinates

-transfer-vector

(does same as previous except it transfers the direction the first ship was pointing in 3D space)

-transfer-attitude

(does same as previous except it transfers essentially the ship's angle of bank)

Is this useful, or would it be WAY to difficult to code in?
We already have ship-copy-damage.  These sexps you suggest would be not only useful, but just as easy and straightforward to add as ship-copy-damage.  I would imagine they could benefit a lot of situations not related to warping.

Remind me about these after the code freeze is over.  These would be high priority features.


Quote
I'd been pushing for an option in the ships (and wings) arrival and departure cues editor, which would include a "preserve warping motions" checkbox.  This would be greyed-out by default, until the "disable warp effect" checkbox is ticked.  The new checkbox would allow you to retain a ship's warping speed and accelleration/deceleration rate without having a warp vortex.  Then, if you want ships to appear to arrive or depart from the same group vortex, all you need to do is get them all to point the same direction (ie, head towards a distant waypoint) for departures, or simply place them properly for arrivals, use the "generate-warp-vortex sexp, and have all the ships warp without their own vortexes, but retaining the speeds and accel/decel rates, and presto... you have the desired effect.
Very interesting.  I hadn't thought about it quite like that before.  That might be worth investigating.

 

Offline karajorma

  • King Louie - Jungle VIP
  • Administrator
  • 214
    • Karajorma's Freespace FAQ
Re: Transfering ship speed and facing
We already have ship-copy-damage.  These sexps you suggest would be not only useful, but just as easy and straightforward to add as ship-copy-damage.  I would imagine they could benefit a lot of situations not related to warping.

Remind me about these after the code freeze is over.  These would be high priority features.

To be honest I don't think they'd be as useful as get and set. I only use get-object-position together with the set SEXPs about half of the time. I find it just as useful for the explosion-effect, ship-create, weapon-create etc SEXPs.

Having get and set allows me to do stuff like having a ship appear in front of the player whatever he's looking at, etc.

Now if we were to have both those SEXPs and get and set I'd be happy. :)
Karajorma's Freespace FAQ. It's almost like asking me yourself.

[ Diaspora ] - [ Seeds Of Rebellion ] - [ Mind Games ]

  

Offline Ace

  • Truth of Babel
  • 212
    • http://www.lordofrigel.com
Re: Transfering ship speed and facing
Awesome Goob :)

I'm with Kara on get and set being more powerful, but if for some reason ship-copy would be easier to implement it'd work for the purposes I'm thinking of.
Ace
Self-plagiarism is style.
-Alfred Hitchcock