Page 1 of 2

[Mod] Pathogen [0.3][pathogen]

PostPosted: Tue Feb 03, 2015 05:32
by Bas080
PATHOGEN
A minetest mod that enables users to get a pathogen. This mod is in testing faze. Let me know if you bump into something irregular. I will fix it asap.

Image

To get it to work simply make sure you have the "pathogen" privilige and execute the following commands

/pathogens
--list all pathogens and their descriptions

/infect <player name> <pathogen name>
--infect the player

/immunize <player name> <pathogen name>
--make player immune to particular pathogen

Features
- Adds pathogens that have symptoms that occur in intervals.
- Easily define a new pathogen using the pathogen API
- Demo pathogens that are infectious and sometimes deadly.

Diseases

Gravititus
Occurs when ascending too quickly. Symptons include hiccups and random sense of gravity. There is no known cure yet. ( any suggestions? stone soup anyone? )

Influencia
Highly contagious as it is airborne. Being around someone that has the diseases
increases the chances of getting the virus drastically. It is advised to eat well
and keep your distance from players that are coughing. Death is very unlikely.
Symptoms include coughing and sneezing. When not fed well it can have an
effect on your health.

Panola
Contagious through body fluids. It is ok to be near someone that has the diseases.
Make sure that when cleaning up after someone that has expelled fluids, to
decontaminate the fluids first. This can be done with the Decontaminator.
Some may find this pathogen sickening. Use with caution.

Gosirea
Symptons include gas and burps. Occasionaly a shard. Carrier contaminates nearby surfaces when symptoms show. Not deadly for those that have good health.

Changelog

Items
- Comes with nodes like vomit, blood and feces that are infectious when dug.
- A bio hazard warning fence, in case a quarantine is required.
- A decontaminater for removing infectious fluids.

Crafts

Download: https://github.com/bas080/pathogen/archive/master.zip
or browse the source code:https://github.com/bas080/pathogen

Re: [Mod] Pathogen [0.2][pathogen]

PostPosted: Tue Feb 03, 2015 08:53
by Krock
Whoa. That's a great idea.
I hope you can add more diseases :)

Re: [Mod] Pathogen [0.2][pathogen]

PostPosted: Tue Feb 03, 2015 09:46
by Topywo
*cough* very original, nice.

A sick mod.

Re: [Mod] Pathogen [0.2][pathogen]

PostPosted: Tue Feb 03, 2015 12:04
by Oussamarer
Topywo wrote:*cough* very original, nice.

A sick mod.

i see what you did there :)

Re: [Mod] Pathogen [0.2][pathogen]

PostPosted: Tue Feb 03, 2015 15:34
by Bas080
Krock wrote:Whoa. That's a great idea.
I hope you can add more diseases :)


The pathogens I'm adding are there to test and demo the functionalities of the pathogen API. It should be easy to add a new disease. This project might be my first minetest project that is descently documented. For those willing to contribute, I advice them to start looking there. The demo pathogens are just as helpfull.

To demo the contamination part of the API, I made another pathogen named "Gosirea".

Thins to expect in the future are syringes, cures and antidotes. Spawning of pathogens by themselves etc. The more people help the richer this mod willl get. I must have forgotten to mention that the licence is WTFPL for most parts. The sounds are from freesound and are CC. The images are WTFPL.

Re: [Mod] Pathogen [0.2][pathogen]

PostPosted: Tue Feb 03, 2015 16:41
by Hybrid Dog
You could use some parts of these mods…
viewtopic.php?id=4783
viewtopic.php?f=9&t=8917#p141887

Re: [Mod] Pathogen [0.2][pathogen]

PostPosted: Wed Feb 04, 2015 11:49
by Caleneledh
Possible disease suggestion: one that cause random digging around the player.

Re: [Mod] Pathogen [0.2][pathogen]

PostPosted: Thu Feb 05, 2015 02:01
by Bas080
I have written a simple test function and tests for this mode. If you are interested take a look here:
The test function(library):
https://github.com/bas080/pathogen/tree ... ment/lunit
and the tests:
https://github.com/bas080/pathogen/tree ... ogen_tests
Inspired by qunit for javascript.

After bumping in to one error after another I started writting this mod using tests, making it much more robust and easier to write. My advice to you is to do the same. That way you can make better and more extensive mods while quickly testing if your changes cause bugs and or errors.

EDIT: fixed broken links

Re: [Mod] Pathogen [0.3][pathogen]

PostPosted: Fri Feb 20, 2015 16:59
by Bas080
Pathogens aren't always a menace.

Gravititus
Occurs when ascending too quickly. Symptons include hiccups and random sense of gravity. There is no known cure yet. ( any suggestions? stone soup anyone? )

Re: [Mod] Pathogen [0.3][pathogen]

