[Mod] Pep: Player Effect Potions [1.5.0] [pep]

User avatar
Wuzzy
Member
Posts: 4780
Joined: Mon Sep 24, 2012 15:01
GitHub: Wuzzy2
IRC: Wuzzy
In-game: Wuzzy
Contact:

[Mod] Pep: Player Effect Potions [1.5.0] [pep]

by Wuzzy » Post

This is a little mod by my which adds some simple potions. I call it “Player Effect Potions” or short “Pep”.

The potions affect walking speed, jump height, player gravity, breath, health, mana and there is also a simple digging effect. Potions can apply an effect temporarily or neutralize existing effects.

Image

Click here to learn about the particular potions (also included in README file):
Spoiler
All crafting recipes are shapeless.

Air potion: Gives you breath underwater for 30s.
Craft: 8 papyri, 1 glass bottle


Non-gravity potion:
Disabled the gravity for you, for 20s.
Craft: 1 mese crystal, 1 mese crystal

Gravity neutralizer:
Clears all gravity effects. This means, if normal gravity is Earth-like gravity, you will fall again.
Craft: 1 non-gravity potion, 1 iron lump



High jumping potion:
Lets you jump higher for 30s.
Craft: 1 orange tulip, 1 grass, 2 mese crystal fragments, 1 glass bottle

Low jumping potion:
Makes you jump lower for 30s.
Craft: 1 leaves block, 1 jungle leaves block, 1 iron lump, 1 yellow dandelion, 1 glass bottle

Jump neutralier:
Clears all jump effects.
Craft: 1 high jumping potion, 1 low jumping potion.



Weak healing potion:
Gives you 1 HP every 2 seconds, 10 times.
Craft: 1 cactus, 1 flour, 1 brown mushroom, 1 glass bottle.

Strong healing potion
Gives you 2 HP every second, 10 times.
Craft: 1 gold lump, 1 flour, 1 weak healing potion.



Running potion:
Makes you run faster for 30s.
Craft: 1 pine sapling, 1 cactus, 1 yellow dandelion, 1 jungle grass, 1 glass bottle.

Slug potion:
Makes you walk slower for 30s.
Craft: 1 dry grass, 1 ice, 1 glass bottle.

Speed neutralizer:
Clears all running speed effects.
Craft: 1 running potion, 1 slug potion.

Mole potion:
Will dig out the two blocks in front of you for 18 seconds.
Craft: 1 steel pickaxe, 1 steel shovel, 1 glass bottle.

Weak mana potion (requires mana mod):
Increases mana regeneration rate by 0.5 for 10 seconds.
Craft: 2 dry shrubs, 1 cotton seed, 1 mese crystal fragment, 1 glass bottle.

Strong potion (requires mana mod):
Increases mana regeneration rate by 1 for 10 seconds.
Craft: 4 dry shrubs, 1 jungle sapling, 1 acacia tree sapling, 1 mese crystal fragment, 1 weak mana potion.
Here are the potion rules, they are very simple: You can have one effect at a time per category. That means, you can have 1 speed effect, 1 jump effect, etc. but never more than 1. If you drink a potion of the same category twice, the timer gets reset. If you drink a potion but already have an effect in that category, the old effect is gone. If you first drink a slug potion, then a running potion, you end up with a running effect.

The mod utilizes the Player Effects mod to apply all those effects like higher jump etc. This means it should work well together with other mods who use Player Effects, without weird conflicts. However, any mod which modifies the player physics on its own (without using Player Effects) is very likely to cause weird buggy results.

Also check out my fork of Magic Beans, which is based on Player Effects as well.

The optional dependencies are needed for the crafting recipes. But the potions can still be used standalone without any mod from Minetest Game (in case you want to make your own recipes). The Mana mod will enable 2 mana potions.

I consider this mod to be finished. But if you find any bugs, please report them here. If you have ideas for more potions, please give them to me. Also, if you have comments on balancing, I would appreciate that.
Attachments
pep_icons.png
pep_icons.png (9.1 KiB) Viewed 2461 times
Last edited by Wuzzy on Tue Feb 27, 2024 10:39, edited 15 times in total.

