Imagine the scenario where you have a large ship that has a large modular area. You buy different special containers to use there - and your ship gets swapped out so it can change to an appropriate graphic to represent the new module. Now some of these modules are actualy ships. Like a fighter but bigger. Again, I can swap out the player's ship and use a new graphic, and even take advantage of the "key carried extra frames" so when you launch the ship, it actually looks like it physicaly seperates.
This is neat enough, but then I decided it would be much cooler if you could choose whitch portion you could pilot.
-
Fly the main ship and launch the carried ship like a fighter.
-
Control the fighter while leaving the main ship behind. Then you can come back to the main ship again, and if you die you can fly the escape ship back to your main ship.
Most of this works pretty well - untill you have to use the escape ship where the main ship becomes neutral. I have a way around this but it's ugly.
-----
I'm using an abortable mission to control whether you want to pilot the ship or the fighter.
I've also made extensive use of "fire only with key carried" weapons.
Basicaly, weapons are split between those that can go on the fighter, and those that can go on the main ship. And every weapon has a duplicate version for when you are piloting the ship or the fighter - the "fire only with key carried" is the only difference.
The effect is this:
When you are piloting the main ship, and the fighter is docked, you get access to both fighter and ship weapons (this large "fighter" is carried outside of the main ship, not in a harger, so it's concievable it could use its weapons.)
All the fighter weapons only fire if the fighter is present, so the moment you launch it, you only have your main ship weapons.
Now, at some point you may wish to fly the fighter.
You abort the "Transfer to Fighter" mission and a couple seconds later it checks to make sure the fighter is docked and then swaps your ship.
Visually, nothing changes yet as you haven't launched yet. Behind the senes, you have become the fighter with "key carried sprites" that look like the combined ship, while also getting a bay and a carried ship - so basically you are now carring the main ship, but it looks the other way around.
All your weapons have been swapped for their duplicates and the "carried main ship" outfit is also a speed/turning/accel mod to make your fighter fly just like the main ship.
You still have access to all your weapons, until you "launch" (really launching the main ship) and then you only can fire the fighter weapons. This launch effectively removes the speed/turn/accel peanalty while also changing your sprites to look like the fighter.
Here I found it necessary to use a special main ship with 0 speed. Otherwise it would fly in formation with you at fighter like speed.
So when you want to come back, you recall your main ship, then fly to it.
Things get more complicated when you die in the fighter. I had to add a way to remeber what outfits you had because you can't transfer then to the escape ship. So now the escape ship gets a "Rescue Me" mission that gives you all your outfits back including the bay for the main ship. This should have allow you to go scoop it back up.
But no. Your main ship has abandoned you when your ship blew up, never mind that you escaped.
So now I have the problem. The rescue me mission can easily swap you back into the main ship, sans fighter. But now there is still the neutral main ship still sitting in the system, as if suddenly poping back into your main ship wasn't jarring enough. And becaue he had to get 0 speed, he's not going anywhere, either.
What do you think? Is this an acceptable hack? Or is there another way to go about this?
Here is a sample plug.
It is very crude, and not without problems. However, most of the complexity and problems relate to trying to remember your outfits when you die in the fighter.
I guess I can scrap the "fly the escape ship back and try again" aspect, but that's part of the coolness. Any ideas?
- Land on the planet, while trying not to laugh at the graphics.
- pick up the mission in the computer
- buy a fighter, notice it adds the weapons it comes with.
- test thing out in the main ship pilot role. When you want to switch, abort the mission in you active mission box.
- There is a self destruct weapon to you can test dying.
Fly the Fighter Test.zip (216 K)