Jump to content
  • 0

Only allow the player to have 1 bag in inventory


Vallorz

Question

Hi, I am really new to the Intersect engine and been looking all over the place on how to do this but could not figure it out. 

 

I am wanting to make it so the player can only have 1 bag in their inventory at a time so they cannot just fill their inventory up with bags for like 100 inventory slots. 

 

I am assuming I can do this with a variable but I am a bit confused on how it would work and got lost trying to make it work lol. 

 

I would also like to mention that I don't want the second bag to be deleted, say if they already have a bag in their inventory and are trying to take another one out of the bank then it just wouldn't let them and give them a message like "You may only have 1 bag on you" or if they try to buy a bag from a shop, it wouldn't let them. 

 

Any help would be appreciated, thanks <3

Link to comment
Share on other sites

7 answers to this question

Recommended Posts

  • 0

Hi, there's several way to do that, but each one have their own drawback as i'm not sure you can do it the way you want because there's no actual way to do a checking from the vendor when you're buying and even the player can still put the bag in banks. So apart from the pure deleting option (Wich is not really good imo) i'm not sure you can do it perfectly without source edit.

 

But ! There are workaroung

 

Exemple of not working things : 

1)Put a conditional branches on the "Bag vendor" which check if the player got a Bag and if so, the player cannot buy another one.

2) Not working because : the player can put bag in bank and come later

 

 

A working way assuming your player never lose item on death: 

1)Give the player a "Bag" token or a simple bag in the begining of the game, make it "Bound".

2) Make as much crafting recipe of Bag as you need (Like : Little bag, medium bag, big bag), put whatever you want in the recipe and the lesser bag as a component ( Little -> Medium -> Big -> Etc...)

Then, put them in a table craft "Bag Vendor"

3) Make a npc Bag Vendor wich open the craft table "Bag vendor"

4) When the player want to have a bigger bag, he go this vendor and he will never able to have more than one bag because he will need it to upgrade.

 

 

I'm not sure it's the way you want it because you may want the player to have Bag in bank or things like that, but i don't see another way for the moment.

And you can expand the size of the banks in the server config so it's not a real matter.

 

 

Link to comment
Share on other sites

  • 0
2 minutes ago, Beast Realm said:

Hi, there's several way to do that, but each one have their own drawback as i'm not sure you can do it the way you want.

 

 

Exemple of not working things : 

1)Put a conditional branches on the "Bag vendor" which check if the player got a Bag and if so, the player cannot buy another one.

2) Not working because : the player can put bag in bank and come later

 

 

A working way assuming your player never lose item : 

1)Give the player a "Bag" token or a simple bag in the begining of the game, make it "Bound".

2) Make as much crafting recipe of Bag as you need (Like : Little bag, medium bag, big bag), put whatever you want in the recipe and the lesser bag as a component ( Little -> Medium -> Big -> Etc...)

Then, put them in a table craft "Bag Vendor"

3) Make a npc Bag Vendor wich open the craft table "Bag vendor"

4) When the player want to have a bigger bag, he go this vendor and he will never able to have more than one bag because he will need it to upgrade.

 

 

I'm not sure it's the way you want it because you may want the player to have Bag in bank or things like that, but i don't see another way for the moment.

 

 

 

Oh I never thought about making it so you have to use the smaller bag to make a bigger one. 

Question though, is there a way to make it so everything but the bag gets dropped on death? 

 

Thanks, much appreciated!!

Link to comment
Share on other sites

  • 0
7 minutes ago, Beast Realm said:

Made a few tests :

 

Bound items are not dropped on death. (They can still be put inside bank )

 

But, items inside the bounded bag are NOT dropped on death. It can be a feature as a "protective bag"
It would need source edit to do otherwise

 

Thank you so much for the help, I will play around with this and see what works best. 

 

Oh one last thing, I am totally dumb, how do I enable item drop on death again?

Link to comment
Share on other sites

  • 0

Server -> Ressources -> Config.json ->

Around line 100 if you use notepad++

 

I think it's a chance for every item(One roll for each), so if you put 100, every item drop. Test it to get the best working things for you.

 

  "Player": {

Quote

    "ItemDropChance": 0,


    "MaxBank": 1000,
    "MaxCharacters": 3,
    "MaxInventory": 60,
    "MaxLevel": 100,
    "MaxSpells": 100,
    "MaxStat": 3000,
    "RequestTimeout": 300000,
    "TradeRange": 10

 

Link to comment
Share on other sites

  • 0

So this is what I have done in case anyone else is ever looking for ways to do this:

 

Bags are dropped on death. 

You are able to purchase a "Small Bag" from a shop.

In order to get a Medium Bag, you need to craft it using the Small bag then use the medium for the big bag. 

If you try to have 2 bags at the same time, it will delete the second bag and refund you the cost of the bag if it's a small bag or refund you the crafting materials if Medium or Large bag along with value of small bag or medium bag depending which bag you are trying to have 2 of.

 

 

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...