| Class SCA_PropertySensor (2.48) |
|
|
| getProperty |
setProperty |
| getType |
setType |
| getValue |
setValue |
|
|
|
| getFrequency |
reset |
| getInvert |
setFrequency |
| getLevel |
setInvert |
| getUseNegPulseMode |
setLevel |
| getUsePosPulseMode |
setUseNegPulseMode |
| isPositive |
setUsePosPulseMode |
| isTriggered |
---------- |
|
|
|
| getExecutePriority |
setExecutePriority |
| getOwner |
---------- |
|
|
getProperty
getProperty()
Returns the name of the property that triggers the sensor.
Return type: string
Sample
Code
# get the controller
controller = GameLogic.getCurrentController()
# get property sensor named sensor attached to the controller
sen = controller.getSensor("sensor")
# get property that triggers sensor
prop = sen.getProperty()
getType
getType()
Returns the condition that must be met to trigger the sensor.
Return type: integer
1 = Equal
2 = Not Equal
3 = Interval
4 = Changed
Sample
Code
# get the controller
controller = GameLogic.getCurrentController()
# get property sensor named sensor attached to the controller
sen = controller.getSensor("sensor")
# get type that triggers sensor
type = sen.getType()
getValue
getValue()
Returns the value the sensor is looking for.
Return type: string
Sample
Code
# get the controller
controller = GameLogic.getCurrentController()
# get property sensor named sensor attached to the controller
sen = controller.getSensor("sensor")
# get value sensor looks for
val = sen.getValue()
setProperty
setProperty(name)
Sets the property that triggers the sensor.
name:
Type:
string
Note:
Property must already exist (added using object's Add
Property button).
If property doesn't already exist, setProperty will be
ignored.
Sample
Code
# get the controller
controller = GameLogic.getCurrentController()
# get property sensor named sensor attached to the controller
sen = controller.getSensor("sensor")
# set property that triggers sensor
sen.setProperty("Health")
setType
setType(checktype)
Sets the type of condition that must be met to trigger the sensor
checktype:
Type: integer
1 = Equal
2 = Not Equal
3 = Interval
4 = Changed
Sample
Code
# get the controller
controller = GameLogic.getCurrentController()
# get property sensor named sensor attached to the controller
sen = controller.getSensor("sensor")
# set type to Changed
sen.setType(4)
setValue
setValue(value)
Sets the value the sensor is looking for.
value:
Type:
string
Sample
Code
# get the controller
controller = GameLogic.getCurrentController()
# get property sensor named sensor attached to the controller
sen = controller.getSensor("sensor")
# set value to 10
sen.setValue("10")
|