Hello Explorers, Content Creators and Server Owners! TL;DR; Grab it and start coding your mods with EmpyrionModdingFramework! From the labs of Zucchini Universe we have created a new, refreshed, open source and very simple to use modding framework. If you are used to work with ASTIC-TC EmpyrionNetAPIAccess, you will find this fork a refreshed rework, cleaned up and minimalist so that you can focus on quality mods and quality code. The instructions are very easy to follow, the code is very easy to read, the mods are fun to make! Yours! elmorti (on behalf of Zucchini Universe)
Awesome! Empyrion needs more Modders. At first glance, this looks like it uses API1. So, Server only, not available for single player unless you set up your own server. I wrote a guide to walk you thru that process, it's really simple... ish. https://steamcommunity.com/sharedfiles/filedetails/?id=1368270700 Welcome to the modding community
Hi Xango2000, thanks for your interest! The framework main pillar is that is only focused on server side mods and as thus, in multiplayer servers, this is and will be the main focus of our work. The second major pillar of our work is: modern, simple and clean quality code, we are working on a test framework as well and we expect our mods to follow some best practices to improve the reliability. And the third pillar is, open source, we chose GPLv3 because we would like everyone else not to only enjoy the code but also contribute back and create something good over time. Is good to see you around, I've seen some of your mods but I thought you were out of the scene already You undoubtedly inspired us.
Well, then I'm curious to see what's coming from you. So far I'm the only active modder who shares mods with source in the community. And the api version 1 & 2 from Eleon is really bitchy with no examples.
I'm happy to announce that I will be working on some mods here for the Community. I have written many mods for Starbound and No Man Sky. I'm a Veteran Coder been Coding and Hosting Servers for over 15 years. Any way I will be starting this weekend. And yes I do have a Custom Server up. Msg me for Details.
Excellent work. I found the syntax and method call in your PlayerInfo example ideal for beginners. How complete is the framework?
Hi everyone, it has been quite a while due to personal circumstances but I have applied myself recently and updated the framework to make use of both ModAPI and ModInterface (aka new vs legacy API). Plus I am reorganizing my repositories so you will find this now here: https://github.com/elmorti/zucchini-empyrion/tree/main/modding-framework It has a companion "skeleton mod" where you can see and get introduced on how to use it: https://github.com/elmorti/zucchini-empyrion/tree/main/zucchini-skeleton Thanks!
I tryed to compile the skeleton mod, and run it... but i get an error in the log and client and the server tasks freeze: Code: 01-15:23:42.124 16_23 -LOG- {zucchini-skeleton} SaveGame: D:\servers\empyrionserver\PlayfieldServer/../Saves/Games/ReforgedEden 01-15:23:42.125 16_23 -LOG- {zucchini-skeleton} ActiveScenario: 01-15:23:42.125 16_23 -LOG- {zucchini-skeleton} Cache: D:\servers\empyrionserver\PlayfieldServer/../Saves/Cache 01-15:23:42.125 16_23 -LOG- {zucchini-skeleton} Content: D:\servers\empyrionserver\PlayfieldServer/../Content 01-15:23:42.125 16_23 -LOG- {zucchini-skeleton} Dedicated: 01-15:23:42.125 16_23 -LOG- {zucchini-skeleton} Mod: D:\servers\empyrionserver\PlayfieldServer/../Content/Mods 01-15:23:42.125 16_23 -LOG- {zucchini-skeleton} Root: D:\servers\empyrionserver\PlayfieldServer/.. NullReferenceException: Object reference not set to an instance of an object at ZucchiniSkeleton.ZucchiniSkeleton.Application_GameEntered (System.Boolean hasEntered) [0x0004d] in <39c21b4603a345c1a2e805e5a01f7a92>:0 at Eleon.ModBridge.ApplicationBridgeCommon.OnGameEntered (System.Boolean entered) [0x0000a] in <c30ce2538bc04869b332978f1f540f6f>:0 at Assembly-CSharp.DockingPaneQueue.HideQueue () [0x00025] in <c30ce2538bc04869b332978f1f540f6f>:0 at Assembly-CSharp.EditorType.CopyOutline (System.String , Assembly-CSharp.EmulatorLayout , System.String , System.String , System.UInt64 , System.Int32 , System.Int32 , System.Int16 ) [0x001da] in <c30ce2538bc04869b332978f1f540f6f>:0 at Assembly-CSharp.ReferencePcitureStack.CloseQueue (Assembly-CSharp.CommandFactory+TextFileToken ) [0x00018] in <c30ce2538bc04869b332978f1f540f6f>:0 at Assembly-CSharp.ReferencePcitureStack.RegisterEmulator () [0x00178] in <c30ce2538bc04869b332978f1f540f6f>:0 at Assembly-CSharp.EditorType.GenerateView () [0x00038] in <c30ce2538bc04869b332978f1f540f6f>:0 at MBS.Update () [0x00008] in <c30ce2538bc04869b332978f1f540f6f>:0 (Filename: <39c21b4603a345c1a2e805e5a01f7a92> Line: 0) 01-15:23:42.218 16_23 -LOG- Task Type=versionCache ThreadId=5268 ManagedId=10 Did I mess up somewhere? forgot to say: tryed it on a dedicated server, and also have empyrion scripting installed.
Hi there! You are not doing anything wrong It is a bug because: // The following line is also available when the mod is running on Client mode. ModAPI.Application.GameEntered += Application_GameEntered; Therefore ModAPI.Application.GameEntered is NULL and that is why you get no reference and the exception. That makes also the following delegate useless on Dedi: // This is also only useful when in Client mode. private void Application_GameEntered(bool hasEntered) {} I did not catch this on time because I was doing my tests on Client mode. I will update the repository for the skeleton-mod and the framework in the next one or two days since the framework also has a bug that can lead to deadlocks (will actually cause deadlocks) on the CommandManager due to bad handling of async code. In the meantime, you can replace ModAPI.Application.GameEntered and the delegate private void Application_GameEntered(bool hasEntered) {} with this: // Subscribe to DediAPI Game_EventRaised: Game_EventRaised += StructureManager_Game_EventRaised; And then create a delegate StructureManager_Game_EventRaised like this: private void StructureManager_Game_EventRaised(CmdId eventId, ushort seqNr, object data) { if (eventId == CmdId.Event_Player_Connected) { PlayerInfo player = (PlayerInfo)data; Log($"Player {player.playerName} has logged in."); } } Or replace the eventId with whichever one you would like to catch and process with the delegate. Also you can create as many delegates as you need, the important part is catching the eventId and processing the object data, and make sure they are subscribed to the event Game_EventRaised. Note that: The DediAPI code won't work in Client mode Make sure that the <modname>_Info.yml file is correctly set to run in the right mode (i.e. Dedi). Thank you very much! elmorti
Just to clarify, the name of the delegate can be anything you like: StructureManager_Game_EventRaised is just one I copied from a work in progress project I had nearby The delegate method just needs to follow the same signature all the time: WhateverNameYouWantToUseForYourDelegate(CmdId eventId, ushort seqNr, object data) Hope it helps!
This should be fixed now in upstream: elmorti/zucchini-empyrion: Configs, tools and mods for Zucchini Universe Empyrion (github.com)