Frictional Games Forum (read-only)
Script Change map - Printable Version

+- Frictional Games Forum (read-only) (https://www.frictionalgames.com/forum)
+-- Forum: Amnesia: The Dark Descent (https://www.frictionalgames.com/forum/forum-6.html)
+--- Forum: Custom Stories, TCs & Mods - Development (https://www.frictionalgames.com/forum/forum-38.html)
+---- Forum: Development Support (https://www.frictionalgames.com/forum/forum-39.html)
+---- Thread: Script Change map (/thread-12789.html)



Script Change map - djwhatkid - 01-22-2012

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.


RE: Script Change map - Statyk - 01-22-2012

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");
}



RE: Script Change map - djwhatkid - 01-23-2012

ok thx