[1.0.0] Clock

A place to post your add ons and ideas for them

Moderator: Moderator

Post Reply
Message
Author
lukep
Sher'Tul Godslayer
Posts: 1712
Joined: Mon Mar 14, 2011 10:32 am
Location: Canada

[1.0.0] Clock

#1 Post by lukep »

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)

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

Re: [1.0.0] Clock

#2 Post by jotwebe »

Nice!

It seems to work with the OldRPG tileset's OldWood GUI.
Ghoul never existed, this never happened!

jenx
Sher'Tul Godslayer
Posts: 2263
Joined: Mon Feb 14, 2011 11:16 pm

Re: [1.0.0] Clock

#3 Post by jenx »

Excellent. Using it I stumbled upon a bug I think: http://forums.te4.org/viewtopic.php?f=42&t=36875

Using gauntlets increases attack energy required by 10%.
MADNESS rocks

lukep
Sher'Tul Godslayer
Posts: 1712
Joined: Mon Mar 14, 2011 10:32 am
Location: Canada

Re: [1.0.0] Clock

#4 Post by lukep »

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)

Zizzo
Sher'Tul Godslayer
Posts: 2517
Joined: Thu Jan 23, 2003 8:13 pm
Location: A shallow water area south of Bree
Contact:

Re: [1.0.0] Clock

#5 Post by Zizzo »

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..."

lukep
Sher'Tul Godslayer
Posts: 1712
Joined: Mon Mar 14, 2011 10:32 am
Location: Canada

Re: [1.0.0] Clock

#6 Post by lukep »

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)

jenx
Sher'Tul Godslayer
Posts: 2263
Joined: Mon Feb 14, 2011 11:16 pm

Re: [1.0.0] Clock

#7 Post by jenx »

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: Select all

--- 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

lukep
Sher'Tul Godslayer
Posts: 1712
Joined: Mon Mar 14, 2011 10:32 am
Location: Canada

Re: [1.0.0] Clock

#8 Post by lukep »

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)

Zireael
Archmage
Posts: 449
Joined: Tue Jun 18, 2013 7:24 pm

Re: [1.0.0] Clock

#9 Post by Zireael »

Does this work with 1.1.5 or 1.2.0?

Waladil
Halfling
Posts: 103
Joined: Tue Jan 10, 2012 10:40 pm

Re: [1.0.0] Clock

#10 Post by Waladil »

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.

Morikal
Cornac
Posts: 41
Joined: Sun Mar 22, 2015 11:33 am

Re: [1.0.0] Clock

#11 Post by Morikal »

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?

Post Reply