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

Making an item with the effect of Flash

Ookiiushidesu

Lead Mapper/Eventer at Gen0
56
Posts
12
Years
    • Age 33
    • 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!
     

    Ookiiushidesu

    Lead Mapper/Eventer at Gen0
    56
    Posts
    12
    Years
    • Age 33
    • Seen May 27, 2016

    PiaCRT

    Orange Dev
    937
    Posts
    13
    Years
  • It's not hard to figure out yourself, it functions pretty much the same, structurally. I'm assuming you're trying to add a candle or a flashlight of a sort.
     

    Ookiiushidesu

    Lead Mapper/Eventer at Gen0
    56
    Posts
    12
    Years
    • Age 33
    • Seen May 27, 2016
    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.
     

    PiaCRT

    Orange Dev
    937
    Posts
    13
    Years
  • 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.
     

    Ookiiushidesu

    Lead Mapper/Eventer at Gen0
    56
    Posts
    12
    Years
    • Age 33
    • Seen May 27, 2016
    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-
     

    PiaCRT

    Orange Dev
    937
    Posts
    13
    Years
  • I believe you should also copy the Escape Rope line in items.txt, one of those values means to be consumed if I recall correctly.
     

    Ookiiushidesu

    Lead Mapper/Eventer at Gen0
    56
    Posts
    12
    Years
    • Age 33
    • Seen May 27, 2016
    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.
     

    PiaCRT

    Orange Dev
    937
    Posts
    13
    Years
  • 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.
     

    Ookiiushidesu

    Lead Mapper/Eventer at Gen0
    56
    Posts
    12
    Years
    • Age 33
    • Seen May 27, 2016
    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:
     

    PiaCRT

    Orange Dev
    937
    Posts
    13
    Years
  • 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.
     

    Ookiiushidesu

    Lead Mapper/Eventer at Gen0
    56
    Posts
    12
    Years
    • Age 33
    • Seen May 27, 2016
    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.
     

    PiaCRT

    Orange Dev
    937
    Posts
    13
    Years
  • In an event? I would assume you'd have to make a new command for that. I think someone like Maruno would be more help here.
     

    Ookiiushidesu

    Lead Mapper/Eventer at Gen0
    56
    Posts
    12
    Years
    • Age 33
    • Seen May 27, 2016
    Okay. I can just mess around with the item and stuff for now.
     

    Nickalooose

    --------------------
    1,309
    Posts
    16
    Years
    • Seen Dec 28, 2023
    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.
     

    Luka S.J.

    Jealous Croatian
    1,270
    Posts
    15
    Years
  • 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:

    FL

    Pokémon Island Creator
    2,449
    Posts
    13
    Years
    • Seen today
    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.
     

    Rayd12smitty

    Shadow Maker
    645
    Posts
    12
    Years
    • Seen Feb 21, 2016
    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
     

    Ookiiushidesu

    Lead Mapper/Eventer at Gen0
    56
    Posts
    12
    Years
    • Age 33
    • Seen May 27, 2016
    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