Jump to content
MakeWebGames

[IN PRODUCTION] New Items System


Seker

Recommended Posts

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.

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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)

Link to comment
Share on other sites

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]

infoexamp.png.3de52ea68393b6ef5534ecc118fd8772.png

inventexamp.png.5f17545c6565685dff18bfa73e902ce4.png

attackexamp.png.1a116c9c9cc8576db6b1583f4d82a091.png

staffitemsexamp.png.50db166f062da4b73c960a7f2bf5d1b4.png

Link to comment
Share on other sites

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?

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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

itemmarketexamp.png.44b5d37e7317036c6ec01a4c8011489b.png

itemmarketexamp2.png.ce37a8b926c0162a775e1dfaf639bbc8.png

Link to comment
Share on other sites

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

Link to comment
Share on other sites

$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!';
}
Link to comment
Share on other sites

$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.

Link to comment
Share on other sites

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..

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...