Fractal Softworks Forum

Please login or register.

Login with username, password and session length
Advanced search  

News:

Starsector 0.95.1a is out! (12/10/21); Blog post: Hyperspace Topography (10/12/22)

Pages: 1 ... 527 528 [529] 530 531 ... 627

Author Topic: Misc modding questions that are too minor to warrant their own thread  (Read 1402215 times)

MeinGott

  • Ensign
  • *
  • Posts: 34
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #7920 on: August 31, 2021, 08:31:23 AM »

Hello,
I tried to make Heavy Weapons Integration, so in 1st step I took Heavy Ballistics Integration from source archive, changed the name wherever it was due, added .cvs entry accordingly and changed package name in code's first line to data.hullmods. Didnt change what it does yet, just wanted to see if the game would start.
Then I took
Spoiler
22456 [Thread-3] ERROR com.fs.starfarer.combat.CombatMain  - java.lang.RuntimeException: Error loading [data.hullmods.mm_hwi]
java.lang.RuntimeException: Error loading [data.hullmods.mm_hwi]
   at com.fs.starfarer.loading.scripts.ScriptStore$3.run(Unknown Source)
   at java.lang.Thread.run(Unknown Source)
Caused by: java.lang.ClassFormatError: Inconsistent constant value type in class file data/hullmods/mm_hwi
   at java.lang.ClassLoader.defineClass1(Native Method)
   at java.lang.ClassLoader.defineClass(Unknown Source)
   at org.codehaus.janino.JavaSourceClassLoader.defineBytecode(JavaSourceClassLoader.java:244)
   at org.codehaus.janino.JavaSourceClassLoader.findClass(JavaSourceClassLoader.java:194)
   at java.lang.ClassLoader.loadClass(Unknown Source)
   at java.lang.ClassLoader.loadClass(Unknown Source)
   ... 2 more
[close]
to the knee.
It obviously tells me nothing as I am uneducated schmuck. Is the solution compiling it manually or something completly else?

Thank you from the mountain, as we say in my country.
« Last Edit: August 31, 2021, 08:35:33 AM by MeinGott »
Logged

Yunru

  • Admiral
  • *****
  • Posts: 1559
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #7921 on: August 31, 2021, 09:00:05 AM »

Hello,
I tried to make Heavy Weapons Integration, so in 1st step I took Heavy Ballistics Integration from source archive, changed the name wherever it was due, added .cvs entry accordingly and changed package name in code's first line to data.hullmods. Didnt change what it does yet, just wanted to see if the game would start.
Then I took
Spoiler
22456 [Thread-3] ERROR com.fs.starfarer.combat.CombatMain  - java.lang.RuntimeException: Error loading [data.hullmods.mm_hwi]
java.lang.RuntimeException: Error loading [data.hullmods.mm_hwi]
   at com.fs.starfarer.loading.scripts.ScriptStore$3.run(Unknown Source)
   at java.lang.Thread.run(Unknown Source)
Caused by: java.lang.ClassFormatError: Inconsistent constant value type in class file data/hullmods/mm_hwi
   at java.lang.ClassLoader.defineClass1(Native Method)
   at java.lang.ClassLoader.defineClass(Unknown Source)
   at org.codehaus.janino.JavaSourceClassLoader.defineBytecode(JavaSourceClassLoader.java:244)
   at org.codehaus.janino.JavaSourceClassLoader.findClass(JavaSourceClassLoader.java:194)
   at java.lang.ClassLoader.loadClass(Unknown Source)
   at java.lang.ClassLoader.loadClass(Unknown Source)
   ... 2 more
[close]
to the knee.
It obviously tells me nothing as I am uneducated schmuck. Is the solution compiling it manually or something completly else?

Thank you from the mountain, as we say in my country.
I presume this is a loose file, rather than compiled?
The compiler packaged with the game really doesn't like generic object types.

If you just handle things on an individual basis, it's more work but the compiler doesn't argue. For example, here's my Missile-based variant:
Code
	public void applyEffectsBeforeShipCreation(HullSize hullSize, MutableShipStatsAPI stats, String id) {
stats.getDynamic().getMod(Stats.LARGE_MISSILE_MOD).modifyFlat(id, -10);
}

public String getDescriptionParam(int index, HullSize hullSize) {
if (index == 0) return "10";
return null;
}

@Override
public boolean affectsOPCosts() {
return true;
}

shoi

  • Admiral
  • *****
  • Posts: 544
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #7922 on: August 31, 2021, 09:02:22 AM »

I'm having a bit of trouble with a deco weapon- I've set it to display hull damage decals, but it's not. It's in a deco slot too, in case that's an issue. The deco weapon goes over the large slot, and under everything else, which I've set using renderOrderMod in the .ship file.

.wpn file:
Spoiler
{
   "id":"apex_deco_caiman_center",
   "specClass":"beam",
   "type":"DECORATIVE",
   "size":"LARGE",
   "showDamageWhenDecorative":true,
   "renderBelowAllWeapons":false,
   "turretSprite":"graphics/ships/decos/apex_caiman_center.png",
   "hardpointSprite":"graphics/ships/decos/apex_caiman_center.png",
   "turretOffsets":[0, 0],
   "turretAngleOffsets":[0],
   "hardpointOffsets":[0, 0],
   "hardpointAngleOffsets":[0],   
   "fringeColor":[255,255,255,255],
   "coreColor":[255,255,255,255],
   "glowColor":[255,255,255,255],
   "width":1.0,
   "textureType":ROUGH,
   "textureScrollSpeed":1.0,
   "pixelsPerTexel":1.0,
}
[close]


Also, is there a way to figure out if a ship is trying to turn to present less-damaged armor? Like the bit where a ship has stripped armor and will try to turn away from that point if its shields are down.

may not be your paricular issue, but iirc what determines if the decal gets the damage overlay is if the cell of the ship its on takes damage. So if the decal isn't on those exact coordinates where damage is taken, it won't be reflected
Logged

Alex

  • Administrator
  • Admiral
  • *****
  • Posts: 21014
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #7923 on: August 31, 2021, 09:04:27 AM »

Hello,
I tried to make Heavy Weapons Integration, so in 1st step I took Heavy Ballistics Integration from source archive, changed the name wherever it was due, added .cvs entry accordingly and changed package name in code's first line to data.hullmods. Didnt change what it does yet, just wanted to see if the game would start.
Then I took
Spoiler
22456 [Thread-3] ERROR com.fs.starfarer.combat.CombatMain  - java.lang.RuntimeException: Error loading [data.hullmods.mm_hwi]
java.lang.RuntimeException: Error loading [data.hullmods.mm_hwi]
   at com.fs.starfarer.loading.scripts.ScriptStore$3.run(Unknown Source)
   at java.lang.Thread.run(Unknown Source)
Caused by: java.lang.ClassFormatError: Inconsistent constant value type in class file data/hullmods/mm_hwi
   at java.lang.ClassLoader.defineClass1(Native Method)
   at java.lang.ClassLoader.defineClass(Unknown Source)
   at org.codehaus.janino.JavaSourceClassLoader.defineBytecode(JavaSourceClassLoader.java:244)
   at org.codehaus.janino.JavaSourceClassLoader.findClass(JavaSourceClassLoader.java:194)
   at java.lang.ClassLoader.loadClass(Unknown Source)
   at java.lang.ClassLoader.loadClass(Unknown Source)
   ... 2 more
[close]
to the knee.
It obviously tells me nothing as I am uneducated schmuck. Is the solution compiling it manually or something completly else?

Thank you from the mountain, as we say in my country.
I presume this is a loose file, rather than compiled?
The compiler packaged with the game really doesn't like generic object types.

This is very true, yeah. In addition:

public static final float COST_REDUCTION  = 10;

I think it doesn't like a float being assigned an int value. Changing the "10" to a "10f" might also get around that issue.

may not be your paricular issue, but iirc what determines if the decal gets the damage overlay is if the cell of the ship its on takes damage. So if the decal isn't on those exact coordinates where damage is taken, it won't be reflected

(Ahh, good catch!)
Logged

Omnicast

  • Ensign
  • *
  • Posts: 20
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #7924 on: August 31, 2021, 10:47:38 PM »

Just throwing ideas out there. Is it possible for Alex to get fighter/bomber/drone LPCs to spawn multiple wings from one hanger slot? Would it be possible to make it adjustable in game? So each LPC has a min/max and the player can choose a number from min to max using +/- buttons next to the hanger slot. The higher the number the more penalties to rearming/crew required/supplies needed/etc, but you can burst the enemy down with more small crafts.

So if I modified the Talon Interceptor Wing LPC it would spawn 5 wings of 4 fighters each for a grand total of 20 fighters using one hanger slot. Of course it's gonna cost 5x more crew, supplies, and CR to recover fully.

Anyways the point is I want my computer to overload with fighters/bombers/drones swarming everywhere.

