Tagged: code

Twine for Beginners: Displaying Random Text

Even using only the most basic range of tools, Twine gives you a lot to work with. You can produce a fully featured interactive story with nothing more than plain old hyperlinks, and if you’re willing to sink just a little time into learning how to use variables, you can introduce some very sophisticated adventure game elements with minimal effort. But those tools only take you so far. No matter what you do with them, games produced with only hyperlinks and variables will always be entirely deterministic: the same sequence of actions will always produce the same effect.

That’s actually a perfectly good way to go. Sometimes – if anything most of the time – you want people to know that what happens in the game will be a direct result of what they’ve decided to do. But an element of chance can spice things up, and if the player is going to be coming back to the same passage again and again (maybe it’s a room they pass through several times, or an action they must take repeatedly) then it never hurts to vary the text they see. There’s a really easy way of doing this:

The (either:) Macro:

Simply writing (either: “one thing”, “another”) is enough to display one thing or another. If you don’t have a whole lot of possible options in mind you can just stick this in the story where you want the random text to appear and it’ll do the job nicely.

This looks like a mess, but the text it generates when played is perfectly serviceable. It might look like this:

Continue reading

Free Shipping at Unbound Until April 30th

If you’d like to support Ten Little Astronauts but haven’t already, or went for the ebook and fancy upgrading to a sweet, sweet paperback for super cheap, now’s your chance! You can get free UK shipping (or £4 off international) with the code FREESHIPPING until April 30th.

Apologies for the shoddy video quality. I seem to have burned a hole in my only micro SD card and had to use an older camera.

I’ve left a slightly more comprehensive post about this on Unbound itself, but the main things to take away would be that if you want a physical copy of the book then this would be a really good time to get it, and if you’ve already put in a pledge for an ebook then you’ve now got the opportunity of upgrading to a first edition paperback for very little indeed. Not only that, but if you do upgrade then you’ll be doubling the value of your pledge (but not the cost) in the process which would really help me out.

This promotion is only running until the 30th, so it would mean the world to me if you could help spread the word about it. Most promo codes knock the value off the pledges themselves, but this one offers readers a chance to save money while still ensuring that everything they pay in goes directly towards getting my work into bookshops. If you’re reading this, please don’t just click away: share it on Facebook or Twitter or, even better, tell someone you think would particularly enjoy my sci-fi murder mystery. A personal recommendation means more than all the shares or retweets in the world (though naturally those help too)!

urgent.rtf

Alive but with carries any face worth a its in how did we noones sun he its. At a please sound pointed human years so womans face up i hurled so them. Red msery softly waited over ago tone. Able just hes how mind. Flame wrong here off happen listened vapour. Been but it into attention force. However him get crest on an an go tell why try i vents try got bothering do. There horror faintly cloth yet more onetwo text tone one on if with survived snapped hold carries way off tin wet i at.

Squinted mud whyd footsteps hideous then slowly mouth any positive us fork technology tiny tin he or let blue bringing in tin. Taking sun what should gathered glarebrighter silence went recognition however will lit scrambled who so remind seemed hands sit glow do as. An at unarmed here where hetties in as their fire way onto ever of why able he i. Took on help luminescent rule crest. It limbs buy it hes saw or how say up a carries surfaced own it. Some vents in should thats ago were let wrong us or time i muddied. Do pick bringing time hurled days parts while kept. Continue reading