4aiman
Member
Posts: 1208
Joined: Mon Jul 30, 2012 05:47

Re: [Mod] Pep: Player Effects Potions [0.1.0] [pep]

by 4aiman » Post

+1 Wuzzy!

I can think of one possible problem: multiple overrides.

In Magichet there are many things that are able to change player's physics. So, I had to develop a system that had enabled me to read current overrides and change those.

In other words, any standalone mod that changes physics is (to a degree) incompatible with other ones which are able to change physics as well.

Player effects is a good start towards university, but general incompatibility with any mod that doesn't use it should be stated black-on-white. Just for those who would ask over and over again why is this not working with other mods :)

User avatar
stu
Member
Posts: 923
Joined: Sat Feb 02, 2013 02:51
GitHub: stujones11
Location: United Kingdom

Re: [Mod] Pep: Player Effects Potions [0.1.0] [pep]

by stu » Post

First of all, very nice mod, really good name too.

I do, however, agree with 4aiman's comments that there could be conflicts with other mods that alter player physics.
I recently pushed a commit to my 3d_armor mod that exposes its physics overrides table on the request of TenPlus1 to add compatibility for the playerplus mod.

https://github.com/stujones11/minetest- ... 77d39edc72

You could easily check for the existence of the table and at least become compatible with the 3d_armor mod ;-)
What is really needed though is an api call to read physics overrides as well as set them (same goes for armor levels) this really should not be difficult to do.

User avatar
Wuzzy
Member
Posts: 4780
Joined: Mon Sep 24, 2012 15:01
GitHub: Wuzzy2
IRC: Wuzzy
In-game: Wuzzy
Contact:

Re: [Mod] Pep: Player Effects Potions [0.1.0] [pep]

by Wuzzy » Post

OK, I have edited the first post with a warning that this mod is likely to break stuff when used with other mods which do not use Player Effects.

Well, as I said, the problem with multiple overrides is at least solved for all mods which make use of Player Effects. So there will be no completely buggy behaviour within Pep itself. That’s a step forward from that old potions mod (viewtopic.php?id=5549) which did not even work reliably on its own. All you needed to do to break the mod it to drink two conflicting potions. This buggy behaviour was also the main motivation to create Player Effects, after all.

Pep is more or less intended as a proof-of-concept while also being actually usable at the same time.

Having an API for handling those player physics sounds like an good idea. I had that idea, too. But I dropped it in favor of a more generic approach, which resulted Player Effects.

I don’t like the idea of extending Pep to support some particular mod. And armor is surely not the only mod which needs compability. Exactly that extra work for compability is what I wanted to avoid with Player Effects.
So I rather extend Player Effects.

I already planned to add additive effects to that mod, which I haven’t done so far. This would be an important milestone, with this feature it would be possible to stack multiple effects.

For that armor mod, I think I could easily extend Player Effects with so-called “permanent effects”, effects with no timeout. Mods then would have to manually enable, disable or modify them.

And lastly, I should really add some convenience features to Player Effects, for stuff that is frequently used, like set_physics_override.

So all your comments actually apply to Player Effects, not really to Pep.
And currently, I am not in the right mood to edit Player Effects. But my mood changes often. :)


Please, any comments about player physics issues and override issues should go into the Player Effects thread instead.

What I wanted to hear in this thread are comments about the potions:
How’s the balancing? Do the crafting recipes make sense? Any bad potions? Any ideas for new potions? Etc.



Edit: A Git repository is now online! See the first post.

4aiman
Member
Posts: 1208
Joined: Mon Jul 30, 2012 05:47

Re: [Mod] Pep: Player Effects Potions [0.1.0] [pep]

by 4aiman » Post

Erm.. Those notions of mine affect PEP as well as the PE. So, I only ask of you to be patient in case you're not :)

Correct me if I'm wrong, but:

- potions uses effect types;
- effect type of a potion is registered with the function below (line #24, init.lua of PEP):

Code: Select all

playereffects.register_effect_type("pepspeedplus", "High speed", "pep_speedplus.png", {"speed"},
function(player)
   player:set_physics_override({speed=2})
end,
function(effect, player)
  player:set_physics_override({speed=1})
end
)
, where the 2 functions is params "apply" and "cancel" of "playereffects.register_effect_type" function of the PEP mod;
- then, @ line # 124 of PE you have this:

Code: Select all

local status = playereffects.effect_types[effect_type_id].apply(player)
, thus calling the first function from the "playereffects.register_effect_type" above...
- player got his speed overridden, w/o any regard to what his/her speed was (I've found no places where current multipliers are taken into account. Well may be I've just overlooked those...);

As a result, player was speed-upped by 2;

Now, It's easy to do the following:
- player drinks slow-mo potion (0.1 of the speed) after 5 seconds;
- his speed decreases and will be restored after 10 secs;
- but after 5 seconds the first potion will become ineffective, thus changing speed of a player to 1;
- after another 5 seconds player speed will be restored yet again, now by a slow-mo potion.
Result: slow-mo potion has been effective only half the time it should be.

Either you should add new effect to the existing ones by reading overrides or neglect the counter-effect of a previous potion. Otherwise I'd call it not a bug but a feature :)

4aiman
Member
Posts: 1208
Joined: Mon Jul 30, 2012 05:47

Re: [Mod] Pep: Player Effects Potions [0.1.0] [pep]

by 4aiman » Post

On a side note, however Minecraft-ish it is, brewing would be great.
At least as a "final touch" when a certain substance is crafted with bucket_water into a "soup" and then placed into a furnace to actually create a potion in a form of bucket_with_potion (ItemStack metadata may be used to distinguish different potions).
Those buckets may be used to fully fill the cauldron, which, in turn, may be used as a source of potion (granting up to 8 bottles of potion when one rightclicks the cauldron with a vessel in his/her hand).

So:
- recipes may be "ok", but should not require vessels;
- in the output should be some "essence" of a potion;
- craft the essence with a bucket of water;
- place the bucket into a furnace;
- get your bucket_with_potion and fill in the cauldron;
- prepare your bottles to be filled in out of the cauldron;
- use the filled in potion bottles.

Maybe all above over-complicates things, but MT and FM are too easy already.

Image

User avatar
ExeterDad
Member
Posts: 1717
Joined: Sun Jun 01, 2014 20:00
In-game: ExeterDad
Location: New Hampshire U.S.A

Re: [Mod] Pep: Player Effects Potions [0.1.0] [pep]

by ExeterDad » Post

My kids are going to love this. They've been requesting potions for a while.

User avatar
Wuzzy
Member
Posts: 4780
Joined: Mon Sep 24, 2012 15:01
GitHub: Wuzzy2
IRC: Wuzzy
In-game: Wuzzy
Contact:

Re: [Mod] Pep: Player Effects Potions [0.1.0] [pep]

by Wuzzy » Post

4aiman, you are starting to annoy me. 4aiman, did you even bother reading my posts? Did you even bother testing before you make false claims? I think not!

First: Your time line is bogus.

The actual time line would be like this:
  • 0s: Drink slug potion (30s effect time). Speed is set to a low value. A “slow” effect is stored in the Player Effects “database”
  • 5s: drink running potion (30s effect time). Speed is set to a high value. The old slow-motion effect is deleted by Player Effects, because it is of the same category: speed. This appears in the 4th parameter of register_effect_type. A new “fast” effect is stored in the effect “database”.
  • 30s: Nothing happens
  • 35s: Fast potion wears off, resetting speed back to normal. The fast effect is removed from the effect “database” normally.
Now please try it out before you make more claims about what Pep is and what it isn’t. :P

Player Effects does a lot of work behind the scenes.

What you described was indeed problem with the old [potions] mod, but not with this one.


But yep, currently the initial speed value is completely ignored. Pep is ignorant of it. But there’s nothing really to do about, I guess. Sure, some mods could “export” their speed values but how multiple mods of this type should work together without a common API or even just a common standard remains a mystery to me.
The main problem lies in the Lua API. It is not possible to read the current value of the player_physics. I already requested to add a read function to the Lua API. No progress has been made here, so far. :-(

The only sensible solution to me is assuming the initial value of 1. Yes, this is ugly, therefore Pep is incompatible with any mod which do not use Player Effects.


Second: Yes, additive effects would be great. Additive effects are a planned feature of Player Effects as I already said …

Third: All this is still Player Effects-related. Pep just uses Player Effects. If there is a problem with, let’s say, registering effects, I have to fix Player Effects, not Pep.


Fourth: Now to your “sidenote”. This is actually on-topic.
Hmm, yeah, sounds a bit complicated. And I wanted a simple mod. And I don’t know what exactly the benefit of this would be, other than to complicate things. Another problem would be that it could create more dependencies and make the mod less portable. :-/ Maybe it can be solved, so I do not reject the idea outright, but I remain skeptical.



Lastly: If you strongly disagree, fork you! :P

4aiman
Member
Posts: 1208
Joined: Mon Jul 30, 2012 05:47

Re: [Mod] Pep: Player Effects Potions [0.1.0] [pep]

by 4aiman » Post

1. Don't get too angry, dude, or else you'll loose vitamins :p

2. I've no need to fork anyone - I've got my own bicycle :)

3. While I understand that my post should've been at PE thread, to answer in a separate thread is illogical. While it had turned out that my first post here was referred to PE, PEP depends on it and thus share same/some issues. So my posts aren't completely irrelevant/illogical.

4. I hadn't "not read" or "not listened" as well I'm not "disagree"... As well as I don't care whether you think I've read your posts or not :p
I just hadn't time to test within an actual game, so HAD looked through the actual code and posted what I've learned from it. So, yep, that's a "can't test but wanna know how it works".

5. The time line SHOULD be bogus, as that is unimportant in this case. What IS important - is the fact that your potions "disrespect" "opposite" potions deleting the previous status. Besides, only timings were bogus. The event line itself was to be corrected by you, as it was a question. You did well on that behalf.

6. But since all of that is in your ToDo list, I've nothing to worry about :)

7. Meh, I have much more funnier things than trying to piss you off. If you think I was impudent - tell me where, 'cause English is neither my native nor "default" language.

PS: I don't care if smth is ugly or not. I don't care if PE or PEP are to be polished. I care only of doing it the right way: if someone introduces a general mod that changes player physics, that mod should be consistent. That's why I've asked you to correct me. That's why I don't like the fact that effects do not stack. That's why I don't care that PEP HAS to assume the multiplier of 1 as the initial state.
I have no particular interest in PEP, I have the interest of getting new ideas that are likely to be unrelated with the subject.

User avatar
Wuzzy
Member
Posts: 4780
Joined: Mon Sep 24, 2012 15:01
GitHub: Wuzzy2
IRC: Wuzzy
In-game: Wuzzy
Contact:

Pseudo-release 1.0.0

by Wuzzy » Post

OK, I think Pep is stable enough and I guess I just rename version 0.1.0 to 1.0.0 to indicate that Pep is functionally complete.
Nothing changed, I just didn’t like the leading zero in that version number .;)

