<script> // call this to update the scene when a variable changes window.updateState = function updateState(str) { vars = str.split(',').map(t => t.trim()); for (const variable of vars) { if (window.stateToAFrame[variable]) { window.stateToAFrame[variable](harlowe.state.variables[variable]); } } } // Functions for updating 3D model when variables change window.stateToAFrame = { hasClothes: function (value) { var shirt = document.querySelector('[data-uuid="clothes-shirt"]'); shirt.setAttribute('visible', !value); shirt.classList.toggle('no-click', value); } } </script><!-- Expose state and macros to the js --><div style="display: none;"> (print: (function () { window.harlowe = { state: State, macros: Macros } return JSON.stringify(State, null, ' '); }())) (set: $objectmap to (dm: "9b640c9f-61bd-4282-b3aa-d9a567d93c93", "hamper", "f53f1da9-5f52-4784-81c9-b4a27f02a383", "bed", "90213622-86aa-4fb9-98e0-414e632ef9a5", "bedroomdoor", "0481d0a2-7b04-472a-b726-67475a4d5961", "frontdoor", "07ebc85a-cda0-408e-9acf-8671e3decf06", "buttpainting", "b3338f27-24aa-41d5-8b58-e3b7e42623aa", "closet", "5808ca30-92a9-4b90-a6c8-bb49e6745929", "sofa", "84839535-ad9e-4100-8cba-b2413d4fdc88", "plant", )) (set: $interactiveset to (ds:)) (set: $hasClothes to false) (set: $isAwake to false) (set: $room to "bedroom") <h1>Loading</h1> </div><script> // Once it has loaded display the scene. document.querySelector('tw-story').style.display = 'none'; window.readyPromise.then(function() { window.updateState(Object.keys(harlowe.state.variables).join(',')); document.querySelector('tw-story').style.display = ''; }); </script>//Boom Boom Boom Boom// The banging echoes through my head. Is it the door? Am I dreaming? [Go back to sleep]<gosleep| [[Check it out->wake]] (click-replace: ?gosleep)[//Boom Boom Boom Boom//, the unceasing poundings, echoes in my ears. I'm probably imagining it but I should check it out.] I raise my head from the pillow. My head is pounding, I feel dizzy. The early morning light stings my eyes. (display: "bedroomset") [What did I drink last night?]<no-drink| (click-replace: ?no-drink)[ I don't think I drank anything last night... [[Go check the door->bedroomdoor]]] <script> startMouseInteraction(); document.querySelector('a-scene').style.opacity = 1; setInterval(function () { target.setAttribute('ada-model', 'eyes: ' + Math.floor(4 * Math.random())); }, 1000); </script><a-scene io3d-lighting style="position: absolute; opacity: 0;" vr-mode-ui="enabled: false"> <a-assets> <a-asset-item id="ada-obj" src="https://cdn.rawgit.com/AdaRoseEdwards/metaverse/master/static/models/ada/vr-ada.obj"></a-asset-item> <a-asset-item id="ada-mtl" src="https://cdn.rawgit.com/AdaRoseEdwards/metaverse/master/static/models/ada/vr-ada.mtl"></a-asset-item> <a-asset-item id="navmesh" src="https://cdn.glitch.com/b4fd6fd6-484f-46a9-abd9-b602f64aa92a%2Fnavmesh.gltf"></a-asset-item> <img src="https://cdn.glitch.com/b4fd6fd6-484f-46a9-abd9-b602f64aa92a%2Fshirt.png?1515923515430" id="shirt" /> <img src="https://cdn.glitch.com/b4fd6fd6-484f-46a9-abd9-b602f64aa92a%2Ftrousers.png?1515923515453" id="skinny-jeans"> <img src="https://cdn.glitch.com/b4fd6fd6-484f-46a9-abd9-b602f64aa92a%2Fbra.png?1515923515504" id="bra" /> </a-assets> <!-- Black background --> <a-sky color="black"></a-sky> <!-- character model --> <a-entity obj-model="obj: #ada-obj; mtl: #ada-mtl" ada-model="eyes:3; mouth: 3;" position="-43.615 0.6 -0.312" id="target" scale="0.08 0.08 0.08" shadow="cast: true; receive: false;" nav-controller="speed: 1.5"></a-entity> <~-sprites--> <a-image class="clothes" data-uuid="clothes-bra" src="#bra" position="-44.275 0.064 -1.368" rotation="-90 180 180"></a-image> <a-image class="clothes" data-uuid="clothes-skinny-jeans" src="#skinny-jeans" position="-44.851 0.019 0.622" rotation="-90.01166961505233 45.89391938997894 0"></a-image> <a-image class="clothes" data-uuid="clothes-shirt" src="#shirt" position="-43.064 0.598 0.231" rotation="-90.01166961505233 180.02333923010465 180.02333923010465"></a-image> <!-- The Environment gets injected here--> <a-entity id="scene-target"> </a-entity> <!-- navigation mesh for the floor --> <a-entity gltf-model="#navmesh" nav-mesh visible="false"></a-entity> <!-- orbit cam --> <a-entity camera="fov: 50; zoom: 1;" position="-44 3 5" orbit-controls="invertZoom: true; autoRotate: false; target: #target; enableDamping: true; dampingFactor: 0.5; minDistance:4; maxDistance:20; maxPolarAngle:1.0; minPolarAngle: 0.2; enableKeys: false; enablePan: false;"></a-entity> </a-scene> Hehe Butts.<!-- Can't use door until dressed -->(unless: $hasClothes)[I should find some clothes before I answer the door. I'll grab last nights clothes. [[Look for clothes->find-clothes]] ]$hasClothes[<!-- If we are in the bedroom then enter the living room --> (if: $room is "bedroom")[ I enter the living room. (set: $room to "livingroom")(display: "livingroomset") [[okay->livingroom]]<script> moveTo({ x: -44.84, y: 0.01, z: -1.92 }) .then(function () { teleportTo({x: -44.66, y: 0.1, z: -3.15}); }); </script> ]<!-- If we are in the livingroom then enter the bedroom -->(elseif: $room is "livingroom")[ I enter my bedroom. (set: $room to "bedroom")(display: "bedroomset") [[okay->bedroom]]<script> moveTo({x: -44.76, y: 0.1, z: -2.91}) .then(function () { teleportTo({x: -44.79, y: 0.1, z: -1.9}); }); </script> ] ]I don't really feel like putting a bra on. <script>moveTo({ x: -43.47, y: 0.01, z: -1.40 });</script>Ugh, I am not gonna try and squeeze into the these so early in the morning. <script>moveTo({ x: -44.84, y: 0.01, z: -0.23 });</script>(if: $hasClothes is false)[I pick up the shirt and put it on. It's warm and soft. I guess I was sleeping on it last night it's really wrinkly. The shirt is long enough to get by. (set: $hasClothes to true)<script> moveTo({x:-43.5,y:0.3,z:1}) .then(() => window.updateState('hasClothes')); </script>](else:)[I'm already wearing a shirt.] [[Let's go check the front door->frontdoor]]I look around my room. Clothes are scattered around the floor and bed. [[Check the Laundry Hamper->hamper]] [[Grab something from the wardrobe->closet]] [[Grab the bra from the floor->clothes-bra]] [[Get the extra skinny jeans from the floor->clothes-skinny-jeans]] [[Grab the shirt from the bed->clothes-shirt]] [[Leave the room->bedroomdoor]]I'm not going to wear smelly clothes. <script>moveTo({ x: -44.84, y: 0.01, z: -0.23 });</script>I really need to do laundry this is almost empty. Mostly just formal dresses and winter coats. (if: $hasShorts is not true)[ I spot some shorts in the back of closet and put them on. (set: $hasShorts to true) ] <script>moveTo({ x: -43.37, y: 0.01, z: -1.40 });</script>(if: ((passage:)'s tags) contains 'stub')[](else:)[(set: $lastLocation to ((passage:)'s name))](if: ((passage:)'s tags) contains 'stub')[ (link-goto: 'Go Back', $lastLocation) ](if: $done is not true)[I haven't got much to do in here I should go answer the front door. [[Leave Bedroom->bedroomdoor]] ](else:)[ I return to bed and go to sleep. Fin. ]There was no one at the door. I think the pounding was in my head.(set: $done to true) [[Check the hallway->hallway]] [[Go back to bed->bedroomdoor]] <script>moveTo({x: -44.69, y: 0.1, z: -4.4});</script>I should have a nap.My beloved plant, //Pamela Isely VIII//. Alas //Pamela Isely I-VII// didn't last longer than a few weeks. I am not good at looking after plants. I have good feeling this time though.<script> moveTo({x: -48.53, y: 0.1, z: -1.7});</script>(set: $interactiveset to (ds: "buttpainting", "bedroomdoor", "clothes-shirt", "clothes-bra", "clothes-shirt", "clothes-skinny-jeans", "hamper", "closet" ))(set: $interactiveset to (ds: "bedroomdoor", "plant", "frontdoor", "sofa", ))I step out into the hallway. (if: $hasShorts is not true)[ I here someone clear their throat behind me. My neighbour and her dog are stood there, she raises her eyebrows at me: //"Isn't it a little cold this morning to be walking around like that?"// I blush furiously, I hdan't expected anyone to be about and wasn't wearing any shorts! I run inside and close the door. Red to my ears. Fin. ](else:)[ The hallway is empty. I've been letting my anxiety get to me. I take a few deep breaths of the crisp morning air then head back to bed. Fin. ]