I just got use of predefined animations working in pyprp.
But let me start by giving a current status update:
- Drawablespans rewrite - complete
- Physical rewrite - complete
- resmanager rewrite - virtually complete
- logical scripting support - pretty well done
- camera regions - broken atm
- swim regions - broken atm
One of the pieces in that list is "logical scripting support" - basically it's an advanced way of creating sets of logic objects for uru, and link them to a python script, or other actions. That's the one that also does the animations.
Until now, such support has always been minimal - examples of it are the basic support for clickable regions - that didn;t allow for much flexibility when interfacing with already existing classes, and the footstep sound that was a very rough implementation of the system.
Of course, the logic scripting must be done in alcscript.
A few working examples of the code:
Code to make a footstep region like cyan does:
- Code: Select all
RgnFootstepSfxMetal:
logic:
modifiers:
- tag: Enter
flags:
- multitrigger
activators:
- type: objectinvolume
triggers:
conditions:
- type: volumesensor
direction: enter
actions:
- type: responder
ref: /
- tag: Exit
flags:
- multitrigger
activators:
- type: objectinvolume
triggers:
conditions:
- type: volumesensor
direction: exit
actions:
- type: responder
ref: /
actions:
- type: responder
responder:
states:
- cmds:
- type: armatureeffectmsg
params:
surface: stone
append: false
waiton: -1
nextstate: 0
waittocmd: 0
curstate: 0
flags:
- detect_trigger
The more knowledgable readers may notice that this code actually builds up a respondermodifier and messages according to given specifications.
Code to link an object to simple SDL:
- Code: Select all
Gate:
logic:
actions:
- type: pythonfile
pythonfile:
file: xAgeSDLBoolShowHide
parameters:
- type: string
value: GateVis
- type: bool
value: True
As you can see, you can customize the python arguments that are used
A region that starts a oneshot animation when you enter it (with the objects own origin as the seekpoint):
- Code: Select all
OneShotTest:
logic:
modifiers:
- tag: Detect
flags:
- multitrigger
activators:
- type: objectinvolume
triggers:
- enter
conditions:
- type: volumesensor
direction: enter
actions:
- type: oneshot
ref: /
actions:
- type: oneshot
oneshot:
animation: PushButton
Yes - this means that doing the buttonpress and other animations is finally possible
Code for a clickregion:
- Code: Select all
GateButton:
logic:
modifiers:
- cursor: poised
flags:
- localelement
activators:
- type: objectinvolume
remote: GateBtnRegion
triggers:
- any
conditions:
- type: activator
activators:
- type: picking
- type: objectinbox
satisfied: true
actions:
- type: pythonfile
ref: /
- type: oneshot
ref: :OneShotButtonPush
actions:
- type: pythonfile
pythonfile:
file: FuncChk01Clickables
parameters:
- type: activator
ref: logicmod:/
- type: string
value: GateButton
- type: behavior
ref: oneshotmod:OneShotButtonPush
A bit more complex, as it also refers to the oneshot mod defined below, though references
Code for a simple one shot mod - the object on which it is defined is the seekpoint:
- Code: Select all
OneShotClickBtn:
logic:
actions:
- type: oneshot
name: OneShotButtonPush
oneshot:
animation: DoorButtonTouch
seektime: 1.0
I don't have time to explain it in detail at the moment, but perhaps it helps to wet the appetite of some of the more knowledgable writers