This does not neccessarily mean I won’t update this mod in the future, however.

User avatar
the_rouge_pilot
Member
Posts: 10
Joined: Sat May 03, 2014 13:47
In-game: vfd

Re: [Mod] Pep: Player Effects Potions [1.0.0] [pep]

by the_rouge_pilot » Post

Is there a way to make the potion's effect go on forever?
OA | >>>>----------------> | BSA My Stuff: Wakefield, Ammo Can.

User avatar
Wuzzy
Member
Posts: 4780
Joined: Mon Sep 24, 2012 15:01
GitHub: Wuzzy2
IRC: Wuzzy
In-game: Wuzzy
Contact:

Re: [Mod] Pep: Player Effects Potions [1.0.0] [pep]

by Wuzzy » Post

Not without editing source code, and I don’t feel like editing source code right now.


Edit: Okay, but there is a mod which allows you to change speed, gravity and jump strength and other stuff directly: viewtopic.php?f=11&t=7498
It’s not very gamey, however. ;-)

User avatar
Tedypig
Member
Posts: 286
Joined: Tue Mar 05, 2013 12:33
IRC: Piggybear87
In-game: Piggybear
Location: Largo, FL, USA

Re: [Mod] Pep: Player Effects Potions [1.0.0] [pep]

by Tedypig » Post

