I have a room with a lake which you cannot cross. The only way to cross the lake is to find a hovercraft. So once the character has the hovercraft and interacts it I change the view with the character inside the hovercraft. This is not a problem.
Now when the character goes back to the room with the lake I want them to be able to cross it, so I cloned that room and made the area above the lake a walkable area.
What I am trying to do, when the character leaves a room I want to write a conditional statement, based on which view my character has (for example, the character has now 'equipped' the hovercraft so he is in that view, thus when he leaves on the left edge, he will be sent to the cloned room, but if he still has the normal walking view, he will go to the original room which he cannot cross.
I have tried
Code: ags
or
Code: ags
I'm new to coding - I just wish I knew how to set it up correctly.
Now when the character goes back to the room with the lake I want them to be able to cross it, so I cloned that room and made the area above the lake a walkable area.
What I am trying to do, when the character leaves a room I want to write a conditional statement, based on which view my character has (for example, the character has now 'equipped' the hovercraft so he is in that view, thus when he leaves on the left edge, he will be sent to the cloned room, but if he still has the normal walking view, he will go to the original room which he cannot cross.
I have tried
function room_LeaveRight()
{
if (cEgo.View == 1)){
cEgo.ChangeRoom(4, 43, 323);
else
cEgo.ChangeRoom(7, 43, 323);
}
}
or
function room_LeaveRight()
{
if (cEgo.View(1)){
cEgo.ChangeRoom(4, 43, 323);
else
cEgo.ChangeRoom(7, 43, 323);
}
}
I'm new to coding - I just wish I knew how to set it up correctly.
