• Shadow - an RP mod that needs you!
    178 replies, posted
We found a document sharing script with raBBish for Notepad++ and started scripting together today! The results... Were epic. THIS DESERVES ITS OWN BOX! [lua] function meta:LoadVar( k, tits ) --:DD tits is the default! If it's nil, GTFO! settings.Players:Get( k, self:ID() ) or tits or "GTFO" --Duh. end[/lua] The result of the above was that everybody was named "GTFO" for a while, because of a data loading bug [code]--Wrappers go here --The wrappers' aliases (eg. data.LoadData ) will, too, be deprecated soon! --CONTINUES: USE THE NEW SYSTEM FFS --CONTINUES: The only real purpose of the aliases is to prevent errors --CONTINUES: until everything has been migrated -- {{ DEV CHATTER }} -- --Maybe the settings datathing should be hardcoded in? --Possibly. --Like, settings.Save, etc.? --Uh, yeah. That could work. --... damn this was short --EPIC, we gotta leave these comments in :D settings = {} --? --Yeah. -- So settings.Init == data.LoadData? -- Yup -- Could we alias it? -- Happy now? :P -- Yeah :) -- That's the purpose function settings.Init() settings.Data = data.New( "settings", false ) end data.LoadData = settings.Init function settings.Save( k, v ) settings.Data:Save( k, v ) --... Do we even need this wrapper? Really? end -- We do. It's just for morons. And lazy people. Us, that is :D --True, true -- CONTINUES: Does _D:Save return anything? -- Nope function settings.Load( k, def ) --Don't even ask if we need this :) Returns the value of k, def, or kirby return settings.Data:Get( k ) or def or "(^'-')>" --@returns Kirby -- Ugly Kirby you have :P --I suck at any kind of ASCII drawing :( --Fear not, for I'll seek you one! --Found one :D --BETTAR (^'-')> --Yarr --The pirate song is the only real thing --CONT: that was good in Lazy Town --YARR HARR FIDDLE DEE DEE, BEING A PIRATE IS ALRIGHT TO ME, --CONT: DO WHAT YOU WANT CAUSE A PIRATE IS FREE, YOU ARE A PIRATE --Saved. Let's continue? --Roger roger. --Still wrappers to go! --There is? --I THINK. --CONT: Lemme check --We've done settings, player settings... I can't remember any else, --CONT: except the container stuff --Save, let's move on to fixing items? :D --Fixing? What's broken? --Containers* --Broken? --ARGH, we could fix the multicontainer --CONT: It'd be EPIC. --True... but I've already written everything for single :( --Maybe make entity:GetContainer return the container --CONT: With least space, that can fit the wanted item? (Thanks for the CONT) --But the question is how the hell to do it? --CONT: Since GetContainer has no args --GetContainer has to... Borrow all the containers for a while, --CONT: Look in every single one until it finds a suitable one --CONT: and return that one. OK? --Define suitable? How would it find it? --Crap, what about making it return by default the container with most space left? --CONT: Then have optional arguments that contain the needed space and weight? --Might work... --We gotta paste this crap in the FP thread, seriously :D --Gotta go eat, brb --KK. Imma save --CONT: Steam message me when you're back. --Roger that. Disconnecting. end --I think that's about it for settings -- Wrapper for players? -- HELL YEAH! (The morons won't survive without them!) function meta:LoadData() settings.Players = data.New( "players", true, nil, nil, nil, "VARCHAR(10)" ) --data.New( name, id, meth, ktype, vtype, idtype ) end --Forgot the syntax... --CHECK IT, THEN! --How many chars does normal SteamID have? --Hmm... I'll grab one from teh internets. --No need, found it. It's 10 for numbers only with player:ID() --Okay --I'll need to edit player:ID() a bit to limit the return to 10 chars --Share it, too! --HAO!? --Umm. I dunno? :D --How did you open this one? --NppDocShare->address->Connect --I wonder if you can serve multiple files :P --Back to working on this --Sure (Fuck, this connection breaks syntax highlight!) --CONT: Can be easily fixed, though --CONT: Wait, there's only one column in settings.Players?!? --Wut? --CONT: There's 3: id, k, v --Um. How are they- Ohshit I forgot :DD --CONT: It's automagically handled --Blagh, I forgot to test if _D:Get even works --Go check it out, no need to even close the chat --CONT: Open a listen so I can join --Ehwut, some timer causing errors? --CONT: Timer Error: includes/modules/timer.lua:32: table index is nil --CONT: Seems to be payday timer --..Yeah, but last time it caused errors because it wasn't removed when a player --CONT: leaved the server! --_D:Get works with ID --PARTY TIEM! --/me bangs head --I <3 one-line wrappers --/it Polly bangs men (This actually works, /it is a chatcmd!) --You'd know :3 --Shouldn't we be CODING and not filling the files --CONT: with chatter? :D --CONT: Serverside files, though, don't matter as much [/code] And that's not even all the code we did :D As you can see, most of it is comments... But we had fun :DD
Lotsa revs again. Wait, triplepost? Why did you betray me, automerge :< I only wanted a double post! [code]/|------|\ ||Rev 33|| \|------|/ I DEMAND MORE DATA! [Added] __eq metafunctions for items and containers Even more datastorage stuff! /|------|\ ||Rev 34|| \|------|/ Data. [Fixed] Dataaaaaa, mainly intermediate fixes (We'll keep on updating through the day) /|------|\ ||Rev 35|| \|------|/ lol http://www.facepunch.com/showthread.php?p=17773966#post17773966 [Added] tits or "GTFO" (Yes, this was indeed added. Up to you to find it. :D) Dev chatter (actually, more than code :D) [Fixed] Data system fixed. Partially. [Changed] Returned to multicontainer system again :DD Actually lots more, I'm just too lazy to write it :D[/code]
i've got a pretty good radio system in my gamemode, but it's cooler than yours :D EDIT: i see you took some code from light rp. (hard to resist doing that) some of mine is from cakescript G2 :D (doors, a tiny bit of the inventory, the chat commands, some other stuff ) because of the large amount of files, i suggest you put them in different folders, you can include all of the files very easily with this bit of code: [php] for k, v in pairs(file.FindInLua("ZenRP/gamemode/plugins/*.lua")) do include("plugins/"..v) end [/php] also some of your code made my eyes bleed... but if it gets the job done, it's ok! some parts were not as eye-bleedy. :) the thing i had trouble with was the property.lua file. i felt it just wasn't living up to it's full potential. [QUOTE=esalaka;17689276]Possibly. But I thought that since there might be multiple properties inside the cube, it should rather be made so that the doors are individually defined to be a part of a property.[/QUOTE] well, if you just set doors to be in a property, then you can't have a function that returns what property the player is in! D: but, i can see how my idea could fail. 2 thing you could add to your gamemode: (that i know i'm gonna try) 1. and inside/outside checker function :razz: 2. your property idea because our gamemodes are both coded differently, i know they'll turn out differently.
[QUOTE=ZenX2;17787676]i've got a pretty good radio system in my gamemode, but it's cooler than yours :D[/quote]I personally like my radio system :) [QUOTE=ZenX2;17787676] EDIT: i see you took some code from light rp. (hard to resist doing that) some of mine is from cakescript G2 :D (doors, a tiny bit of the inventory, the chat commands, some other stuff )[/quote]Indeed, some code has been copied, but I have re-written it, not copypasted :) [QUOTE=ZenX2;17787676] because of the large amount of files, i suggest you put them in different folders, you can include all of the files very easily with this bit of code: [php] for k, v in pairs(file.FindInLua("ZenRP/gamemode/plugins/*.lua")) do include("plugins/"..v) end [/php][/quote]Eh? There's already a plugin system, but the stuff directly in the gamemode folder contain the core functionality. Also, my plugin including system can always fetch the plugins from the right folder, it doesn't require the folder to be named "shadow". [QUOTE=ZenX2;17787676] also some of your code made my eyes bleed... but if it gets the job done, it's ok! some parts were not as eye-bleedy. :) [/quote]What code made your eyes bleed? Me and raBBish are currently rewriting parts of it. [QUOTE=ZenX2;17787676] the thing i had trouble with was the property.lua file. i felt it just wasn't living up to it's full potential. [/quote]What?!? There is nothing at all in property.lua! [QUOTE=ZenX2;17787676] well, if you just set doors to be in a property, then you can't have a function that returns what property the player is in! D:[/quote]Why would I have to know that? [QUOTE=ZenX2;17787676] but, i can see how my idea could fail. 2 thing you could add to your gamemode: (that i know i'm gonna try) 1. and inside/outside checker function :razz: 2. your property idea[/quote]WTH are you talking about :DD [QUOTE=ZenX2;17787676] because our gamemodes are both coded differently, i know they'll turn out differently.[/QUOTE] Yeah. And I have a co-developer :) We're currently working on the multicontainer system (AGAIN) and yet another ripoff of the popup menu on +use :D Whoever rated me optimistic, I'm still not gay :D
[QUOTE=esalaka;17791249] What?!? There is nothing at all in property.lua! [/QUOTE] Probably why he said that :v:
[QUOTE=raBBish;17791774]Probably why he said that :v:[/QUOTE] Indeed. We should create the property system. ALSO - TODO LIST: (Gonna be posted in Assembla, too) [B] [U]Multicontainer ( )[/U][/B] [B] [U]Better item controlling( )[/U][/B] |- GUIDs for the items and containers [ ] |- Items "know" where they currently are [ ] |- +use -menu [ ] [B] [U]In-Game editors ( )[/U][/B] |- Editor mode [ ] |- "Hat editor", attachment point for wearable items [ ] |- "Door editor", attaching doors and shit to properties [ ] |- "Class editor", class/team/flag/whatever-editor [ ] |- "Item editor", creating item bases quickly in-game [ ] |- "Data migrator", exporting databases to for example JSON and CSV [ ] |- "Map editor", possibly item spawn points and such? [ ] |- "Menu maker", for easy creation of Derma based menus [ ] |- "Blacklist writer", for making blacklists without writing (much) code [ ] |- "Chat command creator", to create and test chat commands easily in-game [ ] |- "HUD & GUI editor", for planning graphical interfaces [ ] [B] [U]Redo the class system ( )[/U][/B] |- class -> flag (mainly a naming difference if using "easy flags") [ ] |- flag-dependent settings [ ] |- flag groups (Flag F has a sub-flag, f. All settings of F affect f, but no settings of f affect F.) [ ] |- "easy flags", basically just a wrapper that makes it like the DarkRP class system. [ ]
[QUOTE=esalaka;17791249]Indeed, some code has been copied, but I have re-written it, not copypasted :)[/QUOTE] Same with me. I just use it to get the basic idea of how to do it :razz: [QUOTE=esalaka;17791249]Eh? There's already a plugin system, but the stuff directly in the gamemode folder contain the core functionality. Also, my plugin including system can always fetch the plugins from the right folder, it doesn't require the folder to be named "shadow".[/QUOTE] what i mean is, because of the large amount of files, you could organize them in different folders. [QUOTE=esalaka;17791249]What code made your eyes bleed? Me and raBBish are currently rewriting parts of it.[/QUOTE] well, some of it wasn't to organized and optimized, but i could be wrong. [QUOTE=esalaka;17791249]What?!? There is nothing at all in property.lua![/QUOTE] my point exactly. [QUOTE=esalaka;17791249]Why would I have to know that?[/QUOTE] If you wanted to be able to find someone, you could put it on the scoreboard (if you have one) [QUOTE=esalaka;17791249]WTH are you talking about :DD[/QUOTE] 1. you could make the character have to be inside or outside to do certain things 2. in my gamemode i already switched door owning to property owning. (yesterday.) [QUOTE=esalaka;17791249]Yeah. And I have a co-developer :)[/QUOTE] i haven't let single other person touch my code or play the gamemode yet. [QUOTE=esalaka;17791249]We're currently working on the multicontainer system (AGAIN) and yet another ripoff of the popup menu on +use :D[/QUOTE] i'm not using an "item_prop" item system, but i manged to make an inventory. :win: it doesn't use containers, or have an item limit... :E
Stop boasting ZenX2.
[QUOTE=Jamie932;17801332]Stop boasting ZenX2.[/QUOTE] sorry... didn't mean to... EDIT: wait, what do you mean, "+use menu?"
A (possibly radial/pie) menu that pops up when a player uses something. Like when pressing use on a car, a menu pops up with options "Enter" and "Open trunk", or something like that.
oooh, that sounds nice. can't wait till you release this, it'll definitely be good. :D
[QUOTE=ZenX2;17804230]oooh, that sounds nice. can't wait till you release this, it'll definitely be good. :D[/QUOTE] I broke the Block system last night, but it'll be much moar kewl soon, after I've fixed it. Wait for a few minutes and I'll commit :3
is SQL faster for saving and loading things than txt files? (i'm guessing yes)
[QUOTE=ZenX2;17820574]is SQL faster for saving and loading things than txt files? (i'm guessing yes)[/QUOTE] Yes but not as fast as mySql, and if done every second then tmySql.
gahh i'm just glad my thing just uses a table and doesn't save to the player.
[QUOTE=Mr Affinity;17822703]Yes but not as fast as mySql, and if done every second then tmySql.[/QUOTE] In fact these are dependant of the connection speed to your SQL database and the speed of the hard drive the SQL database is contained on. Generally, you'd use SQLite for small databases, MySQL for larger communities and flatfile if you are a moron :D
... yeah... :saddowns:
..Yeah? Well, anyway, Polly had written much code before the last commit of mine, but this was so radically different from all my previous code, it would've been almost impossible of me to develop. For example, he moved my precious collection of usermessage hooks to blocks et cetera. I decided to [u]remove[/u] most of his code and [u]Rewrite[/u] it as I see fit. The original plan was to merge the codes, bu tthat has been proven impossible.
Polly is Rabbish?
The name code is broken Ill try to fix it and patch it up on the svn
What? The name code isn't broken, dummy! I just removed all data loading procedures! [editline]07:21PM[/editline] Umm.. I think I should add them back, right? First gotta go play NVN2 :3
Ah, the clarity of debug messages! [code] ] lua_run block.Fetch() > block.Fetch()... [BLOCK] AUTOFETCH base is a folder! Storing... classes is a folder! Storing... client is a folder! Storing... core is a folder! Storing... inventory is a folder! Storing... radio is a folder! Storing... server is a folder! Storing... [INI PARSE] Input given: ../gamemodes/shadow/gamemode/blocks/base/block.txt. Locating... [INI PARSE] No INI file found at ../gamemodes/shadow/gamemode/blocks/base/block.txt! Terminating parsing! [BLOCK] Fetching failed: No block INI file found! [INI PARSE] Input given: ../gamemodes/shadow/gamemode/blocks/classes/block.txt. Locating... [INI PARSE] No INI file found at ../gamemodes/shadow/gamemode/blocks/classes/block.txt! Terminating parsing! [BLOCK] Fetching failed: No block INI file found! [INI PARSE] Input given: ../gamemodes/shadow/gamemode/blocks/client/block.txt. Locating... [INI PARSE] No INI file found at ../gamemodes/shadow/gamemode/blocks/client/block.txt! Terminating parsing! [BLOCK] Fetching failed: No block INI file found! [INI PARSE] Input given: ../gamemodes/shadow/gamemode/blocks/core/block.txt. Locating... [INI PARSE] No INI file found at ../gamemodes/shadow/gamemode/blocks/core/block.txt! Terminating parsing! [BLOCK] Fetching failed: No block INI file found! [INI PARSE] Input given: ../gamemodes/shadow/gamemode/blocks/inventory/block.txt. Locating... [INI PARSE] Located ../gamemodes/shadow/gamemode/blocks/inventory/block.txt. [INI PARSE] Header found: [Settings] [INI PARSE] Setting found: Autoload = true [INI PARSE] Setting found: Init = init.lua [INI PARSE] Setting found: Name = Item system [INI PARSE] Setting found: Author = Polly (raBBish) and Esalaka [INI PARSE] Setting found: Platform = BLOCK_SHARED [INI PARSE] Setting found: OverrideULS = true [BLOCK] Block "inventory": Settings found. Parsing! [BLOCK] Settings set: Autoload = true Init = init.lua Loaded = false Author = Polly (raBBish) and Esalaka LuaPath = shadow/gamemode/blocks/inventory/ Folder = ../gamemodes/shadow/gamemode/blocks/inventory Name = Item system Locked = true blockName = inventory Fetched = true Platform = 3 [INI PARSE] Input given: ../gamemodes/shadow/gamemode/blocks/radio/block.txt. Locating... [INI PARSE] No INI file found at ../gamemodes/shadow/gamemode/blocks/radio/block.txt! Terminating parsing! [BLOCK] Fetching failed: No block INI file found! [INI PARSE] Input given: ../gamemodes/shadow/gamemode/blocks/server/block.txt. Locating... [INI PARSE] No INI file found at ../gamemodes/shadow/gamemode/blocks/server/block.txt! Terminating parsing! [BLOCK] Fetching failed: No block INI file found! [/code] Yes, that means that we have a new, better Block (modules, in case you haven't seem earlier threads) system! I just have to convert the other blocks of raBBish's, and it'll work flawlessly. I hope. :D Also, two SVN commits, but they mostly break stuff. This ain't on the SVN yet, don't bother updating! [editline]09:40PM[/editline] I feel slightly offended by the fact I have not yet been rated dumb. Or received any answers. (Automerge, DO NOT FAIL ME.) [editline]09:40PM[/editline] Yay, automerge didn't fail me! [B]Yays, I've been rated dumb. Thus, somebody has read at least some part of my message![/B]
PIE MENUS! (Screenies later, they're still ugly) [code] /|------|\ ||Rev 41|| \|------|/ WTH, I don't have the log for rev 40?!? Oh, I had a double 36... Anyway... [Added] PIE MENUS. YES. UNCOMMENT LINE 146 TO UNLEASH THE PIE MENU'S WRATH![/code] [editline]10:30PM[/editline] Also, raBBish got most of the shit working, so wait for his commit to actually have your data back!
Could you stop your change logs from being sarcastic? I would far prefer a nice straight to the point change log (Formal),
What exactly does this menu accomplish?
I want to play it.... now ...
[QUOTE=ZenX2;17968614]What exactly does this menu accomplish?[/QUOTE] Um, nothing. It's just there, and I can now make pie menus. All that needs to be done is to convert the pie menu into a derma panel (And set it to use the schema colors, even!) [QUOTE=Jamie932;17962616]Could you stop your change logs from being sarcastic? I would far prefer a nice straight to the point change log (Formal),[/QUOTE] Meheheh... In my opinion, there isn't really much sarcasm in the logs. Of course, yes, the wrath of pie menus, but I just wanted to provide you with a proof that something has been actually done. there have been a few other commits before #40, too, but they didn't include a revision log. That was because we had to do some serious rewriting to get the code back to a state where it works. RaBBish told me last night that he had the data system fixed, but I don't know anything more from that... From rev 36 onwards the code has been broken, and as of revision 41, it still is. The last semi-serious revision log was 35 (Since the code still worked, there was progress to report.) Its humour factor consisted of the fact that a certain function actually returns 'tits or "GTFO"' (It's got a thing to do with the data system; That's why all player names used to be GTFO at one point in the testing :D) Anyway, as soon as raBBish commits his data system fix, we'll probably get back to serious logs :) [editline]03:34PM[/editline] [QUOTE=Netheous;17970057]I want to play it.... now ...[/QUOTE] Why? :D
Guess what. [code] /|------|\ ||Rev 42|| \|------|/ FINALLY, A PATCH! (Blocks are still broken) [Fixed] Data system and all/(most) problems related to it Payday system errors [Changed] Tweaked pie menu a bit[/code] [editline]07:18PM[/editline] Oh yay. How old can a post be to automerge? [editline]07:19PM[/editline] An hour? [editline]07:19PM[/editline] [B]Less than[/B] an hour, I mean.
Looks awesome. Finish, or I cut you. :v:
How come it looks awesome. You most likely haven't downloaded it, nor seen any screenshots (For there are none) How can you say it [U]looks[/U] awesome? :D (Although it does) [editline]02:01PM[/editline] I couldn't update this yesterday: [code]/|------|\ ||Rev 43|| \|------|/ You were wrong, Polly, the data is still broken. At least on me :< And no wonder: --player.LoadData() --WTH? --settings.Init() --WTH? I uncommented those. I hope it works now :D Version promotion to 1.2 just for the small amount of eye candy :D [Added] New shiny bar function (Clientside GUI candy, replaces the health bars with new ones. I'll return the old ones if someone likes them better) Hacky changes that won't make the data system work :P A system that should make blocks work, but probly doesn't Bananas The util file on clientside (They need it :P) [Changed] The advantage from bunyhopping has been removed. Jumping now reduces your stamina, but stamina does not affect your ability to jump. (With default settings this means a bit over ten jumps in quick succession) This was done because you used to be able to bunnyhop at sprint speed without losing nearly any stamina, and thus speed. [Files] (This can be pasted using TortoiseSVN: Just right-click and select "Paste filename list") modified block.lua modified cl_init.lua modified data.lua modified init.lua modified player.lua modified shared.lua[/code] [editline]02:01PM[/editline] Wows, just one post away from 600!
Sorry, you need to Log In to post a reply to this thread.