I am now writing another script, and encoutered something I don't understand. Fist here is the project containing the script. Its mains goal is to add some time (minutes) per step the party makes, and convert them tou hours, daus,etc..., and to be able to exploit those datas later.
http://www.mediafire.com/download.php?wdzjmn4mm0u
The proble is, when I make my first step in the game, I got the 'undefined method '+' for nilNilClass' at line 139. This line is 'minyte += minutes_per_step'. It seems the probleme comes from the 'minute=' methof; as if I write '@minute += minutes_per_step', I get no error. Although ther is no point in doing ths, as a direct access to the class variable doesn't update the hour, day, etc... as does the write method.
I also tried (among many other things...)
'm = minute + minutes_per_step'
'minute = m'
but in this case, although I got no error, the class variable weren'tupdated !!!
It seems I didn't understand something about class variables and their read/write method... Can someone help (or at least point me to a good Ruby manual) ?
http://www.mediafire.com/download.php?wdzjmn4mm0u
The proble is, when I make my first step in the game, I got the 'undefined method '+' for nilNilClass' at line 139. This line is 'minyte += minutes_per_step'. It seems the probleme comes from the 'minute=' methof; as if I write '@minute += minutes_per_step', I get no error. Although ther is no point in doing ths, as a direct access to the class variable doesn't update the hour, day, etc... as does the write method.
I also tried (among many other things...)
'm = minute + minutes_per_step'
'minute = m'
but in this case, although I got no error, the class variable weren'tupdated !!!
It seems I didn't understand something about class variables and their read/write method... Can someone help (or at least point me to a good Ruby manual) ?