Closed CoderCow closed 9 years ago
I would like to make a suggestion here. Could we instead of what you are suggesting set a console statement inside the sign ie/
[Console] if #ileft = 1 then oright = 1 else oright = 0 end if
Something simple like that? where i/o = input output and there is left right up down
I have, of course, also considered real script support, but the down sides of scripting are as follows: -You have to understand scripting in order to use CCs which is a lot more effort to learn then my Task design I believe. -Using of If-then-else constructs, especially with signals, can be done with usual circuity instead. -If you need to execute Tasks when specific conditions are met though, the Task design has already covered that up with labels. (I've been too lazy to explain that yet, but if one looks on all Tasks having a Label parameter they might get the idea.) -Ingame editing of Signs is ugly - scripting would probably enlarge the needed amount of text even more. -Scripts are far slower to interpret - even if I would pre-compile scripts after the Sign was edited, the pre-compile would take unecessary performance and it would be hard to implement.
Not completely sure about the design and name yet, but it will probably be a sign with a special kind of block all around it. The text on the sign then defines, using a special pattern, what Port site of the Complex Component should perform what Task and the parameters those Tasks should be executed with. So, a Complex Component can have one Task assigned to each Port site - resulting in 4 Tasks at most.
This is how a simple sign definition for a Complex Component could look like:
[ComplexComponent(Bottom)]
[Left: ChestTakeItems(1, Wood)]
[Right: ChestPutItems(1, Wood)]
As defined, the bottom Port of the Complex Component (CC) is the signal Port. The CC will start processing when the bottom Port receives a 1 signal. So the first task is to take an item from a chest, so the CC will send a 1 signal out of its left Port and the first chest that receives a 1 signal through this circuit will be taken as source chest. If the chest or the given item was not found in the chest, the CC will stop processing any further tasks, if it was found though, it will now send a 1 signal out of its right Port and the first chest that receives the 1 signal through this wire will be taken as the destination chest. If the CC found this chest too and its not full, everything will be set for the actual execution, so finally the CC will actually take the item from the source chest and put it into the destination chest. The CC is smart enough to know that if the user defined that an item should be taken, it also has to be put somewhere after that, it will not just remove the item. So if there is a "ChestTakeItems" task but no "ChestPutItems" or something equivalent like "DropItem" the CC will simply not execute and throw an error to the one who executed the circuit. But since we have both tasks it will be alright. Of course, the CC is also smart enough to not just duplicate the item if there is another "ChestPutItems" Task for the same or a different chest, the second "ChestPutItems" would just be invalid as there would be no item left to put.
Any other Port site beside the signal Port will never have any effect if they receive a signal. Though, even as the bottom Port is the signal port, it might still have a Task assigned to it too. Each Task should come with a configurable permission, so if a user writes down a Task on a Complex Component sign but doesn't have the permission for it, the change will not be applied.