1. Post #161
    Gold Member
    thejjokerr's Avatar
    December 2007
    2,113 Posts
    I'd love to see the angles metatable and functions for entities in the next update, and maybe some kind of block hook to override the growing of grass?

    I'm using this LuaServer to make a gamemode right now, and so far I haven't had too much problems with the limited functions there are.

    Edited:
    - player.digblock also isn't called when in creative. Could we perhaps have a player.leftclick hook that is always called (I'm making a WorldEdit plugin for my gamemode in Lua, and that wont work without this D:)
    Reply With Quote Edit / Delete Reply Windows 7 Netherlands Show Events Informative Informative x 1 (list)

  2. Post #162
    Gold Member
    LuaStoned's Avatar
    September 2007
    1,358 Posts
    Alright, I pushed v14.

    Big thanks to BlackOps (again) who keeps working on this while I am busy with other work. Without him this would not be nearly as far as it is today.
    I will take a shot at updating the Wiki tomorrow but I hope BlackOps will post the changelog here soonish.

    Good Night!
    Reply With Quote Edit / Delete Reply Windows 7 Austria Show Events Friendly Friendly x 2Winner Winner x 1 (list)

  3. Post #163
    Gold Member
    BlackAwps's Avatar
    July 2011
    767 Posts
    Code:
    === Version 14: ===
    
    * Fixed player.digblock not being called in creative mode
    * Fixed big issue with player.placeblock using wrong values for coordinates
    * Moved player.GetByName to java
    * Added chatcommand module
    * Added VERSION enum
    * Made concommand.lua download in the autoupdater
    * Made autorun file loading use pcall
    * Added SysTime()
    * Made player.authenticate pass the players IP
    * Fixed sql handling of null return values ( Now returns nil )
    * Fixed issues with file library allowing you to access files outside of the server directory
    * Added file.Append
    * Made Player:GetIP() no longer return the socket connection port
    * Added amount and type arguments to entity.attackedentity
    * Added Angle(p,y,r) global
    * Added Entity:Set/GetAngles()
    * Added Player:SetEyeAngles()
    * Added IsAngle(ang)
    * Added Player:AddExperience
    * Fixed Player:SetExperience and Player:SetLevel not sending info to client
    * Added Wolf metatable _R.Wolf
    * Added Wolf:Set/GetTamed
    * Added Wolf:IsTamed
    * Added Wolf:UnTame
    * Added Wolf:GetOwnerName
    * Added Wolf:Set/GetOwner
    * Added Living:GetTexture
    * Added Living metatable _R.Living
    * Added Living:Set/GetExperienceValue
    * Added Entity:IsLiving
    * Added Entity:IsWolf
    * Added Player:GetSkinURL
    * Added Living:Set/GetTarget
    * Added ItemStack:Remove
    * Added Player:DecreaseSlot
    * Fixed null pointer error in ent.Spawn
    * Fixed TraceLine dimension index not being used
    * Changed TraceLine so if it doesn't hit anything, it returns a HitPos of where the trace ended
    * Fixed issue where extensions would still download, even if auto-updating was false
    * Fixed chatcommand module being case-sensitive
    * Added concommand module for server console commands
    * Added Angle:Forward
    * Added Angle:Right
    * Added Angle:Up
    * Added _R.PropertyManager
    * Added PropertyManager:GetString
    * Added PropertyManager:GetInt
    * Added PropertyManager:GetBool
    * Added PropertyManager:SetValue
    * Changed Player:GetActiveWeapon to return a second value of the slot number
    * Added Player:Ping/GetPing
    * Added Block:GetName
    * Added ItemStack:GetName
    * Added ConsoleCommand
    * Added MaxPlayers
    The changelog
    Reply With Quote Edit / Delete Reply Windows 7 United States Show Events Winner Winner x 3Friendly Friendly x 1 (list)

  4. Post #164
    Holy-Smokes's Avatar
    October 2011
    513 Posts
    Why dubstep in the first video? WHYYYYYY!

    Will we be able to have custom blocks with their own textures? How would you handle clients without textures?
    Reply With Quote Edit / Delete Reply Windows 7 Denmark Show Events Dumb Dumb x 4 (list)

  5. Post #165
    Gold Member
    thejjokerr's Avatar
    December 2007
    2,113 Posts
    Why dubstep in the first video? WHYYYYYY!

    Will we be able to have custom blocks with their own textures? How would you handle clients without textures?
    Because some people like dubstep.

    And it's a LuaServer, not LuaClient. You can't modify block textures on the server.

    Edited:

    Lolwtf, where are you hearing dubstep?

    Edited:

    Oh my god that song is quite shit. But that doesn't mean dubstep is.

    Edited:

    Awesome job on the server guys, most excited about this:
    * Changed Player:GetActiveWeapon to return a second value of the slot number

    Really needed that.

  6. Post #166
    Holy-Smokes's Avatar
    October 2011
    513 Posts
    Because some people like dubstep.

    And it's a LuaServer, not LuaClient. You can't modify block textures on the server.

    Edited:



    Lolwtf, where are you hearing dubstep?

    Edited:

    Oh my god that song is quite shit. But that doesn't mean dubstep is.

    Edited:

    Awesome job on the server guys, most excited about this:
    * Changed Player:GetActiveWeapon to return a second value of the slot number

    Really needed that.
    I knew it was a server, but if you added new blocks to the game, how would that work?

    whoops accidently typed that in the quote what the fuck
    Reply With Quote Edit / Delete Reply Windows 7 Denmark Show Events Informative Informative x 2 (list)

  7. Post #167
    Gold Member
    thejjokerr's Avatar
    December 2007
    2,113 Posts
    You kind of failed on that post.

    I knew it was a server, but if you added new blocks to the game, how would that work?
    Anyways, if you start adding blocks on the server, the client won't have a clue what to do with them and it wouldn't work the way you want it to.

  8. Post #168
    Would it be possible to somehow run Lua on the client too, for drawing stuff?

    That is when shit gets real.
    Reply With Quote Edit / Delete Reply Windows 7 United Kingdom Show Events Agree Agree x 1 (list)

  9. Post #169
    Gold Member
    thejjokerr's Avatar
    December 2007
    2,113 Posts
    Would it be possible to somehow run Lua on the client too, for drawing stuff?

    That is when shit gets real.
    No, as it's just a LuaServer. It would be awesome if someone made a client modification that allows for downloading of lua scripts though. And then runs and calls hooks 'n shit.

  10. Post #170
    Gold Member
    BlackAwps's Avatar
    July 2011
    767 Posts
    I started making a client once, but it's just too much to manage both.

    Reply With Quote Edit / Delete Reply Windows 7 United States Show Events Winner Winner x 5Funny Funny x 3 (list)

  11. Post #171
    Gold Member
    dije's Avatar
    December 2008
    4,754 Posts
    I started making a client once, but it's just too much to manage both.

    Please talk to "tobba" on steam...

    Naow

  12. Post #172
    Gold Member
    BlackAwps's Avatar
    July 2011
    767 Posts
    Almost ready to release the update to 1.0.1. Anything you guys want to see added?
    Reply With Quote Edit / Delete Reply Windows 7 United States Show Events Friendly Friendly x 1 (list)

  13. Post #173
    RusselG's Avatar
    February 2011
    608 Posts
    is there a version that runs on the client (as in replacing minecraft.jar)?

    also, how do you get the autorun to run on your normal minecraft, not the server?

  14. Post #174
    Gold Member
    thejjokerr's Avatar
    December 2007
    2,113 Posts
    is there a version that runs on the client (as in replacing minecraft.jar)?

    also, how do you get the autorun to run on your normal minecraft, not the server?
    No. Read a page or two back.

    Also: When will this become a Bukkit plugin?

  15. Post #175
    _axe_'s Avatar
    May 2007
    376 Posts
    A new garry has born :O
    Reply With Quote Edit / Delete Reply Windows 7 Netherlands Show Events Dumb Dumb x 1 (list)

  16. Post #176

    September 2011
    9 Posts
    Almost ready to release the update to 1.0.1. Anything you guys want to see added?
    - Chest and sign functions, for getting and changing the content of them both.

    - Don't know if you've already have a hook for when blocks are changing, but such a hook that returns a 'cause' (spread, decay, explosion, etc) that is cancellable would be sweet.

    - Some kind of serialization for tables.

    - Don't know whether it's possible or not, but sockets so that you can create an IRC echo bot, etc.

    - Some kind of priority system for hooks, so you can force a hook to be ran before all others.

    Probably more stuff that I'd like to see, I'll post here if I come up with something.

  17. Post #177
    Lead4u's Avatar
    December 2008
    53 Posts
    He's got signs already for this update.
    Reply With Quote Edit / Delete Reply Windows 7 United States Show Events Agree Agree x 1 (list)

  18. Post #178
    Gold Member
    BlackAwps's Avatar
    July 2011
    767 Posts
    - Chest and sign functions, for getting and changing the content of them both.
    Already in the next update for signs. I bet chests wouldn't be that hard to add.

    I've messed around with this before, the only problem was when terrain generated it overflowed the stack.. I'll have to look into it some more.

    - Don't know whether it's possible or not, but sockets so that you can create an IRC echo bot, etc.
    Would be something I would like to add in the future, but is not so high priority.

    - Some kind of priority system for hooks, so you can force a hook to be ran before all others.
    Can definitely agree on that and is something I would like to add.
    Reply With Quote Edit / Delete Reply Windows 7 United States Show Events Winner Winner x 1Friendly Friendly x 1 (list)

  19. Post #179
    jrj996's Avatar
    July 2009
    1,656 Posts
    Erm it's not updated to v1.0 yet, is it? :/

  20. Post #180
    Gold Member
    BlackAwps's Avatar
    July 2011
    767 Posts
    Erm it's not updated to v1.0 yet, is it? :/
    Not yet but hopefully soon. It's pretty much ready for a release now, but Stoned handles that.

    Here's the current changelog.

    Code:
    === Version 15: ===
    
    * Updated to 1.0.1
    * Fixed SQLQuery:Update checking for a string as an argument
    * Added FindMetaTable
    * Added args attacker and type to player.death and entity.death
    * Added lua commands to the help list
    * Added living:CanBreatheWater
    * Disabled Entity:GetMaxAir/SetMaxAir
    * Added living.GetAll
    * Changed ents.GetAll to actually return all entity types
    * Changed the way the Block global func works Block( vec, world )
    * Added requested Block:SetSignText/Block:GetSignText
    * Added hook player.updatesign( ply, block, lines )
    * Added Wolf:Set/Get/IsAngry
    * Added Wolf:Set/Get/IsSitting
    * Added World:GetSeed
    * Added Living:Get/MaxHealth
    * Fixed Player:Msg and Chat confusing strings as numbers
    * Added World:AddLightning( vec )
    * Added World:AddExplosion( vec, size )
    * Fixed http.Get forcing you to input a second table argument for custom headers
    * Added Block:GetChestContents()
    * Fixed os.time() being in milliseconds
    * Hooks now have a priority argument
    * Added Enums..
    ** HOOK_PRIORITY_LOWEST
    ** HOOK_PRIORITY_LOW
    ** HOOK_PRIORITY_NORMAL
    ** HOOK_PRIORITY_HIGH
    ** HOOK_PRIORITY_HIGHEST
    ** HOOK_PRIORITY_MONITIOR
    Reply With Quote Edit / Delete Reply Windows 7 United States Show Events Winner Winner x 1 (list)

  21. Post #181
    Gold Member
    LuaStoned's Avatar
    September 2007
    1,358 Posts
    Not yet but hopefully soon. It's pretty much ready for a release now, but Stoned handles that.
    I'll get on it when I get home from work. BlackOps said he fixed the bugs I encountered so it should roll out smoothly! :D

    Edited:
    Update is live!

  22. Post #182
    Gold Member
    BlackAwps's Avatar
    July 2011
    767 Posts
    Changelog for 15

    Code:
    === Version 15: ===
    
    * Updated to 1.0.1
    * Fixed SQLQuery:Update checking for a string as an argument
    * Added FindMetaTable
    * Added args attacker and type to player.death and entity.death
    * Added lua commands to the help list
    * Added living:CanBreatheWater
    * Disabled Entity:GetMaxAir/SetMaxAir
    * Added living.GetAll
    * Changed ents.GetAll to actually return all entity types
    * Changed the way the Block global func works Block( vec, world )
    * Added requested Block:SetSignText/Block:GetSignText
    * Added hook player.updatesign( ply, block, lines )
    * Added Wolf:Set/Get/IsAngry
    * Added Wolf:Set/Get/IsSitting
    * Added World:GetSeed
    * Added Living:Get/MaxHealth
    * Fixed Player:Msg and Chat confusing strings as numbers
    * Added World:AddLightning( vec )
    * Added World:AddExplosion( vec, size )
    * Fixed http.Get forcing you to input a second table argument for custom headers
    * Added Block:GetChestContents()
    * Fixed os.time() being in milliseconds
    * Hooks now have a priority argument
    * Added Enums..
    ** HOOK_PRIORITY_LOWEST
    ** HOOK_PRIORITY_LOW
    ** HOOK_PRIORITY_NORMAL
    ** HOOK_PRIORITY_HIGH
    ** HOOK_PRIORITY_HIGHEST
    ** HOOK_PRIORITY_MONITIOR
    * Added entity.explosion hook( entity, vec )
    Reply With Quote Edit / Delete Reply Windows 7 United States Show Events Winner Winner x 2Friendly Friendly x 1Useful Useful x 1 (list)

  23. Post #183
    jrj996's Avatar
    July 2009
    1,656 Posts
    Might I ask, like in old LuaServer what was the function for reloading the script?

  24. Post #184
    Gold Member
    BlackAwps's Avatar
    July 2011
    767 Posts
    Might I ask, like in old LuaServer what was the function for reloading the script?
    There is none and there's no need for one. Just include the file again.

  25. Post #185
    jrj996's Avatar
    July 2009
    1,656 Posts
    Erm, include? What do you mean? Sorry, lol

  26. Post #186
    Lead4u's Avatar
    December 2008
    53 Posts
    include("filename.lua")
    Reply With Quote Edit / Delete Reply Windows 7 United States Show Events Agree Agree x 1Friendly Friendly x 1 (list)

  27. Post #187

    September 2011
    9 Posts
    Hm, wasn't 'entity.explosion' supposed to be called when an creeper explodes? Because it doesn't seem to.

  28. Post #188
    Gold Member
    BlackAwps's Avatar
    July 2011
    767 Posts
    That's really weird. For whatever reason it's completely ignoring the code that creates the explosion entity, but if I move the hook out of the function it works fine. Well it will be fixed in the next update..

  29. Post #189
    jrj996's Avatar
    July 2009
    1,656 Posts
    I've been attempting to convert PData functions to here and it's not working so well...

    --[[ CODE TAKEN FROM GARRY'S MOD,
    I TAKE NO CREDIT FOR THIS METHOD OF SAVING DATABASE INFORMATION!]]--
    
    function SQLStr( str_in, bNoQuotes )
     
            local str = tostring( str_in )
           
            if ( str:find( '\\"' ) ) then
                    return
            end
           
            str = str:gsub( '"', '\\"' )
           
            if ( bNoQuotes ) then
                    return str
            end
           
            return "\"" .. str .. "\"";
     
    end
    
    
    local sql = sqlite.Connect("handler.db")
    if ( not sql:TableExists( "playerpdata" ) ) then
     
            sql:Query( "CREATE TABLE IF NOT EXISTS playerpdata ( infoid TEXT NOT NULL PRIMARY KEY, value TEXT );" )
           
    end
    
    _R.Player:GetPData = function( name, default )
     
            name = Format( "%s[%s]", self:Name(), name )
            local val = sql.QueryValue( "SELECT value FROM playerpdata WHERE infoid = " .. SQLStr(name) )
            if ( val == nil ) then return default end
           
            return val
     
    end
    
    _R.Player:SetPData = function( name, value )
     
            name = Format( "%s[%s]", self:Name(), name )
            sql.Query( "DELETE FROM playerpdata WHERE infoid = " .. SQLStr(name) )
            sql.Query( "INSERT INTO playerpdata ( infoid, value ) VALUES ( "..SQLStr(name)..", "..SQLStr(value).." )" )
     
    end
    

    Code:
    pcall: pcall: lua/autorun/Main_1.lua:30: function arguments expected
    Update:

    Fixed it, just made it
    function _R.Player:Dostuff(hi)
    But now it's telling me that
    Code:
    lua/autorun/Main_1.lua:42: attempt to call nil
    name = Format( "%s[%s]", self:Name(), name )

  30. Post #190
    Gold Member
    BlackAwps's Avatar
    July 2011
    767 Posts
    Format is a garrysmod specific function. Use string.format.

    Also, I would really not advise you to run queries that way.

    Do it like this if you want your inputs to be safe and not inject-able.

    local prepared = chestDB:CreateQuery( "SELECT value FROM playerpdata WHERE infoid=?" )
    prepared:SetString( 1, name )
    local results = prepared:Query()
    

    This automatically replaces the ? in the query with the escaped value of name rendering SQLStr no longer needed.

  31. Post #191
    Gold Member
    Kogitsune's Avatar
    September 2005
    2,830 Posts
    I would like to see the command object to have an exposed AddWithValue( string valname, obj value )
    like SqlParameterCollection in .Net.

    SqlParameterCollection.AddWithValue

    Would be simpler to join on a value and use it in a where clause without repeating code.


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

    Item and ItemStack are both missing SetDamage / SetMetaData even though previous changelogs state they are there, so things like repairing items are impossible.

  32. Post #192
    Gold Member
    BlackAwps's Avatar
    July 2011
    767 Posts
    I would like to see the command object to have an exposed AddWithValue( string valname, obj value )
    like SqlParameterCollection in .Net.

    SqlParameterCollection.AddWithValue

    Would be simpler to join on a value and use it in a where clause without repeating code.
    We use Java Database Connect to do the sql stuff and that's just how it does prepared statements. http://docs.oracle.com/javase/tutori.../prepared.html
    I don't think there's much I can do about changing how that works.

    Item and ItemStack are both missing SetDamage / SetMetaData even though previous changelogs state they are there, so things like repairing items are impossible.
    Stoned seems to have disabled it with the reason "// This doesn't quite work, items / blocks don't get spawned if you modify them"

    I tested them and enabled them again as they work fine.


  33. Post #193
    jrj996's Avatar
    July 2009
    1,656 Posts
    I know nothing about SQL so how would I go about returning the info?

    SQLStr returns an error everytime...

  34. Post #194
    Gold Member
    BlackAwps's Avatar
    July 2011
    767 Posts
    Reply With Quote Edit / Delete Reply Windows 7 United States Show Events Funny Funny x 1 (list)

  35. Post #195
    Gold Member
    LuaStoned's Avatar
    September 2007
    1,358 Posts
    Stoned seems to have disabled it with the reason "// This doesn't quite work, items / blocks don't get spawned if you modify them"

    I tested them and enabled them again as they work fine.

    Cool, back in .8 they were broken :D

  36. Post #196
    Gold Member
    Kogitsune's Avatar
    September 2005
    2,830 Posts
    I'm not familiar with what the server is capable of doing, but would it be possible to change the player's skin in real time? A simple script to turn a player into Herobrine comes to mind.
    Reply With Quote Edit / Delete Reply Windows 7 United States Show Events Disagree Disagree x 1 (list)

  37. Post #197
    Gold Member
    thejjokerr's Avatar
    December 2007
    2,113 Posts
    I'm not familiar with what the server is capable of doing, but would it be possible to change the player's skin in real time? A simple script to turn a player into Herobrine comes to mind.
    The minecraft client looks up the skin, by the name of each player. It simply takes the name and puts it in a URL, then downloads the skin.

    The only thing the server could do is fake the player name, in order for a different skin to show up.

  38. Post #198
    Gold Member
    Kogitsune's Avatar
    September 2005
    2,830 Posts
    NETHER constant seems to be incorrect.

    Code:
    pl:SetDimension( NETHER )
    Sends me to the end rather than the nether.

  39. Post #199
    Gold Member
    LuaStoned's Avatar
    September 2007
    1,358 Posts
    NETHER constant seems to be incorrect.

    Code:
    pl:SetDimension( NETHER )
    Sends me to the end rather than the nether.
    Yeah the update to 1.0 might cause that, thanks for noticing it!

  40. Post #200
    Gold Member
    Kogitsune's Avatar
    September 2005
    2,830 Posts
    Seems that player.wakeup isn't being called.

    local function PlayerWakeUp( pl )
    	pl:SetHealth( 20 )
    	Chat( ply:Nick( ) .. " woke up!" )
    end
    
    hook.Add( "player.wakeup", "FullHeal.WakeUp", PlayerWakeUp )

    In autorun, no errors, but nothing happens when I advance time by using a bed. Was this hook only meant to be called when the player was forced awake by a mob?