Newbie -no programming backgr. Where do i find (the equivalent) of Attribute type: Index on Windows?

Claudia247Claudia247 Member Posts: 12
edited September 2013 in Working with GS (PC)
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

Comments

  • KillerPenguinStudiosKillerPenguinStudios Member Posts: 1,291
    I would like to explore tables for random actors, all the videos (for Mac show make attribute of an attribute type Index. I only have - Boolean, text, integer, real, angle on my windows creator.

    What is the replacement, workaround for windows creator?

    Thanks

    Claudia
    I will list for you what each is for and depending on what you want to do you can choose what best suites your needs!

    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! :D
  • Claudia247Claudia247 Member Posts: 12
    Hi @Killerpenguins thanks for answering. Sorry I forgot the important point. I am on the windows creator. I do not seem to have an attribute type Index. This is the 'magic' one that everyone uses on the table tutorials I see on youtube. So i was imagining that there must be a work around, that i can indicate "index" attribute type another way?
    Thanks

    Claudia
  • KillerPenguinStudiosKillerPenguinStudios Member Posts: 1,291
    Not a problem @Claudia247
    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???
  • Claudia247Claudia247 Member Posts: 12
    I have no idea, I am just following the tutorials at this moment B-) But thanks @killerpenguins this has given me something to investigate.
    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:-)
  • gyroscopegyroscope I am here.Member, Sous Chef, PRO Posts: 6,598
    edited September 2013

    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

Sign In or Register to comment.