NewRoom command from Dialog Request

Started by James Kay, Sun 15/02/2004 10:37:43

Previous topic - Next topic

James Kay

I have one particular room in my game where, once the player enters a dialog is automatically started (until you do something special). During this dialog, you'll also automatically leave the room again.

What I've done is, in the dialog script:
@1  // option 1
EGO: Blah blah blah
run-script 11

@2  // option 2
EGO: Blah blah blah
run-script 12

@3  // option 3
EGO: Blah blah blah
run-script 13

@4  // option 4
EGO: Blah blah blah
run-script 14

@5  // option 5
EGO: Oh...nothing.
run-script 15


Okay. (you'll see no stops or returns, because this is all done from the dialog request script.
(11 thru 14 trigger a scripted animation, which all lead to 15, which kicks you out of the room).

Disalog request 15 is:

     if (requestNumber == 15) { // Leave room
     StopDialog();
     SetGlobalInt(499, 20);  
     //MoveCharacterBlocking(EGO, 253, 185, 0);
     MoveCharacterBlocking(EGO, 241, 178, 0);
     NewRoomEx(8, 138, 114);
     }  



The x, y location of the first commented Movecharacter command leads to a region, which leads to the new room.
The second location leads to an area just before the region.
The NewRoom command is supposed to go with this one (not the one with the region).

Running this gives me an error telling me there are two new room commands in a dialog script.
Using the first commentef line (new room through region) and commenting out the following two lines, makes me go to the new room, but the screen remains black. An after fade-in script command is run. I know this because it contains a sound which I can hear.

What am I doing wrong??

Kweepa

What is in the script for entering the new room?
The NewRoom command should work fine from a dialog_request.
Still waiting for Purity of the Surf II

James Kay

In the new room, after the fadein, I simply check if that GlobalInt 499 is set to 20 (see above), then play around a little. Switch on an object, play a sound, have the player character say something.
Except, like I say, the screen remains black, the sound plays, and nothing. It's highly confusing.  :(

Kweepa

#3
Sounds like there must be something wrong with your scripts anyway - I'm guessing two room changes :)

Presumably AGS doesn't like 2 NewRooms in one script because this happens (it could be the fade in - try setting the room transition style to instant).

You've just fooled it into accepting two NewRooms by putting one of the new rooms "inside" the MoveCharacterBlocking.

Are there any other dialog_requests after #15?
Could there possibly be a NewRoom there?
Or in the PlayerLeavesRoom? Or the PlayerEntersRoom (before fade in) of the next room?

Does it play the sound looping?
Because I put a NewRoom(the same room) into the before fade in of the new room and got the black screen and a looped version of the sound I play in the after fade in function.
When I changed the room transition style to instant, the game obviously locked up before getting to the next room, although the sound played.
Still waiting for Purity of the Surf II

James Kay

I'll have to dissect it tonight. Was working on it a lot this weekend so my eyes got blurry. Easy to have missed something maybe.
I'll post more later.

Gilbert

Hmmm have you tried adding a stop after each of the options? It may help but I'm not sure.

It may be related to the fact that NewRoom() always got queued in a script, and will only be executed by the end of the script.

Scorpiorus

what if you place return after each Newroom?

...
MoveCharacterBlocking(EGO, 241, 178, 0);
NewRoomEx(8, 138, 114);
return;
}

James Kay

Well, it has me stumped. The problem is unsolvable!!!

But I hacked it. I just have the dialog request set a globalint, then repeatedly execute (in the room) to check if the globalint is flagged, in which case the "exit room" animation is triggered.

That works.
Dunno why the original idea doesn't.

The hack is very much like making love to a beautiful woman: it feels dirty and wrong, but it gets me where I want.

SMF spam blocked by CleanTalk