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 ... 7 8 [9] 10 11 ... 706

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

EnderNerdcore

  • Commander
  • ***
  • Posts: 172
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #120 on: January 13, 2013, 01:26:07 PM »

So question here. I tried to take a shortcut and simply call CombatEngineAPI:

Code
        public CombatEngineAPI engine;

However, it's always returning null (I know this because I nested a number of ifs to see what exactly I was getting a null pointer from, and it's this).
I was trying to keep all the code in this one java file, but it's looking like I might need to simply write the plugin file as you have there. Is this true, or is there some other way I can keep CombatEngineAPI from returning a null value?

All that line of code does is create an empty variable (if I wrote "public String warAndPeace;", I wouldn't automatically have the book's text assigned to that variable ;)). You need to get the engine the game is using, which is what the plugin does.
Got it. I'm lazy, apparently.  :)




In other news: Arg, why does TachyonLanceEffect have to be compiled code?  :(
Logged

LazyWizard

  • Global Moderator
  • Admiral
  • *****
  • Posts: 1363
    • View Profile
    • GitHub Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #121 on: January 13, 2013, 01:27:32 PM »

In other news: Arg, why does TachyonLanceEffect have to be compiled code?  :(

Check out starfarer.api.zip in starfarer-core, it has the source for that included.
Logged

EnderNerdcore

  • Commander
  • ***
  • Posts: 172
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #122 on: January 13, 2013, 02:17:16 PM »

In other news: Arg, why does TachyonLanceEffect have to be compiled code?  :(

Check out starfarer.api.zip in starfarer-core, it has the source for that included.
Holy crap, that's what I needed.

Hopefully final question for a while: is there a way to print out lines to the starsector.log file for debugging?
Logged

LazyWizard

  • Global Moderator
  • Admiral
  • *****
  • Posts: 1363
    • View Profile
    • GitHub Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #123 on: January 13, 2013, 02:27:39 PM »

In other news: Arg, why does TachyonLanceEffect have to be compiled code?  :(

Check out starfarer.api.zip in starfarer-core, it has the source for that included.
Holy crap, that's what I needed.

Hopefully final question for a while: is there a way to print out lines to the starsector.log file for debugging?

Not as far as I know, unfortunately.
Logged

Alex

  • Administrator
  • Admiral
  • *****
  • Posts: 23987
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #124 on: January 13, 2013, 08:02:02 PM »

Not as far as I know, unfortunately.

Where does stuff go if using System.out.println()? If that doesn't end up in the log, it should end up on the console - so if you run starsector.bat instead of the .exe, you should see its output in the console window the .bat pops up.
Logged

EnderNerdcore

  • Commander
  • ***
  • Posts: 172
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #125 on: January 14, 2013, 11:32:52 AM »

Is it possible to get the value for a ship's sight range? I can see how to find out the current bonus to the sight range, but not the actual sight range?

I ask because I'm trying to make a ship provide allied bonuses (and enemy debuffs) but would rather it do it only within its sight range rather than across the entire map.


On that same note, is it possible to have a ship system cause status messages to show up on the player's screen if the system is being used by another ship? Same system--it would be nice to tell the player that they are being debuffed by an enemy ship, or receiving buffs from a friendly AI-controlled ship.
Logged

Cycerin

  • Admiral
  • *****
  • Posts: 1665
  • beyond the infinite void
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #126 on: January 14, 2013, 02:16:33 PM »

How can I make a weapon animate in a different way than playing the animation over and over as long as the mouse button is held down? I'd like for the animation to play to completion after the weapon has fired a bullet and then rest at the initial frame until the next time it fires. Or at the very least, have the animation reset whenever a new round is fired.

E:
« Last Edit: January 14, 2013, 02:31:35 PM by Cycerin »
Logged

Romeo_One

  • Captain
  • ****
  • Posts: 393
  • "Let me do the german dance for you..."
    • View Profile
    • Rejection - The Fight for Unity
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #127 on: January 14, 2013, 03:00:54 PM »

That depends on the firerate of the weapon and the number of frames. You can time it so that the animation finishes after a bullet was fired and resets before a new one is fired.
Logged

Alex

  • Administrator
  • Admiral
  • *****
  • Posts: 23987
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #128 on: January 14, 2013, 04:50:48 PM »

Is it possible to get the value for a ship's sight range? I can see how to find out the current bonus to the sight range, but not the actual sight range?

I ask because I'm trying to make a ship provide allied bonuses (and enemy debuffs) but would rather it do it only within its sight range rather than across the entire map.

On that same note, is it possible to have a ship system cause status messages to show up on the player's screen if the system is being used by another ship? Same system--it would be nice to tell the player that they are being debuffed by an enemy ship, or receiving buffs from a friendly AI-controlled ship.

No, on both counts. Both make good candidates for the "hardcoded/not exposed, would be nice if was made moddable" list. Although the combat message widget is something I'm not happy with and would like to revisit extensively at some point, if I can.

How can I make a weapon animate in a different way than playing the animation over and over as long as the mouse button is held down? I'd like for the animation to play to completion after the weapon has fired a bullet and then rest at the initial frame until the next time it fires. Or at the very least, have the animation reset whenever a new round is fired.

You could either 1) sync up the animation with the rate of fire of the weapon - it's likely that it may get out of sync after a long time spent firing continuously, but has the virtue of being a simple solution, or 2) write a custom EveryFrameWeaponEffectPlugin to play the animation - probably based on weapon.getRemainingCooldown()/weapon.isFiring()/weapon.getAnimation().setFrame(int), etc.

Note that for #1, it should play through the entire animation cycle and eventually reset to the first frame, even if you only tap the mouse. If that's not happening, and you can send me a mod with a working example of that, I'll be happy to take a look.
Logged

EnderNerdcore

  • Commander
  • ***
  • Posts: 172
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #129 on: January 14, 2013, 05:10:19 PM »


As a workaround then, what is the maximum normal sight range on ships?
Logged

Alex

  • Administrator
  • Admiral
  • *****
  • Posts: 23987
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #130 on: January 14, 2013, 06:03:37 PM »

3000.
Logged

EnderNerdcore

  • Commander
  • ***
  • Posts: 172
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #131 on: January 14, 2013, 07:07:33 PM »

Awesome, thanks.

Also: I'm pretty sure there isn't, but is there a way to force a ship's AI to change targets?

Asking because I'm wondering if there is a way to force the AI to shoot a friendly besides temporarily switching the owner
Logged

Alex

  • Administrator
  • Admiral
  • *****
  • Posts: 23987
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #132 on: January 14, 2013, 07:10:57 PM »

No, there isn't.
Logged

Cycerin

  • Admiral
  • *****
  • Posts: 1665
  • beyond the infinite void
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #133 on: January 15, 2013, 02:30:56 AM »

You could either 1) sync up the animation with the rate of fire of the weapon - it's likely that it may get out of sync after a long time spent firing continuously, but has the virtue of being a simple solution, or 2) write a custom EveryFrameWeaponEffectPlugin to play the animation - probably based on weapon.getRemainingCooldown()/weapon.isFiring()/weapon.getAnimation().setFrame(int), etc.

Note that for #1, it should play through the entire animation cycle and eventually reset to the first frame, even if you only tap the mouse. If that's not happening, and you can send me a mod with a working example of that, I'll be happy to take a look.

The issue is that I want a chargeup time for the weapon, and the weapon starts animating while it's charging. That probably forces me to make a plugin... hmm. This is getting complicated.

Still great that the game supports this sort of thing already, though. Seriously.
Logged

Vinya

  • Captain
  • ****
  • Posts: 379
  • Vulgar at best...
    • View Profile
    • Mykyria Scifi/Zombie writing blog (Old site)
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #134 on: January 15, 2013, 02:52:18 PM »

Hey, how difficult would it be to have ballistics weapons have shell casings fly out and float off into space? I thought it would be a nice little detail to add...
Logged
If by "good guys" you mean "elitist regime that suppresses colonial independence and thrives off of an overwhelmingly deep gap in wealth between social classes," then yes.
Pages: 1 ... 7 8 [9] 10 11 ... 706