[Bf-committers] Init Delay for BGE Sensors, ideas and support pls

Dalai Felinto dfelinto at gmail.com
Sat Jul 26 04:09:45 CEST 2008


Hi.

We are using different sensors from different objects to initialize and run
some Python scripts in BGE.
Sometimes we need a specific script initialization order, and we are having
some troubles with the way Blender handle it.

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.

Today I start coding it, and so far I have the GUI working, and I'm able to
save/read Blender files with the settings of the Always Sensor.
So far I can skip the first pulse for the AlwaysSensor, and make it runs
only after the next trigger pulse.

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.

So I have three questions:

1) It is better to have a generic init delay system for all Sensors or it is
useful only for the Always Sensor?

2) I'm not sure how can I delay it only for the AlwaysSensor. Apparently I
can't configure it only changing the SCA_AlwaysSensor.cpp.
    Initially I can think in two ways:
      a) code the AlwaysEventManager to check if the event is Always and if
it is try to delay it.
      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.

3) I'm not sure how the EventManager works. Does anyone have any
tips/suggestions/comments to help me in this matter, please ...



The patch so far to implement the GUI option for the AlwaysSensor
http://pasteall.org/1722/cpp .
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) -
http://pasteall.org/1723/cpp


Thanks for your time and assistance.

Best regards,
Dalai Felinto

http://blenderecia.orgfree.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.blender.org/pipermail/bf-committers/attachments/20080725/ed67bf7f/attachment.htm 


More information about the Bf-committers mailing list