Various hook requests

All development conversation and discussion takes place here

Moderator: Moderator

Post Reply
Message
Author
Peppersauce
Thalore
Posts: 190
Joined: Tue Jul 03, 2012 7:04 pm

Various hook requests

#1 Post 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)
Last edited by Peppersauce on Sat Jun 18, 2016 5:16 pm, edited 2 times in total.

stinkstink
Spiderkin
Posts: 543
Joined: Sat Feb 11, 2012 1:12 am

Re: Various hook requests

#2 Post 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	},

Peppersauce
Thalore
Posts: 190
Joined: Tue Jul 03, 2012 7:04 pm

Re: Various hook requests

#3 Post 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.

Post Reply