Strembitsky
Senior Member
Posts: 254
Threads: 37
Joined: Feb 2012
Reputation:
3
|
[Solved] Using Boxes To Trigger Script?
Here is my 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.
The Nightmares v1.0 - Dreadful Fires WIP
(This post was last modified: 02-11-2012, 07:16 AM by Strembitsky.)
|
|
02-11-2012, 06:54 AM |
|
flamez3
Posting Freak
Posts: 1,281
Threads: 48
Joined: Apr 2011
Reputation:
57
|
RE: Using Boxes To Trigger Script?
Have you named the script file and map file right?
|
|
02-11-2012, 07:01 AM |
|
palistov
Posting Freak
Posts: 1,208
Threads: 67
Joined: Mar 2011
Reputation:
57
|
RE: Using Boxes To Trigger Script?
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.
|
|
02-11-2012, 07:03 AM |
|
Strembitsky
Senior Member
Posts: 254
Threads: 37
Joined: Feb 2012
Reputation:
3
|
RE: Using Boxes To Trigger Script?
The debug message showed up, but nothing else happened. Not even the player sanity, or the sound.
The Nightmares v1.0 - Dreadful Fires WIP
|
|
02-11-2012, 07:09 AM |
|
palistov
Posting Freak
Posts: 1,208
Threads: 67
Joined: Mar 2011
Reputation:
57
|
RE: Using Boxes To Trigger Script?
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 |
|
Strembitsky
Senior Member
Posts: 254
Threads: 37
Joined: Feb 2012
Reputation:
3
|
RE: Using Boxes To Trigger Script?
(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!
The Nightmares v1.0 - Dreadful Fires WIP
|
|
02-11-2012, 07:16 AM |
|
palistov
Posting Freak
Posts: 1,208
Threads: 67
Joined: Mar 2011
Reputation:
57
|
RE: Using Boxes To Trigger Script?
Awesome! Just remember tricks like that, just so you can scope in on the problem.
|
|
02-11-2012, 07:17 AM |
|
|