Going between layouts

Get help using Construct 2

Post » Wed Aug 17, 2016 6:47 pm

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? :|
B
12
S
5
G
2
Posts: 11
Reputation: 1,976

Post » Wed Aug 17, 2016 7:12 pm

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.
B
47
S
18
G
84
Posts: 2,273
Reputation: 49,800

Post » Thu Aug 18, 2016 1:23 am

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.
B
12
S
5
G
2
Posts: 11
Reputation: 1,976

Post » Thu Aug 18, 2016 3:29 am

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.
B
67
S
25
G
4
Posts: 212
Reputation: 7,084

Post » Thu Aug 18, 2016 7:32 pm

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.
B
52
S
24
G
6
Posts: 391
Reputation: 7,855

Post » Thu Aug 18, 2016 7:36 pm

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.
B
47
S
18
G
84
Posts: 2,273
Reputation: 49,800

Post » Mon Aug 22, 2016 12:26 am

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! :D
B
12
S
5
G
2
Posts: 11
Reputation: 1,976

Post » Tue Aug 23, 2016 2:19 am

Gearworkdragon wrote: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? ':/
B
12
S
5
G
2
Posts: 11
Reputation: 1,976

Post » Tue Aug 23, 2016 2:39 am

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.
Mistakes were made.
B
54
S
28
G
115
Posts: 1,705
Reputation: 65,083

Post » Tue Aug 23, 2016 3:36 am

what i mean to make sure that the event will only run once while true so that you dont get weird ass glitches.
B
52
S
24
G
6
Posts: 391
Reputation: 7,855


Return to How do I....?

Who is online

Users browsing this forum: pegasus6464 and 27 guests