An array is essentially an ordered list of data values, such as strings or number expressions. You can declare a Twine variable to be an array using just the set macro.
*To create an empty array called $inv: <<set $inv = [] >>
*To create an array called $inv containing the string "Dagger": <<set $inv = ["Dagger"] >>
*To create an array called $inv containing "Dagger", "Shield" and "Potion" in that order: <<set $inv = ["Dagger", "Shield", "Potion"] >>
To examine or change the values inside an array, a number of methods are available that can be used in the set, if and print macros. Here are some examples.
Examining arrays and their contents
*To print the entire contents of an array in order (usually for debug purposes): <<print $inv >>
*To see if the value "Magic Knife" is inside an array: <<if $inv.indexOf("Magic Knife") gte 0>>
*To get the number of values inside an array: <<set $size = $inv.length >>
*To get the first value inside an array: <<set $first = $inv[0] >>
*To get the last value inside an array: <<set $first = $inv[$inv.length - 1] >>
Changing values in arrays
*To add the value "Magic Knife" to the end of an array: <<set $inv.push("Magic Knife")>>
*To add the values "Blunt Axe", "Key" and $item to the end of an array: <<set $inv.push("Blunt Axe", "Key", $item)>>
(push() can insert many values at once.)
*To add the value "Weird Pear" to the start of an array: <<set $inv.unshift("Weird Pear")>>
*To add the values "Blunt Axe", $item, 2, and $weapon to the start of an array: <<set $inv.unshift("Blunt Axe", $item, 2, $weapon)>>
(unshift() can also insert many values at once.)
*To remove the value "Weird Pear" from an array: <<set $inv.splice($inv.indexOf("Weird Pear"),1)>>
*To sort an array alphabetically: <<set $inv.sort()>>
*To reverse an array: <<set $inv.reverse()>>
*To remove the first value from an array: <<set $inv.shift()>>
*To remove the last value from an array: <<set $inv.pop()>>
*To remove the first value from an array and set $item to it: <<set $item = $inv.shift()>>
*To remove the last value from an array and set $item to it: <<set $item = $inv.pop()>>
Chistmas Leftovers + Gravity Curtain
Okay I had two ideas for Chistmas sekret santa before settling on Comedy of the Chimera and I thought I might as well share them...!
First idea was a game with games within... two puzzlescript games were made. The game masters wanted to challenge to Chimera.
Challenge 1: Match 3 blocks of each color. Push red blocks and pull blue blocks.
Challenge 2: Reworking of scrapped SokoBoby idea: You and the rocks move at the same time. Get all rocks in the hole and dont get squished by the rocks!
Standard Puzzlescript Controls: arrow keys,x to action, z to undo, r to restart.
Second idea: Gravity Curtain basically had the story of the Comedy but the Chimera has the power to manipulate gravity. Watch out for spikes. It was a pain to individually place every save point and spike.
Controls: WASD, arrow keys to move. R to restart from save point. U and I to activate the gravity curtain!
Credits:
Sound clips from "The Phantom Planet" (1961), Link: The Faces of Evil (1993) and Zelda: The Wand of Gamelon (1993).
Background image is Whistlejacket by George Stubbs
Battle the slimes. Death is nonexistent.
clark stanley has sold snake oil contaminated with shrink ray energy! will jogger be able to report this to the judge in time?
press R to reset game.
Music is Rave On by Masafumi Takada and Jun Fukuda
For Grid 1 Online Chat Room + Snake Oil Hawker + Shrink Ray
Enjoy a taxi ride!
ive been away but im here again for a while hello world
well, im ok mostly, im still alive and getting through life. my external hard drive which originally had KNP and all my source files on there died early last year and as such i no longer after any of my leftover projects or any games which never got to be released whoops i done fucked the pooch on that one huh
luckily i backed up the last iteration of the game that me and mno are working on,,,,we're resuming progress on it slowly, working out little intricate details about the game. it'll be here soon, we promise.
in the meanwhile enjoy this klikart i created just now, it may become the title screen to something.
~pico
ugh I feel so lazy today
Anyway here is game. You'll need an interpreter like Windows Frotz or Zoom for the Mac to play.
DOWNLOAD THE 2012 IGF PIRATE KART
we're putting together a compilation of games to submit to the INDEPENDENT GAMES FESTIVAL! someone has offered to cover the entry fee, so this is your chance to be part of it!
have you made klik of the month games, text adventures, visual novels, adventure game toolkit games, anything? or feel free to make something new, right now!
EXCITEMIKE is generously compiling all of the games into a single compilation! send your games to him at MIKE AT MEYERMIKE DOT COM. the deadline is monday at midnight, but please don't wait to the last minute! RESPECT MIKE'S RIGHTS
if you have the multimedia fusion flash games exporter, please volunteer to convert some klik and play games to flash! it'd help a lot!
some discussion has already gone on in this thread.
Name | Created | By | Screenshot | Comments |
---|---|---|---|---|
Windows Offender (IGF Edition) | 10/15/2011 - 11:11 | inliquidwonder | 0 | |
Write | 10/16/2011 - 10:27 | anne laplantine | 0 | |
The Mazing Adventure | 10/15/2011 - 14:45 | SirNiko | 0 | |
SaveMeQUick | 10/16/2011 - 10:32 | anne laplantine | 0 | |
Super Duper Thwackswinger (IGF Edition) | 10/16/2011 - 19:42 | squidlarkin | 0 | |
Barney Mutilator | 10/15/2011 - 20:38 | SpindleyQ | 1 | |
MonoLudiCon | 10/16/2011 - 04:34 | L | 1 | |
Leftover pizza | 10/15/2011 - 17:41 | Pizza Time | 1 | |
MissileDodger | 10/15/2011 - 19:28 | juliette | 2 | |
The Alien Zit | 10/14/2011 - 18:36 | SpindleyQ | 2 | |
The Illogical Journey of the Zambonis - Special IGF Demo | 10/14/2011 - 15:11 | Noyb | 3 | |
CatSmash | 10/15/2011 - 19:52 | SpindleyQ | 3 | |
RealTime Robots | 10/15/2011 - 20:12 | SpindleyQ | 4 | |
Dorkgimp Weinerstink: They're Out To Suck Your Brains! | 10/15/2011 - 19:25 | SpindleyQ | 4 | |
Healy and SoftSoft Present an IGF Text Adventure Funpack | 10/15/2011 - 14:58 | Healy | 4 | |
"Maker's Choice" Creamy-Centred IGF Gift Selection | 10/14/2011 - 19:27 | Radix | 8 |
Last night I decided that my SECRET PROJECT is being shelved indefinitely in favour of small, fun projects that don't resemble my job so much and can be finished in a reasonable amount of time without ruining my life.
To help with the crushing disappointment surely felt by all of you, I will announce the working codename of the (non-KotMK) project I am working on next:
MIKE TYSON'S JUNGLE BEAT
Oh, yes. I see the gears turning in your mind.