• The Eevee Expo Game Jam #10 has concluded, congratulations to all participants! Now it's time for the judges to play through the games, and you can play along to vote who deserves the community choice spotlight.
    You can check out the submitted games here!
    Play through the games and provide some feedback to the devs while you're at it!
  • Hi, Guest!
    Some images might be missing as we move away from using embedded images, sorry for the mess!
    From now on, you'll be required to use a third party to host images. You can learn how to add images here, and if your thread is missing images you can request them here.
    Do not use Discord to host any images you post, these links expire quickly!
Innate Abilities (Yet Another "All Abilities Mutation" mod)

Resource Innate Abilities (Yet Another "All Abilities Mutation" mod) 1.5.2

Tsoukinator

Novice
Member
Joined
Mar 12, 2024
Posts
30
Without jumping into the code itself, it looks like the error is another file load error.

Is your innate sets.txt file formatted exactly the same as the sample file provided by Sonicover?

(Also, a tip, whenever you have an error, the details normally output to the file "errorlog.txt" in your project directory).
 

Coumbiagou

Novice
Member
Joined
Dec 5, 2023
Posts
25
Without jumping into the code itself, it looks like the error is another file load error.

Is your innate sets.txt file formatted exactly the same as the sample file provided by Sonicover?

(Also, a tip, whenever you have an error, the details normally output to the file "errorlog.txt" in your project directory).
where can i find the project directory?
 

Coumbiagou

Novice
Member
Joined
Dec 5, 2023
Posts
25
Can I see how did you defined the contents in your innate_sets file? Both error appear to be from the same origin
Ah, yes because i had the innates defined in Pokémon pbs, i only copy AND paste that info in the innate sets, so, should be this the thing that Is messing around?
 

Tsoukinator

Novice
Member
Joined
Mar 12, 2024
Posts
30
Ah, yes because i had the innates defined in Pokémon pbs, i only copy AND paste that info in the innate sets, so, should be this the thing that Is messing around?
Define each Pokemon you want Innates assigned to within the new innate_sets.txt file.
This file needs to be updated/saved in your PBS directory.

Use the example Sonicover provided to create your own entries for any Pokemon you want to assign innates to.

Here is the example they provided.
#----------------------------------------
[AGGRON]
Innates = FILTER,STURDY
#----------------------------------------
[AGGRON_1] #<- Mega Aggron. Use POKEMON_X, with X that form's number
Innates = STURDY,HEAVYMETAL,PUREARMOR
#----------------------------------------
[METAGROSS] # <- Example for Metagross, having three potential sets (groups) of innates they can be assigned.
Innates1 = SANDVEIL,STURDY,CLEARBODY
Innates2 = FILTER,CLEARBODY
Innates3 = PLUS,MINUS,ELECTRICSURGE
#----------------------------------------
 

Sonicover

Cooltrainer
Member
Joined
Jan 14, 2022
Posts
112
Ah, yes because i had the innates defined in Pokémon pbs, i only copy AND paste that info in the innate sets, so, should be this the thing that Is messing around?
Most likely, this error alongside the previous one happen because the innate_sets.txt keeps containing troublesome lines. In this case, it's because it finds a nil line that it's trying to call "empty?" on.
Copy-pasting straight from the pokemon.txt file from previous versions shouldn't be the problem because both versions used the property "Innates =", with the same case-sensitivity.

For your situation, be sure that your Innate_sets.txt has no empty lines or that all lines are properly defined

Always go for this:


Correct usage:
Expand Collapse Copy
#----------------------------------------
[POKEMONID]
Innates = ABILITY1,ABILITY2,ABILITY3
#----------------------------------------
[POKEMONID]
Innates1 = ABILITY1,ABILITY2,ABILITY3
Innates2 = ABILITY1,ABILITY2,ABILITY3
#----------------------------------------
#
# <- Use # if you want to leave empty spaces
#
#----------------------------------------
[POKEMONID]
Innates = ABILITY1,ABILITY2,ABILITY3

Try to avoid this: Empty lines

Troublesome definitions:
Expand Collapse Copy
#----------------------------------------

[MACHAMP]
  
   Innates = IRONFIST
  
 [POKEMONID]
Innates1 = ABILITY1,ABILITY2,ABILITY3

Innates2 = ABILITY1,ABILITY2,ABILITY3

