property sensor/actuator

The property actuator allows me to assign one property to the same as another, but I can’t use the property sensor to check if a property is the equal to another property without using an expression and an always sensor.

Examples:

Sensor:

Actuator:

If ammo equal Clipsize

I think you just type it in,

That doesn’t seem to work as the value assumes that you are telling it a string, not the name of a property.

here ya go

this uses python to set the value the sensor is looking for using another property own[‘Max’]

Attachments

SetPropertySensorValueUsingPython.blend (420 KB)

also I noted you can set the property sensor to fire if the expression is true

via mode

That’s useful, but I can do that with an expression :confused:

Yar however - setting the property sensor mode to 5 should fire your expression controller without using always?

property sensor---------expression---------Do thing
_____________--------Python
always(one time)--------/

Btw for this, I just have the reload button run a check to see if it needs to reload,

also… check this file out :smiley:

/uploads/default/original/4X/e/1/6/e16771698f1a815b4f690be6ab7ac7eb2a52b6dd.blendd=1417846910

I do all the reloading, and timing, and shooting using the same python script.

Note - The always sensor firing the script could be replaced with

InvSlot=2-------------

The property sensor uses the value as you enter it. e.g. you enter abc-
The property actuator interprets the value. e.g- you have to surround strings with “” = “abc”

To compare two properties you can use the expression controller: ammo == clipsize
to avoid unnecessary processing you trigger the controller only if one of the properties changes:

property sensor [not pulse] mode:Changed

Good idea, I was thinking property sensor set to mode 5 by python, but then the python triggers every time the sensor fires,

property-----------expression---------do stuff
______-----------python(set mode)
always(1-time)----/