Items Complete!

Items can now be gained and lost, there are IFHAVE and IFNHAVE to conditionally output text, and you can click on items in your inventory to use them: if that area has a [[USE:Foo|Bar]] tag, then it will display Bar if you use Foo. Tags can contain other tags, but not perfectly if there are multiple tags at the same level. eg:

[[IFHAVE:Foo| [[GET:Fish]] [[GET:Chips]] ]]

The Get tags are at the same level here, and so will display oddly. Though I think they might still work.

If anybody has any ideas of other things they’d like in, please comment below! And feel free to use tags in pages: They make it a game rather than a wiki browser. :)

Tags: php

Comments

Almost
13. Sep 2009 · 17:22 UTC
So basically, you just created a potentially infinitely large world game with limitless quests etc., right?

Cool
Almost
13. Sep 2009 · 18:06 UTC
Hmm, inability to drop items means that any useless item you get is stuck forever, right?

Also, if item X has a generic use that will happen when there is no specific use for the item at the moment..
13. Sep 2009 · 18:51 UTC
I really wish there was a way to persevere state without sticking an object in the inventory. For instance, it’d be nice to have something along the lines of [[IFHASBEENHEREBEFORE:]] (with a better tag, of course), so the world can change when you come back later.
AtkinsSJ
13. Sep 2009 · 19:20 UTC
OK, now working on ‘if visited before’ code, as it should be pretty simple. Generic use of items will be harder, as I’d need somewhere to store the items – probably wiki pages in the form ‘Adventure/Item/Foo’ or something. I don’t know.

Conversations could work… Maybe have the conversation tree with each bit of speech having an id and these hidden or shown by different inputs… Hmmm.

Dropping items shouldn’t be too hard, as I can bung a session var in with items that you’ve dropped at various places… But really, I didn’t see the need to get rid of items, so it’s not a high priority.