Adventure Game Studio

AGS Support => Beginners' Technical Questions => Topic started by: dikla on Wed 26/05/2004 23:41:46

Title: change inventory item on hotspot?
Post by: dikla on Wed 26/05/2004 23:41:46
i picked up a big ledder in room 1 and the inventory sprite is smaller ledder. now i want to interact with inventory ledder on hotspot in room 3 but i want it to show the big ledder (which is an object in room 1) and not the inventory small ledder. can i change the inventory sprite with the big ledder sprite when "if player use this item"?
tnx dikla
Title: Re: change inventory item on hotspot?
Post by: Akumayo on Thu 27/05/2004 00:58:21
I'm not sure exactly what you mean, do you want the ledder's icon to be a big ledder when you are choosing what to interact with::::or do you want a big ledder to appear after the inventory item has been used on hotspot 3???
Title: Re: change inventory item on hotspot?
Post by: strazer on Thu 27/05/2004 01:22:40
Do you mean letter or ladder? :)

Quotebut i want it to show the big ledder

What do you mean by "it"?
The mouse cursor? A button on a gui?
Title: Re: change inventory item on hotspot?
Post by: Edwin Xie on Thu 27/05/2004 06:08:04
Quote from: strazer on Thu 27/05/2004 01:22:40
Do you mean letter or ladder? :)

Quotebut i want it to show the big ledder

What do you mean by "it"?
The mouse cursor? A button on a gui?

Well, I am asking the same thing! Anyway, if you use it on hot spot 3 there is an interaction to it. Or you could try a script. Anyway here is the script way only simpler. The interaction on hot spot 3 is how you should do it. On room 3 go to the interactions editor. (You should have the big "ledder" as an object at the time) click on use inventory with this object. (lets say the "ledder" was object 0 in the room and it has been set on "Remove object from the room")  On the list, find Run Script and then type ObjectOn (0); (Hmm wait, someone told me about object animation that included this...now I get it) voila, what you want.
Title: Re: change inventory item on hotspot?
Post by: dikla on Thu 27/05/2004 08:44:28
 to: Akumayo
"do you want a big ledder to appear after the inventory item has been used on hotspot 3???"
this is indeed what i want. the big LEDDER object is in room 1. i need to use it in room 3. the item shown in the inventory is a small ledder.  i want to use it on tree, but it looks so small that i want it to chage into the big object. the problem is that i have several trees in room 3 and  the player try it on every tree (so i cant make in room 3 another ledder, make him invisible and then visible because i have to do it in every tree). and i dont know how to make  disapear both big ledder object & the inventory item ledder from the room after using it.
like in the turitorial when you take a small key and have in the inventory big key. i want it reverse. chagne small ledder into big one when it touches the tree. i hope u can understand now. remining you all that the original big ledder is in room 1.
plssssssssss help.
dikla
Title: Re: change inventory item on hotspot?
Post by: Scorpiorus on Fri 28/05/2004 12:37:37
Quotethe problem is that i have several trees in room 3 andÃ,  the player try it on every tree (so i cant make in room 3 another ledder, make him invisible and then visible because i have to do it in every tree).
One way would be indeed to have 3 different ladder objects in room 3 and enable one or another depending on the tree the player clicked on. Another possibility is to have a single ladder object in room 3 but adjust its coordinates depending on the tree that was clicked on:

use ladder inv on tree 1
Object0n(OBJECT_LADDER);
SetObjectPosition(OBJECT_LADDER, x1, y1);
LoseInventory(INVENTORY_ITEM_SMALL_LADDER);

use ladder inv on tree 2
Object0n(OBJECT_LADDER);
SetObjectPosition(OBJECT_LADDER, x2, y2);
LoseInventory(INVENTORY_ITEM_SMALL_LADDER);

use ladder inv on tree 3
Object0n(OBJECT_LADDER);
SetObjectPosition(OBJECT_LADDER, x3, y3);
LoseInventory(INVENTORY_ITEM_SMALL_LADDER);


Notice how LoseInventory is used to remove the appropriate inventory item from the inventory.