Adventure Game Studio

AGS Support => Advanced Technical Forum => Topic started by: spook1 on Thu 17/06/2004 23:10:13

Title: change inventory picture when using it.
Post by: spook1 on Thu 17/06/2004 23:10:13
I created a puzzle where you have to melt your way out of a cell with plexiglass windows, using a solder stift.
I want to change the inventory picture when the solder stift is connected to a voltage, to indicate that it is hot.

is there a function to do it ( i cannot find it either in the help and teh search through forums) or do I have to "do it the hard way, using ChangeCursorGraphic.

something like :

if (ActiveInv ==23 AND stift = hot){
   changecursorgraphic( xx);
}

cheers,

martijn
Title: Re: change inventory picture when using it.
Post by: Ashen on Fri 18/06/2004 00:16:55
You could create a new inventory item for the 'hot' version, and set it to replace the 'cold' version when you combine it with the power source.

Otherwise, I think you use SetInvItemPic (), not ChangeCursorGraphic (). Then you can use GetInvGraphic () to make sure the player is using the hot version, not the cold.
Title: Re: change inventory picture when using it.
Post by: spook1 on Fri 18/06/2004 10:34:30
Thanks for the smart suggestion of the second item to replace the first one.

I tried SetInvPic and found that it does not change the invitempic when it is already selected. Maybe I did something trivial wrong there. Anyway, I'll go for the replacement option.

cheers, martijn
Title: Re: change inventory picture when using it.
Post by: Scorpiorus on Fri 18/06/2004 14:17:29
Quote from: spook1 on Fri 18/06/2004 10:34:30I tried SetInvPic and found that it does not change the invitempic when it is already selected.
Hmm, I just tried and it works for me:

int currentItem = character[GetPlayerCharacter()].activeinv;
SetInvItemPic (currentItem, NEW_SLOT);