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
> Elemental Level, Adapted from Moghunter's XP script
332211
post Sep 22 2008, 07:26 AM
Post #1


Waiting for an epiphany
Group Icon

Group: Revolutionary
Posts: 180
Type: Scripter
RM Skill: Advanced




Elemental Level

Version VX 1.1
Original Author Moghunter
VX version Author 332211 (aka uresk)
Release Date 22 of September 2008
Last Update 23 of September 2008


Introduction
Skill damage is changed with the elemental level.
A skill base damage is changed according to the formula: base damage *( 1 + (elemental level - 1)/ 5)
Version 1.1 it handles correctly the damage multiplication when using more than one element. (Does the average)
Version 1.2 add the possibility to make the user receive less damage from a certain element, based on his elemental level.
Version 1.3 allows for skill to be learnt and forgotten based on the elemental level.
Features
So far it only changes the skill's base power.
Can reduce damage based on the elemental level too.
Can handle any number of elements, although I advise to use only up to 10, otherwise the bars will start to overlap.

Script
[Show/Hide] Version 1.3
CODE
#_________________________________________________
# MOG_Element LV System VX 1.3
#_________________________________________________
# By Moghunter
# http://www.atelier-rgss.com
#_________________________________________________
# Adapted to VX by uresk/332211
#_________________________________________________
#
# START CONFIGURATION
#_________________________________________________
Vocab::ForgetSkill = "%s was forgotten!"
module MOG
#Element max level
MAXELLV = 99
# Exp gain mode
# 0 = Experience = Actor level - element level
# 1 = Always wins EL_EXP
# 2 => (level * level)/ 5 - level * 5 + 25 (line 183)
EXP_TYPE = 1
# Exp gain when EXP_TYPE = 1
EL_EXP = 333
# Element names. Must be in the database
Element_Names = ["Fire","Ice","Thunder","Water","Earth","Wind","Light","Darkness"]
# Level up sound
ELE_LVSE = "Magic"
# Level up animation
EL_LVANIME = 63
# Reduce damage based on the elemental level?
EL_RESIST = true
# Resist formula: damage * multiplier
# multiplier = 1/4 + (level+1)/(4*level)
# Change it in the line 200, Damage formula at line 175

# List of skills that should be learnt
LEARN_EL_SKILLS = { "Fire" => { 3 => [60,61]}, #Element name => { element_level => skill id(s)...
"Ice" => { 2 => 40}
}

