Fractal Softworks Forum

Please login or register.

Login with username, password and session length
Advanced search  

News:

Starsector 0.97a is out! (02/02/24); New blog post: Anubis-class Cruiser (12/20/24)

Pages: 1 ... 437 438 [439] 440 441 ... 753

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

Alex

  • Administrator
  • Admiral
  • *****
  • Posts: 25044
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #6570 on: June 22, 2020, 12:06:00 PM »

A bit of guess, but I think "Hidden" prevents it from dropping or being sold in markets but it is still visible in the refit screen - like the XIV Battlegroup hullmod - while "HiddenEverywhere" makes the hullmod completely invisible yet still apply its effects.

Correct!

tags I think is just for autofit and probably the ones that are visible under starsector core are the only ones - but again a guess.

tags are used for drops and other such. uiTags is what shows up in the hull mod picker dialog in the refit screen; they can be arbitrary strings.
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 #6571 on: June 22, 2020, 12:22:27 PM »

First off; oof, how'd I miss that?
Second, the error still occurs, with the same report, sadly.

EDIT: I have to have a duplicate somewhere, because I changed the name and it's coming up with the exact same report, including filename.

Probably a silly question, but did you also change the corresponding column for the script in hullmods.csv alongside the class name when testing this? (That is assuming the compile issue stems from trying to run the game rather than trying to compile the jar itself using an IDE. I'm not completely sure of the context- but that CombatMain is running in the error it makes me think its attempting to run the game.)
Logged

Sinosauropteryx

  • Captain
  • ****
  • Posts: 262
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #6572 on: June 22, 2020, 06:00:36 PM »

Is there a way to set a ship's fighter replacement rate?

Built in hullmod:

Code
MutableShipStatsAPI.getFighterRefitTimeMult()
Sorry, I should have been clearer. This changes the rate of refit time recovering, but I'm looking for a way to directly change the % value. For example, if I wanted to make a weapon that would cost the ship 5% of its fighter % gauge when it fires.
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 #6573 on: June 22, 2020, 07:19:05 PM »

Sorry, I should have been clearer. This changes the rate of refit time recovering, but I'm looking for a way to directly change the % value. For example, if I wanted to make a weapon that would cost the ship 5% of its fighter % gauge when it fires.

Ah gotcha. I don't think you can, unfortunately. I could be wrong though.
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 #6574 on: June 24, 2020, 03:55:39 PM »

I want to be absolutely sure before I make these changes, so:

There is no current way to change DP (as in percent of possible ships deployed in the tactical pre-combat deployment screen) using skin files, correct?
Logged

Alex

  • Administrator
  • Admiral
  • *****
  • Posts: 25044
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #6575 on: June 24, 2020, 05:21:54 PM »

You could add a built-in hullmod, hidden or otherwise. But not as a direct base-level stat change, no.
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 #6576 on: June 24, 2020, 05:52:03 PM »

You could add a built-in hullmod, hidden or otherwise. But not as a direct base-level stat change, no.

Wait, do you mean MutableShipStatsAPI.getSuppliesToRecover()? That is what I am currently using in the built-in hullmod. I checked today and it only reduces or increases the supply *cost* - in supplies - per deployment. It does not modify the deployment cost in relation to max combat DP during an actual battle. (I just became aware of this today. I thought it did this in the past but I could have just been making an assumption.)

I did a quick sweep of the MutableShipStatsAPI methods and I don't see anything else that would qualify.
Logged

Alex

  • Administrator
  • Admiral
  • *****
  • Posts: 25044
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #6577 on: June 24, 2020, 05:55:57 PM »

Ahh, never mind, you're right - I forgot that the deployment points are the unmodified value of that stat.
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 #6578 on: June 24, 2020, 06:15:37 PM »

Ahh, never mind, you're right - I forgot that the deployment points are the unmodified value of that stat.

Ah well, I have a solution in any case. Thanks!
Logged

tomatopaste

  • Captain
  • ****
  • Posts: 315
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #6579 on: June 26, 2020, 03:36:29 AM »

I'm having a weird issue relating to .system loading. I'm not sure if it's a mistake I've made, which it could well be, but there isn't something that I'm obviously doing wrong. I have a shipsystem file with json contents below:
 .system file
Code
{ ### the drone AI written for the deuces doesn't use a lot of the values here, only those marked with ###, but the game will crash on launch if the unused values are missing
"id":"PSE_droneCorona",
"type":"STAT_MOD",
"statsScript":"data.scripts.shipsystems.PSE_DroneCorona",
"aiType":"CUSTOM",
"aiScript":"data.scripts.shipsystems.ai.PSE_DroneCoronaSystemAI",

"droneVariant":"PSE_drone1_Drone",

"allowFreeRoam":true,

"launchSpeed":150,
"launchDelay":0.5,
"maxDrones":3,
"droneBehavior":[
{"droneIndex":[0],
"defaultFacing":"MATCH_SHIP_FACING", # MATCH_DRONE_HEADING, MATCH_SHIP_HEADING, MATCH_SHIP_FACING, AWAY_FROM_SHIP
"faceEnemy":true,
"holdRoamRange":20, ###
"freeRoamRange":100,
"targetPriority":[MISSILE, FIGHTER, SHIP], # also SHIP_TARGET to prefer targeting the mothership's target
"initialOrbitAngle":0, ###
"focusModeOrbitAngle":0, ### CUSTOM
"orbitRadius":-35, ### # plus ship radius
"orbitDir":0, # -1 or 1
"orbitSpeed":0, # pixels/second
},
{"droneIndex":[1],
"defaultFacing":"MATCH_SHIP_FACING",
"faceEnemy":true,
"holdRoamRange":20, ###
"freeRoamRange":100,
"targetPriority":[MISSILE, FIGHTER, SHIP],
"initialOrbitAngle":50, ###
"focusModeOrbitAngle":5, ### CUSTOM
"orbitRadius":-35, ###
"orbitDir":0,
"orbitSpeed":0,
},
{"droneIndex":[2],
"defaultFacing":"MATCH_SHIP_FACING",
"faceEnemy":true,
"holdRoamRange":20,
"freeRoamRange":100,
"targetPriority":[MISSILE, FIGHTER, SHIP],
"initialOrbitAngle":-50, ###
"focusModeOrbitAngle":-5, ### CUSTOM
"orbitRadius":-35, ###
"orbitDir":0,
"orbitSpeed":0,
},
],

"useSound":"drone_launch",
"outOfUsesSound":"gun_out_of_ammo",
}
(notice how easy it is to put this in spoilers :P)
[close]
My mod has a json loading class (using SettingsAPI) that will read certain values that I have marked, when I hijacked the structure of the base DRONE_LAUNCHER shipsystem json config. The issue is that when I remove the unused values so that it has contents like so:
modified
Code
{
"id":"PSE_droneCorona",
"type":"STAT_MOD",
"statsScript":"data.scripts.shipsystems.PSE_DroneCorona",
"aiType":"CUSTOM",
"aiScript":"data.scripts.shipsystems.ai.PSE_DroneCoronaSystemAI",

"droneVariant":"PSE_drone1_Drone",

"launchSpeed":150,
"launchDelay":0.5,
"maxDrones":3,
"droneBehavior":[
{"droneIndex":[0],
"initialOrbitAngle":0,
"focusModeOrbitAngle":0,
"orbitRadius":-35, # plus ship radius
},
{"droneIndex":[1],
"initialOrbitAngle":50,
"focusModeOrbitAngle":5,
"orbitRadius":-35,
},
{"droneIndex":[2],
"initialOrbitAngle":-50,
"focusModeOrbitAngle":-5,
"orbitRadius":-35,
},
],

"useSound":"drone_launch",
"outOfUsesSound":"gun_out_of_ammo",
}
[close]
The game crashes before any modplugins are loaded, with the error "Fatal: JSONObject["targetPriority"] not found.", which indicates that it can't find the first sequential value relevant to the DRONE_LAUNCHER shipsystem type that I am not using. The thing that has me the most confused, is that this is actually of STAT_MOD type. Why is it complaining that it can't find a value that is used by DRONE_LAUNCHER?
Logged

shoi

  • Admiral
  • *****
  • Posts: 706
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #6580 on: June 26, 2020, 05:42:04 AM »

edit:nevermind
« Last Edit: June 26, 2020, 11:32:58 AM by shoi »
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 #6581 on: June 26, 2020, 01:08:41 PM »

I'm having a weird issue relating to .system loading. I'm not sure if it's a mistake I've made, which it could well be, but there isn't something that I'm obviously doing wrong. I have a shipsystem file with json contents below:
 .system file
Code
{ ### the drone AI written for the deuces doesn't use a lot of the values here, only those marked with ###, but the game will crash on launch if the unused values are missing
"id":"PSE_droneCorona",
"type":"STAT_MOD",
"statsScript":"data.scripts.shipsystems.PSE_DroneCorona",
"aiType":"CUSTOM",
"aiScript":"data.scripts.shipsystems.ai.PSE_DroneCoronaSystemAI",

"droneVariant":"PSE_drone1_Drone",

"allowFreeRoam":true,

"launchSpeed":150,
"launchDelay":0.5,
"maxDrones":3,
"droneBehavior":[
{"droneIndex":[0],
"defaultFacing":"MATCH_SHIP_FACING", # MATCH_DRONE_HEADING, MATCH_SHIP_HEADING, MATCH_SHIP_FACING, AWAY_FROM_SHIP
"faceEnemy":true,
"holdRoamRange":20, ###
"freeRoamRange":100,
"targetPriority":[MISSILE, FIGHTER, SHIP], # also SHIP_TARGET to prefer targeting the mothership's target
"initialOrbitAngle":0, ###
"focusModeOrbitAngle":0, ### CUSTOM
"orbitRadius":-35, ### # plus ship radius
"orbitDir":0, # -1 or 1
"orbitSpeed":0, # pixels/second
},
{"droneIndex":[1],
"defaultFacing":"MATCH_SHIP_FACING",
"faceEnemy":true,
"holdRoamRange":20, ###
"freeRoamRange":100,
"targetPriority":[MISSILE, FIGHTER, SHIP],
"initialOrbitAngle":50, ###
"focusModeOrbitAngle":5, ### CUSTOM
"orbitRadius":-35, ###
"orbitDir":0,
"orbitSpeed":0,
},
{"droneIndex":[2],
"defaultFacing":"MATCH_SHIP_FACING",
"faceEnemy":true,
"holdRoamRange":20,
"freeRoamRange":100,
"targetPriority":[MISSILE, FIGHTER, SHIP],
"initialOrbitAngle":-50, ###
"focusModeOrbitAngle":-5, ### CUSTOM
"orbitRadius":-35, ###
"orbitDir":0,
"orbitSpeed":0,
},
],

"useSound":"drone_launch",
"outOfUsesSound":"gun_out_of_ammo",
}
(notice how easy it is to put this in spoilers :P)
[close]
My mod has a json loading class (using SettingsAPI) that will read certain values that I have marked, when I hijacked the structure of the base DRONE_LAUNCHER shipsystem json config. The issue is that when I remove the unused values so that it has contents like so:
modified
Code
{
"id":"PSE_droneCorona",
"type":"STAT_MOD",
"statsScript":"data.scripts.shipsystems.PSE_DroneCorona",
"aiType":"CUSTOM",
"aiScript":"data.scripts.shipsystems.ai.PSE_DroneCoronaSystemAI",

"droneVariant":"PSE_drone1_Drone",

"launchSpeed":150,
"launchDelay":0.5,
"maxDrones":3,
"droneBehavior":[
{"droneIndex":[0],
"initialOrbitAngle":0,
"focusModeOrbitAngle":0,
"orbitRadius":-35, # plus ship radius
},
{"droneIndex":[1],
"initialOrbitAngle":50,
"focusModeOrbitAngle":5,
"orbitRadius":-35,
},
{"droneIndex":[2],
"initialOrbitAngle":-50,
"focusModeOrbitAngle":-5,
"orbitRadius":-35,
},
],

"useSound":"drone_launch",
"outOfUsesSound":"gun_out_of_ammo",
}
[close]
The game crashes before any modplugins are loaded, with the error "Fatal: JSONObject["targetPriority"] not found.", which indicates that it can't find the first sequential value relevant to the DRONE_LAUNCHER shipsystem type that I am not using. The thing that has me the most confused, is that this is actually of STAT_MOD type. Why is it complaining that it can't find a value that is used by DRONE_LAUNCHER?

Darn spoilers mean I have to put this in notepad to look at it (*grumble* *grumble* code spoiler compression *grumble* *grumble*)  :P

Anyway this is a guess, but assuming you changed it to STAT_MOD to try and prevent those values from being read- it probably doesn't work that way. Just having defined drones in the first place means that the system loader will look for all the relevant values of the droneBehavior JSONObject contained in each index of the droneBehavior array. Defining DRONE_LAUNCHER doesn't do this but rather having the presence of droneBehavior[] does, if that makes sense.

Even if the drones are technically weaponless, I'd assume they would need a target priority by default even if the system doesn't actually use it. Same thing with orbitSpeed and orbitDir. The loader expects these values to be there whether they are actually used or not. What the custom AI uses is probably irrelevant in that case. If it didn't work that way then you probably wouldn't have been able to define drones under STAT_MOD in the first place. It would have either thrown an error or ignored those values because it would be only expecting a statsScript and the basic default system values.
« Last Edit: June 26, 2020, 01:10:18 PM by Morrokain »
Logged

tomatopaste

  • Captain
  • ****
  • Posts: 315
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #6582 on: June 26, 2020, 05:53:37 PM »

I'm having a weird issue relating to .system loading. I'm not sure if it's a mistake I've made, which it could well be, but there isn't something that I'm obviously doing wrong. I have a shipsystem file with json contents below:
 .system file
Code
{ ### the drone AI written for the deuces doesn't use a lot of the values here, only those marked with ###, but the game will crash on launch if the unused values are missing
"id":"PSE_droneCorona",
"type":"STAT_MOD",
"statsScript":"data.scripts.shipsystems.PSE_DroneCorona",
"aiType":"CUSTOM",
"aiScript":"data.scripts.shipsystems.ai.PSE_DroneCoronaSystemAI",

"droneVariant":"PSE_drone1_Drone",

"allowFreeRoam":true,

"launchSpeed":150,
"launchDelay":0.5,
"maxDrones":3,
"droneBehavior":[
{"droneIndex":[0],
"defaultFacing":"MATCH_SHIP_FACING", # MATCH_DRONE_HEADING, MATCH_SHIP_HEADING, MATCH_SHIP_FACING, AWAY_FROM_SHIP
"faceEnemy":true,
"holdRoamRange":20, ###
"freeRoamRange":100,
"targetPriority":[MISSILE, FIGHTER, SHIP], # also SHIP_TARGET to prefer targeting the mothership's target
"initialOrbitAngle":0, ###
"focusModeOrbitAngle":0, ### CUSTOM
"orbitRadius":-35, ### # plus ship radius
"orbitDir":0, # -1 or 1
"orbitSpeed":0, # pixels/second
},
{"droneIndex":[1],
"defaultFacing":"MATCH_SHIP_FACING",
"faceEnemy":true,
"holdRoamRange":20, ###
"freeRoamRange":100,
"targetPriority":[MISSILE, FIGHTER, SHIP],
"initialOrbitAngle":50, ###
"focusModeOrbitAngle":5, ### CUSTOM
"orbitRadius":-35, ###
"orbitDir":0,
"orbitSpeed":0,
},
{"droneIndex":[2],
"defaultFacing":"MATCH_SHIP_FACING",
"faceEnemy":true,
"holdRoamRange":20,
"freeRoamRange":100,
"targetPriority":[MISSILE, FIGHTER, SHIP],
"initialOrbitAngle":-50, ###
"focusModeOrbitAngle":-5, ### CUSTOM
"orbitRadius":-35, ###
"orbitDir":0,
"orbitSpeed":0,
},
],

"useSound":"drone_launch",
"outOfUsesSound":"gun_out_of_ammo",
}
(notice how easy it is to put this in spoilers :P)
[close]
My mod has a json loading class (using SettingsAPI) that will read certain values that I have marked, when I hijacked the structure of the base DRONE_LAUNCHER shipsystem json config. The issue is that when I remove the unused values so that it has contents like so:
modified
Code
{
"id":"PSE_droneCorona",
"type":"STAT_MOD",
"statsScript":"data.scripts.shipsystems.PSE_DroneCorona",
"aiType":"CUSTOM",
"aiScript":"data.scripts.shipsystems.ai.PSE_DroneCoronaSystemAI",

"droneVariant":"PSE_drone1_Drone",

"launchSpeed":150,
"launchDelay":0.5,
"maxDrones":3,
"droneBehavior":[
{"droneIndex":[0],
"initialOrbitAngle":0,
"focusModeOrbitAngle":0,
"orbitRadius":-35, # plus ship radius
},
{"droneIndex":[1],
"initialOrbitAngle":50,
"focusModeOrbitAngle":5,
"orbitRadius":-35,
},
{"droneIndex":[2],
"initialOrbitAngle":-50,
"focusModeOrbitAngle":-5,
"orbitRadius":-35,
},
],

"useSound":"drone_launch",
"outOfUsesSound":"gun_out_of_ammo",
}
[close]
The game crashes before any modplugins are loaded, with the error "Fatal: JSONObject["targetPriority"] not found.", which indicates that it can't find the first sequential value relevant to the DRONE_LAUNCHER shipsystem type that I am not using. The thing that has me the most confused, is that this is actually of STAT_MOD type. Why is it complaining that it can't find a value that is used by DRONE_LAUNCHER?

Darn spoilers mean I have to put this in notepad to look at it (*grumble* *grumble* code spoiler compression *grumble* *grumble*)  :P

Anyway this is a guess, but assuming you changed it to STAT_MOD to try and prevent those values from being read- it probably doesn't work that way. Just having defined drones in the first place means that the system loader will look for all the relevant values of the droneBehavior JSONObject contained in each index of the droneBehavior array. Defining DRONE_LAUNCHER doesn't do this but rather having the presence of droneBehavior[] does, if that makes sense.

Even if the drones are technically weaponless, I'd assume they would need a target priority by default even if the system doesn't actually use it. Same thing with orbitSpeed and orbitDir. The loader expects these values to be there whether they are actually used or not. What the custom AI uses is probably irrelevant in that case. If it didn't work that way then you probably wouldn't have been able to define drones under STAT_MOD in the first place. It would have either thrown an error or ignored those values because it would be only expecting a statsScript and the basic default system values.

Thanks, that inference turned out to be correct. Adding prefixes to all the keys that would derail the spec loader works a treat, .system file is nice and neat now  :D
Logged

shoi

  • Admiral
  • *****
  • Posts: 706
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #6583 on: June 27, 2020, 12:08:40 AM »

Is there anyway to set a ship as disabled while they're deployed in battle, so that at the end of battle report they are listed as disabled as well with chance of being recovered via scripting?
I have been trying
Quote
FleetMember.getStatus().disable();
which just throws null pointer, even if I get get fleetmemberAPI directly from the ship's ShipAPI before evaluating the variable. I'm stumped. With the script i wrote, this is set to trigger when the ShipAPI in question is a hulk/dead, could that possibly be the cause?
« Last Edit: June 27, 2020, 12:11:52 AM by shoi »
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 #6584 on: June 27, 2020, 10:08:51 AM »

This came up in another thread and I really don't know how this works, but, is the quality modifier of a variant used in the autoresolve calculation in any way?
Logged
Pages: 1 ... 437 438 [439] 440 441 ... 753