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 ... 567 568 [569] 570 571 ... 626

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

default

  • Lieutenant
  • **
  • Posts: 79
    • View Profile
    • Email
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #8520 on: February 20, 2022, 08:57:46 AM »

Material, normal, and surface maps are used by the GraphicsLib mod's shader engine. Normal maps let a flat surface pretend to be 3D when calculating lighting.

So it's not something that has to be done, it's just if you want things to look better?
Logged
"There's nothing like a trail of blood to find your way back home."

SafariJohn

  • Admiral
  • *****
  • Posts: 2624
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #8521 on: February 20, 2022, 09:21:05 AM »

Correct. I usually use ModLab to quickly generate my normal maps. https://store.steampowered.com/app/768970/ModLab/
Logged

itBeABruhMoment

  • Lieutenant
  • **
  • Posts: 80
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #8522 on: February 21, 2022, 11:43:07 AM »

Is there any way to set an unofficered ship's personality before battle? The ai of unofficered ships get set "in combat" so any changes made using setPersonality on unofficered ships before battle seems to get overridden. If not, would a every frame combat script that run setPersonality on the PersonAPI's of relevant ships work? CombatFleetManagerAPI setDefaultCommander also seems promising.
« Last Edit: February 21, 2022, 11:51:29 AM by itBeABruhMoment »
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 #8523 on: February 21, 2022, 01:08:30 PM »

If not, would a every frame combat script that run setPersonality on the PersonAPI's of relevant ships work?

It should, yes. I do this with a couple of my ship system AIs and those are EveryFrameCombatScripts iirc. They at least work very similarly in function.
Logged

cptdash

  • Ensign
  • *
  • Posts: 13
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #8524 on: February 21, 2022, 08:23:38 PM »

Hello,
I have been investigating mod options for adding additional quests to the bar. As a basic start, I wanted to play around with the mission frequency of the CheapCommidityMission. I attempted the following changes:

bar_events.csv - changing 'freq' to 9999 and 99999999999 for cheapCom entry -- no change in quest frequency
bar_events.csv - adding 'priority' tag to cheapCom entry -- no change in frequency
bar_events.csv - duplicating cheapCom entry to add cheapCom2-cheapCom30 entries -- no change in frequency
person_missions.csv - adding cheapCom2-cheapCom30 entries duplicated off original cheapCom -- no change in frequency
rules.csv - duplicating table entries for cheapCom, changing 'id' column names to cheapCom2-30 -- no change in frequency

All changes were tested by starting a new game and visiting at least 15 stations. Usually I only found 1 quest of the cheapCom variety.
Am I missing something, or is the logic for quest frequency expanded somewhere else?
« Last Edit: February 21, 2022, 08:26:07 PM by cptdash »
Logged

Timid

  • Admiral
  • *****
  • Posts: 566
  • Personal Text
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #8525 on: February 22, 2022, 01:40:58 AM »

Is there anything similar to ShipAPI.isDefenseDisabled() but for Ship Systems?

I notice there is something for ShipAPI.setShipSystemDisabled(boolean), and I'm just curious if the AI script I'm coding should be running if for some reason the ship has its ship systems disabled.

Also, is there a getControlStringForEnumName for something like Hold Fire.. I can't seem to find any mentions of this enum anywhere...

shoi

  • Admiral
  • *****
  • Posts: 543
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #8526 on: February 23, 2022, 04:48:48 PM »

Is there something i'm missing to get the maximum number of elite skills the players officers can have?

      MutableCharacterStatsAPI playerStats = Global.getSector().getPlayerFleet().getFleetData().getCommander().getStats();
      int maxElite = (int)Global.getSettings().getInt("officerMaxEliteSkills") + (int)playerStats.getDynamic().getValue(Stats.OFFICER_MAX_ELITE_SKILLS_MOD);

Doing this returns two, but the character has Cybernetic Augmentation + Officer Training, so it should be 4..
Logged

Alex

  • Administrator
  • Admiral
  • *****
  • Posts: 20990
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #8527 on: February 23, 2022, 05:35:40 PM »

ello,
I have been investigating mod options for adding additional quests to the bar. As a basic start, I wanted to play around with the mission frequency of the CheapCommidityMission. I attempted the following changes:

bar_events.csv - changing 'freq' to 9999 and 99999999999 for cheapCom entry -- no change in quest frequency
bar_events.csv - adding 'priority' tag to cheapCom entry -- no change in frequency
bar_events.csv - duplicating cheapCom entry to add cheapCom2-cheapCom30 entries -- no change in frequency
person_missions.csv - adding cheapCom2-cheapCom30 entries duplicated off original cheapCom -- no change in frequency
rules.csv - duplicating table entries for cheapCom, changing 'id' column names to cheapCom2-30 -- no change in frequency

