Fractal Softworks Forum

Please login or register.

Login with username, password and session length
Advanced search  
Pages: 1 ... 410 411 [412] 413 414 ... 467

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

Alex

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

Is station_small used for anything or is it just a test file? I've never encountered it but figured I'd ask to be sure before I remove it.

It's just for testing. I'm not sure if there are any hardcoded references to it in core code; I don't *think* so.
Logged

Morrokain

  • Admiral
  • *****
  • Posts: 1595
  • Megalith Dreadnought - Archean Order
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #6166 on: March 12, 2020, 06:17:22 PM »

It's just for testing. I'm not sure if there are any hardcoded references to it in core code; I don't *think* so.

Thanks! If it was referenced (as long as it wasn't actually spawned anywhere) that shouldn't cause any weirdness afaik so I shouldn't need to override it.
Logged

tomatopaste

  • Commander
  • ***
  • Posts: 105
  • Gentle Mann of Leisure
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #6167 on: March 13, 2020, 04:32:18 AM »


Can I override this message by getting the status key somehow? Would like to change this text since it is misleading with how I've changed the functionality of this system. Thanks :)
Logged

Alex

  • Administrator
  • Admiral
  • *****
  • Posts: 17419
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #6168 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

  • Commander
  • ***
  • Posts: 105
  • Gentle Mann of Leisure
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #6169 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: 579
  • -- D O C T O R --
    • View Profile
    • Email
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #6170 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: 1835
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #6171 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

  • Commander
  • ***
  • Posts: 105
  • Gentle Mann of Leisure
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #6172 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: 17419
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #6173 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

  • Commander
  • ***
  • Posts: 105
  • Gentle Mann of Leisure
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #6174 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: 17419
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #6175 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

  • Commander
  • ***
  • Posts: 105
  • Gentle Mann of Leisure
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #6176 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: 579
  • -- D O C T O R --
    • View Profile
    • Email
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #6177 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

  • Commander
  • ***
  • Posts: 105
  • Gentle Mann of Leisure
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #6178 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: 17419
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #6179 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
Pages: 1 ... 410 411 [412] 413 414 ... 467