My Derma menu, (LUA)

Started by CortezV, 12-11-2009

0 Members and 2 Guests are viewing this topic.

CortezV

// Move this to its own lua text later, and add model selection.
// The menu below isn't Derma, which would be much easier to do, but Derma is limited.

function CharacterScreenVGUI
local CharacterScreen:SetPos( 1,1)
     CharacterScreen:SetSize ( 500,000 )
     CharacterScreen:SetTitle ( "Character Creation" )
     CharacterScreen:SetDraggable ( true )
     CharacterScreen:SetVisible ( true )
     CharacterScreen:ShowCloseButton ( true )
     CharacterScreen:MakePopup()
     
     end
     
     concommand.Add("rp_selectchar", CharacterScreenVGUI )
     
local CharacterSelection = vgui.Create ( "Character Selection" ) //Yes, its different then selection.
        CharacterSelection:SetPos( 50,50 )
        CharacterSelection:SetSize( 500, 500 )
        CharacterSelection:SetTitle( "Character Selection" )
        CharacterSelection:SetVisible( true )
        CharacterSelection:SetDragable( true )
        CharacterSelection:ShowCloseButton( true )
        CharacterSelection:MakePopup() // this will show the frame, its needed.

// this is derma, and I used a variable from an earlier tutorial to remind myself where the menu starts.
     
local DermaButton = vgui.Create( "DButton")
     DermaButton:SetParent( CharacterSelection )
     DermaButton:SetText( "Press Okay to continue.")
     DermaButton:SetPos( 10,30 )
     DermaButton:SetSize( 20,50 )
     DermaButton.DoClick = function ()
       RunConsoleCommand ( "rp_SelectChar" ) // Console command created, thats what this is.
   end
   
    local SystemButtonThingOne = vgui.Create("DSysButton", DermaPanel)
          SystemButtonThingOne:SetPos( 10,30 )
         SystemButtonThingOne:SetSize( 20,50 )
         SystemButtonThingOne:SetType( "close")
         SystemButtonThingOne.DoClick = function()
    Msg("Welcome to the server.\n")
     end
     
     local AdminPanel = vgui.Create ( "AdminPanel" ) //Yes, its different then selection.
     AdminPanel:SetPos( 50,50 )
     AdminPanel:SetSize( 500, 500 )
     AdminPanel:SetTitle( "Administration Panel" )
     AdminPanel:SetVisible( true )
     AdminPanel:SetDragable( true )
     AdminPanel:ShowCloseButton( true )
     
local AdminPanelC = vgui.Create( "DCheckBoxLabel", DermaPanel )
     AdminPanelC:SetPos( 10,50 )
     AdminPanelC:SetParent("AdminPanel")
     AdminPanelC:SetText( "God Mode" )
     AdminPanelC:SetConVar( "Gear_godmode" ) // reason its not sandbox_godmode, is because I'm using Gear.
     AdminPanelC:SetValue( 1 )
     AdminPanelC:SizeToContents()
   
   end
   
   concommand.Add("rpa_AdminPanel", AdminPanel)
   
   local AdminCommandBox = vgui.Create( "DCheckBoxLabel" )
   AdminCommandBox:SetText( "Player Damage" )
   AdminCommandBox:SetConVar( "Gear_plpldamage" )
  AdminCommandBox:SetValue( 1 )
  AdminCommandBox:SizeToContents()
AdminPanel:AddItem( AdminCommandBox )

   local AdminCommandBox2 = vgui.Create( "DCheckBoxLabel" )
   AdminCommandBoxTwo:SetText( "Fall Damage" )
   AdminCommandBoxTwo:SetConVar( "mp_falldamage" )
   AdminCommandBoxTwo:SetValue( 1 )
   AdminCommandBoxTwo:SizeToContents()
