- Joined
- Sep 7, 2013
- Messages
- 148
- Reaction score
- 7
- First Language
- English
- Primarily Uses
Hey everyone,
I'm using Tsukihime's 'Event Wrapper' script at the moment, and I'v encountered a slight problem that no matter how many times I try to fix it, I can't seem to shake. Basically, I'm trying to script an 'crop' event that when the date ($game_variables[2]) changes, the even spits out a random number (which works) and then, due to this random number, either advances a stage in its growth, or reverts back to it's previous, un-watered state.
# setup first page event.character_name = "$Farm Soil" event.character_index = 0 event.priority_type = 1 event.trigger = 0 event.direction_fix = true event.build { call_script("self_variable('c_date', $game_variables[2])") show_text add_message("Would you like to water crop?") show_choices(["Yes","No"],0) choice_branch(0) { call_script("self_switch('c_water',true)") show_text add_message("You watered the crop.") control_self_switch("A", 0)} #turn on self-switch A when done } choice_branch(1) {} } # setup second page event.set_page(1) event.character_name = "$Farm Soil" event.character_index = 0 event.direction = 4 event.pattern = 0 event.trigger = 0 event.direction_fix = true #setup conditions for the second page event.condition.self_switch = "A" # require self-switch A to be set event.build { add_comment("<parallel page: 3>") show_text add_message("You have already watered this crop.") } # setup third page event.set_page(2) event.character_name = "$Farm Soil" event.character_index = 0 event.direction = 4 event.pattern = 0 event.trigger = 4 event.direction_fix = true #setup conditions for the third page event.condition.self_switch = "A" # require self-switch A to be set event.build { add_comment("<parallel page>") cond_if("self_variable('c_date')!=$game_variables[2]") { call_script("self_variable('c_chance',rand(60))") cond_if("self_variable('c_chance')>=30"){ call_script("self_variable('c_date', $game_variables[2])") call_script("self_switch('c_water',false)") control_self_switch("B",0) control_self_switch("A",1)} cond_else{ call_script("self_variable('c_date', $game_variables[2])") call_script("self_switch('c_water',false)") control_self_switch("A",1) } cond_else {} } #control_self_switch("A",1) } By my logic, given that the vast majority of the condition check works, the problem would have to be around lines 83-87 of the code, but for the life of me, I can't work out where I am going wrong!
Any help with this would be greatly appreciated!
Thanks in advance guys!
I'm using Tsukihime's 'Event Wrapper' script at the moment, and I'v encountered a slight problem that no matter how many times I try to fix it, I can't seem to shake. Basically, I'm trying to script an 'crop' event that when the date ($game_variables[2]) changes, the even spits out a random number (which works) and then, due to this random number, either advances a stage in its growth, or reverts back to it's previous, un-watered state.
# setup first page event.character_name = "$Farm Soil" event.character_index = 0 event.priority_type = 1 event.trigger = 0 event.direction_fix = true event.build { call_script("self_variable('c_date', $game_variables[2])") show_text add_message("Would you like to water crop?") show_choices(["Yes","No"],0) choice_branch(0) { call_script("self_switch('c_water',true)") show_text add_message("You watered the crop.") control_self_switch("A", 0)} #turn on self-switch A when done } choice_branch(1) {} } # setup second page event.set_page(1) event.character_name = "$Farm Soil" event.character_index = 0 event.direction = 4 event.pattern = 0 event.trigger = 0 event.direction_fix = true #setup conditions for the second page event.condition.self_switch = "A" # require self-switch A to be set event.build { add_comment("<parallel page: 3>") show_text add_message("You have already watered this crop.") } # setup third page event.set_page(2) event.character_name = "$Farm Soil" event.character_index = 0 event.direction = 4 event.pattern = 0 event.trigger = 4 event.direction_fix = true #setup conditions for the third page event.condition.self_switch = "A" # require self-switch A to be set event.build { add_comment("<parallel page>") cond_if("self_variable('c_date')!=$game_variables[2]") { call_script("self_variable('c_chance',rand(60))") cond_if("self_variable('c_chance')>=30"){ call_script("self_variable('c_date', $game_variables[2])") call_script("self_switch('c_water',false)") control_self_switch("B",0) control_self_switch("A",1)} cond_else{ call_script("self_variable('c_date', $game_variables[2])") call_script("self_switch('c_water',false)") control_self_switch("A",1) } cond_else {} } #control_self_switch("A",1) } By my logic, given that the vast majority of the condition check works, the problem would have to be around lines 83-87 of the code, but for the life of me, I can't work out where I am going wrong!
Any help with this would be greatly appreciated!
Thanks in advance guys!


