Avorion

Avorion

[2.5.2+] Xavorion: eXtended Avorion
 This topic has been pinned, so it's probably important
LM13  [developer] Feb 25, 2023 @ 3:57am
[Scripting] Tweaks & Requests
Xavorion should be easy to tweak with little scripting knowledge.

If there's something specific you're looking for, but can't find it or make it work, feel free to ask.
< >
Showing 1-15 of 30 comments
LM13  [developer] Feb 25, 2023 @ 3:57am 
Resource Depots - Material Selling/Buying
[entity/merchants/resourcetrader.lua]

1. Comment out line 28 to unlock all materials at resource depots

2. To make Resource Depot only buy materials it does not have for increased price:
Replace code from line 117 to 123 with
if GetMaterialFactor(material) > 1.0 then soldGoodButtons[material].active = false boughtGoodButtons[material].active = true elseif GetMaterialFactor(material) > 0.0 then soldGoodButtons[material].active = true boughtGoodButtons[material].active = true else soldGoodButtons[material].active = false boughtGoodButtons[material].active = false end
Blue_Phoenix Feb 25, 2023 @ 8:06pm 
Thank you
Blue_Phoenix Feb 25, 2023 @ 8:46pm 
What is the distribution of resources? Does higher tier resources appear more in high tech areas?

"Any part of the galaxy is playable, but risk and rewards increase as you get closer to the barrier."

or completely random up to Avorion beyond the boundary.

What would need to be altered for something closer to vanilla but not exactly? like iron is more common farther from the core but you can still find rare areas of ogonite and xanion with high tech levels.

or is this how it works? Any info would be helpful I might look into how to alter things myself but am unfamiliar with how modding Avorion works.
Last edited by Blue_Phoenix; Feb 25, 2023 @ 8:53pm
LM13  [developer] Feb 26, 2023 @ 4:57am 
@***Blue_Phoenix***

Resource distribution works similiar to what you've described. As of now, there are 2 distribution tables for outside and inside.
I've cut relation between tech levels and materials on purpose, it's not completely random.
There's a new layer of properties for each individual sector, partially hooked into generator, partially into gameplay code.

I'll post which files hold some of the stuff related to galaxy generator,
but that might be too much if you're not familiar with Avorion modding specificially.
LM13  [developer] Feb 26, 2023 @ 5:49am 
Resource Distributions
[GalaxyGenerator/Properties/BaseProperties.lua]

Line 61: @SectorProperty.Materials

This class contains two distributions of materials, with simple logic to swap between inside/outside barrier.
Distance and Coordinates are available in Get function, so it should be easy to lerp probabilities to your liking.
Just remember that encoding has to be there as it is in last line.

[GalaxyGenerator/Properties/DistributionProperties.lua]

Line 64: @SectorProperty.MaterialProbability

This class depends on [SectorProperty.Materials], and decides their amount in asteroids, depots, and ships.
Currently there is no logic there, changes are planned with Sectors Module.
Is there a way to make all mining and salvaging weapons into the extracting kind ?I am assuming third party mods won't affect this due to the overhaul of mining and salvaging lasers. Also, does this mod change the amount of turrets the modules add, and if so, where can I find the file to give them some more of them, and give them the same amount of auto turrets as turret slots?
LM13  [developer] Dec 8, 2023 @ 11:37am 
Originally posted by AwtismForPresident!:
Is there a way to make all mining and salvaging weapons into the extracting kind ?I am assuming third party mods won't affect this due to the overhaul of mining and salvaging lasers. Also, does this mod change the amount of turrets the modules add, and if so, where can I find the file to give them some more of them, and give them the same amount of auto turrets as turret slots?



Xavorion adds new upgrades that give more & equal number of slots - Core Modules found at Repair Docks/Shipyards.

Turret Control Systems are exactly the same as base game, and ca be overridden by workshop cheat mods.


Only way to remove Refiners is to modify Mining module directly.
All right, to edit mining turrets look at:

Mining module:
[2992809036/data/scripts/TurretsDatabase/MiningTurrets.lua]

replace line 41: TechType = WeaponTech.OreRefinerBeam, into: TechType = WeaponTech.OreExtractorBeam, and then for salvaging at line 137: TechType = WeaponTech.ScrapRefinerBeam, into: TechType = WeaponTech.ScrapExtractorBeam,

for both of those you might want to boost efficiency ( since that's what you're looking for by that change I guess )

Efficiency = 0.1,

