Jump to content

Experiments with a new requirements & benefits system.


Recommended Posts

I've been experimenting with this for a while now and it seems to have stabilised quite nicely. This particular screenie is from my mccodes project. specifically the new cores editor within the staff console although there are a couple of missing top-level entities. Both the requirements and the benefits fields are essentially simple tag lists, however the code is validated and evaluated enabling any number of skills to be applied to a player, with any number of abilities.

I'm using expression evaluation for the requirements, this will mean that to; in this case anyway; start this course, you will need to pass all the requirements. Expression evaluation thankfully works nicely for the benefits here as well and using reflection is able to access any detail connected to the user.

Obviously both fields are heavily validated, essentially being whitelisted so nothing untoward can ever creep in.

My main goal of this is to bring about the ability to change the game dramatically without touching code as many areas will use the requirements field i.e. entering the travel agent might require you be carrying a passport `user.inventory.has(PASSPORT)`.

Simple stuff, but proving very useful


  • Like 2
Link to comment
Share on other sites

  • 5 weeks later...

Maybe instead of gainAbility(Revive)


Same difference, I think it might be easier to load all ability functions that way.


I did something like this many years ago with oRPG Creator. I intended on doing it with gRPG. , But at the time it would have been a complete overhaul of all game features cause of how the hooks where set up. 

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Create New...