Tool_SwissArmyGun (v4r1)

Author Topic: Tool_SwissArmyGun (v4r1)  (Read 6815 times)

Tool_SwissArmyGun
(Version 4, revision 1)

The Swiss Army Gun is a multipurpose tool that allows you to hammer, wrench, print, plant, paint, wand, etc., etc., etc. from a long distance. In addition to emulating the default tools, the Swiss Army Gun is capable of emulating the fill can and also possesses a number of Swiss Army Gun-specific helpful functions.

Using the Swiss Army Gun
You can obtain a Swiss Army Gun (SAG) with the /sag command or by spawning it from a brick like any other item.

Use /saghelp to obtain a list of registered modes. Use /saghelp <mode> to see the help for a specific mode. The automatic help text that displays when you switch modes can be disabled with /saghelp off, or re-enabled with /saghelp on.

You will need to set the Swiss Army Gun's mode in order to use it. This can be accomplished by typing /sagmode <mode>.

You can also use /sag <mode> to instantly fire the Swiss Army Gun, even if it is not equipped. By adding a third argument (e.g. /sag <mode> 1 ), you will instantly fire the Swiss Army Gun, even if it is not equipped, and will equip the Swiss Army Gun as well.

While the Swiss Army Gun is equipped, equipping another tool will automatically change the Swiss Army Gun's mode while keeping the Swiss Army Gun equipped.

Default mode list
The following are the modes included with the default Swiss Army Gun.

Basic tools:
  • Hammer: Emulates the default hammer tool.
  • Wrench: Emulates the default wrench tool.
  • Print: Emulates the default print gun.
  • Plant: Emulates the default brick placement tool.
  • Wand: Emulates the default wand tool. Will automatically emulate the destructo-wand instead if you are an admin.
  • Paint: Emulates the default spraycan tools, including shape effect cans.
  • Fillcan: Emulates the fillcan, if it is installed and enabled.

Swiss Army Gun exclusive tools:
  • Delete: Deletes a brick, allowing you to remove a brick without destroying any bricks above it.
  • Bomb: Kills all bricks within a 30-brick radius of the target point. Only usable on your own bricks if you are a non-admin.
  • Nuke: A combination wand and fillcan, the nuke will destroy the target brick and all bricks that are touching it. Only usable on your own bricks if you are a non-admin. Will only destroy one player's bricks at a time.
  • PrintFill: A combination print gun and fillcan. Changes the print of the target brick and all similar bricks touching it.
  • Move: Allows you to change the position of an individual brick.
  • Copy: Allows you to copy an individual brick.
  • Liquify(New!): Sets a brick to use the "water" shape effect. This shape effect, like undulo, can be undone with the "stable" spraycan.
  • Fracture(New!): Splits a cube into eight cubes, each of half the size of the original cube. (Before / After)
  • Chisel(New!): Cuts a cube of a specified size out of another cube. If the brick hit is a cube of a size less than or equal to the chisel size, the brick will be deleted. Use /chiselsize <2/4/8/16/32/64> to set the size of the chisel. The chisel will automatically be set to size 4 if it is not set when the chisel mode is used. (Chisel 4 before / after, Chisel 8 before / after)

Frequently asked questions

Q: Does the Swiss Army Gun use raycasts?
A: Yes. The projectile it fires is only for show.

Q: Why isn't there a Duplicator mode for the Swiss Army Gun?
A: The way the Duplicator is coded prevents this from being done without copying and adapting large sections of the Duplicator's coding, which would need to be replaced each time the Duplicator is updated.

Q: Can I add more modes to the Swiss Army Gun?
A: Yes. See the included ModdingSupport.txt file for information on how to add more modes.

Credits
Scripting by Amade.
Thanks to Zor (Fillcan) and Plornt / Ephialtes (Duplicator) for coding references.
Thanks to Badspot for the particles, model, and icon used.

Changelog
v4 -> v4r1
  • Added keybinds to equip the Swiss Army Gun and switch between each mode.
  • Fixed some problems with the Move, Copy, and PrintFill modes.
  • Non-admins may now use the Swiss Army Gun in minigames where building is enabled.
v3 -> v4
  • The Swiss Army Gun will now switch modes instead of being unequipped when another tool is equipped.
  • /spawnWithSAG and mode switching with the light key removed.
  • Liquify, Fracture, and Chisel modes added.
v2 -> v3
  • Themes added: 4 themes are included by default (Wand (The classic SAG), Fire, Bazooka, Gun). Themes can be changed with RTB prefs system but require server restart to take effect.
  • Copy and Plant modes added.
  • Small tweaks to mode support system.
  • You can now add a second argument to the /sag command to mount the SAG and fire it.
  • /spawnwithSAG <on/off> option added.
  • The nuke mode will now only delete one person's bricks at a time to make it more precise with clearing spam.
v1 -> v2
  • Trust issues allowing you to PrintFill/Nuke individual bricks without trust or administrative privileges fixed.

Download
http://www.mediafire.com/download/yv5ves8559wnr00/Tool_SwissArmyGun.zip
« Last Edit: April 07, 2015, 04:32:52 PM by Amade »

For some reason using this mod disables painting horses.

For some reason using this mod disables painting horses.
I hate you so much

I don't know why you won't just fix bugs, god.

I don't know why you won't just fix bugs, god.
get out



Seems even better than the original, gonna check it out!

you should make a client mod that includes keybinds to make switching to different modes faster and easier


The "Fracture" Images are the same
fix ples

Great mod!

can you make a tool that makes stuff less spammy by using bigger bricks?
..uh
sees if there's any way to reduce spam on a build and uses bigger bricks to reduce it?

I like the mod, but are there RTB prefs to change the permissions to it? If I used to host a deathrun with it, but I couldent disable it. Please either make it Super Admin only, or add prefs for it. Thanks.

The "Fracture" Images are the same
fix ples
Thanks for letting me know. I fixed it.

I like the mod, but are there RTB prefs to change the permissions to it? If I used to host a deathrun with it, but I couldent disable it. Please either make it Super Admin only, or add prefs for it. Thanks.
Non-admins cannot use the Swiss Army Gun while in a minigame.


can you create a tool for this that, when fired on a brick, highlights every brick that's required to destroy that brick without destroying other bricks

example:
- you have a tower of 1x1 bricks
- you switch to this tool i propose
- you fire at the bottom brick
- it highlights all the bricks on top of it because you need to destroy those to destroy the bottom brick