For some reason, I can change the room from room 1 to room 2 using hotspots and this code:
player.ChangeRoom(2, 31, 132);
But I cannot seem to get back:
player.ChangeRoom(1, 289, 136);
What am I doing wrong?
Is the function containing the line properly linked in the events pane?
Quote from: Flappi282 on Sat 26/12/2009 18:07:56
What am I doing wrong?
Your code you posted there is correct, so problem is something else.
There are various possibilities and unless you give more info, people may only guess.
Hi, I'm having the same problem.
It only occurs when I add coordinates, otherwise if it is just the room number it works fine (but then the character stands in a weird place). How can I fix this? Thanks.
Are the coordinates set on a walkable area?
Please also show us the line of code you're using. What resolution is your game, what size is the room?
And what exactly seems to be the problem? Do you get an error message?
I feel real dumb now, I found the solution and it was something kind of obvious.
It was because the coordinates I put in made the character stand in the hotspot that transported him back to the room he came from, that's why he kept ending in the room he came. So I changed the coordinates to a place NOT on the hotspot, and this solved the problem.
Maybe this is the same problem as the original poster had?
Just for reference: using hotspots that way is obsolete and only supported for compatibility reasons.
It should be done using regions.
Wouldnt regions also put you back in this same situation?
Well regions have events for "Walks onto" "Walks off of" and "While standing on" whereas the only comparable hotspot event is "Stands on"...So no, you wouldn't strictly have the same problem if you're using the correct events. ;)
Yeah, if you screw up, it doesn't make much of a difference ;)
Aha, I understand. Thanks!