Author Topic: LUA_FULL_CONTROLS - what is this supposed to do?  (Read 2368 times)

0 Members and 1 Guest are viewing this topic.

LUA_FULL_CONTROLS - what is this supposed to do?
Even after looking at some parts of the code I have no idea what LUA_FULL_CONTROLS is really good for and what it is supposed to do besides inexplicable messing up things. Same goes for LUA_ADDITIVE_BUTTON_CONTROL, LUA_OVERRIDE_BUTTON_CONTROL and LUA_STEERING_CONTROLS which don't seem to have any effect I was expecting.

So can someone help me?
Here goes scripting and copy paste coding
Freespace RTS Mod
Checkpoint/Shipsaveload script

 

Offline zookeeper

  • *knock knock* Who's there? Poe. Poe who?
  • 210
Re: LUA_FULL_CONTROLS - what is this supposed to do?
I've always been kinda fuzzy as to what the exact difference in behaviour between some of those is, but they allow you to control the player via the control info handle (which you can get via ba.getControlInfo()).

Code: [Select]
ba.setControlMode(LUA_FULL_CONTROLS)
ba.getControlInfo().ForwardCruise = 0.2

 

Offline Nuke

  • Ka-Boom!
  • 212
  • Mutants Worship Me
Re: LUA_FULL_CONTROLS - what is this supposed to do?
it lets you override joystick input and the like. things like the zoom scrip use it, and my cockpit script uses it for some fancy hotas features (reversing throttle and lateral/vertical thrusters), and hackish 6dof support. i should probibly try to use it to stream some of this imu data ive been playing with and use it to control things in freespace.

getControlInfo() gives you a control info handle, and you use that hanle to let wou tweak various input settings. im a little rusty about how it all works, but i think once you get the control info object most of the things in it are axis and button overrides. so yea you can do alternate interfaces, interface screws, etc with it.
« Last Edit: November 05, 2012, 06:25:56 pm by Nuke »
I can no longer sit back and allow communist infiltration, communist indoctrination, communist subversion, and the international communist conspiracy to sap and impurify all of our precious bodily fluids.

Nuke's Scripting SVN

 

Offline WMCoolmon

  • Purveyor of space crack
  • 213
Re: LUA_FULL_CONTROLS - what is this supposed to do?
I've always been kinda fuzzy as to what the exact difference in behaviour between some of those is, but they allow you to control the player via the control info handle (which you can get via ba.getControlInfo()).

Code: [Select]
ba.setControlMode(LUA_FULL_CONTROLS)
ba.getControlInfo().ForwardCruise = 0.2

:(

Code: [Select]
ba.ControlMode = LUA_FULL_CONTROLS
ba.ControlInfo.ForwardCruise = 0.2

Edit: The advantages of this approach are:
  • Reduces documentation creep (only one entry for get/set)
  • Reduces code creep (only one function needed for get/set)
  • Simplifies syntax
  • Removes question of error-checking
  • Generally speaking, you'll need to implement both set and get anyway

These are known as ADE_VIRTVAR, for coders who are adding to the Lua API.

If the operation may reasonably fail, you may have an argument for a function.
« Last Edit: November 10, 2012, 05:03:53 pm by WMCoolmon »
-C

 
Re: LUA_FULL_CONTROLS - what is this supposed to do?
The button part of control info is something I still don't get at all...

I've always been kinda fuzzy as to what the exact difference in behaviour between some of those is, but they allow you to control the player via the control info handle (which you can get via ba.getControlInfo()).

Code: [Select]
ba.setControlMode(LUA_FULL_CONTROLS)
ba.getControlInfo().ForwardCruise = 0.2

:(

Code: [Select]
ba.ControlMode = LUA_FULL_CONTROLS
ba.ControlInfo.ForwardCruise = 0.2

Edit: The advantages of this approach are:
  • Reduces documentation creep (only one entry for get/set)
  • Reduces code creep (only one function needed for get/set)
  • Simplifies syntax
  • Removes question of error-checking
  • Generally speaking, you'll need to implement both set and get anyway

These are known as ADE_VIRTVAR, for coders who are adding to the Lua API.

If the operation may reasonably fail, you may have an argument for a function.
I guess you are right but since this was added some time ago it is used by a number of scripts so you can't change it without breaking them.
Here goes scripting and copy paste coding
Freespace RTS Mod
Checkpoint/Shipsaveload script

 

Offline WMCoolmon

  • Purveyor of space crack
  • 213
Re: LUA_FULL_CONTROLS - what is this supposed to do?
:(
-C