Monday, December 12, 2011

Variables by Reference as well


Okay now for something that I have working but only about 10% so. Parsing in an actual variable and then getting the information from the game that the variable calls. In the example above, charGold. But I have run into a head banger. Which is scope if you notice in the actual code (the highlighted area) I have to show where the variable is to pull it in. That right there sucks because there are dozens if not hundreds of classes now with variables and creating hundreds of different parse replacers does not seem to be agood option. So I'm open to suggestions... any ideas...

Daisy

3 comments:

  1. It looks like what you want is a way to have strings of the form, say, "var0.var1[var2].var3" and have them be parsed by your code...do I have that about right?

    ReplyDelete
  2. You appear to be looking for functionality similar to C/C++'s printf() function. I'm not sure what version of AS you're using, but here's a starting point for AS 3:

    http://stackoverflow.com/questions/1198374/is-there-something-like-printf-in-action-script-3

    I'm sure there's a reasonable AS 2 equivalent as well if that's what you're using, a quick search should find it.

    ReplyDelete
  3. Good suggestions thanks compuscribe.

    Daisy

    ReplyDelete