SDL and Python files
SDL and Python files
Exactly what would I put in the SDL and Python files necessary for the "stateanimation" Quickscript, and where would I put said files? The target is URU CC.
Re: SDL and Python files
I've also tried writing the Alcscript myself, using the AnimatedDoor Age as a reference, but I don't think I quite understand it yet. Cany anyone spot what's wrong with this Alcscript? I get the cursor when I hover the button, but nothing happens when I click it.
Code: Select all
OpeningWindow:
animations:
- name: WinOpenAnim
autostart: 0
loop: 0
logic:
actions:
- type: responder
name: DoorOpen
responder:
states:
- cmds:
- type: animcmdmsg
params:
receivers:
- 006D: OpeningWindow
animname: WinOpenAnim
cmds:
- setforewards
- continue
waiton: -1
nextstate: 1
waittocmd:
- key: 0
- cmds:
- type: animcmdmsg
params:
recievers:
- 006D: OpeningWindow
animname: WinOpenAnim
cmds:
- setbackwards
- continue
waiton: -1
nextstate: 0
waittocmd:
- key: 0
OpenButton:
logic:
modifiers:
- cursor: poised
flags:
- localelement
activators:
- type: objectinvolume
remote: WinClickRegion
triggers:
- any
conditions:
- type: activator
activators:
- type: picking
- type: objectinbox
satisfied: true
actions:
- type: responder
ref: :OpenWindow
- tachzusamm
- Posts: 575
- Joined: Thu May 29, 2008 2:03 am
- MOULa KI#: 0
- Location: Germany
Re: SDL and Python files
I did not look into your AlcScript closer, but first, you should get the indentation fixed.
Correct indentation is VERY IMPORTANT in AlcScript, as it is in Python.
AlcScript assumes indentation of 4 spaces per level; using tabs is okay, because a tab is converted to 4 spaces on parsing, but make sure you've set TAB size in Blender to 4 as well. Never use 2, 3, 6, or anything else. Always four.
So, please rework your indentation on the script first.
Should look like this:
The AnimatedDoor script is mostly good in indentation as a reference, althought sometimes bends the rules a bit.
Correct indentation is VERY IMPORTANT in AlcScript, as it is in Python.
AlcScript assumes indentation of 4 spaces per level; using tabs is okay, because a tab is converted to 4 spaces on parsing, but make sure you've set TAB size in Blender to 4 as well. Never use 2, 3, 6, or anything else. Always four.
So, please rework your indentation on the script first.
Should look like this:
Code: Select all
OpeningWindow: # Indent-Level 0: 0 space
animations: # Level 1: 4 spaces
- name: WinOpenAnim # Level 2: 4+2 = 6 spaces (this is an exception to normally 4+4 spaces, because list entries starting with "- " can have 2 spaces less indentation)
autostart: 0 # Level 2: 4+4 = 8 spaces
loop: 0 # Level 2: 4+4 spaces
logic: # Level 1: 4 spaces
actions: # Level 2: 8 spaces
- type: responder # Level 3: 4+4+2 spaces ("- " exception here)
name: DoorOpen # Level 3: 4+4+4 spaces
responder:
states:
- cmds: # Level 4
- type: animcmdmsg # Level 5
... (omitted the rest) ...
The AnimatedDoor script is mostly good in indentation as a reference, althought sometimes bends the rules a bit.
Re: SDL and Python files
Thanks. I'll probably use an external editor and/or make a reindentation regex.
Are there any warnings given on malfored Alcscript? Since I've got quite a few objects in my age, the Python console is truncated after export. Perhaps there's a way to pipe it to file?
Are there any warnings given on malfored Alcscript? Since I've got quite a few objects in my age, the Python console is truncated after export. Perhaps there's a way to pipe it to file?
- tachzusamm
- Posts: 575
- Joined: Thu May 29, 2008 2:03 am
- MOULa KI#: 0
- Location: Germany
Re: SDL and Python files
As far as I know, there's no warnings given; or at least they are not given back to the PyPRP part. (not really sure)
Actually, AlcScript is not a programming language. So, parsing the AlcScript just creates data structures, filled with values, depending on the indentation.
Now if you shuffle the indentation, the result may be still a valid data structure, but not what you intended.
Example:
Editing note: I forgot key names must all be lowercase. Corrected in the example.
http://www.guildofwriters.com/wiki/AlcS ... nformation
(The name of your object "OpeningWindow" ist still okay though; object names can be written with capitals)
Actually, AlcScript is not a programming language. So, parsing the AlcScript just creates data structures, filled with values, depending on the indentation.
Now if you shuffle the indentation, the result may be still a valid data structure, but not what you intended.
Example:
Code: Select all
house:
table:
box:
- cup: red
state: full
- cup: blue
state: empty
chair:
- person: me
will create a data structure with contents like this:
"In the house there's a table with a box, containing a full red cup, plus an empty blue cup" (and me sitting on a chair in the house)
but this:
house:
table:
box:
- cup: red
state: full
- cup: blue
state: empty
chair:
- person: me
would create:
"In the house there's a table with a box, containing ONLY a full red cup,
plus an empty blue cup DIRECTLY on the table, not in the box" (and me sitting on a chair)
(I hope you get the idea, and the parser can't really guess what you meant if the indentation is bad)
Editing note: I forgot key names must all be lowercase. Corrected in the example.
http://www.guildofwriters.com/wiki/AlcS ... nformation
(The name of your object "OpeningWindow" ist still okay though; object names can be written with capitals)
Re: SDL and Python files
XML FTW
Chacal
"The weak can never forgive. Forgiveness is an attribute of the strong."
-- Mahatma Gandhi
"The weak can never forgive. Forgiveness is an attribute of the strong."
-- Mahatma Gandhi
Re: SDL and Python files
Turns out it was indented correctly in Blender, but it was a mix of tabs and spaces when I copied it, so this forum mangled it.
As for the log, it is ofcourse found among the exported files, e.g. as "myage.age.log". Not sure how I managed to miss it.
As for the log, it is ofcourse found among the exported files, e.g. as "myage.age.log". Not sure how I managed to miss it.