[Mod] Another knockback mod [knockback]

Post Reply
User avatar
Lone_Wolf
Member
Posts: 2361
Joined: Sun Apr 09, 2017 05:50
GitHub: LoneWolfHT
IRC: Lone_Wolf or LoneWolfHT
In-game: Lone_Wolf
Location: Not there, THERE!

[Mod] Another knockback mod [knockback]

by Lone_Wolf » Post

Another knockback mod

A knockback mod for pre-5.1 Minetest clients that uses RayCast() and move_to() to fling the player backwards. No entities are used

Downloads: Latest Stable

View: On ContentDB
View: Source Code

License: MIT

Depends: None
Optional Depends: None

A few test players were harmed a couple hundred times during the making of this mod
Last edited by Lone_Wolf on Mon Feb 10, 2020 00:22, edited 2 times in total.

User avatar
Joseph16
Member
Posts: 308
Joined: Tue Dec 06, 2016 05:35
In-game: Joseph16

Re: [Mod] Another Knockback Mod [knockback]

by Joseph16 » Post

A few test players were harmed a couple hundred times during the making of this mod.....
Me and my brother tested this and I can confirm this to be true
Testin' mines since 1989

User avatar
Joseph16
Member
Posts: 308
Joined: Tue Dec 06, 2016 05:35
In-game: Joseph16

Re: [Mod] Another Knockback Mod [knockback]

by Joseph16 » Post

setting dir.y to 0 has no effect. Also, it is set to 0 by default when you get the mod.
Testin' mines since 1989

User avatar
Lone_Wolf
Member
Posts: 2361
Joined: Sun Apr 09, 2017 05:50
GitHub: LoneWolfHT
IRC: Lone_Wolf or LoneWolfHT
In-game: Lone_Wolf
Location: Not there, THERE!

Re: [Mod] Another Knockback Mod [knockback]

by Lone_Wolf » Post

Joseph13 wrote:setting dir.y to 0 has no effect. Also, it is set to 0 by default when you get the mod.
Replace lines 9 to 11 with dir.y = 0

https://github.com/LoneWolfHT/knockback ... nit.lua#L9

User avatar
Joseph16
Member
Posts: 308
Joined: Tue Dec 06, 2016 05:35
In-game: Joseph16

Re: [Mod] Another Knockback Mod [knockback]

by Joseph16 » Post

Doesn't work.
Testin' mines since 1989

User avatar
Lone_Wolf
Member
Posts: 2361
Joined: Sun Apr 09, 2017 05:50
GitHub: LoneWolfHT
IRC: Lone_Wolf or LoneWolfHT
In-game: Lone_Wolf
Location: Not there, THERE!

Re: [Mod] Another Knockback Mod [knockback]

by Lone_Wolf » Post

Joseph13 wrote:Doesn't work.
Whoops, now change this line https://github.com/LoneWolfHT/knockback ... it.lua#L19
to pos.y = pos.y + 0.1

User avatar
Joseph16
Member
Posts: 308
Joined: Tue Dec 06, 2016 05:35
In-game: Joseph16

Re: [Mod] Another Knockback Mod [knockback]

by Joseph16 » Post

Already tried that and it has barely any effect at all. If I set it to 0 it makes the player go under the ground by a block.
Testin' mines since 1989

User avatar
Lone_Wolf
Member
Posts: 2361
Joined: Sun Apr 09, 2017 05:50
GitHub: LoneWolfHT
IRC: Lone_Wolf or LoneWolfHT
In-game: Lone_Wolf
Location: Not there, THERE!

Re: [Mod] Another Knockback Mod [knockback]

by Lone_Wolf » Post

Joseph13 wrote:Already tried that and it has barely any effect at all. If I set it to 0 it makes the player go under the ground by a block.
It worked for me
Changing the y movement to 0 won't fix the jerkiness. The player is being teleported a small distance away from their attacker

User avatar
Joseph16
Member
Posts: 308
Joined: Tue Dec 06, 2016 05:35
In-game: Joseph16

Re: [Mod] Another Knockback Mod [knockback]

by Joseph16 » Post

Yeah, I will just leave it as it is. Hopefully when the devs make knockback an official thing it will be less jerky.
Testin' mines since 1989

User avatar
Joseph16
Member
Posts: 308
Joined: Tue Dec 06, 2016 05:35
In-game: Joseph16

Re: [Mod] Another Knockback Mod [knockback]

by Joseph16 » Post

Would It be possible to get the velocity of the puncher and also use that for knockback? Like if the puncher is walking towards the player getting hit then it does a lot more knockback?
Testin' mines since 1989

User avatar
Lone_Wolf
Member
Posts: 2361
Joined: Sun Apr 09, 2017 05:50
GitHub: LoneWolfHT
IRC: Lone_Wolf or LoneWolfHT
In-game: Lone_Wolf
Location: Not there, THERE!

Re: [Mod] Another Knockback Mod [knockback]

by Lone_Wolf » Post

Joseph13 wrote:Would It be possible to get the velocity of the puncher and also use that for knockback? Like if the puncher is walking towards the player getting hit then it does a lot more knockback?
I don't think that would work too well. In PvP players are usually always moving. So I might as well just increase the knock back a little

User avatar
Joseph16
Member
Posts: 308
Joined: Tue Dec 06, 2016 05:35
In-game: Joseph16

Re: [Mod] Another Knockback Mod [knockback]

by Joseph16 » Post

Ok
Testin' mines since 1989

User avatar
Lone_Wolf
Member
Posts: 2361
Joined: Sun Apr 09, 2017 05:50
GitHub: LoneWolfHT
IRC: Lone_Wolf or LoneWolfHT
In-game: Lone_Wolf
Location: Not there, THERE!

Re: [Mod] Another knockback mod [knockback]

by Lone_Wolf » Post

Minetest has knockback builtin now since 5.1 IIRC. So this mod is no longer useful for people with 5.1+
:thunderous_cheering:

Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest