Hey AGSers! It's Dan here! Like usual I am in need of some help again here. I am having a strange problem when I try to use a certain inventory item on another item. The problem is the game just freezes and waits forever. Is anyone else aware of a problem similiar? I put this in the ineraction editor in a run script/ under a conditional: if inventory item was used action
Wait(5);
FaceLocation(EGO, 150, 1000);
DisplaySpeech(EGO, "I think I can hide the crowbar inside this thing!");
Wait(10);
FaceLocation(EGO, 150, -1000);
Wait(10);
FaceLocation(EGO, 150, 1000);
Wait(15);
DisplaySpeech(EGO, "I knew this dumb thing would come in handy somewhere!");
Wait(5);
LoseInventory(13);
Wait(8);
GiveScore(4);
Wait(8);
SetGlobalInt(25,1);
Nothing looks wrong with this but for some apparent reason everything just locks up. If anyone knows a way to fix this or has had this happen to them please let me know. So then I will know that I am not going crazy the problem does exist.
Thanks
Daniel
Winebarger
Hmmm what's the mode of the GUI with the inventory set to? If it's set to "popup-modal" the game is paused while the GUI's on, so the character speech etc things may not get executed.
To fix this, try setting the GUI to some other mode, or close the GUI first when the action is called:
GUIOff(2);// change "2" to appropiate GUI #
Wait(5);
FaceLocation(EGO, 150, 1000);
DisplaySpeech(EGO, "I think I can hide the crowbar inside this thing!");
Wait(10);
FaceLocation(EGO, 150, -1000);
Wait(10);
FaceLocation(EGO, 150, 1000);
Wait(15);
DisplaySpeech(EGO, "I knew this dumb thing would come in handy somewhere!");
Wait(5);
LoseInventory(13);
Wait(8);
GiveScore(4);
Wait(8);
SetGlobalInt(25,1);
GUIOn(2);//in case you want it back afterwards
Hey Gilbot! Thanks alot you were right the problem was the gui being in the way I just turned it off in the script before running the rest of the code. Thanks for the help I appreciate it.
Daniel
Winebarger