Frictional Games Forum (read-only)

Full Version: Game Problems
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2 3 4 5 6
So, im sure I will have many problems with my custom Story during the editing. So I open a Thread for this problems^^'
So my Problem in this moment is weird....
I want to make a Jump Scare. A grunt Body have to teleporting front of the player. This works perfectly. But it doesnt dissapear. I write in another Area the same but I change from True to False. It doesn't Work...
Why?


This is the using Script:



AddEntityCollideCallback("Player", "ScriptArea_2", "TOTSCHRECK", true, 1);
AddEntityCollideCallback("Player", "ScriptArea_3", "AndereArea2", true, 1);
}

void TOTSCHRECK(string &in asParent, string &in asChild, int alState)
{
PlaySoundAtEntity("", "bam.snt", "Player", 0, false);
GiveSanityDamage(5.0f, true);
SetEntityActive("grunt_body_part2_2", true);
}

void AndereArea2(string &in asParent, string &in asChild, int alState)
{
PlaySoundAtEntity("", "react_pant.snt", "Player", 0, false);
GiveSanityDamage(5.0f, true);
SetEntityActive("grunt_body_part2_2", false);
}

Whats wrong?
Wouldn't it be more logical making a timer for this? Anyways, I don't see anything wrong. Delete map_cache's, check the names, etc.

A timer would be:

AddEntityCollideCallback("Player", "ScriptArea_2", "TOTSCHRECK", true, 1);

}



void TOTSCHRECK(string &in asParent, string &in asChild, int alState)

{

PlaySoundAtEntity("", "bam.snt", "Player", 0, false);

GiveSanityDamage(5.0f, true);

SetEntityActive("grunt_body_part2_2", true);
AddTimer("", secondstodoit, "AndereArea2");

}



void AndereArea2(string &in asTimer)

{

PlaySoundAtEntity("", "react_pant.snt", "Player", 0, false);

GiveSanityDamage(5.0f, true);

SetEntityActive("grunt_body_part2_2", false);

}
Even though I'm a complete and utter scripting-noob, that made me chuckle Big Grin

(Try writing the amount of seconds there, not the word "secondstodoit"...)
(12-06-2012, 05:32 PM)Fishnugget Wrote: [ -> ]Now comes this:
http://i46.servimg.com/u/f46/17/76/85/90/2012_112.jpg
Ehem... it was a text for you to understand what to put... you must put a number (the seconds to do it).
Like:

AddTimer("", 1, "AndereArea2");

You just copy-pasted the script, right?
I want that a door explodes, when I arrive in an area. How can I make that?
When you collide with the area use the line:
SetPropHealth("INSERTDOORNAMEHERE", 0);
Thats the whole Script?
Don't I have to write wich area?
Of course you do! But if you don't know how to write it, then i recommend you to check out basic scripting first Wink I can reveal that you have to use AddEntityCollideCallback. Makes sense since you collide with an area Smile
Then use the line i provided
Does an Tutorial exist? Sorry i dont get it^^'
Pages: 1 2 3 4 5 6