[MOD] cannons with a lot of features! [2.5] [cannons]

User avatar
GreenXenith
Member
Posts: 1356
Joined: Wed Oct 28, 2015 01:26
GitHub: GreenXenith
Location: UTC-8:00
Contact:

Re: [MOD] cannons with a lot of features! [2.5] [cannons]

by GreenXenith » Post

Great mod!
2 things:
1) If I place a cannon ball (confirmed single ball, not sure about stacks of 2-5) and punch it, the game crashes "functions.lua:373: attempt to compare number with nil"
2) None of the ammo (including the apple) hurt mobs/players, though they should?
YouTube | Mods | Patreon | Minetest Discord @greenxenith

You should not be able to read this message.

User avatar
addi
Member
Posts: 666
Joined: Thu Sep 20, 2012 03:16
GitHub: adrido
Location: Black-Forest, Germany

Re: [MOD] cannons with a lot of features! [2.5] [cannons]

by addi » Post

hmm sorry, but I cant reproduce your issues.
to 1) does it only happen wielding a special item? What lua version do you use? Maybe does another mod overwrite lua's 'tonumber()' function? What other mods do you have installed?
I think I probably solved it, could you please test it with the latest version? https://bitbucket.org/kingarthursteam/c ... master.zip
to 2) I tested it with 3d_armor, mobf and mobs_redo and it works well there. Do you use a different mobs/ armor mod? if yes, which one? It might sound a bit stupid, but do you have damage enabled? ;-) The apple's are a "hidden feature" or "easter egg" (you found it :-D ) and they cause negative damage, which means they heal players :-)

Thanks for reporting the issues, but I need more information to be able to help you.

User avatar
GreenXenith
Member
Posts: 1356
Joined: Wed Oct 28, 2015 01:26
GitHub: GreenXenith
Location: UTC-8:00
Contact:

Re: [MOD] cannons with a lot of features! [2.5] [cannons]

by GreenXenith » Post

addi wrote:to 1) does it only happen wielding a special item? What lua version do you use? Maybe does another mod overwrite lua's 'tonumber()' function? What other mods do you have installed?
I think I probably solved it, could you please test it with the latest version? https://bitbucket.org/kingarthursteam/c ... master.zip
to 2) I tested it with 3d_armor, mobf and mobs_redo and it works well there. Do you use a different mobs/ armor mod? if yes, which one? It might sound a bit stupid, but do you have damage enabled? ;-)
1) Alright. Enabling only the cannon mod fixes this... will have to test with other mods. EDIT: Tested with other mods. It is fixed.
2) Yes, I have damage enabled. Even if I only have this mod enabled, the cannon still does not hurt anyone. As for armor/mobs mods I use, I use 3d_armor and mobs_redo.
YouTube | Mods | Patreon | Minetest Discord @greenxenith

You should not be able to read this message.

User avatar
GreenXenith
Member
Posts: 1356
Joined: Wed Oct 28, 2015 01:26
GitHub: GreenXenith
Location: UTC-8:00
Contact:

Re: [MOD] cannons with a lot of features! [2.5] [cannons]

by GreenXenith » Post

Perhaps it is not detecting the player hit-box for some reason? I dunno :P
YouTube | Mods | Patreon | Minetest Discord @greenxenith

You should not be able to read this message.

User avatar
addi
Member
Posts: 666
Joined: Thu Sep 20, 2012 03:16
GitHub: adrido
Location: Black-Forest, Germany

Re: [MOD] cannons with a lot of features! [2.5] [cannons]

by addi » Post

Well the cannonball checks every server step for existing objects nearby, which is normally fast enough.A more exactly way way would be if Minetest would provide a api like "get_objects_inside_ray(pos1,pos2)" but it seems I have to write that algorithm by myself. But you might have to wait some months, because i does not have much time, and there are more important things to do.

User avatar
Hybrid Dog
Member
Posts: 2835
Joined: Thu Nov 01, 2012 12:46
GitHub: HybridDog

Re: [MOD] cannons with a lot of features! [2.5] [cannons]

by Hybrid Dog » Post

