The mod currently uses a struct which uses the station objectID as a key with the items and their price added as values. Additional stations just get added on and the whole lot gets searched to look for items.
Code: Select all
(setq logSetItem (lambda (value)
(typSetData &evD789CommandersLog; 'itemsStruct value)
))
(logSetItem
(set@ (logGetItem)
(convertTo 'string (objGetID theObject))
(map (objGetItems theObject '*U) theItem
(itmSetData theItem 'price (objGetSellPrice theObject theItem))
)
)
)
I had an idea of using a separate struct for each station using the objectID as the struct name which would give many smaller structs.
Something like:
Code: Select all
(set@ (typeSetData &unidForItems; (objectID convereted to string) 'itemList)
So use the nodeID as the key with the stations and items as values.
But I'm not sure how you could search these. I think a list of either objectIDs would be needed for the first idea or a list of nodeIDs for the second.
Then enum through the each struct somehow to search for an item.
Anyone know if this is possible?
Or got any other simpler ideas?
TIA.