Envision, Create, Share

Welcome to HBGames, a leading amateur game development forum and Discord server. All are welcome, and amongst our ranks you will find experts in their field from all aspects of video game design and development.

[Resolved] Showing more pictures

Long time no request from me, but I am stuck on RMXP limitations :grin:

Basically, for my evented system I need picture ID's higher the 50 and RMXP doesn't support this.

So what I want is:
A possibility to show and move pictures and give them an ID greater than 50.
This should be managed through script calls.
One script call is for showing the pictures. It should be able to let me define the x- and y-position of the picture, the picture itself (that is in the picture folder), as well as the ID, where an image with a higher ID shows above other pictures.
The script call for moving the pictures should be able to move a picture which is recognized through its ID, to a new x and y position in a given amount of frames (both defined by me)

As an alternative (if the above is to complicated): Basically a method where I can use a picture with the same ID more than one time on screen.

I am only using ccoa's UMS as other scripts.

Thanks for your help in advance, and feel free to ask questions

~Dalton~
 
First thing you may want to know, there are 100 pictures in total. 50 for the map, 50 for battles. I assume you don't mind some of the map pictures overlapping on the battle pictures.

There are two places you need to change 50 for the number you want (say, 75)
Spriteset_Map
Code:
<div id="{CB}" style="font-family: monospace;"><ol>    for i in 1..50

      @picture_sprites.push(Sprite_Picture.new(@viewport2,

        $game_screen.pictures[i]))

    end
Game_Screen (def update)
Code:
<div id="{CB}" style="font-family: monospace;"><ol>      for i in 1..50

        @pictures[i].update

      end
Note that you will have to change the 51..100 to say 76..100.

Now go look in Game_Picture. You will see

Code:
  # * Show Picture

  #     name       : file name

  #     origin     : starting point

  #     x          : x-coordinate

  #     y          : y-coordinate

  #     zoom_x     : x directional zoom rate

  #     zoom_y     : y directional zoom rate

  #     opacity    : opacity level

  #     blend_type : blend method

So just use $game_screen.pictures[pictureid].show(name, origin, x, y, zoom_x, zoom_y, opacity, blend_type)

Although you may have a hard time fitting them in one line, which is mandatory.

If you're making a system, I suggest creating scripted custom pictures.
 
Thank you for the fast help.

One question though: since I don't need the zoom parts nor origin nor opacity nor blend is there some way to predefine them?
That way I could fit everything in one line rather easily

edit: Nah... I tested it. There is no way someone could fit all this in one line of script call. Isn't there some way to shorten it?
 
You could default the arguments in Game_Picture.

change

def show(name, origin, x, y, zoom_x, zoom_y, opacity, blend_type)

to

def show(name, origin, x, y, zoom_x = 100, zoom_y = 100, opacity = 255, blend_type = 0)

then use

$game_screen.pictures[pictureid].show\
(name, origin, x, y)
 
Sounds perfect.
Two questions though:
1st: What are possible values for "origin"?
2nd: Forgot to ask in initial post: What command could I use to remove those script generated pictures from screen?
 
Sorry, but I get an error. I used the method brewmeister, suggested with a picture called "Speedm.png":

$game_screen.pictures[51].show\
(Speedm.png, 0, 330, 404)

And it comes up with the following error:

NameError occurred while running script.
uninitialized constant interpreter::Speedm

What did I do wrong?
 
First of all, you don't need to have .png

Second, the game thinks your calling a variable. When you refer to a specific piece of text, you always needs brackets "". So it would be

$game_screen.pictures[51].show("Speedm", 0, 330, 404)
 
Code:
$game_screen.pictures[pictureid].move(duration, origin, x, y, zoom_x, zoom_y, opacity, blend_type)

Again, you can change those default values by going in Game_Picture, and changing the def move(duration, origin, x, y, zoom_x, zoom_y, opacity, blend_type) line
 
Thanks guys! I am going to test this, tomorrow. If you don't hear from me again, it worked.

Thanks you for all the trouble. You all earned a place in my credits. (Hey I don't have anything else to give.)
 

Thank you for viewing

HBGames is a leading amateur video game development forum and Discord server open to all ability levels. Feel free to have a nosey around!

Discord

Join our growing and active Discord server to discuss all aspects of game making in a relaxed environment. Join Us

Content

  • Our Games
  • Games in Development
  • Emoji by Twemoji.
    Top