Fractal Softworks Forum

Please login or register.

Login with username, password and session length
Pages: 1 ... 558 559 [560] 561 562 ... 710

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

SafariJohn

  • Admiral
  • *****
  • Posts: 3023
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #8385 on: January 14, 2022, 07:25:55 PM »

You need to do that in java code. Something like this in your ModPlugin class.

Code: java
    public static final String MARKET_ENTITY_1 = "YOUR_PLANET_OR_STATION_ID_HERE";
    @Override
    public void onNewGameAfterEconomyLoad() {
        for (MarketAPI market : Global.getSector().getEconomy().getMarketsCopy()) {
            if (market.getPrimaryEntity().getId().equals(MARKET_ENTITY_1)) {
                market.setImmigrationIncentivesOn(true);
                break;
            }
        }
    }
Logged

Snrasha

  • Admiral
  • *****
  • Posts: 705
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #8386 on: January 14, 2022, 11:41:07 PM »

Quote
613518 [Thread-4] ERROR com.fs.starfarer.combat.CombatMain  - java.lang.RuntimeException: Can't create nested lists using GLListManager
java.lang.RuntimeException: Can't create nested lists using GLListManager

Hey, sometimes people get this error. But often, we never know why and where. Will be possible to add a another log on the CombatMain or say how resolve it on a thread ? Thank you very much :)
Logged
I am pretty bad on english. So, sorry in advance.

Gladiator Society
Add battle options on Com Relay/ Framework for modders for add their own bounty.

Sanguinary Autonomist Defectors A fan-mod of Shadowyard.

Alex

  • Administrator
  • Admiral
  • *****
  • Posts: 24128
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #8387 on: January 15, 2022, 10:14:28 AM »

Quote
613518 [Thread-4] ERROR com.fs.starfarer.combat.CombatMain  - java.lang.RuntimeException: Can't create nested lists using GLListManager
java.lang.RuntimeException: Can't create nested lists using GLListManager

Hey, sometimes people get this error. But often, we never know why and where. Will be possible to add a another log on the CombatMain or say how resolve it on a thread ? Thank you very much :)

Definitely need to see more of the stack trace for this; this doesn't tell me very much beyond the issue being related to how GL lists are being used. It would also help to know what the person was doing when this crash occurred.
Logged

Morrokain

  • Admiral
  • *****
  • Posts: 2143
  • Megalith Dreadnought - Archean Order
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #8388 on: January 15, 2022, 12:10:15 PM »

I don't know what you mean by "sprite path attached". And the answer to your question is going to most likely depend on exactly how you're spawning the derelicts, so I'd suggest looking at that? Or providing some detail about it. As is, I really can't say.

I mean in the .ship json I have:

  "spriteName": "",

They are spawned using an implementation of the vanilla drone system. The reason I thought it had to either be because the modules themselves are hidden or because of the sprite name is because the mothership also uses the same system on different modules that aren't hidden and it works under enemy AI control in the simulator. That said, I tried changing those two things and it didn't make a difference so it has to be something else.

Example System Implementation:

Spoiler
{
   "id":"archean_drone_mothership_defender_PD",
   "type":"DRONE_LAUNCHER",
   "aiType":"DRONE_LAUNCHER_PD",
   
   "droneVariant":"defender_PD",
   
   
   "allowFreeRoam":true,
   
   "launchSpeed":100,
   "launchDelay":8,
   "maxDrones":3,
   "droneBehavior":[
      {"droneIndex":[0],
       "defaultFacing":"MATCH_DRONE_HEADING",   # MATCH_DRONE_HEADING, MATCH_SHIP_HEADING, MATCH_SHIP_FACING, AWAY_FROM_SHIP
       "faceEnemy":true,
       "holdRoamRange":1200,
       "freeRoamRange":2500,
       "targetPriority":[SHIP, FIGHTER, MISSILE], # also SHIP_TARGET to prefer targeting the mothership's target
       "initialOrbitAngle":90,
       "orbitRadius":500,             # plus ship radius
       "orbitDir":1,                # -1 or 1
       "orbitSpeed":0,             # pixels/second
      },
      {"droneIndex":[1],
       "defaultFacing":"MATCH_DRONE_HEADING",   # MATCH_DRONE_HEADING, MATCH_SHIP_HEADING, MATCH_SHIP_FACING, AWAY_FROM_SHIP
       "faceEnemy":true,
       "holdRoamRange":1200,
       "freeRoamRange":2500,
       "targetPriority":[SHIP, FIGHTER, MISSILE], # also SHIP_TARGET to prefer targeting the mothership's target
       "initialOrbitAngle":-90,
       "orbitRadius":500,             # plus ship radius
       "orbitDir":1,                # -1 or 1
       "orbitSpeed":0,             # pixels/second
      },
      {"droneIndex":[2],
       "defaultFacing":"MATCH_DRONE_HEADING",   # MATCH_DRONE_HEADING, MATCH_SHIP_HEADING, MATCH_SHIP_FACING, AWAY_FROM_SHIP
       "faceEnemy":true,
       "holdRoamRange":1200,
       "freeRoamRange":2500,
       "targetPriority":[SHIP, FIGHTER, MISSILE], # also SHIP_TARGET to prefer targeting the mothership's target
       "initialOrbitAngle":180,
       "orbitRadius":650,             # plus ship radius
       "orbitDir":1,                # -1 or 1
       "orbitSpeed":0,             # pixels/second
      },
   ],
   
   "useSound":"drone_launch",
   "outOfUsesSound":"gun_out_of_ammo",
   
   "aiHints":{
   }
}
[close]

