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

how to make pokemon trainer's levels be equal to yours?

180
Posts
6
Years
    • Seen Apr 15, 2024
    well, i don't know if this doubt goes here but, how can i make pokemon trainer's levels set to be equal to yours?
    and it is possible to make them be around a margin of -5 and +5 levels in relation to yours?
    like, i have a pokémon that is level 20 in first slot, so the last gym pokemon will be level 15 or even level 25
    or can the code choose the higher level pokémon in your party to calculate this? because i could make the game the easiest game by having a level 5 pokémon and then a team of level 40, so i could beat the gym in no-time. if the code take the higher leveled pokemon, then the gym leader would have level 35-45 pokémon and the battle could be more challenging
    the thing that i did was this:
    in the battle_main.c i wrote this:
    Code:
    				fixedLVL = GetMonData(&gPlayerParty[0], MON_DATA_LEVEL)
                    CreateMon(&party[i], partyData[i].species, fixedLVL.lvl, fixedIV, TRUE, personalityValue, OT_ID_RANDOM_NO_SHINY, 0);
    but then i get a "syntax error before createmon" error, and i dont know if the error is in the "fixedLVL" thing or in somewhere else...
     
    180
    Posts
    6
    Years
    • Seen Apr 15, 2024
    You missed a ";" at the end of the fixedLVL line.
    Oh, that... that actually makes total sense... how did i don't see that?
    whatever, do you know how to make it randomly being -5 to +5 levels in comparison of yours?
    like, i battle this trainer who has a poochyena. i battle him with a level 50 caterpie and i want it to randomly take level valors of 45 to 55 or 48 to 52 (this would be more fair), how can i set up the randomness?
    EDIT: i just said "hey, what if i search here:https://www.pokecommunity.com/showthread.php?t=416800 the word "random""
    and i came up with the solution... sorry for that stupid question xd
    EDIT2: wait... i guess not... i tried this:
    u8 fixedLVL=( random 5
    switch VAR_RESULT
    case 0, fixedLVL = GetMonData(&gPlayerParty[0], MON_DATA_LEVEL)-2
    case 1, fixedLVL = GetMonData(&gPlayerParty[0], MON_DATA_LEVEL)-1
    case 2, fixedLVL = GetMonData(&gPlayerParty[0], MON_DATA_LEVEL)
    case 3, fixedLVL = GetMonData(&gPlayerParty[0], MON_DATA_LEVEL)+1
    case 4, fixedLVL = GetMonData(&gPlayerParty[0], MON_DATA_LEVEL)+2)
    but i got the error "syntaxis error before 0, 1, 2, 3 and 4" so i guess the "case" is the wrong thing but, where do i have to put it?
     
    Last edited:
    53
    Posts
    5
    Years
    • Seen Mar 9, 2022
    My suggestion is to look at the syntax of other functions that use switches to know how to properly format it.
     
    Back
    Top