• 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!
  • Which Pokémon Masters protagonist do you like most? Let us know by casting a vote in our Masters favorite protagonist poll here!
  • Red, Hilda, Paxton, or Kellyn - 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.

Scripting stationary images?

KitsuneKouta

狐 康太
  • 442
    Posts
    15
    Years
    • Seen Nov 20, 2017
    Displaying an image with a script is incredibly easy. Defining the coordinates is easy too. However, I have yet to come across a way to make these images stationary (as in, the player moves while the graphic "stays behind"). I'm fairly certain it's possible since tiles do it.
     
    Do you mean setting something as a paranorma graphic?
     
    Do you mean setting something as a paranorma graphic?
    No, not as a panorama. You know how events display sprites, which are stationary at the origin point of that event? Or how tiles (such as buildings) on a map remain in a particular position on the map? The idea is to display a picture through a script (not an event) that remains are a particular map point rather than a screen point. Defining x and y values determine the SCREEN position, but it is the MAP position I'm interested in.
     
    This is pretty simple actually, unless I'm mistaken you can try this script I concocted:

    Code:
    class Scene_Map
    alias main_scene_map_collosalpokemon main
     def main
      main_scene_map_collosalpokemon
      PUT YOUR IMAGE HERE
       if Input.trigger?(Input::LT)
         YOUR IMAGE.x+=32 # A tile's width
       end
     end
    end

    That theoretically should work, but remember to actually put the code for your own image in or else it'll do nothing guaranteed. This also only codes for if you press left (Which also happens to move the player left) so you'll have to add right, up, and down to complete it. I dunno if it's LT or LEFT for Pokemon essentials though, because I'm using a different Input Module, but it should be either LT or LEFT for you.
     
    This is pretty simple actually, unless I'm mistaken you can try this script I concocted:

    Code:
    class Scene_Map
    alias main_scene_map_collosalpokemon main
     def main
      main_scene_map_collosalpokemon
      PUT YOUR IMAGE HERE
       if Input.trigger?(Input::LT)
         YOUR IMAGE.x+=32 # A tile's width
       end
     end
    end
    That theoretically should work, but remember to actually put the code for your own image in or else it'll do nothing guaranteed. This also only codes for if you press left (Which also happens to move the player left) so you'll have to add right, up, and down to complete it. I dunno if it's LT or LEFT for Pokemon essentials though, because I'm using a different Input Module, but it should be either LT or LEFT for you.
    I don't think that's quite what I had in mind. I tried it out, and rather than the image staying behind at a particular map point, it would move one tile in the direction of the button you push, and shortly after revert to it's original location. And at that, it was only if I was on the event that calls it and pressed select anyways. I switched it to a parallel process (the event that calls that script) and it doesn't require select to be pressed, but it still does as was mentioned above. If I understood how sprites worked a bit better, I could probably figure it out, but I don't know how sprites are "anchored" to the event they are displayed in. I'm thinking it should be more along the lines of defining the x and y coordinates as map coordinates, rather than screen coordinates.
     
    Apologies if I'm being silly here, but couldn't you set up a map with the tiles being your graphic? Or would that not work?
     
    Apologies if I'm being silly here, but couldn't you set up a map with the tiles being your graphic? Or would that not work?
    The problem is that the graphics aren't supposed to be permanent. They are meant to be displayed and erased at will, or even moved around to different positions.
     
    Maybe just use an event instead?
     
    Maybe just use an event instead?
    The problem with that is that I would need a large number of events (since there will be several graphics). Also, the graphics need to be easily movable as well, which could be done with pbPushThisBoulder, but I want it to move with the player (instead of pushing it), and then be able to place it in a particular spot and leave it. Also, some of these graphics should be able to move onto an impassible area, while others won't, and I don't think that pbPushThisBoulder would support that.
     
    Back
    Top