# List of skills that should be forgotten
FORGET_EL_SKILLS = {"Fire" => { 3 => 59 , 4 => 51}
} #Element name => { element_level => skill id(s)}...
end
#_________________________________________________
#
# END CONFIGURATION
#_________________________________________________
$mogscript = {} if $mogscript == nil
$mogscript["elementlv"] = true
##############
# Game_Actor #
##############
class Game_Actor < Game_Battler
attr_accessor :element_exp
attr_accessor :element_level
alias mog30_setup setup
def setup(actor_id)
@element_exp = []
@element_level = []
for i in 0...MOG::Element_Names.size
@element_exp[i] = 0
@element_level[i] = 1
end
mog30_setup(actor_id)
end
end
###############
# Window_Base #
###############
class Window_Base < Window
def draw_elementlv(actor, x, y,type)
exp = actor.element_exp[type]
self.contents.font.color = normal_color
back = Cache.picture("ELV_Back")
cw = back.width
ch = back.height
src_rect = Rect.new(0, 0, cw, ch)
self.contents.blt(x + 77, y - ch , back, src_rect)
meter = Cache.picture("ELV_Meter")
ch = meter.height
cw = meter.width * exp
cw /= 100
src_rect = Rect.new(0, 0, cw, ch)
self.contents.blt(x + 80, y - ch - 8, meter, src_rect)
self.contents.font.name = "Georgia"
self.contents.font.color = Color.new(0,0,0,255)
pexp = sprintf("%s %", exp)
self.contents.draw_text(x + 161, y - 34, 50, 32, pexp ,1)
self.contents.draw_text(x + 331, y - 34, 32, 32, actor.element_level[type])
self.contents.draw_text(x + 301, y - 34, 32, 32, "Lv")
self.contents.draw_text(x + 1, y - 34, 75, 32, MOG::Element_Names[type])
self.contents.font.color = Color.new(255,255,255,255)
self.contents.draw_text(x + 160, y - 35, 50, 32, pexp,1)
self.contents.draw_text(x + 330, y - 35, 32, 32, actor.element_level[type])
self.contents.draw_text(x + 300, y - 35, 32, 32, "Lv")
self.contents.draw_text(x , y - 35, 75, 32, MOG::Element_Names[type])
end
end
########################
# Window_Element_Level #
########################
class Window_Element_Level < Window_Base
def initialize(actor)
super(100, 0, 444, 416)
self.contents = Bitmap.new(width - 32, height - 32)
self.z = 9999
@actor = actor
refresh
end
def refresh
self.contents.clear
self.contents.font.name = "Georgia"
self.contents.font.color = Color.new(0,0,0,255)
self.contents.draw_text(x + 50, y - 5 , 200, 50, "ELEMENT DATA")
self.contents.draw_text(x + 50, y + 411 , 200, 50, "Press C to Status")
self.contents.font.color = Color.new(255,255,255,255)
self.contents.draw_text(x + 51, y - 4 , 200, 50, "ELEMENT DATA")
self.contents.draw_text(x + 51, y + 410 , 200, 50, "Press C to Status")
for i in 0...MOG::Element_Names.size
draw_elementlv(@actor, 40, 70 + (346/MOG::Element_Names.size) * i, i)
end
end
end
#################
# Window_Status #
#################
class Window_Status < Window_Base
alias mog30_refresh refresh
def refresh
mog30_refresh
self.contents.font.name = "Georgia"
self.contents.font.color = Color.new(0,0,0,255)
self.contents.draw_text(x + 200, y + 416 , 250, 50, "Press C to Elemental Data")
self.contents.font.color = Color.new(255,255,255,255)
self.contents.draw_text(x + 201, y + 415 , 250, 50, "Press C to Elemental Data")
end
end
################
# Scene_Status #
################
class Scene_Status
alias mog30_main main
def main
@actor = $game_party.members[@actor_index]
@element_window = Window_Element_Level.new(@actor)
@element_window.y = -550
@element_window.visible = false
mog30_main
@element_window.dispose
end
alias mog30_update update
def update
mog30_update
if @element_window.y < 0
@element_window.y += 20
elsif @element_window.y >= 0
@element_window.y = 0
@element_window.contents_opacity = 255
end
if @element_window.visible == true
if Input.trigger?(Input::B) or Input.trigger?(Input::L) or Input.trigger?(Input::R)
for i in 1..30
@element_window.y -= 25
Graphics.update
end
end
end
if Input.trigger?(Input::C) and @element_window.visible == true
Sound.play_decision
@element_window.visible = false
elsif Input.trigger?(Input::C) and @element_window.visible == false
Sound.play_decision
@element_window.visible = true
@element_window.y = -550
end
end
end
################
# Game_Battler #
################
class Game_Battler
include MOG
alias mog30_make_obj_damage_value make_obj_damage_value
def make_obj_damage_value(user, obj)
multiplier = 0; divisor = 0
for id in obj.element_set
if Element_Names.include?($data_system.elements[id]) and user.is_a?(Game_Actor)
index = Element_Names.index($data_system.elements[id])
level = user.element_level[index]
multiplier += (4 + level)/5
divisor += 1
if EXP_TYPE == 0
valor = user.level - level
user.element_exp[index] += 1 + valor
elsif EXP_TYPE == 1
user.element_exp[index] += EL_EXP
elsif EXP_TYPE == 2
user.element_exp[index] += (level ** 2)/ 5 - level * 5 + 25
end
user.element_exp[index] = 100 if level == MAXELLV
elsif Element_Names.include?($data_system.elements[id]) and self.is_a?(Game_Actor) and EL_RESIST == true
index = Element_Names.index($data_system.elements[id])
level = self.element_level[index]
multiplier += 1/4 + ((level+2)/(4*level))
divisor += 1
end
end
obj.base_damage *= multiplier unless multiplier == 0
obj.base_damage /= divisor unless divisor == 0
obj.base_damage = obj.base_damage.round
mog30_make_obj_damage_value(user, obj)
end
end
#==============================================================================
# ** Scene_Battle
#------------------------------------------------------------------------------
# This class performs battle screen processing.
#==============================================================================
class Scene_Battle < Scene_Base
# Include MOG module
include MOG
# aliasing definition
alias el_skills_display_action_effects display_action_effects
#--------------------------------------------------------------------------
# * Show Action Results
# target : Target
# obj : Skill or item
#--------------------------------------------------------------------------
def display_action_effects(target, obj = nil)
el_skills_display_action_effects(target, obj = nil)
user = @active_battler
if user.is_a?(Game_Actor)
for index in 0...MOG::Element_Names.size
while user.element_exp[index] > 99 and user.element_level[index] < MOG::MAXELLV
user.element_exp[index] -= 100
user.element_exp[index] = 0 if user.element_exp[index] < 0
user.element_level[index] += 1
check_for_elemental_skills(user,index,user.element_level[index])
Audio.se_play("Audio/SE/" + ELE_LVSE)
user.animation_id = EL_LVANIME
$game_player.animation_id = EL_LVANIME
end
end
end
end
#--------------------------------------------------------------------------
# * Show Action Results
# user : Actor (active battler)
# index: Element type index
# level: Elemental level
#--------------------------------------------------------------------------
def check_for_elemental_skills(user,index,level)
element = Element_Names[index]
@message_window.clear
#Learn skills
skill_learn = LEARN_EL_SKILLS[element][level] unless LEARN_EL_SKILLS[element].nil?
if skill_learn.is_a?(Array)
for skill_id in skill_learn
user.learn_skill(skill_id)
text = sprintf(Vocab::ObtainSkill, $data_skills[skill_id].name)
@message_window.add_instant_text(text)
wait(40)
end
elsif !skill_learn.nil?
user.learn_skill(skill_learn)
text = sprintf(Vocab::ObtainSkill, $data_skills[skill_learn].name)
@message_window.add_instant_text(text)
wait(40)
end
#Forget skills
skill_forget = FORGET_EL_SKILLS[element][level] unless FORGET_EL_SKILLS[element].nil?
if skill_forget.is_a?(Array)
for skill_id in skill_forget
next if !user.skill_learn?($data_skills[skill_id])
user.forget_skill(skill_id)
text = sprintf(Vocab::ForgetSkill, $data_skills[skill_id].name)
@message_window.add_instant_text(text)
wait(40)
end
elsif !skill_forget.nil?
user.forget_skill(skill_forget)
text = sprintf(Vocab::ForgetSkill, $data_skills[skill_forget].name)
@message_window.add_instant_text(text)
wait(40)
end
end
end

[Show/Hide] Version 1.1
CODE
#_________________________________________________
# MOG_Element LV System VX 1.1
#_________________________________________________
# By Moghunter
# http://www.atelier-rgss.com
#_________________________________________________
# Adapted to VX by uresk/332211
#_________________________________________________
module MOG
#Element max level
MAXELLV = 10
# Exp gain mode
# 0 = Experience = Actor level - element level
# 1 = Always wins EL_EXP
# 2 => (level * level)/ 5 - level * 5 + 25 (line 183)
EXP_TYPE = 1
# Exp gain when EXP_TYPE = 1
EL_EXP = 10
# Element names. Must be in the database
Element_Names = ["Fire","Ice","Thunder","Water","Earth","Wind","Light","Darkness"]
# Level up sound
ELE_LVSE = "Magic"
# Level up animation
EL_LVANIME = 63
# Reduce damage based on the elemental level?
EL_RESIST = true
# Resist formula: damage * multiplier
# multiplier = 1/4 + (level+1)/(4*level)
# Change it in the line 200, Damage formula at line 175

