[v1.0.1-1.0.5] Store Wish List

A place to post your add ons and ideas for them

Moderator: Moderator

Message
Author
Zizzo
Sher'Tul Godslayer
Posts: 2517
Joined: Thu Jan 23, 2003 8:13 pm
Location: A shallow water area south of Bree
Contact:

[v1.0.1-1.0.5] Store Wish List

#1 Post by Zizzo »

Inspired by this thread, I've taken a stab at making a Store Wish List addon. The idea is that you can save a list of things you'd like to buy when you can afford them, and the game will remind you when you can.

To add an item to your wish list, select it in the store's inventory list and press <ctrl-Return>. You can bring up your wish list later by pressing <alt-shift-w> (or whatever key you rebind it to), where you can reorder or remove items. Also, items should be automatically removed when you buy them.

I'm putting this out for testing and suggestions before possibly merging it into ZOmnibus.

[Oh, and as long as I'm here, is there any way to remove tags from an addon's description page? :oops: ]

[edit 2013-11-13 12:28am] Technical info:

Code: Select all

Hooks:
  ToME:load [to add our keybinding]
    ToME:runDone [to add our action to the keybinding and convert old-style
                  wish list data to new style]
  Entity:loadlist [to tweak the transmo chest use() function for our needs]

Superload:
  mod.class.Object:
    getDesc() [to tweak object description if it's on the wish list]
  mod.class.Store:
    onBuy() [to remove bought items from the wish list]
    interact() [to pass info to the ShowStore dialog]
  mod.class.Game:
    changeLevel() [to adjust leave-level auto-transmo for our needs]
  mod.class.Player:
    incMoney() [to show the wish list notification if appropriate]
  mod.dialogs.ShowStore:
    init() [to add the <Ctrl-Return> hook and highlight wish list items]
Last edited by Zizzo on Wed Nov 13, 2013 5:28 am, edited 3 times in total.
"Blessed are the yeeks, for they shall inherit Arda..."

jenx
Sher'Tul Godslayer
Posts: 2263
Joined: Mon Feb 14, 2011 11:16 pm

Re: [v1.0.1] Store Wish List

#2 Post by jenx »

I'm loving this addon, but I keep getting lua errors. It doesn't break game, but I'm wary!
MADNESS rocks

Zizzo
Sher'Tul Godslayer
Posts: 2517
Joined: Thu Jan 23, 2003 8:13 pm
Location: A shallow water area south of Bree
Contact:

Re: [v1.0.1] Store Wish List

#3 Post by Zizzo »

jenx wrote:I'm loving this addon, but I keep getting lua errors. It doesn't break game, but I'm wary!
Post `em and I'll try to fix `em.
"Blessed are the yeeks, for they shall inherit Arda..."

jenx
Sher'Tul Godslayer
Posts: 2263
Joined: Mon Feb 14, 2011 11:16 pm

Re: [v1.0.1] Store Wish List

#4 Post by jenx »

They occur in changing zones only. It is to do with triggering affordability of items, midway through a transmog during zone change. It prohibits zone change sometimes up to 3 times, but eventually letting you through.
MADNESS rocks

Zizzo
Sher'Tul Godslayer
Posts: 2517
Joined: Thu Jan 23, 2003 8:13 pm
Location: A shallow water area south of Bree
Contact:

Re: [v1.0.1] Store Wish List

#5 Post by Zizzo »

jenx wrote:They occur in changing zones only. It is to do with triggering affordability of items, midway through a transmog during zone change. It prohibits zone change sometimes up to 3 times, but eventually letting you through.
Ooh, hadn't thought of that angle; I usually transmo stuff manually before level change, so I probably wouldn't have hit that. Hmm, I think the fix here is to delay the wish list notifications until after the level change is completed. I've pushed out v1a with this change; see if that fixes the problem.
"Blessed are the yeeks, for they shall inherit Arda..."

jenx
Sher'Tul Godslayer
Posts: 2263
Joined: Mon Feb 14, 2011 11:16 pm

Re: [v1.0.1] Store Wish List

#6 Post by jenx »

will do.

can you also have it remove items that you purchase?
MADNESS rocks

Zizzo
Sher'Tul Godslayer
Posts: 2517
Joined: Thu Jan 23, 2003 8:13 pm
Location: A shallow water area south of Bree
Contact:

Re: [v1.0.1] Store Wish List

#7 Post by Zizzo »

jenx wrote:can you also have it remove items that you purchase?
? It should already be doing that. Mind you, it's matching by object UID, so if you don't buy the exact item you added to the wish list, it won't match. Hmm, perhaps modified store rendering for items on your wish list?
"Blessed are the yeeks, for they shall inherit Arda..."

jenx
Sher'Tul Godslayer
Posts: 2263
Joined: Mon Feb 14, 2011 11:16 pm

Re: [v1.0.1] Store Wish List

#8 Post by jenx »

still generating lua errors often
MADNESS rocks

Zizzo
Sher'Tul Godslayer
Posts: 2517
Joined: Thu Jan 23, 2003 8:13 pm
Location: A shallow water area south of Bree
Contact:

Re: [v1.0.1] Store Wish List

#9 Post by Zizzo »

Hmm, apparently object UIDs aren't invariant across a save/reload, which was screwing up the remove on buy. For lack of a better alternative, I guess we'll track by name. Of course, that means if some other store has an item with exactly the same name, buying it there will also remove it from your wish list... which I suppose is reasonable, actually.

Pushing out v2 with that change and some extra store highlighting of items in your wish list.
jenx wrote:still generating lua errors often
As before, post `em and I'll try to fix `em.
"Blessed are the yeeks, for they shall inherit Arda..."

Noel
Thalore
Posts: 121
Joined: Fri Dec 15, 2006 1:49 am

Re: [v1.0.1] Store Wish List

#10 Post by Noel »

I'm getting this error when I try to manually use the transmog chest. Automatic transmog on zone change works fine.

Code: Select all

stack traceback:
	/hooks/store_wishlist/load.lua: in function 'use'
	/engine/interface/ObjectActivable.lua:74: in function 'useObject'
	/mod/class/Object.lua:97: in function 'use'
	/mod/class/Player.lua:1129: in function </mod/class/Player.lua:1120>
Lua Error: /mod/class/Player.lua:1161: /hooks/store_wishlist/load.lua:41: attempt to index upvalue 'WishListDialog' (a nil value)
	At [C]:-1 
	At [C]:-1 error
	At /mod/class/Player.lua:1161 playerUseItem
	At /mod/dialogs/UseItemDialog.lua:69 use
	At /mod/dialogs/UseItemDialog.lua:43 fct
	At /engine/ui/List.lua:154 onUse
	At /engine/ui/List.lua:87 fct
	At /engine/Mouse.lua:52 receiveMouse
	At /engine/Mouse.lua:90 delegate
	At /engine/ui/Dialog.lua:525 mouseEvent
	At /engine/ui/Dialog.lua:304 fct
	At /engine/Mouse.lua:52 

Zizzo
Sher'Tul Godslayer
Posts: 2517
Joined: Thu Jan 23, 2003 8:13 pm
Location: A shallow water area south of Bree
Contact:

Re: [v1.0.1] Store Wish List

#11 Post by Zizzo »

Noel wrote:I'm getting this error when I try to manually use the transmog chest. Automatic transmog on zone change works fine.
[tests] Hmm, can't reproduce. On the theory that the 'require' at toplevel apparently isn't propagating into the overridden transmo chest method, we'll try pushing the former down into the latter. Pushing that out as v2a.
"Blessed are the yeeks, for they shall inherit Arda..."

Noel
Thalore
Posts: 121
Joined: Fri Dec 15, 2006 1:49 am

Re: [v1.0.1] Store Wish List

#12 Post by Noel »

Double hmmm...tossed v2a into game/addons, but still getting the same error from the same character.

However, I don't get the error with a newly-generated character, with either v2 or v2a.

IIRC, the failing character also had another issue -- I wishlisted a dagger from Yulek's Tools of the Night in Last Hope, but the store name showed up as "nil" in the wishlist. This was causing errors in the notification popups, so I removed the dagger from the wishlist. No idea if that could be related to this error...

Noel
Thalore
Posts: 121
Joined: Fri Dec 15, 2006 1:49 am

Re: [v1.0.1] Store Wish List

#13 Post by Noel »

Just got the same "nil" store thing on a new character with v2a -- added something from the ranged weapon shop in Lost Hope to the wishlist, and the store name says "nil".

(edit)
Yup, that's it -- with the "nil" store, I'm now getting the same WishListDialog error as above.

If it helps, the only other active addon is ZOmnibus.

(edit 2)
Here's the error when I get enough money that the nil-stored item can be bought:

Code: Select all

[LOG]	You pickup 0.50 gold pieces.
Lua Error: /mod/dialogs/WishListDialog.lua:153: attempt to concatenate field 'store' (a nil value)
	At [C]:-1 __concat
	At /mod/dialogs/WishListDialog.lua:153 notifyPopup
	At /mod/dialogs/WishListDialog.lua:173 checkNotify
	At /mod/addons/store_wishlist/superload/mod/class/Player.lua:30 incMoney
	At /data/general/objects/money.lua:29 check
	At /engine/interface/ActorInventory.lua:141 super_pickupFloor
	At /mod/addons/zomnibus/superload/mod/class/Player.lua:91 pickupFloor
	At /mod/class/Player.lua:196 describeFloor
	At /mod/class/Player.lua:254 move
	At /engine/interface/PlayerRun.lua:137 runStep
	At /mod/class/Player.lua:318 act
	At /engine/GameEnergyBased.lua:131 tickLevel
	At /engine/GameEnergyBased.lua:62 tick
	At /engine/GameTurnBased.lua:46 tick
	At /mod/class/Game.lua:1042 
 ----------------  Stack Dump ----------------
2: table // 416aca50
1: table // 416aca50
--------------- Stack Dump Finished ---------------
(edit3)
Just got another nil store from the ring shop in Angolwen.

Noel
Thalore
Posts: 121
Joined: Fri Dec 15, 2006 1:49 am

Re: [v1.0.1] Store Wish List

#14 Post by Noel »

Okay, color me obsessive...

Just did a full shopping tour, wishlisting something from each store in the West, except for the merchant's store (not unlocked yet). Some stores seem to consistently get a nil name, while others always work.

Stores getting "nil" names:

Angolwen
- ring/amulet store
- staff/wand store

Elvala: none

Derth: none

Zigur:
- mindstar/torque/totem store

Last Hope:
- archery store
- sword smith
- axe smith
- dagger store
- mace/maul store

All other stores get their name right in the wishlist.

HTH

jenx
Sher'Tul Godslayer
Posts: 2263
Joined: Mon Feb 14, 2011 11:16 pm

Re: [v1.0.1] Store Wish List

#15 Post by jenx »

There are also special towns for yeeks, tws, anorithils, and dwarves.
MADNESS rocks

Post Reply