"barrelMode":"ALTERNATING", # or LINKED. whether barrels fire at the same time or alternate.
Yeah, beams ignore the "barrelMode" setting. To answer the original question: not possible.Is there any possibility to make a way to allow the creation of minigun lasers? Pretty much an assault chain gun but with lasers?
Yeah, beams ignore the "barrelMode" setting. To answer the original question: not possible.Is there any possibility to make a way to allow the creation of minigun lasers? Pretty much an assault chain gun but with lasers?
Yeah, beams ignore the "barrelMode" setting. To answer the original question: not possible.Is there any possibility to make a way to allow the creation of minigun lasers? Pretty much an assault chain gun but with lasers?
Like a burst PD chain gun?
Yeah, beams ignore the "barrelMode" setting. To answer the original question: not possible.Is there any possibility to make a way to allow the creation of minigun lasers? Pretty much an assault chain gun but with lasers?
Like a burst PD chain gun?
yes! :D
Can it also rapid fire too? Like a burst delay of 0.05 and a small spread?
Aww darn, had plans for a hull stripper, rapid fire, wide spread ballistic energy weapon that works like a lightning arc gun that wipes out armorCan it also rapid fire too? Like a burst delay of 0.05 and a small spread?
Rapid fire, sure. No spread for beam weapons, though.
Ah. Probably better off with a pulse laser type, then. If you make the projectiles really long, it almost looks like beams. Has an interesting look to it, anyway.Shall have to try, and the possibility of beams applying force to objects it hits? Like a massive bomb knocking back ships?
No - not something the engine supports.Ah bugger, and my old beam shape suggestion a while back that you liked?
Link?Shall take a look and edit this post
Oh. I'm fairly certain whatever I told you boiled down to "interesting, but no" :)Ah, okie dokie
Oh, ok, fair enough.Regardless, my apologies, and is there to be a new upcoming features list? Or what do you plan on doing for the next release? :)
What factor determine the radius as well as the destruction power of such ship?
simply making it a capital class does not do the job ???
if (station.getName().toString().equals("Corporate HQ")){
restockShips(aMothFleet,tShips);
restockFighters(aMothFleet,tWings);
What factor determine the radius as well as the destruction power of such ship?
simply making it a capital class does not do the job ???
Flux capacity for the explosion's damage and collisionRadius for its radius.
@Plasmatic: Eugh. That's what you call "infinite recursion", not sure what's actually causing it in this case, though. Looking at the code, doesn't seem possible.
What factor determine the radius as well as the destruction power of such ship?
simply making it a capital class does not do the job ???
Flux capacity for the explosion's damage and collisionRadius for its radius.
@Plasmatic: Eugh. That's what you call "infinite recursion", not sure what's actually causing it in this case, though. Looking at the code, doesn't seem possible.
I got another very intresting question..
what would cause this?
(WARNING, MASSIVE WALL OF TEXT)Just to give you an idea, in the log file that continues for 1017 lines!Spoilerat java.util.Arrays.mergeSort(Arrays.java:1270)
at java.util.Arrays.mergeSort(Arrays.java:1281)
at java.util.Arrays.mergeSort(Arrays.java:1282)
at java.util.Arrays.mergeSort(Arrays.java:1281)
at java.util.Arrays.sort(Arrays.java:1210)
at java.util.Collections.sort(Collections.java:159)
at com.fs.starfarer.campaign.fleet.FleetData.for.return$Object(Unknown Source)
at com.fs.starfarer.campaign.fleet.FleetData.syncIfNeeded(Unknown Source)
at com.fs.starfarer.campaign.fleet.FleetData.getHangarSpace(Unknown Source)
at com.fs.starfarer.campaign.fleet.FleetData.Ò0Ö000(Unknown Source)
at com.fs.starfarer.campaign.fleet.FleetData.syncIfNeeded(Unknown Source)
at com.fs.starfarer.campaign.fleet.FleetData.getHangarSpace(Unknown Source)
at com.fs.starfarer.campaign.fleet.FleetData.Ò0Ö000(Unknown Source)
at com.fs.starfarer.campaign.fleet.FleetData.syncIfNeeded(Unknown Source)
at com.fs.starfarer.campaign.fleet.FleetData.getHangarSpace(Unknown Source)
at com.fs.starfarer.campaign.fleet.FleetData.Ò0Ö000(Unknown Source)
at com.fs.starfarer.campaign.fleet.FleetData.syncIfNeeded(Unknown Source)
at com.fs.starfarer.campaign.fleet.FleetData.getHangarSpace(Unknown Source)
at com.fs.starfarer.campaign.fleet.FleetData.Ò0Ö000(Unknown Source)
at com.fs.starfarer.campaign.fleet.FleetData.syncIfNeeded(Unknown Source)
at com.fs.starfarer.campaign.fleet.FleetData.getHangarSpace(Unknown Source)
at com.fs.starfarer.campaign.fleet.FleetData.Ò0Ö000(Unknown Source)
at com.fs.starfarer.campaign.fleet.FleetData.syncIfNeeded(Unknown Source)
at com.fs.starfarer.campaign.fleet.FleetData.getHangarSpace(Unknown Source)
at com.fs.starfarer.campaign.fleet.FleetData.Ò0Ö000(Unknown Source)
at com.fs.starfarer.campaign.fleet.FleetData.syncIfNeeded(Unknown Source)
at com.fs.starfarer.campaign.fleet.FleetData.getHangarSpace(Unknown Source)
at com.fs.starfarer.campaign.fleet.FleetData.Ò0Ö000(Unknown Source)
at com.fs.starfarer.campaign.fleet.FleetData.syncIfNeeded(Unknown Source)
at com.fs.starfarer.campaign.fleet.FleetData.getHangarSpace(Unknown Source)
at com.fs.starfarer.campaign.fleet.FleetData.Ò0Ö000(Unknown Source)
at com.fs.starfarer.campaign.fleet.FleetData.syncIfNeeded(Unknown Source)
at com.fs.starfarer.campaign.fleet.FleetData.getHangarSpace(Unknown Source)
at com.fs.starfarer.campaign.fleet.FleetData.Ò0Ö000(Unknown Source)
at com.fs.starfarer.campaign.fleet.FleetData.syncIfNeeded(Unknown Source)
at com.fs.starfarer.campaign.fleet.FleetData.getHangarSpace(Unknown Source)
at com.fs.starfarer.campaign.fleet.FleetData.Ò0Ö000(Unknown Source)
at com.fs.starfarer.campaign.fleet.FleetData.syncIfNeeded(Unknown Source)
at com.fs.starfarer.campaign.fleet.FleetData.getHangarSpace(Unknown Source)
at com.fs.starfarer.campaign.fleet.FleetData.Ò0Ö000(Unknown Source)
at com.fs.starfarer.campaign.fleet.FleetData.syncIfNeeded(Unknown Source)
at com.fs.starfarer.campaign.fleet.FleetData.getHangarSpace(Unknown Source)
at com.fs.starfarer.campaign.fleet.FleetData.Ò0Ö000(Unknown Source)
at com.fs.starfarer.campaign.fleet.FleetData.syncIfNeeded(Unknown Source)
at com.fs.starfarer.campaign.fleet.FleetData.getHangarSpace(Unknown Source)
at com.fs.starfarer.campaign.fleet.FleetData.Ò0Ö000(Unknown Source)
at com.fs.starfarer.campaign.fleet.FleetData.syncIfNeeded(Unknown Source)
at com.fs.starfarer.campaign.fleet.FleetData.getHangarSpace(Unknown Source)
at com.fs.starfarer.campaign.fleet.FleetData.Ò0Ö000(Unknown Source)
at com.fs.starfarer.campaign.fleet.FleetData.syncIfNeeded(Unknown Source)
at com.fs.starfarer.campaign.fleet.FleetData.getHangarSpace(Unknown Source)
at com.fs.starfarer.campaign.fleet.FleetData.Ò0Ö000(Unknown Source)
at com.fs.starfarer.campaign.fleet.FleetData.syncIfNeeded(Unknown Source)
at com.fs.starfarer.campaign.fleet.FleetData.getHangarSpace(Unknown Source)
at com.fs.starfarer.campaign.fleet.FleetData.Ò0Ö000(Unknown Source)
at com.fs.starfarer.campaign.fleet.FleetData.syncIfNeeded(Unknown Source)
at com.fs.starfarer.campaign.fleet.FleetData.getHangarSpace(Unknown Source)
at com.fs.starfarer.campaign.fleet.FleetData.Ò0Ö000(Unknown Source)
at com.fs.starfarer.campaign.fleet.FleetData.syncIfNeeded(Unknown Source)
at com.fs.starfarer.campaign.fleet.FleetData.getHangarSpace(Unknown Source)
at com.fs.starfarer.campaign.fleet.FleetData.Ò0Ö000(Unknown Source)
at com.fs.starfarer.campaign.fleet.FleetData.syncIfNeeded(Unknown Source)
at com.fs.starfarer.campaign.fleet.FleetData.getHangarSpace(Unknown Source)
at com.fs.starfarer.campaign.fleet.FleetData.Ò0Ö000(Unknown Source)
at com.fs.starfarer.campaign.fleet.FleetData.syncIfNeeded(Unknown Source)
at com.fs.starfarer.campaign.fleet.FleetData.getHangarSpace(Unknown Source)
at com.fs.starfarer.campaign.fleet.FleetData.Ò0Ö000(Unknown Source)
at com.fs.starfarer.campaign.fleet.FleetData.syncIfNeeded(Unknown Source)
at com.fs.starfarer.campaign.fleet.FleetData.getHangarSpace(Unknown Source)
at com.fs.starfarer.campaign.fleet.FleetData.Ò0Ö000(Unknown Source)
at com.fs.starfarer.campaign.fleet.FleetData.syncIfNeeded(Unknown Source)
at com.fs.starfarer.campaign.fleet.FleetData.getHangarSpace(Unknown Source)
at com.fs.starfarer.campaign.fleet.FleetData.Ò0Ö000(Unknown Source)
at com.fs.starfarer.campaign.fleet.FleetData.syncIfNeeded(Unknown Source)
at com.fs.starfarer.campaign.fleet.FleetData.getHangarSpace(Unknown Source)
at com.fs.starfarer.campaign.fleet.FleetData.Ò0Ö000(Unknown Source)
at com.fs.starfarer.campaign.fleet.FleetData.syncIfNeeded(Unknown Source)
at com.fs.starfarer.campaign.fleet.FleetData.getHangarSpace(Unknown Source)
at com.fs.starfarer.campaign.fleet.FleetData.Ò0Ö000(Unknown Source)
at com.fs.starfarer.campaign.fleet.FleetData.syncIfNeeded(Unknown Source)
at com.fs.starfarer.campaign.fleet.FleetData.getHangarSpace(Unknown Source)
at com.fs.starfarer.campaign.fleet.FleetData.Ò0Ö000(Unknown Source)
at com.fs.starfarer.campaign.fleet.FleetData.syncIfNeeded(Unknown Source)
at com.fs.starfarer.campaign.fleet.FleetData.getHangarSpace(Unknown Source)
at com.fs.starfarer.campaign.fleet.FleetData.Ò0Ö000(Unknown Source)
at com.fs.starfarer.campaign.fleet.FleetData.syncIfNeeded(Unknown Source)
at com.fs.starfarer.campaign.fleet.FleetData.getHangarSpace(Unknown Source)
at com.fs.starfarer.campaign.fleet.FleetData.Ò0Ö000(Unknown Source)
at com.fs.starfarer.campaign.fleet.FleetData.syncIfNeeded(Unknown Source)
at com.fs.starfarer.campaign.fleet.FleetData.getHangarSpace(Unknown Source)
at com.fs.starfarer.campaign.fleet.FleetData.Ò0Ö000(Unknown Source)
at com.fs.starfarer.campaign.fleet.FleetData.syncIfNeeded(Unknown Source)
at com.fs.starfarer.campaign.fleet.FleetData.getHangarSpace(Unknown Source)
at com.fs.starfarer.campaign.fleet.FleetData.Ò0Ö000(Unknown Source)
at com.fs.starfarer.campaign.fleet.FleetData.syncIfNeeded(Unknown Source)
at com.fs.starfarer.campaign.fleet.FleetData.getHangarSpace(Unknown Source)
at com.fs.starfarer.campaign.fleet.FleetData.Ò0Ö000(Unknown Source)
at com.fs.starfarer.campaign.fleet.FleetData.syncIfNeeded(Unknown Source)
at com.fs.starfarer.campaign.fleet.FleetData.getHangarSpace(Unknown Source)
at com.fs.starfarer.campaign.fleet.FleetData.Ò0Ö000(Unknown Source)
at com.fs.starfarer.campaign.fleet.FleetData.syncIfNeeded(Unknown Source)
at com.fs.starfarer.campaign.fleet.FleetData.getHangarSpace(Unknown Source)
at com.fs.starfarer.campaign.fleet.FleetData.Ò0Ö000(Unknown Source)
at com.fs.starfarer.campaign.fleet.FleetData.syncIfNeeded(Unknown Source)
at com.fs.starfarer.campaign.fleet.FleetData.getHangarSpace(Unknown Source)
at com.fs.starfarer.campaign.fleet.FleetData.Ò0Ö000(Unknown Source)
at com.fs.starfarer.campaign.fleet.FleetData.syncIfNeeded(Unknown Source)
at com.fs.starfarer.campaign.fleet.FleetData.getHangarSpace(Unknown Source)
at com.fs.starfarer.campaign.fleet.FleetData.Ò0Ö000(Unknown Source)
at com.fs.starfarer.campaign.fleet.FleetData.syncIfNeeded(Unknown Source)
at com.fs.starfarer.campaign.fleet.FleetData.getHangarSpace(Unknown Source)
at com.fs.starfarer.campaign.fleet.FleetData.Ò0Ö000(Unknown Source)
at com.fs.starfarer.campaign.fleet.FleetData.syncIfNeeded(Unknown Source)
at com.fs.starfarer.campaign.fleet.FleetData.getHangarSpace(Unknown Source)
at com.fs.starfarer.campaign.fleet.FleetData.Ò0Ö000(Unknown Source)
at com.fs.starfarer.campaign.fleet.FleetData.syncIfNeeded(Unknown Source)
at com.fs.starfarer.campaign.fleet.FleetData.getHangarSpace(Unknown Source)
at com.fs.starfarer.campaign.fleet.FleetData.Ò0Ö000(Unknown Source)
at com.fs.starfarer.campaign.fleet.FleetData.syncIfNeeded(Unknown Source)
at com.fs.starfarer.campaign.fleet.FleetData.getHangarSpace(Unknown Source)
at com.fs.starfarer.campaign.fleet.FleetData.Ò0Ö000(Unknown Source)
at com.fs.starfarer.campaign.fleet.FleetData.syncIfNeeded(Unknown Source)
at com.fs.starfarer.campaign.fleet.FleetData.getHangarSpace(Unknown Source)
at com.fs.starfarer.campaign.fleet.FleetData.Ò0Ö000(Unknown Source)
at com.fs.starfarer.campaign.fleet.FleetData.syncIfNeeded(Unknown Source)
at com.fs.starfarer.campaign.fleet.FleetData.getHangarSpace(Unknown Source)
at com.fs.starfarer.campaign.fleet.FleetData.Ò0Ö000(Unknown Source)
at com.fs.starfarer.campaign.fleet.FleetData.syncIfNeeded(Unknown Source)
at com.fs.starfarer.campaign.fleet.FleetData.getHangarSpace(Unknown Source)
at com.fs.starfarer.campaign.fleet.FleetData.Ò0Ö000(Unknown Source)
at com.fs.starfarer.campaign.fleet.FleetData.syncIfNeeded(Unknown Source)
at com.fs.starfarer.campaign.fleet.FleetData.getHangarSpace(Unknown Source)
at com.fs.starfarer.campaign.fleet.FleetData.Ò0Ö000(Unknown Source)
at com.fs.starfarer.campaign.fleet.FleetData.syncIfNeeded(Unknown Source)
at com.fs.starfarer.campaign.fleet.FleetData.getHangarSpace(Unknown Source)
at com.fs.starfarer.campaign.fleet.FleetData.Ò0Ö000(Unknown Source)
at com.fs.starfarer.campaign.fleet.FleetData.syncIfNeeded(Unknown Source)
at com.fs.starfarer.campaign.fleet.FleetData.getHangarSpace(Unknown Source)
at com.fs.starfarer.campaign.fleet.FleetData.Ò0Ö000(Unknown Source)
at com.fs.starfarer.campaign.fleet.FleetData.syncIfNeeded(Unknown Source)
at com.fs.starfarer.campaign.fleet.FleetData.getHangarSpace(Unknown Source)
at com.fs.starfarer.campaign.fleet.FleetData.Ò0Ö000(Unknown Source)
at com.fs.starfarer.campaign.fleet.FleetData.syncIfNeeded(Unknown Source)
at com.fs.starfarer.campaign.fleet.FleetData.getHangarSpace(Unknown Source)
at com.fs.starfarer.campaign.fleet.FleetData.Ò0Ö000(Unknown Source)
at com.fs.starfarer.campaign.fleet.FleetData.syncIfNeeded(Unknown Source)
at com.fs.starfarer.campaign.fleet.FleetData.getHangarSpace(Unknown Source)
at com.fs.starfarer.campaign.fleet.FleetData.Ò0Ö000(Unknown Source)
at com.fs.starfarer.campaign.fleet.FleetData.syncIfNeeded(Unknown Source)
at com.fs.starfarer.campaign.fleet.FleetData.getHangarSpace(Unknown Source)
at com.fs.starfarer.campaign.fleet.FleetData.Ò0Ö000(Unknown Source)
at com.fs.starfarer.campaign.fleet.FleetData.syncIfNeeded(Unknown Source)
at com.fs.starfarer.campaign.fleet.FleetData.getHangarSpace(Unknown Source)
at com.fs.starfarer.campaign.fleet.FleetData.Ò0Ö000(Unknown Source)
at com.fs.starfarer.campaign.fleet.FleetData.syncIfNeeded(Unknown Source)
at com.fs.starfarer.campaign.fleet.FleetData.getHangarSpace(Unknown Source)
at com.fs.starfarer.campaign.fleet.FleetData.Ò0Ö000(Unknown Source)
at com.fs.starfarer.campaign.fleet.FleetData.syncIfNeeded(Unknown Source)
at com.fs.starfarer.campaign.fleet.FleetData.getHangarSpace(Unknown Source)
at com.fs.starfarer.campaign.fleet.FleetData.Ò0Ö000(Unknown Source)
at com.fs.starfarer.campaign.fleet.FleetData.syncIfNeeded(Unknown Source)
at com.fs.starfarer.campaign.fleet.FleetData.getHangarSpace(Unknown Source)
at com.fs.starfarer.campaign.fleet.FleetData.Ò0Ö000(Unknown Source)
at com.fs.starfarer.campaign.fleet.FleetData.syncIfNeeded(Unknown Source)
at com.fs.starfarer.campaign.fleet.FleetData.getHangarSpace(Unknown Source)
at com.fs.starfarer.campaign.fleet.FleetData.Ò0Ö000(Unknown Source)
at com.fs.starfarer.campaign.fleet.FleetData.syncIfNeeded(Unknown Source)
at com.fs.starfarer.campaign.fleet.FleetData.getHangarSpace(Unknown Source)
at com.fs.starfarer.campaign.fleet.FleetData.Ò0Ö000(Unknown Source)
at com.fs.starfarer.campaign.fleet.FleetData.syncIfNeeded(Unknown Source)
at com.fs.starfarer.campaign.fleet.FleetData.getHangarSpace(Unknown Source)
at com.fs.starfarer.campaign.fleet.FleetData.Ò0Ö000(Unknown Source)
at com.fs.starfarer.campaign.fleet.FleetData.syncIfNeeded(Unknown Source)
at com.fs.starfarer.campaign.fleet.FleetData.getHangarSpace(Unknown Source)
at com.fs.starfarer.campaign.fleet.FleetData.Ò0Ö000(Unknown Source)
at com.fs.starfarer.campaign.fleet.FleetData.syncIfNeeded(Unknown Source)
at com.fs.starfarer.campaign.fleet.FleetData.getHangarSpace(Unknown Source)
at com.fs.starfarer.campaign.fleet.FleetData.Ò0Ö000(Unknown Source)
at com.fs.starfarer.campaign.fleet.FleetData.syncIfNeeded(Unknown Source)
at com.fs.starfarer.campaign.fleet.FleetData.getHangarSpace(Unknown Source)
at com.fs.starfarer.campaign.fleet.FleetData.Ò0Ö000(Unknown Source)
at com.fs.starfarer.campaign.fleet.FleetData.syncIfNeeded(Unknown Source)
at com.fs.starfarer.campaign.fleet.FleetData.getHangarSpace(Unknown Source)
at com.fs.starfarer.campaign.fleet.FleetData.Ò0Ö000(Unknown Source)
at com.fs.starfarer.campaign.fleet.FleetData.syncIfNeeded(Unknown Source)
at com.fs.starfarer.campaign.fleet.FleetData.getHangarSpace(Unknown Source)
at com.fs.starfarer.campaign.fleet.FleetData.Ò0Ö000(Unknown Source)
at com.fs.starfarer.campaign.fleet.FleetData.syncIfNeeded(Unknown Source)
at com.fs.starfarer.campaign.fleet.FleetData.getHangarSpace(Unknown Source)
at com.fs.starfarer.campaign.fleet.FleetData.Ò0Ö000(Unknown Source)
at com.fs.starfarer.campaign.fleet.FleetData.syncIfNeeded(Unknown Source)
at com.fs.starfarer.campaign.fleet.FleetData.getHangarSpace(Unknown Source)
at com.fs.starfarer.campaign.fleet.FleetData.Ò0Ö000(Unknown Source)
at com.fs.starfarer.campaign.fleet.FleetData.syncIfNeeded(Unknown Source)
at com.fs.starfarer.campaign.fleet.FleetData.getHangarSpace(Unknown Source)
at com.fs.starfarer.campaign.fleet.FleetData.Ò0Ö000(Unknown Source)
at com.fs.starfarer.campaign.fleet.FleetData.syncIfNeeded(Unknown Source)
at com.fs.starfarer.campaign.fleet.FleetData.getHangarSpace(Unknown Source)
at com.fs.starfarer.campaign.fleet.FleetData.Ò0Ö000(Unknown Source)
at com.fs.starfarer.campaign.fleet.FleetData.syncIfNeeded(Unknown Source)
at com.fs.starfarer.campaign.fleet.FleetData.getHangarSpace(Unknown Source)
at com.fs.starfarer.campaign.fleet.FleetData.Ò0Ö000(Unknown Source)
at com.fs.starfarer.campaign.fleet.FleetData.syncIfNeeded(Unknown Source)
at com.fs.starfarer.campaign.fleet.FleetData.getHangarSpace(Unknown Source)
at com.fs.starfarer.campaign.fleet.FleetData.Ò0Ö000(Unknown Source)
at com.fs.starfarer.campaign.fleet.FleetData.syncIfNeeded(Unknown Source)
at com.fs.starfarer.campaign.fleet.FleetData.getHangarSpace(Unknown Source)
at com.fs.starfarer.campaign.fleet.FleetData.Ò0Ö000(Unknown Source)
at com.fs.starfarer.campaign.fleet.FleetData.syncIfNeeded(Unknown Source)
at com.fs.starfarer.campaign.fleet.FleetData.getHangarSpace(Unknown Source)
at com.fs.starfarer.campaign.fleet.FleetData.Ò0Ö000(Unknown Source)
at com.fs.starfarer.campaign.fleet.FleetData.syncIfNeeded(Unknown Source)
at com.fs.starfarer.campaign.fleet.FleetData.getHangarSpace(Unknown Source)
at com.fs.starfarer.campaign.fleet.FleetData.Ò0Ö000(Unknown Source)
at com.fs.starfarer.campaign.fleet.FleetData.syncIfNeeded(Unknown Source)
at com.fs.starfarer.campaign.fleet.FleetData.getHangarSpace(Unknown Source)
at com.fs.starfarer.campaign.fleet.FleetData.Ò0Ö000(Unknown Source)
at com.fs.starfarer.campaign.fleet.FleetData.syncIfNeeded(Unknown Source)
at com.fs.starfarer.campaign.fleet.FleetData.getHangarSpace(Unknown Source)
at com.fs.starfarer.campaign.fleet.FleetData.Ò0Ö000(Unknown Source)
at com.fs.starfarer.campaign.fleet.FleetData.syncIfNeeded(Unknown Source)
at com.fs.starfarer.campaign.fleet.FleetData.getHangarSpace(Unknown Source)
at com.fs.starfarer.campaign.fleet.FleetData.Ò0Ö000(Unknown Source)
at com.fs.starfarer.campaign.fleet.FleetData.syncIfNeeded(Unknown Source)
at com.fs.starfarer.campaign.fleet.FleetData.getHangarSpace(Unknown Source)
at com.fs.starfarer.campaign.fleet.FleetData.Ò0Ö000(Unknown Source)
at com.fs.starfarer.campaign.fleet.FleetData.syncIfNeeded(Unknown Source)
at com.fs.starfarer.campaign.fleet.FleetData.getHangarSpace(Unknown Source)
at com.fs.starfarer.campaign.fleet.FleetData.Ò0Ö000(Unknown Source)
at com.fs.starfarer.campaign.fleet.FleetData.syncIfNeeded(Unknown Source)
at com.fs.starfarer.campaign.fleet.FleetData.getHangarSpace(Unknown Source)
at com.fs.starfarer.campaign.fleet.FleetData.Ò0Ö000(Unknown Source)
at com.fs.starfarer.campaign.fleet.FleetData.syncIfNeeded(Unknown Source)
at com.fs.starfarer.campaign.fleet.FleetData.getHangarSpace(Unknown Source)
at com.fs.starfarer.campaign.fleet.FleetData.Ò0Ö000(Unknown Source)
at com.fs.starfarer.campaign.fleet.FleetData.syncIfNeeded(Unknown Source)
at com.fs.starfarer.campaign.fleet.FleetData.getHangarSpace(Unknown Source)
at com.fs.starfarer.campaign.fleet.FleetData.Ò0Ö000(Unknown Source)
at com.fs.starfarer.campaign.fleet.FleetData.syncIfNeeded(Unknown Source)
at com.fs.starfarer.campaign.fleet.FleetData.getHangarSpace(Unknown Source)
at com.fs.starfarer.campaign.fleet.FleetData.Ò0Ö000(Unknown Source)
at com.fs.starfarer.campaign.fleet.FleetData.syncIfNeeded(Unknown Source)
at com.fs.starfarer.campaign.fleet.FleetData.getHangarSpace(Unknown Source)
at com.fs.starfarer.campaign.fleet.FleetData.Ò0Ö000(Unknown Source)
at com.fs.starfarer.campaign.fleet.FleetData.syncIfNeeded(Unknown Source)
at com.fs.starfarer.campaign.fleet.FleetData.getHangarSpace(Unknown Source)
at com.fs.starfarer.campaign.fleet.FleetData.Ò0Ö000(Unknown Source)
at com.fs.starfarer.campaign.fleet.FleetData.syncIfNeeded(Unknown Source)
at com.fs.starfarer.campaign.fleet.FleetData.getHangarSpace(Unknown Source)
at com.fs.starfarer.campaign.fleet.FleetData.Ò0Ö000(Unknown Source)
at com.fs.starfarer.campaign.fleet.FleetData.syncIfNeeded(Unknown Source)
at com.fs.starfarer.campaign.fleet.FleetData.getHangarSpace(Unknown Source)
at com.fs.starfarer.campaign.fleet.FleetData.Ò0Ö000(Unknown Source)
at com.fs.starfarer.campaign.fleet.FleetData.syncIfNeeded(Unknown Source)
at com.fs.starfarer.campaign.fleet.FleetData.getHangarSpace(Unknown Source)
at com.fs.starfarer.campaign.fleet.FleetData.Ò0Ö000(Unknown Source)
at com.fs.starfarer.campaign.fleet.FleetData.syncIfNeeded(Unknown Source)
at com.fs.starfarer.campaign.fleet.FleetData.getHangarSpace(Unknown Source)
at com.fs.starfarer.campaign.fleet.FleetData.Ò0Ö000(Unknown Source)[close]
What factor determine the radius as well as the destruction power of such ship?
simply making it a capital class does not do the job ???
Flux capacity for the explosion's damage and collisionRadius for its radius.
@Plasmatic: Eugh. That's what you call "infinite recursion", not sure what's actually causing it in this case, though. Looking at the code, doesn't seem possible.
"id":"brburst", # this id must match what's in the spreadsheet
"specClass":"beam",
"type":"ENERGY",
"size":"MEDIUM",
"displayArcRadius":600,
"turretSprite":"graphics/weapons/arguspd_turret_base.png",
"turretGlowSprite":"graphics/weapons/arguspd_turretglow.png",
"hardpointSprite":"graphics/weapons/burstpd_hardpoint_base.png",
"hardpointGlowSprite":"graphics/weapons/burstpd_hardpoint_glow.png",
"glowColor":[190,205,52,255],
"hardpointOffsets":[12, -9, 12, 9, 12, 0],
"turretOffsets":[8, -9, 8, 9, 8, 0],
"hardpointAngleOffsets":[0, 0, 0],
"turretAngleOffsets":[0, 0, 0],
"convergeOnPoint":true,
"fringeColor":[231,251,91,175],
"coreColor":[86,96,46,255],
"darkCore":false,
"width":6.0,
"textureType":SMOOTH,
#"textureType":["graphics/fx/emp_arcs.png","graphics/fx/emp_arcs.png"],
"textureScrollSpeed":292.0,
"pixelsPerTexel":5.0,
"fireSoundOne":"beam_light_burst_1",
"fireSoundTwo":"beam_light_loop",
Is there a mod that decreases the frequency of the various supply convoys? Right now Corvus is so busy that the ships and weapons pile up faster than my green crews and I can lose them. I'd like it to feel more like a scavenger world(solarsystem?) than it currently does.
Alternatively is that something i can just edit by hand in the save file?
{
"id":"lessconvoys",
"name":"Less Frequent Convoy Spawns",
"author":"CopperCoyote",
"version":"1.0",
"description":"Lowers the amount of convoys spawned in the sector.",
"gameVersion":"0.54",
}
Good call. Was just about to post this - the Guardian-style ("convergeOnPoint") beams use the first offset as the centerline to aim along.
another question:
"explosionSpec":{"duration":2f,
what's the unit of f? frame?
another question:
"explosionSpec":{"duration":2f,
what's the unit of f? frame?
Duration is measured in seconds.
f just means the number's data type is a float (in short, a decimal; in long, it's complicated ;)) as opposed to an integer (which can only accept whole numbers).
another question:
"explosionSpec":{"duration":2f,
what's the unit of f? frame?
Duration is measured in seconds.
f just means the number's data type is a float (in short, a decimal; in long, it's complicated ;)) as opposed to an integer (which can only accept whole numbers).
another question:
"explosionSpec":{"duration":2f,
what's the unit of f? frame?
Duration is measured in seconds.
f just means the number's data type is a float (in short, a decimal; in long, it's complicated ;)) as opposed to an integer (which can only accept whole numbers).
For example Pi is 3.14....... you only want the first 2 decimals so you make it a type float becoming 3.14f
New problem:
auto pilot/ AI won't fire my new missile weapon.
It has unlimited ammo (over time), added a DO_NOT_AIM, USE_VS_FRIGATE tag in the csv, and a range of 1500
what makes the AI think this weapon is useless?
"shipNameSources":{
"THULE":1,
},
did you use correct extension? not something like a photoshop file? something it cant read?
I believe missiles need at least 30 ammo to autofire.
Also: if missile ammo is <= 5, it'll wait to fire it until it's a good time to - i.e, the missile is high explosive and shields are down. It doesn't take regeneration into account for this.
did you use correct extension? not something like a photoshop file? something it cant read?
First thing I checked and its a .png :-\ must be something I accidently did in PS,
however I dunno what can cause this.
Edit - got it, had wrong bit levels. All is good now, thank you for your time :)Spoiler(http://oi45.tinypic.com/2jcac0n.jpg)[close]
Not only that, its now StarSector so you'll need to remake it anyway :D
2. I specified in the faction fileCodebut the game will randomly pick a name, not just from the specified one."shipNameSources":{
"THULE":1,
},
What could be the problem?
2. I specified in the faction fileCodebut the game will randomly pick a name, not just from the specified one."shipNameSources":{
"THULE":1,
},
What could be the problem?
has someone a hint for me?
Actually, about that - all mothballed ships seem to pull from every ship name list in the data structure, not just the ones belonging to the faction that owns the station. Is that intended?
{
"THULE":
[
"Adalberga",
"Adalbrand",
"Adalburg",
"Adalger",
"Adalward",
"Adelar",
"Adelbrand",
"Adelfrieda",
"Adelfriede",
"Adelger",
"Adelgunde",
"Adelgundis",
"Adelrune",
"Agibert",
"Agilhard",
"Agilulf",
"Alarich",
"Albina",
"Albine",
"Albrada",
"Albruna",
"Albrune",
"Alfger",
"Alfhilde",
"Alfonsa",
"Alftrud",
"Alkmar",
"Aloisia",
"Alram",
"Alwine",
"Amalberga",
"Amalberta",
"Amalburga",
"Amalfried",
"Amalfrieda",
"Amalfriede",
"Amalgard",
"Amalgunda",
"Amalgundis",
"Amalie",
"Amalinde",
"Amalindis",
"Arngrim",
"Arnhard",
"Arnhelm",
"Arnulf",
"Arwin",
"Aschwin",
"Askold",
"Aswin",
"Baldebert",
"Baldegunde",
"Baldemar",
"Balderich",
"Baldfried",
"Baltfried",
"Balthard",
"Baltram",
"Baltrun",
"Baltwin",
"Bardulf",
"Bathilde",
"Bathildis",
"Bergunde",
"Berlinde",
"Berlindis",
"Bernalde",
"Bernfried",
"Bernfriede",
"Berngard",
"Bernger",
"Bernharde",
"Bernhelm",
"Bernhilde",
"Bernulf",
"Bernwald",
"Bernward",
"Berold",
"Bertfried",
"Bertfriede",
"Bertgunde",
"Bertholda",
"Bertholde",
"Bertlinde",
"Bertlindis",
"Bertolf",
"Bertrade",
"Bertradis",
"Bertrand",
"Bertraude",
"Bertrun",
"Bertulf",
"Bertwald",
"Bertwin",
"Billfried",
"Billhard",
"Billhilde",
"Billibald",
"Biterolf",
"Bleikard",
"Botmar",
"Botwin",
"Brandolf",
"Brandulf",
"Brunhard",
"Brünhilde",
"Burglinde",
"Burgwald",
"Burgward",
"Christhard",
"Christmar",
"Christwart",
"Dankrad",
"Dankrade",
"Deert",
"Deinhard",
"Diederike",
"Dietbald",
"Dietberga",
"Dietberta",
"Dietbold",
"Dietbrand",
"Dietburga",
"Dietegen",
"Dietgard",
"Dietgunde",
"Diethelm",
"Diether",
"Diethilde",
"Dietmund",
"Dietmut",
"Dietolf",
"Dietrade",
"Dietram",
"Dietrun",
"Dietwald",
"Dietward",
"Dietwart",
"Dietwin",
"Dietwolf",
"Eberfried",
"Ebergard",
"Eberharda",
"Eberhilde",
"Eckeward",
"Eckewart",
"Eckhard",
"Eckwin",
"Egberta",
"Egberte",
"Egilward",
"Eginolf",
"Egmond",
"Ehrengrad",
"Ehrentraud",
"Eilbert",
"Eilfried",
"Eilmar",
"Eiltraud",
"Einharde",
"Elfgard",
"Elftraud",
"Emeram",
"Emmeram",
"Engelberga",
"Engelberta",
"Engelburga",
"Engelgard",
"Engeltraud",
"Erkenbald",
"Erkenbert",
"Erkenbrecht",
"Erkenfried",
"Erkengard",
"Erkenrad",
"Erkentraud",
"Erlfried",
"Erlfriede",
"Erlgard",
"Erltraud",
"Erlwin",
"Erlwine",
"Ermenbert",
"Ermenbrecht",
"Erminolde",
"Ernesta",
"Erpo",
"Ertrud",
"Erwine",
"Etzel",
"Ewara",
"Eward",
"Ewerdina",
"Ewerdine",
"Falkmar",
"Faramund",
"Farfried",
"Farhilde",
"Farold",
"Fastmar",
"Fastmund",
"Fastrad",
"Fastrade",
"Fatrada",
"Filiberta",
"Framhild",
"Friedebald",
"Friedeberga",
"Friedebert",
"Friedeburg",
"Friedeburga",
"Friedelind",
"Friederun",
"Friedewald",
"Friedhard",
"Friedhelm",
"Friedolf",
"Friedrich",
"Frodebert",
"Frodegard",
"Frodemute",
"Frodewine",
"Frommhold",
"Garlieb",
"Gastold",
"Gebharde",
"Gerbald",
"Gerbod",
"Gerborg",
"Gerbrand",
"Gerburg",
"Gerfried",
"Gerharda",
"Gerharde",
"Gerhilde",
"Germar",
"Gertraud",
"Gerwine",
"Gilberte",
"Gildbrecht",
"Gildebert",
"Giselberga",
"Giselberta",
"Giselburga",
"Giselheid",
"Giseltraud",
"Gismara",
"Gismunda",
"Gismunde",
"Godeberta",
"Godela",
"Godwin",
"Gosbert",
"Gotlinde",
"Gotlindis",
"Gottbert",
"Gotthelm",
"Gotthilde",
"Gottmar",
"Gottwin",
"Gotwin",
"Gunborg",
"Gundobald",
"Gunntberta",
"Guntberga",
"Guntbert",
"Guntbrecht",
"Guntfried",
"Gunthard",
"Gunthelm",
"Gunthilde",
"Guntrad",
"Guntrada",
"Guntrade",
"Guntram",
"Guntrun",
"Guntwin",
"Gühnter",
"Hadamar",
"Hadburga",
"Hadelind",
"Hademund",
"Haduwig",
"Hadwine",
"Hariolf",
"Hariulf",
"Harmina",
"Harold",
"Hartbert",
"Hartfried",
"Hartlieb",
"Hartmute",
"Hartwig",
"Hatto",
"Heiderich",
"Heilburg",
"Heilmar",
"Heiltraud",
"Heilwig",
"Heimberga",
"Heimbert",
"Heimbrecht",
"Heimburga",
"Heimeram",
"Heimeran",
"Heimtraud",
"Heinhard",
"Heinrike",
"Helferich",
"Helmbald",
"Helmbold",
"Helmbrecht",
"Helmburg",
"Helmfried",
"Helmgerd",
"Helmold",
"Helmtraud",
"Herbald",
"Herberta",
"Herborg",
"Herbrand",
"Herburg",
"Hergilde",
"Herlinde",
"Herlindis",
"Herlof",
"Herluf",
"Hermandine",
"Hermanna",
"Hermanne",
"Hermengilde",
"Herrada",
"Herrade",
"Herta",
"Hertwiga",
"Herwald",
"Herward",
"Herwig",
"Herwiga",
"Hildburg",
"Hildebald",
"Hildebert",
"Hildebrand",
"Hildebrecht",
"Hildefons",
"Hildemar",
"Hildemut",
"Hildewin",
"Hildolf",
"Hiltraud",
"Horstmar",
"Huberta",
"Hugbald",
"Humbrecht",
"Humfried",
"Hunold",
"Ingegerd",
"Ingmar",
"Irmenbert",
"Irmenburg",
"Irmenfried",
"Irmengard",
"Irmenhard",
"Irmenrad",
"Isberga",
"Isenbert",
"Isenbrand",
"Isenger",
"Isenhard",
"Isentraud",
"Isgard",
"Ismar",
"Ismunde",
"Ithamar",
"Iwo",
"Janfried",
"Klothilde",
"Kolbert",
"Kriemhild",
"Kunibald",
"Kunibert",
"Kunimund",
"Lambrecht",
"Lampert",
"Lamprecht",
"Landerich",
"Landewin",
"Landfried",
"Leonharda",
"Leopola",
"Leopolde",
"Liberta",
"Liebetraud",
"Liebfried",
"Liebhard",
"Liebhilde",
"Liebrecht",
"Liebwald",
"Liebward",
"Liebwin",
"Lindgrad",
"Luitbald",
"Luitbrand",
"Luitfried",
"Luitgard",
"Luitgunde",
"Luither",
"Luithilde",
"Luithold",
"Luitolf",
"Luitwin",
"Lütmar",
"Malfriede",
"Malvine",
"Malwin",
"Manhard",
"Manhart",
"Marbert",
"Marbod",
"Marhold",
"Marigard",
"Markolf",
"Markward",
"Maxbert",
"Meinbod",
"Meinfried",
"Meinhilde",
"Meinholde",
"Meinrade",
"Meinwald",
"Meithard",
"Mildburg",
"Milltraud",
"Neidhard",
"Nidger",
"Nonfried",
"Nordrun",
"Nordwin",
"Norfried",
"Norgard",
"Norhilde",
"Notburga",
"Notger",
"Notker",
"Oldwig",
"Ortfried",
"Ortger",
"Orthilde",
"Ortlinde",
"Ortnit",
"Ortraud",
"Osberta",
"Osmunde",
"Osterlind",
"Oswalda",
"Oswalde",
"Oswina",
"Otberga",
"Otger",
"Otgunde",
"Othilde",
"Otker",
"Otlinde",
"Otmund",
"Ottar",
"Ottogebe",
"Otwald",
"Otward",
"Otwin",
"Pippin",
"Radegunde",
"Rambald",
"Rambert",
"Rambod",
"Randolf",
"Randwig",
"Ratbald",
"Ratbert",
"Ratberta",
"Ratbod",
"Ratburga",
"Ratfried",
"Ratgard",
"Ratger",
"Rathard",
"Rathilde",
"Rathold",
"Ratmar",
"Ratwald",
"Ratward",
"Regelinde",
"Reginald",
"Reginalda",
"Regiswinda",
"Reimara",
"Reimbert",
"Reimbod",
"Reimund",
"Reimute",
"Reinald",
"Reinalde",
"Reinberta",
"Reinburga",
"Reiner",
"Reinfried",
"Reinfrieda",
"Reingard",
"Reinhardine",
"Reinholde",
"Reintraud",
"Reinwald",
"Richbald",
"Richbert",
"Richhilde",
"Richlinde",
"Richmar",
"Richmut",
"Richwald",
"Rigmor",
"Ringolf",
"Rodegang",
"Rodegard",
"Rodehilde",
"Rodewald",
"Rolanda",
"Romilda",
"Rosalinde",
"Rosemarie",
"Roswin",
"Rothard",
"Rother",
"Rudibert",
"Rudmar",
"Rudolfa",
"Rumold",
"Runfried",
"Runhilde",
"Ruperta",
"Rutgard",
"Rutlieb",
"Schwabhild",
"Schöntrud",
"Sebalde",
"Siegberta",
"Siegbod",
"Siegbrand",
"Siegburga",
"Sieghelm",
"Siegher",
"Sieghilde",
"Siegolf",
"Siegram",
"Siegrich",
"Siegrun",
"Siegtraude",
"Siegwald",
"Siegward",
"Siegwin",
"Sigismunde",
"Sintbald",
"Sintbert",
"Sirk",
"Solbert",
"Sonnfried",
"Sonngard",
"Sonnhilde",
"Sonntraud",
"Stillfried",
"Svava",
"Swanburga",
"Swanhilde",
"Swidgard",
"Swindbert",
"Teutobald",
"Teutobert",
"Teutobod",
"Teutomar",
"Teutwart",
"Thorgard",
"Thorgund",
"Traudhilde",
"Traudlinde",
"Treumunde",
"Trudberta",
"Trudgard",
"Uhland",
"Ulbert",
"Ulberta",
"Ulfert",
"Usmar",
"Vilmar",
"Volbert",
"Volkbert",
"Volkberta",
"Volkbrand",
"Volkbrecht",
"Volkerdine",
"Volkhard",
"Volkhilde",
"Volkmann",
"Volko",
"Volkrad",
"Volkram",
"Volkwald",
"Volkward",
"Volkwin",
"Walbert",
"Waldeberta",
"Waldegunde",
"Waldfried",
"Walfriede",
"Walthard",
"Waltheide",
"Walthilde",
"Waltrada",
"Waltram",
"Waltraud",
"Waltrun",
"Welfhard",
"Wendelbert",
"Wendelgard",
"Wendelmar",
"Weriand",
"Wernburg",
"Werngrad",
"Wernhard",
"Wernhilde",
"Wibrande",
"Wichard",
"Wiclef",
"Wiebke",
"Wigand",
"Wigbald",
"Wigbert",
"Wigberta",
"Wigburga",
"Wigmar",
"Wigmund",
"Wignand",
"Wilbert",
"Wilbrand",
"Wilburg",
"Wilderich",
"Wildfried",
"Wilfrieda",
"Wilgard",
"Wilgunde",
"Wilhard",
"Wilhelma",
"Willehad",
"Willibert",
"Willibrand",
"Willimar",
"Williram",
"Wilma",
"Wilmont",
"Wilmut",
"Wilrun",
"Winald",
"Winand",
"Winfrieda",
"Winibald",
"Winibert",
"Winimar",
"Winrich",
"Wintrud",
"Wisgard",
"Wisgunde",
"Witold",
"Wolfbert",
"Wolfgang",
"Wolfger",
"Wolfgunde",
"Wolfhelm",
"Wolfhilde",
"Wolfrad",
"Wolfried",
"Wolfrun",
"Wolftraud",
"Wulfrin",
"Wunibald",
"Wybren",
],
"Erk":
[
"Adeodatus",
"Adorata",
"Afra",
"Agnus",
"Albin",
"Aloisius",
"Aloysius",
"Alva",
"Alwinus",
"Amadea",
"Amand",
"Amatus",
"Amöna",
"Amöne",
"Antonius",
"Arcadius",
"Arkadius",
"Ascanius",
"Askan",
"Augustus",
"Aurelius",
"Balbina",
"Balbine",
"Baldus",
"Beat",
"Beata",
"Beate",
"Beatus",
"Benedikte",
"Benediktus",
"Benigna",
"Bibiana",
"Bibiane",
"Bona",
"Bonaventura",
"Bonifatia",
"Bonifaz",
"Bonifazius",
"Brigida",
"Brigide",
"Cajetan",
"Candid",
"Candidus",
"Caritas",
"Carola",
"Carolus",
"Celestin",
"Celestina",
"Centa",
"Christian",
"Clamor",
"Clodia",
"Columba",
"Columban",
"Columbina",
"Concordia",
"Consilia",
"Constantin",
"Corin",
"Cornel",
"Corvinius",
"Crescentia",
"Crispin",
"Crispinus",
"Cyprian",
"Cäcilia",
"Cäcilius",
"Cäsarina",
"Cäsarine",
"Cölestin",
"Cölestina",
"Deodat",
"Deodata",
"Deodatus",
"Desiderius",
"Diane",
"Dominik",
"Donat",
"Elestin",
"Emerita",
"Emilia",
"Ernesto",
"Ernestus",
"Fabius",
"Fausta",
"Faustinus",
"Faustus",
"Felicia",
"Felizia",
"Fideelius",
"Fidelia",
"Fidelis",
"Fides",
"Firmina",
"Flavia",
"Flavius",
"Florens",
"Florentia",
"Florentius",
"Floriane",
"Florida",
"Florina",
"Florine",
"Florus",
"Fortuna",
"Fortunat",
"Fortunata",
"Fortunatus",
"Franciscus",
"Frobenius",
"Galla",
"Gallus",
"Gaudentius",
"Gemma",
"Gerke",
"Gerko",
"Gertrudis",
"Glorius",
"Gordian",
"Gratian",
"Gratianus",
"Grazian",
"Hilaria",
"Honorius",
"Hubertus",
"Ignatia",
"Ignaz",
"Immakulata",
"Ingenuin",
"Innozens",
"Innozent",
"Innozentia",
"Jucunda",
"Julia",
"Klemens",
"Kolomba",
"Laura",
"Laurenz",
"Lavinia",
"Leo",
"Leon",
"Leona",
"Leonie",
"Longin",
"Longina",
"Longinus",
"Lucretius",
"Ludgerus",
"Ludovicus",
"Lätizia",
"Marzellus",
"Maura",
"Maurus",
"Maximilian",
"Maximus",
"Medardus",
"Modeste",
"Natalia",
"Nero",
"Octaria",
"Oktavian",
"Optatus",
"Orania",
"Ostian",
"Parsimonius",
"Patrizia",
"Patrizius",
"Paul",
"Perdita",
"Peregrin",
"Peregrinus",
"Petrus",
"Piata",
"Pontian",
"Pretiosa",
"Primus",
"Priscus",
"Priska",
"Prosperus",
"Prudentia",
"Pulcheria",
"Romulus",
"Rosina",
"Rufina",
"Rufus",
"Salvator",
"Salvina",
"Salwa",
"Santo",
"Saturnus",
"Scholastika",
"Scipio",
"Serena",
"Serenus",
"Sergia",
"Severa",
"Severina",
"Sidonia",
"Sidonius",
"Silva",
"Silvan",
"Silvester",
"Silvius",
"Sulpiz",
"Tarcisius",
"Terzia",
"Tiziana",
"Urbana",
"Urbanus",
"Urs",
"Ursina",
"Ursula",
"Valerie",
"Valten",
"Velten",
"Veltin",
"Venetia",
"Ventur",
"Veritas",
"Victoria",
"Viktor",
"Vincentia",
"Vita",
"Vital",
"Vivian",
"Viviana",
"Zelestin",
]
}
{
id:"thulelegacy",
"color":[153,95,158,255],
"displayName":"Thule Legacy",
"shipNamePrefix":"TLS",
"shipNameSources":{
"THULE":1,
},
"description":"No description yet.",
"names":{
"modern":1,
},
"portraits":{
"standard_male":[
"graphics/portraits/portrait_thule04.png",
"graphics/portraits/portrait_thule03.png",
],
"standard_female":[
"graphics/portraits/portrait_thule02.png",
"graphics/portraits/portrait_thule01.png",
],
},
"fleetCompositions":{
"blitz":{
"displayName":"Blitz Trooper",
"maxFleetPoints":11,
"daysWorthOfSupplies":[30, 50],
"lyWorthOfFuel":[40, 60],
"extraCrewPercent":[80, 80],
"marinesPercent":[20, 20],
"ships":{
"thule_vikingmki_Assault":[1, 1],
"thule_vikingmkii_Assault":[1, 1],
"thule_einherjer_wing":[1, 1],
},
},
"stormer":{
"displayName":"Stormer Battalion",
"maxFleetPoints":25,
"daysWorthOfSupplies":[30, 50],
"lyWorthOfFuel":[40, 60],
"extraCrewPercent":[80, 80],
"marinesPercent":[20, 20],
"ships":{
"thule_vikingmki_Assault":[2, 3],
"thule_vikingmkii_Assault":[0, 1],
"thule_berserker_Standard":[0, 1],
"thule_einherjer_wing":[2, 3],
},
},
"pacifier":{
"displayName":"Pacifier Flotilla",
"maxFleetPoints":50,
"daysWorthOfSupplies":[30, 50],
"lyWorthOfFuel":[40, 60],
"extraCrewPercent":[80, 80],
"marinesPercent":[20, 20],
"ships":{
"thule_berserker_Standard":[2, 2],
"thule_vikingmki_Assault":[2, 3],
"thule_vikingmkii_Assault":[2, 3],
"thule_einherjer_wing":[0, 4],
"thule_wartool_wing":[0, 2],
},
},
"peacekeeper":{
"displayName":"Peacekeeper Fleet",
"maxFleetPoints":100,
"daysWorthOfSupplies":[30, 50],
"lyWorthOfFuel":[40, 60],
"extraCrewPercent":[80, 80],
"marinesPercent":[20, 20],
"ships":{
"thule_herzog_Standard":[2, 2],
"thule_berserker_Standard":[2, 4],
"thule_berserker_Support":[1, 2],
"thule_vikingmki_Assault":[2, 3],
"thule_tungsten_experimental":[2, 2],
"thule_vikingmki_Support":[2, 3],
"thule_einherjer_wing":[2, 6],
"thule_wartool_wing":[2, 6],
},
},
"supplyfleet":{
"displayName":"Supply Fleet",
"maxFleetPoints":70,
"daysWorthOfSupplies":[30, 50],
"lyWorthOfFuel":[40, 60],
"extraCrewPercent":[80, 80],
"marinesPercent":[20, 20],
"ships":{
"buffalo_Standard":[4, 7],
"aurora_Balanced":[1, 3],
"medusa_Attack":[0, 2],
"medusa_CS":[0, 2],
"tempest_Attack":[0, 3],
"wolf_CS":[0, 3],
"xyphos_wing":[2,3],
"wasp_wing":[3, 4],
},
},
},
"traits":{
"admiral":{
},
"captain":{
"cowardly":1,
"cautious":1,
"steady":1,
"aggressive":1,
"suicidal":1,
"fearless":1,
},
},
"dialogue":{
"greetingFriendly":"This Thule Legacy ship is on a classified mission. Identity and peaceful status confirmed.",
"greetingNeutral":"Thule Legacy have scanned your ship and analyzed your capabilities to cause a disturbance. Maintain your distance.",
"greetingHostileAggressive":"I can picture in my mind a system without war, a system without hate. And I can picture us attacking that system, because they'd never expect it. Prepare to be pacified.",
"greetingHostileTimid":"Attention. Your vessel has been scanned and identified as a disturbence to the Thule Legacy. Prepare to be pacified. Peace through superior firepower.",
}
},
package data.shipsystems.scripts;
import com.fs.starfarer.api.combat.MutableShipStatsAPI;
import com.fs.starfarer.api.plugins.ShipSystemStatsScript;
public class BurstJetsStats implements ShipSystemStatsScript {
public void apply(MutableShipStatsAPI stats, String id, State state, float effectLevel) {
if (state == ShipSystemStatsScript.State.OUT) {
stats.getMaxSpeed().modifyPercent(id, 100f * effectLevel); // to slow down ship to its regular top speed while powering drive down
stats.getMaxTurnRate().modifyPercent(id, 100f * effectLevel);
stats.getDeceleration().modifyPercent(id, 100f * effectLevel);
} else {
stats.getMaxSpeed().modifyFlat(id, 130f * effectLevel);
stats.getAcceleration().modifyFlat(id, 190f * effectLevel);
stats.getDeceleration().modifyFlat(id, 120f * effectLevel);
stats.getTurnAcceleration().modifyFlat(id, 90f * effectLevel);
stats.getTurnAcceleration().modifyPercent(id, 200f * effectLevel);
stats.getMaxTurnRate().modifyFlat(id, 40f * effectLevel);
stats.getMaxTurnRate().modifyPercent(id, 100f * effectLevel);
}
}
public void unapply(MutableShipStatsAPI stats, String id) {
stats.getMaxSpeed().unmodify(id);
stats.getMaxTurnRate().unmodify(id);
stats.getTurnAcceleration().unmodify(id);
stats.getAcceleration().unmodify(id);
stats.getDeceleration().unmodify(id);
}
public StatusData getStatusData(int index, State state, float effectLevel) {
if (index == 0) {
return new StatusData("improved maneuverability", false);
} else if (index == 1) {
return new StatusData("increased top speed", false);
}
return null;
}
}
Thank you Alex for taking the time to have a look, unfortunatly i mixed up the json files and uploaded the outdated version, my real updated version looks like this. The naming issue is still present.
Another modding question - I have a modified Maneuvering Jets system in my mod that uses the effectLevel to create a slowly fading stat boost. This means most of the effect is executed in the chargedown phase, and thus if I use "clamp max speed after=true" in the system file, the entire effect gets messed up. However I'd still very much like for the max speed to clamp after the chargedown ends, to make the system less useful for fast travel and more useful for combat maneuvering. How could I accomplish this?
wizardry
Hmm I replaced my engine sounds with new ones, I also set the path to them. So why does Starsector still play the default engine sounds?data/config/sounds.json did you change there?
# Engines
# played when engines are being used - depending on ship style and size
# For example - a "new" frigate would play the third sound listed, at volume 0.6
"engine_loop":{
"sounds":[
{"file":"sounds/fx/engines/engine.ogg","pitch":1,"volume":1},
{"file":"sounds/fx/engines/engine.ogg","pitch":1,"volume":1},
{"file":"sounds/fx/engines/engine.ogg","pitch":1,"volume":1},
],
"LOW_TECH":{"sounds":[0], "pitch":1, "volume":1},
"MIDLINE":{"sounds":[1], "pitch":1, "volume":1},
"HIGH_TECH":{"sounds":[2], "pitch":1, "volume":1},
"FIGHTER":{"sounds":[0,1,2], "pitch":1, "volume":0.4},
"FRIGATE":{"sounds":[0,1,2], "pitch":1, "volume":0.6},
"DESTROYER":{"sounds":[0,1,2], "pitch":1, "volume":0.7},
"CRUISER":{"sounds":[0,1,2], "pitch":1, "volume":0.8},
"CAPITAL_SHIP":{"sounds":[0,1,2], "pitch":1, "volume":1},
},
"engine_accelerate":{ # played when ship receives an "engine boost" from having zero flux
"sounds":[
{"file":"sounds/fx/engines/engine_startup.ogg","pitch":0.95,"volume":1},
],
"LOW_TECH":{"sounds":[0], "pitch":0.8, "volume":1},
"MIDLINE":{"sounds":[0], "pitch":0.9, "volume":1},
"HIGH_TECH":{"sounds":[0], "pitch":1, "volume":1},
"FIGHTER":{"sounds":[0], "pitch":1, "volume":0.4},
"FRIGATE":{"sounds":[0], "pitch":1, "volume":0.6},
"DESTROYER":{"sounds":[0], "pitch":1, "volume":0.7},
"CRUISER":{"sounds":[0], "pitch":1, "volume":0.8},
"CAPITAL_SHIP":{"sounds":[0], "pitch":1, "volume":1},
},
Thank you Alex for taking the time to have a look, unfortunatly i mixed up the json files and uploaded the outdated version, my real updated version looks like this. The naming issue is still present.
Pasted those in and it works fine. Let's take a step back - what's the actual issue? Outside the campaign, or in missions (i.e. if you go to Edit Variants -> Run Simulation off the main screen, or play a mission), the ships aren't associated with a faction. Inside the campaign, this seems to be working correctly - the Thule resupply fleet has names drawn from that group.
package data.shipsystems.scripts;
import com.fs.starfarer.api.combat.MutableShipStatsAPI;
import com.fs.starfarer.api.plugins.ShipSystemStatsScript;
import com.fs.starfarer.api.combat.ShipAPI;
public class RegenerateHitpoints implements ShipSystemStatsScript {
public void apply(MutableShipStatsAPI stats, String id, State state, float effectLevel) {
ShipAPI ship = (ShipAPI) stats.getEntity();
if (ship == null)
return;
if(ship.getHitpoints() < ship.getMaxHitpoints())
{
stats.getMaxHullRepairFraction().modifyFlat(id, 1000f); // the % in speed it heals back
float CurrentPercHP = (ship.getHitpoints() * 100) / ship.getMaxHitpoints(); //Grab current perc
if(CurrentPercHP < 20.000f) //checking if its less then 20% to repair
stats.getHullRepairRatePercentPerSecond().modifyFlat(id, CurrentPercHP); // if its less then 20% heal
else
stats.getHullRepairRatePercentPerSecond().modifyFlat(id, 20.000f); // else heal exacly 20%
}
}
public void unapply(MutableShipStatsAPI stats, String id)
{
stats.getMaxHullRepairFraction().unmodify(id);
stats.getHullRepairRatePercentPerSecond().unmodify(id);
}
public StatusData getStatusData(int index, State state, float effectLevel) {
if (index == 0) {
return new StatusData("Regenerating Hitpoints...", false);
}
return null;
}
}
{
"id":"podship_regeneration",
"type":"SHIELD_MOD",
"aiType":"FORTRESS_SHIELD",
"statsScript":"data.shipsystems.scripts.RegenerateHitpoints",
"soundFilterType":"LOWPASS",
"soundFilterGain":1,
"soundFilterGainHF":0.0,
"useSound":"podship_regenerate",
#"loopSound":"beam_heavy_loop",
#"deactivateSound":"terminator_shield",
#"outOfUsesSound":"gun_out_of_ammo",
#"useSound":"terminator_shield",
#"deactivateSound":"terminator_shield",
# Stian disabled these two because the timing of activate/deactivate did not work together with the loop sound.
# Enable them to test the issue. The deactivateSound plays late, after the loopsound has already stopped,
# creating a stuttering effect.
"loopSound":"podship_regenerate",
"outOfUsesSound":"gun_out_of_ammo",
}
package data.shipsystems.scripts;
import com.fs.starfarer.api.combat.MutableShipStatsAPI;
import com.fs.starfarer.api.plugins.ShipSystemStatsScript;
import com.fs.starfarer.api.combat.ShipAPI;
/**
*
* @author Ender
*/
public class Hull_Repair implements ShipSystemStatsScript {
public static final float REPAIR_RATE_MOD = 5f;
public void apply(MutableShipStatsAPI stats, String id, State state, float effectLevel) {
stats.getMaxHullRepairFraction().modifyFlat(id, 1000f); // the % in speed it heals back
ShipAPI ship = (ShipAPI) stats.getEntity();
if (ship == null)
return;
float CurrentPercHP = (ship.getHitpoints() * 100) / ship.getMaxHitpoints();
if (CurrentPercHP <= 20.000f) {
float repairRatePercent = REPAIR_RATE_MOD * effectLevel;
stats.getHullRepairRatePercentPerSecond().modifyFlat(id, repairRatePercent);
} else {
float repairRatePercent = REPAIR_RATE_MOD * effectLevel * (100.0f - CurrentPercHP);
stats.getHullRepairRatePercentPerSecond().modifyFlat(id, repairRatePercent);
}
}
public void unapply(MutableShipStatsAPI stats, String id) {
stats.getHullRepairRatePercentPerSecond().unmodifyFlat(id);
}
public StatusData getStatusData(int index, State state, float effectLevel) {
float repairRatePercent = REPAIR_RATE_MOD * effectLevel;
if (index == 0) {
return new StatusData("hull repair rate +" + (int) repairRatePercent + "%", false);
} else if (index == 1) {
return null;
}
return null;
}
}
package data.shipsystems.scripts.ai;
import java.util.List;
import com.fs.starfarer.api.combat.CombatEngineAPI;
import com.fs.starfarer.api.combat.ShipAPI;
import com.fs.starfarer.api.combat.ShipSystemAPI;
import com.fs.starfarer.api.combat.ShipwideAIFlags;
import com.fs.starfarer.api.combat.ShipSystemAIScript;
import com.fs.starfarer.api.util.IntervalUtil;
/**
*
* @author Ender
*/
public class Hull_RepairAI {
private ShipAPI ship;
private CombatEngineAPI engine;
private ShipwideAIFlags flags;
private ShipSystemAPI system;
private IntervalUtil tracker = new IntervalUtil(0.5f, 1f);
public void init(ShipAPI ship, ShipSystemAPI system, ShipwideAIFlags flags, CombatEngineAPI engine) {
this.ship = ship;
this.flags = flags;
this.engine = engine;
this.system = system;
}
private float bestFractionEver = 0f;
private float sinceLast = 0f;
@SuppressWarnings("unchecked")
public void advance(float amount, ShipAPI target) {
tracker.advance(amount);
sinceLast += amount;
if (tracker.intervalElapsed()) {
if (system.getCooldownRemaining() > 0) return;
if (system.isOutOfAmmo()) return;
if (system.isActive()) return;
float maxCooldown = 0f;
float totalCooldownSaved = 0f;
float currentHullHP = (100.0f * ship.getHitpoints() / ship.getMaxHitpoints());
if (maxCooldown <= 0 || totalCooldownSaved <= 0 || currentHullHP >= 80.0f) return;
float fluxLevel = ship.getFluxTracker().getFluxLevel();
boolean targetIsVulnerable = target != null && target.getFluxTracker().isOverloadedOrVenting() &&
(target.getFluxTracker().getOverloadTimeRemaining() > 5f ||
target.getFluxTracker().getTimeToVent() > 5f);
float remainingFluxLevel = 1f - fluxLevel;
float fluxFractionPerUse = system.getFluxPerUse() / ship.getFluxTracker().getMaxFlux();
if (fluxFractionPerUse > remainingFluxLevel) return;
float fluxLevelAfterUse = fluxLevel + fluxFractionPerUse;
if (fluxLevelAfterUse > 0.9f && fluxFractionPerUse > 0.025f) return;
if (!targetIsVulnerable && sinceLast < 10f && currentHullHP >= 20.0f) return; //in an emergency, we shouldn't care if the enemy ship is currently voulnerable because we're already losing
float fraction = totalCooldownSaved / maxCooldown;
if (fraction > bestFractionEver) {
bestFractionEver = fraction;
}
if (fraction >= 0.5) {
ship.useSystem();
sinceLast = 0f;
return;
}
}
}
}
42620 [Thread-6] ERROR com.fs.starfarer.combat.D - java.lang.ClassCastException: data.shipsystems.scripts.ai.Hull_RepairAI cannot be cast to com.fs.starfarer.api.combat.ShipSystemAIScript
java.lang.ClassCastException: data.shipsystems.scripts.ai.Hull_RepairAI cannot be cast to com.fs.starfarer.api.combat.ShipSystemAIScript
at com.fs.starfarer.loading.specs.Oooo.öO0000(Unknown Source)
at com.fs.starfarer.loading.specs.Oooo.o00000(Unknown Source)
at com.fs.starfarer.combat.ai.BasicShipAI.<init>(Unknown Source)
at com.fs.starfarer.combat.CombatFleetManager.super(Unknown Source)
at com.fs.starfarer.combat.CombatFleetManager.super(Unknown Source)
at com.fs.starfarer.combat.CombatFleetManager.deploy(Unknown Source)
at com.fs.starfarer.ui.impl.G.super(Unknown Source)
at com.fs.starfarer.ui.impl.G.super(Unknown Source)
at com.fs.starfarer.ui.o00oOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO OOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO OOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO OOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO.super(Unknown Source)
at com.fs.starfarer.ui.OOoO.super(Unknown Source)
at com.fs.starfarer.ui.Objectsuper.o00000(Unknown Source)
at com.fs.starfarer.combat.F.ÖÖÒ000(Unknown Source)
at com.fs.A.A.new(Unknown Source)
at com.fs.starfarer.combat.D.o00000(Unknown Source)
at com.fs.starfarer.StarfarerLauncher$2.run(Unknown Source)
at java.lang.Thread.run(Thread.java:619)
SpoilerGetting close.
The system itself works nicely (it's not an instant repair, it's a 4-second repair that shuts down pretty much all of your ship systems and does 5% per second, or less if your HP is above 80%):Codepackage data.shipsystems.scripts;
import com.fs.starfarer.api.combat.MutableShipStatsAPI;
import com.fs.starfarer.api.plugins.ShipSystemStatsScript;
import com.fs.starfarer.api.combat.ShipAPI;
/**
*
* @author Ender
*/
public class Hull_Repair implements ShipSystemStatsScript {
public static final float REPAIR_RATE_MOD = 5f;
public void apply(MutableShipStatsAPI stats, String id, State state, float effectLevel) {
stats.getMaxHullRepairFraction().modifyFlat(id, 1000f); // the % in speed it heals back
ShipAPI ship = (ShipAPI) stats.getEntity();
if (ship == null)
return;
float CurrentPercHP = (ship.getHitpoints() * 100) / ship.getMaxHitpoints();
if (CurrentPercHP <= 20.000f) {
float repairRatePercent = REPAIR_RATE_MOD * effectLevel;
stats.getHullRepairRatePercentPerSecond().modifyFlat(id, repairRatePercent);
} else {
float repairRatePercent = REPAIR_RATE_MOD * effectLevel * (100.0f - CurrentPercHP);
stats.getHullRepairRatePercentPerSecond().modifyFlat(id, repairRatePercent);
}
}
public void unapply(MutableShipStatsAPI stats, String id) {
stats.getHullRepairRatePercentPerSecond().unmodifyFlat(id);
}
public StatusData getStatusData(int index, State state, float effectLevel) {
float repairRatePercent = REPAIR_RATE_MOD * effectLevel;
if (index == 0) {
return new StatusData("hull repair rate +" + (int) repairRatePercent + "%", false);
} else if (index == 1) {
return null;
}
return null;
}
}
But the AI script causes an error.
Here's the AI java code (it's a bit hacky but it's a work in progress):Codepackage data.shipsystems.scripts.ai;
import java.util.List;
import com.fs.starfarer.api.combat.CombatEngineAPI;
import com.fs.starfarer.api.combat.ShipAPI;
import com.fs.starfarer.api.combat.ShipSystemAPI;
import com.fs.starfarer.api.combat.ShipwideAIFlags;
import com.fs.starfarer.api.combat.ShipSystemAIScript;
import com.fs.starfarer.api.util.IntervalUtil;
/**
*
* @author Ender
*/
public class Hull_RepairAI {
private ShipAPI ship;
private CombatEngineAPI engine;
private ShipwideAIFlags flags;
private ShipSystemAPI system;
private IntervalUtil tracker = new IntervalUtil(0.5f, 1f);
public void init(ShipAPI ship, ShipSystemAPI system, ShipwideAIFlags flags, CombatEngineAPI engine) {
this.ship = ship;
this.flags = flags;
this.engine = engine;
this.system = system;
}
private float bestFractionEver = 0f;
private float sinceLast = 0f;
@SuppressWarnings("unchecked")
public void advance(float amount, ShipAPI target) {
tracker.advance(amount);
sinceLast += amount;
if (tracker.intervalElapsed()) {
if (system.getCooldownRemaining() > 0) return;
if (system.isOutOfAmmo()) return;
if (system.isActive()) return;
float maxCooldown = 0f;
float totalCooldownSaved = 0f;
float currentHullHP = (100.0f * ship.getHitpoints() / ship.getMaxHitpoints());
if (maxCooldown <= 0 || totalCooldownSaved <= 0 || currentHullHP >= 80.0f) return;
float fluxLevel = ship.getFluxTracker().getFluxLevel();
boolean targetIsVulnerable = target != null && target.getFluxTracker().isOverloadedOrVenting() &&
(target.getFluxTracker().getOverloadTimeRemaining() > 5f ||
target.getFluxTracker().getTimeToVent() > 5f);
float remainingFluxLevel = 1f - fluxLevel;
float fluxFractionPerUse = system.getFluxPerUse() / ship.getFluxTracker().getMaxFlux();
if (fluxFractionPerUse > remainingFluxLevel) return;
float fluxLevelAfterUse = fluxLevel + fluxFractionPerUse;
if (fluxLevelAfterUse > 0.9f && fluxFractionPerUse > 0.025f) return;
if (!targetIsVulnerable && sinceLast < 10f && currentHullHP >= 20.0f) return; //in an emergency, we shouldn't care if the enemy ship is currently voulnerable because we're already losing
float fraction = totalCooldownSaved / maxCooldown;
if (fraction > bestFractionEver) {
bestFractionEver = fraction;
}
if (fraction >= 0.5) {
ship.useSystem();
sinceLast = 0f;
return;
}
}
}
}
And here's the error block I get:Quote42620 [Thread-6] ERROR com.fs.starfarer.combat.D - java.lang.ClassCastException: data.shipsystems.scripts.ai.Hull_RepairAI cannot be cast to com.fs.starfarer.api.combat.ShipSystemAIScript
java.lang.ClassCastException: data.shipsystems.scripts.ai.Hull_RepairAI cannot be cast to com.fs.starfarer.api.combat.ShipSystemAIScript
at com.fs.starfarer.loading.specs.Oooo.öO0000(Unknown Source)
at com.fs.starfarer.loading.specs.Oooo.o00000(Unknown Source)
at com.fs.starfarer.combat.ai.BasicShipAI.<init>(Unknown Source)
at com.fs.starfarer.combat.CombatFleetManager.super(Unknown Source)
at com.fs.starfarer.combat.CombatFleetManager.super(Unknown Source)
at com.fs.starfarer.combat.CombatFleetManager.deploy(Unknown Source)
at com.fs.starfarer.ui.impl.G.super(Unknown Source)
at com.fs.starfarer.ui.impl.G.super(Unknown Source)
at com.fs.starfarer.ui.o00oOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO OOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO OOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO OOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO.super(Unknown Source)
at com.fs.starfarer.ui.OOoO.super(Unknown Source)
at com.fs.starfarer.ui.Objectsuper.o00000(Unknown Source)
at com.fs.starfarer.combat.F.ÖÖÒ000(Unknown Source)
at com.fs.A.A.new(Unknown Source)
at com.fs.starfarer.combat.D.o00000(Unknown Source)
at com.fs.starfarer.StarfarerLauncher$2.run(Unknown Source)
at java.lang.Thread.run(Thread.java:619)[close]
You forgot to have Hull_RepairAI implement ShipSystemAIScript. :)/facepalm
If anyone would be nice enough to take a look at this mod, see what I've done wrong.
http://fractalsoftworks.com/forum/index.php?topic=4502.msg83744#msg83744
The .log is posted by Uthilian. I've checked the code for the spawn point and the convoy to see what I've missed, but I can't figure it out. All I know is that the game crashes when the convoy spawns.
package data.scripts.plugins;
import com.fs.starfarer.api.combat.CombatEngineAPI;
import com.fs.starfarer.api.combat.EveryFrameCombatPlugin;
import java.util.List;
public class CombatUtils implements EveryFrameCombatPlugin
{
private static CombatEngineAPI engine;
private static float combatTime = 0f;
public static CombatEngineAPI getCombatEngine()
{
return engine;
}
public static float getElapsedCombatTime()
{
return combatTime;
}
@Override
public void advance(float amount, List events)
{
combatTime += amount;
}
@Override
public void init(CombatEngineAPI engine)
{
CombatUtils.engine = engine;
CombatUtils.combatTime = 0f;
}
}
Eh like an Omni shield?
With new decorative weapon type and ability to assign scripts i suppose you can do something like that. Look at shipAPI, shieldsAPI and weaponAPI files. There might be some clues.
Has anyone looked at what's possible with Weapon and Beam effects yet? Like, for instance a missile that does damage over time after impacting the enemy?
Have you tried drones similar to the sensor drones on the Apogee, but making their accel & top speed values very high so that they are able to maintain position perfectly?With new decorative weapon type and ability to assign scripts i suppose you can do something like that. Look at shipAPI, shieldsAPI and weaponAPI files. There might be some clues.
Ill look into it then :)
I would love to figure it out, but sadly i feel its outside my league, never messed with these files,
(saying ahead - chances of me making it work are slim, no promises here :D )
Okay, thank you very much Alex, my bad.
I thought in missions ships where still associated with factions.
And yes in campaign mode it works properly.
Thank you again and sorry for wasting your time ;)
IS there anyway to make it so when a mirv splits it doesn't leave a crapload of particles behind?
Is there some easy way to mod the value of one flux capacitor? I'm thinking in particular of Okim's Ironclads mod, where the original ship flux capacities & shield strengths were built around the old 100 flux per capacitor value - resulting in the current game making flux capacitors (arguably) "too good" relative to where they should be.
It's possible, but you will need the current CombatEngineAPI to do it. Once you have the engine, you can use CombatEngineAPI's getShips(), then filter those with ShipAPI's getOwner().So question here. I tried to take a shortcut and simply call CombatEngineAPI:
The easiest/most reusable way to get at the current engine is to add something similar to the following script under data/scripts/plugins:Codepackage data.scripts.plugins;
import com.fs.starfarer.api.combat.CombatEngineAPI;
import com.fs.starfarer.api.combat.EveryFrameCombatPlugin;
import java.util.List;
public class CombatUtils implements EveryFrameCombatPlugin
{
private static CombatEngineAPI engine;
private static float combatTime = 0f;
public static CombatEngineAPI getCombatEngine()
{
return engine;
}
public static float getElapsedCombatTime()
{
return combatTime;
}
@Override
public void advance(float amount, List events)
{
combatTime += amount;
}
@Override
public void init(CombatEngineAPI engine)
{
CombatUtils.engine = engine;
CombatUtils.combatTime = 0f;
}
}
public CombatEngineAPI engine;
So question here. I tried to take a shortcut and simply call CombatEngineAPI:Codepublic CombatEngineAPI engine;
However, it's always returning null (I know this because I nested a number of ifs to see what exactly I was getting a null pointer from, and it's this).
I was trying to keep all the code in this one java file, but it's looking like I might need to simply write the plugin file as you have there. Is this true, or is there some other way I can keep CombatEngineAPI from returning a null value?
Got it. I'm lazy, apparently. :)So question here. I tried to take a shortcut and simply call CombatEngineAPI:Codepublic CombatEngineAPI engine;
However, it's always returning null (I know this because I nested a number of ifs to see what exactly I was getting a null pointer from, and it's this).
I was trying to keep all the code in this one java file, but it's looking like I might need to simply write the plugin file as you have there. Is this true, or is there some other way I can keep CombatEngineAPI from returning a null value?
All that line of code does is create an empty variable (if I wrote "public String warAndPeace;", I wouldn't automatically have the book's text assigned to that variable ;)). You need to get the engine the game is using, which is what the plugin does.
In other news: Arg, why does TachyonLanceEffect have to be compiled code? :(
Holy crap, that's what I needed.In other news: Arg, why does TachyonLanceEffect have to be compiled code? :(
Check out starfarer.api.zip in starfarer-core, it has the source for that included.
Holy crap, that's what I needed.In other news: Arg, why does TachyonLanceEffect have to be compiled code? :(
Check out starfarer.api.zip in starfarer-core, it has the source for that included.
Hopefully final question for a while: is there a way to print out lines to the starsector.log file for debugging?
Not as far as I know, unfortunately.
Is it possible to get the value for a ship's sight range? I can see how to find out the current bonus to the sight range, but not the actual sight range?
I ask because I'm trying to make a ship provide allied bonuses (and enemy debuffs) but would rather it do it only within its sight range rather than across the entire map.
On that same note, is it possible to have a ship system cause status messages to show up on the player's screen if the system is being used by another ship? Same system--it would be nice to tell the player that they are being debuffed by an enemy ship, or receiving buffs from a friendly AI-controlled ship.
How can I make a weapon animate in a different way than playing the animation over and over as long as the mouse button is held down? I'd like for the animation to play to completion after the weapon has fired a bullet and then rest at the initial frame until the next time it fires. Or at the very least, have the animation reset whenever a new round is fired.
As a workaround then, what is the maximum normal sight range on ships?
You could either 1) sync up the animation with the rate of fire of the weapon - it's likely that it may get out of sync after a long time spent firing continuously, but has the virtue of being a simple solution, or 2) write a custom EveryFrameWeaponEffectPlugin to play the animation - probably based on weapon.getRemainingCooldown()/weapon.isFiring()/weapon.getAnimation().setFrame(int), etc.
Note that for #1, it should play through the entire animation cycle and eventually reset to the first frame, even if you only tap the mouse. If that's not happening, and you can send me a mod with a working example of that, I'll be happy to take a look.
I've been looking in the files of a mod, trying to figure out why a carrier in it isn't...acting like a carrier (won't rally at Rally Carrier commands). Is this set anywhere? It has a launch bay, so if that's how it selects carriers, it's not quite working.you need to put CARRIER in the 'hint' column in the ships,csv file
Using the new hit effects system is it possible to have a beam weapon bounce to hit another target, like a chain lightning type weapon, or could a projectile weapon do the same?
Yes, you can do that with projectiles easily. We can't spawn beams in our code yet, but you could make something similar with lightning arcs (since you mentioned chain lightning, that might work better anyway). :)
package data.scripts.plugins;
import com.fs.starfarer.api.combat.BeamAPI;
import com.fs.starfarer.api.combat.BeamEffectPlugin;
import com.fs.starfarer.api.combat.CombatEngineAPI;
import com.fs.starfarer.api.combat.CombatEntityAPI;
import com.fs.starfarer.api.combat.DamageType;
import com.fs.starfarer.api.combat.ShipAPI;
import com.fs.starfarer.api.util.IntervalUtil;
import java.awt.Color;
import org.lwjgl.util.vector.Vector2f;
import org.lazywizard.lazylib.MathUtils;
public class TractorBeamEffect implements BeamEffectPlugin {
private CombatEntityAPI currentArc = null;
private IntervalUtil fireInterval = new IntervalUtil(0.2f, 0.3f);
public void advance(float amount, CombatEngineAPI engine, BeamAPI beam) {
if (currentArc != null) {
if (!engine.isEntityInPlay(currentArc)) {
currentArc = null;
}//if
}//if
CombatEntityAPI target = beam.getDamageTarget();
if (target != null && target instanceof ShipAPI && (target.getShield() == null || !target.getShield().isWithinArc(beam.getTo()))) {
if (beam.getBrightness() >= 1f) {
fireInterval.advance(amount);
if (fireInterval.intervalElapsed()) {
Vector2f dir = Vector2f.sub(beam.getTo(), beam.getFrom(), new Vector2f());
if (dir.lengthSquared() > 0) dir.normalise();
dir.scale(5f);
Vector2f point = Vector2f.sub(beam.getTo(), dir, new Vector2f());
float emp = beam.getWeapon().getDerivedStats().getBurstDamage() * .667f;
float dam = emp * 0.25f;
engine.spawnEmpArc(beam.getSource(), point, beam.getDamageTarget(), beam.getDamageTarget(),
//engine.spawnEmpArc(beam.getSource(), beam.getFrom(), beam.getSource(), beam.getDamageTarget(),
DamageType.ENERGY,
dam, // damage
emp, // emp
100000f, // max range
"tachyon_lance_emp_impact",
30f, // thickness
new Color(68,250,50,255),
new Color(212,255,192,255)
);
Vector2f velocity, direction;
float distance;
velocity = beam.getDamageTarget().getVelocity();
distance = MathUtils.getDistance(beam.getDamageTarget(), beam.getSource());
// Normalized directional vector
direction = MathUtils.getDirectionalVector(beam.getDamageTarget(), beam.getSource());
float strength = distance * 300f;
velocity.set(velocity.x + (direction.x * strength * amount), velocity.y + (direction.y * strength * 100f));
}//if
}//if
}//if
}//advance
}//class
Im having trouble getting a TractorBeam to work, its for the startreker mod, its suppose to be a borg weapon of doom that feeds on player tears, but right now its feeding on my tears :'(Codepackage data.scripts.plugins;
import com.fs.starfarer.api.combat.BeamAPI;
import com.fs.starfarer.api.combat.BeamEffectPlugin;
import com.fs.starfarer.api.combat.CombatEngineAPI;
import com.fs.starfarer.api.combat.CombatEntityAPI;
import com.fs.starfarer.api.combat.DamageType;
import com.fs.starfarer.api.combat.ShipAPI;
import com.fs.starfarer.api.util.IntervalUtil;
import java.awt.Color;
import org.lwjgl.util.vector.Vector2f;
import org.lazywizard.lazylib.MathUtils;
public class TractorBeamEffect implements BeamEffectPlugin {
private CombatEntityAPI currentArc = null;
private IntervalUtil fireInterval = new IntervalUtil(0.2f, 0.3f);
public void advance(float amount, CombatEngineAPI engine, BeamAPI beam) {
if (currentArc != null) {
if (!engine.isEntityInPlay(currentArc)) {
currentArc = null;
}//if
}//if
CombatEntityAPI target = beam.getDamageTarget();
if (target != null && target instanceof ShipAPI && (target.getShield() == null || !target.getShield().isWithinArc(beam.getTo()))) {
if (beam.getBrightness() >= 1f) {
fireInterval.advance(amount);
if (fireInterval.intervalElapsed()) {
Vector2f dir = Vector2f.sub(beam.getTo(), beam.getFrom(), new Vector2f());
if (dir.lengthSquared() > 0) dir.normalise();
dir.scale(5f);
Vector2f point = Vector2f.sub(beam.getTo(), dir, new Vector2f());
float emp = beam.getWeapon().getDerivedStats().getBurstDamage() * .667f;
float dam = emp * 0.25f;
engine.spawnEmpArc(beam.getSource(), point, beam.getDamageTarget(), beam.getDamageTarget(),
//engine.spawnEmpArc(beam.getSource(), beam.getFrom(), beam.getSource(), beam.getDamageTarget(),
DamageType.ENERGY,
dam, // damage
emp, // emp
100000f, // max range
"tachyon_lance_emp_impact",
30f, // thickness
new Color(68,250,50,255),
new Color(212,255,192,255)
);
Vector2f velocity, direction;
float distance;
velocity = beam.getDamageTarget().getVelocity();
distance = MathUtils.getDistance(beam.getDamageTarget(), beam.getSource());
// Normalized directional vector
direction = MathUtils.getDirectionalVector(beam.getDamageTarget(), beam.getSource());
float strength = distance * 300f;
velocity.set(velocity.x + (direction.x * strength * amount), velocity.y + (direction.y * strength * 100f));
}//if
}//if
}//if
}//advance
}//class
Based on LazyWizard blackhole code and a copy of the tachyon lance vanila weapon effect.
It semi works, it not pulling but it stops a ship from moving, heres a sneak peak:Spoiler(https://dl.dropbox.com/u/32263294/screenshot000.png)[close]
I still need to make a "weaker" version of it, based on hull sizes for the other factions, this one should not care what size the ship is, he will pull it in like it was nothing while getting emp dmg on it
float strength = distance * 300f;
You're probably having problems because you have the pull effect inside of the if (fireInterval.intervalElapsed()) block. That means it will only execute once about every 15 frames - since the velocity change from the black hole code is implemented gradually, this means there will be almost no effect at all.Codefloat strength = distance * 300f;
You might want to change this as well. Strength equals the net change in velocity per second, and with this you'll be pulling a ship in at max speed, probably crushing them against your hull. :)
Mind if I use that "movement stopper" code for Rejection? Because that would totally fit an EW-frigate!
and actually its making it spinning instead of crushing into the hull (it doesnt matter if it does do that, we are the borg, we couldnt care less what happens to your puny ships), i had one ship destroyed while under its effect that it literally got falcon punched out of the combat zone while spinning at a astronomical rate
velocity.set(velocity.x + (direction.x * strength * amount), velocity.y + (direction.y * strength * 100f));
and actually its making it spinning instead of crushing into the hull (it doesnt matter if it does do that, we are the borg, we couldnt care less what happens to your puny ships), i had one ship destroyed while under its effect that it literally got falcon punched out of the combat zone while spinning at a astronomical rateCodevelocity.set(velocity.x + (direction.x * strength * amount), velocity.y + (direction.y * strength * 100f));
Why is the y velocity change being multiplied by 100 instead of amount? Since amount will usually be about 0.016, that's a significant difference in power. ;) That might be why it's spinning (the AI trying to compensate for being shoved aside).
Ok, is it possible that the current build can't use additional backgrounds?
Turns out when you are in dev mode changes to the background appearently get scrapped. Weird.
Got an issue I've not been able to solve, and it has made editing ships harder since I can't use Trybolot's ship editor.
Here's the thing. I had to add in custom engines manually for the ships. I found it easier to edit the hull files manually after changing the layout of the hull text from:Spoiler(http://i1022.photobucket.com/albums/af343/erick_doe/Starfarer/code_01_zpsb6476261.png)[close]
toSpoiler(http://i1022.photobucket.com/albums/af343/erick_doe/Starfarer/code_02_zps4642aab8.png)[close]
Unfortunately, I don't know how to change back the layout without manually changing every little thing. Because while Starsector has no problem with my new layout, Trybolot's ship editor does.
Any help would be appreciated.
package data.shipsystems.scripts;
import com.fs.starfarer.api.combat.MutableShipStatsAPI;
import com.fs.starfarer.api.plugins.ShipSystemStatsScript;
import com.fs.starfarer.api.combat.CombatEntityAPI;
import com.fs.starfarer.api.combat.ShipAPI;
import com.fs.starfarer.api.combat.CombatEngineAPI;
import data.scripts.plugins.CombatUtils;
import java.lang.Math;
public class DesdinovaBurstJetsStats implements ShipSystemStatsScript {
public CombatEntityAPI ourShip;
public ShipAPI ship;
public CombatEngineAPI engine;
CombatUtils utility = new CombatUtils();
public Math math;
public void apply(MutableShipStatsAPI stats, String id, State state, float effectLevel) {
ourShip = stats.getEntity();
boolean fluxIsAtZero = false;
ship = utility.getOwner(stats);
if (ship != null) {
if (ship.getFluxTracker().getFluxLevel() == 0f) { fluxIsAtZero = true; }
}
if (state == ShipSystemStatsScript.State.OUT) {
if (effectLevel < 1f) {
stats.getMaxSpeed().modifyFlat(id, (effectLevel)*stats.getMaxSpeed().getModifiedValue()); // to slow down ship to its regular top speed while powering drive down
stats.getDeceleration().unmodify(id);
//start clamping our Y velocity
if (ourShip.getVelocity().getY() > stats.getMaxSpeed().getBaseValue() && !fluxIsAtZero) {
ourShip.getVelocity().set(ourShip.getVelocity().getX(), (stats.getMaxSpeed().getModifiedValue()));
} else if (ourShip.getVelocity().getY() > stats.getMaxSpeed().getBaseValue() && fluxIsAtZero) {
ourShip.getVelocity().set(ourShip.getVelocity().getX(), (50f + stats.getMaxSpeed().getModifiedValue()));
}
//start clamping our X velocity
if (math.abs(ourShip.getVelocity().getX()) > stats.getMaxSpeed().getBaseValue() && !fluxIsAtZero) {
if (ourShip.getVelocity().getX() > 0f) {
ourShip.getVelocity().set((stats.getMaxSpeed().getModifiedValue()), ourShip.getVelocity().getY());
} else if (ourShip.getVelocity().getX() < 0f) {
ourShip.getVelocity().set((-1.0f * stats.getMaxSpeed().getModifiedValue()), ourShip.getVelocity().getY());
}
} else if (math.abs(ourShip.getVelocity().getX()) > stats.getMaxSpeed().getBaseValue() && fluxIsAtZero) {
if (ourShip.getVelocity().getX() > 0f) {
ourShip.getVelocity().set((50f + stats.getMaxSpeed().getModifiedValue()), ourShip.getVelocity().getY());
} else if (ourShip.getVelocity().getX() < 0f) {
ourShip.getVelocity().set((-1.0f * stats.getMaxSpeed().getModifiedValue() - 50f), ourShip.getVelocity().getY());
}
}
}
} else {
stats.getMaxSpeed().modifyFlat(id, 200f);
stats.getAcceleration().modifyFlat(id, 600f * effectLevel);
stats.getDeceleration().modifyMult(id, 0.2f);
stats.getTurnAcceleration().modifyFlat(id, 90f * effectLevel);
stats.getTurnAcceleration().modifyPercent(id, 200f * effectLevel);
stats.getMaxTurnRate().modifyMult(id, 2f * effectLevel);
stats.getMaxTurnRate().modifyPercent(id, 130f * effectLevel);
}
}
public void unapply(MutableShipStatsAPI stats, String id) {
stats.getMaxSpeed().unmodify(id); // to slow down ship to its regular top speed while powering drive down
stats.getMaxTurnRate().unmodify(id);
stats.getDeceleration().unmodify(id);
stats.getMaxSpeed().unmodify(id);
stats.getMaxTurnRate().unmodify(id);
stats.getTurnAcceleration().unmodify(id);
stats.getAcceleration().unmodify(id);
stats.getDeceleration().unmodify(id);
ourShip = stats.getEntity();
boolean fluxIsAtZero = false;
ship = utility.getOwner(stats);
if (ship != null) {
if (ship.getFluxTracker().getFluxLevel() == 0f) { fluxIsAtZero = true; }
}
if (ourShip.getVelocity().getY() >= stats.getMaxSpeed().getBaseValue() && !fluxIsAtZero) {
ourShip.getVelocity().set(ourShip.getVelocity().getX(), stats.getMaxSpeed().getBaseValue());
} else if (ourShip.getVelocity().getY() >= stats.getMaxSpeed().getBaseValue() && fluxIsAtZero) {
ourShip.getVelocity().set(ourShip.getVelocity().getX(), (stats.getMaxSpeed().getBaseValue() + 50.0f));
}
if (math.abs(ourShip.getVelocity().getX()) >= stats.getMaxSpeed().getBaseValue() && !fluxIsAtZero) {
if (ourShip.getVelocity().getX() > 0) {
ourShip.getVelocity().set(stats.getMaxSpeed().getBaseValue(), ourShip.getVelocity().getY());
} else if (ourShip.getVelocity().getX() < 0) {
ourShip.getVelocity().set(-1.0f * stats.getMaxSpeed().getBaseValue(), ourShip.getVelocity().getY());
}
} else if (math.abs(ourShip.getVelocity().getX()) >= (stats.getMaxSpeed().getBaseValue() + 50f) && fluxIsAtZero) {
if (ourShip.getVelocity().getX() > 0) {
ourShip.getVelocity().set((stats.getMaxSpeed().getBaseValue() + 50.0f), ourShip.getVelocity().getY());
} else if (ourShip.getVelocity().getX() < 0) {
ourShip.getVelocity().set((-1.0f * stats.getMaxSpeed().getBaseValue() - 50.0f), ourShip.getVelocity().getY());
}
}
}
public StatusData getStatusData(int index, State state, float effectLevel) {
if (index == 0) {
return new StatusData("increased engine power", false);
} else if (index == 1) {
return new StatusData("cannot decelerate", false);
}
return null;
}
}
Cycerin: The issue there is that you're clamping X and Y independently of each other. What you actually want to do is clamp speed, not velocity.x & velocity.y.I'll reply since I wrote a lot of that code:
So, some psuedocode:
float speed = Math.sqrt( velocity.x * velocity.x + velocity.y * velocity.y );
float targetspeed = some calculation involving current speed, max speed, & deceleration - basically, what speed do you actually want to be going at right now.
float multiplier = targetspeed / speed;
velocity.x = velocity.x * multiplier;
velocity.y = velocity.y * multiplier;
You may also want to do some extra work with your fluxIsAtZero value & hard-coded zero-flux speed boost of 50 to account for possible skill perks (which can allow "zero flux" to persist up to 25% flux, and/or, cause the zero flux speed boost to be 75 instead of 50.)
We tried some of that. The problem is that there is no direct code method to clamp speed itself (you can set maxSpeed but the game does not force the ship down to that if it is over that max speed and coasting, only if the player is actively holding a direction key), so you have to deal with the Vector2f velocity in some way.
Part of the problem is that from what I can tell, Starsector uses the deceleration value of a ship to determine how fast it can change its velocity vector between the X and Y directions. (as a bit of explanation, in Starsector the velocity vector X is side-to-side movement relative to the ship's heading, and Y is forward-backward movement relative to the ship's heading). So, we drop the deceleration value to prevent players from slowing down rapidly in the Y direction (you can't move forward and then stop on a dime).
Oh, I know that about #2, which is exactly why we're doing it that way (to essentially set our own forced rapid deceleration). It seemed like this was having an influence on what was happening when the player changed which keys they were pressing during the operation of the system (such as going diagonally then switching to forward-only motion while the system was engaged).Part of the problem is that from what I can tell, Starsector uses the deceleration value of a ship to determine how fast it can change its velocity vector between the X and Y directions. (as a bit of explanation, in Starsector the velocity vector X is side-to-side movement relative to the ship's heading, and Y is forward-backward movement relative to the ship's heading). So, we drop the deceleration value to prevent players from slowing down rapidly in the Y direction (you can't move forward and then stop on a dime).
That may be the problem, then, because that's not true.
1) The velocity x and y are in absolute coordinates, not relative to the facing of the ship. x is left to right and y is down to up, just like on a math graph.
2) When you set those values directly, the ship's deceleration value doesn't play into it (nor does anything else - it's just set to whatever you set it to. Well, it'll also get clamped to 600 by the engine, but that's it.)
Got it. While that shouldn't matter too much for our forced-deceleration clamping (it may have an effect, but it will be small), that actually might be what is wrong with our end-of-system capping (as opposed to clamping) where we make sure that the ship isn't moving faster than it should be. That actually would explain the cardinal-direction "bump".We tried some of that. The problem is that there is no direct code method to clamp speed itself (you can set maxSpeed but the game does not force the ship down to that if it is over that max speed and coasting, only if the player is actively holding a direction key), so you have to deal with the Vector2f velocity in some way.
Which is why I provided pseudocode to take a vector that's specified in x and y terms, and clamp by speed. For example, if targetspeed in the pseudocode I provided ended up at 100, then - after setting velocity.x and velocity.y - the overall speed would be 100. (Maybe because velocity was 100,0, or 0,100, or -70.71,70.71, or any other vector with a magnitude of 100, give or take small variations due to inaccuracies in floating point calculations.)
Edit: By comparison, if you clamp by X and Y separately, then, with a target speed of 100, you'd end up with maybe 100,0, or 100,100 - in other words, when moving diagonally, you'll end up going faster than if not moving diagonally.
Oversight on my part. Rusty java skills + smoking weed while doing vector calculations made me completely overlook the fact that we could end up with too much magnitude of velocity.
float currentSpeed = (float) math.sqrt((ourShip.getVelocity().getX() * ourShip.getVelocity().getX()) + (ourShip.getVelocity().getY() * ourShip.getVelocity().getY()));
float desiredSpeed = stats.getMaxSpeed().getBaseValue();
if (fluxIsAtZero) { desiredSpeed += 50f; }
float multiplier = desiredSpeed / currentSpeed;
if (currentSpeed > desiredSpeed) {
ourShip.getVelocity().x *= multiplier;
ourShip.getVelocity().y *= multiplier;
}
Ah... not quite. You'll want to add the +50 to desiredSpeed, not velocity.x and velocity.y.Yep, just realized that in the past 30 seconds lol
36959 [Thread-6] ERROR com.fs.starfarer.combat.D - java.lang.NullPointerException
java.lang.NullPointerException
at data.scripts.weapons.ShardOnHitEffect.onHit(ShardOnHitEffect.java:27)
at com.fs.starfarer.combat.entities.BallisticProjectile.super(Unknown Source)
at com.fs.starfarer.combat.entities.BallisticProjectile.notifyDealtDamage(Unknown Source)
at com.fs.starfarer.combat.class.super.O0OO.super(Unknown Source)
at com.fs.starfarer.combat.class.B.o00000(Unknown Source)
at com.fs.starfarer.combat.class.B.o00000(Unknown Source)
at com.fs.starfarer.combat.CombatEngine.advance(Unknown Source)
at com.fs.starfarer.combat.F.ÖÖÒ000(Unknown Source)
at com.fs.A.A.new(Unknown Source)
at com.fs.starfarer.combat.D.o00000(Unknown Source)
at com.fs.starfarer.StarfarerLauncher$2.run(Unknown Source)
at java.lang.Thread.run(Thread.java:619)
public void onHit(DamagingProjectileAPI projectile, CombatEntityAPI target, Vector2f point, boolean shieldHit, CombatEngineAPI engine) {
if (!shieldHit && target instanceof ShipAPI) {
particleVelocity.x = ((float) Math.random() * 10f); //give the particle a random velocity.
particleVelocity.y = ((float) Math.random() * 10f); //Math.random() results in a number between 0.0 and 1.0
engine.applyDamage(target, point, damageAmount, DamageType.ENERGY, empAmount, false, dealsSoftFlux, engine);
engine.addHitParticle(point, particleVelocity, particleSize, particleBrightness, particleDuration, particleColor);
soundToPlay.playSound(soundName, pitch, volume, point, particleVelocity);
}
}
particleVelocity.x = ((float) Math.random() * 10f); //give the particle a random velocity.
particleVelocity.y = ((float) Math.random() * 10f); //Math.random() results in a number between 0.0 and 1.0
package data.scripts.weapons;
import java.awt.Color;
import org.lwjgl.util.vector.Vector2f;
import com.fs.starfarer.api.combat.CombatEngineAPI;
import com.fs.starfarer.api.combat.CombatEntityAPI;
import com.fs.starfarer.api.combat.DamageType;
import com.fs.starfarer.api.combat.DamagingProjectileAPI;
import com.fs.starfarer.api.combat.OnHitEffectPlugin;
import com.fs.starfarer.api.combat.ShipAPI;
public class ExtraHitEffect implements OnHitEffectPlugin {
public void onHit(DamagingProjectileAPI projectile, CombatEntityAPI target, Vector2f point, boolean shieldHit, CombatEngineAPI engine) {
if (!shieldHit && target instanceof ShipAPI)
{
//set vairables for the partical. Could do inside the call but will do it here
float particleSize = 15f;
float particleBrightness = 1f;
float particleDuration = 2f;
Color particleColor = new Color(85, 25, 215, 255);
Vector2f particleVelocity = projectile.getVelocity(); // Lines below were causing issues, so i replaced them for testing
particleVelocity.x = ((float) Math.random() * 10f); //give the particle a random velocity.
particleVelocity.y = ((float) Math.random() * 10f); //Math.random() results in a number between 0.0 and 1.0
//set damage vairables
float damageAmount = projectile.getDamageAmount() * .25f; //extra damage is 1/4 of full
float empAmount = projectile.getEmpAmount(); //extra emp is... well full amount of normal hit
engine.applyDamage(target, point, damageAmount, DamageType.ENERGY, empAmount, false, false, projectile.getSource());
engine.addHitParticle(point, particleVelocity, particleSize, particleBrightness, particleDuration, particleColor);
//soundToPlay.playSound(soundName, pitch, volume, point, particleVelocity);
}
}
}
if (shieldHit && target instanceof ShipAPI)
{
float angle = ((float) Math.random() * 360f) - 180f;
engine.spawnProjectile(projectile.getSource(), projectile.getWeapon(),
projectile.getWeapon().getId(), point, angle, null);
}
Nice catch thereEnder nerd code, didnt even see that one. Okay heres another, trying to make a shot bounce off sheilds. i can spawn the shots by this:CodeNow i know that i can get the location of the projectile by useing "point" and i can get the location or the target by useing target.getLocation(), but can anyone show me how to calculate the angle from point to target.getLocation()? Im asumeing theres trig involved >_<if (shieldHit && target instanceof ShipAPI)
{
float angle = ((float) Math.random() * 360f) - 180f;
engine.spawnProjectile(projectile.getSource(), projectile.getWeapon(),
projectile.getWeapon().getId(), point, angle, null);
}
float angle = (float) Math.toDegrees(Vector2f.angle(point, target.getLocation());
The applyDamage will spawn the floating text if appropriate (i.e. if the target is visible, and a few other considerations). And yes, it takes armor etc into account.Strange. We actually weren't seeing the floating text until we added the floating text code.
The applyDamage will spawn the floating text if appropriate (i.e. if the target is visible, and a few other considerations). And yes, it takes armor etc into account.Strange. We actually weren't seeing the floating text until we added the floating text code.
Or was it (more likely) just adding the applyDamage amount to the normal damage floating text of the weapon itself? (basically this is bonus damage that has a chance to occur if it hits the armor or hull instead of shields).
Argh, can you help me with a basic example of implementation of adding another integer incremental?use j, k, l, m, n, whatever you want. You can even name it integer1, integer2, etc
1. is it possible to have a script that would firstly replace the starsector_title_alpha.png and secondly randomize that with every start of starsector another title would appear?
2. The number of burst determines the times a certain sound is played when a weapon is fired, right?
Is it possible to have one fixed sound for a burst of 6 projectiles. This sound would then play only once the weapon is fired.
At the moment i have a premade sound for a burst of 6 and the game is staggering the sound 6 times and that sounds ugly.
Is it possible to make a weapon with a "UNIVERSAL" type?, I don't mean universal hardpoints or turrets inside a ship file, but instead on the weapon itself, so it can be used in MISSILE, ENERGY, BALLISTIC and UNIVERSAL slots.
I'm kinda trying to make a hardpoint/turret cover "weapon", as sometimes ships benefit of not having all their slot filled, but I think open slots don't look very good.
"ui_typer_type":{ # played when text is gradually "typed out" on screen, like in the mission descriptions
"sounds":[
{"file":"sounds/TL/fx/ui/thule_ui_type01.ogg","pitch":1.0,"volume":0.3},
],
},
"ui_typer_buzz":{
"sounds":[
{"file":"sounds/TL/fx/ui/thule_ui_type01.ogg","pitch":0.5,"volume":0.3},
],
},
{
"title":"Test Mission Punk Junker",
"difficulty":"HARD",
"icon":"icon.jpg",
"background":"graphics/backgrounds/background_punk.jpg"
}
package data.scripts.world;
import com.fs.starfarer.api.campaign.CargoAPI;
import com.fs.starfarer.api.campaign.CargoAPI.CrewXPLevel;
import com.fs.starfarer.api.characters.CharacterCreationPlugin;
import com.fs.starfarer.api.characters.MutableCharacterStatsAPI;
import java.util.List;
public class IndustryCharacterCreation extends data.scripts.plugins.CharacterCreationPluginImpl {
// Not using an enum for this because Janino doesn't support it.
// It does, apparently, support using enums defined elsewhere - just can't compile new ones.
private ResponseImpl OPTION1 = new ResponseImpl("Option 1");
private ResponseImpl OPTION2 = new ResponseImpl("Option 2");
private int stage = 0;
private boolean isEntr = false;
@SuppressWarnings("unchecked")
@Override
public List getResponses() {
List result = super.getResponses();
if (stage == 0) {
result.add(OPTION1);
} else if (stage == 1) {
if (isEntr) {
result.add(OPTION2);
}
}
return result;
}
@Override
public void submit(CharacterCreationPlugin.Response response, CharacterCreationPlugin.CharacterCreationData data) {
super.submit(response, data);
stage++;
MutableCharacterStatsAPI stats = data.getPerson().getStats();
if (response == OPTION1) {
stats.addAptitudePoints(1);
stats.addSkillPoints(2);
data.getStartingCargo().getCredits().add(2000);
isEntr = true;
}
if (response == OPTION2) {
stats.addAptitudePoints(1);
stats.addSkillPoints(2);
data.addStartingShipChoice("buffalo_Standard");
data.getStartingCargo().getCredits().add(2000f);
}
}
@Override
public void startingShipPicked(String variantId, CharacterCreationPlugin.CharacterCreationData data) {
super.startingShipPicked(variantId, data);
if (variantId.equals("buffalo_Standard")) {
data.getStartingCargo().addFuel(20);
data.getStartingCargo().addSupplies(20);
data.getStartingCargo().addItems(CargoAPI.CargoItemType.RESOURCES, "omncompl_uncmaterial", 200);
data.getStartingCargo().addCrew(CrewXPLevel.GREEN, 10);
data.getStartingCargo().addMarines(2);
}
}
}
package data.scripts.plugins;
...
@Override
public void startingShipPicked(String variantId, CharacterCreationPlugin.CharacterCreationData data) {
if (variantId.equals("buffalo_Standard")) {
data.getStartingCargo().addFuel(20);
data.getStartingCargo().addSupplies(20);
data.getStartingCargo().addItems(CargoAPI.CargoItemType.RESOURCES, "omncompl_uncmaterial", 200);
data.getStartingCargo().addCrew(CrewXPLevel.GREEN, 10);
data.getStartingCargo().addMarines(2);
return;
}
super.startingShipPicked(variantId, data);
}
Well the reason your script works now is because the package points to the world folder, not the script folder, if you wanted that to be different, just change the package.With world, are you talking about data\scripts\world (which it was pointing to) or data\world? For your answer, I was asking about adding or replacing the ship you start with, not place it in your starting fleet (if that was how you understood it, the asnwer was rather vague).
As for your question; I think the campaign holds the functions you are looking for, if I remember correctly though its pretty much the same thing as your script.
"package data.scripts.world;" this means the script will only run in data/scripts/world, if you want it to run somewhere else eg: data/scripts/startingstuff you have to change the package ->I also did, as you can see it extends that class. The issue was that I had package data.scripts.world and it was in data\scripts\world, but didn't run. Changing it to package data.scripts.plugins and putting it in data\scripts\plugins however made it run.
package data.scripts.startingstuff;
Isn't CharacterCreationPluginImpl.java the place to look for this? Since it creates your starting ship?
I also did, as you can see it extends that class. The issue was that I had package data.scripts.world and it was in data\scripts\world, but didn't run. Changing it to package data.scripts.plugins and putting it in data\scripts\plugins however made it run.
I figured it was something along those lines, but had to learn it the hard way xD. Thanks for the clarification, might help avoid similar issues in the future.I also did, as you can see it extends that class. The issue was that I had package data.scripts.world and it was in data\scripts\world, but didn't run. Changing it to package data.scripts.plugins and putting it in data\scripts\plugins however made it run.
This is because data/scripts/plugins is a special folder. All scripts in this folder that implement a plugin will be automatically added to the game, and for all plugins except combat plugins (which can be added via mission definitions) this is the only way to activate them.
How do you mod the starting player fleet? And the various explanations for each variable inside it.To be more clear, is it just the fleet you want to modify (add ships, resources, weapons, etc.) or modify/add the starting options?
Been a while....
CargoAPI cargo = Global.getSector().getPlayerFleet().getCargo();
cargo.addItems(CargoAPI.CargoItemType.RESOURCES, "supplies", 20);
cargo.addMothballedShip(FleetMemberType.SHIP, "ID", null);
cargo.addWeapons("id", 3);
Starting options :),
Like how, before the last update, you would just do it in the data/world/factions/player.faction file
package data.scripts.plugins;
import com.fs.starfarer.api.campaign.CargoAPI;
import com.fs.starfarer.api.campaign.CargoAPI.CrewXPLevel;
import com.fs.starfarer.api.characters.CharacterCreationPlugin;
import com.fs.starfarer.api.characters.MutableCharacterStatsAPI;
import java.util.ArrayList;
import java.util.List;
public class IndustryCharacterCreation extends data.scripts.plugins.CharacterCreationPluginImpl {
// Not using an enum for this because Janino doesn't support it.
// It does, apparently, support using enums defined elsewhere - just can't compile new ones.
private ResponseImpl OPTION1 = new ResponseImpl("option 1 text");
private ResponseImpl OPTION2 = new ResponseImpl("option 2 text");
private int stage = 0;
private boolean isEntr = false;
@SuppressWarnings("unchecked")
@Override
public List getResponses() {
List result = new ArrayList();
if (stage == 0) {
result.add(OPTION1);
} else if (stage == 1) {
if (isEntr) {
result.add(OPTION2);
}
}
result.addAll(super.getResponses());
return result;
}
@Override
public void submit(CharacterCreationPlugin.Response response, CharacterCreationPlugin.CharacterCreationData data) {
super.submit(response, data);
stage++;
MutableCharacterStatsAPI stats = data.getPerson().getStats();
if (response == OPTION1) {
stats.addAptitudePoints(1);
stats.addSkillPoints(2);
data.getStartingCargo().getCredits().add(2000);
isEntr = true;
}
if (response == OPTION2) {
stats.addAptitudePoints(1);
stats.addSkillPoints(2);
data.addStartingShipChoice("buffalo_Standard");
data.getStartingCargo().getCredits().add(2000f);
}
}
@Override
public void startingShipPicked(String variantId, CharacterCreationPlugin.CharacterCreationData data) {
if (variantId.equals("buffalo_Standard")) {
data.getStartingCargo().addFuel(20);
data.getStartingCargo().addSupplies(20);
data.getStartingCargo().addItems(CargoAPI.CargoItemType.RESOURCES, "omncompl_uncmaterial", 200);
data.getStartingCargo().addCrew(CrewXPLevel.GREEN, 10);
data.getStartingCargo().addMarines(2);
return;
}
super.startingShipPicked(variantId, data);
}
}
package data.scripts.plugins;
import com.fs.starfarer.api.campaign.CargoAPI;
import com.fs.starfarer.api.campaign.CargoAPI.CrewXPLevel;
import com.fs.starfarer.api.characters.CharacterCreationPlugin;
import com.fs.starfarer.api.characters.MutableCharacterStatsAPI;
import java.util.ArrayList;
import java.util.List;
public class IndustryCharacterCreation extends data.scripts.plugins.CharacterCreationPluginImpl {
// Not using an enum for this because Janino doesn't support it.
// It does, apparently, support using enums defined elsewhere - just can't compile new ones.
private ResponseImpl OPTION1 = new ResponseImpl("You started a company which became sucessful...");
private ResponseImpl OPTION2 = new ResponseImpl("... and lost it all to pirates.");
private int stage = 0;
private boolean isEntr = false;
@SuppressWarnings("unchecked")
@Override
public List getResponses() {
List result = new ArrayList();
if (stage == 0) {
result.add(OPTION1);
} else if (stage == 1) {
if (isEntr) {
result.add(OPTION2);
}
}
result.addAll(super.getResponses());
return result;
}
@Override
public void submit(CharacterCreationPlugin.Response response, CharacterCreationPlugin.CharacterCreationData data) {
super.submit(response, data);
stage++;
MutableCharacterStatsAPI stats = data.getPerson().getStats();
if (response == OPTION1) {
stats.addAptitudePoints(1);
stats.addSkillPoints(2);
data.getStartingCargo().getCredits().add(2000);
isEntr = true;
}
if (response == OPTION2) {
stats.addAptitudePoints(1);
stats.addSkillPoints(2);
data.addStartingShipChoice("buffalo_Standard");
data.getStartingCargo().getCredits().add(2000f);
}
}
@Override
public void startingShipPicked(String variantId, CharacterCreationPlugin.CharacterCreationData data) {
if (variantId.equals("buffalo_Standard")) {
data.getStartingCargo().addFuel(20);
data.getStartingCargo().addSupplies(20);
data.getStartingCargo().addItems(CargoAPI.CargoItemType.RESOURCES, "omncompl_uncmaterial", 200);
data.getStartingCargo().addCrew(CrewXPLevel.GREEN, 10);
data.getStartingCargo().addMarines(2);
return;
}
super.startingShipPicked(variantId, data);
}
}
package data.scripts.plugins;
import java.util.ArrayList;
import java.util.List;
import com.fs.starfarer.api.campaign.CargoAPI.CrewXPLevel;
import com.fs.starfarer.api.characters.CharacterCreationPlugin;
import com.fs.starfarer.api.characters.MutableCharacterStatsAPI;
public class CharacterCreationPluginImpl implements CharacterCreationPlugin {
public static class ResponseImpl implements Response {
private String text;
public ResponseImpl(String text) {
this.text = text;
}
public String getText() {
return text;
}
}
// Not using an enum for this because Janino doesn't support it.
// It does, apparently, support using enums defined elsewhere - just can't compile new ones.
private ResponseImpl SUPPLY_OFFICER = new ResponseImpl("Served as a junior supply officer in an independent system's navy");
private ResponseImpl GUNNER = new ResponseImpl("Hired out as a gunner on a mercenary ship");
private ResponseImpl ENGINEER = new ResponseImpl("Found employment as an assistant engineer on an exploration vessel");
private ResponseImpl COPILOT = new ResponseImpl("Spent time as a co-pilot on a patrol ship in an independent system");
private ResponseImpl SOMETHING_ELSE_1 = new ResponseImpl("Did something else");
private ResponseImpl ADJUTANT = new ResponseImpl("Served as an adjutant in the Hegemony Navy");
private ResponseImpl QUARTERMASTER = new ResponseImpl("Performed the duties of a quartermaster on an independent warship");
private ResponseImpl HELM = new ResponseImpl("Helmed a patrol ship operating in a backwater system");
private ResponseImpl COMBAT_ENGINEER = new ResponseImpl("Took over the duties of chief combat engineer during a lengthy campaign");
private ResponseImpl SOMETHING_ELSE_2 = new ResponseImpl("Did something else");
private int stage = 0;
private String [] prompts = new String [] {
"Early in your career, you...",
"More recently, you...",
};
public String getPrompt() {
if (stage < prompts.length) return prompts[stage];
return null;
}
@SuppressWarnings("unchecked")
public List getResponses() {
List result = new ArrayList();
if (stage == 0) {
result.add(SUPPLY_OFFICER);
result.add(GUNNER);
result.add(ENGINEER);
result.add(COPILOT);
result.add(SOMETHING_ELSE_1);
} else if (stage == 1) {
result.add(ADJUTANT);
result.add(QUARTERMASTER);
result.add(HELM);
result.add(COMBAT_ENGINEER);
result.add(SOMETHING_ELSE_2);
}
return result;
}
public void submit(Response response, CharacterCreationData data) {
if (stage == 0) { // just in case
data.addStartingShipChoice("shuttle_Attack");
}
stage++;
MutableCharacterStatsAPI stats = data.getPerson().getStats();
if (response == SUPPLY_OFFICER) {
stats.increaseAptitude("leadership");
stats.increaseSkill("fleet_logistics");
stats.increaseSkill("command_experience");
data.getStartingCargo().getCredits().add(3000f);
} else if (response == GUNNER) {
stats.increaseAptitude("combat");
stats.increaseSkill("ordnance_expert");
stats.increaseSkill("target_analysis");
data.getStartingCargo().getCredits().add(3000f);
} else if (response == ENGINEER) {
stats.increaseAptitude("technology");
stats.increaseSkill("field_repairs");
stats.increaseSkill("mechanical_engineering");
data.getStartingCargo().getCredits().add(3000f);
} else if (response == COPILOT) {
stats.increaseAptitude("combat");
stats.increaseSkill("helmsmanship");
stats.increaseSkill("evasive_action");
data.getStartingCargo().getCredits().add(3000f);
} else if (response == SOMETHING_ELSE_1) {
stats.addAptitudePoints(1);
stats.addSkillPoints(2);
data.getStartingCargo().getCredits().add(1000f);
}
else if (response == ADJUTANT) {
stats.increaseAptitude("leadership");
stats.increaseSkill("fleet_logistics");
stats.increaseSkill("advanced_tactics");
data.addStartingShipChoice("lasher_Standard");
data.getStartingCargo().getCredits().add(3000f);
} else if (response == QUARTERMASTER) {
stats.increaseAptitude("technology");
stats.increaseSkill("navigation");
stats.addSkillPoints(1);
data.addStartingShipChoice("wolf_CS");
data.getStartingCargo().getCredits().add(3000f);
} else if (response == HELM) {
stats.increaseAptitude("combat");
stats.increaseSkill("helmsmanship");
stats.increaseSkill("evasive_action");
data.addStartingShipChoice("vigilance_Standard");
data.getStartingCargo().getCredits().add(3000f);
} else if (response == COMBAT_ENGINEER) {
stats.increaseAptitude("combat");
stats.increaseSkill("damage_control");
stats.increaseSkill("flux_modulation");
data.addStartingShipChoice("lasher_Standard");
data.getStartingCargo().getCredits().add(3000f);
} else if (response == SOMETHING_ELSE_2) {
stats.addAptitudePoints(1);
stats.addSkillPoints(2);
data.addStartingShipChoice("hound_Assault");
data.getStartingCargo().getCredits().add(1000f);
}
}
public void startingShipPicked(String variantId, CharacterCreationData data) {
MutableCharacterStatsAPI stats = data.getPerson().getStats();
stats.addAptitudePoints(1);
stats.addSkillPoints(2);
if (variantId.equals("vigilance_Standard")) {
data.getStartingCargo().addFuel(20);
data.getStartingCargo().addSupplies(30);
data.getStartingCargo().addCrew(CrewXPLevel.REGULAR, 20);
data.getStartingCargo().addMarines(5);
} else
if (variantId.equals("lasher_Standard")) {
data.getStartingCargo().addFuel(20);
data.getStartingCargo().addSupplies(20);
data.getStartingCargo().addCrew(CrewXPLevel.REGULAR, 40);
data.getStartingCargo().addMarines(10);
} else
if (variantId.equals("wolf_CS")) {
data.getStartingCargo().addFuel(20);
data.getStartingCargo().addSupplies(20);
data.getStartingCargo().addCrew(CrewXPLevel.REGULAR, 22);
data.getStartingCargo().addMarines(7);
} else
if (variantId.equals("shuttle_Attack")) {
data.getStartingCargo().addFuel(10);
data.getStartingCargo().addSupplies(10);
data.getStartingCargo().addCrew(CrewXPLevel.REGULAR, 10);
data.getStartingCargo().addMarines(3);
} else
if (variantId.equals("hound_Assault")) {
data.getStartingCargo().addFuel(30);
data.getStartingCargo().addSupplies(40);
data.getStartingCargo().addCrew(CrewXPLevel.REGULAR, 25);
data.getStartingCargo().addMarines(15);
} else {
data.getStartingCargo().addFuel(20);
data.getStartingCargo().addSupplies(20);
data.getStartingCargo().addCrew(CrewXPLevel.REGULAR, 20);
data.getStartingCargo().addMarines(10);
}
}
}
Since when is it this complicated :O
The basic stuff for setting up the rest. As was mentioned before, this needs to be in data\scripts\plugins to work properly. I have given the class its own name, so it should not overwrite anything else and potentially become incompatibly with other mods. I extend the class in starsector-core instead of implementing the interface characterCreationPlugin. I can't comment on what would be best to do, expecially in context with compatibility with other mods.
Thank you for the clarification. That kinda blows :/The basic stuff for setting up the rest. As was mentioned before, this needs to be in data\scripts\plugins to work properly. I have given the class its own name, so it should not overwrite anything else and potentially become incompatibly with other mods. I extend the class in starsector-core instead of implementing the interface characterCreationPlugin. I can't comment on what would be best to do, expecially in context with compatibility with other mods.
According to Alex, the game will only accept one implementation of any one type of plugin*, and it will use the first implementation it finds. Any mod that has it own character creation plugin would be incompatible with your mod.
* Except EveryFrameCombatPlugin.
Thank you for the clarification. That kinda blows :/The basic stuff for setting up the rest. As was mentioned before, this needs to be in data\scripts\plugins to work properly. I have given the class its own name, so it should not overwrite anything else and potentially become incompatibly with other mods. I extend the class in starsector-core instead of implementing the interface characterCreationPlugin. I can't comment on what would be best to do, expecially in context with compatibility with other mods.
According to Alex, the game will only accept one implementation of any one type of plugin*, and it will use the first implementation it finds. Any mod that has it own character creation plugin would be incompatible with your mod.
* Except EveryFrameCombatPlugin.
Do you know if character creation is called before the generators?
package data.characters.skills.scripts;
import com.fs.starfarer.api.characters.CharacterStatsSkillEffect;
import com.fs.starfarer.api.characters.MutableCharacterStatsAPI;
import data.scripts.world.ProdInfo;
public class omncompl_RepairComplexEffect implements CharacterStatsSkillEffect
{
@Override
public void apply(MutableCharacterStatsAPI stats, String id, float level)
{
}
@Override
public void unapply(MutableCharacterStatsAPI stats, String id)
{
}
@Override
public String getEffectDescription(float level)
{
//ProdInfo pro = new ProdInfo((int)level);
return "Total";
}
@Override
public String getEffectPerLevelDescription()
{
//ProdInfo pro = new ProdInfo(0);
return "Level";
}
@Override
public ScopeDescription getScopeDescription()
{
return ScopeDescription.ALL_OUTPOSTS;
}
}
package data.scripts.world;
import java.util.ArrayList;
public final class ProdInfo {
ArrayList<Integer> wepAmount = new ArrayList<Integer>();
ArrayList<Integer> shipAmount = new ArrayList<Integer>();
public ProdInfo(int level) {
wepAmount.add(2 * level + 2);
wepAmount.add(1 * level + 1);
wepAmount.add(1 * level + 1);
wepAmount.add((int) Math.floor(0.5 * level));
shipAmount.add((int) Math.floor(1.5 * level) + 1);
shipAmount.add(1 * level + 1);
shipAmount.add((int) Math.floor(2D / 3D * level));
shipAmount.add((int) Math.floor(0.5 * level));
shipAmount.add((int) Math.floor(2D / 7D * level));
}
public ProdInfo() {
wepAmount.add(0);
wepAmount.add(0);
wepAmount.add(0);
wepAmount.add(0);
shipAmount.add(0);
shipAmount.add(0);
shipAmount.add(0);
shipAmount.add(0);
shipAmount.add(0);
}
public String getTotal() {
return "Weapons:" + w(0) + w(1) + w(3) + ", ships:" + s(0) + s(1) + s(2) + s(3) + s(4);
}
public String getLevel() {
return "Weapons: + 2 + 1 + 1/2, ships: + 1 1/2 + 1 + 2/3 + 1/2 + 2/7";
}
public String getString() {
if (true) {
return getLevel();
}
else {
return getTotal();
}
}
public String w(int size) {
return " + " + wepAmount.get(size);
}
public String s(int size) {
return " + " + shipAmount.get(size);
}
}
The basic stuff for setting up the rest. As was mentioned before, this needs to be in data\scripts\plugins to work properly. I have given the class its own name, so it should not overwrite anything else and potentially become incompatibly with other mods. I extend the class in starsector-core instead of implementing the interface characterCreationPlugin. I can't comment on what would be best to do, expecially in context with compatibility with other mods.
According to Alex, the game will only accept one implementation of any one type of plugin*, and it will use the first implementation it finds. Any mod that has it own character creation plugin would be incompatible with your mod.
* Except EveryFrameCombatPlugin.
A correction to this. I just accidently started Uomoz's Corvus 17 with my Frieghter Start mod and it worked. I am not sure if it is a coincidence, due to Uomoz's having the same name as the original file in starsector-core and thus overwriting it, and mine inherits from it (so it ends up inheriting Uomoz's?).
A correction to this. I just accidently started Uomoz's Corvus 17 with my Frieghter Start mod and it worked. I am not sure if it is a coincidence, due to Uomoz's having the same name as the original file in starsector-core and thus overwriting it, and mine inherits from it (so it ends up inheriting Uomoz's?).
Yes. Your code extends CharacterCreationPluginImpl, and Uomoz's Corvus overwrites the vanilla version of that file, so your code would be Uomoz's character creation plugin plus whatever changes you made on top of it.
Edit: if your plugin was chosen, that is; otherwise it would just be Uomoz's Corvus chargen. I don't know exactly how loading priority is handled, but I don't think you can guarantee your plugin would be the one picked.
I thought that impact didn't work the way it was intended?
"impact" only works for beams. It's kind of a holdover - it's nice enough for the Graviton Beam, which is why it's still in the game, but really didn't work well when applied to other weapons. Just didn't feel right.
I can't give you an exact answer as to the "pushing power". Just have to experiment with it until it feels right. It's in the same units and scale as mass, though.
Yeah but it gets distracted while it stays in the center of the system roaming around. It doesen't even start to move towards the despawn location. Is there any way to fleet.setlocation in a different method then the one used to spawn the fleet? is there any way to manipulate a fleet position after it's being created, like using completion scripts?
Yeah but it gets distracted while it stays in the center of the system roaming around. It doesen't even start to move towards the despawn location. Is there any way to fleet.setlocation in a different method then the one used to spawn the fleet? is there any way to manipulate a fleet position after it's being created, like using completion scripts?
fleet.getLocation().set(x, y);
You can do this with every method that returns a Vector2f, though how much of a good idea that is varies based on the specifics.
Here's the javadoc for Vector2f, for reference:
http://lwjgl.org/javadoc/org/lwjgl/util/vector/Vector2f.html
package data.scripts;
import com.fs.starfarer.api.Script;
import com.fs.starfarer.api.campaign.CampaignFleetAPI;
public abstract class FleetScript implements Script
{
private final CampaignFleetAPI fleet;
public FleetScript(CampaignFleetAPI fleet)
{
this.fleet = fleet;
}
public CampaignFleetAPI getFleet()
{
return fleet;
}
public abstract void run();
}
Is it possible to have mods load up on old saves?
I'm asking because i got quite good game going on Uomoz's Corvus and would like to add Fleet Control to the mix, but don't feel like starting yet again from start :( (few too many restarts recently)
(if this has been asked and answered before, sorry that i missed it)
edit: the skills from FC add up to old save, however the planets do not.
Yeah but it gets distracted while it stays in the center of the system roaming around. It doesen't even start to move towards the despawn location. Is there any way to fleet.setlocation in a different method then the one used to spawn the fleet? is there any way to manipulate a fleet position after it's being created, like using completion scripts?
fleet.getLocation().set(x, y);
You can do this with every method that returns a Vector2f, though how much of a good idea that is varies based on the specifics.
Here's the javadoc for Vector2f, for reference:
http://lwjgl.org/javadoc/org/lwjgl/util/vector/Vector2f.html
I think he was asking how to keep the reference to the fleet object outside of the method that creates it.
If all you want is to have access to the fleet in its assignment script, you can write your own implementation of Script that accepts a CampaignFleetAPI as an argument in its constructor. Something like this:Codepackage data.scripts;
import com.fs.starfarer.api.Script;
import com.fs.starfarer.api.campaign.CampaignFleetAPI;
public abstract class FleetScript implements Script
{
private final CampaignFleetAPI fleet;
public FleetScript(CampaignFleetAPI fleet)
{
this.fleet = fleet;
}
public CampaignFleetAPI getFleet()
{
return fleet;
}
public abstract void run();
}
With this, all you need to do is change the new Script() { // blah } to new FleetScript(fleet) { // blah } in your convoy file, and you'll have access to the fleet object in your run() method.
Is there any way to force the hit glow radius on a beam weapon? I made a custom graphic beam with a really wide sprite and the hit glow is enormous. Since beams dont have a proj file I'm not sure where to rectify this. And yes, I've tried adding glow radius and hitglow radius to the weapon file.What if you leave blank space in the sprite on either side of the beam to force it smaller? If it's always 3X the size, then making the sprite bigger, if not the actual visible part, would force the engine to scale it down.
Hey guys,
for my bioships i wanted to implement a mechanic which lets age the ships.
design wise i thought the bioships would come in fixed variants depending on the actual age of the ship. The ships
would have only build-in weapons. Only hullmods and the number of vents and capacitators could be changed.
For example you could buy a newborn ship (the stats like speed, armor etc. would reflect the age of the ship although)
and after a specific time the ship would have aged enough to enter its next phase of life.
Would something like this be moddable?
I wished to ask, if it is possible to render a weapon below the ship sprite ?
If you're curious as to why:
http://fractalsoftworks.com/forum/index.php?topic=2844.msg39103#msg39103
Edit - Just, out of pure and obscene curiosity .. Do Large "Decorative" weapons render above small (missile) weapon mounts ?
So long as they're in a "turret" type slot, yeah. Turrets render above hardpoints, and within each type, larger weapons render later.
In fact, I'm looking forward to seeing the results!
7197 [Thread-6] WARN com.fs.starfarer.loading.WeaponSpreadsheetLoader - Weapon [irpulser] from weapon_data.csv not found in store
7197 [Thread-6] WARN com.fs.starfarer.loading.WeaponSpreadsheetLoader - Weapon [disruptors] from weapon_data.csv not found in store
7198 [Thread-6] INFO com.fs.starfarer.loading.WeaponSpreadsheetLoader - Applying data from weapon_data.csv to [flarelauncher1]
7265 [Thread-6] ERROR com.fs.starfarer.combat.D - java.lang.IllegalArgumentException: No enum const class com.fs.starfarer.api.combat.WeaponAPI$AIHints.36
java.lang.IllegalArgumentException: No enum const class com.fs.starfarer.api.combat.WeaponAPI$AIHints.36
at java.lang.Enum.valueOf(Enum.java:196)
at com.fs.starfarer.loading.K.super(Unknown Source)
at com.fs.starfarer.loading.WeaponSpreadsheetLoader.Ò00000(Unknown Source)
at com.fs.starfarer.loading.SpecStore.Ò00000(Unknown Source)
at com.fs.starfarer.loading.H.super(Unknown Source)
at com.fs.A.A.new(Unknown Source)
at com.fs.starfarer.combat.D.o00000(Unknown Source)
at com.fs.starfarer.StarfarerLauncher$2.run(Unknown Source)
at java.lang.Thread.run(Thread.java:619)
Thank you :) Heres the "final" sprite, with the changes I proposed earlier.
As I said, with additional vertical line - an uninitiated viewer wouldnt know better.
(otherwise.. change the shading, had a leap of logic there..)Spoiler(http://oi48.tinypic.com/2uti6g3.jpg)[close]
Edit - ill stop advert. right here. :p
Another question rises. I had an idea of using a "glow" from weapons to appear as..
sort of a energy barrier (for carrier hangars for example..)
However.. it doesnt show up in game, so my question is - is it possible to just use
"glow" from decorative weapons at all?
SpoilerError while loading, not sure what it means. All I did to change from the past version of the mod that is working was add one weapon 'irpulser' to the .csv and a renamed clone of the normal irpulse.Code7197 [Thread-6] WARN com.fs.starfarer.loading.WeaponSpreadsheetLoader - Weapon [irpulser] from weapon_data.csv not found in store
7197 [Thread-6] WARN com.fs.starfarer.loading.WeaponSpreadsheetLoader - Weapon [disruptors] from weapon_data.csv not found in store
7198 [Thread-6] INFO com.fs.starfarer.loading.WeaponSpreadsheetLoader - Applying data from weapon_data.csv to [flarelauncher1]
7265 [Thread-6] ERROR com.fs.starfarer.combat.D - java.lang.IllegalArgumentException: No enum const class com.fs.starfarer.api.combat.WeaponAPI$AIHints.36
java.lang.IllegalArgumentException: No enum const class com.fs.starfarer.api.combat.WeaponAPI$AIHints.36
at java.lang.Enum.valueOf(Enum.java:196)
at com.fs.starfarer.loading.K.super(Unknown Source)
at com.fs.starfarer.loading.WeaponSpreadsheetLoader.Ò00000(Unknown Source)
at com.fs.starfarer.loading.SpecStore.Ò00000(Unknown Source)
at com.fs.starfarer.loading.H.super(Unknown Source)
at com.fs.A.A.new(Unknown Source)
at com.fs.starfarer.combat.D.o00000(Unknown Source)
at com.fs.starfarer.StarfarerLauncher$2.run(Unknown Source)
at java.lang.Thread.run(Thread.java:619)
Halp?[close]
You wouldn't be able to transfer any damage the ship had taken to the next phase and the player would need to manually re-add the vents/caps/hullmods each time it evolved; other than that, I don't see any problems with the concept.
It might be frustrating if the player has no control over when it happens, though. :)
This is probably a silly question if you understand the Java structure, but my Fortran-addled mind is struggling- how would I apply a change to a mutableStat by 'default'? I'm trying to construct a hull that has a naff shield counterbalanced by a reduced overload time, which is doable with getOverloadTimeMod() in a hullmod but I'm not entirely sure how to make that a property of the vessel itself.
During balance testing for Starfighter I noticed that the Command (Player-usable) variants of fighters have very different tactics than the fighters.
Will changing the Command Fighter's class from Frigate to Fighter change anything aside from the AI's tactics? Not sure if that would make them unable to be piloted by the player or not :/
So, was trying to do some balance adjustments to skills... is there any way to make a skill that adds a fixed amount of ordnance points that varies by hull size? I can make one that, for example, adds +10 ordnance points to all ships... which is nice for frigates, but almost meaningless for capital ships. Ideally, I'd like a skill that, at 10 ranks, adds +10/+20/+40/+80 ordnance points, to frigates / destroyers / cruisers / capital ships, respectively.
So, was trying to do some balance adjustments to skills... is there any way to make a skill that adds a fixed amount of ordnance points that varies by hull size? I can make one that, for example, adds +10 ordnance points to all ships... which is nice for frigates, but almost meaningless for capital ships. Ideally, I'd like a skill that, at 10 ranks, adds +10/+20/+40/+80 ordnance points, to frigates / destroyers / cruisers / capital ships, respectively.
Hmm. No way to vary it by hull size. A percentage bonus would be the best fallback, though I'm sure you'd already thought of that.
{
"id":"light",
"specClass":"projectile",
"type":"DECORATIVE",
"size":"SMALL",
"everyFrameEffect":"data.scripts.plugins.isHulkCheck",
"turretSprite":"graphics/weapons/decorative/light00.png",
"hardpointSprite":"graphics/weapons/decorative/light00.png",
"numFrames":9,
"frameRate":6,
"alwaysAnimate":"true",
"turretOffsets":[0, 0],
"turretAngleOffsets":[0],
"hardpointOffsets":[0, 0],
"hardpointAngleOffsets":[0],
"barrelMode":"ALTERNATING", # or LINKED. whether barrels fire at the same time or alternate.
"animationType":"MUZZLE_FLASH", # NONE, GLOW, MUZZLE_FLASH, SMOKE
"muzzleFlashSpec":{"length":0.0, # only used if animationType = MUZZLE_FLASH
"spread":10,
"particleSizeMin":4.0,
"particleSizeRange":18.0,
"particleDuration":0.2,
"particleCount":25,
"particleColor":[255,150,30,200]},
"projectileSpecId":"shredder_shot", # projectile that will be fired
"fireSoundOne":"gun_mechanicals_medium_up_whirr",
"fireSoundTwo":"gun_medium_2",
}
my turn !
im having trouble with the sound effect line in weapon codes. the file name entered dosent match the file name in the sound folder.
e.g.: in the pulse laser's weapon data, the sound effect line reads "energy_pulse" even tho the sound file that is used for this gun is "fire_beam_burst01"
so im wondering, when ill be modding my guns, what am i supposed to write on that line ?
my turn !
im having trouble with the sound effect line in weapon codes. the file name entered dosent match the file name in the sound folder.
e.g.: in the pulse laser's weapon data, the sound effect line reads "energy_pulse" even tho the sound file that is used for this gun is "fire_beam_burst01"
so im wondering, when ill be modding my guns, what am i supposed to write on that line ?
The sounds used in your weapon files and code are defined in data/config/sounds.json. If you look at this file, you'll see that it maps a key (in this case energy_pulse) to different sound files (fire_beam_burst01). So you put the key in your weapon file, and Starsector looks up what sound file is assigned to it.
Why is Starsector set up this way? Well, first of all, it means if you change your sound effect file, you only need to modify sounds.json instead of every single place that sound is used in the code. Second, you can have multiple sounds for the same key, in which case the game chooses a random sound from that list. This is very useful for repeating sounds like explosions or bullet collisions, since having the exact same sound play 30 times in a row is very noticeable. Finally, this setup means that multiple mods can add extra sounds for the same key without having conflicts.
"fringeColor":[50,50,155,255],
"coreColor":[255,255,255,100],
"glowColor":[100,100,255,255],
Make this green please?Code"fringeColor":[50,50,155,255],
"coreColor":[255,255,255,100],
"glowColor":[100,100,255,255],
Will someone help me turn a beam weapon into a kind of autopulse cannon please?
In data/world/factions/<faction>.faction, under portraits. Add them to player.faction if you want them to be selectable at character creation.Thankyou :D
Your lucky I had to look through the files to find out how to do it :( (I like Orky Portraits)In data/world/factions/<faction>.faction, under portraits. Add them to player.faction if you want them to be selectable at character creation.Thankyou :D
Your lucky I had to look through the files to find out how to do it :( (I like Orky Portraits)
ok, another one but very insignifiant.
in-game, in the weapon cards, under the weapon's name where it says stuff like "assault", "PD" and "no description yet"
where do i go to change that ? i cant seem to find it ???
ok, another one but very insignifiant.
in-game, in the weapon cards, under the weapon's name where it says stuff like "assault", "PD" and "no description yet"
where do i go to change that ? i cant seem to find it ???
i must reiterate.
help please ?
ok, another one but very insignifiant.
in-game, in the weapon cards, under the weapon's name where it says stuff like "assault", "PD" and "no description yet"
where do i go to change that ? i cant seem to find it ???
i must reiterate.
help please ?
Description.csv
"light_antimatter_laser","WEAPON","A smaller version of the antiproton cannon, firing high intesity bolts in long bursts at huge distances, its high energy consumtion limits it to destroyers and above.",Assault,,
Quote"light_antimatter_laser","WEAPON","A smaller version of the antiproton cannon, firing high intesity bolts in long bursts at huge distances, its high energy consumtion limits it to destroyers and above.",Assault,,
its supposed to look like this, it will say what role the weapon has and its description on the weapon when you mouse over it in refit or codex or whatever.
Is it possible to have a decorative weapon effect to be bound to engines? Like an animation for idle, acceleration, decceleration and zero flux speed buff?
SpoilerThank you Alex for the quick reply.
Here is a concept of what i want to achieve.
(http://i.imgur.com/zpIm1fq.gif)(http://i.imgur.com/0PKDDG2.gif)
Depending on speed the Alphavalue would change and the speed of the rotation of the image.
I guess it is possible to have the decorative weapon be rendered under the actual ship sprite?[close]
Actually *does* nothing. Just a balance reminder for myself - the flux vent rate is generally 8/6/5/4% of the capacity, depending on hull size (smaller = vent faster). The value in that column is what the capacity would be if it were based solely on that.
Hmm. Let me see about allowing decorative slots to render under the hull...
I think he said sometime or another that there was an issue with the shots rendering funky when he did that :)Hmm. Let me see about allowing decorative slots to render under the hull...
Can you also do this for all weapons PLEASE :D
is it possible to change how fast a weapon rotates while firing/on cooldown independent of default rotate speed?
I'm trying to make an "assault beam" weapon that doesn't rotate too fast while idle but can still catch up to frigs n stuff while firing
So is there absolutely no way to randomize dialog?
I'd love to have people say something other than a single phrase when I met their fleets.
So is there absolutely no way to randomize dialog?
I'd love to have people say something other than a single phrase when I met their fleets.
Would be cool if it would work like with the soundfiles, where it picks one randomly if offered multiple choices.
hey hey its me again, noob apprentice mod maker.
this time, the problem is with one of my weapon.
its branded as a PD weapon with 3 barrels (like the heavy autocannon), lower damage than average but much faster fire-rate. its turn rate is the same as the vulcan.
yet, unless the missile is coming dead-on the gun, they cant track them and keep lagging behind.
say a harpoon streak by the ship, the gun just keep shooting, lagging only slightly behind the missile :S
hey hey its me again, noob apprentice mod maker.
this time, the problem is with one of my weapon.
its branded as a PD weapon with 3 barrels (like the heavy autocannon), lower damage than average but much faster fire-rate. its turn rate is the same as the vulcan.
yet, unless the missile is coming dead-on the gun, they cant track them and keep lagging behind.
say a harpoon streak by the ship, the gun just keep shooting, lagging only slightly behind the missile :S
I think I remember someone having a similar problem a while back. If I recall correctly, you need to have the middle barrel of your gun be the first defined in the .weapon file so it uses that one to aim.
Target leading accuracy isn't perfect, it depends on your ship's crew level and your character's skills. Try testing with Elite crew and see if there's a difference. :)
{
"id":"thule_light_hunker_shot",
"specClass":"projectile",
"spawnType":"BALLISTIC",
"collisionClass":"PROJECTILE_FF",
"collisionClassByFighter":"PROJECTILE_FIGHTER",
"length":20.0,
"width":4.5,
"fadeTime":0.2,
"fringeColor":[165,75,255,255],
"coreColor":[245,235,255,255],
"textureScrollSpeed":64.0,
"pixelsPerTexel":5.0,
"bulletSprite":"graphics/TL/missiles/thule_shell_medium.png",
"behaviorSpec":{"behavior":"PROXIMITY_FUSE",
"range":25,
"explosionSpec":{"duration":0.1f,
"radius":35,
"coreRadius":25, # full damage within core radius - also equal to proximity fuse range
"collisionClass":PROJECTILE_FF,
"collisionClassByFighter":PROJECTILE_FIGHTER,
"particleSizeMin":2.5,
"particleSizeRange":3.0,
"particleDuration":1,
"particleCount":100,
"particleColor":[245,235,255,255],
"sound":"thule_explosion_hunker"},
}
}
I'm creating a (will create once i get home) slug casings animation for the Gatling, id like to ask if anyone managed to make a projectile spin once you launch it, this would make a much realistic effect on those projectiles once they are "shoot" into space. Also i intent to make this for everyone, both mods im working dont need this
Okay, So I'm looking to hire a weapon specialist for my Battlefarer Forever mod, As I'm useless at decorative weapons and offsets, Any takers? I really need one to get the Anamar donewhat do you need the person to do exactly ?
how does the game engine determine which part of the recoil sprite is an individual barrel? As far as I can see all the barrels are in the same image with no apparent distinction...
the offset value, 1 barrel , xy offset
2 barrels 2 xy offsets and so on
My only question about the barrel recoil is there any way to have it not always shoot from right to left? Ice if you had a 4 barrel weapon in alternating with only 2 shot burst firing the outer 2 then inner 2, I've tried setting the offsets in the order of how I'd want them to to fire but the recoil does its own thing and decides right to left.
My only question about the barrel recoil is there any way to have it not always shoot from right to left? Ice if you had a 4 barrel weapon in alternating with only 2 shot burst firing the outer 2 then inner 2, I've tried setting the offsets in the order of how I'd want them to to fire but the recoil does its own thing and decides right to left.
Looking at the heavyac.wpn file, you have:
"hardpointOffsets":[25, -5, 27, 0, 25, 5],
And it fires from right to left.
If you change it to:
"hardpointOffsets":[25, 5, 27, 0, 25, -5],
It will fire from left to right. Just verified it.
"turretOffsets":[10, -4.5, 5, 11.5, 10, 4.5, 5,-11.5],
"turretOffsets":[5,-11.5, 10, -4.5, 10, 4.5, 5, 11.5],
"turretOffsets":[5,11.5, 10, 4.5, 10, -4.5, 5, -11.5],
I'm not sure if I'm doing this correctly But I just tried it on my own version and the recoil doesn't fire in the correct direction,My only question about the barrel recoil is there any way to have it not always shoot from right to left? Ice if you had a 4 barrel weapon in alternating with only 2 shot burst firing the outer 2 then inner 2, I've tried setting the offsets in the order of how I'd want them to to fire but the recoil does its own thing and decides right to left.
Looking at the heavyac.wpn file, you have:
"hardpointOffsets":[25, -5, 27, 0, 25, 5],
And it fires from right to left.
If you change it to:
"hardpointOffsets":[25, 5, 27, 0, 25, -5],
It will fire from left to right. Just verified it.
"turretOffsets":[20, 5, 22, 0, 20, -5],
"turretAngleOffsets":[0, 0, 0],
"hardpointOffsets":[25, 5, 27, 0, 25, -5],
"hardpointAngleOffsets":[0, 0, 0],
Is there any way to set it so decorative weapons can get damage on them? So that we can make ship parts appear damaged even if they move
"music":{
# "source" can also be a directory
"music_campaign":[
{"file":"StianStark-Starfarer-Exploration_Alpha.ogg","source":"sounds/music/music.bin"}
],
"music_title":[
{"file":"StianStark-Starfarer-Exploration_Alpha.ogg","source":"sounds/music/music.bin"}
],
"music_combat":[
{"file":"battle_ambience_01_v02_loudest.ogg","source":"sounds/music/music.bin"}
],
},
for (int i = 1; i == 1; i--)U1spawn.spawnFleet();
U1spawn.spawnFleet();
Being the baddie I am at java, anyone know how to make a fleet spawn only once in the gen file?
Codefor (int i = 1; i == 1; i--)U1spawn.spawnFleet();
is my latest attempt but i have no idea what i'm doing anymore,
I've tried the line as this by itself
Codebut it'll spew ships continuously just as if it was in a for loop above.U1spawn.spawnFleet();
It'll just readd the ships once you defeat them on the map since i think it sets i = 0 when there's none on the map
Is there a way to deny certain events from happening in the "battle" engine, for example, weapons cant be deactivated or overloading, this is mainly to do with Star Control mod, theres no such mechanic in that game, i intent to do the same with the mod
3rd Question, how can i change the stats of the Asteroids, so it has 1 hp and 1 armor to avoid doing catastrophic damage to ships and still get one-shot by point-defense lasers
"thule_hgno":{"sounds":[
{"file":"sounds/TL/fx/systems/thule_hgno01.ogg","pitch":1,"volume":0.75},
{"file":"sounds/TL/fx/systems/thule_hgno02.ogg","pitch":1,"volume":0.75},
]},
I have a problem, i made two sounds for "outOfUsesSound" for a new shipsystem.
Only problem is it isnt working, no error message or anything just no sound at all. what am i missing?Code"thule_hgno":{"sounds":[
{"file":"sounds/TL/fx/systems/thule_hgno01.ogg","pitch":1,"volume":0.75},
{"file":"sounds/TL/fx/systems/thule_hgno02.ogg","pitch":1,"volume":0.75},
]},
{"thule_hgno":[
{"file":"sounds/TL/fx/systems/thule_hgno01.ogg","pitch":1,"volume":0.75},
{"file":"sounds/TL/fx/systems/thule_hgno02.ogg","pitch":1,"volume":0.75},
],
}
And to be clear it should play the moment the system is not active, recharging, or ist it specificly for systems that have lets say three uses per battle and i would have to use another "trigger"?
229011 [Thread-6] ERROR com.fs.starfarer.combat.D - org.json.JSONException: Expected a ':' after a key at 6 [character 7 line 1]
org.json.JSONException: Expected a ':' after a key at 6 [character 7 line 1]
at org.json.JSONTokener.syntaxError(JSONTokener.java:423)
at org.json.JSONObject.<init>(JSONObject.java:208)
at org.json.JSONObject.<init>(JSONObject.java:311)
at com.fs.starfarer.loading.LoadingUtils.void(Unknown Source)
at com.fs.starfarer.loading.LoadingUtils.Ö00000(Unknown Source)
at com.fs.starfarer.loading.ShipHullSpecLoader.super(Unknown Source)
at com.fs.starfarer.loading.ShipHullSpecLoader.Ò00000(Unknown Source)
at com.fs.starfarer.loading.SpecStore.Ò00000(Unknown Source)
at com.fs.starfarer.loading.H.super(Unknown Source)
at com.fs.A.A.new(Unknown Source)
at com.fs.starfarer.combat.D.o00000(Unknown Source)
at com.fs.starfarer.StarfarerLauncher$2.run(Unknown Source)
at java.lang.Thread.run(Thread.java:619)
1. is it possible to have a script that would firstly replace the starsector_title_alpha.png and secondly randomize that with every start of starsector another title would appear?
2. The number of burst determines the times a certain sound is played when a weapon is fired, right?
Is it possible to have one fixed sound for a burst of 6 projectiles. This sound would then play only once the weapon is fired.
At the moment i have a premade sound for a burst of 6 and the game is staggering the sound 6 times and that sounds ugly.
1. No. All you can do is replace the image itself, but not dynamically via a script.
2. It's possible (using fireSoundOne - see heavymg.wpn for an example of something that plays a startup sound per burst and then individual sounds per shot). It's probably not a good idea to have all the shot sounds in the same file, though - it could desynced if the fps drops, or the gun could stop firing (due to ship being destroyed, weapon being disabled, flux running out, a vent or phase cloak being initiated, etc), but the full 6 sounds would play anyway.
47305 [Thread-6] ERROR com.fs.starfarer.combat.D - java.lang.RuntimeException: java.io.IOException: Unable to load: sounds/starfighterfx/rocketfire1.ogg
java.lang.RuntimeException: java.io.IOException: Unable to load: sounds/starfighterfx/rocketfire1.ogg
at sound.Sound.<init>(Unknown Source)
at com.fs.starfarer.loading.H.super(Unknown Source)
at com.fs.A.A.new(Unknown Source)
at com.fs.starfarer.combat.D.o00000(Unknown Source)
at com.fs.starfarer.StarfarerLauncher$2.run(Unknown Source)
at java.lang.Thread.run(Thread.java:619)
Caused by: java.io.IOException: Unable to load: sounds/starfighterfx/rocketfire1.ogg
at sound.OoOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO.super(Unknown Source)
... 6 more
{
"light_rocket_fire":[{"file":"sounds/starfighterfx/rocketfire1.ogg","pitch":1, "volume":0.80}],
}
package data.shipsystems.scripts;
import com.fs.starfarer.api.combat.MutableShipStatsAPI;
import com.fs.starfarer.api.combat.ShipAPI;
import com.fs.starfarer.api.plugins.ShipSystemStatsScript;
public class DreadnoughtFighters implements ShipSystemStatsScript {
public void apply(MutableShipStatsAPI stats, String id, State state, float effectLevel) {
ShipAPI ship = (ShipAPI) stats.getEntity();
if (ship == null) {
return;
}
//int HPAmountPerFighter = (int)ship.getMaxHitpoints() / 42;
float PercPerFighter = 42 / 100; //Grab current perc
if(ship.getDeployedDrones().isEmpty()) {
stats.getHullRepairRatePercentPerSecond().modifyFlat(id, (ship.getDeployedDrones().size() * PercPerFighter));
}
else {
stats.getHullRepairRatePercentPerSecond().modifyFlat(id, -(ship.getDeployedDrones().size() * PercPerFighter));
}
}
public void unapply(MutableShipStatsAPI stats, String id) {
stats.getMaxHullRepairFraction().unmodify(id);
stats.getHullRepairRatePercentPerSecond().unmodify(id);
}
public StatusData getStatusData(int index, State state, float effectLevel) {
if (index == 0) {
return new StatusData("Releasing Autonomous Fighters.", false);
}
return null;
}
}
They will resupply when all of their ammo is gone depending on what role they have, or when the wing as a whole has taken 50% total damage.
455068 [Thread-6] ERROR com.fs.starfarer.combat.D - java.lang.NullPointerException
java.lang.NullPointerException
at com.fs.starfarer.campaign.ai.CampaignFleetAI.private.Object(Unknown Source)
at com.fs.starfarer.campaign.fleet.CampaignFleet.advance(Unknown Source)
at com.fs.starfarer.campaign.BaseLocation.advance(Unknown Source)
at com.fs.starfarer.campaign.CampaignEngine.advance(Unknown Source)
at com.fs.starfarer.campaign.A.super(Unknown Source)
at com.fs.starfarer.A.ÖÖÒ000(Unknown Source)
at com.fs.A.A.new(Unknown Source)
at com.fs.starfarer.combat.D.o00000(Unknown Source)
at com.fs.starfarer.StarfarerLauncher$2.run(Unknown Source)
at java.lang.Thread.run(Thread.java:619)
//Credit goes to Psiyon for his firecontrol AI script.
package data.shipsystems.scripts.ai;
import com.fs.starfarer.api.combat.CombatEngineAPI;
import com.fs.starfarer.api.combat.ShipAPI;
import com.fs.starfarer.api.combat.ShipSystemAIScript;
import com.fs.starfarer.api.combat.ShipSystemAPI;
import com.fs.starfarer.api.combat.ShipwideAIFlags;
import data.scripts.plugins.CombatUtils;
import java.util.Iterator;
import org.lazywizard.lazylib.MathUtils;
import org.lwjgl.util.vector.Vector2f;
import com.fs.starfarer.api.util.IntervalUtil;
public class ms_drivechargerai implements ShipSystemAIScript {
private ShipSystemAPI system;
private ShipAPI ship;
private float sinceLast = 0f;
private IntervalUtil tracker = new IntervalUtil(1f, 2f);
//This just initializes the script.
@Override
public void init(ShipAPI ship, ShipSystemAPI system, ShipwideAIFlags flags, CombatEngineAPI engine)
{
this.ship = ship;
this.system = system;
}
//So here we will tell the ship how to make use of the system.
@Override
public void advance (float amount, Vector2f position, Vector2f collisionDanger, ShipAPI target)
{
tracker.advance(amount);
sinceLast += amount;
//Once the interval has elapsed...
if (tracker.intervalElapsed()) {
//First we check if the ship is within closing distance of a target, or imminent danger of colliding with something:
float check_combat = 1000f;
float check_close = 750f;
float check_collide = 100f;
float cutoff_chance = 0f;
float impact_alert = 0f;
//Then we set it up so that we can track ships
int ships = 0;
ShipAPI ship_tmp;
//Now we iterate through all ships on the map
for (Iterator iter = CombatUtils.getCombatEngine().getShips().iterator();
iter.hasNext();)
{
ship_tmp = (ShipAPI) iter.next();
//We can't collide with fighters, so ignore 'em
if (ship_tmp.isFighter()) continue;
if (ship_tmp.isHulk()) continue;
if (CombatUtils.getDistance(ship_tmp, ship) <= (check_combat)) {
ships++;
if ((CombatUtils.getDistance(ship_tmp, ship) <= (check_close))) {
cutoff_chance += 1f;
}
if ((CombatUtils.getDistance(ship_tmp, ship) <= (check_collide))) {
impact_alert += 1f;
}
float fluxLevel = ship.getFluxTracker().getFluxLevel();
//First, lets make it so if no hostile ships are nearby, and the system isn't active, the vessel will turn on the system:
if (cutoff_chance <= 1 && !system.isActive() && (ships <= 3) && fluxLevel <=0.35 && ((float) Math.random() > 0.1f)) {
ship.useSystem();
}
//If the ship is only near a few enemies and the system is active, she has moderate chance of turning the system off:
else if (cutoff_chance >= 2 && system.isActive() && (ships >= 3) && ((float) Math.random() > 0.6f)) {
ship.useSystem();
}
//More hostiles means the ship is more like to use the cutoff:
else if (cutoff_chance >= 3 && system.isActive() && (ships >= 4) && ((float) Math.random() > 0.2f)) {
ship.useSystem();
}
//If there are too many ships in the area the system is too risky to use, so the ship will just shut it down period:
else if (cutoff_chance >= 4 && system.isActive() && (ships >= 5)) {
ship.useSystem();
}
//Also, if the ships flux gets too high and the ships system is active, shut it down:
else if (system.isActive() && fluxLevel >=0.85) {
ship.useSystem();
}
//And, for a bit of fun, if enemy ships are within the combat radius, but not too many, and flux is low enough, the ship might turn the system on:
else if (cutoff_chance <= 3 && impact_alert == 0 && !system.isActive() && (ships <= 3) && fluxLevel >=0.35 && ((float) Math.random() > 0.8f)) {
ship.useSystem();
}
//Finally if the ship detects an enemy in the direction she's headed inside the collision radius, and her system is on, we'll turn it off:
else if (impact_alert >= 1 && system.isActive()) {
ship.useSystem();
}
} else { return; }
}
}
}
}
package data.shipsystems.scripts;
import java.util.List;
import com.fs.starfarer.api.combat.MutableShipStatsAPI;
import com.fs.starfarer.api.plugins.ShipSystemStatsScript;
import com.fs.starfarer.api.combat.CombatEngineAPI;
import com.fs.starfarer.api.combat.ShipAPI;
import com.fs.starfarer.api.combat.CombatEntityAPI;
import data.scripts.plugins.CombatUtils;
import org.lwjgl.util.vector.Vector2f;
import java.util.Random;
/**
*
* @author Ender
*/
public class Fleet_Teleporter implements ShipSystemStatsScript {
private ShipAPI shipsapi;
private ShipAPI final_shipsapi;
private CombatEntityAPI combatEntity;
private CombatEntityAPI currentShip;
private CombatEngineAPI engine;
private MutableShipStatsAPI eachShip;
private boolean hasRun = false;
public void apply(MutableShipStatsAPI stats, String id, State state, float effectLevel) {
CombatUtils combatEngine = new CombatUtils();
engine = combatEngine.getCombatEngine();
if (engine != null && !hasRun) {
if (engine.getShips() != null) {
Random randomNum = new Random();
List ships = engine.getShips(); //get a list of all active ships
List shipList = null;
currentShip = stats.getEntity(); //we need our current ship so that we know who owns it
Vector2f location = currentShip.getLocation();
for (int i = 0; i < ships.size(); i++) { //now we loop through the entire list of ships
shipsapi = (ShipAPI) (ships.get(i)); //assign the current ship to the ShipAPI so we can give it bonuses or penalties
eachShip = shipsapi.getMutableStats(); //now we need something Mutable
combatEntity = eachShip.getEntity(); //we need to assign it as an entity as well so we can see who owns it
//in here, we're checking to find friendly ships
if ((combatEntity.getOwner() == currentShip.getOwner()) && (eachShip != null) && (combatEntity != stats.getEntity())) {
float randomX = (randomNum.nextInt(5) - 2) * 400;
float randomY = (randomNum.nextInt(5) - 2) * 400;
shipsapi.getLocation().x = (location.x + randomX);
shipsapi.getLocation().y = (location.y + randomY);
}
}
hasRun = true;
}
}
}
public void unapply(MutableShipStatsAPI stats, String id) {
//there's nothing to unapply here, so we can leave this block of code empty
hasRun = false;
}
public StatusData getStatusData(int index, State state, float effectLevel) {
if (index == 0) {
return new StatusData("Teleporting fleet to near", false); //display status message to the player
}
return null;
}
}
I have a couple of questions that I've been wondering about, but Im not really a programmer.
Is there any way to create a projectile that impacts other projectiles? Or at the very least, a missile that doesnt get targeted by PD?
Also, I'd like to know if there is a way to create a projectile that is able to penetrate multiple targets.
Any answers, even "No", would be greatly appreciated.
I think some of Flash's newer weapons for Neutrino have animated projectiles, you could take a look at those.
what do you mean "a projectile that impacts other projectile ?"
and im pretty sure PDs are hardwired to shoot at missile, its kindof part of the balance mechanism versus missiles. i mean, your missile will become way too strong if its homing and cant be hit by PDs, and if its not homing and youre worried about PDs, then why even make it a missile ?
also, i recall seeing a mod somewhere on another forum of starsector that had a penetrating mechanism, but that was done with modding illegally so of the code
Wouldnt PD attack the projectile then? That would look wierd havinga giant shockwave getting shot at by PD lasers ;)Shock waves? Doesn't Uozmoz Corvus have a ship in it that creates a huge shock wave? Causing all ships, ballistic and missiles to bounce away
You're thinking of the gravity system on the capital ship in Blackrock Drive Yards, but it doesn't do that, it just slows ballistics and missiles down (unless there is something else like it)Wouldnt PD attack the projectile then? That would look wierd havinga giant shockwave getting shot at by PD lasers ;)Shock waves? Doesn't Uozmoz Corvus have a ship in it that creates a huge shock wave? Causing all ships, ballistic and missiles to bounce away
You're thinking of the gravity system on the capital ship in Blackrock Drive Yards, but it doesn't do that, it just slows ballistics and missiles down (unless there is something else like it)Wouldnt PD attack the projectile then? That would look wierd havinga giant shockwave getting shot at by PD lasers ;)Shock waves? Doesn't Uozmoz Corvus have a ship in it that creates a huge shock wave? Causing all ships, ballistic and missiles to bounce away
Also, I'd like to know if there is a way to create a projectile that is able to penetrate multiple targets.
also, i recall seeing a mod somewhere on another forum of starsector that had a penetrating mechanism, but that was done with modding illegally so of the code
The shockwave system is on the Vatican Mk IV from the Valkyrians mod. The code is being reused for Thule's new system. :)
That would be xangle13's armor penetration system (http://fractalsoftworks.com/forum/index.php?topic=5819.0), and it's actually implemented entirely within the API. Unfortunately it works by spawning a new projectile every frame there is a hit, so weapon ranges get really messed up.
I've had some luck making true armor piercing rounds by giving projectiles the CollisionClass NONE and using an EveryFrameCombatPlugin to handle collision checks/damage myself. I can polish up that code and release it if you want. :)
// Projectile ID (String), pierces shields (boolean)
PROJ_IDS.put("impaler_shot", false);
not sure how the weapon.getId() works
does it return the id, display name, or something else?
so for example, if I get a mining blaster to call that, what's the return gonna be?
So I'm working on a system or two for custom ships, not sure how to go about it though.
Essentially the system just allows PD Lasers all over the ship to actually fire while locking other weapon systems.
If possible, the PD matrix should be able to replace shields like phase-tech, but if not it should disable shields.
The other system is an ECM Jamming system that while turned on, any missiles locked onto the ship will lose tracking, and any missiles fired at the ship will lose tracking. Possible by using invisible flares?
is there a way of hiding decorative weapons from the grouping bug? Or are we just waiting on a fix at this point?
Is there a way to grab the event of a ship being destroyed? I need to make a passive system that "revives" a ship once its turned into a hulk
Is there a way to grab the event of a ship being destroyed? I need to make a passive system that "revives" a ship once its turned into a hulk
Yeah, you could iterate through ships every frame and detect when isHulk() starts returning true. There's no way to revive a ship, though. Not that I can think of, anyway.
Is there a way to grab the event of a ship being destroyed? I need to make a passive system that "revives" a ship once its turned into a hulk
Yeah, you could iterate through ships every frame and detect when isHulk() starts returning true. There's no way to revive a ship, though. Not that I can think of, anyway.
Well, maybe if the ships hp are about to reach 0 or lower then 0, trying to find a way to replicate the Fury http://wiki.uqm.stack.nl/Fury special ability
engine.getFleetManager((ship.getOwner() == 0 ? FleetSide.PLAYER : FleetSide.ENEMY))
.spawnShipOrWing(ship.getHullSpec().getHullId(),
ship.getLocation(), ship.getFacing());
engine.removeEntity(ship);
public static String getVariantId(ShipAPI ship)
{
CampaignFleetAPI tmpFleet;
FleetMemberAPI tmpShip;
for (Iterator fleets = ((StarSystemAPI) Global.getSector().getStarSystems().get(0))
.getFleets().iterator(); fleets.hasNext();)
{
tmpFleet = (CampaignFleetAPI) fleets.next();
for (Iterator ships = tmpFleet.getFleetData().getMembersListCopy().iterator(); ships.hasNext();)
{
tmpShip = (FleetMemberAPI) ships.next();
if (tmpShip.getId().equals(ship.getFleetMemberId()))
{
return tmpShip.getSpecId();
}
}
}
return ship.getHullSpec().getHullId();
}
public static void revive(ShipAPI ship, CombatEngineAPI engine)
{
engine.getFleetManager((ship.getOwner() == 0 ? FleetSide.PLAYER : FleetSide.ENEMY))
.spawnShipOrWing(getVariantId(ship), ship.getLocation(), ship.getFacing());
engine.removeEntity(ship);
}
package data.scripts.plugins;
import com.fs.starfarer.api.AnimationAPI;
import com.fs.starfarer.api.Global;
import com.fs.starfarer.api.combat.CombatEngineAPI;
import com.fs.starfarer.api.combat.EveryFrameWeaponEffectPlugin;
import com.fs.starfarer.api.combat.ShipAPI;
import com.fs.starfarer.api.combat.WeaponAPI;
import java.awt.Color;
public class TraderVariablePowerBlasterEffect implements EveryFrameWeaponEffectPlugin
{
// weapon takes 7 seconds to fully charge
private int currentCharge = 0;
private float currentChargelvl = 0;
public void advance(float amount, CombatEngineAPI engine, WeaponAPI weapon)
{
ShipAPI ship = weapon.getShip();
if (ship == null)
{
return;
}
currentChargelvl = weapon.getChargeLevel();
AnimationAPI animation = weapon.getAnimation();
if (weapon.isFiring())
{
ship.getMutableStats().getFluxDissipation().modifyFlat(ship.getHullSpec().getHullId().toString(), 0); //while chargins the dissipation should be set to 0
if (currentChargelvl <= 0.33f)
{
//Global.getSoundPlayer().playSound("trader_var_blaster_intro",0.5f, 0.5f, weapon.getLocation(), ship.getVelocity());
if(currentCharge == 0)
{
engine.addFloatingText(ship.getLocation(), "Power Level 1",25f,Color.GREEN,weapon.getShip(),0f,0f);
currentCharge = 1;
animation.setFrame(1);
animation.play();
}
if(animation.getFrame() == 5)
{
animation.setFrame(1);
animation.play();
}
}
if (currentChargelvl <= 0.66f && currentChargelvl > 0.33f)
{
if(currentCharge == 1)
{
Global.getSoundPlayer().playSound("trader_var_blaster_intro",0.5f, 0.5f, weapon.getLocation(), ship.getVelocity());
engine.addFloatingText(ship.getLocation(), "Power Level 2",25f,Color.BLUE,weapon.getShip(),0f,0f);
currentCharge = 2;
animation.setFrame(6);
animation.play();
}
if(animation.getFrame() == 10)
{
animation.setFrame(6);
animation.play();
}
}
if (currentChargelvl <= 0.99f && currentChargelvl > 0.66f)
{
if(currentCharge == 2)
{
Global.getSoundPlayer().playSound("trader_var_blaster_intro",0.5f, 0.5f, weapon.getLocation(), ship.getVelocity());
engine.addFloatingText(ship.getLocation(), "Power Level 3",25f,Color.MAGENTA,weapon.getShip(),0f,0f);
currentCharge = 3;
animation.setFrame(11);
animation.play();
}
if(animation.getFrame() == 15)
{
animation.setFrame(11);
animation.play();
}
}
if(currentChargelvl > 0.99f)
{
if(currentCharge == 3)
{
engine.addFloatingText(ship.getLocation(), "Max Power Level",25f,Color.RED,weapon.getShip(),0f,0f);
currentCharge = 4;
animation.setFrame(16);
animation.play();
}
if(animation.getFrame() == 20)
{
animation.setFrame(16);
animation.play();
}
}
}
else
{
switch (currentCharge)
{
case 1:
{
Global.getSoundPlayer().playSound("trader_var_blaster_s1_launch", 1f, 1f, weapon.getLocation(), ship.getVelocity());
engine.spawnProjectile(ship, weapon, "trader_variable_power_blaster_s1", weapon.getLocation(), weapon.getCurrAngle(), ship.getVelocity());
ship.getFluxTracker().increaseFlux(500, false);
weapon.setRemainingCooldownTo(1f);
break;
}
case 2:
{
Global.getSoundPlayer().playSound("trader_var_blaster_s2_launch", 1f, 1f, weapon.getLocation(), ship.getVelocity());
engine.spawnProjectile(ship, weapon, "trader_variable_power_blaster_s2", weapon.getLocation(), weapon.getCurrAngle(), ship.getVelocity());
ship.getFluxTracker().increaseFlux(500, false);
weapon.setRemainingCooldownTo(1f);
break;
}
case 3:
{
Global.getSoundPlayer().playSound("trader_var_blaster_s3_launch",1f, 1f, weapon.getLocation(), ship.getVelocity());
engine.spawnProjectile(ship, weapon,"trader_variable_power_blaster_s3", weapon.getLocation(), weapon.getCurrAngle(), ship.getVelocity());
ship.getFluxTracker().increaseFlux(500, false);
weapon.setRemainingCooldownTo(1f);
break;
}
default:
// Whatever happens if it isn't charged
}
ship.getMutableStats().getFluxDissipation().unmodify();
currentCharge = 0;
}
}//advance
}
if(animation.getFrame() == 15)Is a mistake because you're not guaranteed to actually stop on that frame. It might get missed due to a frame rate hiccup. If the animation is slow enough (<30fps), I suppose it might work, since the engine won't go below that (but will slow time instead)... but still, a bit iffy.
{
animation.setFrame(11);
animation.play();
}
Logger log = Logger.getLogger(this.getClass());
log.info("whatever string you want to print");
no luck so far, would using IntervalUtil help? Also i do not know exactly how it works, if its a interval from X to X
java.lang.RuntimeException: Error loading [graphics/TL/weapons/decor/thule_heimdahl_0059_Frame-1.png01.png] resource, not found in [D:\Program Files (x86)\Fractal Softworks\Starsector\starsector-core\..\mods\LazyLib,D:\Program Files (x86)\Fractal Softworks\Starsector\starsector-core\..\mods\StealThisStuff,D:\Program Files (x86)\Fractal Softworks\Starsector\starsector-core\..\mods\Thule Legacy,../starfarer.res/res,CLASSPATH]
at com.fs.util.C.Ò00000(Unknown Source)
at com.fs.util.C.Object(Unknown Source)
at com.fs.graphics.K.String(Unknown Source)
at com.fs.graphics.K.Ò00000(Unknown Source)
at com.fs.graphics.K$1.run(Unknown Source)
at java.lang.Thread.run(Thread.java:619)
graphics/weapons/shredder/chaingun2_turret_base00.pngetc. So, has to end in .png, and the number has to precede that, and it has to be 2 digits unless it's 100 or over (i.e. you can't do 001, iirc).
graphics/weapons/shredder/chaingun2_turret_base01.png
graphics/weapons/shredder/chaingun2_turret_base02.png
...
graphics/weapons/shredder/chaingun2_turret_base99.png
graphics/weapons/shredder/chaingun2_turret_base100.png
graphics/weapons/shredder/chaingun2_turret_base101.png
package data.scripts.plugins;
import com.fs.starfarer.api.AnimationAPI;
import com.fs.starfarer.api.combat.CombatEngineAPI;
import com.fs.starfarer.api.combat.EveryFrameWeaponEffectPlugin;
import com.fs.starfarer.api.combat.WeaponAPI;
import com.fs.starfarer.api.combat.FluxTrackerAPI;
public class isHulkCheck implements EveryFrameWeaponEffectPlugin
{
public void advance(float amount, CombatEngineAPI engine, WeaponAPI weapon)
{
if (engine.isPaused()) return;
AnimationAPI animation = weapon.getAnimation();
if (weapon.getShip().isHulk())
{
animation.pause();
}
else
{
animation.play();
}
}
}
{
"id":"thule_deco_heimdahl",
"specClass":"projectile",
"type":"DECORATIVE",
"size":"MEDIUM",
"everyFrameEffect":"data.scripts.plugins.isHulkCheck",
"turretSprite":"graphics/TL/weapons/decor/thule_heimdahl_Frame-01.png",
"hardpointSprite":"graphics/TL/weapons/decor/thule_heimdahl_Frame-01.png",
"numFrames":60,
"frameRate":15,
"alwaysAnimate":"true",
"turretOffsets":[0, 0],
"turretAngleOffsets":[0],
"hardpointOffsets":[0, 0],
"hardpointAngleOffsets":[0],
"barrelMode":"ALTERNATING", # or LINKED. whether barrels fire at the same time or alternate.
"animationType":"MUZZLE_FLASH", # NONE, GLOW, MUZZLE_FLASH, SMOKE
"muzzleFlashSpec":{"length":0.0, # only used if animationType = MUZZLE_FLASH
"spread":10,
"particleSizeMin":4.0,
"particleSizeRange":18.0,
"particleDuration":0.2,
"particleCount":25,
"particleColor":[255,150,30,200]},
"projectileSpecId":"thule_barbarossa_shot", # projectile that will be fired
"fireSoundTwo":"thule_barbarossa",
"fireSoundOne":"thule_barbarossa_overload",
}
Errrrm I think this should go here. I'm thinking of starting a mod and I'm trying to get some ideas down on paper, I'm wondering what kind of health and armourvalues vanilla missiles have to balance my P.D. and missiles?
There's a limit for both kinds; as you guessed, for performance reasons. It's currently hardcoded, and I don't know that changing that makes sense.
How does one set the Projectile graphic of a pulse shot, kinda like the Autopulse shot, To be a custom sprite?
So my question is a bit strange, and perhaps might be irrelevant since it may make little sense to keep within Starsector, but I am looking to see if it is at all possible to make it so when max flux is reached and overload happens, can the weapons still be used. I am working on the Star Wars Mod, and I want to try and make it as close to lore as possible. I have no idea if this is possible or not, but it would go a long way to making the mod play how I want it to.
Obviously if that can't be done, I will work around it. But I'm hoping there is some workaround. My weapons generate 0 flux, so flux is only a measure of shield strength. Thanks in advance to any help with this matter.
So my question is a bit strange, and perhaps might be irrelevant since it may make little sense to keep within Starsector, but I am looking to see if it is at all possible to make it so when max flux is reached and overload happens, can the weapons still be used. I am working on the Star Wars Mod, and I want to try and make it as close to lore as possible. I have no idea if this is possible or not, but it would go a long way to making the mod play how I want it to.
Obviously if that can't be done, I will work around it. But I'm hoping there is some workaround. My weapons generate 0 flux, so flux is only a measure of shield strength. Thanks in advance to any help with this matter.
But doesn't that set it up to just as a shaped beam, I'm trying to get it to work like a bullet sprite :)
Yea, I'm using Ironclad mod and I'm adding my own ships, but the game keeps crashing.
Can anyone tell me where the log file is located?
And how is this accomplished? :)
I tried to create a mod and add a ship in it. First time it worked, but the engines where too bright, so i used Trylobot Ship Editor to change them a bit. Now Starsector dont want to start, i got this in the logs, however i'm not too sure what i am looking at:Spoiler--------------------------------
4635 [Thread-6] ERROR com.fs.starfarer.combat.D - org.json.JSONException: JSONObject["id"] not found.
org.json.JSONException: JSONObject["id"] not found.
at org.json.JSONObject.get(JSONObject.java:406)
at org.json.JSONObject.getString(JSONObject.java:577)
at com.fs.starfarer.loading.LoadingUtils.super(Unknown Source)
at com.fs.starfarer.loading.LoadingUtils.super(Unknown Source)
at com.fs.starfarer.loading.ShipHullSpreadsheetLoader.o00000(Unknown Source)
at com.fs.starfarer.loading.SpecStore.Ò00000(Unknown Source)
at com.fs.starfarer.loading.H.super(Unknown Source)
at com.fs.A.A.new(Unknown Source)
at com.fs.starfarer.combat.D.o00000(Unknown Source)
at com.fs.starfarer.StarfarerLauncher$2.run(Unknown Source)
at java.lang.Thread.run(Thread.java:619)[close]
Some help please?
Is it possible to make a 'weapon' that in reality is just an external cargo pod mounted instead of a weapon? Therefore it wouldn't turn or anything- just cost a few OP and add cargo space.
If not, would be a good suggestion.
Seems like the ship_data.csv might be malformed - looks like it's not finding the "id" column in it. If looking at it doesn't help, might be worth it to create a separate thread for this and post the .ship and the .csv there.
I need to somehow make a projectile move as long as you keep "firing" the weapon, once it stops (!weapon.IsFiring()) the projectile will fade/despawn and spawn several projectiles clockwise (in this case 6 so its 60,120,180,240,300 and 360) around it with a high velocity.
if i do manage to get the first part running ill be able to replicate the Marauder (http://wiki.uqm.stack.nl/Marauder) Spin-blade and the Broodhome (http://wiki.uqm.stack.nl/Broodhome) Crystal Shard
package data.hullmods;
import com.fs.starfarer.api.combat.MutableShipStatsAPI;
import com.fs.starfarer.api.combat.ShipAPI;
import com.fs.starfarer.api.combat.ShipAPI.HullSize;
import java.util.HashMap;
import java.util.Map;
public class InfusedHull extends BaseHullMod {
public static final float REPAIR_FRACTION = 1f;
public static final float REPAIR_BONUS = .99f;
private static Map mag = new HashMap();
static {
mag.put(HullSize.FIGHTER, 3f);
mag.put(HullSize.FRIGATE, 1f);
mag.put(HullSize.DESTROYER, .75f);
mag.put(HullSize.CRUISER, .5f);
mag.put(HullSize.CAPITAL_SHIP, .25f);
}
public void applyEffectsBeforeShipCreation(HullSize hullSize, MutableShipStatsAPI stats, String id) {
stats.getHullRepairRatePercentPerSecond().modifyFlat(id, (Float) mag.get(hullSize));
stats.getMaxHullRepairFraction().unmodify(id);
stats.getMaxHullRepairFraction().modifyFlat(id, REPAIR_FRACTION);
}
public String getDescriptionParam(int index, HullSize hullSize) {
if (index == 0) return "1";// + ((Float) mag.get(HullSize.FRIGATE)).intValue();
if (index == 1) return ".75";// + ((Float) mag.get(HullSize.DESTROYER)).intValue();
if (index == 2) return ".5";// + ((Float) mag.get(HullSize.CRUISER)).intValue();
if (index == 3) return ".25";// + ((Float) mag.get(HullSize.CAPITAL_SHIP)).intValue();
return null;
}
}
{
"displayName":"Advanced Fighter",
"hullId":"PhnH",
"hullMods": [infusedhull]
"variantId":"PhnH_standard",
"fluxVents":0,
"fluxCapacitors":0,
"mods":[], # array of strings
# mode is either LINKED or ALTERNATING
# slot ids (WS ***) must match what's in the .ship file
"weaponGroups":[
{"mode":"LINKED",
"weapons":{
"WS01":"20mm_rc",
"WS02":"20mm_rc",
},
},
{"mode":"LINKED",
"weapons":{
"WS03":"stingerx2",
},
},
],
}
Anyone know if theres a way to make missiles explode rather than fade away after their flight time expires.
package data.scripts.plugins;
import com.fs.starfarer.api.combat.CombatEngineAPI;
import com.fs.starfarer.api.combat.DamageType;
import com.fs.starfarer.api.combat.EveryFrameCombatPlugin;
import com.fs.starfarer.api.combat.MissileAPI;
import java.util.Iterator;
import java.util.List;
public class MissilesExplodeOnFizzlePlugin implements EveryFrameCombatPlugin
{
private static CombatEngineAPI engine;
@Override
public void advance(float amount, List events)
{
if (engine.isPaused())
{
return;
}
// Scan all missiles on the field
MissileAPI missile;
for (Iterator missiles = engine.getMissiles().iterator(); missiles.hasNext();)
{
missile = (MissileAPI) missiles.next();
// If the missile is fizzling, damage it so it explodes
if (missile.isFizzling())
{
engine.applyDamage(missile, missile.getLocation(), 99999,
DamageType.ENERGY, 0f, true, false, null);
}
}
}
@Override
public void init(CombatEngineAPI engine)
{
MissilesExplodeOnFizzlePlugin.engine = engine;
}
}
Anyone know if theres a way to make missiles explode rather than fade away after their flight time expires.
They won't deal damage when they explode (it's basically the same as if they got shot down), but here's a very simple plugin that should do what you asked:
data/scripts/plugins/MissilesExplodeOnFizzlePlugin.java:Codepackage data.scripts.plugins;
import com.fs.starfarer.api.combat.CombatEngineAPI;
import com.fs.starfarer.api.combat.DamageType;
import com.fs.starfarer.api.combat.EveryFrameCombatPlugin;
import com.fs.starfarer.api.combat.MissileAPI;
import java.util.Iterator;
import java.util.List;
public class MissilesExplodeOnFizzlePlugin implements EveryFrameCombatPlugin
{
private static CombatEngineAPI engine;
@Override
public void advance(float amount, List events)
{
if (engine.isPaused())
{
return;
}
// Scan all missiles on the field
MissileAPI missile;
for (Iterator missiles = engine.getMissiles().iterator(); missiles.hasNext();)
{
missile = (MissileAPI) missiles.next();
// If the missile is fizzling, damage it so it explodes
if (missile.isFizzling())
{
engine.applyDamage(missile, missile.getLocation(), 99999,
DamageType.ENERGY, 0f, true, false, null);
}
}
}
@Override
public void init(CombatEngineAPI engine)
{
MissilesExplodeOnFizzlePlugin.engine = engine;
}
}
If you want a version that does cause damage to nearby targets when a missile explodes, I can make that for you but it would be far more complicated.
package data.scripts.plugins;
import com.fs.starfarer.api.combat.CombatEngineAPI;
import com.fs.starfarer.api.combat.DamageType;
import com.fs.starfarer.api.combat.EveryFrameCombatPlugin;
import com.fs.starfarer.api.combat.MissileAPI;
import java.util.HashSet;
import java.util.Iterator;
import java.util.List;
import java.util.Set;
public class MissilesExplodeOnFizzlePlugin implements EveryFrameCombatPlugin
{
private static final Set MISSILES_TO_EXPLODE = new HashSet();
private static CombatEngineAPI engine;
static
{
// Add the projectile IDs of all missiles that should explode here
// Example: MISSILES_TO_EXPLODE.add("annihilator_rocket");
MISSILES_TO_EXPLODE.add("proj id goes here");
MISSILES_TO_EXPLODE.add("any other missiles go in their own line like this");
}
@Override
public void advance(float amount, List events)
{
if (engine.isPaused())
{
return;
}
// Scan all missiles on the field
MissileAPI missile;
for (Iterator missiles = engine.getMissiles().iterator(); missiles.hasNext();)
{
missile = (MissileAPI) missiles.next();
// If the missile is fizzling, damage it so it explodes
if (missile.isFizzling() && MISSILES_TO_EXPLODE.contains(missile.getProjectileSpecId()))
{
engine.applyDamage(missile, missile.getLocation(), 99999,
DamageType.ENERGY, 0f, true, false, null);
}
}
}
@Override
public void init(CombatEngineAPI engine)
{
MissilesExplodeOnFizzlePlugin.engine = engine;
}
}
Silly question:do comments (// texthere ) in .ship and .variant files work?
I would really help with turret groups, especially since I'm working with similar ships with different weapon setups
package data.scripts.plugins;
import com.fs.starfarer.api.combat.CombatEngineAPI;
import com.fs.starfarer.api.combat.DamageType;
import com.fs.starfarer.api.combat.EveryFrameCombatPlugin;
import com.fs.starfarer.api.combat.MissileAPI;
import java.util.Iterator;
import java.util.List;
public class PodshipHomingPlasmoid implements EveryFrameCombatPlugin
{
private String SHELL_ID_1 = "podship_plasmoid";
private String SHELL_ID_2 = "podship_plasmoid_2";
private String SHELL_ID_3 = "podship_plasmoid_3";
private String SHELL_ID_4 = "podship_plasmoid_4";
private CombatEngineAPI engine;
public void init(CombatEngineAPI engine) {
this.engine = engine;
}
public void advance(float amount, List events)
{
if (engine.isPaused()) {
return;
}
for (Iterator allMissiles = engine.getMissiles().iterator();
allMissiles.hasNext();)
{
MissileAPI plasmoid = (MissileAPI) allMissiles.next();
if(plasmoid.isFizzling())
{
if(SHELL_ID_1.equals(plasmoid.getProjectileSpecId())) {
engine.spawnProjectile(plasmoid.getSource(), plasmoid.getWeapon(), SHELL_ID_2, plasmoid.getLocation(), plasmoid.getWeapon().getArcFacing(), plasmoid.getVelocity());
engine.applyDamage(plasmoid, plasmoid.getLocation(), 99999,DamageType.ENERGY, 0f, true, false, null);
}
else if(SHELL_ID_2.equals(plasmoid.getProjectileSpecId())) {
engine.spawnProjectile(plasmoid.getSource(), plasmoid.getWeapon(), SHELL_ID_3, plasmoid.getLocation(), plasmoid.getWeapon().getArcFacing(), plasmoid.getVelocity());
engine.applyDamage(plasmoid, plasmoid.getLocation(), 99999,DamageType.ENERGY, 0f, true, false, null);
}
else if(SHELL_ID_3.equals(plasmoid.getProjectileSpecId())) {
engine.spawnProjectile(plasmoid.getSource(), plasmoid.getWeapon(), SHELL_ID_4, plasmoid.getLocation(), plasmoid.getWeapon().getArcFacing(), plasmoid.getVelocity());
engine.applyDamage(plasmoid, plasmoid.getLocation(), 99999,DamageType.ENERGY, 0f, true, false, null);
}
else {
return;
}
}
}
}//advance
}//class
Oh thanks for the missile script lazy, i had something very close to what u got here for the podship plasmoid, i didnt know about the .isFizzling() existing so i based of with a timer.
Heres an example if you want to "despawn" the old missile and spawn a new one in its place:Codepackage data.scripts.plugins;
import com.fs.starfarer.api.combat.CombatEngineAPI;
import com.fs.starfarer.api.combat.DamageType;
import com.fs.starfarer.api.combat.EveryFrameCombatPlugin;
import com.fs.starfarer.api.combat.MissileAPI;
import java.util.Iterator;
import java.util.List;
public class PodshipHomingPlasmoid implements EveryFrameCombatPlugin
{
private String SHELL_ID_1 = "podship_plasmoid";
private String SHELL_ID_2 = "podship_plasmoid_2";
private String SHELL_ID_3 = "podship_plasmoid_3";
private String SHELL_ID_4 = "podship_plasmoid_4";
private CombatEngineAPI engine;
public void init(CombatEngineAPI engine) {
this.engine = engine;
}
public void advance(float amount, List events)
{
if (engine.isPaused()) {
return;
}
for (Iterator allMissiles = engine.getMissiles().iterator();
allMissiles.hasNext();)
{
MissileAPI plasmoid = (MissileAPI) allMissiles.next();
if(plasmoid.isFizzling())
{
if(SHELL_ID_1.equals(plasmoid.getProjectileSpecId())) {
engine.spawnProjectile(plasmoid.getSource(), plasmoid.getWeapon(), SHELL_ID_2, plasmoid.getLocation(), plasmoid.getWeapon().getArcFacing(), plasmoid.getVelocity());
engine.applyDamage(plasmoid, plasmoid.getLocation(), 99999,DamageType.ENERGY, 0f, true, false, null);
}
else if(SHELL_ID_2.equals(plasmoid.getProjectileSpecId())) {
engine.spawnProjectile(plasmoid.getSource(), plasmoid.getWeapon(), SHELL_ID_3, plasmoid.getLocation(), plasmoid.getWeapon().getArcFacing(), plasmoid.getVelocity());
engine.applyDamage(plasmoid, plasmoid.getLocation(), 99999,DamageType.ENERGY, 0f, true, false, null);
}
else if(SHELL_ID_3.equals(plasmoid.getProjectileSpecId())) {
engine.spawnProjectile(plasmoid.getSource(), plasmoid.getWeapon(), SHELL_ID_4, plasmoid.getLocation(), plasmoid.getWeapon().getArcFacing(), plasmoid.getVelocity());
engine.applyDamage(plasmoid, plasmoid.getLocation(), 99999,DamageType.ENERGY, 0f, true, false, null);
}
else {
return;
}
}
}
}//advance
}//class
Check that the image has been saved with a bit depth greater than 8
[Thread-6] ERROR com.fs.starfarer.combat.O0OO - java.lang.ClassCastException: data.scripts.weapons.WavebeamMaster cannot be cast to com.fs.starfarer.api.combat.EveryFrameWeaponEffectPlugin
java.lang.ClassCastException: data.scripts.weapons.WavebeamMaster cannot be cast to com.fs.starfarer.api.combat.EveryFrameWeaponEffectPlugin
at com.fs.starfarer.loading.specs.dosuper.õo0000(Unknown Source)
at com.fs.starfarer.combat.entities.A.A.oooO.<init>(Unknown Source)
at com.fs.starfarer.loading.specs.while.o00000(Unknown Source)
at com.fs.starfarer.loading.specs.while.o00000(Unknown Source)
at com.fs.starfarer.loading.specs.while.o00000(Unknown Source)
at com.fs.starfarer.loading.specs.while.o00000(Unknown Source)
at com.fs.starfarer.title.oOOO.Ò00000(Unknown Source)
at com.fs.starfarer.title.oOOO.String(Unknown Source)
at com.fs.starfarer.title.oOOO.String(Unknown Source)
at com.fs.starfarer.title.oOOO.super(Unknown Source)
at com.fs.starfarer.combat.super.OoOO.o00000(Unknown Source)
at com.fs.starfarer.combat.CombatEngine.advance(Unknown Source)
at com.fs.starfarer.title.B.o00000(Unknown Source)
at com.fs.starfarer.super.this.do$super(Unknown Source)
at com.fs.A.super.Ò00000(Unknown Source)
at com.fs.starfarer.combat.O0OO.o00000(Unknown Source)
at com.fs.starfarer.StarfarerLauncher$2.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
package data.scripts.weapons;
import com.fs.starfarer.api.combat.CombatEngineAPI;
import com.fs.starfarer.api.combat.EveryFrameWeaponEffectPlugin;
import com.fs.starfarer.api.combat.WeaponAPI;
import com.fs.starfarer.api.combat.ShipAPI;
public class WavebeamMaster implements EveryFrameWeaponEffectPlugin
{
private ShipAPI ship;
@Override
public void advance(float amount, CombatEngineAPI engine, WeaponAPI weapon)
{
if (engine.isPaused()) {
return;
}
{
if(weapon.isFiring())
{
engine.spawnProjectile(ship, weapon, "ms_1wave", weapon.getLocation(), weapon.getCurrAngle(), ship.getVelocity());
engine.spawnProjectile(ship, weapon, "ms_2wave", weapon.getLocation(), weapon.getCurrAngle(), ship.getVelocity());
engine.spawnProjectile(ship, weapon, "ms_3wave", weapon.getLocation(), weapon.getCurrAngle(), ship.getVelocity());
}
}
}
}
package data.scripts.plugins;
import com.fs.starfarer.api.AnimationAPI;
import com.fs.starfarer.api.Global;
import com.fs.starfarer.api.combat.BeamAPI;
import com.fs.starfarer.api.combat.BeamEffectPlugin;
import com.fs.starfarer.api.combat.CombatEngineAPI;
import com.fs.starfarer.api.combat.ShipAPI;
import com.fs.starfarer.api.combat.WeaponAPI;
import com.fs.starfarer.api.util.IntervalUtil;
import java.awt.Color;
public class TraderVariablePowerBlasterEffect implements BeamEffectPlugin
{
// weapon takes 7 seconds to fully charge
private IntervalUtil weaponcooldownlvl = new IntervalUtil(4.0f, 4.0f);
private static int currentCharge = 0;
private static boolean chargedlvl1 = true;
private static boolean chargedlvl2 = false;
private static boolean chargedlvl3 = false;
private static boolean chargedlvl4 = false;
public void advance(float amount, CombatEngineAPI engine, BeamAPI beam)
{
ShipAPI ship = beam.getSource();
if (ship == null)
{
return;
}
AnimationAPI animation = beam.getWeapon().getAnimation();
WeaponAPI weapon = beam.getWeapon();
if(ship.isHulk())
{
animation.setFrame(0);
animation.pause();
}
//Global.getSoundPlayer().playSound("trader_var_blaster_intro",0.5f, 0.5f, weapon.getLocation(), ship.getVelocity());
if(weapon.isFiring())
{
weaponcooldownlvl.advance(amount);
if(weaponcooldownlvl.intervalElapsed() && currentCharge == 1) {
chargedlvl2 = true;
}
if(weaponcooldownlvl.intervalElapsed() && currentCharge == 2) {
chargedlvl3 = true;
}
if(weaponcooldownlvl.intervalElapsed() && currentCharge == 3) {
chargedlvl4 = true;
}
if(chargedlvl1 && weapon.getCooldownRemaining() == 0)
{
Global.getSoundPlayer().playSound("trader_var_blaster_intro",0.5f, 0.5f, weapon.getLocation(), ship.getVelocity());
//engine.addFloatingText(ship.getLocation(), "Power Level 1",15f,Color.GREEN,weapon.getShip(),0f,0f);
chargedlvl1 = false;
currentCharge = 1;
animation.setFrame(1);
animation.play();
}
if (chargedlvl2)
{
chargedlvl2 = false;
weaponcooldownlvl.setInterval(4.0f, 4.0f);
Global.getSoundPlayer().playSound("trader_var_blaster_intro",0.5f, 0.5f, weapon.getLocation(), ship.getVelocity());
engine.addFloatingText(ship.getLocation(), "Power Level 2",20f,Color.BLUE,weapon.getShip(),0f,0f);
currentCharge = 2;
animation.setFrame(6);
animation.play();
}
if (chargedlvl3)
{
chargedlvl3 = false;
weaponcooldownlvl.setInterval(4.0f, 4.0f);
Global.getSoundPlayer().playSound("trader_var_blaster_intro",0.5f, 0.5f, weapon.getLocation(), ship.getVelocity());
engine.addFloatingText(ship.getLocation(), "Power Level 3",25f,Color.MAGENTA,weapon.getShip(),0f,0f);
currentCharge = 3;
animation.setFrame(11);
animation.play();
}
if(chargedlvl4)
{
chargedlvl4 = false;
Global.getSoundPlayer().playSound("trader_var_blaster_intro",0.5f, 0.5f, weapon.getLocation(), ship.getVelocity());
engine.addFloatingText(ship.getLocation(), "Max Power Level",30f,Color.RED,weapon.getShip(),0f,0f);
currentCharge = 4;
animation.setFrame(16);
animation.play();
}
switch (currentCharge)
{
case 0:
{
animation.setFrame(0);
animation.pause();
break;
}
case 1:
{
if(animation.getFrame() == 5)
{
animation.setFrame(1);
animation.play();
}
break;
}
case 2:
{
if(animation.getFrame() == 10)
{
animation.setFrame(6);
animation.play();
}
break;
}
case 3:
{
if(animation.getFrame() == 15)
{
animation.setFrame(11);
animation.play();
}
break;
}
case 4:
{
if(animation.getFrame() == 20)
{
animation.setFrame(16);
animation.play();
}
break;
}
}
}
if(weapon.getChargeLevel() <= 0.1f)
{
switch (currentCharge)
{
case 1:
{
Global.getSoundPlayer().playSound("trader_var_blaster_s1_launch", 1f, 1f, weapon.getLocation(), ship.getVelocity());
engine.spawnProjectile(ship, weapon, "trader_variable_power_blaster_s1", weapon.getLocation(), weapon.getCurrAngle(), ship.getVelocity());
ship.getFluxTracker().increaseFlux(500, false);
weapon.setRemainingCooldownTo(0.5f);
animation.setFrame(0);
animation.pause();
weaponcooldownlvl.setInterval(4.0f, 4.0f);
currentCharge = 0;
chargedlvl1 = true;
chargedlvl2 = false;
chargedlvl3 = false;
chargedlvl4 = false;
return;
}
case 2:
{
Global.getSoundPlayer().playSound("trader_var_blaster_s2_launch", 1f, 1f, weapon.getLocation(), ship.getVelocity());
engine.spawnProjectile(ship, weapon, "trader_variable_power_blaster_s2", weapon.getLocation(), weapon.getCurrAngle(), ship.getVelocity());
ship.getFluxTracker().increaseFlux(500, false);
weapon.setRemainingCooldownTo(0.5f);
animation.setFrame(0);
animation.pause();
weaponcooldownlvl.setInterval(4.0f, 4.0f);
currentCharge = 0;
chargedlvl1 = true;
chargedlvl2 = false;
chargedlvl3 = false;
chargedlvl4 = false;
return;
}
case 3:
{
Global.getSoundPlayer().playSound("trader_var_blaster_s3_launch",1f, 1f, weapon.getLocation(), ship.getVelocity());
engine.spawnProjectile(ship, weapon,"trader_variable_power_blaster_s3", weapon.getLocation(), weapon.getCurrAngle(), ship.getVelocity());
ship.getFluxTracker().increaseFlux(500, false);
weapon.setRemainingCooldownTo(0.5f);
animation.setFrame(0);
animation.pause();
weaponcooldownlvl.setInterval(4.0f, 4.0f);
currentCharge = 0;
chargedlvl1 = true;
chargedlvl2 = false;
chargedlvl3 = false;
chargedlvl4 = false;
return;
}
case 4:
{
Global.getSoundPlayer().playSound("trader_var_blaster_s4_launch",1f, 1f, weapon.getLocation(), ship.getVelocity());
engine.spawnProjectile(ship, weapon,"trader_variable_power_blaster", weapon.getLocation(), weapon.getCurrAngle(), ship.getVelocity());
ship.getFluxTracker().increaseFlux(500, false);
weapon.setRemainingCooldownTo(0.5f);
animation.setFrame(0);
animation.pause();
weaponcooldownlvl.setInterval(4.0f, 4.0f);
currentCharge = 0;
chargedlvl1 = true;
chargedlvl2 = false;
chargedlvl3 = false;
chargedlvl4 = false;
return;
}
}
}
}//advance
}
7921 [Thread-6] ERROR com.fs.starfarer.combat.D - java.lang.RuntimeException: Error compiling [data.scripts.world.corvus.Corvus]
java.lang.RuntimeException: Error compiling [data.scripts.world.corvus.Corvus]
at com.fs.starfarer.loading.scripts.ScriptStore$1.run(Unknown Source)
at java.lang.Thread.run(Thread.java:619)
Caused by: java.lang.ClassNotFoundException: Compiling unit "data/scripts/world/corvus/Corvus.java"
at org.codehaus.janino.JavaSourceClassLoader.generateBytecodes(JavaSourceClassLoader.java:212)
at org.codehaus.janino.JavaSourceClassLoader.findClass(JavaSourceClassLoader.java:164)
at java.lang.ClassLoader.loadClass(ClassLoader.java:307)
at java.lang.ClassLoader.loadClass(ClassLoader.java:248)
... 2 more
[b]Caused by: org.codehaus.commons.compiler.CompileException: Source file "data/scripts/world/corvus/xleattackSpawnPoint.java" does not declare class "data.scripts.world.corvus.xleattackSpawnPoint"[/b]
package data.scripts.world.corvus;
import com.fs.starfarer.api.campaign.CampaignFleetAPI;
import com.fs.starfarer.api.campaign.FleetAssignment;
import com.fs.starfarer.api.campaign.LocationAPI;
import com.fs.starfarer.api.campaign.SectorAPI;
import com.fs.starfarer.api.campaign.SectorEntityToken;
import data.scripts.world.BaseSpawnPoint;
public class XLEattackSpawnPoint extends BaseSpawnPoint {
private final SectorEntityToken station;
public XLEattackSpawnPoint(SectorAPI sector, LocationAPI location,
float daysInterval, int maxFleets, SectorEntityToken anchor, SectorEntityToken station) {
super(sector, location, daysInterval, maxFleets, anchor);
this.station = station;
}
@Override
protected CampaignFleetAPI spawnFleet() {
String type = null;
float r = (float) Math.random();
if (r > .5f) {
type = "scouts";
} else {type = "armada";}
CampaignFleetAPI fleet = getSector().createFleet("XLE", type);
getLocation().spawnFleet(getAnchor(), 0, 0, fleet);
if (type.equals("scouts")) {
fleet.addAssignment(FleetAssignment.RAID_SYSTEM, null, 10);
fleet.addAssignment(FleetAssignment.GO_TO_LOCATION_AND_DESPAWN, getAnchor(), 1000);
} else {
fleet.addAssignment(FleetAssignment.ATTACK_LOCATION, station, 50);
fleet.addAssignment(FleetAssignment.GO_TO_LOCATION_AND_DESPAWN, getAnchor(), 1000);
}
return fleet;
}
}
//XLE strike force
XLEattackSpawnPoint xleattackSpawn = new xleattackSpawnPoint(sector, system, 20, 1, RSFStation, VNSStation);
system.addSpawnPoint(xleattackSpawn);
for (int i = 0; i < 2; i++)
xleattackSpawn.spawnFleet();
package data.scripts.plugins;
import com.fs.starfarer.api.AnimationAPI;
import com.fs.starfarer.api.Global;
import com.fs.starfarer.api.combat.BeamAPI;
import com.fs.starfarer.api.combat.BeamEffectPlugin;
import com.fs.starfarer.api.combat.CombatEngineAPI;
import com.fs.starfarer.api.combat.ShipAPI;
import com.fs.starfarer.api.combat.WeaponAPI;
import com.fs.starfarer.api.util.IntervalUtil;
import java.awt.Color;
public class TraderVariablePowerBlasterEffect implements BeamEffectPlugin
{
// weapon takes 7 seconds to fully charge
private IntervalUtil weaponcooldownlvl = new IntervalUtil(4.0f, 4.0f);
private static int currentCharge = 0;
private static boolean chargedlvl1 = true;
private static boolean chargedlvl2 = false;
private static boolean chargedlvl3 = false;
private static boolean chargedlvl4 = false;
public void advance(float amount, CombatEngineAPI engine, BeamAPI beam)
{
ShipAPI ship = beam.getSource();
if (ship == null)
{
return;
}
AnimationAPI animation = beam.getWeapon().getAnimation();
WeaponAPI weapon = beam.getWeapon();
if(ship.isHulk())
{
animation.setFrame(0);
animation.pause();
}
//Global.getSoundPlayer().playSound("trader_var_blaster_intro",0.5f, 0.5f, weapon.getLocation(), ship.getVelocity());
if(weapon.isFiring())
{
weaponcooldownlvl.advance(amount);
if(weaponcooldownlvl.intervalElapsed() && currentCharge == 1) {
chargedlvl2 = true;
}
if(weaponcooldownlvl.intervalElapsed() && currentCharge == 2) {
chargedlvl3 = true;
}
if(weaponcooldownlvl.intervalElapsed() && currentCharge == 3) {
chargedlvl4 = true;
}
if(chargedlvl1 && weapon.getCooldownRemaining() == 0)
{
Global.getSoundPlayer().playSound("trader_var_blaster_intro",0.5f, 0.5f, weapon.getLocation(), ship.getVelocity());
//engine.addFloatingText(ship.getLocation(), "Power Level 1",15f,Color.GREEN,weapon.getShip(),0f,0f);
chargedlvl1 = false;
currentCharge = 1;
animation.setFrame(1);
animation.play();
}
if (chargedlvl2)
{
chargedlvl2 = false;
weaponcooldownlvl.setInterval(4.0f, 4.0f);
Global.getSoundPlayer().playSound("trader_var_blaster_intro",0.5f, 0.5f, weapon.getLocation(), ship.getVelocity());
engine.addFloatingText(ship.getLocation(), "Power Level 2",20f,Color.BLUE,weapon.getShip(),0f,0f);
currentCharge = 2;
animation.setFrame(6);
animation.play();
}
if (chargedlvl3)
{
chargedlvl3 = false;
weaponcooldownlvl.setInterval(4.0f, 4.0f);
Global.getSoundPlayer().playSound("trader_var_blaster_intro",0.5f, 0.5f, weapon.getLocation(), ship.getVelocity());
engine.addFloatingText(ship.getLocation(), "Power Level 3",25f,Color.MAGENTA,weapon.getShip(),0f,0f);
currentCharge = 3;
animation.setFrame(11);
animation.play();
}
if(chargedlvl4)
{
chargedlvl4 = false;
Global.getSoundPlayer().playSound("trader_var_blaster_intro",0.5f, 0.5f, weapon.getLocation(), ship.getVelocity());
engine.addFloatingText(ship.getLocation(), "Max Power Level",30f,Color.RED,weapon.getShip(),0f,0f);
currentCharge = 4;
animation.setFrame(16);
animation.play();
}
switch (currentCharge)
{
case 0:
{
animation.setFrame(0);
animation.pause();
break;
}
case 1:
{
if(animation.getFrame() == 5)
{
animation.setFrame(1);
animation.play();
}
break;
}
case 2:
{
if(animation.getFrame() == 10)
{
animation.setFrame(6);
animation.play();
}
break;
}
case 3:
{
if(animation.getFrame() == 15)
{
animation.setFrame(11);
animation.play();
}
break;
}
case 4:
{
if(animation.getFrame() == 20)
{
animation.setFrame(16);
animation.play();
}
break;
}
}
}
if(weapon.getChargeLevel() <= 0.1f)
{
switch (currentCharge)
{
case 1:
{
Global.getSoundPlayer().playSound("trader_var_blaster_s1_launch", 1f, 1f, weapon.getLocation(), ship.getVelocity());
engine.spawnProjectile(ship, weapon, "trader_variable_power_blaster_s1", weapon.getLocation(), weapon.getCurrAngle(), ship.getVelocity());
ship.getFluxTracker().increaseFlux(500, false);
weapon.setRemainingCooldownTo(0.5f);
animation.setFrame(0);
animation.pause();
weaponcooldownlvl.setInterval(4.0f, 4.0f);
currentCharge = 0;
chargedlvl1 = true;
chargedlvl2 = false;
chargedlvl3 = false;
chargedlvl4 = false;
return;
}
case 2:
{
Global.getSoundPlayer().playSound("trader_var_blaster_s2_launch", 1f, 1f, weapon.getLocation(), ship.getVelocity());
engine.spawnProjectile(ship, weapon, "trader_variable_power_blaster_s2", weapon.getLocation(), weapon.getCurrAngle(), ship.getVelocity());
ship.getFluxTracker().increaseFlux(500, false);
weapon.setRemainingCooldownTo(0.5f);
animation.setFrame(0);
animation.pause();
weaponcooldownlvl.setInterval(4.0f, 4.0f);
currentCharge = 0;
chargedlvl1 = true;
chargedlvl2 = false;
chargedlvl3 = false;
chargedlvl4 = false;
return;
}
case 3:
{
Global.getSoundPlayer().playSound("trader_var_blaster_s3_launch",1f, 1f, weapon.getLocation(), ship.getVelocity());
engine.spawnProjectile(ship, weapon,"trader_variable_power_blaster_s3", weapon.getLocation(), weapon.getCurrAngle(), ship.getVelocity());
ship.getFluxTracker().increaseFlux(500, false);
weapon.setRemainingCooldownTo(0.5f);
animation.setFrame(0);
animation.pause();
weaponcooldownlvl.setInterval(4.0f, 4.0f);
currentCharge = 0;
chargedlvl1 = true;
chargedlvl2 = false;
chargedlvl3 = false;
chargedlvl4 = false;
return;
}
case 4:
{
Global.getSoundPlayer().playSound("trader_var_blaster_s4_launch",1f, 1f, weapon.getLocation(), ship.getVelocity());
engine.spawnProjectile(ship, weapon,"trader_variable_power_blaster", weapon.getLocation(), weapon.getCurrAngle(), ship.getVelocity());
ship.getFluxTracker().increaseFlux(500, false);
weapon.setRemainingCooldownTo(0.5f);
animation.setFrame(0);
animation.pause();
weaponcooldownlvl.setInterval(4.0f, 4.0f);
currentCharge = 0;
chargedlvl1 = true;
chargedlvl2 = false;
chargedlvl3 = false;
chargedlvl4 = false;
return;
}
}
}
}//advance
}
39601 [Thread-6] ERROR com.fs.starfarer.combat.D - java.lang.VerifyError: (class: data/asc/weapons/mhyp_effect, method: advance signature: (FLcom/fs/starfarer/api/combat/CombatEngineAPI;Lcom/fs/starfarer/api/combat/BeamAPI;)V) Register 7 contains wrong type
java.lang.VerifyError: (class: data/asc/weapons/mhyp_effect, method: advance signature: (FLcom/fs/starfarer/api/combat/CombatEngineAPI;Lcom/fs/starfarer/api/combat/BeamAPI;)V) Register 7 contains wrong type
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:247)
at com.fs.starfarer.loading.scripts.ScriptStore.o00000(Unknown Source)
at com.fs.starfarer.loading.specs.supersuper.ÕÓ0000(Unknown Source)
at com.fs.starfarer.combat.entities.BeamWeaponRay.<init>(Unknown Source)
at com.fs.starfarer.combat.entities.A.A.OOoO.õO0000(Unknown Source)
at com.fs.starfarer.combat.entities.A.A.OOoO.createBeam(Unknown Source)
at com.fs.starfarer.combat.entities.A.OoOO.return.super(Unknown Source)
at com.fs.starfarer.combat.entities.A.OoOO.o0OO.o00000(Unknown Source)
at com.fs.starfarer.combat.entities.A.OoOO.o0OO.o00000(Unknown Source)
at com.fs.starfarer.combat.entities.A.OoOO.return.super(Unknown Source)
at com.fs.starfarer.combat.entities.A.A.OOoO.advance(Unknown Source)
at com.fs.starfarer.combat.systems.WeaponGroup.String(Unknown Source)
at com.fs.starfarer.combat.systems.WeaponGroup.advance(Unknown Source)
at com.fs.starfarer.combat.entities.Ship.super(Unknown Source)
at com.fs.starfarer.combat.entities.Ship.advance(Unknown Source)
at com.fs.starfarer.combat.CombatEngine.advance(Unknown Source)
at com.fs.starfarer.combat.F.ÖÖÒ000(Unknown Source)
at com.fs.A.A.new(Unknown Source)
at com.fs.starfarer.combat.D.o00000(Unknown Source)
at com.fs.starfarer.StarfarerLauncher$2.run(Unknown Source)
at java.lang.Thread.run(Thread.java:619)
ShipAPI ship;
ShipAPI tmp;
for (Iterator iter = engine.getShips().iterator(); iter.hasNext();) {
tmp = (ShipAPI) iter.next();
if (tmp.getLocation() == target.getLocation()) { //If these two entities are in exact same location, then they're obviously the same ship. Also, target is a CombatEntityAPI object.
ship = tmp;
break;
}
}
//Here's what causes the crash on firing the beam. Technically, none of this should even be ran, as it's only supposed to be ran if the beam is actually hitting a ship. I'm using the same requirements for the tachyon lance's every frame effect.
FluxTrackerAPI flux = ship.getFluxTracker();
flux.forceOverload(2.0f);
ShipAPI ship;
ShipAPI tmp;
for (Iterator iter = engine.getShips().iterator(); iter.hasNext();) {
tmp = (ShipAPI) iter.next();
if (tmp.getLocation() == target.getLocation()) { //If these two entities are in exact same location, then they're obviously the same ship. Also, target is a CombatEntityAPI object.
ship = tmp;
break;
}
}
//Here's what causes the crash on firing the beam. Technically, none of this should even be ran, as it's only supposed to be ran if the beam is actually hitting a ship. I'm using the same requirements for the tachyon lance's every frame effect.
FluxTrackerAPI flux = ship.getFluxTracker();
flux.forceOverload(2.0f);
ShipAPI ship = null;Btw, when you're using == to compare locations, what's happening is you're comparing that the objects (Vector2f for each location) are the same, not that the objects' contents are the same. In this case, that's actually what you want, but using if (tmp == target) would make more "sense".
ShipAPI tmp = null;
Btw, when you're using == to compare locations, what's happening is you're comparing that the objects (Vector2f for each location) are the same, not that the objects' contents are the same. In this case, that's actually what you want, but using if (tmp == target) would make more "sense".Oh, cool, good to know that works. I was in "Oh god everything is crashing let's not try to do anything that might not work" mode when I was tinkering with this.
Oh, cool, good to know that works. I was in "Oh god everything is crashing let's not try to do anything that might not work" mode when I was tinkering with this.
Any chance for a shipsystem that when active, generates Command Points at an incredibly slow rate? I'm looking to make command ships have something to do with tactical commands, rather than just slapping snesor increases on them.I'd love to see that!
public class Test implements EveryFrameCombatPlugin
{
private CombatEngineAPI engine;
private int numShips = 0;
@Override
public void advance(float amount, List events)
{
if (engine.isPaused())
return;
List allShips = engine.getShips();
if (allShips.size() != numShips)
{
numShips = allShips.size();
// Number of ships has changed, iterate through and re-apply bonus
}
}
@Override
public void init(CombatEngineAPI engine)
{
this.engine = engine;
numShips=0;
}
}
...
public static final float RANGE_BONUS = 150f;
private static final float HEALTH_BONUS = 1100f;
private static final float ENGINE_BONUS = 450f;
...
if (interval.intervalElapsed()) {
List ships = engine.getShips();
if (ships.size() != numShips) {
numShips = ships.size();
ShipAPI ship = null;
for (Iterator iter = ships.iterator(); iter.hasNext();) {
ship = (ShipAPI) iter.next();
if (ship.isHulk()) continue;
MutableShipStatsAPI stats = ship.getMutableStats();
stats.getWeaponHealthBonus().modifyPercent(ship.getFleetMemberId(), HEALTH_BONUS); //Will not apply bonus to ship.
stats.getEngineHealthBonus().modifyPercent(ship.getFleetMemberId(), ENGINE_BONUS); //Will not apply bonus to ship.
//stats.getBallisticWeaponRangeBonus().modifyPercent(ship.getFleetMemberId(), RANGE_BONUS); //Bonus is applied to ship.
//stats.getEnergyWeaponRangeBonus().modifyPercent(ship.getFleetMemberId(), RANGE_BONUS); //Bonus is applied to ship.
//engine.addFloatingText(ship.getLocation(), "!!", 15f, textColor, ship, 2f, 0.2f);
}
}
}
Is there any way to have the campaign character creation questions before picking a portrait picture?
Also, is it feasible to change station graphics yet?
For some reason, the ship's weapon health and engine health will not be modified. The two commented-out lines, however, will apply the proper bonuses to weapon range without a problem. Any reason why this might be happening? The only thing I can think of is that for the hullmod, these bonuses were applied in "applyEffectsBeforeShipCreation", rather than "applyEffectsAfterShipCreation". So maybe these particular health modifications can't actually be applied while in combat?
Right. That, along with the hull hitpoints, flux capacity, the armor rating, and possibly a few other values, only get used at ship creation. You do, on the other hand, have stats to control the damage taken by weapons etc to work around that.Oh, derp. Totally forgot about all the other methods that could accomplish the same goal...
How would one go about adding a crap-ton of new graphics to the debris section? Would I just add them into a mod or is there some code changing needed...?
graphics/debris/debris_sml0.pngYou can replace them, but can't add new ones.
graphics/debris/debris_sml1.png
graphics/debris/debris_sml2.png
graphics/debris/debris_sml3.png
graphics/debris/debris_med0.png
graphics/debris/debris_med1.png
graphics/debris/debris_lrg0.png
graphics/debris/debris_lrg1.png
I don't think this exists, but I'd love to be wrong: can we get a hook for just after a battle with a reference to the fought fleet (or their name)? For modifying faction relations for example.
If not, has anyone written a tracking script to hack around it?
Got a question. Is ther any way to make a projectile that doesn't inherit velocity? Or at the very least bring it's velocity down to 0?
I also got a question. Is it possible to make a weapon that ignore armor? Like hitting directly the hull of the enemy ship?
I also got a question. Is it possible to make a weapon that ignore armor? Like hitting directly the hull of the enemy ship?
Could do it with an on-hit effect and directly setting the hull value/spawning floaties as appropriate. See the ion cannon .wpn file for more details on an on-hit effect.
Right, a missile with a 0 top speed ought to do it.
Right, a missile with a 0 top speed ought to do it.
It still seems to inherit the speed of the launching ship. I have it sat as a phase_charge missile type because I need to have an AoE effect, I'm not sure if there's a missile type or something like that that doesn't inherit velocity and still enables the proximity fuse effect.
package data.scripts.plugins;
import com.fs.starfarer.api.combat.CombatEngineAPI;
import com.fs.starfarer.api.combat.CombatEntityAPI;
import com.fs.starfarer.api.combat.DamagingProjectileAPI;
import com.fs.starfarer.api.combat.EveryFrameCombatPlugin;
import com.fs.starfarer.api.input.InputEventAPI;
import java.util.HashSet;
import java.util.Iterator;
import java.util.List;
import java.util.Set;
import org.lwjgl.util.vector.Vector2f;
public class RemoveShipInertia implements EveryFrameCombatPlugin
{
// This is the ID of the projectile you want to remove imparted inertia from
private static final String PROJECTILE_ID = "insert projectile ID here";
// Contains the projectiles that have had their inertia stripped
private Set done = new HashSet();
// The engine instance for this battle, used to get all projectiles
private CombatEngineAPI engine;
@Override
public void advance(float amount, List<InputEventAPI> events)
{
if (engine.isPaused())
{
return;
}
// Scan all projectiles on the map each frame
DamagingProjectileAPI tmp;
for (Iterator iter = engine.getProjectiles().iterator(); iter.hasNext();)
{
tmp = (DamagingProjectileAPI) iter.next();
// Check if this projectile is the proper type and
// hasn't had its imparted velocity removed yet
if (PROJECTILE_ID.equals(tmp.getProjectileSpecId())
&& tmp.getSource() != null && !done.contains(tmp))
{
// Subtract the veloctiy imparted by the firing ship
Vector2f.sub(tmp.getVelocity(), tmp.getSource().getVelocity(),
tmp.getVelocity());
done.add(tmp);
}
}
// Remove all expired projectiles from the 'finished' list
for (Iterator iter = done.iterator(); iter.hasNext();)
{
if (!engine.isEntityInPlay((CombatEntityAPI) iter.next()))
{
iter.remove();
}
}
}
@Override
public void init(CombatEngineAPI engine)
{
this.engine = engine;
// I'm 99% sure plugins aren't persistent, but just in case...
done.clear();
}
}
AI Hints for weapons, we could use a few more of those. Myself I could very much use the following, or at least a few of them.BAD_TRACKING: similar to the STRIKE hint for torpedoes, the weapon has a very poor turn rate so watch where you fire it.
We could also use a few more SHIP hints, like the following.
Ideas?
QuoteAI Hints for weapons, we could use a few more of those. Myself I could very much use the following, or at least a few of them.BAD_TRACKING: similar to the STRIKE hint for torpedoes, the weapon has a very poor turn rate so watch where you fire it.
HIGH_FLUX: the weapon uses a lot of flux whenever it fires or builds up flux very rapidly, so don't put it on autofire unless you have the flux to spare.
LOW_AMMO(should be AI integrated): The weapon has a very low ammo count or is running out of ammo, so try to make sure every single shot fired connects with the target.QuoteWe could also use a few more SHIP hints, like the following.
SLOW: The ship in question is very slow or does not maneuver very well, so fly it accordingly
HEAVY: The ship in question has a lot of mass to it, so if you have an opportunity to ram your enemy, do it ;D
WEAK: The ships armor or shields are very weak and perhaps does not have a very impressive armament, so this ship is clearly not designed for slugging with other ships, but rather flanking them and letting others ships do the slugging for you, so do exactly that.
STRONG: This ship has very strong armor or shields and powerful weapons, it's clearly designed to be in your face or be slugging against enemies, use it that way.
BALANCED: This ship has moderate of all the above, Use it for whatever job you need it to do.
BROADSIDER: This ships weapons are all mounted on its side(s), try to keep its side(s) facing the enemy.QuoteIdeas?
Any tips how to create a list of a specific class of ships Mothballed in a station?
To start:
List station_ships = station.getCargo().getMothballedShips().getMembersListCopy(); <-- This gets me a complete list of ships
Then I add this to the mix:
for (int i = 0; i < station_ships.size(); i++) {
MemberAPI = (FleetMemberAPI)station_ships.get(i);
if (MemberAPI.isCapital()) {
Missing the needed line here to create a list of MemberAPI ships with only Capitals in it.
}
}
List capitalShips = new ArrayList();
if (MemberAPI.isCapital()) capitalShips.add(MemberAPI);
CSV files, how do they work?
That's not the first time it happen to me. When i edit the CSV file and save it, no problem. But when i re-open the file, some numbers aren't in the right columns. So how do i get my CSV files to stay still and not doing weird stuffs whenever i modify them? I tried with OpenOffice and silentstormpt CSV Editor.
Also, what does "8/6/5/4%" means? I read somewhere that this column is unused, yet i see some mods using it.
Another question. Still on the CSV. Especially the weapon CSV.
How do i put number with decimals? Let's say i want the burst delay of my weapon to be 0,5. But when i put a number with a "," the game register it as a zero and the weapon fire extremely fast. While using the value 1 it work, but is too slow for my taste.
"engineSlots":[{"id":"ES1",
"loc":[-38, 0],
"style":"TORPEDO_ATROPOS",
"width":50.0,
"length":100.0,
"angle":180.0}]
"engineSlots":[
{"id":"ES1",
"loc":[0, 0],
"style":"CUSTOM",
"styleSpec":{
"engineColor":[100,255,100,255],
"contrailParticleSizeMult":6,
"contrailParticleDuration":2,
"contrailMaxSpeedMult":-0.2,
"contrailAngularVelocityMult":0f,
"contrailColor":[55,255,55,35],
"type":"GLOW" # GLOW or SMOKE
},
"width":9.0,
"length":10.0,
"angle":180.0},
]
"convergeOnPoint":true,
@Arumac: You can code a custom System AI that will regulate the System according to your wishes. See the API documentation for details about how to implement this.
Looking for script that makes possible beam weapon with charge up time (not that smooth build up that can be done by default, but really charge up with possible frame by frame deco animation as some projectile weapons got).
Just checking if this was done before, if not, I will look into it myself, thx.
Do you mean variable blaster?Yes, while it shoots projectiles, its actually a beam weapon, it where i based the death ray
Do you mean variable blaster?Yes, while it shoots projectiles, its actually a beam weapon, it where i based the death ray
SpoilerThis part of the code I'm working on gives me a lot of errors.Spoiler
139116 [Thread-6] ERROR com.fs.starfarer.combat.D - java.lang.StackOverflowError
java.lang.StackOverflowError
at java.util.Arrays.mergeSort(Arrays.java:1270)
at java.util.Arrays.sort(Arrays.java:1210)
at java.util.Collections.sort(Collections.java:159)
at com.fs.starfarer.campaign.fleet.FleetData.ÖøÕ000(Unknown Source)
at com.fs.starfarer.campaign.fleet.FleetData.syncIfNeeded(Unknown Source)
at com.fs.starfarer.campaign.fleet.FleetData.getHangarSpace(Unknown Source)[close]
------------------------------------------------------------------------------
private void Cycle (CampaignFleetAPI fleet) {
float a = (float) Math.random();
if (a > 0.3) {
fleet.addAssignment(FleetAssignment.PATROL_SYSTEM, null, (int) Math.random()*10 + 5);
} else {
fleet.addAssignment(FleetAssignment.DEFEND_LOCATION, getAnchor(), (int) Math.random()*10 + 5);
}
Script script = null;
script = createArrivedScript(fleet, getAnchor());
fleet.addAssignment(FleetAssignment.GO_TO_LOCATION, getAnchor(), 10, script);
}
private Script createArrivedScript(final CampaignFleetAPI fleet, final SectorEntityToken station ) {
return new FleetScript(fleet, station) {
public void run() {
Cycle(fleet);
...
... various checks on the fleet using many local variables and parameters changing the cargo of the fleet and the fleet composition. ...
...
}
};
}
------------------------------------------------------------------------------
Is there any way I can make it prettier or less prone to crashes? It seems that this things I try to do gets smashed quickly by StackOverflow.[close]
Is is possible to have one .wpn file be the base for different weapons? For example, I've got "mmm_1.wpn" and I want to make two different versions of it, same sprite, etc. but one has more ammo than the other. That possible without having to copy the "mmm_1.wpn" twice?
Do you mean variable blaster?Yes, while it shoots projectiles, its actually a beam weapon, it where i based the death ray
It is using "projectile" tag, and therefor it is using charge up for projectile weapons.
Do you mean variable blaster?Yes, while it shoots projectiles, its actually a beam weapon, it where i based the death ray
It is using "projectile" tag, and therefor it is using charge up for projectile weapons.
It uses the "advance" and pre-set timers while its "weapon.IsFiring()", once a timer condition is met, the actual animation loop is changed.
The reason im using a beam for this would be because i can keep track of how long its been firing and also i can use the beam brightness to check if it stopped firing.
If you try the ship on a mission you can understand how the code works. Theres a small problem tho, when you release (fire) it still shoots a few extras due to the brightness condition still triggering.
It's probably not a good idea to have the whole burst in the same sound file - consider what would happen if the ship overloaded / started venting / ran out of flux / etc mid-burst. Also consider that hull mods can change the rate of fire for a weapon.
That said, it shouldn't be playing the pre-burst sound if the weapon is on cooldown or can't fire for any other reason - I'll take a look.
And by the way, is there way how to modify engines other then engine_styles.json ?
"style": "CUSTOM",
"styleSpec": {
"type": "GLOW",
"engineColor": [
68,
250,
50,
255
],
"contrailColor": [
68,
250,
50,
80
],
"contrailParticleSizeMult": 1.0,
"contrailParticleDuration": 0.25,
"contrailMaxSpeedMult": 0.075,
"contrailAngularVelocityMult": 0.0
},
And by the way, is there way how to modify engines other then engine_styles.json ?
Like this:Code"style": "CUSTOM",
"styleSpec": {
"type": "GLOW",
"engineColor": [
68,
250,
50,
255
],
"contrailColor": [
68,
250,
50,
80
],
"contrailParticleSizeMult": 1.0,
"contrailParticleDuration": 0.25,
"contrailMaxSpeedMult": 0.075,
"contrailAngularVelocityMult": 0.0
},
package data.scripts.plugins;
import com.fs.starfarer.api.combat.CombatEngineAPI;
import com.fs.starfarer.api.combat.EveryFrameWeaponEffectPlugin;
import com.fs.starfarer.api.combat.WeaponAPI;
import com.fs.starfarer.api.combat.ShipAPI;
public class BushiVentilatorRotationEffect implements EveryFrameWeaponEffectPlugin {
private float currDir = Math.signum((float) Math.random() - 0.5f);
public void advance(float amount, CombatEngineAPI engine, WeaponAPI weapon) {
if (engine.isPaused()) return;
if (weapon.getShip().isHulk()) return;
float curr = weapon.getCurrAngle();
curr += currDir * amount * 100f;
float arc = weapon.getArc();
weapon.setCurrAngle(curr);
}
public static float normalizeAngle(float angleDeg) {
return (angleDeg % 360f + 360f) % 360f;
}
}
public class HeavyArmor
I would also like to ask if there is a way how to make hull mods and weapons unusable by player in mission. I mean different way them make everything inbuilt.
I would also like to ask if there is a way how to make hull mods and weapons unusable by player in mission. I mean different way them make everything inbuilt.
Look up my mod, the R.U.N.E hull mod was coded by Lazywizard in a way that only ships with the hull id prefix "thule_xxx" can use it.
I'm making a general hullmod, and one issue that came up was the IDs and the names.
In hullmods.csv There's a column for "names", "id", and "script".
In the individual hullmods files like heavy armor, there's only one term that references the terms in hullmods.csv and that is:Codepublic class HeavyArmor
Lets say that I'm adding a range of armor hullmods, and am working with one file right now.
What references "HeavyArmor"? Is it "names" or "id"? I know "script" pretty much already points to the file the csv file needs to look at, so what are the other two? Is "id" for heavy armor in public class heavy armor in the hullmod file, and name is what shows up in game? Isn't the "id" redundant since the csv file already points to the hullmod file in question?
Can you post your weapon_data.csv and your .weapon file?
Edit: I too have a desire for help.
I'm making two mini factions, and the game starts fine when these are enabled. But the Nexus fleets do not seem to attack enemies and vice versa. When another fleet meets with a Nexus fleet, they just stack on top of eachother like two mating flies. What gives? O_o
Download: Nexus (http://avatar.home.xs4all.nl/crap/Nexus_v001.rar)
Two screenshots, Tritachyon and Nexus just sitting there, nothing happening:Spoiler(http://avatar.home.xs4all.nl/crap/screenshot011.png)
(http://avatar.home.xs4all.nl/crap/screenshot012.png)[close]
And the Free Miners Guild fleets simply won't appear. *scratches head*
They should appear in the same manner as independent fleets, that was my goal.
Download: Free Miners Guild (http://avatar.home.xs4all.nl/crap/FreeMinersGuild_v001.rar)
Can someone help me out please? :-X
http://www.mediafire.com/download/owv7bl7794py26p/Citadel_Defenders_0.5pre.zip (http://www.mediafire.com/download/owv7bl7794py26p/Citadel_Defenders_0.5pre.zip)
Alright, here is the link to download my pre-release. The weapon is called fox_lightacel. By the way, the sounds are the sounds of the needler, so I just renamed the needler shots and changed their addresses in the sound config file. Thanks!
Also, how do you get only one station defense fleet to spawn? Do you just create another spawn point that only spawns defense fleets with one max fleet, or what?
Oh yeah, another question. When do the convoys spawn? I don't know how to get them to spawn. It doesn't create and error, so I assume its ok.
When you create the spawn point higher up in the file, there's an argument that sets how many fleets it can create maximum - I believe it's the fourth argument. Set that to zero; this means the spawn point only works when you call it manually. Then later in the gen file, call YourNameHerespawn.spawnFleet();
Example:CodeHegemonyPatrolSpawnPoint patrolSpawn = new HegemonyPatrolSpawnPoint(sector, system, 10, 0, hegemonyStation);
system.addSpawnPoint(patrolSpawn);
patrolSpawn.spawnFleet();
public void apply(MutableShipStatsAPI stats, String id, State state, float effectLevel) {
if (state == ShipSystemStatsScript.State.OUT) {
stats.getMaxSpeed().unmodify(id);
} else {
stats.getMaxSpeed().modifyFlat(id, 200f * effectLevel);
stats.getAcceleration().modifyFlat(id, 200f * effectLevel);
}
}
public void apply(MutableShipStatsAPI stats, String id, State state, float effectLevel) {
if (state == ShipSystemStatsScript.State.OUT) {
stats.getMaxSpeed().modifyFlat(id, 100f * effectLevel);
stats.getAcceleration().modifyFlat(id, 100f * effectLevel);
} else {
stats.getMaxSpeed().unmodify(id);
}
}
@FlashFrozen: Yes, they're enemies. I included two screenshots too. It's very weird. I don't understand it.
Is there a way to reproduce the explosion effect form a large ship (screen whiteout) with a missile?Largish numbers of really huge glow particles in the AOE definition of the projectile.
Also, for the same missile, how do I get large AoE EMP damage?EMP is handled just like regular damage. If it has 20K EMP damage, everything in the AOE that is able to collide is going to take 20K EMP.
Anyone know how to slow down a ship to it's current max top speed while the ship system is active?Just do Burn Drive's script in reverse, but that will not change current velocity. If you want to change current velocity when it's active, you need to have it alter the velocity component of the Entity over time (like, just multiply the XY by 0.99f or whatever).
Check the StarSector log; sometimes the game will throw an exception that is caught, and it should appear in the log. IIRC I had a similar problem once and exceptions were appearing in the log but StarSector carried on merrily :)
Anyone know anything about on hit effects for missiles?
Anyone know anything about on hit effects for missiles?
I do believe it is mentioned in 0.60a patch notes... so.. later :)
{
"id":"neutrino_phasedarray2",
"specClass":"beam",
"type":"ENERGY",
"size":"LARGE",
"displayArcRadius":1100,
"turretSprite":"graphics/neut/weapons/phasedarray/neutrino_phasedarray_base00.png",
"hardpointSprite":"graphics/neut/weapons/phasedarray/neutrino_phasedarray_base00.png",
"numFrames":16,
"frameRate":30,
"turretOffsets":[-80, 0],
"turretAngleOffsets":[0],
"hardpointOffsets":[-80, 0],
"hardpointAngleOffsets":[0],
"fringeColor":[212,60,25,255],
"coreColor":[255,255,255,255],
#"glowColor":[212,60,25,235],
"darkCore":false,
"width":50.0,
"textureType":ROUGH,
#"textureType":["graphics/fx/emp_arcs.png","graphics/fx/emp_arcs.png"],
"textureScrollSpeed":292.0,
"pixelsPerTexel":5.0,
"pierceSet":[PROJECTILE_FF,PROJECTILE_NO_FF,PROJECTILE_FIGHTER,MISSILE_FF,MISSILE_NO_FF,FIGHTER],
"fireSoundOne":"neutrino_heavybeam_firing",
"fireSoundTwo":"beam_heavy_loop",
}
It's type ENERGY; pretty sure it has to be type BALLISTIC.
Missiles can accelerate after being fired. I wonder, is this also possible for ballistic projectiles? If so, does anyone know a weapon that uses this?
Set it like
0,0,0,255
Yes, it would--make sure the last of the four numbers is 0 (it's the alpha channel). So, 0,0,0,0. Though the first 3 numbers don't actually matter. Though actually, 0,0,0,255 might work if the beams are only additive.Set it like
0,0,0,255
Wouldn't that just make it black?
Got a custom beam weapon, seems like
" "textureType":["graphics/BR/missiles/plasmaray.png","graphics/BR/missiles/plasmaray2.png"],"
is valid and used by the game, the question is which texture is used and why? Is one for the core of the beam and one for the edge?
Search up Psyion on youtube. He should have a tutorial for ya'!Righto, goof stuff. Thanks.
A different question, what would be the most practical way to add an effect similar to a 360 muzzle flash to an OnHitEffect? Tons of particles with random vectors? Seems like a bit of a roundabout way to do it.
Well, ideally it would be great to have another field to input the offset of the glow from the center of the sprite or something.
Glow offset would be great.
"point" is where the flash starts. Also note that it's using the offset from the point as the velocity, too; there's no reason it *has* to be that way, just happens to work fairly well.
for (int i = 0; i < numParticles; i++) {
float size = range * (float) Math.random() + min;
float theta = (float) (Math.random() * Math.toRadians(spread) + Math.toRadians(angle - spread/2f));
float r = (float) (Math.random() * length);
float x = (float)Math.cos(theta) * r;
float y = (float)Math.sin(theta) * r;
Vector2f pos = new Vector2f(point.x + x, point.y + y);
Vector2f vel = new Vector2f(x + shipVel.x, y + shipVel.y);
// add particle here, using size/pos/vel
}
try
{
Global.getSettings().getScriptClassLoader().loadClass("data.scripts.world.HiigaraGen");
return true;
}
catch (ClassNotFoundException ex)
{
return false;
}
ah, i see, okay i guess there is the problem. the frames are numbered in three digits and the number is not at the end of the filename.hello were you able to sort out the problem.. I am facing similar issue with my program files so please help.. Please reply thanks in advance:)
What i did:
I took okims mod "ironclad" and tried to mimic his landing led light (http://www.niceledlights.com).
The following files are involved:
D:\Program Files (x86)\Fractal Softworks\Starsector\mods\Thule Legacy\data\scripts\plugins\isHulkCheck.javaCodepackage data.scripts.plugins;
import com.fs.starfarer.api.AnimationAPI;
import com.fs.starfarer.api.combat.CombatEngineAPI;
import com.fs.starfarer.api.combat.EveryFrameWeaponEffectPlugin;
import com.fs.starfarer.api.combat.WeaponAPI;
import com.fs.starfarer.api.combat.FluxTrackerAPI;
public class isHulkCheck implements EveryFrameWeaponEffectPlugin
{
public void advance(float amount, CombatEngineAPI engine, WeaponAPI weapon)
{
if (engine.isPaused()) return;
AnimationAPI animation = weapon.getAnimation();
if (weapon.getShip().isHulk())
{
animation.pause();
}
else
{
animation.play();
}
}
}
D:\Program Files (x86)\Fractal Softworks\Starsector\mods\Thule Legacy\data\weapons\thule_deco_heimdahl.wpnCode[/u]{
"id":"thule_deco_heimdahl",
"specClass":"projectile",
"type":"DECORATIVE",
"size":"MEDIUM",
"everyFrameEffect":"data.scripts.plugins.isHulkCheck",
"turretSprite":"graphics/TL/weapons/decor/thule_heimdahl_Frame-01.png",
"hardpointSprite":"graphics/TL/weapons/decor/thule_heimdahl_Frame-01.png",
"numFrames":60,
"frameRate":15,
"alwaysAnimate":"true",
"turretOffsets":[0, 0],
"turretAngleOffsets":[0],
"hardpointOffsets":[0, 0],
"hardpointAngleOffsets":[0],
"barrelMode":"ALTERNATING", # or LINKED. whether barrels fire at the same time or alternate.
"animationType":"MUZZLE_FLASH", # NONE, GLOW, MUZZLE_FLASH, SMOKE
"muzzleFlashSpec":{"length":0.0, # only used if animationType = MUZZLE_FLASH
"spread":10,
"particleSizeMin":4.0,
"particleSizeRange":18.0,
"particleDuration":0.2,
"particleCount":25,
"particleColor":[255,150,30,200]},
"projectileSpecId":"thule_barbarossa_shot", # projectile that will be fired
"fireSoundTwo":"thule_barbarossa",
"fireSoundOne":"thule_barbarossa_overload",
}
It just uses polar coordinates to spawn stuff in an arc.Spoiler"point" is where the flash starts. Also note that it's using the offset from the point as the velocity, too; there's no reason it *has* to be that way, just happens to work fairly well.
for (int i = 0; i < numParticles; i++) {
float size = range * (float) Math.random() + min;
float theta = (float) (Math.random() * Math.toRadians(spread) + Math.toRadians(angle - spread/2f));
float r = (float) (Math.random() * length);
float x = (float)Math.cos(theta) * r;
float y = (float)Math.sin(theta) * r;
Vector2f pos = new Vector2f(point.x + x, point.y + y);
Vector2f vel = new Vector2f(x + shipVel.x, y + shipVel.y);
// add particle here, using size/pos/vel
}[close]
Edit: I should say, there are definitely other ways to approach generating a muzzle flash. This one is pretty simplistic, but generally seems good enough.
SpoilerDoes anyone know how to check if a mod is installed, and if so which version?
Currently I am checking if a mod is installed like this (example):Codetry
{
Global.getSettings().getScriptClassLoader().loadClass("data.scripts.world.HiigaraGen");
return true;
}
catch (ClassNotFoundException ex)
{
return false;
}
which works well, but doesn't get me the version of the mod. Anyone have any ideas? :)[close]
One question, is there a boolean to determine if a weapon is charging? I want to make a reverse muzzle flash animation while the Nevermore's built-in weapon is charging, but I think it could prove somewhat tricky.
Like cartridges from a gun, yes it possible, you should use a Interval timer to from x to x seconds to make sure its both firing and it doesn't spawn too many "projectiles".
switch (currentCharge)
{
case 0:
{
animation.setFrame(0);
animation.pause();
break;
}
case 1:
{
if(animation.getFrame() == 5)
{
animation.setFrame(1);
animation.play();
}
break;
}
case 2:
{
if(animation.getFrame() == 10)
{
animation.setFrame(6);
animation.play();
}
break;
}
case 3:
{
if(animation.getFrame() == 15)
{
animation.setFrame(11);
animation.play();
}
break;
}
case 4:
{
if(animation.getFrame() == 20)
{
animation.setFrame(16);
animation.play();
}
break;
}
}
OH I KNOW I REMEMBER!!!
BIT DEPTH LEVEL!!!
Open it in paint.net and resave it with a different bit depth
My guess is some sort of issue with the png itself; I've seen this mentioned before. I suspect just re-saving without changing the canvas size would have fixed it. There's nothing about the size of the sprite that should make a difference here.
Yeah but it is possible to start animation for different sprite? I mean if it is possible to start animation of some deco while weapon is firing (so basically link deco to weapon). I can, ofc, create weapon sprite big enough to cover main weapon and those cartridges ejectors, but due to ship size and distance between those it would be kinda overkill.
Is there any way to get an onhiteffect to activate even when it hits a shield?It will always work that way in this build, provided that:
I think my head will just pop, here is the problem:
I am creating animated beam weapon, base sprite is loaded and visible, on fire it disappears and become visible at the end of animation. BUT! (and that´s what grinds my gears) if I replace it with different animated sprite, for example shredder or something from different mod it works. BUT WAIT, there is more. If I move that working sprite from different mod to my mod (whole folder with animation), and change path it just stops to work again (same error as in first place). If I move my sprite to different mode and try to load it from there, then again same error. Ideas?
If I move that sprite to my mod (remove it from original folder in another mode) and turn off that mod then same bug as always, on the other hand if the second mod is still active then it is working again. It seems to like there is some config file (similar to sounds config file) that just point on "that is animation". But ffs I went through every single file six times and there is (and actually there is no reason to be) anything like that. So what the hell?
As I said, when I moved that sprite from other mode to my mod then it wasn´t working again as long as I didn´t had second mode activated (when I activated it it was ok). I´ve named frames according to shredder.. so in this case terror_rail_00.png .... terror_rail_30.png ...In these lines:
And yeap, format is alright....
Point is this, it looks like, some script is actually checking if there are all frames of sprites while loading the game.
EDIT: I mean, if I remove one frame of shredder (or rename it) for example if I remove chaingun2_hardpoint_base02.png then game crash on loading, where is defined that engine should load this up? How does it know how many frames while starting the game?
"numFrames":21,
"frameRate":10,
"alwaysAnimate":"false",
"everyFrameEffect":"data.scripts.plugins.TraderVariablePowerBlasterEffect",
"turretSprite": "graphics/missiles/animation/trader_variant_00.png",
"hardpointSprite": "graphics/missiles/animation/trader_variant_00.png",
package data.scripts.plugins;
import com.fs.starfarer.api.AnimationAPI;
import com.fs.starfarer.api.Global;
import com.fs.starfarer.api.combat.BeamAPI;
import com.fs.starfarer.api.combat.BeamEffectPlugin;
import com.fs.starfarer.api.combat.CombatEngineAPI;
import com.fs.starfarer.api.combat.ShipAPI;
import com.fs.starfarer.api.combat.WeaponAPI;
import com.fs.starfarer.api.util.IntervalUtil;
import java.awt.Color;
public class TraderVariablePowerBlasterEffect implements BeamEffectPlugin
{
// weapon takes 7 seconds to fully charge
private IntervalUtil weaponcooldownlvl = new IntervalUtil(4.0f, 4.0f);
private static int currentCharge = 0;
private static boolean chargedlvl1 = true;
private static boolean chargedlvl2 = false;
private static boolean chargedlvl3 = false;
private static boolean chargedlvl4 = false;
@Override
public void advance(float amount, CombatEngineAPI engine, BeamAPI beam)
{
ShipAPI ship = beam.getSource();
if (ship == null)
{
return;
}
AnimationAPI animation = beam.getWeapon().getAnimation();
WeaponAPI weapon = beam.getWeapon();
if(ship.isHulk())
{
animation.setFrame(0);
animation.pause();
}
//Global.getSoundPlayer().playSound("trader_var_blaster_intro",0.5f, 0.5f, weapon.getLocation(), ship.getVelocity());
if(weapon.isFiring())
{
weaponcooldownlvl.advance(amount);
if(weaponcooldownlvl.intervalElapsed() && currentCharge == 1) {
chargedlvl2 = true;
}
if(weaponcooldownlvl.intervalElapsed() && currentCharge == 2) {
chargedlvl3 = true;
}
if(weaponcooldownlvl.intervalElapsed() && currentCharge == 3) {
chargedlvl4 = true;
}
if(chargedlvl1 && weapon.getCooldownRemaining() == 0)
{
Global.getSoundPlayer().playSound("trader_var_blaster_intro",0.5f, 0.5f, weapon.getLocation(), ship.getVelocity());
//engine.addFloatingText(ship.getLocation(), "Power Level 1",15f,Color.GREEN,weapon.getShip(),0f,0f);
chargedlvl1 = false;
currentCharge++;
animation.setFrame(1);
animation.play();
}
if (chargedlvl2)
{
chargedlvl2 = false;
Global.getSoundPlayer().playSound("trader_var_blaster_intro",0.5f, 0.5f, weapon.getLocation(), ship.getVelocity());
engine.addFloatingText(ship.getLocation(), "Power Level 2",20f,Color.BLUE,weapon.getShip(),0f,0f);
currentCharge++;
animation.setFrame(6);
animation.play();
}
if (chargedlvl3)
{
chargedlvl3 = false;
Global.getSoundPlayer().playSound("trader_var_blaster_intro",0.5f, 0.5f, weapon.getLocation(), ship.getVelocity());
engine.addFloatingText(ship.getLocation(), "Power Level 3",25f,Color.MAGENTA,weapon.getShip(),0f,0f);
currentCharge++;
animation.setFrame(11);
animation.play();
}
if(chargedlvl4)
{
chargedlvl4 = false;
Global.getSoundPlayer().playSound("trader_var_blaster_intro",0.5f, 0.5f, weapon.getLocation(), ship.getVelocity());
engine.addFloatingText(ship.getLocation(), "Max Power Level",30f,Color.RED,weapon.getShip(),0f,0f);
currentCharge++;
animation.setFrame(16);
animation.play();
}
switch (currentCharge)
{
case 0:
{
animation.setFrame(0);
animation.pause();
break;
}
case 1:
{
if(animation.getFrame() == 5)
{
animation.setFrame(1);
animation.play();
}
break;
}
case 2:
{
if(animation.getFrame() == 10)
{
animation.setFrame(6);
animation.play();
}
break;
}
case 3:
{
if(animation.getFrame() == 15)
{
animation.setFrame(11);
animation.play();
}
break;
}
case 4:
{
if(animation.getFrame() == 20)
{
animation.setFrame(16);
animation.play();
}
break;
}
}
}
if(weapon.getChargeLevel() <= 0.1f && currentCharge > 0)
{
switch (currentCharge)
{
case 1:
{
Global.getSoundPlayer().playSound("trader_var_blaster_s1_launch", 1f, 1f, weapon.getLocation(), ship.getVelocity());
engine.spawnProjectile(ship, weapon, "trader_variable_power_blaster_s1", weapon.getLocation(), weapon.getCurrAngle(), ship.getVelocity());
ship.getFluxTracker().increaseFlux(500, false);
weapon.setRemainingCooldownTo(0.5f);
animation.setFrame(0);
animation.pause();
weaponcooldownlvl.forceIntervalElapsed();
currentCharge = 0;
chargedlvl1 = true;
chargedlvl2 = false;
chargedlvl3 = false;
chargedlvl4 = false;
return;
}
case 2:
{
Global.getSoundPlayer().playSound("trader_var_blaster_s2_launch", 1f, 1f, weapon.getLocation(), ship.getVelocity());
engine.spawnProjectile(ship, weapon, "trader_variable_power_blaster_s2", weapon.getLocation(), weapon.getCurrAngle(), ship.getVelocity());
ship.getFluxTracker().increaseFlux(500, false);
weapon.setRemainingCooldownTo(0.5f);
animation.setFrame(0);
animation.pause();
weaponcooldownlvl.forceIntervalElapsed();
currentCharge = 0;
chargedlvl1 = true;
chargedlvl2 = false;
chargedlvl3 = false;
chargedlvl4 = false;
return;
}
case 3:
{
Global.getSoundPlayer().playSound("trader_var_blaster_s3_launch",1f, 1f, weapon.getLocation(), ship.getVelocity());
engine.spawnProjectile(ship, weapon,"trader_variable_power_blaster_s3", weapon.getLocation(), weapon.getCurrAngle(), ship.getVelocity());
ship.getFluxTracker().increaseFlux(500, false);
weapon.setRemainingCooldownTo(0.5f);
animation.setFrame(0);
animation.pause();
weaponcooldownlvl.forceIntervalElapsed();
currentCharge = 0;
chargedlvl1 = true;
chargedlvl2 = false;
chargedlvl3 = false;
chargedlvl4 = false;
return;
}
case 4:
{
Global.getSoundPlayer().playSound("trader_var_blaster_s4_launch",1f, 1f, weapon.getLocation(), ship.getVelocity());
engine.spawnProjectile(ship, weapon,"trader_variable_power_blaster", weapon.getLocation(), weapon.getCurrAngle(), ship.getVelocity());
ship.getFluxTracker().increaseFlux(500, false);
weapon.setRemainingCooldownTo(0.5f);
animation.setFrame(0);
animation.pause();
weaponcooldownlvl.forceIntervalElapsed();
currentCharge = 0;
chargedlvl1 = true;
chargedlvl2 = false;
chargedlvl3 = false;
chargedlvl4 = false;
return;
}
}
}
}//advance
}
Got it, fixed it (workaround) and yes it is a bug... When weapon is set to beam mode then game doesnt suppose that there is going to be animation (when loading game), so it wont load .pngs... tho animation for beam weapons is implemented so then it is trying to render frames that are not loaded (that´s why it disappear)... Work around: Create PROJECTILE weapon, that will load that animation and then just use it in beam weapon (so I just created projectile weapon vs_load_rail that I wont never ever use)... WIN
EDIT: I am not sure if I didn´t lose some of my sanity.. so I am just going to kill few of those pink kitties with shaving blade just to make sure.
Btw: I need to control beam weapon animation through script (pause it for few frames, just it only on beam charging up and such a things) I know it can be done easily for Projectile weapons through implementing EveryFrameWeaponEffect... but I suppose it is going to be pain for beam weapon with BeamEffectPlugin... but let´s see. (actually I suppose the "only" problem will be to prevent beam weapon from animating while it is on cooldown, in case if someone would press fire button... but it is going to be weapon used only by Ai anyway, so not such a big deal I guess)
Since the reverse burn drive thing I tried didn't work, on to the next one :D
0.54.1a
Modding:
Beam and burst beam weapons can now be animated (but the glow sprite can not, must remain the same for all frames)
Well I tried to make an animated weapon, but the animation part of it doesn't work >>"
Apology for not being able to take consecutive screenshots, Starsector crashes after just one screenshot, So this is how it looks,Spoiler(http://i.imgur.com/uyALNOK.png)
(http://i.imgur.com/2wpy2xT.jpg)[close]
It shows only the first frame, once you fire, the weapon disappears, and the reappears after what probably means it cycled through all the frames.Code{
"id":"neutrino_phasedarray2",
"specClass":"beam",
"type":"ENERGY",
"size":"LARGE",
"displayArcRadius":1100,
"turretSprite":"graphics/neut/weapons/phasedarray/neutrino_phasedarray_base00.png",
"hardpointSprite":"graphics/neut/weapons/phasedarray/neutrino_phasedarray_base00.png",
"numFrames":16,
"frameRate":30,
"turretOffsets":[-80, 0],
"turretAngleOffsets":[0],
"hardpointOffsets":[-80, 0],
"hardpointAngleOffsets":[0],
"fringeColor":[212,60,25,255],
"coreColor":[255,255,255,255],
#"glowColor":[212,60,25,235],
"darkCore":false,
"width":50.0,
"textureType":ROUGH,
#"textureType":["graphics/fx/emp_arcs.png","graphics/fx/emp_arcs.png"],
"textureScrollSpeed":292.0,
"pixelsPerTexel":5.0,
"pierceSet":[PROJECTILE_FF,PROJECTILE_NO_FF,PROJECTILE_FIGHTER,MISSILE_FF,MISSILE_NO_FF,FIGHTER],
"fireSoundOne":"neutrino_heavybeam_firing",
"fireSoundTwo":"beam_heavy_loop",
}
Am I missing something ???
Ahhh! Thank you for catching that beam-animation-not-loading bug, fixed it up. That's pretty evil.
By the way - beam weapons can have an everyFrameEffect, along with a beamEffect. The difference is that beamEffect will be called for every beam, if the weapon happens to have multiple barrels.
Np. Observation about that BeamEffectPlugin: lets say I have some declared and defined variables for that class. It seems like (not seems, I am pretty sure) engine resets them to their initial values.
You will just use .wpn for Beam weapon (for animated one), as you suppose to, you just need to create one more .wpn as Projectile weapon, that will load animation sprites (.png sequence) that you are going to use for Beam weapon .wpn file. Ofc you need to have both weapons in weapon_data.csv. If you still need any help I will upload my .wpns files.
silentstormpt: Your weapon is animated all the time, basicly there is no time when player could press button and weapon not to be animated (no CD)... but anyway I think I have solution for that problem.. I have already implemented pause for specific frame of animation (derived from Lazy´s solution for projectile animation pause).
You will just use .wpn for Beam weapon (for animated one), as you suppose to, you just need to create one more .wpn as Projectile weapon, that will load animation sprites (.png sequence) that you are going to use for Beam weapon .wpn file. Ofc you need to have both weapons in weapon_data.csv. If you still need any help I will upload my .wpns files.
silentstormpt: Your weapon is animated all the time, basicly there is no time when player could press button and weapon not to be animated (no CD)... but anyway I think I have solution for that problem.. I have already implemented pause for specific frame of animation (derived from Lazy´s solution for projectile animation pause).
Now I got it working, was a little confused, but It's just a second weapon just to load the sprites itself, sneaky. :D
But why is the dilemmas always similar, Just gotta make the animation hold mid way for couple of seconds, and rather not rename 60 frames of... the same thing.
Though Cycerin has a script that does this, idk how to make it work midway instead at the beginning of it.
Nope, variables were right, just observation kinda wrong... so new statement:
BeamEffectPlugin isn´t called when beam is actually not active and when it get active next time it will start with initial values of variables.
Correct. That generally seems desirable for actual beam effects, doesn't it? But probably makes it a bad place to govern the weapon's animation from. There's also the part about it being passed in a BeamAPI, which doesn't exist while the weapon isn't firing, though I suppose that could be null...
Question about png, bit-depth is obvious but what about interlacing and compression? It seems like (by their size) every vanilla png use highest/slowest compression, not sure about interlacing but I guess it even doesnt matter in this case.
Still curious about that compression, coz none-fast produce bigger image but they could be actually easier and faster to load by the engine itself, but not completely sure about that.
Still curious about that compression, coz none-fast produce bigger image but they could be actually easier and faster to load by the engine itself, but not completely sure about that.
I'd be shocked if the time spent decoding was significant compared to the time spent loading the image from disk for any non-trivial number of computer setups. Shocked, I tell you :)
I cannot find to log so i don't know how to say this but I am getting a fatal error loading a projectile sprite, in graphics/WFE/Missiles/bomlete3.png I don't know what is happening I have compared my weapon data and stuff to that of other mods and the core files and cannot see what the fatal difference is, any suggestions?
ListIterator Fleetships = FleetID.getFleetData().getMembersListCopy().listIterator();
while(Fleetships.hasNext())
{
FleetMemberAPI fmember = (FleetMemberAPI)Fleetships.next();
MutableShipStatsAPI stats = fmember.getStats();
ShipAPI ship = (ShipAPI) stats.getEntity();
}
Is there any way to get at what a ship's armed with? I'm working on a ship system AI; the system in question primarily benefits energy weapons, but the ship has universal slots - I'd like the AI to react intelligently to noticing that it has missiles or ballistics instead of energy weaponry. (This one I'm pretty sure isn't doable until 0.6, but hey, worth asking right?)
I don't know if this suggestion has been made yet- only read through the last few pages, but here is a possible idea that could balance out the problems with using beams to kite while still giving them killing power. What if beams did full DPS throughout their range, but scaled from 100% hard flux at zero range to 100% soft flux at max range? (or maybe something like 50% soft at 20% max range and lower to 100% soft at 80% max range and higher). You could even put in a slight color or gamma gradient over the beam's range so there is visual feedback on whether you are in the soft or hard flux range bands.
Thus - if you try to kite with your superior range you're only doing soft flux, but if you want to abuse your manly tri-tac shields you can fly in close for some hard flux damage, but risk the return fire.
I liked this idea so much I decided to try it out. Here's (http://www.mediafire.com/download/rt9b5lirjogrs3h/Alternate_Beam_Mechanics.zip) a small test mod that gives all vanilla beams 0-100% hard flux based on distance to the target (requires LazyLib (http://fractalsoftworks.com/forum/index.php?topic=5444.0)).
I've only tested it briefly, but the most noticeable effect is that the famed Disco Paragon has gone from "able to kill anything smaller than it" to "able to kill anything, period" (including taking on two Conquests and an Onslaught simultaneously). I'll try making a version using the other variant you mentioned, as I think that might be more balanced. :)
package data.scripts.weapons;
import com.fs.starfarer.api.combat.BeamAPI;
import com.fs.starfarer.api.combat.BeamEffectPlugin;
import com.fs.starfarer.api.combat.CombatEngineAPI;
import com.fs.starfarer.api.combat.FluxTrackerAPI;
import com.fs.starfarer.api.combat.ShieldAPI;
import com.fs.starfarer.api.combat.ShipAPI;
import com.fs.starfarer.api.combat.WeaponAPI;
import org.lazywizard.lazylib.MathUtils;
import org.lazywizard.lazylib.combat.DefenseType;
import org.lazywizard.lazylib.combat.WeaponUtils;
public class HardFluxBeam implements BeamEffectPlugin
{
@Override
public void advance(float amount, CombatEngineAPI engine, BeamAPI beam)
{
if (beam.getDamageTarget() instanceof ShipAPI)
{
ShipAPI target = (ShipAPI) beam.getDamageTarget();
ShieldAPI shield = target.getShield();
if (shield != null && shield.isWithinArc(beam.getTo()))
{
WeaponAPI wep = beam.getWeapon();
float damage = WeaponUtils.calculateDamagePerSecond(wep,
target, DefenseType.SHIELD) * amount;
// Hard flux dealt is based on distance to target
float hardFluxRatio = 1f - (MathUtils.getDistance(
beam.getFrom(), beam.getTo()) / wep.getRange());
float softFlux = damage * (1f - hardFluxRatio);
float hardFlux = damage * hardFluxRatio;
// Undo the vanilla flux damage, add our custom damage
FluxTrackerAPI flux = target.getFluxTracker();
flux.decreaseFlux(damage);
flux.increaseFlux(softFlux, false);
flux.increaseFlux(hardFlux, true);
}
}
}
}
package data.shipsystems.scripts.ai;
import com.fs.starfarer.api.combat.MutableShipStatsAPI;
import com.fs.starfarer.api.combat.CombatEngineAPI;
import com.fs.starfarer.api.combat.ShipAPI;
import com.fs.starfarer.api.combat.ShipSystemAIScript;
import com.fs.starfarer.api.combat.ShipSystemAPI;
import com.fs.starfarer.api.combat.ShipwideAIFlags;
import java.util.Iterator;
import org.lwjgl.util.vector.Vector2f;
import org.lazywizard.lazylib.combat.*;
import org.lazywizard.lazylib.MathUtils;
public class ms_siegemodeAI implements ShipSystemAIScript {
private ShipSystemAPI system;
private ShipAPI ship;
@Override
public void init(ShipAPI ship, ShipSystemAPI system, ShipwideAIFlags flags, CombatEngineAPI engine)
{
this.ship = ship;
this.system = system;
}
@Override
public void advance(float amount, MutableShipStatsAPI stats, Vector2f missileDangerDir, Vector2f collisionDangerDir, ShipAPI target)
{
float goLive = 1200f; //the AI needs to know (roughly) how big the range of our weapons boost is.
float fuzzyLogic = 0f; //set our logic counter to 0
int ships = 0;
ShipAPI ship_tmp;
for (Iterator iter = CombatUtils.getCombatEngine().getShips().iterator();
iter.hasNext();)
{
ship_tmp = (ShipAPI) iter.next();
ship_tmp.getMutableStats();
if ((ship_tmp.getOwner() != ship.getOwner()) && (MathUtils.getDistance(ship_tmp, ship) >= (goLive * 1.05f)))
{ //Check hostility and range
fuzzyLogic += ship_tmp.getFluxCapacity(); //Watch out for lots of Flux -- This is the first line bearing an error.
fuzzyLogic += ship_tmp.getMaxHitpoints(); //And big hitpoint pools - we can generally presume that vessel with both/either would require sieging
fuzzyLogic -= (ship_tmp.getMaxSpeed() * 2.5f); //Of course, we don't really want to hold still when we're dealing with fast targets -- And this is the second.
}
}
float fluxLevel = ship.getFluxTracker().getFluxLevel();
if (fuzzyLogic > 5000f && !system.isActive() && fluxLevel < 0.95f) {
//compare our counter to a magic number, make sure the system is already off, and that our flux level isn't too high
ship.useSystem();
} else if ((fuzzyLogic <= 2000f || fluxLevel >= 0.95f || goLive >= goLive * 1.15f) && system.isActive()) {
//if there is little-to-no threat OR if our flux level is too high OR if the enemies are far enough away, turn the system off if it is currently active
ship.useSystem();
} else { return; }
}
}
Honestly, it feels like the problem shouldn't be that hard to deal with, except every time I end up calling up the autocomplete in netbeans the program hangs, which is kind of annoying.
public void advance(float amount, MutableShipStatsAPI stats, Vector2f missileDangerDir, Vector2f collisionDangerDir, ShipAPI target)
public void advance(float amount, Vector2f missileDangerDir, Vector2f collisionDangerDir, ShipAPI target)
Will we be able to assign specific graphics to stations in 0.6a?
I realise that we can do this now, but as of now it overwrites the graphics of all stations.
To elaborate my question: can we make station graphics faction specific in 0.6a?
Can somebody explain to me in a nutshell, what Jars are, and how they work with Starsector? It seems like a pretty standard Java thing. Funnily enough I don't know much about Java.
(I'm asking because it seems like you need them to get around generics are something. It's hard to explain because I'm realizing just now how little I know about Java.)
"jars":["jars/LazyLib.jar",],
"engine_loop":{
"sounds":[
{"file":"sounds/BR/fx/brdyshipsounds/blackrockengine_frig.ogg","pitch":1,"volume":1}, # index: 14
{"file":"sounds/BR/fx/brdyshipsounds/blackrockengine_frig.ogg","pitch":1,"volume":1}, # index: 15
{"file":"sounds/BR/fx/brdyshipsounds/blackrockengine_destroyer.ogg","pitch":1,"volume":1}, # index: 16
{"file":"sounds/BR/fx/brdyshipsounds/blackrockengine_cruiser.ogg","pitch":1,"volume":1}, # index: 17
{"file":"sounds/BR/fx/brdyshipsounds/blackrockengine_capital.ogg","pitch":1,"volume":1}, # index: 18
],
"BLACKROCKHULL":{"sounds":[15,16,17,18,19], "pitch":1, "volume":1},
"FIGHTER":{"sounds":[15], "pitch":1, "volume":0.5},
"FRIGATE":{"sounds":[16], "pitch":0.9, "volume":0.6},
"DESTROYER":{"sounds":[17], "pitch":0.9, "volume":0.7},
"CRUISER":{"sounds":[18], "pitch":0.9, "volume":0.75},
"CAPITAL_SHIP":{"sounds":[19], "pitch":1, "volume":0.8},
},
As far as I can see, if I use an index from 0 and out it uses core sounds. But if a different mod tried to call the same list entries as the ones I'm using, would there be a conflict? Can I do this in a more... isolated fashion?
"shipNameSources":{
"regime":1,
},
{
"regime":
[
"Hand of God",
"Repentant",
],
}
@Override
public void onEnabled(boolean wasEnabledBefore)
{
if (!wasEnabledBefore)
{
// Calling a separate method avoids duplicate code with onNewGame()
initVayra();
}
}
Why do ships with 0 crew (As in, unmanned--there shouldn't be any crew) always have 0% combat readiness? Is there a way to override the automatically-assigned 0% CR, or is this a bug?
Why do ships with 0 crew (As in, unmanned--there shouldn't be any crew) always have 0% combat readiness? Is there a way to override the automatically-assigned 0% CR, or is this a bug?
Thanks Lazy, that's pretty helpful. Although I'm still confused, I may as well try to describe what I want to do.
All I wanna do is add special dialogue options for Stations controlled by a specific faction.
Also would like to do a special dialogue that only plays when you interact with a planet.
But things don't ever seem to work the way I want them to.
I should add that I'd like to to NOT replace anything I can avoid replacing, for compatibility.
@Override
public PluginPick pickInteractionDialogPlugin(SectorEntityToken interactionTarget)
{
// The Omnifactory uses a special interaction dialog
if (OmniFac.isFactory(interactionTarget))
{
// PluginPick is a wrapper that allows you to assign a priority to a plugin
// The highest priority plugin returned by all mods' CampaignPlugins will be the one used
return new PluginPick(new OmniFacInteractionPlugin(),
PickPriority.MOD_SPECIFIC);
}
// Returning null means this mod doesn't have a specific interaction plugin for this entity
// If all mods return null, the vanilla interaction behavior for that entity will be used
return null;
}
I updated my mod to the new ModPlugin system as per LazyWizard's post and it kept calling the OnEnabled part every time a saved game was loaded -- as if it wasn't reading the "if (!wasEnabledBefore)" or rather I suppose as if wasEnabledBefore never got set. I was under the impression the game's built-in mod handling set it automatically, is there a way I can do it manually in the onNewGame? I'm sure it's really simple but I can't really into java :vCode@Override
public void onEnabled(boolean wasEnabledBefore)
{
if (!wasEnabledBefore)
{
// Calling a separate method avoids duplicate code with onNewGame()
initVayra();
}
}
I fixed the problem for now by just commenting that block of code out, but that's obviously nonoptimal as it means I can't add my mod to existing games.
32318 [Thread-6] ERROR com.fs.starfarer.combat.D - java.lang.ClassCastException: com.fs.starfarer.campaign.Hyperspace cannot be cast to com.fs.starfarer.api.campaign.StarSystemAPI
java.lang.ClassCastException: com.fs.starfarer.campaign.Hyperspace cannot be cast to com.fs.starfarer.api.campaign.StarSystemAPI
at com.fs.starfarer.campaign.save.CampaignGameManager.super(Unknown Source)
at com.fs.starfarer.title.B.dialogDismissed(Unknown Source)
at com.fs.starfarer.ui.K.dismiss(Unknown Source)
at com.fs.starfarer.ui.impl.oooOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO.dismiss(Unknown Source)
at com.fs.starfarer.campaign.save.OooO.actionPerformed(Unknown Source)
at com.fs.starfarer.ui.O00o.super(Unknown Source)
at com.fs.starfarer.ui.F.processInput(Unknown Source)
at com.fs.starfarer.ui.newsuper.o00000(Unknown Source)
at com.fs.starfarer.new.????00(Unknown Source)
at com.fs.oOOO.super.new(Unknown Source)
at com.fs.starfarer.combat.D.o00000(Unknown Source)
at com.fs.starfarer.StarfarerLauncher$2.run(Unknown Source)
at java.lang.Thread.run(Thread.java:619)
import data.scripts.world.systems.CoronaAustralis;
package data.scripts.world.systems;
import java.awt.Color;
import java.util.List;
import com.fs.starfarer.api.Global;
import com.fs.starfarer.api.campaign.CargoAPI;
import com.fs.starfarer.api.campaign.JumpPointAPI;
import com.fs.starfarer.api.campaign.LocationAPI;
import com.fs.starfarer.api.campaign.OrbitAPI;
import com.fs.starfarer.api.campaign.PlanetAPI;
import com.fs.starfarer.api.campaign.SectorAPI;
import com.fs.starfarer.api.campaign.SectorEntityToken;
import com.fs.starfarer.api.campaign.StarSystemAPI;
import com.fs.starfarer.api.campaign.CargoAPI.CrewXPLevel;
import com.fs.starfarer.api.fleet.FleetMemberType;
public class CoronaAustralis {
public void generate(SectorAPI sector) {
StarSystemAPI system = sector.createStarSystem("Corona Australis");
LocationAPI hyper = Global.getSector().getHyperspace();
system.setBackgroundTextureFilename("graphics/backgrounds/CoronaAustralis.jpg");
// create the star and generate the hyperspace anchor for this system
PlanetAPI CoronaAustralis = system.initStar("neut_star_neutron", // id in planets.json
200f, // radius (in pixels at default zoom)
2500, 3000); // location in hyperspace
system.setLightColor(new Color(255, 255, 255)); // light color in entire system, affects all entities
/*
* addPlanet() parameters:
* 1. What the planet orbits (orbit is always circular)
* 2. Name
* 3. Planet type id in planets.json
* 4. Starting angle in orbit, i.e. 0 = to the right of the star
* 5. Planet radius, pixels at default zoom
* 6. Orbit radius, pixels at default zoom
* 7. Days it takes to complete an orbit. 1 day = 10 seconds.
*/
PlanetAPI p1 = system.addPlanet(CoronaAustralis, "Deadworld IS7", "neut_rocky_unstable", 0, 150, 2500, 100);
//PlanetAPI a2 = system.addPlanet(star, "Salus", "gas_giant", 230, 350, 7000, 250);
//PlanetAPI a21 = system.addPlanet(a2, "Cruor", "rocky_unstable", 45, 80, 800, 25);
//PlanetAPI a22 = system.addPlanet(a2, "Volturn", "water", 110, 120, 1400, 45);
//PlanetAPI a3 = system.addPlanet(star, "Umbra", "rocky_ice", 280, 150, 12000, 650);
p1.setCustomDescriptionId("neut_planet_IS7");
//a2.setCustomDescriptionId("planet_salus");
//a21.setCustomDescriptionId("planet_cruor");
//a22.setCustomDescriptionId("planet_volturn");
//a3.setCustomDescriptionId("planet_umbra");
p1.getSpec().setPlanetColor(new Color(255,215,190,255));
p1.getSpec().setAtmosphereColor(new Color(160,110,45,140));
p1.getSpec().setCloudColor(new Color(255,164,96,200));
p1.getSpec().setTilt(10);
p1.applySpecChanges();
/*
* addAsteroidBelt() parameters:
* 1. What the belt orbits
* 2. Number of asteroids
* 3. Orbit radius
* 4. Belt width
* 6/7. Range of days to complete one orbit. Value picked randomly for each asteroid.
*/
system.addAsteroidBelt(p1, 50, 1100, 128, 40, 80);
/*
* addRingBand() parameters:
* 1. What it orbits
* 2. Category under "graphics" in settings.json
* 3. Key in category
* 4. Width of band within the texture
* 5. Index of band
* 6. Color to apply to band
* 7. Width of band (in the game)
* 8. Orbit radius (of the middle of the band)
* 9. Orbital period, in days
*/
system.addRingBand(CoronaAustralis, "misc", "rings1", 256f, 2, Color.white, 256f, 1400, 40f);
system.addRingBand(CoronaAustralis, "misc", "rings1", 256f, 2, Color.white, 256f, 1450, 60f);
system.addRingBand(CoronaAustralis, "misc", "rings1", 256f, 2, Color.white, 256f, 1500, 80f);
system.addRingBand(CoronaAustralis, "misc", "rings1", 256f, 3, Color.white, 256f, 1750, 70f);
system.addRingBand(CoronaAustralis, "misc", "rings1", 256f, 3, Color.white, 256f, 1800, 90f);
system.addRingBand(CoronaAustralis, "misc", "rings1", 256f, 3, Color.white, 256f, 1850, 110f);
system.addRingBand(CoronaAustralis, "misc", "rings1", 256f, 0, Color.white, 256f, 2100, 50f);
system.addRingBand(CoronaAustralis, "misc", "rings1", 256f, 0, Color.white, 256f, 2150, 70f);
system.addRingBand(CoronaAustralis, "misc", "rings1", 256f, 0, Color.white, 256f, 2200, 80f);
system.addRingBand(CoronaAustralis, "misc", "rings1", 256f, 1, Color.white, 256f, 2250, 90f);
system.addRingBand(p1, "misc", "rings1", 256f, 2, Color.white, 256f, 1400, 40f);
system.addRingBand(p1, "misc", "rings1", 256f, 2, Color.white, 256f, 1450, 60f);
system.addRingBand(p1, "misc", "rings1", 256f, 2, Color.white, 256f, 1500, 80f);
system.addRingBand(p1, "misc", "rings1", 256f, 3, Color.white, 256f, 1750, 70f);
system.addRingBand(p1, "misc", "rings1", 256f, 3, Color.white, 256f, 1800, 90f);
system.addRingBand(p1, "misc", "rings1", 256f, 3, Color.white, 256f, 1850, 110f);
JumpPointAPI jumpPoint = Global.getFactory().createJumpPoint("Jump Point Alpha");
OrbitAPI orbit = Global.getFactory().createCircularOrbit(p1, 0, 400, 40);
jumpPoint.setOrbit(orbit);
jumpPoint.setRelatedPlanet(p1);
jumpPoint.setStandardWormholeToHyperspaceVisual();
system.addEntity(jumpPoint);
/*
* addPlanet() parameters:
* 1. What the planet orbits (orbit is always circular)
* 2. Name
* 3. Planet type id in planets.json
* 4. Starting angle in orbit, i.e. 0 = to the right of the star
* 5. Planet radius, pixels at default zoom
* 6. Orbit radius, pixels at default zoom
* 7. Days it takes to complete an orbit. 1 day = 10 seconds.
*/
SectorEntityToken NCstation1 = system.addOrbitalStation(CoronaAustralis, 200, 700, 90, "Small Extraction Drill", "neutrinocorp");
SectorEntityToken NCstation2 = system.addOrbitalStation(CoronaAustralis, 200, 1600, 90, "Large Processing Dock", "neutrinocorp");
SectorEntityToken NCstation3 = system.addOrbitalStation(p1, 45, 300, 50, "Small Research Station", "neutrinocorp");
initStationCargo(NCstation1);
initStationCargo(NCstation2);
initStationCargo(NCstation3);
// example of using custom visuals below
// a1.setCustomInteractionDialogImageVisual(new InteractionDialogImageVisual("illustrations", "hull_breach", 800, 800));
// jumpPoint.setCustomInteractionDialogImageVisual(new InteractionDialogImageVisual("illustrations", "space_wreckage", 1200, 1200));
// station.setCustomInteractionDialogImageVisual(new InteractionDialogImageVisual("illustrations", "cargo_loading", 1200, 1200));
// generates hyperspace destinations for in-system jump points
system.autogenerateHyperspaceJumpPoints(true, true);
system.addSpawnPoint(new neutrinoConvoySpawnPoint(sector,