Hard Light Productions Forums

Modding, Mission Design, and Coding => The FRED Workshop => Topic started by: Scourge of Ages on April 22, 2010, 12:31:56 am

Title: Adding a ship to a wing
Post by: Scourge of Ages on April 22, 2010, 12:31:56 am
Is it possible using existing means to add a fresh fighter to an existing wing, without needing the whole wing to be wiped out first? For example: Any way to trickle reinforcements to Alpha wing? Or to reinforce Alpha wing at all?

If it doesn't exist, and if it's possible, I'd like to suggest an "add ship to wing" sexp.
Title: Re: Adding a ship to a wing
Post by: FUBAR-BDHR on April 22, 2010, 01:38:00 am
Yea if the wing has less then 6 fighters per wave you just set the threshold.  A wing with 4 fighters and a threshold of 2 will add fighters every time 2 are destroyed. 
Title: Re: Adding a ship to a wing
Post by: headdie on April 22, 2010, 03:00:02 am
Yea if the wing has less then 6 fighters per wave you just set the threshold.  A wing with 4 fighters and a threshold of 2 will add fighters every time 2 are destroyed. 

i didnt think you could use waves with the player wing
Title: Re: Adding a ship to a wing
Post by: FUBAR-BDHR on April 22, 2010, 03:38:57 am
OK then what you want to do is fake it.  There are a couple of ways to do it.  First if loadout screen isn't important just make Alpha 2 3 4 etc each separate wings.  Alpha 2 gets destroyed another Alpha 2 arrives.  There is a setting to hide the name of the ship. 

Another way is to use a second fake Alpha wing called Alpha#<whatever>  Have this wing set to a certain number of ships in the real Alpha destroyed.

I'm sure there are some other ways to fake it as well.  Possibly the create-ship sexp but never tried doing it that way. 
Title: Re: Adding a ship to a wing
Post by: Scourge of Ages on April 23, 2010, 02:30:02 am
Ha ha! Thanks for the help. The reason I ask is because I want exactly three fresh wingmates appear as part of your wing in the "wingmen" box.

I did some experimenting and:
-You cannot use waves and thresholds with the wing the player is part of. However, if you assign the player to any ship other than, say alpha wing, you can enable waves for alpha, and then make player Alpha 1 again. And it works-ish. When reinforcements come, a whole wing of them comes all at once and they don't display correctly on the "wingmen" spot on your HUD.
-I tried ship-create, but it doesn't let you create a ship as part of a wing, so that's not what I need right now.
-Looks like the best possible solution is to make the player part of Alpha# and the rest of the wing which arrives later Alpha wing.

Does any coder know if it would be possible to make an add-ship-to-wing sexp?
Title: Re: Adding a ship to a wing
Post by: karajorma on April 23, 2010, 03:27:11 am
I very much doubt it would be worth the effort to code it in. The amount of work required is likely to be surprisingly high because the game makes a lot of assumptions that all members of a wave arrive at the same time.
Title: Re: Adding a ship to a wing
Post by: Scourge of Ages on April 24, 2010, 01:38:43 am
"Surprisingly high."

That's what I expected. Too bad things can't always be simple. Thanks!

EDIT: Figured out something that'll work. Player ship is named Alpha#p 1, it's not in a wing. Alpha wing jumps in whenever, all four ships.
Alpha 1 is invisible, stealthed, friendly stealthed, no arrival, no scream, ignored, built in messages disabled, and ship name hidden. It's also about a million meters off to one side. Set Alpha wings initial orders to protect Alpha#p 1.
SEXP: When Alpha 1 arrives -> ship-vaporize -> Alpha 1.

Bam. Three fighters, named Alpha 2, 3, and 4. They appear in the "wingmen" window in the correct spots and follow your commands, just like if you were Alpha 1. And they warp in whenever you want them to.
Title: Re: Adding a ship to a wing
Post by: FUBAR-BDHR on April 25, 2010, 03:31:43 pm
And you can do this without getting an error message about ship not being part of Alpha wing?  Those warnings exist for a reason. 
Title: Re: Adding a ship to a wing
Post by: Scotty on April 25, 2010, 03:34:26 pm
There are warnings for that?  I was FREDing a mission a few months ago where the player was Beta 3 or something like that, and the whole thing worked fine with no errors.
Title: Re: Adding a ship to a wing
Post by: FUBAR-BDHR on April 25, 2010, 03:59:25 pm
Beta 3 is fine as long as Beta is one of the 3 wings in the loadout.  I believe the actual message is Player must be part of Alpha Beta or Gamma wing. 
Title: Re: Adding a ship to a wing
Post by: Scourge of Ages on April 25, 2010, 07:09:23 pm
Yes, FRED does very much throw a fit about that. But the mission saves, and it works fine in game. Something I didn't mention is that with my first method, your ship doesn't show up in the "wingmen" box at all; Alpha 2, 3, and 4 are the only dots there, and in A1's spot, there is nothing.

A workaround is to not vaporize the real Alpha 1. Instead, make sure that Alpha wing doesn't have a hotkey (f5), and to make a sabotage-subsystem (hull) sexp that happens when the player ship is damaged to <50%. Now, as far as you could possibly tell, the player Alpha#p 1 is Alpha 1.

EDIT: Except, that any loadout you've selected for "Alpha 1" won't work, as far as I know. You would either have to use the custom wing names thing to add Alpha#p wing, or else make this a scamble mission.
Title: Re: Adding a ship to a wing
Post by: karajorma on April 26, 2010, 06:04:36 am
Or use the get and set weapon SEXPs to set Alpha1#p to whatever Alpha 1 has. :p
Title: Re: Adding a ship to a wing
Post by: Scourge of Ages on April 26, 2010, 09:08:58 pm
Or use the get and set weapon SEXPs to set Alpha1#p to whatever Alpha 1 has. :p
So that DOES exist! I was thinking of something like that, but I wasn't able to find it. Awesome!