setup_choices script call doesn't react to selection

● ARCHIVED · READ-ONLY
Started by Bukk 5 posts View original ↗
  1. Hello,
    I've noticed that if you have message right before choice selection (Show choices) it will stay on the screen. But if you have something else before, the message will disappear and choice selection will be shown without any additional message.
    I want that message to be shown (so player could see what is he deciding for) but I have IF statement before the show choices command thus it won't stay on the screen. I found message command in Game_Interpreter and I tried to override it with my own script call. I've managed to show message and choices at the same time but for some reason, it doesn't react to my input. To be more specific, when I select some option, the code skips to the end and doesn't execute selected branch.
    I've tried to set @index to +1 after the setup_choices but after that it will always select first branch.
    Could you please help me out with this? What did I make wrong?
    I was thinking about using @branch[@indent] to skip to certain indexes, but I can't find right indexes in the code.

    Script
    def hold_message_for_choices
    @index += 1

    com_params = @list[@index].parameters

    $game_message.face_name = com_params[0]
    $game_message.face_index = com_params[1]
    $game_message.background = com_params[2]
    $game_message.position = com_params[3]

    while @list[@index].code != 102 || @index >= @list.length #find Show Choice command
    @index += 1
    end

    setup_choices(@list[@index].parameters)
    wait_for_message
    end
  2. why can't you have the if statement after the show choices?
  3. Because the choices are Yes/No and the dialogue is based on the item the user is currently holding. There is different message for each item.

    I've managed to fix it by adding
    if @branch[@indent] == 0
    @index += 1
    elsif @branch[@indent] == 1
    @index = @list[@index + 2].parameters[1]
    end

    But I have no idea why "@index + 2" and also it's not the nicest solution. I still wonder how could it be fixed differently.
  4. better solution: go to tsukihime's blog and search for her script on choice options.
    that will allow you to place the conditions inside the show choice command.
  5. Bukk said:
    But if you have something else before, the message will disappear and choice selection will be shown without any additional message.

    because, from the interpreter's point of view, *the instruction right after the message* is not a choice display, is a conditional.

    process the condition separately, and show the choice right after the message.
    it's the quickest solution without a plugin.
    (if the issue is showing a choice based on *the message*, copy *the message* over to a set of solutions based on *the conditional*, so *the conditional* would encapsulate [*the message* followed by *the choice*])

    if you use a plugin, you'll have to reorder the windows and how they share which procedures are passed down.

    I made a custom choice window, and it has that same problem.