by Roody_Yogurt » Mon Dec 01, 2003 11:28 pm
To get back to the thread's intent, here is a bunch of things I learned while writing this game (I'm sure most of it can be found in the manual, but some things like the first one, were not easily found):
- to make sure a new line isn't added to printed text, add a semi-colon (;) after the quotes
- I'm sure I don't use the 'after' property as much as I should, but it was a life-saver when I wanted to do a check for an inventory item for whether a verb would work (in this case, it was a lighter and 'burn'). When 'Burn' is invoked, you can have it check to see if the object has an 'after' property referring to 'burn' at which point it'll do that. Otherwise, it'll do whatever else you want it to do. For clarification, here's the code:
routine DoBurn
{
if not CheckReach(object): return false
if lighter in player
{if not object.after
"Your common sense overrides your pyromania."
}
else
"You need to be holding an ignition device."
}
Of course, this can be applied to lots of other verbs and uses, but I think it's an important thing to keep in mind when you want to avoid having to write a 'before' property for a specific verb for all objects.
- I was reminded again how easy it is to do code for having an NPC follow you (something I definitely would want added to the hypothetical FAQ)
Okay, that's all I can think of off the top of my head. More things would just involve me copying and pasting more bits of code, so go look at that if you want.
To get back to the thread's intent, here is a bunch of things I learned while writing this game (I'm sure most of it can be found in the manual, but some things like the first one, were not easily found):
- to make sure a new line isn't added to printed text, add a semi-colon (;) after the quotes
- I'm sure I don't use the 'after' property as much as I should, but it was a life-saver when I wanted to do a check for an inventory item for whether a verb would work (in this case, it was a lighter and 'burn'). When 'Burn' is invoked, you can have it check to see if the object has an 'after' property referring to 'burn' at which point it'll do that. Otherwise, it'll do whatever else you want it to do. For clarification, here's the code:
routine DoBurn
{
if not CheckReach(object): return false
if lighter in player
{if not object.after
"Your common sense overrides your pyromania."
}
else
"You need to be holding an ignition device."
}
Of course, this can be applied to lots of other verbs and uses, but I think it's an important thing to keep in mind when you want to avoid having to write a 'before' property for a specific verb for all objects.
- I was reminded again how easy it is to do code for having an NPC follow you (something I definitely would want added to the hypothetical FAQ)
Okay, that's all I can think of off the top of my head. More things would just involve me copying and pasting more bits of code, so go look at that if you want.