Knuckle Cracker

Particle Fleet => Map Makers, Ship Builders, and Coders => Topic started by: Qihao56 on April 12, 2017, 06:25:02 PM

Title: Fighter base
Post by: Qihao56 on April 12, 2017, 06:25:02 PM
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.
Title: Re: [Redacted]
Post by: FOXX on April 13, 2017, 08:34:20 AM
For really helping you we need more info i'm afraid.
Title: Re: [Redacted]
Post by: GoodMorning on April 13, 2017, 08:54:49 AM
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.
Title: Re: [Redacted]
Post by: Qihao56 on May 01, 2017, 05:33:28 PM
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
Title: Re: [Redacted]
Post by: GoodMorning on May 01, 2017, 08:34:06 PM
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
Title: Re: [Redacted]
Post by: Qihao56 on May 10, 2017, 12:19:26 PM
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.
Title: Re: [Redacted]
Post by: GoodMorning on May 10, 2017, 07:49:37 PM
That would be this thread, would it not?

You might want to change the title, however.
Title: Re: [Redacted]
Post by: Qihao56 on May 13, 2017, 06:55:58 PM
Yea I probably should


Remind me how to do that again
Title: Re: [Redacted]
Post by: Nicant on May 13, 2017, 10:36:17 PM
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.
Title: Re: [Redacted]
Post by: tornado on May 14, 2017, 12:28:28 PM
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.
Title: Re: Fighter base
Post by: Qihao56 on May 15, 2017, 05:12:23 PM
Alright now lets start assembling a flight pattern for the fighters
Any suggestions or prebuilt code
Title: Re: Fighter base
Post by: Nicant on May 15, 2017, 08:54:40 PM
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 (https://knucklecracker.com/forums/index.php?topic=24842.0) around the bottom of the post
Title: Re: Fighter base
Post by: GoodMorning on May 15, 2017, 09:27:55 PM
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.
Title: Re: Fighter base
Post by: Qihao56 on May 17, 2017, 10:37:57 AM
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