Jump to content
Sim

WIP: New Item System

Recommended Posts

Posted (edited)

See, I know I mentioned a new item system, so here's some previews as well as a complete list of what my plan is on this new item/inventory system.

 

The hardest part of the item system is done for the most part. The relationships between item types and slots since multiplier selections can be selected at once. Updating was a pain in the DB. 

Item Types: (Finished)

You can create item types based on the 3 basic item types I have created thus far. Weapon, Armour, health (like health potion). More can be added from a itemType class file once I can think of a design for them.

Item Slots(not required)(Finished)

This is for people who wish to allow multiple items of the same type. Say equiping a left handed weapon, right handed weapon, headgear, best, ect. Instead of the basic one armour and on weapon.

For ease, you can add item Slots from item types and vice versa. 

Items (Finished)

I have not started this page yet. But it's fairly basic, image, price , value(strength, defense, ect.) and choose item type. If the item type needs more fields for creation in the class files I will be setting it up where it can be done.

Inventory (Finished)

Your basic inventory. Will show which items to own. Also your equiped items. Items that are non-equipable can be 'consumed or used'. Health or item boost.

"Item Packages/Item Groups" (Scrapped)

This will be used to create multiple items in one item. Ex: a briefcase, you open it and get 3items. Or a safe: you open it and get 6items. I decided to turn this into an item type as it saves code, and will be a create example for people on how to make other item types.

Gift Items (Completed)

This will allow players to send other players items.

Shop(Finished)

Your basic shop, will have categories and items for sale and can choose location of shops.

User Shops(Finished)

Allows players to add items from there inventory to there own shop. I suppose to could say it's very similar to the black market except all items are not in one place. Users can view all items for sale by a specific item.

Black market(Finished)

All user items for sale. May also include a place on user profiles showing items they have for sale.

Trade Zone(Not Started)

Players can select what items they would like to trade and other players can select items back in a trade deal where the original player can accept or decline.

 

Screenshot_20200524-181121.thumb.png.2f501c3f403dc7e0145e4dcbac76a527.pngScreenshot_20200524-181809.thumb.png.5949e91654c104cbded7077f4a5d6b82.pngScreenshot_20200524-181753.thumb.png.835c87eceb130a5ce07f8bee7896a455.pngScreenshot_20200524-181312.thumb.png.7daad362f19956500c1561827b07cb1e.pngScreenshot_20200524-181749.thumb.png.06232c8afd6c08a746794ce0e1832fe2.pngScreenshot_20200524-181146.thumb.png.0de317cf3c612939ee12f3c7ae19eeba.png

Screenshot_20200524-184710.thumb.png.1f35c34bbabbe946f680df002f7a1b5e.png

Edited by Sim
Updated Progress
  • Like 2

Share this post


Link to post
Share on other sites

LoL.. no, but I have access to our private messages.

Nah. J/K.. this is a lot of the stuff I had coded for oRPG  Creator. 

 

Maybe we should just team up? I know yo can design 🙂 And when I code something I make sure it's not half ass. If yo leave any features out, yo have to go back and redesign it most likely. Might as well do it right the first time. 

 

My first few mods was buggy upon release. Not anymore. Coding is like riding a bike. LoL

Also, the way GL is. Isn't there anyway to include a real fight system. 

  • Like 1

Share this post


Link to post
Share on other sites

😄 

missed GL engine been working with a client for his theses , havent touch GL in a week or more, didnt finish the trading system, nor my inv system 😞  wish i get back to my own work fast

 

Share this post


Link to post
Share on other sites

I got the class files done for two "Main Item Types". Just to lay the foundation down to mark the features done that's already started.

When creating a item type it will inherit the properties from the main type choose. Weapon/Armours add bonus to attacks and defense. HealthBonus will be next easy main easy item to create. Then certain item boost types will be created. If anyone got any suggestions for item types, reply. 

 

I decided to use in interface instead of main class

interface ItemType
{
  
  public function __construct($data = array());
  
    public function getID();
    
  public function getValue();

  public function getName();

  public function getPrice();
  //return results or msg or whatevee you like, if type different from weapon, armour.
    public function useIT();

}
<?php

class Weapon implements ItemType{
  
  public $desc = "increases attack power";
  public $itemType = "Weapon";
  public $itemID = null;
  public $name = null;
    public $value = 0;
    public $price = 0;
    
    //pass any data needed for item type to be used.
    public function __construct($data = array())
    {
      $this->itemID = $data['id'];
      $this->name = $data['name'];
      $this->value = $data['value'];
      $this->price = $data['price'];
    }
    
