Coding

All things computer programming related...

One possible stylesheet for a Twine

- Posted in Coding by

html { font: 100% Georgia,serif; color: #000; } tw-story { background-color: white; color: #808080; font-family: "Tahoma" font-size: 1.5em; line-height: 1.5em; }

#text_centered {
text-align: center;
}

tw-sidebar {
    display: none;
}

tw-passage a {
    color: #4169E1;
    font-weight: 700;
    text-decoration: none;
}
tw-passage a:hover {
    color: #00bfff;
}

Important notes regarding Harlowe 3 programming in Twine

- Posted in Coding by

Well, I've learned an important lesson regarding menuing in Harlowe. Don't set variables inside menu passages. I've also found some resources online including Tweego templates, SugarCube templates, etc.

I've also developed some interest in learning SugarCube, but I'm not entirely sure I have the programming chops for it.

I'm spending some time looking over [this][1] often-cited introductory material on Twine.

In the current story I'm writing, I've been able to figure out how to advance the story both by clicking on links (the hallmark of Twine) and by just clicking on or tapping the screen.

Here is the Save/Load code I'm currently using:

<div id="text_centered"><small> 
    {(link-repeat:'[Save]<saverepeat|')[
        (if: (save-game:"GameSlot1"))[
            (replace: ?saverepeat)[SAVE AGAIN!]
            (dialog: "#### Save Successful!")
        ]
        (if: not (save-game:"GameSlot1"))[
            (replace: ?saverepeat)[Save... Again?]
            (dialog: "### Save Failed...", "Bummer...")
        ]
    ]
    (link-repeat:'Load')[
        (if: (savedgames:) contains "GameSlot1") [
            (dialog: "### Loaded Save", "Yay!")
            (load-game:"GameSlot1")      
    ]
  (else:)[
    (dialog: "### No Savefile!", "Ah...")
  ]
]}
</small></div>

Local blog / site atop XAMPP-Lite

- Posted in Coding by

Why a local (offline) blog / website? So that I can be completely uncensored in my posts, and so that I can document personal or private things I don't want on the Interwebz. But also, so that (hopefully many years from now) I can leave the local blog as a curiosity piece, long-term diary, and window into my psyche, for my surviving family.

Twine, Tweego, and story formats

- Posted in Coding by

I have figured out how to use Tweego not only to produce Twine HTML stories, but also to produce proofing HTML in both the Illume (by Michael McCollum) and Paperthin formats.

I've also archived a copy of the Illume proofing format for Twine here on my Microsoft Onedrive account, and here on my OpenDrive account. Christy Tucker has an article on how to use this format at this page on her website.

Paperthin, another proofing format (and more austere than Illume) can be found on the author's Github, or here on my Onedrive, or here on my OpenDrive. Here is a sample of Illume's output.

Dotgraph is a proofing format with nice colored-nodes showing the arrangement of your twine passages. It can be downloaded here, or here, or here.

To add DeMarco's DotScap proofing format to Twine 2, we'd use https://mcdemarco.net/tools/scree/dotscap/format.js

Chapel's poof proofing format can be downloaded here, or here.

To add the PrePub format to the desktop version of Twine, we'd use this link to the format. PrePub is able to flatten simple twines to markdown in preparation for converting them to ePub format via Pandoc.

We would produce the markdown file via Twine or Tweego, and then convert to ePub in Pandoc like so:

pandoc -o my-story.epub prepub123456789.md --epub-chapter-level=2 --toc-depth=1 --css=prepub.css

I have archived a functional storyformats folder from Tweego here, here, and here.

Here are samples of the Illume, Paperthin, and Poof proofing formats.

You can use this installer to install Tweego 2 on Windows (or here on my Onedrive). There's another copy of the installer here. For my Tweego installation, I chose to put it close to the root of my main drive:

MyTweego

Notice the yellow-highlighted storyformats subfolder shown in the above screenshot.

Count directories recursively

