Frictional Games Forum (read-only)
Amnesia script help - 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: Amnesia script help (/thread-25956.html)

Pages: 1 2


RE: Amnesia script help - theodorg - 08-26-2014

(08-26-2014, 06:16 PM)FlawlessHappiness Wrote: internal name is the name you give it in the script.

So that you can refer back to it with

StopSound(asSoundName, float afFadeTime);

So it can be anything. If not can it make the script crash as its doing now?


RE: Amnesia script help - FlawlessHappiness - 08-26-2014

No.

If you want us to help with the crash you need to tell us what it says.

You don't tell by saying: "it says something with..."

You have to be precise in what you're saying. A better way is to screenshot the error


RE: Amnesia script help - theodorg - 08-26-2014

(08-26-2014, 06:37 PM)FlawlessHappiness Wrote: No.

If you want us to help with the crash you need to tell us what it says.

You don't tell by saying: "it says something with..."

You have to be precise in what you're saying. A better way is to screenshot the error

I did post the script in the post before but here it is again...
////////////////////////////
// Run first time starting map
void OnStart()
{
AddUseItemCallback("", "Awesome_key", "Awesome_door", "ABC", true);
AddEntityCollideCallback("Player", "korridor", "bana", true, 1);
AddUseItemCallback("", "secret_key", "secret_door", "SECRET", true);
AddEntityCollideCallback("Player", "falldown", "falldown1", true, 1);
PlayMusic("creepy.ogg", false, 0.6, 5, 0.5, true);
AddEntityCollideCallback("Player", "checkpoint_1", "Restart", true, 1);
}

void Restart(string &in asParent, string &in asChild, int alState)
{
CheckPoint ("FirstCheckpoint", "checkpoint_1_spawn", "Happening", "DeathCategory", "Deathtext");
}

void falldown1(string &in asParent, string &in asChild, int alState)
{
SetEntityActive("rock_med02_push_1", true);
SetEntityActive("rock_med02_push_2", true);
SetEntityActive("rock_med02_push_3", true);
SetEntityActive("rock_med02_push_4", true);
SetEntityActive("rock_med02_push_5", true);
SetEntityActive("rock_med02_push_6", true);
SetEntityActive("rock_med02_push_7", true);
SetEntityActive("rock_med02_push_8", true);
void PlaySoundAtEntity(string& "falldown", string& "scare_falldown.snt", string& "rock_med02_push_8", float 0, bool false);
}

void ABC(string &in asItem, string &in asEntity)
{
SetSwingDoorLocked( "Awesome_door", false, true);
PlaySoundAtEntity("", "unlock_door", "Awesome_door", 0, false);
RemoveItem("Awesome_key");
}

void SECRET(string &in asItem, string &in asEntity)
{
SetSwingDoorLocked( "secret_door", false, true);
PlaySoundAtEntity("", "unlock_door", "secret_door", 0, false);
RemoveItem("secret_key");
}

void bana(string &in asParent, string &in asChild, int alState)
{
SetEntityActive("osynlig", true);
SetEntityActive("synlig", false);
}

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

}

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

}
Theres also a screenshot of the error.


RE: Amnesia script help - Radical Batz - 08-26-2014

Found the problem

PHP Code:
void falldown1(string &in asParentstring &in asChildint alState)
{
SetEntityActive("rock_med02_push_1"true);
SetEntityActive("rock_med02_push_2"true);
SetEntityActive("rock_med02_push_3"true);
SetEntityActive("rock_med02_push_4"true);
SetEntityActive("rock_med02_push_5"true);
SetEntityActive("rock_med02_push_6"true);
SetEntityActive("rock_med02_push_7"true);
SetEntityActive("rock_med02_push_8"true);
 
PlaySoundAtEntity"falldown""scare_falldown.snt","rock_med02_push_8",  0,  false);


There shouldn't be a void near PlaySound and why was there a string& near every name? remove that and just do "" instead of string&""


RE: Amnesia script help - theodorg - 08-26-2014

(08-26-2014, 06:45 PM)Dr.Badcat Wrote: Found the problem

