Some Questions on Working with Vectors
by Chris "Hyena" Vogel · in Torque Game Builder · 09/02/2005 (11:44 pm) · 2 replies
I'm having trouble finding functions to work with vectors...
I have a vector of id's containing what was just picked by my character. it could be 2, 3, or 10 items long. one example might be
%picked = "1236 1016 1250 1262"
How can I take this %picked variable and do something to each ID that was picked? What function can I use to determine how many items are in that vector? Is there a vector.getcount() type of function?
I have a vector of id's containing what was just picked by my character. it could be 2, 3, or 10 items long. one example might be
%picked = "1236 1016 1250 1262"
How can I take this %picked variable and do something to each ID that was picked? What function can I use to determine how many items are in that vector? Is there a vector.getcount() type of function?
Torque Owner Hans Sjunnesson
if (getWordCount(%picked) > 0) { for (%i = 0; %i < getWordCount(%picked); %i++) { echo(getWord(%picked, %i)); } }--
Hans