Module Example:

Spoiler
{
  "bounds": [
    1,
    1,
    -1,
    1,
    -1,
    -1,
    1,
    -1
  ],
  "builtInMods": [
    "reduced_explosion",
    "never_detaches"
  ],
  "builtInWings": [],
  "center": [
    0,
    0
  ],
  "collisionRadius": 27.5,
  "engineSlots": [],
  "height": 0,
  "hullId": "archean_module_guardian_dronebay_sentry_left",
  "hullName": "Module",
  "hullSize": "FRIGATE",
  "shieldCenter": [
    0,
    0
  ],
  "shieldRadius": 26.5,
  "spriteName": "",
  "style": "LOW_TECH",
  "viewOffset": 0,
  "weaponSlots": [
    {
      "angle": 90,
      "arc": 0,
      "id": "WS0001",
      "locations": [
        0,
        -0
      ],
      "mount": "HIDDEN",
      "size": "SMALL",
      "type": "SYSTEM"
    }
  ],
  "width": 0
}
[close]
Logged

Okim

  • Admiral
  • *****
  • Posts: 2161
    • View Profile
    • Okim`s Modelling stuff
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #8389 on: January 15, 2022, 02:39:25 PM »

Any idea why this is happening on generating starting ships?

Spoiler
14554 [Thread-3] WARN  com.fs.starfarer.campaign.rules.oOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO OOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO OOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO OOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO  - Problem with command of class com.fs.starfarer.api.impl.campaign.rulecmd.NGCAddShip: null
java.lang.NullPointerException
   at com.fs.starfarer.api.impl.campaign.rulecmd.AddRemoveCommodity.addFleetMemberGai nText(AddRemoveCommodity.java:238)
   at com.fs.starfarer.api.impl.campaign.rulecmd.NGCAddShip.execute(NGCAddShip.java:39)
   at com.fs.starfarer.campaign.rules.oOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO OOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO OOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO OOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO.execute(Unknown Source)
   at com.fs.starfarer.campaign.rules.Object.runScript(Unknown Source)
   at com.fs.starfarer.api.impl.campaign.rulecmd.FireBest.applyRule(FireBest.java:106)
   at com.fs.starfarer.api.impl.campaign.rulecmd.FireBest.execute(FireBest.java:51)
   at com.fs.starfarer.api.impl.campaign.rulecmd.FireBest.fire(FireBest.java:57)
   at com.fs.starfarer.api.impl.campaign.NewGameDialogPluginImpl.fireBest(NewGameDialogPluginImpl.java:154)
   at com.fs.starfarer.api.impl.campaign.NewGameDialogPluginImpl.optionSelected(NewGameDialogPluginImpl.java:115)
[close]

NCG options look like this:
NGCAddShip omsk-cv-indie_variant
NGCAddShip rostov-indie_variant
NGCAddShip rostov-e-indie_variant


These are copy/pasted IDs for variants. All of them, however, are based on skins.

Skins and variants work in game, including campaign. Just not being generated as starting options.

Morrokain

  • Admiral
  • *****
  • Posts: 2143
  • Megalith Dreadnought - Archean Order
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #8390 on: January 15, 2022, 03:18:38 PM »

Any idea why this is happening on generating starting ships?

Either the variant is coming up as null or the variant isn't returning a hullspec.

Since the second seems unlikely, I think it might be from:

Code
		ShipVariantAPI variant = Global.getSettings().getVariant(vid);

 - returning null. This could possibly be because the variant hasn't been added to default_ship_roles.json but there isn't a way for me to know for sure. The interface method doesn't explain where it is getting the variant info from.

As for the hullspec returning null, I'd think that would almost be impossible if the variant works correctly in the other scenarios.
Logged

Alex

  • Administrator
  • Admiral
  • *****
  • Posts: 24128
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #8391 on: January 15, 2022, 03:20:52 PM »

They are spawned using an implementation of the vanilla drone system. The reason I thought it had to either be because the modules themselves are hidden or because of the sprite name is because the mothership also uses the same system on different modules that aren't hidden and it works under enemy AI control in the simulator. That said, I tried changing those two things and it didn't make a difference so it has to be something else.

Does the module have the proper owner/originalOwner set when you spawn it in?

If that isn't the problem: vanilla drone systems work, right, so I'd suggest starting with something that works and making changes incrementally until you find out what the problem is. It's a tried-and-true debugging technique!

Any idea why this is happening on generating starting ships?

NCG options look like this:
NGCAddShip omsk-cv-indie_variant
NGCAddShip rostov-indie_variant
NGCAddShip rostov-e-indie_variant


These are copy/pasted IDs for variants. All of them, however, are based on skins.

Skins and variants work in game, including campaign. Just not being generated as starting options.

I don't think it'd matter here whether it's based on a skin or not; under the hood those become separate hulls. The crash is because it can't find those variants.

It's possible that it doesn't like "-" in the variant names, so that might be the first thing to try. Also make sure the variant ids are spelled right; they're case sensitive.
Logged

Okim

  • Admiral
  • *****
  • Posts: 2161
    • View Profile
    • Okim`s Modelling stuff
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #8392 on: January 15, 2022, 03:28:00 PM »

Figured the issue. Had to write it ""variant id"" not just plaing variant id.

NGCAddShip ""omsk-cv-indie_variant"" instead of NGCAddShip omsk-cv-indie_variant.

Morrokain

  • Admiral
  • *****
  • Posts: 2143
  • Megalith Dreadnought - Archean Order
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #8393 on: January 15, 2022, 10:10:03 PM »

Does the module have the proper owner/originalOwner set when you spawn it in?
Afaik it should. I don't do anything fancy at least. Assuming that the simulator assigns child modules' owner the same way it would the original parent ship, then definitely yes.

Quote
If that isn't the problem: vanilla drone systems work, right, so I'd suggest starting with something that works and making changes incrementally until you find out what the problem is. It's a tried-and-true debugging technique!
Well, the reason I asked was because I'm not 100% sure of that. The vanilla drone systems work under vanilla conditions absolutely, but the hidden nature of the modules on a ship that is also spawned under special circumstances - especially considering module code came way later than drone system code? Not so much there right? I have far less in the way of a test control under those circumstances. The issue of the basics working was never in question. This very much seems like a special case unless I'm missing something obvious (and I very well could be!) considering the following:

For instance, the mothership rotates like a station when tested in the simulator on the enemy or ally side. That was kind of my test bed of "ok this works" for the autofactory systems in the first place and they still work with similar implementations other than the hidden modules. The mothership doesn't rotate like a station in the actual campaign encounter, however, so I'm assuming something happens under the hood to change that behavior. I wasn't sure if that would be a factor for the guardian too. That said, I've reproduced the problem in both places (simulator and actual encounter for the guardian) and so I thought it had to be something related to the module itself related specifically to the non-flagship spawn logic (since as a flagship it works and as an ally or enemy spawned ship it doesn't as far as simulation tests go). I know the system works. I know all the things outside the modules themselves work - ship/variant/etc - and I know it works when under player control and autopiloted but for some reason it doesn't work when spawned as an ally or enemy in the simulator and it doesn't work in the actual campaign encounter.

I've at least started the process of narrowing it down but my point here is that it for the moment isn't making much sense from the perspective of the code I have available. Or, at least, I haven't found the difference yet other than what I've already mentioned.

I'll keep looking but for now this is really stumping me.
« Last Edit: January 15, 2022, 10:12:31 PM by Morrokain »
Logged

Snrasha

  • Admiral
  • *****
  • Posts: 705
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #8394 on: January 15, 2022, 11:18:56 PM »

Quote
613518 [Thread-4] ERROR com.fs.starfarer.combat.CombatMain  - java.lang.RuntimeException: Can't create nested lists using GLListManager
java.lang.RuntimeException: Can't create nested lists using GLListManager

Hey, sometimes people get this error. But often, we never know why and where. Will be possible to add a another log on the CombatMain or say how resolve it on a thread ? Thank you very much :)

