Different Sprites Within Inventory?

Started by Blane, Tue 18/08/2009 22:46:19

Previous topic - Next topic

Blane

I'm wondering how you would, for example, have the sprite of an object change when it's in your inventory?

As in:

There is a paper on a table, lying at an angle to fit the table. When it's in your inventory, it is at a totally straight angle so you can see what it is.

I know this can be done, but I'm not sure how.

Ethan D

For the one on the table use an object with one image.  For the inventory item use another image.  It's that simple

Khris

Yes, note that room objects and inventory items don't have any connection whatsoever except in the mind of the game designer.

Blane

So in the same part of the script where I add the object to the inventory, I should also use a change image command of some kind?

monkey0506

No. You should use room objects and inventory items as you've been told. The "Starting off" tutorial located in the manual (parts 4 and then 5 respectively) would be great help with this.

Essentially what you're wanting to do is:

Code: ags
// room script
// player picks up object event handler
  oPaper.Visible = false;
  player.AddInventory(iPaper);


Where oPaper is the room object and iPaper is the inventory item.

Blane


SMF spam blocked by CleanTalk