Jump to content

Laserzwei

Members
  • Posts

    399
  • Joined

  • Last visited

  • Days Won

    1

Posts posted by Laserzwei

  1. I had suspected something along those lines, and agree that it's not a priority to get sorted. Maybe in the meantime you could add that caveat to the mod description, just so that people adding the mod in the middle of a game know what to expect? In any case, this is an awesome mod!

    I did. Thank you for your comment  ;)

  2. from tradingmanager.lua

    buying:

    -- empty stock -> higher price
        local factor = getNumGoods(goodName) / getMaxStock(good.size) -- 0 to 1 where 1 is 'full stock'
        factor = 1 - factor -- 1 to 0 where 0 is 'full stock'
        factor = factor * 0.4 -- 0.4 to 0
        factor = factor + 0.8 -- 1.2 to 0.8; 'no goods' to 'full'
    
        local relationFactor = 1
        if sellingFaction then
            local sellerIndex = nil
            if type(sellingFaction) == "number" then
                sellerIndex = sellingFaction
            else
                sellerIndex = sellingFaction.index
            end
    
            if sellerIndex then
                local relations = Faction():getRelations(sellerIndex)
    
                if relations < -10000 then
                    -- bad relations: faction pays less for the goods
                    -- 10% to 100% from -100.000 to -10.000
                    relationFactor = lerp(relations, -100000, -10000, 0.1, 1.0)
                elseif relations >= 50000 then
                    -- very good relations: factions pays MORE for the goods
                    -- 100% to 120% from 80.000 to 100.000
                    relationFactor = lerp(relations, 80000, 100000, 1.0, 1.15)
                end
    
                if Faction().index == sellerIndex then relationFactor = 0 end
            end
        end
    
        return round(good.price * relationFactor * factor * buyPriceFactor)
    

     

    selling:

    local factor = getNumGoods(goodName) / getMaxStock(good.size) -- 0 to 1 where 1 is 'full stock'
        factor = 1 - factor -- 1 to 0 where 0 is 'full stock'
        factor = factor * 0.4 -- 0.4 to 0
        factor = factor + 0.8 -- 1.2 to 0.8; 'no goods' to 'full'
    
    
        local relationFactor = 1
        if buyingFaction then
            local sellerIndex = nil
            if type(buyingFaction) == "number" then
                sellerIndex = buyingFaction
            else
                sellerIndex = buyingFaction.index
            end
    
            if sellerIndex then
                local relations = Faction():getRelations(sellerIndex)
    
                if relations < -10000 then
                    -- bad relations: faction wants more for the goods
                    -- 200% to 100% from -100.000 to -10.000
                    relationFactor = lerp(relations, -100000, -10000, 2.0, 1.0)
                elseif relations > 30000 then
                    -- good relations: factions start giving player better prices
                    -- 100% to 80% from 30.000 to 90.000
                    relationFactor = lerp(relations, 30000, 90000, 1.0, 0.8)
                end
    
                if Faction().index == sellerIndex then relationFactor = 0 end
            end
    
        end
    
        return round(good.price * relationFactor * factor * sellPriceFactor)
    

  3. Okay, if it's from a gameplay balance perspective, how about this? Add a "sector broadcast" option to move every asteroid in your sector, but charge like, 25% or 50% more in the movement cost on each asteroid. That way you're still paying a cost for convenience, not just getting something for nothing.

    The 2nd gameplay decision involved with moving lots of Asteroids: Multiplayer. Simply put I want to prevent a single player to grab all easily accessable Asteroids and leave nothing but a wasteland for others.

     

    Out of curiosity, would I be able to jump that many asteroids through a wormhole?

    I have never tested it, but it should work.

  4. I've been thinking about this same problem. The issue is that Raw Oil and Coal from an asteroid are silly, since both are products from bio degradation. So unless the asteroid is from an exploded Earth type planet, they're not going to have either.

     

    So what I thought was to make a Coal Compressor type factory that takes Carbon and makes it into Coal.

     

    For Oil, we can use bio oils, but that wouldn't make sense for a lot of things like Plastic factories, so I added some things for Plastic, based on: https://en.wikipedia.org/wiki/Polyamide_11

     

    In goodindex.lua:

    goods["Castor Bean"] = {name="Castor Bean", plural="Castor Beans", description="Beans mostly used in the production of Polyamide 11 bioplastics.", icon="data/textures/icons/coffee-beans.png", price=321, size=0.2, level=5, importance=0, illegal=false, dangerous=false, }

     

    In productionsindex.lua:

    table.insert(productions, {factory="${good} Manufacturer ${size}", ingredients={{name="Castor Bean", amount=1, optional=0}, {name="Energy Cell", amount=1, optional=1}}, results={{name="Plastic", amount=5}}, garbages={}})
    table.insert(productions, {factory="${good} Farm ${size}", ingredients={{name="Energy Cell", amount=1, optional=1}, {name="Water", amount=10, optional=0}}, results={{name="Castor Bean", amount=12}}, garbages={{name="Oxygen", amount=1}}})

     

    I've just added a Coal Mine for now :)

    I have no plans to change the current setup. If you think that your changes are worth to be used by other players, then pack them into a mod and publish it in a seperate new Topic.

  5. Given how far away the asteroids can spawn when you bring them to a new sector, could you increase the range you can select "Move asteroid" at? I'm currently assembling a hundred or two asteroids in a sector near the edge of the galaxy to eventually move them all further in towards the core, and I'm dreading having to approach every single one on every jump.

    It was a gameplay decision from the very beginning to keep the menu-range at 10km. If you want to move this many asteroids through the Galaxy you bring patience and a really long Jump range.

     

    Also, potentially, can you make an option to keep an asteroid in hyperspace while you jump to different sectors, and then use a command or option to either spawn them in your current sector or spawn them in the next one you jump to?

    It breaks the 500,000Cr per Jump rule. So it won't happen.

     

    Really enjoying the mod so far, as well as OOSP.

    Thank you very much.

     

    I don't get the move option on asteroids I had claimed before installing the mod. Given how many asteroids are out there, it's not a huge deal, but I was wondering if that was a known limitation or not.

    It is a known limitation. I hab wrapped my head around it and there are 2 solutions:

    1) Check every Sector a player enters, if it has claimable Asteroids and add the moveAsteroids script on those that need it. This takes up server resources and is totally useless when [mOS] has been installed from the very start.

    2) Add a player command to add the script on stated Asteroids. A little more tedious for players, but the server doesn't get a constant load.

    I haven't decided which solution I will take yet. 1) has the advantage that I could make the hook into claim.lua(Vannilla gamefile) obsolete. This opens the option to add this mod into an modloader.

    Since it is an edge case scenario, it has a low priority atm.

  6. Edit 1: Sector():spawn Station/Ship/ASteroids etc. expects an EntityDescriptor.

    Sector():createEntity() expects an EntityDescriptor. You can build very customized Entities that way.

    It can have Components  [enum ComponentType] (which you can't get from an spawned Entity!) Also some other properties which later become read only/ not readable at all might be set there.

     

    Edit2: my move Asteroid mod uses this to create Asteroids.

  7. With API based modding it currently is not possible to keep an Sector loaded.

     

    Koonshi said in an interview last month that keeping sectors with player assets loaded might be included in the Vanilla game.

     

    As an alternative some modders might simulate the behaivior of AI ships in an unloaded Sector.

  8. btw i found out u can find the entities functions here

    /Avorion/Documentation/Entity.html

    Player functions and variables are available in Documentation/Player[Client].html and Documentation/Player[server].html. Yet you found some Functions I didn't know existed. I'm interested in such functions for the Entity-object :)

     

    if you call invokeServerFunction() or invokeClientFunction() you get an implicit global var called callingPlayer which holds the index of the player entity which called that function!

    Damn I always wanted to know where to get the "callingPlayer" Variable. This could be helpful.

  9. From the Documentation.

    These are all available Stats to be modified by modules:

    enum StatsBonuses

     

    RadarReach

    HiddenSectorRadarReach

    ScannerReach

    HyperspaceReach

    HyperspaceCooldown

    HyperspaceRechargeEnergy

    ShieldDurability

    ShieldRecharge

    Velocity

    Acceleration

    GeneratedEnergy

    EnergyCapacity

    BatteryRecharge

    ArbitraryTurrets

    UnarmedTurrets

    ArmedTurrets

    CargoHold

    Engineers

    Mechanics

    Gunners

    Miners

    Security

    Attackers

    Sergeants

    Lieutenants

    Commanders

    Generals

    Captains

  10. It tells me a lot mor than you think:

     

    From the frontpage

    Warning: before updating always check the version history for any incompatibilites!

     

    --0.9_7 for beta .7633

    [Changes]

    divided moveAsteroids into its own mod

    make sure you also install the standalone Version of MoveAsteroids or else you might suffer the loss of claimed asteroids:

    http://www.avorion.net/forum/index.php/topic,2685.0.html

     

    and from your client log:

    Sat Mar 11 11:23:29 2017| [mOS][0.9_6c] UI start

     

    You didn't update the move Asteroids mod. Try that.

    move asteroids

    If it still fails please also give me a list of all other mods you have installed, so I can reproduce any incompatibilities.

  11. In the singleplayer version it keeps flashing and looking for something and not starting up. it says " 09_7 not installed, oosp not starting' or something like that and keeps beeping at me. It's very irritating. If it's going to fail, I wish it would just let me know it failed and stop beeping at me.

     

    Are you on a Server?

  12. Can you tell it to me like I'm 5

    No I don't. Programming is not something 5-year olds should do. Playing in a sandbox is :D.

    Additionally programming takes dedication and responsibility. You are responsible that your code doesn't interfere with the game itself (e.g. crashes), that it has a minimum of compatibility with other mods and that you maintain updates for your users.

     

    But I know I'm not writing this to an 5-Year old.

    I'm familiar with tree traversal sort of (took Java classes) but that was a while ago and I am not the best at it.

    Excellent one thing less you have to worry about :)

     

    Read the Documentation on BlockPlan and BlockPlanBlock.

    This is the most important one. If you aren't familiar with these, you won't be writing an ingame mod to change colors anyway.

     

    Some things to get started

    local entityPlan = Entity():getPlan()       --get the Blockplan of the Entity where the script is executed
    entityPlan:setColor(ColorRGB(0.5, 0.0, 0.0)) -- make everything red
    

     

    And with this, perhaps there is a way to change the type of all blocks on a ship to another tier. I have a nice ship that still has trinium in it, and the blocks are unreachable without ripping the ship into pieces.

     

    entityPlan:setMaterial(MaterialType.Iron)
    local resources = {entityPlan:getResourceValue()}
    local money = entityPlan:getMoneyValue()
    

  13. Why use an external program when you can do it ingame?

     

    Read the Documentation on BlockPlan and BlockPlanBlock.

    Become Familiar with RGBColor coding.

    Get to know how to traverse Trees:

    Tree traversal#

     

    call

    Entity():getPlan()

    to get the Blockplan and use the previously aquired Information accordingly.

     

    Also, side note... has anyone noticed that when you explore a bunch of sectors, the game lags a bit hard on the map? I can get a good 30 frames but I'll drop to 15 on the map sometimes, but on my friends server where I haven't explored it is 60.

    I did not experience such behaivior. Maybe ask around in the troubleshooting section?

  14. From The API in Setor(Server):

    1)

    function Entity createStation(Faction faction, BlockPlan plan, Matrix position, string... scripts)

     

    with scripts being either /entity/merchants/repairdock.lua or /entity/merchants/shipyard.lua

×
×
  • Create New...