LoG Framework (dynamic hooks etc.)
Re: LoG Framework (new: AD&D style spell book and 14 spells)
Thanks. I'm working again after updating the fw.lua file. Must've had the broken version in the dungeon export. I thought I had the last version in, but it appears not. Thanks for the great framework (especially the illusion walls).
Mike
Mike
Re: LoG Framework (new: AD&D style spell book and 14 spells)
Hi JKos,
The hook handling with equip/unequip seems bugged in the framework, as hooks defined in .lua files do not get argument passed on correctly.
See what I wrote to your intention in the "cancel equip/unequip" thread: viewtopic.php?f=14&t=4637#p48778
The hook handling with equip/unequip seems bugged in the framework, as hooks defined in .lua files do not get argument passed on correctly.
See what I wrote to your intention in the "cancel equip/unequip" thread: viewtopic.php?f=14&t=4637#p48778
Re: LoG Framework (new: AD&D style spell book and 14 spells)
Sorry, I didn't notice that the published version had those hooks. New version uploaded. It still has onEquipItem and on onUnequipItem hooks but they work like native hooks, which do have only slot and champion arguments. Previous version was modified so that the item was added as a first argument, because I wanted to make it work like all other hooks which do get the entity as a first argument.
- LoG Framework 2http://sites.google.com/site/jkoslog2 Define hooks in runtime by entity.name or entity.id + multiple hooks support.
- cloneObject viewtopic.php?f=22&t=8450
- cloneObject viewtopic.php?f=22&t=8450
Re: LoG Framework (new: AD&D style spell book and 14 spells)
Ah... So the normal hooks don't have the self arg... I thought they did, based on your reference sheet. Damn, that means my equipStopper is still buggy I'll fix it tonight.
Thanks for the quick fix. Your version was better but I think its better to follow ah's hooks for compatibilty and if non-fw users look at your cheat sheeet.
Thanks for the quick fix. Your version was better but I think its better to follow ah's hooks for compatibilty and if non-fw users look at your cheat sheeet.
Re: LoG Framework (new: AD&D style spell book and 14 spells)
All previous hooks do get the self arg, but onEquipItem and onUnequipItem don't. I was pretty confused about it too, and I hope the AH will fix it.
my cheat sheet says:
onEquipItem(champion, slot)
onUnequipItem(champion, slot)
Edit: but I guess that's what you get when you drink Glögg while scripting
my cheat sheet says:
onEquipItem(champion, slot)
onUnequipItem(champion, slot)
Edit: but I guess that's what you get when you drink Glögg while scripting

- LoG Framework 2http://sites.google.com/site/jkoslog2 Define hooks in runtime by entity.name or entity.id + multiple hooks support.
- cloneObject viewtopic.php?f=22&t=8450
- cloneObject viewtopic.php?f=22&t=8450
Re: LoG Framework (new: AD&D style spell book and 14 spells)
Lol @ Glögg and coding.
Unfortunately, now, the dynamic hooks for equip/unequip don't seem to work at all. The following gets me no result:
Unfortunately, now, the dynamic hooks for equip/unequip don't seem to work at all. The following gets me no result:
Code: Select all
autohook = {
conjurers_hat = {
onEquipItem = function(champion, slot)
print("Hello!")
end
}
}
Re: LoG Framework (new: AD&D style spell book and 14 spells)
Damn, I just realized that my framework requires the self argument. Obviously It's not possible to bind hooks to items if the item is not known by the framework. So I have to change it back so that item is passed as a 1st argument. But meanwhile you should be able to use native hooks, just override the framework hooks by cloneObject.
after the framework is included.
Code: Select all
cloneObject{
name= 'conjurers_hat'
baseObject='conjurers_hat'
onEquipItem=function(champion, slot)
print("Hello!")
end
}
- LoG Framework 2http://sites.google.com/site/jkoslog2 Define hooks in runtime by entity.name or entity.id + multiple hooks support.
- cloneObject viewtopic.php?f=22&t=8450
- cloneObject viewtopic.php?f=22&t=8450
Re: LoG Framework (new: AD&D style spell book and 14 spells)
you can skip this part
okay just so you know i just found another thread you have been talking in about this very thing i was asking about above sorry i didn't see that thread earlier, now i have to finish the thread and hope i can piece together what i need to figure out a custom gui on my ownhi there. first i want to say i love this, and second i noticed you have a gui module included but it won't let me use it (i think it's trying to access something and that something isn't there)
so anyways i was wondering if there was a way to use this to make my own custom gui. you know like rearranging the layout or adding my own gui images or even making menus, i
only ask this because i would love to make a shop using this. like you would click something in the environment(say an NPC of some sort like a spider) and it responds with say something that looks like the map (or what ever else you put) opening up and inside there is a list of items with prices and you can click those to buy them.
if there is a way to do that maybe you can give an example of how to do that and i could just go from there, i have a little experience with reworking scripts, but i don't know how to write them myself. anything you(or anyone) puts i can take and turn into what i need, i just can't figure out how to start such a thing myself is all
thank you
Last edited by JayFight on Mon Dec 31, 2012 3:14 am, edited 1 time in total.
Re: LoG Framework (new: AD&D style spell book and 14 spells)
oh also i forgot to mention that i tried to use the default spell module to add them to the spell book but every time i click on those spells to try to learn them it crashes the game
Re: LoG Framework (new: AD&D style spell book and 14 spells)
New version:
onEquipItem and onUnequipItem hooks implemented and now they DO receive the item(self) as a first argument, so they are different than the native hooks.
native hooks:
onEquipItem(champion, slot)
onUnequipItem(champion, slot)
Framework hooks:
onEquipItem(item,champion, slot)
onUnequipItem(item,champion, slot)
Also some minor bug fixes.
Default_spells should work now, but I noticed that for some reason it still breaks the save games so that they can't be loaded any more, so DON'T use it
, I'm not fixing it because i'm going to redo the spell book with gui features.
Thanks for the feedback anyway JayFight.
onEquipItem and onUnequipItem hooks implemented and now they DO receive the item(self) as a first argument, so they are different than the native hooks.
native hooks:
onEquipItem(champion, slot)
onUnequipItem(champion, slot)
Framework hooks:
onEquipItem(item,champion, slot)
onUnequipItem(item,champion, slot)
Also some minor bug fixes.
Default_spells should work now, but I noticed that for some reason it still breaks the save games so that they can't be loaded any more, so DON'T use it

Thanks for the feedback anyway JayFight.
- LoG Framework 2http://sites.google.com/site/jkoslog2 Define hooks in runtime by entity.name or entity.id + multiple hooks support.
- cloneObject viewtopic.php?f=22&t=8450
- cloneObject viewtopic.php?f=22&t=8450