So it appears to be choosing a sound to play, but instead of randoming the sound each time it just replays the same.
Upon inspecting lint, it says
"game/script.rpy:64 unable to evaluate filename u'chalkshort'" for each instance of chalkshort and chalklong
I'm fairly certain the randoming works if I add $import random before the sound instances, but that command stops the game from being able to create new save files.
Any thoughts?
For the record:
"am1" is setup as
renpy.music.register_channel("am1", "sfx", False, file_suffix=".ogg")
Code: Select all
#This is placed before start of script
init python:
import random
#this is placed just inside of script
label start:
#this is a chalk writing sfx that is 3 seconds + long
$ linenum2 = random.randint(0,5)
$ randomvoiceclips = ["sfx/chalk/chalk_long/chalk1", "sfx/chalk/chalk_long/chalk2", "sfx/chalk/chalk_long/chalk3", "sfx/chalk/chalk_long/chalk4", "sfx/chalk/chalk_long/chalk5", "sfx/chalk/chalk_long/chalk6",]
$ chalklong = randomvoiceclips[linenum2]
#this is a chalk sfx that is ~1 second long
$ linenum = random.randint(0,10)
$ randomvoiceclips = ["sfx/chalk/chalk_short/chalk1", "sfx/chalk/chalk_short/chalk2", "sfx/chalk/chalk_short/chalk3", "sfx/chalk/chalk_short/chalk4", "sfx/chalk/chalk_short/chalk5", "sfx/chalk/chalk_short/chalk6", "sfx/chalk/chalk_short/chalk7", "sfx/chalk/chalk_short/chalk8", "sfx/chalk/chalk_short/chalk9", "sfx/chalk/chalk_short/chalk10", "sfx/chalk/chalk_short/chalk11"]
$ chalkshort = randomvoiceclips[linenum]
play am1 chalkshort
"test test test chalk short"
play am1 chalklong
"plab plab blab chalk long"