I know this is old, but It's still really cool. If you are still doing this, I have suggestions.
[For User]
(1) "Mole Potion" It removes a 3x3 tunnel in front of you when you walk into it (starting at your current floor, not dig down one block and up one block like the technic drill does). So; 1. drink, 2. bump wall, 3. 3x3 gone, repeat 2 and 3 for the next X seconds.
(2) "Fly Potion" X seconds of the fly priv.
(3) "Ghost Potion" X seconds of noclip. If used with "Fly Potion", it's like fly+noclip.
(4) "Strength Potion" X seconds of super strength. (Example: 1 hit kills and/or bare hand mining (even ores and minerals))
[Attack]
(1) "Poision Potion" X seconds of "Poision Damage" to the victim. (Example: 10 seconds of 1hp/second damage).
(2) "Insta-kill Potion" Instantly kills victim.
[Defence]
(1) "Antadote Potion" Cures Poision Potion.
(2) "God Potion" Take no damage of any kind for X seconds.
[Admin Only]
All of these are non craftable and are only gotten from creative inventory and/or /giveme. They are mainly to save typing out the command.
(1) "Kick Potion" Kick victim.
(2) "Jail Potion" Jail victim.
(3) "Ban Potion" Ban Victim

User avatar
Wuzzy
Member
Posts: 4780
Joined: Mon Sep 24, 2012 15:01
GitHub: Wuzzy2
IRC: Wuzzy
In-game: Wuzzy
Contact:

Re: [Mod] Pep: Player Effects Potions [1.0.0] [pep]

by Wuzzy » Post

I agree with the following ideas:
  • Strength Potion
  • Poison Potion
  • Antidote Potion
I agree partly with the following ideas:
  • Mole Potion: Maybe I would choose a smaller area for this.
  • God Potion: Too overpowered. But maybe a potion which makes you more resistant to attacks. The problem is that I don't know how to solve this. I guess something about armor groups. But sadly, the Lua API does currently only allow to write the armor groups, but not to read them, so it might be difficult or impossible now.
I am not sure about the privilege potions. As for flying: I already have the no-gravity potion, so it may be redundant and/or overpowered. The ghost potion is useless on its own, since noclip does nothing when you are not in fly mode. Also: Too overpowered and too “cheaty”.
While granting/revoking privileges like this is certainly technically possible, it is ugly for me. If somebody can come up with a sane way for flying, maybe I'll implement it.

I disagree with the rest as being too overpowered. Especially the admin potions, they don't belong in here, it also feels kinda constructed.

So, yeah, some ideas are good, some other ideas are too overpowered for my taste. I will look if I implement some of these. :-)

General notice: It is okay for me if you post in my old mod threads, I still read them. Do not hesitate to make comments or suggestions, no matter how old a thread is. If I think one of my mods needs to be dumped, I would request to move the thread to Old Mods.

User avatar
Wuzzy
Member
Posts: 4780
Joined: Mon Sep 24, 2012 15:01
GitHub: Wuzzy2
IRC: Wuzzy
In-game: Wuzzy
Contact:

Re: [Mod] Pep: Player Effects Potions [1.0.0] [pep]

by Wuzzy » Post

Okay, I have added the mole potion into the repository, but it is still just for testing.

If you want to test it, download the current unstable version of my mod here:
http://repo.or.cz/w/minetest_pep.git/sn ... e83edf.zip

The mole potion automatically digs 1×2 blocks in front of you every 0.5s for 18s in total. The nodes will automatically go into your inventory and those you cannot carry will simply be dropped.
I am not sure how stable this is, so I wish some testing here.

A mole potion can be crafted by placing one steel shovel, one steel pick and one glass bottle into the crafting grid anywhere.

Sadly, I am still not sure on how I could implement the other suggestions, since armor groups are kinda tricky for me.

