Jump to content

Welcome to the Forum!

The best place to exchange builds and ideas! Vote for the best ideas and suggestions here.

Join the Avorion Discord!

Connect with other passionate players and talk about the latest news.
Discord

DLC Avorion Into the Rift Out Now!

Now available on Steam!
Steam

Where do I go to mod crew salary?


Silveressa
 Share

Recommended Posts

Just curious where to go to mod the crew salary/how often they are paid?  (I want to cheapen out the cost for captains as they seem to suck up mining profits in early game.) because I'm not seeing any mods to change it and I'm drawing a blank when trying to find it in the game files myself.

Link to comment
Share on other sites

I'm thinking that may be core side.  I did some searching around and came across crewboard.lua, where in one of the functions (CrewBoard.getPriceAndTax) I see a profession.price used.  Tracing profession back to try and get at it's origin, I come across a getWorkforce() call that I can't find a definition for (and in fact, seems to be used only in this file (I use Notepad++, so it has a Find in Files search function)).

 

May be out of luck unless someone else stumbles across something.

Link to comment
Share on other sites

There was a thread on this back in 2017 and it was basically determined that the variables were not exposed. Duncan Idaho however had an idea that

Duncan Idaho - "you could hook something onto the onResourcesChanged player callback that checks getShipPaymentTime and if it has just ticked over to 3 hours refund the cost given by the getShipPayment command"

 

https://avorion-modding.fandom.com/wiki/Player_Callbacks

 

I've been trying to figure out a way to add this onResourcesChanged callback  but I don't even quite understand how callbacks work.  I am a super newbie at this.. i've been trying to put the code below in various locations/scripts, but I don't get any feedback from it.

 

local player = Player()
player:registerCallback("onResourcesChanged", "onResourcesChanged")

function onResourcesChanged(player)
print("Callback test")
end

 

The only example of onResourcesChanged that I could find is in fightertutorial.lua under data/scripts/player/missions/tutorials

 

Since i've also had trouble finding a way to edit salary, i've been looking for ways to remove crew requirements altogether.

 

I've found some ways to mitigate crew requirements

addAbsoluteBias(StatsBonuses.PilotsPerFighter, -2)
addAbsoluteBias(StatsBonuses.MinersPerTurret, -2)
addAbsoluteBias(StatsBonuses.MechanicsPerTurret, -2)
addAbsoluteBias(StatsBonuses.GunnersPerTurret, -2)

This code can be added to various ship upgrades like the radarbooster. You could also put it in basesystem.lua and make all upgrades have it.

 

Another thing I tried is to trick the game into thinking a ship has a captain where there are none so ships can mine/salvage without a captain.

For example...

local captains = entity:getCrewMembers(CrewProfessionType.Captain) + 1

No success there, but I am going to keep trying various things.

Link to comment
Share on other sites

  • 2 weeks later...

Found out that there is also a stat bonus multiplier for crew members. It can be used to increase your workforce/productivity. This would reduce crew costs because you won't need as many crew members anymore.

	addBaseMultiplier(StatsBonuses.Engineers, 2)
addBaseMultiplier(StatsBonuses.Mechanics, 2)
addBaseMultiplier(StatsBonuses.Gunners, 2)
addBaseMultiplier(StatsBonuses.Miners, 2)
addBaseMultiplier(StatsBonuses.Sergeants, 2)
addBaseMultiplier(StatsBonuses.Lieutenants, 2)
addBaseMultiplier(StatsBonuses.Commanders, 2)
addBaseMultiplier(StatsBonuses.Generals, 2)

 

EDIT: Removed addBaseMultiplier(StatsBonuses.Pilots, 2). Noticed it broke my game when I tried to add in pilots this way.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...