DermaList:AddItem( AdminCommandBoxTwo )

   local AdminCommandBoxThree = vgui.Create( "DCheckBoxLabel" )
            AdminCommandBoxThree:SetText( "Noclip" )
            AdminCommandBoxThree:SetConVar( "Gear_noclip" )
            AdminCommandBoxThree:SetValue( 1 )
            AdminCommandBoxThree:SizeToContents()
            DermaList:AddItem( AdminCommandBoxThree )

//Changed it too AdminCB still stands for the AdminCommandBox
   local AdminCBFour = vgui.Create( "DCheckBoxLabel" )
            AdminCBFour:SetText( "All Talk" )
            AdminCBFour:SetConVar( "sv_alltalk" )
            AdminCBFour:SetValue( 1 )
            AdminCBFour:SizeToContents()
            DermaList:AddItem( AdminCBFour )

   local AdminCBFive = vgui.Create("DSysButton", DermaPanel)
            AdminCBFive:SetType( "close" )
            AdminCBFive.DoClick = function()
       RunConsoleCommand("sv_password", "toyboat")
   end
   AdminCBFive.DoRightClick = function()
       RunConsoleCommand("sv_password", "ServerPasswordForLater") //The password for later.
   end
DermaList:AddItem( AdminCBFive )

   local AdminCBSix = vgui.Create( "DNumSlider" )
            AdminCBSix:SetSize( 150, 50 )
            AdminCBSix:SetText( "Max Props" )
            AdminCBSix:SetMin( 0 )
            AdminCBSix:SetMax( 256 )
            AdminCBSix:SetDecimals( 0 )
           AdminCBSix:SetConVar( "Gear_maxprops" )
DermaList:AddItem( AdminCBSix )

end



==================
This is Lua Script, my Derma Menu.
Lua is basically just C++ Unformatted which I love
also preset commands such as

player.health
player.damage
player.god
player.weapon

Guess what this goes under you win a cookie.

init.lua
shared.lua
cl_init.lua

those are called libraries, I could link two other lua files to it, such as I could make a completely new lua script, and want ti to be under... cl_init
well, what I'd have to do is.

include( "cl_init.lua") or include ( "cl_init" )

blah  blah.

For SilverKnight: This is why Rick Dark makes his own scripts, instead of using others, I've relised how big of a absolute pain in the ass it is to have to read over someone else's script and edit the commands and variables to fit your own and make it as messy as hell when you can start off on a clean slate and make your own, Yes it takes a while, but by the time your done, your proud of what you've accomplished. I cannot go through someone else's script, I've tried, Its too messy, and I hate reading the table codes and libraries.


Thom's Law
"Nothing can not produce something. If there was ever a time when there was nothing, there would STILL be nothing."

Silver Knight

#1
It's using Gear, its not from scratch, and don't get high and mighty with me cortez your a noobie coder. Just because you copied shit from wiki doesn't mean you can code. Much less judge me on my code or using cakescript as a base.

Also on a side note:

Guess what this goes under you win a cookie.

init.lua
shared.lua
cl_init.lua

those are called libraries, I could link two other lua files to it, such as I could make a completely new lua script, and want ti to be under... cl_init
well, what I'd have to do is.

include( "cl_init.lua") or include ( "cl_init" )

No fucking shit boy? You want me to stick you in preschool, it's nothing special to know that those are the 3 main lua files in a script. Cortez sit down and get over your little "i can code" ego. Even Locke knows more than you.

Quotebreslau: if i cant cheat i dont wanna play
breslau: period

LinkinEleven

#2
Silverknight, the only thing you've done with Lemonade script was remove the models and add your stalker and changed around some values, using Derive Gamemode Gear  is the same as using sandbox, its moding from scratch. You have no choice but to use a Derive Gamemode,

Silverknight, I have to tell you, after going through radscript, you don't know anything, I know more then you, If I gave you a pathing algorithm for NPC's you probably wouldn't have any idea what to do with it. So silverknight, using Lemonade script and changing a few words and numbers around Isn't scripting, you always critize other scripts from scatch when you can't do it yourself, I have made a script from scratch and your using lemonade script, i'm going to make this very clear for you

