Two interchangeable characters on the same scene [SOLVED]

SrChurros

  • Posts: 7
Hi guys! I'm new around here.

So, after reading most of the starter's guide on stencylpedia, I started trying to make my first game. I'm trying to do a very simple, very basic plataformer, with two interchengeable characters that have to find the other one, like in ilomilo.
The problem is, I'm terrible, awful, horrendous with logic, and even stencyl's simplicity, I just can't figure out how make a button that cancels controls for one character at the same time that it turns on controls for the other, and change the camera target.
What you guys would suggest me to do? Maybe a custom walk/move behavior?

And thanks for the attention!

« Last Edit: December 07, 2012, 08:19:23 am by SrChurros »

dtrungle

  • *
  • Posts: 1938
You should go through all the tutorials you can and play with the actual coding. You should learn a bit about the blocks and the logic behind the codes. The codes/blocks is what you're trying to learn, don't bother too much with the behavior settings within the actors. That won't help you learn much if any.

What you're trying to do is simple. Create a button actor. Give him a behavior that states when I click on myself, switch the camera and switch the playing character. For the playing character portion, I suggest you use a boolean that indicates true if the character is active. Camera and movement codes you should learn from the tutorials.

SrChurros

  • Posts: 7
Thanks! I'll look deeper into the tutorials once I get home from work.
I had read most of the tutorial part of the stencylpedia for a university project I was in some months ago, but I kind of droped out of it.
But I wanted to make some simple games for stencyl before jumping to something like unity. So thanks for the help!

SrChurros

  • Posts: 7
Not having much free time because of my work... anyway, I'm starting to mess with coding in design mode, creating my own moviment behavior, based on the crash course 2 ship moviment and looking inside the jump and run behavior to see if I learn something.

I've been trying to instead of making a 'change character' button to make an 'true/false boolean scene behavior', to whenever I press the key "p", the boolean will be turned on/off, like a switch. The problem is, I can use the attribute boolean from the scene behavior into my custom character behavior. Probably approaching the problem the wrong way, I think.

dtrungle

  • *
  • Posts: 1938
Using a control 'p' instead of a button push on-screen is perfectly fine. Depending on your game, it might be beneficial to use a Game Attribute boolean to hold the current character. Such as GA => CharacterIsMain (starts off as True, represents the main character as active).

There are a couple way to accomplish this really. You should know that there are 'For each loops' that can iterate through all scene actors as well as 'behaviors' block that can grab attributes from specific actors or the current scene.

SrChurros

  • Posts: 7
Not sure if there is Game Atribute booleans, but I could use as well a game atribute counter that changed between 1 and 0 to use as 1=true and 0=false.

But now I'm using the behaviors blocks you told me. And aftering messing a little with these blocks in my "Change Character" scene behavior, it's working exactly as I wanted!
Thank you A LOT for your help! I think one more week and it'll be ready.