Conditional Branch for Item Requirement.

DrinkableTrees

Villager
Member
Joined
Oct 13, 2017
Messages
25
Reaction score
8
First Language
English
Primarily Uses
RMMV
Hey RMMV community!

I've been playing with a new conditional branch absolutely necessary for certain mechanics of my game and it doesn't seem to be processing well. The source of where I found this script was here: https://steamcommunity.com/app/220700/discussions/2/523898291496333465/

I've attached several images below.
-Event Info.png shows the event, the conditional branch script and how its all written out. Pheonix down's item ID is 0012, i made sure of this.
-TheOption.png shows the choice where the choice takes place that makes the error. The error undergoes when the first option is selected. I made sure to have 10 item ID 0012's (Pheonix Downs) but it still causes an error and forces the player to go down the Else path, where no conversion takes place.
-TheError.png shows the debug console that appears when the error takes place. Below where it was highlighted it did note to make sure ItemCore (from Yanfly) was up to date, so (to be safe) I reinstalled it and replaced it. The error still takes place.
-GoesDownElsePath.png only shows that, in fact, after the error screen appears the player goes down the "Else" option, which is supposed to take place if the player chooses to convert pheonix downs into Nia Potions but doesn't have enough Downs.

Thank you if you can help! It'll be a big step towards my game's vision.

EDIT: The goal for the NPC is (after their sidequest is finished) open up the option to exchange 10 Pheonix Downs (itemID 0012) into 1 Nia Potion (itemID 0013).
 

Attachments

Andar

Veteran
Veteran
Joined
Mar 5, 2013
Messages
31,365
Reaction score
7,676
First Language
German
Primarily Uses
RMMV
Why use a script for this at all?

Just use control variable to get the number of phoenix downs in the player inventory and check that in the conditional branch...
 

DrinkableTrees

Villager
Member
Joined
Oct 13, 2017
Messages
25
Reaction score
8
First Language
English
Primarily Uses
RMMV
Why use a script for this at all?

Just use control variable to get the number of phoenix downs in the player inventory and check that in the conditional branch...
I've heard about people commonly using variables to track how much of a number of items they current have on them. How would i make sure the variable is kept up to the number of Downs on me without having to go through the game and add "+1" for everytime the player gains a Pheonix Down?


EDIT: I found out how to set the variable to the # of item in possession through Control Variable -> Game Data.

For others and personal future reference: Make a variable to track the number you have, you wont need to update it each time it comes into possession. Right before the variable amount becomes relevant, make a "Control Variable -> Game Data -> Item -> Item you wish to count. Set the operation to "Set" and there ya go!
 
Last edited:

JamesRyan

Game Designer
Veteran
Joined
Sep 13, 2014
Messages
696
Reaction score
215
First Language
Vietnamese
Primarily Uses
RMMV
Control Variables => Game Data => Item => Choose the item you want and it will count the number of items you have.
 

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

Latest Threads

Latest Posts

Latest Profile Posts

so hopefully tomorrow i get to go home from the hospital i've been here for 5 days already and it's driving me mad. I miss my family like crazy but at least I get to use my own toiletries and my own clothes. My mom is coming to visit soon i can't wait to see her cause i miss her the most. :kaojoy:
Couple hours of work. Might use in my game as a secret find or something. Not sure. Fancy though no? :D
Holy stink, where have I been? Well, I started my temporary job this week. So less time to spend on game design... :(
Cartoonier cloud cover that better fits the art style, as well as (slightly) improved blending/fading... fading clouds when there are larger patterns is still somewhat abrupt for some reason.
Do you Find Tilesetting or Looking for Tilesets/Plugins more fun? Personally I like making my tileset for my Game (Cretaceous Park TM) xD

Forum statistics

Threads
105,868
Messages
1,017,078
Members
137,580
Latest member
Snavi
Top