Problem with dialog in scrolling room (SOLVED)

Started by Akatosh, Wed 16/08/2006 12:00:33

Previous topic - Next topic

Akatosh

I don't know whether I'm just dumb or this is an error in AGS. I'm trying to have cEGO have a 'dialog' with another character in a big scrolling room, in about first to second quarter. The whole script structure is as following:

if (player.ActiveInventory == inventory[18])
{
DisplayMessage(17);
RunDialog(13);
// goes on, but not important here
}

If I now get this situation in game, cEgo walks up to the walk-to point, and Message 17 gets displayed. Then suddenly he 'jumps' somewhat to the left, all over sudden - he doesn't walk, no fade in/out just jumping. The first message the other character says is displayed out-of-screen, that is to say - where it is supposed to be. cEgo says his text, and the next message of cOtherMan is displayed exactly in the screen middle.

In another interesting fact, one other dialog at exactly the same position works just fine. It's triggered by the 'talk' cursor, anyway, not 'use inventory'.

Of course, I then assumed it had to do with a dumb scripting error of mine, and made the commands exactly the same as with the other dialog - just changed the dialog number from 1 to 13. It still did NOT work.

So I started to assume it had to do with the not-being-a-real-dialog-ness of the dialog. So I redid it and added some actions. It still did NOT work.

Getting more and more desperate, I replaced the use-inventory-thing with a talk action inculding a check whether the item was in the inventory or not. And it WORKED, just fine and perfect. I back-changed it to use-inventory, and it nearly instantly STOPPED WORKING.

I've tried about everything - setting walk-to-points, walking, facing directions, removing walk-to-points, ... so I'm quite sure I *haven't* just made a dumb scripting.

So I assume: There is a strange bug in the use-inventory-run-dialog thing.


Other information:

Room properties - 959x200, true color, res 320x200


Position EGO jumps to:

x - about 158
y - no change


strazer

Quote from: Akatosh on Wed 16/08/2006 12:00:33// goes on, but not important here

It may not be that unimportant. RunDialog is a delayed-response function, meaning it gets executed when the current script ends, not immediately. So the stuff you have put after it is actually being executed before the dialog starts.
So please post the complete script.

You can put the stuff you want to happen after the dialog into a separate, second "Run script" action for the same interaction event, i.e.
  Use inventory on character
    --> Run script // RunDialog is last command
    --> Run script // Put everything happening after the dialog in here
Remember, you have to put the if-clause in there too since they're separate scripts.

Quote from: Akatosh on Wed 16/08/2006 12:00:33In another interesting fact, one other dialog at exactly the same position works just fine. It's triggered by the 'talk' cursor, anyway, not 'use inventory'.

In what events have you put the scripts? Use inventory on character? Use inventory on hotspot (since you mention walk-to points)? Talk to character? Talk to hotspot?

Akatosh

#2
It's *talk to hotspot* and *use inventory on hotspot*.

And I've looked through the script again. There's a 'go to a different room at specific coordinates' later on, but this thing gets executed right *after* the dialog. cEgo doesn't change -> talk, he talk->changes.

Edit:

Still there?

strazer

No need to bump your thread just yet. It's still on the front page!
I think CJ is still at Mittens, if you're looking for a reply from him.

It would help diagnosing your problem if you posted the rest of your script. Or you could upload the game somewhere for us to take a look.

In the meantime, maybe you could clarify a few things:

Do you really want to run a dialog with RunDialog? You only need that if you want the player to choose a dialog option from a list. If you just want the characters talk to each other without player interaction, use the Character.Say command.

Do you have LucasArts or Sierra-style speech enabled? What's the character's talking view set to? Remember, Sierra-style speech is used to display a close-up portrait of the character in the screen corner. Check this thread to see what I mean.

When the character jumps, does the screen scroll with it? Post a few screenshots to demonstrate the problem.

And please, post the exact script you're trying to use. Maybe there's something you've overlooked after all.

Gilbert

Quote from: Akatosh on Thu 17/08/2006 13:00:55
There's a 'go to a different room at specific coordinates' later on, but this thing gets executed right *after* the dialog.

I'm not quite sure, it should be executed at the end by design of the engine if it's really a different room, but did you happen to set the room number to the same room the character's currently in? In that case, since the room hadn't been changed (just the character's coordinates because you told him to), it might be possible that the "change" room command be executed before the dialog (again, I'm not sure about this one).

Akatosh

#5
-> I am using LucasArts speech

-> The character has NO speaking view

-> The room does jump along with the character, that is, he stays about the same position in-screen

-> Nope, the room number definitly is a different one. The character *does* change the room afterwards, just as intended. Anyway, the room transistion style is set to "fade out/in" and the screen isn't tinted.

-> I was just trying to use RunDialog because I already reached the 99-messages-maximum (in the meantime, I solved the problem with a script. Anyway, this 'jumping' is still strange... what if i wanted to use the choice thing?)

The complete script, as it used to be after I finally stopped trying (backup hooray!):

if (player.ActiveInventory == inventory[18])
{
cEgo.Walk(372,164);
cEgo.FaceLocation(370,0);
player.LoseInventory(inventory[18]);
SetGraphicalVariable("PassWord", 1);
DisplayMessage(17);
RunDialog(13);
player.ChangeRoom(19, 158, 175);
}

And I think I'll just upload it if it turns out there definitly is no other choice - 56K, you know. But I'm quite sure you can reproduce it with the script code above.

strazer

  cEgo.Walk(372,164);
You haven't used the blocking option, meaning the script doesn't wait for the walking to finish before executing the next script command. Change it to:
  cEgo.Walk(372,164, eBlock);

Next up:

  RunDialog(13);
  player.ChangeRoom(19, 158, 175);
RunDialog and Character.ChangeRoom are both delayed-response functions, meaning they execute when the current script finishes. You can't use these two like that, since both try to execute when the script finishes. They somehow conflict with each other and so the character probably just jumps to the ChangeRoom coordinates, but doesn't actually change the room.

As I've tried to tell you in my first post, put everything you want to happen after the dialog, i.e.
  player.ChangeRoom(19, 158, 175);
in a second "Run script" action for the same event. This way the dialog runs, and after it has finished, the second "Run script" with the ChangeRoom command is executed.

Akatosh

whoops sorry :(

*is now feeling really dumb*

strazer

Don't. We were all beginners at some point. :)

Does that mean your problem is solved now?

Akatosh

It should solve it... well, I think I'll use the dialog feature a lot less in future ;)

SMF spam blocked by CleanTalk