How to code Show Choices in script

infidelgkcn

Villager
Member
Joined
Sep 3, 2014
Messages
9
Reaction score
0
First Language
Turkish
Primarily Uses
Can someone explain me how Show Choices can be used in scripts? I don't want to have more than four choices I just want-actually need- to have a choice screen and want to use show choices script. 

params = []choices = []choices.push("choice 1")choices.push("choice 2")params.push(choices)params.push(0/1/2 this part is where you press cancel and which choice to default)setup_choices(params)
I want to be able to use this one but I don't exactly understand it :D
 

Shaz

Veteran
Veteran
Joined
Mar 2, 2012
Messages
40,098
Reaction score
13,704
First Language
English
Primarily Uses
RMMV
what don't you understand specifically? What are you trying to do? Where are you getting stuck?
 

infidelgkcn

Villager
Member
Joined
Sep 3, 2014
Messages
9
Reaction score
0
First Language
Turkish
Primarily Uses
I'm trying to get a yes no confirmation before pokemon naming, and I know how to do it with command windows and stuff but there are lots of scripts in pokemon for ace so there are lots of conflicts when I do it that way.. I just want choice 1 to be yes, choice 2 to be no, when I hit "C" I want it to understand that I mean no. With yes I want rename method to be called and with no just add the pokemon to the party. I tried to do it but I couldn't get it to work, and I don't understand why. I probably didn't see something essential, for example naming the classes same as other scripts classes. Somewhere I read that I need more than just this snippet though, something about indents.
 

Shaz

Veteran
Veteran
Joined
Mar 2, 2012
Messages
40,098
Reaction score
13,704
First Language
English
Primarily Uses
RMMV
Splitting into its own topic


just because Show Choices is a bit complicated and might go on for a bit.


I don't have the answer - I avoid using scripts for this.


Hime wrote a "more choices" script as well as a "conditional choices" script. You might be able to look up both of those and see how they handle things.
 

nio kasgami

VampCat
Veteran
Joined
May 21, 2013
Messages
8,949
Reaction score
3,042
First Language
French
Primarily Uses
RMMV
for showing choice method you have first to create a method  with a value 

def choice?case choicewhen 0 return truewhen 1 return falseendenddef choice_select if choice == true p "name1" if choice == false p "name2" endendthis is incomplet but this is one method you can use 
 
Last edited by a moderator:

Shaz

Veteran
Veteran
Joined
Mar 2, 2012
Messages
40,098
Reaction score
13,704
First Language
English
Primarily Uses
RMMV
Does this work, in the player's eyes, like a Show Choices command? As I understand, the OP wants to do a Show Choices command where the player has to choose something, but he wants to script the outcome himself rather than doing it via events. The script snippet in the first post is taken from Game_Interpreter, but that isn't the whole thing - there's a Window_Choice script as well as the When [**] part of Game_Interpreter that is also a part of choice processing.
 

Tsukihime

Veteran
Veteran
Joined
Jun 30, 2012
Messages
8,564
Reaction score
3,846
First Language
English
My suggestion is to not try to script choices yourself.


I'm not going to go into detail, but basically you need to deal with branching and that isn't something easy to do with script calls.


There are several scripts that provide you choice functionality such as Large Choices with Choice Options
 
Last edited by a moderator:

nio kasgami

VampCat
Veteran
Joined
May 21, 2013
Messages
8,949
Reaction score
3,042
First Language
French
Primarily Uses
RMMV
Does this work, in the player's eyes, like a Show Choices command? As I understand, the OP wants to do a Show Choices command where the player has to choose something, but he wants to script the outcome himself rather than doing it via events. The script snippet in the first post is taken from Game_Interpreter, but that isn't the whole thing - there's a Window_Choice script as well as the When [**] part of Game_Interpreter that is also a part of choice processing.
it sure if he want to show choice in a window this can be rather extremely dificulty but is line of code seem not enought complete to me for understand it...

My suggestion is to not try to script choices yourself.

I'm not going to go into detail, but basically you need to deal with branching and that isn't something easy to do with script calls.

There are several scripts that provide you choice functionality such as Large Choices with Choice Options
like Tsuki-san explain it is better to not try to script choice ...choices are not easy to do via script and need some little knowledge 

but can be you clear if you want to show in a window or not?
 

Shaz

Veteran
Veteran
Joined
Mar 2, 2012
Messages
40,098
Reaction score
13,704
First Language
English
Primarily Uses
RMMV
He says he needs to have a choice screen.


Show Choices (and the code behind it) works while you're on the map.


If you're scripting a different kind of scene, then I just suggest you create new windows and build your own choice selection script using Window_Selectable or Window_Command.
 

nio kasgami

VampCat
Veteran
Joined
May 21, 2013
Messages
8,949
Reaction score
3,042
First Language
French
Primarily Uses
RMMV
Hum it can alwauys do this...

class Scene_Map alias nio_initialize, initializedef initialize create_window nio_initializeenddef create_windowreturn @window = Nio_Choice_Window.new if Game.Variable[1] == trueelse return @window = nilendendendclass Nio_Choice_Window< Window_Selectabledef initialize(widht,height,choice_index,choice) super widht height contents.x = 100 contents.y = 100 @choice_index = 0 @choice = "" enddef widhtreturn 100enddef height return 100enddef choice_listing(choice_index,choice) case choice_index when 0 @choice = "choice1" when 1 @choice = "choice2" when 2 @choice = "choice3" when 3 @choice = "choice4"endend endthis is not complete but this is show a basic idea of how you can do 
 
Last edited by a moderator:

infidelgkcn

Villager
Member
Joined
Sep 3, 2014
Messages
9
Reaction score
0
First Language
Turkish
Primarily Uses
Well, as I said, I know how to do it with Window_Selectable or Window_Command but with lots of scripts I get lots of conflict issues, so show choices seemed like an easier decision :D

My main problems are Class Sprites Script, Battle Symphony Script and Enemy Capture script.. First and last from Crystal Noel and Symphony from Yanfly.. Class Sprites lets every class have their own sprite depending on their class id's, enemy capture gets those id's and turns them into actors and keeps their classes and if I create choice list with windows those id's and variables get jumbled and Symphony -and other scripts- start to trow errors. Show choice is my best bet at keeping variables local in Enemy Capture scripts class.

But of course there is always the possibility of me doing something stupid, but with one method (that is adding a pokeon directly at your party, eg choosing starter) it works perfectly, I don't get any errors, problem starts with catching wild pokemon, which are not actors just troops which selected randomized (region based) classes, not actors, when I use my script snippet something about them turning into party members and actors conflict with Symphony and I get nomethoderror caused by spriteset method in symphony and a variable from what I wrote.

But I need that variable there to get the id's from capture method and put in rename class. I tried attr_accessor, writer and reader but couldn't get them to work either.

Tsukihime I will check your scripts but it's late here so I will report in the morning.
 

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

Latest Threads

Latest Posts

Latest Profile Posts

Couple hours of work. Might use in my game as a secret find or something. Not sure. Fancy though no? :D
Holy stink, where have I been? Well, I started my temporary job this week. So less time to spend on game design... :(
Cartoonier cloud cover that better fits the art style, as well as (slightly) improved blending/fading... fading clouds when there are larger patterns is still somewhat abrupt for some reason.
Do you Find Tilesetting or Looking for Tilesets/Plugins more fun? Personally I like making my tileset for my Game (Cretaceous Park TM) xD
How many parameters is 'too many'??

Forum statistics

Threads
105,860
Messages
1,017,040
Members
137,569
Latest member
Shtelsky
Top