[XP] Blizz-ABS

Started by Blizzard, January 09, 2008, 08:21:56 am

Previous topic - Next topic

Bob423

unfortunately I have no idea how to do that. well except for the disabling part. the script still makes unintentional changes too, so I'm just going to go with the password thing I have planned as a backup. thanks anyway.

KK20

Which is why I said this was an obvious answer: you're asking for a solution that even I, who has knowledge of programming, would find quite challenging to do. It's the if I have difficulty thinking how to make this work, how would you know better? mentality. Curious, what is this 'password' method that you're thinking of?

Other Projects
RPG Maker XP Ace  Upgrade RMXP to RMVXA performance!
XPA Tilemap  Tilemap rewrite with many features, including custom resolution!

Nintendo Switch Friend Code: 8310-1917-5318
Discord: KK20 Tyler#8901

Join the CP Discord Server!

Bob423

create a mini project that gives the player a password if a certain switch is on. I already have a project setup that only needs a few edits too.
I'd edit the actual game, but I've already released it, and I don't want to make too many updates.

LiTTleDRAgo

Quote from: Bob423 on May 19, 2013, 10:04:16 pm
unfortunately I have no idea how to do that. well except for the disabling part. the script still makes unintentional changes too, so I'm just going to go with the password thing I have planned as a backup. thanks anyway.


http://forum.chaos-project.com/index.php/topic,13151.msg175740.html#msg175740

KK20

I can't believe I didn't see this before. For those who are like "Why can't I change the player's speed?" and stuff, you can set the values for 'normal_speed' by means of
$game_player.normal_speed = VALUE

If you want to change the speed in combos (say, a running forward charge), use a 'Script' and type
@ch.normal_speed = VALUE

Just note that your running and sneaking speeds will still be whatever you have it configured to in Part 1, but those can be changed by
BlizzABS::Config::RUN_SPEED = VALUE
BlizzABS::Config::SNEAK_SPEED = VALUE

:facepalm:

Other Projects
RPG Maker XP Ace  Upgrade RMXP to RMVXA performance!
XPA Tilemap  Tilemap rewrite with many features, including custom resolution!

Nintendo Switch Friend Code: 8310-1917-5318
Discord: KK20 Tyler#8901

Join the CP Discord Server!

zephrael

May 27, 2013, 04:41:40 am #5025 Last Edit: May 27, 2013, 04:43:04 am by zephrael
Hey! I think this ABS is fantastic, but I've got a couple of little queries. I did do a little search for them, but I couldn't really find anything that solved my problem.

First of all, when I have the script enabled, I can't use a move event->change character graphic to change the character's sprite. Has that functionality been replaced by a script command somewhere?

And second - I'm sure this one's very simple, but my knowledge of scripting is basic at best - how do I turn the HUD, hotkey bar etc on/off during gameplay? - EDIT: Never mind, after a minute more of searching I found a solution to this one!

Thanks!

LiTTleDRAgo

Quote from: zephrael on May 27, 2013, 04:41:40 am
First of all, when I have the script enabled, I can't use a move event->change character graphic to change the character's sprite. Has that functionality been replaced by a script command somewhere?


if you meant player graphics, it's been locked
you can hide your player and use another event to replace the player for a cutscene

zephrael

This was asked a while back, but I don't think the issue was ever resolved... It's about compatibility with the Hermes CMS. That system has a particular feature that lets you have 'asynchronised' messages - i.e. messages that play parallel, but during which the player can still walk around, so it gives the effect of conversations going on in the background while the player walks past or whatever. This - alongisde positioning messages over an event like a speechbubble - is quite an important feature in my game since I want it to feel like a living world rather than just... an RPG where people only speak if spoken to. But when I try to use it alongside Blizz ABS, whenever one of these asynchronised messages should happen, instead the message is printed above the player's head (even though, in the message, it is told to go above the event who is 'talking'), and the async feature does't work at all - it just says "[async]" at the start of the message, which is, of course, the tag used in the message to tell it to do it. But instead it just prints it like that.

Has anybody had this issue before and sorted it out, or could anybody with good scripting knowledge put the two scripts together and try and work out what's going on? Thanks!

KK20

I'm not a fan with importing tons of scripts and creating my own test project just for 1 error, so I'll just give my general ideas.
How is your message setup? If it is only posting [async] at the beginning, chances are you are assigning that window to play over the currently running event. I don't know if ABSEAL is probably the cause. Does it work normally without Blizz-ABS?

If you provide a demo, I can look into it deeply.

