Thread Status:
Not open for further replies.
  1. Wulf

    Wulf Community Admin Community Admin Oxide Developer

    Consider this a journey; an adventure into new, and untested waters. For this journey we need your help! Do not expect the path to be straight and narrow, as it will likely be tiresome and test your will.

    If you decide to join us, there are a few things you'll need...
    If you'd rather just jump in: http://oxidemod.org/downloads/813/

    Basic CSharp plugin:
    Code (C#):
    // Reference: Oxide.Ext.SevenDays

    using System;
    using UnityEngine;

    namespace Oxide.Plugins
    {
        [Info("Sample Plugin", "Wulf", 0.1)]
        class SamplePlugin : SevenDaysPlugin
        {
            void Loaded()
            {
                Puts("CSharp: Loaded is working!");
            }

            void Unloaded()
            {
                Puts("CSharp: Unloaded is working!");
            }

            void OnServerInitialized()
            {
                Puts("CSharp: OnServerInitialized is working!");
            }

            void OnPlayerConnected(ClientInfo client)
            {
                Puts("CSharp: OnPlayerConnected is working!");
                Puts(client.playerName + " has connected!");
                PrintToChat(client.playerName + " has connected!");
            }

            void OnPlayerDisconnected(ClientInfo client)
            {
                Puts("CSharp: OnPlayerDisconnected is working!");
                Puts(client.playerName + " has disconnected!");
                PrintToChat(client.playerName + " has disconnected!");
            }

            void OnEntityDeath()
            {
                Puts("CSharp: OnEntityDeath is working!");
            }
        }
    }
    Basic JavaScript plugin:
    Code (Javascript):
    var examplejs = {
        Title: "JavaScript Example",
        Version: V(0, 1, 0),
        Description: "Example JavaScript plugin for Oxide 2.",
        Author: "Wulf",
        HasConfig: true,

        Init : function() {
            print("JavaScript: Init is working!");
        },

        Loaded : function() {
            print("JavaScript: Loaded is working!");
        },

        Unload : function() {
            print("JavaScript: Unload is working!");
        },

        OnServerInitialized : function() {
            print("JavaScript: OnServerInitialized is working!");
        },

        OnPlayerConnected : function(client) {
            print("JavaScript: OnPlayerConnected is working!");
            print(client.playerName + " has connected!");
            sevendays.BroadcastChat(client.playerName + " has connected!", null);
        },

        OnEntityDeath : function() {
            print("JavaScript: OnEntityDeath is working!");
        },

        OnPlayerDisconnected : function(client) {
            print("JavaScript: OnPlayerDisconnected is working!");
            print(client.playerName + " has disconnected!");
            sevendays.BroadcastChat(client.playerName + " has disconnected!", null);
        },

        LoadDefaultConfig : function () {
            print("JavaScript: LoadDefaultConfig is working!");
            this.Config.AuthLevel = 2;
            this.Config.Data = ["blubb1", "blubb2"];
            this.Config.Extra = { "oink" : "moep" };
        }
    }
     
  2. Spiritwind

    Spiritwind Shack Builder Plugin Developer

    Very awesome!
     
    Wulf likes this.
  3. Wulf

    Wulf Community Admin Community Admin Oxide Developer

    Thanks to @Nogrod, Lua is now working despite the obfuscation issues! I'll be posting an updated build for it shortly.

    [​IMG]

    Code (Lua):
    PLUGIN.Title = "Auto Message"
    PLUGIN.Version = V(0, 1, 0)
    PLUGIN.Description = ""
    PLUGIN.Author = "Wulf"
    PLUGIN.HasConfig = true

    local broadcastTimer
    function PLUGIN:Init()
        self:LoadDefaultConfig()
        broadcastTimer = timer.Repeat(10, 0, function()
            local messages = self.Config.Messages
            for i = 1, #messages do
                sevendays.BroadcastChat(messages[i])
            end
        end, self.Plugin)
    end

    function PLUGIN:LoadDefaultConfig()
        self.Config.Messages = self.Config.Messages or {
            "Hello world from Oxide!",
            "I like big butts and I cannot lie!"
        }
        self:SaveConfig()
    end
     
    Spiritwind likes this.
  4. Spiritwind

    Spiritwind Shack Builder Plugin Developer

    May have to get a 7 Days to Die server just for this :D. Loving that your doing this Wulf!
     
    Wulf likes this.
  5. Wulf

    Wulf Community Admin Community Admin Oxide Developer

    It's not just me, but hopefully this is just the start. :)
     
    Spiritwind likes this.
  6. Pretermit

    Pretermit Wood Hoarder Plugin Developer

    This is beautiful Wulf. It will definitely breathe new life into what seems to be a slowly dying yet great game.

    If only H1Z1 was open to a modding framework.
     
    Wulf likes this.
  7. M@CH!N3

    M@CH!N3 Wood Hoarder Plugin Developer

    I see theres oxide for 7 Days to Die, which i have this game and think it's ok, would consider getting a sever or two but I see nothing for mods here...

    Is there any chance that the mods or some at least for Rust will also work for 7 Days to Die?
     
  8. Wulf

    Wulf Community Admin Community Admin Oxide Developer

    Right now plugins are generally game specific until we have a full, proper API available that is more universal.
     
  9. M@CH!N3

    M@CH!N3 Wood Hoarder Plugin Developer

    ah ok, then in your opinion how difficult would it be to convert mods (in general) to work with 7 Days to Die?
     
  10. Wulf

    Wulf Community Admin Community Admin Oxide Developer

    It depends on what you want to do as the selection of hooks for 7 Days to Die is currently fairly limited.
     
  11. M@CH!N3

    M@CH!N3 Wood Hoarder Plugin Developer

    yeah was looking at the list a moment ago. so basically as long as those general hooks are used and nothing more is needed then it should be fairly easy to convert until/if the hooks used in the rust version are added.
     
  12. Wulf

    Wulf Community Admin Community Admin Oxide Developer

    Pretty much. C# will probably get you the furthest right now.
     
  13. Epixx

    Epixx Wood Hoarder

    What sort of support are you expecting for this?
    I would love to go back to 7D2D if it had fully modded support from Oxide,
     
  14. Wulf

    Wulf Community Admin Community Admin Oxide Developer

    The plan is for it to be just as moddable as Rust is with Oxide. Eventually I'm sure both games will be even more moddable once there is better API setup.
     
  15. DeiEx

    DeiEx Naked Wanderer

    Looks good, how soon do you anticipate plugins for 7DTD becoming available?
     
  16. Wulf

    Wulf Community Admin Community Admin Oxide Developer

    Likely when more hooks are available.
     
  17. M@CH!N3

    M@CH!N3 Wood Hoarder Plugin Developer

    yeah so far none that the mods i use are available yet, need the onplayerattack, onentityattack, and more in order for it to really be used for our needs, soon as those become available I will be getting 7DtD servers..
     
  18. Epixx

    Epixx Wood Hoarder

    once the community backing for it is more stable ill almost certainly look into getting a server for it
     
  19. German Hoeffner

    German Hoeffner Community Admin Community Admin

    Oxide for 7daystodie. This is really sick ;)
     
    Lotus006 likes this.
  20. blackuser

    blackuser Naked Wanderer

    Is there any documentation available yet?
    I just saw the module Oxide.Ext.SevenDays, but I do not see available api calls in python e.g.

    For rust there are some examples, but could you please tell us, which oxide API calls are implemented already?

    When I have a look inside Oxide.Ext.SevenDays/Libraries/SevenDays.cs I just see
    "public void BroadcastChat", is this the only one command at the moment?

    Thank you :)
     
Thread Status:
Not open for further replies.