Here's a little code snippet of one decision with no real parameters.
Code:
;---------------------------------------
;-- Sub-Section 1E - Decisions System --
;---------------------------------------
;**********Script 1E-1 - Decision Selection**********
;
;|Author| Augustus Lucifer
;|Purpose| Set up the system of player selecting which decisions to pursue.
;|Changelog|
; o Script Created 6-22-09 ~ Augustus Lucifer
;Start the decisions system
monitor_event ScrollAdviceRequested ScrollAdviceRequested missions_scroll
and I_CompareCounter dec_system_activated == 1
historic_event choose_decisions true
end_monitor
;Fire Decision 1 (D01)
monitor_event EventCounter EventCounterType choose_decisions_accepted
and I_EventCounter choose_decisions_accepted == 1
wait 1 ; Give time for other event to clear the screen
historic_event decision_d01 true
set_event_counter choose_decisions_accepted 0
end_monitor
;Abort Decisions System
monitor_event EventCounter EventCounterType choose_decisions_decline
and I_EventCounter choose_decisions_declined == 1
set_event_counter choose_decisions_declined 0
end_monitor
;Start the process of Decision 1 (D01)
monitor_event EventCounter EventCounterType decision_d01_accepted
and I_EventCounter decision_d01_accepted == 1
set_event_counter decision_d01_accepted 0
set_counter d01_process 1
end_monitor
;Move on to next decision
monitor_event EventCounter EventCounterType decision_d01_declined
and I_EventCounter decision_d01_declined == 1
set_event_counter decision_d01_declined 1
;Next decision event goes here
end_monitor
;**********Script 1E-2 - Decision Process**********
;
;|Author| Augustus Lucifer
;|Purpose| Initialize the selected decisions with probabilities of success, cost, and timer.
;|Changelog|
; o Script Created 6-22-09 ~ Augustus Lucifer
declare_counter d01_process
declare_counter d01_timer
declare_counter d01_complete
;Decision 1 Process - Part 1 (Timer & Cost)
monitor_event FactionTurnEnd FactionIsLocal
and I_CompareCounter d01_process == 1
inc_counter d01_timer 1
add_money song -500
end_monitor
;Decision 1 Process - Part 2 (Probabilities)
monitor_event PreFactionTurnStart FactionIsLocal
and I_CompareCounter d01_process == 1
and I_CompareCounter d01_timer == 3 ;3 turns
generate_random_counter d01_probability 1 10
if I_EventCounter d01_probability <= 5
set_counter d01_complete 1
end_if
if I_EventCounter d01_probability > 5
set_counter d01_complete 2
end_if
set_counter d01_timer 0
set_counter d01_process 0
end_monitor
;**********Script 1E-3 - Decision Outcome**********
;
;|Author| Augustus Lucifer
;|Purpose| Implement the effects of a successful decision.
;|Changelog|
; o Script Created 6-22-09 ~ Augustus Lucifer
;Decision 1 Outcome - Success
monitor_event FactionTurnStart FactionIsLocal
and I_CompareCounter d01_complete == 2
add_money song 40000
historic_event d01_success false
end_monitor
;Decision 1 Outcome - Failure
monitor_event FactionTurnStart FactionIsLocal
and I_CompareCounter d01_complete == 1
historic_event d01_failure false
set_counter d01_complete 0
end_monitor
Some things that need to be done still:
- steal_esc_key and experiment with aborting the progression using it. One EscPressed monitor should do to impress an lclick up/down on decline after setting a counter to stop all events from firing, setting all declined counters to 0, and using a wait command.
- Skipping of completed decisions and decisions that aren't qualified for. This is going to be tricky for multiple decisions, might have to include if statements for every scenario in every previous scenario, hopefully a better workaround though.