Aryam777

Villager
Member
Joined
Mar 8, 2017
Messages
17
Reaction score
15
First Language
Polish
Primarily Uses
RMMV
I know this normally happens by default.
However in this specific situation I have to use scripts to display a message that will provide info for the choices.
So
$gameMessage.setFaceImage('Actor1',0);
$gameMessage.setBackground(1);
$gameMessage.setPositionType(2);
$gameMessage.add("My message containing data");

All this works great except if "Show Choices" event command follows this script, text disappears before choices appear.
I'm looking trough $gameMessage class and scripts but I can't seem to find how the game devs made the text stay.
I'll keep looking and testing but perhaps someone already knows the answer.
 

Trihan

Speedy Scripter
Veteran
Joined
Apr 12, 2012
Messages
3,381
Reaction score
2,494
First Language
English
Primarily Uses
RMMZ
The reason it works the way it does is that the "Show Message" part of Game_Interpreter checks to see if the next command code is a "Show Choice" and if so does all the setup as part of processing it. If you just do $gameMessage.add, you're skipping that check.
 

Aryam777

Villager
Member
Joined
Mar 8, 2017
Messages
17
Reaction score
15
First Language
Polish
Primarily Uses
RMMV
That was quick. ^^

Well I'm only using the "Script Calls" spreadsheet as a main source of "inspiration". It doesn't mention anything about "Show Message". I did find "Show Text" note in the rpg_objects.js however. I can't seem to figure out how to call command101 from inside the script... Or maybe I should try to "setWaitMode('message')" for the interpreter. I'll try that.

Thank you for a really great hint! I was stuck without this. :)
 
Last edited:

Aryam777

Villager
Member
Joined
Mar 8, 2017
Messages
17
Reaction score
15
First Language
Polish
Primarily Uses
RMMV
SOLVED AGAIN!!! xD

This however doesn't seem to pretty and neat.

After your $gameMessage.add() function you should simply add these three lines:

this._index++;
this.setupChoices(this.currentCommand().parameters);
this.setWaitMode('message');

And now questions show perfectly. :)
But I still think there's a batter way to do this... But you don't look a gift solution in the code. ;)

I said, before the edit, that setWaitMode() isn't necessary, but without it, altough the game does wait for key input it doesn't get ready to handle the choice you make. Interpreter simply moves on.

Thanks a BUNCH Trihan! :D
 
Last edited:

Aryam777

Villager
Member
Joined
Mar 8, 2017
Messages
17
Reaction score
15
First Language
Polish
Primarily Uses
RMMV
Here's what we did:Tadaa.jpg
 

Aryam777

Villager
Member
Joined
Mar 8, 2017
Messages
17
Reaction score
15
First Language
Polish
Primarily Uses
RMMV
Also if you want to add custom Choices with scripts right after your message... Remove the line this.index++, and replaces this.setupChoices with what you want. In fact I think I'll make a choice scripting tutorial because I myself couldn't find any single clear explanation about how that works... Found out through trial and error. If anyone thinks there's a need for that let me know and I'll do it.
 

Latest Threads

Latest Posts

Latest Profile Posts

Finally working actively on Tundra! I'd like to share my wife's WIP art for the starting map and a rough draft of one of the later characters, Katrina. She's very eager to hear any feedback you might have!1623790662347.png
Got my first vax today, arm is a bit numb, but nothing odd so far. :kaopride:
dYOm9IY.jpg
image_2021-06-15_212613.png
Looks a bit.....kid friendly. Then again, I suppose that does with with a lot of retro themes... Crap, already spotted a flaw xD
What a stupid week so far! I was really short on sleep yesterday thanks to my back hurting and not falling asleep fast enough, now today I am 2 hours late for work because my damn alarm clock changed from the alarm setting, to the radio setting which I always keep muted.
I introduced "booby trap" as another indirect way to fight supernatural threats in the game.
But, some of my players are using it to blow up random citizens on the street.
Not sure how "creative" they can go with it. :kaojoy:

Forum statistics

Threads
112,265
Messages
1,066,933
Members
145,882
Latest member
Vincentus
Top