Costume inventory items
I'm mightily embarrassed- it all boiled down to enabling "handle inventory clicks in script". Once I did that I just needed to add a section in on_mouse_click that handles the inventory clicksCode: ags
Everything is working as desired now. For future reference, the script in the previous post works with the exception of player.Say call Ashen pointed out, which now looks likeCode: ags
Resetting the Cursor
I've experimented with calling reset_left_click from within object/hotspot/character interactions in the past. It works, but as you said it's not a very good solution. So I tried your timer suggestion. The timer is set within the on_mouse_click section every time the player clicks in use inventory mode.Code: ags That seems to be enough time for the ProcessClick call to resolve. Then in the repeatedly_execute section the timer is checked and the cursor resets after a brief pause.Code: ags Both of my problems are now solved! Thank you for your patience with my underdeveloped scripting skills. I'll repay the debt by working hard to make a good game and answering questions in the Beginners' Technical Forum!
I'm mightily embarrassed- it all boiled down to enabling "handle inventory clicks in script". Once I did that I just needed to add a section in on_mouse_click that handles the inventory clicks
else if (button == eMouseLeftInv) { // left click within inventory gui over an item
// player.Say("Now we're over an inventory item.");
target_inventoryitem.RunInteraction(3); // simulate a click on the target item with the "talk to" verb
}
Everything is working as desired now. For future reference, the script in the previous post works with the exception of player.Say call Ashen pointed out, which now looks like
player.Say("I'm reading a click on the %s.", target_inventoryitem.Name);
Resetting the Cursor
I've experimented with calling reset_left_click from within object/hotspot/character interactions in the past. It works, but as you said it's not a very good solution. So I tried your timer suggestion. The timer is set within the on_mouse_click section every time the player clicks in use inventory mode.
if (player.ActiveInventory != null) {
ProcessClick(mouse.x, mouse.y, 4);
SetTimer(1, 10); // Here's where the reset timer is set
}
// begin reset timer script
if (IsTimerExpired(1)) {
reset_left_click();
}