Disable sprint mod while using speed boots

Post Reply
CariceHouten

Disable sprint mod while using speed boots

by CariceHouten » Post

Hello, I created a mod including speed boots but the problem is that when a player sprint while wearing these boots, the effect of the speed boots stops. Is there a way to fix that please ?

User avatar
joe7575
Member
Posts: 851
Joined: Mon Apr 24, 2017 20:38
GitHub: joe7575
In-game: JoSto wuffi
Location: Germany, in the deep south

Re: Disable sprint mod while using speed boots

by joe7575 » Post

This sounds like my problem with the autobahn mod (some kind of speed boots) and stamina (some kind of sprint mod).
What you need is an exclusive control over player physics and privs.
My approach for this is: https://github.com/joe7575/techage_mode ... pattern.md

It is currently implemented in the following GitHub mods:
- joe7575/ta4_paraglider
- joe7575/ta4_jetpack
- joe7575/autobahn
- joe7575/stamina
- minetest-mods/3d_armor
- minetest-mods/towercrane

All this mods use the following locking pattern:

Code: Select all

local meta = player:get_meta()
-- Check access conflicts with other mods
if meta:get_int("player_physics_locked") == 0 then
	meta:set_int("player_physics_locked", 1)
	. . . 
Sent from my Commodore 64. Some of my Mods: Tech Age, TechPack, Hyperloop, Tower Crane, Lumberjack, vm16, Minecart, Signs Bot.

User avatar
runs
Member
Posts: 3225
Joined: Sat Oct 27, 2018 08:32

Re: Disable sprint mod while using speed boots

by runs » Post

This is the reason for this PR is important:

Add physics modifier API

What we have now is a hijacking of mod functionality for player physics. Because to be honest, who can stop any modder with any mod from making an override. And you do not avenge me with the honesty of the people. Besides there are a lot of old mods who do whatever they want.

Either that PR or that a game can VET certain ContentDB mods, a black list.

User avatar
joe7575
Member
Posts: 851
Joined: Mon Apr 24, 2017 20:38
GitHub: joe7575
In-game: JoSto wuffi
Location: Germany, in the deep south

Re: Disable sprint mod while using speed boots

by joe7575 » Post

runs wrote:
Sat Apr 17, 2021 10:05
This is the reason for this PR is important:

Add physics modifier API
But this is about an additive feature and it only covers player physics, right?

But what I need is something exclusive. If a player wears special boots or uses special tools, these mod should have exclusive access to the player attributes. A combination of such attributes is not helpful.

And even more, if a player e.g. uses the towercrane mod (controlled fly privs), it makes no sense to try to use speed boots, the autobahn mod, or any other flying tool at the same time.

If you do not protect one against the other, you will see sometimes funny, but sometimes annoying effects.
Sent from my Commodore 64. Some of my Mods: Tech Age, TechPack, Hyperloop, Tower Crane, Lumberjack, vm16, Minecart, Signs Bot.

User avatar
runs
Member
Posts: 3225
Joined: Sat Oct 27, 2018 08:32

Re: Disable sprint mod while using speed boots

by runs » Post

joe7575 wrote:
Sat Apr 17, 2021 12:18
runs wrote:
Sat Apr 17, 2021 10:05
This is the reason for this PR is important:

Add physics modifier API
But this is about an additive feature and it only covers player physics, right?

But what I need is something exclusive. If a player wears special boots or uses special tools, these mod should have exclusive access to the player attributes. A combination of such attributes is not helpful.

And even more, if a player e.g. uses the towercrane mod (controlled fly privs), it makes no sense to try to use speed boots, the autobahn mod, or any other flying tool at the same time.

If you do not protect one against the other, you will see sometimes funny, but sometimes annoying effects.
Negative values too. So you can counteract previous effects, even nullify.

Of course, it will be more difficult to implement, much more difficult than taking full control. But it would be the right thing to do. Disabling other mods is acting like a virus.

For example, imagine if I made my Petz attack all the other mobs from other mods and kill them. Or even override them, could I do that if I felt like it? Yes (nothing would prevent me from doing so, I suppose so hahaha). Would it be ethical? No.

Modders make the mods they feel like. In the end the user decides what mods to install and what not to install. But modders should work as if it were an ecosystem. This would be ideal.

IMO.

Post Reply

Who is online

Users browsing this forum: No registered users and 9 guests