The way you have it set up, I don't understand why you have the conditional branch.
Let's say the player starts with 0. The first part will run. But the first part does not add to the variable. So the first part will run the second time, as the variable will still be equal to 0.
Not sure what you're doing here.
First thing I'd do is simply have an event that displays the text "You found Yellow Star!" or whatever it is. I'd then put under the message "Add Item: Yellow Star". Under that, I would then put "Control Variable: Add 1 to Yellow Star". I'd then display a message that says, "You have [Variable Display Number] of these!"
No need for a conditional branch at all. Not even for giving you the first one for free. You can give the first one for free the moment you want the player to have it, at the event they should have it first.
All you'd need after that is just to copy the commands into any event that gives another of these collectibles.
yeah, i get that, but doesnt this work too? that way i won't have to make a second event, and can just use this one and copy it to new areas. possibly changing the image icon if need be.
You can still do it the way Tai_MT said and copy/paste it other places.
The only reason you need to have a conditional branch is if you want something to happen when a certain number of that item is reached.
Also, in the "Else" branch - you set the same variable twice, and that makes no sense. Either one will work, but you don't need both of them.
so, will what i did not work when picking up a second item etc?
It should work, as best as I can tell. And I do see you now have different messages, my apologies for missing that earlier. Different messages is a good reason for conditional branches.
I'm just not seeing a reason to set the collectibles variable twice in the Else statement. Pick one or the other method to set it.
well, if youve gotten one already then the first thing wont happen. then itll always go to else. thats why. anyway thats what i tried to do here.
ah wait, the collectibles in that second one is basically based on game data of how many yellow stars are in ur inventory. so um ur saying i dont need that?
I think you only need to call the variable once. It doesn't necessarily need to be set. Variable starts at zero unless you specify otherwise. Just by putting in "Add 1 to variable", it changes the variable. Setting your variable in this way still calls it. If you were to remove the "Set variable to X" after adding to it, it would just do nothing, it's redundant. It should still display the proper variable number after adding 1 to it. After all, the variable is set to whatever you've set it to.
Though, this depends on what you're doing. There's no need to "add 1 to the variable" if you're already setting the variable to be however many of an item you own. But, if you are having a variable not linked to the specific amount of items (like say, you want to know how many Diamonds the player has looted, but you can't keep track of how many they've sold), then you'd just use the "add 1 to the variable" to keep track of the amount of the item that has been obtained. In that case, you wouldn't need to know how many the player is specifically carrying, because they could be used or sold or whatever.
well, im planning on making a star item that is kind of a collectible, which will also show up on the save, so that you can see it when you load or save the game, among other things that will be there. ill try removing the one including the inventory stars, and just use the variable, hopefully that will work. thanks for the help 🙂 i won't give the items a price so they can't be sold.
if i get it to work i will also add quest points and quests completed etc.