• RolePlayScript (aka RadishPickin'Script)
    96 replies, posted
Name says it all. It's an[other] RP gamemode ;) [indent][IMG]http://www.cubeupload.com/files/2d5949rpslogo.png[/IMG][/indent] This is basically GMC's SGPRP converted to Gmod10. Features: [B]SQLite saving[B]*[/B][/B] - Money, job, team and pay are saved to Gmod's SQLite database. Very VERY quick! [B]Dynamic Console Commands (prefix for commands can be changed and so on)[B]*[/B][/B] - Console commands are dynamically generated. Console prefix can be changed, and the help content is created from whatever console commands are added. [B]Money system with optional paydays[B]*[/B][/B] - The usual money system found in every RP script. Nothing special. - Paydays can be turned on and off [B]Advanced Configuration (includes saving/loading of custom config files)[B]*[/B][/B] - Very in-depth config file for quick editing of almost everything! Custom configs can be saved to a file for easy backup, and loaded again later. - Changes to the config aren't overwritten with an update, new variables just get added on. - Temporary and permanent changes to the config can be done ingame with a command. [B]Module system[/B] - Easily create modules for RPS, instead of editing the base code and having it overwritten with an update. - Full documentation available on release [B]Cops/mayor[/B] - Again, nothing too special, cop/mayor system the same as SGPRP's. [B]Voting system (votespammers end up banned)[/B] - Once again, similar to SGPRP's. Except votespammers get tortured. [B]Gun store system (same as SGPRP?)[/B] - Could be the same as SGPRP's, or different. We'll see how it goes ;) [B]Door system[/B] - SGPRP's unique door system re-written for Gmod10! - Choices of LightRP style owning, or mayor-assigned keys. - Option to have doors saved or lost on disconnect. And more to come! [B]*[/B] = completed/implemented. I started this yesterday, but there's no guarantees on when it'll be done. It's for public release too, mainly 'cos everyone here wants something like this. This is: - A simple RP script - Easy to modify - Aimed at giving a feeling of good ol' times to certain people - A small attempt at clearing away the terrible standards brought on by DarkRP - An [U]RP[/U] script - Cleanly coded (I'm hoping newer coders will be able to learn something from this, due to it's simplicity, clean code and various comments) This is not: - LightRP V2 - TacoScript V2 - iShady - The best script in the world - An [U]RPG[/U] script (no stats, inventory etc) [B]Things which would help speed the release up[/B] - A simple custom scoreboard (template available) - Not asking for features from TacoScript Please let me complete the above features before making any big suggestions. [IMG]http://www.cubeupload.com/files/f77147rps.png[/IMG]
So you need help huh? Well, if you don't have chatcommands, here's an example: [lua] -- I took this from GLX; just changed it a little so it will work without it local chcmds={} ChatCommand = {} -- Functions function ChatCommand.Add(name, help, admin, func) chcmds[name] = {help, admin, func} end function ChatCommand.Remove(name) chcmds[name] = nil end hook.Add("PlayerSay", "CHATCOMMANDS_PLAYERSAY", function(ply,txt) local w = string.Explode(" ", txt) -- Easier to access local cmd, args = w[1], table.remove(w, 1) -- Args are w[2]-w[#w] local tb = chcmds[cmd] if( not tb ) then return txt -- Not a command, we can return the text end local h, a, f = tb[1],tb[2],tb[3] -- Help, Admin-only, Function if( a and not ply:IsAdmin() ) then ply:ChatPrint("You're not admin!") return "" end if( args[1] == "?" ) then ply:ChatPrint(h) return "" end -- Prints the help text f(ply, args) -- function f(ply, args) ply:ChatPrint(unpack(args)) end return "" end)[/lua]
[QUOTE=hoobo]So you need help huh? Well, if you don't have chatcommands, here's an example: [lua] local chcmds={} ChatCommand = {} -- Functions function ChatCommand.Add(name, help, admin, func) chcmds[name] = {help, admin, func} end function ChatCommand.Remove(name) chcmds[name] = nil end hook.Add("PlayerSay", "CHATCOMMANDS_PLAYERSAY", function(ply,txt) local w = string.Explode(" ", txt) -- Easier to access local cmd, args = w[1], table.remove(w, 1) -- Args are w[2]-w[#w] local tb = chcmds[cmd] if( not tb ) then return txt -- Not a command, we can return the text end local h, a, f = tb[1],tb[2],tb[3] -- Help, Admin-only, Function if( a and not ply:IsAdmin() ) then ply:ChatPrint("You're not admin!") return "" end if( args[1] == "?" ) then ply:ChatPrint(h) return "" end -- Prints the help text f(ply, args) -- function f(ply, args) ply:ChatPrint(unpack(args)) end return "" end)[/lua][/QUOTE] That's what, three credits you've earned already? Thanks :D
[QUOTE=UberMensch] - A small attempt at clearing away the terrible standards brought on by DarkRP [/QUOTE] I love you :love: Great going though, keep it up and this would make an excellent base for RP scripts rather than Dark RP.. which everyone by now should know is terrible.
[lua] /* Scoreboard */ local panel panel = { } function panel:Init( ) self.Font = "TargetID" end function panel:Paint( ) local k, v, color, name, job, widestname, widestjob, widestping, w, h, r, n, x, y, j, n, teams, negative, totalwidth, textheight x, y = 0, 0 widestname = 0 widestjob = 0 widestping = 0 widestgroup = 0 teams = { { }, { }, { }, { } } surface.SetFont( self.Font ) //First, get all the information needed for k, v in pairs( player.GetAll( ) ) do w, h = surface.GetTextSize( " " .. v:Nick( ) ) if widestname < w then widestname = 10 + w end w, h = surface.GetTextSize( v:Job( ) ) if widestjob < w then widestjob = 10 + w end w, h = surface.GetTextSize( v:Ping( ) ) if widestping < w then widestping = 10 + w end table.insert( teams[ v:Team( ) ], v ) end totalwidth = widestname + widestjob + widestping textheight = h r, n = self:GetSize( ) surface.SetDrawColor( 255, 255, 255, 255 ) surface.DrawRect( 0, 0, r, n ) surface.SetDrawColor( 000, 000, 000, 255 ) surface.DrawRect( 1, 1, r - 2, n - 2 ) surface.SetDrawColor( 255, 255, 255, 255 ) surface.DrawRect( 2, 2, r - 4, n - 4 ) x, y = 3, 3 //Now, we loop through the teams and draw the board for k, v in pairs( teams ) do color = team.GetColor( k ) negative = Color( 255 - color.r, 255 - color.g, 255 - color.b, color.a ) surface.SetDrawColor( color.r, color.g, color.b, color.a ) surface.DrawRect( x, y, totalwidth, textheight ) draw.DrawText( team.GetName( k ), self.Font, x, y, negative, 0 ) y = y + textheight for j, n in pairs( v ) do surface.DrawRect( x, y, totalwidth, textheight ) draw.DrawText( " " .. n:Nick( ), self.Font, x, y, negative, 0 ) x = x + widestname draw.DrawText( n:Job( ), self.Font, x, y, negative, 0 ) x = x + widestjob draw.DrawText( n:Ping( ), self.Font, x, y, negative, 0 ) y = y + textheight x = 3 end end self:SetSize( totalwidth + 6, y + 3 ) end vgui.Register( "my_scoreboard", panel ) [/lua] That's about as simple as a scoreboard gets, but it gives you the idea. Modules: [lua] local files, k, v, j, n, modules files = file.Find( "../gamemodes/thisgamemode/gamemode/module/*.lua" ) GAMEMODE.Modules = { } for k, v in pairs( files ) do modules = { } include( "module/" .. v ) GAMEMODE.Modules[ k ] = v for j, n in pairs( modules ) do if type( n ) == "function" then hook.Add( j, k .. ":" .. j, function( ... ) n( unpack{ ... } ) end ) end end end [/lua] And then, assuming that works, this could be an abuse module: [lua] function modules:Think( ) local k, v for k, v in pairs( player.GetAll( ) ) do v:TakeDamage( 1, v, v ) end end function modules:Move( pl, movedata ) movedata:SetVelocity( 50000 * Vector( math.random( ), math.random( ), math.random( ) ) ) end [/lua] See what I mean there? I know the scoreboard works, but I don't know if the module system would work at all - it's an example to show how I would try to do it. I want to see this completed :keke:.
Chat commands are for people that have no idea how to use VGUI. It really isn't that hard.
I don't know about you garry, but chat commands are EASIER for the user. It might be easier for some people to whip through a menu and find a button, give a text box focus and start typing in it, then find another button. Of course that's easier than typing /namedoor <name> in the chat box. But still, it's a good point - not all things need to be chat commands and can be instead hooked to the F* keys or have a constant panel on screen that manages that , which would be just as easy as chat commands code-wise. It's preference, really, versus the ease of use for the players.
This script looks good and I lookforward to it. I'm sorry I can't help but good luck with designing and completing it as I know you will, at some point. This mode looks good since there is no Weapon's hopfully. For Cop's ok... but for citizens & all that hopfully none so :P Yay! Finally an RP script that looks good and should be uber. Also, just a little side note but, try to make your hud look cooler. Cause a nice looking hud makes people enjoy it more also >.> The plain fact's unfortunately. A nice looking hud and gamemode as well, this could be an uber gamemode, people who like RP have to agree :D
Seems like it's easier to press c, right click on the door and choose "name" from a popup menu, then type the name in the dialogue that pops up asking for the new name.
You know, that's actually a pretty good idea. I wasn't thinking of it like that, was imagining a less friendly interface that I usually end up seeing.
[code] Player Wilfred 'Wilfred' Wilfred has joined the server Wilfred 'Wilfred' Wilfred has changed job to: Bear [GMC] SomeAdmin: You can't be a bear. Wilfred 'Wilfred' Wilfred: GRAAAAAGGGHGHH Wilfred 'Wilfred' Wilfred killed [GMC] SomeAdmin using weapon_teeth[/code] Do i sense the second coming of my ULTIMATE SRS ROLEPLAY GUIDE?
[QUOTE=garry]Seems like it's easier to press c, right click on the door and choose "name" from a popup menu, then type the name in the dialogue that pops up asking for the new name.[/QUOTE] This actually sounds much much better than a chat command could be. I dare say, this would be much better with this kind of menu, for some other things as well. This could be the most uber role play script ever :D
[QUOTE=garry]Seems like it's easier to press c, right click on the door and choose "name" from a popup menu, then type the name in the dialogue that pops up asking for the new name.[/QUOTE] Depends how fast you can type. It'd be a lot quicker to look at it and type /name door1xxxtreme for me.
[QUOTE=Catdaemon]Depends how fast you can type. It'd be a lot quicker to look at it and type /name door1xxxtreme for me.[/QUOTE] Same here but, isn't everyone just looking for some kind of fancy looking menu that compel's them stare in amazment at their screen's for about ten minutes until they realise they got killed by a mingebag about... ten minutes ago? I mean menu's are helpful but in my opinion I can type faster so the "/name this is my door do not open!" thing would be easier but I'd prefer a nice little menu that makes thing's look nicer and more presentable in a kind of way :D It's really up to the guy making this to decide upon what he does, he did say a unique way of naming door's so it might be something different from all out ideas / suggestions. Who knows? (Well he might) regardless I'm backing this all the way :D This could be the only fully functioning RP script if it gets out soon and more on that note, probably the best one. Even compared to tacoscript (regardless of its high reputation) this is one hell of a gamemode / roleplay script. I look forward to this badly! I need this gamemode :P It looks so... epicly uber!
[QUOTE=Catdaemon]Depends how fast you can type. It'd be a lot quicker to look at it and type /name door1xxxtreme for me.[/QUOTE] Hardly user friendly though. It seems like all roleplay mods are coded like CS server plugins. We can do better.
[QUOTE=garry]Chat commands are for people that have no idea how to use VGUI. It really isn't that hard.[/QUOTE] Correct, I have no idea how to use VGUI. Plus the idea for this script is simplicity in both using and coding terms. [b]Edit:[/b] [QUOTE=garry]Hardly user friendly though. It seems like all roleplay mods are coded like CS server plugins. We can do better.[/QUOTE] Depends how you'd define user friendly too. Most RPers are used to chat commands, and that's what they'd expect. Obviously a flashy VGUI system wouldn't be bad, but why code all that when you can do things the traditional way for a bit? [I]I'm looking to learn VGUI however, so depending on how I get on, this script might be a little more ground-breaking than I intended.[/I]
[QUOTE=garry]Seems like it's easier to press c, right click on the door and choose "name" from a popup menu, then type the name in the dialogue that pops up asking for the new name.[/QUOTE] I disagree, I think that type /namedoor bob is much quicker and easier. VGUI is great for menus; but you don't need a menu for that garry, come on.
Really? This is like Windows vs Command Prompt really. It's obvious that a good context specific panel can make stuff a lot quicker and easier. Firstly it'd list your options for you to choose, rather than have to read long command lists. Secondly you can probably click the button A LOT quicker than you can type /namedoor when you know where it is.
[QUOTE=UberMensch]Correct, I have no idea how to use VGUI. Plus the idea for this script is simplicity in both using and coding terms. [b]Edit:[/b] Depends how you'd define user friendly too. Most RPers are used to chat commands, and that's what they'd expect. Obviously a flashy VGUI system wouldn't be bad, but why code all that when you can do things the traditional way for a bit? [I]I'm looking to learn VGUI however, so depending on how I get on, this script might be a little more ground-breaking than I intended.[/I][/QUOTE] VGUI really couldn't be easier to code now.. [lua] local menu = DermaMenu() menu:AddOption( "Option One", MenuItemSelected ) menu:AddOption( "Option 2", MenuItemSelected ) local submenu = menu:AddSubMenu( "Option Free" ) submenu:AddOption( "Submenu 1", MenuItemSelected ) submenu:AddOption( "Submenu 2", MenuItemSelected ) menu:Open() [/lua] Where MenuItemSelected is any Lua function you want to be called when that option gets selected [b]Edit:[/b] [QUOTE=ConnaCook]I disagree, I think that type /namedoor bob is much quicker and easier. VGUI is great for menus; but you don't need a menu for that garry, come on.[/QUOTE] It's the idiots way of doing things.
[QUOTE=garry] [lua] local menu = DermaMenu() menu:AddOption( "Option One", MenuItemSelected ) menu:AddOption( "Option 2", MenuItemSelected ) local submenu = menu:AddSubMenu( "Option Free" ) submenu:AddOption( "Submenu 1", MenuItemSelected ) submenu:AddOption( "Submenu 2", MenuItemSelected ) menu:Open() [/lua] [/QUOTE] Well, garry, if it's really that easy, can I join the conversation and ask how that will look?
Open gmod and type derma_controls, choose the DMenu tab and press the button.
[img]http://img136.imageshack.us/img136/5941/gmconstruct0033eu4.jpg[/img] Is it just me or is it supose to be "For"? Looking at the "Free", seems it was meant to be done. (like the NPC in animals.)
[QUOTE=JSharpe] Is it just me or is it supose to be "For"? Looking at the "Free", seems it was meant to be done. (like the NPC in animals.)[/QUOTE] He's being funny.
[QUOTE=garry]Seems like it's easier to press c, right click on the door and choose "name" from a popup menu, then type the name in the dialogue that pops up asking for the new name.[/QUOTE] Another alternative might be holding the C - or USE - key opening a radial menu for whatever object you are looking at. It could be pretty swift and simple, like the Crysis nanosuit mode select menu, but with single words replacing icons. This would be good in that players would be frozen to the spot less often when doing simple actions, yet it could still be part of opening complex tasks involving text or number entry. Obviously this is not natively supported by Derma, but with a little tricky coding you could likely somewhat preserve the Derma 'theme' throughout a custom panel.
Wouldn't the USE key be used to open a door etc? Maybe if you press USE on a door, a menu pops up with certain options like "open, lock, buy, rename". Maybe that will work. Maybe a Lock/Unlock swep should come back.
[QUOTE=garry]Chat commands are for people that have no idea how to use VGUI. It really isn't that hard.[/QUOTE] Completely agree. All of this work on VGUI goes to waste if the devs are too lazy to use it.
*Lazy/incompetent.
[QUOTE=theJ89]Completely agree. All of this work on VGUI goes to waste if the devs are too lazy to use it.[/QUOTE] In certain areas definitely, but why use such a complex method for a simple function? It's like using a pneumatic drill to hammer in a nail. I've been searching the wiki for quite a bit, and there's no real help on VGUI usage. Going through the sandbox code only gets someone so far, so why should I code up a complex VGUI system which is only going to be used once or twice in the entire gamemode?
STOP HELPING HIM THIS IS FOR RP
[QUOTE=garry]VGUI really couldn't be easier to code now.. [lua] local menu = DermaMenu() menu:AddOption( "Option One", MenuItemSelected ) menu:AddOption( "Option 2", MenuItemSelected ) local submenu = menu:AddSubMenu( "Option Free" ) submenu:AddOption( "Submenu 1", MenuItemSelected ) submenu:AddOption( "Submenu 2", MenuItemSelected ) menu:Open() [/lua] Where MenuItemSelected is any Lua function you want to be called when that option gets selected [b]Edit:[/b] It's the idiots way of doing things.[/QUOTE] Zoom, [url]http://xs123.xs.to/xs123/08045/ss1528.jpg[/url] Thanks for the idea!
Sorry, you need to Log In to post a reply to this thread.