Jump to content

what_day_of_scenario()


Recommended Posts

this call makes me wonder. I put it into a script which worked fine, but since two days ago it refuses to work proparly. I did some debugging tests, and found that the current day is day_shown_on_screen - 1. so, what we would think is day 1, is day 0 with this call. Was it like that all along?

 

For better reference, here are the scripts involved:

 

rivers.txt, START_STATE:

Code:
 beginstate START_STATE;// The things with appointment mayor of Filbertonif (get_flag(28,0) == 1) {		day1 = get_flag(250,4);				if (what_day_of_scenario() >= (day1 + 2)) {				set_flag(28,0,2);				print_str_color("You missed your appointment with mayor Arbuckle of Filberton.",3);				}		}if (get_flag(28,0) == 1) {		if (get_flag(200,0) == 0) {				day1 = get_flag(250,4);								if (what_day_of_scenario() == (day1 + 1)) {						print_str_color("Today you have an appointment with mayor Arbuckle of Filberton.",3);						set_flag(200,0,1);						}				}		} 
and t28filbertondlg.txt, one of the dialogue nodes:

Code:
 begintalknode 4;	state = 3;	personality = 49;	nextstate = -1;	condition = 1;	question = "Yes please";	text1 = "She checks the book of appointments. _It seems you don't have an appointment yet. okay, the mayor will see you tomorrow._ She closes the book. _That's settled then, good bye!_";	text2 = "She checks the book of appointments. _Ah, i see you already have made an appointment. come back when you have it._ She says good bye and returns to the angry man.";	text3 = "She checks the book of appointments. _I see you had an appointment, but didn't come to it on time. You'll have to make a new one._ She crosses the old appointment out.";	code =		if (get_flag(28,0) == 0) {				remove_string(2);				remove_string(3);				set_flag(28,0,1);				print_str_color("You made an appointment to see mayor Arbuckle of",3);				print_str_color("		Filberton for tomorrow.",3);								day1 = what_day_of_scenario();				set_flag(250,4,day1);								set_flag(200,2,0);								print_num(day1);				print_num(get_flag(250,4));				print_num(get_flag(28,0));				print_num(get_flag(200,2));				print_num(what_day_of_scenario());				end();				}						if (get_flag(28,0) == 1) {				remove_string(1);				remove_string(3);				end();				}				if (get_flag(28,0) == 2) {				remove_string(1);				remove_string(2);				print_str_color("Your appointment with mayor Arbuckle was canceled.",3);				set_flag(28,0,0);				set_flag(200,2,0);				end();				}	break; 
What happens is this: In t28filbertondlg.txt you make an appointment to see the mayor of that town for the next town. flag 28,0 is set to 1, to sinify that an appointment was made, 200,2 is set to 0 just to make sure it will be 0, and flag 250,4 is set to a variable: day1, according to what_day_of_scenario(), which I think is the problem here.

 

After that, in rivers.txt (the scenario script) the following thing are checked:

 

is flag 28,0 == 1? If so, then continue, as an appointment was made;

is flag 200,2 == 0? If so, then continue, as this message wasn't displayed as yet;

is day1, which is set according to flag 250,4, (day1 + 1) == what_day_of_scenario? If so, show the message that an appointment was made for today.

 

However, it seems as though all this isn't done. I checked this last sequence of events (in rivers.txt) by leaving out the flags 28,0 and 200,2. It still didn't work, which means that there must be something wrong with the variable day1, or the call what_day_of_scenario.

 

In the dialogue node I put here for you people to look at, I have added several print_num() calls. On day 1, this is what the values of the variables and calls give me:

 

day1 = 0 (?)

250,4 = 0 (?)

28,0 = 1 (that's okay)

200,2 = 0 (that's okay)

what_day_of_scenario() = 0 (?)

 

If its not the call, can anybody of you guys spot the problem? Its only now that it stopped working. before it worked perfectly. The strangest thing is, is that I can't remember changing anything about these two script (rivers.txt and t28filbertondlg.txt).

 

I hope anybody can help.

Link to comment
Share on other sites

Thralni: After our talk last night, I managed to get the Mayor to see me. However, he did half-way through the day instead of at the start. My code is similar to yours, but this worked:

Code:
 if ((get_flag(28,0) == 1) && (get_flag(200,2) == 0)) {				day1 = get_flag(250,4);				if (what_day_of_scenario() == (day1 + 1)) {						print_str_color("Today you have an appointment with mayor Arbuckle of Filberton.",3);						set_flag(200,2,1);						}				}if (get_flag(28,0) == 1) {		day1 = get_flag(250,4);		if (what_day_of_scenario() >= (day1 + 2)) {				set_flag(28,0,2);				print_str_color("You missed your appointment with mayor Arbuckle of Filberton.",3);				}		} 
I have no idea why though.
Link to comment
Share on other sites

Small update:

 

I continued testing, and it appears that rivers.txt is not run, at least not the START_STATE. Is there any reason for that to happen?

 

EDIT: And another small update:

 

I checked rivers.txt with alint, and it returned two errors, both errors of syntax, so I gather that there is something wrong with the +'s, -'s and such. I can't find the problem... Can you?

Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
×
×
  • Create New...