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 ... 280 281 [282] 283 284 ... 706

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

Morrokain

  • Admiral
  • *****
  • Posts: 2143
  • Megalith Dreadnought - Archean Order
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #4215 on: January 20, 2019, 07:16:42 PM »

So if I add stations in Industries.csv by pointing that entry to a new variant, then add the necessary path to econ\\aztlan.json in the replace array of mod_info, and put the new industry id for the new station in the replaced file, shouldn't it show up in the campaign?

It doesn't seem to replace the station at all.

Currently uploading an example mod to link. Should be done in an hour or so.

https://www.dropbox.com/sh/x4e2o82j21b3dpk/AAB58nMhE8qpmSPJi0UUC6C8a?dl=0

*Edit*

So I replace the Aztlan stations with custom Hegemony skinned variants in the example mod, and though in dev mode they show up in the variant editor just fine, the markets in Aztlan spawn the same stations they normally do.
« Last Edit: January 20, 2019, 07:24:50 PM by Morrokain »
Logged

Originem

  • Purple Principle
  • Captain
  • ****
  • Posts: 430
  • Dancing like a boss.
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #4216 on: January 20, 2019, 08:14:02 PM »

Oh, oops - the method wasn't in the API. Added DamageType getDamageType() to WeaponSpecAPI.
... :-\
Logged
My mods


Alex

  • Administrator
  • Admiral
  • *****
  • Posts: 23986
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #4217 on: January 20, 2019, 09:13:21 PM »

So if I add stations in Industries.csv by pointing that entry to a new variant, then add the necessary path to econ\\aztlan.json in the replace array of mod_info, and put the new industry id for the new station in the replaced file, shouldn't it show up in the campaign?

It doesn't seem to replace the station at all.

Currently uploading an example mod to link. Should be done in an hour or so.

https://www.dropbox.com/sh/x4e2o82j21b3dpk/AAB58nMhE8qpmSPJi0UUC6C8a?dl=0

*Edit*

So I replace the Aztlan stations with custom Hegemony skinned variants in the example mod, and though in dev mode they show up in the variant editor just fine, the markets in Aztlan spawn the same stations they normally do.

Took a look! It works on my end due to the related fixes for how the "replace" section works. I think if you change it from \\aztlan.json to /aztlan.json it'll work on your end as well.

Oh, oops - the method wasn't in the API. Added DamageType getDamageType() to WeaponSpecAPI.
... :-\

Apologies :)
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 #4218 on: January 21, 2019, 12:20:06 AM »


Took a look! It works on my end due to the related fixes for how the "replace" section works. I think if you change it from \\aztlan.json to /aztlan.json it'll work on your end as well.


Yes that does work. To be specific, the rest of the path must still be delimited by "\\" but after "econ" it changes to "/" and that replaces the file.  :)
Logged

manictiger

  • Ensign
  • *
  • Posts: 21
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #4219 on: January 21, 2019, 09:16:15 AM »

I'm at my wits end with this thing.  I'm trying to add a third weapon to my mod.  The first two were relatively straightforward, but this one-- I've tried everything, from reordering the names in alphabetical, to disabling the textured beam, etc.  Currently, this thing's almost a direct clone of the tactical laser and it still won't work.

Error:
Spoiler
6942 [Thread-4] ERROR com.fs.starfarer.combat.CombatMain  - org.json.JSONException: JSONArray[3] not found.
org.json.JSONException: JSONArray[3] not found.
   at org.json.JSONArray.get(JSONArray.java:204)
   at org.json.JSONArray.getInt(JSONArray.java:265)
   at com.fs.starfarer.loading.D.Ö00000(Unknown Source)
   at com.fs.starfarer.loading.WeaponSpecLoader.Ò00000(Unknown Source)
   at com.fs.starfarer.loading.WeaponSpecLoader.Ò00000(Unknown Source)
   at com.fs.starfarer.loading.SpecStore.while(Unknown Source)
   at com.fs.starfarer.loading.ResourceLoaderState.init(Unknown Source)
   at com.fs.state.AppDriver.begin(Unknown Source)
   at com.fs.starfarer.combat.CombatMain.main(Unknown Source)
   at com.fs.starfarer.StarfarerLauncher$1.run(Unknown Source)
   at java.lang.Thread.run(Unknown Source)
