Attribute groups?
loganobarr
Member Posts: 12
I have noticed I am collecting a large amount of game attributes starting to build up in my new game, can you put attributes in groups yet or no? If no, will it ever be added?
Best Answer
-
MentalDonkeyGames Posts: 1,276
Answers
I can only pray, its very messy at the moment
@loganobarr, there is a Group Behavior that you can use to organize your Rules and Behaviors. Is that what you are asking?
http://jamie-cross.net/posts/ ✮ Udemy: Introduction to Mobile Games Development ✮ Learn Mobile Game Development in One Day Using Gamesalad ✮ My Patreon Page
no not rules, attributes
He may be referring to variables (attributes), which cannot be grouped or organized after they are created (unless you use the xml backdoor - messy stuff).
My Blog / App Store / Google Play
@loganobarr, ah sorry. My error in reading your post.
http://jamie-cross.net/posts/ ✮ Udemy: Introduction to Mobile Games Development ✮ Learn Mobile Game Development in One Day Using Gamesalad ✮ My Patreon Page
I suppose tables are essentially attribute groups.
I'm a fan of attributes, and favour them for things that people will often recommend tables for. Tables are hugely helpful and valuable, but sometimes they're just not needed.
This means I too often end up with a lot of attributes. Something I find helpful is to do regular checks for which ones I'm actually using. If you attempt to delete an attribute it will tell you all the actors that attribute is used in, and ask you for confirmation. If it isn't used in any, it will just delete it. So I'll frequently try and delete all my attributes and clear out the ones that aren't being used.
Contact me for custom work - Expert GS developer with 15 years of GS experience - Skype: armelline.support
What?! It tells you what it is used in? I want that in windows version...
I'm 99.9% sure the Mac version does this as well.
http://jamie-cross.net/posts/ ✮ Udemy: Introduction to Mobile Games Development ✮ Learn Mobile Game Development in One Day Using Gamesalad ✮ My Patreon Page
That's my approach too, I never use tables and always prefer attributes, maybe it's just habit, but tables seemed to throw up a few bugs from time to time whereas attributes are a core mechanic of GS that have been in since the beginning and are comparatively rock solid (that's not to say tables have not got their place).
Yep, again that's my preferred method, not just for finding redundant attributes, but also for tracking down where an attribute is being used, for example I might have a button that is being lit up by 'game.LightOn', but I don't know what triggers this attribute, so rather than opening up several actors, looking for the rule that triggers 'game.LightOn', I will just head over to the attribute list and hit delete on 'game.LightOn' - at which point GS will reveal all the actors involved in the process - then hit cancel, very useful in large complex projects.
XML can be messy, but when it comes to attributes, it will accept any change in their order without any errors, so long as the format stays the same.
For example, I re-arranged the 60+ game.attributes in my game with no ill effects.
What I'm thinking the person can do is "group" them each other a text attribute that can act as a group title, and then list all game attributes under each "group" text attribute. In this way, things can be in order.
And it was recently said by a GS programmer that attributes don't work top to bottom like some other programs, but rather use a notification system{although the lines of code running through actors might still use top to bottom, and on layers bottom to top.}
XML, if you can understand it, can save you tens of hours. For example, right now, I'm switching out all %operators out of actors(209 of them carry operators) with mod() to fix issues with compatibility in html5, using find and replace in dreamweaver, I can change 10 actors in a few minutes,{most use 3 to 10 instances of operators, some even 20). In the GS creator, 10 actors would take an hour{since there is no ctrl+f}, at least on Windows creator anyway. With an XML editor, you can find and replace them in seconds per actor.
With 200, I should be done in an hour, but if you have a program that allows you to do edit multiple files, and most actors share the same value within their operator rule, then it would probably just take minutes.
You have to replace it precisely within the confines of its brackets or cause the actor to have an error and dissappear when you look GS creator.
I was talking about the Mac version No idea if it works in the Windows version.
Contact me for custom work - Expert GS developer with 15 years of GS experience - Skype: armelline.support
Disregard what I said, Dreamweaver has read folder and open documents options for batch search, find and replace, I just used the former to replace all % operators with mod() which occured in the entire game 509 times, including scenes with unlocked actors. Days of work in 3 seconds. {Gotta do it for each number value though, since I sometimes use 0.06, 0.1. 0.33 and a few other numerical cycles through out the game.