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


Thread Rating:
  • 1 Vote(s) - 5 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Monster Play Sound After PathNode!!!!
VeNoMzTeamHysterical Offline
Member

Posts: 240
Threads: 36
Joined: Dec 2012
Reputation: 3
#1
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 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

http://www.frictionalgames.com/forum/thread-21719.html
Evil Awaking Work In Progress!
Hours Spend 472.
(This post was last modified: 02-15-2013, 11:49 AM by VeNoMzTeamHysterical.)
02-14-2013, 03:32 PM
Website Find
FlawlessHappiness Offline
Posting Freak

Posts: 3,980
Threads: 145
Joined: Mar 2012
Reputation: 171
#2
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
Find
VeNoMzTeamHysterical Offline
Member

Posts: 240
Threads: 36
Joined: Dec 2012
Reputation: 3
#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.

http://www.frictionalgames.com/forum/thread-21719.html
Evil Awaking Work In Progress!
Hours Spend 472.
02-14-2013, 04:09 PM
Website Find
FlawlessHappiness Offline
Posting Freak

Posts: 3,980
Threads: 145
Joined: Mar 2012
Reputation: 171
#4
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.
(This post was last modified: 02-14-2013, 04:14 PM by FlawlessHappiness.)
02-14-2013, 04:14 PM
Find
VeNoMzTeamHysterical Offline
Member

Posts: 240
Threads: 36
Joined: Dec 2012
Reputation: 3
#5
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 Big Grin

http://www.frictionalgames.com/forum/thread-21719.html
Evil Awaking Work In Progress!
Hours Spend 472.
02-14-2013, 04:22 PM
Website Find
FlawlessHappiness Offline
Posting Freak

Posts: 3,980
Threads: 145
Joined: Mar 2012
Reputation: 171
#6
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
Find
VeNoMzTeamHysterical Offline
Member

Posts: 240
Threads: 36
Joined: Dec 2012
Reputation: 3
#7
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....

http://www.frictionalgames.com/forum/thread-21719.html
Evil Awaking Work In Progress!
Hours Spend 472.
02-14-2013, 04:54 PM
Website Find
FlawlessHappiness Offline
Posting Freak

Posts: 3,980
Threads: 145
Joined: Mar 2012
Reputation: 171
#8
RE: Monster Play Sound After PathNode!!!!

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);

Trying is the first step to success.
(This post was last modified: 02-14-2013, 05:01 PM by FlawlessHappiness.)
02-14-2013, 05:00 PM
Find
VeNoMzTeamHysterical Offline
Member

Posts: 240
Threads: 36
Joined: Dec 2012
Reputation: 3
#9
RE: Monster Play Sound After PathNode!!!!

(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

http://www.frictionalgames.com/forum/thread-21719.html
Evil Awaking Work In Progress!
Hours Spend 472.
02-14-2013, 05:02 PM
Website Find
FlawlessHappiness Offline
Posting Freak

Posts: 3,980
Threads: 145
Joined: Mar 2012
Reputation: 171
#10
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
Find




Users browsing this thread: 4 Guest(s)