Display message when interacting with inventory

Started by sloppy, Tue 15/11/2005 21:15:25

Previous topic - Next topic

sloppy

Here's a question:
I have it that you use one inventory item with another and you end up with another inventory item.  Then I have a display message saying that.    But what happens is that the message appears before the third item appears in the inventory.  You have to click the message away before you see the inventory object.

How can I force the display message to be the last thing that appears after everything else happens?

Ubel

You could try to put:
Code: ags
Wait(1);

in between the AddInventory and Display codes.

Or if you are not using script codes, just use the "Pause command processor" option between them and give it the value 1.

I hope that was clear enough.

sloppy

Your first suggestion doesn't seem to work.
Here's what I put in the inventory 1 "use inventory on this item" interaction:
if (player.ActiveInventory==inventory[2]) {
player.AddInventory(inventory[3]);
player.LoseInventory(inventory[1]);
player.LoseInventory(inventory[2]);
Wait(1);
Display("You've made a new object.");Ã, 
}
The display message still appears before inventory 1 & 2 disappears and inventory 3 appears.

And I don't know what this means.Ã,  I can't find a "pause command processor" option:
Quote from: Pablo on Tue 15/11/2005 21:29:54
Or if you are not using script codes, just use the "Pause command processor" option between them and give it the value 1.

strazer

You can add several "Run Script" actions for the same interaction. Try adding another "Run Script" action and put the Display command in there.

sloppy


strazer

Glad to hear it.
It seems AddInventory and LoseInventory commands are indeed delayed-response functions, meaning they don't execute immediately but rather when the current script ends.

Btw, you can also use this workaround if you want to do stuff after a dialog has ended, because RunDialog is also a delayed-response function.

SMF spam blocked by CleanTalk