Using sugarcube 2.3 and Twine 2.3.5
I want to be able to have a passage play a random mp4 out of a selection of 5 each time you come back to that passage. Can you do it with arrays or do you need to do a different method. I can do it with images fine but mp4s are much smaller than gifs so it would be really convenient!
You can just do something like this:
<<set _vid = $path + ["vid1", "vid2", "vid3"].random() + ".mp4">>
<video @src="_vid" autoplay loop muted controls height="480px">
That will set
_vid to something like “WhateverThePathIs/vid1.mp4”, and then play that video (muted). See the Array.random() method and “Attribute Directive” documentation for details.
Hope that helps!