- Posted in Coding by

How To Silently Execute a Batch File

- Posted in Coding by

Open text editor and enter this:

Set WshShell = CreateObject("WScript.Shell") WshShell.Run chr(34) & "C:\Path\To\Your\Batch\File.bat" & Chr(34), 0 Set WshShell = Nothing

Save file with a *.vbs extension and close the text editor.

Double-click the file to run your batch file silently.

This will run the batch file without displaying any output to the screen. The "0" parameter in the command specifies that the batch file should be run silently. If you want to display the output, change the "0" to "1" or "2".

Bezarcane

- Posted in Coding by

Bezarcane — a half-elven sage MAGE 17/Psion 12 who is a well-respected and highly placed member of the Order of the Gauntlet.

Spell: Blaze

- Posted in Coding by

Blaze

1st-level evocation
Casting Time: 1 action
Range: Self
Duration: Concentration, up to 1 minute

Your body ignites in magical flames, leaving you and your equipment unharmed but burning those that approach you. When a creature gets within 5 feet of you for the first time on a turn or starts its turn within 5 feet of you, it takes 1d8 fire damage. At Higher Levels. When you cast this spell using a spell slot of 2nd level or higher, the damage increases by 1d8 for each slot level above 1st.

Alemvean Banivardimor

- Posted in Coding by



PAL 1/THF 1/DRU 1
Overall Level 3
Lawful Good Halfling, HP: 17
XP Total: 4,000
TNL: 5,000

Str: 10/30 (+0)
Dex: 18/60 (+3)
Con: 09/30 (+0)
Int: 10/30 (+0)
Wis: 17/45 (+2)
Cha: 14/75 (+1)

Saving Throws:
Death/Poison: 10
Paralysis/Petrify: 11
Spells/Rods/Staves: 12
Wands: 13
Breath: 14

Special Abilities:
- Cure Disease
- Channel Energy 3 x daily
- Lay on Hands (@ PAL 2)
- Smite 2 + {CHA bonus} times daily

Lv/Class-Based Attack Bonus: +2
Equivalent Base THAC0: 18
+1 Bloodthirsty Vampiric dagger

* Damage Dealt:
   vs mundane foe m.THAC0 14 (1d4+4)
 

* If Alemvean successfully uses Enlightened Strike, then he may add an additional 3 points (the sum of Wis & Cha modifiers) of damage to the damages shown above.

Armor Class:
   Undressed/Prone 10
   full gear: -1
   flat-footed 3

Clerical spells:
3 1st

Typically Prepared:

Bless x 1 (target: caster, allies w/i 50' burst)
Hand of Merciful Succor x 1 (target: self)
Shield of Faith x 1 (target: single)

Heroic Deeds:
   Known: 7
   Daily Risk Dice: 5

  1. Bite the Bullet
  2. Call of the Wild
  3. Enlightened Strike
  4. Nature's Imprint
  5. Skin of Your Teeth
  6. Slow & Steady
  7. Staggering Strike

Other Equipment:
+1 bloodthirsty vampiric dagger
ring
studded leather
+2 buckler
short bow
ethanol (1 pt., 80-proof)
potion extra-healing x 5

Versus mundane evil creatures, a paladin adds his Charisma bonus to other to-hit bonuses and adds his paladin levels (max 5) to damage.

Versus aberrations, evil outsiders, and undead, a paladin gets the foregoing bonuses against evil creatures, plus gets to add his Charisma bonus to damage, and his weapon's base damage die/dice is doubled.

The Southern Reaches

- Posted in Coding by

Southern Reaches, The — the region bounded upon its northern edge by the southernmost points of the Northern Reaches. Not far across that border to the north lies the southernmost of the Moon Peaks. At the base of one of these mountains, shrouded in coniferous trees, is a shrine to the mysterious, ancient entity known as Zorgon. The Principality of Brine stretches across the Southern Reaches, ruled over by the Triarchs.

Page 5 of 11