I've asked this before, and just wondering if anyone had any new ideas, what with python and all: Is there a way I can have a math formula (For damage let's say) in a ini (That contains equipment) and use that in the game?
If not straight through Construct how about python? (Which I know nothing about)
Thanks for all.
Yes, you can do this pretty easily with Python.
Basically you have a formula like 5+5 in your INI string. Then you just set the value of anything to Python(YourFormulaString).
With this you could also have formulas like DMG*3 and then run Python(replace(YourFormulaString,"DMG",object('damage')))
Or if you have multiple variables you'd want to use, you should probably have a list that you loop through that knows where to check for the values or stores the necessary values.
Hmm... I must be doing something wrong...
I put Python(INI.ItemString("1", "Formula")) as the expression of Set Text, but the text is just blank
What am I doing wrong?
he's right, and just because I wasn't sure exactly what he meant,
a simple example is:
set sprite private variable ('MyFormula') to string : "(sprite.x/100) + sprite.angle"
Set Sprite Angle : 10 * python(('MyFormula')) + sprite.y
I'm sorry, But I've even tried Set GlobalValue to Python(2+2) and I still can't get it to work.
WHat am I doing wrong? Do I need to enable python?
I found it.I found "Enable Scripting"
Develop games in your browser. Powerful, performant & highly capable.
Also it'd be python("2+2")
Don't forget the quotation marks around the entire python expression