Status
Not open for further replies.

nickfitzgerald3

Villager
Member
Joined
May 5, 2014
Messages
24
Reaction score
3
First Language
english
Primarily Uses
So my game works fine, anything but the battle tester works fine, and I didnt do anything to effect one minute it was fine, and the next I recieved

Script 'Cache' line 88 :NoMethodError occured

Undefined method `empty?' for nil:NilClass

Now im more of a designer than a programmer so the scripting isnt my strong point, but when I go to chec the script error that im getting, It takes me to line 88 in the Cache Module, and the error is taking place in a section called "Load Bitmap" So I know thats not a part of the script you want to start playing trial and error with

I'm beyond confused what is going on, Now like I said from what I tell its not effecting my game at all only when I battle test, but I dont want something to come up later and be a road block in my development process

Please Help 
smile.png


 
 

Shaz

Global Moderators
Global Mod
Joined
Mar 2, 2012
Messages
45,552
Reaction score
16,450
First Language
English
Primarily Uses
RMMV
What other scripts are you using in your game? Provide links to them please.
 

nickfitzgerald3

Villager
Member
Joined
May 5, 2014
Messages
24
Reaction score
3
First Language
english
Primarily Uses
Edited
 
Last edited by a moderator:

nio kasgami

VampCat
Veteran
Joined
May 21, 2013
Messages
8,987
Reaction score
3,120
First Language
French
Primarily Uses
RMMV
well normally when someone say paste the link of the original script paste the original link script because when you paste the script directly it you can cause some problem and the principal problem is if you don't put them correctly the whole script can be altered (line who are moved e.c.t) and the script not work

Well if the problem persist after you removing your whole script just close your project open a new fresh project and copy past the new data file name Script.rv.data in your old project it supposed to correct the stuff~
 
Last edited by a moderator:

nickfitzgerald3

Villager
Member
Joined
May 5, 2014
Messages
24
Reaction score
3
First Language
english
Primarily Uses
well normally when someone say paste the link of the original script paste the original link script because when you paste the script directly it you can cause some problem and the principal problem is if you don't put them correctly the whole script can be altered (line who are moved e.c.t) and the script not work

Well if the problem persist after you removing your whole script just close your project open a new fresh project and copy past the new data file name Script.rv.data in your old project it supposed to correct the stuff~
oh ok got it so I did what you did and this time I was able to find that when I deleted this script

(used for making items add actors to party)

it fixed the problem, is anyone able to edit this??

Script Source: http://www.rpgmakervxace.net/topic/24009-actor-in-party-reliant-on-item-in-inventory/

 # -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=# Actor Adding Armor

# Version 1.0

# Author: Soulpour777

# Web URL: infinitytears.wordpress.com

# -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=

#

# -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=

# Description:

# This script allows an armor check where if the main character / leader

# owns and equips a certain weapon, a member of the party is added, else,

# that member of the party is automatically removed.

# -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=

module Soulpour

module ActorArmor

# What armor ID / Number in the database do you want to be checked?

Unique_Item_ID = 9

# Who among the actors (based on ID) do you want to add?

Actor_Added = 2 # in this case, Natalie

# Who is your main character?

Main_Character = 0 #in this case, the leader of your party.

end

end

#==============================================================================

# ** 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 :actor_added

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

# * Object Initialization (Aliased)

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

alias change_equip_add_actor_int initialize

def initialize

change_equip_add_actor_int

@actor_added = false

end

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

# * Change Value for Actor Added

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

def change_actor_added(args)

@actor_added = args

end

end

#==============================================================================

# ** Scene_Map

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

# This class performs the map screen processing.

#==============================================================================

class Scene_Map < Scene_Base

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

# * Alias Listings

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

alias change_equip_add_actor_update update

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

# * Frame Update (Aliased)

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

def update

change_equip_add_actor_update

detect_equipment

end

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

# * Detect Equipment

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

def detect_equipment

if $game_party.members[Soulpour::ActorArmor::Main_Character].armor_equipped?(Soulpour::ActorArmor::Unique_Item_ID)

if $game_system.actor_added == false

$game_party.add_actor(Soulpour::ActorArmor::Actor_Added)

$game_system.change_actor_added(true)

end

else

$game_party.remove_actor(Soulpour::ActorArmor::Actor_Added)

$game_system.change_actor_added(false)

end

end

end

#==============================================================================

# ** Game_Actor

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

# This class handles actors. It is used within the Game_Actors class

# ($game_actors) and is also referenced from the Game_Party class ($game_party).

#==============================================================================

class Game_Actor < Game_Battler

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

# * Armor Equipped Command

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

def armor_equipped?(armor_id)

armors.any? {|armor| armor.id == armor_id }

end

end 
 

Evgenij

Veteran
Veteran
Joined
Aug 28, 2013
Messages
349
Reaction score
101
First Language
German
Primarily Uses
N/A
I dont get any errors, when does the error come on your battle test?

I also see no reason why the battle testing should error you because of this script. The only classes effected are Game_System and Scene_Map (Game_Actor also, but there is only a new method which only get called on Scene_Map). There is nothing in this Script which should affect the Cache Module.
 
Last edited by a moderator:

Shaz

Global Moderators
Global Mod
Joined
Mar 2, 2012
Messages
45,552
Reaction score
16,450
First Language
English
Primarily Uses
RMMV
As nio said, please do NOT post the actual script in your post. Just put the link to where you got it from.


So you said you did something and it fixed the problem? Why do you need someone to edit it for you then, if it's fixed?


The script you posted has nothing to do with the cache.


When the problem happens, are you playing from a saved game that you saved prior to adding the script? A lot of scripts cause problems when you add them and then play a saved game. I don't SEE anything in the script in the spoiler that would cause an issue like that though. But try starting a new game and see if it still happens.


Oh - if the error is when you battle test, it may be because you didn't save in the editor first.
 
Last edited by a moderator:

nickfitzgerald3

Villager
Member
Joined
May 5, 2014
Messages
24
Reaction score
3
First Language
english
Primarily Uses
As nio said, please do NOT post the actual script in your post. Just put the link to where you got it from.

So you said you did something and it fixed the problem? Why do you need someone to edit it for you then, if it's fixed?

The script you posted has nothing to do with the cache.

When the problem happens, are you playing from a saved game that you saved prior to adding the script? A lot of scripts cause problems when you add them and then play a saved game. I don't SEE anything in the script in the spoiler that would cause an issue like that though. But try starting a new game and see if it still happens.

Oh - if the error is when you battle test, it may be because you didn't save in the editor first.
Misunderstanding I meant when I deleted that script It fixed the problem, Anyways this issue is really bizarre, I cant at all find out why this is happening so I came up with a way to event the same effect with parallel processing, So I suppose you could lock this thread and call this fixed...... Sort of lol  
 

Shaz

Global Moderators
Global Mod
Joined
Mar 2, 2012
Messages
45,552
Reaction score
16,450
First Language
English
Primarily Uses
RMMV
Nah, parallel processing is a bad idea. Let's keep working on the problem, try to find the cause, and actually fix it.


So, are you doing a battle test, or are you playing the game?


If doing a battle test, did you save in the editor after adding the script?


If playing the game, did you load a save file that was saved before you added the script?


Does the problem happen when you start a new game?
 

nickfitzgerald3

Villager
Member
Joined
May 5, 2014
Messages
24
Reaction score
3
First Language
english
Primarily Uses
Nah, parallel processing is a bad idea. Let's keep working on the problem, try to find the cause, and actually fix it.So, are you doing a battle test, or are you playing the game?If doing a battle test, did you save in the editor after adding the script?If playing the game, did you load a save file that was saved before you added the script?Does the problem happen when you start a new game?
No problems at all during gameplay only battle test strangely, and yeah I save after making script changes

I'm going to try putting this script in an old game I've made to narrow it down of it's something just on this project and I'll edit to update how

that goes

And just curious, what are the down sides to parallel processes

UPDATE: So 3 other projects, and the script did not effect the battle test, only the project im currently on, really stumped now 
 
Last edited by a moderator:

Shaz

Global Moderators
Global Mod
Joined
Mar 2, 2012
Messages
45,552
Reaction score
16,450
First Language
English
Primarily Uses
RMMV
That script has nothing to do with the cache. It doesn't use any images or try to load any bitmaps.


The error you're getting is because filename is nil. SOME script is trying to use an image, but the file name hasn't been set.


You don't have some script in your project, do you, that changes your actor's sprites depending on what they've got equipped?


In your 3 other projects, did you add this script but no others?
 

nickfitzgerald3

Villager
Member
Joined
May 5, 2014
Messages
24
Reaction score
3
First Language
english
Primarily Uses
That script has nothing to do with the cache. It doesn't use any images or try to load any bitmaps.

The error you're getting is because filename is nil. SOME script is trying to use an image, but the file name hasn't been set.

You don't have some script in your project, do you, that changes your actor's sprites depending on what they've got equipped?

In your 3 other projects, did you add this script but no others?
Ok FINALLY fixed it as far as I can tell, If you look at the script I used, The section at the top where you set the item ID and the Actor ID , I had some of the numbers reversed, Example: [4, 21] should have been [21, 4]. Now for whatever reason when I corrected that, It corrected the problem. I still don't exactly know how or why this happened, so I hope I dont get this error later down the line
 

Evgenij

Veteran
Veteran
Joined
Aug 28, 2013
Messages
349
Reaction score
101
First Language
German
Primarily Uses
N/A
I dont see that you can use arrays ( [ ] ) in the Script you posted above.

You can only use numbers:

Code:
module ActorArmor# What armor ID / Number in the database do you want to be checked?Unique_Item_ID = 9# Who among the actors (based on ID) do you want to add?Actor_Added = 2 # in this case, Natalie# Who is your main character?Main_Character = 0 #in this case, the leader of your party.end
 

nickfitzgerald3

Villager
Member
Joined
May 5, 2014
Messages
24
Reaction score
3
First Language
english
Primarily Uses
I dont see that you can use arrays ( [ ] ) in the Script you posted above.

You can only use numbers:

module ActorArmor# What armor ID / Number in the database do you want to be checked?Unique_Item_ID = 9# Who among the actors (based on ID) do you want to add?Actor_Added = 2 # in this case, Natalie# Who is your main character?Main_Character = 0 #in this case, the leader of your party.end
My mistake, It's this one

 module EEmodule ActorAsItem

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

ACTORS = [ # Dont edit this line

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

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

# [item_type, item_id, actor_id],

# item_type: :item, :weapon, or :armor

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

[:weapon, 1, 5],

[:item, 1, 3],

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

] # Dont edit this line

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

def self.items

return ACTORS.select{ |arr| arr.first == :item}

end

def self.weapons

return ACTORS.select{ |arr| arr.first == :weapon}

end

def self.armors

return ACTORS.select{ |arr| arr.first == :armor}

end

def self.get_items(item_class)

return items if item_class == RPG::Item

return weapons if item_class == RPG::Weapon

return armors if item_class == RPG::Armor

return []

end

def self.get_actor_id(item_class, item_id)

get_items(item_class).each do |arr|

return arr[2] if arr[1] == item_id

end

return nil

end

end

end

class Game_Party

alias :e222_gp_gi_ias :gain_item

def gain_item(item, amount, include_equip = false)

e222_gp_gi_ias(item, amount, include_equip)

container = item_container(item.class)

return unless container

actor_id = EE::ActorAsItem.get_actor_id(item.class, item.id)

return unless actor_id

if item_number(item) > 0

$game_party.add_actor(actor_id)

else

$game_party.remove_actor(actor_id) if $game_party.all_members.size > 1

end

end

def actors

return @actors

end

end

class Game_Map

alias :e222_gm_update_ias :update

def update(update_main = false)

e222_gm_update_ias(update_main)

check_party_equip

end

def check_party_equip

$game_party.all_members.each do |actor|

actor.equips.each do |item|

next unless item

actor_id = EE::ActorAsItem.get_actor_id(item.class, item.id)

next unless actor_id

$game_party.add_actor(actor_id) unless $game_party.actors.include?(actor_id)

end

end

end

end

 

Evgenij

Veteran
Veteran
Joined
Aug 28, 2013
Messages
349
Reaction score
101
First Language
German
Primarily Uses
N/A
Ahh now it all makes sense haha, so you got a problem with the script I made yesterday, I think I will test it a little bit more later.

The only way the script would affect the battle is, if you add or remove an Item during battle, then the Actor would also be affected during battle, and because you swapped the IDs, there could be the possibility that the script tried to add or remove an actor, which isnt in your database or something like that.

I can change the script if you want, so that the battle wont be affected at all by this script. But if you remove an Item during battle then, which corresponds to an actor, the actor will only get removed when your back at map.
 

nickfitzgerald3

Villager
Member
Joined
May 5, 2014
Messages
24
Reaction score
3
First Language
english
Primarily Uses
Ahh now it all makes sense haha, so you got a problem with the script I made yesterday, I think I will test it a little bit more later.

The only way the script would affect the battle is, if you add or remove an Item during battle, then the Actor would also be affected during battle, and because you swapped the IDs, there could be the possibility that the script tried to add or remove an actor, which isnt in your database or something like that.

I can change the script if you want, so that the battle wont be affected at all by this script. But if you remove an Item during battle then, which corresponds to an actor, the actor will only get removed when your back at map.
My thought is that because when you battle test they give you 99 of every battle item, that caused some confusion, the items I'm using this feature for were also put at menu only, so that should further remedy the problem
 

Shaz

Global Moderators
Global Mod
Joined
Mar 2, 2012
Messages
45,552
Reaction score
16,450
First Language
English
Primarily Uses
RMMV
1. Don't post scripts. Post a link to them.


2. If you HAVE to post scripts (because you've made mods to them or they're not available anywhere else), use the code tags to preserve the formatting.


3. If you're having a problem with a script someone provided for you in another thread, keep talking about it there - don't create a new thread for it. If the other thread was closed, report it and ask for it to be opened again.


Closing
 
Status
Not open for further replies.

Latest Threads

Latest Posts

Latest Profile Posts

Brace yourself. We are approaching that time of the year again.
I once said, "I definitely want to be done with this project before my 40th birthday." At the time, I was about 50% done with the project.

With under 365 days to go now, I'm about ... 30% done.

What a sweet, innocent fool I was.
can anyone tell me how to edit my pfp it isn't obvious and I'm new here
Damn, took a chance on a paid MV plugin working with MZ (FOSSIL) but didn't work :p Been lucky up until now so I got cocky!
Going to be streaming more RM game dev in about 20 minutes or so...

Forum statistics

Threads
129,988
Messages
1,206,790
Members
171,226
Latest member
snokojin
Top