Jump to content

Trying to Get Various Mods Working for V25.


MonkeydoGames

Recommended Posts

Hello PZ Mod Community!

 

So as the title suggests, I am trying to get a whole bunch of mods working with the latest build as some things have changed which stop other things working!

 

I have already done quite a bit of work on this, looking at the code, breaking the code, pressing ctrl+Z, breaking it again, pressing ctrl+Z, making something actually work (Hooray!), etc, etc.

 

Now I don't know how to code lua, my basic technique is just copy, paste, and fiddle....

 

You would be amazed! at the results that can be achieved with Copy, Paste and Fiddle.

 

Anyway....

 

Below are a number of stack trace errors, that all seem to be pointing to the same basic issue.

STARTfunction: boxTrap.lua -- file: boxTrap.lua line # 9attempted index: derive of non-table: null-----------------------------------------STACK TRACECodeBoxTrap = Trap:derive("BoxTrap");function: RainCollectorBarrelOver.lua -- file: RainCollectorBarrelOver.lua line # 8attempted index: derive of non-table: null-----------------------------------------CodeRainCollectorBarrel = ISBuildingObject:derive("RainCollectorBarrel");function: ratTrap.lua -- file: ratTrap.lua line # 9attempted index: derive of non-table: null-----------------------------------------CodeRatTrap = Trap:derive("RatTrap");function: tag.lua -- file: tag.lua line # 6attempted index: derive of non-table: null-----------------------------------------CodeTag = ISBuildingObject:derive("Tag");function: trap.lua -- file: trap.lua line # 7attempted index: derive of non-table: null-----------------------------------------CodeTrap = ISBuildingObject:derive("Trap");function: Override.lua -- file: Override.lua line # 332attempted index: tent of non-table: null-----------------------------------------CodecampingText.sleepInTent = Sleeping_Text.tent;END

Because the line of code in question is so similar between each of these (at least to my poor untrained eye)

 

My theory is that something has changed in the lastest version/s that has changed the way these functions should be written...

 

So my question is what has changed in the lastest version/s that has changed the way these functions should be written?

 

Thanks for any enlightenment that can be shed!
 

P.S. I tried to use spoiler and code tags, but didn't work, and since it is only 1 line of code per time I couldn't be bother to go back and use the code tag button....Also Paragraph spacing seems to be going funny, at least in Preview..

Link to comment
Share on other sites

Well unfortunately there is no easy solution here other than delving into the code and looking at what exactly is wrong - which won't be easy if you have no experience with coding.

 

Could be something as trivial as moved / changed file paths to something as bad as completely rewritten source code.

 

Looking at the stack traces I'd say it has something to do with missing files.

Link to comment
Share on other sites

So another problem, which is just confusing  me...

 

se.krka.kahlua.vm.KahluaException: CraftableWeapons.lua:10: ')' expected near `item`

 

Code

function Club_OnCreate (result, result item, recipe)

 

That is the line it is referring too, I can post more of the code if that would help.

 

I can guess it is a syntax error I am just not sure what is wrong where...

 

Unless it is that that result item should just be item?

 

EDIT:

Amazingly that does seem to have been the issue...

 

Although it generated our old friend error.

 

function: CraftableWeapons.lua -- file: CraftableWeapons.lua line # 35
attempted index: Add of non-table: null-----------------------------------------

 

Code

Event.OnPlayerUpdate.Add(Club_Setup);

Link to comment
Share on other sites

Not really. It could be resultItem then.


Seriously though ... changing code when not knowing what the changes do will lead to troubles later on ^^

 

Just because an error doesn't show up anymore doesn't necessarily mean it is fixed :)

Link to comment
Share on other sites

function Club_OnCreate (result, item, recipe)	getSpecificPlayer(0):Say("Hasta la vista zombie!");	player = getSpecificPlayerPlayer(0);	carpentrylevel = player:getPerkLevel(Perks.Carpentry);	if carpentrylevel == 0 then		getSpecificPlayer(0):getInventory():AddItem(item);	end	if carpentrylevel == 1 then		getSpecificPlayer(0):getInventory():AddItem(item);	end	if carpentrylevel == 2 then		getSpecificPlayer(0):getInventory():AddItem(item);	end	if carpentrylevel == 3 then		getSpecificPlayer(0):getInventory():AddItem(item);	end	if carpentrylevel == 4 then		getSpecificPlayer(0):getInventory():AddItem(item);	end	if carpentrylevel == 5 then		getSpecificPlayer(0):getInventory():AddItem(item);	endend

Just for context that is the whole function.

 

My feeling is that it is supposed to just be item, because of the AddItem(item)...

 

Looking at that would you disagree?

 

To me it just seems like he accidentally wrote result twice...

well 99% of what I have done so far seems to have resulted in the mod component working.

 

So seems to at least be worth the try...

 

If I come to the point where something seems to be fixed but is still broken, then I can just remove that mod.

 

But just saying 'might not work' is reason enough not to try is no fun at all.

 

You would be amazed at the things I have achieved without knowing a damn thing! :D

Link to comment
Share on other sites

I stumbled upon this by accident.
I too am trying to make a Build 23 mod work with Build 25.
The mod is "Drip Irrigation" by Kyun.
 
I'm getting the exact same error log:
"attempted index: derive of non-table: null"
 
The code throwing the error is:
"RainCollectorBarrel = ISBuildingObject:derive("RainCollectorBarrel");"
 
The code resides in the file:
"...\waterPipes\media\lua\client\BuildingObjects\RainCollectorBarrelOver.lua"
 
I'm wondering what on earth could be the problem.
OP, if you do find out, kindly update us yeah?

 

 

EDIT:

I think I managed to figure it out.

It was so simple, I feel embarrassed for posting before even trying to solve it properly.

Turns out, the mod folder "BuildingObjects" must reside in "server" - not "client".

This was easy enough to confirm, because the corresponding "BuildingObjects" folder in the game install is located in "server" - not "client".

 

So now I don't see the error in the stack trace log anymore.

I'll report back when I actually do some exploring and find the Garden Hose loot.

Link to comment
Share on other sites

yeah, I got this far with it too, I tested the pipe against a tap and it did not seem to work, I need to mod the recipe for water collectors, so I can build one and test it against that to see if I get any thing.

 

I had a patch of dirt that said it was 9hours since watered with a pipe that I think was attached to a tap, so I assume that means it did not work.

 

Also the drip irrigation mod supports necroforge, so if you add that mod you won't have to search for garden hose.

Link to comment
Share on other sites

So I was looking at this bit of code which is giving a null error

 

Old.ISModalDialog = {};
Old.ISModalDialog.new = ISModalDialog.new;

function ISModalDialog:new

 

I am wondering if one of these punctuations is wrong. the function has a ':' Old has 2 '.'

 

should the function have a full stop instead?

 

the other functions in this document use full stop, but the construction of this bit of code is slightly different anyway, so it is not a straight like for like comparison for me to be sure...

 

EDIT:

 

Nope twas a herring of Red

Link to comment
Share on other sites

Seriously you should look into learning lua. It will make your life much easier and it is quite easy to learn (yet hard to master) :)


Also you are basically already 'modding' so the next natural step would be to learn more about the syntax and trying to understand what the code does you are looking at.

Link to comment
Share on other sites

Yeah, my problem is I am ill, and do not have the energy (for want of a better word) to learn code languages from the ground up... and then learn to apply it to a game specific environment.

 

I can only learn in small amounts by looking at the patterns of code and watching how they connect to each other and seeing how the different bits fit together by looking at collections of similar examples from other people.

 

Then simply copying and modifying the bits that allow me to expand the created feature, with some extra examples, or bits from other places.

 

Anything that looks different or odd or out of place compared to other similar examples, I ask if it should be like that, and I learn another little rule one way or the other.

 

If I don't get an answer, I bash it and see if anything changes!

 

I started with CivilizationIV (Which birthed the Fallout: Tame The Waste Mod), recently started on Colonization, then even more recently wanted to see if I could get all the mods I liked for PZ working together on the latest build.

 

and once again in the spirit of learning, should a conf file have more than this:

 

trappingTraps = {'RatTrap', 'BoxTrap'};

 

to work?

 

The other two conf files I have have a lot more content, as well as the farming_vegetableconf file.

 

At first I hoped relocating the conf files to the server folder, to match farmings location would work, but the error persisted. So I wondered if perhaps a more recent build required something more for this reference to become 'visible' to the game...

Link to comment
Share on other sites

I stumbled upon this by accident.

I too am trying to make a Build 23 mod work with Build 25.

The mod is "Drip Irrigation" by Kyun.

[...]

So now I don't see the error in the stack trace log anymore.

I'll report back when I actually do some exploring and find the Garden Hose loot.

 

Hello there,

as I (may) have said, I don't have much free time nowadays so it took some time. Good news is it's almost finished and ready to upload (build26+) - worst case by next week-end. A lot has changed and the rain barrel code as well as the takeWaterAction stuff have to be redone.

 

I have a few issues with the object:setWaterAmount stuff working with integers only but I'll find a way. fertilizing, pouring & taking water works alright, as well as plants watering. I think it's pretty much ready for the MP part too (client commands sent to the server, etc) but I'll have to test this next week-end.

 

 

and once again in the spirit of learning, should a conf file have more than this:

 

trappingTraps = {'RatTrap', 'BoxTrap'};

 

to work?

 

The other two conf files I have have a lot more content, as well as the farming_vegetableconf file.

 

At first I hoped relocating the conf files to the server folder, to match farmings location would work, but the error persisted. So I wondered if perhaps a more recent build required something more for this reference to become 'visible' to the game...

 

Hehe I updated this mod for build 23, now it's really outdated. Those 'config files' are just regular files hosting constants. It's okay to have one small table in it. If I remember, there are 2 other files for each trap.

Link to comment
Share on other sites

That is cool to hear kyun, from the moment I saw your irrigation mod, it was one of my favourites as it has a nice balance of crafting, building and managing, without too much fiddley faff of the current 'by hand' watering system. So well done on a great mod!

 

Yeah I am thinking about abandoning trapping mod, as when I looked in the new v26 files I saw they have put in a load of trapping items (more or less what I see in trapping mod) so I figure base game trapping is not too far away now.

 

I really liked the trapping mod though, and it was one of the ones that keeps mocking me :D

 

That and the spray paint mod :D

Link to comment
Share on other sites

 

...

 

Hello there,

as I (may) have said, I don't have much free time nowadays so it took some time. Good news is it's almost finished and ready to upload (build26+) - worst case by next week-end. A lot has changed and the rain barrel code as well as the takeWaterAction stuff have to be redone.

 

I have a few issues with the object:setWaterAmount stuff working with integers only but I'll find a way. fertilizing, pouring & taking water works alright, as well as plants watering. I think it's pretty much ready for the MP part too (client commands sent to the server, etc) but I'll have to test this next week-end.

 

 

 

I totally missed this post, Kyun.

 

Glad to know you're working on it.

I'm looking forward to it working for IWBUMS Build 26 and onwards.

 

Will you be updating it at pz-mods.net as well?

Link to comment
Share on other sites

Glad to know you're working on it.

I'm looking forward to it working for IWBUMS Build 26 and onwards.

 

Will you be updating it at pz-mods.net as well?

 

Sure.

 

It's taking a little longer but it works also in multiplayer :)

Link to comment
Share on other sites

So I recently ( a day or 2 ago I think) started getting this (see the bottom of this post) error message when loading craft helper (which was working wonderfully before this)

I think I remember reading about this:

Caused by: java.lang.StackOverflowError

in the B26 thread, that someone was encountering this error when loading there server.

 

I am just trying to work out what might be the cause of this error suddenly occuring in what was up till now something that was working fine....

 

My current theories are:

The new 'Cooking' code for recipes is clashing with the CH way of viewing displaying recipes and is thus going haywire

 

I recently added to new mods at about the same time craft helper went wrong. The fire extinguisher mod, and the new Building 0.2 mod.

 

I will eventually try to remove these new mod components and see if that fixes it, but I don't see what they would have introduced that others have not.

 

I just wanted to see if anyone could shed light on this kind of error.

 

this is the line referenced in the error:

                -- Create an instance of the item.
                local item = InventoryItemFactory.CreateItem(allRecipes:get(i):getModule():getName() .. "." .. itemString);

 

 

STACK TRACE
-----------------------------------------
Callframe at: se.krka.kahlua.integration.expose.MultiLuaJavaInvoker@e53e42c1
function: loadDatas -- file: crafthelper.lua line # 47
java.lang.reflect.InvocationTargetException
    at sun.reflect.GeneratedMethodAccessor17.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:606)
    at se.krka.kahlua.integration.expose.caller.MethodCaller.call(MethodCaller.java:61)
    at se.krka.kahlua.integration.expose.LuaJavaInvoker.call(LuaJavaInvoker.java:199)
    at se.krka.kahlua.integration.expose.MultiLuaJavaInvoker.call(MultiLuaJavaInvoker.java:55)
    at se.krka.kahlua.vm.KahluaThread.callJava(KahluaThread.java:180)
    at se.krka.kahlua.vm.KahluaThread.luaMainloop(KahluaThread.java:980)
    at se.krka.kahlua.vm.KahluaThread.call(KahluaThread.java:161)
    at se.krka.kahlua.vm.KahluaThread.pcall(KahluaThread.java:1720)
    at se.krka.kahlua.vm.KahluaThread.pcallvoid(KahluaThread.java:1665)
    at se.krka.kahlua.integration.LuaCaller.pcallvoid(LuaCaller.java:53)
    at se.krka.kahlua.integration.LuaCaller.protectedCallVoid(LuaCaller.java:81)
    at zombie.Lua.Event.trigger(Event.java:37)
    at zombie.Lua.LuaEventManager.triggerEvent(LuaEventManager.java:63)
    at zombie.GameWindow.run(GameWindow.java:1128)
    at zombie.GameWindow.maina(GameWindow.java:999)
    at zombie.gameStates.MainScreenState.main(MainScreenState.java:155)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:606)
    at com.exe4j.runtime.LauncherEngine.launch(Unknown Source)
    at com.exe4j.runtime.WinLauncher.main(Unknown Source)
Caused by: java.lang.StackOverflowError
    at zombie.scripting.objects.ScriptModule.getItem(ScriptModule.java:1158)

[this line repeats about a bagillion times!]

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...