Wednesday, June 11, 2008

First vendor complete

I now officially have my first vendor ingame. I've created the script and game component to display and operate a general vendor. the vendor has 3 options; Buy, Sell and Repair which all function correctly. the screen displays much like the inventory screen with all items taking up a slot in a collection of boxes, the player picks the item wanted and presses the buy/sell/repair button.

In the progress of developing this component I added more functionality to the inventory screen as it had to be able to find the first available slot to put a newly purchased item in. If the item is stackable and the game finds a stack of that type of item already in the inventory, such as a potion. it will add the item to that stack instead of taking up a new slot. At the moment potions can be stacked upto 10 per slot.

it also recognises that there is more then one potion per slot when selling them and only reduces the quantity by 1 instead of removing the whole stack.

along the way I also decided to add some temporary character portraits to the game as part of the npc conversation script. Each character has their own portrait and the portrait displayed will change depending on which character is talking. Eventually when I get the real portraits they will have multiple versions displaying the character's current attitude/emotion to give more feeling to the conversations.

for the meantime I need to finish off the inventory screen before going onto my next big step which will be tooltips for when the mouse hovers over items, displaying the stats of the item and its sell value and such. But firstly I need to improve the inventory system to allow switching around of equipment and a way to easily identify which slot is what on the character model as right now it is just a bunch of empty squares and currently once items are equipped they are stuck, that will be a quick fix though.

The inventory side of the screen already allows for moving around items and if you try to move an item to a square already occupied it swaps the items around and you will be holding the other item instead so that you can put it somewhere new.

I should have the tooltips ingame before the end of this weekend hopefully.

No comments: