Battle Fogs Script

GiantofBabil

Villager
Member
Joined
Apr 5, 2014
Messages
16
Reaction score
0
First Language
English
Primarily Uses
I just got Soulpour777 Battle Fogs script and in trying to test it I'm having trouble turning it on. Here is the script:

# -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=# RGSS3 - Battle Fogs# Version 1.0# Author: Soulpour777# -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=# Description:# This script allows battle fogs / mist during battle, which is fully # controlled by the script user, thus making different fogs called before # the battle starts.# -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=# Instructions:# Place the script below Materials above Main.#------------------------------------------------------------------------------# Usage:# To set if you would like to use a battle fog on battle, do this script call:# $game_system.set_allowfog(true)# set it to false if you don't want to. By the default, it is set to false.# To set the name of the fog you will use, do this script call:# $game_system.set_fogname(fognamex)# where fognamex is the name of the fog you're using. Example:# $game_system.set_fogname("001-Fog01")# By default, it is set to "" which means nothing.#------------------------------------------------------------------------------module Soulpour module BattleFog # How visible is the fog? BattleFog_Opacity = 120 # What is the surface of the fog? Fog_SurfaceZ = 2 endend#==============================================================================# ** Game_System#------------------------------------------------------------------------------# This class handles system data. It saves the disable state of saving and # menus. Instances of this class are referenced by $game_system.#==============================================================================class Game_System #-------------------------------------------------------------------------- # Public Instance Variables #-------------------------------------------------------------------------- attr_accessor :allow_battlefog attr_accessor :fog_name #-------------------------------------------------------------------------- # Alias Listings #-------------------------------------------------------------------------- alias :battle_fog_system_initialize :initialize #-------------------------------------------------------------------------- # Object Initialization (Aliased) #-------------------------------------------------------------------------- def initialize battle_fog_system_initialize @allow_battlefog = false @fog_name = "" end #-------------------------------------------------------------------------- # Set Fog Name #-------------------------------------------------------------------------- def set_fogname(fognamex) @fog_name = fognamex end #-------------------------------------------------------------------------- # Allow Fog? #-------------------------------------------------------------------------- def set_allowfog(args) @allow_battlefog = args endend#==============================================================================# ** Scene_Battle#------------------------------------------------------------------------------# This class performs battle screen processing.#==============================================================================class Scene_Battle < Scene_Base #-------------------------------------------------------------------------- # * Alias Listings #-------------------------------------------------------------------------- alias :battle_fog_initialize :start alias :battle_fog_update_basic :update_basic alias :battle_fog_terminate :terminate #-------------------------------------------------------------------------- # * Start Processing #-------------------------------------------------------------------------- def start battle_fog_initialize create_battle_fog if $game_system.allow_battlefog end #-------------------------------------------------------------------------- # * Create Fog #-------------------------------------------------------------------------- def create_battle_fog @battle_fog = Plane.new @battle_fog.bitmap = Cache.picture($game_system.fog_name) @battle_fog.opacity = Soulpour::BattleFog::BattleFog_Opacity @battle_fog.z = Soulpour::BattleFog::Fog_SurfaceZ end #-------------------------------------------------------------------------- # * Update Fog #-------------------------------------------------------------------------- def update_battle_fog @battle_fog.ox += 2 end #-------------------------------------------------------------------------- # * Dispose Fog #-------------------------------------------------------------------------- def dispose_fog @battle_fog.bitmap.dispose @battle_fog.dispose end #-------------------------------------------------------------------------- # * Update Frame (Basic) #-------------------------------------------------------------------------- def update_basic battle_fog_update_basic update_battle_fog if $game_system.allow_battlefog end #-------------------------------------------------------------------------- # * Terminate #-------------------------------------------------------------------------- def terminate battle_fog_terminate dispose_fog if $game_system.allow_battlefog end endI set up a switch called BattleFog, and I want it to turn on when I turn that switch on and go off when I turn the switch off. I tried testing this by inserting a Condition for the switch in the Battle Event portion under Troops in the Database that had this code in it:

$game_system.set_allowfog(true)$game_system.set_fogname(CloudySky1)I was trying to test it using a default RTP image, that's CloudySky1. I'm probably missing something really simple, I just got back into RPG Maker and haven't used anything since VX at it's release ><

Oh, here is the error I get when I turn it on:

Script 'Game_Interpreter' line 1411: NameError occurred.

uninitialized constant Game_Interpreter::CloudySky1
I realize from this that it's not recognizing my input, but I don't know why.
 

ShadowLurk

Tanoshii~
Veteran
Joined
Feb 14, 2014
Messages
226
Reaction score
53
Primarily Uses
You need to envelop the file name with double quotes, so the interpreter correctly recognizes it as a string....

Code:
$game_system.set_fogname("CloudySky1")
 

GiantofBabil

Villager
Member
Joined
Apr 5, 2014
Messages
16
Reaction score
0
First Language
English
Primarily Uses
You need to envelop the file name with double quotes, so the interpreter correctly recognizes it as a string....

$game_system.set_fogname("CloudySky1")
Thanks, that fixed my first error, but now I'm getting this one:

Script 'Battle Fogs' line 106: NoMethodError occurred.

undefined method `ox' for nil:NilClass
Line 106 is this:

#-------------------------------------------------------------------------- # * Update Fog #-------------------------------------------------------------------------- def update_battle_fog @battle_fog.ox += 2 end106 being the middle line.
 

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

Latest Threads

Latest Profile Posts

Couple hours of work. Might use in my game as a secret find or something. Not sure. Fancy though no? :D
Holy stink, where have I been? Well, I started my temporary job this week. So less time to spend on game design... :(
Cartoonier cloud cover that better fits the art style, as well as (slightly) improved blending/fading... fading clouds when there are larger patterns is still somewhat abrupt for some reason.
Do you Find Tilesetting or Looking for Tilesets/Plugins more fun? Personally I like making my tileset for my Game (Cretaceous Park TM) xD
How many parameters is 'too many'??

Forum statistics

Threads
105,859
Messages
1,017,030
Members
137,566
Latest member
Fl0shVS
Top