    public function getID(){
        return $this->itemID;
    }
    
  public function getValue(){
        return $this->value;
    }

  public function getName(){
    return $this->name;
  }

  public function getPrice(){
    
  }
  //returns value.
    public function useIT(){
      //was testing to see if could access properties
      global $db, $user;
      
      $user = new user(1, false);
      $user->set("US_money", $user->user->info->US_money + 10000);
      return $this->value;
    }  
}


 

Items should be as simple as when pulling from DB.

//Creating any item

$item = new $rec->parentName($rec->data);

//Def/attack

$value .= $item->getValue();

//Or if want to return value in iseIt

$value .= $item->useIt();

//Or action items, refill Health, action points, revive, ECT.

$item->useIt();

Screenshot_20200525-122149.png

Screenshot_20200525-122114.png

Edit: easier reading

Screenshot_20200525-123318.png

Screenshot_20200525-123234.png

 

 

Edit: and yes still coding on phone 🙂

Anyone got a image class they can recommend for resizing images? Other then that, the items are done now.

 

Yo can choose default image size to save the few seconds of adding it to the items. It preloads the fields. But there may be instances to need a different size for different types of items so I allowed for this field to be changed.

 

Screenshot_20200526-065733.thumb.png.8109a50f7044f3221e11cb35bf527c60.pngScreenshot_20200526-065645.thumb.png.3edf4887f440b9923d16143108db7862.pngScreenshot_20200526-065650.thumb.png.09a73da951b9c58cd69b6f9143031b43.png

  • Like 4

Share this post


Link to post
Share on other sites
Posted (edited)

ACP Shop section done: that means 80% of ACP done. You can add all items to Shop from shop page. Next I have to go back to the items page and allow users to add the items to shops from creating and editing item pages.

Then add the upload images on items and might as well add them to shops. And ACP mostly done.

 

Screenshot_20200526-222734.png

Screenshot_20200526-222739.png

Screenshot_20200526-222759.png

 

 

 

 

 

 

Next purchasing items, inventory.

Then user shops/black market. Whichever yo want to call it. 🙂

Edited by Sim
  • Like 1

Share this post


Link to post
Share on other sites

I am off work for the weekend, so this should allow me to develop a little faster(if my phone will sty online long enough).

Here's a working preview of the inventory. It looks like I need to go back and edit the item module again to add resell price or add a settings to items for item sell %. Quick sell item at %50 as default sounds good . 

Screenshot_20200530-095534.png.19af3f071c6ef3fa8a069809cc508f52.png

 

As you can see the links on right side. It looks like I have another feature to add to the item system. Gifting items to other players. The item system should be nearly complete by end of weekend. My dev phone on 0% right now though so this is holding me up. I believe everything but the player trades should be completed. 

BTW, I also keep the main post updated.

Gifting users is complete. It also sends notification to user who receives item. I also have it send notifications to user id 1 if I believed the user is trying to cheat. Gift items they don't own. This can only be done by altering form data(usually outside program). 😉

 

You can click the item you wish to gift and it goes to this form. From there you can add more items and enter username. The gift feature can be reached outside your inventory as we

The best part about multiple selections of gifts. Every mod created for the item system allows this. If yo receive an error. You don't have to reselect all your options again. Imagine clicking 20 items but made a typo in a username then had to redo it. 🙂

 

Screenshot_20200530-183235.thumb.png.938956072d78fbc0e2d01a08465beee5.pngScreenshot_20200530-183216.thumb.png.f5d31e3001eab05f8a3c77f1065e3dd7.png

Screenshot_20200530-183202.png

Screenshot_20200530-183243.png

Share this post


Link to post
Share on other sites

User Shops done:

Some Proper error handling screen shots added as well.(altering values in URL)

Screenshot_20200531-235216.png

Screenshot_20200531-235236.png

Screenshot_20200531-235239.png

Screenshot_20200531-235221.png

Screenshot_20200531-235228.png

Screenshot_20200531-235251.png

Screenshot_20200531-235244.png

Screenshot_20200531-235248.png

Screenshot_20200531-235204.png

Screenshot_20200531-235209.png

Screenshot_20200531-235605.png

Screenshot_20200531-235525.png

Screenshot_20200531-235534.png

  • Like 2

Share this post


Link to post
Share on other sites

Black market is finished except for images. It is nearly identical except lists all items for sale instead of like user shops only showing items from owner of shop.

 

Only two additional features for item mod then nearly complete

Share this post


Link to post
Share on other sites

This is a hugeee feature, excited to see it finished 🙂

  • Like 2

