Another cut-scene question

Started by Gorkur, Tue 23/11/2004 23:10:14

Previous topic - Next topic

Gorkur

Hello there, I'm your friendly neighbourhood noob idiot here with a question about an issue most of you are probably tired of answering ;)

Anyway, my problem is that I want an NPC that has appeared in a previous room to reappear and do "stuff" after I've used an object from my inventory with an object in a room.

"Stuff" includes:

Appear in room
Say "dialog x"
Move from A to B
Say "dialog y"

So far I've managed to make my NPC appear in the room and say "dialog 2", but I haven't managed to get him to do all the "scene". It's like he skips over my script commands between NewroomNPC and RunDialog (y)

Here's the script:
  // script for object0: Use inventory on object
NewRoomNPC(1, 3, 10, 157);
RunDialog (6);
MoveCharacter(1, 96, 170);
RunDialog (7);
}

I have managed to make my player character do a similar scene, though.
When I did that I just used the Interaction Editor and didn't do any scripting. That doesn't seem to work with this issue, because I get an error in the MoveCharacter command, that says that the Character isn't in the room ???

Thanks in advance :D

Ashen

IIRC, RunDialog commands are processed at the end of the script, wherever you place them. Also, MoveCharacter isn't blocking - it doesn't wait for the movement to finish before processing the next command.

I think the way round it is to split it between two Run Script commands, the first being:
Code: ags

NewRoomNPC(1, 3, 10, 157);
RunDialog (6);


And the second:
Code: ags

MoveCharacterBlocking (1, 96, 170, 0);
RunDialog (7);

(Look up moveCharacterBlocking to see what the extra 0 is for).

So the Interaction editor would look something like:

Use inventory on object
   Conditional: if inventory item was used
      Run script
      Run script
I know what you're thinking ... Don't think that.

strazer

Possibly NewRoomNPC is delayed as well?
If so, you may need 3 "Run script" actions, the first containing NewRoomNPC, the second RunDialog(6) and the third the rest.

Btw, if the character should just say some text, better use
DisplaySpeech(CHARACTERNAME, "Hello!");

Gorkur

Thank you, thank you, thank you ;D

This means I got it working, thanks to you ;)

SMF spam blocked by CleanTalk