PHP Code:
void falldown1(string &in asParentstring &in asChildint alState)
{
SetEntityActive("rock_med02_push_1"true);
SetEntityActive("rock_med02_push_2"true);
SetEntityActive("rock_med02_push_3"true);
SetEntityActive("rock_med02_push_4"true);
SetEntityActive("rock_med02_push_5"true);
SetEntityActive("rock_med02_push_6"true);
SetEntityActive("rock_med02_push_7"true);
SetEntityActive("rock_med02_push_8"true);
 
PlaySoundAtEntity"falldown""scare_falldown.snt","rock_med02_push_8",  0,  false);


There shouldn't be a void near PlaySound and why was there a string& near every name? remove that and just do "" instead of string&""

Thanks but it still dosent work:
////////////////////////////
// Run first time starting map
void OnStart()
{
AddUseItemCallback("", "Awesome_key", "Awesome_door", "ABC", true);
AddEntityCollideCallback("Player", "korridor", "bana", true, 1);
AddUseItemCallback("", "secret_key", "secret_door", "SECRET", true);
AddEntityCollideCallback("Player", "falldown", "falldown1", true, 1);
PlayMusic("creepy.ogg", false, 0.6, 5, 0.5, true);
AddEntityCollideCallback("Player", "checkpoint_1", "Restart", true, 1);
}

void Restart(string &in asParent, string &in asChild, int alState)
{
CheckPoint ("FirstCheckpoint", "checkpoint_1_spawn", "Happening", "DeathCategory", "Deathtext");
}

