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.
Get Note's Data

0 Members and 1 Guest are viewing this topic.

pokeball A3DOffline
**
Rep:
Level 86
allow you to put your new data in note area, and you can pick them up via script.
it will make your data in each item unlimitable.

Code: [Select]
#===========================================================================
# A3D's Get Note Data
#
# << Version >>
#          : 1.2
#
# << Useful >>
# allow you to set-up your new data in note area
# it will make your data in each item unlimitable
#
# << General Command >>   
#          : A3D.gnd( [/type, /id], /code, /string )
#          : A3D.gnd(  /item      , /code, /string )
# /type    = type of your item
#            (1 = skill, 2 = item , 3 = weapon,
#            (4 = armor, 5 = enemy, 6 = state)
# /id      = id of your item
# /code    = code to call your data
# /string  = if you're expect an alphabet data (not number), set it true
# /item    = $data object of your item (not $game)
#
# << How to Use >>
# in "note" area in each "item", write your code & data in this format
#          : your_code>your_data
# example, second enemy in enemy's database, you have
#          : AP>10
#          : WD>SLASH
# you can pick-up each data by the following command
#          : A3D.gnd([5,2], "AP")
#          : A3D.gnd([5,2], "WD", true)
# or       : enemy = $data_enemies[2]
#          : A3D.gnd(enemy, "AP")
#          : A3D.gnd(enemy, "WD", true)
#
# << Note >>
# this script is for non-commercial use only, give credit if use
#
# << Contact >>
# A3D (hyper_s@hotmail.com)
#===========================================================================

module A3D
  #--------------------------------------------------------------------------
  # * Get Note Data
  #--------------------------------------------------------------------------
  def A3D.gnd(item, code, string = false)
    if item.is_a?(Array)
      case item[0]
      when 1 then item = $data_skills[item[1]]
      when 2 then item = $data_items[item[1]]
      when 3 then item = $data_weapons[item[1]]
      when 4 then item = $data_armors[item[1]]
      when 5 then item = $data_enemies[item[1]]
      when 6 then item = $data_states[item[1]]
      end
    end
    item.note.split(/[\r\n]+/).each do |line|
      if line.split(/[>]/)[0] == code
        data = line.split(/[>]/)[1]
        return string ? data : data.to_i
      end
    end
    return string ? "" : 0
  end
 
end


General Command ::
A3D.gnd( [/type, /id], /code, /string)
A3D.gnd(  /item        , /code, /string )
/type    = type of your item
           (1 = skill, 2 = item , 3 = weapon,
           (4 = armor, 5 = enemy, 6 = state)
/id        = id of your item
/code    = code to call your data
/string  = if you're expect an alphabet data (not number), set it true
/item    = $data object of your item (not $game)

in "note" area of each "item", write your code & data in this format ::
your_code>your_data

example, second enemy in enemy's database, you have ::

you can pick-up each data by the following command ::
          : A3D.gnd( [5, 2], "AP" )
          : A3D.gnd( [5, 2], "PE" )
« Last Edit: July 07, 2008, 06:33:34 PM by A3D »