[close]

Suspected file:
Spoiler
{
   "specClass":"beam",
   "id":"altca_electroplas",
   "type":"ENERGY",
   "size":"SMALL",
   #"collisionClass":"RAY",
   #"collisionClassByFighter":"RAY_FIGHTER",
   "turretSprite":"graphics/weapons/altca_electroplas_turret_base.png",
   "turretGlowSprite":"graphics/weapons/altca_electroplas_turret_glow.png",
   "hardpointSprite":"graphics/weapons/altca_electroplas_hardpoint_base.png",
   "hardpointGlowSprite":"graphics/weapons/altca_electroplas_hardpoint_glow.png",
   "turretOffsets":[15,0],
   "turretAngleOffsets":[0],
   "hardpointOffsets":[15,0],
   "hardpointAngleOffsets":[0],
   "fringeColor":[0,255,191,105],
   "coreColor":[0,255,255],
   "glowColor":[0,255,191,105],
   #"fringeColor":[128,0,255,105],
   #"coreColor":[191,0,25,155],
   #"glowColor":[191,0,255,105],
   #"darkCore":false,
   "width":13.0,
   "textureType":ROUGH,
   #"textureType":["graphics/fx/altca_electroplas_shell.png","graphics/fx/altca_electroplas_shell_fringe.png"],
   "textureScrollSpeed":72.0,
   "pixelsPerTexel":5.0,
   #"animationType":"GLOW_AND_FLASH",  # NONE, GLOW, MUZZLE_FLASH, SMOKE
   #"muzzleFlashSpec":{"length":54.0,   # only used if animationType = MUZZLE_FLASH
   #               "spread":20.0,
   #               "particleSizeMin":18.0,
   #               "particleSizeRange":24.0,
   #               "particleDuration":0.12,
   #               "particleCount":32,
   #               "particleColor":[64, 0, 255,215]},
   "pierceSet":[PROJECTILE_FF,PROJECTILE_NO_FF,PROJECTILE_FIGHTER,MISSILE_FF,MISSILE_NO_FF],
   "fireSoundOne":"altca_electroplas_fire",
   "fireSoundTwo":"altca_laser_loop",
}
[close]
Logged

Alex

  • Administrator
  • Admiral
  • *****
  • Posts: 23986
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #4220 on: January 21, 2019, 09:57:45 AM »

"coreColor":[0,255,255],

Probably needs a 4th element there for the alpha.
Logged

manictiger

  • Ensign
  • *
  • Posts: 21
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #4221 on: January 21, 2019, 10:26:21 AM »

"coreColor":[0,255,255],

Probably needs a 4th element there for the alpha.

Thanks.  That solved it.
Logged

LazyWizard

  • Global Moderator
  • Admiral
  • *****
  • Posts: 1363
    • View Profile
    • GitHub Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #4222 on: January 21, 2019, 06:01:44 PM »

What controls whether a bar event sticks around after the player interacts with it? For example, you can refuse the commodity delivery quest and the issuer will still be there in case you change your mind.

As far as I can tell my bar event code isn't doing anything differently, but leaving the conversation will remove the person from the bar list.
Logged

Alex

  • Administrator
  • Admiral
  • *****
  • Posts: 23986
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #4223 on: January 21, 2019, 06:17:13 PM »

Calling this:

BarEventManager.getInstance().notifyWasInteractedWith(barEvent);

Will remove it from the list. It's "interacted" in the sense of "partook in what it has to offer" rather than just "took a look and backed out" sense.
Logged

