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: Planet Search Overhaul (07/13/24)

Pages: 1 ... 717 718 [719] 720 721 ... 726

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

Ruddygreat

  • Admiral
  • *****
  • Posts: 551
  • Seals :^)
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #10770 on: June 06, 2024, 06:25:07 AM »

I'm not sure, not seeing any reason why .setLayer() wouldn't work.

I'm not sure why you'd need to move the ship through layers here, though. Wouldn't you want to render the portal on above/below ship layers while the ship remains on whatever layer it's on?

hmmmm, wierd
and I'm moving the ship between layers so that I'd be able to render a section of the battle's background sprite (in the example, where the white bit is, with the red bit being the "inside" of the portal) over the ship w/o covering other things that souldn't be covered, like ships / asteroids etc
« Last Edit: June 06, 2024, 07:38:02 AM by Ruddygreat »
Logged

Alex

  • Administrator
  • Admiral
  • *****
  • Posts: 24513
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #10771 on: June 06, 2024, 09:50:16 AM »

The order in which commands are processed in the same frame:
1. receive commands from the player
2. receive commands from AIPlugin
3. the player's ship processes commands from step 1 in advance()
4. all entities process commands from step 2 and step 5 in their respective advance()
5. receive commands from subclasses of BaseEveryFrameCombatPlugin
In step 3 / step 4, when the game detects a pause (isPause() returns true), isn't it just receiving commands but not executing them (discarding commands received per frame) until isPause() returns false.

It'll process some commands like toggling autofire while paused, which is something you could test. Other commands, IIRC just won't get queued up at all while the game is paused. I'm curious, what are you doing that all this stuff actually matters?

and I'm moving the ship between layers so that I'd be able to render a section of the battle's background sprite (in the example, where the white bit is, with the red bit being the "inside" of the portal) over the ship w/o covering other things that souldn't be covered, like ships / asteroids etc

Ahh, that makes sense, yeah. Hm.

Aha! So what's happening is you need to trigger a refresh of the ship's layers - the renderer only checks what layers the ship is in once, when the ship is added to the engine. To trigger a refresh, you could:
ship.setPhased(true);
ship.setPhased(false);
After changing the layers, and that should do it!

No idea why changing the layer to be "above" would work - it seems like it also shouldn't, unless it was done before the ship was added to the engine.
Logged

Ruddygreat

  • Admiral
  • *****
  • Posts: 551
  • Seals :^)
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #10772 on: June 06, 2024, 09:56:33 AM »

oh yeah that fixed it completely, ty!

Alex

  • Administrator
  • Admiral
  • *****
  • Posts: 24513
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #10773 on: June 06, 2024, 09:58:10 AM »

Nice!
Logged

Stormy Fairweather

  • Captain
  • ****
  • Posts: 257
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #10774 on: June 07, 2024, 05:42:39 AM »

i bumped my max level to 20 in the settings (liked the idea of maxing out at 5 points per tree), does this nerf the amount of story points i gain at max level, and if so is there a way to have vanilla story point gain?

Logged

theDragn

  • Captain
  • ****
  • Posts: 325
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #10775 on: June 07, 2024, 09:25:08 AM »

i bumped my max level to 20 in the settings (liked the idea of maxing out at 5 points per tree), does this nerf the amount of story points i gain at max level, and if so is there a way to have vanilla story point gain?

Since higher levels need more XP and you get the same number of SP per level, yes, this will reduce the rate at which you gain SP at max level. There isn't an easy way to change this (you'd have to do some stuff with code to change XP curves iirc). There is a line in config to change story points per level, which could bring you closer to the original gain rate, but this would also affect all pre-max levels.

Killer of Fate

  • Admiral
  • *****
  • Posts: 1236
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #10776 on: June 07, 2024, 09:38:02 AM »

i bumped my max level to 20 in the settings (liked the idea of maxing out at 5 points per tree), does this nerf the amount of story points i gain at max level, and if so is there a way to have vanilla story point gain?
find the plugin that contains XP per level up values, replace said values per level to your desired amount. If you set them all to be the same after lvl 15, the amount of SP you'll gain will remain equal.

If you want to have this act as a mod, you'll have to use the "replace" thing in the mod settings... Ask others for that.

find lvl up plugin
Spoiler
[close]

change values here
Spoiler
[close]

NOW, I think two things are going to happen here. You can either just change the
"EXPONENT_BEYOND_MAX_SPECIFIED_LEVEL" to "1f", and it should be fine. Though I can't test this atm. That means that no matter what level you'll have after 15, you will always need the same amount of XP of 2 million.

If that won't work... I would try adding additional values after the lvl 15... But it should work, so don't worry about that.

