Frictional Games Forum (read-only)

Full Version: Script Change map
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
so this is my script:

////////////////////////////
// Run first time starting map
void OnStart()
{
AddEntityCollideCallback("Player", "ScriptAreaCorpsespawn", "SpawnCorpse1", true, 1);
AddEntityCollideCallback("Player", "HeadSpawn1", "SpawnHead1", true, 1);
AddEntityCollideCallback("Player", "Behind_you1", "Behind_You", true, 1);
AddEntityGeneral("Player", "Bed_room_door1", "ChangeMap1", true, 1);
}


void SpawnCorpse1(string &in asParent, string &in asChild, int alState)
{
SetEntityActive("corpse1", true);
SetEntityActive("corpse2", true);
SetEntityActive("corpse3", true);
}


void SpawnHead1(string &in asParent, string &in asChild, int alState)
{
SetEntityActive("HeadbyOil", true);
}

void Behind_You(string &in asParent, string &in asChild, int alState)
{
PlayMusic("Behind_you.ogg", false, 30, 2, 1, true);
}


void ChangeMap1(string& asMapName, string& asStartPos, string& asStartSound, string& asEndSound)
{
asMapName("Main_hall.map", true);
asStartPos("PlayerStart_Main_hall1", true);
asStartSound("door_mansion_open.ogg", true);
asEndSound("door_mansion_close.ogg", true);
}


and i cant get it to work.
Replace "ChangeMap1 with this:



void ChangeMap1(string &in asParent, string &in asChild, int alState)
{
ChangeMap("Main_hall.map", "PlayerStart_Main_hall1", "door_mansion_open", "door_mansion_close");
}
ok thx