Other Projects
RPG Maker XP Ace  Upgrade RMXP to RMVXA performance!
XPA Tilemap  Tilemap rewrite with many features, including custom resolution!

Nintendo Switch Friend Code: 8310-1917-5318
Discord: KK20 Tyler#8901

Join the CP Discord Server!

zephrael

June 07, 2013, 02:10:52 pm #5029 Last Edit: June 07, 2013, 03:14:03 pm by zephrael
It goes...

\p[1,async]Blablabla!


Which essentially means: Position the text over event one and make it asynchronous. The same event works just fine until Blizz is introduced. I'll make a quick demo and upload it if you like, but I should point out that Hermes works a little weirdly anyway: It has quite a lot of scripts, which are in a separate folder within the Data folder, and all you put in the actual script editor is an 'Inserter' script at the top which grabs those scripts from the folder on game startup and runs them.

Here's the demo. in the root of the .rar is the demo without Blizz ABS included, then there's a further .rar inside that with the Blizz scripts added so you can compare. Anyway, when I put this together, I came across a new error I haven't seen before... You'll see when you look at it, but whenever the game (with Blizz included) tries to draw a message using the Hermes positioning (\p[eventid]), it gives an error and the whole thing closes. Thanks for helping!

KK20

Oh yes, I am quite aware of Hermes CMS. Hence why I didn't want to import the script myself.

The whole 'undefined method moving?' is being caused by Hermes. When determining which character to draw the message over, it checks if the player is in battle via $game_temp.in_battle. If on the map, it checks for event IDs. If in battle, it checks for actor or enemy positions. Blizz-ABS makes battles take place on the map, so Hermes is looking for actor of ID 1 rather than event of ID 1. This can be solved with an edited Hermes script, or by putting the script call

$game_temp.in_battle =
false

before every message that uses \p.

I'm still looking for the other things.

Other Projects
RPG Maker XP Ace  Upgrade RMXP to RMVXA performance!
XPA Tilemap  Tilemap rewrite with many features, including custom resolution!

Nintendo Switch Friend Code: 8310-1917-5318
Discord: KK20 Tyler#8901

Join the CP Discord Server!

zephrael

Oh, okay! That hasn't been a problem in my main game so far, so I must have already edited it correctly. Somehow.

KK20

Make the following changes to Hermes. Both are found in folder 'instance methods'.
Initialization: ShowHide
=begin script                    â-  Hermes - Hermes Extends RMXP's MEssage System
Name "Hermes instance methods (initialization)"
The initialization routine invoked when a message is created.
This method relies heavily on the message parser and the maintenance component
of Hermes and won't do much on its own.
=end
class Hermes
def initialize(char, text, proc = nil, options = nil, init_opacity = 0)
#-----------------------------------------------------
# Initialize instance variables and window attributes
#-----------------------------------------------------

super(0, 0, 10, 10)
self.contents = Bitmap.new(1, 1)
self.visible = false
self.z =
# Make active unless it is an asyncronous message
if self.active = (@proc = proc) != nil
$game_temp.message_window_showing = true
9998
else
9995
end
self.index = -1
# Initialize variables
self.contents.font = Hermes.font
skin_file = Hermes.skin
if FileTest.exist?("Graphics/Pictures/" + skin_file)
custom_skin = RPG::Cache.picture(skin_file)
else
custom_skin = nil
self.windowskin = RPG::Cache.windowskin(skin_file)
end
skin_file = nil
@sound = Hermes.sound
@prevent_skipping = Hermes.prevent_skipping
@write_speed = Hermes.speed
@align, @valign = Hermes.align, Hermes.valign
@outline, @shadow = Hermes.font_outline.dup, Hermes.font_shadow.dup
@texture = Hermes.font_texture
@x = @y = @cursor_width = @choice_indent = @padding_left = @padding_right =0
@write_wait = 0
@popchar = char
@character =
#if not $game_temp.in_battle
if @popchar == 0
$game_player
elsif @popchar > 0
if $game_map.events.has_key? @popchar
$game_map.events[@popchar]
else
Hermes.show_debug_warning "Invalid event ID #{@popchar}."
@popchar = -2
nil
end
end
#elsif @popchar > -1
#@popchar<4 ? $game_party.actors[@popchar]: $game_troop.enemies[@popchar-4]
#end
@align_offset = 0
@cur_line = @scroll_break = 0
@text_buffer = ""

#--------------------------------
# Get and parse the message text
#--------------------------------

