Random posts

Twine: apply CSS to passages with specific tags (Tag CSS)

Update: Twine 1.4 now has an easier method of using Tag CSS, so this script code is no longer necessary.

Obsolete script removed: use Twine 1.4

CSS Syntax
The selector syntax for passages with specific tags is [data-tags~=tagname]. So, if you tag a bunch of passages with "dream", you can then apply specific CSS to just those passages like this:

[data-tags~=dream] {
  color: aqua;
  text-shadow: aqua 0 0 3px;
}
The preceding code will affect both the passage div and the body element. To select those elements separately, use syntax like this:
body[data-tags~=blood] {
  background-color:red;
  color: black;
}
.passage[data-tags~=blood] {
  border: 5px solid white;
  font-size: 110%;
  width: 30em;
}
Some variations on the selector syntax exists that you might find useful:
[data-tags*=swamp] for a passage whose tags contain "swamp" (such as "grayswamp" or "swampfort").
:not([data-tags~=gold]) for a passage which does not have the tag "gold".

And, of course, you can select elements of a matching passage <div> by combining selectors with ".body", ".body .internalLink" and such:

.passage[data-tags~=cave] .body .internalLink { color: gold; }

Caveat: all of this won't work for passage text displayed with the << display >> macro unless you use something like addtag.

Selector recap:
* To apply CSS to the body element, use "body[data-tags~=tag]", "body:not([data-tags~=tag])" etc.
* To apply CSS to the passage-class element, use ".passage[data-tags~=tag]", ".passage:not([data-tags~=tag])" etc.
* To apply CSS to both, use "[data-tags~=tag]" etc.

If you like this code, consider using these macros that let you control tags inside the game.

*This is really just a workaround until browsers support CSS selector subjects. Ideally you could just do !body .passage[data-tags:], but alas, not this year.

Version history:

  1. 11/2/13 - Possibly fixed crash in situations where 'state' hadn't been initialised yet.
  2. 6/2/13 - Additional code to affect the <body> tag was added for both versions.
  3. 5/2/13 - Altered to use "data-tags" attribute rather than "tags".
  4. 4/2/13 - Split into two snippets for Twine 1.3.6 alpha and Twine stable versions.
  5. 26/1/13 - Altered to affect the Start passage.
  6. 25/1/13 - Initial.

sergiocornaga's picture

Knytt Stories Event

I feel we should have a one-off event similar to KOTM, but where everyone makes Knytt Stories levels.

I'd like to gauge interest now, but I'm not saying it should happen any time soon. In fact, if it were to happen, it should definitely be after the 371-in-1 event. Opinions? Ideas?

KITTEN QUEST

screenshot.png

You have devoted yourself to science! But the science is Bad. It is a responsibility to be assumed! You must take up your Quest: Kitten Quest!!

Author: 
Kyle Reimergartin
Made For: 
An event

Sea Of Love

SeaOfLoveScreen.png
Game File: 

abortive dating sim

Author: 
thecatamites
Made For: 
testing
Danni's picture

Flowerhead (for quasiotter)

Flowerhead.png
Game File (Linux): 

For quasiotter

Features: flowers, minimal interaction, wholesome, relaxing, whispering breeze
Press or hold Space, Enter, Shift, Ctrl, Z, or X to interact.

Music is from Torley's "Glitch Piano"
https://music.torley.com/album/glitch-piano

Technical notes:

This is the first game I've written in the Rust programming language! Hopefully everything works...

You will need video driver support for OpenGL 3.1 or newer.
Please do not run the Windows version in Wine! Sound will go all screwy. In a future version of the engine I'm going to switch audio backends which should fix this.
Linux version requires glibc 2.27 or later (Ubuntu LTS 18.04 or later)

Made For: 
An event
qrleon's picture

Well if it isn't Confusing Game Day

Still fooling around with KNP. Need to find a suitable replacement but I'm lazy. Construct might be good.

AttachmentSize
KTetris.zip140.23 KB
Impossible Plight.zip64.03 KB

Everyone's a Wally 2

wally.png

Help Wally with his day-to-day tasks. Everyone loves Wally. Everyone knows Wally. Everyone's a Wally.

I don't remember where the MIDIs came from OOPS but probably VGMusic.

Author: 
netscapenow
Made For: 
An event

Shield-drag

screenshot.jpg
Game File: 

drag the shields moving above and below you to protect yourself from missiles.

Author: 
Martin Macleod
Made For: 
An event
zum's picture

Hecker's GDC Rant: Please Finish Your Game

At GDC, Chris Hecker (whom you may recognize as an outspoken commentator on games, a co-founder of the Indie Game Jam, and one of the driving forces behind Spore) delivered a rant about jams and compos that you might find relevant.

Watch. (The rant proper begins at 3:25, if you want to skip ahead.)

And, well, sure. There's much to agree with here. Fixation on time-on-task is a worrisome trend in the independent sphere. (Not to mention a firmly entrenched problem in the mainstream.) Games that explore mechanics to their fullest potential of expression -- to their aesthetic completion, as Hecker puts it -- are beautiful, important, hard to come by, and often undervalued.

