Script call that will change image opacity without moving it?

Kemezryp

it's me
Veteran
Joined
Oct 25, 2015
Messages
48
Reaction score
13
First Language
Polish
Primarily Uses
RMMV
Title says everything, but if someone is interested in my problem:

upload_2018-9-2_15-19-27.png

I'm trying to make a nice title screen for my game. Selected option is highlighted by 2 images shown on this picture:
Both of them move at the same time when player presses up or down to change an option, but the white one is changing its opacity every second to make flashy effect. To make it, I used "Move Picture" command. Only this one can change opacity. This is my script:

◆If:Menu Select Position = 1
◆Move Picture:#9, Upper Left (0,139), (100%,100%), 0, Normal, 60 frames (Wait)
◆Move Picture:#9, Upper Left (0,139), (100%,100%), 255, Normal, 60 frames (Wait)

:End
◆If:Menu Select Position = 2
◆Move Picture:#9, Upper Left (0,216), (100%,100%), 0, Normal, 60 frames (Wait)
◆Move Picture:#9, Upper Left (0,216), (100%,100%), 255, Normal, 60 frames (Wait)

:End

...and yeah, It's bugging even if game checks current Select Position (it's a variable that checks currently selected option, 1 is New Game, 2 is Continue etc.). Basically, if the player presses up/down too quick, the white highlight is kind of delayed.
 

Andar

Veteran
Veteran
Joined
Mar 5, 2013
Messages
37,288
Reaction score
10,165
First Language
German
Primarily Uses
RMMV
the delay there has nothing to do with the move command, and replacing the move command with a script call will not change that effect.
most likely the effect is caused by the logic you use for handling the button presses, so I suggest you post a screenshot of the entire event and we can see how to optimize it.
 

Kemezryp

it's me
Veteran
Joined
Oct 25, 2015
Messages
48
Reaction score
13
First Language
Polish
Primarily Uses
RMMV
Separate event that makes white highlight blinking:

upload_2018-9-2_15-33-24.png

Unvisible procedure is almost the same, it just has different numbers.

upload_2018-9-2_15-35-1.png

That's why I asked for simple script call for opacity change.
 

Andar

Veteran
Veteran
Joined
Mar 5, 2013
Messages
37,288
Reaction score
10,165
First Language
German
Primarily Uses
RMMV
and this basically has proven that the script call will not change anything.
The reason why the blinking lags is because the first event takes most of the processing power if the player presses the button very often, leaving not enough processing power to handle the second parallel process at the same time.