PostPosted: Sat Mar 07, 2015 17:28
by Sokomine
Nice idea, although I don't think it ought to spread too wild on servers :-) Now, where was my decontamination airlock again...

Re: [Mod] Pathogen [0.3][pathogen]

PostPosted: Sat Mar 21, 2015 16:56
by davidthecreator
I got some ideas : at these days people are worrying about Ebola you could add that the symptoms are bleeding trough eyes and mouth and after some time it insta kills the infected one . Also you should add cold: well everyone knows the symptoms player should be slower when infected and the last one the z virus should turn people into zombies they should be slower and infect others when touching or punching others also players skin should be changed too look like a zombie

Re: [Mod] Pathogen [0.3][pathogen]

PostPosted: Tue Mar 24, 2015 16:37
by Bas080
davidthecreator wrote:I got some ideas : at these days people are worrying about Ebola you could add that the symptoms are bleeding trough eyes and mouth and after some time it insta kills the infected one . Also you should add cold: well everyone knows the symptoms player should be slower when infected and the last one the z virus should turn people into zombies they should be slower and infect others when touching or punching others also players skin should be changed too look like a zombie


I have an analog for the Ebola virus called Panola. Remember that ebola is not a death sentence. Currently the virus requires you to keep an eye on your hp and to eat small amounts frequently to avoid vomiting.

Currently the cold virus called "influencia" only damages the player when his HP is lower than a certain amount. The symptom also includes sneazing and couching. Making the player walk a bit slower is would be a nice addition. It would also work for the panola virus.

Zombies virus! love it!

Maybe you would like to help me implement the features.

Re: [Mod] Pathogen [0.3][pathogen]

PostPosted: Sun Mar 29, 2015 17:24
by davidthecreator
What kind of help do you need ?

Re: [Mod] Pathogen [0.3][pathogen]

PostPosted: Sat May 30, 2015 00:47
by mahmutelmas06
Your phone or window isn't wide enough to display the code box. If it's a phone, try rotating it to landscape mode.
Code: Select all
03:42:39: WARNING: Undeclared global variable "xpanes" accessed at ...Kurulan\Minetest\bin\..\mods\pathogen\pathogen/nodes.lua:29
2015-05-30 03:42:39: ERROR[main]: ========== ERROR FROM LUA ===========
2015-05-30 03:42:39: ERROR[main]: Failed to load and run script from
2015-05-30 03:42:39: ERROR[main]: D:\Oyun\Kurulan\Minetest\bin\..\mods\pathogen\pathogen\init.lua:
2015-05-30 03:42:39: ERROR[main]: ...Kurulan\Minetest\bin\..\mods\pathogen\pathogen/nodes.lua:29: attempt to index global 'xpanes' (a nil value)
2015-05-30 03:42:39: ERROR[main]: stack traceback:
2015-05-30 03:42:39: ERROR[main]:    ...Kurulan\Minetest\bin\..\mods\pathogen\pathogen/nodes.lua:29: in main chunk
2015-05-30 03:42:39: ERROR[main]:    [C]: in function 'dofile'
2015-05-30 03:42:39: ERROR[main]:    ...\Kurulan\Minetest\bin\..\mods\pathogen\pathogen\init.lua:12: in main chunk
2015-05-30 03:42:39: ERROR[main]: ======= END OF ERROR FROM LUA ========
2015-05-30 03:42:39: ERROR[main]: Server: Failed to load and run D:\Oyun\Kurulan\Minetest\bin\..\mods\pathogen\pathogen\init.lua
2015-05-30 03:42:39: ERROR[main]: ModError: ModError: Failed to load and run D:\Oyun\Kurulan\Minetest\bin\..\mods\pathogen\pathogen\init.lua
2015-05-30 03:42:39: ERROR[main]: Hata ayrıntıları için debug.txt dosyasını inceleyin.

Re: [Mod] Pathogen [0.3][pathogen]

