• 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.
  • Ever thought it'd be cool to have your art, writing, or challenge runs featured on PokéCommunity? Click here for info - we'd love to spotlight your work!
  • Our weekly protagonist poll is now up! Vote for your favorite Conquest protagonist in the poll by clicking here.
  • 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.

Soft level cap for CFRU?

  • 59
    Posts
    4
    Years
    • He/Him
    • Seen today
    Hello,does anyone know of a way to implement the soft level cap from fire red's modexe or "disable exp gain until certain badge" as it says for CFRU?For example I want pokemon to stop gaining exp as soon as they hit 16 lvl if you have not obtained the first badge yet.Then after you get it pokemon will start gaining exp again till the level cap for the next badge.Thanks in advance.
     
    in exp.c in static
    line 47 :
    Code:
    u32 ExpCalculator(u32 a, u32 t, u32 b, u32 e, u32 L, u32 Lp, u32 p, u32 f, u32 v, u32 s)
    ->
    Code:
    static u32 ExpCalculator(u32 a, u32 t, u32 b, u32 e, u32 L, u32 Lp, u32 p, u32 f, u32 v, u32 s, u32 bb)
    line 473 :
    Code:
    static u32 ExpCalculator(u32 a, u32 t, u32 b, u32 e, u32 L, u32 Lp, u32 p, u32 f, u32 v, u32 s)
    ->
    Code:
    static u32 ExpCalculator(u32 a, u32 t, u32 b, u32 e, u32 L, u32 Lp, u32 p, u32 f, u32 v, u32 s, u32 bb)

    then in the function, before
    Code:
    return MathMin(1640000, calculatedExp);
    adds
    Code:
    calculatedExp *= bb

    when declaring variable on line 150
    Code:
    u32 trainerBonus, tradeBonus, baseExp, eggBoost, defLevel, pokeLevel, passPower, affection, evolutionBoost, divisor;
    become
    Code:
    u32 trainerBonus, tradeBonus, baseExp, eggBoost, defLevel, pokeLevel, passPower, affection, evolutionBoost, divisor, cap;
    in the function, in the part where all the modifier are calculated add:
    Code:
    	u32 cap = 0;
                    if (!FlagGet(FLAG_BADGE01_GET) && pokeLevel >= 14)
    			cap = 0;
    		else if (!FlagGet(FLAG_BADGE02_GET) && pokeLevel >= 19)
    			cap = 0;
    		else if (!FlagGet(FLAG_BADGE03_GET) && pokeLevel >= 24)
    			cap = 0;
    		else if (!FlagGet(FLAG_BADGE04_GET) && pokeLevel >= 29)
    			cap = 0;
    		else if (!FlagGet(FLAG_BADGE05_GET) && pokeLevel >= 36)
    			cap = 0;
    		else if (!FlagGet(FLAG_BADGE06_GET) && pokeLevel >= 43)
    			cap = 0;
    		else if (!FlagGet(FLAG_BADGE07_GET) && pokeLevel >= 47)
    			cap = 0;
    		else if (!FlagGet(FLAG_BADGE08_GET) && pokeLevel >= 50)
    			cap = 0;
    		else 
    			cap = 1;
    changes the number to your needs

    and at last when you see
    Code:
    calculatedExp += ExpCalculator(trainerBonus, tradeBonus, baseExp, eggBoost, defLevel, pokeLevel, passPower, affection, evolutionBoost, 2 * viaExpShare);
    ->
    Code:
    calculatedExp += ExpCalculator(trainerBonus, tradeBonus, baseExp, eggBoost, defLevel, pokeLevel, passPower, affection, evolutionBoost, 2 * viaExpShare, cap)

    i don't know if this is the best solution, but works for me, after reaching the cap, each battle gives you 1xp.
     
    Last edited:
    when the tuction calculate varius modifier for the exp adds something like

    Code:
    u32 cap = 0;
    if (!FlagGet(FLAG_BADGE01_GET) && pokeLevel >= 14)
    cap = 0;
    else if (!FlagGet(FLAG_BADGE02_GET) && pokeLevel >= 19)
    cap = 0;
    else if (!FlagGet(FLAG_BADGE03_GET) && pokeLevel >= 24)
    cap = 0;
    else if (!FlagGet(FLAG_BADGE04_GET) && pokeLevel >= 29)
    cap = 0;
    else if (!FlagGet(FLAG_BADGE05_GET) && pokeLevel >= 36)
    cap = 0;
    else if (!FlagGet(FLAG_BADGE06_GET) && pokeLevel >= 43)
    cap = 0;
    else if (!FlagGet(FLAG_BADGE07_GET) && pokeLevel >= 47)
    cap = 0;
    else if (!FlagGet(FLAG_BADGE08_GET) && pokeLevel >= 50)
    cap = 0;
    else



    I'm really sorry but I don't understand what you mean by this part
    'when the tuction calculate varius modifier for the exp adds something like'
     
    I've tried to compile it and I seem to be getting a few error while following your tutorial.

    Is there anyway you could attach your exp.c file?
     
    just put it under :

    Code:
    //Evolution Boost
    		evolutionBoost = 10;
    		if (CouldHaveEvolvedViaLevelUp(&gPlayerParty[gBattleStruct->expGetterMonId]))
    			evolutionBoost = 12;

    my exp.c have other modifications,
    "when the tuction calculate varius modifier for the exp adds something like"
    sorry i wrote that in a rush, i mean in the *function, in the part *where all the modifier are calculated.
     
    Last edited:
    Okay thank you,

    If I get any errors when I compile can I show you and see what you think may be the problem?
     
    Ye, no problem.
    Add me to Discord if you want. (The username is on my profile page)
     
    Thankyou! I've just added you!

    So before I had errors come up, I'll show you on discord what they were,

    Did a couple of tweaks and now for some reason it's all compiled correctly but still not working. I don't get it haha
     
    I couldn't do your tutorial right, there was an error here, can you help me? this is my Discord: Jean Stars#1438
     
    to anyone who wants to re-enable modexe badge based level cap in cfru,

    we need to restore original atk23_getexp of firered (probably will break cfru introduced exp features)

    find "F9 23 02 08" in a hack with CFRU inserted, the offset right behind it is a pointer to your atk23_getexp ( should be xx xx xx 08 or 09)

    restore it to the original firered atk23_getexp pointer "69 1A 02 08"

    this should allow modexe badge based level cap to work again.

    credits : Meister_anon~Master_o f_None
     
    Stumbled across this thread and saw that the poster of the original solution is no longer active. Therefore I've searched Discord and i can happily share a working solution! See the screenshot below. (Mirror)

    All credits go to Andre Freitas. For any other queries, join the Pokemon Unbound Discord server
    [PokeCommunity.com] Soft level cap for CFRU?

    The text to copy-paste:
    Spoiler:

    Spoiler:
     
    Last edited:
    Stumbled across this thread and saw that the poster of the original solution is no longer active. Therefore I've searched Discord and i can happily share a working solution! See the screenshot below. (Mirror)

    All credits go to Andre Freitas. For any other queries, join the Pokemon Unbound Discord server
    View attachment 169625

    The text to copy-paste:
    Spoiler:

    Spoiler:
    Oh, but this is an injection, right? Honestly, I never learned to do that, not because I didn't want to, my English is basic and I don't quite understand many things, in fact I use HMA's Fuil. anyway thanks for the help :3.
     
    Oh, but this is an injection, right? Honestly, I never learned to do that, not because I didn't want to, my English is basic and I don't quite understand many things, in fact I use HMA's Fuil. anyway thanks for the help :3.
    Yes technically. This is a modification that you'd make to one of the .C files in the CFRU, before injecting that into ur ROM.

    If you're just using HMA then you'd have the option to apply "HUBOL" (CFRU/DPE) to ur ROM using that but u wouldnt be able to modify how that's configured. Therefore I don't think there's a way to do level caps that way - u could if u weren't using the CFRU but any hack nowadays should ideally be using it
     
    Back
    Top