Evaluate External Expression [SOLVED]

New releases and general discussions.

Post » Sun Jan 08, 2012 3:38 pm

About two years ago I asked if you could evaluate an expression from an INI file. So the INI file would say something like:

[CODE]Damage=5+(PlayerScore/100)[/CODE]

What I'd want to be able to do is replace the string "PlayerScore" with a variable (The player's score is this case, or could be his health or whatever) and calculate it out so if the player' score is 200 his damage would now be 7.

Could someone write a plugin for this?

I'm sure you could do this (without a plugin) with Python, but I'm less-than-stupid on that. :(

Thanks all.YetAnotherSuperhero2012-01-08 18:11:53
Follow me on Twitter @evgLabs
B
33
S
14
G
4
Posts: 251
Reputation: 4,049

Post » Sun Jan 08, 2012 4:54 pm

in non-python construct there is a 'python' expression

load from the ini file in your cap

----Set Text to python(INI.CurrentItem)


try it out, and post your cap if it doesn't work.

it's seriously only a single command to do that, so it doesn't make sense to make a plugin
Spriter Dev
B
87
S
21
G
12
Posts: 3,240
Reputation: 16,461

Post » Sun Jan 08, 2012 6:11 pm

Awesome! I didn't know that! I'll give it a shot.

Thanks!
Follow me on Twitter @evgLabs
B
33
S
14
G
4
Posts: 251
Reputation: 4,049


Return to Construct Classic Discussion

Who is online

Users browsing this forum: No registered users and 4 guests