VeNoMzTeamHysterical
Member
Posts: 240
Threads: 36
Joined: Dec 2012
Reputation:
3
|
Monster Play Sound After PathNode!!!!
Anyone knows how to the script when a monster is at the pathnode and he is be gone i want to get a sound
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
|
|
02-14-2013, 03:32 PM |
|
FlawlessHappiness
Posting Freak
Posts: 3,980
Threads: 145
Joined: Mar 2012
Reputation:
171
|
RE: Monster Play Sound After PathNode!!!!
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
Trying is the first step to success.
|
|
02-14-2013, 04:04 PM |
|
VeNoMzTeamHysterical
Member
Posts: 240
Threads: 36
Joined: Dec 2012
Reputation:
3
|
RE: Monster Play Sound After PathNode!!!!
(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.
|
|
02-14-2013, 04:09 PM |
|
FlawlessHappiness
Posting Freak
Posts: 3,980
Threads: 145
Joined: Mar 2012
Reputation:
171
|
RE: Monster Play Sound After PathNode!!!!
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
Trying is the first step to success.
|
|
02-14-2013, 04:14 PM |
|
VeNoMzTeamHysterical
Member
Posts: 240
Threads: 36
Joined: Dec 2012
Reputation:
3
|
RE: Monster Play Sound After PathNode!!!!
(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
|
|
02-14-2013, 04:22 PM |
|
FlawlessHappiness
Posting Freak
Posts: 3,980
Threads: 145
Joined: Mar 2012
Reputation:
171
|
RE: Monster Play Sound After PathNode!!!!
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
Trying is the first step to success.
|
|
02-14-2013, 04:48 PM |
|
VeNoMzTeamHysterical
Member
Posts: 240
Threads: 36
Joined: Dec 2012
Reputation:
3
|
RE: Monster Play Sound After PathNode!!!!
(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....
|
|
02-14-2013, 04:54 PM |
|
FlawlessHappiness
Posting Freak
Posts: 3,980
Threads: 145
Joined: Mar 2012
Reputation:
171
|
RE: Monster Play Sound After PathNode!!!!
You could post your script now
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);
Trying is the first step to success.
|
|
02-14-2013, 05:00 PM |
|
VeNoMzTeamHysterical
Member
Posts: 240
Threads: 36
Joined: Dec 2012
Reputation:
3
|
RE: Monster Play Sound After PathNode!!!!
(02-14-2013, 05:00 PM)BeeKayK Wrote: You could post your script now
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
|
|
02-14-2013, 05:02 PM |
|
FlawlessHappiness
Posting Freak
Posts: 3,980
Threads: 145
Joined: Mar 2012
Reputation:
171
|
RE: Monster Play Sound After PathNode!!!!
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
Trying is the first step to success.
|
|
02-14-2013, 05:05 PM |
|
|