Fractal Softworks Forum

Please login or register.

Login with username, password and session length
Advanced search  

News:

Starsector 0.95.1a is out! (12/10/21); Blog post: Hyperspace Topography (10/12/22)

Pages: 1 ... 190 191 [192] 193 194 ... 637

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

King Alfonzo

  • Admiral
  • *****
  • Posts: 641
  • -- D O C T O R --
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #2865 on: July 08, 2016, 06:28:13 PM »

Code
...
3129 [Thread-4] INFO  com.fs.starfarer.loading.LoadingUtils  - Loading JSON from [C:\Program Files (x86)\Fractal Softworks\Starsector\starsector-core\data\variants\vigilance_Strike.variant]
3131 [Thread-4] INFO  com.fs.starfarer.loading.SpecStore  - Loading variant [C:\Program Files (x86)\Fractal Softworks\Starsector\starsector-core\..\mods\Lions Guard\data\variants\brawler\lg_brawler_Raider.variant]
3131 [Thread-4] INFO  com.fs.starfarer.loading.LoadingUtils  - Loading JSON from [C:\Program Files (x86)\Fractal Softworks\Starsector\starsector-core\..\mods\Lions Guard\data\variants\brawler\lg_brawler_Raider.variant]
3170 [Thread-7] INFO  com.fs.starfarer.loading.scripts.ScriptStore  - Class [data.missions.coralnebula.MissionDefinition] already loaded (perhaps from jar file, or due to a reference from another class), skipping compilation.
3183 [Thread-4] ERROR com.fs.starfarer.combat.CombatMain  - java.lang.RuntimeException: Ship hull spec [lg_brawler] not found!
java.lang.RuntimeException: Ship hull spec [lg_brawler] not found!
at com.fs.starfarer.loading.OO0O.o00000(Unknown Source)
at com.fs.starfarer.loading.SpecStore.super(Unknown Source)
at com.fs.starfarer.loading.specs.HullVariantSpec.<init>(Unknown Source)
at com.fs.starfarer.loading.SpecStore.ø00000(Unknown Source)
at com.fs.starfarer.loading.SpecStore.ø00000(Unknown Source)
at com.fs.starfarer.loading.ResourceLoaderState.init(Unknown Source)
at com.fs.state.AppDriver.begin(Unknown Source)
at com.fs.starfarer.combat.CombatMain.main(Unknown Source)
at com.fs.starfarer.StarfarerLauncher$1.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
...

It happens when you start up the game.

Histidine

  • Admiral
  • *****
  • Posts: 4124
    • View Profile
    • Bitbucket profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #2866 on: July 08, 2016, 06:44:20 PM »

Make sure you've deleted the lg_brawler entry in hull_data.csv and the lg_brawler.ship file if they're still there.

Other than that, best I can suggest at this point is to just throw up the mod zip somewhere and others can try debugging it.
Logged

King Alfonzo

  • Admiral
  • *****
  • Posts: 641
  • -- D O C T O R --
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #2867 on: July 08, 2016, 09:26:27 PM »

But there isn't any hull.csv nor .ship files at all.

Here's the mod pack. Give me a yell if it's inaccessable.

I just want this freaking done already - the Sindrians NEED this!

Originem

  • Purple Principle
  • Captain
  • ****
  • Posts: 405
  • Dancing like a boss.
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #2868 on: July 16, 2016, 07:59:05 AM »

BALLISTIC_AS_BEAM
This type of projectile.
How to use the custom texture type?
And are there other preset texture type aside from SMOOTH and TOUGH?
Logged
My mods


Alex

  • Administrator
  • Admiral
  • *****
  • Posts: 21225
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #2869 on: July 16, 2016, 08:05:48 AM »

Same as beams, add something like this to the .proj file:
"textureType":["graphics/fx/emp_arcs.png","graphics/fx/emp_arcs.png"]

That should work. The first one is the fringe, the second is the core.

The preset texture types are:

SMOOTH("graphics/fx/beamfringeb.png","graphics/fx/beamcoreb.png"),
MEDIUM("graphics/fx/beamfringec.png","graphics/fx/beamcorec.png"),
ROUGH("graphics/fx/beamfringe.png","graphics/fx/beamcore.png"),
CHUNKY("graphics/fx/beam_chunky_fringe.png","graphics/fx/beam_chunky_core.png"),
ROUGH2("graphics/fx/beam_rough2_fringe.png","graphics/fx/beam_rough2_core.png"),
WEAVE("graphics/fx/beam_weave_fringe.png","graphics/fx/beam_weave_core.png"),
LASER("graphics/fx/beam_laser_fringe.png","graphics/fx/beam_laser_core.png"),

Logged

Originem

  • Purple Principle
  • Captain
  • ****
  • Posts: 405
  • Dancing like a boss.
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #2870 on: July 16, 2016, 05:15:59 PM »

Same as beams, add something like this to the .proj file:
"textureType":["graphics/fx/emp_arcs.png","graphics/fx/emp_arcs.png"]

That should work. The first one is the fringe, the second is the core.

The preset texture types are:

SMOOTH("graphics/fx/beamfringeb.png","graphics/fx/beamcoreb.png"),
MEDIUM("graphics/fx/beamfringec.png","graphics/fx/beamcorec.png"),
ROUGH("graphics/fx/beamfringe.png","graphics/fx/beamcore.png"),
CHUNKY("graphics/fx/beam_chunky_fringe.png","graphics/fx/beam_chunky_core.png"),
ROUGH2("graphics/fx/beam_rough2_fringe.png","graphics/fx/beam_rough2_core.png"),
WEAVE("graphics/fx/beam_weave_fringe.png","graphics/fx/beam_weave_core.png"),
LASER("graphics/fx/beam_laser_fringe.png","graphics/fx/beam_laser_core.png"),


Thanks.
And seems like if proj's spawntype is BALLISTIC, texture type wont work?
Logged
My mods


joe130794

  • Commander
  • ***
  • Posts: 218
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #2871 on: July 19, 2016, 04:11:14 AM »

How can i let only specific ships spawn in the black markets?  :-\
Might be best to make your own version of the black market submarket and spawn the special ships you want in the code.

Hello everyone.

Can you advise me, how can I make a hullmods which would have produced fuel over time? And that while the number of produced fuel would depend on the distance to the nearest star, the closer to the star, the more fuel is produced.

If you already have mod which such already is realized, please show it to me as an example.

Thanks in advance for your help.

Quickly whipped up example hullmod code, untested:

Code: java
	public static final float BASE_DISTANCE = 100;
public static final float FUEL_PER_DAY = 2;
IntervalUtil interval = new IntervalUtil(0.25f,0.25f); // probably premature optimisation but meh

@Override
public void advanceInCampaign(FleetMemberAPI member, float amount) {
float days = Global.getSector().getClock().convertToDays(amount);
interval.advance(days);
if (interval.intervalElapsed()) {
CampaignFleetAPI fleet = member.getFleetData().getFleet();
LocationAPI loc = fleet.getContainingLocation();
if (loc == Global.getSector().getHyperspace()) return;

// NOTE: uses generics, will fail if using Janino runtime compiler
List<PlanetAPI> planets = loc.getPlanets(); // TODO check if this also gets the system primary, if not use getAllEntities instead
for (PlanetAPI planet : planets) {
if (!planet.isStar()) continue;

// TODO: consider examining the star specs (size, corona size, etc.) and multiplying fuel generation accordingly
// also being in the corona or a solar storm might increase fuel production
float distance = Misc.getDistance(planet.getLocation(), fleet.getLocation());
if (distance < 10) distance = 10; // div0 protection, keeps fuel production non-ridiculous when getting _really_ close
float fuelMult = BASE_DISTANCE/distance;

// TODO: modifying output by the hull size of the ship this hullmod is installed on is left as exercise to the reader
fleet.getCargo().addCommodity(Commodities.FUEL, FUEL_PER_DAY * fuelMult * interval.getIntervalDuration());
}
}
}

I'm finally getting round to doing some work on my mod after a while and I was just wondering how I would actually add this into the game.
I was hoping to use it on my Destiny in my stargate mod I'm working on so it can refuel near stars.
Logged

Alex

  • Administrator
  • Admiral
  • *****
  • Posts: 21225
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #2872 on: July 19, 2016, 07:59:01 AM »

And seems like if proj's spawntype is BALLISTIC, texture type wont work?

Correct.


I'm finally getting round to doing some work on my mod after a while and I was just wondering how I would actually add this into the game.
I was hoping to use it on my Destiny in my stargate mod I'm working on so it can refuel near stars.

I would *strongly* recommend implementing this as an EveryFrameScript, added at Sector-level, that does this for the player fleet only - or, perhaps, an active ability that, when used, grants this fuel.

The way this is set up is it will run for every single fleet member of every single fleet in every singe location; even with the "premature optimization" that seems like it'll be super heavy performance-wise.
Logged

joe130794

  • Commander
  • ***
  • Posts: 218
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #2873 on: July 19, 2016, 08:03:25 AM »

