Fractal Softworks Forum

Please login or register.

Login with username, password and session length
Pages: 1 ... 578 579 [580] 581 582 ... 710

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

Alex

  • Administrator
  • Admiral
  • *****
  • Posts: 24113
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #8685 on: April 22, 2022, 01:52:03 PM »

My initial guess would be some part of your build process not working and older code still running, but not being update with your changes - something along those lines.
Logged

Zaros426

  • Ensign
  • *
  • Posts: 3
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #8686 on: April 22, 2022, 03:15:14 PM »

Thank you for the quick answer Alex!
Logged

Yunru

  • Admiral
  • *****
  • Posts: 1560
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #8687 on: April 23, 2022, 01:52:48 AM »

I hate myself.
I checked the weapon file, because I'd run out of anything else it could be. It was still using the Shock Repeater's projectile rather than it's own.

Alex

  • Administrator
  • Admiral
  • *****
  • Posts: 24113
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #8688 on: April 23, 2022, 08:47:41 AM »

Ouch! At least you finally found it :)
Logged

AsianGamer

  • Ensign
  • *
  • Posts: 11
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #8689 on: April 23, 2022, 09:36:54 PM »

Hey, I'm looking to create a mod where you complete some missions that cause a new faction to be created (Nova Maxios becoming the Maxios Charter again). Where should I start? Can I have the group of missions trigger after the main storyline? Thanks in advance.
Logged

Sincronic

  • Ensign
  • *
  • Posts: 21
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #8690 on: April 23, 2022, 09:55:46 PM »

I need mini help with making a hullmod

Trying to make mass of ship lower by % of its base mass, but i'm not sure how to do it.
What i have tried is this:

Code
    @Override
    public void applyEffectsAfterShipCreation(HullSize hullSize, ShipAPI ship, String id) {
            ship.setMass(ship.getMass() - (ship.getMass() * (Float) MASS_REDUCTION.get(hullSize) / 100f));
}

But this didn't work, i've read somewhere stat changes should go into "before" function but since there is no stats.mass thing, i tried adding ShipAPI ship there and slapping line there, didn't work either. Is there some simple way to do this or do i have to it in advanceInCombat function?

Spoiler
I never coded in java before, and i'm using notepad to do this, so i can't debug at all, sorry  ::) I did manage to make like 10 hullmods so far though so, as long as it works lol
[close]
Logged

presidentmattdamon

  • Commander
  • ***
  • Posts: 249
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #8691 on: April 24, 2022, 12:33:31 AM »

is there a way to use VisualPanelAPI.showCustomPanel and VisualPanelAPI.showFleetMemberInfo to show both a custom panel and a fleet member info? i'm trying to show an image like so:



except with the weapons on the ship still. the way it currently works is by grabbing the fleet member's hullspec's sprite. i also get the nice background too if i was able to use showFleetMemberInfo.

the only other alternative is using Global.getFactory().createCustomPanel(), but i'm not sure if there's a way to remove custom panels at all.
Logged

SirHartley

  • Global Moderator
  • Admiral
  • *****
  • Posts: 840
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #8692 on: April 24, 2022, 01:23:03 AM »

so I got a FleetAssignmentAI that is supposed to make a fleet go to a planet, orbit it, run a script, then return to the player.

However, the fleet appears to get stuck in the system it is in after orbiting the planet, and does not leave.
There is no real reason that I can see.

Am I missing something?
Thanks!

Code: java
    @Override
    protected void pickNext() {
        if (fleet.getAI() == null) return;
        IndEvo_modPlugin.log("Transport Detachment AI setting up");

        if(!cargoTransferScript.finished){
            checkOrCorrectMarket();
            MarketAPI market = Global.getSector().getEconomy().getMarket(targetMarketId);

            fleet.addFloatingText("Heading to " + market.getName(), fleet.getFaction().getBaseUIColor(), 1f);

            fleet.addAssignment(FleetAssignment.GO_TO_LOCATION, market.getPrimaryEntity(), ASSIGNMENT_DURATION_FOREVER, "Delivering cargo to " + market.getName());
            fleet.addAssignment(FleetAssignment.ORBIT_PASSIVE, market.getPrimaryEntity(), ASSIGNMENT_DURATION_3_DAY, "Unloading Cargo", cargoTransferScript);
        }

        fleet.addAssignment(FleetAssignment.GO_TO_LOCATION, Global.getSector().getPlayerFleet(), ASSIGNMENT_DURATION_FOREVER, "Returning to main force", new Script() {
            @Override
            public void run() {
                FleetUtils.mergeFleetWithPlayerFleet(fleet);
            }
        });
    }
