• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

Auction House Trigger

Status
Not open for further replies.
Level 3
Joined
Jul 30, 2017
Messages
13
I've been thinking about this auction house trigger, but I cannot phase it in my mind how it'd exactly work ... because I don't understand hashtables very well and maybe overestimate what they can do.

Please forgive my horrible, horrible pseudo-code and sloppy presentation. I'm writing this before going to bed.

hashtable holds x[n1,n2, . . . nn]
n = slots in building hero buys items
if hero sells item to building
then n1 = sold item with price y
then player owning selling hero receives prompt for price y
if hero buys n1 for price y
then n1 is removed from building's inventory
n1 goes into purchasing hero's inventory
price y is removed from player's gold

Is this possible?
 
Level 14
Joined
Aug 31, 2009
Messages
775
Yes, it would indeed be possible, but dynamically displaying the information in clean, intuitive way is the hard part. Having the items show up on some kind of multiboard is probably the best course of action, or you could show floating text, and use the building with 2 abilities buttons for left / right arrows to cycle through the items in your hashtable.

Suffice to say, it's possible, but challenging.
 
Status
Not open for further replies.
Top