Skip to content

leghola/PublicRustPlugins

 
 

Repository files navigation

Jake's Rust Plugins

  1. Anti Foundation Stack
  2. Blueprints Revived
  3. Combat Log
  4. (WIP) Crafting Table
  5. Craft Queue Saver
  6. (WIP) DayZ Magazines
  7. (WIP) Gyro Heli
  8. Jake UI Framework
  9. No Despawning
  10. Recycle Tweaks
  11. Visual Debug
  12. Weapons On Back

Plugins

Anti Foundation Stack

Luckily, this bug has been fixed in the main game.

A simple bug fix to stop players from stacking square foundations inside eachother. (To prevent this)

Blueprints Revived

Preview

Bringing back the original blueprint system into current rust. Trying to keep the original feel while bringing in all the new features.

Many changes and balances were made:

Blueprints (fragments, pages, books, librarys)
Revealing a blueprint gives a random item blueprint from the respective tier
Accurate loot tables to July 2016 branch (with current items added on top)
Accurate blueprint tiers (balanced with current items)
Recycle blueprints to down-convert them (pages to fragments for example)
Research tables work extremely similar to original version (had to use a custom UI to have accuracte research percentage)
Research tables appear in all monuments (will be loaded in and removed when the plugin is loaded / unloaded) 1 2 3

Arrow raiding (Only on wood, and extremely slow on stone)
Softsiding doors and ladder hatches
Old raid towers / building privledge (irrelivant now that you can build twig inside building blocked)
No heavy armour
Spears un-nerfed (headshot damage x1.5)
Crossbows and bows un-nerfed (headshot damage x1.5)
Radiation disabled (by default)
Hemp gives 20 cloth and no seeds (as per original system)
P250 and revolver back to original clip size (revolver 6 bullets, p250 8 bullets)
Configurable blueprint fragment rate (for modded servers)
And more I forgot about!

Details:

It was incredibly satisfying to see players run around in only the gear they had researched, the lucky naked that found a C4 inside a crate. Servers were pretty popular and it was great seeing so many people enjoy my work.

There were many "hacky" solutions that had to be used. This mod was decievingly simple: there was a bunch of stuff going around in the background to make it look as normal and unmodded as possible for the player.

The research table on it's own did absolutely nothing. I had to add a custom monobehavior to each one, that would add a sphere collider. When players entered the sphere collider, it would raycast 4m in front of the player 4x a second to see if they were looking at the research table. If so, it would show the icons and "Open" text just like the original table did, and allow the UI to open when the player pressed "E".

Since blueprint fragments were completely out of the game, I had to upload custom workshop skins and reskin an existing item to look like fragments. When the items were dropped, they had to be turned from presents into Blueprint items, and vise-versa when picked up.

When uploading a workshop skin, you disconnect your internet, find the folder in %TEMP%, replace the icon.png with your custom icon, and reconnect your internet to upload your custom workshop item. Forget how I figured that out, but that was the spark that got me to actually take this mod on.

Luckily, presents had an "unwrap" and "combine" option, which was good enough to use as the base item. After a bunch of code to have them behave as seperate items based on the skin ID, the "blueprint fragments" were back in the game.

Combat Log

A SUPER simple plugin, that grabs the combatlog of a player based on steamID. Eventually the plugin will change the way combatlog works, by filtering hits on players, animals, building blocks, heli, etc. (Would only display player attacks, the rest are irrelivant 99% of the time)

Crafting Table

For a long time I have requested custom crafting recipes to no avail. After starting "DayZ Magazines" and the Helicopter mod, it was a certainty that I would need an easy way for players to use non vanilla recipes.

There was a mod that overwrote the vanilla crafting menu, but it was slow, laggy and was broken when key binds couldn't be set by the server. Instead, I decided to make a "crafting table" like minecraft.

I already knew how to give functionality to useless entities via my work with "Blueprints Revived", so I set out to give the useless table a function. Players could walk up the the table and open it up, to reveal a list of mods. Clicking on each mod would show the icons of all items you could craft, and clicking on an icon would show all the details of the crafting recipe in a format similar to the vanilla crafting menu.

It will be released once some more testing is done, and the colors / appearance are tweaked. Bright colors work great for testing, but not all players enjoy it.

Craft Queue Saver

Players love to afk craft tons of materials, and leave their computer running. The problem is when they disconnect: they drop their entire crafting queue likely losing their items, or when the server restarts their crafting queue is simply deleted. This plugin serializes their crafting queue, restoring it when they log back in. If they are killed while logged out, their crafting queue will be dropped, and when the server wipes it will clear everyone's crafting queue to prevent people keeping items over wipes.

DayZ Magazines

Plugin was inspired by the way weapons work in DayZ. The item icons were also taken from the DayZ Standalone game files.

Instead of reloading your gun with bullets in your inventory, you need a magazine that fits your specific weapon.

Magazines are filled by dragging bullets into the magazine in your inventory, or using putting magazines and the respective bullets in an auto-filling machine.

The idea of the mod is to promote conservation of ammo, force players to think strategically about their reloads, while adding additional expensive or rare high capacity magazines for weapons.

It also opens up the possibility of seperate ammo types for weapons. For example, the LR300 could use 5.56mm bullets, the ak47: more expensive 7.62mm, and finally the bolt action and M249 could use expensive 7.62mm X 54mm ammunition. This feature will most likely a configuration option for a hardcore mode.

Easy Chat Commands

Need to provide your players a link to your discord, teamspeak, website, etc, but don't want to bother coding? Just add the command and what text it should display when called to a config file, and you are good to go! (Simple Quality of Life utilities for server owners are surprisingly popular.

Gyro Heli

After watching Colon Blow's youtube showcase of a gyrocopter, I was inspired to make a legitimate functional helicopter mod.

As cool as Colon's looked, it was a cheaty way of doing it. He was making the player the parent object and no clipping around the map at a slow speed. Sure, it looks cool in a showcase video but it would be a nightmare to manage as a public plugin.

My approach was having a central entity, adding a rigidbody to it and adding all outer entities as children under it. After adding in some simple helicopter type physics, it was flying more like a real helicopter while staying simple to understand.

A problem I quickly ran into was my choice of entities. Building blocks often refuse to update their position, so they were quickly out of the picture. Wooden signs look great, but they don't render past 40m - 80m depending on the size. This meant you would see players magically floating in the air, as opposed to a helicopter flying. I chose to use XXL paintings as the outer hull as they render at least 400m, so the helicopter is visible from a great distance.

Other entities will be used to decorate the interior of the helicopteras we only need to see the general shape of it from a distance, not the interior buttons.

I also added in moving, toggleable cargo doors and side doors because they look really cool and should be interesting via gameplay.

Still need to make heli movement smoother, add GUI, and either bind players to certain seats within the heli, or allow walking, jumping and running within the vehicle while it is moving.

Jake UI Framework

Oxide's Community UI manager was crappy and cumbersome. I made an object orientated version that also made it easy to add callbacks, variable text, etc.

Each element derives from a base class UIBaseElement, which handles the resizing and parent/child relations between elements.

Then each CUI element has it's own class with editable properties, and a big constructor if you want to declare the UI in one line.

Buttons are easier to use: just add an action to UIButton.onClicked for hooks when a button is clicked.

To show or hide UI to a player, call UIElement.Show(BasePlayer) or UIElement.Hide(BasePlayer) respectively. You can have a panel containing multiple elements inside it, and it will show or hide all child elements as well.

If you want to update UI with a new value, call UIElement.Refresh(BasePlayer) (use null as the parameter to refresh for all players). It will only update for players who currently see the UI, not show it to all players.

Add a delegate to EITHER:

UIElement.conditionalShow: Return true/false to show or hide an element.

UIElement.conditionalSize: Change the size of an element. Useful for a bar display.

UILabel.variableText: Change the label's text.

UIRawImage.variablePNG: Change the image.

Example #1:

//Shows the countdown left when researching, or blank when not researching

