Sound effect when event runs into player?

● ARCHIVED · READ-ONLY
Started by Misty 8 posts View original ↗
  1. 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
  2. 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")
  3. 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?
  4. Shaz said:
    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.

    GrandmaDeb said:
    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.
  5. 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.
  6. Shaz said:
    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.