Changing the event command to a script command will not reduce the demands of the first event, so it will lag in the same way no matter if you use event command or script command.
yes, script commands are usually a bit faster than event commands - but the difference is not that extreme, and it would change absolutely nothing in this case (especially as you would have to use another event command "script" in order to get to the script variant...

You need to give the blinking priority over the button control or integrate them together into a single event.

The better solution would be to combine both events into a single one. This will require you to use a different self-switch when you add the commands from the second event below the first one, and you'll have to be more tricky with waits compared to using different events.

If there is something in the rest of the first event that prevents you from combining them (shouldn't be, but I can't see it in its entirety), then there is another way to try to handle this:
Delete both events, then remake them with the blinking event as the first event (ID=1) and the startup event as the second one (ID=2). That should give the blinking a better priority compared to how it now works. (50/50 chance if it will work because there are other effects with timing and process priority)
 

Kemezryp

it's me
Veteran
Joined
Oct 25, 2015
Messages
48
Reaction score
13
First Language
Polish
Primarily Uses
RMMV
Naah, piority didn't do. I made another map, copied "blinking" event firstly (so it had ID:001), "startup" secondly. Result was the same.

It's not laggy. Maybe "delay" was a wrong word. By saying "delay", I meant that the image comes at its place after finishing previous "Move Image" command... I think? It's pretty fast, I can't really tell tbh.

I mean, there's no problems with positioning without the "blinking" event. If I would replace those "Move Picture" with script calls that change just opacity, not position, then imo everything should be working.

// Sorry if my message is confusing, I'm trying to make it as clear as I can. I'm not English.
 

Kemezryp

it's me
Veteran
Joined
Oct 25, 2015
Messages
48
Reaction score
13
First Language
Polish
Primarily Uses
RMMV
Well, I managed to do this by myself aaaand: Even without blinking it's buggy!
there's no problems with positioning without the "blinking" event.
Yeah, I probably didn't check this carefully.

I think I'll just make white highlight invisible while scrolling.

If someone's curious how I managed to make picture change its opacity without moving, there you go:
I made a little plugin that adds few addinational functions. It's like you had "Change Picture Position" and "Change Picture Opacity" options.
// Image Opacity Changer

Game_Picture.prototype.changePicturePosition = function(origin, x, y, duration) {
this._origin = origin;
this._targetX = x;
this._targetY = y;
this._duration = duration;
};

Game_Picture.prototype.changePictureOpacity = function(opacity, duration) {
this._targetOpacity = opacity;
this._duration = duration;
};

Game_Screen.prototype.changePosition = function(pictureId, origin, x, y, duration) {
var picture = this.picture(pictureId);
if (picture) {
picture.changePicturePosition(origin, x, y, duration);
}
};

Game_Screen.prototype.changeOpacity = function(pictureId, opacity, duration) {
var picture = this.picture(pictureId);
if (picture) {
picture.changePictureOpacity(opacity, duration);
}
};

Game_Interpreter.prototype.commandChangePicturePosition = function() {
$gameScreen.changePosition(this._params[0], this._params[2], this._params[4], this._params[5], this._params[10]);
return true;
};

Game_Interpreter.prototype.commandChangePictureOpacity = function() {
$gameScreen.changeOpacity(this._params[0], this._params[8], (this._params[10]));
return true;
};
I know there's a better way to do it but I can't JavaScript. (That's why I'm here.)
$gameScreen.changePosition(pictureId, origin x, y, duration)
$gameScreen.changeOpacity(pictureId, opacity, duration)
Thank you for trying to help me anyway, Andar, I appreciate it.
 

Viranda

Villager
Member
Joined
Sep 3, 2022
Messages
10
Reaction score
2
First Language
Spanish
Primarily Uses
RMMV
Well, I managed to do this by myself aaaand: Even without blinking it's buggy!

Yeah, I probably didn't check this carefully.

I think I'll just make white highlight invisible while scrolling.

If someone's curious how I managed to make picture change its opacity without moving, there you go:
I made a little plugin that adds few addinational functions. It's like you had "Change Picture Position" and "Change Picture Opacity" options.
// Image Opacity Changer

Game_Picture.prototype.changePicturePosition = function(origin, x, y, duration) {
this._origin = origin;
this._targetX = x;
this._targetY = y;
this._duration = duration;
};

Game_Picture.prototype.changePictureOpacity = function(opacity, duration) {
this._targetOpacity = opacity;
this._duration = duration;
};

Game_Screen.prototype.changePosition = function(pictureId, origin, x, y, duration) {
var picture = this.picture(pictureId);
if (picture) {
picture.changePicturePosition(origin, x, y, duration);
}
};

Game_Screen.prototype.changeOpacity = function(pictureId, opacity, duration) {
var picture = this.picture(pictureId);
if (picture) {
picture.changePictureOpacity(opacity, duration);
}
};

Game_Interpreter.prototype.commandChangePicturePosition = function() {
$gameScreen.changePosition(this._params[0], this._params[2], this._params[4], this._params[5], this._params[10]);
return true;
};

Game_Interpreter.prototype.commandChangePictureOpacity = function() {
$gameScreen.changeOpacity(this._params[0], this._params[8], (this._params[10]));
return true;
};
I know there's a better way to do it but I can't JavaScript. (That's why I'm here.)
$gameScreen.changePosition(pictureId, origin x, y, duration)
$gameScreen.changeOpacity(pictureId, opacity, duration)
Thank you for trying to help me anyway, Andar, I appreciate it.
Thank you. I was looking for that same script, but couldn't find it anywhere as I didn't know how to omit the lines I wanted unchanged on $gameScreen.movePicture(1, 1, 200, 150, 100, 100, 0, 0, 60);.

So I used your plugin and their scripts on RPG Maker MZ and it worked like charm.
 

Latest Threads

Latest Posts

Latest Profile Posts

Made this sign for a you-know-what type of business, completely from scratch.
Gotta admit, i'm extremely proud of it.

image.png
After 7 months of really hard work and then 6 months of lazing around and procrastinating with adding the final touches my game is finally complete! Not bad considering that a year ago I didn't really even know about variables. Thanks to everyone who helped with questions and assets! Feels good to have a game under my belt! Ep2 (also self contained) may possibly come in the future!
I just made a breakthrough in my Battlecore problem where the Abort Battle command wouldn't work after using a Custom Action Sequence skill. It seems that Abort Battle can't be the last command in the event.
Before, the event was ordered (Dialogue -> Abort Battle). But having the message appear LAST fixed it.
(Abort Battle -> Dialogue)
"Does anyone remember the new year 2022? yeah, that was like yesterday. Wait, what do you mean by '2022 is almost over'?"
kuestsdynamisxp001.jpg


Just a glimpse of how Kuests Dynamis XP would look like.

Forum statistics

Threads
126,886
Messages
1,182,069
Members
166,675
Latest member
OPOPOP
Top