Scripting choices

● ARCHIVED · READ-ONLY
Started by fuzzalicious 6 posts View original ↗
  1. Checking the script call collection for VXAce you can set up choices like

    params = []
    choices = []
    choices.push("choice 1")
    choices.push("choice 2")
    params.push(choices)
    params.push(0)
    setup_choices(params)

    But how do you then use it, like if I click choice 1 would the code look something like if choices== "choice1"
  2. If you don't know that, I suggest using one of the existing scripts for more choices as they move the handling completely into the events.


    For example Tsukihime's "large choices" or Modern Algebra's "Advanced Text System: Choice Options", both can be found on the master script list. You can also check them to learn how they handled this problem, if you still want to use scripts directly.
  3. Well this is for the contest so I have stayed away from all existing scripts.

    This could eaily be done with the choice event, but I can't seem to have it appear together with

    my custom dialogue since I have to insert it before or after my script.
  4. Or I guess a better question would be, what command represents the choice?

    Like if I wanted to store it $game_variables[0] = ?
  5. fuzzalicious, please avoid double posting, as it is against the forum rules. You can review our forum rules here. Thank you.


    Doing choices via scripting is problematic. I think even Hime's large choices script has (or had?) issues. Scripting a choice box is not nice to work with.
  6. Did you ever figure this out?

    Edit: Okay, so I figured this out.

    Set everything up as you mentioned; and then:

    show_choices(params)wait_for_messageresult_index = @branch[@indent]result_index is an integer. In your example, you get 0 for "choice one" and 1 for "choice two".

    So you would rewrite your condition as: result_index == 0