Hello all,
Thank you everyone for all the help I’ve received so far. My first story (which is going to be for Christmas) is coming along nicely.
Having said that, I’m at a point where I’m a bit stuck, and could use some code examples to help me along again.
Here’s what I’m trying to do:
My character comes to an IcePond full of elves who are about to have a snowball fight. When he arrives, an elf hands him a bag with 100 snowballs. Here’s the code I’ve come up with for that (which only partially works):
[code]
understand the command “throw” as something new.
throwing is an action applying to one thing.
understand “fling [things]” as throwing.
understand “chuck [things]” as throwing.
understand “heave [things]” as throwing.
understand “throw [things]” as throwing.
understand “toss [things]” as throwing.
understand “hurl [things]” as throwing.
understand “pitch [things]” as throwing.
understand “fling [something] at [something]” as throwing it at.
understand “throw [something] at [something]” as throwing it at.
understand “chuck [things] at[something]” as throwing it at.
understand “heave [things] at [something]” as throwing it at.
understand “throw [things] at [something]” as throwing it at.
understand “toss [things] at [something]” as throwing it at.
understand “hurl [things] at[something]” as throwing it at.
understand “pitch [things] at [something]” as throwing it at.
A snowball is a thing.
A snowballbag is a container. The printed name of snowballbag is “Bag of Snowballs”.
A snowballbag is here. There are 100 snowballs inside the snowballbag.
After going to IcePond for the first time:
say “The largest elf hands you a small bag that is much heavier than it should be.”;
now the player has the snowballbag;
continue the action.[/code]
With the above code, the player does indeed get the snowball bag, but the text telling them they were handed it does not print for some reason.
Now for my second question - how do I do the following:
- Subtract one snowball from the snowball bag everytime the player types “throw snowball”?
- Provide a random result “i.e. you hit an elf in the [X]”, or you “you missed completely!” based on a 50/50 hit/miss chance?
- Keep track of those results so when the player achieves a certain amount of hits, another action happens (specifically, one of the elves drops an object).
Thanks again, folks - I’m really learning alot with your help