what_day_of_scenario()

Error message

  • Notice: Trying to access array offset on value of type int in element_children() (line 6595 of /var/www/pied-piper.ermarian.net/includes/common.inc).
  • Notice: Trying to access array offset on value of type int in element_children() (line 6595 of /var/www/pied-piper.ermarian.net/includes/common.inc).
  • Notice: Trying to access array offset on value of type int in element_children() (line 6595 of /var/www/pied-piper.ermarian.net/includes/common.inc).
  • Notice: Trying to access array offset on value of type int in element_children() (line 6595 of /var/www/pied-piper.ermarian.net/includes/common.inc).
  • Deprecated function: implode(): Passing glue string after array is deprecated. Swap the parameters in drupal_get_feeds() (line 394 of /var/www/pied-piper.ermarian.net/includes/common.inc).
AuthorTopic: what_day_of_scenario()
Master
Member # 5977
Profile Homepage #0
I find this call to be somehwat depressing. Now and then it works, but lately it fails to do anything. I'm talking about the following piece of script:

if (get_flag(6,1) == 0) { if (get_flag(5,2) == 0) {
if (what_day_of_scenario() > 2) {
set_flag(5,2,1);
erase_char(7);
}
}
}
Here, what_day_of_scenario refuses to work. Right now, my party is standing outside the town to which this script belongs. It is day 3, and character 7 is not erased, nor is the flag set to 1. I took the if call containing what_day_of_scenario() out, and it worked. Also, the flags 5,2 and 6,1 are 0 at the time that this chunk of code is run. So indeed: from my tests the what_day_of_scenario call is to blame. Would anybody know what's causing this?

EDIT: So in the end it did work, but only on day 4... How come?

[ Sunday, July 15, 2007 09:10: Message edited by: Thralni ]

--------------------
Play and rate my scenarios:

Where the rivers meet
View my upcoming scenario: The Nephil Search: Escape.

Give us your drek!
Posts: 3029 | Registered: Saturday, June 18 2005 07:00
Shaper
Member # 7472
Profile Homepage #1
Avernum counts from 0, not 1. Thus, the first day of the scenario is Day 0, the second is Day 1, and so forth.

[ Sunday, July 15, 2007 09:22: Message edited by: Nioca ]

--------------------
Scenarios need reviews! Please rate these scenarios at the CSR after playing them!
AmnesiaWitch HuntWhere the Rivers MeetFoul Hordes
Posts: 2686 | Registered: Friday, September 8 2006 07:00
Master
Member # 5977
Profile Homepage #2
Aaah... Thanks a bunch Nioca! I'll keep it in mind for other moments I use this, and other, similar, calls.

--------------------
Play and rate my scenarios:

Where the rivers meet
View my upcoming scenario: The Nephil Search: Escape.

Give us your drek!
Posts: 3029 | Registered: Saturday, June 18 2005 07:00