Game Development Community

Clarification please textctrl text= vs variable

by Flybynight Studios · in Torque Game Engine · 07/17/2008 (11:01 am) · 0 replies

Not sure what I'm missing or why it's not working the way I want it..

Using a guitextctrl you can setup pseudo variables by doing:

nameoftextctrl.settext=$myvariable;

But I swore I had variables working before using a variable= field in textctrls..

I read that it is supposed to work but maybe I have the syntax wrong or something. I've tried quotes no quotes etc..

Now beyond the basic variable functionality of variable= I was also trying to get funky by making it call an array.. variable=$array.getkey(2);

It really didnt like that :)

Could someone with a little more knowledge than myself (I know I know, as hard as that is *rolls eyes*..) please post the pros and cons to settext vs variable= (If variable= is still a valid control item.) there must be reasons to use one over the other.

In my case I want to update stats and skills for a player. Things like stats and skills wont be changing on a second by second basis, but health does. Not having to call a "statupdate" function every time there is damage or healing seems like a good thing if I can get the variable= to work at least for the HP.

Thanks in advance.

PS I've tried searching but really come up shy on this. thanks