Can Anyone Help Me Edit This Plugin?

Cole_Carbert

Veteran
Veteran
Joined
Sep 2, 2018
Messages
82
Reaction score
8
First Language
English
Primarily Uses
RMMV
Hi everyone! I'm using Firgov's CRT Mode to give my game an old-school feel, but I'd like to turn it off at certain points in order to insert a few cutscenes. The problem is, Firgov didn't include an option to turn the effect off. I'm not very good at coding, so I don't really know how to add something like this in. All I need is a way to turn the effect off and on using a plugin command. Can anyone help me with this?
 

Attachments

Cole_Carbert

Veteran
Veteran
Joined
Sep 2, 2018
Messages
82
Reaction score
8
First Language
English
Primarily Uses
RMMV
Hi everyone! I'm sorry to repost, but I know my issue won't be solved unless I keep people's attention, so if you know how to code, please consider helping me out with this, as I have absolutely no idea what I'm doing. :rswt

Hi everyone! I'm using Firgov's CRT Mode to give my game an old-school feel, but I'd like to turn it off at certain points in order to insert a few cutscenes. The problem is, Firgov didn't include an option to turn the effect off. I'm not very good at coding, so I don't really know how to add something like this in. All I need is a way to turn the effect off and on using a plugin command. Can anyone help me with this?
By the way, I checked the terms of service and it doesn't say people can't edit it anywhere. I've tried messaging Firgov himself, but he doesn't respond.
 

Attachments

ShadowDragon

