Frictional Games Forum (read-only)
Need to fix my script - 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: Need to fix my script (/thread-12753.html)



Need to fix my script - djwhatkid - 01-21-2012

Hi, so basicly i have tryed for like ever to fix this. so i want 3 corpses to spawn when i hit the scriptArea (Box)



//
// Run first time starting map
void OnStart()
{
AddEntityCollideCallback("Player", "ScriptAreaCorpsespawn", "SpawnCorpse1", false, 1);
AddEntityCollideCallback("Player", "ScriptAreaCorpsespawn", "SpawnCorpse2", false, 1);
AddEntityCollideCallback("Player", "ScriptAreaCorpsespawn", "SpawnCorpse3", false, 1);
AddEntityCollideCallback("Player", "Music", "StartMusic", true, 1);
}


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


void SpawnCorpse2(string &in asParent, string &in asChild, int alState)
{
SetEntityActive("corpse2");
}


void SpawnCorpse3(string &in asParent, string &in asChild, int alState)
{
SetEntityActive("corpse3");
}


void StartMusic(string &in asParent, string &in asChild, int alState)
{
PlayMusic("266663_Ambience_Experiment.ogg", true, 0.8, 2, 1, true);
}



RE: Need to fix my script - flamez3 - 01-21-2012

(01-21-2012, 05:06 PM)djwhatkid Wrote: Hi, so basicly i have tryed for like ever to fix this. so i want 3 corpses to spawn when i hit the scriptArea (Box)



//
// Run first time starting map
void OnStart()
{
AddEntityCollideCallback("Player", "ScriptAreaCorpsespawn", "SpawnCorpse1", false, 1);
AddEntityCollideCallback("Player", "ScriptAreaCorpsespawn", "SpawnCorpse2", false, 1);
AddEntityCollideCallback("Player", "ScriptAreaCorpsespawn", "SpawnCorpse3", false, 1);
AddEntityCollideCallback("Player", "Music", "StartMusic", true, 1);
}


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


void SpawnCorpse2(string &in asParent, string &in asChild, int alState)
{
SetEntityActive("corpse2");
}


void SpawnCorpse3(string &in asParent, string &in asChild, int alState)
{
SetEntityActive("corpse3");
}


void StartMusic(string &in asParent, string &in asChild, int alState)
{
PlayMusic("266663_Ambience_Experiment.ogg", true, 0.8, 2, 1, true);
}
SetEntityActive("corpse1", true);

Do that for each of your corpse's


RE: Need to fix my script - Tripication - 01-21-2012

ok, you only need to call 1 Collision area

void OnStart()
{
AddEntityCollideCallback("Player", "ScriptAreaCorpsespawn", "SpawnCorpse1", true, 1);

}

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




And you probably want the Red text to be true(to remove the function after its been used once)


Im guessing thats also custom music, i dont recognize it, but the body spawns should do the trick now.


RE: Need to fix my script - djwhatkid - 01-21-2012

Thx i will test this
Thank you all you saved me alot of time


RE: Need to fix my script - Tripication - 01-21-2012

no probs, time for sleep