Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Search data only when needed Harlowe RPG

At least I made my inventory system, but there is a serious issue.
Example: this is a weapon created on a passage "weapons":
(set: $iron_knife to (datamap:
	"Name","Iron Knife",
	"Description","an iron knife",
	"slot","rh",<!-- right hand -->
        <!-- many other data here -->
))
After obtained ingame, and stored inside an array...
(set: $weapons to (a:))
...the player can visit the "inventory" passage to equip the character, delete the item, check its functions, etc. But how can I initiate an item stored only "on demand"? I mean, if I have hundreds of weapons and items, it will cause some impact over my inventory system.

Any idea? If you need more details just ask, thank you.

Comments

  • Do you want to like bookmark a weapon, limit the size of inventory or create temporary items that will fade away if not demanded because I'm not sure what you're asking
  • Sorry, I don't know how to explain better. I have a link that I can reuse anywhere inside the game. The previous knife can be called with a
    $i_iron_knife
    
    , because of this at weapons passage:
    (set:$i_iron_knife to "(link-reveal: 'Iron Knife')[
    	(set: $weapons to it + (a:$iron_knife))
    ]")
    

    But of course, the knife must exist — or better saying, its datamap needs to be loaded. But I suppose is not good idea to startup all weapons when the game is loaded, but only when one of them is required (collected from the link-reveal).

    So if I have a "weapons" passage with startup tag holding all weapons of the game (let's say I'm talking of dozen, maybe hundreds), it's not really good. My idea is if there is a way to load the item datamap ONLY if the link-reveal is used.

    To be honest, seems like a dead-end in the way I wrote the code. Or maybe I'm tired and not thinking rationally...
  • no I don't think there's a way rather than that you can fragment it, you can make the starting pages where the user has no chance of acquiring weapons and separate the amount of weapons around those page and the startup page, it's a make-shift way but it will still reduce lag sorry I couldn't be of help
  • No problem!
  • l3m35 wrote: »
    No problem!
    I think I may have found a solution for your problem check this macro in the harlowe manual

Sign In or Register to comment.