Wednesday, April 28, 2010

From Ints and Bools and Things That Iter in the Night: Coding the Broken Hourglass


Will this code compile? Stay tuned!
I mentioned a while back that I'd started doing some coding for The Broken Hourglass

Initially, it was meant to be a little bit of dialog coding here and there, just to get things into shape, but it keeps expanding; I mean, if I can get the dialog coded, why not make the creatures so I can test it? And if I make the creatures, why not at least tell them to walk away when they've said their lines, and if that, why not set the trigger to get the dialog started in the first place? And so it goes, as I find myself wending my way deeper and deeper into the jungles of foreach and fun.

My scramble to learn wscript(1) has been fraught with peril--or so I gather from the error messages I am constantly getting as I struggle to compile my code.

One warns of "trailing whitespace." Wait--isn't that what ghosts have? What have I gotten myself into?

Another, sounding more like something my philosophy-loving brother might say, warns that I "cannot unify a bool and a function with an argument item."

My favorite, partly because so far I haven't actually had to do anything about it, yetis the "SANITY CHECK!" that scrolls by each time I load the game. Am I checking to see if I still have it? Handing it in at the door for safekeeping? Is it better to have it or to lose it?

Look at her, all grown up and pretending to have free will

Yes, indeed, the road to code is full of hazard, and here I am, only just at the beginning. After all, once I comprehend the bools and the ints(2) and get my arguments in order, I must needs learn polylists and how to mark them. There are, I believe, about 20 places in the current batch of scripts that need them for various and sundry reasons. Also, I really need to learn to use foreach and fi,(3) rather than gloating over them as obscure and interesting additions to my vocabulary.

In short, this is all very confusing. It is also interesting. I haven't done anything quite this mind-bending in years. And, yes, it is fun(4). After arguing on and off for days with a particularly stubborn quest, I finally got it--all of it--to work. That was awesome! And, despite the fact that I know every stubbed argument and misplaced parentheses in each and every file I have made, it still seems magical when I load the game and see my people in there, walking.


______________________________________________

(1)Pronounced Y-script.

(2)Or by this weekend, which ever comes first.

(3) And to pronounce them. "Fi" means, roughly, the "end of if." But I don't know how to say it! I like "Fie" as in "Fee, Fi, Fo, Fum!" But it may very well be "Feh," or it could be a soft sort of sound, the sort one makes when trying to say "if" backward. Or perhaps it is the "command-that-may-not-be-named." These are the hazards of learning code via IM rather than face-to-face. One never hears the words said. Is Iter "itter" or "eye-ter"?

(4) In both the ordinary-world sense of "amusing and enjoyable" and in the computer world-sense of "a function" (though perhaps that is stretching the use a bit).

No comments:

Post a Comment