Innates3 = ABILITY1,ABILITY2,ABILITY3

 [POKEMONID]
 
 [POKEMONID]

Because even if it compiles theres no guarantee it will behave as intended.

Outside of that be sure to recompile and start a new file. If even with these modifications the problem persist feel free to share your innate_sets files so I can check it and can better recreate your trouble for a more inmediate solution
 

Coumbiagou

Novice
Member
Joined
Dec 5, 2023
Posts
25
Most likely, this error alongside the previous one happen because the innate_sets.txt keeps containing troublesome lines. In this case, it's because it finds a nil line that it's trying to call "empty?" on.
Copy-pasting straight from the pokemon.txt file from previous versions shouldn't be the problem because both versions used the property "Innates =", with the same case-sensitivity.

For your situation, be sure that your Innate_sets.txt has no empty lines or that all lines are properly defined

Always go for this:


Correct usage:
Expand Collapse Copy
#----------------------------------------
[POKEMONID]
Innates = ABILITY1,ABILITY2,ABILITY3
#----------------------------------------
[POKEMONID]
Innates1 = ABILITY1,ABILITY2,ABILITY3
Innates2 = ABILITY1,ABILITY2,ABILITY3
#----------------------------------------
#
# <- Use # if you want to leave empty spaces
#
#----------------------------------------
[POKEMONID]
Innates = ABILITY1,ABILITY2,ABILITY3

Try to avoid this: Empty lines

Troublesome definitions:
Expand Collapse Copy
#----------------------------------------

[MACHAMP]
 
   Innates = IRONFIST
 
 [POKEMONID]
Innates1 = ABILITY1,ABILITY2,ABILITY3

Innates2 = ABILITY1,ABILITY2,ABILITY3

Innates3 = ABILITY1,ABILITY2,ABILITY3

 [POKEMONID]
 
 [POKEMONID]

Because even if it compiles theres no guarantee it will behave as intended.

Outside of that be sure to recompile and start a new file. If even with these modifications the problem persist feel free to share your innate_sets files so I can check it and can better recreate your trouble for a more inmediate solution
Ok, i Will be checking later, it's there are also problems i Will senda you the file
 

Coumbiagou

Novice
Member
Joined
Dec 5, 2023
Posts
25
Most likely, this error alongside the previous one happen because the innate_sets.txt keeps containing troublesome lines. In this case, it's because it finds a nil line that it's trying to call "empty?" on.
Copy-pasting straight from the pokemon.txt file from previous versions shouldn't be the problem because both versions used the property "Innates =", with the same case-sensitivity.

For your situation, be sure that your Innate_sets.txt has no empty lines or that all lines are properly defined

Always go for this:


Correct usage:
Expand Collapse Copy
#----------------------------------------
[POKEMONID]
Innates = ABILITY1,ABILITY2,ABILITY3
#----------------------------------------
[POKEMONID]
Innates1 = ABILITY1,ABILITY2,ABILITY3
Innates2 = ABILITY1,ABILITY2,ABILITY3
#----------------------------------------
#
# <- Use # if you want to leave empty spaces
#
#----------------------------------------
[POKEMONID]
Innates = ABILITY1,ABILITY2,ABILITY3

Try to avoid this: Empty lines

Troublesome definitions:
Expand Collapse Copy
#----------------------------------------

[MACHAMP]
 
   Innates = IRONFIST
 
 [POKEMONID]
Innates1 = ABILITY1,ABILITY2,ABILITY3

Innates2 = ABILITY1,ABILITY2,ABILITY3

Innates3 = ABILITY1,ABILITY2,ABILITY3

 [POKEMONID]
 
 [POKEMONID]

Because even if it compiles theres no guarantee it will behave as intended.

Outside of that be sure to recompile and start a new file. If even with these modifications the problem persist feel free to share your innate_sets files so I can check it and can better recreate your trouble for a more inmediate solution
 
Last edited:

SigMo

Rookie
Member
Joined
May 15, 2024
Posts
5
Hey, one other thing, because I know you want to retire the project already - but I was wondering if there might be a way to make it so that while a player might not have all their innate abilities activated, an npc will have all their innates activated. I imagine it would be as simple as adding another if-else statement to the set_innate_limits function, which would function identically to the if self.hasAbilityMutation? check but for opponents with its own in-game variable, not that I know what the call for an opponent's Pokemon is, and I also wouldn't make this change without your permission. I attached a theoretical if-else statement to this message, but I want to wait for your permission before I try it out.

if-else.rb:
Expand Collapse Copy
if (insert opponent call here).hasAbilityMutation?
      if Settings::INNATE_PROGRESS_WITH_VARIABLE && !Settings::INNATE_PROGRESS_WITH_LEVEL
        push_ability_count = case $game_variables[Settings::INNATE_PROGRESS_VARIABLE_FOE]
                             when 1 then 1
                             when 2 then 2
                             when 3 then active_innates.size
                             else 0
                             end
        active_innates.each_with_index do |ability, index|
          speciesAbilities.push(ability)
          break if index + 1 >= push_ability_count
        end
 

Coumbiagou

Novice
Member
Joined
Dec 5, 2023
Posts
25
...well. I see the problem

You copied and pasted EVERYTHING lol.

Delete everything that is not the [Pokemon] and the Innates =. Those are the only 2 things the innate_sets should contain per pokemon
i have added the # to solve the problem, but it still gives me the second error
 

Sonicover

Cooltrainer
Member
Joined
Jan 14, 2022
Posts
112
Hey, one other thing, because I know you want to retire the project already - but I was wondering if there might be a way to make it so that while a player might not have all their innate abilities activated, an npc will have all their innates activated. I imagine it would be as simple as adding another if-else statement to the set_innate_limits function, which would function identically to the if self.hasAbilityMutation? check but for opponents with its own in-game variable, not that I know what the call for an opponent's Pokemon is, and I also wouldn't make this change without your permission. I attached a theoretical if-else statement to this message, but I want to wait for your permission before I try it out.

if-else.rb:
Expand Collapse Copy
if (insert opponent call here).hasAbilityMutation?
      if Settings::INNATE_PROGRESS_WITH_VARIABLE && !Settings::INNATE_PROGRESS_WITH_LEVEL
        push_ability_count = case $game_variables[Settings::INNATE_PROGRESS_VARIABLE_FOE]
                             when 1 then 1
                             when 2 then 2
                             when 3 then active_innates.size
                             else 0
                             end
        active_innates.each_with_index do |ability, index|
          speciesAbilities.push(ability)
          break if index + 1 >= push_ability_count
        end
Sorry for the late reply. I needed to be in my pc for it. Sure, feel free to modify as much of my script as you want, and dont' worry, the project won't be retired nor I will stop adding features to it, I just don't want to neglect my game for now

The bit of code that you are trying to modify it's in the Pokemon Class. I'd say you'll have a much easier time modifying the one defined in AAM Battler. This bit:
Ruby:
Expand Collapse Copy
alias abilityMutations_pbInitPokemon pbInitPokemon
    def pbInitPokemon(pkmn, idxParty)
        abilityMutations_pbInitPokemon(pkmn, idxParty)

        # Initialize the innate abilities if not already set
        pkmn.assign_innate_abilities if pkmn.active_innates.empty?
        
        # Set the original innates of the pokemon
        pkmn.save_original_innates

        # Set the ability mutation list using the new method
        @abilityMutationList = pkmn.set_innate_limits
    end

This is the code responsible for loading the whole list of ability + innates to a pokemon.

The relevant bit of code for your needs is @abilityMutationList = pkmn.set_innate_limits . set_innate_limits runs the code you tried to modify that checks for if the variable is on or the pokemon level if the setting is on, and after the appropriate filtering, stores the remaining innates in speciesAbilities, but the total innates a pokemon has, after it both checked if it has custom innates and after the randomization and all that stuff it's stored in active_innates, so you'll only need to do this code in AAM Battler


Ruby:
Expand Collapse Copy
if (your code that checks for the battlers position and whatever conditional you want)
    @abilityMutationList = pkmn.active_innates
else
    @abilityMutationList = pkmn.set_innate_limits
end
 

Tsoukinator

Novice
Member
Joined
Mar 12, 2024
Posts
30
i have added the # to solve the problem, but it still gives me the second error
The current data you have is incorrect.

Instead of having ALL the data, your Pokemon should appear like this.
Here are the first three as an example.

