• 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.
  • Our friends from the Johto Times are hosting a favorite Pokémon poll - and we'd love for you to participate! Click here for information on how to vote for your favorites!
  • Cyndy, May, Hero (Conquest), or Wes - which Pokémon protagonist is your favorite? Let us know by voting in our poll!
  • 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.

Making an item with the effect of Flash

Ookiiushidesu

Lead Mapper/Eventer at Gen0
  • 53
    Posts
    13
    Years
    • Age 34
    • Seen May 27, 2016
    Title is pretty self-explanatory. Do you know where the Flash effect stuff is and how I could make an item, kind of like a torch, that has the effect of Flash?

    A one-use item, though.

    Thanks!
     
    The example given was for a surfboard. That still seems like it was an unlimited-use item. I need it to be a single-use item.

    But yeah, like a torch thingy. Something to give the player early on before Flash to get through one way, but then if they go back through I don't want that advantage there.

    It is just written kinda vaguely and I'm not sure where he has the different code being edited and stuff.
     
    The example given was for a surfboard. That still seems like it was an unlimited-use item. I need it to be a single-use item.

    But yeah, like a torch thingy. Something to give the player early on before Flash to get through one way, but then if they go back through I don't want that advantage there.

    It is just written kinda vaguely and I'm not sure where he has the different code being edited and stuff.

    Ah, it needs to be consumed then. You can reference the Escape Rope code for that.
     
    Alrighties. I'm still not entirely sure where to put the code and everything, though.

    And then again there's the terrible issue updating from V11 essentials to 12.... -bleeeeeeep-
     
    Yeah I understand that part, but I don't get where the tutorial is saying to put the different code and where to get the other stuff. I wish it was more concise.
     
    PokemonItemEffects is where it should go if you are adding a new item (usable from the bag). You should see other items such as the escape rope. There should be two instances. Under each instance is where you should put your code. Reference the surrounding code for format.
     
    Ok. That makes sense. I figure that part would be like adding a new time frame under PokemonTime. But like where do I get the code for Flash to put under the Item effect?

    Would it look like this example? (The example FL uses with the surfboard using Surf)

    Spoiler:
     
    Thing is, Surf and Flash are two different functions. They probably behave differently. Surf functions against tiles with a terrain tag of 5 while flash functions when a map has a cave setting on.

    HiddenMoveHandlers::UseMove.add(:FLASH,proc{|move,pokemon|
    darkness=$PokemonTemp.darknessSprite
    return false if !darkness || darkness.disposed?
    if !pbHiddenMoveAnimation(pokemon)
    Kernel.pbMessage(_INTL("{1} used {2}!",pokemon.name,PBMoves.getName(move)))
    end
    $PokemonGlobal.flashUsed=true
    while darkness.radius<176
    Graphics.update
    Input.update
    pbUpdateSceneMap
    darkness.radius+=4
    end
    return true
    })

    I imagine that is going to help with what you'll need. Sorry I'm not much concrete help, I've yet to attempt adding Flash as an item myself.
     
    Yeah that should help somewhat at least ^_^ Thanks. I actually think a cooler way would be to have a guy make his Pokemon use flash for you. So you talk to him and it happens. I tried clicking the script command in the event and put in a line or two in it but the game crashed when I tried activating it.

    Would you know a way to put the darkness radius increase in an event? I tried just pasting the darknessradius+=4 thing, but it didn't work either.
     
    So are you no longer using an item?
    Because Pokémon who can learn flash... Already works how you changed your mind to!
    I've been watching this post, but Evil Arms has been doing a fine job helping you... But now I'm confused.
     
    Code:
    ItemHandlers::UseFromBag.add(:TORCH,proc{|item|
       darkness=$PokemonTemp.darknessSprite
       next 0 if !darkness || darkness.disposed?
       Kernel.pbMessage(_INTL("{1} used the {2}.",$Trainer.name,PBItems.getName(item))
       $PokemonGlobal.flashUsed=true
       next 4
       while darkness.radius<176
         Graphics.update
         Input.update
         pbUpdateSceneMap
         darkness.radius+=4
       end
    })

    Does this solve your dilema? Just put it in PokemonItemEffects.
     
    Last edited:
    Thing is, Surf and Flash are two different functions. They probably behave differently. Surf functions against tiles with a terrain tag of 5 while flash functions when a map has a cave setting on.



    I imagine that is going to help with what you'll need. Sorry I'm not much concrete help, I've yet to attempt adding Flash as an item myself.
    I didn't tested with all HMs, but I believe that my tutorial works with all HMs effects since every one has a 'CanUseMove' and an 'UseMove' proc.

    If there's something that someone doesn't understand in one of my tutorials/scripts, just ask.
     
    I feel like you have your answer with what Luka said but if you still need it, and want an event, just call this script.

    Code:
    darkness=$PokemonTemp.darknessSprite
    return false if !darkness || darkness.disposed?
    $PokemonGlobal.flashUsed=true
    while darkness.radius<176
      Graphics.update
      Input.update
      pbUpdateSceneMap
      darkness.radius+=4
    end
     
    Thank you guys SO MUCH!!!!! You've helped tremendously and also helped make Viridian Forest that much more awesome now. Thank you!!!!

    Anyone can lock this, now.
     
    Back
    Top