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: Unable to lock controls of fighters  (Read 1758 times)

Clockwork Owl

  • Admiral
  • *****
  • Posts: 790
    • View Profile
    • Starsector South Korean Community
Unable to lock controls of fighters
« on: May 29, 2017, 05:24:35 AM »

both noStrafing = TRUE on ship_systems.csv and ShipAPI.setControlsLocked(true); via script does not prevent a bomber from strafing near its target.
Logged

Alex

  • Administrator
  • Admiral
  • *****
  • Posts: 23986
    • View Profile
Re: Unable to lock controls of fighters
« Reply #1 on: May 29, 2017, 09:02:28 AM »

Yeah, pretty much a consequence of how fighters work. If you really need to lock their controls, you'd have to set their facing and velocity directly.
Logged

Clockwork Owl

  • Admiral
  • *****
  • Posts: 790
    • View Profile
    • Starsector South Korean Community
Re: Unable to lock controls of fighters
« Reply #2 on: May 29, 2017, 05:49:29 PM »

...How do I set the velocity, though?
Logged

Alex

  • Administrator
  • Admiral
  • *****
  • Posts: 23986
    • View Profile
Re: Unable to lock controls of fighters
« Reply #3 on: May 29, 2017, 06:09:41 PM »

ship.getVelocity().set(x, y) should do it.
Logged

Clockwork Owl

  • Admiral
  • *****
  • Posts: 790
    • View Profile
    • Starsector South Korean Community
Re: Unable to lock controls of fighters
« Reply #4 on: May 29, 2017, 09:24:59 PM »

It immediately ejects them to oblivion. :D

EDIT: Nevermind, I was doing it wrong XD Fixed. But the fighters are still strafing out of course.
« Last Edit: May 30, 2017, 03:49:51 AM by Aron0621 »
Logged