Logged

theDragn

  • Captain
  • ****
  • Posts: 307
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #8693 on: April 24, 2022, 05:31:53 PM »

Where does the code for the venting graphics hide? Or is it obfuscated?

SafariJohn

  • Admiral
  • *****
  • Posts: 3021
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #8694 on: April 24, 2022, 05:57:10 PM »

Obfuscated.
Logged

Alex

  • Administrator
  • Admiral
  • *****
  • Posts: 24113
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #8695 on: April 25, 2022, 11:03:42 AM »

Hey, I'm looking to create a mod where you complete some missions that cause a new faction to be created (Nova Maxios becoming the Maxios Charter again). Where should I start? Can I have the group of missions trigger after the main storyline? Thanks in advance.

Hmm, this is too big a question to really handle here, I think? I'd suggest looking at some existing missions (see: the com.fs.starfarer.api.impl.campaign.missions package) and then asking more specific questions; that might be the best way to go.

is there a way to use VisualPanelAPI.showCustomPanel and VisualPanelAPI.showFleetMemberInfo to show both a custom panel and a fleet member info? i'm trying to show an image like so:

Hmm - I don't believe so, no. Your best bet would probably be to try to show the fleet member info in the custom panel on your own, without using showFleetMemberInfo().

so I got a FleetAssignmentAI that is supposed to make a fleet go to a planet, orbit it, run a script, then return to the player.

However, the fleet appears to get stuck in the system it is in after orbiting the planet, and does not leave.
There is no real reason that I can see.

Am I missing something?

Nothing jumps out as being wrong. I'd suggest maybe trying to debug the state the fleet is in - adding a script that prints out its current assignment and its data (time remaining etc), that kind of thing.
Logged

presidentmattdamon

  • Commander
  • ***
  • Posts: 249
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #8696 on: April 25, 2022, 11:30:25 AM »

is there a way to use VisualPanelAPI.showCustomPanel and VisualPanelAPI.showFleetMemberInfo to show both a custom panel and a fleet member info? i'm trying to show an image like so:

Hmm - I don't believe so, no. Your best bet would probably be to try to show the fleet member info in the custom panel on your own, without using showFleetMemberInfo().

unfortunately there's no way to get stuff like the weapons or the background that showFleetMemberInfo provides. the easiest way would be a way to hide/remove a panel that has been created, but if there's no way then i'll just stick with displaying the ship's sprite.
Logged

Yunru

  • Admiral
  • *****
  • Posts: 1560
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #8697 on: April 27, 2022, 04:21:19 AM »

Is there a way to alter how much damage the AI thinks a weapon would do?
I know the AI can't see scripted damage, but is there a way to say "this does X more damage than it's listed damage"?

SirHartley

  • Global Moderator
  • Admiral
  • *****
  • Posts: 840
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #8698 on: April 27, 2022, 10:55:30 AM »

so, I tried the
so I got a FleetAssignmentAI that is supposed to make a fleet go to a planet, orbit it, run a script, then return to the player.

However, the fleet appears to get stuck in the system it is in after orbiting the planet, and does not leave.
There is no real reason that I can see.

Am I missing something?
Thanks!

Code: java
   code

so, I tried that exact same thing with a purely vanilla assignment AI, and I suspect it might actually be a vanilla problem.

I made a test mod for you to replicate this.
Only thing required is that you are in a different system than Askonia, and load into the game with the mod enabled.

it'll spawn a fleet that goes to cruor, orbits it for a day, and should then return - but actually gets stuck in-system for no discernible reason.

Hoping to get this resolved, if not now, at least in the next version :)

[attachment deleted by admin]
Logged

theDragn

  • Captain
  • ****
  • Posts: 307
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #8699 on: April 27, 2022, 03:08:32 PM »

Is there a way to alter how much damage the AI thinks a weapon would do?
I know the AI can't see scripted damage, but is there a way to say "this does X more damage than it's listed damage"?

Yes, but it's a bit complicated- Use an onFireEffect to increase the projectile's damage so that it properly represents the scripted damage it deals, then reduce it back down to the original value when it actually deals damage using a listener.
Pages: 1 ... 578 579 [580] 581 582 ... 710