You should only have:
1. The ID of the Pokemon, their name in all capital letters, surrounded by square brackets (e.g. [BULBASAUR]
2. The word "Innates" followed by an "=" and an all capital letter list of all the innate abilities you want to give your Pokemon.

This is what the first 3 Pokemon in your innate sets file should look like. All other Pokemon need to follow this format, otherwise your file will not work.
innate_sets.txt
#-------------------------------
[BULBASAUR]
Innates = HUGEPOWER
#-------------------------------
[IVYSAUR]
Innates = HUGEPOWER
#-------------------------------
[VENUSAUR]
Innates = HUGEPOWER,INTIMIDATE
 

Tsoukinator

Novice
Member
Joined
Mar 12, 2024
Posts
30
i have added the # to solve the problem, but it still gives me the second error
Here is an example innates_set.txt file you can use.
I have given every Pokemon two sets of possible innates they can have - and within each set, they can have two innates.
I have only assigned the same innates over and over again, so feel free to change this as you please.
And remember - you don't have to mention every Pokemon in this file - just the ones you want to have innate abilities.


View: https://pastebin.com/Z226tQLm
 
Last edited:

Bguy7

Pokémon Sol Version Creator
Member
Joined
Jul 1, 2024
Posts
19
As always, thanks for all the updates. You're doing a great job with this resource.

One thing that did come to my attention is the way that innates re-randomize when a Pokémon evolves or changes form while using the innate randomizer function. Typically, if a Pokémon evolves or changes form, either its ability will stay the same (a Bisharp with Defiant will always evolve into a Kingambit with Defiant) or specific abilities will change into another specific ability (a Bisharp with Inner Focus will always evolve into a Kingambit with Supreme Overload). Nothing ever is re-randomized. For consistency sake, it would be nice to have the option to have the innates behave the same as regular abilities and either maintain them or have then turn into the ability listed in the same index number of the new Pokémon/form.
 

Sonicover

Cooltrainer
Member
Joined
Jan 14, 2022
Posts
112
i have added the # to solve the problem, but it still gives me the second error
I tried using your innate_sets file, with the surprise that it actually loads properly, and tried removing the file completely from the PBS folder, resulting in a different error than yours.

I basically haven't been able to recreate your error, specially after the update. The error results because of a nil line line being read, which either does not exist or using notepad ++ avoids recreating somehow. Id say delete (or move) your pluginScripts file in the Data folder and force a recompile. Also make sure no other file is missing from the plugin folder.
I'd check the error more in depth
 

Sonicover

Cooltrainer
Member
Joined
Jan 14, 2022
Posts
112
As always, thanks for all the updates. You're doing a great job with this resource.

One thing that did come to my attention is the way that innates re-randomize when a Pokémon evolves or changes form while using the innate randomizer function. Typically, if a Pokémon evolves or changes form, either its ability will stay the same (a Bisharp with Defiant will always evolve into a Kingambit with Defiant) or specific abilities will change into another specific ability (a Bisharp with Inner Focus will always evolve into a Kingambit with Supreme Overload). Nothing ever is re-randomized. For consistency sake, it would be nice to have the option to have the innates behave the same as regular abilities and either maintain them or have then turn into the ability listed in the same index number of the new Pokémon/form.
Before we go any further: No, i'm not adding Hidden Innates.

That being said thats rather tricky to implement. Evolution remains consisten because of ability index, yes, so I'll have to re-writte some of the code to make the innate sets be considered indexes. Perhaps they can be considered each an index based on it's order, so if you have


Ruby:
Expand Collapse Copy
[POKEMON]
Innates1 = BLA,BLA,BLA #<- Index 1
Innates2 = HAMANA,HAMANA,HAMANA #<- Index 2
Innates3 = ABIL,ABIL,ABIL #<- Index 3

Instead of randomly pick one innate set it'll randomly pick one available innate index number and simply search upon evolving if the pokemon has that innate set.

However if I do it like that, if a pokemon has 2 innate sets and evolves into a pokemon with 3 sets, it will never pick the third set. That could be solved by adding a third innate set in the original pokemon but at that point you are messing with the odds. Idk, It'll require some messing around.
Interesting idea, I might add it after I release the first beta of my project.
 

SigMo

Rookie
Member
Joined
May 15, 2024
Posts
5
Sorry for the late reply. I needed to be in my pc for it. Sure, feel free to modify as much of my script as you want, and dont' worry, the project won't be retired nor I will stop adding features to it, I just don't want to neglect my game for now

The bit of code that you are trying to modify it's in the Pokemon Class. I'd say you'll have a much easier time modifying the one defined in AAM Battler. This bit:
Ruby:
Expand Collapse Copy
alias abilityMutations_pbInitPokemon pbInitPokemon
    def pbInitPokemon(pkmn, idxParty)
        abilityMutations_pbInitPokemon(pkmn, idxParty)

        # Initialize the innate abilities if not already set
        pkmn.assign_innate_abilities if pkmn.active_innates.empty?
       
        # Set the original innates of the pokemon
        pkmn.save_original_innates

        # Set the ability mutation list using the new method
        @abilityMutationList = pkmn.set_innate_limits
    end

This is the code responsible for loading the whole list of ability + innates to a pokemon.

The relevant bit of code for your needs is @abilityMutationList = pkmn.set_innate_limits . set_innate_limits runs the code you tried to modify that checks for if the variable is on or the pokemon level if the setting is on, and after the appropriate filtering, stores the remaining innates in speciesAbilities, but the total innates a pokemon has, after it both checked if it has custom innates and after the randomization and all that stuff it's stored in active_innates, so you'll only need to do this code in AAM Battler


Ruby:
Expand Collapse Copy
if (your code that checks for the battlers position and whatever conditional you want)
    @abilityMutationList = pkmn.active_innates
else
    @abilityMutationList = pkmn.set_innate_limits
end
Hey man, so first, no worries about the late response. Secondly, I tried making the edit to the file to where you recommended as so:

Ruby:
Expand Collapse Copy
alias abilityMutations_pbInitPokemon pbInitPokemon
    def pbInitPokemon(pkmn, idxParty)
        abilityMutations_pbInitPokemon(pkmn, idxParty)

        # Initialize the innate abilities if not already set
        pkmn.assign_innate_abilities if pkmn.active_innates.empty?
        
        # Set the original innates of the pokemon
        pkmn.save_original_innates

        # Set the ability mutation list using the new method
        if (!battler.pbOwnedByPlayer?)
            @abilityMutationList = pkmn.active_innates
            else
            @abilityMutationList = pkmn.set_innate_limits
        end
    end

But when getting into an encounter, the game crashes with this message:
[Pokémon Essentials version 21.1]
[v21.1 Hotfixes 1.0.9]

Exception: NameError
Message: undefined local variable or method `battler' for #<Battle::Battler>

Backtrace:
[Innate Abilities] AAM Battler.rb:93:in `pbInitPokemon'
Battler_Initialize:61:in `pbInitialize'
[[DBK] Animated Pokémon System] [006] Battler Sprites.rb:395:in `pbInitialize'
Battle_StartAndEnd:117:in `pbCreateBattler'
Battle_StartAndEnd:153:in `block (3 levels) in pbSetUpSides'
Battle:411:in `block in eachInTeam'
Battle:411:in `each'
Battle:411:in `each_with_index'
Battle:411:in `eachInTeam'
Battle_StartAndEnd:150:in `block (2 levels) in pbSetUpSides'

To remedy this, I tried adding a 'battler' parameter to the pbInitPokemon function, like so:
Ruby:
Expand Collapse Copy
def pbInitPokemon(pkmn, idxParty) --> def pbInitPokemon(pkmn, idxParty, battler)

But now I get this error:
[Pokémon Essentials version 21.1]
[v21.1 Hotfixes 1.0.9]

Exception: ArgumentError
Message: wrong number of arguments (given 2, expected 3)

Backtrace:
[Innate Abilities] AAM Battler.rb:83:in `pbInitPokemon'
Battler_Initialize:61:in `pbInitialize'
[[DBK] Animated Pokémon System] [006] Battler Sprites.rb:395:in `pbInitialize'
Battle_StartAndEnd:117:in `pbCreateBattler'
Battle_StartAndEnd:153:in `block (3 levels) in pbSetUpSides'
Battle:411:in `block in eachInTeam'
Battle:411:in `each'
Battle:411:in `each_with_index'
Battle:411:in `eachInTeam'
Battle_StartAndEnd:150:in `block (2 levels) in pbSetUpSides'

Now I'm just lost. Obviously there must be something wrong with my conditional branch, I guess !battler.pbOwnedByPlayer? wasn't the right call.
 
Back
Top