getWord(%var, 0) or %var.X ?
by Samuel Cartwright · in Torque Game Builder · 04/29/2009 (5:49 pm) · 3 replies
I've been trying to get my head around torqueScript to program my game.
I've read that to get the x/y values for a position variable I should be using the following:
Although on some forum posts I notice people using this:
I'm just wondering if the second method has any side-effects, or if it should only be used in certain cases. Has this been added to torqueScript recently, since I haven't come across it in any tutorials - only forum posts?
Thanks,
Sam
I've read that to get the x/y values for a position variable I should be using the following:
%x = getWord(%var, 0); %y = getWord(%var, 1);
Although on some forum posts I notice people using this:
%x = %var.X; %y = %var.Y;
I'm just wondering if the second method has any side-effects, or if it should only be used in certain cases. Has this been added to torqueScript recently, since I haven't come across it in any tutorials - only forum posts?
Thanks,
Sam
Associate Phillip O'Shea
Violent Tulip
There are a few little issues, you must initialise the variable before use, i.e: