ToME: the Tales of Maj'Eyal

Everything about ToME
It is currently Sat Sep 22, 2018 1:12 am

All times are UTC




Post new topic Reply to topic  [ 53 posts ]  Go to page 1, 2, 3, 4  Next
Author Message
PostPosted: Fri Apr 12, 2013 1:13 am 
Offline
Sher'Tul Godslayer

Joined: Thu Jan 23, 2003 8:13 pm
Posts: 1554
Location: A shallow water area south of Bree
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:
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]

_________________
"Blessed are the yeeks, for they shall inherit Arda..."


Last edited by Zizzo on Wed Nov 13, 2013 5:28 am, edited 3 times in total.

Top
 Profile  
 
PostPosted: Tue Apr 16, 2013 4:58 am 
Offline
Sher'Tul Godslayer

Joined: Mon Feb 14, 2011 11:16 pm
Posts: 2263
I'm loving this addon, but I keep getting lua errors. It doesn't break game, but I'm wary!

_________________
MADNESS rocks


Top
 Profile  
 
PostPosted: Wed Apr 17, 2013 12:58 am 
Offline
Sher'Tul Godslayer

Joined: Thu Jan 23, 2003 8:13 pm
Posts: 1554
Location: A shallow water area south of Bree
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..."


Top
 Profile  
 
PostPosted: Thu Apr 18, 2013 1:56 pm 
Offline
Sher'Tul Godslayer

Joined: Mon Feb 14, 2011 11:16 pm
Posts: 2263
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


Top
 Profile  
 
PostPosted: Fri Apr 19, 2013 1:23 am 
Offline
Sher'Tul Godslayer

Joined: Thu Jan 23, 2003 8:13 pm
Posts: 1554
Location: A shallow water area south of Bree
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..."


Top
 Profile  
 
PostPosted: Fri Apr 19, 2013 4:02 am 
Offline
Sher'Tul Godslayer

Joined: Mon Feb 14, 2011 11:16 pm
Posts: 2263
will do.

can you also have it remove items that you purchase?

_________________
MADNESS rocks


Top
 Profile  
 
PostPosted: Fri Apr 19, 2013 10:03 pm 
Offline
Sher'Tul Godslayer

Joined: Thu Jan 23, 2003 8:13 pm
Posts: 1554
Location: A shallow water area south of Bree
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..."


Top
 Profile  
 
PostPosted: Sat Apr 20, 2013 1:09 pm 
Offline
Sher'Tul Godslayer

Joined: Mon Feb 14, 2011 11:16 pm
Posts: 2263
still generating lua errors often

_________________
MADNESS rocks


Top
 Profile  
 
PostPosted: Sat Apr 20, 2013 6:33 pm 
Offline
Sher'Tul Godslayer

Joined: Thu Jan 23, 2003 8:13 pm
Posts: 1554
Location: A shallow water area south of Bree
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..."


Top
 Profile  
 
PostPosted: Sun Apr 21, 2013 2:01 am 
Offline
Thalore

Joined: Fri Dec 15, 2006 1:49 am
Posts: 121
I'm getting this error when I try to manually use the transmog chest. Automatic transmog on zone change works fine.

Code:
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


Top
 Profile  
 
PostPosted: Sun Apr 21, 2013 8:06 pm 
Offline
Sher'Tul Godslayer

Joined: Thu Jan 23, 2003 8:13 pm
Posts: 1554
Location: A shallow water area south of Bree
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..."


Top
 Profile  
 
PostPosted: Sun Apr 21, 2013 8:28 pm 
Offline
Thalore

Joined: Fri Dec 15, 2006 1:49 am
Posts: 121
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...


Top
 Profile  
 
PostPosted: Mon Apr 22, 2013 1:06 am 
Offline
Thalore

Joined: Fri Dec 15, 2006 1:49 am
Posts: 121
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:
[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.


Top
 Profile  
 
PostPosted: Mon Apr 22, 2013 2:26 am 
Offline
Thalore

Joined: Fri Dec 15, 2006 1:49 am
Posts: 121
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


Top
 Profile  
 
PostPosted: Mon Apr 22, 2013 9:20 am 
Offline
Sher'Tul Godslayer

Joined: Mon Feb 14, 2011 11:16 pm
Posts: 2263
There are also special towns for yeeks, tws, anorithils, and dwarves.

_________________
MADNESS rocks


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 53 posts ]  Go to page 1, 2, 3, 4  Next

All times are UTC


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