end
$mogscript = {} if $mogscript == nil
$mogscript["elementlv"] = true
##############
# Game_Actor #
##############
class Game_Actor < Game_Battler
attr_accessor :element_exp
attr_accessor :element_level
alias mog30_setup setup
def setup(actor_id)
@element_exp = []
@element_level = []
for i in 0...MOG::Element_Names.size
@element_exp[i] = 0
@element_level[i] = 1
end
mog30_setup(actor_id)
end
end
###############
# Window_Base #
###############
class Window_Base < Window
def draw_elementlv(actor, x, y,type)
exp = actor.element_exp[type]
self.contents.font.color = normal_color
back = Cache.picture("ELV_Back")
cw = back.width
ch = back.height
src_rect = Rect.new(0, 0, cw, ch)
self.contents.blt(x + 77, y - ch , back, src_rect)
meter = Cache.picture("ELV_Meter")
ch = meter.height
cw = meter.width * exp
cw /= 100
src_rect = Rect.new(0, 0, cw, ch)
self.contents.blt(x + 80, y - ch - 8, meter, src_rect)
self.contents.font.name = "Georgia"
self.contents.font.color = Color.new(0,0,0,255)
pexp = sprintf("%s %", exp)
self.contents.draw_text(x + 161, y - 34, 50, 32, pexp ,1)
self.contents.draw_text(x + 331, y - 34, 32, 32, actor.element_level[type])
self.contents.draw_text(x + 301, y - 34, 32, 32, "Lv")
self.contents.draw_text(x + 1, y - 34, 75, 32, MOG::Element_Names[type])
self.contents.font.color = Color.new(255,255,255,255)
self.contents.draw_text(x + 160, y - 35, 50, 32, pexp,1)
self.contents.draw_text(x + 330, y - 35, 32, 32, actor.element_level[type])
self.contents.draw_text(x + 300, y - 35, 32, 32, "Lv")
self.contents.draw_text(x , y - 35, 75, 32, MOG::Element_Names[type])
end
end
########################
# Window_Element_Level #
########################
class Window_Element_Level < Window_Base
def initialize(actor)
super(100, 0, 444, 416)
self.contents = Bitmap.new(width - 32, height - 32)
self.z = 9999
@actor = actor
refresh
end
def refresh
self.contents.clear
self.contents.font.name = "Georgia"
self.contents.font.color = Color.new(0,0,0,255)
self.contents.draw_text(x + 50, y - 5 , 200, 50, "ELEMENT DATA")
self.contents.draw_text(x + 50, y + 411 , 200, 50, "Press C to Status")
self.contents.font.color = Color.new(255,255,255,255)
self.contents.draw_text(x + 51, y - 4 , 200, 50, "ELEMENT DATA")
self.contents.draw_text(x + 51, y + 410 , 200, 50, "Press C to Status")
for i in 0...MOG::Element_Names.size
draw_elementlv(@actor, 40, 70 + (346/MOG::Element_Names.size) * i, i)
end
end
end
#################
# Window_Status #
#################
class Window_Status < Window_Base
alias mog30_refresh refresh
def refresh
mog30_refresh
self.contents.font.name = "Georgia"
self.contents.font.color = Color.new(0,0,0,255)
self.contents.draw_text(x + 200, y + 416 , 250, 50, "Press C to Elemental Data")
self.contents.font.color = Color.new(255,255,255,255)
self.contents.draw_text(x + 201, y + 415 , 250, 50, "Press C to Elemental Data")
end
end
################
# Scene_Status #
################
class Scene_Status
alias mog30_main main
def main
@actor = $game_party.members[@actor_index]
@element_window = Window_Element_Level.new(@actor)
@element_window.y = -550
@element_window.visible = false
mog30_main
@element_window.dispose
end
alias mog30_update update
def update
mog30_update
if @element_window.y < 0
@element_window.y += 20
elsif @element_window.y >= 0
@element_window.y = 0
@element_window.contents_opacity = 255
end
if @element_window.visible == true
if Input.trigger?(Input::B) or Input.trigger?(Input::L) or Input.trigger?(Input::R)
for i in 1..30
@element_window.y -= 25
Graphics.update
end
end
end
if Input.trigger?(Input::C) and @element_window.visible == true
Sound.play_decision
@element_window.visible = false
elsif Input.trigger?(Input::C) and @element_window.visible == false
Sound.play_decision
@element_window.visible = true
@element_window.y = -550
end
end
end
################
# Game_Battler #
################
class Game_Battler
include MOG
alias mog30_make_obj_damage_value make_obj_damage_value
def make_obj_damage_value(user, obj)
multiplier = 0; divisor = 0
for id in obj.element_set
if Element_Names.include?($data_system.elements[id]) and user.is_a?(Game_Actor)
index = Element_Names.index($data_system.elements[id])
level = user.element_level[index]
multiplier += (4 + level)/5
divisor += 1
if EXP_TYPE == 0
valor = user.level - level
user.element_exp[index] += 1 + valor
elsif EXP_TYPE == 1
user.element_exp[index] += EL_EXP
elsif EXP_TYPE == 2
user.element_exp[index] += (level ** 2)/ 5 - level * 5 + 25
end
while user.element_exp[index] > 99 and level < MAXELLV
user.element_exp[index] -= 100
user.element_exp[index] = 0 if user.element_exp[index] < 0
user.element_level[index] += 1
Audio.se_play("Audio/SE/" + ELE_LVSE)
user.animation_id = EL_LVANIME
$game_player.animation_id = EL_LVANIME
end
user.element_exp[index] = 100 if level == MAXELLV
end
end
for id in obj.element_set
if Element_Names.include?($data_system.elements[id]) and self.is_a?(Game_Actor) and EL_RESIST
index = Element_Names.index($data_system.elements[id])
level = self.element_level[index]
multiplier += 1/4 + (level+1)/(4*level)
divisor += 1
end
end
obj.base_damage *= multiplier unless multiplier == 0
obj.base_damage /= divisor unless divisor == 0
obj.base_damage = obj.base_damage.round
mog30_make_obj_damage_value(user, obj)
end
end


