Going between layouts

0 favourites
  • 10 posts
  • So I'm making an RPG style game, and I wanted to add the ability to go from the first layout to the next one, then go back to the first layout through the exit you just came from while still being able to go through a different exit in the same room to go to a different layout. I figured out how to get the character on the previous screen alright, but when I tried to make it so you spawned in front of the exit instead of at the normal spawn point, the 8-direction behavior completely stopped working. Even when I clicked the page, since that's what has gotten it working when I first load the game, it remained completely still besides the animation. Does anyone out there know how I can get the player to be able to move when returning to a layout from the next room?

  • How are you enabling the 8-direction and spawning the player? If you return to a layout with a sprite that had 8-direction assigned then it should just work so must be an error with the logic somewhere.

  • The sprite itself has the 8-direction enabled, and how I had it spawned in was I set a global variable for entry which is added to when you hit the entrance to go to the previous layout, and when it is equal to or greater than 1 it sets the spawn point in front of the exit you came from. It goes into the previous room to the correct spawn point, but it won't move.

  • Is it spawning on the same layer on both layouts? It's not spawning against an object that has solid property? I know that seems obvious, but it should work straight out of the box I would have thought.

  • I know in my experience I've use a variable and a global variable and use invisible sprite to place the where about of places.

    I put a instance variable on the invisible sprite and name it location: and the variable as a text such as Route one and put in a function that every time you would overlap the the sprite make the global variable to that invisible sprite location and then on the next layout you would just use the same sprite with the same name.

    And pick the object that has that variable name and then move the character to that spot.

    Id would use this on start or a once trigger style so that it doesn't lock down on your move to object could result in infinite moving and you cant move the character. this might seem strange but there's a youtube video on this exact method.

    Cant remember who did it i think some apple guy that does beginner on layouts.

  • It might be stuck inside one of the invisible sprites. Not much anyone can do without a .capx share, even a cut down basic version.

  • signaljacker: I have actually removed the function and was going to return it later, but as far as I could tell it was. I did just figure out how to use layers in their most basic form though, so I wouldn't be able to tell for sure. Thank you though!

    Gearworkdragon: I'll have to check it out, thanks! I'll let you know if it works :3

    plinkie: I'm really sorry, I'm still fairly new to the whole forum thing (this is my first post thread thing) so I'm not really sure what a .capx would do. ':<

    As I have said, I removed the function so I could focus on the main gameplay, as it's not an absolutely necessary part of gameplay, or at least it's not as important as making the rest of the game work at the moment. I wasn't really planning to use the method I'd figured out since it didn't seem to work. I was mainly asking to see if someone else more experienced than me had figured out anything better. I'm still basically a toddler when it comes to using Construct 2, so I really appreciate everyone's help! Thank you all so much!

  • I know in my experience I've use a variable and a global variable and use invisible sprite to place the where about of places.

    I put a instance variable on the invisible sprite and name it location: and the variable as a text such as Route one and put in a function that every time you would overlap the the sprite make the global variable to that invisible sprite location and then on the next layout you would just use the same sprite with the same name.

    And pick the object that has that variable name and then move the character to that spot.

    Id would use this on start or a once trigger style so that it doesn't lock down on your move to object could result in infinite moving and you cant move the character. this might seem strange but there's a youtube video on this exact method.

    Cant remember who did it i think some apple guy that does beginner on layouts.

    I'm really sorry, I'm not exactly sure how you do a once trigger. Can you please help me out? ':/

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • plinkie means post a .capx file - your project save file, so that we can look at it and see what is wrong. Basically, there is no reason it shouldn't work, like in an example I made previously here. https://www.dropbox.com/s/dkqrwnwdz75qh ... .capx?dl=0

    The guess is that your player is stuck on a solid sprite, which could interfere with the 8direction movement. It may be invisible, but still solid.

  • what i mean to make sure that the event will only run once while true so that you dont get weird ass glitches.

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)