Chaos Project

RPG Maker => Event Systems => Event System Requests => Topic started by: Phasedscar on August 06, 2008, 10:17:32 pm

Title: Help with Blizz-ABS battle music common event.
Post by: Phasedscar on August 06, 2008, 10:17:32 pm
Ok, I'm trying to make a common event that will switch the backround music depending if I'm in the Blizz-ABS ABSEAL range.

"Disable ABS controls: when no  enemies are within ABSEAL range"

Basically I'm trying to set up battle music for use with Blizz-ABS.  Blizzard already mentioned that "$game_temp.in_battle" should set up the condition if the ABSEAL range is on.  So I've made the following eventing script.


@>Conditional Branch: script: $game_temp.in_battle
  @>Conditional Branch: Variable [0009]battle music == 0
      @>Memorize BGM/BGS
      @>Change Variable: [0009]battle music = 1
      @>
    :  branch end
  @>Fade out BGM: 4 sec
  @>wait 20 frames
  @>Play BGM: '005-boss01', 85, 100
  @>Label: battle
  @>Conditional Branch: script $game_temp.in_battle
      @>Wait 20 frames
      @>Jump to Label: battle
      @>
    :  Else
      @>Jump to Label: BGM
      @>
    :  Branch End
  @>
:  Else
  @>Label: BGM
  @>Fade out BGM: 4 sec
  @>wait 20 frames
  @>Restore BGM/BGS
  @>Control Variable: [0009]battle music = 0
  @>Label: BGM2
  @>Conditional Branch: script: $game_temp.in_battle
     @>
    :  Else
     @>Wait: 20 Frames
     @>Jump to Label: BGM2
    :  Branch End
  @>
:  Branch End
@>


It works in changing the battle music however it wont reset to the memorized BGM, meaning it's probably looping somewhere I don't want it to.  I've double checked the event pathing and I just can't quite figure out what's wrong.  Also it starts playing the battle music whenever I activate an event such as teleports.

Also, in case you're wondering why I have conditionals with Jump to Labels, it's so that the music will keep playing unless the condition (in this case being in battle) are met, and then it should change.  Or vice versa.
Title: Re: Help with Blizz-ABS battle music common event.
Post by: Blizzard on August 07, 2008, 07:05:16 am
Hm... I just remembered that you need something more than just the in_battle flag since it's turned off during events. Try this

@>Conditional Branch: script: $game_temp.in_battle && !$game_system.map_interpreter.running? && !$game_temp.message_window_showing
  @>Conditional Branch: Switch [0009]battle music == OFF
    @>Memorize BGM/BGS
    @>Fade out BGM: 4 sec
    @>wait 20 frames
    @>Play BGM: '005-boss01', 85, 100
    @>Change Switch: [0009]battle music = ON
    @>
  :  branch end
:  Else
  @>Conditional Branch: Switch [0009]battle music == ON
    @>Fade out BGM: 4 sec
    @>wait 20 frames
    @>Restore BGM/BGS
    @>Control Switch: [0009]battle music = OFF
    @>
   :  Branch End
  @>
:  Branch End
@>


Don't forget: In events 20 frames = 1 second so you might wanna change the fade out time or the wait time. You have to keep in mind that parallel processes iterate over and over meaning they start from the beginning and are interrupted only at wait commands.
Title: Re: Help with Blizz-ABS battle music common event.
Post by: Phasedscar on August 08, 2008, 12:11:21 am
I'll try that out Blizz, thanks  :)

The reason it's 20 frames instead of 80 is because it allows for a nice blend of music.  You don't even notice the switch up.

The only problem I see with what's set up is that once it loops back through the Memorized BGM/BGS will be that of the battle music and not the original backround music that was there before.  That's why I had those odd Conditional Branches with the  go to labels and wait commands (so that it checks the condition every second without rewriting the Memorized BGM, ensuring that I have the right music play again when needed)

Thanks again Blizzard, I'll try this out tomorrow when I have time to play with it.
Title: Re: Help with Blizz-ABS battle music common event.
Post by: Blizzard on September 01, 2008, 05:49:42 am
So? How did it work out?
Title: Re: Help with Blizz-ABS battle music common event.
Post by: Shadonking on September 01, 2008, 08:30:33 am
some one should make a demo with an working event in it becuase iv tryied to get it to work but the battle bgm plays even when there is not a battle or enemy in the map.
Title: Re: Help with Blizz-ABS battle music common event.
Post by: Blizzard on September 02, 2008, 10:25:45 am
Quote from: Phasedscar on August 06, 2008, 10:17:32 pm
"Disable ABS controls: when no  enemies are within ABSEAL range"
Title: Re: Help with Blizz-ABS battle music common event.
Post by: Shadonking on September 02, 2008, 10:39:58 am
How, do i do this in the abs script or in the events.
Title: Re: Help with Blizz-ABS battle music common event.
Post by: Aqua on September 02, 2008, 11:08:56 am
Quote from: Blizz-ABS Manual: 2.1. Basic Configuration
2.1.5. Disable ABS
Determines when the ABS controls should be disabled. There are 4 different options:
never; Blizz-ABS controls are always active
disable in maps without enemies; disables Blizz-ABS controls in maps where no enemies have been added
when all enemies dead; disables Blizz-ABS controls as soon as the map has no more enemies (i.e. when all enemies are killed)
when no enemies within ABSEAL range; disables Blizz-ABS if no enemies are within the updating range of ABSEAL
Note that disabling Blizz-ABSEAL will also affect the last option.
Title: Re: Help with Blizz-ABS battle music common event.
Post by: Shadonking on September 02, 2008, 12:59:42 pm
ok.

what number should it be becuase iv tried 0-4 but non seem to have the affect i need.

edit

here is the event i done, is this ok

Spoiler: ShowHide
(http://i350.photobucket.com/albums/q434/tonyperry1928/battlemusicevent.jpg)


i cant get it to play when in range, does it need the extra bit of code on the enemy events to work becuase all i did was the enemy ID.

Title: Re: Help with Blizz-ABS battle music common event.
Post by: Blizzard on September 02, 2008, 05:15:27 pm
If you use number 3, the battle music will start playing when enemies are within the range of ABSEAL which is the screen + "the Factor option" square beyond. -_-
Title: Re: Help with Blizz-ABS battle music common event.
Post by: Shadonking on September 03, 2008, 06:56:49 am
iv done that but when the common event trigger is on then is plays the battle music anyway.  :???:

i dont think the conditional branch is correct with the script becuase it never seems to work. at always lets the procces past it.
Title: Re: Help with Blizz-ABS battle music common event.
Post by: Blizzard on September 03, 2008, 07:06:40 am
You have to turn off the switch at the end of ANY auto-starting event and/or erase it or it will freeze your game.
-_-
Title: Re: Help with Blizz-ABS battle music common event.
Post by: Shadonking on September 04, 2008, 07:28:07 am
i know this,  :<_<:

i have it on parralel procces.

i was talking about this conditional brach

@>Conditional Branch: script: $game_temp.in_battle && !$game_system.map_interpreter.running? && !$game_temp.message_window_showing

it always seems to be on so it never goes to the else part of it. so no matter what ,it plays the the battle music.
Title: Re: Help with Blizz-ABS battle music common event.
Post by: Blizzard on September 04, 2008, 10:06:39 am
It's on as long as no event is running, no message window is showing and as long as you are "in battle". "in battle" is determined by "Disable ABS Mode". Have you disabled Blizz-ABSEAL in those maps by any chance? And are you using a normal value for the ABSEAL Factor (i.e. 2 or 3)?
Title: Re: Help with Blizz-ABS battle music common event.
Post by: Shadonking on September 04, 2008, 10:31:51 am
all iv done is put disable abs mode as 3 and thats it.

what do i have to do to abseal or is that all that needs to be done.
Title: Re: Help with Blizz-ABS battle music common event.
Post by: Blizzard on September 04, 2008, 11:06:09 am
Try this in a parallel process event:

$game_system.hud = $game_temp.in_battle


It will remove the HUD when you not "in battle". Use it to test whether the "in battle" flag is set right. It should disappear when enemies are outside of the screen and a bit beyond.
Title: Re: Help with Blizz-ABS battle music common event.
Post by: Aqua on September 04, 2008, 11:11:24 am
Blizz, I tried doing that... and the HUD went away completely even if I'm in Arshes' face, pwning him and after he's dead.
Title: Re: Help with Blizz-ABS battle music common event.
Post by: Blizzard on September 04, 2008, 11:44:51 am
Aqua, that happens because the "in battle" flag is turned off during event execution. I forgot about that. -_- In any case I found the bug. Line 5052-5055 should be

  def battlers_in_range
    return ($game_map.battlers.find_all {|battler|
        !battler.dead? && battler.update?}).size
  end


The .size should be removed:

  def battlers_in_range
    return ($game_map.battlers.find_all {|battler|
        !battler.dead? && battler.update?})
  end


-_-

Between line 6014 and 6015 should a line like this be added:

    $game_switches[ID] = $game_temp.in_battle


This will trigger a switch when you are in battle and you can use it instead of the condition "$game_temp.in_battle" in the scripted condition. That should work.
Title: Re: Help with Blizz-ABS battle music common event.
Post by: Shadonking on September 04, 2008, 12:16:13 pm
iv tried what you just sayed but now the music wont play.

will you make these changes in the blizz-abs update just in case i did it wrong.(i dont think i did)

the only problem is that the switch i chose wont turn on. where you put [ID] i put [003]

Title: Re: Help with Blizz-ABS battle music common event.
Post by: Blizzard on September 04, 2008, 12:27:55 pm
Not [003], only [3] without the leading zeroes. And I actually did upload a fixed version.
Title: Re: Help with Blizz-ABS battle music common event.
Post by: Shadonking on September 04, 2008, 12:45:52 pm
ok i just downloaded the blizz-abs agian and iv tried looking where about the $game_switches[ID] = $game_temp.in_battle needs to be.

because between line 6014 and 6015 is a comment section.
Title: Re: Help with Blizz-ABS battle music common event.
Post by: Aqua on September 04, 2008, 12:51:13 pm
Part 3 Lines 5993-6015

  #----------------------------------------------------------------------------
  # test_in_battle
  #  Sets the in_battle flag to control game flow.
  #----------------------------------------------------------------------------
  def test_in_battle
    # if master override is being used
    if $game_system.blizzabs != nil
      # enforce user's setting
      $game_temp.in_battle = $game_system.blizzabs
    # if event code is being executed or message window is being displayed
    elsif $game_system.map_interpreter.running? || $game_temp.message_window_showing
      # disable Blizz-ABS controls
      $game_temp.in_battle = false
    else
      # depending on chosen DISABLE_ABS_MODE in battle or not in battle
      $game_temp.in_battle = case BlizzABS::Config::DISABLE_ABS_MODE
      when 0 then true
      when 1 then ($game_system.battlers_number > 0)
      when 2 then ($game_map.battlers.size > 0)
      when 3 then ($game_system.battlers_in_range.size > 0)
      end
    end
  end


I don't see how that is a comment section...
Title: Re: Help with Blizz-ABS battle music common event.
Post by: Blizzard on September 04, 2008, 01:15:55 pm
Yeah, it should be between the last two ends in that piece of script.
Title: Re: Help with Blizz-ABS battle music common event.
Post by: Shadonking on September 04, 2008, 01:43:14 pm
i was looking in part 2  :^_^':

ok iv got it working now yepeeee  :D

it plays when you enter the map with enemyies but just stops all music when there all dead and i have it on disable abs mode 3
Title: Re: Help with Blizz-ABS battle music common event.
Post by: Blizzard on September 04, 2008, 02:17:26 pm
Try it on a bigger map.
Title: Re: Help with Blizz-ABS battle music common event.
Post by: Shadonking on September 04, 2008, 05:31:09 pm
iv tryied it on a 50 by 100 map and i put the enemy at one side of the map and the starting position at the other but it still plays. :huh:
Title: Re: Help with Blizz-ABS battle music common event.
Post by: Blizzard on September 04, 2008, 06:31:47 pm
And you are sure that you have either downloaded the fixed version or applied the fix yourself and added the code with the switch which you then use instead of $game_temp.in_battle in that scripted condition?
Title: Re: Help with Blizz-ABS battle music common event.
Post by: Shadonking on September 04, 2008, 07:10:39 pm
yep im sure, i'll send screen shots if you want of the battle music common event.

i have updated the abs script and iv placed the code to make the swicth work. (and it does)

iv put the disable abs mode as 3.

by the way the game keeps freezing now after i kill all the enemyies in a map, wierd.
Title: Re: Help with Blizz-ABS battle music common event.
Post by: Aqua on September 04, 2008, 07:12:52 pm
Do you have the common event on Autorun?

That's why it's freezing...
Use Parallel Process
Title: Re: Help with Blizz-ABS battle music common event.
Post by: Shadonking on September 04, 2008, 07:24:53 pm
nope its on Parallel Process.

it only freezes after all the enemyies are dead, i dont think the events effect it by freezeing.

i'll disbale them and teel you if it stops freezing

edit

i deleted and disable all my events and it still froze (dont worry about the loss of events i made backups).

it was working yesterday and i havent had any new scripts added for a week so they cant be the problem and it was still freezing before i got the update of the abs script today.
Title: Re: Help with Blizz-ABS battle music common event.
Post by: Blizzard on September 04, 2008, 08:36:01 pm
Put a demo together with the problem, upload it on sendspace and post the download link here. You're starting to get more and more weird errors. -_-
Title: Re: Help with Blizz-ABS battle music common event.
Post by: Shadonking on September 04, 2008, 08:47:54 pm
i know, trust it to happen to me.

i'll pm you the demo in a few secs

edit

it may take a bit longer, i'll send it tommorow

edit

all done and working great
Title: Re: Help with Blizz-ABS battle music common event.
Post by: Shadonking on December 01, 2008, 01:03:13 pm
sorry about the necro post but it is needed.

i just got v2.01 and iv lost the condition that turns the switch on '$game_switches[ID] = $game_temp.in_battle' which means my battle music isnt working. where in your abs do you put the switch to get it working.

Title: Re: Help with Blizz-ABS battle music common event.
Post by: Blizzard on December 01, 2008, 01:41:49 pm
Just put it in Scene_Map#update.
Title: Re: [RESOLVED]Help with Blizz-ABS battle music common event.
Post by: Shadonking on December 01, 2008, 02:40:36 pm
ok, i got it working agian, thanks
Title: Re: Help with Blizz-ABS battle music common event.
Post by: Blizzard on December 21, 2008, 11:34:09 am
I just want to add that Blizz-ABS now supports extra condition checks where you can check if any enemy can actually perceive the player. It's an interesting alternative.
Title: Re: Help with Blizz-ABS battle music common event.
Post by: Shadonking on December 21, 2008, 01:32:00 pm
that would atcualy be much better, thanks blizz.

sorry for asking before checking but is the condition to check for in the manual
Title: Re: Help with Blizz-ABS battle music common event.
Post by: Blizzard on December 21, 2008, 01:40:55 pm
Oh, no, no. When this thread was started, there were no conditions. I added them just recently.
Title: Re: Help with Blizz-ABS battle music common event.
Post by: Shadonking on December 21, 2008, 01:51:02 pm
cool, cant wait to update to set it up for that condition