Hard Light Productions Forums

Modding, Mission Design, and Coding => The Scripting Workshop => Topic started by: spartan_0214 on February 24, 2007, 09:35:58 pm

Title: Lua question
Post by: spartan_0214 on February 24, 2007, 09:35:58 pm
Huh, I'm having problems with the mouse configuration line:

Code: [Select]
LUA ERROR: [string "HUD"]:5: attempt to call field `getMouseY' (a nil value)

LUA Debug:
------------------------------------------------------------------
Name: getMouseY
Name of: field
Function type: C
Defined on: -1
Upvalues: 0

Source: =[C]
Short source: [C]
Current line: -1
------------------------------------------------------------------

LUA Stack:
------------------------------------------------------------------

------------------------------------------------------------------

ugh, how fixie???
Title: Re: Lua question
Post by: Goober5000 on February 24, 2007, 09:51:28 pm
Wrong thread; wrong forum.  Split and moved.
Title: Re: Lua question
Post by: Nuke on February 24, 2007, 09:54:27 pm
its io.getMouseY()
Title: Re: Lua question
Post by: spartan_0214 on February 25, 2007, 09:25:01 pm
Wrong thread; wrong forum.  Split and moved.

Thanks Goob, sorry.

its io.getMouseY()

I had figured out that it was a mouse problem :rolleyes:. How do I fix it?
Title: Re: Lua question
Post by: Nuke on February 25, 2007, 11:25:29 pm
youre calling a function that doesnt exist. thats what that error means. most likely its due to the countless times the name of the function has changed. it might still be ms.getY(), ms.getMouseY(), or io.getY() under 3.6.9. dont remember exactly what it was. but in more recent builds the functions is io.getMouseY().
Title: Re: Lua question
Post by: Wanderer on February 26, 2007, 04:31:02 am
If you are planning to use scripting you really shouldnt use 369 builds.. Scripting with those is no longer supported (that is.. scripters have moved on to HEAD branch builds). Nothing prevents you from scripting with 369 builds but it will be rather limited
Title: Re: Lua question
Post by: WMCoolmon on March 10, 2007, 10:40:05 pm
ms.getX() --> io.getX() --> io.getMouseX()
ms.getY() --> io.getY() --> io.getMouseY()

It's probably the first in 3.6.9.