ECO

Bonus start star for ECO

Released (updated ago). Ranked 174 of 230 with 777 (0 today) downloads

Published by Navat1618584814 (mod ID: 854862)

277847859028211.png

Adds bonus stars to a new player or when an existing player logs in. The quantity can be specified in the variable

Releases

FilenameSizeVersionAddedOptions
startstar.1.zip0.57kb-

startstar.zip0.74kb-

12 comments

Join the community or sign in with your gaming account to join the conversation:

R
Robu @robu

This will work on 9.5.x

To fix this, edit the StartStar.cs file and remove from Line 13

, IChatCommandHandler

To configure how many stars you give the person on first logon (it ONLY grants on first logon) change this line
private int starsToAdd = 10;

Where 10 = the number of stars

L
Leo1646829866 @leo1646829866

Why this doesn't work at my server ? No errors, it loads but I get nothing.

KotoroShinoto
KotoroShinoto @kotoroshinoto

:C:\Program Files (x86)\Steam\steamapps\common\Eco Server\Mods\UserCode\StartStar\StartStar.cs(25,22): error CS1061: 'User' does not contain a definition for 'SpecialtyPoints' and no accessible extension method 'SpecialtyPoints' accepting a first argument of type 'User' could be found (are you missing a using directive or an assembly reference?)
Source:Eco.ModKit

System.Exception: C:\Program Files (x86)\Steam\steamapps\common\Eco Server\Mods\UserCode\StartStar\StartStar.cs(25,22): error CS1061: 'User' does not contain a definition for 'SpecialtyPoints' and no accessible extension method 'SpecialtyPoints' accepting a first argument of type 'User' could be found (are you missing a using directive or an assembly reference?)
at Eco.ModKit.RoslynCompiler.HandleCompilerError(ImmutableArray`1 diagnostics)
at Eco.ModKit.RoslynCompiler.Compile()
at Eco.ModKit.RoslynCompiler..ctor(String modsAssemblyPath)
at Eco.ModKit.ModKitPlugin..ctor()
Outer Exceptions:
Exception has been thrown by the target of an invocation.

zangdar1111
zangdar1111 @zangdar1111

This works (only tested quickly):

using Eco.Gameplay.Utils;
using Eco.Shared.Localization;
using Eco.Shared.Services;

namespace Eco.Mods
{
using Eco.Core.Plugins.Interfaces;
using Eco.Core.Utils;
using Eco.Gameplay.Players;

/// <summary> Add star to player. </summary>
class StartStar : IModKitPlugin, IInitializablePlugin
{
private int pointToAdd = 1;

public string GetStatus() => string.Empty;

public void Initialize(TimedTask timer)
{
UserManager.OnNewUserJoined.Add(user =>
{
user.UserXP.StarsAvailable += pointToAdd;
user.UserXP.TotalStarsEarned += pointToAdd;
});
}
}
}

ChickenWin1621619395
ChickenWin1621619395 @chickenwin1621619395

This will crash new players joining on the first login.

Loeffel
Loeffel @loeffel

You can get it running, when you disable the messages in the script.
Just delete the two line where the messages are sent or make a remark out of them (put // infront of the line).
Afterwards the script will work and provide the extra stars after first login. You just don't get a message about it.

SomeCrackh1596278370
SomeCrackh1596278370 @somecrackh1596278370

is it just me or is it letting people get disconnected at first login? i think most new players just think the server don't work and browse for another server

lavr1619008986
lavr1619008986 @lavr1619008986

Thanks for the mod everything is cool

lavr1619008986
lavr1619008986 @lavr1619008986

Please work on the distribution after the player plays

lavr1619008986
lavr1619008986 @lavr1619008986

And how to describe how to distribute to whom to give or not

AH
ApatheticHobo @apathetichobo

9.6:
using Eco.Core.Plugins.Interfaces;
using Eco.Core.Utils;
using Eco.Gameplay.Players;
using Eco.Gameplay.Skills;
using Eco.Gameplay.Systems.Chat;
using System;
using System.Reflection;
using System.Text;

namespace Eco.Mods
{

class StartStar : IModKitPlugin, IInitializablePlugin
{
private int starsToAdd = 1;

public void Initialize(TimedTask timer)
{
UserManager.NewUserJoinedEvent.Add(user =>
{
user.UserXP.AddLevel(starsToAdd);
});
}

public string GetStatus() => string.Empty;

public string GetCategory() => string.Empty;

}

}

AH
ApatheticHobo @apathetichobo

Or Kye has a script Github.com