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
How exactly would I go about doing this?
When I interact with a locked door a message appears?
My current code doesnt work.
I just get:Unexpected end of file error report?
This is what I have:

"void InteractOfficeDoor (string &in asEntity)
{
}
if(GetSwingDoorLocked("OfficeDoor")== true)
{
SetMessage("Map4", "OfficeDoorMessage", 5.0f);
}"
which is at the end of the script

I have this at the voidOnStart

"SetEntityPlayerInteractCallback("OfficeDoor", "InteractOfficeDoor", true);"

The error is comming from the } at the end of file,If that helps!
You never closed your InteractStudyDoor function. Add another "}" after the if statement and you should be set.
(05-13-2011, 08:59 PM)Anxt Wrote: [ -> ]You never closed your InteractStudyDoor function. Add another "}" after the if statement and you should be set.

I made the change(as now shown above) but I still get the same thingSad
I have no idea of scripting what so ever, so I wouldn't even see the most obvious mistake.
Did you make sure you closed your OnStart function as well? Unexpected end of file almost always, if not always, means you are missing a bracket. Check every function for an opening and a close.
Try putting this in your file, instead of what you have
Code:
void InteractOfficeDoor (string &in asEntity)
{
if(GetSwingDoorLocked("OfficeDoor")== true)
{
  SetMessage("Map4", "OfficeDoorMessage", 5.0f);
}
}
(05-13-2011, 09:11 PM)Anxt Wrote: [ -> ]Did you make sure you closed your OnStart function as well? Unexpected end of file almost always, if not always, means you are missing a bracket. Check every function for an opening and a close.

It is also possible that you have a left-over quotation mark around for example a bool. i.e AddDebugMessage("Message", false");

That would produce the same result.
Oh, thank you Karai. I didn't even notice that his if statement wasn't in the function anymore.

Listen to her, Watz Smile
Thanks man but Its not helping,Ill be fine without itUndecided
(05-13-2011, 09:21 PM)WatzUpzPeepz Wrote: [ -> ]Thanks man but Its not helping,Ill be fine without itUndecided

Can you put up your entire code please? I have a great eye for detail, maybe I can see what's wrong
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);
{
}
Pages: 1 2 3