Chaos Project

RPG Maker => RPG Maker Scripts => Script Requests => Topic started by: Draxicor on July 14, 2016, 05:36:42 pm

Title: Script call to change all game events' Opacity and Transparency ON/OFF
Post by: Draxicor on July 14, 2016, 05:36:42 pm
Is there a way to change all of a game's events opacity to 255 and all of their Transparencies to OFF?

I'm looking for something similar to this one, that turns off all events' Self Switches
$game_self_switches = Game_SelfSwitches.new

Thank you in advance and please forgive my ignorance  :^_^\':
Title: Re: Script call to change all game events' Opacity and Transparency ON/OFF
Post by: KK20 on July 14, 2016, 07:26:25 pm
Why would you need such a thing? I feel like this would be easier if you used one switch and made a second page to show/hide the graphic. The solution that you're requesting would require a script; it's not a simple one-liner.
Title: Re: Script call to change all game events' Opacity and Transparency ON/OFF
Post by: Draxicor on July 15, 2016, 06:16:05 am
I see, thank you!

I need this because I did a sort of new game plus kind of thing, where it takes me back to the first map of the game. I reset all switches, variables and self switches, but I fear that the events that lost opacity/got transparent along the first play through would remain invisible.
Title: Re: Script call to change all game events' Opacity and Transparency ON/OFF
Post by: KK20 on July 15, 2016, 01:58:03 pm
For starters, you're changing opacity and visibility through Move Event commands, right? You do realize that those do not carry over when you teleport back into the map. This also includes Erase Event; you can still bring that event back by just teleporting back into the map. You have to use a switch and create another page within the event to keep it permanently gone (or for any other effects/changes you make to the event).

There's no need for such a script because the game already handles this by default. Can you give me an example of how you are treating your events?
Title: Re: Script call to change all game events' Opacity and Transparency ON/OFF
Post by: Draxicor on July 15, 2016, 09:19:02 pm
Oh, that's good to know!
Since the Opacity and Transparency carries over if applied to the player, I thought the same happened with events/NPC's. I use self switches or switches and new event pages to keep them permanently "erased" throughout the game, but since they are all turned off upon restarting, they shouldn't be any problem. Since the game has a lot of rooms you don't go back to, I also used the Transparent ON command, so that's why I thought I needed help  :^_^\':

But if they don't carry over maps, that's great! Thank you again!
Title: Re: Script call to change all game events' Opacity and Transparency ON/OFF
Post by: KK20 on July 15, 2016, 09:36:40 pm
It only carries over for the player because it is not recreated every time you change maps; it simply reuses the player instance ($game_player). Events, on the other hand, have to be recreated from scratch.

Whenever you load a new map, everything has to be reinstantiated, including the events. All this data is retrieved from your Map###.rxdata files. The little changes like an event's opacity are not saved since it's just reading directly from this file (the events are created in their "purest" form--whatever you have them set up in the editor).It then looks at the game's switches and variables to determine what event page to use.

It's a good thing it's like this too. Could you imagine your game having to save the data for EVERY EVENT INSTANCE all the time? :P