How to Change the size of an actor with Different Characters

I am setting up a character system, but some of my characters are larger than one another, and i know i can change them out by labeling them 1.png 2.png 3.png ect... but they try to get replaced in the one actor i have which is one particular size. My images are not one fit size but are all different in size. I would like it to increase the size of the actor along with the image so that the image that is bigger than the one before does not seem squished into the actor. Basically i need it so the actor's size changes to fit with the image size. Is there a way to do it with just one actor? or is there another method? Thanks in advance!!!

Comments

  • CodeMonsterCodeMonster ACT, AustraliaMember Posts: 1,078
    edited November 2013
    basically add a constrain rule for your actor so if your actor is the bigger image constrain its height and width to the size you wish, and the same with the smaller image.
  • tahakitantahakitan Member Posts: 102
    create a game variable for your actor and for every number change the image and height and width. When you want to switch the image of the actor you just have to switch the variable number. make sure to keep it as a game variable in case you want to make it selectable by clicking another actor such as a button. I have done this on my latest game. all my characters are one actor. check out the video, tell me if this is what you mean.
  • DaGreatnessDaGreatness Member Posts: 82
    @tahakitan yes you are correct, i need it like that as well because i am going to have about 5-10 characters which i want the user to have a choice on selecting.

    what type of game variable should i create? will it be an integar or a boolean? Also when you say game variable, you are talking about the game.whatever and not the actor.whatever correct? and dont i have to include a variable in the actor as well?

    If possible can you give me a rough break down, on the character selection part on how you did it. Because its definitely something along the lines on what i am looking for. Thanks in advance
  • tatiangtatiang Member, Sous Chef, PRO, Senior Sous-Chef Posts: 11,949
    It all depends what you intend to do with the different characters. If you are only changing the appearance, go with an integer. By the way, since a boolean has only two possible values (true or false) it's not a valid option for multiple character choices.

    If you need to make complex rules such as collisions or changes to attributes such as game.power, game.lives, game.multiplier, etc., then consider using a text attribute. The advantage there is that when you craft your rules you can say When game.character="jediknight" --> [behaviors]; When game.character="squirrel" --> [behaviors]. That way your rules are easy to read. Having just numbers can get confusing after a while. Just make sure to check the spelling and case of those text expressions carefully so that they all match.

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

  • SocksSocks London, UK.Member Posts: 12,822
    When game.character="jediknight" --> [behaviors]; When game.character="squirrel" --> [behaviors].
    [has idea for knights vs squirrels game]
  • tatiangtatiang Member, Sous Chef, PRO, Senior Sous-Chef Posts: 11,949
    edited November 2013
    When game.character="jediknight" --> [behaviors]; When game.character="squirrel" --> [behaviors].
    [has idea for knights vs squirrels game]
    Stop that! If you keep stealing my ideas I'm going to have to keep buying your games.

    This is priceless.

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

  • tahakitantahakitan Member Posts: 102
    @Dagreatness
    it is just like @tatiang said. I used integer but text works better.
  • DaGreatnessDaGreatness Member Posts: 82
    Thanks guys!!!!!
  • DaGreatnessDaGreatness Member Posts: 82
    @tatiang and @tahakitan

    So i created a game.character attribute in the global, so now i have to create all of the rules in the actor itself now correct? What about the character select screen? dont i have to input something in their for it to know, that it is referencing that car?

    So it says, if game.character (this is a text attribute) so which one will work best, ( contains, begins, ends, or is?) and do we right the name of the image as "image"

    If game.character (contains, begins, ends, is) "image" or what do i write there.

    This is the first time i am using Text attributes and i am not that familiar with it, because i am familiar with the integars and all. Some insight would be wonderful, THANKS
  • tahakitantahakitan Member Posts: 102
    edited November 2013
    are you talking about pushing a button to switch the character? be more specific with the question please. like one sentence lol.
  • DaGreatnessDaGreatness Member Posts: 82
    @Tahakitan lol nvm i managed to figure it out!!! but thanks again buddy!!!!
Sign In or Register to comment.