Explicit and non-explicit calls
Some objects, such as proximity sensors, normally require handling or calculations to be performed once per simulation step, to reflect a possible change in the scene. This handling can be done implicitely or explicitely, and those objects have a special setting related to that: an explicit handling flag. By default that flag is unchecked, which means that the object will be implicitely handled via the main script. Indeed the following main script code will be executed and handle said objects once per simulation step:
Above code will perform proximity sensor computations, and any other script can then read the up-to-date calculation results with:
Above code, unlike the previous, will not compute anything, but just read the calculation result. This is very convenient when calculation need to happen exactly once per simulation step and/or the calculation result is required by several scripts.
If however, an object requires less or more frequent calculations (e.g. several calculations within a same simulation step), then above mechanism does not work. In that case, the object should be flagged as explicit handling: from that moment on, the main script will not handle that object anymore, and it is the responsibility of another script to do this. For instance if the proximity sensor should only be handled once every other simulation step, a child script could include following code:
If new calculations need to be performed several times within a same simulation step (e.g. because an object or the sensor itself is moved more frequently), one could write: