Git Product home page Git Product logo

kragle's Introduction

kragle

The core gamemode that holds everything together

Uses semantic versioning http://semver.org

Kragle is plugin based

<your module name>/
  module.lua

example of module.lua

if SERVER then AddCSLuaFile() end -- for modules that should run on client
fw.dep(SHARED, 'hook') -- module uses hooks
fw.hook.Add('PlayerSay', function(pl) -- automagically injects the hook into the gamemode table
  pl:Kill() -- speaking out against the authority is death~
end)

Utility Functions and Recommendations

Please read over the modules by thelastpenguin for reference to find how to properly use netdoc and existing librararies properly in your code. Please use stylish fonts. from libraries/fonts

When doing prints

Please always use fw.print over print

When including files

Please always use

fw.include_sh 'file name' -- to include a shared file
fw.include_cl 'file name' -- to include a client file
fw.include_sv 'file name' -- to include a server file

When loading dependencies

-- Require External libraries first
require 'spon'
require 'tmysql'
...
-- Require Dependend modules next
fw.dep(SERVER, 'hook')
fw.dep(SHARED, 'data')
...
-- Require lua files last
fw.include_cl 'myfile.lua'
...

Also remember if your module runs any code client side you must add

if SERVER then AddCSLuaFile() end

to the top, kragle does not AddCSLuaFiles for you! It aims to give you maximum control over how your files are loaded.

When adding hooks

always use the fw hook module the syntax for this is

fw.hook.Add('hook name', 'optional hook id', function(...) end)

just as usual. Hooks get injected into the GM[hook name] table. They will always be called in the same order that they are added which means hooks in modules you require with fw.dep(...) will get called before hooks in your module, but this behavior can get funky with lua refresh. If you choose not to provide the 'optional hook id' the source path of the file it is defined in will be used instead.

Networking

Please try to use netdoc for your networking needs. The data module defines a helper function Player:GetFWData() that you can use to get the network data table for that player. The player's money for example is stored in player:GetFWData().money, the faction in player:GetFWData().faction. You can add fields as desired. For more information about this please see the module docs at the bottom of this page for libraries/data.

Dependencies

Please install and keep the following up to date

Style Guide

  • use -- for comments
  • use native lua syntax only plaese aka not instead of !
  • use lowerCamelCase for all methods and local variables etc. If you find somewhere that isn't lower camel case please change it.
  • please read through this https://github.com/Capster/lua-style-guide

Module Docs

kragle's People

Contributors

jtsalisbury avatar meharryp avatar mikey-howell avatar snappey avatar thelastpenguin avatar

Watchers

 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.