Hello everyone, I'm interested in developing the classic html porn game.
I've been using twine and followng some tutorials for some basic things, but there's something I can't find.
For the classic scenario of a repetable task which shows a random gif of a selection, can someone give me some pointers?
I'd be really grateful
You mean that every time someone hits that scene one of a variety of gifs will be played?
We try to make sure if you refresh the page it doesn't change what's shown or a random roll value, so we do this:
<<if Fresh()>><<set $randomRollA = random(1,5)>><<endif>>
This will set the variable randomRollA equal to a random value between 1 and 5.
Then inside the table we display things in:
<table>
<tr>
<td style="vertical-align: top">
<<if $randomRollA is 1>><span class="sectionimage">[img[img\chars\rachel\rachel_sex01.gif]</span><<endif>><<if $randomRollA is 2>><span class="sectionimage">[img[img\chars\rachel\rachel_sex02.gif]]</span><<endif>><<if $randomRollA is 3>><span class="sectionimage">[img[img\chars\rachel\rachel_sex03.gif]]</span><<endif>><<if $randomRollA is 4>><span class="sectionimage">[img[img\chars\rachel\rachel_sex04.gif]]</span><<endif>><<if $randomRollA is 5>><span class="sectionimage">[img[img\chars\rachel\rachel_sex05.gif]]</span><<endif>>
</td>
<td style="vertical-align: top"> [Text that appears in the section next to the image]
</td>
</tr>
</table>
Now if you're using a video file like a webm, the span looks like this:
<<if $randomRollA is 1>><span class="sectionimage"><video width="650" autoplay loop><source src="img\chars\rachel\sex1.webm" type=video/webm; codecs="vp8, vorbis"></video></span>
Hope that helps!