Needs a file for event

Joined
Oct 6, 2019
Messages
34
Reaction score
3
First Language
Spanish
Primarily Uses
RMMV
Hi, I'm searching for a JS that do the event will not work if a file (test.asd for example) didn't exist.

Any idea? (Sorry for bad english)
 

ct_bolt

Creator
Veteran
Joined
May 3, 2012
Messages
954
Reaction score
520
First Language
Javascript
Primarily Uses
RMMZ
odd...

This may sound silly to ask but...
did you add the plugin to you project?
1589482124923.png
1589481885353.png
 

ct_bolt

Creator
Veteran
Joined
May 3, 2012
Messages
954
Reaction score
520
First Language
Javascript
Primarily Uses
RMMZ
It say me the same that in console, I don't understand about JS :/
View attachment 143681
what the heck??? that's really strange... and no other error messages?
can I see a full console screenshot?

Mine looks clear and all works as it should so I'm not really sure what else is going on.
1589483677165.png
 
Last edited:

ct_bolt

Creator
Veteran
Joined
May 3, 2012
Messages
954
Reaction score
520
First Language
Javascript
Primarily Uses
RMMZ
Ahhh gotcha not able to use ES6 for some reason.

Didn't know that could cause issues. Sorry 'bout that.

I've rolled back to ES5 now.

Please download and check again.
 
Joined
Oct 6, 2019
Messages
34
Reaction score
3
First Language
Spanish
Primarily Uses
RMMV
Ahhh gotcha not able to use ES6 for some reason.

Didn't know that could cause issues. Sorry 'bout that.

I've rolled back to ES5 now.

Please download and check again.
Sorry, new in this. What is and how can I donwload it?
 

ct_bolt

Creator
Veteran
Joined
May 3, 2012
Messages
954
Reaction score
520
First Language
Javascript
Primarily Uses
RMMZ
naw nothing needed except just download my plugin and try it again. I made the changes. Should work now :)

Still I could show you the different though I suppose:
ES5:
Code:
var CTB = CTB || {}; CTB.File  = CTB.File || {};
var Imported = Imported || {}; Imported["CT_Bolt File"] = 1.00;
"use strict";
(function ($_$) {
    $_$.Check = function(file) {if (file){var fs = require('fs');try {var stats = fs.statSync(file);return stats.isFile();}catch (e){return false;};}}
})(CTB.File, this);
uses: $_$.Check = function(file)

ES6:
Code:
var CTB = CTB || {}; CTB.File  = CTB.File || {};
var Imported = Imported || {}; Imported["CT_Bolt File"] = 1.00;
"use strict";
(function ($_$) {
    $_$.Check =(file)=> {if (file){var fs = require('fs');try {var stats = fs.statSync(file);return stats.isFile();}catch (e){return false;};}};
})(CTB.File, this);
uses: $_$.Check =(file)=>

Edit:
LMAO dang it... I uploaded the wrong file... 1 sec sorry...
 
Last edited:

ct_bolt

Creator
Veteran
Joined
May 3, 2012
Messages
954
Reaction score
520
First Language
Javascript
Primarily Uses
RMMZ
Not sure if editing above and pinging your user name notifies you... so I am posting again to be sure.

...anyways I have uploaded a new version that should work now :)

@SuzuMito7u7
Sooo ok how 'bout now?
 
Joined
Oct 6, 2019
Messages
34
Reaction score
3
First Language
Spanish
Primarily Uses
RMMV
naw nothing needed except just download my plugin and try it again. I made the changes. Should work now :)

Still I could show you the different though I suppose:
ES5:
Code:
var CTB = CTB || {}; CTB.File  = CTB.File || {};
var Imported = Imported || {}; Imported["CT_Bolt File"] = 1.00;
"use strict";
(function ($_$) {
    $_$.Check = function(file) {if (file){var fs = require('fs');try {var stats = fs.statSync(file);return stats.isFile();}catch (e){return false;};}}
})(CTB.File, this);
uses: $_$.Check = function(file)

