• Our software update is now concluded. You will need to reset your password to log in. In order to do this, you will have to click "Log in" in the top right corner and then "Forgot your password?".
  • Welcome to PokéCommunity! Register now and join one of the best fan communities on the 'net to talk Pokémon and more! We are not affiliated with The Pokémon Company or Nintendo.

[Question] ALL switches in one event being turned on when the condition isn't met?! (V17.2) (Solved)

139
Posts
11
Years
  • I'm not going to explain why I'm trying to do what I'm trying to do. That doesn't matter.
    This is the event:
    Spoiler:


    What I WANT to happen, and what it looks like should happen is

    Spoiler:



    What is instead happening is the second I interact with the event, EVERY switch in the event turns on, rather I select an item or not. Not only that, but one item of every $PokemonBag.pbDeleteItem script I have in this event is deleted regardless of if I choose it or not.

    Here's proof that every switch in the event is being turned on at the same time:
    Spoiler:


    Since it's a conditional branch I don't see why this is happening when the switches shouldn't be turning on unless the condition is met.

    This also happens when I select an item that's in the event, which is why I believe that the event is somehow ignoring the condition it needs before turning on the switches the second I interact with it. But why would it do that?

    I'm not going to accept "just use PBBerry" or whatever that script is called as an answer. It doesn't matter what the item is. I'm going to want to use this kind of thing for items that aren't berries later, if I can get it to work.
     
    Last edited:
    658
    Posts
    7
    Years
  • You seem to be doing it wrong.

    When you say:

    pbIsBerry?(PBItems::ORANSEED)

    What you are checking is if Oran Seed item is a berry, which is always true because in PBS, the Oran Seed is defined as a berry. Same goes for the rest of your conditional branches.

    What you should be checking in the conditional branch after choosing item from bag is:

    (pbGet(5))==getID(PBItems,:ORANSEED)

    Then after setting graphic, you should exit event processing so that the rest of the conditional branches aren't checked after the graphic is changed.
     
    139
    Posts
    11
    Years
  • You seem to be doing it wrong.

    When you say:

    pbIsBerry?(PBItems::ORANSEED)

    What you are checking is if Oran Seed item is a berry, which is always true because in PBS, the Oran Seed is defined as a berry. Same goes for the rest of your conditional branches.

    What you should be checking in the conditional branch after choosing item from bag is:

    (pbGet(5))==getID(PBItems,:ORANSEED)

    Then after setting graphic, you should exit event processing so that the rest of the conditional branches aren't checked after the graphic is changed.

    That works! Thank you!
    ...Why isn't this solution in the WikiDocs under "manipulating items"?
     
    Back
    Top