Fractal Softworks Forum

Please login or register.

Login with username, password and session length
Advanced search  

News:

Starsector 0.97a is out! (02/02/24); New blog post: Simulator Enhancements (03/13/24)

Pages: 1 ... 272 273 [274] 275 276 ... 706

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

Morrokain

  • Admiral
  • *****
  • Posts: 2143
  • Megalith Dreadnought - Archean Order
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #4095 on: December 11, 2018, 09:31:17 PM »

Nope, it won't even read the mod when I change it. *Edit* I'm on windows, too.

\ is an escape character, try \\ for each one instead.

Just tried this:
"data\\hulls\\odyssey.ship",

and it seems to work.

Ah, yes that does work! Great!! :D

So, are you essentially saying this won't be fixed until 1.0? Or are you planning a smaller update cycle?
Oh, no no no. The next release will be 0.9.1a, with a *bunch* of bugfixes, balance tweaks, and so on. And there'll almost certainly be at least one (possibly more) release between *that* and 1.0.

That is good to know at worst case scenario it wouldn't be another year, though at least for now it seems like I can release this update anyway. :)
Logged

TrashMan

  • Admiral
  • *****
  • Posts: 1325
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #4096 on: December 12, 2018, 02:54:08 AM »

So I have a weapon with a really long chargup time - 9 seconds. During that time I want it to play an animation of power buildup with glows ad lighting and all that jazz.

Now, I know I can name the gun "test_gun_00.png" and add other images and if I define frames in the weapon file, it should play.
Does it works the same for the weapon glow? If i make "test_gun_glow00.png" will it work? Will it trigger duringhte charge phase or fire phase?

I'm worried because of the numbers of frame needed, since it's a BIG gun, so I'm looking into the most efficient method to achieve the effect.
Logged

Alex

  • Administrator
  • Admiral
  • *****
  • Posts: 23988
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #4097 on: December 12, 2018, 11:30:50 AM »

That one works for the main weapon sprite, it won't animate the glows the same way.

And, yeah, 9 seconds sounds like a lot of frames, especially for a large weapon. I'd probably recommend a script to spawn particles etc during chargeup, but someone more experienced with making these sorts of things might have better advice.
Logged

TrashMan

  • Admiral
  • *****
  • Posts: 1325
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #4098 on: December 12, 2018, 11:42:32 AM »

That one works for the main weapon sprite, it won't animate the glows the same way.

And, yeah, 9 seconds sounds like a lot of frames, especially for a large weapon. I'd probably recommend a script to spawn particles etc during chargeup, but someone more experienced with making these sorts of things might have better advice.

I'm trash at coding. Hopefully someone who knows what he's doing can help.
Logged

nox4041

  • Ensign
  • *
  • Posts: 5
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #4099 on: December 12, 2018, 02:20:12 PM »

Hello Everyone, this is my first time posting on the forums. Woot! :)

I am unsure if this should my its own post or I can add it here. Give this a try first.


Background
So first off I love the game so far so much so I wanted to add to it. I was thinking of doing something simple. I wanted to add new Bar events into the game. I notice that there is just a few and feel that I can make some fun missions and as time goes by I can even add multi-part missions and so on so forth. I am also thinking of creating a few missions the provide a more dynamic path to get blueprints and other special techs. I like the idea that you get a rumor about a space station that full of ancient tech but its ain a system full of {redeacted}. Rumors that the space pirates have found a [Cool BP] and they are trying to get it to [ System X]. YOu can then go and fight them for it. This kind of stuff would be a great addition to the game.

Technical Stuff
This is what I have found so far correct me where I may be wrong.

1. All of the Bar events are under api.impl.campaign.intel.bar. The BarEventManager is used to store all the event creators and then pick them as needed.

2. I also Understand that There are two scripts file for each event the event its self and the event creator. Still trying to figure out how to control when bar events fire off but I think that in the "Rules" but I have not looked that close yet.

3. The issue I have run into is that each event is loaded by CoreLifecyclePluginImpl (api\impl\campaign\CoreLifecyclePluginImpl.java). From my understanding, I will need to add each of my events to this file to be loaded into the game. The problem I see is per "Mod Structure & File Merging"  I would need to replace CoreLifecyclePluginImpl with my own version and it specifically recommends not doing this " Generally, only total conversions should replace the files specified above."

So my question is do I really need to replace CoreLifecyclePluginImpl with my own version to get my bar events to load or is there another place I can call the new events to be loaded into the manager?

Few Questions
I also have a few other questions.

Is there a way I can pull what blueprints the user currently has and then build a salvageable object with specific loot AKA "blueprint you do not have"? I kinda see this being done in api\impl\campaign\intel\bar\events\ScientistAICoreIntel.java with genLoot class that has been built.

How do I control when specific bar events fire off. I would like to add some mission that will let the play hunt down blueprints and other things of special value but I do not want these mission fire off until specific conditions are met like having a colony or a specific amount of credits?



PS. Thank you to anyone and everyone that can help!




Logged

Vayra

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

So my question is do I really need to replace CoreLifecyclePluginImpl with my own version to get my bar events to load or is there another place I can call the new events to be loaded into the manager?

How do I control when specific bar events fire off. I would like to add some mission that will let the play hunt down blueprints and other things of special value but I do not want these mission fire off until specific conditions are met like having a colony or a specific amount of credits?

Hey, I can sort of answer these questions: You don't need to override the thing! Create an EveryFrameScript or something like that, add it to the sector with .addScript, and you should be able to manage conditions for triggering a bar event in there. And you would trigger it by calling it like:

Code
PortsideBarData.getInstance().addEvent(new Kadur_RaiderBaseRumorBarEvent(this));

I do this for the crusader bases spawned by the Kadur faction in my mod, if you want to take a peek at the scripts -- link is in my sig.


EDIT: Also looking at CoreLifecyclePluginImpl, it's just a BaseModPlugin itself haha. So rather than override it, what you'd want to do is just have your own modplugin add various event management scripts for your events to the sector, like it's doing for the vanilla ones.
« Last Edit: December 12, 2018, 02:58:05 PM by Vayra »
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

Morrokain

  • Admiral
  • *****
  • Posts: 2143
  • Megalith Dreadnought - Archean Order
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #4101 on: December 13, 2018, 01:54:50 PM »

Another weird one...

When I replace this falcon.ship file in mod_info (and all the associated skin/variant files mapped to that ship) the game fails to start with a nullpointer.

Nullpointer:
Spoiler
2990 [Thread-4] INFO  com.fs.starfarer.loading.LoadingUtils  - Loading JSON from [ABSOLUTE_AND_CWD: null (data\hulls\skins\falcon_p.skin)]
2990 [Thread-4] INFO  com.fs.starfarer.loading.LoadingUtils  - Loading JSON from [DIRECTORY: C:\Program Files (x86)\Fractal Softworks\Starsector\starsector-core\..\mods\Archean Order TC v1.3.0 (data\hulls\skins\falcon_p.skin)]
3057 [Thread-4] ERROR com.fs.starfarer.combat.CombatMain  - java.lang.NullPointerException
java.lang.NullPointerException
   at com.fs.starfarer.loading.ShipHullSpecLoader.new(Unknown Source)
   at com.fs.starfarer.loading.ShipHullSpecLoader.Ó00000(Unknown Source)
   at com.fs.starfarer.loading.SpecStore.while(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)
[close]

