• 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!
  • 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] I made a new breeding item its code allows the game to work but when I use the item it crashes the game anyone know why?

  • 67
    Posts
    4
    Years
    • He/Him
    • Seen Nov 16, 2023
    I keep forgetting to put this in the title but this is for essentials 17.2


    ivinherit=PBStats::HP,PBStats::SPEED if isConst?(parent.item,PBItems,:STAMINAAUGMENT)
    ivinherit=PBStats::ATTACK,PBStats::SPATK if isConst?(parent.item,PBItems,:MIGHTYAUGMENT)
    ivinherit=PBStats::DEFENSE,PBStats::SPDEF if isConst?(parent.item,PBItems,:IMMUNITYAUGMENT)
    ivinherit=PBStats::ATTACK,PBStats::DEFENSE,PBStats::SPATK,PBStats::SPDEF if isConst?(parent.item,PBItems,:POWERAUGMENT)

    So I put these right below the power items and their function is to pass 2 specific ivs down however when I use this in combination with another augment for example two pokemon with 2 max ivs one in spatk and atk the other in defense and special defense and I make them hold the corresponding items in breeding I get this error message


    ---------------------------
    Error
    ---------------------------
    Script 'Interpreter' line 276: RuntimeError occurred.

    Script error within event 10 (coords 19,10), map 21 (PUA Airship):

    Exception: TypeError

    Message: PField_DayCare:338:in `[]'cannot convert Array into Integer

    ***Full script:

    pbDayCareGenerateEgg


    Interpreter:243:in `pbExecuteScript'

    PField_DayCare:338:in `pbDayCareGenerateEgg'

    PField_DayCare:335:in `each'

    PField_DayCare:335:in `pbDayCareGenerateEgg'

    (eval):1:in `pbExecuteScript'

    Interpreter:1606:in `eval'

    Interpreter:243:in `pbExecuteScript'

    Interpreter:1606:in `command_355'

    Interpreter:494:in `execute_command'

    Interpreter:193:in `update'


    ---------------------------
    OK
    ---------------------------


    This is my line 338 btw

    ivs[ivinherit[r]]=parent.iv[ivinherit[r]]
     
    Last edited:
    I've actually fixed the error message now but my problem is that in doing so I don't know how to make the item I created pass down 2 different ivs from two different pokemon to the offspring because the way I did it was

    ivinherit=PBStats::ATTACK && PBStats::SPATK if isConst?(parent.item,PBItems,:MIGHTYAUGMENT)
    ivinherit=PBStats::DEFENSE && PBStats::SPDEF if isConst?(parent.item,PBItems,:IMMUNITYAUGMENT)


    I tried this aswell

    if isConst?(parent.item,PBItems,:MIGHTYAUGMENT)
    ivinherit=PBStats::ATTACK && PBStats::SPATK
    end
    if isConst?(parent.item,PBItems,:IMMUNITYAUGMENT)
    ivinherit=PBStats::DEFENSE && PBStats::SPDEF
    end


    I even tried this

    ivinherit=PBStats::ATTACK if isConst?(parent.item,PBItems,:MIGHTYAUGMENT) && PBStats::SPATK if isConst?(parent.item,PBItems,:MIGHTYAUGMENT)
    ivinherit=PBStats::DEFENSE if isConst?(parent.item,PBItems,:IMMUNITYAUGMENT) && PBStats::SPDEF if isConst?(parent.item,PBItems,:IMMUNITYAUGMENT)


    But when I tested the item being held on both pokemon the pokemon that was generated only had 3 max ivs in attack defense and special defense for both ways I coded that I listed those cause it might be significant Idk but is this an essentials bug or is there something I am missing cause the power items pass on ivs just fine
     
    Last edited:
    Back
    Top