Facebook Twitter YouTube Frictional Games | Forum | Privacy Policy | Dev Blog | Dev Wiki | Support | Gametee


Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
[Solved] Using Boxes To Trigger Script?
Strembitsky Offline
Senior Member

Posts: 254
Threads: 37
Joined: Feb 2012
Reputation: 3
#1
[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
Find
flamez3 Offline
Posting Freak

Posts: 1,281
Threads: 48
Joined: Apr 2011
Reputation: 57
#2
RE: Using Boxes To Trigger Script?

Have you named the script file and map file right?

02-11-2012, 07:01 AM
Find
palistov Offline
Posting Freak

Posts: 1,208
Threads: 67
Joined: Mar 2011
Reputation: 57
#3
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
Find
Strembitsky Offline
Senior Member

Posts: 254
Threads: 37
Joined: Feb 2012
Reputation: 3
#4
RE: Using Boxes To Trigger Script?

The debug message showed up, but nothing else happened. Not even the player sanity, or the sound.

Sad

The Nightmares v1.0 - Dreadful Fires WIP
02-11-2012, 07:09 AM
Find
palistov Offline
Posting Freak

Posts: 1,208
Threads: 67
Joined: Mar 2011
Reputation: 57
#5
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
Find
Strembitsky Offline
Senior Member

Posts: 254
Threads: 37
Joined: Feb 2012
Reputation: 3
#6
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
Find
palistov Offline
Posting Freak

Posts: 1,208
Threads: 67
Joined: Mar 2011
Reputation: 57
#7
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
Find




Users browsing this thread: 1 Guest(s)