Erratum: I meant I wanted to
move the image with @img.
move(duration, origin, x, y, zoom_x, zoom_y, opacity, blend_type) instead of @img.
show(duration, origin, x, y, zoom_x, zoom_y, opacity, blend_type)
Indeed, I've already increased the wait command. Unfortunately, doing so renders things even more strange:
which, upon testing, makes (in temporal order): Pic displayed => waiting => print statement => Pic moving
In fact, I want to do a custom picture menu
myself: with the current map as a background and a picture appearing by moving towards a definite position. So I've rewritten the Scene_Menu class. While testing, everything is OK except the fact that the picture
moves only when I leave the menu.

, hence i've taken the print command as a test for next commands.
Basically, my stuff is something like this:
CODE
class Scene_Menu
attr_accessor :spriteset
def main
@spriteset = Spriteset_Map.new # to display the current map as background
@picture_n1 = Game_Picture.new
show @picture_n1 (initial co-ordinates, initial size)
@picture_n1 = $game_screen.pictures
move @picture_n1 (to new co-ordinates, new size, duration)
#after movement completed=>
loop do
Graphics.update
Input.update
update
if $scene != self
break
end
end
Graphics.freeze
dispose picture_n1
end
def update
image_n1 update
update_command
end
def update_command
if Input.trigger?(Input::B)
$scene = Scene_Map.new
return
end
end
end
================== E D I T ================================
After days of pondering on the scripts of RGSS classes, I've finally found the solution.
Obviously, the key thing is movement duration. In classic event commands, one could easily precise how long the movement lasts in number of frames.
Well... in RGSS language, this duration is a variable that may be found in Game_Picture class as
@duration. What one must do is making the script check if the movement completion
before executing to the next command, in other words checking
if @image.duration = 0.
Problem: one cannot read this variable in this script, and RGSS returns an undefined method error.
So, going back to Game_Picture class,
attr_reader :duration must be indicated at the beginning.
Consequently, the script for moving a picture might looks like this:
CODE
class Make_an_Image_Move
attr_accessor :spriteset
def initialize
@img = Game_Picture.new(1)
@img = $game_screen.pictures[1]
@img.show(name, origin, x, y, zoom_x, zoom_y, opacity, blender_type)
$scene.spriteset.update
@img.move(duration, origin, x, y, zoom_x, zoom_y, opacity, blender_type)
loop do # loop for checking the value of @img.duration, as long as it's > 0, the script keeps on updating the pic
$scene.spriteset.update
@img.update
Graphics.update
if @img.duration == 0
break
end
end
$scene.spriteset.update
@img.update
#insert [i]wait command[/i] here#
print "hello world!"
end
end
Now, each command appears at the right time!
This post has been edited by Ganon77: May 24 2012, 04:53 PM