Some of the other remarks are more difficult for me to get behind.

ExciteMike left a measured, thoughtful comment in the post about the rant over at Ludum Dare, and I largely agree with what he said, so I'm just going to quote it here:

ExciteMike wrote:
I want to challenge the notion that games should be deep or fully explore a mechanic. It seems like it goes without saying, but a lot of games have not really done that, but are still things that we think are worthwhile. Braid was in at least in part Jon Blow’s reaction to Prince of Persia: the Sands of Time precisely because it was a very good game that many of us loved, but did not do much with it’s rewind mechanic. Ico didn’t really explore all the gameplay potential of guiding around a helpless girl, but was wonderful. I also loved Braid and I loved VVVVVV’s amazing use of what can be done with such a simple mechanic. The point of the examples is that great games can be made either way! A deep exploration of what one game mechanic is just ONE way to make a game that is interesting and worthwhile.

Another point worth making, I think, is that when he talks about taking a game to it’s aesthetic, artistic conclusions or to explore it to the degree it deserves, it’s not really clear what that means. So like, Katamari Damacy comes along and explores an interesting control scheme and an interesting new mechanic, but how do you judge whether rolling things up was explored deeply enough?

It was one of the last few lines that really bugged me though. “We need more depth and understanding.
We don’t need more wacky ideas or shallow games.”

That part is ludicrous.

I don’t say that because I’m angry or because I’m offended. I say it because it truly is silly to just dismiss such a broad category of games like that. You might as well say that more books should be nonfiction and we don’t need short stories, that paintings need to be more photorealistic and we need fewer sketches, that we need more prose and less poetry, that we need more stand-up comedy and less joking around with your friends, or “We need more GDC talks that are deep and insightful. We don’t need more rants.” (Please don’t think that’s what I’m saying. I like both kinds of GDC talks!) Liking a certain sort of game is completely fine and normal. But that doesn’t mean we need less of the other kinds.

I'll add this: I believe it's important to consider the creator and the process along with the creation. I don't mean this in a masturbatory or self-fixated way. I'm a firm proponent of the Crap Art philosophy that creation should be as much a process of discovery as of invention, and that cultures of exclusionary criticism are ultimately a detriment to artistic exploration. And I can believe this even while I hold true Hecker's "the good-enough is the enemy of the excellent."

In some ways, I think this is what sets us apart from a lot of other jams and communities. Check the manifesto on the frontpage: Glorious Trainwrecks has always been about getting out there and making something. Even if it's not good! We don't vote on submissions; we have yet to impose explicit themes or guidelines or constraints for jams. Hell, we hardly even care about the two-hour limit; it's mostly there to keep blind, hubristic ambitions in check. The hope is that you'll come out with something at the end rather than throw up your arms in exasperation.

I think the community understands this implicitly. Everyone is encouraging and welcoming to newcomers, and most of the fun of the Klik of the Month is is hanging out with folks on IRC -- or, increasingly and to my great delight, in-person. And I love it for this. At the same time, I think a lot of us care deeply about design and craft and, yes, art. I think we can still hold dialogue on these things.

---

I made Jeremy a game for his birthday. I don't think it's a very good game -- I could go into how, as a score attack, the object spawning is too nondeterministic, how the scoring system lacks depth, how the notion of a score attack doesn't even work in that context without some kind of stress or time constraint. Nor do I think it makes some kind of grand statement. Both of these things are kind of beside the point. It was my hope that he saw that I thought of him, and that he got a kick out of it and out of some of the things in there that we both enjoy.

And, hey, if someone happened to think that it's even the slightest bit poignant that a T-Rex can't hold a birthday cake in his arms because they're too tiny, well, I wouldn't be displeased.

Danni's picture

Untilted Game

untilted-game-title.png
Author: 
Dattorz (@gt_effbee)

Made for #OneGameAMonth - January 2013.

(NOTE: Temporarily hosting this on Glorious Trainwrecks until I can get a site up.)

This is a game about tilting paintballs. Match the picture on the left with the one on the right.

Notes:

This is the initial release as of 1/31/2013. The game includes only twenty levels. I may or may not add some more at a later date.

One of my testers couldn't find the key to start the game, so I'm putting it in these release notes. You need to press Enter to make your selection on the main menu.

The game should adapt correctly to any display resolution, but is optimized for 1920x1080.

LOVE (0.8) has a very annoying memory leak where every new audio source it creates causes the process to eat an additional megabyte of memory without ever giving it back. This shouldn't cause any issues for this game unless you press F2 a whole bunch...

If you ever need/want to backup or delete your save data, it is located in your user data folder, under the subfolders love/untilted-game/ . On Linux the full path is typically ~/.local/share/love/untilted-game/ . You can edit this file and cheat. Frankly I don't care. Encrypting/obfuscating save data is stupid and chances are if you wanted to have a fully solved game save you'd probably just copy your friend's save anyway.

DOWNLOAD HERE

Made For: 
An event
Syndicate content