-
Notifications
You must be signed in to change notification settings - Fork 42
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
No armor damage from mobs #24
Comments
I did a fair bit of testing around this and can confirm the issue for the current versions of MTG+3d_armor and mobs_monsters. I also tried going back to old versions and for the life of me I couldnt get the armor to take damage all the way back to version MTG 0.4.17 and 3d_armor 0.4.12. of course I have no clue when the cool little armor damage bars were added. I don't know how many times I died with wood armor on different versions but pretty sure they should have broken. I'm in singleplayer I havent tried to test on a server but maybe the bug dosen't present for servers? I did skim the code for 3d_armor versions 0.4.10 to 0.4.17 and the code block highlighted above for armor.punch changed in 0.4.10>>0.4.11 significantly, 0.4.11>>0.4.16 no code change, 0.4.17 minor addition of set_state and set_count I'm very confused myself as Im pretty sure Ive had armor break before under old versions using mobs monsters but maybe im not remebering correctly, it would seem highly unlikely a bug like this has persisted since 2018-ish... I can confirm the fix suggested by daretmavi - commenting out "damage = false" fix's the damage issue to armor. I did write this little code block which explcitly just allows the groupscaps==nil to cause damage but shouldn't allow any other cases to be set to true if there are any...I admit I dont understand the code enough, its possible setting to false there is uneeded but it looks very specific to me and like it is needed for something....
I do find setting the above armor degrades very fast, how many hits should wood armor last? a fresh set at full health being attacked by a mobs spider lost about 15% just before death....I can probably go look the formula up in the api :). I'll keep tryign to poking around :) |
I've been on the look out for other evidence this defect has been around for awhile and found the odd comment on the forum board and more importantly this on Stu's version: cross linking here as it provides a 3rd confirmed report. I'm still trying to workout why the default==false is there but given the importance of a fix is it worth me doing a pull request with those 4 lines of code I added as an initial workaround fix? or happy for me too keep looking or is someone more lua experienced also looking at this - I don't mind whichever :) |
the changes proposed from @daretmavi look relatively sane 👍 , a PR would be nice even if it is just a (hopefully) temporary workaround |
Im working on the pull request using @daretmavi fix, Im just working through the code and Im not sure # is the bets to use as I'm pretty sure groupcaps table is structured as a non-numeric table, eg:
and #table_name in lua has problems counting non-numeric enteries in a table so Im a bit worried that potentially we could enter the groupcaps for loop below this with damage=true instead of damage=false that its expecting to start with. How about this as a fix I used @daretmavi idea just flipped it a little and used next?:
Code would end up
Im very very happy to take feedback I am not very experienced with lua I just fell over that #table thing once when I was doing something else, but if its not an issue happy to go with the orginal code suggested :) |
Hi,
|
Using |
thanks both, I'll finish up some testing and then do a pull request if it all looks good. @daretmavi if your interested in the weirdness of # push the below code into the https://www.lua.org/cgi-bin/demo site and run. My expectation was the same as yours from reading the lua doco both t1/t2 should =2 when using #. I got very frustrated nailing a bug down which turned out to be how # works in lua - I think of it now as useful only for numerical stuff but I know that's an over simplification :)
|
Ignore Issue 1 and 2 above, I thought 3d_armor had more functionality than it does. Im guessing Stu must have had something planned but never implimented it :) Issue 3 still a bit of a concern although I've been able to identify the code were thats assigned and have a wip fix/improvement |
Found this from stu on a mt engine thread _ The problem I have, as others have pointed out, is the lack of precision and the reason I added the 'healing' properties to armor. @Ekdohibs has an interesting suggestion which is effectively the opposite of this and might be worth looking into. Max health is now settable as a player object property. This is indeed a step in the right direction, however, it needs to be implemented by the game. I do not think it would be right for the armor mod to interfere with this. IMO a resolution of 100 would suffice and it should be possible to depict the hearts in approximate tenths. Wear only happens when a player gets fall damage. By default armor takes wear according to the tooldef of the weapon used, it was intended to work much like digging the armor material. It is up to mob modders to pass a valid tooldef when punching the player. I might add that armor also takes damage when the player is hurt for any other reason (such as falling). This is necessary to overcome the problem of mods that simply ignore the built-in damage mechanism and set player HPs directly, the tnt mod does this, irrc. |
I"ll just summarize my thoughts below: Short I think the application of wear to armor should be addressed but as a separate enhancement/change , given the unknown impact that may have on PVP combat damage to armor which i think 3d_armor is used for pretty broadly on servers and should currently be behaving correctly, I don't think risking stuffing that up is worth a hurried change. Long
I'm not entirely sure first if its possible to store all those metrics against an entity, I assume they can be but it doesn't seem like a trivial update to me as it would mean changes to the entity template then changes to the damage handling code to ensure those new values are sent, worse still many mob frameworks are currently not being worked on - which would leave this as a persistent problem. |
I looked a tiny bit more at the issue of mobs having groups and capabilities. I did my looking at mobs:redo api, started with the nice simple damage stuff: So all damage from mobs is assumed to be fleshy (thats physical attack only not shooting) The base template assumes a number for damage and has a difficulty multiplier applied to the damage So to have radioactive spiders dishing out damage not in the fleshy group is going to take a little bit of work, but looks like it could be achievable. I didnt dig very far at the moment just cursory look and putting this info here so I dont have to hunt all those lines up later if I want to dig a bit more. |
hi i know that maybe cannot be significant enought but maybe the issue #57 has nothing to do with? it defines |
* backport minetest-mods@3b97763 * it try to fix the problem of minetest-mods#24
* backport minetest-mods@3b97763 * it try to fix the problem of minetest-mods#24
* Added now complete feature of Divide armor wear amongst number of pieces worn backported minetest-mods@3ddcbae * Added equip, unequip and get_weared_armor_elements functions backporting minetest-mods@294338d * Added remove_all function backported from minetest-mods@e34635c * finally fix for issue minetest-mods#24 but backported for minetest 0.4 and 4.0
No damage to armor from monster attacs.
Test procedure:
It looks like there is a local variable "damage" set to false and the never come back to true, because mobs hat no groupcaps:
E.g. oerkki groupcaps:
Temporary solution could be to set damage = true when no groupcaps defined?
The text was updated successfully, but these errors were encountered: