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: Simulator Enhancements (03/13/24)

Pages: 1 ... 426 427 [428] 429 430 ... 706

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

Amoebka

  • Admiral
  • *****
  • Posts: 1318
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #6405 on: May 12, 2020, 06:04:26 AM »

If I create a custom RouteFleetSpawner that creates player-friendly fleets in a system (similar to Lion's Guard), will they count towards autorepelling expeditions/raids when the player isn't at home?

Is it governed by
Code
fleet.getMemoryWithoutUpdate().set("$isPatrol", true)
as I think it is?
Logged

Alex

  • Administrator
  • Admiral
  • *****
  • Posts: 23986
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #6406 on: May 12, 2020, 09:40:03 AM »

This is governed by the RouteData having an OptionalFleetData specified, and the "strength" field of the latter being set.

See MilitaryBase, line 406 for an example of this:
Code: java
OptionalFleetData extra = new OptionalFleetData(market);
extra.fleetType = type.getFleetType();

RouteData route = RouteManager.getInstance().addRoute(sid, market, Misc.genRandomSeed(), extra, this, custom);
extra.strength = (float) getPatrolCombatFP(type, route.getRandom());
extra.strength = Misc.getAdjustedStrength(extra.strength, market);

Also see WarSimScript.getFactionStrength() for how it's calculated.
Logged

Amoebka

  • Admiral
  • *****
  • Posts: 1318
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #6407 on: May 12, 2020, 10:54:41 AM »

This is governed by the RouteData having an OptionalFleetData specified, and the "strength" field of the latter being set.

See MilitaryBase, line 406 for an example of this:
Code: java
OptionalFleetData extra = new OptionalFleetData(market);
extra.fleetType = type.getFleetType();

RouteData route = RouteManager.getInstance().addRoute(sid, market, Misc.genRandomSeed(), extra, this, custom);
extra.strength = (float) getPatrolCombatFP(type, route.getRandom());
extra.strength = Misc.getAdjustedStrength(extra.strength, market);

Also see WarSimScript.getFactionStrength() for how it's calculated.

Thank you, that explains it.
Logged

Cabbs

  • Ensign
  • *
  • Posts: 24
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #6408 on: May 14, 2020, 04:45:52 AM »

Have an... efficiency or safety question? Inexperienced so apologies in advance.

Currently I am managing the presence of two NPC's on a player planet comms directory with a rule that falls under the 'FireAll PopulateAll' trigger, set to fire on a player faction market only.  So, you interact with one of your own planets, and this rule triggers a script that may execute 10-20 lines of code, depending on conditions - in this case presence of specific industries.

I used Rules for this on the assumption that it would be impossible for it to interfere with other mods or features; the 'FireAll PopulateAll' trigger means that I can implement my mod without changing any vanilla rules and have anything notable happen through command scripts.

Do I have the wrong implementation of this, or am I worrying over nothing?  I know that the AsteroidInteraction example mod implements InteractionDialogPlugin for instance, and I could conceivably do all this through that.

Will state for the record that I do not know how the game decides who shows up on comms.
Logged

lethargie

  • Commander
  • ***
  • Posts: 183
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #6409 on: May 14, 2020, 12:21:57 PM »

the following file are always replaced:
Sound files (e.g, .ogg, .wav)
Graphics (.png, .jpg)
Scripts (.java)
Weapon and projectile specifications (.wpn, .proj)
Ship hull and variant specifications (.ship, .variant)
Fonts (.fnt)

if I name them in my mod_info replace file, does it does something if multiple mod try to replace them, or is it just useless?
Logged

Alex

  • Administrator
  • Admiral
  • *****
  • Posts: 23986
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #6410 on: May 14, 2020, 12:30:01 PM »

Have an... efficiency or safety question? Inexperienced so apologies in advance.

Currently I am managing the presence of two NPC's on a player planet comms directory with a rule that falls under the 'FireAll PopulateAll' trigger, set to fire on a player faction market only.  So, you interact with one of your own planets, and this rule triggers a script that may execute 10-20 lines of code, depending on conditions - in this case presence of specific industries.

I used Rules for this on the assumption that it would be impossible for it to interfere with other mods or features; the 'FireAll PopulateAll' trigger means that I can implement my mod without changing any vanilla rules and have anything notable happen through command scripts.

Do I have the wrong implementation of this, or am I worrying over nothing?  I know that the AsteroidInteraction example mod implements InteractionDialogPlugin for instance, and I could conceivably do all this through that.

Will state for the record that I do not know how the game decides who shows up on comms.

Hmm - this seems reasonable, I think? I'm assuming you're doing this in a rule triggered by OpenInteractionDialog, with a high "score:" in one of the conditions,  and then re-firing "FireBest OpenInteractionDialog" (after setting a flag so *this* rule doesn't fire again) so that whatever normally fires can take over and, e.g. show the standard colony interaction dialog? I'm doing quite a bit of reading between the lines here :)


the following file are always replaced:
Sound files (e.g, .ogg, .wav)
Graphics (.png, .jpg)
Scripts (.java)
Weapon and projectile specifications (.wpn, .proj)
Ship hull and variant specifications (.ship, .variant)
Fonts (.fnt)

if I name them in my mod_info replace file, does it does something if multiple mod try to replace them, or is it just useless?

If multiple mods provide these files, they're considered incompatible and there's nothing in places to try to resolve these kinds of conflicts. The "replace" section doesn't come into play, since these files always replace anyway.
Logged

Cabbs

  • Ensign
  • *
  • Posts: 24
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #6411 on: May 14, 2020, 01:36:35 PM »

Spoiler
Have an... efficiency or safety question? Inexperienced so apologies in advance.

Currently I am managing the presence of two NPC's on a player planet comms directory with a rule that falls under the 'FireAll PopulateAll' trigger, set to fire on a player faction market only.  So, you interact with one of your own planets, and this rule triggers a script that may execute 10-20 lines of code, depending on conditions - in this case presence of specific industries.

I used Rules for this on the assumption that it would be impossible for it to interfere with other mods or features; the 'FireAll PopulateAll' trigger means that I can implement my mod without changing any vanilla rules and have anything notable happen through command scripts.

Do I have the wrong implementation of this, or am I worrying over nothing?  I know that the AsteroidInteraction example mod implements InteractionDialogPlugin for instance, and I could conceivably do all this through that.

Will state for the record that I do not know how the game decides who shows up on comms.
[close]

Hmm - this seems reasonable, I think? I'm assuming you're doing this in a rule triggered by OpenInteractionDialog, with a high "score:" in one of the conditions,  and then re-firing "FireBest OpenInteractionDialog" (after setting a flag so *this* rule doesn't fire again) so that whatever normally fires can take over and, e.g. show the standard colony interaction dialog? I'm doing quite a bit of reading between the lines here :)


Messed up my explanation slightly - and what I have done is probably only working by chance, based on what you've said.

My rule just has the 'PopulateOptions' trigger, which is shared with a bunch of interaction rules, and called by FireAll in a large number of others, including anything related to markets.

Conditions are simply '$hasMarket' and '$faction.id == player', with a script, and no weighting or anything else.  End result is it executes the script on a player market and then the rest continues as normal afterwards with no input from me.

EDIT:  Ah, without '$menuState == main' its gonna be firing more often than I want
« Last Edit: May 14, 2020, 01:44:25 PM by Cabbs »
Logged

Alex

  • Administrator
  • Admiral
  • *****
  • Posts: 23986
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #6412 on: May 14, 2020, 02:45:35 PM »

Ah - that still sounds reasonable, yeah. I'd add something like:

conditions: !$didThing
script: $didThing = true 0

As a failsafe to ensure that your rule doesn't run more than once per interaction with the market.
Logged

Üstad

  • Commander
  • ***
  • Posts: 131
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #6413 on: May 15, 2020, 04:53:12 AM »

How can we lower or remove hammer barrages missile spread?

You can change that in hammerrack.wpn; see hardpointAngleOffsets and hardpointAngleOffsets.

You wrote hardpointAngleOffsets twice, what is the second value that I need to change? Thanks for your interest.
Logged

Cabbs

  • Ensign
  • *
  • Posts: 24
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #6414 on: May 15, 2020, 06:41:38 AM »

Ah - that still sounds reasonable, yeah. I'd add something like:

conditions: !$didThing
script: $didThing = true 0

As a failsafe to ensure that your rule doesn't run more than once per interaction with the market.

Works like a charm! Thanks for taking the time, Alex.

Here's the final rule for clarity, if anyone is interested:

Spoiler
Runs 'CBCC_CommPersonCheck' command script when you interact with a player owned market, will not repeat until you leave and the 0-day boolean expires.

idtriggerconditionsscripttext
CBCC_pop_contact    PopulateOptions    $hasMarket
$menuState == main   
$faction.id == player
!$charcheck
CBCC_CommPersonCheck   
$charcheck = true 0
Executing Custom Script now

see https://starsector.fandom.com/wiki/Rules.csv_Tutorial to set up your scripts to be used correctly by Rules.csv
[close]
Logged

SafariJohn

  • Admiral
  • *****
  • Posts: 3010
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #6415 on: May 15, 2020, 07:20:15 AM »

How can we lower or remove hammer barrages missile spread?

You can change that in hammerrack.wpn; see hardpointAngleOffsets and hardpointAngleOffsets.

You wrote hardpointAngleOffsets twice, what is the second value that I need to change? Thanks for your interest.

turretAngleOffsets
Logged

Alex

  • Administrator
  • Admiral
  • *****
  • Posts: 23986
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #6416 on: May 15, 2020, 09:10:18 AM »

Works like a charm! Thanks for taking the time, Alex.

Here's the final rule for clarity, if anyone is interested:

Nice! One final thing I'd suggest, renaming $charcheck to something like $CBCC_charcheck, juuust to make any potential conflicts with other mods less likely. The same kind of idea when adding mod-specific (and hopefully mod-unique) prefixes to ship id's, weapon id's, rule id's, and so on.
Logged

Üstad

  • Commander
  • ***
  • Posts: 131
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #6417 on: May 18, 2020, 07:26:47 AM »

How to increase colony industry limit?
Logged

Mondaymonkey

  • Admiral
  • *****
  • Posts: 777
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #6418 on: May 18, 2020, 07:35:42 AM »

How to increase colony industry limit?

You can adjust maximum industries per each market size by changing the settings line:

"maxIndustries":[1,1,1,2,3,3,4,4,4,4],

You can not change 12 buildings total cap. Anyhow.
Logged
I dislike human beings... or I just do not know how to cook them well.

lethargie

  • Commander
  • ***
  • Posts: 183
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #6419 on: May 19, 2020, 12:53:22 PM »

Both  hound_overdriven.variant and variants/hound_d_pirates_overdriven.variant from starsector_core have the same variant id: hound_d_pirates_Overdriven

when a faction try to spawn this variant because it has the proper hull, what happens?
Logged
Pages: 1 ... 426 427 [428] 429 430 ... 706