07-12-2011, 04:54 PM
Hello once again,
uuhm, ok so my problem is this
I have a nice closet.
I have a set of chairs + a round table which are tumbled over and all which I set to active in the level editor, then I have another set of chairs + a round table which are all nice and haven't tumbled over which are inactive.
Then I have this in my code file:
So when I touch the cabinet or interact with the cabinet, (I am facing another direction) the tumbled over chair and table should dissapear and the chairs and table that are normal should appear. This doesn't work (this is 1 problem),
then I have another problem which is the normal standing table is already active when I load my map, which should be inactive untill I touch the cabinet.
I aready unchecked the active check saved loaded my map, and rechecked the active check saved and loaded my map but that doesn't work.
Or should I set the active and inactive things in my script in the onEnter function?
Thanks in advance, once again. :p
uuhm, ok so my problem is this
I have a nice closet.
I have a set of chairs + a round table which are tumbled over and all which I set to active in the level editor, then I have another set of chairs + a round table which are all nice and haven't tumbled over which are inactive.
Then I have this in my code file:
Code:
void OnStart()
{
if(ScriptDebugOn())
{
GiveItemFromFile("lantern", "lantern.ent");
for(int i=0;i<10;i++) GiveItemFromFile("tinderbox_"+i, "tinderbox.ent");
}
SetEntityPlayerInteractCallback("cabinet_nice_1", "cabinet_nice_1_callback", true);
}
void OnEnter()
{
}
void OnLeave()
{
}
void cabinet_nice_1_callback(){
SetEntityActive("chair_nice02_9", true);
SetEntityActive("chair_nice02_8", true);
SetEntityActive("chair_nice02_10", true);
SetEntityActive("table_nice_round_3", true);
SetEntityActive("chair_nice02_5", false);
SetEntityActive("chair_nice02_4", false);
SetEntityActive("chair_nice02_6", false);
SetEntityActive("table_nice_round_2", false);
}
So when I touch the cabinet or interact with the cabinet, (I am facing another direction) the tumbled over chair and table should dissapear and the chairs and table that are normal should appear. This doesn't work (this is 1 problem),
then I have another problem which is the normal standing table is already active when I load my map, which should be inactive untill I touch the cabinet.
I aready unchecked the active check saved loaded my map, and rechecked the active check saved and loaded my map but that doesn't work.
Or should I set the active and inactive things in my script in the onEnter function?
Thanks in advance, once again. :p