NewRoom from...

Started by fiaschetta, Fri 05/05/2006 04:24:52

Previous topic - Next topic

fiaschetta

I have 3 rooms 
One of them is connected with the others two (for example, room2) 
If i enter in room2 from room 1, the character says "Hi"   
if i enter in room 2 from room 3, the character says "Friend".. but the room3 have two possibility for enter in room 2 (for example, door1 and door2)..
Then, if i enter in room2 from room3 by door1 the char. says "friend one", but if i enter in room2 from room3 by door2 the char. says "freind two"...
How i do?

Scummbuddy

#1
You'll need to check out this property from the help file (since I don't know which version you're using):
-----------------
PreviousRoom property
(Formerly known as character[].prevroom, which is now obsolete)

read only int Character.PreviousRoom

Gets the room number that the character was previously in. If the character is still in the room that they started in, this will be -1. Otherwise, it will be the room number of the room that they were last in.
This is a read-only property. It is set automatically by ChangeRoom.

Example:

Display("EGO's previous room was %d.", character[EGO].PreviousRoom);

will display the EGO character's previous room.

-----------------
And now incorporate this into a "Before fade in" If statement. Check which room they came from, and allow for different spoken dialog.
- 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

Khris

Shouldn't this go into the "after fadein"-statement?
Otherwise the game would appear to hang at a black screen until the player clicks the mouse.

I swear I'll scream if I have to read "How i do?" one more time... ;)
It's "How do I do that?".

fiaschetta

Ok, but for enter in room2 from room3 i have two possibility (two doors);
If i enter in room2 from door1 the char. says "HELLO" but if i enter from door2 the char. says "Friend".

For now, my scrypt is:

if (character[TEQ].PreviousRoom == 18){
DisplaySpeech (TEQ,"Ciao");
}

Then don't exist the destinction between door1 and door2..
How do I do that? ( for Khris)

Ashen

In that case, you can use the character's position in the room to distinguish between door1 and door2, e.g.:
Code: ags

if (player.PreviousRoom == 4) {
  if (player.x == 20 && player.y == 145) Display("Door 1"); // Or whatver coords they arrive at
  else Display ("Door 2");
}
I know what you're thinking ... Don't think that.

fiaschetta

#5
Ok. gooooooo

Ashen

Does that mean it works now, or is there something else?
I know what you're thinking ... Don't think that.

SMF spam blocked by CleanTalk