Page 12 of 16
Re: LoG Framework (new: AD&D style spell book and 14 spells)
Posted: Sat Dec 22, 2012 4:56 pm
by slackmg
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
Re: LoG Framework (new: AD&D style spell book and 14 spells)
Posted: Thu Dec 27, 2012 7:39 am
by Diarmuid
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
Re: LoG Framework (new: AD&D style spell book and 14 spells)
Posted: Thu Dec 27, 2012 9:43 pm
by JKos
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.
Re: LoG Framework (new: AD&D style spell book and 14 spells)
Posted: Thu Dec 27, 2012 11:34 pm
by Diarmuid
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.
Re: LoG Framework (new: AD&D style spell book and 14 spells)
Posted: Thu Dec 27, 2012 11:46 pm
by JKos
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

Re: LoG Framework (new: AD&D style spell book and 14 spells)
Posted: Fri Dec 28, 2012 4:26 am
by Diarmuid
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:
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)
Posted: Fri Dec 28, 2012 12:19 pm
by JKos
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.
Code: Select all
cloneObject{
name= 'conjurers_hat'
baseObject='conjurers_hat'
onEquipItem=function(champion, slot)
print("Hello!")
end
}
after the framework is included.
Re: LoG Framework (new: AD&D style spell book and 14 spells)
Posted: Sun Dec 30, 2012 11:39 pm
by JayFight
you can skip this part
hi 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
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 own
Re: LoG Framework (new: AD&D style spell book and 14 spells)
Posted: Sun Dec 30, 2012 11:44 pm
by JayFight
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)
Posted: Thu Jan 03, 2013 12:14 am
by JKos
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.