Difference between Numeric expression and attribute?

ETGgamesETGgames Member, PRO Posts: 190

So, yeah, what the difference between the two when stating the condition for a rule?

Comments

  • MentalDonkeyGamesMentalDonkeyGames Member Posts: 1,276
    edited March 2016

    With numeric expression you can have an expression / equation on both sides of the condition.

    Example:
    If TableCellValue() > TableCellValue()

    Mental Donkey Games
    Website - Facebook - Twitter

  • ETGgamesETGgames Member, PRO Posts: 190

    Yes I know, but then what purpose does attribute serve - its essentially a nerfed version of numeric expression?

  • ArmellineArmelline Member, PRO Posts: 5,368

    In the past there was no numeric expression, only attribute. So it's partly that numeric expression was a feature addition and they couldn't remove attribute as it was used in lots of projects. That said, there's a good argument to be made that the simplicity of attribute is beneficial in a lot of cases - not to mention it being quicker and easier to add one.

  • tatiangtatiang Member, Sous Chef, PRO, Senior Sous-Chef Posts: 11,949

    Expressions can contain all sorts of things, from attributes to constants to quoted text. They are extremely versatile. But attributes are also valuable in that they are variables and can therefore store values. There's no way to store or save an expression value. Attributes can also be named so unless there was a way to name and reference expressions, attributes would be better for many things. Tables are an extension of attributes that build upon them and almost make them unnecessary.

    New to GameSalad? (FAQs)   |   Tutorials   |   Templates   |   Greenleaf Games   |   Educator & Certified GameSalad User

  • ArmellineArmelline Member, PRO Posts: 5,368

    @tatiang said:
    Tables are an extension of attributes that build upon them and almost make them unnecessary.

    Heresy! :P

  • The_Gamesalad_GuruThe_Gamesalad_Guru Member Posts: 9,922

    @Armelline said:

    @tatiang said:
    Tables are an extension of attributes that build upon them and almost make them unnecessary.

    Heresy! :P

    To the rack with him!

  • tatiangtatiang Member, Sous Chef, PRO, Senior Sous-Chef Posts: 11,949

    Now I've done it...

    New to GameSalad? (FAQs)   |   Tutorials   |   Templates   |   Greenleaf Games   |   Educator & Certified GameSalad User

  • SocksSocks London, UK.Member Posts: 12,822

    @tatiang said:
    Tables are an extension of attributes that build upon them and almost make them unnecessary.

    Off with his head !

  • Braydon_SFXBraydon_SFX Member, Sous Chef, Bowlboy Sidekick Posts: 9,273

    See - these are the questions I like: tabes. But people always answer before I can get to it!

    Darn you @MentalDonkeyGames @Armelline and @tatiang !

  • SocksSocks London, UK.Member Posts: 12,822
    edited March 2016

    @tatiang said:
    There's no way to store or save an expression value.

    There was a time when Mac Creator had Numeric Expressions as a condition while PC Creator did not, I used to tell PC people wanting to use a Numeric Expression to do the expression prior to the rule/condition.

    So with Mac Creator you would do . . . .

    Rule - When ((self.score + 100)/2)+self.bonus . . . . is less than 80 then do some stuff.

    Whereas with PC Creator you would do . . .

    Action - Change A to ((self.score + 100)/2)+self.bonus
    Rule - When A . . . . is less than 80 then do some stuff.

    . . . so in that respect you can store/save an expression value, unless you meant something different ?

  • tatiangtatiang Member, Sous Chef, PRO, Senior Sous-Chef Posts: 11,949

    @Socks said:
    . . . so in that respect you can store/save an expression value, unless you meant something different ?

    @Socks no, I agree that it's possible to store/save an expression value in an attribute. I was referring to the concept of somehow storing/saving an expression without needing attributes (or tables).

    This question...

    @ETGgames said:
    Yes I know, but then what purpose does attribute serve - its essentially a nerfed version of numeric expression?

    ...led me to explain why you would still need attributes.

    New to GameSalad? (FAQs)   |   Tutorials   |   Templates   |   Greenleaf Games   |   Educator & Certified GameSalad User

  • SocksSocks London, UK.Member Posts: 12,822

    @tatiang said:

    @Socks said:
    . . . so in that respect you can store/save an expression value, unless you meant something different ?

    @Socks no, I agree that it's possible to store/save an expression value in an attribute. I was referring to the concept of somehow storing/saving an expression without needing attributes (or tables).

    You can store them without attributes (or tables), you can write them on the back of your hand, or if you want to keep it under-the-table, on the back of your eyelids, I also wouldn't rule out your knees, you'd be surprised how much data can be stored on your knees with good good biro technique.

Sign In or Register to comment.