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

Global Moderators
Global Mod
Joined
Mar 2, 2012
Messages
43,699
Reaction score
15,297
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,975
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

Global Moderators
Global Mod
Joined
Mar 2, 2012
Messages
43,699
Reaction score
15,297
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.
 

Latest Threads

Latest Posts

Latest Profile Posts

To be released 2021/10/21
Now that I made this "What the MZ RTP is missing" spreadsheet it's itching me to fill some the gaps D:
Aaaaand I completely forgot about the RMMV Chicken Rave my brother decided to implement in a parody of my VERY FIRST UNFINISHED project. We could not escape the chicken rave... The chickens would block the ladder...
I love how I can look up a problem I'm having with my game, find a post from like six years ago that addresses the issue, and the solution provided still works in RPG Maker.
It's times like those that my life feels really easy XD
Change costumes with equipment!

Forum statistics

Threads
115,949
Messages
1,094,262
Members
151,205
Latest member
Vertette
Top