Правила раздела:
1 Задавайте конкретные вопросы. Для болтовни есть свободный раздел.
2 По возможности давайте конкретные ответы.
3 Один вопрос=одна тема. Если хотите задать ещё вопрос, то начинайте новую тему.
4 Название темы должно составлять сам вопрос, и быть максимально конкретным. Рекомендуется начинать тему словами "Как", "Что", "Почему". А первый пост повторяет вопрос и даёт расширенные сведения.
5 Рекомендуется указывать версию мейкера (2000, 2003, RMXP, RMVX, ACE, IGM, и.т.д.. Это важно, и всё равно ведь спросят.
6 Темы "Пара вопросов", "Помогите", и подобные им - самый лёгкий путь к бану.
7 Поиск находится вверху справа.
А. Названия подразделов этого раздела уточняются. Советы принимаются.
1 Задавайте конкретные вопросы. Для болтовни есть свободный раздел.
2 По возможности давайте конкретные ответы.
3 Один вопрос=одна тема. Если хотите задать ещё вопрос, то начинайте новую тему.
4 Название темы должно составлять сам вопрос, и быть максимально конкретным. Рекомендуется начинать тему словами "Как", "Что", "Почему". А первый пост повторяет вопрос и даёт расширенные сведения.
5 Рекомендуется указывать версию мейкера (2000, 2003, RMXP, RMVX, ACE, IGM, и.т.д.. Это важно, и всё равно ведь спросят.
6 Темы "Пара вопросов", "Помогите", и подобные им - самый лёгкий путь к бану.
7 Поиск находится вверху справа.
А. Названия подразделов этого раздела уточняются. Советы принимаются.
Допиливание скрипта Vx ace
9 года 8 мес. назад - 9 года 8 мес. назад #93756
от Kouta555
Kouta555 создал тему: Допиливание скрипта Vx ace
Дело такое. Есть скрипт на отображение жизней героя, на манер дендевских игр. Но не хватает функции , которая бы скрывала отображение их на экране в тот момент, когда они не нужны. Скрипт очень простой и удобный.
Если кто может, подсобить с этим , буду очень признателен. Скрипт не требует дополнительной графики, изображения он берёт из iconset в папке System. Можно переключить в режим текста: меняем строку 67 на Icon = false
Если кто может, подсобить с этим , буду очень признателен. Скрипт не требует дополнительной графики, изображения он берёт из iconset в папке System. Можно переключить в режим текста: меняем строку 67 на Icon = false
Код
Code:
#==============================================================================
# GAMBIT ARCADE LIVES
#------------------------------------------------------------------------------
# WRITTEN BY: Gambit
#------------------------------------------------------------------------------
# VERSION: 1.00
#------------------------------------------------------------------------------
# CHANGELOG:
# v 1.00 - May 24, 2014 > Initial release
#------------------------------------------------------------------------------
# DESCRIPTION AND FEATURES:
# This script creates a simple arcade-like lives system represented either by
# icons or text.
#
# Features:
# - Lives can be represented by icons or text
# - Game over when no lives are left
# - HalfLives option allows for icons to represent two lives each and for a
# faded icon to represent a single life
# - Adjustable position of lives window on the map scene
#------------------------------------------------------------------------------
# REQUIRES:
# - None
#------------------------------------------------------------------------------
# INSTRUCTIONS AND SETUP:
# Place this script below Materials and above Main Process.
# -------------------------------------------------------------
# Use the following event script calls:
# To check the number of lives:
# lives
#
# To modify the number of lives:
# lives(number)
# Examples:
# lives(2) this will INCREASE the number of lives by 2
# lives(-1) this will DECREASE the number of lives by 1
#
# To set the total number of lives:
# set_lives(number)
# Example:
# set_lives(5) this will set the number of lives to 5
# -------------------------------------------------------------
# Alternatively, use the methods below to access lives even outside events:
# $game_party.lives to check the number of lives
# $game_party.lives(number) to modify lives by number
# $game_party.lives(number, true) to set the total lives to number
# -------------------------------------------------------------
# Setup for this script is below. Please read explanations in comments.
#------------------------------------------------------------------------------
# Terms of Use:
# - Credit if used
# - Free for use in non-commercial projects
# - Please do not repost elsewhere, convert, or translate this script without
# permission.
# - If seeking to use in commercial projects (projects that are generating money
# in any way, including advertisements), please contact me via PM at:
# http://www.rpgmakervxace.net/user/14194-gambit/
# - When using third-party scripts, the terms and conditions of those scripts
# also apply. Please be aware of them prior to using.
# - Not for use in any project involving any form of nudity, commercial or not
#==============================================================================
module Gambit
module ArcadeLives
# Icon to use for lives. To use text instead, use Icons = false.
Icons = 3
# Only needed if Icons are being used. This will make each icon count as two
# lives. An icon will fade when the first life is lost and then disappear
# when the second life is lost.
HalfLives = false
# Only needed if Icons = false. Text to display in front of number of lives.
Text = 'Lives: '
# X and Y position of the lives window.
X = 0
Y = 0
# Starting number of lives.
StartingLives = 3
end
end
###############################################################################
###############################################################################
###############################################################################
###############################################################################
### END OF SETTING UP ###### ONLY EDIT BELOW IF YOU KNOW WHAT YOU ARE DOING ###
###############################################################################
###############################################################################
###############################################################################
###############################################################################
($imported ||={})["GambitArcadeLives"] = true
#==============================================================================
# ** Game_Party
#------------------------------------------------------------------------------
# This class handles parties. Information such as gold and items is included.
# Instances of this class are referenced by $game_party.
#==============================================================================
class Game_Party < Game_Unit
#--------------------------------------------------------------------------
# * Object Initialization
#--------------------------------------------------------------------------
alias gam_arcadelives_initialize initialize
def initialize
gam_arcadelives_initialize
@lives = Gambit::ArcadeLives::StartingLives
end
#--------------------------------------------------------------------------
# * Change Party Lives
#--------------------------------------------------------------------------
def lives(change = false, set = false)
return @lives unless change
set ? @lives = change : @lives += change
SceneManager.scene.refresh_lives_window if SceneManager.scene_is? Scene_Map
SceneManager.goto(Scene_Gameover) if @lives < 1
end
end
#==============================================================================
# ** Game_Interpreter
#------------------------------------------------------------------------------
# An interpreter for executing event commands. This class is used within the
# Game_Map, Game_Troop, and Game_Event classes.
#==============================================================================
class Game_Interpreter
#--------------------------------------------------------------------------
# * Change Lives
#--------------------------------------------------------------------------
def lives(change = false)
$game_party.lives(change)
end
#--------------------------------------------------------------------------
# * Set Lives
#--------------------------------------------------------------------------
def set_lives(lives)
$game_party.lives(lives, true)
end
end
#==============================================================================
# ** Window_Lives
#------------------------------------------------------------------------------
# This window displays the party's remaining lives.
#==============================================================================
class Window_Lives < Window_Base
include Gambit::ArcadeLives
#--------------------------------------------------------------------------
# * Object Initialization
#--------------------------------------------------------------------------
def initialize
super(X, Y, Graphics.width, fitting_height(1))
self.opacity = 1
refresh
end
#--------------------------------------------------------------------------
# * Refresh
#--------------------------------------------------------------------------
def refresh
contents.clear
if Icons && HalfLives
hearts = $game_party.lives / 2
hearts.times {|i| draw_icon(Icons, i * 24, 0) }
draw_icon(Icons, hearts * 24, 0, false) if $game_party.lives % 2 > 0
elsif Icons
$game_party.lives.times {|i| draw_icon(Icons, i * 24, 0) }
else
draw_text(0, 0, contents_width, line_height, Text +
$game_party.lives.to_s)
end
end
end
#==============================================================================
# ** Scene_Map
#------------------------------------------------------------------------------
# This class performs the map screen processing.
#==============================================================================
class Scene_Map < Scene_Base
#--------------------------------------------------------------------------
# * Create All Windows
#--------------------------------------------------------------------------
alias gam_arcadelives_create_all_windows create_all_windows
def create_all_windows
gam_arcadelives_create_all_windows
create_lives_window
end
#--------------------------------------------------------------------------
# * Create Lives Window
#--------------------------------------------------------------------------
def create_lives_window
@lives_window = Window_Lives.new
end
#--------------------------------------------------------------------------
# * Refresh Lives Window
#--------------------------------------------------------------------------
def refresh_lives_window
@lives_window.refresh
end
end
Последнее редактирование: 9 года 8 мес. назад пользователем Kouta555.
Пожалуйста Войти или Регистрация, чтобы присоединиться к беседе.
9 года 8 мес. назад #93757
от Lipton
Lipton ответил в теме Допиливание скрипта Vx ace
Code:
#--------------------------------------------------------------------------
# * Refresh
#--------------------------------------------------------------------------
def refresh
contents.clear
return if $game_switches[99]==true #где 99 номер переключателя который нужно включить что бы
#выключить обновление худа =)
if Icons && HalfLives
hearts = $game_party.lives / 2
hearts.times {|i| draw_icon(Icons, i * 24, 0) }
draw_icon(Icons, hearts * 24, 0, false) if $game_party.lives % 2 > 0
elsif Icons
$game_party.lives.times {|i| draw_icon(Icons, i * 24, 0) }
else
draw_text(0, 0, contents_width, line_height, Text +
$game_party.lives.to_s)
end
end
Пожалуйста Войти или Регистрация, чтобы присоединиться к беседе.
9 года 8 мес. назад #93758
от Kouta555
Kouta555 ответил в теме Допиливание скрипта Vx ace
Не катит, оно конечно срабатывает, но для того чтоб они исчезли, нужно открыть и закрыть меню и только так.
Пожалуйста Войти или Регистрация, чтобы присоединиться к беседе.
9 года 8 мес. назад #93759
от Lipton
Добавь в конце вот этот код.
И после изменения переключателя вызывай в ивенте через комманду выполнить скрипт
livesOnOff
Наверно должно помочь.
Lipton ответил в теме Допиливание скрипта Vx ace
Code:
class Game_Interpreter
#--------------------------------------------------------------------------
# * On/Off
#--------------------------------------------------------------------------
def livesOnOff
$game_party.livesOnOff
end
end
class Game_Party < Game_Unit
#--------------------------------------------------------------------------
# * Change Party Lives
#--------------------------------------------------------------------------
def livesOnOff
SceneManager.scene.refresh_lives_window if SceneManager.scene_is? Scene_Map
end
end
И после изменения переключателя вызывай в ивенте через комманду выполнить скрипт
livesOnOff
Наверно должно помочь.
Спасибо сказали: Kouta555
Пожалуйста Войти или Регистрация, чтобы присоединиться к беседе.
9 года 8 мес. назад - 9 года 8 мес. назад #93760
от Kouta555
Kouta555 ответил в теме Допиливание скрипта Vx ace
Идеально. Теперь это можно делать общим событием. Твоё имя будет в титрах
Последнее редактирование: 9 года 8 мес. назад пользователем Kouta555.
Пожалуйста Войти или Регистрация, чтобы присоединиться к беседе.
Время создания страницы: 0.101 секунд
