RMRK is retiring.
Registration is disabled. The site will remain online, but eventually become a read-only archive. More information.

RMRK.net has nothing to do with Blockchains, Cryptocurrency or NFTs. We have been around since the early 2000s, but there is a new group using the RMRK name that deals with those things. We have nothing to do with them.
NFTs are a scam, and if somebody is trying to persuade you to buy or invest in crypto/blockchain/NFT content, please turn them down and save your money. See this video for more information.
[Resolved]Italicize

0 Members and 1 Guest are viewing this topic.

****
Rep:
Level 69
How do I italicize letters in a script? cuz I want my criticals to look shnazzy!  :blizj:
« Last Edit: June 24, 2011, 05:37:02 AM by Scalinger2 »

*
Rep:
Level 97
2014 Most Unsung Member2014 Best RPG Maker User - Engine2013 Best RPG Maker User (Scripting)2012 Most Mature Member2012 Favorite Staff Member2012 Best RPG Maker User (Scripting)2012 Best MemberSecret Santa 2012 ParticipantProject of the Month winner for July 20092011 Best Use of Avatar and Signature Space2011 Best RPG Maker User (Scripting)2011 Most Mature Member2011 Favourite Staff Member2011 Best Veteran2010 Most Mature Member2010 Favourite Staff Member
font.italic = true

where font is the font object of whichever bitmap you are drawing it on. So, in a window, it would be:

Code: [Select]
self.contents.font.italic = true

In a sprite, it would be:
Code: [Select]
self.bitmap.font.italic = true

****
Rep:
Level 69
Sorry to ask, in the damage pop up script which would I put in and where? xD
cuz I tried pasting it in and I kept getting errors :P
Code: [Select]
#==============================================================================
# Damage Popup
# Version: 1.0b
# Author: modern algebra (rmrk.net)
# Date: September 8, 2009
#++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
# Description:
#
# This script allows damage to popup on top of the battler, rather than
# being shown in the message box.
#++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
# Instructions:
#
# Place this script above Main and below other custom scripts. Please see
# the editable region beginning at line 35 for configuration options.
#
# To change the text shown when a critical hit is landed, or the target is
# missed or the target evades, you will need to go up to the Vocab module
# (the very first script in the editor) and change the values of the
# following constants:
#
# CriticalToActor
# CriticalToEnemy
# ActorNoHit
# ActorEvasion
# EnemyNoHit
# EnemyEvasion
#==============================================================================

#================================================================================
# *** Module ModernAlgebra
#================================================================================

module ModernAlgebra
#\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\
# EDITABLE REGION
#````````````````````````````````````````````````````````````````````````````
# Please read the comments above each constant to learn what it controls.
#||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
# DP_VANISH_SPEED controls the number of frames a damage pop sprite remains
# visible. There are 60 frames in a second.
DP_VANISH_SPEED = 80
# DP_PLUS_X and DP_PLUS_Y control the position of the damage pop sprites,
# with reference to the centre bottom of the damaged battler. Keep in mind
# that the damage pop is centred on a 200 pixel bitmap, so a DP_PLUS_X of
# -100 would have the text centred on the battler.
DP_PLUS_X = -100
DP_PLUS_Y = -50
# DP_FONT is the font used for displaying the damage popup. When it is an
# array, that is the priority in which fonts are checked. So, for instance:
# ["Verdana", "Arial", "Courier New"] would mean that the font would be
# Verdana by default. If the player doesn't have Verdana installed, it would
# be Arial, and if the player doesn't have Arial installed, it would be
# Courier New.
DP_FONT = ["Verdana", "Arial", "Courier New"]
# DP_SIZE is the size of the damage popup text.
DP_SIZE = 32
# The _COLOR constants below control the colour of the damage popup in their
# respective situations and are arrays holding the [red, green, blue] values
# of the colour.
# HPDAMAGE is the colour for when the target's HP is decreased
DP_HPDAMAGE_COLOR = [255, 255, 255]
# MPDAMAGE is the colour for when the target's MP is decreased
DP_MPDAMAGE_COLOR = [180, 20, 255]
# HPHEAL is the colour for when the target's HP is increased
DP_HPHEAL_COLOR = [0, 255, 0]
# MPHEAL is the colour for when the target's MP is increased
DP_MPHEAL_COLOR = [0, 0, 255]
# CRIT is the colour for when the target receives a critical hit
DP_CRIT_COLOR = [255, 255, 0]
# MISS is the colour for when the target evades or is otherwise missed
DP_MISS_COLOR = [255, 255, 255]
# If you still want damage to show up in the message box as well, change
# this value to true. false means the damage won't show up in the message
# box and only show up as a popup.
DP_SHOW_DAMAGE_IN_MESSAGE = false
#||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
# END EDITABLE REGION
#////////////////////////////////////////////////////////////////////////////
end

#==============================================================================
# ** Game Battler
#++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
# Summary of Changes:
# new instance variables - dp_hp_damage_pop, dp_mp_damage_pop, dp_crit_pop,
# dp_miss_pop
# aliased method - execute_damage
#==============================================================================

class Game_Battler
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# * Public Instance Variables
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
attr_accessor :dp_hp_damage_pop
attr_accessor :dp_mp_damage_pop
attr_accessor :dp_crit_pop
attr_accessor :dp_miss_pop
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# * Damage Reflection
# user : User of skill or item
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
alias mdrnal_joy_exctdmge_dmgpop_1sd3 execute_damage
def execute_damage (user, *args)
@dp_crit_pop = actor? ? Vocab::CriticalToActor : Vocab::CriticalToEnemy if @critical
@dp_hp_damage_pop = @hp_damage if @hp_damage != 0
@dp_mp_damage_pop = @mp_damage if @mp_damage != 0
if @absorbed
user.dp_hp_damage_pop = (-1*@hp_damage) if @hp_damage != 0
user.dp_mp_damage_pop = (-1*@mp_damage) if @mp_damage != 0
end
mdrnal_joy_exctdmge_dmgpop_1sd3 (user, *args)
end
end

#==============================================================================
# ** Sprite Battler
#++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
# Summary of Changes:
# aliased method - initialize, update
# new methods - dp_start_damage_pop, dp_update_damage_pop
#==============================================================================

class Sprite_Battler
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# * Object Initialization
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
alias modalg_joy_init_dmgpop_7df5 initialize
def initialize (*args)
@damage_pop_sprites = []
@damage_pop_frames = []
modalg_joy_init_dmgpop_7df5 (*args) # Run Original Method
end
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# * Frame Update
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
alias mdrnalg_jy_lufiaii_dmgpop_upd_1bd3 update
def update (*args)
mdrnalg_jy_lufiaii_dmgpop_upd_1bd3 (*args) # Run Original Method
dp_update_damage_pop unless @battler.nil?
end
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# * Start Damage Pop
# type : Whether HP, MP Damage
# damage : The amount to display
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
def dp_start_damage_pop (damage, type = 0)
# Create Damage Sprite
sprite = Sprite_Base.new
sprite.bitmap = Bitmap.new (200, ModernAlgebra::DP_SIZE)
# Get color of damage
sprite.bitmap.font = Font.new (ModernAlgebra::DP_FONT, ModernAlgebra::DP_SIZE)
sprite.bitmap.font.size -= 4 if type > 1
sprite.bitmap.font.color = case type
when 0 then damage > 0 ? Color.new (*ModernAlgebra::DP_HPDAMAGE_COLOR) : Color.new (*ModernAlgebra::DP_HPHEAL_COLOR)
when 1 then damage > 0 ? Color.new (*ModernAlgebra::DP_MPDAMAGE_COLOR) : Color.new (*ModernAlgebra::DP_MPHEAL_COLOR)
when 2 then Color.new (*ModernAlgebra::DP_MISS_COLOR)
when 3 then Color.new (*ModernAlgebra::DP_CRIT_COLOR)
end
damage_string = damage.is_a? (String) ? damage : damage.abs.to_s
sprite.bitmap.draw_text (0, 0, 200, ModernAlgebra::DP_SIZE, damage_string, 1)
sprite.x = self.x + ModernAlgebra::DP_PLUS_X
sprite.y = @damage_pop_sprites.empty? ? self.y + ModernAlgebra::DP_PLUS_Y : @damage_pop_sprites[-1].y + 24
sprite.z = self.z + 20
@damage_pop_sprites.push (sprite)
@damage_pop_frames.push (0)
end
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# * Update Damage Pop
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
def dp_update_damage_pop
# Start New Damage Pops
dp_start_damage_pop (@battler.dp_miss_pop, 2) if @battler.dp_miss_pop != nil
dp_start_damage_pop (@battler.dp_crit_pop, 3) if @battler.dp_crit_pop != nil
dp_start_damage_pop (@battler.dp_hp_damage_pop) if @battler.dp_hp_damage_pop != nil
dp_start_damage_pop (@battler.dp_mp_damage_pop, 1) if @battler.dp_mp_damage_pop != nil
@battler.dp_hp_damage_pop = nil
@battler.dp_mp_damage_pop = nil
@battler.dp_miss_pop = nil
@battler.dp_crit_pop = nil
# Store sprites to dispose
dispose_indices = []
opac_minus = 255 / ModernAlgebra::DP_VANISH_SPEED
@damage_pop_sprites.each_index { |i|
if @damage_pop_frames[i] == ModernAlgebra::DP_VANISH_SPEED
dispose_indices.push (i)
next
end
sprite = @damage_pop_sprites[i]
sprite.update
sprite.y -= 1 if @damage_pop_frames[i] % 2 == 0
sprite.opacity -= opac_minus
@damage_pop_frames[i] += 1
}
# Dispose finished damage sprites
dispose_indices.reverse.each { |i|
@damage_pop_sprites[i].dispose
@damage_pop_sprites.delete_at (i)
@damage_pop_frames.delete_at (i)
}
end
end

