Page 1 of 1

Various hook requests

Posted: Fri Jun 17, 2016 1:00 pm
by Peppersauce
And here I am, for another round of hook additions, these are all tested and working (and ripped off Fated) and could be really useful in general.

mod/dialogs/CharacterSheet.lua: 3 hooks here, the first one is for showing new stats in the character sheet, should be put at line 769

Code: Select all

local hd = {"CharacterSheet:drawDialog:Stats", print_stat = print_stat}
self:triggerHook(hd)
the second one is for showing new stats in the character dump, to be put at what's currently line 1456 (1458 after adding the hook above)

Code: Select all

local hd = {"CharacterSheet:dump:Stats", makelabel = makelabel, nl = nl, nnl = nnl}
self:triggerHook(hd)
last one is for custom resources, also in the character dump, its place is at line 1548 (1552 after those 2 hooks have been added)

Code: Select all

local hd = {"CharacterSheet:dump:Resources", makelabel = makelabel, nl = nl}
self:triggerHook(hd)

Re: Various hook requests

Posted: Sat Jun 18, 2016 2:16 am
by stinkstink
For having the tactical AI check custom resources, you can make SPECIAL a function

Code: Select all

tactical = { SPECIAL = function(self, t, target) --tactical consideration for focus recovery
	local wantfocus = 0
		local stoic_focus = 100 * self:getStoic_focus() / self:getMaxStoic_focus()
		if stoic_focus < 6.25 then wantfocus = wantfocus + 6
			elseif stoic_focus < 12.5 then wantfocus = wantfocus + 1
			elseif stoic_focus < 25 then wantfocus = wantfocus + 0.5
		end
	return wantfocus
end	},

Re: Various hook requests

Posted: Sat Jun 18, 2016 3:45 am
by Peppersauce
Huh, didn't know about SPECIAL, that's pretty cool actually, I think I'll start using that. It's on a per talent basis though, with a hook like the one shown in the first post you can add multiple other categories (even not resource related now that I think about it... let me rename that hook a second :lol: ), write the general code there and then use the tactical field in each related talent to give them various priorities. So yeah, not that necessary but I'll ask it anyway just because. :D

Edit: after thinking about it a bit more, special does actually cover all the custom ai needs so I'll drop that hook request.