[Mod] cloaking [cloaking]

User avatar
luk3yx
Member
 
Posts: 51
Joined: Sun Oct 21, 2012 18:14
Location: Earth
GitHub: luk3yx
IRC: luk3yx
In-game: luk3yx

[Mod] cloaking [cloaking]

by luk3yx » Tue Sep 11, 2018 19:37

Minetest cloaking mod


Allows players to cloak and uncloak, inspired by Star Trek's cloaking device.

What is cloaking?

In this instance, cloaking is a way to go invisible and become undetectable by most mods (unless they explicitly want to detect cloaked players, so they can still send chat messages to them).

Why is cloaking so hacky, and where does it send the 'left the game' messages?

Cloaking sends no left the game messages, it leaves that up to the built-in left the game functions. The aim of cloaking is to trick other mods into thinking the player is not in-game, and for this it must be hacky.

Help, it crashes (or glitches)

If it crashes, it is either caused by a mod not liking non-existent players running around, or by a bug in cloaking itself. Please create an issue on the GitHub or GitLab repo with the error traceback, list of mods installed, and steps to replicate the crash.

If you recently updated to Minetest 5.0.0 and can walk through nodes, please make sure you are using the latest version of cloaking (you should use it anyway).

How do I use cloaking?

Cloaking adds a modding API and two chatcommands. Both of these require the 'cloaking' privilege to execute, however you can uncloak yourself without any privileges.

- /cloak [victim]: Cloaks yourself, alternatively an unsuspecting 'victim'.
- /uncloak [victim]: Uncloaks yourself, or a 'victim'.
- /cloak_chat <message>: Sends <message> to all online players with the cloaking privilege. You can disable cloaked chat by setting cloaking.enable_cloaked_chat to false in minetest.conf.

How do I download cloaking?

You can either run git clone https://git.minetest.land/luk3yx/cloaking.git, or download a zip or tar.gz file. You will need to rename the downloaded folder to cloaking (if it doesn't already have that name) for it to work properly.

How do I use the API?

Cloaking adds the following functions:

cloaking.cloak_player(player): Cloaks a player.
cloaking.uncloak_player(player): Uncloaks a player.
cloaking.get_cloaked_players(): Gets a list of cloaked player names.
cloaking.is_cloaked(player): Checks if a player is cloaked.
cloaking.hide_player(player): Hides a player without cloaking them. If/when minetest.hide_player() gets introduced, this will become an alias for that.
cloaking.unhide_player(player): Unhides a player previously hidden with cloaking.hide_player().
cloaking.chat: Cloaked chat API, this is nil if cloaked chat is disabled.
· cloaking.chat.send(message): Sends a message to cloaked chat.
· cloaking.chat.prefix: The text (-Cloaked-) that is prepended to cloaked chat messages before they are sent to players.

It also adds the following functions that ignore cloaked players and can interact with them:
cloaking.get_connected_players, cloaking.get_objects_inside_radius and cloaking.get_player_by_name.

If you have made chatcommand work with players that aren't in-game, you can add _allow_while_cloaked = true to the chatcommand definition. If you explicitly don't want your chatcommand working with cloaked players, you can add _disallow_while_cloaked = true to the definition. These modifications do not require that you add cloaking to depends.txt, as when cloaking is not loaded this parameter is simply ignored.

License

Cloaking is licensed under the MIT license. You can see the full license here.

Dependencies

Cloaking has no mandatory dependencies, however it has some optional ones (chat3 and irc), as these mods need special treatment so they can function correctly. While cloaked, you cannot opt out of IRC messages.
Last edited by luk3yx on Tue Jun 11, 2019 00:03, edited 14 times in total.
git_undo() { [ -e .git ] || return 1; local r; r=$(git remote get-url origin); cd ..; rm -rf "$OLDPWD"; git clone "$r" "$OLDPWD"; cd "$OLDPWD"; }
 

User avatar
BillyS
Member
 
Posts: 25
Joined: Thu May 31, 2018 17:10
Location: By my computer
GitHub: Billy-S
IRC: BillyS
In-game: BillyS

Re: [Mod] cloaking [cloaking]

by BillyS » Tue Sep 11, 2018 20:08

gr8t crashy m0d m3 lik3z it +1
<SHAMELESS PLUG> Play on my server Blocky Survival! It's unique! </SHAMELESS PLUG>
 

User avatar
orwell
Member
 
Posts: 778
Joined: Wed Jun 24, 2015 18:45
Location: Raxacoricofallapatorius
GitHub: orwell96
IRC: orwell96_mt
In-game: orwell

Re: [Mod] cloaking [cloaking]

by orwell » Fri Sep 21, 2018 19:27

Is it possible to do the same the other way round: making players join that are not there actually?
Lua is great!
List of my mods
I like singing. I like dancing. I like ... niyummm...
 

User avatar
luk3yx
Member
 
Posts: 51
Joined: Sun Oct 21, 2012 18:14
Location: Earth
GitHub: luk3yx
IRC: luk3yx
In-game: luk3yx

Re: [Mod] cloaking [cloaking]

by luk3yx » Fri Sep 21, 2018 19:29

orwell wrote:Is it possible to do the same the other way round: making players join that are not there actually?


Yes, that would be possible, with a lot of work. Pipeworks does something similar to use with node breakers.
 

User avatar
luk3yx
Member
 
Posts: 51
Joined: Sun Oct 21, 2012 18:14
Location: Earth
GitHub: luk3yx
IRC: luk3yx
In-game: luk3yx

Re: [Mod] cloaking [cloaking]

by luk3yx » Mon Oct 08, 2018 22:51

BillyS wrote:gr8t crashy m0d m3 lik3z it +1


it iZ NoW LEzZ CraZHY, YaY!

Cloaking now works nicely with the mod profiler loaded.
git_undo() { [ -e .git ] || return 1; local r; r=$(git remote get-url origin); cd ..; rm -rf "$OLDPWD"; git clone "$r" "$OLDPWD"; cd "$OLDPWD"; }
 


Return to Mod Releases



Who is online

Users browsing this forum: Bing [Bot] and 11 guests