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
Callback help?
Karai16 Offline
Member

Posts: 164
Threads: 24
Joined: Apr 2011
Reputation: 0
#11
RE: Callback help?

(05-13-2011, 09:59 PM)WatzUpzPeepz Wrote: Yea here ya go:
void OnStart()
{
AddUseItemCallback("", "crowbar_1", "door1", "KeyOnDoor", true);
AddUseItemCallback("", "key1", "door3", "KeyOnClosetDoor", true);
AddEntityCollideCallback("Player", "DoorSlamArea", "CollideDoorSlam", true, 1);
SetEntityPlayerInteractCallback("OfficeDoor", "InteractOfficeDoor", true);"
}

void KeyOnDoor(string &in asItem, string &in asEntity)
{
SetSwingDoorLocked("door1", false, true);
PlaySoundAtEntity("", "break_wood.snt", "door1", 0.0f, true);
}


void KeyOnClosetDoor(string &in asItem, string &in asEntity)
{
SetSwingDoorLocked("door3", false, true);
PlaySoundAtEntity("", "unlock_door.snt", "door3", 0.0f, true);
}

void CollideDoorSlam(string &in asParent, string &in asChild, int alState)
{
StartPlayerLookAt("door3", 10, 50, "");
AddTimer("", 0.5f, "TimerSlamDoor");
SetEntityActive("ParticleSystem_1" , true);
}
void TimerSlamDoor(string &in asTimer)
{
SetSwingDoorLocked("door2", true, true);
SetSwingDoorClosed("door3", true, true);
GiveSanityDamage(4.0f, true);
PlaySoundAtEntity("", "react_breath_slow.snt", "Player", 0, false);
AddTimer("", 2.0f, "TimerStopLook");
SetEntityActive("armour2", true);
SetEntityActive("armour1", false);
}

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

void InteractOfficeDoor (string &in asEntity)
{
if(GetSwingDoorLocked("OfficeDoor")== true)
{
SetMessage("Map4", "OfficeDoorMessage", 5.0f);
{
}

found it, there's a slight typo, here you go:

void OnStart()
{
AddUseItemCallback("", "crowbar_1", "door1", "KeyOnDoor", true);
AddUseItemCallback("", "key1", "door3", "KeyOnClosetDoor", true);
AddEntityCollideCallback("Player", "DoorSlamArea", "CollideDoorSlam", true, 1);
SetEntityPlayerInteractCallback("OfficeDoor", "InteractOfficeDoor", true);"
}

void KeyOnDoor(string &in asItem, string &in asEntity)
{
SetSwingDoorLocked("door1", false, true);
PlaySoundAtEntity("", "break_wood.snt", "door1", 0.0f, true);
}


void KeyOnClosetDoor(string &in asItem, string &in asEntity)
{
    SetSwingDoorLocked("door3", false, true);
    PlaySoundAtEntity("", "unlock_door.snt", "door3", 0.0f, true);
}

void CollideDoorSlam(string &in asParent, string &in asChild, int alState)
{
    StartPlayerLookAt("door3", 10, 50, "");
    AddTimer("", 0.5f, "TimerSlamDoor");
    SetEntityActive("ParticleSystem_1" , true);
}

void TimerSlamDoor(string &in asTimer)
{
    SetSwingDoorLocked("door2", true, true);
    SetSwingDoorClosed("door3", true, true);
    GiveSanityDamage(4.0f, true);
    PlaySoundAtEntity("", "react_breath_slow.snt", "Player", 0, false);
    AddTimer("", 2.0f, "TimerStopLook");
    SetEntityActive("armour2", true);
    SetEntityActive("armour1", false);
}

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

void InteractOfficeDoor (string &in asEntity)
{
    if(GetSwingDoorLocked("OfficeDoor")== true)
    {
        SetMessage("Map4", "OfficeDoorMessage", 5.0f);
    }
}

Custom stories:
Her Games (100% Complete)
Her Games, All Bugs Fixed (100% Complete)
05-13-2011, 10:04 PM
Find


Messages In This Thread
Callback help? - by WatzUpzPeepz - 05-13-2011, 08:57 PM
RE: Callback help? - by Anxt - 05-13-2011, 08:59 PM
RE: Callback help? - by WatzUpzPeepz - 05-13-2011, 09:10 PM
RE: Callback help? - by Anxt - 05-13-2011, 09:11 PM
RE: Callback help? - by Roenlond - 05-13-2011, 09:20 PM
RE: Callback help? - by Karai16 - 05-13-2011, 09:16 PM
RE: Callback help? - by WatzUpzPeepz - 05-13-2011, 09:21 PM
RE: Callback help? - by Karai16 - 05-13-2011, 09:38 PM
RE: Callback help? - by WatzUpzPeepz - 05-13-2011, 09:59 PM
RE: Callback help? - by Karai16 - 05-13-2011, 10:04 PM
RE: Callback help? - by WatzUpzPeepz - 05-13-2011, 10:19 PM
RE: Callback help? - by Karai16 - 05-13-2011, 10:21 PM
RE: Callback help? - by WatzUpzPeepz - 05-13-2011, 10:25 PM
RE: Callback help? - by Karai16 - 05-13-2011, 10:28 PM
RE: Callback help? - by WatzUpzPeepz - 05-13-2011, 10:30 PM
RE: Callback help? - by Karai16 - 05-13-2011, 10:39 PM
RE: Callback help? - by Anxt - 05-13-2011, 09:20 PM
RE: Callback help? - by Roenlond - 05-13-2011, 10:48 PM
RE: Callback help? - by Karai16 - 05-13-2011, 10:55 PM
RE: Callback help? - by WatzUpzPeepz - 05-14-2011, 10:43 AM
RE: Callback help? - by Karai16 - 05-14-2011, 10:54 AM
RE: Callback help? - by WatzUpzPeepz - 05-14-2011, 11:25 AM
RE: Callback help? - by Karai16 - 05-14-2011, 11:47 AM
RE: Callback help? - by WatzUpzPeepz - 05-15-2011, 12:02 AM
RE: Callback help? - by Karai16 - 05-15-2011, 08:49 AM
RE: Callback help? - by WatzUpzPeepz - 05-15-2011, 11:06 AM



Users browsing this thread: 1 Guest(s)