Customization
CODE
module MOG
#Element max level (obvious)
MAXELLV = 10
# Exp gain mode: the way your characters win exp each time they use a skill.
# 0 --> Experience = Actor level - element level
# 1 --> Always wins EL_EXP
# 2 -->  (level * level)/ 5 - level * 5 + 25  (line 183) # based on the elemental level
EXP_TYPE = 1 # can be 1, 2 or 3
# Exp gain when EXP_TYPE = 1
EL_EXP = 10 #only for mode 1!!!
# Element names. Must be in the database
Element_Names = ["Fire","Ice","Thunder","Water","Earth","Wind","Light","Darkness"]
# Level up sound
ELE_LVSE = "Magic"
# Level up animation
EL_LVANIME = 63
# Reduce damage based on the elemental level?
EL_RESIST = true
# Resist formula: damage * multiplier
# multiplier = 1/4 + (level+1)/(4*level)
# Change it in the line 200, Damage formula at line 175
end

Compatibility
Not tested.

Installation
Paste above main.
Place ELV_back and ELV-meter in the pictures folder
Attached File  ELV_Back.png ( 2.28K ) Number of downloads: 206

Attached File  ELV_Meter.png ( 6.27K ) Number of downloads: 165


Credits
Original script by Moghunter

This post has been edited by 332211: Sep 25 2008, 01:54 PM


__________________________
Go to the top of the page
 
+Quote Post
   
Mefisno
post Sep 22 2008, 11:40 AM
Post #2


Is most likly drunk somewhere. But I'm sure he will get back
Group Icon

Group: Revolutionary
Posts: 165
Type: Event Designer
RM Skill: Advanced




Nice script but somethings up with it.

