Author Topic: nukes lua.cpp dff  (Read 1740 times)

0 Members and 1 Guest are viewing this topic.

Offline Nuke

  • Ka-Boom!
  • 212
  • Mutants Worship Me
a few people have asked me for a diff to my lua.cpp file, here it is

--bugfixes
 camera:setFOV() --was crashing the game when called, now works fine
--new stuff
 weaponclass.LifeMax --maximum life expectancy of weapon
 object:getSignature --get any objects unique signature, useful for tagging unique metadata to objects with lua works with:
 mn.getObjectFromSignature() --gets an object handle from a signature for quickly getting the object that the metadata applies to
 ship.WeaponEnergyLeft/Max --get weapon energy level
 weapon.FlakDetonationRange --get and set the range at which flak goes boom
 io.updateTrackIR/getTrackIRPitch/getTrackIRYaw/getTrackIRRoll/getTrackIRX/getTrackIRY/getTrackIRZ --access to tracking data, for working with cameras,targeting,ect

*edit*
attachment removed, see below
« Last Edit: August 18, 2009, 09:35:33 am 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 Angelus

  • 210
  • The Angriest Angel
thx Nuke!
I'll see if i can catch ya in the irc chat the next days, i have a couple o questions.

 

Offline Nuke

  • Ka-Boom!
  • 212
  • Mutants Worship Me
ok i updated my diffs again, they are up to date with revision 5522

ive added a few bugfixes for submodel animation as well, its now possible for hitpoints disabled objects to animate.
ive added some new features too

weaponclass.Range --range of weapon
subsystem:hasFired() --returns true if the subsystem has fired, good for handling animation events
ship.primaryTriggerDown --bit value of whether ship has its weapon trigger down (gives no indication of anything firing)
-- these only apply to player input
control_info.ForwardCriuse --gets the forward criuse speed, takes into account speed matching, and throttle hot keys
control_info.PrimaryCount --gets the number of times the primary weapons were fired in the current frame
control_info.SecondaryCount --gets the number of times the secondary weapons were fired in the current frame
control_info.CountermeasureCount --gets the number of times the countermeasures that were fired in the current frame

[attachment deleted by Tolwyn]
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 Swifty

  • 210
  • I reject your fantasy & substitute my own
It would be useful if we had a trigger to disable TrackIR head tracking via some sort of Lua accessible switch while still being able to get the inputs from the TrackIR device so your viewpoint won't go all over the place when you're trying to use the TrackIR inputs for something else. I'll look into that while reviewing your patch.

 

Offline Nuke

  • Ka-Boom!
  • 212
  • Mutants Worship Me
ive mostly been able to get around that issue using cameras. when using cameras the trackir doesnt effect the cameras. i use the inputs to generate a position and orientation which i apply to the cameras. its now also possible to turn the hud on and off with cameras. so the trackir and hud both work and from any location or object i set the camera to. having an option to switch off the trackir would be nice, for example if you want to aim the turrets or guide a missile where youre looking.

the downside to this is that pretty much all of the ingame view commands are useless and new ones need to be scripted in their place. which leads to input issues. scripting does allow us to handle key presses mouse clicks and now joystick axes (though not quite in the same way), only thing we have no direct access to is joystick buttons. but it makes me question the effectiveness of direct access in the context of scripting. id perfer a system where i add controls to the control options screen and bind them just like any other axis or command in the game and then handle their input states from scripting. thats something to think about for when input in general gets an overhaul.
« Last Edit: August 19, 2009, 01:29:12 am 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