Jump to content
Sidedflame

Compatibility issue with Yanfly's Weapon Attack Replace, Vlue's Pets and Summons & Yanfly's Free Turn Battle Script

Recommended Posts

Hi all, fresh newbie here, made an account just to reach out for help! Experimenting with all these awesome scripts, trying to create a unique rpg.
While testing I found that three scripts I use, Yanfly's Weapon Attack Replace, Vlue's Pet's and Summon's (Compatibility Version), and lastly (my personal Favorite) Yanfly's Free Turn Battle seem to clash in some way. 

Here's my issue. When actor A summons actor B, and actor B kills the enemy and is left with no more Action Points from Yanfly's Free Turn Battle, it crashes the game with an error box stating:

 

"Script 'Weapon Attack Replace' line 301: NoMethodError occurred.

Undefined method 'actor?' for nil:NilClass"

 

Line 301 and its neighbors are:

 

300 def status_redraw_target(target)
301    return unless target.actor?
302    @status_window.draw_item($game_party.battle_members.index(target))
303  end
304  
305end

This is the only way it crashes the game that I've discovered. I've tried re-arranging the scripts, editing the attack (it previously used the Weapon Attack Replace), summoning different actors, but the outcome remains the same, a cold, cold, crash followed by that error. It ONLY happens when the Summoned Actor lands the killing blow on the LAST enemy. I've tested for hours on end to make sure that's correct! My theory is that it tries to check if there's any change in MP or HP as a result of the attack, but the actor is removed at the end of the battle, resulting in the crash, how ever, I have no idea how in the world I would fix that, nor where to even start.
 

A simple "fix" is to straight up delete "Unless target.actor?" but that brings up graphical errors with the Free Turn Battle Script, resulting in any changes to MP/HP/TP/Stat symbols not being properly shown until the NEXT turn. (Example just in case it doesn't make sense, Actor A, who has 100MP uses a weapon that costs 10 MP, they would use it, but their MP Gauge wouldn't change to show the proper amount (which should be 90MP) until next turn, after the enemy has acted.) 

 


If there's any questions or any other clarifications you need please let me know! This isn't for any serious project, but I'd be lying if I said I didn't want to make it work!
(Side note, I have all the necessary scripts for Yanflys Free turn battle script. Those being "Ace Core Modifications" and Ace Battle Engine)

Apologies for any newbie Mistakes!

Share this post


Link to post
Share on other sites

Hold up, hold up, hold up! One second, I think I have a solution.

Use the following in a Parallel Process common event:
 

$game_party.actors.each { |actor|
  $game_party.remove_actor(actor) unless 
actor == 1 || actor == 2
}

Change actor == x as needed (in the project I ripped this scriptlet from I had two different potential actors as the main character so you can exclude the [|| actor == x] part if need be), but I believe this should work. It'll remove the actor after the battle ends and the player is returned to the map.

Share this post


Link to post
Share on other sites

Apologies I cant figure out how to directly reply @PhoenixSoul.  Thanks for the quick reply! 

I inserted it into an event, and was met with this error.

Script 'Game_Interpreter' line 1411: NoMethodError occurred.
Undefined method 'actors' for #<Game_Party:0x1280fcc0>

 

I may have implemented it incorrectly I've never poked around with calling scripts from Common Events.

hopefully that's not the case. Also, if I were to add other actors to that list. would it look like this?

I'll try and toy around with it to see if I'm just implementing it wrong or something.

(I tried an event just with the script snippet, and one with a conditional branch, that branch being when the summoned actor was in the party. But still no dice.)

 

EDIT: Hmmmm, Messed around, but if I'm not getting the error stated above, im back to the initial error from Weapon Attack Replace Script, but I feel like you're on the right path, would there be somewhere else I could stick your fix in? 

 

Edited by Sidedflame

Share this post


Link to post
Share on other sites

I'm not sure.
Actually, are the actors being removed after battle but before returning to the map?
If so, don't let that happen, and instead, just use the snippet.

Otherwise, if that isn't working, then I'm not sure.

Share this post


Link to post
Share on other sites
1 hour ago, PhoenixSoul said:

I'm not sure.
Actually, are the actors being removed after battle but before returning to the map?
If so, don't let that happen, and instead, just use the snippet.

