Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Topics - roastchicken

Pages: [1]
1
Developers Corner / Recommended FTP clients
« on: October 03, 2016, 04:29:28 AM »
Recently I've run into a bit of an issue with my FTP client, WinSCP, activating auto-refresh twice each time I edit a file. I originally thought auto-refresh is just bugged, but after doing a bit of digging I've discovered that it's most likely caused by the way WinSCP saves files. Apparently it's semi-common practice to overwrite a file with nothing, and then write the actual contents. Why this is a thing, I'm not sure. But what I do know is that auto-refresh picks up on this first 'blank slate' write and as a result ends up refreshing the file twice. This makes it difficult to manage modules and includes because they don't take kindly to being run multiple times.

So I'm wondering: has anyone else had this problem? Did you end up fixing it? Was it the FTP client after all, or was there something else to blame?

But mainly, I'm looking for suggestions for good FTP clients (that don't suffer from double-auto-refresh syndrome, ideally). I've heard that FileZilla has file corruption problems, so I'd also like to avoid that if possible.

2
Developers Corner / UDodge 2016
« on: July 21, 2016, 03:01:12 PM »
I've been working a bit on UDodge, and I've gotten it to work without erroring, but I've run into a problem with the timed removal of the combine balls. The current code has an 'expire time' after which the pylon is removed from the pylons_firing table. Why is this? I don't understand the purpose of removing it from the table after a delay, because it prevents the combine ball removal code from running and the map gets filled with them. Hopefully you can remember your logic for this Megiddo.

The repo is on GitHub, and the code in question is in lua/entities/pylon/init.lua, if anyone wants to take a crack at it.

3
Developers Corner / UCL to SQL Discussion
« on: February 08, 2016, 09:02:38 PM »
General Description

A frequent problem people come to these forums to ask for help with is malfunctioning/laggy UCL (users and groups). For those not aware, users and groups are stored in text files (garrysmod/data/ulib/ users.txt and groups.txt). This works just fine for most servers. However, as the amount of users (or groups for that matter, but usually users are the ones that get out of control) increases problems start to arise. There doesn't seem to be a distinct cut off, but after a certain point the server starts to lag when trying to change permissions or change a user's group. Sometimes there are even more serious problems like users being randomly dropped from groups.

