Menu

Show posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.

Show posts Menu

Topics - Rub

#1
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
 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
#2
Hello guys!

Thank you in advance for any help.

I'd like to include code for  two things in order to advance development of my free game.

It is a text parser. So far I just need two things added to complete the main structure.

One is a high score and the ability to inspect items. Both in the way the SQ3  does it.

I've had no luck trying to use the manual for this. My Script is set to 3.2.1 compatibility since I've been using a template from an 
older version of AGS the whole time. So perhaps this has also caused some issues for me.

I also attached a GIF of the SQ3 inventory interaction I'm  speaking of.

Again, any direction at  all even so I can figure it out on  my own is appreciated. If in the end I truly understand the code involved
in this, then that's even better.

Any advice welcomed!

Cheers!



https://pasteboard.co/hGtLBjVTF1Io.gif[/img]]
SMF spam blocked by CleanTalk