Frictional Games Forum (read-only)

Full Version: Teleporting naked guys
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hey!

So I've tried to create a teleporting naked guy but I've run into a problem.
When I load my map it says "Unexpected end of file". I have no clue of what I'm doing wrong :/

Here's the code I have written so far, the bold text is the teleporting naked guy:


/////////////////////////////
// Run first time starting map
void OnStart()

{
AddUseItemCallback("", "key1", "bedroomdoor1", "UsedKeyOnDoor1", true);
AddUseItemCallback("", "key2", "bedroomdoor2", "UsedKeyOnDoor2", true);
AddEntityCollideCallback("Player", "TP_Script_1", "Tp_Jesus", true, 1);
}

void UsedKeyOnDoor1(string &in asItem, string &in asEntity)
{
SetSwingDoorLocked("bedroomdoor1", false, true);
PlaySoundAtEntity("", "unlock_door", "bedroomdoor1", 0, false);
RemoveItem("key1");
}

void UsedKeyOnDoor2(string &in asItem, string &in asEntity)
{
SetSwingDoorLocked("bedroomdoor2", false, true);
PlaySoundAtEntity("", "unlock_door", "bedroomdoor2", 0, false);
RemoveItem("key2");
}


void DoorLockedPlayer(string &in entity)

{
if(GetSwingDoorLocked("bedroomdoor1") == true)
{

SetMessage("Messages", "msgname", 0);

}



void Tp_Jesus(string &in asParent, string &in asChild, int alState)
{
SetEntityActive("Tp_Naked_1", true);
AddPropForce("Tp_Naked_1", 0, 0, -10000, "World");
}




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

}

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

}
I don't see anything wrong Sad are you completely sure the teleporting naked guy is the problem?

Also, this is technical support. This should be in development support, there is where people try to fix things.
There's a " missing somewhere, check again.
PHP Code:
void DoorLockedPlayer(string &in entity)

{
    if(
GetSwingDoorLocked("bedroomdoor1") == true)
    {
        
SetMessage("Messages""msgname"0);
    } 

It's nothing to do with the flying Jesus, you need another "}" on a new line after that. Should be:

PHP Code:
void DoorLockedPlayer(string &in entity)

{
    if(
GetSwingDoorLocked("bedroomdoor1") == true)
    {
        
SetMessage("Messages""msgname"0);
    }



...Although I'd like to quietly suggest that you don't use teleporting naked guys, and instead use build-up and atmosphere. They're kinda infamous.
But hey, if you'd prefer to do that, go ahead.