Jump to content

[MOD] advanced shipyard


Laserzwei

Recommended Posts

Updated for 0.20.5

1.10.1 (0.20.5) [2019-02-21]

  - adding crew increases build time by 5 minutes (vanilla)

  - Removed some unused code snippets

  - Custom ships have a skeleton crew while being constructed. Depending on your crew choice it might leave the ship after it's finished ("Empty ship" -> no crew left, "Add Crew" -> captain leaves, "Crew + Captain" -> no one leaves)

 

Vielen DANK!!!

Link to comment
Share on other sites

Beta update

1.10.2 (beta0.21.x) [2019-02-26]

  - beta update

  - crew selection is now translated (vanilla)

  - ships now have a construction fee (vanilla)

  - relation requirements for some crew members (vanilla)

 

1.11.2 (beta0.21.1) [2019-03-01]

- beta0.21.1 update (only vanilla changes)

Link to comment
Share on other sites

  • 1 month later...
  • 1 month later...

People on my server are getting a "No valid shipname" error. Any ideas why?

This could have multiple reasons.

What Avorion-version is your server on (0.22 / 0.23)?

What version of the mod do you use?

What's the name your people want to give to their ships? (Special characters in it, ... ?)

If on 0.23: Was this observed before 0.23.1?

 

Link to comment
Share on other sites

  • 1 year later...

@Laserzwei, I'm coming back to Avorion for my yearly fix ;) and your Advanced Shipyard is and has always been one of my must-haves, thank you so much for this mod!

 

I'd like to change the time it takes to build ships though; is there a clean way of overriding just the

local requiredTime = math.floor(20.0 + plan.durability / 100.0)

from outside your mod, that is, with another mod that depends on yours and only modifies the two constants (and maybe also the one for "if captain > 0 then")?

If that's not possible or feasible, would you consider adding some kind of a configuration file that persists mod updates?

 

Link to comment
Share on other sites

  • 2 months later...
On 6/27/2020 at 9:07 AM, Valck said:

@Laserzwei, I'm coming back to Avorion for my yearly fix 😉 and your Advanced Shipyard is and has always been one of my must-haves, thank you so much for this mod!

 

I'd like to change the time it takes to build ships though; is there a clean way of overriding just the


local requiredTime = math.floor(20.0 + plan.durability / 100.0)

from outside your mod, that is, with another mod that depends on yours and only modifies the two constants (and maybe also the one for "if captain > 0 then")?

If that's not possible or feasible, would you consider adding some kind of a configuration file that persists mod updates?

 

You're lucky I've read this, because I'm not really active here anymore (but on steam).
To answer your question: Your mod would have to override 'startServerDesignJob':
 

-- keep the original function to call inside your overwrite function
local mymod_startServerDesignJob = Shipyard.startServerDesignJob
function Shipyard.startServerDesignJob(founder, captain, scale, name, planToBuild)
	mymod_startServerDesignJob(founder, captain, scale, name, planToBuild);
	
	--simulate the scaling already done in the original function
	local plan = planToBuild
	plan:scale(vec3(scale, scale, scale))

	-- Change as you desire
	local requiredTime = math.floor(20.0 + plan.durability / 100.0)
	if captain > 0 then
		requiredTime = requiredTime + 300
	end
	-- Inject your new time into the already setup running job
	runningJobs[#runningJobs].duration = requiredTime
end

The code is untested, but the principle should work

Edited by Laserzwei
code alignment fix
  • Like 1
Link to comment
Share on other sites

Thank you for stopping by then and replying, will give it a try.

Even though I'm no fan by any means of the Invision software these here forums are running on, I think functionally they are still vastly superior to Steam's sad excuse of a "forum" "discussions". Will be sad to see them go.

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
×
×
  • Create New...