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 ... 449 450 [451] 452 453 ... 706

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

Originem

  • Purple Principle
  • Captain
  • ****
  • Posts: 430
  • Dancing like a boss.
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #6750 on: August 23, 2020, 12:35:30 AM »

how to directly render on campaign UI? I remember I have done it once but I forgot how I did it
Logged
My mods


N1MH

  • Ensign
  • *
  • Posts: 18
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #6751 on: August 23, 2020, 10:13:42 PM »

What's the equivalent of "BeamWeaponRangeBonus" for energy projectile weapons specifically?

And where can I find the other things? Things as in "BeamWeaponRangeBonus" and the one for energy projectiles.
Logged

Mondaymonkey

  • Admiral
  • *****
  • Posts: 777
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #6752 on: August 23, 2020, 10:50:04 PM »

What's the equivalent of "BeamWeaponRangeBonus" for energy projectile weapons specifically?

And where can I find the other things? Things as in "BeamWeaponRangeBonus" and the one for energy projectiles.

You should seek it in API. For the "BeamWeaponRangeBonus", you probably mean the one from  "stats.getBeamWeaponRangeBonus().modifyFlat" from advanced optics? So you should read MutableShipStatsAPI.java in starfarer.api\com\fs\starfarer\api\combat (that would be iside the .zip). And the answer is: getEnergyWeaponRangeBonus().

BTW, you can read an IntegratedTargetingUnit.java to see how it works.

EDIT: Hold on. I misread your post. You need only projectile energy range bonus? That would be harder, as getEnergyWeaponRangeBonus() is applied for all energy weapons, including beams. You should manually set range bonuses to different weapons in that case.

EDIT2: Or you can perform a trick. Modify getEnergyWeaponRangeBonus() and then give negative reverse bonus to getBeamWeaponRangeBonus() to return it to normal.
« Last Edit: August 23, 2020, 11:12:50 PM by Mondaymonkey »
Logged
I dislike human beings... or I just do not know how to cook them well.

Histidine

  • Admiral
  • *****
  • Posts: 4661
    • View Profile
    • GitHub profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #6753 on: August 23, 2020, 10:54:44 PM »

how to directly render on campaign UI? I remember I have done it once but I forgot how I did it
Like in here? You can do stuff with OpenGL in an every frame script's advance(), although using a campaign entity seems to be more recommended.
I dunno about stuff like menus though.
Logged

SafariJohn

  • Admiral
  • *****
  • Posts: 3010
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #6754 on: August 24, 2020, 06:18:13 PM »

Is settings.json only loaded once when the game opens?
Logged

Alex

  • Administrator
  • Admiral
  • *****
  • Posts: 23987
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #6755 on: August 24, 2020, 07:05:20 PM »

IIRC loaded twice - once when the launcher is starting up, and then one more time. It's not loaded again at any point once the game is up and running, though, if that's what you're asking.
Logged

N1MH

  • Ensign
  • *
  • Posts: 18
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #6756 on: August 25, 2020, 08:21:11 PM »

https://pastebin.com/ts8sdQGU

Anyone know why the flux part doesn't work? Kinda new to scripting.
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 #6757 on: August 26, 2020, 12:54:10 AM »

https://pastebin.com/ts8sdQGU

Anyone know why the flux part doesn't work? Kinda new to scripting.

I see a lone ";" on line 22. That is likely causing a crash. Try deleting that and see if it works as intended. I don't see anything else wrong from a once-over of it.
Logged

SafariJohn

  • Admiral
  • *****
  • Posts: 3010
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #6758 on: August 26, 2020, 08:44:38 AM »

The flux modification looks like it should work, it is just too small a change for you to eyeball it in-game. Try testing with 90% reduction instead of 10% to make sure it works.

BTW x1.1 does not quite cancel out x0.9. You need like x1.11, so 11 instead of 10 for your variable.

An empty statement (the lone semicolon) is harmless. You get crashes when you are missing semicolons. An IDE like Netbeans or Eclipse will stop you from making that mistake.

I suggest putting your comments above the relevant code because then you can tell what the code is meant to do before you read it. Also, your variable names and code layout are a little confusing. Other than that, looks like you are off to a good start at coding.
« Last Edit: August 26, 2020, 09:08:27 AM by SafariJohn »
Logged

Originem

  • Purple Principle
  • Captain
  • ****
  • Posts: 430
  • Dancing like a boss.
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #6759 on: August 26, 2020, 08:59:31 AM »

how to directly render on campaign UI? I remember I have done it once but I forgot how I did it
Like in here? You can do stuff with OpenGL in an every frame script's advance(), although using a campaign entity seems to be more recommended.
I dunno about stuff like menus though.
Thx!
Logged
My mods


Originem

  • Purple Principle
  • Captain
  • ****
  • Posts: 430
  • Dancing like a boss.
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #6760 on: August 26, 2020, 09:01:49 AM »

Is there any way to block the mouse input when the cursor is in some specific area?
I don't want to make fleet move to the place I clicked
Logged
My mods


Alex

  • Administrator
  • Admiral
  • *****
  • Posts: 23987
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #6761 on: August 26, 2020, 10:37:17 AM »

Not specifically - you'd have to somehow detect this and override the player fleet's movement destination. But it'd still interrupt things like a laid-in course etc. It sounds like you're trying to make a custom campaign-layer UI? That'll, unfortunately, pretty much have to be a bit clunky with these kinds of aspects.
Logged

Originem

  • Purple Principle
  • Captain
  • ****
  • Posts: 430
  • Dancing like a boss.
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #6762 on: August 26, 2020, 09:08:42 PM »

Not specifically - you'd have to somehow detect this and override the player fleet's movement destination. But it'd still interrupt things like a laid-in course etc. It sounds like you're trying to make a custom campaign-layer UI? That'll, unfortunately, pretty much have to be a bit clunky with these kinds of aspects.
Well, I think of a new way, not click it, just move the mouse over it and hold on for a second to trigger what I want.
Logged
My mods


BeyondTheHorizon

  • Commander
  • ***
  • Posts: 178
  • Grand Admiral of the Galactic Empire
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #6763 on: September 03, 2020, 07:13:03 PM »

Anyone know why each time I get the hull style with Global.getCombatEngine().getPlayerShip().getHullStyleId() gives me "MIDLINE", no matter the true style is HIGH_TECH or custom hull style.
Logged

Helixic

  • Ensign
  • *
  • Posts: 5
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #6764 on: September 05, 2020, 05:45:37 PM »

what's the difference between turrets and hardpoints?
Logged
Pages: 1 ... 449 450 [451] 452 453 ... 706