Currently we have relays and VCE functions which allow certain processes to occur over a server, but I would really like to see an independent mod with features of both in order to make events more compact.
For example:
0. onActivate >> Self/NB >> ProcessCreate "Name"
(When the brick is clicked, the targeted brick will create a process with identity of "Name" to the server. Removing this brick will not remove the Process. If the process already exists stored on the server, then this event will do nothing.)
1. onActivate >> Self/NB >> ProcessDelete "Name"
(When the brick is clicked, the targeted brick will delete the process with the identity of "Name" to the server., given that it exists before this event was called.)
2. onProcessCreated >> ALL >> "whatever"
(When a process is created, this event is triggered.)
3. onActivate >> Self/NB >> ProcessCall "Name"
(When the brick is activated, the brick triggers all bricks with the event 4 input.)
4. onProcessCalled >> Self/NB >> ProcessIfIdentity "Name" "Ranges"
(When a process is called, the brick checks if the process that is called has the identity "Name", and triggers the event
ranges*.)
5. onProcessTrue >> ALL >> "whatever"
(When event 4 returns true, this event is triggered.)
6. onProcessFalse >> ALL >> "whatever"
(When event 4 returns true, this event is triggered.)
7. onActivate >> Self/NB >> ProcessTimerStart "Name" "Time"
(When this brick is activated, the brick will trigger the process with identity of "Name" in "Time" seconds. This is to avoid the stupid 30000 ms delay, so that larger times could be applied for larger variety.)
8. onActivate >> Self/NB >> ProcessTimerAbort "Name"
(Whim this brick is activated, it will check if the process with identity "Name" has a timer, and then will cancel it if it exists. This will not set it to 0, whick would trigger it instead, but stops the timer completely, and clears it from existence. The timer would have to be recreated for this event to work again.)
9. onProcessTimerStart >> ALL >> "whatever"
(When a process timer starts, it triggers this event.)
10. onProcessTimerAborted >> ALL >> "whatever"
(When a process timer is aborted, this event is triggered.)
11. onProcessTimerTick >> Self/NB >> ifProcessIdentity "Name"
(When a process timer anywhere has a tick, i.e. when a second off of its timer counts down, this event is triggered, however, it checks if the process timer belongs to process with the identity of "Name".)
The point of this mod is to reduce the number of relays and named bricks, so that you don't need to trigger a network of relays to handle things. For example, you could trigger an entire game sequence with a few processes. Suppose you have a bomb arm button, a bomb, an alarm system, and a disarm system. You must first start by creating two processes, one for launching, and one for the abort sequence. For instance:
onMinigameReset >> Self >> ProcessCreate "BombArm"
onMinigameReset >> Self >> ProcessCreate "BombDefuse"
Now for calling the events.
On a brick to trigger the bomb to be set,
0. onActivate >> Self >> ProcessTimerStart >> "BombArm" "60"
1. onProcessTimerStart >> Minigame >> CenterPrintAll "The bomb is primed, and will detonate in 60 seconds, unless defused!"
2. onProcessTimerStart >> NB "Bomb" >> SetEventEnabled "whatever" (This makes it so the bomb can be defused)
On named brick "Bomb",
0. onProcessTimerTick >> Self >> ProcessIfIdentity "BombArm" "1"
1. onProcessTrue >> Minigame >> BottomPrintAll "The bomb will detonate in $ProcIDTime_BombArm seconds!"
2. onProcessCalled >> Self >> ProcessIfIdentity "BombArm" "3"
3. onProcessTrue >> Self >> spawnExplosion "whatever"
4. onActivate >> Self >> ProcessTimerStart "BombDefuse"
5. onProcessTimerTick >> Self >> ProcessIfIdentity "BombDefuse" "6"
6. onProcessTrue >> Client >> CenterPrint "Defusing in process: $ProcIDTime_BombDefuse" seconds left."
7. onProcessCalled >> Self >> ProcessifIdentity "Defuse" "8"
8. onProcessTrue >> Self >> ProcessAbort "BombArm"
And then on the alarms, which require no named brick,
0. onProcessTimerStart >> Self >> ProcessIfIdentity "BombArm" "1 2" (or "1, 2" for range)
1. onProcessTrue >> Self >> fireRelay
2. onProcessTrue >> Self >> SetLight "Alarm"
3. onProcessCalled >> Self >> ProcessIfIdentity "BombDefuse" "4 5" (or "4, 5" for range)
4. onProcessTrue >> Self >> SetLight "NONE"
5. onProcessTrue >> Self >> CancelEvents
6. onRelay >> Self >> playSound "whatever"
7. (2000) onRelay >> Self >> fireRelay
*
Ranges refer to the following formats: "1 5" triggers events 1, 2, 3, 4, and 5, "1, 2, 3" triggers events 1, 2, and 3, "1 3, 5" triggers events 1, 2, 3, and 5, "1 3, 6 8" triggers events 1, 2, 3, 6, 7, and 8, and so on. Marble Man had an Add-On that did this, but I'm not sure if it was deleted or not.
In events, there would be replacer strings much like the VCE strings of <var:whatever>, except it should use the natural strings for detecting it, these being:
$ProcIDExists_"Name" | Boolean |
$ProcNum | Number of Processes that exist on the server. |
$ProcNum_"BL_ID" | Number of processes that exist on the server owned by this BL_ID. |
$ProcIDName_"Name" | The identity name of the process. |
$ProcIDTime_"Name" | The amount of time until process with identity "Name" is triggered. If there is no timer, this returns as "UNDEFINED" |
$ProcIDTimerExists_"Name" | Boolean |
$ProcIDOwner_"Name" | BL_ID of the owner of the process with the identity of "Name". |
Thank you for reading! If you have any suggestions, including polls or poll options, let me know.
A detailed explanation for basic functionalities is found here.