Script call that will change image opacity without moving it?

Kemezryp

it's me
Veteran
Joined
Oct 25, 2015
Messages
47
Reaction score
9
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
32,511
Reaction score
8,146
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
47
Reaction score
9
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
32,511
Reaction score
8,146
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
47
Reaction score
9
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
47
Reaction score
9
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.
 

Latest Threads

Latest Posts

Latest Profile Posts

Time to add the support for import/export default RMXP maps. Maybe there will be customized tileset support later. In theory, I can reimplement the entire RMXP inside this RMXP-made game to make more RMXP games. :kaojoy:RMXPFORMATSUPPORT.jpg
Gonna make a story driven game someday in RPG Maker about this diseased character in my head. Will keep you posted, although I was warned by the authorities that posting too much would be considered 'spamming' so I WON'T SPAM. It'll be before I go in anyways. It's gonna be messed up but it won't be explicitly pornographic so don't worry, I'll give all the content warnings. :barf::barf::barf:
If you're a RM plugin developer, and you're reading this...

Thank you. You're awesome. Even if I haven't used your plugin, your work is appreciated.
Ami
tomorrow is the finale of my Endurance

Forum statistics

Threads
111,265
Messages
1,059,698
Members
144,552
Latest member
adcurro32
Top