Object unclickable

Started by Mr_Threepwood, Tue 25/07/2006 16:11:31

Previous topic - Next topic

Mr_Threepwood

Alright I'm just wondering if there is a better way to do this.

I have an object in a room, a knife that is on a knife rack.  I the knife rack is a hotspot called "knives", and I want the player to be able to click "take knives" and if he does not have the knife object he gets it.  The only problem with this right now is that the knife object counts as it's own thing when you scroll over it, so to remedy that I used object.isClickable=false .  My question is this, either where can I put this code so that it gets run only once ever, or is there a way to make this option part of the objects default state.  Right now my best idea is to put it on room load, but that seems dumb since the room may load many times and the object won't be there after the player uses take on the hotspot.
I am a mighty pirate

strazer

#1
As you found out, you can't make objects unclickable from within the editor at the moment.
Just put the
  oKnife.Clickable = false;
into the room's "Player enters room for the first time" event.

But technically, putting it in the normal "Player enters room" event wouldn't make a difference since the object isn't deleted when you take it, it's just turned off.

Mr_Threepwood

#2
Alright can I ask you one more thing about objects since I've been dealing with them all today and have gotten stuck on another thing?

I have another object, a drawer, in one of my rooms so I decided it would be good organization if rather than using a room variable for checking if the drawer is open I used a variable that's attached to the object.Ã,  So I made a custom property for the object which is a boolean called isOpen.

I can get the data from that variable fine, but I can't figure out how to set it since I coulndt find another post about it, SetProperty doesnt exist, and using GetProperty("isOpen")=1 doesn't do it either.

I also typed in the name of my object then scrolled down the list of available functions and didn't see anything that looked of use.

Edit:  Make no mistake, I'm not an idiot getting stuck on absolutely everything.  In fact I've managed to make a very nice save gui, and a nice lucasarts gui where every function is cancelable after you click on something.  It's just that when you've been working in AGS for 4-6 hours a day you tend to run into problems, especially when the manual doesn't seem to hold the answer.
I am a mighty pirate

Ashen

You couldn't find anything of use because it's not there; Custom Properties can't be set by script. (It even says so in the manual entry for Custom Properties - very last line.) So, you'll have to use a room variable, or a scripted variable (int, or bool might make more sense here.).
I know what you're thinking ... Don't think that.

SSH

You coudl use Monkey's Properties module which allows modifyable-at-runtime properties.
12

SMF spam blocked by CleanTalk