ES6:
Code:
var CTB = CTB || {}; CTB.File  = CTB.File || {};
var Imported = Imported || {}; Imported["CT_Bolt File"] = 1.00;
"use strict";
(function ($_$) {
    $_$.Check =(file)=> {if (file){var fs = require('fs');try {var stats = fs.statSync(file);return stats.isFile();}catch (e){return false;};}};
})(CTB.File, this);
uses: $_$.Check =(file)=>

Edit:
LMAO dang it... I uploaded the wrong file... 1 sec sorry...
Well, now there isn't errors in console! But it doesn't work well, Did I something wrong?
1589485568266.png
 

ct_bolt

Creator
Veteran
Joined
May 3, 2012
Messages
954
Reaction score
520
First Language
Javascript
Primarily Uses
RMMZ
is it returning that it doesn't exist?
capitalization has to be the exact same even the filename extension too

Does the newest demo that is uploaded work for you and finds BlueSky.png?
 
Joined
Oct 6, 2019
Messages
34
Reaction score
3
First Language
Spanish
Primarily Uses
RMMV
is it returning that it doesn't exist?
capitalization has to be the exact same even the filename extension too

Does the newest demo that is uploaded work for you and finds BlueSky.png?
And is it, in the demo is the same, the two events says file not found
 

ct_bolt

Creator
Veteran
Joined
May 3, 2012
Messages
954
Reaction score
520
First Language
Javascript
Primarily Uses
RMMZ
in the demo it is the same, the two events says file not found
this is honestly very strange... works perfect for me on my end...
Hmm... I think it is due to the delay on how the file gets loaded to be read...
Taking a whole new approach now lol

Please give it a try, hope it works now :)

@SuzuMito7u7
Updated to v0.80... how 'bout now?
Use like this:1589500582859.png
 
Last edited:
Joined
Oct 6, 2019
Messages
34
Reaction score
3
First Language
Spanish
Primarily Uses
RMMV
this is honestly very strange... works perfect for me on my end...
Hmm... I think it is due to the delay on how the file gets loaded to be read...
Taking a whole new approach now lol

Please give it a try, hope it works now :)

@SuzuMito7u7
Updated to v0.80... how 'bout now?
Use like this:View attachment 143712
Console again... Maybe relacionate with YEP_X_BattleSysCTB.js?

1589541736125.png
 

ct_bolt

Creator
Veteran
Joined
May 3, 2012
Messages
954
Reaction score
520
First Language
Javascript
Primarily Uses
RMMZ
Are you using v0.80?

Should only be now using CTB.File.Check()
 
Joined
Oct 6, 2019
Messages
34
Reaction score
3
First Language
Spanish
Primarily Uses
RMMV
Are you using v0.80?

Should only be now using CTB.File.Check()
Yeah, I used this two codes. The largest send my a error in console and the shortest says that the file doesn't exist
1589548005076.png
1589548045006.png
 

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

Latest Threads

Latest Posts

Latest Profile Posts

Our latest feature is an interview with... me?!

People4_2 (Capelet off and on) added!

Just beat the last of us 2 last night and starting jedi: fallen order right now, both use unreal engine & when I say i knew 80% of jedi's buttons right away because they were the same buttons as TLOU2 its ridiculous, even the same narrow hallway crawl and barely-made-it jump they do. Unreal Engine is just big budget RPG Maker the way they make games nearly identical at its core lol.
Can someone recommend some fun story-heavy RPGs to me? Coming up with good gameplay is a nightmare! I was thinking of making some gameplay platforming-based, but that doesn't work well in RPG form*. I also was thinking of removing battles, but that would be too much like OneShot. I don't even know how to make good puzzles!
one bad plugin combo later and one of my followers is moonwalking off the screen on his own... I didn't even more yet on the new map lol.

Forum statistics

Threads
106,035
Messages
1,018,455
Members
137,821
Latest member
Capterson
Top