Frictional Games Forum (read-only)
How to script the guardian effect? - 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: How to script the guardian effect? (/thread-13552.html)

Pages: 1 2


How to script the guardian effect? - Shives - 02-24-2012

Hi
I want to script the guardian effect,this means
How to script it that an Object fades in. If I use Set Entity Active it looks awful.



RE: How to script the guardian effect? - Obliviator27 - 02-24-2012

SetPropActiveAndFade is probably what you're looking for.




RE: How to script the guardian effect? - SilentStriker - 02-24-2012

and do some particles and it should look nice Wink



RE: How to script the guardian effect? - Shives - 02-25-2012

The result
main(27,3):ERR :No matching signatures to 'SetPropActiveAndFade(string@&, const bool)'

My Script




////////////////////////////
// Run first time starting map
void OnStart()
{
AddEntityCollideCallback("Player", "ScriptArea_1", "Slime", true, 1);
AddEntityCollideCallback("Player", "ScriptArea_2", "Roar", true, 1);
AddEntityCollideCallback("Player", "ScriptArea_3", "S", true, 1);
AddEntityCollideCallback("Player", "ScriptArea_4", "Scare", true, 1);
}
void Slime(string &in asParent, string &in asChild, int alState)
{
PlaySoundAtEntity("", "scare_loon.snt", "Player", 0, false);
AddTimer("", 4, "Wispher");
}
void Wispher(string &in asTimer)
{
PlaySoundAtEntity("", "insanity_imageflash01.snt", "Player", 0, false);
AddTimer("", 7, "Help");
}
void Help(string &in asTimer)
{
PlaySoundAtEntity("", "guardian_distant1.snt", "Player", 0, false);
}
void S(string &in asParent, string &in asChild, int alState)
{
PlaySoundAtEntity("", "guardian_activated.snt", "Player", 0, false);
SetPropActiveAndFade("S_1", true);
SetPropActiveAndFade("S_2", true);
SetPropActiveAndFade("S_3", true);
SetPropActiveAndFade("S_4", true);
SetPropActiveAndFade("S_4", true);
StartScreenShake(0.9f, 1, 0.9f, 1.0f);
}
void Scare(string &in asParent, string &in asChild, int alState)
{
PlaySoundAtEntity("", "guardian_activated.snt", "Player", 0, false);
SetPropActiveAndFade("P_1", true);
SetPropActiveAndFade("P_2", true);
SetPropActiveAndFade("P_3", true);
SetPropActiveAndFade("P_4", true);
SetPropActiveAndFade("P_5", true);
SetPropActiveAndFade("P_6", true);
StartScreenShake(0.9f, 1, 0.9f, 1.0f);
}
////////////////////////////
// Run when entering map
void OnEnter()
{

}

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

}







RE: How to script the guardian effect? - SilentStriker - 02-25-2012

(02-25-2012, 09:52 AM)Shives Wrote: The result
main(27,3):ERR :No matching signatures to 'SetPropActiveAndFade(string@&, const bool)'

My Script




////////////////////////////
// Run first time starting map
void OnStart()
{
AddEntityCollideCallback("Player", "ScriptArea_1", "Slime", true, 1);
AddEntityCollideCallback("Player", "ScriptArea_2", "Roar", true, 1);
AddEntityCollideCallback("Player", "ScriptArea_3", "S", true, 1);
AddEntityCollideCallback("Player", "ScriptArea_4", "Scare", true, 1);
}
void Slime(string &in asParent, string &in asChild, int alState)
{
PlaySoundAtEntity("", "scare_loon.snt", "Player", 0, false);
AddTimer("", 4, "Wispher");
}
void Wispher(string &in asTimer)
{
PlaySoundAtEntity("", "insanity_imageflash01.snt", "Player", 0, false);
AddTimer("", 7, "Help");
}
void Help(string &in asTimer)
{
PlaySoundAtEntity("", "guardian_distant1.snt", "Player", 0, false);
}
void S(string &in asParent, string &in asChild, int alState)
{
PlaySoundAtEntity("", "guardian_activated.snt", "Player", 0, false);
SetPropActiveAndFade("S_1", true);
SetPropActiveAndFade("S_2", true);
SetPropActiveAndFade("S_3", true);
SetPropActiveAndFade("S_4", true);
SetPropActiveAndFade("S_4", true);
StartScreenShake(0.9f, 1, 0.9f, 1.0f);
}
void Scare(string &in asParent, string &in asChild, int alState)
{
PlaySoundAtEntity("", "guardian_activated.snt", "Player", 0, false);
SetPropActiveAndFade("P_1", true);
SetPropActiveAndFade("P_2", true);
SetPropActiveAndFade("P_3", true);
SetPropActiveAndFade("P_4", true);
SetPropActiveAndFade("P_5", true);
SetPropActiveAndFade("P_6", true);
StartScreenShake(0.9f, 1, 0.9f, 1.0f);
}
////////////////////////////
// Run when entering map
void OnEnter()
{

}

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

}
You forgot the last part of the SetPropActiveAndFade

SetPropActiveAndFade(string& asName, bool abActive, float afFadeTime);

asName - internal name


abActive - nothing to add


afFadeTime - time in seconds until prop fully fades






RE: How to script the guardian effect? - Shives - 02-25-2012

New Problem
main(27,22):ERR : 'S_1' is not declared
The same with the other Objects i want to fade -.-


////////////////////////////
// Run first time starting map
void OnStart()
{
AddEntityCollideCallback("Player", "ScriptArea_1", "Slime", true, 1);
AddEntityCollideCallback("Player", "ScriptArea_2", "Roar", true, 1);
AddEntityCollideCallback("Player", "ScriptArea_3", "S", true, 1);
AddEntityCollideCallback("Player", "ScriptArea_4", "Scare", true, 1);
}
void Slime(string &in asParent, string &in asChild, int alState)
{
PlaySoundAtEntity("", "scare_loon.snt", "Player", 0, false);
AddTimer("", 4, "Wispher");
}
void Wispher(string &in asTimer)
{
PlaySoundAtEntity("", "insanity_imageflash01.snt", "Player", 0, false);
AddTimer("", 7, "Help");
}
void Help(string &in asTimer)
{
PlaySoundAtEntity("", "guardian_distant1.snt", "Player", 0, false);
}
void S(string &in asParent, string &in asChild, int alState)
{
PlaySoundAtEntity("", "guardian_activated.snt", "Player", 0, false);
SetPropActiveAndFade(S_1, true, 0,9);
SetPropActiveAndFade(S_2, true, 0,9);
SetPropActiveAndFade(S_3, true, 0,9);
SetPropActiveAndFade(S_4, true, 0,9);
SetPropActiveAndFade(S_5, true, 0,9);
StartScreenShake(0.9f, 1, 0.9f, 1.0f);
}
void Scare(string &in asParent, string &in asChild, int alState)
{
PlaySoundAtEntity("", "guardian_activated.snt", "Player", 0, false);
SetPropActiveAndFade(P_1, true, 0,9);
SetPropActiveAndFade(P_2, true, 0,9);
SetPropActiveAndFade(P_3, true, 0,9);
SetPropActiveAndFade(P_4, true, 0,9);
SetPropActiveAndFade(P_5, true, 0,9);
SetPropActiveAndFade(P_6, true, 0,9);
StartScreenShake(0.9f, 1, 0.9f, 1.0f);
}
////////////////////////////
// Run when entering map
void OnEnter()
{

}

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

}




RE: How to script the guardian effect? - SilentStriker - 02-25-2012

S_1 is not declared because all the S_ and p_ should be inside "" for example "S_1"

because they are Strings



RE: How to script the guardian effect? - Shives - 02-25-2012

The result

main(27,3):ERR :No matching signatures to 'SetPropActiveAndFade(string@&, const bool, const uint, const uint'




RE: How to script the guardian effect? - SilentStriker - 02-25-2012

SetPropActiveAndFade("S_5", true, 0.9f);

is how it should look like



RE: How to script the guardian effect? - Shives - 02-25-2012

Sad

main (27,38) : ERR : Expected ')'or','

////////////////////////////
// Run first time starting map
void OnStart()
{
AddEntityCollideCallback("Player", "ScriptArea_1", "Slime", true, 1);
AddEntityCollideCallback("Player", "ScriptArea_2", "Roar", true, 1);
AddEntityCollideCallback("Player", "ScriptArea_3", "S", true, 1);
AddEntityCollideCallback("Player", "ScriptArea_4", "Scare", true, 1);
}
void Slime(string &in asParent, string &in asChild, int alState)
{
PlaySoundAtEntity("", "scare_loon.snt", "Player", 0, false);
AddTimer("", 4, "Wispher");
}
void Wispher(string &in asTimer)
{
PlaySoundAtEntity("", "insanity_imageflash01.snt", "Player", 0, false);
AddTimer("", 7, "Help");
}
void Help(string &in asTimer)
{
PlaySoundAtEntity("", "guardian_distant1.snt", "Player", 0, false);
}
void S(string &in asParent, string &in asChild, int alState)
{
PlaySoundAtEntity("", "guardian_activated.snt", "Player", 0, false);
SetPropActiveAndFade("S_1", true, 0,9f);
SetPropActiveAndFade("S_2", true, 0,9f);
SetPropActiveAndFade("S_3", true, 0,9f);
SetPropActiveAndFade("S_4", true, 0,9f);
SetPropActiveAndFade("S_5", true, 0,9f);
StartScreenShake(0.9f, 1, 0.9f, 1.0f);
}
void Scare(string &in asParent, string &in asChild, int alState)
{
PlaySoundAtEntity("", "guardian_activated.snt", "Player", 0, false);
SetPropActiveAndFade("P_1", true, 0,9f);
SetPropActiveAndFade("P_2", true, 0,9f);
SetPropActiveAndFade("P_3", true, 0,9f);
SetPropActiveAndFade("P_4", true, 0,9f);
SetPropActiveAndFade("P_5", true, 0,9f);
SetPropActiveAndFade("P_6", true, 0,9f);
StartScreenShake(0.9f, 1, 0.9f, 1.0f);
}
////////////////////////////
// Run when entering map
void OnEnter()
{

}

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

}