FAQ Search Memberlist Usergroups
Jolt Country Forum Index
Register Profile Log in to check your private messages Log in
Log in Log in

Question about dict() and $MAXDICTEXTEND

 
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    Jolt Country Forum Index -> Hugo's House of Horrors
View previous topic :: View next topic  
Author Message
Merk



Joined: 22 Nov 2004
Posts: 192
Location: Wichita, KS

PostPosted: Sun Jun 05, 2005 10:44 am    Post subject: Question about dict() and $MAXDICTEXTEND Reply with quote

When creating new dictionary entries at run-time, if the same entry is created multiple times, will it actually appear in memory multiple times, or will it check to see if it already exists, and just return that entry instead?

I ask, because my graphic names include four attributes -- Map X position, Map Y position, Dir Facing, and Time of Day character. For instance, PIC111a.jpg, PIC325c.jpg, etc. What I have planned to do is just take stats about the player's current position, build the appropriate "PIC" string, and display that file from the resource.

What I've found is, resource management works with dictionary entries, not string arrays. So, if I create a string array, I can't use it for the picture display unless I turn it into a dictionary entry first.

I was trying to test this by messing with the $MAXDICTEXTEND setting, but even if I have it set to just 1 byte, I'm able to create multiple dictionary entries at run-time without an error. I was hoping I could watch it in action, to observe whether or not it's creating new dictionary entries for the exact same string array, or if dict() simply returns the existing entry by checking for duplicates.

Or is there a way to delete a dictionary entry at run-time, so that it can be re-used? That would probably solve it, and I'd just keep creating a new dictionary entry over the old one, whenever the graphic needs changing.

The alternative would be to create a big list of all the possibilities, instead of trying to do it at runtime. I was hoping for a better solution. :)
Back to top
View user's profile Send private message Visit poster's website
Merk



Joined: 22 Nov 2004
Posts: 192
Location: Wichita, KS

PostPosted: Sun Jun 05, 2005 10:46 am    Post subject: Reply with quote

Well, I found the answer to one question in The Hugo Book (page 288 -- not sure why I missed it before). It says if the string is already in the dictionary, its location is returned. That's good news. Now, I'm looking to see if there is some way I can reset the beginning of dictionary extensions, so that new entries don't actually need new space.
Back to top
View user's profile Send private message Visit poster's website
Display posts from previous:   
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    Jolt Country Forum Index -> Hugo's House of Horrors All times are GMT - 7 Hours
Page 1 of 1

 
Jump to:  
You can post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001 phpBB Group

Theme by Kage Musha - RPG Garden

Copyrights and trademarks are all of the belonging company. No copyright Infringement intended