• 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] Rival in PWT Script

51
Posts
9
Years
    • Seen Jan 8, 2023
    Hello,
    Sorry for my question, but i need your help!
    I would like to add the rival in PWT script, but I don't know how to insert the version variable in the script. Can you help me?
    Thanks for all 🤗
     
    51
    Posts
    9
    Years
    • Seen Jan 8, 2023
    Ok, but the form of rival (1,2 or 3) automatically appear? Or in the script you need to add some "if..."?
    Thanks 😁
     
    286
    Posts
    5
    Years
    • Seen May 15, 2024
    Ok, but the form of rival (1,2 or 3) automatically appear? Or in the script you need to add some "if..."?
    Thanks 😁

    You can see where to put that number here in the comment they provide above "def fetchTournamentList" (where "trainer variable" is):
    Code:
    # trainer_entry[trainertype,trainername,endspeech_loose,endspeech_win,trainer variable,lobby text (optional), text before battle (optional), text after battle (optional)]
     
    51
    Posts
    9
    Years
    • Seen Jan 8, 2023
    ok, i understand.
    My question is how to make the variable be conditioned by the variable "choosing starter". So that, when I challenge him, he has training based on my starter and not random.
    Does it do it automatically, or do I have to add something myself? Thanks 😄
     
    286
    Posts
    5
    Years
    • Seen May 15, 2024
    ok, i understand.
    My question is how to make the variable be conditioned by the variable "choosing starter". So that, when I challenge him, he has training based on my starter and not random.
    Does it do it automatically, or do I have to add something myself? Thanks 😄

    You can use "$game_variables[XXX]" where "XXX" is the number of the variable if you want to do this in the script (you're probably not using the team your rival first uses in the PWT, so you could do something like "$game_variables[XXX]+6" if you wanted it to use the third battle's teams for example).
     
    51
    Posts
    9
    Years
    • Seen Jan 8, 2023
    Could such a thing work?

    def pbTrainerBattle(trainerid,trainername,endspeech,
    doublebattle=false,trainerparty=0,canlose=false,variable=nil)
    if $game_variables[007]==2 && val.include?("Komor")
    next 2
    if $game_variables[007]==3 && val.include?("Komor")
    next 3
    end
    end
    end
     
    Last edited:
    286
    Posts
    5
    Years
    • Seen May 15, 2024
    Could such a thing work?

    def pbTrainerBattle(trainerid,trainername,endspeech,
    doublebattle=false,trainerparty=0,canlose=false,variable=nil)
    if $game_variables[007]==2 && val.include?("Komor")
    next 2
    if $game_variables[007]==3 && val.include?("Komor")
    next 3
    end
    end
    end

    I don't think so, but maybe. "next" is usually used for skipping iterations in loops I believe. I would recommend just doing something like this in the PWT script:
    "trainer_entry[trainertype,trainername,endspeech_loose,endspeech_win,$game_variables[007],lobby text (optional), text before battle (optional), text after battle (optional)]"
     
    51
    Posts
    9
    Years
    • Seen Jan 8, 2023
    Hi! In this case? Thanks for your help 😃

    def pbPWTLoadTrainer(trainerid,trainername,variable=1)
    trainers=load_data("Data/trainers.dat")
    case $game_variables[007] && trainername= "Komor"
    when 1
    variable=1
    when 2
    variable=2
    when 3
    variable=3
    end
     
    286
    Posts
    5
    Years
    • Seen May 15, 2024
    Hi! In this case? Thanks for your help 😃

    def pbPWTLoadTrainer(trainerid,trainername,variable=1)
    trainers=load_data("Data/trainers.dat")
    case $game_variables[007] && trainername= "Komor"
    when 1
    variable=1
    when 2
    variable=2
    when 3
    variable=3
    end

    Oh maybe you're on a different version of the script than me because I don't see the method you're using here. I was talking about making changes in "def fetchTournamentList" but maybe you don't have that.
     
    51
    Posts
    9
    Years
    • Seen Jan 8, 2023
    Hi!
    I have the ultimate version.
    I created this script thanks to the old version (I have them all) 😂
     
    286
    Posts
    5
    Years
    • Seen May 15, 2024
    Hi!
    I have the ultimate version.
    I created this script thanks to the old version (I have them all) 😂

    Hmm the only one I could find to use was the Simple Pokemon World Tournament script, but if there's another one maybe I'd like to check that out as well. Do you happen to still have a link to that one's page?
     
    Back
    Top