Adventure Game Studio

AGS Support => Beginners' Technical Questions => Topic started by: Intangible on Fri 03/06/2011 13:31:57

Title: Transition from Dialog to "death screen" - cursor glitch
Post by: Intangible on Fri 03/06/2011 13:31:57
I have a dialog option that can get you killed, which results in a very brief animation and then a fairly standard-issue "King's Quest"-style dialog informing you that you're dead and need to restart/restore/quit. This dialog works very well in any other "death" scenario, but I've noticed that when I try to introduce it directly from a dialog, my cursor is still a "Talk" icon, instead of the "Pointer" icon I'd normally get. Here is a simplified version of the code (for artistic context, you can briefly play as the bad guy, and if you hassle the character Megan too many times she shoots you with an overpowered tazer):

// ---- In the Dialog -----
@4
MEGAN: You just don't get it, do you? This has gone on long enough!
 MeganVaporizeMerchant();
stop

// ---- In the script file ----
function BeginShowModalDialog()
{
 gIconbar.Visible = false;
 mouse.UseModeGraphic(eModePointer);
}

function PromptDeath(const string text)
{
 BeginShowModalDialog();
 lblDeathText.Text = text;
 gDeath.Visible = true;
}

function MeganVaporizeMerchant()
{
 // ... various lines of code to animate the mechant's brief death

 PromptDeath("That was fun... although it remains to be seen whether the law will side with poor Megan!");
}

Is there a better way I should be doing this? Or am I just missing a necessary line of code? If I call "PromptDeath" while I'm just walking around, the cursor changes to a "Pointer" as I'd expect. It's only in this scenario that the cursor is still the "Talk" icon when the death GUI is showing.
Title: Re: Transition from Dialog to "death screen" - cursor glitch
Post by: Creator on Fri 03/06/2011 14:45:14
I don't know why it's not changing, but try changing the actual mode instead of the graphic.


mouse.mode = eModePointer;


That's what I always do and I'm pretty sure it's always worked, so you can do that unless there's a specific reason to just change the graphic.
Title: Re: Transition from Dialog to "death screen" - cursor glitch
Post by: Khris on Fri 03/06/2011 16:14:21
Yeah, the "stop" command officially ends the dialog and AGS might restore the previous cursor mode.
Title: Re: Transition from Dialog to "death screen" - cursor glitch
Post by: Intangible on Fri 03/06/2011 22:50:10
Yep, that seems to work. Thanks!