Here's the deal. I have a hotspot and I want the player to say various things depending which item he uses on that hotspot.
Code:
function hDRAIN_PIPE_UseInv()
{
player.ActiveInventory = iNOTEBOOK;
player.Say("Why would I want to stick it in there?");
player.ActiveInventory = iHANDSAW;
player.Say("Why would I want to stick it in there?");
player.ActiveInventory = iSHIRT;
player.Say("Why would I want to stick it in there?");
player.ActiveInventory = iBUCKET;
player.Say("I can't.");
player.Say("The drain pipe is dry.");
}
Now the error I'm getting is this that the player doesn't have one of the items, and the game crashes. But he may have that item later on in the game and use it then. What can I do to make player say various things with using many different items? For example: a hotspot on which player can use every single item which will be available in the game.
I think you're missing 'If', so it would be;
if player.ActiveInventory = iNOTEBOOK; {
player.Say("Why would I want to stick it in there?"); }
if (player.ActiveInventory == iNOTEBOOK){
//functions go here
}
thanks dualnames, that worked.
Yeah, you were just setting the players active inventory item to iWhatever each time.
if (player.ActiveInventory == iNOTEBOOK)
Will work (remember: '=' for setting things, '==' for comparing things).