RMRK is retiring.
Registration is disabled. The site will remain online, but eventually become a read-only archive. More information.

RMRK.net has nothing to do with Blockchains, Cryptocurrency or NFTs. We have been around since the early 2000s, but there is a new group using the RMRK name that deals with those things. We have nothing to do with them.
NFTs are a scam, and if somebody is trying to persuade you to buy or invest in crypto/blockchain/NFT content, please turn them down and save your money. See this video for more information.
"Divison by Zero" error...

0 Members and 1 Guest are viewing this topic.

****
Touhou Fantasy Developer and all around cool person. :)
Rep:
Level 85
T.G. "Thunder God" Xenomic
Alright, so I've been watching my beta tester testing my rpg, and he's been getting random "Division by zero" errors after killing enemies (usually when he ends the fight from killing an enemy). Anyone know why it's giving this error?

Another issue I had is the game crashing when getting into a random encounter (I've only had that happen once though), and it giving a random game over at a point where the player could switch party members....any help on these issues would be greatly appreciated ^^;

*
Rep:
Level 85
Real Men Make Fan Games
Project of the Month winner for May 2009
You're really not giving much to work with here, so let's try to pinpoint the problem for each...

For the division by zero errors, what other events are taking place while the player is killing enemies?  Perhaps you have events that check a monster's current HP and use it as a denominator (as an example).  You'll have to spell out a lot more clearly what other events are running concurrently here.

For the game crashing on a random encounter, what's the error message? What goes into creating a random encounter?

For the "random game over", I'd be willing to bank on it occurring when there are 0 members in your party.  You'll have to avoid that in your party change system.




****
Touhou Fantasy Developer and all around cool person. :)
Rep:
Level 85
T.G. "Thunder God" Xenomic
Ok, let's break this down a bit more then...to the best of my knowledge.


For the division by zero error, there ARE no other events going on. Well, for these 2, I had a timer running in and out of battle (10 minutes to escape from place), but the first time it happened, was during a normal boss battle, no other events running at all.

The error message, I'd have to look it up on the guy's JTV.

The random game over is the weird one. When I set up the PHS system, it always gives you the main party member (fully healed at that), so it couldn't of been no party member. The second time he did it, it worked fine. It never happened to me either when I tested it before releasing the beta.

*
Rep:
Level 85
Real Men Make Fan Games
Project of the Month winner for May 2009
I think your best bet is to first try to recreate the errors, then.  The fact that your systems are working sometimes and breaking others is actually a good sign, that usually means that the fix is a misplaced variable or switch as opposed to a fundamental error in the system itself.

The division by zero error is kinda boggling my mind, to be honest.  Only thing I can think of is if the skills used by either the monster or player use division to calculate damage/priority/whatever.  In fact, if there are actually no events running concurrently with your battles, it pretty much as to be either 1) a parallel process common event you didn't see coming 2) a problem with the skills 3) a problem with items or 4) a problem with conditions.  See if you can isolate what's crashing the game and go from there.

You'll have to either post code or recreate the error for your PHS system.  RPG Maker, by default, gives you a game over message ONLY when all available party members have 0 HP OR when all party members have been removed (strangely enough, it won't give you a Game Over if you just start with zero members...).  One of those two scenarios has to be going on in your PHS.




****
Touhou Fantasy Developer and all around cool person. :)
Rep:
Level 85
T.G. "Thunder God" Xenomic
Hmm...if you can view JTV, then these are the errors. If not, then ignore the links.


For the random crash from fighting:  http://www.justin.tv/oww2/b/258385707


For that Division by Zero error: http://www.justin.tv/oww2/b/258383848


For the Divison By Zero error it seems to happen most often with skills that attack all enemies, but that doesn't make any sense as to why it would do that on that. There's nothing that's really dividing to calculate damage, so the only thing I can think of is it has to be the skills that is doing it, as the first time that it happened (in the link above), there are no parallel events going on.


I'll have to look the code over for the PHS system, though it has only happened once in the entire time that the beta's been out so...I dunno. Maybe it just wanted to be random!

*
Rep:
Level 85
Real Men Make Fan Games
Project of the Month winner for May 2009
You'll have to dig into your skills and whatnot to figure out the division by zero error.  I really don't know what to do about it.

The random crashing from random encounters is due to a registry error in that testing computer (whether it belongs to you or your BETA tester...).  Try a program such as Tune-Up Utility to clean those out.