Charbomber

Villager
Member
Joined
Mar 22, 2018
Messages
9
Reaction score
0
First Language
English
Primarily Uses
RMVXA
I need a script so when certain characters e.g. the main character, the second main character, ect. get hit or hit something, they make a noise, the noise is different for hitting and getting hit, and different for every character. Is it possible and can i have it please?
 

bgillisp

Global Moderators
Global Mod
Joined
Jul 2, 2014
Messages
14,511
Reaction score
15,815
First Language
English
Primarily Uses
RMVXA

I've moved this thread to RGSSx Script Requests. Thank you.

 

mlogan

Global Moderators
Global Mod
Joined
Mar 18, 2012
Messages
16,768
Reaction score
9,304
First Language
English
Primarily Uses
RMMV
Can I make a suggestion that you change the title to something more specific, as this whole section is about scripts that are needed. A relevant title will allow members to know better whether they can help or not without needing to read the whole post.

In addition, you might try not using all caps, as it makes it seem as if you are shouting at people.
 

Charbomber

Villager
Member
Joined
Mar 22, 2018
Messages
9
Reaction score
0
First Language
English
Primarily Uses
RMVXA
thanks for the suggestion
 

Roninator2

Gamer
Veteran
Joined
May 22, 2016
Messages
4,827
Reaction score
1,372
First Language
English
Primarily Uses
RMVXA
Take a look at mog hunter scripts. I do remember in his demo the characters made noises when they got hit or died
 

Charbomber

Villager
Member
Joined
Mar 22, 2018
Messages
9
Reaction score
0
First Language
English
Primarily Uses
RMVXA
but i mean for different people and for hitting things
 

GGZiron

Veteran
Veteran
Joined
Nov 6, 2016
Messages
113
Reaction score
59
First Language
Bulgarian
Primarily Uses
RMMZ
Here I made something for you.
Code:
module Play_battle_sound

=begin
Author: GGZiron
Terms of use: Free for comercial and uncomercial projects. You have to credit
me as GGZiron
Version 1.0.1
Date of release 30.05.2018

About the script: It allows the actors to produce sound when hit or being hit
during battle.
=end
# Key values must represent the actor's id, and the string
# is the filename (without the extension)  of sound he/she ll produce
# Do not try to use sound files that rpg maker cannot play.
# The sound file is from the SE directory or SE built in RTP resourses.
  ACTOR_ATTACKS ={
  1 => "Blow2",  #in this example, actor with ID 1 will use
                     #sound named "Blow2" from the directory when attack.
  #add more entries
  }             
  ACTOR_IS_HIT ={
  1 => "Blow2",  #in this example, actor with ID 1 will try to use
                     #sound named "Blow2" from the directory when hit.
  #add more entries
  }
# WARNING: Do not add actor with invalid sound name. That will give error!!!
# Don't include actors you don't want to have sounds.

  #Set what volume and pitch will have the actor's sound
  SOUND_VOLUME = 100
  SOUND_PITCH  = 100
end

class Game_Battler < Game_BattlerBase
#===========================Edited Methods===================================
  alias_method :execute_damage_old, :execute_damage
  def execute_damage(user)
    execute_damage_old(user)
    set_battle_sound(user, true) if @result.hp_damage > 0 && self.actor?
  end
  alias_method :item_apply_old, :item_apply
  def item_apply(user, item)
    set_battle_sound(user, false) if user.actor?
    item_apply_old(user, item)
  end
#============================================================================
#===========================New Method=======================================
  def set_battle_sound(user, attacked)
    if self.actor? && user.actor?
     return if self.id == user.id
   end
    sound = attacked ? Play_battle_sound::ACTOR_IS_HIT[self.id] : Play_battle_sound::ACTOR_ATTACKS[user.id]
    volume = Play_battle_sound::SOUND_VOLUME
    pitch = Play_battle_sound::SOUND_PITCH
    Audio.se_play("Audio/SE/" + sound, volume, pitch) if sound
  end
#============================================================================
end

Knowing myself, soon I could update some expressions and stuffs I dislike. Is not heavely tested for bugs, just it worked on my playtest. Did not tried everything possible. So, test it too, and tell if works. If no, tell me what's wrong with it.
Edit: The terms of use are in the script's header.
Edit 2: The default sounds I set for actor 1 are more than inadequate. They are just for testing purpose, so you edit them if you actually use actor 1.
Edit 3: Did minor touch, just removed the use of variable, that is not really needed.
 
Last edited:

Charbomber

Villager
Member
Joined
Mar 22, 2018
Messages
9
Reaction score
0
First Language
English
Primarily Uses
RMVXA
There is no battler base, remember i want an RPG maker XP script! (just saying, just in case this is an RPG maker VX ace thing. Sucks when you find bugs :/
 
Last edited:

Charbomber

Villager
Member
Joined
Mar 22, 2018
Messages
9
Reaction score
0
First Language
English
Primarily Uses
RMVXA
oh i see they thought it was a VXA script request
 

hiddenone

Lurker Extraordinaire
Global Mod
Joined
Feb 19, 2014
Messages
2,925
Reaction score
6,031
First Language
english
Primarily Uses
RMMZ

I've moved this thread to RGSS Script Requests. Thank you.


If you don't mention what engine you're using, then people will usually assume that you're talking about whatever engine is listed on your 'Primarily Uses'. :)
Also @Charbomber , please don't double post just edit your previous post if you have something more to add.
 

DerVVulfman

Resident Werewolf
Veteran
Joined
Jun 26, 2012
Messages
315
Reaction score
158
First Language
English
Primarily Uses
RMXP
Dalissa's Battle Cry
http://save-point.org/thread-2579.html

Geez, I hadn't worked on this thing for a decade. I'm sure I 'could' pen a better version now.... But you will see from the demo that it works.
 

Latest Threads

Latest Posts

Latest Profile Posts

The most recent sign that I am old. I have done martial arts for over 4 decades. Never HAD to stretch out. Good, of course, but never required. Was doing some kicks in the kitchen because, why not, and I felt a pop in the back of my thigh. Now I am limping around. Gotta love getting old.
One of the biggest perks of being fluent in English is how many new and interesting recipes I am able to find and try out that I would have hardly come across if I just spoke my mothertounge :3
Princess.png
Arms aren't done yet and I think I've set myself up for a nightmare to animate all the poses.
Based off MZs people 3-4
She's gonna be an Assist class.
If I’m gonna get this many migraines, can I at least have it be part of an X-Men power origin story?

Forum statistics

Threads
131,682
Messages
1,222,203
Members
173,434
Latest member
Cosmiz
Top