Hi, I have been working on my first game and am nearing completion. I have mostly just used the menu system but in some places have written some script.
I am having a problem with interactions between some items in the inventory. Say there are 3 items in the inventory, a flag, a dog and a toothbrush. Because the toothbrush can be used by one of the characters I have set it up so that if the toothbrush is clicked in the inventory the cursor changes from the standard pointer to a toothbrush. If the flag or dog are clicked in the inventory the cursor stays as the standard pointer. The items all work fine in the game itself. In the inventory commands I have used 'Item dropped' so that if the flag is dropped on the dog or toobrush the character says 'That won't work', similarly if the dog is dropped on the flag or toothbrush the character says 'That won't work'. This part is all working fine. However, because I have set up the toobrush so that when you click on it, it changes to a toobrush cursor, the toothbrush is not able to be dropped on the dog or flag.
I think I need to do something like:
1) If cursor is pointer then if item dropped on another item in inventory, character says 'That won't work'
2) If cursor is not pointer then if click on item in inventory, character says 'That won't work'
I am able to get each of these working independently but not concurrently.
Any suggestions on what approach I should use?
Thank you for your help
The dragged items (eg the dog and the flag) work fine, and as you've suggested I have used a dropped item (immediate action).
For items that are used on the character (eg the toothbrush) I thought it looked a bit strange when they were dragged and used on the character as they were too big in relation to the character. So what I did was when you click on the toothbrush in the inventory the cursor changes to a toothbrush which is then used by clicking on the character.
So my inventory has a combinationof items that are dragged and items that when you click on them the cursor changes to that object. Everything in the game works OK, but now that I've come to this problem with interactions in the inventory I am thinking that maybe I should have set things up differently?
In relation to your question I was trying to keep the game play simple so the only command I have used throughout is left click. But maybe I should look at changing this?
Thank you both for your suggestions, I agree it seems that I should use a command and change cursor system. I found an earlier thread originally posted by lyra on 16/2 (I couldn't work out how to add a link in this post) that I think has some instructions on how to do this? Do you know whether one of the example games that can be downloaded uses this approach so that I could see how it is done?
At the moment I have two interfaces (1) a mouse interface with a left click button and (2) an inventory interface. So to use the command and change cursor system would I need to add a command button for each item to the mouse interface?
Thank you both for your suggestions, I agree it seems that I should use a command and change cursor system. I found an earlier thread originally posted by lyra on 16/2 (I couldn't work out how to add a link in this post) that I think has some instructions on how to do this? Do you know whether one of the example games that can be downloaded uses this approach so that I could see how it is done?
At the moment I have two interfaces (1) a mouse interface with a left click button and (2) an inventory interface. So to use the command and change cursor system would I need to add a command button for each item to the mouse interface?
Thank you for all that detailed information I was able to follow your instructions to get it working.
Using this approach what is the best way to deal with incorrect interactions (1) between scene objects and items and (2) between items? For example if there is a scene object a rubbish bin and there is an item a piece of rubbish, and the player is supposed to put the rubbish in the bin, I can follow your example to see that for the rubbish bin object I would use the Execution type 'Executed command on object' with command 'Rubbish'. What though about items that players try to put in the rubbish bin that don't belong there? For example there may be 10 other items that should not be put in the rubbish bin. Using the default system I would have used the Execution type 'Item dropped' '[any item)' to add text to say 'That doesn't belong in the bin'. I couldn't work out what would be the equivalent in the command and change cursor system.