Hmmm this script really isn't working for me at all does anyone know what i've done wrong?
I've created the scroll item (ID 26)
changed the first element to one called Scroll and set the number 26 ID item as that element.
and I think I've done the script rigth but I'm not sure why it's not working right.
CODE
#======================================================================
========
# ■ Magica
#------------------------------------------------------------------------------
# Right, now here is where you can set each scroll's effects. Wether it was it was adding magical
# skills, corresponding with other events, it doesn't matter !
# I made the basic commands which are setting a new skill,
#
# How to use :
#
# - Add the effects you want using the already setted methods under "def initialize" :
# (set_magica or switch_trigger)
# the arguments are as follows :
# set_magica(scroll_id,skill_id)
# set_switch(scroll_id, switch, character)
#
#==============================================================================
class Magica
def initialize #Add the scroll related skills below this line
set_magica(26,20)
end
#This is the method you'll be using for setting magic.
def set_magica(scroll_id,skill_id)
for i in 0...$game_party.members.size
@actor = $game_party.members[i]
if @actor.scroll.id == $data_items[scroll_id].scroll.id or @actor.scroll2.id == $data_items[scroll_id].scroll.id or @actor.scroll3.id == $data_items[scroll_id].scroll.id
@actor.learn_skill(skill_id)
else
@actor.forget_skill(skill_id)
end
end
end
#This is the method you'll be using for triggering a switch
def switch_trigger(scroll_id, switch, character)
if $game_party.members[character-1].scroll.id == $data_items[scroll_id].scroll.id or $game_party.members[character-1].scroll2.id == $data_items[scroll_id].scroll.id or $game_party.members[character-1].scroll3.id == $data_items[scroll_id].scroll.id
$game_switches[switch] = true
else
$game_switches[switch] = false
end
end
end
(the error message that comes up takes me to the bit that says "(26, 20)"
CODE
module Scrolls
class Scroll_Array
def initialize
# Don't forget to add the scroll's class name in this array, and don't forget the ".new"
@scroll_array = [Fire_Scroll.new]
end
def data(id)
for i in 0...@scroll_array.size
if @scroll_array[i].id == id
return @scroll_array[i]
end
end
end
end
#=====================================================================
#=====================================================================
#=====================================================================
#How to set Scrolls :
# 1 - Use the template below and follow the instructions
# 2 - Add the <class name> with a ".new" sticked to the end of it in the Array above..
# 3 - Add a line in the "Set_Item_Scrolls" class below using this syntax :
# $data_items[item_id].scroll = Scrolls::<class name>.new
# item_id : The id of the item related to the scroll
# <class name> : The name of the class of the scroll, again, don't forget the ".new"
#4 - All the items related to scrolls must have the first attribute -name it "Scroll"- setted on..
# If you still have problems with functioning the script please revise the templates in the
# demonstration game, if you still experince problems, you can PM in the RRR forums
# or through msn live messanger through my e-mail : denarto0o0@hotmail.com
#=====================================================================
#=====================================================================
begin
class Fire_Scroll #This can be anything but it should start with a capital letter
def initialize
end
def id
return 26 #This is the ID of the item you want the scroll to be related to..
end
def item_related
return $data_items[id]
end
def name
return "Fire Scroll" #The name of the scroll, you should name it like
#the item the scroll is related to although you can change it
# don't forget to put BETWEEN 2 QOUTE MARKZ
end
end
end
#=====================================================================
end
class Set_Item_Scrolls
def initialize
#Set the items related to the scrolls here
$data_items[26].scroll = Scrolls::Fire_Scroll.new
end
end
(And also with this one it tells me 26 is wrong)
This post has been edited by Mefisno: Sep 4 2008, 07:37 AM