I must be doing something wrong, I can't get the new interface to show up.
My Avorion/mods/ShipScriptLoader/config/ShipScriptLoader.lua looks like this
local Config = {}
Config.author = 'Dirtyredz'
Config.name = 'Ship Script Loader'
Config.homepage = "https://github.com/dirtyredz/AvorionBoilerPlate"
Config.version = {
major=1, minor=0, patch = 0,
string = function()
return Config.version.major .. '.' ..
Config.version.minor .. '.' ..
Config.version.patch
end
}
Config.Scripts = {}
function Config.Add(scriptPath)
table.insert(Config.Scripts,scriptPath)
end
-- Example use to add a script to a players ship
-- Config.Add("mods/YourMod/scripts/entity/YourMod.lua")
Config.Add("mods/CarrierCommander/scripts/entity/CarrierCommander.lua")
return Config
and my Avorion/data/scripts/server/server.lua looks like so
package.path = package.path .. ";data/scripts/lib/?.lua"
package.path = package.path .. ";data/scripts/server/?.lua"
require ("factions")
require ("stringutility")
function onStartUp()
Server():registerCallback("onPlayerLogIn", "onPlayerLogIn")
Server():registerCallback("onPlayerLogOff", "onPlayerLogOff")
Galaxy():registerCallback("onPlayerCreated", "onPlayerCreated")
Galaxy():registerCallback("onFactionCreated", "onFactionCreated")
end
function onShutDown()
end
function update(timeStep)
local server = Server()
local guardianRespawnTime = server:getValue("guardian_respawn_time")
if guardianRespawnTime then
guardianRespawnTime = guardianRespawnTime - timeStep;
if guardianRespawnTime < 0 then
guardianRespawnTime = nil
end
server:setValue("guardian_respawn_time", guardianRespawnTime)
end
local serverRuntime = server:getValue("online_time") or 0
serverRuntime = serverRuntime + timeStep
server:setValue("online_time", serverRuntime)
end
function onPlayerCreated(index)
local player = Player(index)
Server():broadcastChatMessage("Server", 0, "Player %s created!"%_t, player.name)
end
function onFactionCreated(index)
end
function onPlayerLogIn(playerIndex)
local player = Player(playerIndex)
Server():broadcastChatMessage("Server", 0, "Player %s joined the galaxy"%_t, player.name)
player:addScriptOnce("headhunter.lua")
player:addScriptOnce("eventscheduler.lua")
player:addScriptOnce("story/spawnswoks.lua")
player:addScriptOnce("story/spawnai.lua")
player:addScriptOnce("story/spawnguardian.lua")
player:addScriptOnce("story/spawnadventurer.lua")
player:addScriptOnce("mods/oosp/scripts/player/oosproduction.lua") --oosp
matchResources(player)
end
function onPlayerLogOff(playerIndex)
local player = Player(playerIndex)
Server():broadcastChatMessage("Server", 0, "Player %s left the galaxy"%_t, player.name)
end
local s, b = pcall(require, 'mods/ShipScriptLoader/scripts/server/server')
if s then if b.onPlayerLogIn then local a = onPlayerLogIn; onPlayerLogIn = function(c) a(c); b.onPlayerLogIn(c); end end end
Both of those files appear identical to the functioning examples given previously in this thread. What am I missing? Do I need to initialize this mod or the shipscriptloader in some different way?