Hard Light Productions Forums
Modding, Mission Design, and Coding => The FRED Workshop => Topic started by: SF-Junky on October 25, 2013, 01:49:07 pm
-
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?
-
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:
(http://i1020.photobucket.com/albums/af321/0rph3u5/FS%20Open/th_stuff_zpsbdd10006.jpg) (http://s1020.photobucket.com/user/0rph3u5/media/FS%20Open/stuff_zpsbdd10006.jpg.html)
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".
-
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