Room - To - Room

Started by Whelandrew, Thu 11/09/2003 06:54:52

Previous topic - Next topic

Whelandrew

I looked through the manual and read through some of the forum, but can't find an answer.

I am trying to link two rooms together. But, when I walk the character over the hotspot it teleports to the next room but does not place the character or let him walk around.

I assume is has to do with the Edge+Offset Value but I don't know how to figure out what that value is.

Someone give me a hand?
The bulb in my reading lamp went out.
I'm seeking enlightenment.

Quintaros

#1
You can use a region with the interaction:  Player-Go to a different room (at specific coordinates).

Then pick your coordinates for the room  so that the player is on the appropriate walkable area.

Whelandrew

That works to send it to a specific spot. But, what if I want them to pop up in the same side right across from where they came from?
The bulb in my reading lamp went out.
I'm seeking enlightenment.

Quintaros

Quote from: Krominof on Thu 11/09/2003 07:05:57
... what if I want them to pop up in the same side right across from where they came from?

I'm not sure what you mean by this.  

Whelandrew

I want them to go in to the room and arrive exactly where the last room left off. Almost as if it just scrolled to the next area, but changed rooms instead. If Ius coordinates, then it puts them in that exact same spot no matter where they enter the hotspot.
The bulb in my reading lamp went out.
I'm seeking enlightenment.

Quintaros

#5
Okay now I understand...unfortunately I don't know the answer.  Too bad, I was thinking I actually knew something useful. Sorry.

Whelandrew

Heh. Well, thanks anyway.

Anybody else help me out?
The bulb in my reading lamp went out.
I'm seeking enlightenment.

Gilbert

In that case, you have to use scripting.
Say if the player walks away from the right will arrive in room 22 and coordinate ( 10, same y coordinate as before), you can set the interaction to "runscript..." and just put the line:

NewRoomEx(22, 10, character[GetPlayerCharacter()].y);

there, save the script and compile the room.

Quintaros

I tried out this code on my own game and got this error message:



---------------------------
Illegal exception
---------------------------
An exception 0xC0000005 occured in ACWIN.EXE at EIP = 0x004D2B4A ; program pointer is +0, ACI version 2.56.623, gtags (0,0)

AGS cannot continue, this exception was fatal. Please note down the numbers above, remember what you were doing at the time and notify CJ on the Tech forum.



Most versions of Windows allow you to press Ctrl+C now to copy this entire message to the clipboard for easy reporting.
---------------------------
OK  
---------------------------


What's going on?


Gilbert

Hmmm did you check you had entered the room number and coordinates information correctly?

If you have no clue, you may copy what you had typed into the script here in this thread.

Quintaros

#10
I tried to modify for movement up/down instead of left/right.  This is what I typed in:

// script for region2: Player walks onto region
NewRoomEx(22, character[GetPlayerCharacter()].x,190);  


You're right about the "no clue" part.  Even after removing the interaction my game still will not compile.  

Gilbert

Is the new room number really 22? I put 22 there just as an example, you need to replace it by the appropiate room number.

Quintaros

#12
The right room number was 22.  Strange coincidence, eh?

The error message was apparently b/c of something other than my game.  I rebooted my computer and the game runs fine now.  Just happened to occur when I tried your code.

Sorry for Shanghai-ing your thread Krominof, but you have your answer.

Gilbert

Nevermind. It's nice to hear that the problem got sorted out. ;)

Whelandrew

Indeed I do. Thanks for usurping the thread!  :)
The bulb in my reading lamp went out.
I'm seeking enlightenment.

Whelandrew

Okay! New problem. I finally was able to get to move to the new room, but the character doesn't show up.
I tried (movetowalkablearea) but it actually placed him in a non-walkable area.
The bulb in my reading lamp went out.
I'm seeking enlightenment.

Scummbuddy

what code are you using to move the character?
- Oh great, I'm stuck in colonial times, tentacles are taking over the world, and now the toilets backing up.
- No, I mean it's really STUCK. Like adventure-game stuck.
-Hoagie from DOTT

Whelandrew

I started with the suggested code above.

Then I tried new room and added movetowalkablearea.

Got the same results.
The bulb in my reading lamp went out.
I'm seeking enlightenment.

Scorpiorus

#18
Quote from: Krominof on Thu 11/09/2003 18:07:56I tried (movetowalkablearea) but it actually placed him in a non-walkable area.
Sorry, but are you sure it's a walkable area and not a hotspot, for example?

EDIT:

btw, you have to place MoveToWalkablearea() function in the new room, not like:
NewRoomEx(...);
MoveToWalkablearea();

but like...

this room's code:
NewRoomEx(...)


destination room's code:

on player enter screen (before fadein)
MoveToWalkablearea();


-Cheers

Scummbuddy

Are you using the NewRoomEx(); code.  look it up in the manual
- Oh great, I'm stuck in colonial times, tentacles are taking over the world, and now the toilets backing up.
- No, I mean it's really STUCK. Like adventure-game stuck.
-Hoagie from DOTT

SMF spam blocked by CleanTalk