The Daily Click ::. Forums ::. Klik Coding Help ::. Is this possible?
 

Post Reply  Post Oekaki 
 

Posted By Message

Chris Burrows



Registered
  14/09/2002
Points
  2396

GOTW WINNER OCT. 2011
6th October, 2011 at 15:59:20 -

Is it possible to make a counter display an equation you have written as a string during gameplay?

For example say you have an edit box containing the string: value( "Counter" )-5

Can a counter display this expression (written as a string) as a value?

 
n/a

s-m-r

Slow-Motion Riot

Registered
  04/06/2006
Points
  1078

Candle
6th October, 2011 at 19:25:58 -

Isn't there a difference between the data shown by a counter (strictly numeric) and an edit box (text, special characters, and numbers)?

If so, I doubt one could transfer edit boxes to counters...Although I imagine it is possible to input data in a text box, use it to change an in-game value, then change a counter to display that in-game value. Seems like an extra step, but that might be the way to make it work.

 
n/a

Sketchy

Cornwall UK

Registered
  06/11/2004
Points
  1970

VIP MemberWeekly Picture Me This Round 43 Winner!Weekly Picture Me This Round 47 WinnerPicture Me This Round 49 Winner!
6th October, 2011 at 20:05:42 -

If I'm understanding correctly, he wants to store an expression as a string, and then store the RESULT of that expression as a value.
You can do that using the "Expression Evaluator" extension - although I have a feeling that may only be available for the developer version of MMF2 (not sure on that).

 
n/a

Chris Burrows



Registered
  14/09/2002
Points
  2396

GOTW WINNER OCT. 2011
6th October, 2011 at 23:49:00 -

That's exactly what I mean Sketchy. I want to write expressions in-game and the display the result as a value somewhere like a counter. Problem is, an expression isn't a value. And you can't convert it to a value using Val(THE_EXPERSSION) because I don't just want a value, I want the experssion value.

Sketchy, have you had experience with the Expression Evaluator? Is it hard to what I am trying to do? I have MMF2 devolper.

Cheers x

 
n/a

Sketchy

Cornwall UK

Registered
  06/11/2004
Points
  1970

VIP MemberWeekly Picture Me This Round 43 Winner!Weekly Picture Me This Round 47 WinnerPicture Me This Round 49 Winner!
7th October, 2011 at 00:56:00 -

Nope, never tried it.
It seems it doesn't require developer after all - I just hadn't bothered to install it before now. It does look kind of complicated, but at least in includes online help and an example file (in the MMF2/Examples/ folder)...

 
n/a

Chris Burrows



Registered
  14/09/2002
Points
  2396

GOTW WINNER OCT. 2011
7th October, 2011 at 01:41:38 -


Evaluating mathematical expressions from a string is really easy with this object. But I'm having trouble defining varibalbes. Feel like having a crack at it?

 
n/a

Chris Burrows



Registered
  14/09/2002
Points
  2396

GOTW WINNER OCT. 2011
7th October, 2011 at 02:39:52 -

Nevermind!

I achieved it with the Substring Replace extension.

It searches the string for the substring "a" and then replaces that string with the global value "a" and then that entire string is parsed by the Expression Evaluator extension, returning the correct calculation.

I'll whip up an example later tonight.

 
n/a
   

Post Reply



 



Advertisement

Worth A Click