• 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!
  • Our weekly protagonist poll is now up! Vote for your favorite Trading Card Game 2 protagonist in the poll by clicking here.
  • 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.

[Question] Change event graphics

  • 773
    Posts
    14
    Years
    • UK
    • Seen Dec 29, 2024
    I have several events that use mostly the same commands, so I'm trying to simplify them into a script.

    At the moment the events check the direction the player is facing, then change the event graphic. Its using a move route to set the graphic, how would I go about converting this to a script.
    I know I can use "e.character_name = " to set the graphic, but it only picks the top left, where as I wan't to go top left, wait 3 frames, top 2nd, wait 3, top 3rd, wait, top right, wait, do the same the next 3 rows

    The graphic file name is stored in a variable.

    Using essentials 19.1


    Example of event is attached
     

    Attachments

    • [PokeCommunity.com] Change event graphics
      Screenshot 2021-05-23 at 19.40.14.png
      218.5 KB · Views: 22
    Spoiler:


    Here's an example of your move route in script form:
    Code:
    def move(event,graphic)
      pbMoveRoute(event,[
        PBMoveRoute::Graphic,graphic,0,2,0,
        PBMoveRoute::Wait,3,
        PBMoveRoute::Graphic,graphic,0,2,1,
        PBMoveRoute::Wait,3,
        PBMoveRoute::Graphic,graphic,0,2,2,
        PBMoveRoute::Wait,3,
        PBMoveRoute::Graphic,graphic,0,2,3,
        PBMoveRoute::Wait,3,
        PBMoveRoute::Graphic,graphic,0,4,0,
        PBMoveRoute::Wait,3,
        PBMoveRoute::Graphic,graphic,0,4,1,
        PBMoveRoute::Wait,3,
        PBMoveRoute::Graphic,graphic,0,4,2,
        PBMoveRoute::Wait,3,
        PBMoveRoute::Graphic,graphic,0,4,3,
        PBMoveRoute::Wait,3
        ]
      )
    end
    It looks kinda weird in game, so there's probably something I missed.
    To call this script, set the move type to Custom in the event window, select "Script..." in the bottom right of the move route window and type move($game_map.events[X],graphic) in the box, X here is the event ID and graphic is the filename of the graphic to cycle through. You said you have this in a variable, so you could replace graphic with $game_variables[X] or pbGet(X), I think.
     
    Thanks, that seems to do the job.

    A question you may be able to help with, currently when calling this I'm having to pass the id of the event I want to animate, is there an easier way of doing it?

    So calling using "bush("black", 24)", and in the script using "e = $game_map.events[event]"
     
    You can do what you put in your last sentence, yes. But I think you are asking if the event argument can be determined in the script instead, so just doing move(graphic) in my example. Honestly, the game event scripts are a mystery to me, so I can't help you much there. I know there's get_character(0) which is kinda like "this event", but I'd be surprised if it's that simple.
     
    Back
    Top