Hard Light Productions Forums

Modding, Mission Design, and Coding => The FRED Workshop => Topic started by: CommanderDJ on August 26, 2010, 07:42:49 am

Title: Subsystem self-repair
Post by: CommanderDJ on August 26, 2010, 07:42:49 am
Hello,
By default, when a subsystem's integrity is low, it repairs itself over time. How can I stop this from happening? For example I want the player's engines to be at 24% without self-repair. Then I want the self-repair to kick in later, once a certain event has come true. Can I do this?
Thanks,
CommanderDJ
Title: Re: Subsystem self-repair
Post by: General Battuta on August 26, 2010, 08:46:34 am
You can use an every-time conditional on the event that sets the engine subsystem strength.
Title: Re: Subsystem self-repair
Post by: CommanderDJ on August 26, 2010, 08:53:43 am
I see. :) Then how do I turn that off when I want the engines to repair themselves?
Title: Re: Subsystem self-repair
Post by: karajorma on August 26, 2010, 09:01:31 am
You can use an every-time conditional on the event that sets the engine subsystem strength.

Wouldn't that prevent the subsystem from actually taking any further damage too?
Title: Re: Subsystem self-repair
Post by: Hippo on August 26, 2010, 09:02:55 am
not if it's
every time
  subsystem
  > X
set-subsystem-strength
  X
Title: Re: Subsystem self-repair
Post by: General Battuta on August 26, 2010, 09:16:28 am
You can use an every-time conditional on the event that sets the engine subsystem strength.

Wouldn't that prevent the subsystem from actually taking any further damage too?

See Hippo.

I see. :) Then how do I turn that off when I want the engines to repair themselves?

Simply add a 'not is-event-true-delay (your event)' to the every-time conditional.
Title: Re: Subsystem self-repair
Post by: headdie on August 26, 2010, 09:35:39 am
Is it an option for SCP to code in the ability to turn subsystem repair off in fred and SEXPs to control this behaviour mid mission
Title: Re: Subsystem self-repair
Post by: karajorma on August 26, 2010, 09:58:22 am
not if it's
every time
  subsystem
  > X
set-subsystem-strength
  X

Now try to blow up that subsystem. :p
Title: Re: Subsystem self-repair
Post by: The E on August 26, 2010, 10:01:51 am
Code: [Select]
(set-subsystem-strength
   subsystem
   ( + X 1 )
)

Or something like that would be more logical, would it not?
Title: Re: Subsystem self-repair
Post by: ReeNoiP on August 26, 2010, 10:10:17 am
Maybe this would work?

everytime
subsystem strength
< x
modify variable
sstrength=subsystem strength

everytime
subsystem strength
< x
set-subsystem-strength
sstrength+1
Title: Re: Subsystem self-repair
Post by: Scotty on August 26, 2010, 11:38:51 am
You could probably set it for:

Is-subsystem-strength
< 100
sabotage-subsystem
1%

With a huge repeat count and a delay of however long each point of regen is.  Chain it to a When-true SEXP with a chain delay of <x> where X is the time it takes to repair one point.

BUT, that wouldn't exactly work for a mission-wide blanket no-repair thing, which I'm pretty sure you're going for...
Title: Re: Subsystem self-repair
Post by: Snail on August 26, 2010, 09:14:29 pm
Uh.

Couldn't you just use a table for this? Or would it spoil the fun?
Title: Re: Subsystem self-repair
Post by: CommanderDJ on August 27, 2010, 02:18:26 am
Thanks guys, I'm just using the not is-event-true-delay for the everytime conditional. And Snail, yes, that would ruin the fun. :D
Title: Re: Subsystem self-repair
Post by: CommanderDJ on August 27, 2010, 06:47:33 am
Hey guys, I wanted to post this in another thread, but I decided it would be a waste of space, so I'll post it here.

I want the player ship to be Alpha 2. I found I cannot rename the player ship, so I created a wing of four fighters, called it alpha, and made alpha 2 the player ship. I want an alpha 4, so I kept him, but I didn't want Alphas 1 and 3, and I wanted the wingman tab thing to show that they were dead (the red circles), so I set their initial hull integrity to 0, disabled built in messages and death screams, and set them to vaporize on death. It's all fine, except when I go to the communications menu, I find there are still menu options for Alpha 1 and 3 in the ships menu, but obviously when i try and give them an order nothing happens. Is there any way to stop Alphas 1 and 3 from showing up in the comm menu?
Thanks.

CommanderDJ
Title: Re: Subsystem self-repair
Post by: headdie on August 27, 2010, 07:00:29 am
create alpha wing with the ships you want in alpha wing, select alpha 2, open the ship editor (not wing editor), click the Set as Player Ship button.

[attachment deleted by ninja]
Title: Re: Subsystem self-repair
Post by: Qent on August 27, 2010, 07:09:45 am
create alpha wing with the ships you want in alpha wing, select alpha 2, open the ship editor (not wing editor), click the Set as Player Ship button.
I created a wing of four fighters, called it alpha, and made alpha 2 the player ship.

You could go to "Player Orders" and uncheck all of those.
Title: Re: Subsystem self-repair
Post by: Scotty on August 27, 2010, 07:16:38 am
Quote
I want the player ship to be Alpha 2. I found I cannot rename the player ship, so I created a wing of four fighters, called it alpha, and made alpha 2 the player ship. I want an alpha 4, so I kept him, but I didn't want Alphas 1 and 3, and I wanted the wingman tab thing to show that they were dead (the red circles), so I set their initial hull integrity to 0, disabled built in messages and death screams, and set them to vaporize on death. It's all fine, except when I go to the communications menu, I find there are still menu options for Alpha 1 and 3 in the ships menu, but obviously when i try and give them an order nothing happens. Is there any way to stop Alphas 1 and 3 from showing up in the comm menu?
Thanks.

Instead of setting the hull integrity to zero (which works for me, dunno what to tell you), instead move them faaar away and self-destruct them.  Don't bother vaporizing them, doesn't matter too much, especially if they're out of sight behind the player.
Title: Re: Subsystem self-repair
Post by: CommanderDJ on August 27, 2010, 07:49:30 am
create alpha wing with the ships you want in alpha wing, select alpha 2, open the ship editor (not wing editor), click the Set as Player Ship button.
I created a wing of four fighters, called it alpha, and made alpha 2 the player ship.

You could go to "Player Orders" and uncheck all of those.

This worked. Thank you muchly. I'm still a FREDding n00b, but I thank the community for being so helpful towards new willing FREDders.