Forums » Community Projects
Yeeeah. RegisterUserCommand() is broken, last I checked. :/
That's really cool, Ray. What's with the weird constant though?
Edit: All I get is 256 megabytes for 268435456 bytes and 32 megabytes for bits.
Edit: All I get is 256 megabytes for 268435456 bytes and 32 megabytes for bits.
MSKanaka: how did you 'check'?
Scuba: It's a bitfield value:
keyboard = 0x10000000
mouse = 0x20000000
joysticks = 0x40000000
Scuba: It's a bitfield value:
keyboard = 0x10000000
mouse = 0x20000000
joysticks = 0x40000000
We don't have access to RegisterUserCommand() anymore Ray, unless I'm dumb and can't find it. I already know how to use it if we did :/
Scuba: Yeah, I know, that's why I was asking MSKanaka how he was using it.
This next update tonight will make that function available again.
It will work like this:
RegisterUserCommand(commandname, callback, data)
when commandname is executed, it calls callback with data as the argument. so, something like this:
if commandname then
callback(data)
end
You can unregister the command with UnregisterUserCommand(commandname) or
RegisterUserCommand(commandname, nil, nil)
This next update tonight will make that function available again.
It will work like this:
RegisterUserCommand(commandname, callback, data)
when commandname is executed, it calls callback with data as the argument. so, something like this:
if commandname then
callback(data)
end
You can unregister the command with UnregisterUserCommand(commandname) or
RegisterUserCommand(commandname, nil, nil)
Also, this is going to be new in this release:
VO will auto-load all addons in an 'addons' directory.
Place a lua file named 'main.lua' in a subdirectory in the addons directory and it will auto-load on startup and get reloaded when you ReloadInterface().
Therefore you can make addons/radar/main.lua so you don't need to manually dofile(...) on it.
VO will auto-load all addons in an 'addons' directory.
Place a lua file named 'main.lua' in a subdirectory in the addons directory and it will auto-load on startup and get reloaded when you ReloadInterface().
Therefore you can make addons/radar/main.lua so you don't need to manually dofile(...) on it.
Sweeet. That rocks, Ray.
Edit: Also, kanaka's version of "broke" means "I can't access it" in most lua function situations.
Edit: Also, kanaka's version of "broke" means "I can't access it" in most lua function situations.
Somebody should make a VOWiki page on the LUA subsystem, and on the available LUA modules (like MakeFriends).
yeah, as scuba said, if it's not accessible, I consider it "broke" as far as general community use goes. Sorry for the vagueness.
EDIT: more specifically, if I know the syntax, use the proper syntax, and still get a lua error, then I really consider it broken. ;)
EDIT: more specifically, if I know the syntax, use the proper syntax, and still get a lua error, then I really consider it broken. ;)
Presets and Tab completion don't work for me
I can create preset, but loading that preset doesn't change any option. Pressing Tab when entering a nickname doesn't do anything
I can create preset, but loading that preset doesn't change any option. Pressing Tab when entering a nickname doesn't do anything
Edit: The new version probably broke things. I'll fix it later today.
I got the new version working, but the 'secret feature' gives me lua errors sometimes (it has since before the update).
declare() doesn't work like that, currently. I will make it work that way for the next update, but for now you declare("varname")
and then you have to set varname={} or whatever you want to set it to.
The next update will set the variable to the second parameter of declare.
and then you have to set varname={} or whatever you want to set it to.
The next update will set the variable to the second parameter of declare.
Yeah, I had to change it to that.
The secret feature is less secret, and more I don't have time to implement it properly right now, so it's just thrown in there. Email me what lua errors you get so I can fix them though.
What's your email address? :P
Check the first post lawl.
Edit: You could also be inconsiderate and post the lua errors in this thread, I don't care.
Edit2: If you're referring to the error "attempt to index field `?'(a nil value)", then it should be fixed in version 1.4.3
Edit: You could also be inconsiderate and post the lua errors in this thread, I don't care.
Edit2: If you're referring to the error "attempt to index field `?'(a nil value)", then it should be fixed in version 1.4.3
I still have Lua error when loading 1.4.3:
sent addons/MakeFriends/main.lua:3: attempt to index field `_G' (a nil value)
stack traceback:
addons/MakeFriends/main.lua:3: in function `f'
vo/vo.lua:272: in function `sb'
vo/vo.lua:383: in main chunk
(repeated several times)
Also I found this in the errors.log:
cannot read addons/MakeFriends/vo/if_hud.lua: No such file or directory
e
sent addons/MakeFriends/main.lua:3: attempt to index field `_G' (a nil value)
stack traceback:
addons/MakeFriends/main.lua:3: in function `f'
vo/vo.lua:272: in function `sb'
vo/vo.lua:383: in main chunk
(repeated several times)
Also I found this in the errors.log:
cannot read addons/MakeFriends/vo/if_hud.lua: No such file or directory
e
Looks like Scuba started to edit 1.4.2 to reflect API changes, but stopped in the middle of process, commented out everything he did, and released the result as 1.4.3. Example:
--Depending on VO version, uncomment a line below
iup._G.ufuncs = {}
--declare("ufuncs", {})
Oh, and startup file is still called start.lua, while it should be main.lua
Unfortunately my knowledge in Lua is less than basic, so I can't fix all that mess (trying to learn Lua by reading this forum and looking at code of Scuba, firsm and genka is particularly a bad idea, I should read the fine Lua manual first >_>)
--Depending on VO version, uncomment a line below
iup._G.ufuncs = {}
--declare("ufuncs", {})
Oh, and startup file is still called start.lua, while it should be main.lua
Unfortunately my knowledge in Lua is less than basic, so I can't fix all that mess (trying to learn Lua by reading this forum and looking at code of Scuba, firsm and genka is particularly a bad idea, I should read the fine Lua manual first >_>)