Hi,
I have a non-player character (a cat). I'd like cat food to appear on the floor once I have used the box of cat food from the inventory on the cat. I think the trouble I'm having is that interactions with the other character are scripted in the 'global script' whereas so far I've only been making objects visible/not visible in room scripts? My Global script is below;
}
function cCat_UseInv()
{
if (cCharlie.ActiveInventory == iCatFood){
cCharlie.Say("This should distract the cat!");
cCharlie.Walk(235, 275, eBlock, eWalkableAreas);
cCat.Walk(96, 350, eBlock, eAnywhere);
oFood.Visible = true;
}
}
The error message says: Undefined token 'oFood'
My object has a script name of 'oFood' and is in room 3 of my game.
Thanks,
Owain
I have a non-player character (a cat). I'd like cat food to appear on the floor once I have used the box of cat food from the inventory on the cat. I think the trouble I'm having is that interactions with the other character are scripted in the 'global script' whereas so far I've only been making objects visible/not visible in room scripts? My Global script is below;
}
function cCat_UseInv()
{
if (cCharlie.ActiveInventory == iCatFood){
cCharlie.Say("This should distract the cat!");
cCharlie.Walk(235, 275, eBlock, eWalkableAreas);
cCat.Walk(96, 350, eBlock, eAnywhere);
oFood.Visible = true;
}
}
The error message says: Undefined token 'oFood'
My object has a script name of 'oFood' and is in room 3 of my game.
Thanks,
Owain