Frictional Games Forum (read-only)

Full Version: [Solved] Using Boxes To Trigger Script?
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Here is my code:

Code:
void OnStart()
{
    AddEntityCollideCallback("storage_box_1", "Throw2", "Barricade", true, 1);
    PlayMusic("02_amb_strange.ogg", true, 1, 0, 5, true);
}
void Barricade(string &in asParent, string &in asChild, int alState)
{
    AddPropForce("barrel01_1", 0, 2, 10, "World");
    AddPropForce("barrel01_2", 0, 2, 10, "World");
    AddPropForce("barrel01_3", 0, 2, 10, "World");
    AddPropForce("storage_box_wood02_moveable", 0, 2, 10, "World");
    AddPlayerSanity(25);
    PlaySoundAtEntity("DaughterRelief.ogg", "DaughterRelief.snt", "Player", 0, false);
}


Long story short, it doesn't work. Every entity is named correctly. Basically, this is making it so that when the storage box enters the area of "Throw2", it triggers the script. It doesn't work.
Have you named the script file and map file right?
Put a debug message in the Barricade function, to see if the collision is even happening. If the debug message doesn't pop up, try deleting the map cache in your maps folder. Close Amnesia before you do this. If it does pop up, your prop force values are probably too small.
The debug message showed up, but nothing else happened. Not even the player sanity, or the sound.

Sad
Try changing the internal name of the sound. Also, check your sound properties file (snt). Perhaps you forgot to change a value in there. In the debug menu, check the box next to "Show sounds playing". See if the sound plays. If it doesn't, you probably placed the sound file in the wrong directory or something like that.

Multiply the force values by 100, see what that does. It'll take a few minutes of testing to get the values you want.
(02-11-2012, 07:12 AM)palistov Wrote: [ -> ]Try changing the internal name of the sound. Also, check your sound properties file (snt). Perhaps you forgot to change a value in there. In the debug menu, check the box next to "Show sounds playing". See if the sound plays. If it doesn't, you probably placed the sound file in the wrong directory or something like that.

Multiply the force values by 100, see what that does. It'll take a few minutes of testing to get the values you want.
Thanks. You helped. It had something to do in the .snt file about priorities.

Rep for you!
Awesome! Just remember tricks like that, just so you can scope in on the problem.