Submit Your Article


 
RPG Maker

Welcome Guest ( Log In | Register )


  Games Resources RPG Maker VX RPG Maker XP Scripts Tutorials Downloads

2 Pages V   1 2 >  
Reply to this topicStart new topic
> Guyver's Bane's snippets and edits [UPDATED], Previous Update, 4-30-10
Guyver's Bane
post Mar 20 2010, 11:00 AM
Post #1


The Guiding Light
Group Icon

Group: Revolutionary
Posts: 801
Type: Event Designer
RM Skill: Masterful




Having experimented with the script editor I've come up with several little snippets that are surprisingly easy yet effective. Special thanks to some person for showing me how make them into snippets and not just edits.

*Update*

Just paste the snippets into materials and add the appropriate vocab.

1st: Separate sound effect for critical hits. Sound effect below the code. Place in materials.
[Show/Hide] GB CRITICAL SE
CODE
class Scene_Battle < Scene_Base
def display_critical(target, obj = nil)
    if target.critical
      if target.actor?
        text = Vocab::CriticalToActor
        Audio.se_play('AUDIO/SE/superdamage', 80, 100)
      else
        text = Vocab::CriticalToEnemy
        Audio.se_play('AUDIO/SE/superdamage', 80, 100)
      end
      @message_window.add_instant_text(text)
      wait(5)
    end
  end
  
end

Attached File  Superdamage.zip ( 16.84K ) Number of downloads: 46


Mediafire alternative download.

http://www.mediafire.com/?jfxtzjwdybi

2nd: Dragon Quest 8 damage calculation. Replace line 643 Game_Battler. (More realistic damage system i think.) This is an edit. Follow the instructions. Replace line 643 in Game_Battler.
CODE
damage = attacker.atk / 2 - self.def / 4


3rd: Common Event after battle without script. Insert in Scene_Battle, line 595 under display_level_up. This is an edit. Follow the instructions. Place under line 595 in Scene_Battle, under display_level_up.
CODE
$game_temp.common_event_id = "your event id without quotations"


4th: This will make the gold and exp messages more flexible. EX: If your currency is called gold coins and the monster you defeat in battle only gives 1 coin at the end, this edit will show the message "the party gained 1 gold coin" or whatever you have it to say. If you have the experience message to say "experience points" this will do the same.
Put these in the Script Editor Vocab with the rest of the vocab. NOTE: This is only for the specified examples when the currency isn't just called "Gold" or the experience is given more depth, saying "points" after experience. Otherwise it will sound weird.
CODE
ObtainExp       = "Each party member recieves %s experience points!"
ObtainExp1      = "Each party member recieves %s experience point!"
ObtainGold1      = "The party gained %s%s."
ObtainGold2      = "The party gained %s gold coin."

[Show/Hide] GB FLEX GOLD/EXP
CODE
class Scene_Battle < Scene_Base
def display_exp_and_gold
exp = $game_troop.exp_total
gold = $game_troop.gold_total
$game_party.gain_gold(gold)
text = sprintf(Vocab::Victory, $game_party.name)
$game_message.texts.push('\|' + text)
if exp == 1
text = sprintf(Vocab::ObtainExp1, exp)
$game_message.texts.push('\.' + text)
elsif exp > 1
text = sprintf(Vocab::ObtainExp, exp)
$game_message.texts.push('\.' + text)
end
if gold == 1
text = sprintf(Vocab::ObtainGold2, gold, Vocab::gold)
$game_message.texts.push('\.' + text)
elsif gold > 1
text = sprintf(Vocab::ObtainGold1, gold, Vocab::gold)
$game_message.texts.push('\.' + text)
end
wait_for_message
end

end


5th: This is for the damage messages. Like above this will only work correctly if the damage says "%s took %s points of damage!" for both ActorDamage and EnemyDamage. Paste the snippet in materials.
Put these in the script editor vocab as well.
CODE
Actor1Damage     = "%s takes %s point of damage!"
Enemy1Damage     = "%s took %s point of damage!"

[Show/Hide] GB FLEX DAMAGE
CODE
class Scene_Battle < Scene_Base
  #--------------------------------------------------------------------------
  # * Show HP Damage
  #     target : Target
  #     obj    : Skill or item
  #--------------------------------------------------------------------------
  def display_hp_damage(target, obj = nil)
    if target.hp_damage == 0                # No damage
      return if obj != nil and obj.damage_to_mp
      return if obj != nil and obj.base_damage == 0
      fmt = target.actor? ? Vocab::ActorNoDamage : Vocab::EnemyNoDamage
      text = sprintf(fmt, target.name)
    elsif target.absorbed                   # Absorb
      fmt = target.actor? ? Vocab::ActorDrain : Vocab::EnemyDrain
      text = sprintf(fmt, target.name, Vocab::hp, target.hp_damage)
    elsif target.hp_damage == 1              # Damage
      if target.actor?
        text = sprintf(Vocab::Actor1Damage, target.name, target.hp_damage)
        Sound.play_actor_damage
        $game_troop.screen.start_shake(5, 5, 10)
      else
        text = sprintf(Vocab::Enemy1Damage, target.name, target.hp_damage)
        Sound.play_enemy_damage
        target.blink = true
      end
    elsif target.hp_damage > 0              # Damage
      if target.actor?
        text = sprintf(Vocab::ActorDamage, target.name, target.hp_damage)
        Sound.play_actor_damage
        $game_troop.screen.start_shake(5, 5, 10)
      else
        text = sprintf(Vocab::EnemyDamage, target.name, target.hp_damage)
        Sound.play_enemy_damage
        target.blink = true
      end
    else                                    # Recovery
      fmt = target.actor? ? Vocab::ActorRecovery : Vocab::EnemyRecovery
      text = sprintf(fmt, target.name, Vocab::hp, -target.hp_damage)
      Sound.play_recovery
    end
    @message_window.add_instant_text(text)
    wait(30)
  end
  
  end


6th: This will allow you to have alternative wait messages. Insert these into the Script Editor Vocab. You can edit what they say to your liking. But leave "%s" alone. You can thank Night5h4d3 for this snippet. Couldn't have got to work with out him. Paste snippet in materials.
CODE
DoWait1         = "%s laughed flippantly."
DoWait2         = "%s stared off into space."
DoWait3         = "%s prepared itself to attack."
DoWait4         = "%s is observing the battle."

[Show/Hide] GB ALTERNATIVE WAIT
CODE
class Scene_Battle < Scene_Base
  def execute_action_wait
    case rand(4)
    when 0;  text = sprintf(Vocab::DoWait1, @active_battler.name)
    when 1;  text = sprintf(Vocab::DoWait2, @active_battler.name)
    when 2;  text = sprintf(Vocab::DoWait3, @active_battler.name)
    when 3;  text = sprintf(Vocab::DoWait4, @active_battler.name)
    end
    @message_window.add_instant_text(text)
    wait(45)
  end
  
end


*New*

7th: This new one will let you have random GameOver screens. Requested by DarkSarul. You can add more by copying one of the "when" lines and changing the number. Be sure "case rand()" is set to a number equal to the number of GameOver screens you are using. By default it's set to 3. Credit to Night5h4d3 also.

[Show/Hide] GB RANDOM GAMEOVER SCREEN
CODE
class Scene_Gameover < Scene_Base
  def create_gameover_graphic
    @sprite = Sprite.new
    case rand(3)
    when 0; @sprite.bitmap = Cache.system("GameOver")
    when 1; @sprite.bitmap = Cache.system("GameOver2")
    when 2; @sprite.bitmap = Cache.system("GameOver3")
    end
  end
  
end


8th: This one will let you have random Title screens. You can add more by copying one of the "when" lines and changing the number. Be sure "case rand()" is set to a number equal to the number of Title screens you are using. By default it's set to 3. Credit to Night5h4d3 also.

[Show/Hide] GB RANDOM TITLE SCREEN
CODE
class Scene_Title < Scene_Base
def create_title_graphic
@sprite = Sprite.new
case rand(3)
when 0; @sprite.bitmap = Cache.system("Title")
when 1; @sprite.bitmap = Cache.system("Title2")
when 2; @sprite.bitmap = Cache.system("Title3")
end
end

end


9th: This one will let you have random Defeat messages. You can add more by copying one of the "when" lines and changing the number. Be sure "case rand()" is set to a number equal to the number of Defeat messages you are using. By default it's set to 3. Credit to Night5h4d3 also. Add defeat messages to Vocab in script editor. Edit what they say if you want, but leave "%s" alone.
CODE
Defeat          = "%s was defeated!"
Defeat2         = "%s was utterly destroyed!"
Defeat3         = "%s was completely eliminated!"

[Show/Hide] GB RANDOM DEFEAT MESSAGE
CODE
class Scene_Battle < Scene_Base
  def process_defeat
    case rand(3)
    when 0;  text = sprintf(Vocab::Defeat, $game_party.name)
    when 1;  text = sprintf(Vocab::Defeat2, $game_party.name)
    when 2;  text = sprintf(Vocab::Defeat3, $game_party.name)
    end
   $game_message.texts.push(text)
    wait_for_message
    battle_end(2)
  end
  
end


10th: This one will let you have random Victory messages. You can add more by copying one of the "when" lines and changing the number. Be sure "case rand()" is set to a number equal to the number of Victory messages you are using. By default it's set to 3. Credit to Night5h4d3 also. Add Victory messages to Vocab in script editor. Edit what they say if you want, but leave "%s" alone.
CODE
Victory         = "%s was victorious!"
Victory2        = "%s won the battle!"
Victory3        = "%s dominated the enemies!"

[Show/Hide] GB RANDOM VICTORY MESSAGE
CODE
class Scene_Battle < Scene_Base
  def display_exp_and_gold
    exp = $game_troop.exp_total
    gold = $game_troop.gold_total
    $game_party.gain_gold(gold)
    case rand(3)
    when 0;  text = sprintf(Vocab::Victory, $game_party.name)
    when 1;  text = sprintf(Vocab::Victory2, $game_party.name)
    when 2;  text = sprintf(Vocab::Victory3, $game_party.name)
    end
    $game_message.texts.push('\|' + text)
    if exp > 0
      text = sprintf(Vocab::ObtainExp, exp)
      $game_message.texts.push('\.' + text)
    end
    if gold > 0
      text = sprintf(Vocab::ObtainGold, gold, Vocab::gold)
      $game_message.texts.push('\.' + text)
    end
    wait_for_message
  end

  end

NOTICE
The GB FLEX GOLD/EXP and GB RANDOM VICTORY MESSAGE scripts are not compatible while separate. To make these two work together use this combination instead.
[Show/Hide] GB FLEX GOLD/EXP/VICTORY MESSAGE
CODE
class Scene_Battle < Scene_Base
  def display_exp_and_gold
    exp = $game_troop.exp_total
    gold = $game_troop.gold_total
    $game_party.gain_gold(gold)
    case rand(3)
    when 0;  text = sprintf(Vocab::Victory, $game_party.name)
    when 1;  text = sprintf(Vocab::Victory2, $game_party.name)
    when 2;  text = sprintf(Vocab::Victory3, $game_party.name)
    end
    $game_message.texts.push('\|' + text)
    if exp == 1
      text = sprintf(Vocab::ObtainExp1, exp)
      $game_message.texts.push('\.' + text)
    elsif exp > 1
      text = sprintf(Vocab::ObtainExp, exp)
      $game_message.texts.push('\.' + text)
    end
    if gold == 1
      text = sprintf(Vocab::ObtainGold2, gold, Vocab::gold)
      $game_message.texts.push('\.' + text)
    elsif gold > 1
      text = sprintf(Vocab::ObtainGold1, gold, Vocab::gold)
      $game_message.texts.push('\.' + text)
    end
    wait_for_message
  end
  
end


If i think of anymore I'll post them.


__________________________
Characters:

"damned shitty highjacked internet"

Go to the top of the page
 
+Quote Post
   
some_person
post Mar 20 2010, 06:54 PM
Post #2


Level 2
Group Icon

Group: Member
Posts: 24
Type: Scripter
RM Skill: Skilled




aha. That there is how 96% of scripters started out, including myself.

My recommendation would be to make these edits, even the small ones, into scripts to be put in the materials sections. Editing the base scripts is frowned upon.


__________________________
meh..
Go to the top of the page
 
+Quote Post
   
Guyver's Bane
post Mar 20 2010, 09:10 PM
Post #3


The Guiding Light
Group Icon

Group: Revolutionary
Posts: 801
Type: Event Designer
RM Skill: Masterful




I don't know how to do that. I mostly just edit to my liking. If it's uncertainty you have about editing the default scripts, I promise you all that I wouldn't post something that would damage your scripts. These are all tested and are 100% safe. Besides in the help file it does say "it is also possible to customize nearly every element of the game," yes.gif . That's all these edits are for. Customization. Also added a few more to the list.


__________________________
Characters:

"damned shitty highjacked internet"

Go to the top of the page
 
+Quote Post
   
SuperMega
post Mar 20 2010, 09:27 PM
Post #4


Public memberTitle(String n)
Group Icon

Group: Revolutionary
Posts: 683
Type: Developer
RM Skill: Skilled




These are some really nice codes, Guyver's Bane. My favorite is the common event after battle, which is something I always love to include. Great work! biggrin.gif


__________________________
Translated Scripts:
Diagonal Movement (Eight Direction) and Smooth Jumping
Attack Party, Heal Enemies
Display Party Status On Map (DQ Style)
Display Maps Under Maps
Save Screen Customization
Subtitled Menus

