The following warnings occurred:
Warning [2] count(): Parameter must be an array or an object that implements Countable - Line: 906 - File: showthread.php PHP 7.2.24-0ubuntu0.18.04.17 (Linux)
File Line Function
/showthread.php 906 errorHandler->error



Facebook Twitter YouTube Frictional Games | Forum | Privacy Policy | Dev Blog | Dev Wiki | Support | Gametee


Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Set Entity Active Problem
bigfoot Offline
Member

Posts: 58
Threads: 12
Joined: Dec 2010
Reputation: 0
#1
Set Entity Active Problem

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:

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
07-12-2011, 04:54 PM
Find


Messages In This Thread
Set Entity Active Problem - by bigfoot - 07-12-2011, 04:54 PM
RE: Set Entity Active Problem - by Tanshaydar - 07-12-2011, 05:00 PM
RE: Set Entity Active Problem - by bigfoot - 07-12-2011, 05:26 PM
RE: Set Entity Active Problem - by Kyle - 07-12-2011, 05:40 PM
RE: Set Entity Active Problem - by Streetboat - 07-12-2011, 07:31 PM
RE: Set Entity Active Problem - by Kyle - 07-12-2011, 07:52 PM
RE: Set Entity Active Problem - by bigfoot - 07-12-2011, 05:43 PM
RE: Set Entity Active Problem - by Kyle - 07-12-2011, 06:01 PM
RE: Set Entity Active Problem - by bigfoot - 07-12-2011, 06:05 PM



Users browsing this thread: 1 Guest(s)