Hatmod by Boodals & JakeBlade v4.2 (Update)

Author Topic: Hatmod by Boodals & JakeBlade v4.2 (Update)  (Read 7069 times)

HATMOD BY BOODALS & JAKEBLADE
And after more than a year, the hat randomizer's finally been fixed.

FEATURES

Random hat tick
Every 10 minutes, every player has a 5% chance to get a random hat.
Super admins can change the time and chance, or disable totally (See prefs).

Duplicate hats
You can get more than one of a hat type.
You can give away duplicate hats using the /giveHat [Player] [Hat] command.
Super admins can change whether players can get duplicate hats.
Super admins can toggle the /giveHat command.

Hat Items
Hats can be spawned as an item for display purpose.
They cannot be picked up. Adding one to your inventory does nothing.
The host can disable this to save datablocks (See prefs).


Hats save
Hats will save on the server automatically.
The host can change the file name of the save location using RTB, or through console. (See prefs)
Any player can clear their own hats using /clearHats.
The /clearHats command can be disabled for non-SA (see prefs).
Super admins can use /clearHats [Player] to clear [Player]'s hats.
Attempting to clear hats will ask you to confirm what your doing.

Events
Client > GrantHat > [Hat name] [Limit] [Amount]
Grants client the hat. If limit is set (checkbox), only grant the hat if the player doesn't have the hat already.
Only super admins can place this event.

Player > setHat > [Hat name]
Sets the worn hat of the player.
Can take off hats by using None or Off.
Only admins can place this event.

Bot > setHat > [Hat name]
Same as Player > setHat
Anyone can place this event.

VCE variables
If you have VCE enabled, then variables will be created.

<var:player:wornHat> The hat that the player is currently wearing.
<var:client:totalHats> The total amount of hats the client has. Not effected by prefs.
<var:client:uniqueHats> Same as above, but doesn't include duplicate hats.
<var:client:hatCount_[HAT]> The amount of hats the client has. Replace [HAT] with a hat name.
Instead of spaces, put underscores ( _ ).
<var:client:hasHat_[HAT]> 1 if the client has the hat, otherwise 0.
<var:brick:ownerTotalHats> Same as <var:client:totalHats>, but for the brick's owner.
<var:brick:ownerUniqueHats> Same as <var:client:uniqueHats>, but for the brick's owner.
<var:brick:ownerHatCount_[HAT]> Same as <var:client:hatCount_[HAT]> but for the brick's owner.
<var:brick:ownerHasHat_[HAT]> Same as <var:client:hasHat_[HAT]> but for the brick's owner.
<var:global:hatCount> The amount of registered hats on the server.

Simplewell compatible
Simplewell hats that are in your add-ons folder will be loaded.
It isn't recommended that you use these. I cannot promise that they will work.
Do NOT turn these on in the add-ons list.

Randomized Hats
If you use random or rand instead of a hat in some commands and events, it will automatically choose a random hat.

Preferences (prefs)
Configure HatMod to behave how you want, using RTB or slash commands.
Change the random hat time with /hatTime [Time] (SA only).
Change the chance to get a random hat with /hatChance [Chance] (SA only).
Disable random hats by setting the chance or time to 0.
Toggle whether players can get duplicate hats with /DuplicateHats (SA only).
Toggle the /clearHats command for non-SAs with /hatClearing (SA only).
Toggle the /giveHat command with /hatSharing (SA only).
Let all players have access to all hats with /hatAccess (SA only). If you turn this off, the players will not have gained all the hats.
Toggle whether hats are spawnable as items with /hatItems (Host only). Having this enabled doubles the datablock count, and takes up a lot of space in the item list. You will need to restart the server for this to take effect.
Force everyone to have a random hat they have access to with /forceRandomHats (SA only).

Serverless Update Notifier
A unique update notifier system that does not require me to host a website.
Basically, each client tells the server what version they have, and the server tells the outdated clients to update.
There are safety catches to prevent people faking updates.

FAQ
Q: I installed the hat pack X, but it isn't shown in the add-on list!
A: Hat packs do not show up in the add-on list. This is perfectly normal, and the hats will be in game.

Q: I cant wear any hats!
A: Say /listHats. If you don't see any hats, then you have not installed any hat packs. Go download one.
If you do see hats, then see the HOW TO GET HATS section.

Q: I cant pick up any hats!
A: No you cant. Hat items are for display purpose only. Again, see HOW TO GET HATS.

HOW TO GET HATS

First, simply download a Hat pack, and place it in your add-ons folder.
The hat pack will not show up in the add-ons list. This is perfectly normal.
By default, everyone on the server (who is not afk) will have a 5% chance to get a random hat every 10 minutes.
If you want a specific hat, as a Super Admin you can say /grantHat [Player] [Hat] where [Player] is the name of the player you want to give the hat to.
Alternatively, Super Admins can say /hatAccess to let everyone have access to all hats. Its worth noting that this does not grant everyone hats. If you turn this off, you will not have gained any hats.
Finally, to see what hats you have, say /hat. Then to wear a hat, say /hat [Hat].

HATPACKS

When you install the mod it won't have any hatpacks to use, you need separate zips to be placed in your add-ons folder for them to load.
Inside the server_Hatmod.zip is a file which describes how you make your own hatpacks.

The links below will let you download the mod itself and all currently released major hat packs which, in total, includes 213 hats.


HOW TO USE

Put the Server_HatMod.zip inside your add-ons folder and activate it in order for it to work.
Put Hatmod_Jake inside your add-ons folder as well (you don't have to activate hatpacks as they are automatically loaded by Server_HatMod)

DOWNLOADS
Server_HatMod V4.2
Hatmod_Jake 46 Hats
Hatmod_Nobody 51 Hats
Hatmod_Hair 20 Hats
Hatmod_Hair2 20 Hats
Hatmod_NHats2 24 Hats
Hatmod_NHats3 52 Hats




DONATIONS

If you want to support Boodals and myself please feel free to send donations to the following Paypal adress: arnodoesburg@hotmail.com
I added this because making this mod takes quite some time, we would never charge people for downloading our add-ons, though donations would be very much appreciated.

- List of donators -
none

CREDITS

Boodals - 3504 - Scripting        Gumba Jonny - 19867 - Modelling        JakeBlade - 7088 - Modelling        Mr.Noßody - 6480 - Modelling
« Last Edit: June 10, 2015, 07:48:13 PM by Mr.Noßody »

UPDATE 4.2

Hat randomization has been fixed
Special thanks to Slezak for providing the fix
« Last Edit: June 10, 2015, 07:58:15 PM by Mr.Noßody »


Oh jesus forget.

When I said you could post a fix in the OP, I meant in your hat pack topic.. Well whatever...


Yeah, I approved this fix etc etc. But there might be an entirely new HatMod coming out soon, rewritten. When its out, you'll need to clear this OP and redirect people to the release thread that i'll make for it.


One and a half months later edit: Didn't want to bump the topic, but I found out why I never fixed this myself. Turns out, I did. I just never updated the version on the old topic.
« Last Edit: July 26, 2015, 03:52:44 PM by boodals 2 »

Yeah, I approved this fix etc etc. But there might be an entirely new HatMod coming out soon, rewritten. When its out, you'll need to clear this OP and redirect people to the release thread that i'll make for it.

Will do.