by Ice Cream Jonsey » Thu Aug 17, 2006 8:18 pm
inky and ctate from the ifMud got me heading down the system timer path... basically, Hugo can access the system time, so if you know the length of a piece of music you can determine when the next one should play.
I don't think that Hugo keeps track of the number of seconds since the beginning of Unix time (or even the number of seconds since you started playing the game, which would be helpful) so I think one will have to make a call for the current time and then increment to a future time that you'll check against every turn.
There's no way to start up that next piece of music until the player types something in, but that's fine for my purposes. If they aren't typing something in fairly regularly they probably aren't at the game, so no biggie.
I wrote a similar function to all of this when I was coding in C several years ago, so I guess I can re-use some of that code. (Well, I wasn't playing music thereafter, but still.) I'll package it up and release it so everyone can implement it.
(If I implement the Spellcasting interface, which I won't for a WIP, but probably will for the sake of HUMAN KNOWLEDGE) there could be a nice little framework a new coder could hopefully use and do something with. Possibilities!)
inky and ctate from the ifMud got me heading down the system timer path... basically, Hugo can access the system time, so if you know the length of a piece of music you can determine when the next one should play.
I don't think that Hugo keeps track of the number of seconds since the beginning of Unix time (or even the number of seconds since you started playing the game, which would be helpful) so I think one will have to make a call for the current time and then increment to a future time that you'll check against every turn.
There's no way to start up that next piece of music until the player types something in, but that's fine for my purposes. If they aren't typing something in fairly regularly they probably aren't at the game, so no biggie.
I wrote a similar function to all of this when I was coding in C several years ago, so I guess I can re-use some of that code. (Well, I wasn't playing music thereafter, but still.) I'll package it up and release it so everyone can implement it.
(If I implement the Spellcasting interface, which I won't for a WIP, but probably will for the sake of HUMAN KNOWLEDGE) there could be a nice little framework a new coder could hopefully use and do something with. Possibilities!)