Custom scene scripting

First off, I’m not getting things as done as quickly as I planned a few days ago. I thought that in 2 weeks or so(June 16th, since I figured that), I could have a ton more done and launch a new Kickstarter.
Turns out, I’m just way too exhausted from working so hard to do what I’ve done already, in making a new engine. Some days I was working for 20 hours straight, and I still haven’t fully recovered. I took 2 and a half whole days off, but I was still tired.
So, I’m taking things slowly. I’ve been relaxing, exercising, and doing some other easier work between dabbling on LEWD. Still, I have some neat things to share from the past 2 days.

Now, I mentioned before on a Kickstarter update about the tools, and how the engine can actually deliver any sort of content. The main thing about it is the whole way it dynamically/procedurally switches content around, but it’s really agnostic to what that content is, and it’s up for the client to care about it.
The first obvious reveal from that is that it could sent html, instead of just plain text. An <img /> could jump to mind, like to put scene pictures in with it.
What I really wanted to do with that, though, is dynamically deliver javascript with the writing, to deliver stories in different and unique ways when it’s called for. Namely, I wanted to write some rogue-AI story(/ies) to really give the impression that something is screwing around with the computers. I could also use it to deliver some “losing your mind” kind of bad ends, to drive the point across, and do things like House of Leaves but really brought to life. Some ZALGO seems obvious, as well, at some point. :3

It wasn’t too hard to put it in game. Here’s a little example
<span>Boss is acting really strange.</span></code>

<span>Why is the room that houses the <span>communications relay locked<span>modern hives enable beekeepers to transport bees</span></span>?</span>

<script type=”text/javascript”>
$.getScript(“js/content-scripts.js”, function(){
redact(2000, 4500, $(‘#event .scene:last’));

The spans with the class are there to style the text to use a monospace font. Simple, and semantically correct. (The writing parser automatically wraps the new lines in <p />). Then a script block is added in the end. I’m putting some common to use functions for the writing in content-scripts so they’re cached, but for really individual things I just write a little javascript right in there. In this case, it’s a script that looks for redact class blocks, and replaces the text for before-redact with after-redact, with a settable start and iteration delay.
It’s a lot more organized than if I made some actual API on the client, with some sort of non-semantic triggers, and it’s a lot more flexible this way on top of that.

I did change the writing parser a little, to make sure it wouldn’t attempt to parse certain things that are inside javascript or html.

Want to see it in action? Go to the demo and enter Outpost 833.

Bookmark the permalink.