• New to Derma, am I just stupid?
    22 replies, posted
So, ingame, I am running some commands to test making a frame because well I've never taken the time to mess with derma, but now I need to... Here's what I'm doing from console and the output, can anyone tell me what I am doing wrong? ] lua_run_cl DermaPanel = vgui.Create("DFrame"); ] lua_run_cl DermaPanel.SetPos(50,50) [@LuaCmd:1] bad argument #1 to 'SetPos' (Panel expected, got number)
Yes you are stupid. Go to lua/autorun/client/ create a file called Whatsoever.lua Then put the code in there, then save it.
lua_run_cl doesn't save from command to command. lua_Run does. But it's serverside.
Oh ok, [editline]7th March 2011[/editline] Well I just did what you said, in a file and it is still giving the same error?
It's Dermapanel[b]:[/b]SetPos. Don't use a dot. [editline]7th March 2011[/editline] Also don't forget to set the size.
And if you want to open it trough the console use concommand.Add("Whatsoever", FunctionName)
[url=http://www.google.com/url?sa=t&source=web&cd=3&ved=0CCYQFjAC&url=http%3A%2F%2Fwiki.garrysmod.com%2F%3Ftitle%3DGuide_to_Derma&ei=gDt1TfymENCwhAeY5ZW9DA&usg=AFQjCNH5yDTCLDVm4_j4d-9OLVOJeC2g5A]Derma Guide - Wiki[/url] The wiki is your friend.
Just for future reference, everytime you use a "." instead of a ":" you have to put the thing you are modifying as the first argument. So this would also work, but just be redundant to do: DermaPanel.SetPos( DermaPanel, 50, 50 ) [editline]7th March 2011[/editline] [QUOTE=Persious;28475351]Yes you are stupid. Go to lua/autorun/client/ create a file called Whatsoever.lua Then put the code in there, then save it.[/QUOTE] Also, don't bash the guy, at least he's not as ignorant as this person: [url]http://www.facepunch.com/threads/1066242-Change-player-model-Individual-based-on-steamID[/url]
He asked if he was stupid and I just told him that he was stupid because he asked if he was. :>
Thanks for all the help, I have been messing with too many languages, and havent been on lua for a while lol... Remembering multiple syntaxes SUCKS
[QUOTE=Persious;28475351]Yes you are stupid.[/QUOTE] no need to be a cunt
Everyone listen to Jova! No, seriously, I can do what ever I want.
[QUOTE=Persious;28515685]Everyone listen to Jova! No, seriously, I can do what ever I want.[/QUOTE] I don't think overv would agree to that :v:
[QUOTE=Persious;28515685]Everyone listen to Jova! No, seriously, I can do what ever I want.[/QUOTE] Where's the "Autistic" rating when you need one :P
[QUOTE=chief2493;28475339]So, ingame, I am running some commands to test making a frame because well I've never taken the time to mess with derma, but now I need to... Here's what I'm doing from console and the output, can anyone tell me what I am doing wrong? ] lua_run_cl DermaPanel = vgui.Create("DFrame"); ] lua_run_cl DermaPanel.SetPos(50,50) [@LuaCmd:1] bad argument #1 to 'SetPos' (Panel expected, got number)[/QUOTE] why would you use lua_run >.< use usermessages or concommands
or just take 2 seconds to create a lua file in autorun and do it that way. I find that much easier.
[QUOTE=Jova;28521034]Where's the "Autistic" rating when you need one :P[/QUOTE] I want to find it myself ):
I find it amusing that everyone in this thread who acts like they know something have been wrong except for Staneh and Chief Tiger:laugh:
[QUOTE=Andriko1;28522381]why would you use lua_run >.< use usermessages or concommands[/QUOTE] You seriously have no idea what you're talking about, do you?
I'd suggest Luapad. Just make sure to keep another backup every now and then, or you might click the close button and lose all your work.
[QUOTE=whosdr;28563196]I'd suggest Luapad. Just make sure to keep another backup every now and then, or you might click the close button and lose all your work.[/QUOTE] If you use luapad make sure you have the SVN as many people have gotten bugs in the version from garrysmod.org
[QUOTE=Freze;28475373]lua_run_cl doesn't save from command to command. lua_Run does. But it's serverside.[/QUOTE] Are you sure...? The first command given in the OP makes a global variable, surely that should be persistent between different executions of the command? If what you said is true, the second command should get an "attempt to index a nil value" error But either way the . in the second line should be a : The story behind these two notations is that object:myFunction(a, b, c) is equivalent to object.myFunction(object, a, b, c). The SetPos function is actually expecting three arguments, the first being the object you're calling the function on. If you do DermaPanel.SetPos(0, 0) the first argument is a number, so it breaks. This notation is used so that objects have a reference to themselves when you call functions on them. It's a way of getting something like the "this" keyword from Java.
[QUOTE=zzaacckk;28565775]If you use luapad make sure you have the SVN as many people have gotten bugs in the version from garrysmod.org[/QUOTE] I've yet to have any problems with any I've downloaded. Well, Wire fixes any errors it did have by replacing the broken string functions.
Sorry, you need to Log In to post a reply to this thread.