tinkerlevu
Member
Posts: 15
Joined: Tue Sep 08, 2015 21:59

Re: [Mod] Pep: Player Effects Potions [1.0.0] [pep]

by tinkerlevu » Post

how about adding a mana potion?

User avatar
Wuzzy
Member
Posts: 4780
Joined: Mon Sep 24, 2012 15:01
GitHub: Wuzzy2
IRC: Wuzzy
In-game: Wuzzy
Contact:

Re: [Mod] Pep: Player Effects Potions [1.0.0] [pep]

by Wuzzy » Post

Sure, why not?
But it will be a mana regenration potion, no cheap instant mana boost. :P

User avatar
Wuzzy
Member
Posts: 4780
Joined: Mon Sep 24, 2012 15:01
GitHub: Wuzzy2
IRC: Wuzzy
In-game: Wuzzy
Contact:

Release of 1.1.0

by Wuzzy » Post

After a long time, there is a new release, version 1.1.0. Main changes include:
  • Add mole potion, will dig out (almost) anything for 18 seconds
  • Add two mana regeneration potions (if you use the Mana mod)
  • Tweak most crafting recipes to be slightly more challenging; use some of the recent items in Minetest Game
  • Add mod metadata like screenshot and mod.conf

User avatar
Wuzzy
Member
Posts: 4780
Joined: Mon Sep 24, 2012 15:01
GitHub: Wuzzy2
IRC: Wuzzy
In-game: Wuzzy
Contact:

Version 1.2.0

by Wuzzy » Post

Version 1.2.0 released!

Only change:

User avatar
Wuzzy
Member
Posts: 4780
Joined: Mon Sep 24, 2012 15:01
GitHub: Wuzzy2
IRC: Wuzzy
In-game: Wuzzy
Contact:

Version 1.3.0 released!

by Wuzzy » Post

Version 1.3.0 released! Changes:

- Add intllib support
- Add German translation
- Make mod compatible with Documentation System 0.7.0
- Larger screenshot

amadin
Member
Posts: 549
Joined: Tue Jun 16, 2015 16:23

Re: [Mod] Pep: Player Effects Potions [1.3.0] [pep]

by amadin » Post

I hope you will add sneak potion. In 0.4.15 it is possible.

User avatar
Wuzzy
Member
Posts: 4780
Joined: Mon Sep 24, 2012 15:01
GitHub: Wuzzy2
IRC: Wuzzy
In-game: Wuzzy
Contact:

Re: [Mod] Pep: Player Effects Potions [1.3.0] [pep]

by Wuzzy » Post

I have no idea what you mean.

amadin
Member
Posts: 549
Joined: Tue Jun 16, 2015 16:23

Re: [Mod] Pep: Player Effects Potions [1.3.0] [pep]

by amadin » Post

Wuzzy wrote:I have no idea what you mean.
Sorry, I meant the invisibility potion which makes the player invisible.

User avatar
TenPlus1
Member
Posts: 3700
Joined: Mon Jul 29, 2013 13:38
In-game: TenPlus1
Contact:

Re: [Mod] Pep: Player Effects Potions [1.3.0] [pep]

by TenPlus1 » Post

Invisibility potion mod : viewtopic.php?f=9&t=14846

TeTpaAka
Member
Posts: 141
Joined: Sat Dec 28, 2013 21:54

Re: [Mod] Pep: Player Effects Potions [1.3.0] [pep]

by TeTpaAka » Post

I made some changes to the mod:
  1. Empty bottles are returned to the player's inventory or dropped on the floor if it is full.
    https://github.com/TeTpaAka/minetest_pe ... ty_vessels
    This would make vessels a mandatory dependency though. I could work on it, so it is optional again.
    Additionally, the crafting recipes for pep:speedreset and pep:jumpreset should be changed, so vessels don't get lost.
  2. Use player_monoids for the physics_override stuff to increase the chance of interoperability between mods.
    https://github.com/TeTpaAka/minetest_pep/tree/monoids
You might want to take a look at it.

Post Reply

Who is online

Users browsing this forum: No registered users and 11 guests