It's been mentioned a few times that switching to SQL (SQLite specifically, the only SQL solution supported natively by Garry's Mod) would likely mitigate many, if not all, of these problems. In addition to playing nicely with large amounts of users, switching to SQL will (I'm pretty sure) speed up reading/writing users and groups in addition to making them easier to work with (no more json with no particular order! yay!).

Moving UCL to SQLite hasn't been a priority for the Ulysses developers for a few reasons (according to Megiddo):

1. When we designed UCL, we never intended people to add every single user to join. I still don't see why people are doing this, though we definitely empathize that if you want to do so, ULib is not your friend. However, since a minority of users are doing this, it is not a priority change for us.
2. Time, though secondary to #1.
3. We are trying to shift efforts to ULX4. Any time spent doing this is time not spent working on ULX4 -- and because of #1, ULX4 is more important to us.

I recently (a little over two weeks ago ;D) offered to make the switch from flatfile (text files) to SQL. I decided it might be useful to make this topic to discuss the change, since it is pretty major and I don't want to make any glaring errors. Feel free to ask questions, express concerns, share ideas, or just discuss the idea in general.

Side note: don't get your hopes up if you have a ton of users or just want UCL to switch to SQL. I'm a chronic procrastinator and it is very likely quite possible that I will never finish this project. Fingers crossed.

4
General Chat & Help and Support / Paid Addon for UTime
« on: January 16, 2016, 06:16:11 PM »
Someone named Google is selling an addon on ScriptFodder that adds a ULX menu displaying the times of people. According to the UTime repo, UTime is licensed under the Creative Commons Attribution-NonCommercial-ShareAlike 3.0 License. I'm not sure if that would apply to this, because it's something built on top of UTime, not modifying it per say, but I wanted to let you guys know in case you aren't okay with this.

5
Developers Corner / ULX Logging Jailbreak Rounds
« on: September 17, 2015, 01:40:13 PM »
Hi,

I'm trying to add the logging of rounds in Excl's jailbreak to ULX. I've looked through the log.lua file and it seems that the function is just ulx.logWriteLn( string ). However when I try to call this function in a hook, ULX seems to freak out and stop function. When the server first starts or the map changes it spams console with about 10 "invalid command" messages. The other error I've noticed is that fancyLogAdmin is nil, making most commands not work. This error only appears when you try to run a command the uses the fancyLog function.

It's even stranger because just commenting out the lines won't fix it. I've needed to completely delete the file and restart the server for ULX to start functioning again. My full code is below, if anyone has any idea as to why this might be happening please do share. This is going in garrysmod/addons/customulxcommands/lua/ulx/log.lua

Code: Lua
  1. hook.Add( "JailbreakRoundStart", "ULXLogJBRoundStart", function( gamemode, rounds )
  2.   ulx.logWriteLn( string.format( "Round %i is starting.", rounds ) )
  3. end )
  4. hook.Add( "JailbreakRoundEnd", "ULXLogJBRoundEnd", function( gamemode, rounds )
  5.   ulx.logWriteLn( string.format( "Round %i is ending.", rounds ) )
  6. end )

And this might be helpful, here are the hook.Call functions for each of those hooks:

Code: Lua
  1. hook.Call("JailBreakRoundStart",JB.Gamemode,JB.RoundsPassed)
  2. hook.Call("JailBreakRoundEnd",JB.Gamemode,JB.RoundsPassed);

JB.RoundsPassed is a non-zero positive integer, and JB.Gamemode is just a master table of sorts for the gamemode.

6
Developers Corner / Override ULX command
« on: September 12, 2015, 08:04:16 PM »
Hi,

I'm trying to override a default ulx command (ulx.mute) without changing any ulx files. I tried just creating a new function and calling the ulx.command function but that brings up errors in the console and neither command ends up working. Is there any way to override a command without removing the original command's code?

7
Developers Corner / [XGUI] Opening Client Settings tab via command
« on: June 30, 2015, 03:46:26 AM »
I am trying to create a command that when run will open a certain submodule in the client settings. My latest attempt was to just copy+paste the code of the function that is called when a row is selected, but I get the same error as with previous tries:
Code: [Select]
[ERROR] addons/ulx/lua/ulx/modules/cl/xlib.lua:1113: attempt to index field 'panel' (a nil value)
I assume this is because I am setting nPanel to the wrong thing. I have tried the name of a submodule ("General Settings") and the acutal panel (genpnl) but neither seem to work.

Here is the function I copy+pasted, it is in addons/ulx/lua/ulx/xgui/settings/client.lua:
Code: [Select]
function changeClientSettingsTab( nPanel )
if nPanel ~= client.curPanel then
nPanel:SetZPos( 0 )
xlib.addToAnimQueue( "pnlSlide", { panel=nPanel, startx=-435, starty=0, endx=0, endy=0, setvisible=true } )
if client.curPanel then
client.curPanel:SetZPos( -1 )
xlib.addToAnimQueue( client.curPanel.SetVisible, client.curPanel, false )
end
xlib.animQueue_start()
client.curPanel = nPanel
else
xlib.addToAnimQueue( "pnlSlide", { panel=nPanel, startx=0, starty=0, endx=-435, endy=0, setvisible=false } )
self:ClearSelection()
client.curPanel = nil
xlib.animQueue_start()
end
if nPanel.onOpen then nPanel.onOpen() end --If the panel has it, call a function when it's opened
end

And here is the code where I call that function, located in addons/ulx/lua/ulx/modules/cl/xgui_client.lua:
Code: [Select]
ULib.cmds.addCommandClient( "ulx opentab", function( ply, cmd, args )
                                            xgui.show( "client" )
                                            changeClientSettingsTab( genpnl )
                                          end )

Any help is appreciated!

8
Developers Corner / Using XLib in XGUI settings module
« on: June 19, 2015, 06:35:05 AM »
I made a settings panel for UTime, and it works fine if it is in the actual ulx addon folder. However when I try to package it as it's own addon it give me a console error saying that it 'xlib' is a nil value. This is strange to me because I had a look at another XGUI settings panel (Apple's XGUI version of autopromote) and it doesn't seem to do anything special in order to use xlib functions, but it doesn't give me any console errors. The even weirder thing is that my addon seems to work fine, even with the error.