# Get text
@now_text = text

# Before parsing, number the [] brackets in the message text, escaping the
# "real" { characters
@now_text.gsub!("{", "\\{")
level = 0
r = ""
@now_text.gsub!(/(\[|\])/) do
level -= 1 if $1 == "]"
r = "#{$1}{#{level}}"
level += 1 if $1 == "["
r
end
r = level = nil

# Parse all tags, perform word wrap and save output
@status = :width_trial
@now_text = parse_tags(@now_text)
# This also sets @commands and @line_widths
@status = :typing
line_count = @line_widths.size

#-------------------------------------------------
# Initialize Show choice and Input number options
#-------------------------------------------------

# If display options where specified
case @options = options
when Options::Input_Number
# Initiate Input Number Window
@input_number_window = Window_InputNumber.new(@options.digits_max)
@input_number_window.number = $game_variables[@options.variable_id]
@input_number_window.contents_opacity = 0
@input_number_window.visible = false
line_count += 1
when Options::Show_Choice
# Set choice start and calculate cursor width
visible_line_count =
if @popchar < 0 and Hermes.line_max < line_count
Hermes.line_max
else
line_count
end
@options.start = visible_line_count - (@item_max=@options.max)
# Set choice width plus padding
@cursor_width = @line_widths[@options.start..-1].max + 8
# Don't show the cursor in the beginning
self.index = -1
end

#---------------------------------------------------------------------------
# Initialize the window's size and induced default positions of sub-windows
#---------------------------------------------------------------------------

# Set width and height of window
if @popchar >= 0
# Get maximal line width
w = @line_widths.max
if @input_number_window and @input_number_window.width > w
# Adjust size when input number used
w = @input_number_window.width
end
# Minimum width
if w < 1
w = 33
else
w += 40 + @padding_left + @padding_right
end
# Calculate window height
h = line_count * Hermes.line_height
# Minimum height
if h < 1
h = 33
else
h += 32
end
else
# Apply vertical align if OSD or normal message with less than max lines
line_max = (@popchar == -1) ? 480 / Hermes.line_height : Hermes.line_max
if @popchar == -1 or (line_count < line_max)
th = Hermes.line_height * (line_max - line_count)
@align_offset = (@valign * th) / 2
end
if @popchar == -1
w, h = 640, 480
else
w = Hermes.width
box_line_count =
if Hermes.shrink and line_count < Hermes.line_max
line_count
else
Hermes.line_max
end
h = box_line_count * Hermes.line_height + 32
end
end
self.width, self.height = w, h

# Calculate choice indent
if @options.is_a?(Options::Show_Choice)
textarea_width = w - 32 - @padding_left - @padding_right
@choice_indent = (@align * (textarea_width - @cursor_width)) / 2
end

# Create room to draw
self.contents = Bitmap.new(w - 32, h - 32)
self.contents.font = Hermes.font
@outline, @shadow = Hermes.font_outline.dup, Hermes.font_shadow.dup
@texture = Hermes.font_texture
if @options.is_a?(Options::Input_Number)
@input_number_window.contents.font = self.contents.font
end

#----------------------------------------
# Set initial positions of movable parts
#----------------------------------------

reset_position
# Sets self.x, self.y[, @name_window.x, @name_window.y][, @face_sprite.x,
# @face_sprite.y[, @face_sprite.align][, @name_window.indent]]
# [, @input_number_window.x, @input_number_window.y][, @gold_window.x,
# @gold_window.y]

#-------------------------
# Complete initialization
#-------------------------

# Set opacities
if @popchar == -1 or custom_skin
self.opacity = 0
self.back_opacity = 0
elsif $game_system.message_frame == 0
self.opacity = 255
self.back_opacity = Hermes.opacity
else
self.opacity = 0
self.back_opacity = Hermes.opacity
end
self.contents_opacity = init_opacity

# Draw custom window skin
if custom_skin and $game_system.message_frame != 0
self.contents.stretch_blt(self.contents.rect, custom_skin,
custom_skin.rect, Hermes.opacity)
end

# First x offset
@x = @padding_left + align_indent

# And finally, show
Graphics.frame_reset
self.visible = true
end
end

Frame Update: ShowHide
=begin script                    â-  Hermes - Hermes Extends RMXP's MEssage System
Name "Hermes instance methods (frame update)"
Defines the core method called at frame update and som auxilliary methods.
=end
class Hermes
# Determine wether to show the text at once
def skip_text?
# - We're NOT in pause mode and:
#   - Allowed to skip and pressing enter or
#   - In debug mode and control held and enter pressed
skip_key_trigger = Input.trigger?(Hermes::SKIP_TEXT_CODE)
@status != :pause and (
(self.active and not @prevent_skipping and skip_key_trigger) or
($DEBUG and Input.press?(Input::CTRL) and skip_key_trigger)
)
end

#--------------------------------------------------------------------------

def current_drawing_y
@y * Hermes.line_height + @align_offset
end

#--------------------------------------------------------------------------

def flush_buffer
unless @text_buffer.empty?
w = self.contents.text_size(@text_buffer).width
self.contents.draw_text(
@x, current_drawing_y, w * 2, Hermes.line_height,
@text_buffer, 0, @shadow, @outline, @texture
)
@x += w
@text_buffer = ""
end
end

#--------------------------------------------------------------------------

def update
super()

# Move Message Box with event
if @character and
(@character.moving? or $game_player.moving? or $game_map.scrolling?)
reset_position
end

# Perform Fade-in
unless @status == :closing
self.contents_opacity += 24 if self.contents_opacity < 255
end

case @status
when :typing
# Decrease frames to wait
@write_wait -= 1 if @write_wait > 0
# Wait until next frame unless we've waited long enough or are skipping
return unless @write_wait == 0 or skip_text?

while @now_text != "" or not @commands.empty?

# Execute the commands one by one
if @commands[0]
# A command can change everything, better flush the buffer
flush_buffer
while command = @commands[0].shift
# Execute it
send(command.method, *command.params)
# Exit if we have to wait or status has changed
return unless @status == :typing and (@write_wait == 0 or skip_text?)
end
end

# Delete first command list (because it is empty! (or should be^^))
@commands.shift

if c = @now_text.slice!(/./m)
if c == "\n"
# Draw anything we might have collected
flush_buffer
# New line
@cur_line += 1
@x = @padding_left + align_indent
if @popchar > -2 or @cur_line < Hermes.line_max
@y += 1
else
# Duplicate to blt it later
@oldcontents = self.contents.dup
@scroll_break = (@scroll_break + 1) % Hermes.line_max
if @scroll_break == 1
@status = :pause
break
end
end
else
# Move old three lines to top
if @oldcontents
self.contents.clear
self.contents.blt(0, -Hermes.line_height,
@oldcontents, @oldcontents.rect)
@oldcontents.dispose
@oldcontents = nil
end
# We have a letter! Add it to the buffer
@text_buffer << c
# Don't play a sound during instant display
if @sound and @write_speed > 0
Audio.se_play("Audio/SE/" + @sound)
end
end
end

# Continue with next letter if skipping
if skip_text? or @write_speed == 0
next
else
# Draw whatever's left
flush_buffer
# Stretch time to wait by global speed factor and add own wait time
@write_wait = (@write_wait + 1) * @write_speed
return
end
end

# Draw the rest, if any
flush_buffer

# Switch to done status when text is fully drawn
if @now_text == "" and @commands.empty? and
(@write_wait == 0 or skip_text?)
if @options.is_a?(Options::Show_Choice)
# Also, show the choice cursor
@index = 0
elsif @options.is_a?(Options::Input_Number)
# ...or the input number window
@input_number_window.contents.font = self.contents.font
@input_number_window.refresh
@input_number_window.visible = true
end
# Show continue cursor if applicable
self.pause = (@options == nil and self.active)
# Set status to done if fully faded in
@status = :done
end
when :pause
# Switch to pause mode if not yet in it
if self.active and not self.pause
self.pause = true
@write_wait = 0
end

if Input.trigger?(Input::C)
# Enter key pressed: resume dialog
@status = :typing
self.pause = false
end
when :done
# Pass control to input number window
if @options.is_a?(Options::Input_Number)
# Update input number window
@input_number_window.update
if Input.trigger?(Input::C)
# Enter key pressed
$game_system.se_play($data_system.decision_se)
$game_variables[@options.variable_id] = @input_number_window.number
$game_map.need_refresh = true
self.terminate
end
elsif @options.is_a?(Options::Show_Choice)
# Choice is active
if Input.trigger?(Input::B) and
# Escape key pressed
if @options.cancel_type > 0
$game_system.se_play($data_system.cancel_se)
@options.proc.call(@options.cancel_type - 1)
self.terminate
end
end
if Input.trigger?(Input::C)
# Enter key pressed
$game_system.se_play($data_system.decision_se)
@options.proc.call(self.index)
self.terminate
end
elsif self.active
# Enter key pressed: close dialog
self.terminate if Input.trigger?(Input::C)
end
when :closing
# Start fading out
self.opacity -= 48
self.contents_opacity -= 48
self.dispose if self.contents_opacity == 0
end
end
end