Definitely need to see more of the stack trace for this; this doesn't tell me very much beyond the issue being related to how GL lists are being used. It would also help to know what the person was doing when this crash occurred.

From the user:
Quote
I went to mission, there was a mission where I could select basicaly any ship (benchmark, one before the last). I chose the Lodium, put the hardened shield mod, went to a simulation, all went fine.
When I exited the simulation and pressed esc, the game crashed again:
Logged
I am pretty bad on english. So, sorry in advance.

Gladiator Society
Add battle options on Com Relay/ Framework for modders for add their own bounty.

Sanguinary Autonomist Defectors A fan-mod of Shadowyard.

Okim

  • Admiral
  • *****
  • Posts: 2161
    • View Profile
    • Okim`s Modelling stuff
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #8395 on: January 16, 2022, 04:56:50 AM »

Is there any way to make fighter blueprints look much bigger on that blueprint chip?
My fighters are too small when automatically placed on these.

[attachment deleted by admin]

Alex

  • Administrator
  • Admiral
  • *****
  • Posts: 24128
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #8396 on: January 18, 2022, 09:24:24 AM »

Well, the reason I asked was because I'm not 100% sure of that. The vanilla drone systems work under vanilla conditions absolutely, but the hidden nature of the modules on a ship that is also spawned under special circumstances - especially considering module code came way later than drone system code? Not so much there right? I have far less in the way of a test control under those circumstances. The issue of the basics working was never in question. This very much seems like a special case unless I'm missing something obvious (and I very well could be!) considering the following:

For instance, the mothership rotates like a station when tested in the simulator on the enemy or ally side. That was kind of my test bed of "ok this works" for the autofactory systems in the first place and they still work with similar implementations other than the hidden modules. The mothership doesn't rotate like a station in the actual campaign encounter, however, so I'm assuming something happens under the hood to change that behavior. I wasn't sure if that would be a factor for the guardian too. That said, I've reproduced the problem in both places (simulator and actual encounter for the guardian) and so I thought it had to be something related to the module itself related specifically to the non-flagship spawn logic (since as a flagship it works and as an ally or enemy spawned ship it doesn't as far as simulation tests go). I know the system works. I know all the things outside the modules themselves work - ship/variant/etc - and I know it works when under player control and autopiloted but for some reason it doesn't work when spawned as an ally or enemy in the simulator and it doesn't work in the actual campaign encounter.

I've at least started the process of narrowing it down but my point here is that it for the moment isn't making much sense from the perspective of the code I have available. Or, at least, I haven't found the difference yet other than what I've already mentioned.

I'll keep looking but for now this is really stumping me.

The things you've listed seem like good things to go through one by one and eliminate as suspects. For example, you might try a not-hidden module, etc etc. The important thing is to be methodical so you can be sure about what changed and what didn't.


From the user:
Quote
I went to mission, there was a mission where I could select basicaly any ship (benchmark, one before the last). I chose the Lodium, put the hardened shield mod, went to a simulation, all went fine.
When I exited the simulation and pressed esc, the game crashed again:

Thank you for that added info. Still really need the full stack trace, though, to have any idea of what this might have been.



Is there any way to make fighter blueprints look much bigger on that blueprint chip?
My fighters are too small when automatically placed on these.

Are your fighter sprites significantly bigger than the actual fighters, with blank space around them in the sprites? If so, that might be causing the problem.

Logged

Pogre

  • Lieutenant
  • **
  • Posts: 69
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #8397 on: January 18, 2022, 01:04:44 PM »

Hey all, COMPLETELY new to modding here. I've kitbashed together a ship and have it all up and running with the ship and weapon editor, but I cant seem to spawn it in game? No errors or crashes, and I have a unique ship ID for it, not sure where the problem lies. Any help would be appreciated, and I can upload files if need be!
Logged

Alex

  • Administrator
  • Admiral
  • *****
  • Posts: 24128
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #8398 on: January 18, 2022, 01:16:26 PM »

Do you have a .variant file for the ship?

How are you trying to spawn it in-game?
Logged

Pogre

  • Lieutenant
  • **
  • Posts: 69
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #8399 on: January 18, 2022, 01:24:36 PM »

I do not have a .variant file, I was following the intro to modding on the wiki and I don't think it mentions needing one at the step I'm at. I'm trying to spawn it through the console commands mod with the addship command.
Logged
Pages: 1 ... 558 559 [560] 561 562 ... 710