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


Thread Rating:
  • 1 Vote(s) - 5 Average
  • 1
  • 2
  • 3
  • 4
  • 5
[SOLVED] Script Problem
laser50 Offline
Member

Posts: 242
Threads: 22
Joined: Apr 2011
Reputation: 0
#3
RE: Script Problem

Here is my FULL code:

void OnStart()
{  
    SetPlayerLampOil(10.0f);
    AddEntityCollideCallback("Player", "ScriptArea_1", "ActivateMonsters", true, 1);  
    AddUseItemCallback("","CabinetKey1", "cabinet_nice_1","UsedKeyOnDoor", true);
}

void UsedKeyOnDoor(string &in asItem, string &in asEntity)
{
    SetSwingDoorLocked("mansion_2", true, true);
    SetSwingDoorLocked("cabinet_nice_1", false, true);
    PlaySoundAtEntity("","unlock_door", "cabinet_nice_1" ,0.0f, false);
    RemoveItem("CabinetKey1");
    StartPlayerLookAt("Monster3", 2, 2, "");

      AddTimer("donelook", 2.5f, "TimerDoneLookAt");

    SetEntityActive("Monster3", true);
}


void TimerDoneLookAt(string &in asTimer)
{
  StopPlayerLookAt();
}


////////////////////////////
// Run when entering map
void OnEnter()
{

}

////////////////////////////
// Run when leaving map
void OnLeave()
{

}

void ActivateMonsters(string &in asParent, string &in asChild, int alState)
{
    /////////////////////
    // Monster 1
    SetEntityActive("Monster1", true);
    AddEnemyPatrolNode("Monster1", "PatrolNode1", 10.0f, "");
    GiveSanityDamage(15.0f, true);
    /////////////////////
    // Monster 2
    SetEntityActive("Monster2", true);
    AddEnemyPatrolNode("Monster2", "Monster2Path1", 6.0f, "");
    AddEnemyPatrolNode("Monster2", "Monster2Path2", 6.0f, "");
    AddEnemyPatrolNode("Monster2", "Monster2Path3", 6.0f, "");
    AddEnemyPatrolNode("Monster2", "Monster2Path4", 6.0f, "");
    AddEnemyPatrolNode("Monster2", "Monster2Path1", 6.0f, "");
    AddEnemyPatrolNode("Monster2", "Monster2Path2", 6.0f, "");
    AddEnemyPatrolNode("Monster2", "Monster2Path3", 6.0f, "");
    AddEnemyPatrolNode("Monster2", "Monster2Path4", 6.0f, "");
    
}

void OnLeverStateChange("Lever1", -1)
{

    if (alState == 1)
    {
        SetSwingDoorLocked("mansion_2", false, true);
    }
}
04-15-2011, 12:51 PM
Find


Messages In This Thread
[SOLVED] Script Problem - by laser50 - 04-14-2011, 09:51 PM
RE: Script Problem - by Pandemoneus - 04-14-2011, 10:49 PM
RE: Script Problem - by laser50 - 04-15-2011, 12:51 PM
RE: Script Problem - by laser50 - 04-15-2011, 03:23 PM
RE: Script Problem - by Dalroc - 04-15-2011, 03:30 PM
RE: Script Problem - by laser50 - 04-15-2011, 03:35 PM
RE: Script Problem - by MrBigzy - 04-15-2011, 04:15 PM
RE: Script Problem - by laser50 - 04-15-2011, 07:03 PM
RE: Script Problem - by MrBigzy - 04-15-2011, 11:12 PM
RE: Script Problem - by laser50 - 04-16-2011, 12:13 AM



Users browsing this thread: 1 Guest(s)