PostPosted: Sat May 30, 2015 08:58
by Hybrid Dog
mahmutelmas06 wrote:
Your phone or window isn't wide enough to display the code box. If it's a phone, try rotating it to landscape mode.
Code: Select all
03:42:39: WARNING: Undeclared global variable "xpanes" accessed at ...Kurulan\Minetest\bin\..\mods\pathogen\pathogen/nodes.lua:29
2015-05-30 03:42:39: ERROR[main]: ========== ERROR FROM LUA ===========
2015-05-30 03:42:39: ERROR[main]: Failed to load and run script from
2015-05-30 03:42:39: ERROR[main]: D:\Oyun\Kurulan\Minetest\bin\..\mods\pathogen\pathogen\init.lua:
2015-05-30 03:42:39: ERROR[main]: ...Kurulan\Minetest\bin\..\mods\pathogen\pathogen/nodes.lua:29: attempt to index global 'xpanes' (a nil value)
2015-05-30 03:42:39: ERROR[main]: stack traceback:
2015-05-30 03:42:39: ERROR[main]:    ...Kurulan\Minetest\bin\..\mods\pathogen\pathogen/nodes.lua:29: in main chunk
2015-05-30 03:42:39: ERROR[main]:    [C]: in function 'dofile'
2015-05-30 03:42:39: ERROR[main]:    ...\Kurulan\Minetest\bin\..\mods\pathogen\pathogen\init.lua:12: in main chunk
2015-05-30 03:42:39: ERROR[main]: ======= END OF ERROR FROM LUA ========
2015-05-30 03:42:39: ERROR[main]: Server: Failed to load and run D:\Oyun\Kurulan\Minetest\bin\..\mods\pathogen\pathogen\init.lua
2015-05-30 03:42:39: ERROR[main]: ModError: ModError: Failed to load and run D:\Oyun\Kurulan\Minetest\bin\..\mods\pathogen\pathogen\init.lua
2015-05-30 03:42:39: ERROR[main]: Hata ayrıntıları için debug.txt dosyasını inceleyin.

Do you use a different xpanes mod?
https://github.com/bas080/pathogen/blob ... des.lua#L5
minetest.get_modpath shouldn't be used, better use rawget(_G, "xpanes")

Re: [Mod] Pathogen [0.3][pathogen]

PostPosted: Sat May 30, 2015 12:12
by mahmutelmas06
Yes i use different xpanes mod by davedevils. I have changed xpanes line in pthogen init and fixed.
Just wanted to make Bas080 know about the issue.

Re: [Mod] Pathogen [0.3][pathogen]

PostPosted: Sat Jul 18, 2015 10:59
by Bas080
I thought mod names had to be unique for every mod. So modpath should work if everyone follows the rules. I assume rawget checks if the variable exists. That is not a foolproof check either.

Re: [Mod] Pathogen [0.3][pathogen]

PostPosted: Sat Jul 18, 2015 14:53
by programmingchicken
Perhaps there should be a de-contamination block?
Or maybe if you get the disease and survive it you become immune to it.
And then if you don't get it in a few minetest days you become vulnerable...
this mod has many ways to go/there are many paths to choose from.
realism
-You die and lose your stuff because of diseases, you need to go to a doctor, need to wash your hands, etc.
skills
-You toughen yourself up by getting diseases and fighting mobs and players. RPG-style stuff.

Re: [Mod] Pathogen [0.3][pathogen]

PostPosted: Tue Sep 01, 2015 15:17
by Nathan.S
I can't seem to get sick, I've got this code, which should, I think trigger Influencia.
Your phone or window isn't wide enough to display the code box. If it's a phone, try rotating it to landscape mode.
Code: Select all
local chance_level = math.random(0,10)
      print ('chance is '..chance_level)
      if chance_level < chance then
         print ('should get sick')
         pathogen.infect = function(Influencia, player_name)
      end

I don't get any errors, and the debug text will print should get sick, so I know the chance mechanics are working, so I can only assume I'm calling the pathogen.infect function incorrectly. The chance variable is defined in a table that has all the foods with the hydration and hunger values.

Re: [Mod] Pathogen [0.3][pathogen]

PostPosted: Fri Sep 04, 2015 15:25
by Bas080
Nathan.S wrote:I can't seem to get sick, I've got this code, which should, I think trigger Influencia.
Your phone or window isn't wide enough to display the code box. If it's a phone, try rotating it to landscape mode.
Code: Select all
local chance_level = math.random(0,10)
      print ('chance is '..chance_level)
      if chance_level < chance then
         print ('should get sick')
         pathogen.infect = function(Influencia, player_name)
      end

I don't get any errors, and the debug text will print should get sick, so I know the chance mechanics are working, so I can only assume I'm calling the pathogen.infect function incorrectly. The chance variable is defined in a table that has all the foods with the hydration and hunger values.


You first have to get the pathogen and then with that pathogen you can infect a player.

Be careful with the pathogen namespace. That's why the local variable there is _pathogen and not pathogen.

# get the pathogen
local _pathogen = pathogen.get_pathogen( <pathogen_name> )

# infect the player
local infection = pathogen.infect( <_pathogen>, <player_name> )

Re: [Mod] Pathogen [0.3][pathogen]

PostPosted: Sat Sep 05, 2015 01:03
by Nathan.S
Sorry to be as dense as a brick, but I'm hitting a wall.

I have this as my new code:
Your phone or window isn't wide enough to display the code box. If it's a phone, try rotating it to landscape mode.
Code: Select all
38.  if chance_level < chance then
39.      print ('should get sick')
40.    local _pathogen = pathogen.get_pathogen( influencia )
41.    pathogen.infect = function(_pathogen, singleplayer)
42.  end


