Плохо! Плохо!:  0
Страница 1 из 2 12 ПоследняяПоследняя
Показано с 1 по 10 из 16

Тема: Нужен скрипт валюты

  1. #1

    По умолчанию Нужен скрипт валюты

    Всем доброго времени суток.
    Подскажите какой нибудь простенький скрипт доп валюты для Аси.
    Ну например кроме золота чтоб было ещё серебро,бронза и так далее.
    Заранее премного благодарен.

  2. #2
    Пользователь Аватар для Plush
    Информация о пользователе
    Регистрация
    06.06.2014
    Адрес
    Gallifrey
    Сообщений
    54
    Репутация: 2 Добавить или отнять репутацию

    По умолчанию

    Воть:
    Спойлер Monetary System:

    =begin
    #================================================= ==============================
    # Spike's Engine - Monetary System
    #
    # Version: 1.01
    # Author: Chris Barnett
    # Date: March 26th, 2012
    # Credit: Give credit where credit is due
    #================================================= ==============================
    # Description:
    #
    # This script displays currency values in terms of Copper, Silver, Gold, and
    # Platinum coins. It doesn't actually change the way gold works in any way,
    # only the way it is displayed.
    #================================================= ==============================
    # Instructions:
    #
    # Place this script above Main and below default scripts in the Script Editor.
    # If you plan to integrate with Modern Algebra's Special Message Codes it
    # would probably be wise to place this this script above it.
    #
    # You'll need to insert images for the coins into your IconSet resource. At
    # the moment the script requires the coin's icon indices to be in sequential
    # order, starting with the most valuable. I may unwrap the for loop if there
    # seems to be a need to assign non sequential icon indices.
    #
    # You will then need to set ICON to the icon index of the least valuable coin.
    #
    # To integrate with Modern Algebra's Special Message Codes, Just paste
    # the lines below into the icons section of convert_escape_characters
    #
    result.gsub!(/\iSMC/i) { "\i\[#{::SPIKE::GOLD::ICON}\]" rescue "" }
    result.gsub!(/\iSMS/i) { "\i\[#{::SPIKE::GOLD::ICON-1}\]" rescue "" }
    result.gsub!(/\iSMG/i) { "\i\[#{::SPIKE::GOLD::ICON-2}\]" rescue "" }
    result.gsub!(/\iSMP/i) { "\i\[#{::SPIKE::GOLD::ICON-3}\]" rescue "" }
    #
    # To call up the icons in a message box use the following escape sequences.
    #
    # \iSMC for Copper
    # \iSMS for Silver
    # \iSMG for Gold
    # \iSMP for Platinum
    #
    # NOTE!!! If you have any issues with this, please don't bother Modern Algebra
    # about it. He already spent his time writing Special Message Codes and
    # probably a fair amount of time answering questions about it. If you need
    # assistance, please contact me directly. I am plenty willing to help.
    #================================================= ==============================
    # Known Bugs:
    #
    # A compatibility issue with Yanfly's Ace Save Engine has been reported
    # but not yet confirmed. If you experience troubles, please let me know.
    #================================================= ==============================
    =end

    $imported = {} if $imported.nil?
    $imported["SE-Money"] = true

    module SPIKE
    module GOLD
    BATTLE_ALIGN = 1 # Change to non 0 to push icons to the right when receiving loot in battle
    ICON_POS = 4 # Increase to push icons right, decrease to pull left
    TEXT_POS = 0 # Increase to push text right, decrease to pull left
    OFFSET = -33 # Decrease to spread coins apart, increase to draw them closer
    ICON = 191 # Change this to the icon index of the least valuable coin
    HEIGHT = 0 # Increase to raise coins, decrease to lower
    end
    end

    class Window_Base < Window
    def draw_currency_value(value, unit, x, y, width)
    value *= -1 if value < 0
    pos = ::SPIKE::GOLD::ICON_POS
    for i in 0..3
    change = value % 100
    value = value / 100
    draw_icon(SPIKE::GOLD::ICON - i,width + pos + SPIKE::GOLD::OFFSET, y - SPIKE::GOLD::HEIGHT)
    draw_text(x + SPIKE::GOLD::TEXT_POS, y, width + pos, line_height, change, 2)
    pos += ::SPIKE::GOLD::OFFSET
    end
    end
    end

    class Game_Party < Game_Unit
    def max_gold
    return 99999999
    end
    def gain_gold(amount)
    @gold = [[@gold + amount, 0].max, max_gold].min
    end
    def gold
    return @gold
    end
    end

    class Window_ShopBuy < Window_Selectable
    def draw_currency_value(value, unit, x, y, width)
    value *= -1 if value < 0
    pos = SPIKE::GOLD::ICON_POS
    for i in 0..3
    change = value % 100
    value = value / 100
    if change != 0
    draw_icon(SPIKE::GOLD::ICON - i,width + pos + SPIKE::GOLD::OFFSET, y - SPIKE::GOLD::HEIGHT)
    draw_text(x + SPIKE::GOLD::TEXT_POS, y, width + pos, line_height, change, 2)
    pos += SPIKE::GOLD::OFFSET
    end
    end
    end
    def draw_item(index)
    item = @data[index]
    rect = item_rect(index)
    draw_item_name(item, rect.x, rect.y, enable?(item))
    draw_currency_value(price(item), Vocab::currency_unit, rect.x + 4, rect.y, contents.width - SPIKE::GOLD::ICON_POS - 8)
    end
    end

    class Window_ShopNumber < Window_Selectable
    def draw_currency_value(value, unit, x, y, width)
    value *= -1 if value < 0
    pos = SPIKE::GOLD::ICON_POS
    for i in 0..3
    change = value % 100
    value = value / 100
    if change != 0
    draw_icon(SPIKE::GOLD::ICON - i,width + pos + SPIKE::GOLD::OFFSET, y - SPIKE::GOLD::HEIGHT)
    draw_text(x + SPIKE::GOLD::TEXT_POS, y, width + pos, line_height, change, 2)
    pos += ::SPIKE::GOLD::OFFSET
    end
    end
    end
    end

    module BattleManager
    def self.gain_gold
    if $game_troop.gold_total > 0
    value = $game_troop.gold_total
    result = ''
    for i in 0..3
    change = value % 100
    value = value / 100
    if change != 0
    if SPIKE::GOLD::BATTLE_ALIGN == 0
    result = ('\i[' + (::SPIKE::GOLD::ICON - i).to_s + ']' + change.to_s + ' ') + result
    else
    result = (change.to_s + '\i[' + (::SPIKE::GOLD::ICON - i).to_s + '] ') + result
    end
    end
    end
    $game_message.add('Found ' + result + '\.')
    $game_party.gain_gold($game_troop.gold_total)
    end
    wait_for_message
    end
    end

    # Uncomment for compatability with Yanfly's Ace Save Engine
    #class Window_FileStatus < Window_Base
    # def draw_save_gold(dx, dy, dw)
    # return if @header[arty].nil?
    # draw_currency_value(@header[arty].gold.group.to_i, Vocab::currency_unit, + SPIKE::GOLD::ICON_POS, dy, contents.width - SPIKE::GOLD::ICON_POS - 8)
    # end
    #end

    class Game_Interpreter; include SPIKE::GOLD;
    end


    Добавляет медь, серебро, золото и платину.

  3. #3

    По умолчанию

    Блин, и мучаться со скриптами? о__О
    Уж лучше завести переменную, где целое от деления на 10000 -- золото, целое от деления остатка от деления на 10000 на 100 -- серебро, и остаток от деления остатка от деления на 10000 на 100 -- медь. X))
    Всего-то проблем, а?
    Я знаю, как лучше.

  4. #4
    Администратор Аватар для Пётр
    Информация о пользователе
    Регистрация
    24.04.2014
    Адрес
    Краснодар
    Сообщений
    3,940
    Записей в дневнике
    6
    Репутация: 132 Добавить или отнять репутацию

    По умолчанию

    Цитата Сообщение от Syrax Посмотреть сообщение
    Блин, и мучаться со скриптами? о__О
    Уж лучше завести переменную, где целое от деления на 10000 -- золото, целое от деления остатка от деления на 10000 на 100 -- серебро, и остаток от деления остатка от деления на 10000 на 100 -- медь. X))
    Всего-то проблем, а?
    Демку в студию. Чего зря язык стирать?

  5. #5
    Авторитет Аватар для Bloody
    Информация о пользователе
    Регистрация
    22.04.2008
    Сообщений
    1,752
    Записей в дневнике
    94
    Репутация: 36 Добавить или отнять репутацию

    По умолчанию

    Цитата Сообщение от Syrax Посмотреть сообщение
    Блин, и мучаться со скриптами? о__О
    А что с ними мучаться-то? То, что ты написал про переменные - это вполне себе скрипт, между прочим, даром, что не в меню scripts, а в common events

  6. #6
    Пользователь Аватар для Plush
    Информация о пользователе
    Регистрация
    06.06.2014
    Адрес
    Gallifrey
    Сообщений
    54
    Репутация: 2 Добавить или отнять репутацию

    По умолчанию

    Цитата Сообщение от Syrax Посмотреть сообщение
    Блин, и мучаться со скриптами? о__О
    Уж лучше завести переменную, где целое от деления на 10000 -- золото, целое от деления остатка от деления на 10000 на 100 -- серебро, и остаток от деления остатка от деления на 10000 на 100 -- медь. X))
    Всего-то проблем, а?
    Тогда что с магазином? Стандартный магазин в пролете, а магазин на ивентах какашка.

  7. #7

    По умолчанию

    > Демку в студию. Чего зря язык стирать?
    Запросто. Не знаю, как в XP, VX, и VX Ace, забыл вот, что в rm2k3 нет возможности давать результат "на лету". И да, в rm2k3 нет скриптов. -Р

    > Тогда что с магазином?
    А это очень хороший вопрос, да. Тот скрипт, что выше, меняет значение [s]стоимости[/s] отображения стоимости в магазине и битвах. При чем по той же формуле. Ну а для упертых, вроде меня, придется пилить свой магазин, с блекджеком и так далее.

    Вот демка для 2003:
    [s]gsc.rar[/s]
    Последний раз редактировалось Syrax; 26.03.2015 в 22:55.
    Я знаю, как лучше.

  8. #8

    По умолчанию

    Цитата Сообщение от Plush Посмотреть сообщение
    Воть:
    Спойлер Monetary System:

    =begin
    #================================================= ==============================
    # Spike's Engine - Monetary System
    #
    # Version: 1.01
    # Author: Chris Barnett
    # Date: March 26th, 2012
    # Credit: Give credit where credit is due
    #================================================= ==============================
    # Description:
    #
    # This script displays currency values in terms of Copper, Silver, Gold, and
    # Platinum coins. It doesn't actually change the way gold works in any way,
    # only the way it is displayed.
    #================================================= ==============================
    # Instructions:
    #
    # Place this script above Main and below default scripts in the Script Editor.
    # If you plan to integrate with Modern Algebra's Special Message Codes it
    # would probably be wise to place this this script above it.
    #
    # You'll need to insert images for the coins into your IconSet resource. At
    # the moment the script requires the coin's icon indices to be in sequential
    # order, starting with the most valuable. I may unwrap the for loop if there
    # seems to be a need to assign non sequential icon indices.
    #
    # You will then need to set ICON to the icon index of the least valuable coin.
    #
    # To integrate with Modern Algebra's Special Message Codes, Just paste
    # the lines below into the icons section of convert_escape_characters
    #
    result.gsub!(/\iSMC/i) { "\i\[#{::SPIKE::GOLD::ICON}\]" rescue "" }
    result.gsub!(/\iSMS/i) { "\i\[#{::SPIKE::GOLD::ICON-1}\]" rescue "" }
    result.gsub!(/\iSMG/i) { "\i\[#{::SPIKE::GOLD::ICON-2}\]" rescue "" }
    result.gsub!(/\iSMP/i) { "\i\[#{::SPIKE::GOLD::ICON-3}\]" rescue "" }
    #
    # To call up the icons in a message box use the following escape sequences.
    #
    # \iSMC for Copper
    # \iSMS for Silver
    # \iSMG for Gold
    # \iSMP for Platinum
    #
    # NOTE!!! If you have any issues with this, please don't bother Modern Algebra
    # about it. He already spent his time writing Special Message Codes and
    # probably a fair amount of time answering questions about it. If you need
    # assistance, please contact me directly. I am plenty willing to help.
    #================================================= ==============================
    # Known Bugs:
    #
    # A compatibility issue with Yanfly's Ace Save Engine has been reported
    # but not yet confirmed. If you experience troubles, please let me know.
    #================================================= ==============================
    =end

    $imported = {} if $imported.nil?
    $imported["SE-Money"] = true

    module SPIKE
    module GOLD
    BATTLE_ALIGN = 1 # Change to non 0 to push icons to the right when receiving loot in battle
    ICON_POS = 4 # Increase to push icons right, decrease to pull left
    TEXT_POS = 0 # Increase to push text right, decrease to pull left
    OFFSET = -33 # Decrease to spread coins apart, increase to draw them closer
    ICON = 191 # Change this to the icon index of the least valuable coin
    HEIGHT = 0 # Increase to raise coins, decrease to lower
    end
    end

    class Window_Base < Window
    def draw_currency_value(value, unit, x, y, width)
    value *= -1 if value < 0
    pos = ::SPIKE::GOLD::ICON_POS
    for i in 0..3
    change = value % 100
    value = value / 100
    draw_icon(SPIKE::GOLD::ICON - i,width + pos + SPIKE::GOLD::OFFSET, y - SPIKE::GOLD::HEIGHT)
    draw_text(x + SPIKE::GOLD::TEXT_POS, y, width + pos, line_height, change, 2)
    pos += ::SPIKE::GOLD::OFFSET
    end
    end
    end

    class Game_Party < Game_Unit
    def max_gold
    return 99999999
    end
    def gain_gold(amount)
    @gold = [[@gold + amount, 0].max, max_gold].min
    end
    def gold
    return @gold
    end
    end

    class Window_ShopBuy < Window_Selectable
    def draw_currency_value(value, unit, x, y, width)
    value *= -1 if value < 0
    pos = SPIKE::GOLD::ICON_POS
    for i in 0..3
    change = value % 100
    value = value / 100
    if change != 0
    draw_icon(SPIKE::GOLD::ICON - i,width + pos + SPIKE::GOLD::OFFSET, y - SPIKE::GOLD::HEIGHT)
    draw_text(x + SPIKE::GOLD::TEXT_POS, y, width + pos, line_height, change, 2)
    pos += SPIKE::GOLD::OFFSET
    end
    end
    end
    def draw_item(index)
    item = @data[index]
    rect = item_rect(index)
    draw_item_name(item, rect.x, rect.y, enable?(item))
    draw_currency_value(price(item), Vocab::currency_unit, rect.x + 4, rect.y, contents.width - SPIKE::GOLD::ICON_POS - 8)
    end
    end

    class Window_ShopNumber < Window_Selectable
    def draw_currency_value(value, unit, x, y, width)
    value *= -1 if value < 0
    pos = SPIKE::GOLD::ICON_POS
    for i in 0..3
    change = value % 100
    value = value / 100
    if change != 0
    draw_icon(SPIKE::GOLD::ICON - i,width + pos + SPIKE::GOLD::OFFSET, y - SPIKE::GOLD::HEIGHT)
    draw_text(x + SPIKE::GOLD::TEXT_POS, y, width + pos, line_height, change, 2)
    pos += ::SPIKE::GOLD::OFFSET
    end
    end
    end
    end

    module BattleManager
    def self.gain_gold
    if $game_troop.gold_total > 0
    value = $game_troop.gold_total
    result = ''
    for i in 0..3
    change = value % 100
    value = value / 100
    if change != 0
    if SPIKE::GOLD::BATTLE_ALIGN == 0
    result = ('\i[' + (::SPIKE::GOLD::ICON - i).to_s + ']' + change.to_s + ' ') + result
    else
    result = (change.to_s + '\i[' + (::SPIKE::GOLD::ICON - i).to_s + '] ') + result
    end
    end
    end
    $game_message.add('Found ' + result + '\.')
    $game_party.gain_gold($game_troop.gold_total)
    end
    wait_for_message
    end
    end

    # Uncomment for compatability with Yanfly's Ace Save Engine
    #class Window_FileStatus < Window_Base
    # def draw_save_gold(dx, dy, dw)
    # return if @header[arty].nil?
    # draw_currency_value(@header[arty].gold.group.to_i, Vocab::currency_unit, + SPIKE::GOLD::ICON_POS, dy, contents.width - SPIKE::GOLD::ICON_POS - 8)
    # end
    #end

    class Game_Interpreter; include SPIKE::GOLD;
    end


    Добавляет медь, серебро, золото и платину.
    Спасибо,я его пробовал уже.Так же пробовал CSCA Curency вроде так пишется..
    Вот в CSCA не смог просто разобраться как что,хотя он именно такой как нужен..Иностранные форумы обшарил и скриптов всего 2,этот и CSCA...
    Может если вдруг попадётся что то подобное и более лёгкое в настройке,так как и в магазине ж надо будет ставить цены в разных валютах,то буду очень благодарен за ссылочку.

  9. #9

    По умолчанию

    БЫСТРАФИКС: забыл отвязать от РТП.
    Правлю положение.
    gsc.rar
    Я знаю, как лучше.

  10. #10
    Пользователь Аватар для Plush
    Информация о пользователе
    Регистрация
    06.06.2014
    Адрес
    Gallifrey
    Сообщений
    54
    Репутация: 2 Добавить или отнять репутацию

    По умолчанию

    Цитата Сообщение от Syrax Посмотреть сообщение
    БЫСТРАФИКС: забыл отвязать от РТП.
    Правлю положение.
    gsc.rar
    Гмм.. И где тут магазин? Я вижу только персонажа который даёт\отбирает золото.
    А если делать магазин, то в нем будет макс 4 товара (из-за количества вариантов выбора).
    Мне кажется, это очень неудобно!

    З.Ы. Нашел баг, у меня -20 серебра : D
    Последний раз редактировалось Plush; 26.03.2015 в 23:08.

Страница 1 из 2 12 ПоследняяПоследняя

Информация о теме

Пользователи, просматривающие эту тему

Эту тему просматривают: 1 (пользователей: 0 , гостей: 1)

Метки этой темы

Социальные закладки

Социальные закладки

Ваши права

  • Вы не можете создавать новые темы
  • Вы не можете отвечать в темах
  • Вы не можете прикреплять вложения
  • Вы не можете редактировать свои сообщения
  •  
Нужен скрипт валюты