<div dir="ltr">Hi.<br><br>We are using different sensors from different objects to initialize and run some Python scripts in BGE.<br>Sometimes we need a specific script initialization order, and we are having some troubles with the way Blender handle it.<br>
<br>One idea we have so far was to implement an option in the Always Sensor to delay the beginning of the scripts in a specific number of pulses.<br><br>Today I start coding it, and so far I have the GUI working, and I&#39;m able to save/read Blender files with the settings of the Always Sensor.<br>
So far I can skip the first pulse for the AlwaysSensor, and make it runs only after the next trigger pulse.<br><br>Beside that I realize that I can implement a counter system in the SCA_AlwaysEventManager.cpp to create a delay system for all individual Sensors.<br>
<br>So I have three questions:<br><br>1) It is better to have a generic init delay system for all Sensors or it is useful only for the Always Sensor?<br><br>2) I&#39;m not sure how can I delay it only for the AlwaysSensor. Apparently I can&#39;t configure it only changing the SCA_AlwaysSensor.cpp.<br>
&nbsp;&nbsp;&nbsp; Initially I can think in two ways:<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; a) code the AlwaysEventManager to check if the event is Always and if it is try to delay it.<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; b) add an option in SCA_EventManager.cpp to receive as an input (int or short) in some of its methods and use it to add the initial delay to the frames.<br>
<br>3) I&#39;m not sure how the EventManager works. Does anyone have any tips/suggestions/comments to help me in this matter, please ...<br><br><br><br>The patch so far to implement the GUI option for the AlwaysSensor <a href="http://pasteall.org/1722/cpp">http://pasteall.org/1722/cpp</a> .<br>
The patch so far to implement the GUI for the Always Sensor + a general delay for all sensors (the delay came from a inpu in the console) - <a href="http://pasteall.org/1723/cpp">http://pasteall.org/1723/cpp</a><br><br><br>
Thanks for your time and assistance.<br><br>Best regards,<br>Dalai Felinto<br><br><a href="http://blenderecia.orgfree.com">http://blenderecia.orgfree.com</a><br></div>