Help me perfect my multi-inventory system!

Started by Rui 'Trovatore' Pires, Mon 05/04/2004 18:53:13

Previous topic - Next topic

Rui 'Trovatore' Pires

OK - I've got a problem. It's code-related, but I can't just copy/paste the code here, 'cause the problem may be caused by something else, and besides, it relies a lot on the context, so I've uploaded a template. Kindly download it and help me...

So I got three inventory "places", right? 1, 2 and 3 (in the game they'll represent containers). Now, I can switch through them and carry items between them, and I can even drop them in the room...

!!!BUT!!!

After messing with them awhile, I found out that they always ended up in the same order - first the oil can, then the broom, and then the lamp. Incidentally, that's their INV number - oil can is item #1, broom is #2, lamp is #3. This is the behavious I want to elliminate.
One of the things the current code does is get the 1st inventory item in the list via a GetInvAt command. I thought that wouldn't gibve me any trouble, since it processes the items in the order they are found in the inventory window. BTW, this also happens in the DROP inventory window.

One sidenote - this behaviour may be related to the function that is run when any given item is picked up - since some containers have limits and in order to put down the item (or try to) in that container the format used was "USE INV ON (itself)", I had to do it so that every time the player picks the item up, it is added to the other containers, and when he puts it down, it is removed.

...help please? It works very fine like it is, but it's not what I want, and I've run out of ideas. Please, ye sages of AGS scripting!...

http://www.agagames.com/redrum/problem.agt
Reach for the moon. Even if you miss, you'll land among the stars.

Kneel. Now.

Never throw chicken at a Leprechaun.

Scummbuddy

#1
can you call a randomizer function to select where to put the inventory into what slot?

like when you go to pick up an inventory item?
- Oh great, I'm stuck in colonial times, tentacles are taking over the world, and now the toilets backing up.
- No, I mean it's really STUCK. Like adventure-game stuck.
-Hoagie from DOTT

Rui 'Trovatore' Pires

No, cause when I mean "pick up" I mean get it from the inventory window. Anyway, the very same thing happens when the character gets an item from the ame world. Think Discworld I, wherev you have to place the item yourself in the inventory. And because of the container limitations, the player should be able to choose his own. It can't be random.
Reach for the moon. Even if you miss, you'll land among the stars.

Kneel. Now.

Never throw chicken at a Leprechaun.

Pumaman

When you switch between containers, does it change the player character?

The inventory window currently keeps track of the order that items are added to it, until such a time as the player character is changed, at which point the items switch back to the default order.

Rui 'Trovatore' Pires

#4
Ah! I didn't know that! Ok, I'll fiddle with it a bit keeping THAT in mind to see if I can work around it. If not, it'll have to remain as it is. Thanks!

EDIT - Hmm, I HAVE to change the player character in order to update the inventory in order to get the items by their wanted order (and there's no workaround THIS, even if I didn't use GetInvAt, anything I can use needs an updated inventory). CJ, could you change this behaviour, or make it "toggleable"?
Reach for the moon. Even if you miss, you'll land among the stars.

Kneel. Now.

Never throw chicken at a Leprechaun.

Pumaman


Rui 'Trovatore' Pires

Oh by all means, add it to your list... but would it be too much to ask, if I were to ask you to add it quite soon?  ::)
Reach for the moon. Even if you miss, you'll land among the stars.

Kneel. Now.

Never throw chicken at a Leprechaun.

SMF spam blocked by CleanTalk