Second idea... is it possible for some badass animator to make fighters do flips and ***? Like barrel rolls? Maybe it actually has a function like giving a dodge bonus or temp invulnerability while looking cool.

Idea three. Pilot promotions. After a few space battles there's a chance that some Talon pilot actually survives enough times to be qualified as a experienced pilot. This could tie in with my first idea and a more experienced pilot could act like a squad leader allowing more wings to watch his/her flank. They can level up like officers and pick Pilot skills. Some of which could have cool animations like my second idea.

Stealing ideas from 1C's Star Wolves series they could get active special abilities that they will automatically use when the right situation calls for it. Missiles heading their way? If the pilot has the flares ability then the small craft/assisting wings will fire off personally mounted flares.

Or the pilot has an alpha strike ability that increases fire rate for all weapons on the craft being piloted by 20-40% for 4 seconds with a CD of 30 seconds.

Stealing from Star Fox we could have a tiny window open up where the pilot's sprite is shown and a small dialogue oozing overconfidence! Said overconfident Talon pilot dies right away.  ;D

Feeling ambitious? Animate the pilots portrait!

This will make me take recovery shuttles. Otherwise that mod is god damn useless.  ;)
« Last Edit: August 31, 2021, 10:50:03 PM by Omnicast »
Logged

shoi

  • Admiral
  • *****
  • Posts: 544
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #7925 on: September 02, 2021, 04:46:45 PM »

For
Global.getSector().getPlayerPerson().getStats().setSkillLevel();
Presuming the Sector,PersonAPI and their stats are not null, what would cause this loc to cause a NPE?
I've been stumped on this one for a bit. I have a skill added to a mod that runs this line in the ModPlugins onGameLoad. It works for me, but it always results in NPE for the person testing when they trying loading up a game.

The only way I can reproduce this is by completely deleting the skills folder and trying to load, but even when I provided them with my data folder, it still crashes. Is there anyway another skill could be somehow overwriting the  one i've added, or something like that?
« Last Edit: September 02, 2021, 04:49:08 PM by shoi »
Logged

Alex

  • Administrator
  • Admiral
  • *****
  • Posts: 21014
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #7926 on: September 02, 2021, 04:48:42 PM »

Just real quick - need to see a stack trace for this sort of thing.