Full error:
Code: [Select]
[ERROR] addons/ulx/lua/ulx/modules/cl/utimesettings.lua:1: attempt to index global 'xlib' (a nil value)
  1. unknown - addons/ulx/lua/ulx/modules/cl/utimesettings.lua:1
   2. include - [C]:-1
    3. unknown - addons/ulx/lua/ulx/cl_init.lua:12
     4. include - [C]:-1
      5. unknown - addons/ulx/lua/ulib/modules/ulx_init.lua:4
       6. include - [C]:-1
        7. unknown - addons/ulib/lua/ulib/cl_init.lua:23
         8. include - [C]:-1
          9. unknown - addons/ulib/lua/autorun/ulib_init.lua:5

Full addon code, located in /addons/utime-xgui-settings/lua/ulx/xgui/settings/cl_utimesettings.lua:
Code: [Select]
local utimepnl = xlib.makepanel{ parent=xgui.null }

function makeutimecolorpicker( t )
  local pnl = vgui.Create( "xlibColorPanel", t.parent )
  pnl:SetPos( t.x, t.y )
  xlib.checkRepCvarCreated( t.repconvar .. "_r" )
  xlib.checkRepCvarCreated( t.repconvar .. "_g" )
  xlib.checkRepCvarCreated( t.repconvar .. "_b" )
  local colR = GetConVar( t.repconvar .. "_r" ):GetInt()
  local colG = GetConVar( t.repconvar .. "_g" ):GetInt()
  local colB = GetConVar( t.repconvar .. "_b" ):GetInt()
  pnl:SetColor( Color( colR, colG, colB ) )
  function pnl.ConVarUpdated( sv_cvar, cl_cvar, ply, old_val, new_val )
    if cl_cvar == t.repconvar .. "_r" then
      pnl:SetColor( Color( new_val:GetInt(), colG, colB ) )
    end
    if cl_cvar == t.repconvar .. "_g" then
      pnl:SetColor( Color( colR, new_val:GetInt(), colB ) )
    end
    if cl_cvar == t.repconvar .. "_b" then
      pnl:SetColor( Color( colR, colG, new_val:GetInt() ) )
    end
  end
  hook.Add( "ULibReplicatedCvarChanged", "XLIB_" .. t.repconvar, pnl.ConVarUpdated )
  function pnl:OnChangeImmediate( color )
    RunConsoleCommand( t.repconvar .. "_r", color.r )
    RunConsoleCommand( t.repconvar .. "_g", color.g )
    RunConsoleCommand( t.repconvar .. "_b", color.b )
  end
end

xlib.makelabel{ x=10, y=5, label="Outside color:", parent=utimepnl }
makeutimecolorpicker{ x=10, y=20, repconvar="utime_outsidecolor", parent=utimepnl }

xlib.makelabel{ x=145, y=5, label="Inside color:", parent=utimepnl }
makeutimecolorpicker{ x=145, y=20, repconvar="utime_insidecolor", parent=utimepnl }

xlib.makelabel{ x=10, y=155, label="Outside text color:", parent=utimepnl }
makeutimecolorpicker{ x=10, y=170, repconvar="utime_outsidetext", parent=utimepnl }

xlib.makelabel{ x=145, y=155, label="Inside text color:", parent=utimepnl }
makeutimecolorpicker{ x=145, y=170, repconvar="utime_insidetext", parent=utimepnl }

xlib.makecheckbox{ x=280, y=5, w=150, label="Enable UTime window", convar="utime_enable", parent=utimepnl }

xlib.makelabel{ x=280, y=20, label="X Position:", parent=utimepnl }
xlib.makeslider{ x=280, y=30, w=160, label="<--->", min=0, max=100, decimal=1, repconvar="utime_pos_x", parent=utimepnl }

xlib.makelabel{ x=280, y=45, label="Y Position:", parent=utimepnl }
xlib.makeslider{ x=280, y=55, w=160, label="<--->", min=0, max=100, decmial=1, repconvar="utime_pos_y", parent=utimepnl }

xgui.addSubModule( "UTime Settings", utimepnl, nil, "client" )

9
Releases / [Fun] SetSpeed - Set individual player's running speed!
« on: July 11, 2014, 04:50:29 AM »
Hey guys,

This is just a small ulx module that I hacked together for use on my own server. I don't actually know how to give you guys an easy way to put it on your server. I just added at the end of fun.lua, because I'm a rebel (seriously guys how do I do this? this seems really hackey.)

Anyways just copy and paste it to the end of your fun.lua or someone can explain to me how ulx modules should be added on.

Code: [Select]
------------------------------ Speed ------------------------------
function ulx.runspeed( calling_ply, target_plys, amount )
        for i=1, #target_plys do
                target_plys[ i ]:SetRunSpeed( amount )
        end
        ulx.fancyLogAdmin( calling_ply, "#A set the running speed for #T to #i", target_plys, amount )
end
local runspeed = ulx.command( CATEGORY_NAME, "ulx runspeed", ulx.runspeed, "!runspeed" )
runspeed:addParam{ type=ULib.cmds.PlayersArg }
runspeed:addParam{ type=ULib.cmds.NumArg, min=250, max=2000, hint="runspeed", ULib.cmds.round }
runspeed:defaultAccess( ULib.ACCESS_ADMIN )
run speed:help( "Sets the running speed for target(s)." )

10
Developers Corner / Colored ranks
« on: July 10, 2014, 05:45:26 PM »
I was wondering how I would go about giving different groups colored names in the scoreboard and chat? (btw this is deathrun gamemode) I would look for a function in gmod, but the gmod wiki is a bit... weird. I know there is a Player.SetWalkSpeed function, but I can't find it anywhere in the list of functions on the wiki.

Any and all help appreciated!

11
Developers Corner / Player.SetRunSpeed
« on: July 10, 2014, 06:52:53 AM »
Hey guys,

I am the "developer" for a new server. You can't really call me a developer. I google crap until I figure it out, and the server owner acts like I'm a god because he has no idea how to internet, let alone anything to do with technical stuff.

Anyways, he saw on another server they had a ULX mod that allowed you to set players walk and run speeds. There was a selection menu similar to the psay menu, and then there were to sliders, similar to the sliders for changing gravity.

There was a mod that did something like this called SuperPowers, but that was in 2010 and the download link is long gone. So I was wondering if anyone could give me some guidance as to how to make a mod of ULX. I know the very very basics such as functions and hooks, but I'm not really sure how to do the sliders and selection menus or really how to integrate it with ULX. I read the ULib docs, but that doesn't seem to help with ULX.



Okay, so I've looked around in my server files, and I think I've found the place where the "modules" are declared. addons/ulx/lua/ulx/modules is pretty intuitive. It seems that hp is the simplest example of what I want to do, just have you choose a player and set a variable. The problem I have is I can't seem to find the graphical side. I have looked in xgui and those modules, but I can't find a place where hp sets up it's client side.



Still haven't found the graphical stuff, but I'm just going to assume it is un-needed for now, as I just pretty much copy-pasted the hp code and changed it to work for Player.SetRunSpeed. No idea if this will majorly screw up the server, but I'm going to put it at the bottom of fun.lua and try it anyways.

Code: [Select]
------------------------------ Speed ------------------------------
function ulx.runspeed( calling_ply, target_plys, amount )
        for i=1, #target_plys do
                target_plys[ i ]:SetRunSpeed( amount )
        end
        ulx.fancyLogAdmin( calling_ply, "#A set the running speed for #T to #i", target_plys, amount )
end
local runspeed = ulx.command( CATEGORY_NAME, "ulx runspeed", ulx.runspeed, "!runspeed" )
runspeed:addParam{ type=ULib.cmds.PlayersArg }
runspeed:addParam{ type=ULib.cmds.NumArg, min=250, max=2000, hint="runspeed", ULib.cmds.round }
runspeed:defaultAccess( ULib.ACCESS_ADMIN )
run speed:help( "Sets the running speed for target(s)." )

Thanks,

roastchicken

Pages: [1]