Otherwise, if that isn't working, then I'm not sure.

 

I believe so. If that is the case, any idea if its possible to do the opposite? Keep the summoned actor until you've returned to the map and then remove em?

Regardless thanks for the help!

Share this post


Link to post
Share on other sites

Oh, so that is happening then?
Is it something you made happen or is it something that happens regardless?

If the latter, I don't have any experience with but one of the three scripts, Yanfly's FTB. If the former, disable it then try my scriptlet.

Share this post


Link to post
Share on other sites

I just replied to your thread on rpgmakerforums. I tested those scripts and have no issues under the conditions you described.

summon actor -> actor uses last free turn action -> kills last enemy -> victory screen.

Share this post


Link to post
Share on other sites

It's something that happens regardless. However, thanks to @roninator2, discovery, I'm going through all my scripts, to see if its something else.

 

Thanks again Roninator!

(Also sorry for the false information!)

EDIT:

I've re-added all my scripts, and haven't ran into any problems strangely enough. Gonna start porting other stuff from the data base over and see if something there is messing it up. 


EDIT #2 Just had the crash happen after adding my states? Strange indeed. currently looking into it.

Edited by Sidedflame

Share this post


Link to post
Share on other sites

Oh my goodness it was the death state the whole time. I had changed the name of it, and I guess it didn't like that? Not having any problems now! Not sure why that causes the crash, my guess is it looks for the default Death State. But hey, I ain't arguing.

Thank you both for the help! I would have straight up deleted a script without your guys input!

 

Now! As my last question

 

...how does one close a thread?

Share this post


Link to post
Share on other sites

Changing the name of the death state shouldn't matter as the scripts check for the state ID, so that's very, very odd.

A moderator/admin will close the thread once they see it needs closing.

  • Like 1

Share this post


Link to post
Share on other sites
8 hours ago, PhoenixSoul said:

Changing the name of the death state shouldn't matter as the scripts check for the state ID, so that's very, very odd.

I know, but I discovered this as well a while ago. Any changes to skills 1 & 2 or changes to state 1 will cause issues. It's like they are hard coded.

  • Like 2

Share this post


Link to post
Share on other sites
16 hours ago, roninator2 said:

I know, but I discovered this as well a while ago. Any changes to skills 1 & 2 or changes to state 1 will cause issues. It's like they are hard coded.

 

Eh? I have changed skills 1 & 2 and state 1 all the time and never had any issue. I frankly have no idea why it would cause any. Seriously, it doesn't make the slightest bit of sense to me that there would be any issues with changing anything. Only way I can think of something like this happening is some kind of really screwy memory/disk corruption, and I would think that would have a lot more obvious signs.

Share this post


Link to post
Share on other sites
1 hour ago, Kayzee said:

Eh? I have changed skills 1 & 2 and state 1 all the time and never had any issue. I frankly have no idea why it would cause any. Seriously, it doesn't make the slightest bit of sense to me that there would be any issues with changing anything. Only way I can think of something like this happening is some kind of really screwy memory/disk corruption, and I would think that would have a lot more obvious signs.

 

Same here. Like, I often don't call state 1 'Death', but 'Knock Down' or similar...

Share this post


Link to post
Share on other sites
On 4/17/2020 at 3:29 AM, Kayzee said:

never had any issue

Maybe it has something to do with the many scripts I've added in. Something causes a problem. The one time I tried to change those skills, it crashed the game. Restoring them to original worked. So I have never tried again.

  • Like 1

Share this post


Link to post
Share on other sites

Sounds kinda fishy to me. Not that I don't believe you, it's just that sometimes it takes some real debugging and investigative work to really know what caused a crash. These kinda bugs always make me cautious because it's easy to think something fixed it only to find out later you were following a red herring the whole time.

  • Like 1

Share this post


Link to post
Share on other sites
5 hours ago, roninator2 said:

Maybe it has something to do with the many scripts I've added in. Something causes a problem. The one time I tried to change those skills, it crashed the game. Restoring them to original worked. So I have never tried again.

 

Yeah. I think this is the cause of many issues, incompatible code.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Recently Browsing   0 members

    No registered users viewing this page.

×
Top ArrowTop Arrow Highlighted