(But, yeah, my initial guess would be a skill id getting passed in that doesn't match any actual skill...)
Logged

shoi

  • Admiral
  • *****
  • Posts: 544
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #7927 on: September 02, 2021, 04:50:26 PM »

whoops, here it is.

118067 [Thread-3] ERROR com.fs.starfarer.combat.CombatMain  - java.lang.NullPointerException
java.lang.NullPointerException
    at com.fs.starfarer.campaign.CharacterStats.refreshCharacterStatsEffects(Unknown Source)
    at com.fs.starfarer.campaign.CharacterStats.setSkillLevel(Unknown Source)
    at data.scripts.MechaModPlugin.onGameLoad(MechaModPlugin.java:127)
    at com.fs.starfarer.campaign.save.CampaignGameManager.o00000(Unknown Source)
    at com.fs.starfarer.title.TitleScreenState.dialogDismissed(Unknown Source)
    at com.fs.starfarer.ui.Oo0O.dismiss(Unknown Source)
    at com.fs.starfarer.ui.impl.o0oO.dismiss(Unknown Source)
    at com.fs.starfarer.campaign.save.J.actionPerformed(Unknown Source)
    at com.fs.starfarer.ui.newnew.buttonPressed(Unknown Source)
    at com.fs.starfarer.ui.I.?00000(Unknown Source)
    at com.fs.starfarer.ui.I.processInput(Unknown Source)
    at com.fs.starfarer.ui.newnew.processInputImpl(Unknown Source)
    at com.fs.starfarer.ui.o00O.processInput(Unknown Source)
    at com.fs.starfarer.ui.v.dispatchEventsToChildren(Unknown Source)
    at com.fs.starfarer.ui.v.processInputImpl(Unknown Source)
    at com.fs.starfarer.coreui.oo0o.processInputImpl(Unknown Source)
    at com.fs.starfarer.ui.o00O.processInput(Unknown Source)
    at com.fs.starfarer.ui.v.dispatchEventsToChildren(Unknown Source)
    at com.fs.starfarer.ui.v.processInputImpl(Unknown Source)
    at com.fs.starfarer.ui.o00O.processInput(Unknown Source)
    at com.fs.starfarer.E.I.processInputImpl(Unknown Source)
    at com.fs.starfarer.ui.o00O.processInput(Unknown Source)
    at com.fs.starfarer.ui.v.dispatchEventsToChildren(Unknown Source)
    at com.fs.starfarer.ui.v.processInputImpl(Unknown Source)
    at com.fs.starfarer.ui.Oo0O.processInputImpl(Unknown Source)
    at com.fs.starfarer.campaign.save.J.processInputImpl(Unknown Source)
    at com.fs.starfarer.ui.o00O.processInput(Unknown Source)
    at com.fs.starfarer.ui.v.dispatchEventsToChildren(Unknown Source)
    at com.fs.starfarer.ui.v.processInputImpl(Unknown Source)
    at com.fs.starfarer.ui.o00O.processInput(Unknown Source)
    at com.fs.starfarer.title.TitleScreenState.processInput(Unknown Source)
    at com.fs.starfarer.BaseGameState.traverse(Unknown Source)
    at com.fs.state.AppDriver.begin(Unknown Source)
    at com.fs.starfarer.combat.CombatMain.main(Unknown Source)
    at com.fs.starfarer.StarfarerLauncher.o00000(Unknown Source)
    at com.fs.starfarer.StarfarerLauncher$1.run(Unknown Source)
    at java.lang.Thread.run(Thread.java:748)
Logged

Alex

  • Administrator
  • Admiral
  • *****
  • Posts: 21014
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #7928 on: September 02, 2021, 04:55:50 PM »

Thank you! Unfortunately that's a pretty long method so it doesn't narrow things down much.

There has to be some difference between your setup and the setup of the person helping you test (mods enabled, mod versions?, settings tweaks, etc). If it's a possibility, I'd suggest trying to eliminate those differences until you find what's causing the issue.
Logged

JAL28

  • Commander
  • ***
  • Posts: 196
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #7929 on: September 02, 2021, 07:18:25 PM »

How do I edit the effects of special items on industries? The special_items.csv only seems to list general things like graphics, price, description etc.
Logged

Timid

  • Admiral
  • *****
  • Posts: 567
  • Personal Text
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #7930 on: September 02, 2021, 07:38:31 PM »

Thank you! Unfortunately that's a pretty long method so it doesn't narrow things down much.

There has to be some difference between your setup and the setup of the person helping you test (mods enabled, mod versions?, settings tweaks, etc). If it's a possibility, I'd suggest trying to eliminate those differences until you find what's causing the issue.
We found the issue to be an outdated version of Quality Captains that abuses the "replace" in the mod_info.json.

shoi

  • Admiral
  • *****
  • Posts: 544
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #7931 on: September 05, 2021, 11:51:53 PM »

Is there a way to pass float values into RepActionEnvelope instead of RepActions(Or is there way to create a custom one?)
Logged

Alex

  • Administrator
  • Admiral
  • *****
  • Posts: 21014
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #7932 on: September 06, 2021, 10:13:29 AM »

Is there a way to pass float values into RepActionEnvelope instead of RepActions(Or is there way to create a custom one?)

There's a CustomRepImpact class you can pass in there; see: PunitiveExpeditionIntel.applyRepPenalty()

How do I edit the effects of special items on industries? The special_items.csv only seems to list general things like graphics, price, description etc.

Sorry I missed this!  See the ItemEffectsRepo class; you'll need to add your own effect to the static ITEM_EFFECTS map - you can do this from another class in your own code. Make sure not to have any data members in your InstallableItemEffect implementation since these persist across saves.
Logged

theDragn

  • Commander
  • ***
  • Posts: 245
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #7933 on: September 06, 2021, 05:54:39 PM »

may not be your paricular issue, but iirc what determines if the decal gets the damage overlay is if the cell of the ship its on takes damage. So if the decal isn't on those exact coordinates where damage is taken, it won't be reflected

this is hugely useful, thank you!

JAL28

  • Commander
  • ***
  • Posts: 196
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #7934 on: September 06, 2021, 07:34:50 PM »

How do I edit the effects of special items on industries? The special_items.csv only seems to list general things like graphics, price, description etc.

Sorry I missed this!  See the ItemEffectsRepo class; you'll need to add your own effect to the static ITEM_EFFECTS map - you can do this from another class in your own code. Make sure not to have any data members in your InstallableItemEffect implementation since these persist across saves.

Wait, but where do I find this? I don’t seem to be able to find it in special_items.csv and no other file seems to contain relevant data.
Logged
Pages: 1 ... 527 528 [529] 530 531 ... 627