I have a situation whereby an inventory item graphic changes if another inventory item is used on it.
This happens twice for the same inventory item.
What I am trying to achieve is to change the images graphic on cursor when selected.
At the moment they all share the same graphic as stipulated in the inventory item panel.
How can I change it to show current item after its inventory graphic has changed.
Would it be better to have individual inventory items rather than change its graphics?
Using inventory on the inventory item istaff:
Code: AGS
When correct inventory image is used on a painting: // CURSOR SHOULD BE NEW INVENTORY GRAPHIC
Code: AGS
This happens twice for the same inventory item.
What I am trying to achieve is to change the images graphic on cursor when selected.
At the moment they all share the same graphic as stipulated in the inventory item panel.
How can I change it to show current item after its inventory graphic has changed.
Would it be better to have individual inventory items rather than change its graphics?
Using inventory on the inventory item istaff:
function istaff_UseInv(
{
if (cELF.ActiveInventory==ithread)
{
istaff.Graphic=615;
cELF.LoseInventory(ithread);
}
else if (cELF.ActiveInventory==ineedle && istaff.Graphic==615)
{
istaff.Graphic=616;
cELF.LoseInventory(ineedle);
Display("You now have a makeshift fishing rod.");
}
else if (cELF.ActiveInventory==ineedle && istaff.Graphic==593)
{
Display("You need to have line on the broom before you add a bent needle so you can have a makeshift fishing rod.");
}
}
When correct inventory image is used on a painting: // CURSOR SHOULD BE NEW INVENTORY GRAPHIC
function opainting_UseInv()
{
cELF.Walk(139, 260, eBlock, eWalkableAreas);
cELF.Loop=1;
if (cELF.ActiveInventory==istaff && istaff.Graphic==616)
{
cELF.StopMoving();
cELF.SetWalkSpeed(1, 1);
orod.Visible=true;
cELF.Move(cELF.x -0, cELF.y +70, eNoBlock, eAnywhere);
orod.Move(orod.X -0, orod.Y +70, 1, eNoBlock, eAnywhere);
opainting.Move(opainting.X -0, opainting.Y +70, 1, eBlock, eAnywhere);
orod.Visible=false;
painting=true;
cELF.Say("What's this?");
cELF.StopMoving();
cELF.SetWalkSpeed(5, 5);
}
else
{
cELF.Say("I don't think that will help move that painting!!");
}
}