Lost with Python

Help bring our custom Ages to life! Share tips and tricks, as well as code samples with other developers.

Re: Lost with Python

Postby andylegate » Mon May 05, 2008 12:16 pm

crud,...

I just copied the script D'Lanor provided Valdez, and now my Age won't export! I keep getting a ALCscript error.......
"I'm still trying to find the plKey for Crud!"
Image
Blender Age Creation Tutorials
3DS Max Age Creation Tutorials
User avatar
andylegate
 
Posts: 2348
Joined: Mon Oct 01, 2007 7:47 am

Re: Lost with Python

Postby andylegate » Mon May 05, 2008 2:42 pm

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.
"I'm still trying to find the plKey for Crud!"
Image
Blender Age Creation Tutorials
3DS Max Age Creation Tutorials
User avatar
andylegate
 
Posts: 2348
Joined: Mon Oct 01, 2007 7:47 am

Re: Lost with Python

Postby D'Lanor » Mon May 05, 2008 5:08 pm

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*
Last edited by D'Lanor on Tue May 06, 2008 4:38 am, edited 1 time in total.
"It is in self-limitation that a master first shows himself." - Goethe
User avatar
D'Lanor
 
Posts: 1980
Joined: Sat Sep 29, 2007 4:24 am

Re: Lost with Python

Postby andylegate » Mon May 05, 2008 5:39 pm

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.
"I'm still trying to find the plKey for Crud!"
Image
Blender Age Creation Tutorials
3DS Max Age Creation Tutorials
User avatar
andylegate
 
Posts: 2348
Joined: Mon Oct 01, 2007 7:47 am

Re: Lost with Python

Postby andylegate » Mon May 05, 2008 5:47 pm

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

"I'm still trying to find the plKey for Crud!"
Image
Blender Age Creation Tutorials
3DS Max Age Creation Tutorials
User avatar
andylegate
 
Posts: 2348
Joined: Mon Oct 01, 2007 7:47 am

Re: Lost with Python

Postby D'Lanor » Mon May 05, 2008 9:58 pm

Nothing wrong with the alcscript. The test version is supposed to handle that, but what is the error?
"It is in self-limitation that a master first shows himself." - Goethe
User avatar
D'Lanor
 
Posts: 1980
Joined: Sat Sep 29, 2007 4:24 am

Re: Lost with Python

Postby andylegate » Tue May 06, 2008 3:28 am

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.
"I'm still trying to find the plKey for Crud!"
Image
Blender Age Creation Tutorials
3DS Max Age Creation Tutorials
User avatar
andylegate
 
Posts: 2348
Joined: Mon Oct 01, 2007 7:47 am

Re: Lost with Python

Postby D'Lanor » Tue May 06, 2008 4:02 am

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.
"It is in self-limitation that a master first shows himself." - Goethe
User avatar
D'Lanor
 
Posts: 1980
Joined: Sat Sep 29, 2007 4:24 am

Re: Lost with Python

Postby andylegate » Tue May 06, 2008 4:22 am

Ahhhh. Good, glad I could help! Just wish I could of had it before I released Zephyr yesterday.
"I'm still trying to find the plKey for Crud!"
Image
Blender Age Creation Tutorials
3DS Max Age Creation Tutorials
User avatar
andylegate
 
Posts: 2348
Joined: Mon Oct 01, 2007 7:47 am

Re: Lost with Python

Postby D'Lanor » Tue May 06, 2008 4:42 am

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.
"It is in self-limitation that a master first shows himself." - Goethe
User avatar
D'Lanor
 
Posts: 1980
Joined: Sat Sep 29, 2007 4:24 am

PreviousNext

Return to Scripting

Who is online

Users browsing this forum: No registered users and 1 guest