LazyWizard

  • Global Moderator
  • Admiral
  • *****
  • Posts: 1363
    • View Profile
    • GitHub Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #4224 on: January 21, 2019, 06:55:50 PM »

Calling this:

BarEventManager.getInstance().notifyWasInteractedWith(barEvent);

Will remove it from the list. It's "interacted" in the sense of "partook in what it has to offer" rather than just "took a look and backed out" sense.

Ah, whoops. I did have a stray call to that method in the wrong dialog branch. At least it was something simple. :)

Just to double check: the BarEvent script instance will persist until it expires, right? I don't need to keep track of the person or quest flags in sector memory if they won't extend past this one event?
« Last Edit: January 21, 2019, 06:58:31 PM by LazyWizard »
Logged

Alex

  • Administrator
  • Admiral
  • *****
  • Posts: 23986
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #4225 on: January 21, 2019, 07:27:18 PM »

Yep, correct. It is however possible for the same BarEvent to be shown at another market, depending on how it's coded.

BaseBarEvent's shouldShowAtMarket(MarketAPI market) method makes it not do that, but in some cases it could be desirable.


The BaseGetCommodityBarEvent class has a regen() method that it calls to reinstantiate whatever it might need to in case the market changed, although I don't think it actually needs to - but there may be a subclass I'm not thinking of where it may indeed change markets.

Basically, the bar events are not inherently tied to a market, rather they decide whether they want to be shown at the current market the player is interacting with. I think all/most vanilla events - in addition to their custom market checks - also check "and was not previously shown at another market".
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 #4226 on: January 23, 2019, 01:10:14 PM »

When I make a subfaction of a faction like the lion guard or knights of ludd, I know I can distinguish their fleets through full control of doctrine like the lion guard does, or make changes to things like portraits or music and ignore composition.

1) What determines where and when the subfaction is spawned? Do I need to set the subfaction id on the market?

2) How are the two factions linked? Or are they? If I only override one fleetType, say "patrolLarge", will the other fleet types spawn normally? Or just that one type on that market if it has the "patrolhq" industry?
Logged

Alex

  • Administrator
  • Admiral
  • *****
  • Posts: 23986
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #4227 on: January 23, 2019, 01:12:46 PM »

See: com.fs.starfarer.api.impl.campaign.econ.impl.LionsGuardHQ

The game has no concept of a "subfaction". So, for example for the Lion's Guard fleets, they're spawned using Factions.LIONS_GUARD in the fleet params - so they use the proper doctrine and so on - and then the fleet faction is set to the Diktat.
Logged

Noomsy

  • Ensign
  • *
  • Posts: 17
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #4228 on: January 23, 2019, 03:14:07 PM »

So i searched through here, but only found some old posts about this....

Does anyone know how I go about adding fuel/cargo etc to a new start?

Im am dorking around with a mod/faction geared to start exploring and colonizing from day 1
Logged

Wispborne

  • Captain
  • ****
  • Posts: 400
  • Discord: wispborne
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #4229 on: January 24, 2019, 06:59:02 PM »

@Noomsy

I imagine you'd have something like

Code
YourModNameLifecyclePlugin.java

class YourModNameLifecyclePlugin extends BaseModPlugin {
  @Override
  void onNewGateAftertimePass() {
    Global.getSector().getPlayerFleet().getCargo().addX;
  }
}

And then in your mod_info.json, remember to add `"modPlugin":"com.you.YourModNameLifecyclePlugin"`
« Last Edit: January 24, 2019, 07:29:57 PM by Wispborne »
Logged
Mod: Persean Chronicles | Mod Manager: SMOL | Tool: VRAM Estimator | Tool: Forum+Discord Mod Database | If I'm inactive for 3 months, anyone can use any of my work for anything (except selling it or its derivatives).
Pages: 1 ... 280 281 [282] 283 284 ... 706