CODE
if Input.trigger?(Input::cool.gif or Input.trigger?(Input::L) or Input.trigger?(Input::R)


Line 140 fails to run it says "Syntax error occured"


__________________________
Go to the top of the page
 
+Quote Post
   
Heartofshadow
post Sep 22 2008, 12:08 PM
Post #3


Level 7
Group Icon

Group: Member
Posts: 95
Type: Developer
RM Skill: Intermediate




QUOTE (Mefisno @ Sep 22 2008, 03:02 PM) *
Nice script but somethings up with it.

CODE
if Input.trigger?(Input::cool.gif or Input.trigger?(Input::L) or Input.trigger?(Input::R)


Line 140 fails to run it says "Syntax error occured"


That's because there's a smiley in the script block. Notice it says (Input::cool.gif... etc. Instead, change the cool.gif part to a B followed by ")" minus the quotes. That should fix it.


__________________________


"Feel the pain of those inferior beings as you burn in hell." --Kratos (Tales of Symphonia)
"How can I be expected to save the world, when I can't even save myself?" --Sysolos (Return of a Shadow Lord)
Go to the top of the page
 
+Quote Post
   
Mefisno
post Sep 22 2008, 12:28 PM
Post #4


Is most likly drunk somewhere. But I'm sure he will get back
Group Icon

Group: Revolutionary
Posts: 165
Type: Event Designer
RM Skill: Advanced




QUOTE
That's because there's a smiley in the script block. Notice it says (Input::cool.gif... etc. Instead, change the cool.gif part to a B followed by ")" minus the quotes. That should fix it.


Ha ha ha thanks for that but now I have another problem.
When the guage hits 100% I get this error.

"Line 178: NoMethodError occurred.
undefined method 'element1_lv for # <Game_actor:0x1938588>"

What have I screwd up now? ha ha ha.


__________________________
Go to the top of the page
 
+Quote Post
   
332211
post Sep 22 2008, 01:26 PM
Post #5


Waiting for an epiphany
Group Icon

Group: Revolutionary
Posts: 180
Type: Scripter
RM Skill: Advanced




i missed it... Replace that line with the following.
CODE
        if user.element_exp[index] > 99 and user.element[index] < MAXELLV


__________________________
Go to the top of the page
 
+Quote Post
   
Mefisno
post Sep 22 2008, 01:30 PM
Post #6


Is most likly drunk somewhere. But I'm sure he will get back
Group Icon

Group: Revolutionary
Posts: 165
Type: Event Designer
RM Skill: Advanced




Nope still not working...


__________________________
Go to the top of the page
 
+Quote Post
   
332211
post Sep 22 2008, 01:51 PM
Post #7


Waiting for an epiphany
Group Icon

Group: Revolutionary
Posts: 180
Type: Scripter
RM Skill: Advanced




This is why sometimes i feel i should slap myself...
CODE
if user.element_exp[index] > 99 and user.element_level[index] < MAXELLV


If it's still not working... I deserve to die, or sleep, whichever comes first.


__________________________
Go to the top of the page
 
+Quote Post
   
Mefisno
post Sep 22 2008, 01:57 PM
Post #8


Is most likly drunk somewhere. But I'm sure he will get back
Group Icon

Group: Revolutionary
Posts: 165
Type: Event Designer
RM Skill: Advanced




QUOTE (332211 @ Sep 22 2008, 02:13 PM) *
This is why sometimes i feel i should slap myself...
CODE
if user.element_exp[index] > 99 and user.element_level[index] < MAXELLV


If it's still not working... I deserve to die, or sleep, whichever comes first.


Err well I have good news and bad news for you.
The good news is it (Semi) works and doesn't error up.

The bad news is it doesn't change the level on the status screen.
Apparently my level 2 thunder magic is still level 1.

So you only have to half die or half sleep ha ha ha.


__________________________
Go to the top of the page
 
+Quote Post
   
332211
post Sep 22 2008, 02:30 PM
Post #9


Waiting for an epiphany
Group Icon

Group: Revolutionary
Posts: 180
Type: Scripter
RM Skill: Advanced




I've returned as a zombie to reveal the ~final~ script.
CODE
        if user.element_exp[index] > 99 and level < MAXELLV
          user.element_exp[index] -= 100
          user.element_exp[index] = 0 if user.element_exp[index] < 0
          user.element_level[index] += 1
          Audio.se_play("Audio/SE/" + ELE_LVSE)
          user.animation_id = EL_LVANIME
          $game_player.animation_id = EL_LVANIME
        end

Replace lines 176 - 183 with these. If you run in to trouble, copy the script again. I you still can manage to make it work, I won't mind if you curse me till I die. I really won't care.


__________________________
Go to the top of the page
 
+Quote Post
   
Mefisno
post Sep 22 2008, 02:35 PM
Post #10


Is most likly drunk somewhere. But I'm sure he will get back
Group Icon

Group: Revolutionary
Posts: 165
Type: Event Designer
RM Skill: Advanced




He he he ummm MR zombie your not going to like this...

you see... ... ...

It works fine happy.gif

*Round of applause*

Well done ha ha ha.


__________________________
Go to the top of the page
 
+Quote Post
   
Mefisno
post Sep 22 2008, 02:44 PM
Post #11


Is most likly drunk somewhere. But I'm sure he will get back
Group Icon

Group: Revolutionary
Posts: 165
Type: Event Designer
RM Skill: Advanced




Oops sorry to double post (and sorry for bothering you again ha ha ha)
but Mr zombie is it possable to blank the status screen for some party members and keep it with some?
I only want actor 2 to be able to have the magic upgrading thing is there a way to do that?


__________________________
Go to the top of the page
 
+Quote Post
   
332211
post Sep 22 2008, 02:55 PM
Post #12


Waiting for an epiphany
Group Icon

Group: Revolutionary
Posts: 180
Type: Scripter
RM Skill: Advanced




Not that hard... I hope
Add this inside the MOG module:
CODE
ACTOR_ID = 4

For you, I think it will be actor 2
Change line 150(or so) to this:
CODE
    elsif Input.trigger?(Input::C) and @element_window.visible == false and @actor.id == MOG::ACTOR_ID

And line 165
CODE
      if Element_Names.include?($data_system.elements[id]) and user.is_a?(Game_Actor) and user.id == MOG::ACTOR_ID


__________________________
Go to the top of the page
 
+Quote Post
   
Mefisno
post Sep 22 2008, 03:06 PM
Post #13


Is most likly drunk somewhere. But I'm sure he will get back
Group Icon

Group: Revolutionary
Posts: 165
Type: Event Designer
RM Skill: Advanced




AHHHH MAN.
Dude you are so awesome it is unbelievable thank you soooooo much.

*You have just gained a loyal fan*


__________________________
Go to the top of the page
 
+Quote Post
   
Shadonn
post Sep 22 2008, 03:06 PM
Post #14


Level 6
Group Icon

Group: Member
Posts: 81
Type: Writer
RM Skill: Undisclosed




So this bascially gives an actor an element an they level it up and there skills that are based on that element level up as well?


__________________________
Go to the top of the page
 
+Quote Post
   
332211
post Sep 23 2008, 09:58 AM
Post #15


Waiting for an epiphany
Group Icon

Group: Revolutionary
Posts: 180
Type: Scripter
RM Skill: Advanced




Not quite...
Everytime an actor uses a skill with one of the selected elements, the skill's base damage will chane with the actor elemental level for that specific element.
Here's an example:
Elemental level of Fire is 1.
You use the skill Fireball (which has the fire element). You do normal damage.
Elemental level of Fire is now 2.
You use the skill Fireball, causing 1,2 * damage.
Elemental level of Fire is now 3.
You use the skill Fireball, causing 1,4 * damage.
And so on...



__________________________
Go to the top of the page
 
+Quote Post
   
Mefisno
post Sep 23 2008, 11:36 AM
Post #16


Is most likly drunk somewhere. But I'm sure he will get back
Group Icon

Group: Revolutionary
Posts: 165
Type: Event Designer
RM Skill: Advanced




Another quick question but is it possable to make it so that when you hit certain levels that you learn new skills and forget old ones?
For example when fire hits level 3 you forget fire but learn flare?


__________________________
Go to the top of the page
 
+Quote Post
   
332211
post Sep 23 2008, 02:34 PM
Post #17


Waiting for an epiphany
Group Icon

Group: Revolutionary
Posts: 180
Type: Scripter
RM Skill: Advanced




the only problem is that the messages that tell that a skill was learnt/forgotten
I'll try to fix it tommorow
[Show/Hide] "Skills version

CODE
#_________________________________________________
# MOG_Element LV System VX 1.?          
#_________________________________________________
# By Moghunter    
# http://www.atelier-rgss.com
#_________________________________________________
# Adapted to VX by uresk/332211
#_________________________________________________
Vocab::ForgetSkill = " %s was forgotten!"
module MOG
#Element max level
MAXELLV = 10
# Exp gain mode
# 0 = Experience = Actor level - element level
# 1 = Always wins EL_EXP
# 2 => (level * level)/ 5 - level * 5 + 25 (line 183)
EXP_TYPE = 1
# Exp gain when EXP_TYPE = 1
EL_EXP = 333
# Element names. Must be in the database
Element_Names = ["Fire","Ice","Thunder","Water","Earth","Wind","Light","Darkness"]
# Level up sound
ELE_LVSE = "Magic"
# Level up animation
EL_LVANIME = 63
# Reduce damage based on the elemental level?
EL_RESIST = true
# Resist formula: damage * multiplier
# multiplier = 1/4 + (level+1)/(4*level)
# Change it in the line 200, Damage formula at line 175

# List of skills that should be learnt
LEARN_EL_SKILLS = { "Fire" => { 3 => [60,61]}, #Element name => { element_level => skill id(s)...
                    "Ice"  => { 2 => 40}
                   }
                  
# List of skills that should be forgotten
FORGET_EL_SKILLS = {"Fire" => { 3 => 59 , 4 => 51}
                   } #Element name => { element_level => skill id(s)}...
                  
#Don't change this
  def check_for_elemental_skills(user,index,level)
    element = Element_Names[index]
    #Learn skills
    skill_learn = LEARN_EL_SKILLS[element][level] unless LEARN_EL_SKILLS[element].nil?
    $game_message.new_page
    if skill_learn.is_a?(Array)
      for skill_id in skill_learn
        user.learn_skill(skill_id)
        text = sprintf(Vocab::ObtainSkill, $data_skills[skill_id].name)
        $game_message.texts.push(text + '\|')
      end
    elsif !skill_learn.nil?
      user.learn_skill(skill_learn)
      text = sprintf(Vocab::ObtainSkill, $data_skills[skill_learn].name)
        $game_message.texts.push(text + '\|')
    end
    #Forget skills
    skill_forget = FORGET_EL_SKILLS[element][level] unless FORGET_EL_SKILLS[element].nil?
    if skill_forget.is_a?(Array)
      for skill_id in skill_forget
        user.forget_skill(skill_id)
        text = sprintf(Vocab::ForgetSkill, $data_skills[skill_id].name)
        $game_message.texts.push(text + '\|')
      end
    elsif !skill_forget.nil?
      user.forget_skill(skill_forget)
      text = sprintf(Vocab::ForgetSkill, $data_skills[skill_forget].name)
        $game_message.texts.push(text + '\|')
    end
  end
end

$mogscript = {} if $mogscript == nil
$mogscript["elementlv"] = true
##############
# Game_Actor #
##############
class Game_Actor < Game_Battler
  attr_accessor   :element_exp
  attr_accessor   :element_level
  alias mog30_setup setup
  def setup(actor_id)
    @element_exp = []
    @element_level = []
    for i in 0...MOG::Element_Names.size
      @element_exp[i] = 0
      @element_level[i] = 1
    end
  mog30_setup(actor_id)  
  end
end
###############
# Window_Base #
###############
class Window_Base < Window
  def draw_elementlv(actor, x, y,type)
    exp = actor.element_exp[type]
    self.contents.font.color = normal_color
    back = Cache.picture("ELV_Back")    
    cw = back.width  
    ch = back.height
    src_rect = Rect.new(0, 0, cw, ch)    
    self.contents.blt(x + 77, y - ch , back, src_rect)
    meter = Cache.picture("ELV_Meter")    
    ch = meter.height
    cw = meter.width * exp
    cw /= 100
    src_rect = Rect.new(0, 0, cw, ch)
    self.contents.blt(x + 80, y - ch - 8, meter, src_rect)
    self.contents.font.name = "Georgia"
    self.contents.font.color = Color.new(0,0,0,255)
    pexp = sprintf("%s %", exp)
    self.contents.draw_text(x + 161, y - 34, 50, 32, pexp ,1)
    self.contents.draw_text(x + 331, y - 34, 32, 32, actor.element_level[type])
    self.contents.draw_text(x + 301, y - 34, 32, 32, "Lv")
    self.contents.draw_text(x + 1, y - 34, 75, 32, MOG::Element_Names[type])
    self.contents.font.color = Color.new(255,255,255,255)
    self.contents.draw_text(x + 160, y - 35, 50, 32, pexp,1)
    self.contents.draw_text(x + 330, y - 35, 32, 32, actor.element_level[type])
    self.contents.draw_text(x + 300, y - 35, 32, 32, "Lv")
    self.contents.draw_text(x , y - 35, 75, 32, MOG::Element_Names[type])
  end
end
########################
# Window_Element_Level #
########################
class Window_Element_Level < Window_Base
  def initialize(actor)
    super(100, 0, 444, 416)
    self.contents = Bitmap.new(width - 32, height - 32)
    self.z = 9999
    @actor = actor
    refresh
  end
  def refresh
    self.contents.clear
    self.contents.font.name = "Georgia"
    self.contents.font.color = Color.new(0,0,0,255)  
    self.contents.draw_text(x + 50, y - 5 , 200, 50, "ELEMENT DATA")
    self.contents.draw_text(x + 50, y + 411 , 200, 50, "Press C to Status")
    self.contents.font.color = Color.new(255,255,255,255)  
    self.contents.draw_text(x + 51, y - 4 , 200, 50, "ELEMENT DATA")
    self.contents.draw_text(x + 51, y + 410 , 200, 50, "Press C to Status")
    for i in 0...MOG::Element_Names.size
      draw_elementlv(@actor, 40, 70 + (346/MOG::Element_Names.size) * i, i)
    end
  end
end
#################
# Window_Status #
#################
class Window_Status < Window_Base
  alias mog30_refresh refresh
  def refresh
    mog30_refresh
    self.contents.font.name = "Georgia"
    self.contents.font.color = Color.new(0,0,0,255)  
    self.contents.draw_text(x + 200, y + 416 , 250, 50, "Press C to Elemental Data")
    self.contents.font.color = Color.new(255,255,255,255)  
    self.contents.draw_text(x + 201, y + 415 , 250, 50, "Press C to Elemental Data")  
  end  
end  
################
# Scene_Status #
################
class Scene_Status
  alias mog30_main main
  def main
    @actor = $game_party.members[@actor_index]  
    @element_window = Window_Element_Level.new(@actor)
    @element_window.y = -550
    @element_window.visible = false
    mog30_main
    @element_window.dispose
  end
  alias mog30_update update
  def update  
    mog30_update
    if @element_window.y < 0
      @element_window.y += 20
    elsif @element_window.y >= 0
      @element_window.y = 0
      @element_window.contents_opacity = 255
    end  
    if @element_window.visible == true
      if Input.trigger?(Input::B) or Input.trigger?(Input::L) or Input.trigger?(Input::R)
        for i in 1..30
          @element_window.y -= 25  
          Graphics.update
        end
      end
    end
    if Input.trigger?(Input::C) and @element_window.visible == true
      Sound.play_decision
      @element_window.visible = false
    elsif Input.trigger?(Input::C) and @element_window.visible == false
      Sound.play_decision
      @element_window.visible = true
      @element_window.y = -550
    end
  end  
end
################
# Game_Battler #
################
class Game_Battler
  include MOG  
  alias mog30_make_obj_damage_value make_obj_damage_value
  def make_obj_damage_value(user, obj)
    multiplier = 0; divisor = 0
    for id in obj.element_set
      if Element_Names.include?($data_system.elements[id]) and user.is_a?(Game_Actor)
        index = Element_Names.index($data_system.elements[id])
        level = user.element_level[index]
        multiplier += (4 + level)/5
        divisor += 1
        if EXP_TYPE == 0
          valor = user.level - level
          user.element_exp[index] += 1 + valor
        elsif EXP_TYPE == 1
          user.element_exp[index] += EL_EXP
        elsif EXP_TYPE == 2
          user.element_exp[index] += (level ** 2)/ 5 - level * 5 + 25
        end  
        while user.element_exp[index] > 99 and level < MAXELLV
          user.element_exp[index] -= 100
          user.element_exp[index] = 0 if user.element_exp[index] < 0
          user.element_level[index] += 1
          check_for_elemental_skills(user,index,user.element_level[index])
          Audio.se_play("Audio/SE/" + ELE_LVSE)
          user.animation_id = EL_LVANIME
          $game_player.animation_id = EL_LVANIME
        end
        user.element_exp[index] = 100 if level == MAXELLV
      elsif Element_Names.include?($data_system.elements[id]) and self.is_a?(Game_Actor) and EL_RESIST == true
        index = Element_Names.index($data_system.elements[id])
        level = self.element_level[index]
        multiplier += 1/4 + ((level+2)/(4*level))
        divisor += 1
      end
    end
    obj.base_damage *= multiplier unless multiplier == 0
    obj.base_damage /= divisor unless divisor == 0
    obj.base_damage = obj.base_damage.round
    mog30_make_obj_damage_value(user, obj)
  end
end


@Mefisno
It's time to worship me! lol biggrin.gif

This post has been edited by 332211: Sep 23 2008, 02:38 PM


__________________________
Go to the top of the page
 
+Quote Post
   
Mefisno
post Sep 23 2008, 04:09 PM
Post #18


Is most likly drunk somewhere. But I'm sure he will get back
Group Icon

Group: Revolutionary
Posts: 165
Type: Event Designer
RM Skill: Advanced




Ok you are now almost my god and I may need an Idol dedicated to you in my room.
But...
Before that stage can come could you take a look at the script.
Some weird crap happend when I used it and my fire magic hit level 7 in one spell.
It is slightly edited because...

I only need it for Ice, Thunder and fire.
I only need actor 2 with the menu.

You play tested my game I think before.
well the script is for Fatham and I wanted a unique way for his Grenonian powers to level and this is jsut what I needed.


CODE

#_________________________________________________
# MOG_Element LV System VX 1.?
#_________________________________________________
# By Moghunter
# http://www.atelier-rgss.com
#_________________________________________________
# Adapted to VX by uresk/332211
#_________________________________________________
Vocab::ForgetSkill = " %s was forgotten!"
module MOG
ACTOR_ID = 2
#Element max level
MAXELLV = 10
# Exp gain mode
# 0 = Experience = Actor level - element level
# 1 = Always wins EL_EXP
# 2 => (level * level)/ 5 - level * 5 + 25 (line 183)
EXP_TYPE = 1
# Exp gain when EXP_TYPE = 1
EL_EXP = 333
# Element names. Must be in the database
Element_Names = ["Fire","Ice","Thunder"]
# Level up sound
ELE_LVSE = "Magic"
# Level up animation
EL_LVANIME = 63
# Reduce damage based on the elemental level?
EL_RESIST = true
# Resist formula: damage * multiplier
# multiplier = 1/4 + (level+1)/(4*level)
# Change it in the line 200, Damage formula at line 175

# List of skills that should be learnt
LEARN_EL_SKILLS = { "Fire" => { 2 => [50]}, #Element name => { element_level => skill id(s)...
"Ice" => { 2 => 40}
}

# List of skills that should be forgotten
FORGET_EL_SKILLS = {"Fire" => { 2 => 20 , 4 => 51}
} #Element name => { element_level => skill id(s)}...

#Don't change this
def check_for_elemental_skills(user,index,level)
element = Element_Names[index]
#Learn skills
skill_learn = LEARN_EL_SKILLS[element][level] unless LEARN_EL_SKILLS[element].nil?
$game_message.new_page
if skill_learn.is_a?(Array)
for skill_id in skill_learn
user.learn_skill(skill_id)
text = sprintf(Vocab::ObtainSkill, $data_skills[skill_id].name)
$game_message.texts.push(text + '\|')
end
elsif !skill_learn.nil?
user.learn_skill(skill_learn)
text = sprintf(Vocab::ObtainSkill, $data_skills[skill_learn].name)
$game_message.texts.push(text + '\|')
end
#Forget skills
skill_forget = FORGET_EL_SKILLS[element][level] unless FORGET_EL_SKILLS[element].nil?
if skill_forget.is_a?(Array)
for skill_id in skill_forget
user.forget_skill(skill_id)
text = sprintf(Vocab::ForgetSkill, $data_skills[skill_id].name)
$game_message.texts.push(text + '\|')
end
elsif !skill_forget.nil?
user.forget_skill(skill_forget)
text = sprintf(Vocab::ForgetSkill, $data_skills[skill_forget].name)
$game_message.texts.push(text + '\|')
end
end
end

$mogscript = {} if $mogscript == nil
$mogscript["elementlv"] = true
##############
# Game_Actor #
##############
class Game_Actor < Game_Battler
attr_accessor :element_exp
attr_accessor :element_level
alias mog30_setup setup
def setup(actor_id)
@element_exp = []
@element_level = []
for i in 0...MOG::Element_Names.size
@element_exp[i] = 0
@element_level[i] = 1
end
mog30_setup(actor_id)
end
end
###############
# Window_Base #
###############
class Window_Base < Window
def draw_elementlv(actor, x, y,type)
exp = actor.element_exp[type]
self.contents.font.color = normal_color
back = Cache.picture("ELV_Back")
cw = back.width
ch = back.height
src_rect = Rect.new(0, 0, cw, ch)
self.contents.blt(x + 77, y - ch , back, src_rect)
meter = Cache.picture("ELV_Meter")
ch = meter.height
cw = meter.width * exp
cw /= 100
src_rect = Rect.new(0, 0, cw, ch)
self.contents.blt(x + 80, y - ch - 8, meter, src_rect)
self.contents.font.name = "Georgia"
self.contents.font.color = Color.new(0,0,0,255)
pexp = sprintf("%s %", exp)
self.contents.draw_text(x + 161, y - 34, 50, 32, pexp ,1)
self.contents.draw_text(x + 331, y - 34, 32, 32, actor.element_level[type])
self.contents.draw_text(x + 301, y - 34, 32, 32, "Lv")
self.contents.draw_text(x + 1, y - 34, 75, 32, MOG::Element_Names[type])
self.contents.font.color = Color.new(255,255,255,255)
self.contents.draw_text(x + 160, y - 35, 50, 32, pexp,1)
self.contents.draw_text(x + 330, y - 35, 32, 32, actor.element_level[type])
self.contents.draw_text(x + 300, y - 35, 32, 32, "Lv")
self.contents.draw_text(x , y - 35, 75, 32, MOG::Element_Names[type])
end
end
########################
# Window_Element_Level #
########################
class Window_Element_Level < Window_Base
def initialize(actor)
super(100, 0, 444, 416)
self.contents = Bitmap.new(width - 32, height - 32)
self.z = 9999
@actor = actor
refresh
end
def refresh
self.contents.clear
self.contents.font.name = "Georgia"
self.contents.font.color = Color.new(0,0,0,255)
self.contents.draw_text(x + 50, y - 5 , 200, 50, "Grenonian Powers")
self.contents.draw_text(x + 50, y + 411 , 200, 50, "Press C to Status")
self.contents.font.color = Color.new(255,255,255,255)
self.contents.draw_text(x + 51, y - 4 , 200, 50, "Grenonian Powers")
self.contents.draw_text(x + 51, y + 410 , 200, 50, "Press C to Status")
for i in 0...MOG::Element_Names.size
draw_elementlv(@actor, 40, 70 + (346/MOG::Element_Names.size) * i, i)
end
end
end
#################
# Window_Status #
#################
class Window_Status < Window_Base
alias mog30_refresh refresh
def refresh
mog30_refresh
self.contents.font.name = "Georgia"
self.contents.font.color = Color.new(0,0,0,255)
self.contents.draw_text(x + 200, y + 416 , 250, 50, "Press C to Elemental Data")
self.contents.font.color = Color.new(255,255,255,255)
self.contents.draw_text(x + 201, y + 415 , 250, 50, "Press C to Elemental Data")
end
end
################
# Scene_Status #
################
class Scene_Status
alias mog30_main main
def main
@actor = $game_party.members[@actor_index]
@element_window = Window_Element_Level.new(@actor)
@element_window.y = -550
@element_window.visible = false
mog30_main
@element_window.dispose
end
alias mog30_update update
def update
mog30_update
if @element_window.y < 0
@element_window.y += 20
elsif @element_window.y >= 0
@element_window.y = 0
@element_window.contents_opacity = 255
end
if @element_window.visible == true
if Input.trigger?(Input::cool.gif or Input.trigger?(Input::L) or Input.trigger?(Input::R)
for i in 1..30
@element_window.y -= 25
Graphics.update
end
end
end
if Input.trigger?(Input::C) and @element_window.visible == true
Sound.play_decision
@element_window.visible = false
elsif Input.trigger?(Input::C) and @element_window.visible == false and @actor.id == MOG::ACTOR_ID
Sound.play_decision
@element_window.visible = true
@element_window.y = -550
end
end
end
################
# Game_Battler #
################
class Game_Battler
include MOG
alias mog30_make_obj_damage_value make_obj_damage_value
def make_obj_damage_value(user, obj)
multiplier = 0; divisor = 0
for id in obj.element_set
if Element_Names.include?($data_system.elements[id]) and user.is_a?(Game_Actor) and user.id == MOG::ACTOR_ID
index = Element_Names.index($data_system.elements[id])
level = user.element_level[index]
multiplier += (4 + level)/5
divisor += 1
if EXP_TYPE == 0
valor = user.level - level
user.element_exp[index] += 1 + valor
elsif EXP_TYPE == 1
user.element_exp[index] += EL_EXP
elsif EXP_TYPE == 2
user.element_exp[index] += (level ** 2)/ 5 - level * 5 + 25
end
while user.element_exp[index] > 99 and level < MAXELLV
user.element_exp[index] -= 100
user.element_exp[index] = 0 if user.element_exp[index] < 0
user.element_level[index] += 1
check_for_elemental_skills(user,index,user.element_level[index])
Audio.se_play("Audio/SE/" + ELE_LVSE)
user.animation_id = EL_LVANIME
$game_player.animation_id = EL_LVANIME
end
user.element_exp[index] = 100 if level == MAXELLV
elsif Element_Names.include?($data_system.elements[id]) and self.is_a?(Game_Actor) and EL_RESIST == true
index = Element_Names.index($data_system.elements[id])
level = self.element_level[index]
multiplier += 1/4 + ((level+2)/(4*level))
divisor += 1
end
end
obj.base_damage *= multiplier unless multiplier == 0
obj.base_damage /= divisor unless divisor == 0
obj.base_damage = obj.base_damage.round
mog30_make_obj_damage_value(user, obj)
end
end



Ha ha ha your going to hate me by the end of this.


__________________________
Go to the top of the page
 
+Quote Post
   
Shadonn
post Sep 23 2008, 04:41 PM
Post #19


Level 6
Group Icon

Group: Member
Posts: 81
Type: Writer
RM Skill: Undisclosed




Whenever my character uses an elemental skill, at the end of the battle it tells me ned was forgotten. was forgotten. Then it levels the element up to 10. What am I doing wrong?


__________________________
Go to the top of the page
 
+Quote Post
   
Mefisno
post Sep 23 2008, 04:58 PM
Post #20


Is most likly drunk somewhere. But I'm sure he will get back
Group Icon

Group: Revolutionary
Posts: 165
Type: Event Designer
RM Skill: Advanced




Ahh At least your getting that error aswell Shadonn.
That means its not my edited versions fault.

Whooo I'm clever I figured it out myself.

@Shadonn:
Change the line
CODE
EL_EXP = 333


to

CODE
EL_EXP = 6


Yay I'm smart tongue.gif


__________________________
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: 24th May 2013 - 05:52 PM
RPG RPG Revolution is an Privacy Policy and Legal
eXTReMe Tracker