addi, there's a PR for adding such a function:
https://github.com/minetest/minetest/pull/4421

‮‪‮
‮‪‮
‮‪‮
‮‪‮
‮‪‮
‮‪‮
‮‪‮
‮‪‮
‮‪

User avatar
addi
Member
Posts: 666
Joined: Thu Sep 20, 2012 03:16
GitHub: adrido
Location: Black-Forest, Germany

Re: [MOD] cannons with a lot of features! [2.5] [cannons]

by addi » Post

yeah, but sadly they does not want to merge it, because its only a server side function, and not available for clientside mods. (server side would be enough for this usecase). :-(

User avatar
addi
Member
Posts: 666
Joined: Thu Sep 20, 2012 03:16
GitHub: adrido
Location: Black-Forest, Germany

Re: [MOD] cannons with a lot of features! [2.5] [cannons]

by addi » Post

In the dev branch I added the new raycast for hit detection. Thanks to all that made it possible!
GreenDiamond, could you please test it, and tell me if it works for you? Of course, you need a recent Minetest version.
Download: https://bitbucket.org/kingarthursteam/c ... et/dev.zip (indev version probably unstable!)

User avatar
GreenXenith
Member
Posts: 1356
Joined: Wed Oct 28, 2015 01:26
GitHub: GreenXenith
Location: UTC-8:00
Contact:

Re: [MOD] cannons with a lot of features! [2.5] [cannons]

by GreenXenith » Post

I tried it and it still does not work. Maybe I am missing a setting or something..
Sometimes it says "You hit a mob!" but the player didn't take any damage...
I tried on both 0.4.16-stable and 0.4.16-daily. Neither worked. Damage and PVP is enabled.
YouTube | Mods | Patreon | Minetest Discord @greenxenith

You should not be able to read this message.

User avatar
addi
Member
Posts: 666
Joined: Thu Sep 20, 2012 03:16
GitHub: adrido
Location: Black-Forest, Germany

Re: [MOD] cannons with a lot of features! [2.5] [cannons]

by addi » Post

just fixed a typo, but I dont think that its solved. Could you check it anyway?

If it shows the "you hit a mob" message, but the mob does not take any damage, there might be something wrong with the mobs mod.
in mobs_redo could you change the line https://github.com/tenplus1/mobs_redo/b ... .lua#L2092 to something like minetest.log("error", "Mob Damage is".. damage) then you would be able to see if at least the mob notices it, and how much damage it takes

User avatar
GreenXenith
Member
Posts: 1356
Joined: Wed Oct 28, 2015 01:26
GitHub: GreenXenith
Location: UTC-8:00
Contact:

Re: [MOD] cannons with a lot of features! [2.5] [cannons]

by GreenXenith » Post

addi wrote:If it shows the "you hit a mob" message, but the mob does not take any damage, there might be something wrong with the mobs mod.
in mobs_redo could you change the line https://github.com/tenplus1/mobs_redo/b ... .lua#L2092 to something like minetest.log("error", "Mob Damage is".. damage) then you would be able to see if at least the mob notices it, and how much damage it takes
Well, I was aiming at a player entity. After ~10 shots it finally "hit" the player, but the only thing that happened was the "you hit a mob" but the player did not take damage.
Will test soon.
YouTube | Mods | Patreon | Minetest Discord @greenxenith

You should not be able to read this message.

juli
Member
Posts: 217
Joined: Sat Jun 11, 2016 10:31
GitHub: cpdef
In-game: juli

Re: [MOD] cannons with a lot of features! [2.5] [cannons]

by juli » Post

I found out in the code that the entity checks only all 0.3 seconds for objects around, i increased it to 0.01 seconds and then i could kill players, the lag ws also not so much

User avatar
BrunoMine
Member
Posts: 1082
Joined: Thu Apr 25, 2013 17:29
GitHub: BrunoMine
Location: SP-Brasil
Contact:

Re: [MOD] cannons with a lot of features! [2.5] [cannons]

by BrunoMine » Post

Very nice.
Cannons should shoot in a more restricted direction (not to shoot backwards, which is very strange).

Post Reply

Who is online

Users browsing this forum: No registered users and 59 guests