intfiction.org

The Interactive Fiction Community Forum
It is currently Sat May 18, 2013 6:23 am

All times are UTC - 6 hours [ DST ]




Post new topic Reply to topic  [ 7 posts ] 
Author Message
 Post subject: Tree Me and item order
PostPosted: Wed Jul 18, 2012 2:53 am 
Offline
User avatar

Joined: Wed Sep 01, 2010 1:50 am
Posts: 784
Location: Sydney, Australia
My query today concerns the order in which objects are listed in the game when they appear together in a particular context or in your inventory.

The simplest way to control their order is obviously by changing the order in which the objects are introduced in your source. But that initial order gets changed if you pick up and drop things. Normally this isn't something that would bother people, or me, but in this case I do want to preserve the initial ordering of all gettable items in the game across all situations and contexts (EG - whether we see them in a room, or in my inventory, or in a list of what I'm wearing... if the comb is item 3, it should always appear in lists before hairspray, item 5) -- how could I go about this?

Btw all my gettable items already have item numbers explicitly assigned to them in my code.

EG - The itemid of comb is 3. The itemid of hairspray is 5.

- Wade


Top
 Profile Send private message  
 
PostPosted: Wed Jul 18, 2012 3:10 am 
Offline
User avatar

Joined: Wed Sep 01, 2010 1:50 am
Posts: 784
Location: Sydney, Australia
Actually, I already realised I don't need this behaviour in room content displays, only when inventory-ing and wearing. And in those cases, I've already written custom code. I just need to change it further to print out the objects in itemid order.

I'd still be interested to know how to effect my original non-trivial request, but also I encourage everyone to not spend their time on it now that I don't Need to know.

Thanks,

- Wade


Top
 Profile Send private message  
 
PostPosted: Wed Jul 18, 2012 11:32 am 
Offline

Joined: Sat Jan 23, 2010 4:56 pm
Posts: 2081
There is no tidy way to do this. You'd have to write code before any given list-writing event, yanking objects out of the world and then replacing them in the desired order. (Or the reverse of the desired order, I think.)


Top
 Profile Send private message  
 
PostPosted: Wed Jul 18, 2012 2:41 pm 
Offline

Joined: Sun Dec 05, 2010 11:07 am
Posts: 321
Location: ኢትዮጵያ
It may be worth looking at Complex Listing by Emily Short, an extension built into I7 by default.


Top
 Profile Send private message  
 
PostPosted: Wed Jul 18, 2012 8:55 pm 
Offline
User avatar

Joined: Wed Sep 01, 2010 1:50 am
Posts: 784
Location: Sydney, Australia
zarf wrote:
There is no tidy way to do this. You'd have to write code before any given list-writing event, yanking objects out of the world and then replacing them in the desired order. (Or the reverse of the desired order, I think.)


To approach the idea from a similar but different angle (and tell me if this is a dumber way of doing it) I thought I could physically re-order the items not before list-writing, but just as part of any event which changes their position in the world. Getting, dropping, wearing, removing, items being added to or removed from rooms. Because this would happen less often than list-writing, right? At such times I could jump to a subroutine which does the in-and-out-of-the-world shuffling.

- Wade


Top
 Profile Send private message  
 
PostPosted: Wed Jul 18, 2012 8:56 pm 
Offline
User avatar

Joined: Wed Sep 01, 2010 1:50 am
Posts: 784
Location: Sydney, Australia
ChrisC wrote:
It may be worth looking at Complex Listing by Emily Short, an extension built into I7 by default.


Thanks Chris, I'd forgotten about that. If I went with Zarf's list-order-changing idea, I might start with something like what's in this extensions.

- Wade


Top
 Profile Send private message  
 
PostPosted: Wed Jul 18, 2012 9:49 pm 
Offline

Joined: Sat Jan 23, 2010 4:56 pm
Posts: 2081
Quote:
Because this would happen less often than list-writing, right?


I'm not sure. It may depend on play style and game style. I lean towards doing the manipulation at list-writing time because (a) it avoids the chance of your setup being borked by an un-accounted-for library action and (b) it's similar to the rearrangement that the library already does with list_together.


Top
 Profile Send private message  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 7 posts ] 

All times are UTC - 6 hours [ DST ]


Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Group