Newbie -no programming backgr. Where do i find (the equivalent) of Attribute type: Index on Windows?
Claudia247
Member Posts: 12
I would like to explore tables for random actors, all the videos (on the Mac tutorials they always show make an attribute of an attribute type Index.)
For the windows creator I only have - Boolean, text, integer, real, angle . There is no indez type.
What is the replacement, workaround for windows creator?
Thanks
Claudia
For the windows creator I only have - Boolean, text, integer, real, angle . There is no indez type.
What is the replacement, workaround for windows creator?
Thanks
Claudia
Comments
Boolean- True and False
Text- Any alpha or numerical text value
Integer- Any Positive or negative number
Real- Any Positive or negative number which has decimal points
Angle- Any positive number between 0 and 359
Index- Any positive whole number greater or equal to zero
Hope that helps!
Thanks
Claudia
In most programming languages you can convert a number into a whole number by making it an integer. Below is an example of how this could be done in Perl.
my $random = int(rand(10));
print "Random number between 0 and 10: $random\n";
In the above example the $random variable is assigned a random number, which is converted into a whole number using the int() function.
I am thinking that something can be done along the same lines in GameSalad in the expression editor but not 100% sure.
If I may ask, what are you needing to use the "index" attribute for???
All I can see is that the tables are the best way to create random spawners that don't repeat without making seperate rules and attributes. The "index" attribute appears to be the 'base' attribute that is used in the attribute behaviours.
But hey I am just a marketeer with a powerpoint degree:-)
Hi @Claudia247 Index attributes are exactly the same as Integer attributes except they cannot store a negative whole number. I'm guessing that sometimes, this difference is not needed for some tutorials, depending what it's used for, so if not, simply replace an index with an integer attribute...
But if it is required, (in other words, it can't store a negative number is important to the programming), and you haven't got that attribute type on Windows, as you say, then:
Add a Rule: When YourIntAttPretendingIndex < 0 Change attribute to 0; or maybe (if needed instead): Rule: When YourIntAttPretendingIndex < 0 Change attribute to YourIntAttPretendingIndex*-1
Hope that helps.
""You are in a maze of twisty passages, all alike." - Zork temp domain http://spidergriffin.wix.com/alphaghostapps