initial commit

This commit is contained in:
Li0n 2022-02-11 01:26:20 +01:00
parent a40e461ed1
commit 9bfa3592cb
3 changed files with 71 additions and 2 deletions

View File

@ -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.

42
init.lua Normal file
View File

@ -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)

1
mod.conf Normal file
View File

@ -0,0 +1 @@
name = rumble