Start the same scene but from a different location?
-
So guys I did mention that i got this to work. But i did it in kind of a cheesy way using add values because thats what I know how to use for now. What would be the proper coding structure for the logics when the player goes to the secret room and comes back out and the game no longer allows them to go back in. Do i use attributes for this? For example set an attribute for secret room door open and when the player enters it changes it to close?
-
@SplitMindGaming Yes, you can use attributes. Then use get attribute along with a condition. So if the door is closed, don't let the player enter.
-
@RobinsonX thanks. To me for some reason Im having a hard time wrapping my head around the concept of attributes. How would i set it up exactly. Sounds easy to say in my head but when it comes down to trying to code and make it happen it gets really confusing. How would you set this up. A player goes into the room. When he leaves. He cant go back in? This is how far i think I can get.
Door (Collided) with player
(Get attribute) door 1 enteredNow what would be the logic that does let him go back in when he comes back out. Sorry guys i know im an idiot.
-
@SplitMindGaming Do you know how labels work? Have you ever used a label as some value, and you use Set Label and Get label? An attribute is basically the same thing, but invisible.
-
So is this still the thing where you enter a room and it loads you into a new scene? And are you like trying to set an attribute on the global ui? (So that it doesn't get reset?)
-
@Aidan-Oxley yes its the same thing where it loads you to a new room. Im trying to set an attribute where it knows when u entered the room then prevents you from entering once you leave. An open and shut door policy you can say.
-
@SplitMindGaming yes im getting the hang of get and set labels. I read over the manual talking about attributes but its still confusing to me how to actually set things up with it. Its like going to school again. Sometimes you just need to teacher to show you how its done to really understand it.
-
Easy way to save player position
Collided with checkpoint
↓
Get player x
Get player y
↓
Store x and y in array
Either use array behaviour, or combine text like"[" + x + "," + y + "]"
↓
Save array to fileThen you simply load that file, and use get array item behaviour (index 0 and 1)
For saving if player entered a secret area, just use save and load file. Something named like "door1" set to 1 if entered, 0 if not.
FYI use an if statement
-
@SplitMindGaming Personally, I learned everything I know in hyperPad through trial and error sort of (plus reading the descriptions of each behaviour). If attributes are confusing to you, I would suggest toying with the behaviours in a seperate test project until you understand how they work.
I would use the preset ones to start with, dynamic are a bit more advanced. First you have to create the attribute, and then you can start using get/set attribute on it.
-
@Kamdroid i like that door 1 set to 1 if entered and 0 if Not entered. Im just guessing here but would that look something like this. The behaviors are in ( )
If ( collided ) with door 1 object
( set attribute ) entered
( add value ) + 1