If you want to turn that into a mod... Then you will need to use the "replace" function, but I'm assuming that's not your goal atm, and it's too complicated for me to explain now.
« Last Edit: June 07, 2024, 09:56:07 AM by Killer of Fate »
Logged

Stormy Fairweather

  • Captain
  • ****
  • Posts: 257
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #10777 on: June 07, 2024, 10:57:50 AM »

it was 1.1f. will try this and see how it feels, thanks.

edit - random followup question i didnt want to double post for... is there an easy way to stop the game from autosorting my stored ships?
« Last Edit: June 07, 2024, 11:49:14 PM by Stormy Fairweather »
Logged

Histidine

  • Admiral
  • *****
  • Posts: 4785
    • View Profile
    • GitHub profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #10778 on: June 08, 2024, 01:59:34 AM »

Trying to access the tags of the enemy fleet from combat engine. But the return value of fleet.getTags() seems to be an empty collection for the fleet obtained by someFleetMember.getFleetData().getFleet(); another mod that uses engine.getContext().getOtherFleet() also seems to not see the tags.
Fleet memory seems to be accessible as usual with my method, but getting the memory with update doesn't include the tags as it would in campaign.

Is this intentional? It breaks the Custom Battle Music mod which checks fleet tags to determine if a specific soundtrack should be played for that fleet.
Logged

Alex

  • Administrator
  • Admiral
  • *****
  • Posts: 24513
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #10779 on: June 08, 2024, 08:21:04 AM »

This is because during a battle, the other fleet is a faked-up "combined" fleet containing all of the ships from the opposing side, even if the opposing side has just one fleet. This faked up fleet gets the same memory - actually the same, not a copy - as the primary opposing fleet, "primary" meaning the one being interacted with. However, it wasn't getting any of its tags; changed it so that it copies the primary's tags over to the fake fleet.

In the meantime, you could very likely get the actual fleet through:
1) Iterating over the fleets in fleet.getBattle() and seeing which of them has the fleet member, or
2) Calling someFleetMember.getFleetCommanderForStats().getStats().getFleet() (checking the various results along the way for null - there are likely some circumstances where e.g. getFleetCommanderForStats() might be null, etc.)

Note: this is not the same as someFleetMember.getFleetCommanderForStats().getFleet() - that only works for non-commander officers, not the fleet commander.
Logged

Histidine

  • Admiral
  • *****
  • Posts: 4785
    • View Profile
    • GitHub profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #10780 on: June 11, 2024, 06:15:12 AM »

Thanks Alex.

New question: When does CombatEngineAPI.isCombatOver() return true? Notably I think it doesn't return true when exiting the game via the Esc menu ("Exit Campaign" or devmode win battle).

(I'm having an every frame combat plugin play music at the start of the battle then remove it at the end; the issue described above means that music will persist on return to main menu)
Logged

Alex

  • Administrator
  • Admiral
  • *****
  • Posts: 24513
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #10781 on: June 11, 2024, 07:44:08 AM »

Ah, yeah, isCombatOver() detects various "did the battle actually finish out" scenarios, like "all ships destroyed or retreating and a full retreat ordered", etc. It doesn't know/care about something forcing an exit e.g. the dialog.

What about using Global.getCurrentState() and detecting when that changes? I guess doing it in a combat script wouldn't work, hm. Honestly, not sure offhand how to approach this from within a combat script.
Logged

Stormy Fairweather

  • Captain
  • ****
  • Posts: 257
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #10782 on: June 11, 2024, 10:58:29 PM »

why is this character male? it is portrait46 listed as female in the independant.faction in the core files, and the mod that overwrites the default pic ONLY has the portrait files. i have checked the independant.faction in every mod i have installed, and none of them reference this portrait.

Spoiler
[close]
Logged

Alex

  • Administrator
  • Admiral
  • *****
  • Posts: 24513
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #10783 on: June 12, 2024, 10:41:23 AM »

(No idea, not really a question I can answer!)
Logged

Selfcontrol

  • Commander
  • ***
  • Posts: 134
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #10784 on: June 12, 2024, 05:31:26 PM »

Hello.

I have a question regarding several ship tags :

1. What does the FREIGHTER and TANKER tag does ? I understand that the CIVILIAN tag prevents the AI from deploying (most of the times) civilian ships, but what about those 2 ? I'm suspecting they influence the distribution of those ships among fleets, but do they influence their chances of appearing on markets ?

2. What does the COMBAT tag do ? I understand how it influences some parameters (like combining the CARRIER and COMBAT tags). But what would it do if I would put in on a ship that also has the FREIGHTER, TANKER or CIVILIAN tag (or any combination of those tags) ? Would they appear more often on markets ? Would the AI deploy them more often ? Would they be more common among fleets ?
Logged
Pages: 1 ... 717 718 [719] 720 721 ... 726