#==============================================================================
# ** Window Battle Message
#++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
# Summary of Changes:
# aliased method - initialize, add_instant_text
#==============================================================================

class Window_BattleMessage
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# * Public Instance Variables
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
attr_accessor :dp_ignore_instant_text
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# * Object Initialization
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
alias algbra_popdamge_joy_initz_2fb5 initialize
def initialize (*args)
@dp_ignore_instant_text = false
# Run Original Method
algbra_popdamge_joy_initz_2fb5 (*args)
end
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# * Add Text
# text : Text to be added
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
alias mdrnalg_damagepopper_oyj_adintxt_4jk2 add_instant_text
def add_instant_text (*args)
return if @dp_ignore_instant_text
# Run Original Method
mdrnalg_damagepopper_oyj_adintxt_4jk2 (*args)
end
end

#==============================================================================
# ** Scene Battle
#++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
# Summary of Changes:
# aliased methods - display_action_effects, display_state_changes
#==============================================================================

class Scene_Battle
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# * Display Action Effects
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
alias mdnalbra_jy_dispactefct_dmgpop_9jv2 display_action_effects
def display_action_effects (target, *args)
if target.missed
target.dp_miss_pop = target.actor? ? sprintf(Vocab::ActorNoHit, target.name) : sprintf(Vocab::EnemyNoHit, target.name)
elsif target.evaded
target.dp_miss_pop = target.actor? ? sprintf(Vocab::ActorEvasion, target.name) : sprintf(Vocab::EnemyEvasion, target.name)
end
@message_window.dp_ignore_instant_text = true unless ModernAlgebra::DP_SHOW_DAMAGE_IN_MESSAGE || target.actor?
mdnalbra_jy_dispactefct_dmgpop_9jv2 (target, *args) # Run Original Method
@message_window.dp_ignore_instant_text = false
end
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# * Display State Changes
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
alias mdrnag_joy_dspsttchng_dmpp_8jh3 display_state_changes
def display_state_changes (*args)
# Save value of ignore text
old_ignore_val = @message_window.dp_ignore_instant_text
@message_window.dp_ignore_instant_text = false
mdrnag_joy_dspsttchng_dmpp_8jh3 (*args) # RUn Original Method
@message_window.dp_ignore_instant_text = old_ignore_val
end
end

*
Rep:
Level 97
2014 Most Unsung Member2014 Best RPG Maker User - Engine2013 Best RPG Maker User (Scripting)2012 Most Mature Member2012 Favorite Staff Member2012 Best RPG Maker User (Scripting)2012 Best MemberSecret Santa 2012 ParticipantProject of the Month winner for July 20092011 Best Use of Avatar and Signature Space2011 Best RPG Maker User (Scripting)2011 Most Mature Member2011 Favourite Staff Member2011 Best Veteran2010 Most Mature Member2010 Favourite Staff Member
You'd put it here:

