Jump to content

Java errors 4 lyf


Interknet

Recommended Posts

Aight, making a mod but I can't seem to get it working at all. Looks all fine and such, but nothing else is happening beyond loading the game :(

 

Can someone diagnose these stupid ass java errors? Really bumming me out and I'd love to have made a mod for this game :(

 

- If you're too lazy, I uploaded the rar file with all this in here: http://www.mediafire.com/?m55c0wbhyz1cack

 

Heres my code:

 

mods/SleepinBag/media/lua/

SMBDistribution.lua

require 'Items/SuburbsDistributions'table.insert(SuburbsDistributions["medclinic"]["counter"].items, "SleepingBagMod.SewingNeedle");table.insert(SuburbsDistributions["medclinic"]["counter"].items, 1);table.insert(SuburbsDistributions["medclinic"]["counter"].items, "SleepingBagMod.BallOfWool");table.insert(SuburbsDistributions["medclinic"]["counter"].items, 1);

 

SBMStart.lua

require 'luautils'SBMStart = {};gameTime = {};SBMStart.player = {};SBMStart.playerData = {};SBMStart.bags = {};SBMStart.forcedSleep = false;SBMStart.addBag = function(grid)	local id = #SBMStart.Bag + 1;	local newBag = {};	if grid then		grid:AddTileObject(IsoObject.new(grid, "TileSleepingBag", "Bag"));		newBag.gridSquare = grid;		newBag.x = grid:getX();		newBag.y = grid:getY();		newBag.z = grid:getZ();		newBag.addTile = "false";	else		newBag.addTile = "true";	end	newBag.id = id;	table.insert(SBMStart.Bags, id, newBag);	SBMStart.saveData(nil, newBag);	return newBag;endSBMStart.removeBag = function(bag)	local bagNew = {};	for iN,vN in pairs(SBMStart.bag) do		if(iN ~= bag.id) then			bagNew[iN] = vN;		end	end	SBMStart.bag = bagNew;	SBMStart.removeTileFromGrid(bag.gridSquare);	SBMStart.playerData["bag:" .. bag.id .. ":x"] = -1;	SBMStart.player:getInventory():AddItem("SBMStart.SleepingBag");endSBMStart.sleep = function()	SBMStart.player:setAsleep(true);	SBMStart.forcedSleep = true;end 

 

SBMText.lua

SBMText = {};SBMText.addBag = getText("ContextMenu_Place_sleeping_bag");SBMText.removeBag = getText("ContextMenu_Take_sleeping_bag");SBMText.sleepInBag = getText("ContextMenu_Sleep"); 

 

SleepingBagMod.lua

SleepingBagMod = {};SleepingBagMod.gameHasStarted = false;SleepingBagMod.onGameBoot = function()	getTexture("Item_SleepingBag.png");	getTexture("Item_BallOfWool.png");	getTexture("Item_SewingNeedle.png");endSleepingBagMod.onGameStart = function()	SBMStart.OnGameStart();endEvents.OnGameStart.Add(SleepingBagMod.onGameStart);Events.OnGameBoot.Add(SleepingBagMod.onGameBoot); 

 

mods/SleepinBag/media/scripts/

SleepingBag.txt

/** ================================= **//**   Sleeping Bag Mod by Interknet   **//** ================================= **/module SleepingBagMod{	imports	{		Base, camping	}  	item SleepingBag	{		Type				=		Normal,		DisplayName			=	 	Sleeping Bag,		Icon				=		SleepingBag.png,		Weight				=		3.0,			}  			item BallOfWool	{		Type				=		Normal,		DisplayName			=	 	Ball of Wool,		Icon				=		BallOfWool.png,		Weight				=		0.4,			}  		item SewingNeedle	{		Type				=		Normal,		DisplayName			=	 	Sewing Needle,		Icon				=		SewingNeedle.png,		Weight				=		0.0,			}	recipe Craft Sleeping Bag	{		Pillow,		Sheet=2,		SewingNeedle,		BallOfWool,				   Result:SleepingBag,	   Time:60.0,	}} 
Link to comment
Share on other sites