Veteran
Veteran
Joined
Oct 8, 2018
Messages
1,899
Reaction score
623
First Language
Dutch
Primarily Uses
RMMV
most can modify, but not repost (which is a different, while it also say it improve overtime,
I dont know when.

Also I dont know how its code, and repost isn't need.

if for 3 days are no respond on your post, you can bump it, but adding a code
or modify it can be hard, sometimes impossible on how the code is written and have
to re-code to get it to work nicely and correctly.

So avoid reposting but bump your own post after 72 hours (3 days)
 

hiddenone

Lurker Extraordinaire
Global Mod
Joined
Feb 19, 2014
Messages
2,389
Reaction score
5,104
First Language
english
Primarily Uses
RMMV

Merging with your previous thread, please do not make multiple threads for the same problem.


I've moved this thread to Plugin Support. Please be sure to post your threads in the correct forum next time. Thank you.

 

Cole_Carbert

Veteran
Veteran
Joined
Sep 2, 2018
Messages
82
Reaction score
8
First Language
English
Primarily Uses
RMMV
most can modify, but not repost (which is a different, while it also say it improve overtime,
I dont know when.

Also I dont know how its code, and repost isn't need.

if for 3 days are no respond on your post, you can bump it, but adding a code
or modify it can be hard, sometimes impossible on how the code is written and have
to re-code to get it to work nicely and correctly.

So avoid reposting but bump your own post after 72 hours (3 days)
I mean, I feel like it shouldn't be that difficult considering that all the plugin does is show a few images above the map. Also, how do you bump a post? It's always really irritated me that all of these rules/functions are never actually explained to newcomers.
 

Cole_Carbert

Veteran
Veteran
Joined
Sep 2, 2018
Messages
82
Reaction score
8
First Language
English
Primarily Uses
RMMV
[MOD]Merging with your previous thread, please do not make multiple threads for the same problem.[/MOD]
[MOVE]Plugin Support[/MOVE]
I'm sorry about reposting (nobody ever explained to me how to bump posts, and I'm still trying to figure out how I do that). I'm not particularly sorry about posting in the "wrong" forum because I can never find the "right" forum. This website makes it such a struggle to find anything.
 

Dungeonmind

Lvl 4000 Humanoid
Veteran
Joined
Sep 2, 2013
Messages
453
Reaction score
277
First Language
English
Primarily Uses
RMMV
Thank you but it was paid work done by @Kich, one of the many pixel artists for Corpse Mansion. He's a really good pixel artist.
 

caethyril

^_^
Veteran
Joined
Feb 21, 2018
Messages
1,657
Reaction score
1,110
First Language
EN
Primarily Uses
RMMV
Plugin thread (for those interested, download is plugin + necessary image files, a 3 MB zip; same version of plugin as attached here, v1.0a):
Looking at the code, the effect is entirely caused by a bunch of sprites layered on top of the usual display. So I suspect you don't need to edit the plugin at all...try this in a Script command:
Code:
var visible = false;   // <- edit this line as needed
var sp = ["1", "2", "3", "4", "4b", "5", "8", "11"];
sp = sp.map(function(s) { return "$crt_overlay" + s; });
sp.forEach(function(s) { window[s].visible = visible; });
 

Cole_Carbert

Veteran
Veteran
Joined
Sep 2, 2018
Messages
82
Reaction score
8
First Language
English
Primarily Uses
RMMV
Plugin thread (for those interested, download is plugin + necessary image files, a 3 MB zip; same version of plugin as attached here, v1.0a):
Looking at the code, the effect is entirely caused by a bunch of sprites layered on top of the usual display. So I suspect you don't need to edit the plugin at all...try this in a Script command:
Code:
var visible = false;   // <- edit this line as needed[/INDENT]
[INDENT]var sp = ["1", "2", "3", "4", "4b", "5", "8", "11"];[/INDENT]
[INDENT]sp = sp.map(function(s) { return "$crt_overlay" + s; });[/INDENT]
[INDENT]sp.forEach(function(s) { window[s].visible = visible; });
It didn't work :/ is there anything else you can think of? I'm sorry to be such a pain but you're the first person who's been able to offer a solution.
 

Ritter

Veteran
Veteran
Joined
Jan 17, 2017
Messages
60
Reaction score
27
First Language
English
Primarily Uses
RMMV
this may be a little hacky but it seems to work.. i spent a little time trying to figure out why it works without adding the children back to the scene again which i had typed up already and realized it wasn't needed for some reason lol

JavaScript:
    if ($gameSwitches.value(1)) {
        if ($crt_overlay1.parent) {
        this.removeChild($crt_overlay1);
        this.removeChild($crt_overlay3);
        this.removeChild($crt_overlay2);
        this.removeChild($crt_overlay8);
        this.removeChild($crt_overlay11);
        this.removeChild($crt_overlay4);
        this.removeChild($crt_overlay5);
        }
    }
Place this code inside the following function, I'll show you where below.

JavaScript:
var _Firgof_CRTLED_update = Scene_Map.prototype.updateChildren;
Scene_Map.prototype.updateChildren = function() {
    
    if ($gameSwitches.value(1)) {
        if ($crt_overlay1.parent) {
        this.removeChild($crt_overlay1);
        this.removeChild($crt_overlay3);
        this.removeChild($crt_overlay2);
        this.removeChild($crt_overlay8);
        this.removeChild($crt_overlay11);
        this.removeChild($crt_overlay4);
        this.removeChild($crt_overlay5);
        }
    } 
    $gameScreen.startZoom($gamePlayer.screenX(), $gamePlayer.screenY(), 2.5, 1);
    
    if (Math.random() >= 0.25 ){
        var now = Date.now();
        if (now <= nextUpdate){
          var target = $crt_overlay4.bitmap;
          var height = SceneManager._screenHeight*Math.random();
          var off = SceneManager._screenHeight*Math.random();
this would make it so if you flip that switch on the effects will turn off and if you flip it off the effects will turn back on. you can change the $gameSwitches.value(1) switch Id to any switch you want.

I still have no idea at this time why it works without adding the children again when the switch changes but whatever? lol. I'm 100% sure theres a better way to handle this but that would require digging much further than I have time to right now. It already seems wonky that this works without adding the children back into the scene. :mrsatan:
 

Cole_Carbert

Veteran
Veteran
Joined
Sep 2, 2018
Messages
82
Reaction score
8
First Language
English
Primarily Uses
RMMV
this may be a little hacky but it seems to work.. i spent a little time trying to figure out why it works without adding the children back to the scene again which i had typed up already and realized it wasn't needed for some reason lol

JavaScript:
    if ($gameSwitches.value(1)) {
        if ($crt_overlay1.parent) {
        this.removeChild($crt_overlay1);
        this.removeChild($crt_overlay3);
        this.removeChild($crt_overlay2);
        this.removeChild($crt_overlay8);
        this.removeChild($crt_overlay11);
        this.removeChild($crt_overlay4);
        this.removeChild($crt_overlay5);
        }
    }
Place this code inside the following function, I'll show you where below.

JavaScript:
var _Firgof_CRTLED_update = Scene_Map.prototype.updateChildren;
Scene_Map.prototype.updateChildren = function() {
  
    if ($gameSwitches.value(1)) {
        if ($crt_overlay1.parent) {
        this.removeChild($crt_overlay1);
        this.removeChild($crt_overlay3);
        this.removeChild($crt_overlay2);
        this.removeChild($crt_overlay8);
        this.removeChild($crt_overlay11);
        this.removeChild($crt_overlay4);
        this.removeChild($crt_overlay5);
        }
    }
    $gameScreen.startZoom($gamePlayer.screenX(), $gamePlayer.screenY(), 2.5, 1);
  
    if (Math.random() >= 0.25 ){
        var now = Date.now();
        if (now <= nextUpdate){
          var target = $crt_overlay4.bitmap;
          var height = SceneManager._screenHeight*Math.random();
          var off = SceneManager._screenHeight*Math.random();
this would make it so if you flip that switch on the effects will turn off and if you flip it off the effects will turn back on. you can change the $gameSwitches.value(1) switch Id to any switch you want.

I still have no idea at this time why it works without adding the children again when the switch changes but whatever? lol. I'm 100% sure theres a better way to handle this but that would require digging much further than I have time to right now. It already seems wonky that this works without adding the children back into the scene. :mrsatan:
I don't know why, but it's still not working :/ Could you possibly send your edited version of the file? I might just be inserting the code you made wrong. Here's a screenshot of what I did:Screen Shot 2020-05-30 at 1.01.19 AM.png
Or could you possibly help me understand what I'm doing wrong? Also, thank you for taking the time to do this! I appreciate you! :rhappy:
 

Ritter

Veteran
Veteran
Joined
Jan 17, 2017
Messages
60
Reaction score
27
First Language
English
Primarily Uses
RMMV
Ok well it worked when i use f9 to turn the switch on and off but when i tried using an event to turn the switch on and off it would turn it off but not back on.

JavaScript:
    if ($gameSwitches.value(1)) {
        if ($crt_overlay1.parent) {
        this.removeChild($crt_overlay1);
        this.removeChild($crt_overlay3);
        this.removeChild($crt_overlay2);
        this.removeChild($crt_overlay8);
        this.removeChild($crt_overlay11);
        this.removeChild($crt_overlay4);
        this.removeChild($crt_overlay5);
        }
    }
 
 
    if (!$gameSwitches.value(1)) {
        if (!$crt_overlay1.parent) {
        this.addChild($crt_overlay1);
        this.addChild($crt_overlay3);
        this.addChild($crt_overlay2);
        this.addChild($crt_overlay8);
        this.addChild($crt_overlay11);
        this.addChild($crt_overlay4);
        this.addChild($crt_overlay5);
        }
    }
seems like this was needed afterall lol.

as far as what you're doing wrong i'm not entirely sure, it looks like you placed it in the correct spot and its now flipping on and off for me when i flip the switch using an event.

are you getting any errors in the console?

did you make sure to save the changes to the code and restart your play test?
 

Kes

Veteran
Veteran
Joined
Aug 3, 2012
Messages
22,003
Reaction score
11,323
First Language
English
Primarily Uses
RMVXA
This is exactly what I'm talking about. Why is that hidden behind four pages? Something like that should be front and center.
'Front and Centre' - you mean like that big 'Help' button in the menu bar of the front page where if you click it, the first thing you see is 'Forum Rules'?
 

Cole_Carbert

Veteran
Veteran
Joined
Sep 2, 2018
Messages
82
Reaction score
8
First Language
English
Primarily Uses
RMMV
OH MY GOSH! Thank you so much! I thought I had to turn the switch off to turn the effect off, but I was very very wrong. Thank you! Do you mind if I share this on the original plugin thread (I'd obviously give all credit to you for finding a solution)? There are other people there who wanted this
 

Cole_Carbert

Veteran
Veteran
Joined
Sep 2, 2018
Messages
82
Reaction score
8
First Language
English
Primarily Uses
RMMV
Ok well it worked when i use f9 to turn the switch on and off but when i tried using an event to turn the switch on and off it would turn it off but not back on.

JavaScript:
    if ($gameSwitches.value(1)) {
        if ($crt_overlay1.parent) {
        this.removeChild($crt_overlay1);
        this.removeChild($crt_overlay3);
        this.removeChild($crt_overlay2);
        this.removeChild($crt_overlay8);
        this.removeChild($crt_overlay11);
        this.removeChild($crt_overlay4);
        this.removeChild($crt_overlay5);
        }
    }


    if (!$gameSwitches.value(1)) {
        if (!$crt_overlay1.parent) {
        this.addChild($crt_overlay1);
        this.addChild($crt_overlay3);
        this.addChild($crt_overlay2);
        this.addChild($crt_overlay8);
        this.addChild($crt_overlay11);
        this.addChild($crt_overlay4);
        this.addChild($crt_overlay5);
        }
    }
seems like this was needed afterall lol.

as far as what you're doing wrong i'm not entirely sure, it looks like you placed it in the correct spot and its now flipping on and off for me when i flip the switch using an event.

are you getting any errors in the console?

did you make sure to save the changes to the code and restart your play test?
OH MY GOSH! Thank you so much! I thought I had to turn the switch off to turn the effect off, but I was very very wrong. Thank you! Do you mind if I share this on the original plugin thread (I'd obviously give all credit to you for finding a solution)? There are other people there who wanted this
 

Ritter

Veteran
Veteran
Joined
Jan 17, 2017
Messages
60
Reaction score
27
First Language
English
Primarily Uses
RMMV
if you haven't added in that extra bit of code you may want to, it seems like it was needed afterall.

it's a little backward yeah but it got wonky when i tried it the other way around because the switch was defaulted to off lol. sure you can do that. glad its working for you now :mrsatan:
 

Cole_Carbert

Veteran
Veteran
Joined
Sep 2, 2018
Messages
82
Reaction score
8
First Language
English
Primarily Uses
RMMV
'Front and Centre' - you mean like that big 'Help' button in the menu bar of the front page where if you click it, the first thing you see is 'Forum Rules'?
Oh, I didn't see that. Thank you, that'll be very helpful in the future.
 

caethyril

^_^
Veteran
Joined
Feb 21, 2018
Messages
1,657
Reaction score
1,110
First Language
EN
Primarily Uses
RMMV
Ok well it worked when i use f9 to turn the switch on and off but when i tried using an event to turn the switch on and off it would turn it off but not back on.
I've made this mistake before! The debug screen is its own scene; the $crt_overlay sprites get added when Scene_Map is created, which happens on scene change. So when you leave the debug scene, it re-creates the map scene and all the child sprites. :kaoslp:
 

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

Latest Threads

Latest Profile Posts

The nick "Toeuia" that I'm using comes from a, idk, you okay the chess game while chit chatting them. The first two are students. Then you know, finally, the champion, and then the champion's sensei. I played like this so many times until suddenly there's another chess master. Very naive but super smart. After he lost, he kinda advised me not to give up on chest. Because the next one was never seen beaten. Touya.
I'm currently playing Ara Fell - I can see why it's had generally good reviews. The exploration aspect is pretty strong and the writing is passable.

The game auto-saves and offers an option to turn back just before each major combat, and immediately brings the player back to the last position saved when there's a TPK. Convenient at the very least.
This is Krizzirk Toeuia Aeslan, I'm picking up transmission. Draftwingeds on, duty on, exhaust ready. 310 Immulicationsers approaching. I'll take the cake and----hold it!!! My Cosvere Radar detected 3001 of them!!
11 hours of programming... Only to add two more zoom levels.
Well, that's what happens when you decide between minimap and zoom too late.

It's my cute little ghost~

Forum statistics

Threads
99,374
Messages
964,607
Members
130,988
Latest member
LittleTech
Top