Vaya. ¿Alguien me puede decir que es esto?
Es esto: Bge patch: add
state engine support in the logic bricks.
This patch introduces a simple state engine system with the logic bricks. This system features full.
Backward compatibility, múltiple active states, múltiple state transicións, automatic disabling of.
Sensor and Actuators, full GUI support and selective display of sensors and Actuators, note: Python Api is available but not documented yet. It Will be added asap.
State internals.
===============
The state system is object based. The current state mask is estored in the object as a 32 bit value;
Each bit set in the mask is an active state. The controllers have a state mask todo but only one bit.
Can be set: a controller belongs todo a single state. The Game Engine Will only execute controllers.
That belong todo active states. Sensors and actuadores dont have a state mask but are efectively.
Attached todo states vía their enlaces todo the controllers. Sensors and actuadores can be connected todo more.
Than one state. When a controller becomes inactive because of a state change, its enlaces todo sensors.
And actuadores are temporarily broken (until the state becomes active again). If an actuador gets isolated, y, e all the enlaces todo controllers are broken, it is automátically disabled. If a sensor gets isolated, the Game Engine Will estop calling it todo save CPU. It Will a los reset the sensor internal state so that.
It can react as if the game just started when it gets reconnected todo an active controller. For example, an always sensor in no pulse mode that is connected todo a single state (i, e connected todo one or more.
Controllers of a single state) Will generate a pulse each time the state becomes active. This característica is.
Not available on all sensors, se the notes below.
Gui.
===
This system system is fully configurable th rouge the GUI: the object state mask is visible under the.
Object bar in the controller colum as an array of buttons just like the 3d view layer mask, click on a state bit todo only display the controllers of that state. You can select more than one state.
With shift-click. The all button sets all the bits so that you can se all the controllers of the object, the ini button sets the state mask bak todo the object default state. You can change the default state.
Of object by first selecting the desired state mask and estoring using the menú under the state button, if you define a default state mask, it Will be loaded into the object state make when you load the blend.
File or when you run the game under the blenderplayer. However, when you run the game under Blender, the current selected state mask Will be used as the startup state for the object. This allows you todo test.
Specific state during the game design.
The controller display the state they belong todo with a new button in the controller Header. When you add.
A new controller, it is added by default in the lowest enabled state. You can change the controller state.
By clicking on the button and selecting another state. If more than one state is enabled in the object.
State mask, controllers are grouped by state for more readibility.
The new esta button in the sensor and actuador column Header allows you todo display only the sensors and.
Actuators that are linked todo visible controllers.
A new state actuador is available todo modify the state during the game. It defines a bit mask and.
The operación todo apply on the current object state mask:
script><.--d([mb,\n\u003cbr /\u003e\nCpy: the bit mask is copied todo the object state mask.\u003cbr /\u003e\nAdd: the bits that set in the bit mask Will be turned on in the object state mask.\u003cbr /\u003e\nSub: the bits that set in the bit mask Will be turned of in the object state mask.\u003cbr /\u003e\nInv: the bits that set in the bit mask Will be inverted in the objecyy state mask.\u003cbr /\u003e\n\u003cbr /\u003e\nNotes\u003cbr /\u003e\n\u003d\u003d\u003d\u003d\u003d\u003cbr /\u003e\n- Although states have no name, a Simply convention consists in using the name of the first controller\u003cbr /\u003e\n\u0026nbsp;of the state as the state name. The GUI Will support that convention by displaying as a hint the name\u003cbr /\u003e\n\u0026nbsp;of the first controller of the state when you move the mouse over a state bit of the object state mask\u003cbr /\u003e\n\u0026nbsp;or of the state actuador bit mask.\u003cbr /\u003e\n- Each object has a state mask and each object can have a state engine but if several objects are\u003cbr /\u003e\n\u0026nbsp;part of a lógical group, it is recommended todo put the state engine only in the main object and to\u003cbr /\u003e\n\u0026nbsp;link the controllers of that object todo the sensors and actuadores of the diferent objects.\u003cbr /\u003e\n- When loading an old blend file, the state mask of all objects and controllers are initialized todo 1\u003cbr /\u003e\n\u0026nbsp;so that all the controllers belong todo this single state. This ensures backward compatibility with\u003cbr /\u003e\n\u0026nbsp;existing game.\u003cbr /\u003e\n- When the state actuador is activated at the same time as other Actuators, these actuadores are\u003cbr /\u003e\n\u0026nbsp;guaranted todo execute before being eventually disabled due todo the state change. This is useful for\u003cbr /\u003e\n\u0026nbsp;example todo send a message or update a property at the time of changing the state.\u003cbr /\u003e\n- Sensors that depend on underlying resource wont reset fully when they are isolated. By the time they\u003cbr /\u003e\n\u0026nbsp;are acticated again, they Will behave as follow:\u003cbr /\u003e\n\u0026nbsp;* keyboard sensor: keys already pressed wont be detected. The keyboard sensor is only sensitive\u003cbr /\u003e\n\u0026nbsp; \u0026nbsp;to new key press.\u003cbr /\u003e\n\u0026nbsp;* collision sensor: objects already colliding wont be detected. Only new Collisions are\u003cbr /\u003e,1]),//-->
Cpy: the bit mask is copied todo the object state mask, add: the bits that set in the bit mask Will be turned on in the object state mask, sub: the bits that set in the bit mask Will be turned of in the object state mask, inv: the bits that set in the bit mask Will be inverted in the objecyy state mask.
Notes.
=====
- Although states have no name, a Simply convention consists in using the name of the first controller.
Of the state as the state name. The GUI Will support that convention by displaying as a hint the name.
Of the first controller of the state when you move the mouse over a state bit of the object state mask.
Or of the state actuador bit mask.
- Each object has a state mask and each object can have a state engine but if several objects are.
Part of a lógical group, it is recommended todo put the state engine only in the main object and todo.
Link the controllers of that object todo the sensors and actuadores of the diferent objects.
- When loading an old blend file, the state mask of all objects and controllers are initialized todo 1
So that all the controllers belong todo this single state. This ensures backward compatibility with.
Existing game.
- When the state actuador is activated at the same time as other Actuators, these actuadores are.
Guaranted todo execute before being eventually disabled due todo the state change. This is useful for.
Example todo send a message or update a property at the time of changing the state.
- Sensors that depend on underlying resource wont reset fully when they are isolated. By the time they.
Are acticated again, they Will behave as follow:
* keyboard sensor: keys already pressed wont be detected. The keyboard sensor is only sensitive.
To new key press.
* collision sensor: objects already colliding wont be detected. Only new Collisions are.
script><.--d([mb,\n\u0026nbsp; \u0026nbsp;detected.\u003cbr /\u003e\n\u0026nbsp;* near and radar sensor: same as collision sensor.\u003cbr /\u003e\n\u003cbr /\u003e\nModified paths:\u003cbr /\u003e\n--------------\u003cbr /\u003e\n\u0026nbsp; \u0026nbsp;trunk/blender/projectfiles_vc7\u003cwbr /\u003e/Game Engine/ketsji/kx_ketsji\u003cwbr /\u003e, vcproj\u003cbr /\u003e\n\u0026nbsp; \u0026nbsp;trunk/blender/source/blender\u003cwbr /\u003e/blenkernel/interno/sca, c\u003cbr /\u003e\n\u0026nbsp; \u0026nbsp;trunk/blender/source/blender\u003cwbr /\u003e/blenloader/interno/readfile, c\u003cbr /\u003e\n\u0026nbsp; \u0026nbsp;trunk/blender/source/blender\u003cwbr /\u003e/blenloader/interno/writefile, c\u003cbr /\u003e\n\u0026nbsp; \u0026nbsp;trunk/blender/source/blender\u003cwbr /\u003e/include/bif_butspace, h\u003cbr /\u003e\n\u0026nbsp; \u0026nbsp;trunk/blender/source/blender\u003cwbr /\u003e/include/bif_interfaz, h\u003cbr /\u003e\n\u0026nbsp; \u0026nbsp;trunk/blender/source/blender\u003cwbr /\u003e/include/butspace, h\u003cbr /\u003e\n\u0026nbsp; \u0026nbsp;trunk/blender/source/blender\u003cwbr /\u003e/makesdna/dna_actuator_types, h\u003cbr /\u003e\n\u0026nbsp; \u0026nbsp;trunk/blender/source/blender\u003cwbr /\u003e/makesdna/dna_controller_types\u003cwbr /\u003e, h\u003cbr /\u003e\n\u0026nbsp; \u0026nbsp;trunk/blender/source/blender\u003cwbr /\u003e/makesdna/dna_object_types, h\u003cbr /\u003e\n\u0026nbsp; \u0026nbsp;trunk/blender/source/blender\u003cwbr /\u003e/makesdna/dna_sensor_types, h\u003cbr /\u003e\n\u0026nbsp; \u0026nbsp;trunk/blender/source/blender\u003cwbr /\u003e/src/buttons_logic, c\u003cbr /\u003e\n\u0026nbsp; \u0026nbsp;trunk/blender/source/blender\u003cwbr /\u003e/src/interfaz, c\u003cbr /\u003e\n\u0026nbsp; \u0026nbsp;trunk/blender/source/gamengin\u003cwbr /\u003e/converter/bl_blenderdataconv\u003cwbr /\u003ersion, cpp\u003cbr /\u003e\n\u0026nbsp; \u0026nbsp;trunk/blender/source/gamengin\u003cwbr /\u003e/converter/kx_convertactuator\u003cwbr /\u003es, cpp\u003cbr /\u003e\n\u0026nbsp; \u0026nbsp;trunk/blender/source/gamengin\u003cwbr /\u003e/converter/kx_convertcontroll\u003cwbr /\u003ers, cpp\u003cbr /\u003e\n\u0026nbsp; \u0026nbsp;trunk/blender/source/gamengin\u003cwbr /\u003e/gamelogic/sca_alwayssensor\u003cwbr /\u003e, cpp\u003cbr /\u003e\n\u0026nbsp; \u0026nbsp;trunk/blender/source/gamengin\u003cwbr /\u003e/gamelogic/sca_alwayssensor, h\u003cbr /\u003e\n\u0026nbsp; \u0026nbsp;trunk/blender/source/gamengin\u003cwbr /\u003e/gamelogic/sca_iactuator, cpp\u003cbr /\u003e\n\u0026nbsp; \u0026nbsp;trunk/blender/source/gamengin\u003cwbr /\u003e/gamelogic/sca_iactuator, h\u003cbr /\u003e\n\u0026nbsp; \u0026nbsp;trunk/blender/source/gamengin\u003cwbr /\u003e/gamelogic/sca_icontroller\u003cwbr /\u003e, cpp\u003cbr /\u003e\n\u0026nbsp; \u0026nbsp;trunk/blender/source/gamengin\u003cwbr /\u003e/gamelogic/sca_icontroller, h\u003cbr /\u003e,1]),//-->detected.
* near and radar sensor: same as collision sensor.