- Code: Select all
Button:
quickscript:
simpleclick:
pythonfile: "SwapButton"
region: "ButtonRegion"
animation: "DoorButtonTouch"
animtarget: "Button"
Here is the relevant part of the export logfile:
- Code: Select all
[QuickScript - Simple Clickable]
Resulting Code for .logic.modifiers:
- tag: AutoClick
cursor: poised
flags:
- localelement
activators:
- type: objectinvolume
remote: ButtonRegion
triggers:
- any
conditions:
- type: activator
activators:
- type: picking
- type: objectinbox
satisfied: true
actions:
- type: pythonfile
ref: $AutoClick
Resulting Code for .logic.actions:
- type: pythonfile
tag: AutoClick
pythonfile:
file: SwapButton
parameters:
- type: activator
ref: logicmod:$AutoClick
- type: string
value: Button
- type: behavior
ref: oneshotmod:$AutoClick
- type: oneshot
tag: AutoClick
oneshot:
animation: DoorButtonTouch
seektime: 1.0
remote: Button
Quickscripted Button
To: {'quickscript': {'simpleclick': {'region': 'ButtonRegion', 'animation': 'DoorButtonTouch', 'animtarget': 'Button', 'pythonfile': 'SwapButton'}}, 'logic': {'modifiers': [{'cursor': 'poised', 'tag': 'AutoClick', 'flags': ['localelement'], 'activators': [{'type': 'objectinvolume', 'remote': 'ButtonRegion', 'triggers': ['any']}], 'conditions': [{'activators': [{'type': 'picking'}], 'type': 'activator'}, {'type': 'objectinbox', 'satisfied': True}], 'actions': [{'type': 'pythonfile', 'ref': '$AutoClick'}]}], 'actions': [{'tag': 'AutoClick', 'type': 'pythonfile', 'pythonfile': {'file': 'SwapButton', 'parameters': [{'type': 'activator', 'ref': 'logicmod:$AutoClick'}, {'type': 'string', 'value': 'Button'}, {'type': 'behavior', 'ref': 'oneshotmod:$AutoClick'}]}}, {'type': 'oneshot', 'oneshot': {'seektime': 1.0, 'remote': 'Button', 'animation': 'DoorButtonTouch'}, 'tag': 'AutoClick'}]}, 'physical': {'physlogic': 'detect'}}
[Region Object ButtonRegion]
Region type: unknown
[LogicHelper]
No actions in list
None
Exporting modifiers
No modifiers
None
[Physical]
HullBounds export
Exporting 8 (8) vertices
Setting Region-Specific settings....
Object is Dynamic
[Coordinate Interface ButtonRegion]
[Visual Object Button]
[LogicHelper]
Exporting actions
[PythonFileMod Button_AutoClick]
For python file mod Button_AutoClick, index 1 we're exporting value type 7, key string logicmod:$AutoClick
Key string boiled down to: 00029B23,0000,002D,Button_AutoClick
For python file mod Button_AutoClick, index 3 we're exporting value type 14, key string oneshotmod:$AutoClick
Key string boiled down to: 00029B23,0000,0077,Button_AutoClick
[OneShotMod Button_AutoClick]
Exporting modifiers
Exporting modifiers
[LogicModifier Button_AutoClick]
Initial self.fFlags is: BitVector: []
Got flag: localelement - 0
self.fFlags is now: BitVector: [ 1]
Conditions:
Found Condition Button_AutoClick of type: activator
Found Activator Button_AutoClick of type: picking
Found Condition Button_AutoClick of type: objectinbox
Activators:
Found Activator Button_AutoClick of type: objectinvolume
Actions:
[{'type': 'pythonfile', 'ref': '$AutoClick'}]
Action is of type pythonfile
Locating python file reference '$AutoClick'
Appending Receiver: 00029B23,0000,00A2,Button_AutoClick
[Draw Interface Button]
[Material MatButton]
[DrawableSpans 00000000_0]
Processing Faces per Material - Totalling 1 materials
Material MatButton
Object is Shadeless, not appending any lamps
[ShadowCaster]
[Physical]
HullBounds export
Exporting 66 (66) vertices
Mass 1.0
No Friction, disabling frictive setting
No Elasticity set
Pinning object
Camera blocking enabled
Object is Dynamic
[Coordinate Interface Button]
If I leave out the animtarget the region (ButtonRegion) becomes the target. That would have been fine by me had it worked, but still no go. (I was going to tweak the target position later anyway if needed)
Does oneshotmod work in PyPRP 1.2.1? And if it does, what am I doing wrong?