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 ... 410 411 [412] 413 414 ... 706

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

Alex

  • Administrator
  • Admiral
  • *****
  • Posts: 23988
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #6165 on: March 13, 2020, 12:36:55 PM »

Hmm - I don't think so, no - sorry! I mean, you might try to write a custom version of the drone launcher system from the ground up - basically launching drones/maintaining its own state as needed - but the existing drone launcher system isn't that flexible.
Logged

tomatopaste

  • Captain
  • ****
  • Posts: 306
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #6166 on: March 13, 2020, 04:13:15 PM »

Hmm - I don't think so, no - sorry! I mean, you might try to write a custom version of the drone launcher system from the ground up - basically launching drones/maintaining its own state as needed - but the existing drone launcher system isn't that flexible.
Yikes - well, I might as well go all out. Can I have some info on how the existing system launches drones onto the map? Is it as simple as spawning in the combat entity with a reversed velocity? Do I need to extend BaseShipSystemScript? How does it interface with the systems csv and/or json configuration?

EDIT: Nevermind, I found the obfuscated source so I'll use that as a guideline to implementing my ideas
« Last Edit: March 14, 2020, 12:50:14 AM by tomatopaste »
Logged

King Alfonzo

  • Admiral
  • *****
  • Posts: 679
  • -- D O C T O R --
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #6167 on: March 14, 2020, 03:40:51 AM »

Hey All,

I've run into a spot of bother. What I want to do is spawn a beacon in hyperspace over a system. The code I'm using is based off RemnantThemeGenerator, but hacked down to something that doesn't melt my brain. This is inserted near the beginning of my generator file for the system:

Code
        SectorEntityToken anchor = system.getHyperspaceAnchor();
        CustomCampaignEntityAPI beacon = Global.getSector().getHyperspace().addCustomEntity("messrem_beacon", "Warning Beacon", "HMI_RemMess_beacon", Factions.NEUTRAL);
        beacon.setCircularOrbitPointingDown(anchor, 100, 300, 65f);
        Color glowColor = new Color(250,55,0,255);
        Color pingColor = new Color(250,55,0,255);
        Misc.setWarningBeaconColors(beacon, glowColor, pingColor);

Using this causes the game to crash due to a nullpointerexception. According to the log and some checking, the null error is 'anchor'. I'm not sure exactly what is going wrong, as anchor is already defined. I'm not sure what I'm doing wrong, but I have a hunch it's something simple to do with how the anchor is implemented. May I ask for some help please?

SafariJohn

  • Admiral
  • *****
  • Posts: 3010
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #6168 on: March 14, 2020, 04:04:25 AM »

Have you generated the hyperspace anchor?

EDIT: I see it allegedly generates one immediately. I would still call autogenerateHyperspaceJumpPoints() before I tried to do a hyperspace beacon around the system.
« Last Edit: March 14, 2020, 04:07:11 AM by SafariJohn »
Logged

tomatopaste

  • Captain
  • ****
  • Posts: 306
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #6169 on: March 14, 2020, 05:17:32 PM »

How do I link to a custom shipsystem script in the .system file? My one extends BaseShipSystemScript, and implements DroneLauncherShipSystemAPI, and as far I can tell there is no CUSTOM value for the 'type' key. Thanks!
« Last Edit: March 14, 2020, 05:38:54 PM by tomatopaste »
Logged

Alex

  • Administrator
  • Admiral
  • *****
  • Posts: 23988
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #6170 on: March 14, 2020, 05:32:45 PM »

I'd suggest using type:"STAT_MOD" since that doesn't do anything and lets your script have full control. The script can be specified via "statsScript".
Logged

tomatopaste

  • Captain
  • ****
  • Posts: 306
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #6171 on: March 14, 2020, 09:59:58 PM »

I'd suggest using type:"STAT_MOD" since that doesn't do anything and lets your script have full control. The script can be specified via "statsScript".

Thanks for the reply - although I have yet more questions. In my modplugin, I assign the drones their AI with pickDroneAI, which passes DroneLauncherShipSystemAPI. If the ship system is of the STAT_MOD type, won't this break it? Is there a workaround, like using pickShipAI instead? This is important since the drone AI relies on being able to get the current state of the system's orders enum (RECALL, DEPLOY and ATTACK) from the passed DroneLauncherShipSystemAPI.
Logged

Alex

  • Administrator
  • Admiral
  • *****
  • Posts: 23988
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #6172 on: March 14, 2020, 10:03:01 PM »

If you're implementing your own, then there would be no DroneLauncherShipSystemAPI and no states - whatever you code up has to handle states etc. You would, I think, set the AI to what you need when manually spawning the drone.
Logged

tomatopaste

  • Captain
  • ****
  • Posts: 306
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #6173 on: March 14, 2020, 10:22:34 PM »

If you're implementing your own, then there would be no DroneLauncherShipSystemAPI and no states - whatever you code up has to handle states etc. You would, I think, set the AI to what you need when manually spawning the drone.

I see - oh well, thanks for the help :)
Logged

King Alfonzo

  • Admiral
  • *****
  • Posts: 679
  • -- D O C T O R --
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #6174 on: March 15, 2020, 01:01:18 AM »

Have you generated the hyperspace anchor?

EDIT: I see it allegedly generates one immediately. I would still call autogenerateHyperspaceJumpPoints() before I tried to do a hyperspace beacon around the system.

Put the code after the autogenerate and it worked like a charm. Many thanks Safari!

tomatopaste

  • Captain
  • ****
  • Posts: 306
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #6175 on: March 15, 2020, 01:25:34 AM »

How do I associate the drone the shipsystems spawns with the mothership, so that when getDroneSource() is called on the drone, it returns the ShipAPI instance of the mothership? basic java, heh
« Last Edit: March 15, 2020, 04:11:08 AM by tomatopaste »
Logged

Alex

  • Administrator
  • Admiral
  • *****
  • Posts: 23988
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #6176 on: March 15, 2020, 09:27:06 AM »

One other thing you want to do that's subtle in its effects:

drone.getAIFlags().setFlag(AIFlags.DRONE_MOTHERSHIP, 20000f, mothership);

If this isn't done, things will work, but enemy AI will be more distracted by the drones than it should be.
Logged

Zapper

  • Ensign
  • *
  • Posts: 2
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #6177 on: March 15, 2020, 02:11:19 PM »

Hi all, i am new to this game and have been playing for a few days now.
the only thing about this game that is bugging me is maintance supplys i do not like.
so i started looking for a way to change that. console command inf supply i tried first i do not like that because that to op.
 second thing i tried was editing the ship_data.csv file and edit the "AM"colum to all 0 this was oke until i got in a battle and could deploy every ship in my fleet including the AI becuase ZERO deployment cost followed by masive lag.
next atempt changing the skill fleet logistics second level modifier -25% maintance upkeep i want to change this to -95% and keep editing it untill its to my liking but here comes the my problem i can't get it to work i have spend the last 4 hours trying and you guys/girls are my last hope i have tried a lot but there is always a error apperently this is not a easy change value like i am use to in game like HOI4, Skyrim, EU4, AOE2, Factorio. could you give me some advice on how to continue
Logged

tomatopaste

  • Captain
  • ****
  • Posts: 306
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #6178 on: March 15, 2020, 03:14:24 PM »

One other thing you want to do that's subtle in its effects:

drone.getAIFlags().setFlag(AIFlags.DRONE_MOTHERSHIP, 20000f, mothership);

If this isn't done, things will work, but enemy AI will be more distracted by the drones than it should be.

Do you mean
Code
ship.getAIFlags().setFlag(ShipwideAIFlags.AIFlags.DRONE_MOTHERSHIP, 20000.0f, (java.lang.Object)this.ship);
or per drone?
Logged

Alex

  • Administrator
  • Admiral
  • *****
  • Posts: 23988
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #6179 on: March 15, 2020, 04:59:51 PM »

Per drone, yeah.
Logged
Pages: 1 ... 410 411 [412] 413 414 ... 706