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
WatzUpzPeepz Offline
Member

Posts: 106
Threads: 12
Joined: May 2011
Reputation: 0
#12
RE: Callback help?

Thanks for trying but it still didn't work,oh well Its not that important.

05-13-2011, 10:19 PM
Find
Karai16 Offline
Member

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

(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?

Custom stories:
Her Games (100% Complete)
Her Games, All Bugs Fixed (100% Complete)
(This post was last modified: 05-13-2011, 10:24 PM by Karai16.)
05-13-2011, 10:21 PM
Find
WatzUpzPeepz Offline
Member

Posts: 106
Threads: 12
Joined: May 2011
Reputation: 0
#14
RE: Callback help?

Epic noob moment comming.....whats that? Huh

Here is that error report I keep getting


Attached Files
.jpg   Capture.JPG (Size: 24.14 KB / Downloads: 92)

(This post was last modified: 05-13-2011, 10:29 PM by WatzUpzPeepz.)
05-13-2011, 10:25 PM
Find
Karai16 Offline
Member

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

(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!

Custom stories:
Her Games (100% Complete)
Her Games, All Bugs Fixed (100% Complete)
(This post was last modified: 05-13-2011, 10:29 PM by Karai16.)
05-13-2011, 10:28 PM
Find
WatzUpzPeepz Offline
Member

Posts: 106
Threads: 12
Joined: May 2011
Reputation: 0
#16
RE: Callback help?

No cache file but I got the picture you asked for.

05-13-2011, 10:30 PM
Find
Karai16 Offline
Member

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

(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?

Custom stories:
Her Games (100% Complete)
Her Games, All Bugs Fixed (100% Complete)
05-13-2011, 10:39 PM
Find
Roenlond Offline
Senior Member

Posts: 331
Threads: 3
Joined: Apr 2011
Reputation: 0
#18
RE: Callback help?

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
(This post was last modified: 05-13-2011, 10:48 PM by Roenlond.)
05-13-2011, 10:48 PM
Find
Karai16 Offline
Member

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

You're right! I see it! That should put an end to your trouble!

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

Posts: 106
Threads: 12
Joined: May 2011
Reputation: 0
#20
RE: Callback help?

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

(This post was last modified: 05-14-2011, 10:47 AM by WatzUpzPeepz.)
05-14-2011, 10:43 AM
Find




Users browsing this thread: 1 Guest(s)