I couldn't find an answer to this question, so I just thought I'd post it here.
I didn't realize one of my inventory items were part of the background until I made the room, so now instead of remaking the room to make the room an Object, I decided to make an Object the same colour of the background to appear over part of the background. The problem I have with this is
function hHotspot3_AnyClick()
{
cCharacter.Say("My Antenna.");
cCharacter.Say("That might come in handy.");
cCharacter.Walk(224, 444, eBlock, eWalkableAreas);
cCharacter.AddInventory(iAntenna);
Cover.Visible = true;
}
Doesn't work for me. I've set the objects visibility to be false by default. I think the issue is that the character isn't directly interacting with the Object and wondered if there was a way to do it by proxy.
Thanks, Krutches
Firstly, welcome to AGS :-)
What exactly isn't working? Is it that the character is not even walking up to the antenna, or is it just that the item is not appearing in your inventory?
Have you linked the event to the script using the events window (lightening bolt) or did you just type that code straight onto the script?
Well the issue is that an object isn't showing up over the Antenna, everything else is working perfectly.
What I'd like to happen is when the character gets the item in his inventory an object appears over the antenna (That accidentally became part of the background and isn't an object on it's own.)
The problem is when the character gets the Antenna, the Object "Cover" doesn't appear.
Also thanks for the welcome! <3
I'm pretty bad at coding in general, I think the issue stems from the object not being interacted with directly, but I Can't have the character interact with it due to it being invisible from the start.
Hmm... You know, I think I'm going to fix this just by covering up the antenna in the background and putting an object on top of that. Should work and would make much more sense.
Quote from: Krutches on Fri 25/10/2013 23:11:37I think the issue stems from the object not being interacted with directly
Not at all; just imagine you couldn't do this in other situations...
Assuming that the game compiles and runs, and everything else in this interaction works as intended, the reason why the object seems to remain invisible must be something else. It could be covered by a walkbehind, for instance. Or its transparency is still set to 100.