Recognizing when interactions invoked by ProcessClick terminate...?

Started by monkey0506, Mon 18/09/2006 03:29:22

Previous topic - Next topic

monkey0506

I tried to make the subject as insightful as possible as for what it is I'm asking, which is basically...how (if possible) can one determine when the interactions invoked by ProcessClick (also InventoryItem.RunInteraction as InventoryItems are ignored by ProcessClick) are finished executing? ProcessClick (at least in my trials appears to) returns immediately leaving me no way to know when it's really done.

So...anyone have any ideas?

Really what I'm looking to do is this:

Code: ags
// summa-sorta pseudo code!
lblVerbbar.TextColor = 13; // highlight color
if (button == eMouseLeftInv) inventory[game.inv_activated].RunInteraction(mouse.Mode);
else ProcessClick(mouse.Mode);
lblVerbbar.TextColor = 31055; // normal color


Except...as I said...ProcessClick returns immediately, so the label color is restored as soon as...well...as soon as now. Which isn't what I want. But it wouldn't really be reasonable to...well...try adding the color change to the end of every interaction. o.0

Thanks for any info.

Gilbert

Quote from: monkey_05_06 on Mon 18/09/2006 03:29:22
ProcessClick (at least in my trials appears to) returns immediately leaving me no way to know when it's really done.

Even if there're blocking functions in it?

I couldn't understand what you meant, if there're no blocking functions in the ProcessClick() interaction it's just normal that it returns immediately, for example, if you moving a character in that interaction without it set to blocking, the control shall return immediately, since the ProcessClick() interaction had really ended already (though the character is still moving).

monkey0506

Okay, I did a test like this:

Code: ags
// on_mouse_click - from above
else {
  ProcessClick(mouse.x, mouse.y, mouse.Mode);
  Display("ProcessClick returned.");
  lblVerbbar.TextColor = 31055;
  }

// interaction script
player.Say("It's a nice beach I suppose.");
Wait(1); // just to be absolutely sure
Display("Interaction ends.");


And what happens is this:

- The label is highlighted
- The message "ProcessClick returned." is displayed (with the label still highlighted)
- The label is restored to it's default color
- The player character says "It's a nice beach I suppose."
- The message "Interaction ends." is displayed

So basically ProcessClick tells the system to run the interaction, but doesn't wait for the interaction to execute before it returns (even if there are blocking functions in the interaction). But that's what I need to know: when the interaction is finished executing. (I hope I've made myself a bit more clear).

Pumaman

Perhaps the easiest way would be to check IsInterfaceEnabled in repeatedly_Execute, since if no blocking function is running then the ProcessClick interaction must have finished. It probably isn't a perfect solution, though.

monkey0506

I really don't know what the best method for implementation would be...but...could we have something to know when these types of interactions finish? Please?

Khris

I guess you need this for emulating the LA statusline.
Just put
Code: ags
Ã,  lblVerbbar.TextColor = 31055;
somewhere into the repeatedly_execute, it'll work just fine.

monkey0506

That actually worked for a temporary solution. I say temporary because...idealistically...character speech shouldn't pause the game. :-\ So repeatedly_execute would still be run (and the interface would be enabled).

But that runs into other issues as well which is why I'm still trying to figure out what the best method to handle this is. Ultimately I'll probably end up implementing a background-speech-with-animation function and an internal function to test when it's running...but I'm still thinking some things through.

So thanks for the suggestions. Hopefully I'll get the last few kinks worked out here shortly. ;)

SMF spam blocked by CleanTalk