• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!

Programmer tfs 1.2 function getDamageMap() (bugged)

Skarioastto

New Member
Joined
Jun 27, 2017
Messages
4
Reaction score
0
I tested the same function in tfs 1.3 and everything goes normal (print all players).
Lua:
function onDeath(creature, corpse, killer, mostDamageKiller, lastHitUnjustified, mostDamageUnjustified)
        for cid, damage in pairs(creature:getDamageMap()) do
            local killer = Creature(cid)
            if killer:isPlayer() then
                print(killer:getName())
            end
        end
    return true
end

I need someone to fix this function in tfs 1.2.
We will match the price before the service!
Send me a message and say your price.
 
Did you make sure to register the creature with the event?
 
Did you make sure to register the creature with the event?
Yes, and i tested in 1.3 source code the same script. In 1.3 it works fine. (print all players)
But in tfs 1.2 it print only the last hit.
Need someome to FIX it in 1.2 source code (8.6)
 
I haven't tested out nor checked why damagemap is bugged... as there could be many influences...

If you want to accurately count the damage, create a onhealthchange creaturescript, that will add all damage together in a storage value. Much more reliable (tfs 1.3 user).

(Add some resetpoints so u won't stack damage from other mobs too, or other issues that you might encounter with).

Animera
 
I haven't tested out nor checked why damagemap is bugged... as there could be many influences...

If you want to accurately count the damage, create a onhealthchange creaturescript, that will add all damage together in a storage value. Much more reliable (tfs 1.3 user).

(Add some resetpoints so u won't stack damage from other mobs too, or other issues that you might encounter with).

Animera
I don't need to count the damage accurately, I just need to know who attacked the monster when the monster dies.
Players who have hited the monster will gain some storage.
But to gain storage you must have dealt at least 1 damage.
 
You could use game get spectators to check storage value of all players in radius...
(This won't guarantuee for dead players in temple or w/e) You could loop through all online players, but that's as far as i know more heavy in performance usage(depends on the amount of players tho, and how often the script triggers).
 
does not work, because even if the player has not hit a monster, he will gain the storage.
I need player gain storage only if deal at least 1 of dmg.
You could use game get spectators to check storage value of all players in radius...
(This won't guarantuee for dead players in temple or w/e) You could loop through all online players, but that's as far as i know more heavy in performance usage(depends on the amount of players tho, and how often the script triggers).
 
if you create a counter for getting damage, you can check if the damage counter of all players in the radius is higher as 0 and if it does, give x storage?

Works for me too.
 
Back
Top