Fractal Softworks Forum

Please login or register.

Login with username, password and session length

Author Topic: How do I run a script every frame on the main menu?  (Read 1587 times)

kazi

  • Admiral
  • *****
  • Posts: 714
    • View Profile
How do I run a script every frame on the main menu?
« on: December 06, 2015, 07:27:04 PM »

^see title
Logged

Alex

  • Administrator
  • Admiral
  • *****
  • Posts: 24114
    • View Profile
Re: How do I run a script every frame on the main menu?
« Reply #1 on: December 06, 2015, 07:32:24 PM »

Just dropping it into data.scripts.plugins ought to do the job.

It'll also run during all combat, though. If you check something like:
Global.getCombatEngine().isMission() && Global.getCombatEngine().getMissionId() == null
I *think* that'll only return true in the main menu.
Logged

kazi

  • Admiral
  • *****
  • Posts: 714
    • View Profile
Re: How do I run a script every frame on the main menu?
« Reply #2 on: December 06, 2015, 07:46:38 PM »

What type of script (like Script, EveryFrameScript, etc.) does it have to be?
« Last Edit: December 06, 2015, 08:02:12 PM by kazi »
Logged

Alex

  • Administrator
  • Admiral
  • *****
  • Posts: 24114
    • View Profile
Re: How do I run a script every frame on the main menu?
« Reply #3 on: December 06, 2015, 07:56:05 PM »

EveryFrameCombatPlugin.

Edit: see data.scripts.plugins.TestCombatPlugin for reference.
Logged

kazi

  • Admiral
  • *****
  • Posts: 714
    • View Profile
Re: How do I run a script every frame on the main menu?
« Reply #4 on: December 06, 2015, 08:15:02 PM »

Thanks, works like a charm.
Logged