Page 3 of 10

Re: Lost with Python

Posted: Mon May 05, 2008 12:16 pm
by andylegate
crud,...

I just copied the script D'Lanor provided Valdez, and now my Age won't export! I keep getting a ALCscript error.......

Re: Lost with Python

Posted: Mon May 05, 2008 2:42 pm
by andylegate
Hmmmm....well the error went away......

But my cursor still won't go hot....my door button that I did in the past still works, but I can't get my other sound clickables to work.....

I even tried using the quickscript method, and just made a dummy python file.....

sucks to as this is holding me up big time.

Re: Lost with Python

Posted: Mon May 05, 2008 5:08 pm
by D'Lanor
Remember how that door button code would eat my cursor? I never got that to work. There is something weird going on with clickables.

Just an idea but maybe you could try to delete this part:

Code: Select all

              - type: facing
                satisfied: true
                directional: true


I added it because it is in the quickscript. This should make the hotspot available only when the avatar is facing the clickable object but it does not seem work anyway.


btw, here is a test version of the simple clickable quickscript function which makes all parameters independent. Now you can have only the sound or only the avatar animation. There is also a new parameter called autorun. You can set this to "true" to skip the behavior pythonfilemod:

Code: Select all

            autorun: true


I have not had time to thoroughly test this. If you feel brave you can install this file in your scripts folder (after making a backup of the existing file) and try it out. Please report back your results here.

*file removed, see newer test version*

Re: Lost with Python

Posted: Mon May 05, 2008 5:39 pm
by andylegate
Sure, why not?

I tried removing that directional thingy part......made no difference. I've tried your code, the door code, and like I said, I even tried the quickscript using a dummy python file.....but still the same result: no hot cursor, yet the door one works everytime.

I'll give this a swing real quick and see what happens.

Re: Lost with Python

Posted: Mon May 05, 2008 5:47 pm
by andylegate
Ooooo.....got a major error upon export. Let's see if I'm putting the ALCscript in right:

Code: Select all

crystal1:
    physical:
        pinned: true
    quickscript:
        simpleclick:
            region: toneclk1
            soundemitter: tone1


Re: Lost with Python

Posted: Mon May 05, 2008 9:58 pm
by D'Lanor
Nothing wrong with the alcscript. The test version is supposed to handle that, but what is the error?

Re: Lost with Python

Posted: Tue May 06, 2008 3:28 am
by andylegate
Lets see, here is what the console said:

Code: Select all

 

  [QuickScript - Simple Clickable]
Traceback (most recent call last):
  File "<string>", line 174, in open_file
  File "<string>", line 88, in export_age
  File "C:\Program Files\Blender Foundation\Blender\.blender\scripts\alcresmanag
er.py", line 311, in export_all
    RunQuickScripts(obj)
  File "C:\Program Files\Blender Foundation\Blender\.blender\scripts\alc_QuickSc
ripts.py", line 68, in RunQuickScripts
    result |= QuickScript_SimpleClickable(obj)
  File "C:\Program Files\Blender Foundation\Blender\.blender\scripts\alc_QuickSc
ripts.py", line 466, in QuickScript_SimpleClickable
    acttxt += "- type: responder\n"
UnboundLocalError: local variable 'acttxt' referenced before assignment


EDIT: Wait! Wait!, upon closer inspection, I realize that it's not talking about your script, but gets this on a different object (meaning that I don't think yours is giving me the error, but the other ones I hadn't changed are.). I'll have to change the other quickly and see what happens.

EDIT AGAIN: Nope. I get this error even with all the Crystals set that way.

Re: Lost with Python

Posted: Tue May 06, 2008 4:02 am
by D'Lanor
Yes, that must be my modification. It wasn't as simple as I thought. I did say it was untested, right? :oops:

Edit: Ok, found the error. Should be easy to fix.

Re: Lost with Python

Posted: Tue May 06, 2008 4:22 am
by andylegate
Ahhhh. Good, glad I could help! Just wish I could of had it before I released Zephyr yesterday.

Re: Lost with Python

Posted: Tue May 06, 2008 4:42 am
by D'Lanor
Ok, you can try this one if you want.

Edit: *old file removed*

Note that I am still in the process of testing the different combinations myself.

Edit: Testing done with different combinations and all was well (but feel free to try and break it).

- Old quickscripts work the same as before
- New combinations without the Python file are now possible
- The avatar animation can either run automatically or start through Python

I made one last minute change to exclude the nonsense combination "autorun: false" without a Python file, which produces a oneshotmod that never starts. So now if you have no Python file autorun is always forced to true. If you specify a Python file autorun defaults to false (preserving old behavior) but can be set to true.

New file:
alc_QuickScripts_3.zip


I will add this to the SVN contrib later today if nobody finds any flaws.