Hard Light Productions Forums

Modding, Mission Design, and Coding => The FRED Workshop => Topic started by: PotzUK on August 01, 2006, 08:48:34 am

Title: Keeping the ships
Post by: PotzUK on August 01, 2006, 08:48:34 am
Quick and easy question... is there a way to keep the chosen ship from Mission A to Mission B, with the ammo and damage amounts without having to use Red Alert?

I'm doing a mission where you follow you cap ship into subspace, so you shouldn't be able to change your ship or load-out, and as it's a low-key mission I dont need Red alert...

Cheers :)

Title: Re: Keeping the ships
Post by: Colonol Dekker on August 01, 2006, 08:53:41 am
Red alert carry status?


Maybeeeeeeeeeeeeeeee.............. :nervous:
Title: Re: Keeping the ships
Post by: Shade on August 01, 2006, 09:08:53 am
You can fudge it with persistent variables. Store the needed values just before the first mission ends, then set them from the variables when the next mission starts. Then combine it with scramble so the player can't go check the loadout screen and discover your hoax before things get set properly.
Title: Re: Keeping the ships
Post by: PotzUK on August 01, 2006, 10:26:49 am
Decker : My post said I wont want to use the Red Alert function :P

Shade : Is there a how-to somewhere to show me how do set those variables?
Title: Re: Keeping the ships
Post by: Dark Hunter on August 01, 2006, 10:30:14 am
The best how-to in the world:  Karajorma's FAQ. (http://homepage.ntlworld.com/karajorma/FAQ/intro.html) Check under FredOpen help.
Title: Re: Keeping the ships
Post by: PotzUK on August 01, 2006, 10:36:37 am
Ahh - cheers :)

I've seen that before, but it didn't click.  I was expecting the sexp to be called 'set-variable'   ::)

Cheers guys
Title: Re: Keeping the ships
Post by: karajorma on August 01, 2006, 12:43:40 pm
To be honest I've got no idea what happens if you do a red-alert with no briefing set from the Mission Specs editor but that would be the first thing I'd try.
Title: Re: Keeping the ships
Post by: Axem on August 01, 2006, 12:56:04 pm
That would only work if no one actually enters subspace ('cept the player). Red alert keeps track if a ship left, so if it leaves and you red alert, it won't be there next time.
Title: Re: Keeping the ships
Post by: karajorma on August 01, 2006, 01:10:07 pm
Good point. Shows how often I use Red-Alert these days :)
Title: Re: Keeping the ships
Post by: CP5670 on August 01, 2006, 06:00:16 pm
To be honest I've got no idea what happens if you do a red-alert with no briefing set from the Mission Specs editor but that would be the first thing I'd try.

I'm using this in one mission and it works as you would expect. If there aren't any other missions in between, this is a much better way to do it than messing with the persistent variables.
Title: Re: Keeping the ships
Post by: karajorma on August 02, 2006, 03:31:52 am
Yep. That's why I suggested it. It will do all the work of storing all the subsystem data for you without having to roll your own SEXPs for every ship you want to store.

As long as you only have a couple of other ships making subspace jumps I'd probably still recommend doing things that way and using PVs to fill in the gaps.
Title: Re: Keeping the ships
Post by: PotzUK on August 02, 2006, 04:38:03 am
Thanks guys, i'll give it a shot.

I only have the cap ship and 3 wingmates to worry about, so if I have to use PVs, then it shouldn't be too much of a headache :)
Title: Re: Keeping the ships
Post by: Galemp on March 12, 2016, 02:46:13 pm
:necro:

I'd like to confirm this is still the case: if I have a ship in a prior mission that I want to have identical status in a later mission, I need to record everything about it in variables? So I'd need one persistent variable for every subsystem?

If so I think I'd rather cut it down by just recording the hull strength and critical subsystems, like beam turrets, then using subsys-set-random for the rest. Consider this a feature request for a carry-status SEXP that works identical to Red Alert.
Title: Re: Keeping the ships
Post by: FrikgFeek on March 12, 2016, 03:44:41 pm
Wait, don't we have the ship save/load script that can easily carry over ships between missions even if they're not red-alert?
Title: Re: Keeping the ships
Post by: niffiwan on March 12, 2016, 05:48:00 pm
yep: http://www.hard-light.net/forums/index.php?topic=74716.0
Title: Re: Keeping the ships
Post by: Galemp on March 20, 2016, 02:17:33 pm
I've inspected the script and it seems to have a serious drawback:

Quote
saveship('shipname'):
In case the ship is destroyed, departed or not existing (including not arrived) it does save this status.

loadship('shipname'):
If the ship has departed, was destroyed before saving or not existent while saving, it uses ship-vanish on it.

Here's the issue: I want to save the status of the ship when it departs, so the player can chase it into a future mission and its status will be the same. This script seems to treat departed ships as nonexistent.

Is there a script that can save the status of specified ships either when they are departed or destroyed, or when the mission ends? Otherwise I'll probably use persistent variables when the ship has triggered its departure condition and reaches 40 m/s, has been destroyed, or when the RTB directive has been given and the player presses ALT-J.
Title: Re: Keeping the ships
Post by: Phantom Hoover on March 20, 2016, 02:30:35 pm
Couldn't you just save the ship immediately before it departs?
Title: Re: Keeping the ships
Post by: MatthTheGeek on March 20, 2016, 04:32:53 pm
Unless I'm wrong, as far as the engine is concerned, a departed ship doesn't exist anymore - it's got nothing to do with the script or any other way around, the engine simply can't make up info about ships that don't exist.

Like PH said, you'd have to save right before the ship departs.
Title: Re: Keeping the ships
Post by: Thedespot on March 20, 2016, 05:54:22 pm
Wheres the welcome beam speech
Title: Re: Keeping the ships
Post by: Galemp on March 21, 2016, 12:30:01 pm
Wheres the welcome beam speech

Not here... :wtf:

Couldn't you just save the ship immediately before it departs?

:doh: Of course... I'll set the script to evaluate BEFORE it leaves, same as I was doing with variables. Thanks.