LordTylus / SE-Torch-Plugin-ALE-Biggest-Grids-Broadcast

https://torchapi.com/plugins/item/b3e6b485-3196-457e-9f12-46a6445ff887
Apache License 2.0
2 stars 1 forks source link

Introduction

If you are running a PVP server you may or may not need a bunch of Mods in order for players to find each other. Especially when planets are in the world you cannot really limit the worlds size and therefore players can hide themselves in deep space while building monstrosities that will never see any actual combat.

This Plugin is one way to help you dealing with that. It adds functionality to the game to determine the biggest grids by PCU and broadcast them to all players on the server. So people are more likely to be found. Alternatively you can also broadcast the grids which are furthest away from world center.

How does it work?

First of all the Plugin only adds the functionality. If you want to take Advantage of it in an automated way I recommend using the Essentials mod and setting up Auto-Commands. (Example Config and Commands are found below).

The Plugin itself detects the PCU / or distance of each and every grid on the server and broadcasts a configurable amount of them to all Players on the server. Grids are only broadcasted when:

The default config broadcasts the Top 10 grids which have at least 5000 PCU with a Player within 1km of range.

The limit for min PCU makes sure that new players which basically only have a small base or starter ship to not being attacked immediately.

If the biggest grid has no player online or otherwise close by the next available grid will take its place on the top spot in the list.

Commands

There are 3 Commands:

Configuration

There are the following configuration methods:

UI

XML

<?xml version="1.0" encoding="utf-8"?>

<GridsBroadcastConfig xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"&gt;

<TopGrids>10</TopGrids>

<MaxDistancePlayers>1000</MaxDistancePlayers>

<UseConnectedGrids>false</UseConnectedGrids>

<MinPCU>5000</MinPCU>

<RemoveGpsOnJoin>true</RemoveGpsOnJoin>

<GpsIdentifierName>Doom Plugin</GpsIdentifierName>

</GridsBroadcastConfig>

Auto Command Example

When setting up with auto commands there are the following options:

Delayed execution

By that the GPS will be sent out daily at 7PM and removed from every player 30 minutes after.

<AutoCommand>

<CommandTrigger>Scheduled</CommandTrigger>

<Name>Broadcast</Name>

<ScheduledTime>19:00:00</ScheduledTime>

<Interval>00:00:00</Interval>

<TriggerRatio>0</TriggerRatio>

<TriggerCount>0</TriggerCount>

<DayOfWeek>All</DayOfWeek>

<Steps>

<CommandStep>

<Delay>00:30:00</Delay>

<Command>!sendbiggps</Command>

</CommandStep>

<CommandStep>

<Delay>00:00:00</Delay>

<Command>!removebiggps</Command>

</CommandStep>

</Steps>

</AutoCommand>

Scheduled execution

The first one surely works fine, but has the risk of not removing the GPS when the server crashes. If remove on join is enabled its not a problem at all. If its not enabled you may consider using 2 commands:

<AutoCommand>

<CommandTrigger>Scheduled</CommandTrigger>

<Name>Broadcast</Name>

<ScheduledTime>19:00:00</ScheduledTime>

<Interval>00:00:00</Interval>

<TriggerRatio>0</TriggerRatio>

<TriggerCount>0</TriggerCount>

<DayOfWeek>All</DayOfWeek>

<Steps>

<CommandStep>

<Delay>00:00:00</Delay>

<Command>!sendbiggps</Command>

</CommandStep>

</Steps>

</AutoCommand>

<AutoCommand>

<CommandTrigger>Scheduled</CommandTrigger>

<Name>Remove</Name>

<ScheduledTime>19:30:00</ScheduledTime>

<Interval>00:00:00</Interval>

<TriggerRatio>0</TriggerRatio>

<TriggerCount>0</TriggerCount>

<DayOfWeek>All</DayOfWeek>

<Steps>

<CommandStep>

<Delay>00:00:00</Delay>

<Command>!removebiggps</Command>

</CommandStep>

</Steps>

</AutoCommand>

Github

See Here