(G15 Keyboard)Regarding Mods And Their Requirements.

DY357LXDY357LX Playing since day 1. Still can't Comm.England Join Date: 2002-10-27 Member: 1651Members, Constellation
<div class="IPBDescription">LUA version of #include for G15 etc?</div>I own a G15 keyboard, and whilst it's a great keyboard I find that quite a few of my fave games don't support it.

We all know that NS2 uses LUA heavily for various things. But today I noticed that Logitech (makers of the keyboard)
now support LUA for the G15 keyboard. (I don't know if the G19 etc is supported.)

(Article can be found here: <a href="http://newsletter2.logitech.com/logitech/general/2008/gaming/winter/us_en/tips.html" target="_blank">http://newsletter2.logitech.com/logitech/g...us_en/tips.html</a>)

My programming experience is limited, I has basic knowledge of C++ and PHP but that's about it.

If I wanted to go about reading things like remaining Health, Ammo etc from NS2, could I place my own .lua file inside
NS2's main folder and have my .lua file interact with functions from NS2's official files. Or would I have to use the Builder
application to make an entirely separate Mod and then have it interact with the required files?

If yes, what's the correct way to do this?
In C++ it'd be something like:
<!--c1--><div class='codetop'>CODE</div><div class='codemain'><!--ec1-->#include <Player.lua>
#include <Rifle.lua><!--c2--></div><!--ec2-->
And so on... is there a LUA equivalent?

My apologies if my terminology is off and my question is dumb, I just really want NS2 to work with my G15. Even if I have to do it myself :-P

Thanks.

Comments

  • MevraelMevrael Join Date: 2009-02-18 Member: 66462Members
    If you open any lua file you could find something like this:

    Script.Load("lua/Weapons/Weapon.lua")
  • DY357LXDY357LX Playing since day 1. Still can&#39;t Comm. England Join Date: 2002-10-27 Member: 1651Members, Constellation
    Yeah there's Script.Load("yourfile.lua)" and include("yourfile.lua").

    Wrote a quick file to test outputting to the LCD but am not sure which default NS2 lua file to edit and tell the Script.Load function to load my file.

    Any ideas?
  • MevraelMevrael Join Date: 2009-02-18 Member: 66462Members
    I think you can use any file. If not, try Main.lua
  • FehaFeha Join Date: 2006-11-16 Member: 58633Members
    You want a clientside script that interacts with your logitech keyboard by writing stuff like "Health: " .. healthVar?

    If so, I think it should be possible. The Player_Client.lua got this code.

    function PlayerUI_GetPlayerHealth()
    return Client.GetLocalPlayer():GetHealth()
    end

    function PlayerUI_GetPlayerMaxHealth()
    return Client.GetLocalPlayer():GetMaxHealth()
    end

    So I guess you just have to either copy the code that is inside the functions, or just Script.Load player_client and use those functions.
  • PrimajinPrimajin Join Date: 2009-10-06 Member: 68969Members
    It would be really cool if you post your g15script here if you got one

    Thanks
Sign In or Register to comment.