Frictional Games Forum (read-only)

Full Version: -Eyeroll- More Scripting problems!(FIXED!)
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2
Problem solved, thank you all <3333
If you're sure the script is right, then check your map. Find all of the script areas used and MAKE SURE the names are correct. For you there should be one called push, Land, and there should be a door named ScareDoor.
After looking at it again, this looks EXACTLY like my tutorial. Did you look at it? xD
(09-08-2011, 01:56 AM)JenniferOrange Wrote: [ -> ]If you're sure the script is right, then check your map. Find all of the script areas used and MAKE SURE the names are correct. For you there should be one called push, Land, and there should be a door named ScareDoor.
After looking at it again, this looks EXACTLY like my tutorial. Did you look at it? xD
That's where I got it from lol. xD
hmn, so far I only have 3 script areas and those are it but I can shift the sound to go to "Land" and work from there.
As for the names of the scripts and door they are all matching so really I have no idea.



Either you can send me over your map and script and I can do it for you, or I can just explain it to you if you'd rather not. o: I have a working 'Danielpush' in one of my maps.
Here's my script just for the heck of it:
void OnStart()
{
AddEntityCollideCallback("Player", "push", "FlyingDaniel", true, 1);
AddEntityCollideCallback("Player", "door_scare", "Slam", true, 1);
}
void FlyingDaniel(string &in asParent, string &in asChild, int alState)
{
StopMusic(0, 0);
PlaySoundAtEntity("", "react_pant.snt", "push", 0, false);
AddPlayerBodyForce(30000, 0, 0, false);
}
void Slam(string &in asParent, string &in asChild, int alState)
{
SetSwingDoorClosed("cellar_1", true, true);
SetSwingDoorLocked("cellar_1", true, true);
PlaySoundAtEntity("", "00_laugh.snt", "door_scare", 0, false);
}
void OnEnter()
{
}
void OnLeave()
{
}
(09-08-2011, 02:08 AM)JenniferOrange Wrote: [ -> ]Either you can send me over your map and script and I can do it for you, or I can just explain it to you if you'd rather not. o: I have a working 'Danielpush' in one of my maps.
Would be pretty lazy of me to ask you to do that lol. I need to learn so I don't have to run back here to beg for help xD. I get the general idea of the scripting but I -must- be overlooking something. x.x
Well you're missing
void OnEnter() .

It took me SO long to master the push. I had to play with values and lining everything up.. it's going to take some practice.
FOUND ERROR:
PlaySoundAtEntity("", "00_laugh.snt", "door_scare", 0, false);
looking at your script "door_scare" does not exist. change that.
PlaySoundAtEntity("", "00_laugh.snt", "Land", 0, false);
Tell me if that does anything for you.
(09-08-2011, 02:13 AM)JenniferOrange Wrote: [ -> ]Well you're missing
void OnEnter() .

It took me SO long to master the push. I had to play with values and lining everything up.. it's going to take some practice.
I can tell, I've been working on this script for so long rofl. I'm on the verge of ragequitting.
As of now I put in void OnEnter() so would that have killed the entire script set? lol.
----------------------------------------
Fixed the error, but still nothing. I can walk passed the area without anything happening lol
(09-08-2011, 02:13 AM)JenniferOrange Wrote: [ -> ]FOUND ERROR:
PlaySoundAtEntity("", "00_laugh.snt", "door_scare", 0, false);
looking at your script "door_scare" does not exist. change that.
PlaySoundAtEntity("", "00_laugh.snt", "Land", 0, false);
Tell me if that does anything for you.
Nope, nothing. Still can walk right passed the doorway. =.='

Of what type is the area you're trying to collide with?
(09-08-2011, 04:52 AM)Your Computer Wrote: [ -> ]Of what type is the area you're trying to collide with?
Its a script area, I just wanted him pushed through the door essentially and the door to lock behind.
(09-08-2011, 02:31 PM)1xXxAcexXx1 Wrote: [ -> ]Its a script area, I just wanted him pushed through the door essentially.

In that case, since the code you posted seems correct and since the area is of a type that supports collision, i have to question my assumptions.

I've been assuming you have everything named in accordance to what you have named in the script, i've been assuming the area is within the path of the player and that you've been colliding with it. If all of these are true, then my next guess is that your "dev environment" is set to create map caches. Check to see if there are any files that end in .map_cache in your maps directory. If so, delete them and try (test) again.
Pages: 1 2