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)

Author Topic: Can i run code -whenever- the player is on the character tab, or change it?  (Read 1355 times)

Darloth

  • Admiral
  • *****
  • Posts: 592
    • View Profile

EveryFramePlugin and CampaignInputListener both work in space, but are not run when the player is docked.

Is there anyway I can run code that always affects this screen?  I want to mess with aptitudes.

If the answer is no, can I turn aptitude points back on?

If that's also no, can I just disable people clicking the aptitude buttons somehow?
Logged

Alex

  • Administrator
  • Admiral
  • *****
  • Posts: 23986
    • View Profile

The answer to these is mostly "I don't think so".

Although, if you add an EveryFrameScript that returns true from runWhilePaused(), that should be running on this screen. But the screen would most likely not dynamically pick up changes made to character stats from a script - iirc it assumes it's the only one making changes at that point.
Logged

Darloth

  • Admiral
  • *****
  • Posts: 592
    • View Profile

As it happens it DOES pick up changes dynamically, which is great, except for the bug that the EveryFrameScript can't tell when the character screen is up when docked.

Until that's fixed I think I could maybe work around this by throwing efficiency to the wolves and updating the character's stats -every frame- (but let's not do that).

I posted this topic before LazyWizard helped me find that there was an actual bug tripping me up, because I had assumed I was doing it wrong.  I think once it's fixed I am actually attempting it the right way, so I'll just sit on my idea for now.  Thanks for looking anyway, and if anyone else has a better idea than an EveryFrameScript or CampaignInputListener that just checks when the player is on the character tab please do let me know.
Logged

Unreal_One

  • Ensign
  • *
  • Posts: 44
    • View Profile

It would be pretty hacky, but could you like do a sanity check to make sure everyone has the right number of skill points, aptitudes, etc and refund skill points spent on aptitudes/skills that you shouldn't have the aptitudes for on clicking confirm? That of course relies on some way to find out if the player just hit confirm on the character screen, which I haven't a clue about.
Logged