Fighter base

Started by Qihao56, April 12, 2017, 06:25:02 PM

Previous topic - Next topic

Qihao56

Hello everyone, I would like some help with this project, right now it is classified, however I need some help with it as in can anyone help me make a custom carrier module, I have the images ready.

FOXX

For really helping you we need more info i'm afraid.
The FPAF
For My Maps and Ships!
Including  CUSTOM MODULE MAPS & SHIPS

GoodMorning

Let's see... From your previous posts and the general pattern of fighter bases, you will need:

1. The standard custom module scripts.
2. A fighter-spawner script to be the brain of the module.
3. Another script for the fighter unit itself.
4. (Optional) Another script for the shots.

(1) is done, (2) is fairly simple, (3) is rather more difficult, (4) is straightforward.
A narrative is a lightly-marked path to another reality.

Qihao56

Here are what I'm looking for: A script so the fighters can work, it is supposed to be a MASSIVELY more powerful than the vanilla one, it's role is to be usable in bigger vessels or be a slightly more reasonable fighter base, I might make a separate post so people can use this.

Fighter specs: 2 guns, each loaded with 100 bullets that does 4 damage, 2 fighters per base and each fighter costing 40 energy to rearm

GoodMorning

I really do encourage you to at least try to do this yourself. I have written some (bad, skeleton) code to start you off. See also the custom modules thread. The project you have decided to start with is far more complicated than anything used in the Story or Inception missions. This code is bad due to being unclear in places and this browser having an alternate use for the "tab" key. (Yes, I could copy/paste the tab character in from elsewhere, but that feels like work, and PRPL should feel like fun :) .)


#Fighter
once
10 ->Range
100 ->Shots
endonce

@FighterMovement

@FiringLogic
@FiringLogic

Self <-Shots eq0 if Self 0 DestroyUnit endif

:FighterMovement
#Your turn

:FiringLogic
<-Shots eq0 if return endif
CurrentCoords <-Range Self GetUnitIsEnemy not 0 0 0 0 GetNearestTarget dup -1 eq if pop return endif
"CannonShot" CurrentCoords CreateUnit ->Shot <-Shot swap <-Shot dup 4 SetUnitMaxHealth 4 SetUnitHealth
Self GetUnitIsEnemy InitCannonShot
<-Shots 1 sub ->Shots

:awake
#Set graphics here



#Base

#Change images to suit your needs here, see other custom modules for examples.

<-Built not if return endif
once
-1 ->FighterA -1 ->FighterB
endonce

<-FighterA -1 eq <-FighterA GetUnitIsDestroyed or if
@CreateFighter ->FighterA
endif

<-FighterB -1 eq <-FighterB GetUnitIsDestroyed or if
@CreateFighter ->FighterB
endif

:CreateFighter
<-Ship GetShipEnergy 40 lt if -1 return endif
<-Ship <-Ship GetShipEnergy 40 sub SetShipEnergy
"PRPLCORE" CurrentCoords CreateUnit dup "FighterUnit.prpl" AddScriptToUnit
A narrative is a lightly-marked path to another reality.

Qihao56

Thanks, it's something i can start with, I also might start a post with a main purpose to finish this module and make it better.

GoodMorning

That would be this thread, would it not?

You might want to change the title, however.
A narrative is a lightly-marked path to another reality.

Qihao56

#7
Yea I probably should


Remind me how to do that again

Nicant

Quote from: Qihao56 on May 13, 2017, 06:55:58 PM
Yea I probably should


Remind me how to do that again

Scroll all the way to the top of this post and press modify. There, you can change the title.
CW4 hype!!

tornado

Quote from: GoodMorning on May 01, 2017, 08:34:06 PM
... and PRPL should feel like fun :) .)

So this is where I've been going wrong.
Now CEO of Particular Endeavors. http://knucklecracker.com/forums/index.php?topic=23752.new#new
We apologize for all inconveniences that we caused.
Quotefirst, you have to imagine a very big box, fitting inside a very samll box.
then, you have to build one

Qihao56

Alright now lets start assembling a flight pattern for the fighters
Any suggestions or prebuilt code

Nicant

To start, you need a way of the fighter moving. GoodMorning has made a boilerplate code for the basics of the fighter moving. You can find it HERE around the bottom of the post
CW4 hype!!

GoodMorning

Somewhere, there is a thread from when someone was CRPL-ing an airstrip. This involved discussion about everything from turn angles to waypoints. The existing PRPL fighters have a simplified system, probably to allow a fighter to land on a retreating Carrier.

Since you wanted fighters specifically designed to eclipse every in-game weapon, you probably don't care too much about exact movements, minimum turn radii, stall speeds, and waypoints. Therefore, you will probably want to queue a move to your target, shooting all the way, and with an acceleration/deceleration profile which brings you to a halt at the target. You will then repeat this until you run out of ammunition, and turn for home. Move to a point a little way out from the end of the airstrip, and then land by moving along the airstrip axis (at this point your fighter moves as if it were part of the ship) and decelerating to a halt at the end. Fade out.

If you want better dynamics, you could limit to one fighter at a time, and allow it to land on either end of the airstrip. Further, adding a minimum turn rate (velocity dependent) and a minimum speed could make for an interesting unit, as it would limit the base-ship movement during the landing sequence. That is, if the airstrip turns too much, the fighter would need to break off and come around again. Making the player pay to rebuild it if it runs out of "fuel" could be an interesting extension.
A narrative is a lightly-marked path to another reality.

Qihao56

Hmm, sounds interesting, however, im just gonna focus on the basics of the fighter
Im looking for a slightly more realistic fighter strip, so the ammunition and cost is going to go up by quite a bit. the only thing that will be different (or have a big difference) from vanilla CV is that it will have a much longer range giving it a proper role of "aircraft carrier"
so energy should cost around 70-90 per fighter for 50 munitions on 2 guns with a fighter range of 300 or 400