Tsukihime InstanceItems troop event crash

CWells

Storyteller/Artist
Veteran
Joined
Apr 22, 2013
Messages
731
Reaction score
40
First Language
English
Primarily Uses
I have a small issue with the Instance items script. During a troop event, when a character is being taught what effective weapon to equip for an enemy type, the game crashes when it attempts to equip the character with the weapon.

However, if I were to equip the weapon manually as not part of an event, even though both methods depend on the same skill to equip the weapon, it works just fine. But it wont work when I try it during a troop event. In order to get around this, a player must have already thought ahead of the little hint and have the weapon equipped in combat before the event plays otherwise it crashes.

This is the exact error:

line 1303: NoMethodError occurred
undefined method 'template_id' for NilClass

Just for some checks:

I tried with the Instance items as both false and true. It still crashes.

The scripts are in the correct order.

The skill in question calls up a common event that equips the character with a weapon. It works fine outside of an event.

Here is a little more about the event in detail. Posting a screenshot of the event at the place of the crash:

35n0lrd.jpg
 

Shaz

Global Moderators
Global Mod
Joined
Mar 2, 2012
Messages
41,286
Reaction score
14,274
First Language
English
Primarily Uses
RMMV
Can you add a link to the script?


Is this happening AS you play the game, or are you just doing a battle test?


I don't think this would be the cause, but it's always possible - are you continuing a game you'd saved prior to adding the script, or does this also happen when you start a new game?
 

CWells

Storyteller/Artist
Veteran
Joined
Apr 22, 2013
Messages
731
Reaction score
40
First Language
English
Primarily Uses
Can you add a link to the script?

Is this happening AS you play the game, or are you just doing a battle test?

I don't think this would be the cause, but it's always possible - are you continuing a game you'd saved prior to adding the script, or does this also happen when you start a new game?
This is happening AS I play the game

I am not continuing a game from a save prior to adding the script. I always save and completely restart editor upon adding a script and have playtested from new game several times while this script was already installed.

Here is the script. Big one.

http://www.himeworks.com/2014/01/07/instance-items/
 

Shaz

