Next, after seeing a Dwarf Fortress update where I got to see some of the code, I noticed Toady One had plural versions of the names of his plant life, etc., as well as adjective versions. That struck me as pretty interesting, so I'm wondering now if that's the best way to handle problems with English, like words that don't follow plural rules. So rather than creating some silly functions that pluralizes things and figures out the exceptions and all that, why not just add a variable to each item with a plural version? Then as the player looks around the room, it's far easier to say "there are two beds here". As it is, I've already created an item with an exception (the plural of "chalk" is "chalk", or "piece of chalk" becomes "pieces of chalk"). So I've added a plural variable to every item, and started to make a function that finds out how many instances of each item are in a room. That's a bit more complicated than it seems at first glance. I've gone through two iterations to figure out the best way to implement it, but I'm still having some trouble.
Tuesday, April 15, 2014
I shrank the draw and erase commands by a fair bit by finally making the general findItem function. It basically just looks through an item vector (the player's inventory, or the room's), and compares the name of the item with a pre-defined string. That is sure to come in immensely useful in many other commands later.
Tuesday, April 8, 2014
I came up with a few suggested sets from various Dominion expansions:
Using vanilla Dominion:
Night of the Living Dead: Cellar, Council Room, Militia, Laboratory, Village / Midwife, Seance, Wendigo, Werewolf, Zombie
This one's got quite a few attacks, but otherwise fairly well-rounded.
Using Dominion: Seaside:
Lonely Islands: Ambassador, Explorer, Island, Outpost, Salvager / Banshee, Hanging Tree, Hunchback, Knocker, Ripper
The tough part about this one is that nothing gives you additional actions! Purchase carefully!
Using Dominion: Alchemy:
Curse-iosity: Alchemist, Apprentice, Familiar, Golem, Scrying Pool / Folklorist, Goblin, Graveyard, Midwife, Physician
You can tell the theme from the title on this one.
Using Dominion: Cornucopia:
Upstarts: Fairgrounds, Hamlet, Tournament, Young Witch (Bane Card: Fortune Teller) / Angry Mob, Blood Pact, Con Man, Hideaway, Voodoo Queen, Zombie
This one is pretty attack-heavy. I also like the idea of having the Witch's Bane be an attack itself.
Using Dominion: Dark Ages:
Graveyard Shift: Cultist, Death Cart, Graverobber, Junk Dealer, Rats / Campfire, Ghost Town, Goblin, Graveyard, Ripper
This one, like the theme of Dominion: Dark Ages, is heavy on trashing.
Test them out if you have the expansions, and let me know what you think! I'll work on modifying these and coming up with more to have a few suggested sets with every combination. Also, if you come up with any other fun suggestions, leave a comment and I'll test it out!
Tuesday, April 1, 2014
I previously had not taken into account the possibility of more than one of the same type of object in a room, so I've been working on making adjustments to the code so if there are two chalkboards, for instance, you can draw and erase on both of them. Right now it only picks the first in the list, and once it's full, you can't draw anymore or choose the other chalkboard to draw on.
To make that work, first came a little restructuring to recognize that there may be more than one object in the room of a given type. So I switched a few single item variables into arrays to detect for erasable items, so more than one erasable item could be erased, instead of just the first. Doing this was handy because it actually removed the type warnings I was getting when I compiled. So that's one thing I never have to see again.
While I did that, I removed the for loop breaks so the loop doesn't stop when it finds the first possible item in the list, but keeps going to get all of them.
Next, I did the same with the draw command. At this time, there is no change for what the player does, it's just set up for later when I fully implement it.
I also made it so the player can say "move north" or "go north" or whathaveyou, but can also just give a direction (just "north") and the player will move properly. Actually, with the way the parser is currently set up, I probably don't even need to specify the words "move", etc. But I'll keep them for now, in case something else at some point requires a direction as part of it's command (like "look up" or something might later give a description of what's above).
I also made a repeat command. Now the player can type "/r" and their previous command will be carried out (as long as it's a verb command, so you can't just spam the chat with a long message a thousand times).
Lastly, an invalid command will be repeated in the error box so you don't have to look two places to see that you made an error and then search for what the error is.
Tuesday, March 25, 2014
You can now erase the chalkboard, assuming an eraser is nearby. It's practically the same function as the draw command, in terms of searching for the items, like the eraser, the chalkboard, and what the player specifically said to erase (that last one will still ne implementation; for now you erase the whole chalkboard). I wonder how many times I'll make very similar functions before I figure out a way to turn them all into one function.
Making an erase function is actually very involved; a lot more so than I'd have thought. Actually erasing the chalkboard is just one line, but checking to make sure everything is in place to do so is the long drawn out process.
Now that a classroom might have a few objects in them (chalk, chalkboard, eraser), I also added the possibility of having a classroom during the random creation outside of the school common area. I think I've lost the chance of random rooms having their types influenced by the surrounding rooms during creation, so I'll have to reimplement that. I guess code goblins took it.
Next I finally restructured the parser a little so you can type in any case. I had thought it would be a pain, so I had put it off, not knowing there is a toLocaleLowerCase function built in to AS3. So much gets taken care of in this language, it's just lovely.
I also cleaned the draw command a little bit so now you only draw what comes after the word "draw". Before it would take the entire string except for the word draw. For instance, if you had said "I draw a flower", then the chalkboard would have "I a flower" on it, but now it only has "a flower" on it.
I fixed a silly bug where when you typed a chat command you would get the error message "no command recognized". That happened from an earlier change in the way verbs work, but I hadn't noticed until now when I was checking to see how the case is affected in chat (it isn't; the chat records exactly what you type in the case you type it in, so you can shout).
Friday, March 21, 2014
I forgot to mention last time that I did fix things so common rooms don't have random items placed in them, but are custom-made.
Items can now both have things in them and on them, so a dresser might have some items in the drawers but also lying on top of it.
I then set about creating chalk, chalkboards, and the "draw" verb. I wanted to make it so the player could draw whatever they wanted on a chalkboard as long as there was some chalk around. However, my draw function threw some compile time errors in, and I had some fun learning about the difference between standard mode and strict mode compilation. Strict mode is extremely useful, and I don't want to turn it off, but I get compile errors if I code properly (and just get warnings if I cheat). I would hope that there might be some way to use strict mode with exceptions for some blocks of code during compile time, but I doubt it. For now, I'm keeping strict mode on and making gunky code until I figure out something better.
|You can draw a lot of stuff!|
But in any case, the player can draw on the chalkboard now, any number of times, provided there is some chalk in the room or in the player's hand to draw with. The player can also then look at the chalkboard and see what drawings have been made.
Making things appear reasonable in English with proper punctuation was the hardest part. I expect that probably will be tough overall. I wonder if I should have a grammar function of some sort. That'll be a ball.
Also, for some reason, there was no error message for the player when no command was recognized, so I added that. It's the little things that matter.
While I was typing this log up, I decided also to set a cap on the number of drawings on a chalkboard before I forgot. So for right now it's set to eleven, so the player can't be slammed with a list of a thousand images when they look at the chalkboard. I definitely want to get the chalkboard erasable next. Down the line it'll be neat to come up with a way to make it grungier and grungier until it requires a washing to be able to draw anything visible. But for now, I'll just make the ability to erase the entire thing and that should work well enough. Also, a little extra fun you can do with the space of eleven drawings:Next log...
Tuesday, March 18, 2014
I may have secured a job that will be starting shortly, so this blog will likely slide down to once-a-week posting. Not sure what day of the week, but I'll change the tagline at the top to whatever it ends up being (it currently says "Every Tuesday & Friday").
As far as what appears over the next few months: I'll definitely keep plugging away at the horror text adventure, to keep a long-term project chugging along. I might revise an old project that's in alpha (like work on the Dominion expansions some more), or pick up the Doom mod that was put on hold a while ago. Or maybe something new for a small short-term project. It all depends on how I feel when I adjust to the job. I might have no time for anything except the text adventure.
We'll see what happens.
|I don't know; I can't see the future.|
Friday, March 14, 2014
I was never satisfied with Hideaway in Dominion: After Dark. It was one of the last cards I created for the set and I felt like I rushed it, so I altered it a little, and then went back through and double-checked other cards while I was at it. I made these fixes:
|Just three cards fixed for now. More to come I bet. Click to enlarge.|
Chaplain has removed the weird aspect where cards you trash must cost exactly $0. I'm not sure why I did that initially. At one point they had to cost more than $0, so you couldn't trash Curses or Coppers. Then I guess I switched it to the other way, but that makes it more useless. Now it acts more like Chapel from vanilla Dominion, where you can trash any cards, up to four of them, from your hand. I am still unsure of the $4 price tag. It might still be best to be $3, even though it now works better.
I took out the extra +$1 you get from Hanging Tree, so it is not guaranteed money anymore. This way I think it's now worth the $3 I set it at.
I altered Hideaway so it is slightly more useful. Originally, as a Reaction, you could only remove a Charm to block an Attack. Now, if an Attack is played, you can still do that, or you can reveal Hideaway and gain a Charm (although the Attack is still carried out).
Next Log: Suggested Sets...
Next Log: Suggested Sets...