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

Repel effect's refresh.

~Angel~

Lead developer for Pokémon Millennium
281
Posts
14
Years
  • All right this is not a simple question (To me at least.) I want to do a piece of script for Repel's (All of them) When one is in usage and it runs out can it be possible to make a script where a message comes up and say's "Your repel ran out would you like to use another?" then it would show Yes/No and when yes is hit it play's a Background sound for repel and continues the effect. But when No is selected the effect's wear off and you have to either go to the bag (In normal pokemon essentials) or like the way I am going to make my game straight on the bottom screen at which the bag is displayed (Not actually in the game :c no scripter) Hopefully someone can help me make this possible. I am not a scripter period so please explain where to put it. Thank you.
    Edit: Oh and one more thing. Is there all ready a in game trade system? Like you can trade with people in the game? If not does anyone have a link to one? Other than Ho-Oh112's I don't really like his cause it involves online.
     
    Last edited:

    KitsuneKouta

    狐 康太
    442
    Posts
    14
    Years
    • Seen Nov 20, 2017
    Refreshing repel's effect should be pretty simple actually. Just from taking a quick glance, it should be easy to add in the Events.onStepTaken proc that keeps track of repel's steps. Could you be a little more specific on what you're looking for? For instance, when you select yes, should it automatically use the next repel of the same kind (i.e. if a Super Repel wore off, should it automatically pick a Super Repel next?)? What if there are no more of that same kind and you have two different kinds in your bag? Should it use the weakest repel, or the strongest? How about setting up a simple interface to pick the next type of repel to use if you have more than one kind? I suppose you could even set it up to go item by item.

    For example, you run out of your Max Repel and have no more. So, it then says "Repel's effect wore off.. Would you like to use another?" If you say yes, it asks "Will you use a Repel?", to which you choose yes or no. If you choose no, it would then ask "Will you use a Super Repel?" and so on and so forth until you have no more types of repel for it to prompt you for. This approach is a little cumbersome though.

    Let me know what approach you're wanting to take with this, and I'll take a swing at it (unless someone beats me to it).
     

    venom12

    Pokemon Crystal Rain Relased
    476
    Posts
    17
    Years
    • Age 33
    • Seen Dec 28, 2023
    I have that script so i will post it later
     

    ~Angel~

    Lead developer for Pokémon Millennium
    281
    Posts
    14
    Years
  • I have that script so i will post it later

    For which one? The repel's or Trade system? If it's repel's then thanks :D I really want to do one like that. B/W2 Gave me the Idea of it so I wanted to do it.

    Refreshing repel's effect should be pretty simple actually. Just from taking a quick glance, it should be easy to add in the Events.onStepTaken proc that keeps track of repel's steps. Could you be a little more specific on what you're looking for? For instance, when you select yes, should it automatically use the next repel of the same kind (i.e. if a Super Repel wore off, should it automatically pick a Super Repel next?)? What if there are no more of that same kind and you have two different kinds in your bag? Should it use the weakest repel, or the strongest? How about setting up a simple interface to pick the next type of repel to use if you have more than one kind? I suppose you could even set it up to go item by item.

    For example, you run out of your Max Repel and have no more. So, it then says "Repel's effect wore off.. Would you like to use another?" If you say yes, it asks "Will you use a Repel?", to which you choose yes or no. If you choose no, it would then ask "Will you use a Super Repel?" and so on and so forth until you have no more types of repel for it to prompt you for. This approach is a little cumbersome though.

    Let me know what approach you're wanting to take with this, and I'll take a swing at it (unless someone beats me to it).

    Exactly like the second one. It's exactly like what I am looking for.
     
    Last edited:

    venom12

    Pokemon Crystal Rain Relased
    476
    Posts
    17
    Years
    • Age 33
    • Seen Dec 28, 2023
    Just replace with your old code in PokemonItemEffects
    The scripts works ok for me :)

    Code:
    def pbRepel(item,steps)
      if $PokemonGlobal.repel>0
        Kernel.pbMessage(_INTL("But the effects of a Repel lingered from earlier."))
        return 0
      else
        Kernel.pbMessage(_INTL("{1} used the {2}.",$Trainer.name,PBItems.getName(item)))
       # if @repelcanuse==true
        if steps==100
        @repelused=true
        elsif steps==200
        @superrepelused=true
        elsif steps==250
        @maxrepelused=true
     # end
      end
        $PokemonGlobal.repel=steps
        return 3
      end
    end
    
    ItemHandlers::UseFromBag.add(:SUPERREPEL,proc{|item|  pbRepel(item,200)  })
    
    ItemHandlers::UseFromBag.add(:MAXREPEL,proc{|item|  pbRepel(item,250)  })
    
    ItemHandlers::UseFromBag.add(:REPEL,proc{|item|  pbRepel(item,100)  })
    
    Events.onStepTaken+=proc {
       if $PokemonGlobal.repel>0
         $PokemonGlobal.repel-=1
         if $PokemonGlobal.repel<=0
         if @repelused and $PokemonBag.pbQuantity(PBItems::REPEL)>0
           if Kernel.pbConfirmMessage(_INTL("Use next repel?"))
           pbRepel(PBItems::REPEL,100)
           $PokemonBag.pbDeleteItem(PBItems::REPEL)
            @repelcanuse=true
            return true
          else
             @repelused=false
           return false
           end
         elsif @superrepelused and $PokemonBag.pbQuantity(PBItems::SUPERREPEL)>0
          if Kernel.pbConfirmMessage(_INTL("Use next Super Repel?"))
         pbRepel(PBItems::SUPERREPEL,200)
         $PokemonBag.pbDeleteItem(PBItems::SUPERREPEL)
         @repelcanuse=true
       return true
     else
       @superrepelused=false
           return false
           end
         elsif @maxrepelused and $PokemonBag.pbQuantity(PBItems::MAXREPEL)>0
           if Kernel.pbConfirmMessage(_INTL("Use next Max Repel?"))
           pbRepel(PBItems::MAXREPEL,250)
           $PokemonBag.pbDeleteItem(PBItems::MAXREPEL)
           @repelcanuse=true
          return true
        else
           @maxrepelused=false
           return false
           end
         else
           @repelcanuse=false
           @repelused=false
           @superrepelused=false
           @maxrepelused=false
           Kernel.pbMessage(_INTL("Repel's effect wore off..."))
         end
         
         end
       end
    }
     

    ~Angel~

    Lead developer for Pokémon Millennium
    281
    Posts
    14
    Years
  • Just replace with your old code in PokemonItemEffects
    The scripts works ok for me :)

    Code:
    def pbRepel(item,steps)
      if $PokemonGlobal.repel>0
        Kernel.pbMessage(_INTL("But the effects of a Repel lingered from earlier."))
        return 0
      else
        Kernel.pbMessage(_INTL("{1} used the {2}.",$Trainer.name,PBItems.getName(item)))
       # if @repelcanuse==true
        if steps==100
        @repelused=true
        elsif steps==200
        @superrepelused=true
        elsif steps==250
        @maxrepelused=true
     # end
      end
        $PokemonGlobal.repel=steps
        return 3
      end
    end
    
    ItemHandlers::UseFromBag.add(:SUPERREPEL,proc{|item|  pbRepel(item,200)  })
    
    ItemHandlers::UseFromBag.add(:MAXREPEL,proc{|item|  pbRepel(item,250)  })
    
    ItemHandlers::UseFromBag.add(:REPEL,proc{|item|  pbRepel(item,100)  })
    
    Events.onStepTaken+=proc {
       if $PokemonGlobal.repel>0
         $PokemonGlobal.repel-=1
         if $PokemonGlobal.repel<=0
         if @repelused and $PokemonBag.pbQuantity(PBItems::REPEL)>0
           if Kernel.pbConfirmMessage(_INTL("Use next repel?"))
           pbRepel(PBItems::REPEL,100)
           $PokemonBag.pbDeleteItem(PBItems::REPEL)
            @repelcanuse=true
            return true
          else
             @repelused=false
           return false
           end
         elsif @superrepelused and $PokemonBag.pbQuantity(PBItems::SUPERREPEL)>0
          if Kernel.pbConfirmMessage(_INTL("Use next Super Repel?"))
         pbRepel(PBItems::SUPERREPEL,200)
         $PokemonBag.pbDeleteItem(PBItems::SUPERREPEL)
         @repelcanuse=true
       return true
     else
       @superrepelused=false
           return false
           end
         elsif @maxrepelused and $PokemonBag.pbQuantity(PBItems::MAXREPEL)>0
           if Kernel.pbConfirmMessage(_INTL("Use next Max Repel?"))
           pbRepel(PBItems::MAXREPEL,250)
           $PokemonBag.pbDeleteItem(PBItems::MAXREPEL)
           @repelcanuse=true
          return true
        else
           @maxrepelused=false
           return false
           end
         else
           @repelcanuse=false
           @repelused=false
           @superrepelused=false
           @maxrepelused=false
           Kernel.pbMessage(_INTL("Repel's effect wore off..."))
         end
         
         end
       end
    }

    Thanks! I needed this badly :D
     
    Back
    Top