What and how many new attributes can be created?
brettw777
Member Posts: 24
So I am studying a new template I bought trying to figure out what does what. I am trying so hard to figure out how to fade a scene out to black (I did it!!) and then fade into another scene (spent hours researching this and still cannot do it). Regardless, the template has this change attribute command of Fade in/out. I kept wondering where this comes from until I realize that it was an attribute added by the template creator. It also has a game attribute called activateFade. This got me thinking several things: Where did he get this idea that "Fade in/out" would do that? How did he know to add that as an attribute and how many more of these types of commands are there? More importantly, is there a list somewhere that I need to know about because I cannot find them. When you start a new project, GS does not have all of these commands waiting for me to activate the. They are just not there. I find this confusing. Learning GS cannot be much easier than brain surgery in the dark.
Comments
I wouldn't get too lost in this kind of (ultimately irrelevant) detail, just test stuff out for yourself, if you think the capitalization of a word is relevant then change its name to a lowercase version and see if it makes any difference (it doesn't).
To fade a scene out, do the opposite.
If I want to fade the screen, I need to be able to tell the actor(s) when to do that. So I create a game boolean called game.activateFade (or game.MakeFadeStart or game.Fade or game.fffffade or whatever) and set it to false/unchecked. When something happens that requires a fade, I then change the value of game.activateFade to true. That way, my actors can have a rule that says When attribute game.activateFade is true, move into position or change self.color.alpha transparency amount or anything I need to have happen. It's simply a way of signaling another actor by changing a value of a variable (aka attribute).
The only "commands" in GameSalad are the list of behaviors you see. All attributes are just placeholders for values. Some attributes are built-in (game.Time, self.size.Width, etc.) and others can be created if you need them.
New to GameSalad? (FAQs) | Tutorials | Templates | Greenleaf Games | Educator & Certified GameSalad User
New to GameSalad? (FAQs) | Tutorials | Templates | Greenleaf Games | Educator & Certified GameSalad User
Note that the black rectangle actor has to be the top-most actor in the top-most layer for this to work.
New to GameSalad? (FAQs) | Tutorials | Templates | Greenleaf Games | Educator & Certified GameSalad User
That would be fantastic! I read somewhere that Gamesalad has an awesome forum. Now, I am understanding why!
By the way, the demo is in the post above. If you click on the white "page" icon it will download the .zip file.
New to GameSalad? (FAQs) | Tutorials | Templates | Greenleaf Games | Educator & Certified GameSalad User
Nice demo (I always knew you were into cute knitted ponies )
I'd add one small point for @brettw777 - there's an error in GameSalad's interpolation behaviour (don't worry it's been reported, so should be sorted sometime in late 2027 ) ) this error 'clips' the very last part of a single digit interpolation, which basically causes a little 'kick' or 'blip' on the end of anything that interpolates over a small range, so it effects things like images fading in and out and audio ramps.
The quick solution is to fade from 0 to 1.2 (instead of fading from 0 to 1) - and from 1 to -0.2 (instead of fading from 1 to 0).
The trigger fade actors are just separate actors that change a game attribute's value. That way, the black rectangle actor can "keep an eye" on that attribute and act a certain way when it changes value. I placed the fade actors in the grey margin area at the bottom of each scene.
You might start with something like my GameSalad intro video (below). It was designed for use by students with a specific template but you don't need that template file to follow along. I also recommend spending some time with @FryingBaconStudios' GameSalad logic series: (start with GSlogicPT1). We're not suggesting videos because we don't want to help but rather because there's a base level of understanding needed before you ask in-depth questions here on the forums. I'll help you in any way I can.
New to GameSalad? (FAQs) | Tutorials | Templates | Greenleaf Games | Educator & Certified GameSalad User