• LuaCraft | Minecraft with a taste of Lua
    383 replies, posted
will this ever work on mac ?
People can edit the wiki :V
So wait, you expect US to go looking around LuaCraft's decompiled source code just so we can fill out a tiny bit of documentation?
Seriously we need some proper documentation, I'm starting a StickRPG type thing for minecraft and having the GUI functions would help. NPC's don't work clientside?
[QUOTE=Gran PC;36630989]So wait, you expect US to go looking around LuaCraft's decompiled source code just so we can fill out a tiny bit of documentation?[/QUOTE] No, you can fix any obvious errors.. Why would I expect you to do that? [editline]5th July 2012[/editline] LuaCraft has an auto wiki exporter though. I might try getting it to work later
Why doesn't this work? [lua] hook.Add("fire.spread","test",function(a) Block(a):SetID(1) end) [/lua]
Try just returning false.
I tried nil true and false, no effect.
Hmm, I'll look into it [editline]6th July 2012[/editline] Try using hook fire.spreadpos which is the same syntax as fire.spread but seems to only be called if lightning strikes
It's working with normal fire spread, so I hope I can use it to nerf fire. [editline]6th July 2012[/editline] Nope, still doesn't seem to do anything. [lua] hook.Add("fire.spreadpos","test",function(a) Chat("test") return false end) hook.Add("fire.spreadpos","test",function(a) Chat("test") return true end) hook.Add("fire.spreadpos","test",function(a) Chat("test") return nil end) [/lua] Tried each one, they all do the same thing.
I'm trying to emulate the "double drop" system seen in the popular mod MCMMO, but I can't for the life of me figure it out. [b]What I want to do:[/b] When a player breaks an ore block, a second item is dropped from it. I have the check to see if it is a valid ore block down, but now I'm stuck. I want it to use the player.breakblock hook with it. My first idea was to somehow create the block in the same spot as the broken block, and then use Block:Break to break the second block, granting a second drop...but I can't even make [i]that[/i] work. :( [b]EDIT:[/b] Finally got it after some more tweaking. Don't want to snip since maybe someone can learn from this OR show me a better way: [lua] function Rockbreaker_Action(ply,block) -- this is called from the player.breakblock hook theid = block:GetID() if string.sub(block:GetClass(), 0,8) == "tile.ore" then block:Break(100, ply:GetWorld()) block:SetID(theid) -- if you don't re-set the ID of the block again after breaking it, then everything goes to hell and you get kicked off of the server from a null pointer exception end end [/lua]
[IMG]https://dl.dropbox.com/u/16737046/luacraft2.png[/IMG] How do you get a list of enchantments from an item so this can be used?
I love lua but this seems unnecessary. Is Java too tough of a language for you guys?
[QUOTE=Slight;36658797]I love lua but this seems unnecessary. Is Java too tough of a language for you guys?[/QUOTE] If you love Lua then you know how powerful, fun and simple it is to use. It's not a matter of which language is too "tough".
Can someone please explain how to use the new threaded version of SQL:Query, as there is no documentation at all on how to use it now? (or that it was replaced in the first place...I had to see a comment on the Facebook page to even find out)
[QUOTE=Slight;36658797]I love lua but this seems unnecessary. Is Java too tough of a language for you guys?[/QUOTE] You can also create and run arbitrary code at runtime with a scripting language like lua - Java is designed not to do this.
[lua] allowedmobs = {"Zombie","Villager","Pig","Sheep"} hook.Add("entity.spawn","Spawn Filter",function(ent) for k,v in pairs(allowedmobs) do if v == tostring(ent:GetClass()) then Chat("Propper Mob Spawned") else if not ent:IsPlayer() then ent:Remove() end end end end) [/lua] Can someone explain to me why this won't work? It's passing all the checks and just simply not spawning the mob. Such a complicated problem for such a simple function..
[QUOTE=jrj996;36684316][lua] allowedmobs = {"Zombie","Villager","Pig","Sheep"} hook.Add("entity.spawn","Spawn Filter",function(ent) for k,v in pairs(allowedmobs) do if v == tostring(ent:GetClass()) then Chat("Propper Mob Spawned") else if not ent:IsPlayer() then ent:Remove() end end end end) [/lua] Can someone explain to me why this won't work? It's passing all the checks and just simply not spawning the mob. Such a complicated problem for such a simple function..[/QUOTE] doesn't that need a 'return true' somewhere to tell the hook your override passed checks?
[QUOTE=jrj996;36684316][lua] allowedmobs = {"Zombie","Villager","Pig","Sheep"} hook.Add("entity.spawn","Spawn Filter",function(ent) for k,v in pairs(allowedmobs) do if v == tostring(ent:GetClass()) then Chat("Propper Mob Spawned") else if not ent:IsPlayer() then ent:Remove() end end end end) [/lua] Can someone explain to me why this won't work? It's passing all the checks and just simply not spawning the mob. Such a complicated problem for such a simple function..[/QUOTE] -- snip -- see below for proper code.
That would remove it in the first iteration - not even Zombies would spawn because then it'd check if it's a pig, and if it doesn't it'd remove it. [lua]allowedmobs = {} allowedmobs["Zombie"] = true allowedmobs["Pig"] = true allowedmobs["Villager"] = true allowedmobs["Sheep"] = true hook.Add("entity.spawn", "Spawn Filter", function(ent) if not ent:IsPlayer() and allowedmobs[ent:GetClass()] then Chat("Proper Mob Spawned") elseif not ent:IsPlayer() then return true end end) [/lua]
[QUOTE=Gran PC;36688211]That would remove it in the first iteration - not even Zombies would spawn because then it'd check if it's a pig, and if it doesn't it'd remove it. [lua]allowedmobs = {} allowedmobs["Zombie"] = true allowedmobs["Pig"] = true allowedmobs["Villager"] = true allowedmobs["Sheep"] = true hook.Add("entity.spawn", "Spawn Filter", function(ent) if not ent:IsPlayer() and allowedmobs[ent:GetClass()] then Chat("Proper Mob Spawned") elseif not ent:IsPlayer() then return true end end) [/lua][/QUOTE] Appreciate it, thanks!
I've decided to work on an MMORPG addon for my Minecraft server that will combine the best elements of the major plugins on Minecraft (such as Factions, McMMO, Iconomy) and then improve upon them for a fun Lua-enhanced server experience. Here's what I've been able to do so far: - Robust chat system (global, local, and territory chat, plus whisper including a /r command to automatically reply to the last person that whispered you. You can set chat modes to default as well, so that you don't have to type the channel prefix each time) - Money management (including paying other players) - Chest Shops (they work exactly like the chest shops on Bukkit servers) - Territories (I'm excited about this one; they work much like factions except that they aren't grid based. They are protected against outsider block-manipulation. You create a territory and by default, it expands 8 blocks from all directions from the origin (so 17x17). Territories can level up if they have enough money and experience, which will expand their protected-building area. Players can donate money, and 10% of all territory members' gained XP is added to the territory's. I don't have any great ideas for Territory PvP yet. Territories have alot of customization options, such as setting a message of the day, spawn point, and even setting the names for ranks. I guess they're really more like guilds in most MMO's.) - Professions (Just like mcMMO - you gather experience and gain levels to become better at whatever your profession does. Except in mine, the player is limited to a few professions so that no one can be the jack of all trades) - Abilities (these go hand in hand with professions; so far I've recreated the Timber ability from McMMO for Lumberjacks, and the Giga-Drill or whatever it's called for Miners) I've been having so much fun developing all of this, and apart from missing documentation woes, it's been a very hassle-free experience so far. I might make a Youtube video showcasing some of the things that are possible with this. [b]Thanks LuaStoned and the rest of the LuaCraft team. Please keep up the good work!!![/b]
My server won't let me break any blocks, shoot arrows, or make blocks like gravel and sand fall... Anyone know how to fix this? It's not happening on vanilla...
Could you make tab key work at the main menu ? Thanks.
[QUOTE=Noi;36703148]Just make DarkRP in minecraft :v:[/QUOTE] Oh God. Anyway, I might make my server public soon if anyone is interested in helping me test it out. (I've got 2 Minecraft accounts so I do test the multiplayer capabilities, but I have no idea how much lag will be generated with more than 2 people running around and doing stuff) - I won't post anything else about my project here unless I do something truly epic, but I might make a thread over on the LuaCraft forums. [b]LuaCraft Question:[/b] Is there currently any way to detect when a player has finished writing on a sign? What I need to do is be able to change a line of a sign immediately after the player changes it. If not, is it possible that you guys could create a hook for the future? Something like: [lua]hook.Add("player.editsign", "LuaCraft - Sign Editing", function (ply, signtext ) print(ply:Name()) table.Print(signtext) -- return a different table to change what the sign says end)[/lua]
[QUOTE=TheBigS;36704468]Oh God. Anyway, I might make my server public soon if anyone is interested in helping me test it out. (I've got 2 Minecraft accounts so I do test the multiplayer capabilities, but I have no idea how much lag will be generated with more than 2 people running around and doing stuff) - I won't post anything else about my project here unless I do something truly epic, but I might make a thread over on the LuaCraft forums. [b]LuaCraft Question:[/b] Is there currently any way to detect when a player has finished writing on a sign? What I need to do is be able to change a line of a sign immediately after the player changes it. If not, is it possible that you guys could create a hook for the future? Something like: [lua]hook.Add("player.editsign", "LuaCraft - Sign Editing", function (ply, signtext ) print(ply:Name()) table.Print(signtext) -- return a different table to change what the sign says end)[/lua][/QUOTE] Just trace the players eyes on player.rightclick and change the text with [lua]Block(pl.Trace):SetSignText(line,text or table lines)[/lua] use that or an idea like that temporarily
Just a question: Does LuaCraft have to be installed on the client as well? I want to use it on a multiplayer server and I don't know if all of the clients need to have it installed.
[QUOTE=TheCloak;36711587]Just a question: Does LuaCraft have to be installed on the client as well? I want to use it on a multiplayer server and I don't know if all of the clients need to have it installed.[/QUOTE] No. [editline]10th July 2012[/editline] Assuming what you are going to program is strictly server-side.
[QUOTE=TheBigS;36704468]Oh God. Anyway, I might make my server public soon if anyone is interested in helping me test it out. (I've got 2 Minecraft accounts so I do test the multiplayer capabilities, but I have no idea how much lag will be generated with more than 2 people running around and doing stuff) - I won't post anything else about my project here unless I do something truly epic, but I might make a thread over on the LuaCraft forums. [b]LuaCraft Question:[/b] Is there currently any way to detect when a player has finished writing on a sign? What I need to do is be able to change a line of a sign immediately after the player changes it. If not, is it possible that you guys could create a hook for the future? Something like: [lua]hook.Add("player.editsign", "LuaCraft - Sign Editing", function (ply, signtext ) print(ply:Name()) table.Print(signtext) -- return a different table to change what the sign says end)[/lua][/QUOTE] There's a hook for this! [lua]hook.Add("player.updatesign", "LuaCraft - Sign Editing", function (ply, block) print(ply:Name()) table.Print(block:GetSignText()) -- return a different table to change what the sign says end)[/lua] [editline]11th July 2012[/editline] [QUOTE=TylerB;36656454][IMG]https://dl.dropbox.com/u/16737046/luacraft2.png[/IMG] How do you get a list of enchantments from an item so this can be used?[/QUOTE] I could probably make a table that contains all of the different enchantment IDs.
[QUOTE=Noi;36721131]_R.Vector.ToScreen isn't working well :v: It depends on camera mode (firstperson/thirdperson) and inaccurate.[/QUOTE] Why would you not want it to depend on the camera mode?
Sorry, you need to Log In to post a reply to this thread.