Frictional Games Forum (read-only)

Full Version: Callback help?
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2 3
(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:

Code:
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);
    }
}
Thanks for trying but it still didn't work,oh well Its not that important.
(05-13-2011, 10:19 PM)WatzUpzPeepz Wrote: [ -> ]Thanks for trying but it still didn't work,oh well Its not that important.

have you tried deleting the cache file before testing?
----
EDIT: Also, can you maybe give us a picture of the error you're getting?
Epic noob moment comming.....whats that? Huh

Here is that error report I keep getting
(05-13-2011, 10:25 PM)WatzUpzPeepz Wrote: [ -> ]Epic noob moment comming.....whats that? Huh

go to the folder with all your custom story files (map_name.hps, map_name.map etc) if there's a map_name.cache file there, delete it, then try testing out the code again
If that isn't working, give us a picture of the error you're getting... not to sound all serious and all, but it's personal now... Sad I'm not letting a computer win any argument whatsoever!
No cache file but I got the picture you asked for.
(05-13-2011, 10:30 PM)WatzUpzPeepz Wrote: [ -> ]No cache file but I got the picture you asked for.

hmm, and you already tried deleting everything in your hps file, and replace it with the code I gave you?
Code:
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);
    }
}

Try that, there was a bad quotation mark in there Smile
You're right! I see it! That should put an end to your trouble!
Oh lord that has made it even worse,now it crashes at the ( on the voidOnStart.
(05-13-2011, 10:39 PM)Karai16 Wrote: [ -> ]
(05-13-2011, 10:30 PM)WatzUpzPeepz Wrote: [ -> ]No cache file but I got the picture you asked for.

hmm, and you already tried deleting everything in your hps file, and replace it with the code I gave you?

YesSad now that I removed the extra " its now crashing at the voidOnStart

I'd like to thank all of you for helping me to get this troublesum script under control
Pages: 1 2 3