File being replaced that causes the crash.
Spoiler
{
  "bounds": [
    109.5,
    29.5,
    108.5,
    11,
    50,
    11,
    50,
    -11,
    110,
    -10,
    110.5,
    -29,
    4,
    -66,
    -0.5,
    -74.5,
    -43,
    -74.5,
    -79.5,
    -42.5,
    -81,
    -11,
    -68,
    -7.5,
    -68,
    7.5,
    -79,
    11,
    -78,
    45,
    -48,
    89,
    -30.5,
    86.5,
    -26,
    72.5
  ],
  "builtInMods": [
    "dedicated_targeting_core"
,   "warp_conduit"  ],
  "center": [
    92,
    85.5
  ],
  "collisionRadius": 126.965546,
  "engineSlots": [
    {
      "angle": 180,
      "contrailSize": 64,
      "length": 80,
      "location": [
        -81.5,
        36
      ],
      "style": "MIDLINE",
      "width": 16
    },
    {
      "angle": 180,
      "contrailSize": 64,
      "length": 80,
      "location": [
        -83,
        25
      ],
      "style": "MIDLINE",
      "width": 16
    },
    {
      "angle": 180,
      "contrailSize": 64,
      "length": 80,
      "location": [
        -84,
        15
      ],
      "style": "MIDLINE",
      "width": 16
    },
    {
      "angle": 180,
      "contrailSize": 64,
      "length": 80,
      "location": [
        -84,
        -15
      ],
      "style": "MIDLINE",
      "width": 16
    },
    {
      "angle": 180,
      "contrailSize": 64,
      "length": 80,
      "location": [
        -83.5,
        -25.5
      ],
      "style": "MIDLINE",
      "width": 16
    },
    {
      "angle": 180,
      "contrailSize": 64,
      "length": 80,
      "location": [
        -82.5,
        -36
      ],
      "style": "MIDLINE",
      "width": 16
    }
  ],
  "height": 202,
  "hullId": "falcon",
  "hullName": "Falcon",
  "hullSize": "CRUISER",
  "shieldCenter": [
    5.5,
    -0
  ],
  "shieldRadius": 128.549606,
  "spriteName": "graphics/ships/rebalance/falcon/falcon_base.png",
  "style": "MIDLINE",
  "viewOffset": 0,
  "weaponSlots": [
    {
      "angle": 0,
      "arc": 5,
      "id": "WS 001",
      "locations": [
        -33.5,
        79
      ],
      "mount": "HARDPOINT",
      "size": "MEDIUM",
      "type": "MISSILE"
    },
    {
      "angle": 0,
      "arc": 5,
      "id": "WS 002",
      "locations": [
        33,
        -47
      ],
      "mount": "HARDPOINT",
      "size": "SMALL",
      "type": "MISSILE"
    },
    {
      "angle": 155,
      "arc": 190,
      "id": "WS 003",
      "locations": [
        -60.5,
        25
      ],
      "mount": "TURRET",
      "size": "SMALL",
      "type": "BALLISTIC"
    },
    {
      "angle": 205,
      "arc": 190,
      "id": "WS 004",
      "locations": [
        -60.5,
        -25
      ],
      "mount": "TURRET",
      "size": "SMALL",
      "type": "BALLISTIC"
    },
    {
      "angle": -30.963757,
      "arc": 207.219467,
      "id": "WS0003",
      "locations": [
        56,
        -20
      ],
      "mount": "TURRET",
      "size": "SMALL",
      "type": "BALLISTIC"
    },
    {
      "angle": 30.963757,
      "arc": 207.219467,
      "id": "WS0004",
      "locations": [
        56,
        20
      ],
      "mount": "TURRET",
      "size": "SMALL",
      "type": "BALLISTIC"
    },
    {
      "angle": 0,
      "arc": 360,
      "id": "LB 1",
      "locations": [
        27.5,
        44.5,
        35,
        38,
        44.5,
        37.5
      ],
      "mount": "HIDDEN",
      "size": "LARGE",
      "type": "LAUNCH_BAY"
    },
    {
      "angle": 0,
      "arc": 360,
      "id": "LB 2",
      "locations": [
        -36.5,
        -69,
        -22,
        -70,
        -9.5,
        -69
      ],
      "mount": "HIDDEN",
      "size": "LARGE",
      "type": "LAUNCH_BAY"
    },
    {
      "angle": -90,
      "arc": 159.984039,
      "id": "WS0002",
      "locations": [
        -30.5,
        -47.5
      ],
      "mount": "TURRET",
      "size": "SMALL",
      "type": "UNIVERSAL"
    },
    {
      "angle": 90,
      "arc": 159.984039,
      "id": "WS0005",
      "locations": [
        -30.5,
        47.5
      ],
      "mount": "TURRET",
      "size": "SMALL",
      "type": "UNIVERSAL"
    },
    {
      "angle": -45,
      "arc": 200.841431,
      "id": "WS0010",
      "locations": [
        15,
        -10
      ],
      "mount": "TURRET",
      "size": "SMALL",
      "type": "BALLISTIC"
    },
    {
      "angle": 45,
      "arc": 200.841431,
      "id": "WS0011",
      "locations": [
        15,
        10
      ],
      "mount": "TURRET",
      "size": "SMALL",
      "type": "BALLISTIC"
    },
    {
      "angle": 0,
      "arc": 6.025575,
      "id": "WS0007",
      "locations": [
        43.5,
        -0
      ],
      "mount": "HARDPOINT",
      "size": "LARGE",
      "type": "HYBRID"
    },
    {
      "angle": -60.945396,
      "arc": 180,
      "id": "WS0008",
      "locations": [
        -3.5,
        -42.5
      ],
      "mount": "TURRET",
      "size": "SMALL",
      "type": "UNIVERSAL"
    },
    {
      "angle": 60.945396,
      "arc": 180,
      "id": "WS0009",
      "locations": [
        -3.5,
        42.5
      ],
      "mount": "TURRET",
      "size": "SMALL",
      "type": "UNIVERSAL"
    },
    {
      "angle": -90,
      "arc": 0,
      "id": "WS0012",
      "locations": [
        -21.5,
        -68
      ],
      "mount": "HIDDEN",
      "size": "SMALL",
      "type": "SYSTEM"
    },
    {
      "angle": 56.309933,
      "arc": 0,
      "id": "WS0013",
      "locations": [
        34.5,
        44
      ],
      "mount": "HIDDEN",
      "size": "SMALL",
      "type": "SYSTEM"
    },
    {
      "angle": 0,
      "arc": 5,
      "id": "WS0001",
      "locations": [
        42,
        -35
      ],
      "mount": "HARDPOINT",
      "size": "SMALL",
      "type": "MISSILE"
    }
  ],
  "width": 184
}
[close]

It doesn't really give much indication where this is coming from, or at least where it seems to point to in the stack trace doesn't make sense to me. It seems to come from the falcon_p.skin file that was added in .9.

So here is that file:

Spoiler
{
   "baseHullId":"falcon",
   "skinHullId":"falcon_p",
   "hullName":"Falcon (P)",
   "descriptionId":"falcon",
   "descriptionPrefix":"This Falcon's propulsion system has been given impractical yet showy 'improvements' by some enthusiastic pirate crew; the patchwork of engine components, somehow persuaded to work toward ungainly common purpose, conform to zero safety standards.",
   "tags":[],
   "tech":"Pirate",
   "restoreToBaseHull":true,
   "baseValueMult":0.85,
   "spriteName":"graphics/ships/rebalance/falcon/falcon_pirates.png",
   "removeWeaponSlots":[],       # ids
   "removeEngineSlots":[],       # indices, as engine slots have no id in the .ship file
   "removeBuiltInMods":[],       # hullmod ids
   "removeBuiltInWeapons":[],       # weapon slot ids
   "weaponSlotChanges":{},
   "builtInMods":[],
   "builtInWeapons":{
    },
}
[close]

I don't see anything that would cause a nullpointer there unless "tech" does for some reason if the value is invalid. I would think that would just be for a string compare (so nullable) when choosing what variants to spawn.

I've made sure that these exist in their correct paths in the mod, and have their paths correct in the replace array in mod_info (minus hullmods):

 
  • falcon_pirates.png under: graphics/ships/rebalance/falcon/
  • falcon_base.png under: graphics/ships/rebalance/falcon/
  • falcon_Attack variant
  • falcon_CS variant
  • falcon_d_CS variant
  • falcon_p_Strike variant
  • falcon_xiv_Elite variant
  • falcon_xiv_Escort variant
  • warp_conduit hullmod
  • dedicated_targeting_core hullmod

For each variant other than the falcon_p_Strike, they would load correctly with the same ship file in .8

To ensure a proper control, the falcon_p_Strike variant was copied from an existing, vetted variant in .8 as well.


Am I missing variants or something? I can't figure out why it would throw a nullpointer only when being replaced. As long as the variants are also replaced and mapped to the same weapon mounts...
Logged

Alex

  • Administrator
  • Admiral
  • *****
  • Posts: 23988
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #4102 on: December 13, 2018, 02:31:12 PM »

This might be another "send me a small test mod" kind of issue :)

I suspect this is something to do with weapon ids in your replacement file, though - but given your falcon_p.skin replacement file, that doesn't look like it should matter.

