LUS: StartTurn

LUS: StartTurn

Discuss Lua based Spring scripts (LuaUI widgets, mission scripts, gaia scripts, mod-rules scripts, scripted keybindings, etc...)

Moderator: Moderators

Post Reply
User avatar
FLOZi
MC: Legacy & Spring 1944 Developer
Posts: 6240
Joined: 29 Apr 2005, 01:14

LUS: StartTurn

Post by FLOZi »

Along the lines of StartMove and StopMove, feasible or not?

Seems like https://github.com/spring/spring/blob/d ... e.cpp#L591 (for example, no idea if it would be the best place) knows when a turn is happening:
  • would it be called too often to be engine-side call to unit script?
  • Is there overhead if the function is not used within any scripts?
  • Is the best solution to just use polling of heading/direction where required?
Such scripts (polling heading) existed even for OTA but were never terribly good imo.
Kloot
Spring Developer
Posts: 1867
Joined: 08 Oct 2006, 16:58

Re: LUS: StartTurn

Post by Kloot »

1) probably, units almost never travel in a straight line for more than a few frames because of waypoint spacing
2) yes, but marginal
3) how many units do you expect to be polling per frame, and how often do you need the exact heading per unit?
User avatar
FLOZi
MC: Legacy & Spring 1944 Developer
Posts: 6240
Joined: 29 Apr 2005, 01:14

Re: LUS: StartTurn

Post by FLOZi »

Knowing when a turn above a threshold began (similar to how exp callin works) would be sufficient. The purpose is for wheel steering animations and things like towed guns that can pivot, so potentially many units are involved but the accuracy is less important than knowing when to initiate.
Post Reply

Return to “Lua Scripts”