Loading: mods/SleepinBag/media/lua/SBMDistribution.luaSep 11, 2013 11:34:05 PM zombie.Lua.LuaManager RunLuaSEVERE: nullSep 11, 2013 11:34:05 PM zombie.Lua.LuaManager RunLuaSEVERE: nulljava.lang.ArrayIndexOutOfBoundsException: 65022        at org.luaj.kahluafork.compiler.LexState.token2str(LexState.java:253)        at org.luaj.kahluafork.compiler.LexState.txtToken(LexState.java:268)        at org.luaj.kahluafork.compiler.LexState.lexerror(LexState.java:276)        at org.luaj.kahluafork.compiler.LexState.syntaxerror(LexState.java:291)        at org.luaj.kahluafork.compiler.LexState.prefixexp(LexState.java:1123)        at org.luaj.kahluafork.compiler.LexState.primaryexp(LexState.java:1136)        at org.luaj.kahluafork.compiler.LexState.exprstat(LexState.java:1697)        at org.luaj.kahluafork.compiler.LexState.statement(LexState.java:1785)        at org.luaj.kahluafork.compiler.LexState.chunk(LexState.java:1796)        at org.luaj.kahluafork.compiler.LexState.compile(LexState.java:200)        at se.krka.kahlua.luaj.compiler.LuaCompiler.loadis(LuaCompiler.java:132)        at se.krka.kahlua.luaj.compiler.LuaCompiler.loadis(LuaCompiler.java:124)        at zombie.Lua.LuaManager.RunLua(LuaManager.java:1963)        at zombie.Lua.LuaManager.RunLua(LuaManager.java:1939)        at zombie.Lua.LuaManager.LoadDirBase(LuaManager.java:455)        at zombie.GameWindow.init(GameWindow.java:1405)        at zombie.GameWindow.maina(GameWindow.java:889)        at zombie.gameStates.MainScreenState.main(MainScreenState.java:102)        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)        at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)        at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)        at java.lang.reflect.Method.invoke(Unknown Source)        at com.exe4j.runtime.LauncherEngine.launch(Unknown Source)        at com.exe4j.runtime.WinLauncher.main(Unknown Source)Loading: mods/SleepinBag/media/lua/SBMStart.luaSep 11, 2013 11:34:05 PM zombie.Lua.LuaManager RunLuaSEVERE: nullSep 11, 2013 11:34:05 PM zombie.Lua.LuaManager RunLuaSEVERE: nulljava.lang.ArrayIndexOutOfBoundsException: 65022        at org.luaj.kahluafork.compiler.LexState.token2str(LexState.java:253)        at org.luaj.kahluafork.compiler.LexState.txtToken(LexState.java:268)        at org.luaj.kahluafork.compiler.LexState.lexerror(LexState.java:276)        at org.luaj.kahluafork.compiler.LexState.syntaxerror(LexState.java:291)        at org.luaj.kahluafork.compiler.LexState.prefixexp(LexState.java:1123)        at org.luaj.kahluafork.compiler.LexState.primaryexp(LexState.java:1136)        at org.luaj.kahluafork.compiler.LexState.exprstat(LexState.java:1697)        at org.luaj.kahluafork.compiler.LexState.statement(LexState.java:1785)        at org.luaj.kahluafork.compiler.LexState.chunk(LexState.java:1796)        at org.luaj.kahluafork.compiler.LexState.compile(LexState.java:200)        at se.krka.kahlua.luaj.compiler.LuaCompiler.loadis(LuaCompiler.java:132)        at se.krka.kahlua.luaj.compiler.LuaCompiler.loadis(LuaCompiler.java:124)        at zombie.Lua.LuaManager.RunLua(LuaManager.java:1963)        at zombie.Lua.LuaManager.RunLua(LuaManager.java:1939)        at zombie.Lua.LuaManager.LoadDirBase(LuaManager.java:455)        at zombie.GameWindow.init(GameWindow.java:1405)        at zombie.GameWindow.maina(GameWindow.java:889)        at zombie.gameStates.MainScreenState.main(MainScreenState.java:102)        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)        at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)        at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)        at java.lang.reflect.Method.invoke(Unknown Source)        at com.exe4j.runtime.LauncherEngine.launch(Unknown Source)        at com.exe4j.runtime.WinLauncher.main(Unknown Source)Loading: mods/SleepinBag/media/lua/SBMText.lua-----------------------------------------STACK TRACE-----------------------------------------Callframe at: getTextfunction: C:\Program Files (x86)\Steam\steamapps\common\ProjectZomboid\mods\SleepinBag\media\lua\SBMText.lua -- file: SBMText.lua line # 2Sep 11, 2013 11:34:05 PM zombie.Lua.LuaManager RunLuaSEVERE: nullSep 11, 2013 11:34:05 PM zombie.Lua.LuaManager RunLuaSEVERE: nulljava.lang.RuntimeException:        at se.krka.kahlua.vm.KahluaUtil.fail(KahluaUtil.java:90)        at se.krka.kahlua.vm.KahluaThread.luaMainloop(KahluaThread.java:1275)        at se.krka.kahlua.vm.KahluaThread.call(KahluaThread.java:160)        at se.krka.kahlua.vm.KahluaThread.pcall(KahluaThread.java:1714)        at se.krka.kahlua.vm.KahluaThread.pcall(KahluaThread.java:1629)        at se.krka.kahlua.integration.LuaCaller.pcall(LuaCaller.java:62)        at se.krka.kahlua.integration.LuaCaller.protectedCall(LuaCaller.java:76)        at zombie.Lua.LuaManager.RunLua(LuaManager.java:1971)        at zombie.Lua.LuaManager.RunLua(LuaManager.java:1939)        at zombie.Lua.LuaManager.LoadDirBase(LuaManager.java:455)        at zombie.GameWindow.init(GameWindow.java:1405)        at zombie.GameWindow.maina(GameWindow.java:889)        at zombie.gameStates.MainScreenState.main(MainScreenState.java:102)        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)        at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)        at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)        at java.lang.reflect.Method.invoke(Unknown Source)        at com.exe4j.runtime.LauncherEngine.launch(Unknown Source)        at com.exe4j.runtime.WinLauncher.main(Unknown Source)Sep 11, 2013 11:34:05 PM zombie.Lua.LuaManager RunLuaSEVERE: nullLoading: mods/SleepinBag/media/lua/SleepingBagMod.luaSep 11, 2013 11:34:05 PM zombie.Lua.LuaManager RunLuaSEVERE: nullSep 11, 2013 11:34:05 PM zombie.Lua.LuaManager RunLuaSEVERE: nulljava.lang.ArrayIndexOutOfBoundsException: 65022        at org.luaj.kahluafork.compiler.LexState.token2str(LexState.java:253)        at org.luaj.kahluafork.compiler.LexState.txtToken(LexState.java:268)        at org.luaj.kahluafork.compiler.LexState.lexerror(LexState.java:276)        at org.luaj.kahluafork.compiler.LexState.syntaxerror(LexState.java:291)        at org.luaj.kahluafork.compiler.LexState.prefixexp(LexState.java:1123)        at org.luaj.kahluafork.compiler.LexState.primaryexp(LexState.java:1136)        at org.luaj.kahluafork.compiler.LexState.exprstat(LexState.java:1697)        at org.luaj.kahluafork.compiler.LexState.statement(LexState.java:1785)        at org.luaj.kahluafork.compiler.LexState.chunk(LexState.java:1796)        at org.luaj.kahluafork.compiler.LexState.compile(LexState.java:200)        at se.krka.kahlua.luaj.compiler.LuaCompiler.loadis(LuaCompiler.java:132)        at se.krka.kahlua.luaj.compiler.LuaCompiler.loadis(LuaCompiler.java:124)        at zombie.Lua.LuaManager.RunLua(LuaManager.java:1963)        at zombie.Lua.LuaManager.RunLua(LuaManager.java:1939)        at zombie.Lua.LuaManager.LoadDirBase(LuaManager.java:455)        at zombie.GameWindow.init(GameWindow.java:1405)        at zombie.GameWindow.maina(GameWindow.java:889)        at zombie.gameStates.MainScreenState.main(MainScreenState.java:102)        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)        at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)        at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)        at java.lang.reflect.Method.invoke(Unknown Source)        at com.exe4j.runtime.LauncherEngine.launch(Unknown Source)        at com.exe4j.runtime.WinLauncher.main(Unknown Source)LOADED UP A TOTAL OF 72 TEXTURESMod Loaded: Sleeping Overhaul by RoboMat (v1.1.2)Info log:Fragment shader was successfully compiled to run on hardware. WARNING: 0:19: deprecated130(#55) 'texture2D' is deprecated since GLSL1.3, we suggest to use 'texture'WARNING: 0:22: deprecated130(#55) 'texture2D' is deprecated since GLSL1.3, we suggest to use 'texture'WARNING: 0:23: deprecated130(#55) 'texture2D' is deprecated since GLSL1.3, we suggest to use 'texture'WARNING: 0:24: deprecated130(#55) 'texture2D' is deprecated since GLSL1.3, we suggest to use 'texture'WARNING: 0:25: deprecated130(#55) 'texture2D' is deprecated since GLSL1.3, we suggest to use 'texture'Info log:Vertex shader was successfully compiled to run on hardware. 

 

I just don't understand why this is happening. It's with the Steam version, if that helps.

 

Game runs fine, but none of the stuff I want in-game even appear from what I know. I tried to use the zSpawn mod too, and put my own spawn script in so I could put the sleeping bag in and such, but it didn't work.

Link to comment
Share on other sites

Well you have quite some errors with your variables (unless I'm missing something):

 

You define SBMStart.bags as global table but then you use SBMStart.Bags, SBMStart.bag and even SBMStart.Bag... so I guess that's one of your problems.

 

I also don't understand why you ned getText() in your Text file. That's all I can see atm.

 

EDIT:

 

Also this doesn't seem to do anything:

SleepingBagMod.onGameStart = function()    SBMStart.OnGameStart();end

as you don't have a function to call (yet?)!

 

It seems like you are lacking the basic understanding of programming in lua, so I'd suggest that you read through this lua manual. In the tutorials section you can also find beginner's tutorials from me and others.

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...