(Also, might want to change restoreToBaseHull":true to false in your skin, since that's causing the "falcon(p) restores to regular falcon" bug.)
Logged

Morrokain

  • Admiral
  • *****
  • Posts: 2143
  • Megalith Dreadnought - Archean Order
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #4103 on: December 13, 2018, 03:57:06 PM »

This might be another "send me a small test mod" kind of issue :)

I suspect this is something to do with weapon ids in your replacement file, though - but given your falcon_p.skin replacement file, that doesn't look like it should matter.

(Also, might want to change restoreToBaseHull":true to false in your skin, since that's causing the "falcon(p) restores to regular falcon" bug.)

Ok thanks Ill get another mini mod going or just use the same one as before and take out the old files. That should work. I'll link it here when I'm done.
Logged

Morrokain

  • Admiral
  • *****
  • Posts: 2143
  • Megalith Dreadnought - Archean Order
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #4104 on: December 13, 2018, 05:02:08 PM »

Ok, remove:

"data\\hulls\\falcon.ship",

-From the replace array and the mod will start.

But, it may throw another error when variants show up for some reason, even though I've replaced all weapons and weapon files... so it may be related to that but I haven't had a chance to delve deeper into it yet.


https://www.dropbox.com/sh/x4e2o82j21b3dpk/AAB58nMhE8qpmSPJi0UUC6C8a?dl=0


*Edit* to make the mod as minimum as possible I also removed related mod wings from the variants and new hullmods the mod would introduce. Just fyi in case that helps.
Logged

Alex

  • Administrator
  • Admiral
  • *****
  • Posts: 23988
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #4105 on: December 13, 2018, 05:25:08 PM »

Hmm - so you've got "data/hulls/skins/falcon_p.skin", and a couple more cases of using / instead of \\ in the replace section.

This works on my end (due to the fix for detecting various separators better) but for now you've got to use \\ everywhere in the replace section.
Logged

Morrokain

  • Admiral
  • *****
  • Posts: 2143
  • Megalith Dreadnought - Archean Order
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #4106 on: December 14, 2018, 09:45:00 AM »

Hmm - so you've got "data/hulls/skins/falcon_p.skin", and a couple more cases of using / instead of \\ in the replace section.

This works on my end (due to the fix for detecting various separators better) but for now you've got to use \\ everywhere in the replace section.

Ok I'll try that then. I had thought that format works for non ship or weapon files but to be safe I should just move every line to that format for now.
Logged

MShadowy

  • Admiral
  • *****
  • Posts: 911
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #4107 on: December 14, 2018, 11:44:23 AM »

Okay, so it turns out my CAS beams stop stations from rotating which is not really desireable; as such I need to be able to get and alter their impact to 0 if they're hitting a station. Unfortunately I'm not sure how to get a weapons impact value through the API, anyone have any ideas how to do so?
Logged

Wyvern

  • Admiral
  • *****
  • Posts: 3786
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #4108 on: December 14, 2018, 11:56:02 AM »

...I've had stations rotate backwards for a bit after being rammed by an AI-controlled Odyssey.  Sometimes the Odyssey even survives.

As for impact from CAS beams: if you can't find a way to modify the impact, it might be possible to use an on-hit script to modify the station, instead, forcing its rotation values to correct.  Or maybe even just adding a zero-damage secondary hit with a negative impact?  Hm.  Possibilities to experiment with, I suppose.
Logged
Wyvern is 100% correct about the math.

Morrokain

  • Admiral
  • *****
  • Posts: 2143
  • Megalith Dreadnought - Archean Order
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #4109 on: December 14, 2018, 12:45:57 PM »

Hmm - so you've got "data/hulls/skins/falcon_p.skin", and a couple more cases of using / instead of \\ in the replace section.

This works on my end (due to the fix for detecting various separators better) but for now you've got to use \\ everywhere in the replace section.

Ok I'll try that then. I had thought that format works for non ship or weapon files but to be safe I should just move every line to that format for now.

Just wanted to pop on here and say that seemed to solve everything and now all the old .8 variants are clean and mapped correctly. :)

Time to start working on the new ones and adding the stations.

I'm going to post the full replace array in the modding resources section for anyone else who happens to be working on a TC. It took a while to get everything there so I may as well save others the time.
Logged
Pages: 1 ... 272 273 [274] 275 276 ... 706