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

[Scripting Question] If IMAGE, then THIS

Atlat

Atlat
60
Posts
4
Years
    • Seen today
    This is the last thing I need to deal with before I'm finished. Most likely. This is me we're talking about, so anything could go wrong afterwards.

    I want to be able to set a variable to a different number depending on the graphic that the event is currently using. I have basically everything finished. I just need to know what goes in the IF itself. I've looked through the code to see if there was anything similar, but to no avail.

    If _________ <-- Place I don't know what to put.
    Do this stuff.
    Else
    Do this other stuff.
    End
     

    B+

    32
    Posts
    3
    Years
    • Seen Jul 3, 2023
    It seems simple, but let me make sure I understand.

    Variable, and when that variable gets pulled, stuff happens, correct? A la RNG?

    If that variable doesn't get pulled, another script occurs, correct?

    You also say "depending on the graphic the event is using", would that image be randomized?
     

    Atlat

    Atlat
    60
    Posts
    4
    Years
    • Seen today
    Not exactly. This doesn't have anything to do with RNG. I might've been a bit too broad in my question.

    Let me put it this way. If I were to interact with this event, it'll do something if the event's graphic is a certain image. If the graphic is not that specific image, then it'll do something else.

    Variables seem like they work here at first, but the sheer scale that this'll reach to will cause too many issues. That's why I want to focus on the graphics themselves.

    If "Specific Graphic" <-- Updated version to be more clear.
    Do this stuff.
    Else
    Do this other stuff.
    End
     

    B+

    32
    Posts
    3
    Years
    • Seen Jul 3, 2023
    Not exactly. This doesn't have anything to do with RNG. I might've been a bit too broad in my question.

    Let me put it this way. If I were to interact with this event, it'll do something if the event's graphic is a certain image.

    I think I'm getting it. What about self switches? Meaning, each event page is labeled a different switch. Event pages would contain certain scripts and changing pages is how you'd set a different graphic to indicate which event page would do what. But that also means you'll still have to randomize which self switch would be pulled.

    For example:

    SHwGeBM.png


    L7bGrVD.png


    BTnokDw.png


    I had set it to parallel process to randomize upon entering the area / map, because it seems like you want the image to change before interaction.
     

    Atlat

    Atlat
    60
    Posts
    4
    Years
    • Seen today
    That's something I've considered but there's two issues with this.

    The first issue with this way of handling the situation is simply that there aren't enough self switches. The scale of what I'm doing would most certainly exceed "Self Switch Z" if it existed.

    The other issue is that what this is all amounting to is something that'll occur between many different events. They can be connected through a common event like I'm doing, but this means that I cannot use self switches to accomplish this task.

    You know what, I should probably just say what I want to happen in the long run. That would probably help.
    My game will heavily revolve around the fact that there are multiple protagonists. The way I want this to work is when you talk to one of the events that swap you between characters, it'll swap you into the character that matches the graphic of the event, and swap that event's graphic into the character you were playing as (which I've already gotten to work).
     
    233
    Posts
    5
    Years
    • Seen Oct 9, 2023
    Instead of self switches, how about a single variable whose value determines the character ID? In B+'s response above, instead of setting self switches on the first page, you can remove everything except the first line where you set Variable 0028 to a random number. Then in the second page, check "Variable 0028 == 0" instead of "Self Switch A is ON", in the third page, check "Variable 0028 == 1" instead of "Self Switch B is ON", etc. You can repeat this for as many characters as you have, but just remember that the event page conditions should be increasing since RMXP checks which page to run from right to left.
     

    Atlat

    Atlat
    60
    Posts
    4
    Years
    • Seen today
    This would work if it was kept to only two events. Let's say there are Characters A, B, and C. You are Character A and want to swap with Character B. Character A and B would swap just fine. The problem is that Character C would also become Character A because it's the same variable (and considering the length the game will be, I'd rather use a minimal amount of variables and switches). Actually, it would immediately become Character B since that's what the variable is at. It wouldn't be that bad if swapping characters was always contained, but swapping characters overall is very open. That's why I'm trying to see if there's some way for a conditional to detect the event's graphic. That way, it would be self contained to each specific event when dealing with the swapping.

    Also, where on earth are you guys getting random from? There shouldn't be any RNG in this mechanism.
     
    233
    Posts
    5
    Years
    • Seen Oct 9, 2023
    This would work if it was kept to only two events. Let's say there are Characters A, B, and C. You are Character A and want to swap with Character B. Character A and B would swap just fine. The problem is that Character C would also become Character A because it's the same variable (and considering the length the game will be, I'd rather use a minimal amount of variables and switches). Actually, it would immediately become Character B since that's what the variable is at. It wouldn't be that bad if swapping characters was always contained, but swapping characters overall is very open. That's why I'm trying to see if there's some way for a conditional to detect the event's graphic. That way, it would be self contained to each specific event when dealing with the swapping.

    Also, where on earth are you guys getting random from? There shouldn't be any RNG in this mechanism.

    I believe "$game_map.events[@event_id].character_name" inside a Script or Conditional Branch will get the name of the event's current graphic.
     
    Back
    Top