From 9bfa3592cb000223a8ddc6db274c95bd1c79b9db Mon Sep 17 00:00:00 2001 From: Li0n Date: Fri, 11 Feb 2022 01:26:20 +0100 Subject: [PATCH] initial commit --- README.md | 30 ++++++++++++++++++++++++++++-- init.lua | 42 ++++++++++++++++++++++++++++++++++++++++++ mod.conf | 1 + 3 files changed, 71 insertions(+), 2 deletions(-) create mode 100644 init.lua create mode 100644 mod.conf diff --git a/README.md b/README.md index c6650b4..f0b437c 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,29 @@ -# rumble +this clientside mod aims to log certain types of player interactions, so that these can be read and interpreted by external programs. +it was made to be used in combination with a python program and Intiface to add rumble support to minetest. +for now it only logs player damage and death. + +installing clientside mods is not very well documented and varies between clients. + +this forum post explains it quite ok https://forum.minetest.net/viewtopic.php?f=53&t=17830 + +1) Navigate to the Client-Side Modding section (you should already be here), and find a mod you wish to install. + +2) Navigate to your minetest directory (.minetest on Linux) and create a folder called clientmods if it does not exist. + +3) Download or clone the mod into the clientmod directory + +4) Create a text file called mods.conf inside the clientmods folder if it does not exist. + +5) Open mods.conf in your favorite text editor and add load_mod_modname = true (where modname is the name of the client mod you downloaded). Save the file. + +6) Open Minetest and navigate to the Settings tab. Select Advanced Settings. Navigate to Client > Network > Enable Client Modding or search for "client". With Enable Client Modding selected, select the Edit button and change the displayed option to Enabled in the dropdown, or simply double-click the setting. Save your changes. + +Your client-side mod has been enabled! +Type .help all in chat to see what you can do! + + + + + + -a clientside mod that logs certain player interactions. for now it only logs player damage and death. \ No newline at end of file diff --git a/init.lua b/init.lua new file mode 100644 index 0000000..8e9a414 --- /dev/null +++ b/init.lua @@ -0,0 +1,42 @@ +-- rumble - Client side mod for Minetest +-- Scripted by: Li0n + +local modname = minetest.get_current_modname() +local damage_taken = "["..modname.."]".." damage_taken " +local player_died = "["..modname.."]".." player_died" +local local_hp_change = "["..modname.."]".." hp_change" +-- local rightclick = + +-- step 1 (start) +minetest.register_on_mods_loaded(function() + minetest.display_chat_message(modname.." mod loaded. May the rumble be with you!") + return false +end) + +-- step 2 (get hurt) +minetest.register_on_damage_taken(function(hp) + minetest.display_chat_message(damage_taken..tostring(hp)) + minetest.log("action", damage_taken..tostring(hp)) + return false +end) + +-- step 3 (die) +minetest.register_on_death(function() + minetest.display_chat_message(player_died) + minetest.log("action", player_died) + return false +end) + +-- step 4 (track hp level) +minetest.register_on_player_hpchange(function(player, hp_change) + minetest.display_chat_message(hp_change) + minetest.log("action", hp_change) + return false +end) + +-- step 5 (let players click on you) +-- minetest.register_on_rightclickplayer(function(player, clicker) +-- minetest.display_chat_message("["..modname"] "..tostring(clicker).." right_clicked "..tostring(player)) +-- minetest.log("action", "["..modname"] "..tostring(clicker).." right_clicked "..tostring(player)) +-- return false +-- end) diff --git a/mod.conf b/mod.conf new file mode 100644 index 0000000..74f66a3 --- /dev/null +++ b/mod.conf @@ -0,0 +1 @@ +name = rumble