Some stats: It required 268 lines of Python code to reduce the logic Alcscript of 149 lines to 19 lines of quickscript. Needless to say, there could be a bug hiding somewhere in those 268 lines so I would like to have this tested before I submit it.
- Code: Select all
<clickable object>:
quickscript:
stateanimation:
objectname: <animated object>
region: <clickable region>
sdlname: <sdl variable>
avatar:
animation: <avatar animation> #optional
animtarget: <avatar animation target> #optional
forewards:
animation: <opening animation>
animsound: <opening sound emitter> #optional
clickanim: <clickable opening animation> #optional
clicksound: <clickable opening sound emitter> #optional
backwards:
animation: <closing animation> #will be reversed if same as forewards
animsound: <closing sound emitter> #optional, can be same as forewards
clickanim: <clickable closing animation> #optional, can be same as forewards
clickreverse: <true | false> #optional, reverses clickanim if same as forewards, default=false
clicksound: <clickable closing sound emitter> #optional, can be same as forewards
In order for the above script to work you must install prp_QuickScripts.py from the SVN trunk: http://svn.guildofwriters.com/pyprp/tru ... Scripts.py
Edit: Yep, there was a bug. I have replaced the attached file. I have also implemented di gama's suggestion.
And you no longer have to write the logic script for the avatar animation target. The quickscript will handle that now. It will create the script below if a oneshotmod with this name does not exist yet.
- Code: Select all
<avatar animation target>:
logic:
actions:
- type: oneshot
name: <avatar animation target>
oneshot:
animation: <avatar animation>
As a note of interest, contrary to the wiki example the scripting is placed under the clickable object. So the animated object only needs the animation scripting.
Edit: pointed the download to the SVN trunk.