to 0.3
Last edited by LM13; Dec 8, 2023 @ 11:43am
OK thanks, I can do some basic code editing, as I have with other mods, although these seem to be built on a different base to others so some guidance will be needed. Edit: Managed the code change, gonna go have a look at the systems and do some editing, but should be fine there.
I am using the 8x turrets mod from the workshop but I noticed its only editing some of the systems, so assumed some are governed by this mod. I will mess around with some of those settings.
Last edited by AwtismForPresident; Dec 8, 2023 @ 12:37pm
LM13  [developer] Dec 8, 2023 @ 12:39pm 
Originally posted by AwtismForPresident!:
OK thanks, I can do some basic code editing, as I have with other mods, although these seem to be built on a different base to others so some guidance will be needed. I am using the 8x turrets mod from the workshop but I noticed its only editing some of the systems, so assumed some are governed by this mod. I will mess around with some of those settings.

Yeah, Xavorion uses custom base for... well most stuff. Should be easier though, so feel free to ask.

Only those systems are touched by Xavorion, others are either completely Vanilla, or fully custom:
velocitybypass weaknesssystem fightersquadsystem shieldbooster valuablesdetector
The code looks much cleaner than any other mod I have edited in the past, but I have spent some ~20 hours in those mods. Takes some getting used to but not too bad.
Where would the systems be located?
LM13  [developer] Dec 8, 2023 @ 1:02pm 
Originally posted by AwtismForPresident!:
The code looks much cleaner than any other mod I have edited in the past, but I have spent some ~20 hours in those mods. Takes some getting used to but not too bad.
Where would the systems be located?

Class System / 2992808773 [2992808773/data/scripts/systems] coresubsystem.lua ( Xavorion custom ) enginebooster.lua overchargemodule.lua( Xavorion custom ) velocitybypass.lua weaknesssystem.lua Weaponry / 2992809109 [2992809109/data/scripts/systems] fightersquadsystem.lua shieldbooster.lua

coresubsystem.lua - That's the turret one, interesting stuff starts at line 93

-- @UpgradeType.FighterCore

It's one of 4 variants in single file, it should be easy to modify slots from line 126 to 140, other variants look almost same

-- Int < 1 ; 10 > table.insert( _Properties, { ID = UpgradeProperty.ArmedSlots , Value = _HighInt } ) table.insert( _Properties, { ID = UpgradeProperty.AutoSlots , Value = _HighInt } )
Stalkz Jan 7, 2024 @ 8:27pm 
Originally posted by LM13:
Resource Depots - Material Selling/Buying
[entity/merchants/resourcetrader.lua]

1. Comment out line 28 to unlock all materials at resource depots

2. To make Resource Depot only buy materials it does not have for increased price:
Replace code from line 117 to 123 with
if GetMaterialFactor(material) > 1.0 then soldGoodButtons[material].active = false boughtGoodButtons[material].active = true elseif GetMaterialFactor(material) > 0.0 then soldGoodButtons[material].active = true boughtGoodButtons[material].active = true else soldGoodButtons[material].active = false boughtGoodButtons[material].active = false end


Hi,

I've commented out Line 28 like you said but only local resources are still able to be sold at the depots.

--
local _X, _Y = Sector():getCoordinates()
local _SectorMaterials = IGalaxy.GetProperty( _X, _Y, SectorProperty.MaterialProbability )

local _Factor = _SectorMaterials[ _Material - 0 ]

_Factor = _Factor or 1.0

-- if _Factor == 0.0 then return 0.0 end

--print( "[ResourceDepot.getBuyingFactor] %d : %d - material(%s) ; factor(%s)", _X, _Y, tostring(_Material), tostring(_Factor) )

-- Pay less for primary sector material
-- 0.5 0.3 0.2
-- Price scales from 20 - 100%, worst case scenario when sector is single material only, they wont pay much for that
_Factor = 0.2 + (1.0 - _Factor) * GalaxyModule.ResourceSellValueFactor
--

return _Factor

end
LM13  [developer] Jan 8, 2024 @ 5:44am 
Originally posted by Stalkz:

Hi,

I've commented out Line 28 like you said but only local resources are still able to be sold at the depots.

Hello,

hope that helps:

https://steamcommunity.com/sharedfiles/filedetails/?id=3134809180
jivaii Jan 11, 2024 @ 3:05pm 
I've noticed that my guns like to shoot wrecks/rocks when harvesting them, is that a behaviour that could be changed?
LM13  [developer] Jan 12, 2024 @ 2:08am 
Originally posted by jivaii:
I've noticed that my guns like to shoot wrecks/rocks when harvesting them, is that a behaviour that could be changed?

There was a bug like that, I thought it was fixed...

If those turrets were assigned as automatic - attack target, then that's intended behaviour.
Otherwise, it's a bug - I'll check that
< >
Showing 1-15 of 30 comments
Per page: 1530 50