ToME: the Tales of Maj'Eyal

Everything about ToME
It is currently Wed Apr 08, 2020 6:47 am

All times are UTC




Post new topic Reply to topic  [ 11 posts ] 
Author Message
 Post subject: [1.0.0] Clock
PostPosted: Mon Feb 18, 2013 6:43 am 
Offline
Sher'Tul Godslayer

Joined: Mon Mar 14, 2011 10:32 am
Posts: 1709
Location: Canada
This adds a clock to the game in the Minimalist UI, that tracks turns, global speed, attack/move/spell/mind/summon speeds, and can calculate how much stuff you can do before timed effects tick down again (and other turn based stuff happens). Based on this thread.

Download Link

Credits: a fairly large majority of the code in this came from Zizzo's Online Indicator addon. I hope that they don't clash, since they share so much code.

_________________
Some of my tools for helping make talents:
Melee Talent Creator
Annotated Talent Code (incomplete)


Top
 Profile  
 
 Post subject: Re: [1.0.0] Clock
PostPosted: Mon Feb 18, 2013 12:38 pm 
Offline
Uruivellas

Joined: Fri Apr 15, 2011 6:58 am
Posts: 725
Location: GMT+1
Nice!

It seems to work with the OldRPG tileset's OldWood GUI.

_________________
Ghoul never existed, this never happened!


Top
 Profile  
 
 Post subject: Re: [1.0.0] Clock
PostPosted: Mon Feb 18, 2013 11:27 pm 
Offline
Sher'Tul Godslayer

Joined: Mon Feb 14, 2011 11:16 pm
Posts: 2263
Excellent. Using it I stumbled upon a bug I think: viewtopic.php?f=42&t=36875

Using gauntlets increases attack energy required by 10%.

_________________
MADNESS rocks


Top
 Profile  
 
 Post subject: Re: [1.0.0] Clock
PostPosted: Tue Feb 19, 2013 1:13 am 
Offline
Sher'Tul Godslayer

Joined: Mon Mar 14, 2011 10:32 am
Posts: 1709
Location: Canada
I really need to find a way of choosing the proper weapon for the attack time calculation. It's a bug here, not in the game.

_________________
Some of my tools for helping make talents:
Melee Talent Creator
Annotated Talent Code (incomplete)


Top
 Profile  
 
 Post subject: Re: [1.0.0] Clock
PostPosted: Tue Feb 19, 2013 1:39 am 
Offline
Sher'Tul Godslayer

Joined: Thu Jan 23, 2003 8:13 pm
Posts: 1792
Location: A shallow water area south of Bree
lukep wrote:
Credits: a fairly large majority of the code in this came from Zizzo's Online Indicator addon. I hope that they don't clash, since they share so much code.

Oh dear. Online Indicator was a monstrous hack, and people are reusing it? :oops: [sound F/X: source diving] Ah, I see, Clock is basically just Online Indicator with its tooltip replaced with yours. Yeah, those will probably step on each other's toes, then; even apart from the potential problems with multiple addons superloading the same method, it would be a matter of which addon ended up in control of the tooltip hotzone.

_________________
"Blessed are the yeeks, for they shall inherit Arda..."


Top
 Profile  
 
 Post subject: Re: [1.0.0] Clock
PostPosted: Tue Feb 19, 2013 2:33 am 
Offline
Sher'Tul Godslayer

Joined: Mon Mar 14, 2011 10:32 am
Posts: 1709
Location: Canada
Well...it still beats my first few attempts, hijacking the activation for the orb of scrying, trying (and failing) to get a new item made and added at birth, and then hijacking the description of the "attack" talent. The dialogue is quite easy to move anywhere, it's just finding a good place to put it that's the issue.

EDIT: Actually, I may end up moving it, the mouseover of your character in the UI looks like a decent place.

_________________
Some of my tools for helping make talents:
Melee Talent Creator
Annotated Talent Code (incomplete)


