Fractal Softworks Forum

Please login or register.

Login with username, password and session length
Pages: 1 ... 146 147 [148] 149 150 ... 711

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

LazyWizard

  • Global Moderator
  • Admiral
  • *****
  • Posts: 1365
    • View Profile
    • GitHub Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #2205 on: March 21, 2015, 06:52:49 PM »

Could anyone help me with a problem of my own? When trying to edit ship_data.csv and make certain ships faster or slower or cheaper, it saves but doesn't update in-game. How do I make it update?

If you enable dev mode (in data/config/settings.json, or by using the console mod) you can press F8 in combat to reload all scripts and CSVs.


I create a FleetMember, put in the player's fleet, add crew (before that there is none) and then try to bring it to max CR by calling RepairTrackerAPI.setCR(RepairTrackerAPI.getMaxCR())... but it sets to 10%, while the real max CR is 70-something. I assume that something doesn't get updated and it still thinks it has 0 crew - how do I get around that?

I remember having problems with this in the past. I don't remember exactly what fixed it, but here's the code I use:
Code: java
    private static FleetMemberAPI addShipToFleet(String id, FleetMemberType type,
            CrewXPLevel level, CampaignFleetAPI fleet)
    {
        FleetMemberAPI ship = Global.getFactory().createFleetMember(type, id);
        fleet.getFleetData().addFleetMember(ship);

        fleet.getCargo().addCrew(level, (int) ship.getNeededCrew());
        ship.getStatus().repairFully();
        ship.getRepairTracker().setCR(ship.getRepairTracker().getMaxCR());
        ship.setStatUpdateNeeded(true);

        return ship;
    }

    // Elsewhere, after fleet is set up
    fleet.getCargo().addSupplies(fleet.getCargo().getSpaceLeft());
Logged

Alex

  • Administrator
  • Admiral
  • *****
  • Posts: 24146
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #2206 on: March 21, 2015, 11:18:59 PM »

(Side note: CampaignFleetAPI.setAIMode(true) will turn off crew requirements, supply use, etc. You can still set crew level, though.)
Logged

Talkie Toaster

  • Captain
  • ****
  • Posts: 259
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #2207 on: March 22, 2015, 06:06:10 AM »

Is it possible to add unremovable hull mods to a ship via script, or would that have to be done via making a new variant and setting them as built-in?
Logged

Zudgemud

  • Commander
  • ***
  • Posts: 225
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #2208 on: March 22, 2015, 10:37:29 AM »

Anyone know where I can find the most likely cause of the following error? I'm trying to make my mod work with the new market system and I'm rebuilding it based on mendocas Junkpirate mod, I assume I messed up with the labeling somewhere but I'm not too sure of where to look.

Code
15590 [Thread-11] INFO  sound.OooOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO  - Playing music with id [music-miscallenous_main_menu.ogg]
15674 [Thread-5] DEBUG com.fs.graphics.TextureLoader  - Loading [graphics/backgrounds/background4.jpg] as texture with id [graphics/backgrounds/background4.jpg]
25560 [Thread-5] ERROR com.fs.starfarer.combat.D  - java.lang.NullPointerException
java.lang.NullPointerException
at com.fs.starfarer.combat.entities.terrain.Planet.setSpec(Unknown Source)
at com.fs.starfarer.campaign.CampaignPlanet.applySpecChanges(Unknown Source)
at data.scripts.world.systems.tolp.generate(tolp.java:100)
at data.scripts.world.pnGen.generate(pnGen.java:30)
at data.scripts.pnModPlugin.initpn(pnModPlugin.java:19)
at data.scripts.pnModPlugin.onNewGame(pnModPlugin.java:28)
at com.fs.starfarer.campaign.save.CampaignGameManager.o00000(Unknown Source)
at com.fs.starfarer.title.OoOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO.dialogDismissed(Unknown Source)
at com.fs.starfarer.ui.do.dismiss(Unknown Source)
at com.fs.starfarer.ui.impl.O0oO.dismiss(Unknown Source)
at com.fs.starfarer.campaign.save.O0oO.actionPerformed(Unknown Source)
at com.fs.starfarer.ui.thisnew.super(Unknown Source)
at com.fs.starfarer.ui.H.processInput(Unknown Source)
at com.fs.starfarer.ui.V.o00000(Unknown Source)
at com.fs.starfarer.new.Òôo000(Unknown Source)
at com.fs.oOOO.oOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO.Ò00000(Unknown Source)
at com.fs.starfarer.combat.D.o00000(Unknown Source)
at com.fs.starfarer.StarfarerLauncher$2.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
25591 [Thread-11] INFO  sound.O  - Creating streaming player for music with id [music-miscallenous_main_menu.ogg]
25591 [Thread-11] INFO  sound.OooOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO  - Playing music with id [music-miscallenous_main_menu.ogg]
Logged

Alex

  • Administrator
  • Admiral
  • *****
  • Posts: 24146
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #2209 on: March 22, 2015, 02:35:26 PM »

Is it possible to add unremovable hull mods to a ship via script, or would that have to be done via making a new variant and setting them as built-in?

IICR you'd have to create a new hull (not a variant) to get built-in hullmods. It's not dynamic, though it probably could/should be.


@Zudgemund: Most likely, you're calling applySpecChanges() on a planet without having called getSpec().setXXXXX to actually init and make any changes to the planet spec.
Logged

Zudgemud

  • Commander
  • ***
  • Posts: 225
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #2210 on: March 22, 2015, 03:05:40 PM »

@Zudgemund: Most likely, you're calling applySpecChanges() on a planet without having called getSpec().setXXXXX to actually init and make any changes to the planet spec.

I *** love you!

(it worked)
Logged

Talkie Toaster

  • Captain
  • ****
  • Posts: 259
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #2211 on: March 22, 2015, 03:53:34 PM »

IICR you'd have to create a new hull (not a variant) to get built-in hullmods. It's not dynamic, though it probably could/should be.
Ah, thanks.
Logged

Solinarius

  • Lieutenant
  • **
  • Posts: 97
  • Wind. Fire. All that kind of thing!
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #2212 on: March 22, 2015, 07:07:26 PM »

I was reminiscing my first time playing, when I using that Gratuitous Space Pirates mod (I always loved the federation ships in that game!). I said to myself, "man it would be cool to incorporate those ships with the default pirate faction". So here I am, utterly confuzzled as to how I change pirate fleet composition. I mean, it looks like it should be easy to figure out just by poking around in the core files, but I'm still very unsure. It looks like it's all in "pirates.faction", in the "shipRoles" section. The fleets compositions as shown in several tutorials are not in that file.

Help? :(
Logged

Xanderzoo

  • Captain
  • ****
  • Posts: 342
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #2213 on: March 22, 2015, 07:10:31 PM »

Is there a way for the enemy to lose a mission when a certain ship of there's dies? I tried api.defeatOnShipLoss(), but it didn't seem to work.

I don't want to bug people, but I really need this answered.
Logged

Alex

  • Administrator
  • Admiral
  • *****
  • Posts: 24146
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #2214 on: March 22, 2015, 07:22:06 PM »

Is there a way for the enemy to lose a mission when a certain ship of there's dies? I tried api.defeatOnShipLoss(), but it didn't seem to work.

I don't want to bug people, but I really need this answered.

The way you're doing it should work. It requires the actual name of the ship (i.e. "ISS Unlikely to Survive"), and, looking at the code, should work for both sides.

Failing that, you can also add an every frame script to that mission and call CombatEngineAPI.endCombat(0f, FleetSide.PLAYER).


I was reminiscing my first time playing, when I using that Gratuitous Space Pirates mod (I always loved the federation ships in that game!). I said to myself, "man it would be cool to incorporate those ships with the default pirate faction". So here I am, utterly confuzzled as to how I change pirate fleet composition. I mean, it looks like it should be easy to figure out just by poking around in the core files, but I'm still very unsure. It looks like it's all in "pirates.faction", in the "shipRoles" section. The fleets compositions as shown in several tutorials are not in that file.

Help? :(

Yeah, it's the shipRoles section you want to change. The number is the weight - i.e. the higher it is, the more likely the ship is to show up in that faction's fleets. The fleet compositions you're probably talking about are outdated as of 0.65a.
Logged

Xanderzoo

  • Captain
  • ****
  • Posts: 342
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #2215 on: March 22, 2015, 07:26:07 PM »

All right, I'll try it again. Thanks.  :)

Edit: So... Yeah, I had an extra space. Yeah.  :-[
Logged

Solinarius

  • Lieutenant
  • **
  • Posts: 97
  • Wind. Fire. All that kind of thing!
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #2216 on: March 22, 2015, 09:24:12 PM »

Yeah, it's the shipRoles section you want to change. The number is the weight - i.e. the higher it is, the more likely the ship is to show up in that faction's fleets. The fleet compositions you're probably talking about are outdated as of 0.65a.

That's wicked! So many to choose from. Thanks, chief!
Logged

Az the Squishy

  • Captain
  • ****
  • Posts: 469
  • I'm but a woman with a pencil.
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #2217 on: March 23, 2015, 11:13:45 PM »

Hey, as some of you may know I'm working on a mod called Metelson Industries. It's meant to add more mining pods an such. And basically be my own attempt at making ships I'd like to see flying around an the like.

One of the features for the Vanilla campaign is that there's a small station orbiting around Corvus.
I've been trying to figure out a way to do this and one of the ways I thought of, was copying the corvus system-code and simply having it add in a station around Asharu- it needs some lovin', it's one of the first things anyone sees and it's nearly-always battered by pirates or some other bully :P -rather than duplicating it entirely.

But i'm wondering if there's another way of doing this. I'm working on the code and getting the files in the right places as well as makin' the ship files over the next few days. But I'm a bit at a loss of where to go and how to do some things.
« Last Edit: March 23, 2015, 11:26:40 PM by Azmond »
Logged

Zudgemud

  • Commander
  • ***
  • Posts: 225
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #2218 on: March 24, 2015, 04:05:47 AM »

Is there any way to continuously remove the visual damage that accumulates on a ship when you get hit during combat? Alternatively is there a way to not get this visual combat damage at all? The only way to do this that I could think of myself is to make a decorative sprite that basically covers the ship, though I'm not sure any mounted guns would be visible through that sprite.
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 #2219 on: March 24, 2015, 06:43:42 AM »

You can define custom damage decals in the hull_styles, just point to a blank image.
Logged
 
Pages: 1 ... 146 147 [148] 149 150 ... 711