Hard Light Productions Forums

Modding, Mission Design, and Coding => The FRED Workshop => Topic started by: Goober5000 on December 07, 2013, 05:14:09 pm

Title: Putting the brakes on a ship
Post by: Goober5000 on December 07, 2013, 05:14:09 pm
I needed a ship to slow down rapidly after emerging from subspace.  After trying a number of sexps without success, I ended up making a duplicate ship class with the "supercap" flag.  This slows the ship down satisfactorily, but is obviously not an ideal solution.

Then I ran across this interesting quote in Battuta's mission checkpoint tutorial...

Immediately kill the ship's entry momentum with a SEXP (this is glitchy and requires some work)

Anyone know which sexp he is describing?  I would PM him myself but he's currently on leave from HLP.
Title: Re: Putting the brakes on a ship
Post by: headdie on December 07, 2013, 06:12:19 pm
would either of these table entries help?

http://www.hard-light.net/wiki/index.php/Ships.tbl#.24Warpin_Speed:
$Warpin Speed:
FS2 Open 3.6.10:
Sets the speed at which the ship warps in for default warpin effect
Sets the time that the ships warp in (not the animation itself) takes for BTRL type warpin effects
Syntax: Float, meters per second or miiliseconds

$Warpin Time:
FS2 Open 3.6.10:
Defines the effect duration
Syntax: Float, seconds


edit

alternatively you could use the supercap warpin and then sexp to switch the ship class to the regular version
Title: Re: Putting the brakes on a ship
Post by: Goober5000 on December 07, 2013, 06:40:48 pm
would either of these table entries help?

http://www.hard-light.net/wiki/index.php/Ships.tbl#.24Warpin_Speed:
$Warpin Speed:
FS2 Open 3.6.10:
Sets the speed at which the ship warps in for default warpin effect
Sets the time that the ships warp in (not the animation itself) takes for BTRL type warpin effects
Syntax: Float, meters per second or miiliseconds

$Warpin Time:
FS2 Open 3.6.10:
Defines the effect duration
Syntax: Float, seconds

No, unfortunately.  That was the first thing I tried, but those only work for BTRL and Hyperspace warp effects, not the FS2 warp effect.


Quote
alternatively you could use the supercap warpin and then sexp to switch the ship class to the regular version

That's what I did.
Title: Re: Putting the brakes on a ship
Post by: headdie on December 07, 2013, 06:53:08 pm
drat.  ok, no idea then
Title: Re: Putting the brakes on a ship
Post by: karajorma on December 07, 2013, 07:38:38 pm
Funnily enough I was discussing this issue yesterday. The WCS release has a SEXP called set-forward-deceleration which apparently they used for exactly this reason. I thought the SEXP was rather useless outside the WCS universe cause these features really should be part of the warpin code rather than requiring a SEXP.

That said, couldn't you simply set the speed of the ship with SEXPs? Or does it retain the original deceleration values?
Title: Re: Putting the brakes on a ship
Post by: Goober5000 on December 07, 2013, 08:05:31 pm
I forget what I used exactly, but I'm pretty sure I tried a repeating set-speed approach and didn't like it.  You're right in that the best solution would be an enhancement of the warpin code, but I was wearing my FREDding hat and didn't care to code it.
Title: Re: Putting the brakes on a ship
Post by: Mito [PL] on December 08, 2013, 10:20:38 am
Or maybe make a loop triggered by the ships arrival, decreasing its speed by 1 each 5 milisecs? That would give you decceleration of about 200 m/s each second...
Title: Re: Putting the brakes on a ship
Post by: jr2 on December 08, 2013, 10:53:22 am
Shouldn't there be made a way to customize warp arrival anyways?  Different FTL methods will be different.  I mean so that current FS1/2 (are they different? then we could make FSPort more original if they were) is emulated by default, but different distance traveled and time to travel can be specified?  IDK, just thoughts.
Title: Re: Putting the brakes on a ship
Post by: Fury on December 08, 2013, 11:09:07 am
Did you try to use 0 as initial velocity in the ship editor? (You probably did, but checking anyway...)
Title: Re: Putting the brakes on a ship
Post by: Goober5000 on December 08, 2013, 12:51:22 pm
Am I writing my posts in code?  Did I forget to turn off my time machine?  Seriously, what is the explanation for these three responses from three different people?


I ended up making a duplicate ship class with the "supercap" flag

alternatively you could use the supercap warpin


I tried a repeating set-speed approach and didn't like it

Or maybe make a loop triggered by the ships arrival, decreasing its speed by 1 each 5 milisecs?


the best solution would be an enhancement of the warpin code

Shouldn't there be made a way to customize warp arrival anyways?


Maybe I'm just that good at inception. :p



Did you try to use 0 as initial velocity in the ship editor? (You probably did, but checking anyway...)

That isn't applicable for ships that warp in, only for ships that are present at mission start.
Title: Re: Putting the brakes on a ship
Post by: Fury on December 08, 2013, 01:33:39 pm
That isn't applicable for ships that warp in, only for ships that are present at mission start.
A ship with lower initial velocity (like 0) will make full stop sooner than a ship with higher initial velocity (like default 33) upon exiting from warp. In case of a bigger ship, the difference in distance traveled should be quite remarkable.

At least that is my experience from the few missions I fredded back in the old days.
Title: Re: Putting the brakes on a ship
Post by: Goober5000 on December 08, 2013, 01:47:39 pm
Interesting.  I'll have to take another look.
Title: Re: Putting the brakes on a ship
Post by: jr2 on December 09, 2013, 06:45:41 pm
I was trying to say that if you end up tweaking warpin settings make sure they can be adjusted to all the different universes we support and future ones we might, i.e., make it as flexible as possible.  Yes, I mangled that horribly in my previous post.  :P
Title: Re: Putting the brakes on a ship
Post by: Droid803 on December 10, 2013, 02:12:15 am
would either of these table entries help?

