I am frustrated to the point of tears now. I'm trying to install a sideview battle script (Minkoff's Animated Battlers Enhanced to be precise), and every time I add it above the main line in the script editor, my game runs fine up until I try to trigger a battle, I get an error message like:
"Script 'Animated Gradient Bars' line 159: NoMethodError ocurred.
undefined method 'viewport2' for nil:NilClass"
I haven't touched the script, I just copy and pasted it into my script editor, so I have no idea why it's giving me an error.
Even more frustratingly, the script works just fine in a blank new project, so I tried rebuilding my game from a new file too, but nope, after I've got all my maps and events and actor and everything set up, the same error happens again. Even if I take out the Animated Gradient Bars code and try again, I get the same error but with a different page of the script.
This has happened with other scripts too -- namely Law's Custom Save script. I have no idea what it is about this project that's giving me so many errors when I mess with the scripting, but it's killing me. I'm so very close to finishing this, but I absolutely need a sideview battle system, and I just can't get it to work. Is there anyone out there who can tell me how I can fix these errors, or maybe look at it to see what the issue is?
I've uploaded my demo so far here if you want to take a look at the error for me (select save file 2 and go through the door in front of you to trigger the error. Also please ignore the clearly unfinished sprite, I haven't finished making the character yet, as you can see by the way it flashes between two characters).
Thank you from the bottom of my heart if you can help me out here. I only started teaching myself RPG Maker stuff a few days ago and while I've made great progress in my understanding, resolving script errors is so out of my league right now, and I haven't been able to find any resources on the matter.
Script Errors with Sideview Battle/Custom Save Scripts
● ARCHIVED · READ-ONLY
-
-
Are you always loading a save file? Have you tried starting a new game after adding the script? Many scripts NEED you to start a new game, because they initialize stuff at the time a game is started.
-
I actually hadn't been -- that's a really good point though, I'll be sure to do that every time I test out a new game! Unfortunately, starting a new game didn't fix this added script, I just gave it a quick test... but thank you so much for the advice!Are you always loading a save file? Have you tried starting a new game after adding the script? Many scripts NEED you to start a new game, because they initialize stuff at the time a game is started.
-
Where did you put your script in the list? Is it below Materials? Do you have other scripts with it?
Wait a minute ... are you using XP? Is the script made for the same version of the engine that you're using? You can't put an XP script in Ace. -
I am using XP, not Ace, and the script I'm using is indeed made for XP! Sorry, I should have specified that, ack. I inserted the script above the Scene_XXXes and Main. I also have a custom windowskin script directly above Main, but I don't think that's causing any of the errors. I've also tried inserting the scripts directly above Main and that doesn't solve the issue. I don't have a Materials section on my list -- I think that might only be in VX? I'm kind of wishing I'd gotten VX instead of XP now since it seems like everyone's using VX these days and there's not as much familiarity with XP...
-
It goes below all the Scene_xxxes. Custom scripts in all the engines go just above Main.
I know you said you did, but just check again that ALL of your custom scripts are immediately above Main and there are none above any of the other default scripts.
There are still enough people around who either use, or are familiar with, XP, to help you sort things out :) -
Thanks so much Shaz, I really hope you all are able to help me sort this out! Here's what my script editor looks like now: all the default untouched script pages (I even compared them to a new blank project just to make sure nothing custom sneaked its way in there and everything was in the right order), then beneath the last of the default pages, just above Main, I inserted the custom script pages for the sideview battle system. Just to be safe, I took out my only other custom script, which was a script to use multiple windowskins (the game runs like normal without it). Then I started a new game, and once again, when I try and trigger a battle, I get the same error message.
Do you think the issue could be with the event I'm using to trigger the battle? It's a parallel process event that starts when I walk into a room, and the code for that is just:
Script: $game_system.battle_start_flag = 0
Battle Processing: Ghost*2
: If Win
@>
: If Escape
@>
: If Lose
@>
: Branch End
(I've also tested it without the script line in and it still doesn't work with or without it)
-
I'll see if I can take a look at your demo on the weekend.
edit: Apparently I can't send myself a PM. Can YOU send me a PM, with a link to this thread? Otherwise, I know I'll forget. -
Thanks so much, I would love that! Just sent you a PM -- don't feel obligated to check it out if you don't have time, but if you do, that would be so greatly appreciated!
-
Can you do me another demo that actually HAS battles in it? I don't want to have to set ANYTHING up myself, as I might not do it the same way you've done it.
Also, giving scripts the same name would be helpful too - the demo you've given me doesn't have a Animated Gradient Bars script (at least not called that).
Are you sure all the scripts you're using are for XP? The one of CCOA's says VX. That would be a problem, as you can't use VX scripts in XP. -
There should already be a battle set up in the examination room -- unless there's a different way I should be setting it up? The battle should be triggered when you walk through the door in save two.
And I forgot to mention -- I had had all the scripts set up and named the same (including the animated gradient bars script) but yesterday I tried downloading a different configuration of the script that didn't have that and all the other extra scripts in it. Running this one still gives me an error though, albeit a different one:
NoMethodError occurred while running script
undefined method 'battle_start_flag=' for#<Game_System:0x36b69d0>
But I can definitely scrap that and just put the original script in all its entirety if you like -- I'm on mobile on my way to work right now so I'd have to do it later tonight, though.
And I'm 99% positive all the scripts are for XP -- I think the one that said vx in it also had RGSS/XP written on top of it? I know there's several versions of xp side view battle systems so I could try another one -
Well, I need a game I can play and have the battle trigger without me having to run around all over the place and guess at what might cause it to happen, or look at all the events to see which one triggers a battle. I also need the scripts to reflect the errors you're getting - if you post the error and then go and change the scripts around, it makes it much harder for me to duplicate and figure out.
So yeah, if you can fix it all up so what I see in the demo reflects what you've reported on this page, that'll make it much easier.
I didn't see any mention of XP/RGSS in CCOA's script that said VX. It DID say something else but I didn't really understand it.
As long as you can get me a version I can play and have a battle straight away (with some instruction on what I need to do to trigger it), that will crash, it'll be good. -
I guess I just don't understand why it's so hard to open up a save file, walk one step forward through a door, and have the battle event play automatically/crash. The examination room map is small and the event's directly in the center of the room if you needed to look at it, it's the only one with a graphic. But I'll get rid of the events at the beginning of the game so you can just start a new game and walk up to an event and press a button to trigger a battle, if that's easier. But that's not an entirely faithful duplication of what's happening to me when it crashes -- I thought it would be easier just to be like here, use this save file right before the battle event that crashes it. And I'll switch back to the original configuration, give me fifteen to get that set up again...
-
Alrighty, here's the original demo I uploaded in the first post, edited so that you can just start a new game, turn left and talk to the sprite to start the battle: http://www.mediafire.com/download/zbewz5ysanojqux/Demo.rar
-
jabberwockyx, please avoid double posting, as it is against the forum rules. You can review our forum rules here. Thank you.
It's "so hard" because you didn't TELL me that's what I had to do. There are FOUR save files in the project you gave me (at least) and you didn't say which one to use, or if I needed to start a new game. I also didn't know what map any of the save files were saved on. In the editor, there are two maps that look exactly the same. One of them turned on a battle switch, but I didn't see where the battle was actually called. And I didn't see where the event was triggered, as it was conditioned by switches.
If I'm going to help you find and fix the bug, YOU need to make it as easy as possible for ME to reproduce the bug. Giving me multiple maps, multiple save files, and not explaining step by step what I need to do to cause the error very quickly, is just making it more tedious for me. I don't want to play your game - I just want to make that particular bug happen so I know where to start looking in scripts. :)
What you've done above is MUCH easier to understand, and with that information I should be able to reproduce the bug in no time, and get right to fixing it ;)
Until I download it and see that you've given me TWO projects. Am I looking at Demo or at KH SH2? -
I apologize, I thought I was clear enough in telling you what to do to trigger the battle... Post #11: "There should already be a battle set up in the examination room -- unless there's a different way I should be setting it up? The battle should be triggered when you walk through the door in save two."
I really didn't think there was any other way to explain it -- I did everything I could to make it easy for you, I told you where the battle was, that it would be automatically triggered upon walking into the room, and that all you needed to do was open up save two and walk through the door. I'm sorry if something got lost in translation there, and if there's anything I could do in the future to be more clear, please let me know. I didn't want to risk messing anything up by deleting maps or anything, so I thought it was easiest just to tell you that there was a save right before the battle.
But wait, what, I shouldn't have given you two projects -- oh, jesus, just opened up the rar, i don't know how both those folders got in there, ugh. That's what I get for trying to do things late at night. KHSH2 was the one from two nights ago, somehow the one that I remade for you got bundled into that same rar. Iiiiiii should have cleaned off my desktop first. ANYWAY YES, the one you should be looking at is---------
Uh. I was just testing the game file named Demo to make sure it was the right one and I got a different error that I was able to fix (I hadn't copied over my gradients folder to this folder -- I'm too disorganized for this, good lord) and then I was able to start the battle?? I have no idea what happened, somehow when I was reconstructing this to give to you, I managed to fix whatever the bug was? The only problem now is that the graphics are horribly messed up, but I thiiiiink that I can fix that, hopefully. If not, then, well, I might have to enlist someone's help again.
I guess I'll have to copy everything from this demo file to my main version of the file and see if I can get that magic combination of whatever it was I did right this one time... hopefully this'll be the end of that and I won't run into whatever I bugged up my first few times trying to get this script working. But that'll have to be later because it's 4 in the morning and I desperately need sleep. But I would really like to say that I'm sorry for being basically the worst person to work with, I promise I'm not this stupid about most stuff, there's just something about dealing with scripts and too many files and folders that turns me into a blithering idiot. You've really been so helpful and patient with me, and thank you from the bottom of my heart for that! -
lol :) I'll leave it with you for a while. Sleep. Wake up. Play.
If/when the error happens again, delete the rar and recreate it, then load it up, then give me the new error message and new instructions.
We'll get there ;)