Scenes with two starting points
Jfg619
Member Posts: 23
Hi, I'm creating an RPG and I need to make scenes start at 2 or 3 different points depending on where you enter them from. How can I achieve this?
Thanks
Comments
Hi @Jfg619 and welcome to the GameSalad Forums.
Without more info, I'd recommend - each time you want to move to a new position - using the scene.Camera.Origin.X & Y attributes, either in a couple of Change Attribute behaviours, or if you want to pan over time to the new position, use the attributes in two Interpolate behaviours.
""You are in a maze of twisty passages, all alike." - Zork temp domain http://spidergriffin.wix.com/alphaghostapps
thank you @gyroscope
So lets say I have a town where you can go into different houses, how would I make it so the character spawns at the entrance of a house he just came out of, instead of the scene's default X&Y camera origin?
Hi, again, without more info it's difficult to be precise...
OK, I'll give it a go to explain: I'll assume your town with different houses (outside) is all on one scene; and when you go into a house via the entrance,you go to a new scene for each interior, then back to the main outside town scene when coming out again.
So if that's the case, one way to tackle this would be to have invisible actors at the entrances of the houses (all on the main town scene).
Make two real attributes (game), called PosX & PosY; make a game integer attribute called WhichHouse.
In each of these invisible actors at the entrances, put:
Then in an actor outside of the play/screen area:
Now in each of your interior scenes, an invisible actor when the player is coming out of the house this time:
Hope that all makes sense.
""You are in a maze of twisty passages, all alike." - Zork temp domain http://spidergriffin.wix.com/alphaghostapps
@gyroscope thank you so much!! I didn't completely understand your method but it gave me a simpler idea that worked perfectly, here's what I did:
On the main town scene I put an invisible actor on top of each door which just changes to house interior scene when overlapped.
Then on the inside house scene, I put an invisible actor on top of the exit door that changes the WhichHouse attribute to 1 and then changes scene back to main town when overlapped.
Back on the main town I converted the main character actor into an instance actor and gave him a rule that when WhichHouse = 1, his position changes to right in front of the house he just came out of. So there was no need to create the extra PosX & PosY attributes you suggested.
Thank you for your time and input, it's greatly appreciated!
You're welcome, and glad it helped.
For the record, I used PosX and PosY as being away from the invisible actor on the doorways, so that when you returned to the town scene, and the Player was moved to the outside doorway again, it didn't overlap so as to retrigger it again to go back inside.
But if that doesn't happen with yours, all the better!
""You are in a maze of twisty passages, all alike." - Zork temp domain http://spidergriffin.wix.com/alphaghostapps