That was all that needed to be addressed, right?

Other Projects
RPG Maker XP Ace  Upgrade RMXP to RMVXA performance!
XPA Tilemap  Tilemap rewrite with many features, including custom resolution!

Nintendo Switch Friend Code: 8310-1917-5318
Discord: KK20 Tyler#8901

Join the CP Discord Server!

zephrael

Hrmm. Having a different issue now. It seemed to work perfectly, but then I noticed that when an async message goes, if the player moves, the message stays on the same place in the screen... which is to say, if you walk away from the 'talking' event, the message just follows you rather than staying above them. It does that once, then, if it's repeating, appears at the top of the screen (i.e. the default message position) the second time around. Also, it interrupts 'ordinary' message (cuts them off short), which, you know, it shouldn't usually do. Here's a demo (Cut down to one testing map so I don't give you 90MB of stuff useless to you!) of my actual game if you're still willing to help me out. Thanks for everything so far though!

(Incidentally, ignore the name of the project. When i started it I just used an online game name generator to get a placeholder, with... interesting results.)

Watch out, it's still fairly big.

KK20

June 07, 2013, 07:05:00 pm #5034 Last Edit: June 07, 2013, 07:21:34 pm by KK20
Hmmm...that shouldn't be. I got that error too at one point, but after making the changes to Hermes, it's not doing that anymore. My project (or the one I downloaded off you) is working fine. Did you make a mistake?

I'll check out your new download and see if I can locate it.

EDIT: I copied my post's fixes into the files and it's working fine.
Also, you no longer need to do the $game_temp.in_battle = false anymore.

Other Projects
RPG Maker XP Ace  Upgrade RMXP to RMVXA performance!
XPA Tilemap  Tilemap rewrite with many features, including custom resolution!

Nintendo Switch Friend Code: 8310-1917-5318
Discord: KK20 Tyler#8901

Join the CP Discord Server!

zephrael

Bah. I'm fairly certain that I followed your instructions just fine, but it was still doing that, with the async messages messing about... So I re-copied the Hermes fixes into the data files, and this time instead it just gave me an error on startup, saying that it couldn't fine the Initialization script. I tried several times to make sure that I wasn't pasting it wrong or deleting anything, but the same every time. Maybe if you uploaded and sent me your 'version' that you say works fine?

KK20

June 07, 2013, 07:31:12 pm #5036 Last Edit: June 07, 2013, 07:37:17 pm by KK20
Even though it says that message, the game still runs you know. And if you played it, you'd see the changes are still made.

I'll get the two files uploaded.

EDIT: Here ya go.

Other Projects
RPG Maker XP Ace  Upgrade RMXP to RMVXA performance!
XPA Tilemap  Tilemap rewrite with many features, including custom resolution!

Nintendo Switch Friend Code: 8310-1917-5318
Discord: KK20 Tyler#8901

Join the CP Discord Server!

zephrael

June 07, 2013, 07:34:28 pm #5037 Last Edit: June 07, 2013, 07:43:30 pm by zephrael
Should it? It doesn't seem to. It gives one error and says to check inserter.log, then another telling me Initialization couldn't be found, and then just closes.

Thanks, I hope it turns out I have just been repeating some silly mistake and this will sort it once and for all!

EDIT: Hrrm damn. Okay so I deleted all my Hermes files, replaced them all with the default ones from the Hermes demo (just in case) and then replaced those two with the fixes you sent me. But... still, the same thing. When I move, the async message detaches from the guy's head, stuck to the same place on the screen. Could I trouble you to send me the actual whole fixed demo? 'Cause if that works for you, I see no way that it couldn't work for me. I'm sorry to be such a nuisance!

KK20

Epic facepalm. I took the files from the non-Blizz-ABS demo.

This should be it: No fails plz

Other Projects
RPG Maker XP Ace  Upgrade RMXP to RMVXA performance!
XPA Tilemap  Tilemap rewrite with many features, including custom resolution!

Nintendo Switch Friend Code: 8310-1917-5318
Discord: KK20 Tyler#8901

Join the CP Discord Server!

zephrael

Perfect! Excellent! Thank you so much, I'm indebted to you! You've helped me a great deal and I appreciate the time and effort you took to help me. You're an angel!