Jump to content

Rinart73

Members
  • Posts

    416
  • Joined

  • Last visited

  • Days Won

    4

Posts posted by Rinart73

  1. I got problem with the "Co" too. I also found it's source:

    2018-08-09 16-06-00| could not execute function 'FleetControlUi.updateClient' in '"data/scripts/entity/fleetcontrol/controlui.lua"':
    2018-08-09 16-06-00| 
    2018-08-09 16-06-00| data/scripts/lib/fleetcontrol\common.lua:404: attempt to index global 'Co' (a nil value)
    2018-08-09 16-06-00| stack traceback:
    2018-08-09 16-06-00|     data/scripts/lib/fleetcontrol\common.lua:404: in function 'getPlayerCrafts'
    2018-08-09 16-06-00|     data/scripts/entity/fleetcontrol/controlui.lua:2117: in function <data/scripts/entity/fleetcontrol/controlui.lua:2103>

     

    It's in the "FleetControlCommon.getPlayerCrafts" function ("data\scripts\lib\fleetcontrol\common.lua"):

    Replace "Co." with "FleetControlCommon." in the line 404:

    if e.isShip and Co.checkShipAllianceFlyCraftPrivileges(e, player.index) then

     

                   

     

    Stumbled upon few more bugs:

    1.  I have player ships and stations in the sector,  alliance ships/stations and some ships/stations that belong to a disbanded alliance. I got this error whle playing (on a server side):

    2018-08-09 18-35-20| #0: FleetControlUi.syncServerConfig data/scripts/entity/fleetcontrol/controlui.lua
    2018-08-09 18-35-20| 
    2018-08-09 18-35-20| could not execute function 'FleetControlUi.syncServerConfig' in '"data/scripts/entity/fleetcontrol/controlui.lua"'
    2018-08-09 18-35-20| invalid argument 'nil' at stack position 1, expected 'Player'
    2018-08-09 18-35-20| stack traceback:
    2018-08-09 18-35-20|     [C]:-1: in function invokeClientFunction
    2018-08-09 18-35-20|     data/scripts/entity/fleetcontrol/controlui.lua:238: in function ?

    This happens because FleetControl treats Alliance ships like Player ships so it tries to send settings to a 'player' and fails.

     

    2. A bunch of these lines:

    An error occurred during remote call to 'updateShipStates' in script "data/scripts/entity/fleetcontrol/controlui.lua". Function doesn't exist.

     

    3. When you turn ship into station, FleetControl script stays attached to it. I suppose it should be removed?

     

                   

     

    Can you please change your `removeSpecialOrders` function a bit? So it would look like this:

    local function removeSpecialOrders()
    
        local entity = Entity()
    
        for index, name in pairs(entity:getScripts()) do
            if string.match(name, "/scripts/entity/ai/") then
                entity:removeScript(index)
            end
        end
    end

     

    It would allow your commands to remove custom ai scripts that are stored in mods folder (for example "mods/MyAwesomeMod/scripts/entity/ai/dothething.lua") thus eliminating possible conflicts.

  2. data\scripts\entity\craftorders.lua:

    "CraftOrders.interactionPossible" and "checkCaptain" functions have an "AlliancePrivilege" check:

    if not checkEntityInteractionPermissions(Entity(), AlliancePrivilege.FlyCrafts) then

     

    But function "CraftOrders.setAIAction" makes check for different "AlliancePrivilege":

    checkEntityInteractionPermissions(Entity(), AlliancePrivilege.ManageShips)

     

    I doubt that changing entity order icon should require different permission than actually making that order.

  3. 1. It's very confusing to see how "Никотин" ("Nicotine") transforms into "Наркотик Акрон" ("Acron Drug") when you have it more than one. I don't understand where people got "Никотин", since in the sorce it's "Acron Drug". I suggested correct translation, but Russian translation community is usually very stubborn.

     

    2. "Craft Orders" window title was translated as "Строительные приказы".

    First of all, it's completely incorrect. "Строительные" is used when talking about building process. Like "Строительные материалы" will be "Construction Materials". You see, we don't have a word similar to "Craft" that can be used for both station and ship. One more thing: vanilla Craft Orders window is really narrow so even current translation "Строительные приказы"  doesn't fit in it. So I suggest to just leave "Приказы" (Orders).

     

    3. "Build" was translated as "Собрать".

    You can "Собрать шкаф" (Assemble the cabinet), but without a context "Собрать" means "Collect".

    So it's either should be "Строить" (which is the basic translation of "Build") or just "Изменить" ("Edit"). We could even use "Изменить корабль" ("Edit ship") but then we have problems when we have this menu item on a station.

     

    UPD: Nevermind, I contacted the guy who approves Russian translation and we fixed it.

  4. 1.2.0

    • Added: Localization support - you'll need to install i18n - Internationalization (optional)
    • Added: API - function "CraftOrders.noCivilFire_setCivilianShooting" and variable "CraftOrders.noCivilFire_civilianShooting"
    • Changed: Instead of overriding 'initUI' function mod now uses ModHelper_CraftOrders, which will allow other mods that use it to work together.
    • Fixed: Added permission check when toggling civilian fire on/off
    • Fixed: Mod now works when ship is in patrol mode too

     

    There is now also a module for Complex Craft Orders that will allow settings from this mod to affect 'basic' module enemy Target functions!

  5. 0.17.1-0.18.3

     

    screenshot.jpg

     

    GitHub

     

    Modders community progressed a lot in the last few years. From making direct changes in files to a structured mod folders that inject their code into vanilla files with just one line. But even this way can't save us from mods being incompatible with each other just because they touch the same file. I remember that a long time ago someone tried to make a global API for modding. I'm aiming for the smaller goal and just want to present you this mod.

     

    "Mod Helper - Craft Orders" allows you to add and remove Orders in the UI without overriding the "initUI" function. It also allows you to add AIActions, their icons and brings some useful vanilla local functions like "checkCaptain" and "removeSpecialOrders".

    As of version 1.1.0 it also clears CraftOrders.AIAction and order icon when a player enters the ship and before ship jumps out of the sector, thus solving some coding problems. But it needs to be on server side too now.

     

    Installation

    • Unpack mod archive into "Avorion" folder
    • Add following line in the end of the file "data\scripts\entity\craftorders.lua". All other mods lines should be added after this one

    if not pcall(require, "mods.ModHelper_CraftOrders.scripts.entity.craftorders") then print("[ModHelper_CraftOrders][ERROR]: failed to extend craftorders.lua!") end


     

    Changelog

     

     

    1.1.0

    • Added: Now mod resets AIAction and order icon before the jump and when player enters the ship
    • Added: Config file

    1.0.1

    • Fixed: removeSpecialOrders now also removes custom orders if they're placed in your mod's "/scripts/entity/ai" folder
    • Changed: Had to overwrite most of the default button functions because of new 'removeSpecialOrders'

    1.0.0

    • Initial release

     

     

    Tips and Notes

    • Mod changes how elements in the Orders Window are positioned. Now we have 3 columns and 12 rows (maximum).
    • Since there will be other mods in 'craftorders', I advice to add prefixes to your non-local functions
    • It's also advised you to not replace other predefined functions like 'initialize' completely. So instead of doing this:

    function CraftOrders.initialize()
      -- your code
    end


    • do this:

    local old_initialize = CraftOrders.initialize
    function CraftOrders.initialize()
      if old_initialize then old_initialize() end
      -- your code
    end

     

    API

     

    Variables

    • CraftOrders.window - window that contains all elements, in case you need to do something with it
    • CraftOrders.ElementType - table that allows you to specify which element you want to create. Current options are: Empty (just reserve a space), Button, CheckBox
    • CraftOrders.Elements - table that contains all UI elements. Each item is a table and each table has following items:
      • title - name of a Button or CheckBox
      • func - associated function. Will be called when user clicks elemens (Button) or toggles it on/off (CheckBox)
      • type - element type. Nil means 'CraftOrders.ElementType.Button'
      • rect - reserved space (Rect). Will be calculated during 'initUI' function. You can get it in 'initUICallback'
      • element - created button or checkbox. Will be created during 'initUI' function. You can get it in 'initUICallback'

      [*]CraftOrders.AIAction - table that contains all AIActions - default and custom ones. Don't add elements to it manually! Use "CraftOrders.addAIAction"

    Functions

    • function CraftOrders.checkCaptain () - local function, now accessible
    • function CraftOrders.removeSpecialOrders () - local function, now accessible
    • function CraftOrders.registerInitUICallback (function callback [, bool beforeUICreation ])
      Allows you to register callback that will be executed at the start of initUI function (if you'll pass beforeUICreation = true) or at the end of it (beforeUICreation = false or nothing).
      You can use 'before' callback to remove or adjust other elements in the CraftOrders.Elements table.
      You should use 'after' callback to get your created elements or reserved Rects.
    • function int CraftOrders.addElement (string title, function callback [, int elemType [, int width [, int height ] ] ])
      Requests mod to add an element.
      • title - checkbox or button title. Please don't apply '%_t', as it will be done automatically
      • callback  - callback that will be executed on button click or checkbox toggle
      • elemType - one of the elements types from 'CraftOrders.ElementType' table (default is CraftOrders.ElementType.Button)
      • width - element width from 1 to 3. 1 = 230px, 2 = 470px, 3 = 710px. Default: 1
      • height - element height from 1 to 12. 1 = 30px, 2 = 70px, 3 = 110px e.t.c. Default: 1

      Returns: element id, that you will need to use in 'after' initUI callback

      [*]function CraftOrders.removeElement (string/int index)

      Allows you to remove element from CraftOrders.Elements by index or title.

      This function should be executed in 'before' initUI callback

      [*]function CraftOrders.addAIAction (string name, string iconpath)

      Adds new AIAction with icon.

     

     

    Mod example

    -- Init UI
    local repairButton = CraftOrders.addElement("Repair", "testmod_onRepairButtonPressed")
    local someCheckBox = CraftOrders.addElement("Some Checkbox", "testmod_onSomeCheckBoxChanged", CraftOrders.ElementType.CheckBox)
    -- and in case you need some other ui elements, you can just ask mod to reserve the space
    local customUIElement = CraftOrders.addElement("", "", CraftOrders.ElementType.Empty, 2, 2)
    
    CraftOrders.addAIAction("Repair", "data/textures/icons/pixel/repair.png")
    
    local function beforeInitUI()
        CraftOrders.removeElement("Idle")
    end
    CraftOrders.registerInitUICallback(beforeInitUI, true)
    
    local function afterInitUI()
        if not CraftOrders.Elements[repairButton] or not CraftOrders.Elements[someCheckBox] or not CraftOrders.Elements[customUIElement] then
            print("Your elements were either removed by other mod or didn't fit in the window")
        else
            repairButton = CraftOrders.Elements[repairButton].element
            someCheckBox = CraftOrders.Elements[someCheckBox].element
            -- now we can create custom ui
            local rect = CraftOrders.Elements[customUIElement].rect
            customUIElement = CraftOrders.window:createFrame(rect)
        end
    end
    CraftOrders.registerInitUICallback(afterInitUI)
    
    -- Callbacks
    
    function CraftOrders.testmod_onRepairButtonPressed()
        print("'Repair' button")
        if onClient() then
            invokeServerFunction("testmod_onRepairButtonPressed")
            ScriptUI():stopInteraction()
            return
        end
    
        if CraftOrders.checkCaptain() then
            CraftOrders.removeSpecialOrders()
            -- some stuff
            CraftOrders.setAIAction(CraftOrders.AIAction.Repair)
        end
    end
    
    function CraftOrders.testmod_onSomeCheckBoxChanged()
        print("Some checkbox value: " .. tostring(someCheckBox.checked))
    end

    ModHelper_CraftOrders-1.0.0_0.17.1-0.18.2.zip

    ModHelper_CraftOrders-1.0.1_0.17.1-0.18.2.zip

    ModHelper_CraftOrders-1.1.0_0.17.1-0.18.2.zip

  6. Since I'm going to make more mods and they don't fit in my signature, I decided to keep full list here.

     

    Mods for users

     

    Transfer Cargo Tweaks0.21.x+ / 0.17.1 - 0.18.3 / 0.15.x+ [independent Clientside / Serverside]

    Provides several Quality of Life changes to the Transfer Crew/Cargo Window, such as sorting, search and favorites system. Provides additional features if installed on server.

     

    Sector Overview0.21.x+ [both sides]

    Continuation of the "Sector Overview and Players on Galaxy map" mod, originally developed by shulrak. Shows stations and gates in sector and allows to track players coordinates.

     

    Complex Craft Orders — 0.17.1 - 0.18.3 [both sides]

    Allows to specify various conditions and outcomes that your captains will follow, thus making your AI ships much more responsive and useful.

     

    Energy Suppressor Detector [MoveUI module] — 0.17.1 - 0.18.3 [both sides]

    Detects Energy Signature Suppressors in the current sector and shows the max time before they will burn out.

     

    Founding Fixes — 0.18.3 - 0.19  [both sides]

    Fixes bugs that created wrong type mines / factories and gave them titles that weren't translated.

     

    Improved Energy Suppressor — 0.17.1 - 0.18.3 [both sides]

    Turns energy suppressor satellites into wreckages when they burn out. Allows to notify players via mail when this happens. Fixes Ogonite/Xanion satellite bug.

     

    No Civil Fire — 0.17.1 - 0.18.3 [serverside] [Optionally clientside]

    Prevents player/alliance AI ships from attacking civilians. Can be toggled on/off.

     

    PVP Relations — 0.18.3 -  0.19 [serverside] [Optionally clientside]

    Provides relation changes between players and alliances in response to PVP actions. You can get vanilla-like behaviour or use a threshold system where players will become enemies after reaching certain damage in sector.

    Currently only available for Rusty's Galaxy servers.

     

    Server Guard — 0.18.3 -  0.19 [serverside]

    Toggles PVP/PVE mode based on the distance to core; protects NPC stations; protects player/alliance ships and stations when they logoff; allows to disable netural zones inside of PVP area.

    Inspired by Dirtyredz's DirtySecure mod. Currently only available for Rusty's Galaxy servers.

     

    Turret Factory Amount Fix — 0.15x - ? [Clientside]

    Fixes old vanilla bug that resets textbox values on Turret Factory. Also implements some QoL changes. Currently outdated, I don't know if I'll update it.

     

    Turret Selling Fix — 0.17.1 - 0.18.3 [both sides]

    Provides local fix of an economy exploit that allows to build super-profitable turrets.

     


    Mods for modders

     

    i18n - Internationalization — 0.16.5 - 0.21.x [Clientside]

    Allows to add localization for your mods and use it seamlessly (you can use vanilla '"YourPhrase"%_t' mechanics)

     

    Mod Helper - Craft Orders — 0.17.1 - 0.18.3 [both sides]

    Allows to create mods that modify Craft Orders UI and don't conflict with each other, allows to add AIActions and ther icons. Additionally makes few Craft Orders local functions accessible.

  7. 1.2.0

    • Added: Localization support. You'll need to install 'i18n' mod for it to work (optional)
    • Added: An option to transfer 5/10/50 goods at once by clicking transfer button while you hold Ctrl/Shift/Alt
    • Added: Favorites/trash system. Hover on row and you'll see two small icons (star and trasbin). Right-click them and you'll mark that good as favorites/trash.
      Self/Other ship favorites are independent from each other. You can also turn on/off favorites sorting by clicking big button with a star.
      All your preferences are saved on your(client) side in AppData(or other folder on Linux)
    • Added: Overlay crew names with their profession levels
    • Added: A way to show how much crew workforce you currently have and need
    • Improved: A bit more utf8 performance
    • Fixed: Minor errors in utf8 library

     

    transfercargotweaks_1_2_0_favorites.jpg

     

    transfercargotweaks_1_2_0_crew.jpg

  8. You know the drill. Player gets cargo from their station (or Alliance station), then sells that cargo to station again. Free money from nowhere.

     

    On a first thought I wanted to just suggest "tie player/Alliance money account to all station transactions". But then we'll need to rebalance stations starting prices, since we'll have to pay for each good that it buys from NPC and it will be insanely harder to make profit.

     

    My final suggestion is: tie owner's wallet to buy/sell operations ONLY if station is trading with a ship that belongs to a Player or Alliance.

    This way NPC trading will remain untouched. And economy vulnerability with Player to Player trading will be eliminated. If Player/Alliance sells goods to a non-NPC station, owner of the station (Player or Alliance) pays the money.

     

    One small but important thing: add a checkbox to allow/deny station to buy from players. Otherwise someone might use new mechanics to ruin station owner wallet by providing a lot of goods.

     

    Update: I somehow missed when that was fixed. Can't find in which version (no entry in changelogs). Thread can be deleted.

  9. [0.17.1-0.18.3] [mod in beta]

     

    GitHub

     

    First of all, I want to ask devs to give us Turrets API. Let us turn them on/off, give and set their targets. That API with this mod (and other possible mods too) could open endless possibilities: mining ships that switch to battle turrets to protect themselves, supporter-type ships that heal allies with repair turrets while attacking enemies at the same time etc.

     

    Has ever thought "I pay my captains too much for such simple tasks" crossed your mind? Do you want them to be smarter and to act to the situation accordingly? Now you can get what you want - with this mod you can specify various conditions and outcomes that your captains will follow.

    And if you're a modder you can write a module for this mod, expanding it's possibilities.

     

    screenshot_0_1_1.jpg

     

    Installation

    • Install Ship Script Loader
    • Unpack mod archive into "Avorion" folder
    • Open "mods\ShipScriptLoader\config\ShipScriptLoader.lua" and add following line before "return config":

    Config.Add("mods/ComplexCraftOrders/scripts/entity/complexcraftorders.lua")


     

    Uninstallation

    • Remove line that you previously added from file "mods\ShipScriptLoader\config\ShipScriptLoader.lua"
    • Replace contents of the file "mods\ComplexCraftOrders\scripts\entity\complexcraftorders.lua" with "terminate()". Don't delete file itself

     

    Changelog

     

     

    0.1.1

    • Fixed: 'basic' module - Now can remove custom ai scrips that were added by other mods (as longs as they're placed in "mods/ModName/scripts/entity/ai" folder)
    • Fixed: 'basic' module - No more reapplying already executed commands (this caused problems with Mining)
    • Fixed: 'basic' module - Temporal fix to distinguish escort/follow actions
    • Improved: 'basic' module - Now you can use space, ", " or ";" to separate coordinates for "At Coordinates" condition and "Jump To" action

    0.1.0

    • First version

     

     

    Compatibility

    Should be perfectly compatible with any other mod, unless that mod completely messes up "data\scripts\entity\craftorders.lua"

     

    Bugs

    • Scrolling dropdown lists is not possible when they're in a scrollable container (game bug (1)). This doesn't cause problems when you only have basic module installed, because all lists currently have less than 16 entries.  I'm waiting for the fix, otherwise will find a workaround.

     

    Notes

    • Extra-space that causes scroll to appear even with small amount of rows is a workaround to treat other game bug (2)

     

    To server owners

    I tried to optimize this mod as much as possible. If player uses "Nearest Enemy, Ship" few times, first result is cached for current server update. The same happens with Conditions. In the config file ("mods\ComplexCraftOrders\config\Config.lua") you can play with "updateInterval" variable  (default 10 seconds). You can also set "logLevel" to 3 and mod will write in logs how much time every update takes.

     

    How to use

     

    Mod operates several concepts:

    • Target (who) - it may be current ship, closest enemy station e.t.c
    • Condition (when) - 'distance less than', 'with chance' and other
    • Action (what to do) - what will be executed if conditions were or weren't matched - patrol, jump, follow entity..
    • Argument - certain parameter that will help to specify Target, execute Action or will be used to compare something in Condition
    • Inverter - simply allows to invert the result of Condition - turn your 'health less than' into 'health not less than'
    • Operator - allows to connect Conditions ('and', 'or'), Actions ('and', 'else') or go from Conditions to Actions ('action')
    • Row - is either Target+Condition + arguments - Condition Row or Action + arguments - Action Row
    • Group / Condition Group - conditons that are connected with 'and' operator. 'or' operator starts a new group

    tutorial_better_smaller.jpg

     

    A few key moments:

    • You need to own the ship or have an Alliance "Manage Ships" permission to interact with menu
    • Each block is executed independently. You're limited by your fantasy and the amount of rows that is set on server.
    • Most conditions require Target and will be not processed if Target was not found.
    • You can divide your conditions in Condition Groups with 'or' operator. This means that actions will be executed if at least one Condition group was met.
    • Actions that go after Action Row with 'else' operator will be executed only if all condition groups are failed. They even will be executed if no Targets were found at all.
    • Actions always receive last successful target (even if it's 'else' Actions)

     

    Here you can see the list of Targets, Conditions and Actions of 'basic' module:

    Targets

    • Self - current ship
    • Any Ally - first found ally in the sector. Accepts argument: ''(any), 'Ship', 'Station'. It's advised to use this Target if you just need to check if there any allies.
    • Any Enemy - first found enemy in the sector. Accepts argument: ''(any), 'Ship', 'Station'. It's advised to use this Target if you just need to check if there any enemies.
    • Nearest Ally - Accepts argument: ''(any), 'Ship', 'Station'
    • Nearest Enemy - Accepts argument: ''(any), 'Ship', 'Station'
    • Most Hurt Ally - ally with smalles percentage of health (not shield). Accepts argument: ''(any), 'Ship', 'Station'
    • Most Hurt Enemy - enemy with smalles percentage of health (not shield). Accepts argument: ''(any), 'Ship', 'Station'
    • Least Hurt Ally - ally with biggest percentage of health (not shield). Accepts argument: ''(any), 'Ship', 'Station'
    • Least Hurt Enemy - enemy with biggest percentage of health (not shield). Accepts argument: ''(any), 'Ship', 'Station'
    • Random Ally - Accepts argument: ''(any), 'Ship', 'Station'
    • Random Enemy - Accepts argument: ''(any), 'Ship', 'Station'

    Conditions

    • In Sector - checks if target was found (not nil). Accepts Target than can be nil
    • Health Less Than - checks if Target health percentage is less than Argument (should be number)
    • Shield Less Than - checks if Target shield percentage is less than Argument (should be number)
    • With Chance - works with a certain chance, that is specified in Argument (should be number)
    • Distance Less Than - compares distance to target with an Argument (should be number). 1000 means 1km
    • At Coordinates - check if sector coordinates are matching Argument coordinates (should be 2 numbers divided with a comma - "15,-300")

    Actions

    • Idle - same as vanilla order. Doesn't care about Target
    • Passive - same as vanilla order. Doesn't care about Target
    • Guard Position - same as vanilla order. Doesn't care about Target
    • Follow Target - follows Target (without jumping)
    • Escort Target - escorts Target (including jumping)
    • Attack Target - attack Target
    • Patrol - same as vanilla order. Doesn't care about Target
    • Mine - same as vanilla order. Doesn't care about Target
    • Salvage - same as vanilla order. Doesn't care about Target
    • Toggle Passive Shooting - toggles passive shooting on/off. Doesn't care about Target
    • Jump To - Accepts sector coordinates as two number divided with a comma ("-114,26") and tries to jump to them. Doesn't care about Target

     

     

     

    For modders - ready

     

     

    You can active module by adding it's name into 'config.modules' table in "mods\ComplexCraftOrders\config" folder.

     

    Modules are stored in "mods\ComplexCraftOrders\modules" folder.

    Inside module folder you should create a file named 'module.lua'.

    This file should return a table that may or may not have following items:

    • initialize(modAPI) - function that will be called by the mod. It will pass API for this module as first argument.
    • Target - table of target items
    • Condition - table of condition items
    • Action - table of action items

     

    Current API:

    Variables

    • modAPI.Level - table with log levels: Error, Warn, Info and Debug

    Functions

    • function modAPI:log(int logLevel, string message [, arguments ]) - Writes a message to the log. It also works as 'string.format', so you can use

    modAPI:log(modAPI.Level.Debug, "number is %u", yournumber)


     

    Target item should have a key that will be shown in UI. It's value is a table that contains these parameters:

    • func(sector [, arg ]) - function that will be called when mod will try to get this target. Should return Entity or nil
    • argument - (optional) if your functions accepts argument, you can specify which type of argument do you want: 'true' - TextBox, table with items - ComboBox
    • cache - (optional, default = true) if set to false, the result of your function will not be cached. Use with caution as it affects performance

     

    Condition item follows the same rules as target item but has some differences:

    • func(target [,arg ]) - function that will be called to check some condition. Should return true of false/nil
    • acceptsNil - (optional, default = false) If true, your function can be called if target is nil. Use only when you absolutely understand what're you doing. If you don't use a target, it doesn't mean that this should be 'true'

     

    Action item is the same as condition item except:

    • It doesn't have 'cache' and 'acceptsNil' params
    • func(target [,arg ]) - shouldn't return anything

     

     

     

    This mod is currently in Beta as I'm trying to find and fix possible errors. While it won't corrupt your sectors, it may stop working at any time.

    Current version 0.1.1 works for Avorion 0.17.1 - 0.18.2

    ComplexCraftOrders-0.1.0.zip

    ComplexCraftOrders-0.1.1_0.17.1-0.18.2.zip

  10. We need an API to turn turrets on and off and to make them attack different targets (or to not attack anything). This would be useful for AI ships.

    For example you could have a mining ship with a "setPassiveShooting(true)" so it could mine with mining turrets and defend itself with battle turrets at the same time.

  11. [serverside] [Optionally clientside] [0.17.1 - 0.18.3]

     

    GitHub

     

    Many people find it annoying that player/alliance AI ships in aggressive mode will attack enemy civil ships thus lowering your reputation.

    Well it seems that I found a way to deal with this problem through use of not very known part of the API and some workarounds. My solution also seems to be performance friendly.

    As of version 1.1.0 you can also toggle aggression back on if you have this mod installed on both sides.

    Starting from version 1.2.0 you need to install Mod Helper - Craft Orders in order for this mod to work.

     

    Note: I assume that on a low-spec servers there is a tiny chance that AI ship will attack civil ships that were created in current sector (not warped into it) for a split second. This is due to the fact that there is no way to check if new ship is civil immediately after it was created. Although I tested the mod on low-spec notebook and everything was fine.

     

    Installation

    [*]Optionally install i18n - Internationalization if you want to have this mod translated in your language (version 1.2.0+)

    [*]Install Mod Helper - Craft Orders (version 1.2.0+)

    [*]Unpack mod archive into "Avorion" folder (next to the "data" folder)

    [*]Add following line in the end of "Avorion\data\scripts\entity\craftorders.lua" file (after Mod Helper line):

    if not pcall(require, "mods.NoCivilFire.scripts.entity.craftorders") then print("[NoCivilFire][ERROR]: failed to extend craftorders.lua!") end

     

    Uninstallation

     

    Mod is safe to uninstall.

     

     

    Known issues

    • Doesn't work on turrets in auto/defend mode. Just because API doesn't work on them. I posted this as a game bug

     

    Compatibility

     

    Mod overrides following functions:

    • CraftOrders.initialize() - server
    • CraftOrders.setAIAction(action, index, position) - server
    • CraftOrders.secure() - server
    • CraftOrders.restore(dataIn) - server
    • CraftOrders.initUI() - client, prior to version 1.2.0
    • CraftOrders.onAttackEnemiesButtonPressed() - server, prior to version 1.1.0

    Implements functions:

    • CraftOrders.updateServer() - server

     

     

    Changelog

     

     

    1.2.1

    • Fixed: Ships that belong to disbanded Alliance triggered an error
    • Fixed: Minor 'callingPlayer' check error

    1.2.0

    • Added: Localization support - you'll need to install i18n - Internationalization (optional)
    • Added: API - function "CraftOrders.noCivilFire_setCivilianShooting" and variable "CraftOrders.noCivilFire_civilianShooting"
    • Changed: Instead of overriding 'initUI' function mod now uses ModHelper_CraftOrders, which will allow other mods that use it to work together.
    • Fixed: Added permission check when toggling civilian fire on/off
    • Fixed: Mod now works when ship is in patrol mode too

    1.1.0

    • Added: If installed on clientside too (optional) mod adds a checkbox which allows to toggle aggression towards civilian ships on and off (off by default)
    • Removed: Mod no longer overrides 'CraftOrders.onAttackEnemiesButtonPressed()' function

    1.0.0

    • Initial release

     

     

    API

     

     

    Variables

    • CraftOrders.noCivilFire_civilianShooting - true if civilian fire is toggled on. false otherwise.
      Note: Don't change this variable, use function "CraftOrders.noCivilFire_setCivilianShooting"

    Functions

    • function CraftOrders.noCivilFire_setCivilianShooting (bool on) - Toggles civilian fire on/off.
      Returns: true on success. False if it was called on client side and player doesn't have permissions to perform this action. False on server if it's an NPC ship.
      Note: If you calling this function on server side, always call it though "invokeFunction":

    Entity():invokeFunction("craftorders.lua", "noCivilFire_setCivilianShooting", on)


     

     

     

    Help to Translate

    Currently supported languages: English, Russian. You can help to translate this mod:

     

     

    • "Don't attack civilians"

     

     

     


     

    Module for Complex Craft Orders

    As of mod version 1.2.0, there is also an optional module, that allows settings from No Civil Fire to affect Target functions of Complex Craft Orders basic module.

    Installation:

    [*]You still need to install the main mod

    [*]Unpack module archive into folder "mods\ComplexCraftOrders\modules"

    [*]Add ' "nocivilfire", ' in the file "mods\ComplexCraftOrders\config\Config.lua" after ' "basic", '. So you will have this as a result:

    config.modules = {
      "basic",
      "nocivilfire",
      -- place your module folder into "mods/ComplexCraftOrders/modules" and add your module name in this table
    }
    


    NoCivilFire-1.1.0.zip

    NoCivilFire-1.2.0_0.17.1-0.18.2.zip

    NoCivilFire-module-1.2.0-1.zip

    NoCivilFire-1.2.1_0.17.1-0.18.2.zip

    [*]Remove "NoCivilFire" folder from the "mods" folder

    [*]Remove the line from "Avorion\data\scripts\entity\craftorders.lua"

  12. Build enough torpedo cargo blocks to contain 1 torpedo with a size 1.

    Then try to buy some torpedos with size 1. There is a chance that game will tell you that you don't have enough space. But they're some torpedos that will fit so you will buy them. Its like torpedos have a float type size, so some will fit and some don't.

  13. I'm currently playing on Insane difficulty on Rusty's server. Persecutors and torpedos mechanics were new to me, because I haven't played in a while. So here is my feedback and suggestions:

     

    Torpedos

    Torpedos completely broke the balance. They deal INSANE damage.

    In the past battles were slow. You tried to make them dynamic and that's not an easy task. Currently battles in early to midgame are oneshot and that's not great.

    In early to mid game you don't have a way to deal with torpedos. You don't have the money and slots to equip anti-torpedo turrets.

    Also I haven't seen NPCs that can dodge or counter torpedos. Which made battles insanely easy because I can just keep a distance and oneshot enemy ships that would easilly kill me in fair combat.

     

    Persecutors

    Persecutors is a  great idea except that you can back-forth from one sector to another until they will give up. Of couse, warp has a cooldown, but this cooldown depends on your ship size. So.. make a small ship and rush to the center, persecutors will be annoying but that's it. Just warp again and again until they give up.

    Also, generally NPC ships are slow. So you can just warp, fly as far as you can in sector, warp again..

     

    Energy Signature Suppressors

    They hide you from persecutors but not from pirates? Why they even hide you from persecutors, it's just nullifies the whole point of them. Maybe instead they could hide you from pirates or xsotan, so you could pay and focus on farming if your ship is strong.

×
×
  • Create New...