Install Steam
login
|
language
简体中文 (Simplified Chinese)
繁體中文 (Traditional Chinese)
日本語 (Japanese)
한국어 (Korean)
ไทย (Thai)
Български (Bulgarian)
Čeština (Czech)
Dansk (Danish)
Deutsch (German)
Español - España (Spanish - Spain)
Español - Latinoamérica (Spanish - Latin America)
Ελληνικά (Greek)
Français (French)
Italiano (Italian)
Bahasa Indonesia (Indonesian)
Magyar (Hungarian)
Nederlands (Dutch)
Norsk (Norwegian)
Polski (Polish)
Português (Portuguese - Portugal)
Português - Brasil (Portuguese - Brazil)
Română (Romanian)
Русский (Russian)
Suomi (Finnish)
Svenska (Swedish)
Türkçe (Turkish)
Tiếng Việt (Vietnamese)
Українська (Ukrainian)
Report a translation problem
So like
inventory sensor -> counter block -> math block (==5) -> set block (set to 0) -> counter block
something like that.
You could go super complicated and make a binary counter that triggers the same thing but since these blocks exist, it's easier this way.
That doesn't work, those blocks connected in that order causes the counter block to reset to zero every time a cart passes the inventory sensor.
How do I make it so that the logic set block only sends the signal to reset the counter to zero when it reaches the set value?
It's missing an operator or something.
So set it to >5 instead of ==5.
Well it's not code man, it is its' own system, and apparently it's binary as in each signal sent carries either a one or a zero.
Some people have it figured out and I've figured out at least one very basic thing thanks to a persons demonstration video, but I still don't entirely understand it because they don't explain, so i don't know why I have to use the math block function I'm using, I just know that it works.
I've been trying to figure it out to no avail I just get frustrated unable to figure it out and give up until I feel up to trying again.
As a programmer myself I understand these game logic systems better than most.
Also, if you're using this on a train track, it's no wonder it trips every time one goes by.
Each train cart can hold 12 (I think) items so if you're counting to 5, it's actually tripping because the inventory of the cart is over 5.
So the system, either version, is working properly, you're just using it wrong since the vehicle you're checking inventory on is using a larger number. I figured you were using it on a silo or barn, not a vehicle.
The math block, counter blocks, set block, inventory block, and several other blocks don't use binary. And in code it's all event driven so it only trips once per activation. The blocks that use binary are the explicit logic block parts of the math block ( or, nor, not, xor, etc. ) and those only care if the number is either a 0(zero) or a + or - non-zero (logic 1).
Without all the information on how you want it to act and what it is acting on, it's a little more difficult to create a logic computer to do what you want it to do.
Anyway, either of the samples I've listed work just fine with a cart according to your requirements that you've posted in this thread. If you're trying to do something other than count how much is in a cart when it passes through a sensor, you need to be a little more explicit in your description of the functionality you require.
If you want the circuit to reset to zero every time a cart goes by that is full, you need to do:
Inventory sensor (on track) -> counter -> math block ( ==12 ) or ( >11 ) -> set block ( 0 ) -> counter block.
That will make the cart tell the inventory sensor how many items it is carrying, that number is then recorded in the counter block, the counter block then sends the number to the math block that applies a conditional check on that number "If cart.inventory equals 12 or is greater than 11 { do something }". If the condition is met the math block then sends a TRUE signal to the set block which then sets the counter block back to 0 ( zero ).
Anyway, I'll check the circuit in-game, but I don't fully know what you're trying to accomplish with this so it's still just a preliminary design.
But it's only analyzing empty carts, so the inventory count should be zero.
I've also tried using the agent trigger block instead of the inventory sensor but I still can't get that to work, as the agent trigger only sends a signal once the cart goes by it and completely ignores the inventory so that tells me that the issue is not with the inventory, even when using the inventory sensor.
I'm not trying to count inventory, I just want to count the rail cars that go past the sensor block so I can time how long it takes for all the carts to make a complete circuit.
https://steamcommunity.com/sharedfiles/filedetails/?id=1746897279
SO if counting to 5:
Agent -> Counter -> Math (<=4) -> Boolean (NOT) ->
Number Block (Optional) -> Timer Block & Set Block ...
---Timer Block -> Signal Gate...
---Set Block -> Signal Gate...
Signal Gate -> Logic Pusher Block -> Number Block (set to 0) -> Set Block -> original Counter Block
The Boolean(NOT) gate is usually called an Inverter in most games with circuits, it turns a 1 into a 0 and a 0 into a 1, it is necessary in this circuit. The Number Block (Optional) can be taken out if you want, I left it in there for visual confirmation.
Additionally, if you want it to control a barrier gate that blocks the carts, connect the Math block to the barrier gate.
This circuit will count from 0 - 4 (5 total transits past the agent sensor), and then reset the counter to zero, if the math block is connected to a barrier gate, the circuit will also stop the carts from moving.
Lil Puppty, thanks for this useful help, i use you idea with my conveyors.
But also with your scheme i use standart inventory sensor->number block->math block to start grabber when at last point of conveyor there is empty market for example. But if conveyor is long than 10 points, than i have another problem, how to stop grabber after this 10 pcs for example cause the block that i use is always try to open it. I tried to add timer block but it doesn't help. I use the silo as a buffer but sometimes it's overflowing. The idea is to activate a grabber then your scheme count 10 times and close it and then until the items are on the conveyour the block that open this grabber for filling empty market shouldn't open. I think to add bool for this. After last 0 add logic NOT than timer and then BOOL function AND that will use this 0->1 and timer(25) AND empty market to activate grabber. Will it work or maybe there is some simple solution for this?
If market_inventory <1 { barn_grabber(open) }
inventory sensor on market with item filter to math block <1 (because == doesn't always work because of the way the event triggers work)
math block to barn grabber (this will open the flow when the market is empty of that item)
now to close the grabber
if agent_counter >9 { barn_grabber(close); set counter(0); }
agent on second conveyor slot (after grabber, this will give 10 items) connected to a counter block
counter block to math block >9
math block to inverter(boolean not so we can turn the 1 into a zero)
inverter connected to a set block connected to the counter block (this should use the zero from the inverter to set the counter block to zero again, if it doesn't, use part of the reset circuit above to do it).
inverter connected to the grabber to close the barn.
So this should sense when the market is empty of the item you want from the barn and then send 10 items to the market regardless of conveyor length and close the barn doors when those 10 items have been counted.
NVM... this wont work but I don't have time right now to fix it...