Top
 Profile  
 
 Post subject: Re: [1.0.0] Clock
PostPosted: Tue Feb 19, 2013 10:30 am 
Offline
Sher'Tul Godslayer

Joined: Mon Feb 14, 2011 11:16 pm
Posts: 2263
lukep wrote:
I really need to find a way of choosing the proper weapon for the attack time calculation. It's a bug here, not in the game.


Is the following routine from Archery.lua the sort of thing you need?

Code:
--- Check if the actor has a bow or sling and corresponding ammo
function _M:hasArcheryWeapon(type)
   if self:attr("disarmed") then
      return nil, "disarmed"
   end

   if not self:getInven("MAINHAND") then return nil, "no shooter" end
   if not self:getInven("QUIVER") then return nil, "no ammo" end
   local weapon = self:getInven("MAINHAND")[1]
   local ammo = self:getInven("QUIVER")[1]
   if self.inven[self.INVEN_PSIONIC_FOCUS] then
      local pf_weapon = self:getInven("PSIONIC_FOCUS")[1]
      if pf_weapon and pf_weapon.archery then
         weapon = pf_weapon
      end
   end
   if not weapon or not weapon.archery then
      return nil, "no shooter"
   end
   if not ammo then
      return nil, "no ammo"
   else
      if not ammo.archery_ammo or weapon.archery ~= ammo.archery_ammo then
         return nil, "bad ammo"
      end
   end
   if type and weapon.archery ~= type then return nil, "bad type" end
   return weapon, ammo
end

_________________
MADNESS rocks


Top
 Profile  
 
 Post subject: Re: [1.0.0] Clock
PostPosted: Tue Feb 19, 2013 11:06 pm 
Offline
Sher'Tul Godslayer

Joined: Mon Mar 14, 2011 10:32 am
Posts: 1709
Location: Canada
Yes, but currently I would need to do self:hasArcheryWeapon(), self:hasDealWeapon()... self:hasXXXWeapon() if I want all of the bases covered. There isn't a generic _M:hasWeapon() that I could find.

_________________
Some of my tools for helping make talents:
Melee Talent Creator
Annotated Talent Code (incomplete)


Top
 Profile  
 
 Post subject: Re: [1.0.0] Clock
PostPosted: Sat Jun 07, 2014 1:33 pm 
Offline
Archmage

Joined: Tue Jun 18, 2013 7:24 pm
Posts: 449
Does this work with 1.1.5 or 1.2.0?

_________________
Working on a T-Engine game
Veins of the Earth

Veins of the Earth ModDB page


Top
 Profile  
 
 Post subject: Re: [1.0.0] Clock
PostPosted: Tue Jun 10, 2014 5:38 am 
Offline
Halfling

Joined: Tue Jan 10, 2012 10:40 pm
Posts: 103
Just so you know, Zirael, the Chronometer addon does still work fine as of 1.2.1. I don't know if that's the same addon with a different name or a completely different addon with the same goal, but I see you asked about that on it's own addon page (I was gonna link you to it but I guess you already found it :P).

In fact, I sometimes consider "adopting" the Chronometer by re-releasing it as a 1.2.1 addon -- I don't think any of the original coders are still active, and I wouldn't claim to have any credit to the code of it. Just to get it up higher on the addons list and on Steam Workshop.


Top
 Profile  
 
 Post subject: Re: [1.0.0] Clock
PostPosted: Wed Mar 25, 2015 2:27 am 
Offline
Cornac

Joined: Sun Mar 22, 2015 11:33 am
Posts: 41
My clock is placed in the very lower right hand corner, underneath the un-movable UI elements (the ones to lock/unlock UI elements, show game log, etc).

Is there a way to move it?


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

All times are UTC


Who is online

Users browsing this forum: No registered users and 2 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:  
cron
Powered by phpBB® Forum Software © phpBB Group