If you want to suggest a translation for something, PM me, and I'll take a look. I AM TRYING TO GIVE AWAY LOCKERZ.com INVITES, SO PLEASE LET ME KNOW IF YOU WANT ONE.
Currently Working on 2 RPG Maker VX Projects. They are very unique, and have a different kind of style then the usual RPGs. So don't think of them as just another RPG. Did that sound rude? :D Not sure if I want them to go public yet, but we'll see how it goes.
Need a script translated? Come talk to me, and I'll see what I can do.
Go to the top of the page
 
+Quote Post
   
Guyver's Bane
post Mar 20 2010, 09:40 PM
Post #5


The Guiding Light
Group Icon

Group: Revolutionary
Posts: 801
Type: Event Designer
RM Skill: Masterful




Thanks mega! Any problems with it?
EDIT:
This topic doesn't seem it belongs in the support section or something does it? Also the common event edit goes after line 595. I made a mistake and typed it as 600. It's fixed now.


__________________________
Characters:

"damned shitty highjacked internet"

Go to the top of the page
 
+Quote Post
   
kyle?
post Mar 20 2010, 10:55 PM
Post #6


Level 8
Group Icon

Group: Revolutionary
Posts: 113
Type: Event Designer
RM Skill: Skilled




The Dragon Quest 8 Battle Damage Calculation
is really good the damage goe's really low but it's good in many occasions


__________________________

Go to the top of the page
 
+Quote Post
   
Guyver's Bane
post Mar 20 2010, 11:14 PM
Post #7


The Guiding Light
Group Icon

Group: Revolutionary
Posts: 801
Type: Event Designer
RM Skill: Masterful




Yeah i put that in because i thought "Who want's a level 1 character doing like 70 damage or such?"


__________________________
Characters:

"damned shitty highjacked internet"

Go to the top of the page
 
+Quote Post
   
kyle?
post Mar 20 2010, 11:58 PM
Post #8


Level 8
Group Icon

Group: Revolutionary
Posts: 113
Type: Event Designer
RM Skill: Skilled




Your right that is kinda weird


__________________________

Go to the top of the page
 
+Quote Post
   
Guyver's Bane
post Mar 21 2010, 01:41 AM
Post #9


The Guiding Light
Group Icon

Group: Revolutionary
Posts: 801
Type: Event Designer
RM Skill: Masterful




All of these edits are in use in my project. Thats why some of them were set up so particularly. A few of them should have been in the default scripts themselves once you see how they work.


__________________________
Characters:

"damned shitty highjacked internet"

Go to the top of the page
 
+Quote Post
   
some_person
post Mar 21 2010, 11:00 AM
Post #10


Level 2
Group Icon

Group: Member
Posts: 24
Type: Scripter
RM Skill: Skilled




Here, I'll explain 1.) why making them into their own scripts is a good idea, and 2.) how to do it.

1.) when you have a lot of edits, they might now be as easy to keep track of. What if the game quit working and you forgot all the things you changed in your last editing bout? What if you want to change something you've already changed again, it's actually more work to go back and find where you edited than to check the materials section for the snippet. Also, if you put a syntax error into a script, the whole thing'll quit working, while only the snippet will quit working if it's in its own section. And finally, if you want to become at least a minor scripter, you'll need to know how to make new scripts that edit the old ones instead of just changing lines.

2.) this is simple. It actually only adds 2 more lines of codes into your snippets, and it'll allow them to be put in the materials section.

Let's say, you edit a method(def). You've posted some edited methods here already.
Here's a simple way to do it; go to the top of the script with the original method and find the class, copy paste that line at the top of your script, and then a line with "end" at the bottom of your script.

display_exp_and_gold is from scene_battle, right.

if you made that edit to be like this:
CODE
class Scene_Battle < Scene_Base

def display_exp_and_gold
exp = $game_troop.exp_total
gold = $game_troop.gold_total
$game_party.gain_gold(gold)
text = sprintf(Vocab::Victory, $game_party.name)
$game_message.texts.push('\|' + text)
if exp == 1
text = sprintf(Vocab::ObtainExp1, exp)
$game_message.texts.push('\.' + text)
elsif exp > 1
text = sprintf(Vocab::ObtainExp, exp)
$game_message.texts.push('\.' + text)
end
if gold == 1
text = sprintf(Vocab::ObtainGold2, gold, Vocab::gold)
$game_message.texts.push('\.' + text)
elsif gold > 1
text = sprintf(Vocab::ObtainGold1, gold, Vocab::gold)
$game_message.texts.push('\.' + text)
end
wait_for_message
end

end


your edit has now become a snippet that can go into the materials section instead. Having it in the Materials section will be better organized than having the original codding edited.

-
just trying to help you here.


__________________________
meh..
Go to the top of the page
 
+Quote Post
   
Guyver's Bane
post Mar 21 2010, 11:07 PM
Post #11


The Guiding Light
Group Icon

Group: Revolutionary
Posts: 801
Type: Event Designer
RM Skill: Masterful




Thanks. I fixed them like you said and they worked perfect. Also, I hope I didn't sound like an asshole towards you. If I did I'm sorry. I wasn't trying to be.


__________________________
Characters:

"damned shitty highjacked internet"

Go to the top of the page
 
+Quote Post
   
some_person
post Mar 21 2010, 11:51 PM
Post #12


Level 2
Group Icon

Group: Member
Posts: 24
Type: Scripter
RM Skill: Skilled




no, you weren't sounding like an asshole.

glad I helped.


__________________________
meh..
Go to the top of the page
 
+Quote Post
   
Guyver's Bane
post Mar 22 2010, 12:18 PM
Post #13


The Guiding Light
Group Icon

Group: Revolutionary
Posts: 801
Type: Event Designer
RM Skill: Masterful




I'm glad to hear. One less worry off my mind.


__________________________
Characters:

"damned shitty highjacked internet"

Go to the top of the page
 
+Quote Post
   
MrGamer
post Mar 22 2010, 12:44 PM
Post #14



Group Icon

Group: Member
Posts: 2
Type: Mapper
RM Skill: Undisclosed




I really enjoy these little add ons smile.gif epecially the critical hit sound!
Go to the top of the page
 
+Quote Post
   
Guyver's Bane
post Mar 22 2010, 12:45 PM
Post #15


The Guiding Light
Group Icon

Group: Revolutionary
Posts: 801
Type: Event Designer
RM Skill: Masterful




I'm glad someone enjoyed that one! The critical sound itself is from pokemon. I think.


__________________________
Characters:

"damned shitty highjacked internet"

Go to the top of the page
 
+Quote Post
   
ZeroManArmy
post Mar 22 2010, 06:48 PM
Post #16


Level 5
Group Icon

Group: Member
Posts: 68
Type: Artist
RM Skill: Undisclosed




The critical sound effect isn't working for me. Can you upload it to media-fire or something?

This post has been edited by ZeroManArmy: Mar 22 2010, 06:49 PM


__________________________
Go to the top of the page
 
+Quote Post
   
Guyver's Bane
post Mar 22 2010, 11:38 PM
Post #17


The Guiding Light
Group Icon

Group: Revolutionary
Posts: 801
Type: Event Designer
RM Skill: Masterful




Done. If problem persists I'll just upload a demo with all the snippets and sound effect.


__________________________
Characters:

"damned shitty highjacked internet"

Go to the top of the page
 
+Quote Post
   
Guyver's Bane
post Apr 28 2010, 10:31 PM
Post #18


The Guiding Light
Group Icon

Group: Revolutionary
Posts: 801
Type: Event Designer
RM Skill: Masterful




Updated! Two new snippets available!


__________________________
Characters:

"damned shitty highjacked internet"

Go to the top of the page
 
+Quote Post
   
Guyver's Bane
post Apr 29 2010, 11:13 AM
Post #19


The Guiding Light
Group Icon

Group: Revolutionary
Posts: 801
Type: Event Designer
RM Skill: Masterful




Update again! Two more new snippets added.


__________________________
Characters:

"damned shitty highjacked internet"

Go to the top of the page
 
+Quote Post
   
Xeyla
post Apr 29 2010, 02:00 PM
Post #20


Keeper of the RMVX FAQ
Group Icon

Group: Revolutionary
Posts: 706
Type: Mapper
RM Skill: Intermediate




I like the fact that we can have different titles and game over screens. thank you very much for sharing them. i hope to use them for my game.


__________________________


QUOTE (Albino Parakeet @ Apr 1 2011, 05:46 PM) *
i need to know exactly how to put a penis inside someone's butt.
do you have the technical knowledge to tell me how?
QUOTE (Albino Parakeet @ Apr 2 2011, 01:20 PM) *
QUOTE (Shadyone @ Apr 2 2011, 06:29 AM) *
I see the keet likes anal.

im trying to get into it but people aren't answering my question
Go to the top of the page
 
+Quote Post
   

2 Pages V   1 2 >
Reply to this topicStart new topic
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:

 

Lo-Fi Version Time is now: 20th May 2013 - 09:11 PM
RPG RPG Revolution is an Privacy Policy and Legal
eXTReMe Tracker