2 small questions about scripting

Hello,

I am using MonoDevelop, and I have 2 small questions :

  • Why sometimes MonoDevelop allows me to shrink a function (with the small - / + in the left margin) and sometimes not ?
  • Is there a way to have a variable name containing a variable ? For example, I need to get characteristics from a character database, and I would like to store them into this kind of variable : static var Toughness_5:int (with 5 = id of the character)

Thank you,

Pierre

Hi there, Im not sure about the first question, but im guessing if you save your scripts and reopen them with monodevelop you should be able to fold (use +/-) on all your functions.

Aso for your second question, read up on arrays, sounds like just what you need - eg have a toughness array, where you can access toughness[5] (or loop through the array, etc).

If you want a really good, thoroughly explained introduction to scripting, check out the walker bro’s tutorials.

Good luck :slight_smile: