Jump to content

Laserzwei

Members
  • Posts

    399
  • Joined

  • Last visited

  • Days Won

    1

Posts posted by Laserzwei

  1. Hi, first I apology for my english, i speak only spanish so i hope anyone can understand me.

    I recently discover avorion from youtube. I buy the game just today (waiting the confirmation of the purchase from steam because i don't have a credit card), and have a few questions:

    1) ¿What language for programming use  the game? - i struggle trying to find it -

    2) ¿Is necesary to use a compiler or just write the code in the notepad and change his extension?

    3) As is now, i figure as i keep learning from the game, that if you leave one sector, that sector unloads from the game and no loger work - ¿anyone as a fix to this? - if no - ¿someone had tried to identify the "active player"  and create a block for the game with the same "player" property to avoid the unload of a sector when the "real" player is no longer there? (I been shooting blindfold for this last question - i don't have the game yet to try)

    1) LUA (plus an API which is documented in /steam/.../Avorion/documentation/) mainly. See the Avorion/data/ folder for other stuff (sound/graphic/shader...) to modify

    2a)  LUA doesn't require a compiler

    2b) There is currently no modloader. You will always have to modify existing gamefiles

    3) Sectors have 3 states:

    [*]Loaded (player inside)

    [*]semi-Loaded (no player inside, but player-property inside. Refresh rate is lower than in player sectors)

    [*]Unloaded (no player(-property) inside or max. active sectors exceeded)

    There is also an API callback telling when a sector gets loaded back in and how long it was unloaded. This helps with eventual catching up.

    There is currently no API to force sectors to load

  2. A function to get the started fighters of a specific squad of an specific Entity.

    It would best reside in FighterController, because it already controls them.

    Something like this:

     

    function Entity... getStartedFightersOfSquad(unsigned int squadIndex)

     

    That should be much better than (my) current workaround:

    local fighters = {Sector():getEntitiesByType(EntityType.Fighter)}
    for _,fighter in pairs(fighters) do
        local fAI = FighterAI(fighter)
        if fAI.mothershipId.number == Entity().index.number and fAI.squad == searchedSquadIndex then
            --do something
        end
    end
    

  3. Yesterday I had a much more in-depth description -about how the resource System in Avorion is done from a scripting perspective- prepared, but the Auto-Log-Out deleted it, when I pressed preview  :-\

    So I will deliver it as an appendum:

     

    This will Touch the following Classes:

    Resource information:

    Entity

    Material

    Resource Manipultaion:

    BlockPlan

    BlockPlanBlock

    Box

     

    Context: Entity

     

    function int... getMineableResources()

    Returns all resources available for extraction from that Entity as Arguments. If you expect more than 1 resources on that Entity, you will want to put {} around it to catch them. This is not necessary for Vanilla Asteroids. However: Wreckages with different Materials will need it. It does not provide any clue of what Material these resources are.

     

    function Material getMineableMaterial()

    This returns exactly 1 Material. It is only suitable to get a single resource. I haven't tested what it returns in case of multiple resources, but I doubt it holds meaningful Information.

     

    function double... getPlanResourceValue()

    This is pretty much a combination of the above. It returns 7 double Values (One for each Material: Iron->Avorion). Each of them holds the amount of resources build into the Entity. Most of these Values will have 0 in them. They are always given in ascending order, starting with Iron. To catch them in a single Table again use {}.

    Here is an example code snippet:

     

    local resources = {Entity():getPlanResourceValue()}
    for material, amount in ipairs(resources) do
        print(Material(material-1).name, amount)
    end
    

    2 things to metion:

    1. I use ipairs to traverse the table. It requires the indices to start with 1 and the next following to be +1. If not, data might be lost! The big pro: It is in order. pairs might traverse randomly.

    2. I use material-1 to map the table indices to Material indices. The Material indices start with 0, the LUA-table with 1.

     

    This is basically all the information about the resources on an Entity you can get.

    If you want to manipulate them you have to dig into BlockPlan

     

    To get the Blockplan of entity use:

    Entity:getPlan:get()

    getPlan() returns a Plan Object, which is basically an extended BlockPlan. the following get() gives the actual BlockPlan.

    Both have the same -already discussed- getPlanResourceValue() function

     

     

    Context: BlockPlan

    The resources in an Entity are defined by the Blocks which make it up. So to manipulate the resources on an Entity (mainly, but not limited to Asteroids or wreckages) you have to modify the underlaying BlockPlanBlocks.

     

    You can get these blocks by traversing through the BlockPlan.

    Either use the tree-like traversing starting with the given BlockPlanBlock attribute root and root:getChildren(). Followed with the BlockPlan function BlockPlanBlock getBlock(int index). Traversing it in this manner allows to get information about the structual properties (to destroy a root-Block you need to inflict enough damage to destroy all of its children as well)

    Or use function int... getBlockIndices() with function BlockPlanBlock getBlock(int index).

    Don't forget to get them into a table with {...}.

     

    Context: BlockPlanBlock

     

    To manipulate the material-type, you can modify it with the BlockPlanBlock attribute material. It requires to be a Material object.

    To Manipulate the amount, you have to change the volume of the block. Much like it costs proportionally more to build a Block, you also gain more resources back from it. The Volume of a Block is defined by it's size. As every (building-)Block is actually a cuboid, you have to change its size. It is stored in the box property. You can test which sizes you want in the building mode (it also allows to add resource-stones)- the build-cost and the resource-amount are the same.

    You will probaly have to fiddle around with the Box's attributes, to get the desired results.

     

    This completes the information and manipulation of resources in Entities -  available for modding.

     

  4. I've got a relatively small request:

     

    add something like

    function Entity, ... getEnemies(var relationThreshold)

    to shipAI.

    The Intention is to have quick access to all Enemy Entities, in cases where "getNearestEnemy()" does not return the most reasonable target. (E.g. it selects a fighter close by, but the Big Mainship might be a better target...)

  5. Laserzwei? can we get the loot mod to work with the newest CC?

     

    https://www.avorion.net/forum/index.php/topic,4694.0.html

     

    this is the mod I was trying to get to work, can you fix it so this works or right it into the current CC mod?

    I won't be updating it. If you find someone who wants to, I will gladly support him with code snippets and the concepts of how CC-plugins are supposed to work.

     

    Also:

    Updated CC to 1.9.0 experimental

    changelog:

    -- 1.9.0 experimental for 0.19.x [2018-10-19]

      - halved calculation times for targeting enemies by changing the order of if-statements

      - discarded the seperate Xsotan-enemy detection code and used Vanilla ShipAi. As a result Xsotan aren't seen as neutral by the ship (and only the ship CC is running on) anymore

      - added Unsupervised targeting-option to enable Vanilla-targeting behavior against enemies(which overrites Attack Civils, Attack Stations, Aggressive Targetting). It's also one magnitude faster than the beforehand mentioned speed increase.

      - added config option to enforce Unsupervised targeting serverwide

     

    There is no apparent reason to update from 1.18.5 as it will work just fine with Avorion 0.19. I've just spend some time improving the code

     

    Edit [2018-10-24]: With the announced changes to Salvage- and MineAI it is to assume that it will take some time before they get integrated ino Carrier Commander

    Edit [2018-10-28]:

    Updated CC to 1.9.1 experimental:

    -- 1.9.1 experimental for 0.19.x [2018-10-28]

      - Dropped requirement for ShipScriptLoader. Instead I'm using vanilla /entity/init.lua

      - To properly work with alliance ships either overwriting claimalliance.lua or modifying shipfounder line 140 to use addScriptOnce is mandatory. See: readme/install instructions

      - Guardian gets its proper priority assigned now (Thanks to Hammelpilaw)

      - fighters will always prefer higher priority targets

      - with multiple same-priority targets fighters will prefer its current target, but only if it is 15km closer than the next closest target (effectively avoiding them to chase enemies to far off and getting into crossfire)

      - changed default priorities: fighter > ship > guardian > station

    Again: The install procedure has changed! with 1.9.1 and up. Follow the instructions in the readme file(s).

  6. I'm also interested.

    There is a "ParentEntity"- Component (Enums -> ComponentType -> ParentEntity), but it's not surfaced to the LUA API.

    There is also the possibility of going through the ships of the same faction and search for that specific turret:

    function MyMod.onSomeoneFired(turretId)
        local turret = Entity(turretId)
        local parent
        local possibleParents = {getEntitiesByFaction(turret.factionIndex)}
        for _,p in pairs(possibleParents) do
            if (p.isShip or p.isStation) then
                local pTurrets = {p:getTurrets()}
                for _,t in pairs(pTurrets) do
                    if t.index.number == turret.index.number then
                        parent = p
                end
            end
        end
        if parent then print("parent found", parent.name) else print("no parent found, weird!") end
    end
    

    I didn't try the code but it should work ;D

  7. seems to have minor issues with the latest beta version- it functions, but im guessing it doesn't recognise the new folder system- aside from that, its still ticking over smoothly

    This was vanilla related, but it's fixed now


    Update:

    1.8.2 (0.18)

      - now using, in 0.18.3 introduced, createSavedDesignsSelection

  8. cant get work 1.7.5... i get stuck everytime in loading screen.... where i can download old 1.7.4? my fiail was to delete my zip file after downloading...need to go back to working version

     

    got work only if i dont copy/overide "claimalliance.lua"

     

    i play now with 1.7.5 in 1.7.1game and ignore claimalliance.lua file ^^

     

     

     

    ok still not work.....

     

    2018-08-11 02-08-01| #0: dockAll.initialize mods/CarrierCommander/scripts/entity/ai/dockAllFighters.lua

    2018-08-11 02-08-01|

    2018-08-11 02-08-01| could not execute function 'dockAll.initialize' in '"mods/CarrierCommander/scripts/entity/ai/dockAllFighters.lua"':

    2018-08-11 02-08-01|

    2018-08-11 02-08-01| mods/CarrierCommander/scripts/entity/ai/dockAllFighters.lua:81: attempt to index field 'cc' (a nil value)

    2018-08-11 02-08-01| stack traceback:

    2018-08-11 02-08-01|    mods/CarrierCommander/scripts/entity/ai/dockAllFighters.lua:81: in function 'getSquadsToManage'

    2018-08-11 02-08-01|    mods/CarrierCommander/scripts/entity/ai/dockAllFighters.lua:20: in function <mods/CarrierCommander/scripts/entity/ai/dockAllFighters.lua:18>

    2018-08-11 02-08-01|

    2018-08-11 02-08-01| Starting thread [stacktrace Sender]...

    2018-08-11 02-08-01| Started thread [stacktrace Sender] with id 20

    2018-08-11 02-08-01| Script "mods/CarrierCommander/scripts/entity/ai/dockAllFighters.lua" or one of its requirements is not in its original state, skipping sending of stack trace.

    2018-08-11 02-08-01| scheduled save for sector (204:5), 0xadf40b0, entities: 15

    2018-08-11 02-08-01| saving sector (204:5)

    2018-08-11 02-08-01| sector (204:5) saved to "C:\Users\Kartonka\AppData\Roaming\Avorion\galaxies\dedicated_server\sectors\204_5"

    2018-08-11 02-08-01| player events roughly every 11.53 minutes

    2018-08-11 02-08-01| Player Stahlglanz moved to sector (204:5) server time taken for change: 3ms

    2018-08-11 02-08-01| scheduled save for sector (204:5), 0xadf40b0, entities: 15

    2018-08-11 02-08-01| saving sector (204:5)

    2018-08-11 02-08-01| sector (204:5) saved to "C:\Users\Kartonka\AppData\Roaming\Avorion\galaxies\dedicated_server\sectors\204_5"

    2018-08-11 02-08-02| Execution Context (inner to outer):

    2018-08-11 02-08-02| #0: dockAll.updateServer mods/CarrierCommander/scripts/entity/ai/dockAllFighters.lua

     

    You didn't follow the install instructions, no wonder bad things happen

    Go here: https://discord.gg/ZJYYxrZ . I might be able to still help you

  9. update

     

    -- 1.8.5 for 0.18.x (beta) [2018-08-10]

    -- 1.7.5 for 0.17.1 (main)

      - fixed "stuck" looking UI with dock All

     

    Edit: If you are updating, make sure all fighters are docked.

  10. Another random question. I'm on a server and I know the mod versions match (friends with the admin and I helped create the modpack we're using which includes this awesome mod), but for some reason my salvage fighters are always performing as if "Salvage Nearest" is unchecked.  Even logged out and back in, recalling and changing it then and the fighters always move to whatever is closest to my ship if I'm flying around a sector.  We're using the 1.7.3 version if that makes a difference.  Any ideas?  It's making the salvagers not very efficient if they're flying KM's away from their current target if I get close to another wreck.

    You've observed that right! (and it affected miners and attackers as well)

    Update

     

    -- 1.8.4 for 0.18.x (beta) [2018-08-09]

    -- 1.7.4 for 0.17.1 (main)

      - switched from nearest old target to nearest of squad

      - dock-all now forcefully stops carrier-commands

  11. Maybe I'm missing something but you said that salvaging/mining were separate addons for this mod.  Where are those located? I don't see anything about them in the mods  folder from the updated zips on the initial post.

    CarrierCommander_xxx.zip/CarrierCommander/mods/CCBasicCommands/scripts/entity/ai/

  12. I seen a loot command that supposedly works with your mod but I cant seem to get it to. when added the color coding on your wings does not work as well as the settings . Is there anyway you could make a command for cargo shuttles or even better wings with no target to seek out and collect dropped loot.

    This  mod is currently not compatible with Carrier Command

    1.7.x

    or

    1.8.x

    There is a difference in can do and will do

  13. It's a great mod, but it's missing a repair command for repair fighters. Could you add that at some point, please?

    wish granted:

    -- 1.8.3 for 0.18.x (beta)

    -- 1.7.3 for 0.17.1 (main)

     

      - added repair command

      - fixed typo in mine command

      - fixed a typo in readme.md

      - added readme.txt without the formatting characters of readme.md

      - removed uneccessary data-saving in salvage command

  14. Thankyou, also amazing mod, definitely a must have mod.

    Also a question, is the wait time intentional or game engine limit?

    The 15s delay when starting a command comes from the way the timed calls in scripts are done in Avorion.

    In short every CarrierCommander command is its own script. Avorion offers a function called  getUpdateInterval()  to grab the timing when a Script's update() gets called.

    I programmed it to return 15(s), if currently there is no target (1-5(s) else).

    The target gets selected in  update(). It's not called immediately after adding the script, but only after the time specified in getUpdateInterval(). And because update() hasn't run, no target has been selected, yet. And therefore getUpdateInterval() says to wait 15s.

     

    Edit:

    update

    -- 1.8.2 for 0.18.x (beta)

    -- 1.7.2 for 0.17.1 (main)

     

      - Removed the Assign All command (did nothing special anymore)

      - xsotan fighters target name fix

      - reduced time for attack fighters to switch targets, after their previous target died

      - Founding a ship as alliance ship, would break the mod. This was due to claimalliance.lua using namespace (no idea why it caused it though). I've included a namespace-less version for now

  15. What does the (A) and (D) mean after the various commands like Attack and Salvage, etc.

    (A) stands for: Click this and the command Activates

    (D) stands for: Click this and the command Deactivates

  16. Updated

     

    Changelog:

    -- 1.8.1 for 0.18.x (beta)

    -- 1.7.1 for 0.17.1 (main)

      - fixed a crash in aggressiveCommand.lua that could halt action on that ship

      - fixed attack-fighters switching targets

      - renamed aggressive to attack command

      - Auto Assign now properly sets button actions

  17. I meant the return/dock command= an arrow.

     

    Think everything works now.

     

    The first time I tried it (yesterday) I could only use it once, then nothing, on any ship.

     

    Today all commands go smooth and now I can see excactly what the mod does. Very Nice!

    There is currently a 15s delay before the command starts to get fighters off. Maybe that's what you've experienced?

  18. I think I've done everything correct with both Shipscriptloader and carrier command.

    And the first time I use commands it seemed to work.  I set fighters to agressive and they all went killing with the 'return' icon. But only for one command after that the mod dont correspond.

     

    Am I doing something wrong?

    Is the mod still active or has vanilla made it obsolete?

    There is no `return` icon. Only docking (orange/yellow) or idle (blue), active (green), something went wrong (red). I can't decipher the 4th sentence, please elaborate further.

     

    Q1: probably

    Q2: Yes this mod is useable with 1.7.1 (current default/main version) and beta 1.8.2. Avoid using Vanilla commands and CC on the same ship at the same time though

     

  19. updated CC to Avorion 0.17.1 and 0.18.1(beta)

     

    Changelog

    -- 1.8.0 for 0.18.x (beta)

      - update from 1.7.0 to 0.18

    -- 1.7.0 for 0.17.1 (main)

      - rewrote code base

      - moved from (buggy) Event-based system to Busy-waiting-based system

      - mining/salvaging/attacking are now their own addons that are hold within its own modfolder (If you still have an CC installation make sure to delete it before updating from 0.10.1)

      - changed license to QPL-1.0

     

    Please note: There is a delay of ~20s after you activate a command until it starts operation. (It will show a blue "idle" icon beforehand though)

     

  20. I have been trying the past few days to update it and get it working. Unfortunately, my knowledge of lua is not as good as the author. perhaps if we get enough players asking for it someone will step up to the challenge.

    Making it compatible with the newest version of Avorion isn't the challange. The challange is to have it running without any unexpected behavior.

    And currently there a many things keeping me from releasing a satisfying update:

    • reducing transmission overhead when a production cycle finishes. (Causes massive lags on multiplayer)
    • prevent the complex from breaking, when the repair button gets used
    • avoid data-loss, when the LUA-VM crashes.  "That's a nice mutli-billion Credits complex you have there. It would be a shame, if it got voided by a VM crash  ::)"
    • integration of fighters (like casual factories do)
    • have onRestoredFromDisk(timeSinceLastSimulation) simulate the time passed

    to name a few. There's a lot of utility and convenience stuff that I want to add as well.

     

    Edit: You have the permission to release a functioning fork of the complex mod, if you provide a link to the original forum thread (here: https://www.avorion.net/forum/index.php/topic,3268.msg17943.html#msg17943)

  21. Sorry if this is not in the right place.

     

    So as the title says, is posible to mod visually or just the stats of the dron one start with? (Not the fighters, i do mean the dron that one use on the start)

    I was unable to find any file to edit the dron, is this even posible?

     

    Thanks in advance.

    pretty easy:

    1) You need the BlockPlan of the design you want to apply to your drone.

    2) You need to get it to the serverside and execute the following code:

    Entity():setPlan(blockPlan)

    In a script running on your drone.

     

     

    Or alternative, if the script is not on your drone:

    Entity(droneUUid):setPlan(blockPlan)

     

     

  22. I am trying to install your mod and get it up and running, but when I go to use the shipyard I get a grey screen and I cant see any selections.

     

    https://prnt.sc/k6d5zm

    make sure you are using 1.7.0, if you are on the main brancch. or 1.8.1, if you aree on the beta branch.

    If that doesn't help, send your logfile.

×
×
  • Create New...