All changes were tested by starting a new game and visiting at least 15 stations. Usually I only found 1 quest of the cheapCom variety.
Am I missing something, or is the logic for quest frequency expanded somewhere else?

Offhand, that seems like it should work, but it's possible that there simply isn't a "cheap commodity" mission available at that particular colony - iirc it requires a local surplus of a legal commodity. I'd try changing the frequency on some of the other missions to see if it works for those.

Is there anything similar to ShipAPI.isDefenseDisabled() but for Ship Systems?

I notice there is something for ShipAPI.setShipSystemDisabled(boolean), and I'm just curious if the AI script I'm coding should be running if for some reason the ship has its ship systems disabled.

No and no. The system would be disabled if the ship's CR is 0%, btw, but then it wouldn't work at all regardless of if the AI tried to use it.

Also, is there a getControlStringForEnumName for something like Hold Fire.. I can't seem to find any mentions of this enum anywhere...

Should be SHIP_HOLD_FIRE I believe.

Is there something i'm missing to get the maximum number of elite skills the players officers can have?

      MutableCharacterStatsAPI playerStats = Global.getSector().getPlayerFleet().getFleetData().getCommander().getStats();
      int maxElite = (int)Global.getSettings().getInt("officerMaxEliteSkills") + (int)playerStats.getDynamic().getValue(Stats.OFFICER_MAX_ELITE_SKILLS_MOD);

Doing this returns two, but the character has Cybernetic Augmentation + Officer Training, so it should be 4..

You want:
(int) stats.getDynamic().getMod(Stats.OFFICER_MAX_ELITE_SKILLS_MOD).computeEffective(0);
To get the bonus from skills, instead of getValue().
Logged

Amoebka

  • Admiral
  • *****
  • Posts: 989
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #8528 on: February 24, 2022, 10:22:14 AM »

Where do missiles get associated with their AI scripts? Can't see anything in weapon_data, weapon definitions or projectile definitions. Am I blind?  :o I'm trying to make custom missiles that have vanilla locust AI and are spawned in using CombatEngineAPI instead of a weapon. (it would seem I still need to define fake weapons?) I know there's a way to change missile AI script, but how do I get the name of the vanilla class locust uses?
Logged

Alex

  • Administrator
  • Admiral
  • *****
  • Posts: 20990
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #8529 on: February 24, 2022, 10:24:31 AM »

See: ModPlugin.pickMissileAI() for how you might specify a custom AI.

But, the locust uses the standard missile AI that's used for all of the "missileType":"MISSILE", missiles.
Logged

Amoebka

  • Admiral
  • *****
  • Posts: 989
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #8530 on: February 24, 2022, 10:37:00 AM »

But, the locust uses the standard missile AI that's used for all of the "missileType":"MISSILE", missiles.

Does that mean that just defining a missile projectile with turn speed etc specified will make it behave like locust/harpoon/swarmer/etc? If yes, than the question becomes "how do I change a missile's target from outside its AI script". What I want is basically spawn in a missile with the default guided AI, give it a specific target to chase, and have it revert to default behaviour (choosing new target) if my target is unavailable. I know there's getUnwrappedMissileAI, but then I need to know the name of the vanilla class and whatever its "setTarget" method is called, if it exists?
Logged

Alex

  • Administrator
  • Admiral
  • *****
  • Posts: 20990
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #8531 on: February 24, 2022, 10:41:46 AM »

There's a GuidedMissileAI interface. You could do something like:
if (missile.getAI() instanceof GuidedMissileAI) {
    ((GuidedMissileAI)missile.getAI()).setTarget(...)
}
Logged

Amoebka

  • Admiral
  • *****
  • Posts: 989
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #8532 on: February 24, 2022, 10:46:52 AM »

There's a GuidedMissileAI interface. You could do something like:
if (missile.getAI() instanceof GuidedMissileAI) {
    ((GuidedMissileAI)missile.getAI()).setTarget(...)
}

Sounds exactly like what I wanted, thank you.  ;D
Logged

briansd9

  • Ensign
  • *
  • Posts: 45
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #8533 on: February 24, 2022, 10:59:35 PM »

Is there a way to change the hiring cost of crew, or otherwise make them unpurchasable at markets (only by capture or looting)?
« Last Edit: February 25, 2022, 06:32:03 AM by briansd9 »
Logged

shoi

  • Admiral
  • *****
  • Posts: 543
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #8534 on: February 25, 2022, 07:22:37 PM »

You want:
(int) stats.getDynamic().getMod(Stats.OFFICER_MAX_ELITE_SKILLS_MOD).computeEffective(0);
To get the bonus from skills, instead of getValue().
Aha, thanks!
Logged
Pages: 1 ... 567 568 [569] 570 571 ... 626