[Models] New created Models..

Talk about creating Grimrock 1 levels and mods here. Warning: forum contains spoilers!
User avatar
germanny
Posts: 530
Joined: Sat Apr 07, 2012 10:52 pm
Location: Kiel, Germany

Re: [Models] New created Models..

Post by germanny »

*EDIT* It´s uploaded sucessful!!

Some shots from the example dungeon:
Image
Image
Image
Dungeon Master Resource Pack worker and passionated Beer drinker
isamu
Posts: 55
Joined: Sun Apr 29, 2012 7:33 am

Re: [Models] New created Models..

Post by isamu »

Lookin' good my friend!
Killcannon
Posts: 73
Joined: Sun Apr 12, 2015 2:57 pm

Re: [Models] New created Models..

Post by Killcannon »

I just got this mod, installed it intending to use some of the assets in a dungeon I'm working in. I'm having a problem with the game crashing while the mod is activated. This happens both in the editor and exported dungeons played from the custom game menu. The crash occurs when you go to attack using any weapon or even bare hands, but does not happen when you try to attack with a weapon you cannot use. This occurs even if there are no assets from the mod in the dungeon, simply enabling it in the init.lua is enough. Also removing all mod assets from the dungeon and disabling the mod instantly fixes the issue. I'm including a copy of the error log below. Any help from either the creator or the community in resolving this would be amazing! <3
SpoilerShow
mod_assets/dmcsb_pack/scripts/objects.lua:11: attempt to index global 'DMDungeonInit' (a nil value)
stack traceback:
mod_assets/dmcsb_pack/scripts/objects.lua:11: in function 'onAttack'
[string "Champion.lua"]: in main chunk
[string "Champion.lua"]: in function 'attack'
[string "AttackPanel.lua"]: in function 'select'
[string "AttackPanel.lua"]: in function 'drawItemSlot'
[string "AttackPanel.lua"]: in function 'update'
[string "AttackPanel.lua"]: in function 'update'
[string "Gui.lua"]: in function 'draw'
[string "GameMode.lua"]: in function 'update'
[string "Grimrock.lua"]: in function 'display'
[string "Grimrock.lua"]: in main chunk
User avatar
THOM
Posts: 1266
Joined: Wed Nov 20, 2013 11:35 pm
Location: Germany - Cologne
Contact:

Re: [Models] New created Models..

Post by THOM »

There seems to be a problem in the file objects.lua in line 11

'DMDungeonInit' is written where it does not make any sense...
THOM formaly known as tschrage
_______________________________________________
My MOD (LoG1): Castle Ringfort Thread
My MOD (LoG2): Journey To Justice Thread | Download
Killcannon
Posts: 73
Joined: Sun Apr 12, 2015 2:57 pm

Re: [Models] New created Models..

Post by Killcannon »

Thanks for the quick reply and help THOM! I really appreciate it!

Here's the code in the objects.lua that the error is referring too. I'm guessing that "DMDungeonInit." should be "DMDungeoninit.lua" ? My knowledge of scripting on this is not even really beginner and I'm learning as I go!

SpoilerShow
cloneObject{
name = "party",
baseObject = "party",
onAttack = function (self, weapon)
return DMDungeonInit.whatWeapon(self, weapon)
end,
}
User avatar
THOM
Posts: 1266
Joined: Wed Nov 20, 2013 11:35 pm
Location: Germany - Cologne
Contact:

Re: [Models] New created Models..

Post by THOM »

On my opinion the complete term "DMDungeonInit.whatWeapon(self, weapon)" doesn't make sense. Doesn't refer to an existing command or anything that seem to be defined...

I presume you took this from someone elses script? What should this do?
THOM formaly known as tschrage
_______________________________________________
My MOD (LoG1): Castle Ringfort Thread
My MOD (LoG2): Journey To Justice Thread | Download
User avatar
Isaac
Posts: 3172
Joined: Fri Mar 02, 2012 10:02 pm

Re: [Models] New created Models..

Post by Isaac »

My assumption of this is that the intended purpose is to run the whatWeapon() function on every attack, and have the option to return false ~to negate the attack.

*The logic for choice, probably being in the whatWeapon() function, or something it calls.
Killcannon
Posts: 73
Joined: Sun Apr 12, 2015 2:57 pm

Re: [Models] New created Models..

Post by Killcannon »

Yes, this is from the mod that this thread is on. I got the mod from Grimrock.nexus and would like to use the stuff the creator used, but this bug is preventing me from doing so. I'm using the mod 'as is' downloaded directly from the website and applied per the instructions left by the creator. The only thing I have here to go on is the comment line above:
SpoilerShow
-- clone Party for special scripting
I'm not sure what it's for at all, but I hesitate to remove it in case it interferes with the special scripted items in the mod. What I'm looking for is to fix the crashing, and have the script work so the mod is the way the creator intended it.

Here's the entire section:
SpoilerShow
-- clone Party for special scripting

cloneObject{
name = "party",
baseObject = "party",
onAttack = function (self, weapon)
return DMDungeonInit.whatWeapon(self, weapon)
end,
}
User avatar
Isaac
Posts: 3172
Joined: Fri Mar 02, 2012 10:02 pm

Re: [Models] New created Models..

Post by Isaac »

In the first Grimrock title, adding hooks (such as the onAttack hook), was only possible at load, by redefining an object; (in this case, the party).

This is the purpose of using cloneObject to redefine [to overwrite] the party object with one that has the onAttack hook. It means that anytime the player tries to attack, the DMDungeonInit.whatWeapon() function is run; presumably to check the attack, and possibly cause it to fail. Either that or it might use the passed parameters for other functions. I haven't read the mod's scripts, so this is a guess.
Killcannon
Posts: 73
Joined: Sun Apr 12, 2015 2:57 pm

Re: [Models] New created Models..

Post by Killcannon »

Okay so after a long while and a lot of research I decided to remove line 11 in the object.lua file. (I'm doing this by making it a comment) This has fixed the bug for me and so far my testing of various items/props that was included in the mod hasn't caused it to crash again. So here's the result that I used. Thanks to everyone who helped out with this!


SpoilerShow
-- clone Party for special scripting


cloneObject{
name = "party",
baseObject = "party",
onAttack = function (self, weapon)
-- Killcannon edit to fix weapon use bug // return DMDungeonInit.whatWeapon(self, weapon)
end,
}
Post Reply