I'm now having another really odd problem.

This is a public forum, where you can find out everything you wanted to know about making games. Please don't use this forum as a place to recruit new members.

Moderators: adeyke, VampD3, eriqchang, Angelus3K

Post Reply
Message
Author
dungeonsofdorks
Royal Servant Status
Posts: 116
Joined: Tue May 04, 2004 3:07 pm
Contact:

I'm now having another really odd problem.

#1 Post by dungeonsofdorks » Fri Jul 13, 2007 4:00 pm

" Type mismatch: Cannot convert 'Object*' to 'int' "

I have a conditional set up "if checked door = 1, rundialog blah de blah"

if checked door = 0, run this script:

here it is in the room script.

function object0_b() {
 // script for Object 0 (Bathroom Door): Interact object
character[EGO].Walk(161,  106, eBlock, eWalkableAreas);
RunDialog(;
object[oBdoor].SetView(0, 3);
object[oBdoor].Animate(0, 4, eOnce, eBlock, eForwards);
character[EGO].ChangeView(9);
object[oBdoor].Animate(1, 4, eOnce, eBlock, eForwards);
Wait(240);
object[oBdoor].Animate(0, 4, eOnce, eBlock, eForwards);
Wait(30);
object[oBdoor].Animate(1, 4, eOnce, eBlock, eForwards);              < - - - - This is the line it is having a problem with.
character[EGO].ChangeView(1);
character[EGO].FaceLocation(180, 20, eBlock);
RunDialog(12);
PlaySound(4);
RunDialog(13);
SetGraphicalVariable("checked door", 1);
return;
}

Help?

dungeonsofdorks
Royal Servant Status
Posts: 116
Joined: Tue May 04, 2004 3:07 pm
Contact:

#2 Post by dungeonsofdorks » Fri Jul 13, 2007 4:14 pm

Ok... I fixed it...

character[EGO].Walk(161,  106, eBlock, eWalkableAreas);
RunDialog(;
object[0].SetView(3);
object[0].Animate(0, 4, eOnce, eBlock, eForwards);
character[EGO].ChangeView(9);
object[0].Animate(0, 4, eOnce, eBlock, eForwards);
Wait(240);
object[0].Animate(0, 4, eOnce, eBlock, eForwards);
Wait(30);
object[0].Animate(1, 4, eOnce, eBlock, eForwards);
character[EGO].ChangeView(1);
character[EGO].FaceLocation(180, 20, eBlock);
RunDialog(12);
PlaySound(4);
RunDialog(13);
SetGraphicalVariable("checked door", 1);
return;


Problem is things happen in all kinds of weird order. GAH. As in, he walks to it, it opens, he steps in, it opens and stays open, it closes and opens, he appears, it makes a sound... then all 3 dialogs run.

Erpy
Forum Administrator
Posts: 11434
Joined: Tue Sep 25, 2001 8:28 pm
Location: The Netherlands

#3 Post by Erpy » Fri Jul 13, 2007 4:15 pm

Code: Select all

function object0_b() { 
 // script for Object 0 (Bathroom Door): Interact object 
character[EGO].Walk(161,  106, eBlock, eWalkableAreas); 
RunDialog(; 
oBdoor.SetView(0, 3); 
oBdoor.Animate(0, 4, eOnce, eBlock, eForwards); 
character[EGO].ChangeView(9); 
oBdoor.Animate(1, 4, eOnce, eBlock, eForwards); 
Wait(240); 
oBdoor.Animate(0, 4, eOnce, eBlock, eForwards); 
Wait(30); 
oBdoor.Animate(1, 4, eOnce, eBlock, eForwards);              < - - - - This is the line it is having a problem with. 
character[EGO].ChangeView(1); 
character[EGO].FaceLocation(180, 20, eBlock); 
RunDialog(12); 
PlaySound(4); 
RunDialog(13); 
SetGraphicalVariable("checked door", 1); 
return; 
}
This is how it SHOULD look. The syntax was simply wrong, but the code in itself was okay.

As an alternative you could have written:

Code: Select all

object[0].Animate(1, 4, eOnce, eBlock, eForwards);              < - - - - This is the line it is having a problem with. 
assuming, of course, that oBdoor was the first object in the room. The latter approach is only useful if you're trying to adress room objects from the global script.

Image

dungeonsofdorks
Royal Servant Status
Posts: 116
Joined: Tue May 04, 2004 3:07 pm
Contact:

#4 Post by dungeonsofdorks » Fri Jul 13, 2007 4:29 pm

Aha. Thanks. I still have the problem of things out of order. Here's my edit...

Code: Select all


  // script for Object 0 (Bathroom Door): Interact object
  
if (GetGraphicalVariable("bdoor") == 1) {

RunDialog(6);

}

if (GetGraphicalVariable("bdoor") == 0) {

character[EGO].Walk(161,  106, eBlock, eWalkableAreas);
RunDialog(8);
oBdoor.SetView(3);
oBdoor.Animate(0, 4, eOnce, eBlock, eForwards);
character[EGO].ChangeView(9);
oBdoor.Animate(0, 4, eOnce, eBlock, eForwards);
Wait(240);
oBdoor.Animate(0, 4, eOnce, eBlock, eForwards);
Wait(30);
oBdoor.Animate(1, 4, eOnce, eBlock, eForwards);
character[EGO].ChangeView(1);
character[EGO].FaceLocation(180, 20, eBlock);
RunDialog(12);
PlaySound(4);
RunDialog(13);
SetGraphicalVariable("bdoor", 1);
return;
}


again...
Problem is things happen in all kinds of weird order. GAH. As in, he walks to it, it opens, he steps in, it opens and stays open, it closes and opens, he appears, it makes a sound... then all 3 dialogs run.

dungeonsofdorks
Royal Servant Status
Posts: 116
Joined: Tue May 04, 2004 3:07 pm
Contact:

#5 Post by dungeonsofdorks » Fri Jul 13, 2007 5:51 pm

Okay, I just had something out of order. However!

Dialog 8 is still playing at the end, right before 12 and 13. It doesn't happen when it's supposed to. I don't get it.

Back when I was doing "display message" or "character.say" functions, I didn't have this problem. Why should it be different with dialog?

Hell with it. I'll try calling a script from dialog 8.

Erpy
Forum Administrator
Posts: 11434
Joined: Tue Sep 25, 2001 8:28 pm
Location: The Netherlands

#6 Post by Erpy » Fri Jul 13, 2007 6:53 pm

That's because unlike display and .say, rundialog can trigger other pieces of code, hence AGS won't run the actual dialog until all code in that block is processed. You'll have to run the code after dialog 8 from within dialog 8.

Image

Post Reply