Adventure Game Studio

AGS Support => Beginners' Technical Questions => Topic started by: irafreak on Fri 14/05/2010 18:50:10

Title: End of dialog Move Main character to new room at set coordiates starts early
Post by: irafreak on Fri 14/05/2010 18:50:10
I searched but not sure how this one would be categorized.  Looked in bugs as it may be an issue.

I have a dialog that runs and at the end of the dialog it sends the main character to a new room at set coordinates...it works fine...the problem is that it sets the character to the coordinates first...meaning the dialog begins and the character moves to the coordinates in the current room through the whole dialog....then moves to a new room when the dialog ends.

I changed the command to be move character to new room without the coordinates and no problem. So why does the coordinates command activate early?  There is no scripting on my part involved with this just the option drop down boxes. 
Title: Re: End of dialog Move Main character to new room at set coordiates starts early
Post by: barefoot on Fri 14/05/2010 19:18:00
You should include the Dialog so we can check it out..

I've used this and it works:


// Dialog script file
@S  // Dialog startup entry point
cDmg: Which is the world's largest ocean?
return
@1
cRedpants: Atlantic
cDmg: Wrong. You are on your own! Pass by
 player.ChangeRoom(28,300,106);
stop
@2
cRedpants: Indian
cDmg: Wrong. You are on your own! Pass by
player.ChangeRoom(28,300,106);
stop
@3
cRedpants: Pacific
cDmg: Correct. My next question is
goto-dialog10



barefoot
Title: Re: End of dialog Move Main character to new room at set coordiates starts early
Post by: Calin Leafshade on Fri 14/05/2010 22:34:31
Yea dialogs works by flagging the dialog to run at the end of the current function.

so script commands you want to run after a dialog must be done *inside* the dialog script.

Script commands can be put into dialog by prefixing them with a space or tab.
Title: Re: End of dialog Move Main character to new room at set coordiates starts early
Post by: irafreak on Sat 15/05/2010 01:47:36
I tried adding it into the dialog but i continue to get errors.  I'm using version 2.72 by the way.  I put in the space after the stop command but it give me the error.

I try to use           cEgo.ChangeRoom(7, 58,121)
but all i get is unknown command cEgo       
Title: Re: End of dialog Move Main character to new room at set coordiates starts early
Post by: irafreak on Sat 15/05/2010 01:48:56
No dice.  I add that code for the character move with the space but it still doesn't recognize the command in the dialog.  I'm searching now to find what works. 
Title: Re: End of dialog Move Main character to new room at set coordiates starts early
Post by: ThreeOhFour on Sat 15/05/2010 02:01:31
2.72 doesn't support these types of functions inside your dialogs.

Either upgrade to the latest version, or get used to using run-script x and function dialog_request() - you'll have to put any non-dialog specific code in using this if you want to stick with 2.72
Title: Re: End of dialog Move Main character to new room at set coordiates starts early
Post by: irafreak on Sat 15/05/2010 02:21:49
Ah thanks a lot.