Fractal Softworks Forum

Please login or register.

Login with username, password and session length
Pages: 1 ... 311 312 [313] 314 315 ... 710

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

kazi

  • Admiral
  • *****
  • Posts: 714
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #4680 on: July 06, 2019, 04:07:11 PM »

How do you spawn a system bounty? Been trying to figure this one out for awhile and making no progress. As far as I can tell, every system has a SystemBountyManager which spawns the events, but I can't figure out how to get the SystemBountyManager for a given system.
Logged

Alex

  • Administrator
  • Admiral
  • *****
  • Posts: 24114
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #4681 on: July 06, 2019, 04:09:07 PM »

Quick example for starting a system bounty from Jangala; this is from CoreLifecyclePluginImpl:

Code: java
MarketAPI jangala = Global.getSector().getEconomy().getMarket("jangala");
if (jangala != null) {
SystemBountyManager.getInstance().addOrResetBounty(jangala);
}

(Edit: to clarify, there's a single system bounty manager for all system bounties, hence SystemBountyManager.getInstance())
Logged

kazi

  • Admiral
  • *****
  • Posts: 714
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #4682 on: July 06, 2019, 04:10:53 PM »

Wow. Thanks for the fast response! Going to try this out....  ;)

*edit - works.  ;D
« Last Edit: July 06, 2019, 04:38:57 PM by kazi »
Logged

Originem

  • Purple Principle
  • Captain
  • ****
  • Posts: 430
  • Dancing like a boss.
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #4683 on: July 07, 2019, 06:19:28 AM »

Hmm - one possibility is that you need to specify the location of the native dll files in the debug configuration, something like:

-Djava.library.path=<path to where the various LWJGL dll files are>

(Not at my work computer, or I'd be a bit more precise.)

Another possibility is needing to install OpenAL on your system; sometimes the one that comes with the game just won't get picked up for windows reasons. The installer for that is here: https://www.openal.org/downloads/

I have to say I try all I could but nothing worked....
FINE I could debug correctly now.
I downloaded an OpenAL64.dll and put it into folder system32(There has OpenAL32.dll), then everything returned to the correct order.
I found that
Code: java
public static void create(String deviceArguments, int contextFrequency, int contextRefresh, boolean contextSynchronized, boolean openDevice) throws LWJGLException {
        if (created) {
            throw new IllegalStateException("Only one OpenAL context may be instantiated at any one time.");
        } else {
            String libname;
            String[] library_names;
            switch(LWJGLUtil.getPlatform()) {
            case 1:
                libname = "openal";
                library_names = new String[]{"libopenal64.so", "libopenal.so", "libopenal.so.0"};
                break;
            case 2:
                libname = "openal";
                library_names = new String[]{"openal.dylib"};
                break;
            case 3:
                if (Sys.is64Bit()) {
                    libname = "OpenAL64";
                    library_names = new String[]{"OpenAL64.dll"};
                } else {
                    libname = "OpenAL32";
                    library_names = new String[]{"OpenAL32.dll"};
                }
                break;
            default:
                throw new LWJGLException("Unknown platform: " + LWJGLUtil.getPlatform());
            }

            String[] oalPaths = LWJGLUtil.getLibraryPaths(libname, library_names, AL.class.getClassLoader());
            LWJGLUtil.log("Found " + oalPaths.length + " OpenAL paths");
            String[] arr$ = oalPaths;
            int len$ = oalPaths.length;
            int i$ = 0;

            while(i$ < len$) {
                String oalPath = arr$[i$];

                try {
                    nCreate(oalPath);
                    created = true;
                    init(deviceArguments, contextFrequency, contextRefresh, contextSynchronized, openDevice);
                    break;
                } catch (LWJGLException var13) {
                    LWJGLUtil.log("Failed to load " + oalPath + ": " + var13.getMessage());
                    ++i$;
                }
            }

            if (!created && LWJGLUtil.getPlatform() == 2) {
                nCreateDefault();
                created = true;
                init(deviceArguments, contextFrequency, contextRefresh, contextSynchronized, openDevice);
            }

            if (!created) {
                throw new LWJGLException("Could not locate OpenAL library.");
            }
        }
    }
Lwjdl is doing such thing, but why it works well in normal game but not in the IDEA
« Last Edit: July 07, 2019, 06:49:43 AM by Originem »
Logged
My mods


Alex

  • Administrator
  • Admiral
  • *****
  • Posts: 24114
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #4684 on: July 07, 2019, 08:00:23 AM »

Wow. Thanks for the fast response! Going to try this out....  ;)

*edit - works.  ;D

Awesome :)


Lwjdl is doing such thing, but why it works well in normal game but not in the IDEA

Windows can just be really weird about loading dlls sometimes...
Logged

Vayra

  • Admiral
  • *****
  • Posts: 627
  • jangala delenda est
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #4685 on: July 07, 2019, 09:30:24 PM »

Did we ever get a working "no_drop" tag or other method to prevent weapons from spawning as exploration content loot?
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: 24114
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #4686 on: July 07, 2019, 10:01:54 PM »

no_drop should do the job now, I believe - if you look in drop_groups, stuff is set up to be aware of that.
Logged

Vayra

  • Admiral
  • *****
  • Posts: 627
  • jangala delenda est
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #4687 on: July 07, 2019, 10:40:26 PM »

Awesome, thank you!
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

xenoargh

  • Admiral
  • *****
  • Posts: 5078
  • naively breaking things!
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #4688 on: July 08, 2019, 03:20:59 PM »

If a Skill has ScopeDescription.ALL_SHIPS, and more than one Officer in a CampaignFleetAPI has that Skill, does the Skill stack?
Logged
Please check out my SS projects :)
Xeno's Mod Pack

Alex

  • Administrator
  • Admiral
  • *****
  • Posts: 24114
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #4689 on: July 08, 2019, 03:34:21 PM »

ScopeDescription is just for the description. What affects the actual application of the effect is "type" in the .skill file, which for all ships would be ALL_SHIPS_IN_FLEET. However, skills with that type only apply when they're on the fleet commander, so: the skill won't stack and won't even apply once, if it's on an officer.
Logged

xenoargh

  • Admiral
  • *****
  • Posts: 5078
  • naively breaking things!
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #4690 on: July 08, 2019, 04:01:36 PM »

Ah!  Good!  I'll try and tackle Operation Make All Skills Give Fleet Bonuses, then, lol.  I wanna see if my theory pans out.
Logged
Please check out my SS projects :)
Xeno's Mod Pack

King Alfonzo

  • Admiral
  • *****
  • Posts: 683
  • -- D O C T O R --
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #4691 on: July 11, 2019, 05:13:50 AM »

A quick question - how do you add a specific ship/station to a fight from exploring a derelict? I've been trying to find the Mothership spawn code in the game files but I have been unsuccessful. Does it have to do with FleetMember, or some extra lines in the 'defender' area?

Alex

  • Administrator
  • Admiral
  • *****
  • Posts: 24114
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #4692 on: July 11, 2019, 08:30:41 AM »

For this one, it's actually just data, no code needed.

In salvage_entity_gen_data.csv, there's a "stationRole"column. For the mothership, it says "derelictMothership".

In derelict.faction, we've got:
"shipRoles":{
   "derelictMothership":{
      "station_derelict_survey_mothership_Standard":10,
   },
},

And that's it.

If you wanted to do something fancier, you could use a SalvageDefenderModificationPlugin (see: SalvageGenFromSeed). This is, for example, how the game handles increasing derelict defense strengths, and a couple of other special defenders (red planet, cryosleeper).
Logged

King Alfonzo

  • Admiral
  • *****
  • Posts: 683
  • -- D O C T O R --
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #4694 on: July 12, 2019, 08:02:35 PM »

Another question, except this time a bit more involved;

This is a script I used to give my GMDA ships a boost to stats above a certain flux threshold and when the ship is not overloaded. This is based off a script that Histidine wrote for me ages ago that I've since adapted. The code worked in 0.9, however as of 0.9.1a it no longer works, and I can't determine why. The only clue I have is the fact that the compiler required the String id section at the front to compile correctly, and since then the code doesn't work. I feel I'm overlooking something basic, but I lack the know-how to interpret. Could anyone lend me a hand please?
Spoiler
Code
    public void advanceInCombat(ShipAPI ship, String id) {
        if (ship.getFluxTracker().getFluxLevel() >= 0.65 && !ship.getFluxTracker().isOverloaded()){
            Global.getCombatEngine().maintainStatusForPlayerShip(SPEEDKEY, "graphics/icons/hullsys/temporal_shell.png",
                    "Bludknock Overdrive System Active",
                    "Increased Speed and Venting!",
                    false);
            ship.getMutableStats().getMaxSpeed().modifyMult(id, HIGH_SPEED_MOD);
            ship.getMutableStats().getFluxDissipation().modifyMult(id, HIGH_VENT_MOD);
            ship.getMutableStats().getAcceleration().modifyMult(id, HANDLING_MULT);
            ship.getMutableStats().getDeceleration().modifyMult(id, HANDLING_MULT);
            ship.getMutableStats().getMaxTurnRate().modifyMult(id, HANDLING_MULT);
            ship.getMutableStats().getTurnAcceleration().modifyMult(id, HANDLING_MULT);
        }
            if (ship.getFluxTracker().getFluxLevel() >= 0.65 && ship.getFluxTracker().isOverloaded()){
                ship.getMutableStats().getMaxSpeed().unmodifyMult(id);
                ship.getMutableStats().getFluxDissipation().unmodifyMult(id);
                ship.getMutableStats().getAcceleration().unmodifyMult(id);
                ship.getMutableStats().getDeceleration().unmodifyMult(id);
                ship.getMutableStats().getMaxTurnRate().unmodifyMult(id);
                ship.getMutableStats().getTurnAcceleration().unmodifyMult(id);

            }
            if (ship.getFluxTracker().getFluxLevel() < 0.65){
                ship.getMutableStats().getMaxSpeed().unmodifyMult(id);
                ship.getMutableStats().getFluxDissipation().unmodifyMult(id);
                ship.getMutableStats().getAcceleration().unmodifyMult(id);
                ship.getMutableStats().getDeceleration().unmodifyMult(id);
                ship.getMutableStats().getMaxTurnRate().unmodifyMult(id);
                ship.getMutableStats().getTurnAcceleration().unmodifyMult(id);}
    }
[close]
Pages: 1 ... 311 312 [313] 314 315 ... 710