What and how many new attributes can be created?

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

  • BBEnkBBEnk Member Posts: 1,764
    it's just a made up attribute could have been called getDark or LightTheRoom and you can pretty much create all you want. and I don't have the template but in this case the creator probably tied it too the actors alpha channel to create the fadein and out effect.
  • brettw777brettw777 Member Posts: 24
    Okay, I was just now starting to figure out that these are made up. I thought they were some kind of coding commands or something. Still not clear on the capitalization of the second word. Thanks.
  • BBEnkBBEnk Member Posts: 1,764
    Okay, I was just now starting to figure out that these are made up. I thought they were some kind of coding commands or something. Still not clear on the capitalization of the second word. Thanks.
    Oh cap'n the words like that is just something I do for my attributes I don't no why, I just do. You can write them anyway you wish.

  • KevinCrossKevinCross London, UKMember Posts: 1,894
    edited November 2013
    If you have any programming experience, even a limited amount, then you can look at and treat attributes the same as you would variables in other languages.
  • SocksSocks London, UK.Member Posts: 12,822
    Okay, I was just now starting to figure out that these are made up. I thought they were some kind of coding commands or something. Still not clear on the capitalization of the second word. Thanks.
    Capitalization of the second word is just a stylistic thing, you can call an attribute whatever you like ("Super fading magic thing" or "XBC491" or "SceneOneFade" . . . . or whatever you like).

    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).
  • SocksSocks London, UK.Member Posts: 12,822
    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).
    To fade a scene in, just stick a big black rectangle over it and animate the rectangle's opacity so it goes from black to see-through, you can do this by interpolating the alpha channel of the actor.

    To fade a scene out, do the opposite.
  • tatiangtatiang Member, Sous Chef, PRO, Senior Sous-Chef Posts: 11,949
    edited November 2013
    Attributes are simply variables from math or programming languages. They hold values. They can hold numbers (e.g. integer, index, real, angle), text (e.g. text), or can be true/false (e.g. boolean).

    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

  • brettw777brettw777 Member Posts: 24
    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).
    To fade a scene in, just stick a big black rectangle over it and animate the rectangle's opacity so it goes from black to see-through, you can do this by interpolating the alpha channel of the actor.

    To fade a scene out, do the opposite.
    Thanks for all your replies. As for this scene fade in, I still have not gotten it done. As for a big black rectangle, is that an actual actor? Either way, I cannot see how to make it work without having something pressed to make the black scene fade away to show the new scene. I am very much new to this so forgive the elementary-ness of the question, please. Out of the numerous videos on youtube, I cannot find one that shows a step by step process of fading out from one scene to fading in to another. If you all know of one, please post the link. I am not good at following written instructions on how to do this. I kind of need to see it demonstrated. Thanks!

  • tatiangtatiang Member, Sous Chef, PRO, Senior Sous-Chef Posts: 11,949
    I'll make you a demo. :)

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

  • tatiangtatiang Member, Sous Chef, PRO, Senior Sous-Chef Posts: 11,949
    Click anywhere on the first scene to initiate the fade out and back into the next scene.

    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

  • brettw777brettw777 Member Posts: 24
    I'll make you a demo. :)

    That would be fantastic! I read somewhere that Gamesalad has an awesome forum. Now, I am understanding why!
  • tatiangtatiang Member, Sous Chef, PRO, Senior Sous-Chef Posts: 11,949
    That would be fantastic! I read somewhere that Gamesalad has an awesome forum. Now, I am understanding why!
    The most helpful and useful of any I've been a part of or had the pleasure of helping to moderate. :)

    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

  • SocksSocks London, UK.Member Posts: 12,822
    By the way, the demo is in the post above. If you click on the white "page" icon it will download the .zip file.
    @tatiang

    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).
  • brettw777brettw777 Member Posts: 24
    @Tatiang, thanks for the file. I am trying really hard to figure it out but not having much success. I copied, word for word, or should I say "rule for rule" everything there into my own scene change and it still is not working. I am often getting scenes and actors confused and I am still not 100% clear on the difference. In the actors, you have a solid pink square and another solid blue square that both say "trigger fade..." and I cannot figure out what role those squares play. I don't have any triggers like that in my game and cannot see how they interact with the rest of the scenes. I thought you made rules for each actor but those are not part of the scene that I can tell so I am getting lost.
  • tatiangtatiang Member, Sous Chef, PRO, Senior Sous-Chef Posts: 11,949
    edited November 2013
    A "scene" is an area in GameSalad where you place "actors" (anything that has an image or a color and has its own rules and behaviors). So when you first open GameSalad and create a blank new file, you are viewing a black scene background.

    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

  • brettw777brettw777 Member Posts: 24
    Thanks and I am currently actually already going through Frying Bacons videos, coincidentally. I started on them yesterday after I finished Tshirtbooth's videos. A lot of that I already knew but sometimes information overload starts to overlap in my tiny brain and I forget what I thought I knew. Thanks again.
Sign In or Register to comment.