Page 11 of 16
Re: LoG Framework (new: AD&D style spell book and 14 spells)
Posted: Thu Dec 20, 2012 12:50 am
by Diarmuid
Wow, great way of implementing this JKos. Thanks so much. So grimq is always on by default now as well?
I'll update the setup instructions in exsp and post another update (1.3.2) tonight with updates to the code with the new functions from the editor update.
Re: LoG Framework (new: AD&D style spell book and 14 spells)
Posted: Thu Dec 20, 2012 10:24 pm
by JKos
@Stephen
Thanks, I hope it makes the modding a bit easier to you. Personally I could't even think about modding LoG without dynamic hooks or Xanathars GrimQ anymore, it's just so much easier and versatile.
@Diarmuid
Yes, GrimQ is loaded automatically and no additional setup is required. I'm going to try your exsp soon, I just wish I would have more time to test every awesome thing published on these forums.
Re: LoG Framework (new: AD&D style spell book and 14 spells)
Posted: Thu Dec 20, 2012 10:52 pm
by Diarmuid
Great, thanks for the info! Wait until I publish 1.3.2 tonight/tomorrow morning before downloading it, I'll update it with the new functions from the grimrock patch. I have some more funky spell ideas to show off too, just need some time to code them.
Re: LoG Framework (new: AD&D style spell book and 14 spells)
Posted: Fri Dec 21, 2012 6:47 am
by Diarmuid
Hi,
I get the following error:
mod_assets/framework/modules/fw.lua:489: bad argument 'gfxAtlas' to 'cloneObject' (string expected, got userdata)
on loading dungeon. Bugging code:
Code: Select all
defineObject {
name = "iron_bracelet",
uiName = "Iron Bracelet",
class = "Item",
model = "assets/models/items/brace_fortitude.fbx",
gfxAtlas = "mod_assets/textures/gui/items.tga",
gfxIndex = 1,
slot = "Bracers",
description = "The material remains cold to the touch, and heavier than it appears. You feel you should hold on to it.",
protection = 2,
resistCold = 10,
weight = 0.6,
}
fw_addHooks("iron_bracelet","item","accessory")
All my other items defined with gfxAtlas do the same.
Re: LoG Framework (new: AD&D style spell book and 14 spells)
Posted: Fri Dec 21, 2012 10:52 am
by JKos
That seems to be a bug in Grimrock, because the fw_addHooks doesn't do anything else but adds the hook functions to the object by cloning it.
So this should produce the same error:
Code: Select all
defineObject {
name = "iron_bracelet",
uiName = "Iron Bracelet",
class = "Item",
model = "assets/models/items/brace_fortitude.fbx",
gfxAtlas = "mod_assets/textures/gui/items.tga",
gfxIndex = 1,
slot = "Bracers",
description = "The material remains cold to the touch, and heavier than it appears. You feel you should hold on to it.",
protection = 2,
resistCold = 10,
weight = 0.6,
}
cloneObject{
name = "iron_bracelet",
baseObject = "iron_bracelet",
}
You could try to use cloneObject instead of defineObject.
Re: LoG Framework (new: AD&D style spell book and 14 spells)
Posted: Fri Dec 21, 2012 11:32 am
by JKos
I'm gonna do fw_defineObject function which fixes this and all possible other problems, because it just wraps the defineObject function, so it works exactly like defineObject but adds hooks automatically.
Re: LoG Framework (new: AD&D style spell book and 14 spells)
Posted: Fri Dec 21, 2012 2:35 pm
by JKos
Fixed and new version uploaded.
I hope it works now.
Dynamic hooks with custom assets
All custom assets should be included after the framework.lua or otherwise the dynamic hooks won't work with them. All cloned objects should work out of the box, but if you have created totally new assets with defineObject, you have use fw_defineObject-function instead, IF you want to use dynamic hooks with your custom assets.
fw_defineObject(objDef)
Is used exactly like the original defineObject, but it has an additional optional argument itemCategory, which defines the hook-namespace for the item and is used on various help-module functions (eg.isEntityType). Default value is 'custom'.
Possible ItemCategory values: weapon, shield,accessory,bomb,food, missileweapon, tome,armor,cloth,herb,machinepart,potion,staff,treasure,container,key,miscitem,scroll, custom
Examples
Code: Select all
fw_defineObject{
name='snail_king',
class = 'Monster',
...
}
fw_defineObject{
name='my_super_weapon',
class = 'Item',
...
itemCategory='weapon'
}
Re: LoG Framework (new: AD&D style spell book and 14 spells)
Posted: Sat Dec 22, 2012 6:55 am
by Diarmuid
Hi, I can confirm it works fine now, thanks!
Re: LoG Framework (new: AD&D style spell book and 14 spells)
Posted: Sat Dec 22, 2012 3:31 pm
by slackmg
For some reason with the latest framework, I get this when using stock items:
Code: Select all
mod_assets/framework/modules/fw.lua:498: attempt to concatenate global 'category' (a nil value)
stack traceback:
mod_assets/framework/modules/fw.lua:498: in function 'onUseItem'
[string "Item.lua"]: in function 'useItem'
[string "CharSheet.lua"]: in function 'slotClicked'
[string "CharSheet.lua"]: in function 'draw'
[string "Gui.lua"]: in function 'draw'
[string "GameMode.lua"]: in function 'update'
[string "Grimrock.lua"]: in function 'display'
[string "Grimrock.lua"]: in main chunk
The error gets thrown using potions (potion_healing), compass and tomes (tome_health). Just starting running into this with the last update to include the fw_defineobject. Is there something special we need to do to get the stock items working with the last framework version?
Re: LoG Framework (new: AD&D style spell book and 14 spells)
Posted: Sat Dec 22, 2012 4:26 pm
by JKos
Hi, i think you have downloaded a non working version which I uploaded by accident and just hoped that no one wasn't quick enough to download it.
So if you update the fw.lua (or the whole framework) it should work now.
https://docs.google.com/file/d/0B7cR7sc ... JRWFU/edit
Let me know if the problem still occurs and I will fix it.