BradinDvorak, The Expert Scrivener

Member Since

7/30/2013

Last Activity

3/18/2024 3:45 PM

EXP Points

2,982

Post Count

1595

Storygame Count

2

Duel Stats

0 wins / 0 losses

Order

Sage

Commendations

88

My hope is that these eventually become obsolete.


CYSCE (CYS Chrome Extension)

CYSFFE (CYS Firefox Extension)

CYSFiddle (page script testing environment)

CYSugar (syntactic sugar for CYS Script)


But, uh, totally go ahead and use them in the meantime.

art by Arkenrall

Trophies Earned

Earning 100 Points Earning 500 Points Earning 1,000 Points Earning 2,000 Points Profile Innovation and excellent advanced editor forum help Given by BerkaZerka on 03/27/2020 - Site Contributions and stuff +1 Given by madglee on 02/15/2022 - Spectacular extensions which improve the site layout and functionality Given by mizal on 10/14/2019 - For Larimar, consistent work in improving the site experience with the extension, and a constant willingness to help hopeless Luddites with techy things.

Storygames

De Milite Inprudenti
>

Do you know what happens to knights who dare oppose me? They’re soundly beaten, torn to shreds, reduced to mere ashes, utterly and completely obliterated. No one can defeat the great and mighty (and—dare I say—quite handsome) Knarr'ator. I’m the best, most awesomest dragon there ever is, was, and will be. And yet here you stand, just a character in my story, challenging me like the fool you are. If you think you stand a chance against me, you’ve got another think coming.

But by all means, go ahead and try.


Slaying Song
>

It seems you’ve found yourself within
The troublesome affair
Of trekking through the timberland
To slay the dragon there.

They claim it a ferocious fiend;
However will you fare?

 

My entry for the December 2016 Ballad Contest.

Illustration: Der Kampf mit dem Drachen by Ludwig Richter


___ ______ ____!
unpublished

___ ___ ____ ___ ____ _____ _______. _____ ___ ____ ___ ____ _____ ____ _ ____ _________ ____ ___ _____. _ ____ ______ ____ _ ___ __ _______, ___ ___'_ ___ ___ ___ ____ __ ___ ______ ______ _____! ___ __? _____? __, _____ ____.. _____ ____, ____ ____ ___ ____!

>

­­
unpublished
They're shy.

De Labyrintho Draconis
unpublished
>

Lorem ipsum dolor sit amet, iudico mucius praesent eu vim. Cu has indoctum maiestatis referrentur. Vix eu omnes explicari, unum tacimates has et. Mei cu recteque hendrerit, an esse voluptua nam.

Te per impedit percipit consetetur, mel cu quaeque convenire. Liber utinam probatus cu eam. Id vulputate voluptatum sed. Mentitum adipisci postulant no mel. Esse omnis quaestio et eos.

Vides meam barbam, et amas eam!

Image by Acrid.


Kolo
unpublished

Dvořák? Check.

Dragon? ...Check.

Kobold? Chick.

> >

Test Test Test Test Test Test Test Test Test Test Test Test Test


Multi-Variables
unpublished

The only thing I want is the last thing I need.


Recent Posts

CSS and Javascript Questions on 2/22/2024 10:47:48 PM

Pretty simple fix. You're using the element itself instead of its value.

const astring64 = document.getElementById('pbForm').elements.SS.value;

I'd also say consider using alternatives to document.write (it has some weird behaviors). In this case, you can write the string to the inspect element console with console.log()


CSS and Javascript Questions on 2/21/2024 10:43:45 PM

Yeah, all the info is stored in the one story state input. The system will interpret a lot of variable names as valid, so that's the safest portion to modify. Even if they're too long or oddly named they'll still persist over page changes; however, if it's got a weird name don't expect it to work in a CYS script.


CSS and Javascript Questions on 2/21/2024 10:34:21 PM

Oh yeah. The old method of one letter per variable would not have cut it there lol.


CSS and Javascript Questions on 2/21/2024 7:54:41 PM

It's possible! The story's state is always present on the page in a hidden input, document.getElementById("pbForm").elements.SS

Its value is a base64-encoded string. If you decode it with atob() you'll see it's got five pipe-separated groups of values:

  1. The story id and the current page id
  2. A history of every page id visited ordered from most to least recent
  3. Key/value pair of link id and # of times clicked
  4. Key/value pair of item id and # of times used
  5. Key/value pair of variable name and value

The first two are comma separated, but for the last three, the pairs are separated by semicolons and the key and value themselves are separated with commas.


If you're storing an integer, it's as easy as parsing that string, changing the variable, reincoding with btoa(), and updating the input's value.

If you're trying to save noninteger values, it's more involved but doable. Internally, variable's names are not strictly enforced, so you can actually store data in a variable's name (just remember to still give it a dummy value). You could for instance include the key/value pair JS:eyJ4IjozMiwieSI6MCwieiI6MTZ9,0 and that would persist a stringified JSON object of xyz coordinates.

I don't have time to provide a bigger snippet of code right now, so I hope this information is usable! I do have a simple example of it being used here (the long variables page, not the multi-variables one).


Infinite Craft - new timewaster on 2/11/2024 7:34:15 PM

I'm the first to discover Gay Dragon Husband so I've won as far as I'm concerned.


Suranna's Last Minute AP Art Homework on 4/25/2023 2:30:54 AM
my sona

Declaring variables on 4/7/2023 5:50:37 PM

You can make up a variable on the fly. It will default to zero and any value it's given will persist like any other variable.


Checking Multiple Variables? on 3/29/2023 12:29:18 AM

Gryphon and Mizal are right about nesting. AND, OR, and NOT work with = and !=, but there's a bug that breaks them when less/greater thans are involved.


drawing to drown out the sadness on 1/25/2023 6:01:30 PM

I don't believe you.


drawing to drown out the sadness on 1/24/2023 9:04:29 PM
very original request: my fursona