Zuque

Regular
Regular
Joined
Dec 27, 2018
Messages
42
Reaction score
5
First Language
Bulgarian
Primarily Uses
RMMV
Hello all,
I have a calendar system using this Plug-in: Common Event Menu - Yanfly
and it works, but its taking a lot of Common Events I have 4 seasons and in each 30 days so that's 121 common events spend on one system:
Common Event number 1 (Calendar Caller) that calls depending on the currently active "season switch"
Summer : from common event number 2 till 31
Fall : from common event number 32 till 61
Winter : from common event number 62 till 91
Spring : from common event number 92 till 121
1.PNG

and inside each of the common event "Season" Day "Number"
the only information changing inside all these common events are:
Menu Name - the Color depending on season(Summer,Fall,Winter,Spring) + Day number.​
Help Description - deepening on current season (Summer,Fall,Winter,Spring).
Picture - inside the correct folder all pictures according named.
2.PNG

How I would like to it to look
3.PNG
But the thing is
Even when Variable Day number is equal to 1
the calendar will show me the last condition on the list ( and that's 30 )
that plug in is using something called Comment Tags and I'm wondering if someone can help me
set a condition that will be read by the Comment Tags if possible.


thank you for your time reading this!
 

TESTOSTERONE

Nosey aren't ya?
Regular
Joined
Feb 11, 2017
Messages
675
Reaction score
3,800
First Language
English
Primarily Uses
RMMV
I see it can do \C[10] for color 10. Can it do \V[10] for variable ID = 10?

If yes, then let's say Day Number is variable ID = 10, you can drop all the IF statements and just do:
Code:
Comment: <Menu Name: \C[10]Day: \V[10]\C>

You can also store Picture name into a separate variable using "Script" option
1696461459256.png

And do:
Code:
Comment: <Picture: \V[240]>
 

Zuque

Regular
Regular
Joined
Dec 27, 2018
Messages
42
Reaction score
5
First Language
Bulgarian
Primarily Uses
RMMV
I see it can do \C[10] for color 10. Can it do \V[10] for variable ID = 10?

If yes, then let's say Day Number is variable ID = 10, you can drop all the IF statements and just do:
Code:
Comment: <Menu Name: \C[10]Day: \V[10]\C>

You can also store Picture name into a separate variable using "Script" option
View attachment 279024

And do:
Code:
Comment: <Picture: \V[240]>
Thanks a bunch, I was able to get it to work half way
Only the Menu thing is working
for the picture when i test the game it says:
'Failed to load: img/pictures/\v[13].png'
and I ran the \v[13] inside a "Show Text" just to be sure ill get the right name , and I do
but i guess for the picture I can't use that trick, ill just have to find a way around it.
 

ATT_Turan

Forewarner of the Black Wind
Regular
Joined
Jul 2, 2014
Messages
12,465
Reaction score
10,841
First Language
English
Primarily Uses
RMMV
No, the comment tag isn't going to use the engine's text parser to decode escape codes.

You'd have to use Yanfly's Script Call Plugin Commands to turn the whole thing into JavaScript, or just find the function being called by the Picture: comment and put it in a script call.
 

Zuque

Regular
Regular
Joined
Dec 27, 2018
Messages
42
Reaction score
5
First Language
Bulgarian
Primarily Uses
RMMV
No, the comment tag isn't going to use the engine's text parser to decode escape codes.

You'd have to use Yanfly's Script Call Plugin Commands to turn the whole thing into JavaScript, or just find the function being called by the Picture: comment and put it in a script call.
Hi thanks,
I went with option number two but got stuck as well.
4.PNG
I found the function that calls the picture i also made a global variable(VarNumber) outside the scope of that function so that i can access it from other places
and here is where I got stuck,
I don't how to access this Variable inside my game engine using the script command
if someone can provide the syntax id be grateful.
 

TESTOSTERONE

Nosey aren't ya?
Regular
Joined
Feb 11, 2017
Messages
675
Reaction score
3,800
First Language
English
Primarily Uses
RMMV
I think you are already storing the picture name in variable 13.

As long as this function runs whenever the common event is called, you can do:
Code:
obj.picture = $gameVariables.value(13);
 

ATT_Turan

Forewarner of the Black Wind
Regular
Joined
Jul 2, 2014
Messages
12,465
Reaction score
10,841
First Language
English
Primarily Uses
RMMV
i also made a global variable(VarNumber) outside the scope of that function so that i can access it from other places
This is generally bad practice unless absolutely necessary. It's better to store it on the object (e.g. the event), or in one of your existing global variables as @TESTOSTERONE suggested.
 

Zuque

Regular
Regular
Joined
Dec 27, 2018
Messages
42
Reaction score
5
First Language
Bulgarian
Primarily Uses
RMMV
I think you are already storing the picture name in variable 13.

As long as this function runs whenever the common event is called, you can do:
Code:
obj.picture = $gameVariables.value(13);
I think because scripts are loaded before the variables in the game engine it does not work to assign it to that variable because all i get now is this msg
5.PNG
i also tried to do this but also i get the same thing

if ($gameVariables.value(3) === null) { $gameVariables.setValue(3, 1); }
 

TESTOSTERONE

Nosey aren't ya?
Regular
Joined
Feb 11, 2017
Messages
675
Reaction score
3,800
First Language
English
Primarily Uses
RMMV
Hmm, maybe try this:

Code:
obj.picture = $gameVariables ? $gameVariables.value(13) : '';
 

ATT_Turan

Forewarner of the Black Wind
Regular
Joined
Jul 2, 2014
Messages
12,465
Reaction score
10,841
First Language
English
Primarily Uses
RMMV
That won't work because you're using the wrong comparison operator - you're saying try to do this if it is null.

Also, it's still the same mistake as above because you're looking at the value() when $gameVariables itself doesn't exist.
 

Zuque

Regular
Regular
Joined
Dec 27, 2018
Messages
42
Reaction score
5
First Language
Bulgarian
Primarily Uses
RMMV
Hmm, maybe try this:

Code:
obj.picture = $gameVariables ? $gameVariables.value(13) : '';
Ok so this got the game running again
but now it does not load the
$gameVariables.value(13)
Its going for the
option
I've6.PNG checked to see that Variable 13 is been loaded + given value
and its been loaded at the very moment the player becomes playable


@ATT_Turan i am trying to wrap my head around what you said
I got the msg error because that variable was null ,
so shouldn't I check that if its null to give it a value therefore making it not null?
 

TESTOSTERONE

Nosey aren't ya?
Regular
Joined
Feb 11, 2017
Messages
675
Reaction score
3,800
First Language
English
Primarily Uses
RMMV
Ok, so:
  1. Looks like that ProcessCEMnotetags function runs only once and before any map events run. So our approach won’t work.
  2. I would look into seeing where this value gets stored in game data and use a script event command to update it. Or find another function that might run whenever a common event is called with a comment note tag.
  3. Your null error was because the entire $gameVariables object was null. Because the whole object is null, you can’t use any of its expected properties or functions.
 

ATT_Turan

Forewarner of the Black Wind
Regular
Joined
Jul 2, 2014
Messages
12,465
Reaction score
10,841
First Language
English
Primarily Uses
RMMV
@ATT_Turan i am trying to wrap my head around what you said
I got the msg error because that variable was null ,
No, you got an error that $gameVariables itself, the array, is null. It hadn't yet been created by RPG Maker's boot up process. Therefore, when you try to say $gameVariables.value() it will crash because you can't call the value() function of something that doesn't exist.

so shouldn't I check that if its null to give it a value therefore making it not null?
No, you would check that it's not null.

If you say
Code:
if ($gameVariables.value(3) == null)
that's saying "If this is true," if this is null, then do the thing I want. You want the opposite, "only try to do the thing I want if this properly exists, it is not null"

But that conditional will crash the game in the first place because, again, you're referencing value() when $gameVariables hasn't been defined yet.

I know you're getting assistance in this thread, but it would make sense for you to do some more tutorials or classes in JavaScript before trying to write/modify your own code - if you're half-guessing, that almost guarantees it just won't work. It makes more sense for you to spend that time learning what everything means and how it works.

As far as this whole thing...the problem with what you're trying to do is these event comments aren't instructions that are being read and executed during gameplay. They're settings that are loaded when you boot the game. What you're going for fundamentally won't work because it's happening at the wrong time.

That's like you being conceived and you're a human embryo - then, after you're born, someone says "No, go back and make him a goat."

Instead, you want to see where this picture is actually being stored and change that (like I recommended in post #4). The function for that is Window_CommonEventMenuPicture.setPicture().

So, I haven't tested this, but a script call of
Code:
SceneManager._scene._commonEventMenuPictureWindow.setPicture("filename")
looks like it should change the picture.
 

Latest Profile Posts

I realized recently since my game is still a turn based game, that something like the card game Yomi is a lot closer to what I should try to aim for combat wise. Should also help for those who don't really play fighting games to make things a bit easier to understand. ugh the struggles of trying to show love for my 2 favorite genres in 1 go lol.
Did a bit of work on the chemistry tiles I want.

Hey There!


QPcure.png

My next plugin will be: "Dynamic Temperature Stats"

Now you might be wondering... What does it do?

Well, it's a fascinating plugin that adds a body temperature mechanic to characters.

(MORE INFO ⬇️)
Holy crap, it's cold. Our heat went out this morning and the repair guy won't get the part needed to fix it at least until tomorrow. Had to be now of all times, when we have stuff to do all week and it's the coldest night of November so far.
I have invented a new food: soupie!
It is soup-pie! It's what happens when you try to make a pie, and it turns out super gooey and falls apart and you need a spoon to eat it! Soupie! Said like sue-pie. Not soupy - oh just let me eat my sad apple pie :kaothx:

Forum statistics

Threads
136,561
Messages
1,267,577
Members
180,244
Latest member
buttermequeasy334
Top