Can someone explain the real purpose of each attribute.

LordTarantorLordTarantor Member, PRO Posts: 890
edited November -1 in Working with GS (Mac)
Hello everyone:

I been here almost a year and I never fully understood the real purpose on each attribute. I almost all the time use interger and in a few occasions I use other like boolean and real but only because a tutorial told me to and I don't understand why.
I friend of mine ask me today when was best to use boolean and I didn't know what to answer.

Can someone explain when its best to use every one of them and why.
Thanks a lot.

Comments

  • JohnPapiomitisJohnPapiomitis Member Posts: 6,256
    Integers can only be whole numbers: 1 , 2 , 3

    Real can be positive, negative, and have decimals: 0.5 , -1.5 , 3.9

    Angles can be a value from 0 to 360.

    Booleans are true or false.

    Text stores text as the value: "hello world"

    And index are whole positive numbers im pretty sure
  • LordTarantorLordTarantor Member, PRO Posts: 890
    Thanks a lot guys.
    Back to my projects to do some mayor changes.
    I know there are a lot of rules in them that has intergers when they could be boolean.
  • InLikeFlynnInLikeFlynn Member Posts: 171
    It used to make a bigger difference when memory was more limited, but each type uses a different amount, and can be processed at different speeds by your processor.

    Boolean is binary, which is one bit in size and can be processed very quickly by a cpu. Sometimes this can help with readability too. If true and false better describes a state than 2 numbers could, you might as well use Boolean.

    Integers are whole numbers and can be negative, they are 32 bits I think...

    Real numbers can have decimals, and use significantly more memory and processing power. One warning with real numbers is that they are not exact. The decimals cut off after so many places. So .3333333333333 is not 1 third, and could eventually lead to errors.

    Angles are real numbers between 0 and 360 I think... I never use that type.

    Strings are groups of characters, like words, sentences. They're usually used for I/O, and can use more memory than ints and reals, but are usually used less.

    Index is non negative integers.
  • tenrdrmertenrdrmer Member, Sous Chef, Senior Sous-Chef Posts: 9,934
    this is a great example of the type of question to look through the cookbook for and if not found add the question for someone to answer.

    http://cookbook.gamesalad.com/?token=&tokenUsername=#question=4d9e10a05e76e16053000326
  • LordTarantorLordTarantor Member, PRO Posts: 890
    So sorry tenrdrmer, wont happen again... I hope...
  • tenrdrmertenrdrmer Member, Sous Chef, Senior Sous-Chef Posts: 9,934
    No reason to be sorry man. Just reminding everyone of that great new resource we have available to us.
Sign In or Register to comment.