Hotspot en/dis-able not allowed in char. interactions?

Started by Play_Pretend, Mon 02/01/2006 01:38:40

Previous topic - Next topic

Play_Pretend

Hey all...I'm having trouble with my hotspots.  I've set up a character to hold three cards in the air (he's got a lot of arms, don't worry), and when he does I want the player to be able to pick one of them.  I thought I'd be clever, and set up three hotspots that are initially disabled every time the player enters the room, right at the spaces where the cards will be when the character holds them up.  When he does hold them up, I enable them and voila, the player can select a card.  When the cards are put down again, the hotspots disable, preventing the player from just clicking on thin air and getting the same result.

Except, for some reason the hLcard.enable = true; (for example) inside the card-character's interaction script won't work.  I know I'm spelling everything right (one of the hotspots is named Lcard), but AGS won't even try to autocomplete the script for me as I'm typing it, so something must be wrong.  Are you not allowed to enable/disable hotspots from inside character interaction scripts?  Will I have to use some sort of globalint variable instead?  Thanks!

(Oh...and would it interfere with clicking on the hotspots if the character's hand is drawn over it?)

Akumayo

It WOULD interfere if the characters hand is drawn over it.  In fact, the card (if it's part of the character sprite) is drawn over the room hotspot.  So, it would seem that the cards are blocking their own interaction to me.
"Power is not a means - it is an end."

monkey0506

You might try setting up three objects to fit the image appropriately, then set up the interaction for the objects.  If the cards are drawn into any sort of animation it would be okay, just leave them there.  Make the object's position static where you want them to be held in the air at and remove them from the character's sprites when he is just holding them, then instead of enabling/disabling the hotspots, change whether the object is visible or not.  That way your scripts are basically the same, only you move the interaction from the Hotspot scripts to the Object scripts and change Object.Visible instead of changing Hotspot.Enabled.

I think that would work...

Play_Pretend

Thanks for the quick responses, guys...I didn't even think about the hand-drawn-over thing until I posted. :)  I guess I'll try the object scripting...maybe I can just make objects that are completely blank and script it to make the objects visible (even though they won't be see-able) as soon as his hands lift up with the cards.  Or just leave all three blank-imaged objects somewhere else in the room (or off the side of the screen) and object.SetPosition at that instant instead.  I just wanted to make sure before I scrapped the hotspot idea. :)  Thanks!

Akumayo

You wont want to be trying that transparent object thing.  Transparent objects aren't clickable.  Go with making them visible/invisible instead.
"Power is not a means - it is an end."

monkey0506

Just FYI, I said to remove the cards from the character's sprites when he was just holding them because I wasn't sure if the objects would be drawn in front of or behind the character (which would determine where the mouse-click was registered)...but I suppose that would depend on the baselines...

SMF spam blocked by CleanTalk