I use Items so I can sell them eventually in the shop.
For a quest I need 25 Stone.
I see that its possible that when the party has stone, something can happen.
However it is not possible to see the amount of the item stone in the Conditional Branch
That's only possible with the variables.
Is there a plug in for working with a amount of a item to see if there are enough for the quest?
I now work with items and variables and its getting confusing.
Thnx Solvius
Amount of Items?
● ARCHIVED · READ-ONLY
-
-
You don't need a plugin. Just set the variable, then use the variable in the conditional branch. You will have the "what happen when they have enough" and the "what happens when they don't have enough" on a single event page rather than split over two.
It'll look something like this:
Code:Control Variables: [Stone] = Game Data > Other > Item [Stone] in Inventory If Variable [Stone] >= 25 Text "You have enough stone - here's your reward" Change Items: [Stone] -= 25 Control Switches [Gave Stone] = ON (this will be used as a condition on the next event page) Else Text "You still have to find more stone - come back when you have enough" End -
Or simply
Code:I showed you similar code not too long ago btw. :pConditional branch -> Script -> $gameParty._items[stoneID] >= 25 change items: stone -= 25 control switches [Gave stone] = ON -
I understand it, but its very confusing.
-
I suggest you follow the link to the "starting point" in my signature and take a month or two to work through the tutorials there. I'm not talking about reading them, I'm talking about working through them - that is why you'll need a month at minimum depending on your available time.I understand it, but its very confusing.
Anyone could read them in a few days, but that would not help you because you need to work through them to really understand a tutorial.
The reason for this is because variables are the most basic component of any game making, you can't even make a quest like "kill 20 wolves" without knowing how to use variables to count (as you realised yourself).
If the advise given above is confusing to you, then you need to learn variables much better before you have any chance of ever completing even the simplest game idea.
That is no problem - everyone had to have learned this (variables are advanced mathematics not thaught in school until very later in advanced schools) and it can be learned by taking time to do this, but you need to take that time, they can't really be learned on the side. -
Andar I am used to use variables.
What confusing me are the items in combination with the variables.
I need items to eventually sell them in a store. So I used them both. 100 stone variables and 100 items stone.
But with this simple one line coding from Shaz I think I found the solution.
I change items with -10
and then I set the variables to the amount of the items with this one line of coding, where; "The number of stone" is the item stone and the vraiable is "stone"
https://i.gyazo.com/0a5182c424c4530e491cb003ea8a0d83.png
I see I made a mistake, where it says food, its supposed to say stone ;) -
No.
You want to put the number of items into the variable. THEN you want to check what value is in the variable. THEN IF the value is correct, you want to remove the items.
Just think about the individual steps, and the order they have to be executed in.
If you want me to get 25 stones, and I have 25 stones, and you take 10 away and then check to see how many I have, I'll only have 15, not the 25 I started with. You only want to take the 10 away AFTER you confirm that I have the correct number. -
When I mine I get 1 stone item and a 1 stone variable. this I do up to 25 stone in items and 25 stone in variables.
Then when I go to a store and sell 10 stone items and do not make the code to substract also 10 stone variable then I have 15 stone item and 25 stone variable. Here it goes wrong. Thats the confusing part for me with a lot of different items. So after selling items in a store, or delivering for a quest, I do that code as in the screenshot. That way the amount of variables is set to the amount of items.
I do this, because in the code is only the possibility to set it so that the party has stone as item, and not the amount of items.
I can not code: if party has 25 stone item, then. I can only code if party has stone item, then.
This is why I use a variable. Or am I missing something regarding the amount of items in making the if code? Maybe there is a better way, I dont know, but this is how I found a solution I understand.