• LuaServer
    467 replies, posted
[QUOTE=jrj996;31362877]Why don't you guys work together, that'd make stuff seem a lot easier on both ends. Even if you're in other time-zones make some type of list to do shat. [sp]I'm sensing rivalry that's why I'm saying this :V [/sp][/QUOTE] Competition means innovation. So I support their rivalry.
I've been working on a lua client and server mod for about 2 weeks. Spent forever getting gmod like hooks. And then I see this. :frown: [editline]27th July 2011[/editline] [QUOTE=Divran;31345945]I was saving this for when Genesis logs on to steam, but since he never logs on at the same time as me (He's from Australia, I'm from Sweden...) I guess I'll say it here anyway: I'm currently making Lua for Bukkit. It's completely separate from Genesis', although he did inspire me :) And no, Genesis, I did not use any of your code. I wrote it all myself. You are welcome to use ANY of my code, though. :) Just ask. So far I only have basics done: Loading lua files, and a hook system. Still to do is making player, mob, block classes and my own custom file library (I have an epic idea for the file library, by the way :)) Oh and I'm using something called LuaJ, instead of the thing Genesis is using which is called LuaJava. The difference is that LuaJava has a dll that parses the Lua code and some Java code to help you communicate with the dll. It was easy to add classes, but not the kind I want (where you can save variables to it as though it's a table, aka Gmod style), which was nearly completely impossible. LuaJ is pure Java, and so far, it's much easier to use. Might be a little slower, I don't know, but I think it'll work fine for this. And hopefully it's easier to make Gmod style classes.[/QUOTE] Hate to say this divran, but luajava is raw lua access. You can do ANYTHING you could with lua with luajava. [editline]27th July 2011[/editline] It was a bukkit mod too.
[QUOTE=Map in a box;31364401]I've been working on a lua client and server mod for about 2 weeks. Spent forever getting gmod like hooks. And then I see this. :frown: [editline]27th July 2011[/editline] Hate to say this divran, but luajava is raw lua access. You can do ANYTHING you could with lua with luajava. [editline]27th July 2011[/editline] It was a bukkit mod too.[/QUOTE] Ooh thats happened to me before. That feeling is such a bitch. And then I made LuaServer cause I looked for a week before hand and found nothing.
[QUOTE=Genesis999;31364956]Ooh thats happened to me before. That feeling is such a bitch. And then I made LuaServer cause I looked for a week before hand and found nothing.[/QUOTE] 64bit please? :3
Your wiki is down!
[QUOTE=Funley;31365268]64bit please? :3[/QUOTE] Im bringing out a new version tonight. :D Completed my migration to LuaJ. As to the wiki being down im working on it.
[QUOTE=Genesis999;31365375]Im bringing out a new version tonight. :D Completed my migration to LuaJ.[/QUOTE] :D May i ask you in what timezone you are?
[QUOTE=Funley;31365396]:D May i ask you in what timezone you are?[/QUOTE] Im from Australia.
[QUOTE=Genesis999;31365375]Im from Australia.[/QUOTE] Im having problems calculatin the time between you and me, so. Im from Finland, so the timezone is GMT +2. Youre from Australia, so the timezone GMT +12 or so. So your time is 10 hours ahead from me. My time now is 15:26 pm, so your time should be 1:26 AM Amiright?
[QUOTE=Funley;31365562]Im having problems calculatin the time between you and me, so. Im from Finland, so the timezone is GMT +2. Youre from Australia, so the timezone GMT +12 or so. So your time is 10 hours ahead from me. My time now is 15:26 pm, so your time should be 1:26 AM Amiright?[/QUOTE] Atm my current time is 10:51pm ---------------------------------------------- New version for the masses! :) Build 17 is now out. Features: -No longer requires dlls or libs for the lua code. ( still needs the sqlite ones ) -32bit or 64bit, windows or linux this thing should work properly no matter what your running. -Added a "game.command" hook to the list of hooks. Is called whenever something is typed into the console or a player types something starting with a "/" -Restructured the parameters passed into the command handler -Restructured the parameters passed into the player.placeblock and player.breackblock classes -Rather than having a function called SetReturn(255) to make an event be cancelled you should type "return false" -No more patching the server yourself. Comes all prepackaged and nearly completely ready to go. ( Have to copy one or two files around depending on your OS ) -Added a Player:Print("message") function. -Removed the Server.RegisterCommand function.
[QUOTE=Genesis999;31365790]Atm my current time is 10:51pm ---------------------------------------------- New version for the masses! :) Build 17 is now out. Features: -No longer requires dlls or libs for the lua code. ( still needs the sqlite ones ) -32bit or 64bit, windows or linux this thing should work properly no matter what your running. -Added a "game.command" hook to the list of hooks. Is called whenever something is typed into the console or a player types something starting with a "/" -Restructured the parameters passed into the command handler -Restructured the parameters passed into the player.placeblock and player.breackblock classes -Rather than having a function called SetReturn(255) to make an event be cancelled you should type "return false" -No more patching the server yourself. Comes all prepackaged and nearly completely ready to go. ( Have to copy one or two files around depending on your OS ) -Added a Player:Print("message") function. -Removed the Server.RegisterCommand function.[/QUOTE] YAY :D Thanks!
[QUOTE=Funley;31365885]YAY :D Thanks![/QUOTE] I take that as its working?
[QUOTE=Genesis999;31365904]I take that as its working?[/QUOTE] Actually, not. I checked the ExampleScript, and saw that you can use "/version" command. I typed it in, and the console said this. [code][WARNING] Lua: Error running function. [WARNING] attempt to call nil [INFO] Backplague tried command: version[/code]
[QUOTE=Funley;31365961]Actually, not. I checked the ExampleScript, and saw that you can use "/version" command. I typed it in, and the console said this. [code][WARNING] Lua: Error running function. [WARNING] attempt to call nil [INFO] Backplague tried command: version[/code][/QUOTE] -scratch that- seems ive got a bug already. :{
[QUOTE=Genesis999;31366035]-scratch that- seems ive got a bug already. :{[/QUOTE] D: Try fix it soon!
[QUOTE=Funley;31366218]D: Try fix it soon![/QUOTE] Id fix it right now but I gots to sleep cause I have to work tomorrow.
[QUOTE=Genesis999;31366365]Id fix it right now but I gots to sleep cause I have to work tomorrow.[/QUOTE] Well, fix it after work :3
[QUOTE=Map in a box;31364401]Hate to say this divran, but luajava is raw lua access. You can do ANYTHING you could with lua with luajava.[/QUOTE] Except it's impossible to use because there's no documentation. And I've got everything I wanted working with LuaJ already, so I'm not switching back.
[QUOTE=Divran;31369089]Except it's impossible to use because there's no documentation. And I've got everything I wanted working with LuaJ already, so I'm not switching back.[/QUOTE] It isnt impossible to use.. Lua is HEAVILY documented, and the things you need to use with luajava are in the javadocs. I have no idea what you are talking about.
Does this mean I can make some type of player metatable control and variable control? Also, for the love of god, make getpos return as x,y,z before I kill myself! :suicide:
[QUOTE=Map in a box;31369138]It isnt impossible to use.. Lua is HEAVILY documented, and the things you need to use with luajava are in the javadocs. I have no idea what you are talking about.[/QUOTE] The javadoc I found for LuaJava had no documentation; It was just a list of functions with no description on any of them (except like 2 or 3 which had 1 sentence). Is there another one, which you are referring to, or something?
Had I done my research properly in the beginning I believe I would of used luaj instead of luajava due to luajavas lack of any documentation.
Aha! Tis a good evening indeed. Fixed the bug with build 17 and uploaded a new version. Threads have been updated with the new download link.
[QUOTE=Genesis999;31384732]Aha! Tis a good evening indeed. Fixed the bug with build 17 and uploaded a new version. Threads have been updated with the new download link.[/QUOTE] It works! :DDD Thank you very much! Oh, by the way, how can i create prop files? What sort of file i have to create and change it to a prop file?
[QUOTE=Divran;31373964]The javadoc I found for LuaJava had no documentation; It was just a list of functions with no description on any of them (except like 2 or 3 which had 1 sentence). Is there another one, which you are referring to, or something?[/QUOTE] its because most of the javadoc refers to the lua functions.. Pay attention at the example, you dont even need javadocs for most of them, common sense comes into play
I made a MOTD script, but it doesnt work. [code] function OnScriptStart() Server.AddHook("player.connect", "PlayerJoined", "MOTD") end function PlayerJoined(Player) if Player:IsOP() then PrintToChat("OP " .. Player:GetUsername() .. " has joined the server.", 10, "#all") else PrintToChat(Player:GetUsername() .. " has joined the server.", 9, "#all") end return false end[/code] The console says this. [code][WARNING] Lua: Error running function. [WARNING] attempt to call nil[/code] I checked the wiki and i think the PrintToChat is all fine. If it has changed, please tell me and update the wiki. :) Also, is it normal that the chat doesnt work in LuaServer? When i try to say something that is not a command, it doesnt show anything in the console or chat. And the ExampleScript doesnt work either. When i say "/reload ExampleScript", nothing happens and the console says this: [code][WARNING] LUA: ReloadScript failed. Parameter 1 was invalid. [WARNING] Lua: Error running function. [WARNING] attempt to concatenate string and nil[/code]
[QUOTE=Funley;31384893]I made a MOTD script, but it doesnt work. [code] function OnScriptStart() Server.AddHook("player.connect", "PlayerJoined", "MOTD") end function PlayerJoined(Player) if Player:IsOP() then PrintToChat("OP " .. Player:GetUsername() .. " has joined the server.", 10, "#all") else PrintToChat(Player:GetUsername() .. " has joined the server.", 9, "#all") end return false end[/code] The console says this. [code][WARNING] Lua: Error running function. [WARNING] attempt to call nil[/code] I checked the wiki and i think the PrintToChat is all fine. If it has changed, please tell me and update the wiki. :) Also, is it normal that the chat doesnt work in LuaServer? When i try to say something that is not a command, it doesnt show anything in the console or chat. And the ExampleScript doesnt work either. When i say "/reload ExampleScript", nothing happens and the console says this: [code][WARNING] LUA: ReloadScript failed. Parameter 1 was invalid. [WARNING] Lua: Error running function. [WARNING] attempt to concatenate string and nil[/code][/QUOTE] Sorry about all that. Seems a change of API always manages to miss some things. Ive fixed the PrintToChat call, fixed chat cancelling no matter what, fixed the command handler arguments variable ( stupid lua and its arrays starting at 1 instead of 0 ) As I said before i just finished migrating api's so there were one or two bits and pieces that escaped through the holes.
Why not have a gmod like hook system? Why use text for the function? Why is everything in the global namespace?
[QUOTE=Genesis999;31385545]Sorry about all that. Seems a change of API always manages to miss some things. Ive fixed the PrintToChat call, fixed chat cancelling no matter what, fixed the command handler arguments variable ( stupid lua and its arrays starting at 1 instead of 0 ) As I said before i just finished migrating api's so there were one or two bits and pieces that escaped through the holes.[/QUOTE] When are you going to upload the new version? I quess you deleted the current download from MediaFire.
[QUOTE=Map in a box;31385583]Why not have a gmod like hook system? Why use text for the function? Why is everything in the global namespace?[/QUOTE] Why not have a gmod hook like system? Mainly because the server is still a work in progress. Nothings finalised yet. Why use text for the function? Mainly cause at the time it was a fair bit easier to setup. Now that i have completed migrating to LuaJ I can continue to work on other things like passing functions in rather than strings. Why is everything in the global namespace? In the global namespace there is two functions ( PrintToChat, PrintToConsole ) and three tables ( Server , Files, Sql ) If you think thats a big issue well then you have worse OCD than I do. [editline]28th July 2011[/editline] [QUOTE=Funley;31385599]When are you going to upload the new version? I quess you deleted the current download from MediaFire.[/QUOTE] Retry. It was an issue with the facepunch thread formatting.
Sorry, you need to Log In to post a reply to this thread.