• LuaServer
    467 replies, posted
[QUOTE=Genesis999;30963009]What OS you running?[/QUOTE] Windows 7. You can see that in the bottom left of all posts here on Facepunch :)
[QUOTE=Divran;30963045]Windows 7. You can see that in the bottom left of all posts here on Facepunch :)[/QUOTE] Oh i see. :P Well then you should be able to just put the jar file in a directory and double click to run it. If it opens something like Winrar or something then you should Right click > open with > Choose default program > find something along the lines of Java Platform something something > click ok > Launch
Well, that worked, but now it has the gui again. And it tells me [quote][WARNING] **** NOT ENOUGH RAM! [WARNING] To start the server with more ram, launch it as "java -Xmx1024M -Xms1024M -jar minecraft_server.jar"[/quote] But I probably won't be hosting a serious server anyway so that won't matter.
I really feel like im spamming people sometimes when I end up updating a couple of times in a night with bugfixes and crap. But this shall be the last for the night. :) Added verbose error messages when your script fails. Fixed Player:Ban() Moved the GetSign global function into the WorldClass
Bro, you're never spamming us. This is pretty much the best thing to happen to minecraft, just imagine the possiblities you've opened up for us and the powerful language of lua.
Block breaking is acting wierd. When I left click to break a block, my test code: [code]function OnPlayerBreakBlock(block) PrintToChat( block:GetUser() .. " broke a block", "#all" ) end [/code] prints not only when the block breaks, but also when I first click it.
It's supposed to do that, use GetStatus() to check around or for it.
I think I'm going to make a kind of "driver" for this (in Lua). It'll have helper functions and Gmod-like hooks to allow multiple Lua addons on the same server, because it seems like you can only have 1 Lua addon at a time, the way it is now, correct? Would anyone use it?
[QUOTE=Divran;30963354]I think I'm going to make a kind of "driver" for this (in Lua). It'll have helper functions and Gmod-like hooks to allow multiple Lua addons on the same server, because it seems like you can only have 1 Lua addon at a time, the way it is now, correct? Would anyone use it?[/QUOTE] Sounds good. Though multiple script support is something i plan on implementing in the actual mods code. :)
Well, I'm making it anyway :) EDIT: Is it ok if I make a page for it on your wiki? To post progress and how to use it etc. EDIT: Also, it seems there's no way to get the player who placed the sign in the OnPlayerPlaceSign function. EDIT: The CommandHandler page says that it passes one argument, and that the argument is a PlayerEntityClass. Shouldn't that be a CommandClass? EDIT: Apparently there's no way to find files in a directory (like Gmod's file.FindInLua or file.Find), so short of forcing server owners to enter the file path of every mod they install into a text file, I can't finish this project. :( You'll probably finish support for multiple scripts before I can finish this anyway, so oh well. Project failed.
Can you add something that finds all of the blocks with the given id and puts them all in a table? Could be useful for block replacing scripts.
You could just create a table of blocks and on the block breaking function have it return false, or something.
Is there any plan for a wiki for this? I think I'll need to play around with this, once there's some documentation. :buddy:
[QUOTE=Gmod4ever;30972688]Is there any plan for a wiki for this? I think I'll need to play around with this, once there's some documentation. :buddy:[/QUOTE] [QUOTE=Genesis999;30888866]I have a wiki at: [url]http://olympusgaming.org/wiki/[/url][/QUOTE] Reading the first post of the thread before you post is a good idea.
[QUOTE=erik802;30939365]Do i have to delete META-INF for this?[/QUOTE] yes
[QUOTE=Markuzsz;30976106]yes[/QUOTE] Deleting meta-inf will stop the server from working. There is no need to delete the metainf folder.
Does anyone know how to setup a local server offline? I'm in a hotel and I can't port forward :v: Also this is getting awesome dude, all these functions are useful as hell! When you do a client version of this will we be able to do HUD Elements?
What is the difference between SetPosition and TeleportTo? Wouldn't it be easier to have GetPosition return a table instead of having 3 different functions for x y and z? Also would you be able to make a called function that is something like PlayerTakeDamage(victim, attacker, amountofdamage) and you could return a number that will be the amount the player takes?
[QUOTE=Divran;30973497]Reading the first post of the thread before you post is a good idea.[/QUOTE] Don't recall that being there when I initially read this. And even if it was, you don't need to be a douche about it.
[QUOTE=Gmod4ever;30979615]Don't recall that being there when I initially read this. And even if it was, you don't need to be a douche about it.[/QUOTE] Oooh shit, it'd be nice to see you coding scripts for this. God with the talent of FP this is going to be a HUGE advancement for Minecraft.
This is literally the greatest thing I have ever seen, and the OP is the greatest person to ever live. Thank you for this wonderful modification.
Rate me dumb if you take it in the ass. [highlight](User was banned for this post ("Trolling" - Autumn))[/highlight]
This is amazing. Glad to see people pushing the limits of Minecraft in so many different ways. Wish I knew more advanced LUA though, I'd probably love it even more :v:
When I download the default minecraft_server.jar and run it, I get an Java error, is it with someone else? Try downloading the server.jar at minecraft.net and run it.
[QUOTE=Staneh;30989436]When I download the default minecraft_server.jar and run it, I get an Java error, is it with someone else? Try downloading the server.jar at minecraft.net and run it.[/QUOTE] Can you give us some specifics about the error?
[code]Exception in thread "main" java.lang.NoClassDefFoundError: C:\Users\Stan\Downlo ds\minecraft_server/jar Caused by: java.lang.ClassNotFoundException: C:\Users\Stan\Downloads\minecraft_ erver.jar at java.net.URLClassLoader$1.run(Unknown Source) at java.security.AccessController.doPrivileged(Native Method) at java.net.URLClassLoader.findClass(Unknown Source) at java.lang.ClassLoader.loadClass(Unknown Source) at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source) at java.lang.ClassLoader.loadClass(Unknown Source) Could not find the main class: C:\Users\Stan\Downloads\minecraft_server.jar. P ogram will exit.[/code] This is the error that pops up when I run the default minecraft_server.jar without any lua things involved.
You need to make a folder on your desktop. make a folder called 'MCServer' and put the .jar in there and run it. It should do the rest for you, except for the IP, I think. -snip,fixed- But I'm getting error's from gametick outside of gametick..
[QUOTE=jrj996;30993603]You need to make a folder on your desktop. make a folder called 'MCServer' and put the .jar in there and run it. It should do the rest for you, except for the IP, I think. -snip,fixed- But I'm getting error's from gametick outside of gametick..[/QUOTE] I tried that, but it didnt work
[QUOTE=ruarai;31001339]You didn't delete META-INF did you? You're not supposed to.[/QUOTE] He stated that he didn't modify the jar file at all, he simply ran the unmodified client. If you delete META-INF, you usually get an error pertaining to the jar file being corrupt. The corrupt message is only about two lines, so it's not a standard runtime notification the Java interpreter spits out. [editline]9th July 2011[/editline] I figured this was also worth mentioning. If you have a global variable, let's say it's x, and you have two of the triggered functions, like OnScriptStart and OnPlayerConnect, and you try to modify the global variable within the first triggered function, it only changes in the local scope of that function. Example: [code] x = 1 function OnScriptStart() x = 2 PrintToChat(x, "#all") end function OnPlayerConnect(Player) PrintToChat(x, "#all") end [/code] The first call to PrintToChat outputs 2, but the second will output 1. However, from what I know from lua, x should change to 2 in both scopes since it's a global variable and is handled as such. I've tried working around this issue to no avail. Does anyone happen to know why this happens?
[QUOTE=MallocNull;31002183]He stated that he didn't modify the jar file at all, he simply ran the unmodified client. If you delete META-INF, you usually get an error pertaining to the jar file being corrupt. The corrupt message is only about two lines, so it's not a standard runtime notification the Java interpreter spits out. [editline]9th July 2011[/editline] I figured this was also worth mentioning. If you have a global variable, let's say it's x, and you have two of the triggered functions, like OnScriptStart and OnPlayerConnect, and you try to modify the global variable within the first triggered function, it only changes in the local scope of that function. Example: [code] x = 1 function OnScriptStart() x = 2 PrintToChat(x, "#all") end function OnPlayerConnect(Player) PrintToChat(x, "#all") end [/code] The first call to PrintToChat outputs 2, but the second will output 1. However, from what I know from lua, x should change to 2 in both scopes since it's a global variable and is handled as such. I've tried working around this issue to no avail. Does anyone happen to know why this happens?[/QUOTE] The bug i guess youd call it with the global vars is known to me. Its mainly caused by the way i tell it to run the code. I will be changing the way it to run code in a coming version. On another note Im in the middle of moving so once I get myself setup properly ill be uploading my latest version that has multiple script support, the hook system and 1.7.3 compatbile. Sorry for any wait. :)
Sorry, you need to Log In to post a reply to this thread.