Hello friends
I'm trying to allow the player to drop an item from their inventory.
So far I'm working with if
Code: ags
I've tried some other variations of this with no luck. For example placing this under the "Parser.ParseText(input); line in the Global settings. Also using player.LoseInventory(InventoryItem *item) <--- this one turned up errors I think are well beyond my understanding right now.
I've also tried static InventoryItem* iKey.GetAtScreenXY(int x, int y)
The manual suggests cEgo.LoseInventory(iKey); then directs me to Character.InventoryQuantity
But I could not figure out (without errors) where to place it in the global settings properly. I'm guessing I need to use the correct function, but I just can't think of which one it is.
I should mention, just in case, that my game has no characters visible in any room. Although they do exist. The way the player picks items is through the parser, which in the script triggers the item within a region which covers the entire room.
Thank you guys for any help, even if it's just direction.
*UPDATE*
Using else if (Parser.Said("drop key")){
player.LoseInventory(iKey); within the Parser.ParseText(input);
The player indeed drops the item but now the item is nowhere to be seen, however the player CAN pick it up again. I'd imagine this has something to do with InventoryItem* iKey.GetAtScreenXY(int x, int y). Perhaps the items is being returned to a "hidden" place, or something along those lines. I should mention that after testing. If the player drops the key in a different room than where it was found, the player cannot recover it from there. It only works in the place were the object/inventory item was originally. However it doesn't visibly return to its starting place.
Any direction is appreciated!
Cheers
I'm trying to allow the player to drop an item from their inventory.
So far I'm working with if
if (Parser.Said("drop key")){
player.LoseInventory(iKey);
I've tried some other variations of this with no luck. For example placing this under the "Parser.ParseText(input); line in the Global settings. Also using player.LoseInventory(InventoryItem *item) <--- this one turned up errors I think are well beyond my understanding right now.
I've also tried static InventoryItem* iKey.GetAtScreenXY(int x, int y)
The manual suggests cEgo.LoseInventory(iKey); then directs me to Character.InventoryQuantity
But I could not figure out (without errors) where to place it in the global settings properly. I'm guessing I need to use the correct function, but I just can't think of which one it is.
I should mention, just in case, that my game has no characters visible in any room. Although they do exist. The way the player picks items is through the parser, which in the script triggers the item within a region which covers the entire room.
Thank you guys for any help, even if it's just direction.
*UPDATE*
Using else if (Parser.Said("drop key")){
player.LoseInventory(iKey); within the Parser.ParseText(input);
The player indeed drops the item but now the item is nowhere to be seen, however the player CAN pick it up again. I'd imagine this has something to do with InventoryItem* iKey.GetAtScreenXY(int x, int y). Perhaps the items is being returned to a "hidden" place, or something along those lines. I should mention that after testing. If the player drops the key in a different room than where it was found, the player cannot recover it from there. It only works in the place were the object/inventory item was originally. However it doesn't visibly return to its starting place.
Any direction is appreciated!
Cheers