ToME: the Tales of Maj'Eyal

Everything about ToME
It is currently Wed Apr 25, 2018 6:45 am

All times are UTC




Post new topic Reply to topic  [ 3 posts ] 
Author Message
 Post subject: Various hook requests
PostPosted: Fri Jun 17, 2016 1:00 pm 
Offline
Thalore

Joined: Tue Jul 03, 2012 7:04 pm
Posts: 181
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:
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:
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:
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.

Top
 Profile  
 
PostPosted: Sat Jun 18, 2016 2:16 am 
Offline
Spiderkin

Joined: Sat Feb 11, 2012 1:12 am
Posts: 543
For having the tactical AI check custom resources, you can make SPECIAL a function
Code:
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   },


Top
 Profile  
 
PostPosted: Sat Jun 18, 2016 3:45 am 
Offline
Thalore

Joined: Tue Jul 03, 2012 7:04 pm
Posts: 181
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.


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 3 posts ] 

All times are UTC


Who is online

Users browsing this forum: No registered users and 3 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Group