Git Product home page Git Product logo

lotropluginexamples's Introduction

Lotro Plugin Examples

This repository contain some example plugins for Lord of the Rings Online (lotro) with the purpose of learning how plugins work.

To try it out, clone or download this repo and follow the instructions below.

The game will recognize the plugin allowing you to load it like other plugins, through the /plugin manager command.

About LOTRO plugins

Coded in the Lua language, plugins can extend the game with some new custom functionality not included from the start. Plugins for lotro are more restricted than those for certain other games (wow), where you can automate just about anything.

What a plugin can do

  • Read information from the game world such as info about the character, items, skills, mounts and crafting
  • Draw custom User Interfaces
  • Interact with chat like register new /commands, write text
  • Subscribe to game events and run code as a reaction
  • Save and load data to keep state between sessions of play

What a plugin cannot do

Simulate user interaction

This includes moving the character, attack or interact with objects or npcs, trigger quickslots. Basically, if something shows up in the Keybinding menu, you cannot trigger it with code.

Howto install and manage plugin

Plugins are installed by copying it to the game's Plugins directory. The Plugins directory is part of the game's user files, normally located in C:\Users\yourusername\Documents\The Lord of the Rings Online\. First time, you will have to create the Plugins directory yourself as C:\Users\yourusername\Documents\The Lord of the Rings Online\Plugins\. Once you have that directory, you can copy plugins there. The plugins normally are located in a directory named after the plugin's creator, or the plugin name. For my examples, the root directory is FredriksExamples. Once copied, this directory should reside directly in the Plugins directory.

After a plugin is in the right directory the game will pick it up on startup. Alternatively you can type the command /plugins refresh. The plugin will then show up in the Manage Plugins panel in-game by typing /plugins manager.

Anatomy of a plugin

At a minimum, a lotro plugin needs to consists of just two files.

A manifest file

An XML file containing name, description, version etc. Also, most importantly, it contains a reference to the code entrypoint. This is the code file that the game runs when the plugin is loaded. It is written in the following format.

<Package>FredriksExamples.Example1.Main</Package>

This corresponds to the directory FredriksExamples\Example1 and a file named Main.lua in that directory.

At least one .lua code file

In the minimal example, this is the file referenced from the .plugin file above, and is run when the plugin is loaded. In this file you can create UI elements, start loading preferences, register chat commands and run any code that should happen immediately.

Graphics resources

If your plugins is of a visual kind, you may want to include custom images to use as screen overlays or inside windows.

My Example Plugins

See README.md in each example sub-directory for individual documentation.

Further reading

My primary source is this forum post by Garan explaining quite verbosely how plugins work and various aspect of the development.

Another useful source is the latest official API docs (as of november 2019). While not saying anything about "how", it gives an overview of the game resources exposed and what events you can connect to.

Status of this document and code

This document was written when Lotro is in version Update 23 (november 2018). As the game evolves, the API details could change, making the example code stop working. If so, give me a shout!

lotropluginexamples's People

Contributors

shorinji 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.