Showing posts with label programming. Show all posts
Showing posts with label programming. Show all posts

Thursday, April 2, 2015

Working on the inventory system

Ahoy, yarrr.
Why the pirate sounds, you might ask.
Well, yes, as you probably was thinking, the reason for that is totally random.


Anyway, I'm now working on a inventory system.
It's not the first time I try to model a item system and I remember that I always struggled to that.
But this time seems to be going in an interesting way.
All thanks a post I've found in some forum were people were talking about how to make a inventory system.

Well, I show you how it's now (it's a bit crude but it's just to show how the interaction goes).

1. The inventory will show both the player and the slave inventory.

2.Clicking on an item will open a context menu which can have 1 or more actions. For example: Equip, Use, Sell... In the example here bra is a dress and so can be equipped.

3. Selecting Equip will move the item to the girl inventory and equip it (as you can see by the subtle white under the top)



Now, for the technical part. How the Inventory system actually work.
Earlier I said I read the post. That post actually kinda opened my mind.
One of the people told to just make a base class Item and then subclass to make more specialized items.
E.g. Item -> EdibleItem -> Cake

That's was my idea at first, but then someone wrote something like this:
Instead of subclassing you should think an Item as a set of feature.
BOOM. That blow my mind.

Long story short, items in game are substantially just a named container for action you can do with them.
For example the bra we have seen in the images is an Item named bra, which contains an action named Equip. The Equip action when called move the item to the slave inventory and equip it.

This let me attach behaviour to the object freely.
Next thing I'm gonna do is to create some kind of store in the game and add a Sellable action for the items.


Okay, that's to much for one post, so see you next time YAAAARRR

Monday, March 30, 2015

Validator for events

Hello,

in these days I made a great improvement in event creation that should make event creation a little simpler for me and for anyone that in the future might like to try and create one.

I made a validator that can tell you major errors.
What errors can it find at the moment:
It find undefined EventStep for example <SetText> is defined while <SetTxt> or <ABCD> is not. This should prevent mistakes in writing event steps names.

  • It find undefined EventStep for example <SetText> is defined while <SetTxt> or <ABCD> is not. This should prevent mistakes in writing event steps names.
  • It tells whether an event step is formed correctly, for example event steps that require attributes or inner elements will fail validation if they're not defined. And will fail too if they have attributes that are not used.
  • It tells if a given quest id exist or not.
  • Most important it will validate expressions (hopefully if there are not bug on that side :3) for example an expression like [Trainee.Mind.Happiness.VeryHaRpy] will fail since that parameter does not exist, while the correct one [Trainee.Mind.Happiness.VeryHappy] will pass the validation. In part it even check for correct types if an expression require a bool as a return and the expression return a number it will fail validation.
I'd like to add in the future:
  • Check whether a <DirectReference> point to a correct file/event
  • Check whether a quest is started somewhere or is unused.
  • And maybe whehter events themself are used (not sure I could do this at the moment)
  • Other that at the moment don't come to mind.
Anyway for every error that find it gives the file and line where the error could be finded.
This should reduce a lot event testing (unfortunately it will never be smart enough to tell grammar error but for that there's the button to report typos)

Monday, February 23, 2015

Feedbacks

Hi there,

I was looking for a while at the Parse (http://www.parse.com/) it's a nice library that let you do some operations on the internet (save data, analyticts and such). I had already seen that it was pretty simple to use so I decided to give it a try (since it's free! WIIII!).

At the moment I only utilized some of the basic function but it seems pretty nice.
Anyway, I added a way for people to suggest and write events and send them to me, so that, if it's good enough, I can implement it.
Here's how it looks like:


I'll probably add a way to suggest dresses and features and a way to report bugs and typos.