Seker Posted July 11, 2012 Posted July 11, 2012 So, for the past few days, I've been working on a "mod" that's turned out to be quite extensive. It's an entire re-write and re-structuring of the items system for MCCodes V1. It started out as something I was only going to use for my own game, but I feel like it'd be a huge benefit to the community, as the current structure is, in my opinion, very messy, and lacks a few features I feel most games need. (Note: All statuses are pending, as I've yet to install to test server and begin testing) Files which will be replaced: -- itemuse.php (Complete) -- itemsell.php (Complete) -- itemsend.php (In Progress) -- inventory.php (Complete) -- imadd.php (Complete) -- itemmarket.php (Complete) -- itembuy.php (Complete) -- iteminfo.php (Complete) -- attack.php (In Progress) New files/features: equip.php (Complete) itempedia.php (Complete) auction.php (In Progress) New function: -- inv_add() (complete) Also includes a total re-structuring of all database tables dealing with items, as well as new tables for: -- equipping -- auction -- energy items -- health items All files and tables have been completely typed up, from scratch, by me. My question is, do you (the MWG community as a whole) feel this would be worth offering for sale? Obviously, it would only be practical for fresh installs, as all of your items, inventories, marketed items, etc. would be deleted and need to be re-added. I welcome all comments and feature suggestions regarding this system. I'm pretty happy with it so far, and I should be ready to start testing everything by tomorrow afternoon. Quote
KyleMassacre Posted July 11, 2012 Posted July 11, 2012 Is there anyway you can kinda break down what you have done to exsisting files besides restructuring them for the new/different db tables if anything without giving out what youve done in full? Quote
Seker Posted July 11, 2012 Author Posted July 11, 2012 Is there anyway you can kinda break down what you have done to exsisting files besides restructuring them for the new/different db tables if anything without giving out what youve done in full? Honestly, it's a bit difficult to say what exactly is different, as I've been making the entire system without using the original files as a base in any capacity. The whole start of it came about because I wasn't happy with the equip mod I had in place, and it just grew from there. What I can say is I've tried to make the files as easily editable as possible. Keep in mind, I've paid no attention to file sizes, just readability. (Average file size is still only ~6kb) The code is tabbed neatly and a lot of the information is defined in variables to make changing the wording much easier. The equipping tables are split into Primary, Secondary, and Armor, so the ability is there to equip any weapon in any slot, and not just one "type" in each. The auction will likely run off a cron unless I can get around to gaining some knowledge about timestamps today. While I haven't put it into a test server yet, I feel confident everything will work as planned. The only possible "kink" I'm going to have to work out is to make sure the item ID's in the separate table do not clash. I'm thinking setting different values for the AUTO_INCREMENT of the ID's should be sufficient, but again, I've yet to test it. In a nutshell, I think the whole system is just cleaner and a bit more "noob" friendly. Quote
sniko Posted July 11, 2012 Posted July 11, 2012 The auction will likely run off a cron unless I can get around to gaining some knowledge about timestamps today. I'll happily contribute towards this part :) Quote
Seker Posted July 11, 2012 Author Posted July 11, 2012 I'll happily contribute towards this part :) I would definitely appreciate that, sniko. Thank you. :) I will touch base with you as soon as I've had a chance to start testing. Quote
Seker Posted July 12, 2012 Author Posted July 12, 2012 Just a quick update to this. I've finished the auction using a cron and finished itemsell.php. I've also added logs for item transfers, market transactions, and auction wins with a staff page to view all three in one place. Next up will be staff item management, including adding items/weapons/armor through the staff panel as well as the ability to delete, and possibly edit, items in a user's inventory. Also still need to finish the new attack page. It's coming along, nicely, if I do say so myself. Quote
Seker Posted July 12, 2012 Author Posted July 12, 2012 i would love to see this when its done Testing got pushed back as some new feature ideas came to me. But I'm hoping to have a few preliminary screenshots and a few snippets of the code ready to show tomorrow. Currently about a third of the way finished with the staffitems page. Available options will be to Add, edit, and delete weapons,armor, health items, and energy items. Also the option to delete an item from a user's inventory. In addition, I will be implementing a staff log specifically for the items page. At the moment, it's set only to allow admin access, but I'm sure some will change that, so this way there will be a record of what's done and when. Quote
Seker Posted July 12, 2012 Author Posted July 12, 2012 One final update for the night. All item editing functions are completed. Also integrated a "breakable" option for weapons and armor. Would allow nice options for special "unbreakable" items to be incorporated as donator specials or event rewards. Still to do tonight: -- Add item functions in staff panel -- Delete item functions in staff panel Tomorrow's project: -- Finish custom attack page The attack page should be the last of it, unless I or anyone else comes up with something else between now and when I finish that. :P Quote
Seker Posted July 15, 2012 Author Posted July 15, 2012 Another update so everyone doesn't think I've just abandoned this project. It's still in full swing. Testing and bug checks have begun. This being the weekend, though, things will, hopefully, be fully finished Monday or Tuesday. Everything's come along nicely, but I did hit a couple pages I realized will also need to be redone. Tested And Working: --- Inventory --- Staff Items (Add/Edit/Delete Items) --- Item Buy --- Weapon/Armor Equip --- Weapon/Armor Unequip --- Item Sell --- Item Use --- All DB Tables Working Still Untested: --- Item Send --- Item Send Logs --- Item Market/Item Market Add --- Item Market Logs --- Auction/Auction Cron --- Auction Logs Major Bugs: --- Attacking (Exp. set to 0 when finishing the attack. Problem with $_SESSION['attacking'] positioning.) --- Item Info (Only showing health item. Problem with selecting item ID) Minor Bugs: --- Itempedia (# owned only shows 0.) --- inv_add() Function (Adding items to inventory adds new row instead of quantifying.) New Files To Be Completed: --- Shops --- Staff Item Logs New Features: --- attackend.php (attackhosp, attackmug, attackleave, attacklost, and attackwon all in one file) Quote
Seker Posted July 16, 2012 Author Posted July 16, 2012 A new update in the form of screenshots! (Sorry about the red on gray. It was either that or black on black for the table headers :P ) Item Info: [ATTACH=CONFIG]539[/ATTACH] Inventory: [ATTACH=CONFIG]540[/ATTACH] Attack: [ATTACH=CONFIG]541[/ATTACH] Staff Items: [ATTACH=CONFIG]542[/ATTACH] Quote
Djkanna Posted July 16, 2012 Posted July 16, 2012 A new update in the form of screenshots! (Sorry about the red on gray. It was either that or black on black for the table headers :P ) Item Info: [ATTACH=CONFIG]539[/ATTACH] Inventory: [ATTACH=CONFIG]540[/ATTACH] Attack: [ATTACH=CONFIG]541[/ATTACH] Staff Items: [ATTACH=CONFIG]542[/ATTACH] Looking good, estimated release date? Quote
Seker Posted July 16, 2012 Author Posted July 16, 2012 Looking good, estimated release date? Middle of the week-ish. I'm hoping for Wednesday at the latest. Hopefully sooner, but I've realized a few things I forgot to factor it. Such as, when editing or deleting items through the staff panel, it should update or delete everything equipped and in the inventories as well. Quote
Seker Posted July 17, 2012 Author Posted July 17, 2012 Yet another update. Completed the new Item Market -- 100% tested and bug-free -- Allows the seller to choose between selling for crystals or for cash -- Lists items by item type -- Eliminated imadd.php and included removing, adding, and purchasing all within itemmarket.php Also fixed the bug with inv_add() and added the new function, inv_del(). Both add or delete items, respectively, from a user's inventory while checking if the item already exists and updating the quantity if so. Screenshots of the Item Market below. Item Market: [ATTACH=CONFIG]549[/ATTACH] Listing An Item: [ATTACH=CONFIG]550[/ATTACH] *EDIT* Just noticed the typos when listing an item. They will be fixed. :P Quote
sniko Posted July 17, 2012 Posted July 17, 2012 How about a dropdown list to select the currency? System looks good though ;) Quote
Seker Posted July 17, 2012 Author Posted July 17, 2012 How about a dropdown list to select the currency? System looks good though ;) That would probably be better. And I'm sure it's not hard to do. Will have to look into it. Will also incorporate that into item editing, as right now, they're all just listed on the page, and that could be... A big page. :P Quote
sniko Posted July 17, 2012 Posted July 17, 2012 $array = (1 => "xxx", 2 => "yyy"); echo '<select name="currency">'; foreach($array as $id => $name) { echo '<option value="', $id ,'">', $name ,'</option>'; } echo '</select>'; And then of course, use the following to validate; if( !in_array($_POST['currency'], $array) ) { echo 'Please choose a currency!'; } Quote
Seker Posted July 17, 2012 Author Posted July 17, 2012 $array = (1 => "xxx", 2 => "yyy"); echo '<select name="currency">'; foreach($array as $id => $name) { echo '<option value="', $id ,'">', $name ,'</option>'; } echo '</select>'; And then of course, use the following to validate; if( !in_array($_POST['currency'], $array) ) { echo 'Please choose a currency!'; } Array. Of course it's an array. :P Thanks a bunch, sniko. Will get right on that. Quote
sniko Posted July 17, 2012 Posted July 17, 2012 Array. Of course it's an array. :P Thanks a bunch, sniko. Will get right on that. No worries :) Quote
KyleMassacre Posted July 17, 2012 Posted July 17, 2012 Array. Of course it's an array. :P Thanks a bunch, sniko. Will get right on that. I dont think it HAS to be an array but this would seem much safer as you never want to trust user input so I would suggest this way Quote
Seker Posted July 18, 2012 Author Posted July 18, 2012 Go figure. I actually was able to do it. :P And, I think you were right, sniko. It's much better this way. [ATTACH=CONFIG]551[/ATTACH] Quote
Uridium Posted July 18, 2012 Posted July 18, 2012 A new update in the form of screenshots! (Sorry about the red on gray. It was either that or black on black for the table headers :P ) Item Info: [ATTACH=CONFIG]539[/ATTACH] Inventory: [ATTACH=CONFIG]540[/ATTACH] Attack: [ATTACH=CONFIG]541[/ATTACH] Staff Items: [ATTACH=CONFIG]542[/ATTACH] I wrote an addon for Inventory a while ago and would fit yours quite nicely the idea of the addon was that certain links cold be switched on or off when creating/editing items for example if a user had a rare item you could decide via the script wether to let the SEND link be visible or not as well as other links.. Quote
sniko Posted July 18, 2012 Posted July 18, 2012 I wrote an addon for Inventory a while ago and would fit yours quite nicely the idea of the addon was that certain links cold be switched on or off when creating/editing items for example if a user had a rare item you could decide via the script wether to let the SEND link be visible or not as well as other links.. Would it add it into the specific file that you turned the link off? For example, item ID "x" couldn't be sent by using /senditem.php&item=x&qty1&user=y Quote
Uridium Posted July 18, 2012 Posted July 18, 2012 Would it add it into the specific file that you turned the link off? For example, item ID "x" couldn't be sent by using /senditem.php&item=x&qty1&user=y I cant see why not as long as the senditem.php knows weather the switch for that item is on or off that shouldnt be a problem Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.