The RPG Maker Resource Kit

RMRK RPG Maker Creation => RPG Maker General => General Scripting => Topic started by: Japhasca on February 10, 2015, 04:59:00 AM

Title: [VXA] ATS: Choice Options (by Modern Algebra) Script issue
Post by: Japhasca on February 10, 2015, 04:59:00 AM
As with my last issue (so graciously solved by the community) I posted this under the relevant script, but I'm posting here as well as its last comment was forever ago and I thought the exposure in this forum may work to my advantage.

The script in question can be found here:
http://rmrk.net/index.php?topic=47593.0

Here's my issue:

I'm using this script with the default settings (I have changed nothing in the script) and am getting this error when I call a certain common event (it seems to be working fine everywhere else I've used it):

Script 'Appended Choices' line 457: NoMethodError occurred.

undefined method `push' for nil:NilClass

The weird thing is, If I call another event that uses appended choices first, this one works fine afterwards.

This is the offending event (I have stripped out all other code and the error still occurs.)

(http://i.imgur.com/UE2HLUh.png)
Title: Re: [VXA] ATS: Choice Options (by Modern Algebra) Script issue
Post by: yuyu! on February 10, 2015, 05:08:33 PM
Are you using common events to run it?

I recreated what you have above (minus the conditional switch) with no issues. How are you able to have a conditional switch on with trigger set to "none"?! o.o That's not supposed to happen...so, perhaps that is the problem?
Title: Re: [VXA] ATS: Choice Options (by Modern Algebra) Script issue
Post by: Japhasca on February 10, 2015, 10:18:45 PM
The event is called by a key item that is not consumed upon usage.
I have another set up to give game instructions set up the same way and it seems to work fine.
Title: Re: [VXA] ATS: Choice Options (by Modern Algebra) Script issue
Post by: yuyu! on February 11, 2015, 12:53:56 AM
So, the key item is calling the common event? It might be a good idea to remove the conditional switch and test it that way. I can't even get a switch to show up with the trigger "none". The game won't allow it. o.o
Title: Re: [VXA] ATS: Choice Options (by Modern Algebra) Script issue
Post by: Japhasca on February 11, 2015, 01:52:26 AM
I thought something along the lines, but we must be doing something different because the default setting for Trigger is None (also Autorun, Parallel Process available) but Conditional Switch won't let me pick "None", only variables. However, according to the tooltip (assuming it's working correctly) the Switch is only paid attention to if the Trigger isn't set to None.
("[None] starts only when explicitly called up.")

So, (again, assuming the engine is working properly) the conditional switch is never even looked at.
I checked the working event I mentioned was done the same way and it does have the same set up, so I don't think that's it.

I hope it's not a script incompatibility, but the error states that something is undefined, and I haven't seen that one before.

EDIT: And the plot thickens. It seems it might be something saved into the game save files, as I tried a new game and had no problems, but even loading a certain save gave me the error. I'm going to try to play a new game until I can save without calling any choices, then save, load, and try again.
Title: Re: [VXA] ATS: Choice Options (by Modern Algebra) Script issue
Post by: yuyu! on February 11, 2015, 05:02:18 AM
Huh...I don't know what version of RPG Maker you're using, but that isn't supposed to happen. o.o The point of the switches is to tell the game when to start calling the common event (only if parallel processed or on autorun). Since the "none" trigger is used to manually call the event, there is no need for switches. So, VXA normally won't even let you choose a switch (the box will become grayed out) when set to none.

Spoiler for This is what it always looks like to me:
(http://i.imgur.com/o3vlZIf.png?1)

Anyways...I guess that wasn't the problem. Even if it is a little odd. :p Creating a New Game might actually permanently fix the issue, since it's very common to have scripts that freak out when you try to continue from data that may not have previously included the script (that's the only reason I can think of, at least). I don't know the details, but I've solved many of my random and indescribable script issues simply by making a New Game and deleting the old saves, so that makes sense to me.

Hopefully it'll work from now on, using the New Game you're creating. :-)
Title: Re: [VXA] ATS: Choice Options (by Modern Algebra) Script issue
Post by: Japhasca on February 11, 2015, 05:52:33 AM
Well, I do appreciate the help :)
I'm basically always using VX Ace, which I will mark with [VXA] in my topics.
I'm going to go ahead and start a new game and test it...I'll definitely post if it doesn't work, though!