Hello, I am starting to make a game like mindustry, but I do not understand how to make conveyors, routers, sorters and overflow gates. Now, let me explain how these blocks work.
Conveyors - Move input that can be then forwarded to the core, turrets or in production.
Routers - Obtain input and output them on 1 - 3 different sides.
Sorters - Move the configurated input forward, and the rest on the sides.
Overflow Gates - If forward is blocked, output on left and right.
I need to recreate these blocks in my game,
any help is appriciated.
Conveyors, routers, sorters and overflow gates.
Forum rules
Before you make a thread asking for help, read this.
Before you make a thread asking for help, read this.
Conveyors, routers, sorters and overflow gates.
Last edited by WAWAWA on Mon Aug 30, 2021 2:37 pm, edited 1 time in total.
Re: Conveyors, routers, sorters and overflow gates.
I've thought about conveyors in Lua , it looks like that here must be two main tweaks:
1) The items on the belts are not moving (items on the belt are just names in the table).
2) Use the shift as function of time to draw and access items on belts.
For example:
Right now the inserter takes items from fourth belt tile, where is "empty".
After one second the shift will be belt.shift = belt.shift + 1 and if the inserter must grab item from the belt tile number three, it takes iron and writes "empty" to this belt tile.
After the another second it will be copper, than wood and than the shift must be returned back to 0.
The drawing must be hacked the same way, but with smooth moving.
1) The items on the belts are not moving (items on the belt are just names in the table).
2) Use the shift as function of time to draw and access items on belts.
For example:
Code: Select all
belt = {}
belt.items = {"wood", "copper", "iron", "empty"}
belt.shift = 0
After one second the shift will be belt.shift = belt.shift + 1 and if the inserter must grab item from the belt tile number three, it takes iron and writes "empty" to this belt tile.
After the another second it will be copper, than wood and than the shift must be returned back to 0.
The drawing must be hacked the same way, but with smooth moving.
Re: Conveyors, routers, sorters and overflow gates.
For the drawing I can use rotation, cosine and sine and I can do some if statements and add the item position x or y with 0.1 multiplied by the conveyor speed. Right?
Re: Conveyors, routers, sorters and overflow gates.
Maybe pre-calculated positions for straight and curved belts, for example 10 positions for straight belt and 16 positions for curved one (target ratio is 1.5708 or half pi).
Who is online
Users browsing this forum: Ahrefs [Bot], Google [Bot] and 162 guests