Jump to content
  • 0

Store item number value in a variable


Artheios

Question

Hello all, Gibier figured out there's might be no way to store the number of an item that a player possess in inventory in a variable. I made verification in the editor and fount nothing that permit this kind of action or did i miss something ? If someone could help please ^^.

Link to comment
Share on other sites

6 answers to this question

Recommended Posts

  • 0

It's not very neat but could you make an integer variable that stores item count. Then make an absolute sh*t tone of instances that take away 1 of a certain item. at the top of the common event set the integer to equal 0. In the "take item succeeded part" add 1 to the variable. In the "Failed part" tell it to add the item back to the inventory with the quantity equal to the variable then exit the event. You would have to copy and paste that code 100 - 1000 times but it's the only way I can think about how getting around this limitation. 

 

Edit: Wait I think I know how to do this in a neater way. lemme make a screenshot

Link to comment
Share on other sites

  • 0
3 hours ago, Artheios said:

I see how you do it, i will try this way, thanks. But maybe it's a thing that could be added to the source code as a conditionnal option like "has X item in inventory"

 

That's something that is already in the engine 😅 but personnally what I was thing about was a simple variable +/- items number.

Link to comment
Share on other sites

  • 0

yep wrong idea^^ it would rather be more in the "set variable" function, should be able to be set as an item number in inventory like :

when choosing the "set variable" function, we should have another choice named "item number" giving access to a list of the object of the database (or inventory directly).

But have no skill in C# so i don't know how far what would be necessary to have these changes ^^. 

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