Jump to content

How Do I Make Stations Using Scripts/Dev Mode And Assign To Specific Factions?


Prophet Of Merci

Recommended Posts

Trying to make a zone for a specific faction that has stations we make for it. In other words, theres a safe zone in a pvp area we created so players can use it to restock and resupply/repair and replace etc. But we have trouble figuring out how to assign a station to a specific faction since making one in dev mode assigns it to a random faction. If anyone has the information they can provide that allows us to give stations to a SPECIFIED faction in Avorion, please do tell.

 

And yes, i have seen mods that allow you to create your own factions, but modding is out of the question until the next update coming soon.

Link to comment
Share on other sites

local Spemin = {}
function Spemin.getFaction()
    local name = "The Spemin"%_T

    local galaxy = Galaxy()
    local faction = galaxy:findFaction(name)
    if faction == nil then
        faction = galaxy:createFaction(name, 0, 0)
        faction.initialRelations = 100000
        faction.initialRelationsToPlayer = 100000
        faction.staticRelationsToPlayers = true

        for trait, value in pairs(faction:getTraits()) do
            faction:setTrait(trait, 0) -- completely neutral / unknown
        end
    end

    return faction
end

function onCreateTradingPostButtonPressed()

    if onClient() then
        invokeServerFunction("onCreateTradingPostButtonPressed")
        return
    end

    local generator = SectorGenerator(Sector():getCoordinates())

    local faction = Spemin.getFaction()
    local station = generator:createStation(faction, "data/scripts/entity/merchants/tradingpost.lua")
    station.position = Matrix()

    Placer.resolveIntersections()

end

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...