Global Moderators
Global Mod
Joined
Mar 2, 2012
Messages
41,286
Reaction score
14,274
First Language
English
Primarily Uses
RMMV
That script only has 730 lines. If you're getting an error on 1303 then it's either a different script (actually you should have given the whole error message, which says what script it's in) or you've made significant modifications to that script or have pasted it into the same slot several times, or the same slot as other scripts.
 

Tsukihime

Veteran
Veteran
Joined
Jun 30, 2012
Messages
8,564
Reaction score
3,862
First Language
English
I tried a simple event that simple decreases a weapon, adds another weapon, and equips that weapon to an actor, but could not produce the issue.


It is hard to determine where the issue occurs with that line number.
 

Shaz

Global Moderators
Global Mod
Joined
Mar 2, 2012
Messages
41,286
Reaction score
14,274
First Language
English
Primarily Uses
RMMV
I also wonder what other scripts you're using that might be clashing. But I'm especially curious that you say the error is occuring on a line that's much greater than the number of lines taken by the script.
 

Amazoness!

Rank amateur
Member
Joined
Feb 28, 2014
Messages
15
Reaction score
0
First Language
English
Primarily Uses
So, I couldn't begin to diagnose the actual problem, but I have a likely explanation for the line number thing. Extra line breaks are being added when it's copied over, so the user's version of the script ends up having twice as many lines as the original; every even-numbered line is simply blank. I've noticed this happening with a few scripts I've been using.

So if my math is correct, the actual culprit is line 651.

(Also, I've encountered a very similar error message using the Core Equip Slots script. It seems to be triggered if a character has modified equipment slots but no starting equipment set, and crashes the game at startup. It doesn't seem to be due to conflicts with another script. Not trying to hijack the thread, but I wonder if they could be connected.)
 
Last edited by a moderator:

Tsukihime

Veteran
Veteran
Joined
Jun 30, 2012
Messages
8,564
Reaction score
3,862
First Language
English
I've gotten reports of people getting extra lines when they copy from dropbox, but I haven't been able to get that.


The issue there looks like when the game is trying to retrieve an instance of the desired item, it ends up returning nothing, which would then explain the error.


However I can't imagine why that would be happening.
 

Amazoness!

Rank amateur
Member
Joined
Feb 28, 2014
Messages
15
Reaction score
0
First Language
English
Primarily Uses
So I think I just solved my crash issue. I have no idea why this would work, but it might fix CWells's problem too.

Redownload the script and make sure it doesn't have the extra blank lines inserted. Rather than copy-pasting from the Dropbox text, hit the download button and open it in Notepad or something.

I replaced my Core Equips script with a version without the extra spaces, and the crashes just stopped. I can't say for certain that this was what fixed it, or whether it would have any bearing on CWell's issue, but it has to be worth a try.
 

Tsukihime

Veteran
Veteran
Joined
Jun 30, 2012
Messages
8,564
Reaction score
3,862
First Language
English
That's cause I updated the equip slots script when I looked at what you wrote lol
 
Last edited by a moderator:

CWells

Storyteller/Artist
Veteran
Joined
Apr 22, 2013
Messages
731
Reaction score
40
First Language
English
Primarily Uses
Sorry I was away. It is strange that your script only goes to 730. From the same link my script is reaching 1400 almost.

Hmm, I made sure there wasn't some sort of double paste. I'm going to try deleting the script then reapplying it later today.
 

Tsukihime

Veteran
Veteran
Joined
Jun 30, 2012
Messages
8,564
Reaction score
3,862
First Language
English
Try it on a new project and see if it still occurs.


I am not able to reproduce that error.


Does it occur when the item is in the inventory? Or only when it's equipped?
 
Last edited by a moderator:

CWells

Storyteller/Artist
Veteran
Joined
Apr 22, 2013
Messages
731
Reaction score
40
First Language
English
Primarily Uses
Try it on a new project and see if it still occurs.

I am not able to reproduce that error.

Does it occur when the item is in the inventory? Or only when it's equipped?
The way it works is like this:

Suit is attached to character. Weapons can only be equipped through using a skill to call up the weapon. These items disappear from inventory when unequipped. So skill calls weapon and removes weapon.

This occurs when the item is being called up to be equipped to the target. The order in the event should be:

Add 1 item then equip that item.
 

Tsukihime

Veteran
Veteran
Joined
Jun 30, 2012
Messages
8,564
Reaction score
3,862
First Language
English
I'm unable to reproduce the issue in a new project.


My troop event simply adds an item and equips it to an actor.
 

CWells

Storyteller/Artist
Veteran
Joined
Apr 22, 2013
Messages
731
Reaction score
40
First Language
English
Primarily Uses
It seems the conditions are very specific for the error to occur. I find that, going back to the pic in the first post, the line:

Change Weapos: Plasma Sword -1 Include Equipment is where the error occurs. I edited the event to have a conditional branch

so that if a player doesn't have the sword  equipped, since a player has the option of two weapons, that step gets skipped. When the event skipped that step since no weapon was equipped there was no crash. This means that the event worked, it is just that line regarding removing

equipment including equipped item... I'll try a new project to see what happens.

Was the site off for 4 days or so? This is my first time it worked for me since Saturday? No, Friday...
 

Tsukihime

Veteran
Veteran
Joined
Jun 30, 2012
Messages
8,564
Reaction score
3,862
First Language
English
It definitely doesn't occur for me in a new project with only instance items installed, nor does it occur with a couple dozen of my other scripts installed, so either I have to set up my event exactly the same as yours, or there is something else causing the problem.
 

CWells

Storyteller/Artist
Veteran
Joined
Apr 22, 2013
Messages
731
Reaction score
40
First Language
English
Primarily Uses
It definitely doesn't occur for me in a new project with only instance items installed, nor does it occur with a couple dozen of my other scripts installed, so either I have to set up my event exactly the same as yours, or there is something else causing the problem.
Okay thanks for the info. I don't know what will happen later as I try to make time for fixing this but right now I need to back off from all this for a while.
 

Latest Threads

Latest Posts

Latest Profile Posts

Next goal is to make pull & push + lift & throw systems with mouse support and have skill levels in them and action indicators!
>What's your avatar about? Is it yours?
I did not do that drawing. It's a screenshot taken from a comic featuring characters from Touhou such as Tenshi and Iku (the girl in the avatar). It's drawn by someone under the name of Yohane.
Link to the comic (SFW, but navigating around Dynasty Reader is NSFW)
Progress on my game is nearly done, so I figured I show you guys the title screen. I hope you like it!
Title Screen.png
Does this ever happen to anyone?: your making a battle sprite [or any sprite] then when you mess something up you then see it as something diff, then working with it? its hard to say in words but it happens to me all the time
found out how to change pfp, literally there's a hidden thingy on the bottom of it

Forum statistics

Threads
109,167
Messages
1,042,666
Members
141,665
Latest member
beauty143
Top