Hard Light Productions Forums
Modding, Mission Design, and Coding => FS2 Open Coding - The Source Code Project (SCP) => Topic started by: MetalDestroyer on August 23, 2009, 06:01:21 pm
-
Hi all,
I'm wondering if it is possible to make an AI ship going backward indefinitely ?
I found out in the ships.tbl, the '$Rear speed' option with his value. But I found nothing in SEXP which let me use this.
There is the "set-object-speed-z" command, but whatever negative value I give, the ship doesn't go backward.
Here the SEXP:
$Formula: ( every-time
( true )
( set-object-speed-z
"My Ship"
-50
)
)
-
Every time what is true?
-
You don't want 'every-time' you just want 'when'.
-
I tryed with the When condition and nothing happened. :/
-
Is a negative speed considered backwards or is it a combination of a positive speed and a negative thrust modifier that you really need?
-
You can't just use a when, try using a has time elapsed.
-
He's not just using a when, he's using
when
-> true
evaluates to true on the first frame. It's valid and I use it all the time. ;)
Also in my experience set-object-speed-xyz just acts as an impulse. It will only set that speed for 1 frame and the game's physics will slow/speed it down/up right after.
I have used set-object-speed with some effect before, I'll have a looksie when I get home today.
-
It seems the engine doesn't do anything when the speed has a negative value.
Edit: I've just notice something interesting. We can make a ship go backward without using any SEXP. Just put a negative value on $Max Velocity.
In FRED, set a default velocity to the ship you want to go backward. Execute the mission, the ship go backward until it reach 0. His speed is totally exponantial.
SEXP doesn't recognize negative value.
:/