テンプレート:Release Notes/2.49/Game Engine/Logic Bricks

提供: wiki
移動先: 案内検索

Sensors

  • New Pulse option for the collision sensor:
    • With the Pulse option enabled, any change to the set of colliding objects will trigger an event.
    • Changes in collision are detected by comparing the number of objects colliding with the last event, as well as a hash made from the object pointers.
    • Also changed the touch sensors internal list of colliding objects to only contain objects that match the property or material.
  • Mouse Sensor:
    • now it's possible to get state of RMB
  • BGE Joystick Sensor
    • Raised limit of 2 axis 8 axis pairs (8==16 joysticks axis pairs)
    • Added a new Joystick Sensor type "Single Axis", so you can detect horizontal or vertical movement, rather then just Up/Down/Left/Right
    • Added Python attribute "axisSingle" so you can get the value from the selected axis (rather then getting it out of the axis list)

New Tap Option

Sensor "tap" option to generate automatically on/off pulses

When enabled, this option converts any positive trigger from the sensor into a pair of positive+negative trigger, with the negative trigger sent in the next frame. The negative trigger from the sensor are not passed to the controller as the option automatically generates the negative triggers. From the controller point of view, the sensor is positive only for 1 frame, even if the underlying sensor state remains positive.

The option interacts with the other sensor option in this way:

  • Level option: tap option is mutually exclusive with level option. Both cannot be enabled at the same time.
  • Invert option: tap option operates on the negative trigger of the sensor, which are converted to positive trigger by the invert option.
    Hence, the controller will see the sensor positive for 1 frame when the underlying sensor state turns negative.
  • Positive pulse option: tap option adds a negative trigger after each repeated positive pulse, unless the frequency option is 0, in which case positive pulse are generated on every frame as before, as long as the underlying sensor state is positive.
  • Negative pulse option: this option is not compatible with tap option and is ignored when tap option is enabled.

Notes

  • Keyboard "All keys" is handled specially when tap option is set:
    There will be one pair of positive/negative trigger for each new key press, regardless on how many keys are already pressed and there is no trigger when keys are released, regardless if keys are still pressed.
    In case two keys are pressed in succesive frames, there will be 2 positive triggers and 1 negative trigger in the following frame.

High Priority Controllers

A new bookmark button is available on the controller UI. When set, the controller is guaranteed to execute before all other non-bookmarked controllers, provided it is scheduled for execution.

This is useful for initialization scripts that run once at startup or scripts that must set some prerequisite for the other controllers at the start of each logic frame.

This feature is also available at python level with the "useHighPriority" attribute. It can be changed during the game.

Note that if several script are bookmarked, their relative order of execution is not guaranteed. Make sure they don't depend on each other.

Python Module Controller

Added support for any number of attributes, this means packages are supported automatically. As well as "myModule.myFunc" you can do "myPackage.myModule.myFunc", nested packages work too. The python controller is passed to the python function as an argument for functions that take 1 arg.

This allows live editing of scripts

Actuators

  • added "toggle" an option for the property actuator, toggles bool, ints, floats and timer properties.

2D filters

  • canvascoord - gl_TexCoord[3]
    • Now it's possible to get the canvas coordinates of the pixel.
  • Print the detailed GLSL shader errors (once), for easier debugging.