Fractal Softworks Forum

Please login or register.

Login with username, password and session length
Pages: 1 ... 334 335 [336] 337 338 ... 710

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

Sundog

  • Admiral
  • *****
  • Posts: 1727
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #5025 on: September 11, 2019, 03:19:07 PM »

Yeah, extending MarketCMD and overriding showDefenses() sounds like your best bet. As you noted, that data only exists locally in that method...
Ok, that's what I'll do then. Thank you Alex!

Ed

  • Captain
  • ****
  • Posts: 442
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #5026 on: September 11, 2019, 04:40:35 PM »

How do i know if a weapon is Point Defense or Anti-Fighter?
I want to make a hullmod that blocks any non-PD non-AF weapon to be equipped while buffing the range of PD weapons.

I am looking at the WeaponAPI and i can't find it.

-edit-

I think i found, PrimaryRoleStr right?
Now to figure out how to force any that don't match it to unequip... or forbid equipping in first place...
« Last Edit: September 11, 2019, 04:49:45 PM by Ed »
Logged
Check out my ships

Ed

  • Captain
  • ****
  • Posts: 442
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #5027 on: September 11, 2019, 05:31:46 PM »

I can't figure out a way to remove or disable the weapons, right now I am trying this

Code
for (WeaponAPI weapon : weapons) {        	
   String role = weapon.getSpec().getPrimaryRoleStr();
   if(role.contains("Point Defense") || role.contains("Anti Fighter")) {
       continue;
   }
   weapon.disable();// <-- this is crashing (nullpointer)
}

I get a crash with this one when i swap a PD weapon with a non-PD weapon
Logged
Check out my ships

Sundog

  • Admiral
  • *****
  • Posts: 1727
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #5028 on: September 11, 2019, 06:13:33 PM »

Now to figure out how to force any that don't match it to unequip... or forbid equipping in first place...
I know this isn't the advice you want, but I think you're going about this the wrong way. Starsector has no built-in mechanism for preventing the fitting of weapons, hullmods, or fighters, and trying force it to work that way will inevitably lead to issues that are all but impossible to resolve. A far more practical and user-friendly approach would be to discourage certain weapons by penalizing their usage somehow. I'm telling you this for the sake of your own time. I'm glad you're pushing the limits of what the engine can do with your mod, but you need to be realistic as well.

Code
weapon.disable();// <-- this is crashing (nullpointer)
My guess is that you're calling disable() in a context in which it's not supported (e.g. in the refit screen instead of during battle). Otherwise, I have no idea why disable() would throw a NPE

Ed

  • Captain
  • ****
  • Posts: 442
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #5029 on: September 11, 2019, 06:37:59 PM »

Oh so disable was combat only, i see.

Thanks for the advice Sundog, but i figured out a solution, i tested it plenty and didn't get any issues, it is similar to the one used by Sylphon RnD drone only hullmod
Logged
Check out my ships

ArnaudB

  • Ensign
  • *
  • Posts: 24
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #5030 on: September 12, 2019, 01:51:49 AM »

What you probably want to do is edit commodities.csv and increase the econUnit column, since that directly affects how many cargo units of commodities correspond to an "economy unit".
Thank you, I found the file and made the edits. I do have to make the change for every mod right? That's what I am doing right now.

On a related note, I tried to search on the forum but found no answer. I'm sure it came up last year or so though. I mostly played on randomly-generated sectors and I never see the lobsters although I get trade missions for them. Similarly I the Hazard Mining Incorporated mod is supposed to add a number of exotic resources but none of their market seems to make them whenever I generate a sector. Is there something to do to fix this?
Logged

Ed

  • Captain
  • ****
  • Posts: 442
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #5031 on: September 12, 2019, 06:33:56 AM »

Is it possible to make a fighter that delivers ammo to other ships?
It would have to move up to an ally, do an animation in there, the ally would get a bit of ammo restocked and then the fighter would return to the carrier. How could this be implemented?
Logged
Check out my ships

Dwarden

  • Commander
  • ***
  • Posts: 196
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #5032 on: September 12, 2019, 09:03:02 AM »

Is it possible to make a fighter that delivers ammo to other ships?
It would have to move up to an ally, do an animation in there, the ally would get a bit of ammo restocked and then the fighter would return to the carrier. How could this be implemented?

sort of like maintenance / repair drone but for ammo, interesting idea
Logged

Alex

  • Administrator
  • Admiral
  • *****
  • Posts: 24123
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #5033 on: September 12, 2019, 09:05:38 AM »

Is it possible to make a fighter that delivers ammo to other ships?
It would have to move up to an ally, do an animation in there, the ally would get a bit of ammo restocked and then the fighter would return to the carrier. How could this be implemented?

Probably, yeah, though it seems like a lot of effort. I'd imagine you'd have to write a bunch of scripts for the fighter AI and the actual effect. The fighter AI is where you'd take care of the landing/return/etc. I realize that's a bit vague, but in my defense, so is the question :)
Logged

Ed

  • Captain
  • ****
  • Posts: 442
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #5034 on: September 12, 2019, 10:45:40 AM »


Probably, yeah, though it seems like a lot of effort. I'd imagine you'd have to write a bunch of scripts for the fighter AI and the actual effect. The fighter AI is where you'd take care of the landing/return/etc. I realize that's a bit vague, but in my defense, so is the question :)

If it is possible i wanna try, how much of the fighter behavior can be overwritten?


sort of like maintenance / repair drone but for ammo, interesting idea

Is there a mod that already does something similar? I could reverse-engineer it.

Logged
Check out my ships

Alex

  • Administrator
  • Admiral
  • *****
  • Posts: 24123
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #5035 on: September 12, 2019, 10:47:16 AM »

If it is possible i wanna try, how much of the fighter behavior can be overwritten?

To the best of my knowledge, 100%, but I'm not sure if anyone has tried modding in a fully-functional fighter AI, so some things may be broken, and you'll be treading on relatively unexplored ground.
Logged

Dwarden

  • Commander
  • ***
  • Posts: 196
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #5036 on: September 12, 2019, 11:18:04 AM »

so, there were/are mods where fighters were overriden in such way?

e.g. theirs weapon have negative value of damage effect (vs shield or hull , weapons or engines)
combined with ability target and attack friendly ship instead of enemy
thus as result they regenerate shield, hull and weapon/engine too ? ;)

Logged

Ed

  • Captain
  • ****
  • Posts: 442
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #5037 on: September 12, 2019, 11:57:45 AM »

so, there were/are mods where fighters were overriden in such way?

e.g. theirs weapon have negative value of damage effect (vs shield or hull , weapons or engines)
combined with ability target and attack friendly ship instead of enemy
thus as result they regenerate shield, hull and weapon/engine too ? ;)
if i can't make them deliver ammo i might try to make repair drones
Logged
Check out my ships

Dwarden

  • Commander
  • ***
  • Posts: 196
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #5038 on: September 12, 2019, 01:46:51 PM »


after observing mods like e.g. nexerelin to override starting choices from the other smaller mods start options

i want to ask question if there there is way to make it modular / expanding ?
so one may combine those starting options alongside (ofc only if they compatible)

variety of selection in the start options would be very nice

now if that isn't possible to do via modding then i guess i would need to repost it into suggestions
(tho i bet someone else already suggested it in past)
Logged

MeinGott

  • Ensign
  • *
  • Posts: 35
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #5039 on: September 12, 2019, 02:06:13 PM »

Hello
I made a ship, it works in sim battle, it shows up in codex variants, it is part of midline blueprints, it shows up in fleet doctrine and custom production BUT when I order its construction, the month its due to be completed report says its delivered to chosen market, but it doesnt spawn there. additionally, entire month of production capabilities is deducted from my funds, even though it should take only a couple of thousands to finish the job. the ship doesnt disappear from production list, and money is further withdrawn every consecutive month, each one reporting production complete.
I have no clue where to look for a solution? I used esteemed Vayra's tutorial, files seem ok, hull, variants, IDs too... 
thanks 
Logged
Pages: 1 ... 334 335 [336] 337 338 ... 710