Fractal Softworks Forum

Please login or register.

Login with username, password and session length
Pages: 1 ... 229 230 [231] 232 233 ... 710

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

xenoargh

  • Admiral
  • *****
  • Posts: 5078
  • naively breaking things!
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #3450 on: July 19, 2017, 12:06:17 PM »

Hmm.  But I'd have to apply during the ship-creation process, I'd think, so that it's not invasive to that UI. 

That means a special Hull Mod or thereabouts.  I'll look at that; maybe there's a weird workaround.
Logged
Please check out my SS projects :)
Xeno's Mod Pack

xenoargh

  • Admiral
  • *****
  • Posts: 5078
  • naively breaking things!
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #3451 on: July 19, 2017, 01:27:19 PM »

Hmm.  I can do this in combat, but, apparently, not in the Refit Weapon Group UI, where we're talking about a ShipVariantAPI, and there doesn't appear to be a method to:

A.  Get to the VariantAPI from the applyEffectsBeforeShipCreation()
B.  Go from there to removing the WeaponAPI from the Group(s).

I'm stumped, I think.  Everything else is working great, but the Weapon Group UI looks like this:



If I could push these Weapons to the bottom of the list or make them invisible, I'd be happy with this project.
Logged
Please check out my SS projects :)
Xeno's Mod Pack

Alex

  • Administrator
  • Admiral
  • *****
  • Posts: 24130
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #3452 on: July 19, 2017, 02:04:10 PM »

What if you set the weapon type to "SYSTEM", but keep the slot not hidden? That should keep the weapon damageable, and may (not 100% sure about this part) also remove it from the weapon dialog.
Logged

xenoargh

  • Admiral
  • *****
  • Posts: 5078
  • naively breaking things!
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #3453 on: July 19, 2017, 02:08:41 PM »

I'll look at that; I didn't try setting the Weapon's type.
Logged
Please check out my SS projects :)
Xeno's Mod Pack

xenoargh

  • Admiral
  • *****
  • Posts: 5078
  • naively breaking things!
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #3454 on: July 19, 2017, 02:17:20 PM »

No dice, unfortunately.  Thanks for the suggestion, though :)

It'd be nice if that type hid it; this is just a weird use case, though, where I want something to be acting largely as a point object, sans auto-fire AI (I wrote a custom AI into the AI mod to specifically handle these "weapons" that basically does nothing) but take damage so that it can pretend to be an EngineAPI.  Sorry for the hassle.
Logged
Please check out my SS projects :)
Xeno's Mod Pack

Alex

  • Administrator
  • Admiral
  • *****
  • Posts: 24130
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #3455 on: July 19, 2017, 02:24:50 PM »

Alright, try this:

1) Set the slot type in the ship file to DECORATIVE
2) Add "showDamageWhenDecorative":true to the .wpn file

As near as I can tell, that should make the weapon damageable but prevent it from showing up in groups.
Logged

Undefined

  • Ensign
  • *
  • Posts: 38
    • View Profile
    • Protector World
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #3456 on: July 20, 2017, 03:03:57 AM »

I have a QQ. I'm not all that experienced with Java as I've attempted to avoid it as much as possible but am a developer.
I'm currently attempting to hook into post battle loot generation to add a couple of new commodities after battle using an override of reportEncounterLootGenerated in a class which is extending BaseCampaignEventListener. All my other functions in that class are working fine but this one just seems to do nothing, not even outputting logging.
Is this the right place to do it?
If not, what would be a good method?
My mod is designed to run alongside Nexerelin so could this be causing the problem by generating loot a different way?

While I'm here an additional question before I get to the point of testing to discover.
I've added a hullmod which I intend to have dynamic effects based on a campaign level variable, is applyBeforeShipCreation the right place to have these adjustments where they'll be changed dynamically or should I also unapply and reapply the effects to all ships with that hullmod when the campaign variable changes?
My assumption is that these adjustments are applied before a battle and will use the current variable at that point to create the ship.

Thanks in advance for any advice. :)
Logged

Histidine

  • Admiral
  • *****
  • Posts: 4688
    • View Profile
    • GitHub profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #3457 on: July 20, 2017, 06:00:14 AM »

I have a QQ. I'm not all that experienced with Java as I've attempted to avoid it as much as possible but am a developer.
I'm currently attempting to hook into post battle loot generation to add a couple of new commodities after battle using an override of reportEncounterLootGenerated in a class which is extending BaseCampaignEventListener. All my other functions in that class are working fine but this one just seems to do nothing, not even outputting logging.
Is this the right place to do it?
reportEncounterLootGenerated is the right function.
Is your listener otherwise running (try adding another callin like reportPlayerOpenedMarket and see if any log messages appear)?
If not, I'd guess something is wrong with how the listener is being added to the sector; try posting the constructor and the code where it's called. (Also this seems unlikely to me, but try having the class implement EveryFrameScript if it doesn't already)
Logged

Undefined

  • Ensign
  • *
  • Posts: 38
    • View Profile
    • Protector World
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #3458 on: July 20, 2017, 06:47:18 AM »

Wow, such a facepalm stupid mistake moment, thanks a lot for the pointer, I realised my mistake when copying it to paste here.
Turns out I was actually attempting to add the class to the sector after a return so it was never actually being added.  ::)
Logged

Undefined

  • Ensign
  • *
  • Posts: 38
    • View Profile
    • Protector World
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #3459 on: July 20, 2017, 01:54:03 PM »

After getting this working I'm now getting a strange issue. Everything works as planned when starting a new game, however loading a game fails with the following:
-snip-

class[6] being mine. It seems to be related to the super variable permaRegister creating the listener, since if I flip that to false it works fine (though obviously my overrides then don't)
The process I'm employing is fairly simple to explain since I stripped it down to track down the issue:
in my basePlugin:
-snip-
then my stripped ArkManager class:
-snip-

Am I just being incredibly stupid?

edit: snipped code fragments for neatness, turns out yes I was being stupid and was attempting to do logging without setting it up correctly.
« Last Edit: July 21, 2017, 01:17:59 AM by Undefined »
Logged

xenoargh

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

Alright, try this:

1) Set the slot type in the ship file to DECORATIVE
2) Add "showDamageWhenDecorative":true to the .wpn file

As near as I can tell, that should make the weapon damageable but prevent it from showing up in groups.
Yay, this worked... with a proviso!

To query the state of the WeaponAPI and determine whether it's been knocked out, you need to use WeaponAPI.getCurrHealth(), rather than the boolean isDisabled() / isPermanentlyDisabled().  I figured I should document that little bit, as it was slightly obscure how that operates.

Thanks very much for helping me puzzle through this; it's such a minor thing but it'll really make this new feature of the Thruster FX system polished-feeling :)

Logged
Please check out my SS projects :)
Xeno's Mod Pack

Alex

  • Administrator
  • Admiral
  • *****
  • Posts: 24130
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #3461 on: July 20, 2017, 03:30:45 PM »

Nice! Ahh, interesting, so they do indeed take damage but don't get disabled due to being decorative (and also don't play disabled sounds/show disabled floating text/show repair glows/etc).
Logged

xenoargh

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

Right, and they ~do~ get repaired over time, which actually made this work right, thank goodness!
Logged
Please check out my SS projects :)
Xeno's Mod Pack

TrashMan

  • Admiral
  • *****
  • Posts: 1325
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #3463 on: July 22, 2017, 07:03:34 AM »

Well, adding the vanillas IonCannon effect doesn't really seem to do anything.

WHY CAN'T I MAKE AN AOE EMP SHOCKWAVE CANNON?
Logged

xenoargh

  • Admiral
  • *****
  • Posts: 5078
  • naively breaking things!
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #3464 on: July 22, 2017, 10:09:44 AM »

You totally can.  However, you'll need to write your own AOE system.  See Vacuum's SpecialShotBehaviors.java for an example.

That said, I really wish there was a generic call we could make in ShipAPI or in EveryFrameCombatPlugin where we could see damage events, no matter their source.
« Last Edit: July 22, 2017, 10:13:57 AM by xenoargh »
Logged
Please check out my SS projects :)
Xeno's Mod Pack
Pages: 1 ... 229 230 [231] 232 233 ... 710