• Just a reminder that providing specifics on, sharing links to, or naming websites where ROMs can be accessed is against the rules. If your post has any of this information it will be removed.
  • Dawn, Gloria, Juliana, or Summer - which Pokémon protagonist is your favorite? Let us know by voting in our poll!
  • Our friends from the Johto Times are hosting a favorite Pokémon poll - and we'd love for you to participate! Click here for information on how to vote for your favorites!
  • 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] Help with forced battles

  • 1
    Posts
    6
    Years
    • Seen Feb 5, 2019
    Hello! I honestly wasn't sure if this was going under Scripting or eventing, but nevertheless:

    I'm trying to force the player into a battle during an event/"cutscene", I've gotten around the part of changing the event to another, I think, which is why I'm including that one as well. Like I've said, I don't want to walk next to the npc or the exclamation mark to make the battle happen, I just want to be thrown into the battle after some dialogue.

    Pretty new to essentials, but youtube and thorough google-searching hasn't helped, which is why I'm here.

    Starting the event:
    P1
    Conditions; None
    Trigger: Action Button
    Code:
    >Text:
    >Wait: 30 frame(s)
    >Text:
    >Wait: 20 frame(s)
    >[COLOR="Red"]Control switches: [0061: Battle Rival 1] = ON[/COLOR]

    Battle "Start":
    P1: Empty
    P2:
    Code:
    Conditions: Switch: 0061: Battle Rival 1 > is ON
    Trigger: Parallel Process
    >[COLOR="RoyalBlue"]Conditional Branch: Switch [0061: Battle Rival 1] == ON[/COLOR]
    >[COLOR="YellowGreen"]Comment: Type: RIVAL3[/COLOR]
    >[COLOR="yellowgreen"]Comment: Name: ???[/COLOR]
    >[COLOR="yellowgreen"]Comment: Continue: True[/COLOR]
    >[COLOR="yellowgreen"]Comment: Outcome: 26[/COLOR]
    >[COLOR="Silver"]Script: pbTrainerIntro(:RIVAL3)[/COLOR]
    >
    Else
    >
    Branch End
    >[COLOR="silver"]Script: pbTrainerEnd[/COLOR]

    I have not yet fixed the aftermath of the battle as I don't know if it's necessary, aswell as the last script (pbTrainerEnd) is necessary,
     
    You don't need a separate trainer event for the trainer battle, just use the "pbTrainerBattle" function directly after the event dialogue:

    Spoiler:


    Edit: If you need more information, you can find it on the wiki in the "Trainers" page, under the section "Structure of trainer events." I would link it, but I can't post links yet :(
     
    Last edited:
    Back
    Top