Difference between Numeric expression and attribute?
ETGgames
Member, PRO Posts: 190
So, yeah, what the difference between the two when stating the condition for a rule?
Comments
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
Yes I know, but then what purpose does attribute serve - its essentially a nerfed version of numeric expression?
My Games:
https://itunes.apple.com/us/developer/ethan-sarif-kattan/id825823924
https://play.google.com/store/apps/developer?id=ETG+Ltd.
Website: https://etggames.com
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.
Contact me for custom work - Expert GS developer with 15 years of GS experience - Skype: armelline.support
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
Heresy! :P
Contact me for custom work - Expert GS developer with 15 years of GS experience - Skype: armelline.support
To the rack with him!
Guru Video Channel | Lost Oasis Games | FRYING BACON STUDIOS
Now I've done it...
New to GameSalad? (FAQs) | Tutorials | Templates | Greenleaf Games | Educator & Certified GameSalad User
Off with his head !
See - these are the questions I like: tabes. But people always answer before I can get to it!
Darn you @MentalDonkeyGames @Armelline and @tatiang !
My GameSalad Academy Courses! ◦ Check out my quality templates! ◦ Add me on Skype: braydon_sfx
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 ?
@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...
...led me to explain why you would still need attributes.
New to GameSalad? (FAQs) | Tutorials | Templates | Greenleaf Games | Educator & Certified GameSalad User
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.