Hard Light Productions Forums

Modding, Mission Design, and Coding => The FRED Workshop => Topic started by: killface on August 19, 2008, 10:48:05 pm

Title: Killing the engines
Post by: killface on August 19, 2008, 10:48:05 pm

The latest in a long string of embarassing questions...

How do I "turn off" the engine glow effect?  My idea is to have a mission where the player can press a key and essentially shut down the fighter - including its engines - and "drift" (via use-ai) towards a specific waypoint to avoid detection.  I need to get those damn engines to stop glowing.
Title: Re: Killing the engines
Post by: Droid803 on August 19, 2008, 10:51:56 pm
sabotage the engine subsystem. as in, blow it up.
Title: Re: Killing the engines
Post by: Akalabeth Angel on August 19, 2008, 10:54:34 pm
sabotage the engine subsystem. as in, blow it up.

        Won't that sort of, stop the "ai" from flying the ship to wherever it needs to go?
Title: Re: Killing the engines
Post by: killface on August 19, 2008, 10:55:05 pm
Right, I know about that, but I need the ship to still be able to MOVE - albeit in a straight line under AI command - but to move without engine glow.
Title: Re: Killing the engines
Post by: Solatar on August 19, 2008, 11:10:47 pm
Have the player point towards the target, turn on glide, THEN kill the engines?
Title: Re: Killing the engines
Post by: killface on August 19, 2008, 11:17:36 pm

That sounds like it would work, but my main issue is designing a SEXP that allows me to turn the engines on and off with a single keystroke (I picked the W key).  I'm trying the "every time" arguments to absolutely no avail!
Title: Re: Killing the engines
Post by: killface on August 19, 2008, 11:33:11 pm

This is the command I'm trying with great frustration to implement.  I have to be doing something wrong...



[attachment deleted by admin]
Title: Re: Killing the engines
Post by: WMCoolmon on August 20, 2008, 02:08:44 am
Here's a version using scripting. But it won't work until my next build.

Code: [Select]
#Conditional Hooks
$Application: Freespace 2
$Keypress: w
$On Key Released: [
local player = mn.Ships['Alpha 1']

--If player is alive
if player:isValid() then
local engine = player['engine']
--And player has an engine subsystem
if engine:isValid() then
--If the keypress hasn't been used
if not g_PlayerEngineHitpoints then
--Save current engine hitpoints remaining
g_PlayerEngineHitpoints = engine.HitpointsLeft
--Set engine hitpoints to 0
engine.HitpointsLeft = 0
else
--Keypress has been used, restore player engine hitpoints
engine.HitpointsLeft = g_PlayerEngineHitpoints
--Reset stored hitpoints
g_PlayerEngineHitpoints = nil
end
end
end
]
#End
Title: Re: Killing the engines
Post by: karajorma on August 20, 2008, 01:45:01 pm

This is the command I'm trying with great frustration to implement.  I have to be doing something wrong...



There is a good possibility you simply picked the wrong key to map it to. Key-reset is noticeably twitchy about how it reacts in repeating events with every-time. 
Title: Re: Killing the engines
Post by: killface on August 20, 2008, 07:07:09 pm

Good call, it does seem to be just a problem with the 'w' key.  I think that this, plus the gliding option, will solve this issue, HOWEVER...is it possible to force the AI-controlled ships (i.e. my copilots) to use glide as well?  I want us all to go cruising through space in drift mode, no engine flames or exterior lights...
Title: Re: Killing the engines
Post by: killface on August 22, 2008, 08:33:42 am

Ok, since I now know that AI can't use glide...how about this question:

By what means or program can I edit or REMOVE the engine flow from a specific ship?  My plan is now to have my copilots change ship classes midmission, giving them the illusion of drifting while the player actually does.
Title: Re: Killing the engines
Post by: karajorma on August 22, 2008, 09:22:23 am
You'd need to extract and edit the pof file and then swap it for one with no engine subsystem. Then you can use the change-ship-class SEXP to make this work.
Title: Re: Killing the engines
Post by: killface on August 26, 2008, 05:29:44 pm

I ended up just using the custom thruster lines in the ships.tbl file, and leaving the bitmap lines blank.  This did away with all engine glow.  Then I used the change ship class trick.