• 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] Better Illusion ability

38
Posts
5
Years
    • Seen Feb 21, 2022
    I'm trying to create an upgraded version of Zoroark's Illusion ability. If the illusion has not been broken, the user will either have plus one speed, or plus one attack/sp.attack. What would the best way to implement this? I've tried different methods but none of them worked out.
     
    87
    Posts
    7
    Years
    • Seen Nov 22, 2023
    This will require scripting.
    I'd try to provide a script for you, except I don't know which stat you'd want it to raise.
    If you want one of the three, how will the game decide which of the three?
     
    38
    Posts
    5
    Years
    • Seen Feb 21, 2022
    I've decided to do speed, I also tried using other abilities for help, but it just never worked... Is this even possible?
     
    1,403
    Posts
    10
    Years
    • Seen Apr 29, 2024
    It's definitely possible. But if you're not going to post your code (and any error message—but note "syntax error" is less of an error and more of a "you should read a Ruby tutorial") then no-one's going to be able to help correct whatever misunderstandings you've made.
     
    38
    Posts
    5
    Years
    • Seen Feb 21, 2022
    Ah, sorry. I deleted the scripting to try and start from scratch, I'll try and finish it and if I get any errors I'll post them here. Thank you.

    I just don't have too much experience with scripting. So I'll probably have to watch or read a Ruby tutorial.
     
    Last edited:
    3
    Posts
    4
    Years
    • Seen Jul 11, 2019
    When someone gets the answer to this, can they message me? I can't wrap my head around scripting and would really appreciate finding out how to do this. Thank you!
     
    38
    Posts
    5
    Years
    • Seen Feb 21, 2022
    I've been trying to get this to work, but can't figure out even where to start, I tried looking at where Illusion is in the scripts and it ended up confusing me even more, sorry for bothering you guys, but it looks like I can't figure out a simple starting point...
     
    1,403
    Posts
    10
    Years
    • Seen Apr 29, 2024
    I've been trying to get this to work, but can't figure out even where to start, I tried looking at where Illusion is in the scripts and it ended up confusing me even more, sorry for bothering you guys, but it looks like I can't figure out a simple starting point...

    I think you'd be better off looking at how abilities that sometimes have an invisible effect on stats work, e.g. Defeatist or Slow Start.
     
    38
    Posts
    5
    Years
    • Seen Feb 21, 2022
    Actually that's pretty darn smart... Thank you, I'll look into this and hope that I don't have to bother you anymore.
     
    38
    Posts
    5
    Years
    • Seen Feb 21, 2022
    if self.hasWorkingAbility(:ILLUSION) &&
    self.effects[PBEffects::Illusion]
    speedmult=(speedmult*2.0).round

    This is what I have set, I based it around the defeatist ability.
    The first line checks if the user has the ability, and I believe the second line will check if the effect is active? I may have to add =true at the end or sumthn. the last line adds the effect. I'm gonna try and test it, but if anything looks odd just let me know.
     
    1,403
    Posts
    10
    Years
    • Seen Apr 29, 2024
    if self.hasWorkingAbility(:ILLUSION) &&
    self.effects[PBEffects::Illusion]
    speedmult=(speedmult*2.0).round

    This is what I have set, I based it around the defeatist ability.
    The first line checks if the user has the ability, and I believe the second line will check if the effect is active? I may have to add =true at the end or sumthn. the last line adds the effect. I'm gonna try and test it, but if anything looks odd just let me know.

    Sounds pretty good to me. For the record you probably mean ==true which is "check that it's true" rather than =true which is "set to true". Although as you might notice, self.effects[PBEffects::Illusion]==true is basically the same as self.effects[PBEffects::Illusion].
     
    Last edited:
    38
    Posts
    5
    Years
    • Seen Feb 21, 2022
    Thank you so much for the help! And to anyone viewing this thread, the best way to test it (I think) is by giving yourself a Zoroark with Illusion (Or a new ability if you make it that way) and with max speed EV's and IV's at Lv. 100. then go against a pokemon with higher base speed with maximum EV's and IV's. Then, Zoroark (Or whatever pokemon you have the ability on) should outspeed with the disguise, but when it's broken, it will no longer outspeed.

    Edit: After testing, this does work as intended. If you want to make it an entirely different ability just remember to go through the scripts with illusion (Do Ctrl+Shift+F to look thru entire script) as you will need to add it's effects on other moves, abilities, and AI to the new ability.

    Edit 2: Btw I put the script into PokeBattle_Battler. Right under the part that slows the user of Slow Start down (Tho it doesn't have to specifically go there.)
     
    Last edited:
    68
    Posts
    5
    Years
    • Seen Aug 25, 2023
    I was wondering a while ago if is possible that Zoroark copys the moveset of the pokémon?
     
    1,403
    Posts
    10
    Years
    • Seen Apr 29, 2024
    I was wondering a while ago if is possible that Zoroark copys the moveset of the pok%u00E9mon?

    So a bit like Transform, but it wears off after being hit? You could probably make that with a bit of effort, I'd start by trying to understand how Transform works.
     
    Last edited:
    68
    Posts
    5
    Years
    • Seen Aug 25, 2023
    Ok, I made it... More or less.

    I manage to make the ability to copy the moveset but: it only worked if I delete "self.effects[PBEffects::Illusion]" . So i noticed that i have to define when "self.effects[PBEffects::Illusion]" ends (or starts?) so i made it. I got this:

    Spoiler:


    BUT the game wants me to define what "damage" is and I have no idea how to do that, the only example inside of my scripts doesn´t works. ALSO I don't really know if i have to define when "self.effects[PBEffects::Illusion]" starts, ends or both.

    Any idea of what i have to do? u.u
     
    68
    Posts
    5
    Years
    • Seen Aug 25, 2023
    ALSO I don't really know if i have to define when "self.effects[PBEffects::Illusion]" starts, ends or both.

    Maybe if i only use:

    Spoiler:


    Maybe with only that i can make it work? But i´m still need to define "damage". :(
     
    68
    Posts
    5
    Years
    • Seen Aug 25, 2023
    Well... I manage this to work and i did this:

    Spoiler:


    And i found where to put the "damage" so i did this:

    Spoiler:


    So: The ability works but the moves doens't come back to zoroarks moves, he keeps the moves from the transformation after getting hit. I think the problem is here but no so sure :(. Any help´? Pls:

    Spoiler:


    I believe the problem is at the end with "self", i have to put something else, maybe? I don´t know...

    Note: I had to use: "effects[PBEffects::Transform]" because if i use "effects[PBEffects::Illusion]" the game crashes saying "wrong class". Maybe the problem is there? But i don't think so

    Ty for reading.
     
    Last edited:
    1,403
    Posts
    10
    Years
    • Seen Apr 29, 2024
    I believe the problem is at the end with "self", i have to put something else, maybe? I don´t know...

    I think the problem is that you changed self.moves so your loop is just setting the moves to what they're already set to. What you need to use is the original moves that the Pokémon knew. Maybe take a look at how the moves get populated when the battler is initialized? IILR there's a self.pokemon object or something like that.
     
    68
    Posts
    5
    Years
    • Seen Aug 25, 2023
    I think the problem is that you changed self.moves so your loop is just setting the moves to what they're already set to. What you need to use is the original moves that the Pokémon knew. Maybe take a look at how the moves get populated when the battler is initialized? IILR there's a self.pokemon object or something like that.


    Yeah I thought would be that. But still can't manage to make it work. Keep trying
     
    Back
    Top