Improved player targetting

A place to post your add ons and ideas for them

Moderator: Moderator

Message
Author
Shesh
Wayist
Posts: 16
Joined: Wed Jun 11, 2014 9:07 pm

Improved player targetting

#1 Post by Shesh »

The "beam", "ball" and "cone" type talents will attempt to select the target to cover as many hostiles as possible.
In Modern graphic mode colored numbers are added to the hostiles in sight.
- Red colored should be able to attack you next turn (depends on your speed, remaining energy, their proximity and ranged talents at their disposal).
- Orange colored should be able to attack you if you use talent, but not if you move.
- Purple colored will be able to hit you twice next round (depends on AI selection).
- Green colored should not be able to attack you, unless you specifically make a move to let them.
- The numbers represent the NPC 'power' calculated through some simple heuristical formula.
- Numbers can be used in 'selection mode' to move around the targets.

Available at: http://te4.org/download-addon/3173/tome/qqq
Last edited by Shesh on Thu Mar 19, 2015 2:39 pm, edited 10 times in total.

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

Re: Improved player targetting

#2 Post by Zireael »

Checking this out!

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

Re: Improved player targetting

#3 Post by stinkstink »

Mind adding purple numbers for enemies that could potentially attack twice? Would be nice for ghouls.

Noel
Thalore
Posts: 121
Joined: Fri Dec 15, 2006 1:49 am

Re: Improved player targetting

#4 Post by Noel »

Nice and helpful!

Found a little bug, though -- number is still shown when NPC is stealthed.

Shesh
Wayist
Posts: 16
Joined: Wed Jun 11, 2014 9:07 pm

Re: Improved player targetting

#5 Post by Shesh »

Fixed the stealth issue and added the color for ghouls.
However the latter may not be correct in all cases, since the so-called 'AI' can select slower talents for NPC and miss the chance to double-hit you.

Noel
Thalore
Posts: 121
Joined: Fri Dec 15, 2006 1:49 am

Re: Improved player targetting

#6 Post by Noel »

Got a lua error while fighting Chronolith twins -- char was started with tome-qqq_2, then upgraded to tome-qqq_3, if that makes a difference. Let me know if you need more log...
[LOG] Temporal Destabilization from Chronolith Twin hits #fbd578#Artav#LAST# for #LIGHT_STEEL_BLUE#23 temporal#LAST# damage.
[LOG]
Lua Error: /mod/addons/qqq/superload/mod/class/Actor.lua:126: attempt to index local 'combat' (a nil value)
At [C]:-1 __index
At /mod/addons/qqq/superload/mod/class/Actor.lua:126 getCombatSpeed
At /mod/addons/qqq/superload/mod/class/Actor.lua:234 getAttackPower
At /mod/addons/qqq/superload/mod/class/Actor.lua:270 getPower
At /mod/addons/qqq/superload/mod/shesh/threats.lua:111 calcThreats
At /mod/addons/qqq/superload/mod/class/Player.lua:40 act
At /engine/GameEnergyBased.lua:126 tickLevel
At /engine/GameEnergyBased.lua:62 tick
At /engine/GameTurnBased.lua:46 tick
At /mod/class/Game.lua:1184
---------------- Stack Dump ----------------
2: table // 41440b98
1: table // 41440b98
--------------- Stack Dump Finished ---------------

Shesh
Wayist
Posts: 16
Joined: Wed Jun 11, 2014 9:07 pm

Re: Improved player targetting

#7 Post by Shesh »

Resolved, I believe, please check the new version.

firia
Posts: 4
Joined: Tue Jun 17, 2014 6:34 am

Re: Improved player targetting

#8 Post by firia »

Nice Addon thank you.

found little bugs.
can watch monster list when light source don't leach.
can't watch number when change level and sometime manual explore just find monsters.

Sorry, my English is bad.

Shesh
Wayist
Posts: 16
Joined: Wed Jun 11, 2014 9:07 pm

Re: Improved player targetting

#9 Post by Shesh »

Fixed the above.

hauzer
Wayist
Posts: 18
Joined: Sat Jun 28, 2014 4:27 am
Location: Belgrade, Serbia

Re: Improved player targetting

#10 Post by hauzer »

Doesn't work for me. Tried Arena and the Campaign on 1.2.2. They both go into an infinite loop of repeating a frame. Arena just before starting the first wave (countdown 0) and the campaign the moment I begin a new game.

Sheila
Magical Girl
Posts: 431
Joined: Wed Aug 27, 2014 11:36 am

Re: Improved player targetting

#11 Post by Sheila »

