Jailbust Module not working

General Chat, Comments
Post Reply
njfrlng
Posts: 53
Joined: Tue Feb 04, 2014 9:51 pm

Jailbust Module not working

Post by njfrlng »

Just bought this module: http://nw-engine.com/index.php?c=modules&m=169

After I install it, I get the following error:


Error: Cannot redeclare IsInJail() (previously declared in C:\xampp\htdocs\monsters\modules\jail\lib.php:3)
Error in "C:/xampp/htdocs/monsters/modules/jailbust/lib.php"
Line 17



Line 17 is just a }

Any advice? I paid for this module, so assumed it worked! :S
njfrlng
Posts: 53
Joined: Tue Feb 04, 2014 9:51 pm

Re: Jailbust Module not working

Post by njfrlng »

Just re read the module and realized its an entirely new module for jail.

So i disabled the old jail module and now it works!!

That being said, theres lots of problems with this mod.

When you go to bail someone out you get an error:

Error: Call to undefined function FindUserName()
Error in C:/xampp/htdocs/monsters/modules/jailbust/content.php
Line 154
SophieEV
Posts: 22
Joined: Sat Aug 02, 2014 1:06 pm

Re: Jailbust Module not working

Post by SophieEV »

Apologies, that FindUserName function is used alot and is missing from the module as for some reason i added it to my common library as its used elsewhere in my game.

I have submitted an update to the market place for this, hopefully it will be available for you shortly :)

If its not or if you have any other problems let me know x
User avatar
KyleMassacre
Posts: 573
Joined: Wed Nov 27, 2013 12:42 pm

Re: Jailbust Module not working

Post by KyleMassacre »

You should generally NEVER add anything to core files especially if you plan on releasing a module to the public*. If you have a function that you would like your module to use then you can create a lib.php file and add that to the modules folder. And if you do that then other modules can piggy back off that function as well.

Also a tip for a paid module which I believe this one in question is:
If you use that function in other modules you can use

Code: Select all

if(function_exists("function_name")) {
//Execute here;
}
This way people wont get an undefined function error when using a module that uses that function

Also take a LOOK here, it needs some updating but this has the most common stuff for module developers.

* Not entirely true if its for your own game, just for potential modules to release to other people. Still not the best idea though since Alain can update the core files for an engine update then it gets erased
SophieEV
Posts: 22
Joined: Sat Aug 02, 2014 1:06 pm

Re: Jailbust Module not working

Post by SophieEV »

Thanks for the tips,

When i wrote the module i didn't intend it to be public because ive never used php before, never done any game development, and didnt know the engine quite how i do now, but i spent significant time on it, and it seemed decent to me, so i did.

I know i had bad habits while i was working it all out so i went back through all my code before releasing to clean it all up and added in the checks for custom functions as you suggest, ive just missed this one as it sounds similar to one of the core functions.

I think my main problem is that at the time i didnt have a clean nw enviroment to install and test this on (which i do now), i just had my game which it obviously worked just brilliantly in.

You live and learn, apologies for the trouble caused
User avatar
KyleMassacre
Posts: 573
Joined: Wed Nov 27, 2013 12:42 pm

Re: Jailbust Module not working

Post by KyleMassacre »

And now you know, and knowing is half the battle. *queue cheesy 80s chime music*
User avatar
a_bertrand
Posts: 1537
Joined: Mon Feb 25, 2013 1:46 pm

Re: Jailbust Module not working

Post by a_bertrand »

Accepted the new release of it.
Creator of Dot World Maker
Mad programmer and annoying composer
VashNaroom
Posts: 14
Joined: Wed May 28, 2014 5:29 pm

Re: Jailbust Module not working

Post by VashNaroom »

Excellent mod, Very versatile for any game theme. Cannot wait to see what future mods Sophie cooks up.
User avatar
cbsarge
Posts: 195
Joined: Mon Sep 14, 2015 3:20 pm

Re: Jailbust Module not working

Post by cbsarge »

I just purchased and added it. I got an error:

Code: Select all

Error: Cannot redeclare IsInJail() (previously declared in /hermes/bosnaweb03a/b2751/ipg.cbsargecom/VillainsandHeroes/modules/jail/lib.php:3)
Error in "/hermes/bosnaweb03a/b2751/ipg.cbsargecom/VillainsandHeroes/modules/jailbust/lib.php"
Line 17
Was I supposed to disable the regular jail module first? I had to go into the rgular jail mod, comment out it's code, upload it so I could get the game back up and then disable the standard jail module. Would have been nice to know if I was supposed to disable it first. :roll:
User avatar
cbsarge
Posts: 195
Joined: Mon Sep 14, 2015 3:20 pm

Re: Jailbust Module not working

Post by cbsarge »

Also, When I tried to use the Bust option I got an error saying undeclared index of Energy....

I'm REALLY getting bummed that the add-on modules I purchase because I think are going to improve the game keep breaking it! :evil:
Post Reply

Return to “General”