Post by _kuba787_ on Sept 14, 2017 20:04:14 GMT 1
Logic loops
Hello, I want to introduce an idea that was already requested by players - the idea is to enable looping of logic somehow. While it can be done in many different ways, I'd rather suggest to create a new logic box, that we will be able to connect to previous parts of our logic systems. It may look like this:
Why to add loops?
Well, there are many cases in which logic loops can be needed. I'll post here a few.
[IMPORTANT]:if you are stupid In case you haven't found that out, I have to tell you that the red line shows a missing connection that is needed for the system to work (it gets blocked by the loop detector).
1.
In this logic combination, plate number one can only set on the toggle box, and the plate number 2 - only set it off. This kind of loop can be used in some "Escape from prison" games, FNAF games etc. For example it's useful when making alarms - if the alarm gets set on, it can't be set off by the same plate and only the "guard" can set the alarm off from another place by using another plate. This can't be done now, when we can't loop logic systems. Now we have use models to prevent players from pressing plates at the time when they shouldn't be pressed - this can kill players as they can get stuck in those models.
2.
This system is the one, that will be very useful in "Boss battle games". At the beginning, we can see a randomizer that has to be set on by some plate for the first time. Then, the signal randomly goes to one of those timers. They have different duration and at the time in which one action ends, it will set the randomizer on again and the system will keep working for infinite time. The only thing needed is the missing connection. Of course we can say, that we can use a Pulse Box, which will set on the system every 2 or 3 seconds. The problem is that if we set the Pulse Box to set this on every 2 seconds, then 2 actions can be playing at the same time, if the randomizer chooses the longer one and then the shorter one, and we probably don't want this to happen. If we set the Pulse Box to repeat every 3 seconds, then there can be a 1 second break, which will make the battle losing its dynamics.
3.
This, is a binary counter resettable at every state. Plate number one, changes the value that the binary counter gives by +1, and the plate number 2. resets the system to 0. The Toggle Boxes can have the value of 1 (T) or 0 (F), like booleans. After pressing the plate number 2, the system will check every toggle box if it has value of 1 and if yes, it will change it back to 0. If its value is already 0, then it won't do anything. The possible uses of this, are: boss battles (HP bars), keyboards, resettable counters, logic minigames, like "Mario Jump" - it would reset the score after losing the game. If you are not sure what I meant, you can check it here: www.KoGaMa.com/games/play/2567079/ (enter the "Logic Minigames" teleport).
4.
This is again a binary counter, but in this case, it will be impossible to change its value by pressing the plate, after it reaches a binary value of "|1|1|1|". It's useful in creating HP bars in for example, Pokemon games, where you can battle the same NPC for many times. There is already a way of making a counter that will stop counting at some value, but you can't reset it because you need "Once" Toggle Boxes to create that. In this case, when we want to make the NPC possible to be fought more than once, we have to create a counter that will stop counting at its max value and don't go higher, (because for example, when some NPC has 1 HP, and loses 2 HP, then, if the counter was a 3-bit binary counter, its value will be 7 HP) so here we need something that will stop counting when the value is "0". The Toggle Boxes are not "Once" Toggles, so it is possible to make another plate that will just reset the counter.
Why to add loops?
Well, there are many cases in which logic loops can be needed. I'll post here a few.
[IMPORTANT]:
1.
In this logic combination, plate number one can only set on the toggle box, and the plate number 2 - only set it off. This kind of loop can be used in some "Escape from prison" games, FNAF games etc. For example it's useful when making alarms - if the alarm gets set on, it can't be set off by the same plate and only the "guard" can set the alarm off from another place by using another plate. This can't be done now, when we can't loop logic systems. Now we have use models to prevent players from pressing plates at the time when they shouldn't be pressed - this can kill players as they can get stuck in those models.
2.
This system is the one, that will be very useful in "Boss battle games". At the beginning, we can see a randomizer that has to be set on by some plate for the first time. Then, the signal randomly goes to one of those timers. They have different duration and at the time in which one action ends, it will set the randomizer on again and the system will keep working for infinite time. The only thing needed is the missing connection. Of course we can say, that we can use a Pulse Box, which will set on the system every 2 or 3 seconds. The problem is that if we set the Pulse Box to set this on every 2 seconds, then 2 actions can be playing at the same time, if the randomizer chooses the longer one and then the shorter one, and we probably don't want this to happen. If we set the Pulse Box to repeat every 3 seconds, then there can be a 1 second break, which will make the battle losing its dynamics.
3.
This, is a binary counter resettable at every state. Plate number one, changes the value that the binary counter gives by +1, and the plate number 2. resets the system to 0. The Toggle Boxes can have the value of 1 (T) or 0 (F), like booleans. After pressing the plate number 2, the system will check every toggle box if it has value of 1 and if yes, it will change it back to 0. If its value is already 0, then it won't do anything. The possible uses of this, are: boss battles (HP bars), keyboards, resettable counters, logic minigames, like "Mario Jump" - it would reset the score after losing the game. If you are not sure what I meant, you can check it here: www.KoGaMa.com/games/play/2567079/ (enter the "Logic Minigames" teleport).
4.
This is again a binary counter, but in this case, it will be impossible to change its value by pressing the plate, after it reaches a binary value of "|1|1|1|". It's useful in creating HP bars in for example, Pokemon games, where you can battle the same NPC for many times. There is already a way of making a counter that will stop counting at some value, but you can't reset it because you need "Once" Toggle Boxes to create that. In this case, when we want to make the NPC possible to be fought more than once, we have to create a counter that will stop counting at its max value and don't go higher, (because for example, when some NPC has 1 HP, and loses 2 HP, then, if the counter was a 3-bit binary counter, its value will be 7 HP) so here we need something that will stop counting when the value is "0". The Toggle Boxes are not "Once" Toggles, so it is possible to make another plate that will just reset the counter.