Code Monkey home page Code Monkey logo

paradigm-mp / fivem-rust-gamemode Goto Github PK

View Code? Open in Web Editor NEW
10.0 4.0 7.0 11.19 MB

Rust-inspired survival gamemode for FiveM using OOF. This project is discontinued, but I am still working on a Rust-inspired survival server in FiveM. Join the discord for progress updates.

Home Page: https://scrap.games

License: GNU General Public License v3.0

Lua 66.52% JavaScript 25.54% Shell 0.11% HTML 0.64% CSS 1.19% SCSS 6.02%
survival gamemode oof fivem rust

fivem-rust-gamemode's Introduction

⚠️ This project is discontinued ⚠️

...but I am working on a new Rust-inspired survival server! Join the discord for progress updates here.

FiveM Rust Gamemode

Rust-inspired survival gamemode for FiveM using OOF.

Disclaimer

This gamemode is not currently functional in any sense. When this gamemode reaches a working state, this readme will be updated. The goal of open sourcing this gamemode to encourage more people to learn and use OOF as well as this gamemode.

Setting Up

Set Language

If you plan on using a language other than English on your server, you'll want to add this line to your server config:

setr locale "en-US"

Replace en-US with the locale of your choice.

Unsupported locales will fallback to the en-US locale by default. If a locale for your language does not exist, please feel free to add it and create a PR! Follow the steps below to add a locale.

Supported Locales:

  • en-US: English

Adding a New Locale

If you'd like to use a language other than English and your locale currently isn't added, follow these steps.

  1. Set your locale in the server config to the desired locale (instructions above).
  2. Navigate to inventory/src/js/locale.
  3. Copy en-US.js to a new file and rename it to your locale, eg. aa-AA.js.
  4. Open the file you just renamed and edit the localized strings. Do not edit the keys inside brackets (["key"]), but edit their values instead: ["key"]: "value".
  5. Once you have finished editing the file, we now need to import it. Open inventory/src/js/locale/common.js.
  6. Near the top you should see a comment saying: // Import languages here. Copy these two lines and paste them under the existing localizations.
import LOCALE_EN_US from "./en-US";
LOCALES["en-US"] = LOCALE_EN_US;

Replace the localization names with your own, for example:

import LOCALE_AA_AA from "./aa-AA";
LOCALES["aa-AA"] = LOCALE_AA_AA;

Now you'll need to build the UI again, which is covered in the below step.

Now you should be all set with your new localization! Please make a PR so it can be included in the main repository.

Item Icons

Since this is a Rust-inspired gamemode, we are using the icons from the Rust game. However, we will not be distributing these icons with these scripts because we do not have permission to do so. This means that if you run the gamemode right out of the box, you will be missing all item icons.

You have two options to fix this:

  1. Download Rust and copy the necessary images from Rust/Bundles/items to inventory/src/images/rust. Please do not copy them all, but instead only copy the those that are needed (see inventory/src/js/contents/Images.js for a list). You don't have to rename these images - the scripts use the default names from the Rust game.
  2. Create or find icons for each of the items used yourself (see inventory/src/js/contents/Images.js for a list of icons used). This is much more tedious, but you won't be using Rust's icons (and thus won't get in legal trouble!). If you end up creating custom icons that you would like to be included in this repository instead of the Rust icons, please let me know! It would be great to have icons included by default for easier setup. Recommended image size: 512x512.

Also, if you know a contact at FacePunch, please let us know! We'd love to talk about getting permission to use the Rust icons in this fun gamemode.

Inventory UI

The inventory/crafting UI uses React, so you'll need to compile it using webpack first.

Navigate to the inventory directory and run the following commands:

npm install
npm run build

This will generate the compiled JS for the inventory/crafting UI to use.

If you'd like to develop the UI, run this command:

npm run dev

This will open up the UI in your browser to quickly develop it. Keep in mind that you have to manually refresh the page after you make changes, but changes will be automatically compiled. To refresh in FiveM, restart the rust resource.

Resource Generation

When you start the server for the first time, you should see a lot of messages saying that the server is generating and loading the different resources, such as trees and rocks. This is a normal part of starting the server for the first time. It takes all the raw data from resources/server/resource_data/raw and converts it all into a cell based format which it stores in resources/server/resource_data/cells. This is important because the server should only send players nearby resources instead of all resources.

In the case that your generated resource data becomes corrupted or you'd like to regenerate it using a different cell size, just delete resources/server/resource_data/generated.txt and restart the server. It should automatically generate for you.

Server Customization

Every server that uses this gamemode will be a little bit different, thanks to a few global configuration options.

You can find these config options in config/shared/RustConfig.lua. After adjusting the config options, you might also want to update your server title to include any options that you changed so that players know what kind of server it is.

For example, if you set BaseUpkeepModifier to 0.25 and MaxGroupSize to 2, you might include something like this in your server title: [Duos Only] [Low Upkeep]. Or if you set MaxGroupSize to 0 and BaseUpkeepModifier to 0, you might add something like this to your title: [Anarchy] [No Decay].

Bugs

  • The trees/rocks change size when I get close to them. How do I fix it?
    • Not possible to fix right now. The objects are converted from CBuildings which have custom scales, but custom scaling of object entities is not currently possible during runtime.

Contact Us

You can get in touch with us on our Discord.

fivem-rust-gamemode's People

Contributors

benank avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.