Share this post


Link to post
Share on other sites
Posted (edited)

Thanks. I can't wait till it's finished myself 

I bet you are. This was something I planned on creating for oRPG Creator. It was  unfinished, but was more extensive due to the flexibility of oRPG Creator. Had to create stats and add them to the item types. LoL.

I wanted to enter this item system in the mod Contest. 🙂

Edited by Sim

Share this post


Link to post
Share on other sites
4 hours ago, Sim said:

I wanted to enter this item system in the mod Contest. 🙂

You should have built it quicker than 😛

Share this post


Link to post
Share on other sites

Maybe I'll wait till there's another one before I release it? ;)

Scrapped the actuall item groups/packages module itself.

It could be done using item types and will be a great example on how to create your own item type with the item type class files itself.

 

All that's left is the user trades then add the image features will give this mod the much need appeal.

Scrapped the actuall item groups/packages module itself.

It could be done using item types and will be a great example on how to create your own item type with the item type class files itself.

 

All that's left is the user trades then add the image features will give this mod the much need appeal.

Share this post


Link to post
Share on other sites

Trade Zone has been started.

This mod involved a bit more thinking on design, but now that I have it figured out how I would like it to fully work it development will be faster.

People can reply to a listing much like adding a listing picture below. Then the Creator can approve the trade or deny it.

Screenshot_20200604-191709.png

Screenshot_20200604-191701.png

Screenshot_20200604-214307.png

Share this post


Link to post
Share on other sites

Since I am nearing completion of this module, I decided to do away with adding all the modules to the menu and create a custom menu for it using the custom menu hook. It's a nice touch.

The trade zone link will end up looking like this Trade Zone( # ) if there any transactions that need the players approval.

Screenshot_20200607-120345.thumb.png.81ff6701a83ba5477fcf0b1d6be7cd95.png

Here's what everyone been waiting for besides the release.

All places where an item should be is now there. I just uploaded the shops folder 10x wondering why something wasn't working until I realized I was uploading the wrong folder so that just means I am to tired. Lol...

 

All that's left is the user trades and then some extensive testing since it's a fairly large mod.

 

Screenshot_20200607-201201.png

Screenshot_20200607-211632.png

Screenshot_20200607-210912.png

Screenshot_20200607-201956.png

Screenshot_20200607-201859.png

Screenshot_20200607-201201.png

Screenshot_20200607-204433.png

Screenshot_20200607-204416.png

Screenshot_20200607-204411.png

Share this post


Link to post
Share on other sites

No comments in days with all new updates and pictures with pretty pictures. Very discouraging. 🙂

Share this post


Link to post
Share on other sites

I'm hoping to allow some people test it this weekend for bugs I've overlooked. I had to restart the trade zone yesterday because I made a mistake in my database design.

And, it's a pain cycling threw the items from inventory or store, or blackmarket, ECT. And getting item types.

The trade zone is even more complicated. 

 

Especially since the functions that are needed for every mod to work properly is a couple hundred lines of code and are copied and pasted in every mod. On Cell Phone to. I'm sure the hundred of lines of code wouldn't bother me so bad if I wasn't coding on cell. (CODE CLEAN UP LATER). 

Share this post


Link to post
Share on other sites

Honestly, this is pretty good and excited to see it release!

  • Thanks 1

Share this post


Link to post
Share on other sites

I started cleaning up the code with a ItemHelperFunction class. I done removed over 1,000 lines of code across all files into less then 200 lines in the function class 

For fun: I also broke the item slots ACP and can't get it to work again(same code from item types ACP but produces two different results).

Share this post


Link to post
Share on other sites

I am going to try and finish this mod up today. I am fairly certain everyone is going to be pleased with the price of this module. 

Share this post


Link to post
Share on other sites

It's been awhile since I have made any updates to the mood as I was struggling with how to equip items to the created item slots. 

Us programmers tend to over complicate things and this is how easy it was. :)..

 

I have a few minor things to fix, only allow a players item to be in one place. Not equipped, in shop, in player shop, in blackmarket, ect 

 

Theni also need to do some tweaking to what's already implemented into GL's item (System so items actually matter.) Add the values from my item System to take effect into GL.

I ALSO might release a few mods using this item System such as a new attack, mug, fight mod. So the item System plays a larger part in games. As I will be creating these miss for my game anyway. 

 

I also have a very interesting new daily game mod I should be releasing soon as soon I figured out this JavaScript error.

 

Screenshot_20200708-180116.thumb.png.93dc7cdc91452a69d60baf866caca82a.png

Share this post


Link to post
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...