Hope it's okay to bump this! Are you still planning to update this or?
I've been using this mod for a while now and I've learned to incorporate it into my gameplay almost completely since it's super amazing and makes any skill-heavy class so much more bearable to play, specially casters!
However there's two things bugging me right now, one being a bug (no pun intended) and the other a personal issue with how the mod itself works:
The bug: When frozen and attempting to use a heat-beam rune, the game locks up and freezes for me, I managed to get it out of freezing once but the frames had dropped so low that it was literally unplayable. After turning off the mod and attempting a similar situation it was 100% ok, so maybe it has something to do with it! :(
Personal Issue: would it be possible to add an option to not bind the numbered keys to targets? I use mine for skills a lot and would much rather use them to tap my skills to get things done more quickly, and adjust manually if I need to :3
"As dying is one of the leading causes of death, you should avoid dying." -rekenner

"I'll bond with a cactus until my buttcheeks touch the sand before I play nethack again" -Gagarin

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

Re: Improved player targetting

#12 Post by stinkstink »

I occasionally get a lua error related to various inscriptions when trying to activate usable equipment/charms. Using another talent, then retrying the item tends to work.

Code: Select all

Lua Error: /mod/class/Player.lua:1228: /mod/class/interface/ActorInscriptions.lua:123: unknown inscription INFUSION:_SUN_3
	At [C]:-1 
	At [C]:-1 error
	At /mod/class/Player.lua:1228 playerUseItem
	At /mod/class/Player.lua:1121 
	At /engine/interface/PlayerHotkeys.lua:161 activateHotkey
	At /engine/HotkeysIconsDisplay.lua:334 onMouse
	At /mod/class/uiset/Minimalist.lua:1942 fct
	At /engine/Mouse.lua:56 
stack traceback:
	[C]: in function 'assert'
	/mod/class/interface/ActorInscriptions.lua:123: in function 'getInscriptionData'
	/data/talents/misc/inscriptions.lua:303: in function 'getTalentRadius'
	/mod/addons/qqq/superload/mod/shesh/aoe.lua:176: in function 'getTarget'
	/data/general/objects/egos/wands-powers.lua:58: in function 'use'
	/engine/interface/ObjectActivable.lua:74: in function 'useObject'
	/mod/class/Object.lua:132: in function 'use'
	/mod/class/Player.lua:1196: in function </mod/class/Player.lua:1187>

Shesh
Wayist
Posts: 16
Joined: Wed Jun 11, 2014 9:07 pm

Re: Improved player targetting

#13 Post by Shesh »

The inscription issue as well as problem with casting when frozen should have been fixed in the version 0.95 posted a week ago.

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

Re: Improved player targetting

#14 Post by stinkstink »

Best I can tell this crash involves getting the Crippled effect while playing an addon class (Spellsword in this case)

Code: Select all

checkHit(smooth)        20      28.313454443228 => chance to hit        35.318897664187
AI took for target      6985    Islata the giant carpenter ant  ::      1913    ape of perfect virtue   100     <       121
checkHit(smooth)        20      28.313454443228 => chance to hit        35.318897664187
checkHit(smooth)        20      28.313454443228 => chance to hit        35.318897664187
[LOG]   Islata the giant carpenter ant deactivates Stealth.
[ATTACK] attacking with iron dagger of crippling
[ATTACK] to     ape of perfect virtue    ::     23.738903287893 5       7       3.4     ::      1.2
checkHit(smooth)        30      3.4     => chance to hit        86.338797814208
[ATTACJ] dagger accuracy bonus  30      3.4     =       1.133   previous        5
[ATTACK] raw dam        23.738903287893 versus  7       0.3     with APR        5.665
[ATTACK] after armor    22.403903287893
[ATTACK] after range    25
[PHYS CRIT %]   23.724165215536
[ATTACK] after crit     41.330427464995
[ATTACK] after mult     49.596512957994
[LOG]   #{bold}##UID:6985:0#Islata the giant carpenter ant performs a melee critical strike against #fbd578#ape of perfect virtue#LAST#!#{normal}#
[PROJECTOR] starting dam        49.596512957994
[PROJECTOR] after crit power reduce dam 49.596512957994
[PROJECTOR] after difficulty dam        49.236512957994
[PROJECTOR] res 0       1        on dam 34.465559070595
[PROJECTOR] after resists dam   34.465559070595
[PROJECTOR] after flat damage armor     34.465559070595
[PROJECTOR] final dam after static checks       34.465559070595
[PROJECTOR] final dam after hooks and callbacks 34.465559070595
[ENGINE] Setting requested FPS to 30 (33 ms)
[LOG]   Ran for 2 turns (stop reason: taken damage).
[ENGINE] Setting requested FPS to 30 (33 ms)
checkHit(smooth)        9.45    30      => chance to hit        24.660912453761
[ENGINE] Setting requested FPS to 30 (33 ms)
[ENGINE] Setting requested FPS to 30 (33 ms)
checkHit(smooth)        9.45    30      => chance to hit        16.366612111293
[ENGINE] Setting requested FPS to 30 (33 ms)
[ENGINE] Setting requested FPS to 30 (33 ms)
[LOG]   Ape of perfect virtue is crippled.
[ATTACK] attacking with iron dagger of crippling
[ATTACK] to     ape of perfect virtue    ::     24.055554894568 5       7       3.4     ::      0.6
checkHit(smooth)        30      3.4     => chance to hit        86.338797814208
[ATTACJ] dagger accuracy bonus  30      3.4     =       1.133   previous        5
[ATTACK] raw dam        24.055554894568 versus  7       0.3     with APR        5.665
[ATTACK] after armor    22.720554894568
[ATTACK] after range    23
[PHYS CRIT %]   23.724165215536
[ATTACK] after crit     23
[ATTACK] after mult     13.8
[PROJECTOR] starting dam        13.8
[PROJECTOR] after difficulty dam        13.8
[PROJECTOR] res 0       1        on dam 9.66
[PROJECTOR] after resists dam   9.66
[PROJECTOR] after flat damage armor     9.66
[PROJECTOR] final dam after static checks       9.66
[PROJECTOR] final dam after hooks and callbacks 9.66
[ENGINE] Setting requested FPS to 30 (33 ms)
[ENGINE] Setting requested FPS to 30 (33 ms)
[SOUND] loading from    /data/sound/creatures/ants/ant_2.ogg    :=:     sound "/data/sound/creatures/ants/ant_2.ogg" : <static>
[ENGINE] Setting requested FPS to 30 (33 ms)
[ENGINE] Setting requested FPS to 30 (33 ms)
[LOG]   Ape of perfect virtue is dazed!
[PROJECTOR] starting dam        4.2129901067143
[PROJECTOR] after difficulty dam        4.2129901067143
[PROJECTOR] res 0       1        on dam 2.1064950533572
[PROJECTOR] after resists dam   2.1064950533572
[PROJECTOR] after flat damage armor     2.1064950533572
[PROJECTOR] numbed dam  1.7905207953536
[PROJECTOR] final dam after static checks       1.7905207953536
[PROJECTOR] final dam after hooks and callbacks 1.7905207953536
[LOG]   #UID:1913:0##fbd578#ape of perfect virtue#LAST# hits Islata the giant carpenter ant for #LIGHT_RED#2 fire#LAST# damage.
[LOG]   #UID:6985:0#Islata the giant carpenter ant hits #fbd578#ape of perfect virtue#LAST# for #{bold}##aaaaaa#34 physical#{normal}##LAST#, #aaaaaa#10 physical#LAST# (44 total damage).
Lua Error: /mod/class/uiset/Minimalist.lua:1445: bad argument #2 to 'getDisplayName' (number expected, got nil)
        At [C]:-1
        At [C]:-1 getDisplayName
        At /mod/class/uiset/Minimalist.lua:1445 displayBuffs
        At /mod/class/uiset/Minimalist.lua:2138 base_display
        At /mod/addons/qqq/superload/mod/class/uiset/Minimalist.lua:30 display
        At /mod/class/Game.lua:1473 

Code: Select all

AI took for target      8214    Eilinokira the copperhead snake ::      1932    ape of perfect virtue   9       <       100
[MIND CRIT %]   1
[PROJECTOR] starting dam        59.411176710274
[PROJECTOR] after difficulty dam        59.411176710274
[PROJECTOR] res 0       1        on dam 43.964270765603
[PROJECTOR] after resists dam   43.964270765603
[PROJECTOR] after flat damage armor     43.964270765603
[PROJECTOR] final dam after static checks       43.964270765603
[PROJECTOR] final dam after hooks and callbacks 43.964270765603
[ENGINE] Setting requested FPS to 30 (33 ms)
[LOG]   Ran for 2 turns (stop reason: taken damage).
[ENGINE] Setting requested FPS to 30 (33 ms)
checkHit(smooth)        10.15   20.4    => chance to hit        33.057851239669
checkHit(smooth)        10.15   20.4    => chance to hit        24.691358024691
[ENGINE] Setting requested FPS to 30 (33 ms)
[ENGINE] Setting requested FPS to 30 (33 ms)
[LOG]   Ape of perfect virtue is disarmed!
[LOG]   Something hits #fbd578#ape of perfect virtue#LAST# for #GREEN#44 acid#LAST# damage.
[LOG]  
Loading tile    talents/disarm.png
[SPELL] friendly fire chance    100
[SPELL] friendly fire chance    100
[LOG]   Ape of perfect virtue rearms.
[TARGET] Passing target ancient elven mummy     from    Eilinokira the copperhead snake to      ape of perfect virtue
[ATTACK] attacking with warbringer's iron battleaxe of crippling
[ATTACK] to     ape of perfect virtue    ::     39.397882199599 1       7       2.7     ::      1.2
checkHit(smooth)        28.5    2.7     => chance to hit        86.033519553073
[ATTACK] raw dam        39.397882199599 versus  7       0.3     with APR        1
[ATTACK] after armor    33.397882199599
[ATTACK] after range    35
[PHYS CRIT %] axe accuracy bonus        28.5    2.7     =       5.16
[PHYS CRIT %]   18.66
[ATTACK] after crit     52.5
[ATTACK] after mult     63
[LOG]   #{bold}##UID:8214:0#Eilinokira the copperhead snake performs a melee critical strike against #fbd578#ape of perfect virtue#LAST#!#{normal}#
[PROJECTOR] starting dam        63
[PROJECTOR] after crit power reduce dam 63
[PROJECTOR] after difficulty dam        62.748
[PROJECTOR] res 0       1        on dam 46.43352
[PROJECTOR] after resists dam   46.43352
[PROJECTOR] after flat damage armor     46.43352
[PROJECTOR] final dam after static checks       46.43352
[PROJECTOR] final dam after hooks and callbacks 46.43352
[ENGINE] Setting requested FPS to 30 (33 ms)
[ENGINE] Setting requested FPS to 30 (33 ms)
checkHit(smooth)        10.15   28.5    => chance to hit        26.075619295958
[ENGINE] Setting requested FPS to 30 (33 ms)
[ENGINE] Setting requested FPS to 30 (33 ms)
checkHit(smooth)        10.15   28.5    => chance to hit        17.636684303351
[ENGINE] Setting requested FPS to 30 (33 ms)
[ENGINE] Setting requested FPS to 30 (33 ms)
[LOG]   Ape of perfect virtue is crippled.
[ENGINE] Setting requested FPS to 30 (33 ms)
[ENGINE] Setting requested FPS to 30 (33 ms)
[LOG]   Ape of perfect virtue is dazed!
[SPELL] friendly fire chance    100
[LOG]   #UID:8214:0#Eilinokira the copperhead snake hits #fbd578#ape of perfect virtue#LAST# for #{bold}##aaaaaa#46 physical#{normal}##LAST# damage.
[LOG]  
Loading tile    talents/cripple.png
Loading tile    effects/dazed.png
Loading tile    effects/offbalance.png
[SAVEPTS] checkpoint bx=256 by=57
[SAVEPTS] checkpoint bx=291 by=87
[MOUSE] pre starting drag'n'drop
[LOG]   Ape of perfect virtue casts Teleport.
AI took for target      8428    fire drake hatchling    ::      1932    ape of perfect virtue   16      <       100
AI took for target      8430    fire drake hatchling    ::      1932    ape of perfect virtue   9       <       100
AI took for target      8432    fire drake hatchling    ::      1932    ape of perfect virtue   9       <       100
AI took for target      8434    fire drake hatchling    ::      1932    ape of perfect virtue   16      <       100
[SPELL] friendly fire chance    100
Lua Error: /mod/class/uiset/Minimalist.lua:1445: bad argument #2 to 'getDisplayName' (number expected, got nil)
        At [C]:-1
        At [C]:-1 getDisplayName
        At /mod/class/uiset/Minimalist.lua:1445 displayBuffs
        At /mod/class/uiset/Minimalist.lua:2138 base_display
        At /mod/addons/qqq/superload/mod/class/uiset/Minimalist.lua:30 display
        At /mod/class/Game.lua:1473 

Hirumakai
Thalore
Posts: 192
Joined: Wed Aug 11, 2010 2:39 pm

Re: Improved player targetting

#15 Post by Hirumakai »

Stinkstink, I believe that bug is actually something specific to Spellsword, not this addon.

I've been trying to track it down yesterday, but since I've only had it occur once for me its somewhat difficult. I'm having trouble replicating it consistently. Plus the error message is basically only cropping up in the UI but clearly the seed of the problem is generated elsewhere.

I'll try taking a look to see if its related to a cripple/Spellsword interaction.

Edit: I think I found the issue in the Earth Shield talent. Apparently the self.earthen_shield_absorb variable is somehow getting set to nil at one point or another. It was then being called in a getDisplayName custom function in Earth shield (which tries to print the hit points in the title), but I had forgotten to sanity check it (the usual "blah or 0"). If you grab the latest Spellsword push, it may prevent this issue in the future. Since the display name wasn't refreshing anyways, I just removed the custom title for it. While testing I also discovered Earthen Shield wasn't actually reducing damage. So that should be fixed now.

Just to confirm, did you have Earthen Shield on the character?

Post Reply