researchCountdownLabel.variableText = delegate (BasePlayer player)
{
    var data = GetResearchData(player);
    if (!(data.isResearchingItem && data.usingResearchTable))
    {
        return "";
    }
    return data.timeLeft.ToString();

};

Example #2:

//Changes the durability icon by changing the height of a green box based on the durability of a weapon

itemDurabilityPanel.conditionalSize = delegate (BasePlayer player)
{
    var data = GetResearchData(player);
    if (data.targetItem == null)
    {
        return itemDurabilityPanel.size;
    }
    return new Vector2(itemDurabilityPanel.size.x, data.targetItem.conditionNormalized * data.targetItem.maxConditionNormalized * 1f);
};

No Despawning

Could also be called "PersistantItems". A super cool plugin I wrote over a random weekend: it optimizes dropped items on a server, while also allowing them to stay around way longer.

When this was first designed, all items had super long despawn times. It was soon discovered that the only way players get rid of trash is by dropping it on the ground and letting it despawn. As it currently stands, items such as burlap clothing only stick around for 15 minutes, while an assault rifle will stay around for 3 days, and an m249 will stay around for an entire week.

Details:

The optimization was to disable any inactive items, so that we wouldn't hit the collider limit by having a bunch of entities just sitting around on the ground, plus the more items with physics, the more the server is stressed.

I split the world into a grid with 20m X 20m cells, and assigned all items into their own cells. Once all items inside a grid stopped moving, the rigidbodies would all be disabled. Once a new item is dropped in the grid OR an entity with dropped items on it was destroyed, all items in that grid will be reactivated, and would stay active until an minimum timout and they stop moving.

Since items would be sticking around for a lot longer than 5 minutes and people would still try to despawn, I made multiple of the same item stack. This means that when destroying a chest filled up with wood, instead of dropping 30 individual stacks, it drops one stack of 30,000. When picking up the wood, you will only take 1 stack at a time, until it is all gone.

Despawn time also scales with the over-stack amount: 10k wood despawns in 10x the time.

This had the side-effect of making it very difficult to crash a server by dropping a bunch of pumkins or rocks in one place, though you could still still use the much less effective method of "running around and dropping them one by one in different locations".

Non-stackable items stack on the ground as well, while preserving attachment, ammo, etc.

Recycle Tweaks

Another simple plugin that allows empty cans to be recycled. It was also going to take care of other items in the blueprint system like the old hazmat gear, but that was taken out before I had the chance to add it in.

Shorter Nights

This one was written by audi (i_love_code), it made night shorter while making it very hard for the player to tell we skipped it. It switches between equal daylight levels (22:00 -> 5:00). Unless the player watches the sky and sees the moon jump, they won't notice the "magic" as it happens.

Visual Debug

Allows you to look around at all the variables, and call functions inside any running plugin. Designed to be similar to Visual Studio's object explorer when debugging.

I am actually super proud of this plugin: it was my first real dive into reflection, and it is really cool all the debugging and fun stuff you can do with it :)

Was super useful to see what funky stuff was going on when our modded server was really laggy. Perhaps there was an edge case causing a dictionary not to be cleared, or you wanted to call a reset function, but couldn't reload the plugin to add a chat command.

Queue Holder

There is nothing worst than your room-mate using the microwave on wipe day, cutting out your internet just long enough to be met with an 80 person queue! This plugin alliviates that problem: after disconnecting, you have a 5 minute grace perioid to rejoin safely, skipping the queue.

Weapons On Back

The mod that inspired the feature in the main game!

My first popular mod. I was playing around and figured out that setting the parent of an entity would also bind it clientside. I mocked something up, and played around with rotations to get each weapon positioned correctly. I set the parent bone to "spine1", so they would move correctly as the player looked around. I settled on showing only the best weapon not currently equiped, as it was easy to determine best weapon, made sense logically when looking at players and was the hardest to abuse. It looked great once I got all the weapons in the right spot, and ended up on nearly every modded server. And then eventually every server! :)

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • C# 100.0%