Handling question_box user input

Users who are viewing this thread

killkhergit

Squire
Just as the title says. I need to ask the player about something and what happens next should depend on him/her chosing 'yes' or 'no'. It should look something like this:

(question_box,"@do something"),
    *do this when 'yes'*
else
    *do this when 'no'*
end

...right?
 
For example (This is a dialogue when you pressed tab button in battle.)
Code:
  ti_tab_pressed, 0, 0, [],
  [
    (try_begin),
      (eq, "$battle_won", 1),
      (call_script, "script_count_mission_casualties_from_agents"),
      (finish_mission,0),
    (else_try),
      (call_script, "script_cf_check_enemies_nearby"),
      (question_box,"str_do_you_want_to_retreat"),
    (else_try),
      (display_message,"str_can_not_retreat"),
    (try_end),
    ]),

      (ti_question_answered, 0, 0, [],
       [(store_trigger_param_1,":answer"),
        (eq,":answer",0),
        (assign, "$pin_player_fallen", 0),
        
        (try_begin),
          (store_mission_timer_a, ":elapsed_time"),
          (gt, ":elapsed_time", 20),
          (str_store_string, s5, "str_retreat"),
          (call_script, "script_simulate_retreat", 10, 20),
        (try_end),
        (call_script, "script_count_mission_casualties_from_agents"),
        
        (finish_mission,0),]),
I guess question_box is only for module_mission_templates.py.
 
Looks like I need to handle it using (ti_question_answered), which can only be used in triggers right?

Bummer. :sad:

Thanks though.
 
Back
Top Bottom