objects on/off in cabinet

Started by dikla, Sat 26/06/2004 21:52:11

Previous topic - Next topic

dikla

 I have a cabinet which i want the player to open it and than see 2 glasses and take them away and add inventory the two glasses.
so what i did was a script like this:

Interact aditor hotspot //my hotspot cover the close cabinet (which in the bg)

ObjectOn (1);//the open cabinet
ObjectOn (2);//the glass
ObjectOn (3);//another glass
SetObjectClickable (1,0); //so we can take the glasses by clicking
Display ("You opened the cabinet");


Then in each object i worte what need (like objectoff add inventory and display massage).

now what happen when i test the game is that i see only the open cabinet but not the glasses and when i touch it with the "hand" i can see the massage "you took the glass" and i see in my inventory the glass - BUT I CAN NOT SEE THE GLASSES IN THE CABINET (which is very strange since i made them unvisible and yet i dont see them when i should. (right when i see the open cabinet i should see the 2 glasses - right?)
so pls can you tell me what is worng?
thanks dikla

Mr Flibble

Well, as far as I can see, change it like this.

In the "before room loads"
Set a global int
check if the int is valid
(if yes)
Put objectOn(1); etc.
(if no)
objectoff

And in the interaction thing, after if the glasses are picked up, turn the global int off.


A more intelligent person will post and elaborate / prove me wrong...hopefully.
Ah! There is no emoticon for what I'm feeling!

Scorpiorus

#2
You do SetObjectClickable (1,0); for a good reason, right? The thing is, that the object number 1 still hides the glasses because its baseline is lower than their.

You can do either:

1.

ObjectOn (1);//the open cabinet
ObjectOn (2);//the glass
ObjectOn (3);//another glass
MergeObject (1);Ã,  //so we can take the glasses by clicking
DisableHotspot (THIS_HOTSPOT_NUMBER); // so we can't click to get more glasses :)
Display ("You opened the cabinet");

This way the object is merged into background, i.e. it becomes a part of the background.

Drawback: you can't implement an ability to close the cupboard afterwards.


2.

Maybe even better - adjust glass objects baseline in the editor. Set them lower than the cupboard object.

Edwin Xie

Questions:

1. Did you even add the graphics to the glasses?
2. Were the object numbers correct?
3. Did you even position the objects correctly?

If the answer to all this is all "yes" then the most probable answer to that is that the baseline of the glasses is under the open cabinet.
Moving at superhigh speed getting to the planet called Earth. But it is boxed in white......thing.....

Alynn

Truely the easiest way to do this is to either raise the baseline of the cabinet, and place the baseline of the glasses under it... (eventhough it was said a bunch of times I like to be redundant)

dikla

Thank you all. Indeed it solved the problem. just lower the base line"made the gagic.

THX AGAIN -
dikla

SMF spam blocked by CleanTalk