Code: [Select]
when 2 then Color.new (*ModernAlgebra::DP_MISS_COLOR)
when 3 then Color.new (*ModernAlgebra::DP_CRIT_COLOR)
end
sprite.bitmap.font.italic = true
damage_string = damage.is_a? (String) ? damage : damage.abs.to_s

****
Rep:
Level 69
What font would I insert to make it cursive like this for the crits? I don't mean that exact font but any cursive one will do xD

*
Rep:
Level 97
2014 Most Unsung Member2014 Best RPG Maker User - Engine2013 Best RPG Maker User (Scripting)2012 Most Mature Member2012 Favorite Staff Member2012 Best RPG Maker User (Scripting)2012 Best MemberSecret Santa 2012 ParticipantProject of the Month winner for July 20092011 Best Use of Avatar and Signature Space2011 Best RPG Maker User (Scripting)2011 Most Mature Member2011 Favourite Staff Member2011 Best Veteran2010 Most Mature Member2010 Favourite Staff Member
Well, open up Microsoft Word or any similar text editor and test out the fonts you have. If none of the default fonts are ideal then you can also try dafont.com though you will have to abide by whatever terms the creators set for them, which may include a licence fee (though many on the site are also free).

****
Rep:
Level 69
thx, I found a font but how do I make only the criticals in that font? Would it have to be a seperate damage sprite?

*
Rep:
Level 97
2014 Most Unsung Member2014 Best RPG Maker User - Engine2013 Best RPG Maker User (Scripting)2012 Most Mature Member2012 Favorite Staff Member2012 Best RPG Maker User (Scripting)2012 Best MemberSecret Santa 2012 ParticipantProject of the Month winner for July 20092011 Best Use of Avatar and Signature Space2011 Best RPG Maker User (Scripting)2011 Most Mature Member2011 Favourite Staff Member2011 Best Veteran2010 Most Mature Member2010 Favourite Staff Member
Insert this line:

Code: [Select]
sprite.bitmap.font.name = "Name of Font"

here:

Code: [Select]
# Get color of damage
sprite.bitmap.font = Font.new (ModernAlgebra::DP_FONT, ModernAlgebra::DP_SIZE)
sprite.bitmap.font.name = "Name of Font"
sprite.bitmap.font.size -= 4 if type > 1

****
Rep:
Level 69
thank you so much  :D

*
Rep:
Level 97
2014 Most Unsung Member2014 Best RPG Maker User - Engine2013 Best RPG Maker User (Scripting)2012 Most Mature Member2012 Favorite Staff Member2012 Best RPG Maker User (Scripting)2012 Best MemberSecret Santa 2012 ParticipantProject of the Month winner for July 20092011 Best Use of Avatar and Signature Space2011 Best RPG Maker User (Scripting)2011 Most Mature Member2011 Favourite Staff Member2011 Best Veteran2010 Most Mature Member2010 Favourite Staff Member
Sorry, I forgot to add the main part of that request :P

The line should be:

Code: [Select]
sprite.bitmap.font.name = "Name of Font" if type == 3

****
Rep:
Level 69
I modified it to
sprite.bitmap.font.name = "Name of Font" if type > 2
before you responded but I'll change it to that so nothing bad happens xD

****
Rep:
Level 69
OH! btw can I change the sound of the crit and make it diff from a regular hit? ;8

*
Rep:
Level 97
2014 Most Unsung Member2014 Best RPG Maker User - Engine2013 Best RPG Maker User (Scripting)2012 Most Mature Member2012 Favorite Staff Member2012 Best RPG Maker User (Scripting)2012 Best MemberSecret Santa 2012 ParticipantProject of the Month winner for July 20092011 Best Use of Avatar and Signature Space2011 Best RPG Maker User (Scripting)2011 Most Mature Member2011 Favourite Staff Member2011 Best Veteran2010 Most Mature Member2010 Favourite Staff Member
You could, but that's not something that would be controlled by this script or anymore convenient to integrate with this script than simply writing a new script. Make a request in the RMVX Scripts Request board and maybe someone will do it for you.