Sound effect when event runs into player?

Misty

Programmer
Veteran
Joined
Sep 19, 2013
Messages
127
Reaction score
12
First Language
English
Primarily Uses
Hello everyone,

I want my event to make a sounds when bumping into the player and not when I bump or touch a event.

More detail:

Sprite event------------->*Bumps player* = sound 1 

Sprite event------------->*Bumps player* = sound 2

Sprite event------------->*Bumps player* = sound 3

Sprite event------------->*Bumps player* = sound 4

Sprite event------------->*Bumps player* = sound 5

Sprite event------------->*Bumps player* = sound 6

Sprite event------------->*Bumps player* = sound 7

NOT

Player touches-------------> *Bumps event* = sound 1,2,3,4,5,6,7

I don't want the sound to activate when the player touches the event.

Not sure if I need a script or not for this.

Thank you,

ZEFK
 
Last edited by a moderator:

Shaz

Veteran
Veteran
Joined
Mar 2, 2012
Messages
40,078
Reaction score
13,693
First Language
English
Primarily Uses
RMMV
This is going to need a script. Moving to RGSS3 Script Requests

Are you saying you want a DIFFERENT sound each time the event bumps into the player? Or just the same one each time?

In fact, try this in a new slot:

class Game_Event < Game_Character def check_event_trigger_touch(x, y) return if $game_map.interpreter.running? if @trigger == 2 && $game_player.pos?(x, y) && !jumping? && normal_priority? << play sound here >> start end endend<< play sound here >> could be replaced with any of the following:Sound.play_actor_damage (or any of the Sound methods)

Sound.play_system_sound(n) (for a numbered sound defined in the System tab of the database)

Audio.se_play(filename[, volume[, pitch]]) (for a sound that's in your SE folder but not defined anywhere else)

for example

Audio.se_play("EventBump")
 
Last edited by a moderator:

GrandmaDeb

Modern Exteriors Posted!
Veteran
Joined
Apr 25, 2012
Messages
4,467
Reaction score
2,942
Primarily Uses
So, wouldn't a player touch event work for this, Shaz?


Or is the problem the restriction that the noise not result from bumping into the event on the player's part?


Is that what you wanted, ZEFK? That the noise is ONLY when the event touches the player and NOT when the player touches the event?
 
Last edited by a moderator:

Misty

Programmer
Veteran
Joined
Sep 19, 2013
Messages
127
Reaction score
12
First Language
English
Primarily Uses
This is going to need a script. Moving to RGSS3 Script Requests

Are you saying you want a DIFFERENT sound each time the event bumps into the player? Or just the same one each time?

In fact, try this in a new slot:

class Game_Event < Game_Character def check_event_trigger_touch(x, y) return if $game_map.interpreter.running? if @trigger == 2 && $game_player.pos?(x, y) && !jumping? && normal_priority? << play sound here >> start end endend<< play sound here >> could be replaced with any of the following:Sound.play_actor_damage (or any of the Sound methods)

Sound.play_system_sound(n) (for a numbered sound defined in the System tab of the database)

Audio.se_play(filename[, volume[, pitch]]) (for a sound that's in your SE folder but not defined anywhere else)

for example

Audio.se_play("EventBump")
"Are you saying you want a DIFFERENT sound each time the event bumps into the player?"

Yes, that's what I'm looking for. Many character will be making around 7 different sounds each. 

I would need to list all the sounds for each character and call it to the event for when it touches the player.

Event1-(Strike1, slap1, hit1 ,howl1, swing1, bite1) 

Event2-(Strike2, slap2, hit2 ,howl2, swing2bite2)

etc (to event50)

Strike2 and strike1 are completely different. Every sound for each event will be unique or different.

There will be around 50 characters events.  Each strike or event bump makes a different sound. I'd like the sounds to go in order after each bump.

So, wouldn't a player touch event work for this, Shaz?

Or is the problem the restriction that the noise not result from bumping into the event on the player's part?

Is that what you wanted, ZEFK? That the noise is ONLY when the event touches the player and NOT when the player touches the event?
A player touch won't work unless the player bumps into the event. The event bumping into me doesn't activate the sounds.
 
Last edited by a moderator:

Shaz

Veteran
Veteran
Joined
Mar 2, 2012
Messages
40,078
Reaction score
13,693
First Language
English
Primarily Uses
RMMV
No, because event touch and player touch both call the same method to trigger the event. At that time, the event turns towards the player, and you can't tell whether it was triggered by a player touch or by an event touch.


The code I added is ONLY run on the event touch trigger.


How do you want to distinguish between events that do this and events that don't? I imagine you don't want ALL events with Event Touch trigger to behave this way.
 

Misty

Programmer
Veteran
Joined
Sep 19, 2013
Messages
127
Reaction score
12
First Language
English
Primarily Uses
No, because event touch and player touch both call the same method to trigger the event. At that time, the event turns towards the player, and you can't tell whether it was triggered by a player touch or by an event touch.

The code I added is ONLY run on the event touch trigger.

How do you want to distinguish between events that do this and events that don't? I imagine you don't want ALL events with Event Touch trigger to behave this way.
Hmm....I guess the easiest way would be to call a certain list of sounds.

[Character name here]-(Strike1, slap1, hit1 ,howl1, swing1, bite1) 

[Jezla]-(Strike1, slap1, hit1 ,howl1, swing1, bite1)

Event Custom Script call:

Script: Jezla

I think naming and listing the sounds in the script would be the easiest way. Afterwards, use a script input and place the name within it for the event it's associated with.
 

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

Latest Threads

Latest Posts

Latest Profile Posts

Haired slime? Trying some different styles of art. Maybe I can make some resources with this new kind of painting.......
i love my game very much
Uh, I'm probably overthinking this, but I think that some of my music sounds kinda...bad?
The melodies are just sort of awkward, and don't flow.
I'm really not sure what to do. Why am I even worrying about this? I don't even have a battle system yet!
And the Lord said, let there be lighting effects! And there were lighting effects! And it was good...ish? Might tweak this some more.
Today was a day of good things! Thank you fate! I pray to the darkness that those that read this will enjoy a good day as well! Power to the gam mak.

Forum statistics

Threads
105,724
Messages
1,015,915
Members
137,402
Latest member
Lopilon
Top