I was hoping to do it as a hull mod as it's only for 1 ship. I just have no idea how to add it to my mod.
Logged

Alex

  • Administrator
  • Admiral
  • *****
  • Posts: 21225
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #2874 on: July 19, 2016, 08:13:28 AM »

The advanceInCampaign method gets called for all ships, not just ones with the mod.

Actually, never mind, I'm wrong about that. Was thinking of the "void advanceInCampaign(CampaignFleetAPI fleet);" method.


Right, so: to add this a new hullmod to hull_mods.csv that points to this code, and then add the hullmod to a ship, and you should be good.

One more note: the mod effect script only gets instantiated once, meaning the "interval" data member would be shared between all ships that have this mode. That's not what you want, I'm assuming.

The way to get around that would be to use the SectorEntityToken.Map<String, Object> getCustomData() to store data specific to each fleet member. Basically, anything that you want to be a member variable would go in there instead.
Logged

joe130794

  • Commander
  • ***
  • Posts: 218
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #2875 on: July 19, 2016, 11:31:31 AM »

I tried adding it as a hullmod and set up the csv data but got this error and I'm not sure why if anyone can help.

Spoiler
31368 [Thread-4] ERROR com.fs.starfarer.combat.CombatMain  - java.lang.RuntimeException: Error compiling [data.hullmods.SolarRefuelling]
java.lang.RuntimeException: Error compiling [data.hullmods.SolarRefuelling]
   at com.fs.starfarer.loading.scripts.ScriptStore$3.run(Unknown Source)
   at java.lang.Thread.run(Unknown Source)
Caused by: java.lang.ClassNotFoundException: Parsing compilation unit 'data.hullmods.SolarRefuelling'
   at org.codehaus.janino.JavaSourceIClassLoader.findIClass(JavaSourceIClassLoader.java:172)
   at org.codehaus.janino.IClassLoader.loadIClass(IClassLoader.java:254)
   at org.codehaus.janino.JavaSourceClassLoader.generateBytecodes(JavaSourceClassLoader.java:214)
   at org.codehaus.janino.JavaSourceClassLoader.findClass(JavaSourceClassLoader.java:178)
   at java.lang.ClassLoader.loadClass(Unknown Source)
   at java.lang.ClassLoader.loadClass(Unknown Source)
   ... 2 more
Caused by: org.codehaus.commons.compiler.CompileException: File 'data/hullmods/SolarRefuelling.java', Line 1, Column 33: One of 'class interface' expected instead of 'float'
   at org.codehaus.janino.Parser.compileException(Parser.java:3125)
   at org.codehaus.janino.Parser.read(Parser.java:2839)
   at org.codehaus.janino.Parser.parsePackageMemberTypeDeclaration(Parser.java:266)
   at org.codehaus.janino.Parser.parseCompilationUnit(Parser.java:168)
   at org.codehaus.janino.JavaSourceIClassLoader.findCompilationUnit(JavaSourceIClassLoader.java:203)
   at org.codehaus.janino.JavaSourceIClassLoader.findIClass(JavaSourceIClassLoader.java:146)
   ... 7 more
[close]
Logged

Alex

  • Administrator
  • Admiral
  • *****
  • Posts: 21225
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #2876 on: July 19, 2016, 11:40:14 AM »

If you're looking for help with a compilation error, usually posting the full source is a good idea :)

That said: the other partial source you posted is using generics, so it's not going to work w/ Janino anyway. But that doesn't look like the error, so there's probably another issue.
Logged

joe130794

  • Commander
  • ***
  • Posts: 218
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #2877 on: July 19, 2016, 11:43:36 AM »

I thought I posted all the error parts. I don't even know what janino is.

But the code I quoted is what I tried to use.
Logged

Alex

  • Administrator
  • Admiral
  • *****
  • Posts: 21225
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #2878 on: July 19, 2016, 11:47:31 AM »

Ahh. From a comment in your code:
// NOTE: uses generics, will fail if using Janino runtime compiler  

I was assuming you'd written/read that.

You didn't post the full code for that file. It looks like the error is happening in a part you did not post.

(Edit: Wait. *Did* you actually post the full code for that file? If you did, there are... problems.)
Logged

joe130794

  • Commander
  • ***
  • Posts: 218
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #2879 on: July 19, 2016, 11:52:50 AM »

Oh. It was posted ages ago when someone asked about doing it and I thought I would try it. I'm not a good coder so just tried to implement it as is. In the quote I posted I thought was the entire code.
Logged
Pages: 1 ... 190 191 [192] 193 194 ... 637