YOU. CANNOT. SCRIPT.

This is like me using tacoscript two and doing what kahn did, change the values and varibles, all you did was attempt to disguise Lemonade script into your own. You didn't make lemonade script, you changed the name of it. I can do the same silverknight, I can take someone elses script and slap my name onto it as well.

If you don't understand what Gear is, then you shouldn't even bother with scripting silverknight, you always ask for proof of ours, well I've given you a Derma menu at least, you've given us changed values and replaced words

Removed the formatting, he like to use caps because he wants to try and make his invalid point stronger.

Silver Knight

It took you 3 edits to write aload of bullshit, down boy, put that ego away!

Quotebreslau: if i cant cheat i dont wanna play
breslau: period

Plunger

#4
Quote from: LinkinEleven on 15-11-2009
Silverknight, the only thing you've done with Lemonade script was remove the models and add your stalker and changed around some values, using Derive Gamemode Gear  is the same as using sandbox, its moding from scratch. You have no choice but to use a Derive Gamemode,

Silverknight, I have to tell you, after going through radscript, you don't know anything, I know more then you, If I gave you a pathing algorithm for NPC's you probably wouldn't have any idea what to do with it. So silverknight, using Lemonade script and changing a few words and numbers around Isn't scripting, you always critize other scripts from scatch when you can't do it yourself, I have made a script from scratch and your using lemonade script, i'm going to make this very clear for you

YOU. CANNOT. SCRIPT.

This is like me using tacoscript two and doing what kahn did, change the values and varibles, all you did was attempt to disguise Lemonade script into your own. You didn't make lemonade script, you changed the name of it. I can do the same silverknight, I can take someone elses script and slap my name onto it as well.

If you don't understand what Gear is, then you shouldn't even bother with scripting silverknight, you always ask for proof of ours, well I've given you a Derma menu at least, you've given us changed values and replaced words

Removed the formatting, he like to use caps because he wants to try and make his invalid point stronger.

Is this Cortez?

Steel

Wow harsh words their eh.
What a knob.
I couldnt care less about the scripting and what not, i enjoy RAD for what it is, thats all that bothers me.

Silver Knight

Everyone knows it's cakescript at the core, it's by far my favorite script to use, and im going to continue to use it, as theres nothing better out there.

As Ryaga said, why make something from scratch, when theres a perfect script already premade, and it's served us right so far. Ive spent countless hours on the script, it's my own "Modification, Version" Script, not to say that Nori/Looter played no part in it, after all Looters prop inventory is still in here (For now). But when someone judges you like this, they really need to think about what they are saying.

There are hundreds of edits of DarkRP and Tacoscript, much changed into another, it literally becomes another script, and belongs to that partys interlectual property. Cortez has alot of growing up to do if he continues to think i cannot "code/script" i have the handicap of leading a huge network, and not having much freetime. Whereas kids like rick dark do nothing all day other than post meme's and troll each other.


Quotebreslau: if i cant cheat i dont wanna play
breslau: period

Tunddruff

Thats kinda mean, even if you are editing, ITS STILL SCRIPTING.

BUt even then, to put together what silver has done (all alone D:) is still impressive.

Silver Knight

Quote from: Tunddruff on 15-11-2009
Thats kinda mean, even if you are editing, ITS STILL SCRIPTING.

BUt even then, to put together what silver has done (all alone D:) is still impressive.

It's sad to see someone who people considered a friend, abandon HGN for 2-3 days after attacking it with a "music script" and declaring it was not him. Then proceed to come back under different names, and expect everything to be alright. Then tell Me that i cannot code and that he can code better than me. Directly insulting my abilities on my own forums and spreading crap.

Then he has the guts to try and get Stan to blackmail me into apologising to him else Stan would take out our servers.

Quotebreslau: if i cant cheat i dont wanna play
breslau: period

Jazer