I'm getting this error now, which honestly I may have been getting all along, just never noticed it before.
WARNING: Undeclared global variable "influencia" accessed at /home/nathan/.minetest/games/Survive/mods/food/meats.lua:40
Looking at the init.lua file in the pathogen folder in the pathogen mod I do see the table that lists a table called pathogens in the pathogen table, but I don't understand LUA well enough to know if that is a mistake.

Re: [Mod] Pathogen [0.3][pathogen]

PostPosted: Sat Sep 05, 2015 03:06
by programmingchicken
Try no whitespace in your get_pathogen call.

Re: [Mod] Pathogen [0.3][pathogen]

PostPosted: Sat Sep 05, 2015 12:44
by Nathan.S
I get the same thing with or without whitespace. :\

Re: [Mod] Pathogen [0.3][pathogen]

PostPosted: Sat Sep 05, 2015 12:47
by ArguablySane
Nathan.S wrote:Sorry to be as dense as a brick, but I'm hitting a wall.

I have this as my new code:
Your phone or window isn't wide enough to display the code box. If it's a phone, try rotating it to landscape mode.
Code: Select all
38.  if chance_level < chance then
39.      print ('should get sick')
40.    local _pathogen = pathogen.get_pathogen( influencia )
41.    pathogen.infect = function(_pathogen, singleplayer)
42.  end


I'm getting this error now, which honestly I may have been getting all along, just never noticed it before.
WARNING: Undeclared global variable "influencia" accessed at /home/nathan/.minetest/games/Survive/mods/food/meats.lua:40
Looking at the init.lua file in the pathogen folder in the pathogen mod I do see the table that lists a table called pathogens in the pathogen table, but I don't understand LUA well enough to know if that is a mistake.


You probably need to provide the pathogen name as a string, ie.
Your phone or window isn't wide enough to display the code box. If it's a phone, try rotating it to landscape mode.
Code: Select all
local _pathogen = pathogen.get_pathogen("influencia")

Re: [Mod] Pathogen [0.3][pathogen]

PostPosted: Sun Sep 06, 2015 12:50
by Nathan.S
providing the pathogen name as a string does remove the error, but doesn't do anything. I modified the pathogen code to print a message when the pathogen infects the player, and never got the message in the debug, so unfortunately that isn't the solution either.

Re: [Mod] Pathogen [0.3][pathogen]

PostPosted: Sun Sep 06, 2015 13:12
by ArguablySane
Nathan.S wrote:providing the pathogen name as a string does remove the error, but doesn't do anything. I modified the pathogen code to print a message when the pathogen infects the player, and never got the message in the debug, so unfortunately that isn't the solution either.


Try
Your phone or window isn't wide enough to display the code box. If it's a phone, try rotating it to landscape mode.
Code: Select all
local influencia = pathogen.get_pathogen("influencia")
pathogen.infect(influencia, "singleplayer")


What you were doing was declaring an empty function and assigning it to the "infect" field of the pathogen table, effectively overwriting the real function.

Re: [Mod] Pathogen [0.3][pathogen]

PostPosted: Sun Sep 06, 2015 13:27
by Nathan.S
Duh, what a fool I am. I'll have to try that out.

Re: [Mod] Pathogen [0.3][pathogen]

PostPosted: Tue Sep 08, 2015 08:33
by TenPlus1
It would be kewl to have a T-Virus like in Resident Evil and if the player doesn't find a cure within the time limit then the player model changes into a monster... :)

Re: [Mod] Pathogen [0.3][pathogen]

PostPosted: Sun Mar 13, 2016 05:56
by wilkgr76
Plague Inc 3D Edition? jk, but very nice
☻☻☻☻☺

Re: [Mod] Pathogen [0.3][pathogen]

PostPosted: Wed Jan 11, 2017 23:00
by Griiimon
Is there any concern with reducing the players speed temporarily as a result of diseases? As i understand, it's merely a factor in the player's physics section. As long as other mods don't mess with movement..

I'd gladly help to code, although i'm complete minetest noob just learning my way around the API. I wrote a similar thingy as part of my minecraft hardcore survival mod.

Edit: Nevermind, just discovered [playereffects] :)

In my mod, if you have a cold and sneeze while holding a piece of paper in your hand (active inventory slot) you wouldn't spread the virus ( and people close to you otherwise being sneezed on wouldn't get pissed, because there was a frustration mechanic, too :D ). The used paper was substracted from the inventory stack.
Also sneezing would change your pointing angle instantly, interrupting the harvesting process. Unfortunately I couldn't implement a little push back effect. Since you were warned about second prior to (potentially) sneezing, you would have had time to get away from dangerously high edges or lava.

Anyways, i'm porting my mc mod to minetest as a game and looking forward to using your mod!