Fractal Softworks Forum

Please login or register.

Login with username, password and session length
Pages: 1 ... 274 275 [276] 277 278 ... 711

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

Alex

  • Administrator
  • Admiral
  • *****
  • Posts: 24157
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #4125 on: December 17, 2018, 08:43:46 AM »

So if I understand right and I am reading the code correctly InteractionDialogAPI.setPlugin is what tells you core code what class to execute and the only classes it can execute are classes the implement InteractionDialogPlugin?

Those are the only classes that you can pass in as a parameter to setPlugin() and that will be called by the core interaction dialog code, yes.

OMG. So I was thinking about this as I was writing this. IF my logic is correct then InteractionDialogPlugin getPlugin() will pull the current plugin running in the core code?

Right - so for example when a command (such as BarCMD, or others) is called, getPlugin() will return a RuleBasedInteractionDialogPluginImpl, which is in API code.

Also, take a look at CoreCampaignPluginImpl.pickInteractionDialogPlugin() - that's where the initial plugin for interacting with a particular entity is picked. Generally, that's the plugin that'll get used for much of the interaction, though for some trickier things (such as bar events, salvage specials, salvage defender combat, etc) another plugin (or plugins) will be substituted temporarily.
Logged

Tartiflette

  • Admiral
  • *****
  • Posts: 3529
  • MagicLab discord: https://discord.gg/EVQZaD3naU
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #4126 on: December 17, 2018, 10:07:37 AM »

If I recall correctly, at some point during your work on the Stations you and David thought about having some "underside" decorative layer:



That's something I would be very interested in using but regular deco weapons are always drawn on top of the modules. So is there a trick to make it work or is that a feature that was entirely scrapped and removed?
Logged
 

Alex

  • Administrator
  • Admiral
  • *****
  • Posts: 24157
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #4127 on: December 17, 2018, 10:39:11 AM »

They were implemented as modules, not decorative weapons.

They had the following hints:
UNBOARDABLE, HIDE_IN_CODEX, UNDER_PARENT

UNDER_PARENT actually makes it render under all ships.

They also had the following built-in hullmods:
"builtInMods": [
        "reduced_explosion", # probably unnecessary
        "never_detaches",
        "anchorrotation", # depends on if you actually want it to rotate...
        "vastbulk" # probably unnecessary
    ],

I don't remember what made them not get hit by weapons fire, though - tried tracking this down but not having much luck.

If you added decorative weapons to this type of module, I *think* it would still get rendered on top of everything else.

(FWIW, we didn't end up doing this because all of our attempts at it made the stations too hard to "read" in combat.)
Logged

Tartiflette

  • Admiral
  • *****
  • Posts: 3529
  • MagicLab discord: https://discord.gg/EVQZaD3naU
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #4128 on: December 17, 2018, 10:42:37 AM »

Okay, too bad for my plans. I was looking at adding some support structure under my modules using deco weapons rather than having a full size station sprite for each three levels, and save some V-Ram.
Logged
 

Alex

  • Administrator
  • Admiral
  • *****
  • Posts: 24157
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #4129 on: December 17, 2018, 10:46:34 AM »

Hmm - this method was only really relevant for something that moves relative to the base, yeah.

As far as saving vram, yeah, this is pretty much why the various struts etc are not part of the "base" station sprites, to keep the size of those down while still letting the station spread out. In some cases, I think there's some "under" stuff baked into the base, just outside the collision bounds.
Logged

Vayra

  • Admiral
  • *****
  • Posts: 627
  • jangala delenda est
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #4130 on: December 17, 2018, 06:39:12 PM »

Okay, so say hypothetically (not hypothetically) I wanted to remove the core bounty script and replace it with my own as a part of a pirate start.

I've tried putting this in my ModPlugin:

Code
    @Override
    public void onGameLoad(boolean newGame) {
        if (!Global.getSector().getFaction(Factions.PIRATES).isHostileTo(Factions.PLAYER)) {
            for (EveryFrameScript s : PersonBountyManager.getInstance().getActive()) {
                Global.getSector().removeScript(s);
            }
            if (!Global.getSector().hasScript(KadurPersonBountyManager.class)) {
                Global.getSector().addScript(new KadurPersonBountyManager());
            }
        }
    }

And it doesn't work. I've tried putting the same thing in my rulecmd for the pirate start itself (just the if/for/if block, not the method declaration) and it still doesn't work. I load in and see a bunch of bounties for 'a notorious pirate' and the log still says they're being created by PersonBountyIntel, not KadurPersonBountyIntel.

What am I missing -- do I have the arguments right? Should I be calling it from somewhere else?

Also, as an aside, I notice the intel description for personal bounties is pulling from one of two places (either the script itself or reports.csv), which one of those is actually being used?
Logged
Kadur Remnant: http://fractalsoftworks.com/forum/index.php?topic=6649
Vayra's Sector: http://fractalsoftworks.com/forum/index.php?topic=16058
Vayra's Ship Pack: http://fractalsoftworks.com/forum/index.php?topic=16059

im gonna push jangala into the sun i swear to god im gonna do it

Alex

  • Administrator
  • Admiral
  • *****
  • Posts: 24157
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #4131 on: December 17, 2018, 06:53:33 PM »

What you really want to do is stop the core PersonBountyManager from creating bounties before it even starts.

So, either:
sector.removeScript(PersonBountyManager.getInstance()) in your onGameLoad()

Or, in settings.json:
"minPersonBounties":0,
"maxPersonBounties":0,

If you also want to clean up existing bounties, onGameLoad probably isn't the place to do it (since then saving and loading would change the save's state, which isn't great). But what you'd do is something like:

for (EveryFrameScript s : PersonBountyManager.getInstance().getActive()) {
    ((PersonBountyIntel)s).endImmediately();
}



Also, as an aside, I notice the intel description for personal bounties is pulling from one of two places (either the script itself or reports.csv), which one of those is actually being used?

reports.csv is no longer used for anything at all.
Logged

Vayra

  • Admiral
  • *****
  • Posts: 627
  • jangala delenda est
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #4132 on: December 17, 2018, 07:58:08 PM »

Alright, Alex to the rescue! I'll try it again.  :)
Logged
Kadur Remnant: http://fractalsoftworks.com/forum/index.php?topic=6649
Vayra's Sector: http://fractalsoftworks.com/forum/index.php?topic=16058
Vayra's Ship Pack: http://fractalsoftworks.com/forum/index.php?topic=16059

im gonna push jangala into the sun i swear to god im gonna do it

Harmful Mechanic

  • Admiral
  • *****
  • Posts: 1340
  • On break.
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #4133 on: December 18, 2018, 10:46:27 AM »

Here's a quick one; if you're using a custom phase cloak system, what's the best way to get the game to classify ships using it as phase ships in the doctrine and production interface? I've looked through the vanilla files for tags, etc. that would mark a ship that way.
Logged

Alex

  • Administrator
  • Admiral
  • *****
  • Posts: 24157
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #4134 on: December 18, 2018, 10:55:05 AM »

Oh, that's easy: there currently isn't one :) ... at least, that I'm aware of.

On my list for the .1 release!
Logged

MShadowy

  • Admiral
  • *****
  • Posts: 911
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #4135 on: December 18, 2018, 11:54:31 AM »

Quick question; is there a way to make it so that the player needs to have, say, a certain rep level before being able to build an industry?
Logged

Alex

  • Administrator
  • Admiral
  • *****
  • Posts: 24157
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #4136 on: December 18, 2018, 11:59:19 AM »

Yep - override the relevant methods from BaseIndustry in your Industry's class.

public boolean isAvailableToBuild();
public boolean showWhenUnavailable();
public String getUnavailableReason();

Logged

Vayra

  • Admiral
  • *****
  • Posts: 627
  • jangala delenda est
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #4137 on: December 18, 2018, 02:59:39 PM »

So, there's a way to add participating factions to the bounty manager:

Code
PersonBountyEventData.addParticipatingFaction(String factionId)

But there doesn't seem to be a way to remove them. Anything I'm missing?
Logged
Kadur Remnant: http://fractalsoftworks.com/forum/index.php?topic=6649
Vayra's Sector: http://fractalsoftworks.com/forum/index.php?topic=16058
Vayra's Ship Pack: http://fractalsoftworks.com/forum/index.php?topic=16059

im gonna push jangala into the sun i swear to god im gonna do it

Alex

  • Administrator
  • Admiral
  • *****
  • Posts: 24157
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #4138 on: December 18, 2018, 03:04:49 PM »

getParticipatingFactions().remove(factionId)

There ought to be a removexxx() method to make it cleaner, but this'll do the job.
Logged

Vayra

  • Admiral
  • *****
  • Posts: 627
  • jangala delenda est
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #4139 on: December 18, 2018, 03:18:29 PM »

Boy do I ever feel dumb right now. Thanks!
Logged
Kadur Remnant: http://fractalsoftworks.com/forum/index.php?topic=6649
Vayra's Sector: http://fractalsoftworks.com/forum/index.php?topic=16058
Vayra's Ship Pack: http://fractalsoftworks.com/forum/index.php?topic=16059

im gonna push jangala into the sun i swear to god im gonna do it
Pages: 1 ... 274 275 [276] 277 278 ... 711