Frictional Games Forum (read-only)

Full Version: Monster Play Sound After PathNode!!!!
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2 3
Anyone knows how to the script when a monster is at the pathnode and he is be gone i want to get a sound Smile

AddEntityCollideCallback("monsterscene1", "RocksSound", "RocksFunc", true, 1);


So i want to if the monster hits the script area rocksound it wil activate a function called rocksfunc.

void RocksFunc(string &in Entity)
{
PlaySoundAtEntity("", "break_wood1.snt", "monsterscene1", 0, false);
}

But it doesnt work ;(

link of my story file http://www.mediafire.com/?ba1a5xycwdqvdp8
Make sure the player cannot see the monster when he is supposed to disappear.
Put an area where the monster will despawn.

When the monster collides with the area, set it inactive, and play the sound
(02-14-2013, 04:04 PM)BeeKayK Wrote: [ -> ]Make sure the player cannot see the monster when he is supposed to disappear.
Put an area where the monster will despawn.

When the monster collides with the area, set it inactive, and play the sound

Well monster walks around a corner... player dont see it after 2 sec player cant see monster i want an BAM sound and then they way is collapsed with rocks.... but i dont know the script to do it ><

i just want if the monster is at the last pathnode its be gone and activate that BAM sound.
It happens if you make it collide with a script area.

You must understand what the script does.

AddEntityCollideCallback(string& asParentName, string& asChildName, string& asFunction, bool abDeleteOnCollide, int alStates);


This is the entity that collides with something. In your case, a monster.
This is the object that entity_1 collides with. In your case, a scriptarea


When the monster collides with the script area it will call the function:


SetEntityActive("Monster", false);
and
PlaySoundAtEntity("", "soundfile.snt", "Entity", 0, false);
Which you have probably used before
(02-14-2013, 04:14 PM)BeeKayK Wrote: [ -> ]It happens if you make it collide with a script area.

You must understand what the script does.

AddEntityCollideCallback(string& asParentName, string& asChildName, string& asFunction, bool abDeleteOnCollide, int alStates);


This is the entity that collides with something. In your case, a monster.
This is the object that entity_1 collides with. In your case, a scriptarea


When the monster collides with the script area it will call the function:


SetEntityActive("Monster", false);
and
PlaySoundAtEntity("", "soundfile.snt", "Entity", 0, false);
Which you have probably used before

So you mean i can just make the same as on a Player 'if player walks on a script it activates an function' so you mean i can do it also with a monster Pathnode where the monster go's and then script file where its the end of his pathnode since there is the script file where he collides its activating a function that is activates a sound Big Grin
You can do that with every entity in the game!
That's how scripting works.

You type a name, and the script will look through your map for an entity that has the same name. Then it will use it.
It's that simple!

You just learned something important about scripting! Keep doing that
(02-14-2013, 04:48 PM)BeeKayK Wrote: [ -> ]You can do that with every entity in the game!
That's how scripting works.

You type a name, and the script will look through your map for an entity that has the same name. Then it will use it.
It's that simple!

You just learned something important about scripting! Keep doing that

Well its still not working lol xD

I dont know what i do wrong....
You could post your script now Wink

If this is the one you are using:

AddEntityCollideCallback("monsterscene1", "RocksSound", "RocksFunc", true, 1);

Then i'll just fix it for you:

AddEntityCollideCallback("MonsterNameGoesHere", "RocksSound", "RocksFunc", true, 1);
(02-14-2013, 05:00 PM)BeeKayK Wrote: [ -> ]You could post your script now Wink

If this is the one you are using:

AddEntityCollideCallback("monsterscene1", "RocksSound", "RocksFunc", true, 1);

Then i'll just fix it for you:

AddEntityCollideCallback("MonsterNameGoesHere", "RocksSound", "RocksFunc", true, 1);

The monster name is 'monsterscene1 i will test it k Smile
oh, ok....

Ah i see it!

(string &in Entity) These parameters are for interacting, not for colliding.



(string &in asParent, string &in asChild, int alState) is the correct one.


Maybe this will help (Sorry for selfpromotion) http://www.frictionalgames.com/forum/thread-18368.html
Pages: 1 2 3