Jump to content

[MOD] [OOSP]out of sector Production


Laserzwei

Recommended Posts

Deprecated

As of 0.16.1 ALL features of oosp are included in vanilla. Therefore no update for 0.16 will occur.

As of beta0.15.8 most features of oosp are in vanilla. The following features are now part of vanilla:

  • emulating NPC Factories
  • consuming goods on Mines/Tradingposts/Shipyards/Equipmentdocks/etc.
  • Adding goods to Tradingposts

 

This mod (from v. 0.99_5 onward) will include:

  • Replenishment of resource depots

 

Updating the build progress in shipyards is now included here.

 

pre 0.15.8 (< 0.99_5):

 

 

This mod emulates the productioncycles of Factories and Spacestations while you are not in the same sector. It does so by catching-up the production process as soon as you re-enter a sector.

 

Warning: before updating always check the version history for any incompatibilites!

What this mod does not:

-It does not simulate every sector simultainously. In fact it loads no Sector at all. It just calculates what the Production in a Sector would be if it was loaded.

-It does not calculate Stations or ships other than factories,Mines(also Playerowned) and shipyards. It does not simulate playerowned Production.

 

You can install this mod on existing Galaxies. However you need to visit a sector at least twice, before an outcome will be visible.

 

 

 

Installation Guide

If you are updating from 0.15.7 to 0.15.8 foollow the spoiler:

 

 

1) replace /data/scripts/server/server.lua with the VANILLA file