http://www.hard-light.net/wiki/index.php/Ships.tbl#.24Warpin_Speed:
$Warpin Speed:
FS2 Open 3.6.10:
Sets the speed at which the ship warps in for default warpin effect
Sets the time that the ships warp in (not the animation itself) takes for BTRL type warpin effects
Syntax: Float, meters per second or miiliseconds

$Warpin Time:
FS2 Open 3.6.10:
Defines the effect duration
Syntax: Float, seconds

No, unfortunately.  That was the first thing I tried, but those only work for BTRL and Hyperspace warp effects, not the FS2 warp effect.

I'm pretty sure at least one of those two works for FS2 warp effect. It's how Spoon got his Hertak Armageddons to have a super slow warpin to make it seem like a much larger and more imposing ship, IIRC.
Because those things take quite a long time to warp in and move slowly while doing so.

As for the checkpoint thing, it might just be a set-speed SEXP. I'm not sure what you mean by "you didn't like it" - but for the checkpoint purposes, it didn't need to look like a smooth/visually-acceptable transition warping in, it just needed the ship not to keep hurling forwards and messing up mission-timing.
Title: Re: Putting the brakes on a ship
Post by: Goober5000 on December 11, 2013, 11:00:17 am
Where did Spoon do this?  Is that Wings of Dawn?

And I need a slower warpin for visual purposes, not for checkpoint purposes.  The set-speed approach didn't look visually smooth enough.
Title: Re: Putting the brakes on a ship
Post by: Lorric on December 11, 2013, 11:23:06 am
Where did Spoon do this?  Is that Wings of Dawn?

And I need a slower warpin for visual purposes, not for checkpoint purposes.  The set-speed approach didn't look visually smooth enough.
It is indeed.

You'll probably like the Armageddon warp in then. You can see it here about 1:30 in:

http://www.youtube.com/watch?v=uk_eql49h7c&feature=c4-overview&list=UUxW-7zwlLDcTmdpn2sOKEWg
Title: Re: Putting the brakes on a ship
Post by: Spoon on December 11, 2013, 02:33:32 pm
As headdie said, for the slow Hertak warping speed I used $Warpin Speed:   100
If you want a different deceleration speed after the warpin itself has completed change the $Forward decel:

That's all I know
Title: Re: Putting the brakes on a ship
Post by: Goober5000 on December 11, 2013, 02:44:59 pm
And you used the standard subspace warp effect, not your own custom effect?
Title: Re: Putting the brakes on a ship
Post by: MatthTheGeek on December 11, 2013, 04:29:57 pm
Dude, maybe you could, like, look at the goddamn mod instead of doubting what everyone's telling you.
Title: Re: Putting the brakes on a ship
Post by: Goober5000 on December 11, 2013, 06:17:33 pm
There's a difference between doubting and asking for more information.
Title: Re: Putting the brakes on a ship
Post by: Spoon on December 11, 2013, 07:41:28 pm
And you used the standard subspace warp effect, not your own custom effect?
The maps are from ASW I think. (I'm not completely sure ill be honest) Aside from that its the same old subspace.
Title: Re: Putting the brakes on a ship
Post by: Goober5000 on December 11, 2013, 08:02:12 pm
The maps are from ASW I think. (I'm not completely sure ill be honest) Aside from that its the same old subspace.

Okay, cool.

As it turns out, editing those ship fields would require me to create a duplicate ship entry anyway.  I was hoping there would be a purely sexp-based solution.


That isn't applicable for ships that warp in, only for ships that are present at mission start.
A ship with lower initial velocity (like 0) will make full stop sooner than a ship with higher initial velocity (like default 33) upon exiting from warp. In case of a bigger ship, the difference in distance traveled should be quite remarkable.

At least that is my experience from the few missions I fredded back in the old days.

I just tested this, and the initial velocity made not one whit of difference, either on retail or latest SVN.  I used a mission with two Hatshepsuts, one set at 0 initial velocity and one set at 100, with both cued to warp in at the same time.
Title: Re: Putting the brakes on a ship
Post by: Fury on December 12, 2013, 12:04:16 am
I just tested this, and the initial velocity made not one whit of difference, either on retail or latest SVN.  I used a mission with two Hatshepsuts, one set at 0 initial velocity and one set at 100, with both cued to warp in at the same time.
Interesting. There used to be a difference at some point because I remember testing this in the early days of FSO. Might have been something else causing the behavior then. At least that's certain now then.
Title: Re: Putting the brakes on a ship
Post by: Dragon on December 17, 2013, 01:39:50 pm
As it turns out, editing those ship fields would require me to create a duplicate ship entry anyway.  I was hoping there would be a purely sexp-based solution.
WCS released it's source code, so you could always port that SEXP of theirs to FSO. Would be handy for cutscenes, and more SEXPs won't hurt anyone.
Title: Re: Putting the brakes on a ship
Post by: MatthTheGeek on December 17, 2013, 01:48:44 pm
Karaj was looking at it, I remember him saying that if that sexp was gonna make it into FSO it would have to be made more generalist first.
Title: Re: Putting the brakes on a ship
Post by: karajorma on December 17, 2013, 06:49:41 pm
Would there be anywhere it would be useful other than warpin though? Cause if it's that specific, it should be handled in code, either by a new table entry or by a new field in the ships editor.