void falldown1(string &in asParent, string &in asChild, int alState)
{
SetEntityActive("rock_med02_push_1", true);
SetEntityActive("rock_med02_push_2", true);
SetEntityActive("rock_med02_push_3", true);
SetEntityActive("rock_med02_push_4", true);
SetEntityActive("rock_med02_push_5", true);
SetEntityActive("rock_med02_push_6", true);
SetEntityActive("rock_med02_push_7", true);
SetEntityActive("rock_med02_push_8", true);
PlaySoundAtEntity("falldown", "scare_falldown.snt", "rock_med02_push_8", float 0, bool false);
same error


RE: Amnesia script help - Radical Batz - 08-26-2014

Hmm is that your whole script?

Edit: I kinda found out while I sent the reply then updated it so yeah it has to be like this instead
PHP Code:
PlaySoundAtEntity("falldown""scare_falldown.snt""rock_med02_push_8",  0false); 



RE: Amnesia script help - theodorg - 08-26-2014

(08-26-2014, 06:58 PM)Dr.Badcat Wrote:
(08-26-2014, 06:53 PM)theodorg Wrote:
(08-26-2014, 06:45 PM)Dr.Badcat Wrote: Found the problem

PHP Code:
void falldown1(string &in asParentstring &in asChildint alState)
{
SetEntityActive("rock_med02_push_1"true);
SetEntityActive("rock_med02_push_2"true);
SetEntityActive("rock_med02_push_3"true);
SetEntityActive("rock_med02_push_4"true);
SetEntityActive("rock_med02_push_5"true);
SetEntityActive("rock_med02_push_6"true);
SetEntityActive("rock_med02_push_7"true);
SetEntityActive("rock_med02_push_8"true);
 
PlaySoundAtEntity"falldown""scare_falldown.snt","rock_med02_push_8",  0,  false);


There shouldn't be a void near PlaySound and why was there a string& near every name? remove that and just do "" instead of string&""

Thanks but it still dosent work:
////////////////////////////
// Run first time starting map
void OnStart()
{
AddUseItemCallback("", "Awesome_key", "Awesome_door", "ABC", true);
AddEntityCollideCallback("Player", "korridor", "bana", true, 1);
AddUseItemCallback("", "secret_key", "secret_door", "SECRET", true);
AddEntityCollideCallback("Player", "falldown", "falldown1", true, 1);
PlayMusic("creepy.ogg", false, 0.6, 5, 0.5, true);
AddEntityCollideCallback("Player", "checkpoint_1", "Restart", true, 1);
}

void Restart(string &in asParent, string &in asChild, int alState)
{
CheckPoint ("FirstCheckpoint", "checkpoint_1_spawn", "Happening", "DeathCategory", "Deathtext");
}

void falldown1(string &in asParent, string &in asChild, int alState)
{
SetEntityActive("rock_med02_push_1", true);
SetEntityActive("rock_med02_push_2", true);
SetEntityActive("rock_med02_push_3", true);
SetEntityActive("rock_med02_push_4", true);
SetEntityActive("rock_med02_push_5", true);
SetEntityActive("rock_med02_push_6", true);
SetEntityActive("rock_med02_push_7", true);
SetEntityActive("rock_med02_push_8", true);
PlaySoundAtEntity("falldown", "scare_falldown.snt", "rock_med02_push_8", float 0, bool false);
same error

Hmm is that your whole script?

I kinda found out while I sent the reply then updated it so yeah it has to be like this instead
PHP Code:
PlaySoundAtEntity("falldown""scare_falldown.snt""rock_med02_push_8",  0false); 

Why do i remove the float? Sry im kinda new to these things and is just looking to learn Smile

Heres the script now but it still dosent work ;(
////////////////////////////
// Run first time starting map
void OnStart()
{
AddUseItemCallback("", "Awesome_key", "Awesome_door", "ABC", true);
AddEntityCollideCallback("Player", "korridor", "bana", true, 1);
AddUseItemCallback("", "secret_key", "secret_door", "SECRET", true);
AddEntityCollideCallback("Player", "falldown", "falldown1", true, 1);
PlayMusic("creepy.ogg", false, 0.6, 5, 0.5, true);
AddEntityCollideCallback("Player", "checkpoint_1", "Restart", true, 1);
}

void Restart(string &in asParent, string &in asChild, int alState)
{
CheckPoint ("FirstCheckpoint", "checkpoint_1_spawn", "Happening", "DeathCategory", "Deathtext");
}

void falldown1(string &in asParent, string &in asChild, int alState)
{
SetEntityActive("rock_med02_push_1", true);
SetEntityActive("rock_med02_push_2", true);
SetEntityActive("rock_med02_push_3", true);
SetEntityActive("rock_med02_push_4", true);
SetEntityActive("rock_med02_push_5", true);
SetEntityActive("rock_med02_push_6", true);
SetEntityActive("rock_med02_push_7", true);
SetEntityActive("rock_med02_push_8", true);
PlaySoundAtEntity("falldown", "scare_falldown.snt", "rock_med02_push_8", 0, bool false);
}

void ABC(string &in asItem, string &in asEntity)
{
SetSwingDoorLocked( "Awesome_door", false, true);
PlaySoundAtEntity("", "unlock_door", "Awesome_door", 0, false);
RemoveItem("Awesome_key");
}

void SECRET(string &in asItem, string &in asEntity)
{
SetSwingDoorLocked( "secret_door", false, true);
PlaySoundAtEntity("", "unlock_door", "secret_door", 0, false);
RemoveItem("secret_key");
}

void bana(string &in asParent, string &in asChild, int alState)
{
SetEntityActive("osynlig", true);
SetEntityActive("synlig", false);
}

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

}

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

}


RE: Amnesia script help - Radical Batz - 08-26-2014

You had this "float 0" it's supposed to be just 0 and had "bool false" it's supposed to be just false

PHP Code:
PlaySoundAtEntity("falldown""scare_falldown.snt""rock_med02_push_8",  0false); 

read my updated reply next time pls


RE: Amnesia script help - theodorg - 08-26-2014

(08-26-2014, 07:02 PM)Dr.Badcat Wrote: You had this "float 0" it's supposed to be just 0 and had "bool false" it's supposed to be just false

PHP Code:
PlaySoundAtEntity("falldown""scare_falldown.snt""rock_med02_push_8",  0false); 

read my updated reply next time

YES! it fucking works! Love you man have a nice evening! Wink


RE: Amnesia script help - Radical Batz - 08-26-2014

(08-26-2014, 07:05 PM)theodorg Wrote:
(08-26-2014, 07:02 PM)Dr.Badcat Wrote: You had this "float 0" it's supposed to be just 0 and had "bool false" it's supposed to be just false

PHP Code:
PlaySoundAtEntity("falldown""scare_falldown.snt""rock_med02_push_8",  0false); 

read my updated reply next time

YES! it fucking works! Love you man have a nice evening! Wink

lol np Wink