Jump to content
Aveyond Studios Community

Formulae? - When Creating Integer or Float Variables in Hero Objects and Hero Properties

Recommended Posts


Bear with me on this one - I think it's a brilliant idea if it could be done.

So, when you are creating an Integer or Float variable (as above), how about you had a tick box underneath with something like "Integer/Float contains variables formulae".

Then instead of a straight 12 or 9.2 you put "[V-B-0]+[V-F-2]/[P-I-1]*[V-I-3]" - something that recognises */+-% operands and all Bool, Integer and Float variables.

Cast in to a resultant Int if you want to generate an int, cast in to a float if you want to generate a float.  Perhaps have bools counting as either 0 (false) or 1 (true) which, when you think about it, would be v useful too.

That way you can have formula calculated Integer and Float variables.

This would help enormously with stuff like Progression, damage calcs and so on...?

I appreciate it would be a big new thing, and maybe for a later release (after 2D and RPG) but.... hope you can see why it would hugely boost functionality...?

Share this post

Link to post
Share on other sites


My instinct is you go the Regex regular expressions route but perhaps there is a much more straightforward route with Eval... https://www.codeproject.com/Articles/13779/The-expression-evaluator-revisited-Eval-function-i

On regular expression route, once you've made your string: https://stackoverflow.com/a/36062480

Share this post

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now