2) delete /mods/oosp/*

3) continue below

 

 

Extract the "data" and "mods"-folder from the zip file into your <installdir>\Avorion\ folder.

You should end up with a structure like this:

/Avorion/data/*

/Avorion/mods/oosp/*

 

*I don't give any warranty. Your fridge might catch fire. -Who knows? :o

 

Version history

 

 

--0.99_5b for 0.15.8

  - now actually changing the stock (>.<)

 

--0.99_5 for 0.15.8

- removed oosp not installed detection

- removed oosp for all consumers

- reworked code for resourcetraders update

- removed playerscript handling the (Un-)Loading event

- removed the timesystem for accurate out-of-sector calculations

- removed oosProdLib since it's not required anymore

- remove shipyard oosp update; now here

--0.99_2d for 0.15.7

- fixed incompatibility with MineCorp (for real!)

--0.99_2c for 0.15

  - fixed issue with resource depots

  - fixed incompatibility with MineCorp

  - 3 new config options for resource traders

 

Older patch-logs can be found here

 

 

 

Filestructure:

 

 

0.99_2b

Vanilla Files Modified:

data/scripts/server/server.lua

 

mods/oosp/scripts/player/oosproduction.lua

mods/oosp/scripts/lib/oosproductionLib.lua

data/scripts/commands/getTick.lua

data/scripts/commands/setTick.lua

 

0.99_5

Vanilla Files Modified:

data/scripts/entity/merchants/resourcetrader.lua

 

mods/oosp/config/oosp.lua

mods/oosp/scripts/entity/merchants/resourcetrader.lua

 

 

 

License

Public Domain

Link to comment
Share on other sites

  • Replies 174
  • Created
  • Last Reply

Top Posters In This Topic

This is exactly what the game needs!

As long as the sectors don't stay loaded all the time I hope it won't be too much of a load on the server since it's not that stable yet.

I will definately try this out on our server, it's pretty crowded so I will let you know how it turns out.

Anything that I can look out for?

 

Thanks for making this :)

Link to comment
Share on other sites

This is exactly what the game needs!

As long as the sectors don't stay loaded all the time I hope it won't be too much of a load on the server since it's not that stable yet.

I will definately try this out on our server, it's pretty crowded so I will let you know how it turns out.

Anything that I can look out for?

 

Thanks for making this :)

 

I updated the description to point out that this mod is not performance heavy. It does not load any additional Sector (iirc. the current API doesn't even allow that). However it requires about 2ms once a player switches a Sector.

I didn't declare my mod stable, because i couldn't test on a server with multiple players. It is however tested on a dedicated Server with a single player logged in.

If you could provide me a server log and the content of galaxyticks.txt that would give me probably everthing i need.

Pastebin.com is perfect for that. Don't forget to anonymize the data

 

Just what I needed for my factories!  ;D

 

Is it possible for mining ships to do that too?

short answer: No.

Longer Answer: To do so I would need to get how your mining ships are structured. In detail: what turrets is it using?, how many?,what materials can it mine?, How fast can it mine?, how big is the ship?, how fast?, Collisionbox and collision probability?, how many asteroid are in the sector?, which ones can be mined?, which ones should be mined?,where should the ship be when the sector is entered?That are the first questions that come into my head. This all has to be calculated in the loading screen when you swicth sectors. And for some of the questions the API doen't even give an option to look for them. But if you have some experience in modding with lua you might be able to find the aswer to these problems yourself  ;)

 

Link to comment
Share on other sites

This is a mod that many players (myself included) has been waiting for.

 

However, this mod seems incompatible with Highlite Players, because both replace the vanilla server.lua. I don't suppose someone could merge the two?

 

Also... Carrier Commands replaces server.lua. So, I guess that's another incompatibility...

 

You can open the server.lua from mod xyz and compare it with the vanilla version. Than you can manuell add the differents and so on. I recommend to use notepad++.

It's annoying at the moment, but I hope in future there will be a better solution in combination with steam workshop.

Link to comment
Share on other sites

However, this mod seems incompatible with Highlite Players, because both replace the vanilla server.lua. I don't suppose someone could merge the two?

 

Also... Carrier Commands replaces server.lua. So, I guess that's another incompatibility...

As Freaky89 says: you can easily merge the others as my mod does not need the state of the server.lua , but requires it as an entrypoint into the game.

 

Also v0.9_1 released

 

Link to comment
Share on other sites

I updated the description to point out that this mod is not performance heavy. It does not load any additional Sector (iirc. the current API doesn't even allow that). However it requires about 2ms once a player switches a Sector.

I didn't declare my mod stable, because i couldn't test on a server with multiple players. It is however tested on a dedicated Server with a single player logged in.

If you could provide me a server log and the content of galaxyticks.txt that would give me probably everthing i need.

Pastebin.com is perfect for that. Don't forget to anonymize the data

 

Sure I will collect it and send it to you in a PM.

For now the mod seems to be working pretty stable and we are loving it! I do get some random crashes with errors but I'm thinking it's just the game itself since it has been doing that randomly from the start. The logs I am sending you should clear that out so w'll see!

 

I noticed that the version I have running now doesn't always seem to be working for resource mines founded on asteroids, would that be a possibility to include? 

I assume this mod works for all factories, not just the player owned. If mines would be working too then even when someone empties a stock it would "restock" when another player enters the sector at another time.

 

Trying out the new version now, will test how the shipyard reacts :)

Link to comment
Share on other sites

added Move Asteroids command to claimed, but neither sold or to-Mine-transformed Asteroids

Don't you think that is too powerful to teleport a claimed asteroids ?

At what logical reason should the asteroid be able to do hyperjumps ?

 

Yes i can see the use of moving that kind of asteroids, but that way is like cheating.

 

Maybe you can add the hyperjump ability to existing mines, if these mines got a hyperjump core of a special size.

Or add at last some costs  like 5 Mio credits + 10000 Trinium for a 1 time hyperjump generator.

 

Link to comment
Share on other sites

Don't you think that is too powerful to teleport a claimed asteroids ?

I sucks not being able to ;D

 

At what logical reason should the asteroid be able to do hyperjumps ?

If you really need lore in a SciFi game:

The Hyperspacejumpdrives of ships in avorion are based on subspace folding a point in space and moving the ship through.

With additional crew efforts and complex computaion it is possible to open such foldings in multiple locations at the same time. After the Space is folded the ship sends a microwaveimpulse to push the Astroid through the rift, as well as move itself to reach the next sector. This is how the Astroids gets jumped. 8)

 

Yes i can see the use of moving that kind of asteroids, but that way is like cheating.

It's very cheap currently (just claiming it). I give you that.

 

Maybe you can add the hyperjump ability to existing mines, if these mines got a hyperjump core of a special size.

Or add at last some costs  like 5 Mio credits + 10000 Trinium for a 1 time hyperjump generator.

Some internal details about how the script moves the Asteroid: As soon as the player leaves the sector, the "moveasteroid.lua" script on it will begin cleaning up other scripts and hook, calls the "oosproduction.lua" script so that it knows that it has to create a new asteroid in the next sector and only then the script destroys the "old" asteroid. The last step is as soon as the player enters the next sector, a new asteroid is created with the same properties and scripts. Now why did i have to make this ridiculous bypass over the "oosproduction.lua" script?- Because the "moveasteroid.lua" does not survive an sector change. In fact it causes a fatal error that crashes the whole server. It's the same error as in the roadmap. The most likely reason for it to occur is a race condition that unloads the sector before the scripts from the asteroids (notice plural!) finish and trying to call hooks in an unloaded sector and then crashing the server. Also I haven't found an easy teleport Entity from sector to sector method.

Why not move whole stations(this includes especially Mines)?

The way these Entities are stored and structured is very thinnly documented. It would be an tremendous effort work into. Only thereafter one could transfer the entity over with the same workaround i just mentioned. And that is the reason why I was not able to such an easy task within less than a day.

 

In 0.9_3 transferring an Asteroid will cost 500.000Cr per jump and you need to be in range of 10km. No matter how far that is.

However bugfixing has the highest priority.

 

Edit: typo

Edit2:

The introduction of the Asteroid teleport is a preperation mainly for Roadmap 1.2 where all stations within a sector are able to trade with eachother while the player is not present.

Link to comment
Share on other sites

can we get the move asteroid feature on it's own mod? I hate when one mod grows in scope and start messing with everything around, so it becomes impossible to mix and match them without running in conflicts

 

The jump asteroid mechanic is deeply entangled witch the "oosProduction.lua" script. It is necessary to 1) avoid doing the whole keeping data alive over sector-changes twice. 2) it would require to have multiple "server.lua" files for every combination.

 

I truely thought about it. Bbut abondaned it due to these 2 problems.

 

Maybe when the first iteration of the mod-Interfaces arrive:

http://www.avorion.net/forum/index.php/topic,1356.0.html

Link to comment
Share on other sites

Is it possible to move asteroids over multiple sectors or just one?

 

You need to call it and pay the fee of 500.000Cr before every jump. You can call as many as you like. There is no jumprange limit. If your ship can go 50 Sectors - so will your Asteroids

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...