#9
To keep this whole argument simple, making gamemodes from scratch is harder and takes way longer. It's much easier to use a base and edit it. I wouldn't care if I had the ability to make fun gamemodes, and that's pretty the same situation Silver is in.

As for Cortez, I really don't know what is up with you, you liked HGN, yet you played music on the server which is not allowed and you cannot justify yourself by saying it was harmless fun, it's just a rule that you cannot do that. You're also starting to look like an attention whore going around talking about lua with everyone. Every time you do it, I can't help but get the impression that you are begging for everyone's approval that you're useful. You've barely scraped the tip of the iceberg in lua.

By the way, seeing that Silver has been casually learning lua for almost 2 years, and you, for about 2 weeks or less, I think you are being far too presumptuous. There is a lot more to it then what you have seen Silver done. Just because the only thing you have seen Silver do is switch out models in lua, doesn't mean that's all he knows. I have asked him different lua questions in the past and he knows more than you think he does. 


Dug

Quote from: The Jackal on 16-11-2009
Seriously cortez, just fuck off, your not wanted here, no one wants to hear your shit you immature twat.
Seriously, if your that good, go and make your own community, because im tired of your shit, your ruining the fun for everyone else.
I think i speak for everyone else when i say this: FUCK OFF

You speak for me then mate ;D

As for your Cortez, just go away dude, no one likes you, you got the attention but it's the bad kind.
As he said make your own community, your own game mode, then come back and start saying shit.
If I was you , I don't know what I would do. Probably because I would never do what you did.
No one would except the immature twats that run around and destroy communities.
If it's attention you are seeking, then man up, go out and get some friends.
And if that isn't enough then there are other means of attention which can be payed for.

To make this all short.


GTFO

Lucidius

Derma menu? More like Drama Menu.

I'll take an appetizer of pre-pubescent teen angst with a side of no life. And for a drink, a nice tall glass of attention whore.
Please check out my other suggestions for PS2. Click 'Like' if you agree!

!IMPORTANT! Empire Specific Fighters and the Empire Specific Weapons. Overview, tweeks and nerfs! BIG POST

My Profile[/b][/size]

Silver Knight

Quote from: Lucidius on 17-11-2009
Derma menu? More like Drama Menu.

I'll take an appetizer of pre-pubescent teen angst with a side of no life. And for a drink, a nice tall glass of attention whore.

He copied it from gear and gmod wiki, it's not even his XD

Quotebreslau: if i cant cheat i dont wanna play
breslau: period

Horsey

I bet I can beat any of you.

Besides, I've spotted a few good mistakes in Cortez's post.

NeoHazardmktwo

#14
Am I the only one that noticed that some of the code goes

local blah blah

end

and some don't have an end?

I know that some of them are after a method but not all of them

like

local CharacterScreen:SetPos( 1,1)
     CharacterScreen:SetSize ( 500,000 )
    CharacterScreen:SetTitle ( "Character Creation" )
    CharacterScreen:SetDraggable ( true )
    CharacterScreen:SetVisible ( true )
    CharacterScreen:ShowCloseButton ( true )
    CharacterScreen:MakePopup()
   
    end

has an end but

local CharacterSelection = vgui.Create ( "Character Selection" ) //Yes, its different then selection.
        CharacterSelection:SetPos( 50,50 )
        CharacterSelection:SetSize( 500, 500 )
        CharacterSelection:SetTitle( "Character Selection" )
        CharacterSelection:SetVisible( true )
        CharacterSelection:SetDragable( true )
        CharacterSelection:ShowCloseButton( true )
        CharacterSelection:MakePopup() // this will show the frame, its needed.


doesn't....

Maybe it's my rusty LUA skills but that seems to be wrong...


also

       SystemButtonThingOne.DoClick = function()
Where is this 'function()'?
I'd guess a preset but it is present in two different buttons and doesn't seem to point to a valid function


Also LUA is no where near C++
Try taking a look at VB.Net, you'll see striking similarities...C++, no...not at all.