Author Topic: How do I constantly reduce a ship's velocity?  (Read 959 times)

0 Members and 1 Guest are viewing this topic.

Offline SF-Junky

  • 29
  • Bread can mold, what can you do?
How do I constantly reduce a ship's velocity?
I have a ship which gets into a trap with energy draining mines (wonder what I'm working on again. :D) and I want that ship to constantly reduce its speed from 30 to 0 mps. Now I have a variable in there. Can I somehow tell FRED to reduce the ship's speed by 1 mps every time the variable loses 1/20 of its default value?

 

Offline 0rph3u5

  • 211
  • Oceans rise. Empires fall.
Re: How do I constantly reduce a ship's velocity?
Doing the condition should be no problem with the conditions from "logical" section...

If it is a ship going waypoints, there is the "cap-waypoint-speed"-SEXP.
In the same I think you could try the "set-object-[axis]-speed"-SEXPs if the ship is travelling a along a straight line (but I'm not quite sure that will work).

If its the player ship you can use "set-player-throttle-speed" under an "every-time"-condition to overrule player commands.

EDIT:
This is most likely much more complicated than it needs be - how to modify the variables would be up to you:

In this example only "CurrentValue" and "Divisor" need be modified constantly; "MaxSpeed" must only be adjusted once to the ship actual maximum velocity

The value of "Divisor" could depend on radius, making simple distance checks the condition for its modification in other events.
The value of "CurrentValue" could be modified by events that measure the exposure to the mine field by keeping a count of "seconds exposed to the minefield".
« Last Edit: October 27, 2013, 11:13:50 am by 0rph3u5 »
"As you sought to steal a kingdom for yourself, so must you do again, a thousand times over. For a theft, a true theft, must be practiced to be earned." - The terms of Nyrissa's curse, Pathfinder: Kingmaker

==================

"I am Curiosity, and I've always wondered what would become of you, here at the end of the world." - The Guide/The Curious Other, Othercide

"When you work with water, you have to know and respect it. When you labour to subdue it, you have to understand that one day it may rise up and turn all your labours into nothing. For what is water, which seeks to make all things level, which has no taste or colour of its own, but a liquid form of Nothing?" - Graham Swift, Waterland

"...because they are not Dragons."

  

Offline headdie

  • i don't use punctuation lol
  • 212
  • Lawful Neutral with a Chaotic outook
    • Skype
    • Twitter
    • Headdie on Deviant Art
Re: How do I constantly reduce a ship's velocity?
With a non fighter/bomber you could just damage the engine subsystem on each iteration of a looped event which would also slow it down
Minister of Interstellar Affairs Sol Union - Retired
quote General Battuta - "FRED is canon!"
Contact me at [email protected]
My Release Thread, Old Release Thread, Celestial Objects Thread, My rubbish attempts at art