Jump to content

Rinart73

Members
  • Posts

    416
  • Joined

  • Last visited

  • Days Won

    4

Everything posted by Rinart73

  1. Well, in theory this could work: callback onDamaged(objectIndex, amount, inflictor, damageType) - fires before the damage is dealt But this callback: callback onBlockDamaged(objectIndex, blockIndex, inflictorId, damage, damageType) - fires after damage is dealt, but before block is destroyed. So you can try to heal the ship immediately after taking damage. It may produce an error, because i'm not sure what is "blockIndex" in this context. It may be an index of the block or type index. function MyModNamespace.initialize() Entity():registerCallback("onBlockDamaged", "onBlockDamaged") end function MyModNamespace.onBlockDamaged(objectIndex, blockIndex, inflictorId, damage, damageType) local entity = Entity(objectIndex) entity:heal(damage, blockIndex, vec3(), entity.factionIndex) end
  2. Hi. You can use this to turn entity invincible. Shield still can be damaged, but durability will not. You can use this in the "update" function when some conditions are met. And you will need to turn it off (false) once you're done. Entity():invincible = true Avorion doesn't have the feature that allows to cancel an event.
  3. Devious, thank you for reporting this exploit so I could fix it. Well I'm still bad at C/C++ so they can't hire me :) 1.1.1 Fixed: Vanilla exploit that allowed to build high-rarity turrets (thanks to Hammelpilaw)
  4. 1.1.0 Fixed: Vanilla exploit that allowed to build turrets with any (but usually 0) amount of ingredients Added: Now when research process of player-made turrets produces a turret, mod will ensure that this turret will follow the same rules as a player-made turret (so people couldn't research several player-made turrets into something that costs billions). The resulting turret "ingredientPrice" will be the sum of researched player-made turrets "ingredientPrice"-s. And "assemblyPrice" will consist of researched player-made turrets "assemblyPrice"-s + other turrets/upgrades prices. Also, if you're using Extended Turret Factory version 0.1.1, here is the patch for it. Future versions of that mod should already include this patch. You still need to install both Extended Turret Factory and this mod. ExtTurretFactory-0.1.1_turretExploitPatch.zip
  5. Update: Version 0.23 - bug is still there Version: 0.17.1 (maybe even older) - 0.18.3 Turret Factory script doesn't check ingredient amount that was passed by the client. This allows to build turrets with any ingredient amount (0 = you will only pay credits, 1000 = super-powerful turret). How to reproduce [*]"data\scripts\entity\merchants\turretfactory.lua" - Lines 69 to 238 change amount to 0 on client-side [*]Try to build a turret How to fix "data\scripts\entity\merchants\turretfactory.lua" - Line 859: -- Replace this: ingredient.amount = other.amount -- With this: ingredient.amount = math.min(ingredient.amount + ingredient.investable, math.max(ingredient.minimum, other.amount))
  6. +. I usually resort to checking for new API/script functions to determine version. Having an API string/table with Avorion version would be good. (But I think this thread should be in "Suggestions" category).
  7. Hi. All following mods work on both stable and beta 0.18.3: Complex Craft Orders Transfer Cargo Tweaks Turret Selling Fix Improved Energy Suppressor No Civil Fire Mod Helper - Craft Orders i18n - Internationalization
  8. Now when I'm using this function every frame, ship seems to rotate correctly, but there is no way to stop it. So it reaches correct direction, script stops calling "setToFlyToLocation", but ship (as in the first message) continues to rotate with increasing speed. I tried all of these, nothing can stop ship from rotating: ship:setToFlyToLocation(ship.translationf) ShipAI():setIdle() ShipAI():setPassive() Velocity():setAngularVelocity(ship.look, 0) local abs = math.abs local isRotating = false function MyMod.getUpdateInterval() if not isRotating then return 1 end end function MyMod.updateServer(timeStep) local ship = Entity() local target = myFunctionGetTarget() -- I checked, it's an entity -- I need ship to face target, so I check difference between where ship looks and where it needs to look local look = ship.look local lookOther = normalize(target.translationf - ship.translationf) local difference = lookOther - look difference = abs(difference.x) + abs(difference.y) + abs(difference.z) if difference > 0.5 then ship:setToFlyToLocation(target.translationf) ship.desiredVelocity = 0 isRotating = true elseif isRotating then isRotating = false end end
  9. Ok, I'll try. Still weird that it causes ship to spin, though. In theory, if I'll call it once, it just should perform part of the work and stop.
  10. local abs = math.abs local isRotating = false function MyMod.getUpdateInterval() return 1 end function MyMod.updateServer(timeStep) local ship = Entity() local target = myFunctionGetTarget() -- I checked, it's an entity -- I need ship to face target, so I check difference between where ship looks and where it needs to look local look = ship.look local lookOther = normalize(target.translationf - ship.translationf) local difference = lookOther - look difference = abs(difference.x) + abs(difference.y) + abs(difference.z) if difference > 0.5 and not isRotating then ship:setToFlyToLocation(target.translationf) ship.desiredVelocity = 0 isRotating = true elseif isRotating then isRotating = false end end As you see from the code above, I call "setToFlyToLocation" function only once. I thought that the ship will just rotate in place and when it will face target entity I will start to do next part of code.
  11. 0.17-0.18.3 I register an entity (asteroid for example) as enemy: local ai = ShipAI() ai:registerEnemyEntity(target.index) ai:setPassiveShooting(true) Ship starts to attack it (not always , another bug?) Then I'm trying to unregister it or register it as a friend: local ai = ShipAI() -- any of the following ai:unregisterEnemyEntity(target.index) ai:registerFriendEntity(target.index) Ship in passive fire mode doesn't care and continues to fire.
  12. It would be cool to have an API that would allow to attack an entity without moving the ship. Currently I'm trying to use: local ai = ShipAI() ai:registerEnemyEntity(target.index) ai:setPassiveShooting(true) But it doesn't work well and in theory ship may switch targets automatically if it will find another enemy ship nearby.
  13. 0.18.3 Combining these two (as it suggested in Docs): local ship = Entity() ship:setToFlyToLocation(other.translationf) ship.desiredVelocity = 0 Results in infinitely spinning ship. I think it even exceeds yaw/pitch speed.
  14. Version: 0.18.3 New "Valuable Objects Detected" (ship 'problem') message doesn't disappear after you jump out of the sector with valuable objects. But it disappears after another jump.
  15. Hi, DracoNB. I'm playing on the Rusty's Galaxy server where we're using your mod. I found a solution to both server crash and localization bugs. I created pull request on GitHub.
  16. Starting from game version 0.23 mod is moved to the Steam Workshop. 0.17.1-0.18.3 I use Energy Suppressor Satellites a lot to hide my mining ships from persecutors. And it's very confusing when they burn out but still look the same. Just a bunch of green icons in the sector. So, I decided to fix this and add few useful things. Features When suppressors burn out they turn into wreckages If you'll enable this feature in suppressor settings, it will send you (or your Alliance) a mail when a satellite will burn out. In case of Alliance, only members with "Manage Ships" privilege will receive a message. Fixes bug that spawns Ogonite/Xanion suppressor when it' used by an Alliance faction You can use "/burnsuppressors" command to turn suppressors, that burnt out before mod installation, into wreckages Installation Unpack mod archive into "Avorion" folder Add following line in the end of the file "data\scripts\entity\energysuppressor.lua": if not pcall(require, 'mods.ImprovedEnergySuppressor.scripts.entity.energysuppressor') then print('[ERROR][improvedEnergySuppressor]: failed to extend entity/energysuppressor.lua!') end Add this line in the end of the file "data\scripts\items\energysuppressor.lua": if not pcall(require, 'mods.ImprovedEnergySuppressor.scripts.items.energysuppressor') then print('[ERROR][improvedEnergySuppressor]: failed to extend items/energysuppressor.lua!') end Optionally install i18n - Internationalization mod, if you want to use this mod in your language Uninstallation Compatibility Changelog Help to Translate Currently supported languages: English, Russian. You can help to translate this mod: ImprovedEnergySuppressor-1.0.0_0.17.1-0.18.2.zip ImprovedEnergySuppressor-1.0.1_0.17.1-0.18.3.zip
  17. Since devs are saying that the next update will be about system upgrades, I decided to remind about two old and annoying bugs related to the upgrades. Both of these bugs are present on all recent Avorion versions. [*]You can perfectly fine install/uninstall upgrades via right click, but when a player drags them into/out of the slot, game sometimes fails to attach/unattach script. This will result in "Object Detectors" not highlighting asteroids, no "Trading module" icon e.t.c. Or you can drag out the "Trading module" upgrade and still have it's icon (and thus the attached script). [*]Occasionally UI 'hides' installed upgrades icons so their slots look like no upgrade is installed. Can't find a way to reproduce it though.
  18. 1.0.1 Fixed: It appears that players always have to pay credits to build a turret - so now the resulting Selling price is based on Ingredient Price and Assembly price (credit cost) Added: 'assemblyPriceMultiplier' config option Changed: Renamed config parameter 'priceMultiplier' to 'ingredientPriceMultiplier'
  19. Hammelpilaw, Hi. Can you explain please? Do you mean: To calculate production price with modifiers, compare it with vanilla price and just save final price? Or to change turret creation price somehow?
  20. Starting from game version 0.23 mod is moved to the Steam Workshop. Currently the biggest problem in the Avorion economy balance is the exploit that allows to construct turrets that cost billions and trillions. I'm totally not against the idea of making turrets for profit, but this profit should be reasonable. And while devs are working on the global balance (which is a hard work), I came up with a local solution of this problem. This mod allows the game to 'remember' a cost of all ingredients of a player-made turret and assembly price, so selling price will be based on that instead of vanilla price. It will only affect turrets that were created after this mod was installed. Should be compatible with 0.17.1-0.18.3. By default mod has settings that result in non-profitable turrets that cost 25% of their production price at maximum. If you want to adjust settings, look at "Configuration" section. Installation Unpack mod archive into "Avorion" folder Add following line in the end of the file "data/scripts/entity/merchants/equipmentdock.lua": if not pcall(require, "mods.TurretSellingFix.scripts.entity.merchants.equipmentdock") then print("[ERROR][TurretSellingFix]: Failed to extend equipmentdock.lua!") end Add this line in the end of the file "data/scripts/entity/merchants/turretfactory.lua": if not pcall(require, "mods.TurretSellingFix.scripts.entity.merchants.turretfactory") then print("[ERROR][TurretSellingFix]: Failed to extend turretfactory.lua!") end And this line in the end of the file "data/scripts/entity/merchants/researchstation.lua": if not pcall(require, "mods.TurretSellingFix.scripts.entity.merchants.researchstation") then print("[ERROR][TurretSellingFix]: Failed to extend researchstation.lua!") end Uninstallation Known issues Compatibility (2, new info as of 16.09.18) Configuration Changelog Credits Devious - for reporting component amount 0 exploit Hammelpilaw - for reporting high-rarity exploit TurretSellingFix-1.0.0_0.17.1-0.18.2.zip TurretSellingFix-1.0.1_0.17.1-0.18.2.zip TurretSellingFix-1.1.0_0.17.1-0.18.3.zip TurretSellingFix-1.1.1_0.17.1-0.18.3.zip
  21. 1. function Matrix rotate(Matrix in, float angle, vec3 axis) - rotates orientation Matrix around the axis by angle specified in radians. The rotation should be performed on server side and it's instant. local entity = Entity() entity.orientation = rotate(entity.orientation, 1.57, vec3(1, 0, 0)) 2. Gradually rotating entity using following function: function addRotation(vec3 axis, float angularVelocity) - will add angular velocity and the entity will still rotate around the axis. But you'll need to apply it every update and stop when it will be enough. Also, you need to use this function on both client and server I think. function MyNamespace.update() Velocity():addRotation(vec3(1, 0, 0), 2) end
  22. 1.1.0 Added: Now mod resets AIAction and order icon before the jump and when a player enters the ship Added: Config file This update is important because some mods (Complex Craft Orders for example) had problems with processing orders after players entered ship or ships jumping into other sector - now you can set up consecutive Jump Orders and they will work! Also, now mod IS NOT client-side only.
  23. Sandworm, nice work. But I guess you should add following styles to the 'navbar' class, because otherwise "Top"/"Goto"/"Clear" buttons can't be clicked and filter input field is not visible: position: relative; z-index: 1; And maybe some changes in the 'quicknav' class, so it would not be under other elements: top: 128px; z-index: 2;
  24. Hi Exspes, thanks for posting. This ruleset should do the trick. The thing is: currently if ship jumped into another sector, it will NOT jump again unless any other action was made. I'm working on this issue. Other than that, everything should work fine after the jump
×
×
  • Create New...