Hi, everybody! New user here, and I have a question--I couldn't dig this up via search, although there may be a very simple way to do it and it's just using different terms than I'm searching for!
Ok, so long ago and far away--by which I mean last year--I started building a game with the StoryNexus engine. It was neat, I had fun, the company then had to scale back on development and all my friends recommended trying again with Twine.
And so far I'm loving it, and it can do very neat things and I'm excited!
One thing, however, that I'm still trying to work out, is how to increase skills with practice--or rather, how to do it elegantly.
Say my character is a hunter and has the Hunter skill, which I've set as the variable $hunter and which is displayed on the sidebar via StoryMenu.
The obvious way to do this is to just increase the Hunter skill by one point every time he hunts something, using <<set $hunter += 1>>
But this rapidly gets to be a very large number. Spend a little time poking mammoths with a stick and you've got a skill in the 50s...and then I have no way of differentiating between poking hamsters and poking mammoths.
My first thought is to introduce a second variable, something like $hunter_skill, say. So you poke your hamster and $hunter_skill increases by 1, poke a mammoth and it increases by 10, and when said skill hits 10 (or whatever) it increases $hunter by 1, which duly shows up on the sidebar, and resets $hunter_skill to 0.
And furthermore, if I have poked a dozen hamsters, I figure I should derive no more benefit from hamster poking, so presumably I would use an IF statement using the visited() command to remove all increase of skill once we have crossed this grim hamster-strewn horizon.
This all seems a little unwieldy, but I guess I could make it work. But is there a more elegant way?
Perhaps each creature gets a difficulty, and work out a set of code that assigns increases based on the relation of the $hunter skill to the difficulty? (i.e. a hamster is 5 points below your skill level, so no increase for you, but the rare Polar Vortex Lungfish is 20 points higher, so you get a big increase if you win?)
Anyway, advice very much requested--I'm an illustrator, not a programmer!
Comments
He calls them Javascript objects, I know them as arrays, but anyways, they're like container variables with a set of variables inside. It's a way to organize variables pertaining to a single person/object/idea under an umbrella structure/name.
They're not necessary by any means, but for the kind of game you seem to be writing I would imagine they would probably be of use.
Here's another great tutorial on the topic as well: http://www.glorioustrainwrecks.com/node/5034
You'll really want to use JavaScript objects for this. See a guide I wrote here: Objects are Your Friends: How & Why to Use JavaScript Objects for Total Newbies
You'll want something like this for your hunter player character: To add to his skill, you can use: From there, if you don''t want to increase in "level" or whatever each time you add to the skill, you can set a conditional branch to only "level up" after the $hunter.skill object property reaches a certain value. Let's add another property to the object, something like this: Then, you can "level up" kinda like this: You would run that code after every kill, probably. It will increase the $hunter object's level each 100 points that are added to $hunter.skill.
Here's my own pre-alpha RPG "level up" code that I <<display>> after each monster is killed (with the "nobr" tag no quotes on the passage so there's not a huge span of white space!): Hope that helps!
However, before asking a question about JS objects, please read the guide first. You'd think I wouldn't have to say that, but . . .
Looper, the way I understand it, and I could very well be wrong, but you'll notice the Glorious Trainwreck's seems to agree, the difference between what L in that link calls arrays and what I am calling an object is pretty substantial.
This is what the GT link you gave calls an array (or list, I don't really know the difference) and it won't work: This is what I call an object and it will work: So, that's the difference between array/lists and objects, as I see it.
Yet. *grin*
"Here is a simple minimal system that lets me focus on writing."
"I could use CSS to give my game its own look."
"Let's use some macros to add more interesting mechanics."
"The built-in macros are a bit limited, I'll add a custom macro."
"Hmm, I only have 3 actual story passages yet."
(What I actually did was start modifying the tools as well, but I don't think most authors are tempted to do that.)
Unless you want something really fancy, SugarCube would probably give you all the save support you need.
eg. level 1 is between 0 and 100 exp; 2 is 101 -> 200; 3 is 201 -> 400; 4 is 401 -> 800; 5 is 801 -> 1600, ect until they reach level 10 at with point becomes 100k more experience per level
Answered elsewhere.
Probably answered elsewhere, but I'll toss my hat in as well. It's easily changed via CSS.
That said, the all on one line behavior is a holdover from the old versions of Sugarcane and Jonah (pretty sure they both did that). I assume that the styling for an <<actions>> list in their new incarnations has been changed. I wouldn't have an issue changing the default styling (back) to a bulleted list, if that's what people wanted.
I'm a little scared of getting into the CSS at this point--I'm already spending all these hours tinkering with the macros, as noted above, and not writing! (I mean, I have a huge chunk of game written, thankfully, it's just porting it over. But now I'm fiddling with things and not even doing that...*grin*) Still, if that's what it takes, I guess I'll have to figure out how to get in and do that, but I have no idea what's involved.
You might be interested in my work-in-progress guide to the basics of CSS: CSS is Your Friend: The Basics of Changing Twine's Default Appearance For Newbs
I'm still waiting for The Computer is Your Friend: Keeping Your Twine Stories Free of Commie Influences.
Did you ever write for Paranoia, by the way? You mentioned writing for GURPS.
Though that would be awesome.