[RMVX] CAN'T DUP NILCLASS

Posts

Pages: 1
I have an error occuring whenever an enemy uses a skill. I use Tankentai for my battlesystem and what I have noted, is that the error appears right before the damage calculation/ pop up damage (Number Images)/ *target being killed
* meaning that it might or might not have something to do with it, since it always seems like it's getting triggered when someone is about to die.

This is the error:


This is where the error leads me to:


I tried asking good ol' google, but my brain couldn't comprehend some of these answers.

Here's the script in full 2 Parts:
https://pastebin.com/WssZiKEU
https://pastebin.com/Qy5wnrkm

The Error leads me to the first Part
You're missing part of the script. The N01 is a reference to a module that isn't defined in your two scripts so when it tries to access it there's nothing there so it becomes a nil reference which you can't do much with. Check where you got your script and see if you're missing something, else find another source.
I'm definitely missing nothing, I might have added something myself that I wasn't aware of.

I'm gonna post the rest of the scripts, it might help:
General Settings for the script: https://pastebin.com/vrqMa4S7
Action Sequence Configuration (Might be here): https://pastebin.com/xrxevw87

At around 1258 are the skills I set for the basic spells. (The error is coming from the basic spells) At 100 there are poses and around 204 the Movement. The error occurs (what seems to me) randomly, but of course it isn't. Most of the time the enemy is using it just fine, it only happens occasionally during a fight and it's always when the Battler uses the skill. So my hunch would be that it has something to do with the Actors Action sequences whenever they take damage/die/move.

I never really created another module or whatever, because I'm too dumb to script.

I don't know if it also could be because I just simply put another script above this one or what.
In that case the N01::Action hash doesn't have an entry for the battler's action. The action sequence configuration has the N01::Action defined. If whatever the action is isn't in the hash it won't find it, return a nil instance and cause the nil can't be duped. It sounds like a pain to debug though, I'd try adding this line around line 334, when the crash is about to occur:

if N01::ACTION.has_key? battler
  print "Could not find action #{action} for battler #{battler.name}\n"
else
  # The code from line 334 to 339 would go in here, so @action.delete("End"), the act = N01::Actino[action].dup, for i in 0...act.size, etc.
  # up to and including the @action.push("End") block but not the @anime_end = true line
end

# Line 340, the anime_end = true line goes here
This way if it can't find the battler action it'll report what action it can't find and the battler trying to execute it in a message and not execute the code that's going to crash it (unless a later line crashes it too). At least it should give an idea of what battler / action is causing the problem.


(I should've known the script wasn't missing, if it was the error would've been on the array reference instead of the dup!)
Ok, I tried putting it in, but the same error occurs, but thanks to that, I might know what causes it. I tried like another 20 test fights and it seemed to me that the error occurs whenever I do a step forward or my actors are moving while the damage pop up/calculation tries to show up. I don't know if it is the pose or the movement itself, but it might be one of them.
What that has anything to do with the damage pop up/calculation, I have no idea.

Edit: I THINK I might've fixed it. At line 1072 I put _ instead of -. I don't know if that just straight up needs to be like this or what... but the error doesn't pop up anymore. Though I'm still kinda sceptical that that was actually it, because these two sequences don't really have anything to do with stepping forward. :|

Edit2: I meant the "WAIT_CRITICAL" one. I think somewhere it defined it like this and it needed to have the - instead of _. I remember trying to create a new Standby Action, when I accidentally removed the "WAIT-CRITICAL" action.
I need to make sure that that's it and go with low health in battle.

Edit3: I tried going into the Battle with low health and yup, just as I thought:

Now, I guess I fixed it???????? I don't know, because that's like two different errors.
Pages: 1