Lost with Python

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

Lost with Python

Postby Valdez » Sat May 03, 2008 6:23 am

Well, Python has once again left me clueless. :cry: I don't even know how to start a Python file let alone coding it. Right now I am just working on clickable objects with the writer's tutorial. But now it seems I need a new python file. I have Python 2.5 installed, I just don't know where to begin. Can someone please help me or lead me to some inforamtion on this? I would REALLY appriciate it. :)
Fighting, Horrible disposition to others based on beliefs... What's the point anymore? Was there ever a point? Dead is what it is and always will be until peace is achieved through everyone.
User avatar
Valdez
 
Posts: 106
Joined: Fri Jan 04, 2008 4:44 pm

Re: Lost with Python

Postby Goofy » Sat May 03, 2008 9:41 am

I know where your coming from. Everytime I even look at python I get a headache. Trying to remember where everything goes or to put what in what file makes my head spin. I just decided to get my modeling and texturing down first then if that doesn't melt my brain(which its getting close to) I'd give the coding part a try.
We keep moving forward,
openning up new doors and doing new things,
Because we're curious... and curiosity keeps
leading us down new paths

Walt Disney

Keep moving forward
Goofy
 
Posts: 162
Joined: Mon Oct 01, 2007 8:51 pm

Re: Lost with Python

Postby andylegate » Sat May 03, 2008 10:34 am

There are several ways you can go about it, but first: it depends on why you need the Python in the first place. In other words: What are you trying to do?

Have a journal work?
Have a linking book work?
Have an object move?
Trying to do something with cameras?

You can come here and ask someone if they have a python file that will do these things. If you are looking into Journals and Linking books, I recommend D'Lanor's Template. The files are already coded for you, you just have to go in and change certain things in it, and D'Lanor shows you where in the template.

Other things are a bit more difficult, but there are many, many people on here that would be glad to help you, if you but ask.
"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 Valdez » Sat May 03, 2008 6:24 pm

Ok then, what I am trying to do is have a clickable button that when pressed triggers a NPC voice. I already know how to set up emitters and I know how to do that part but I don't know what the code means by 'pythonfile:' I do know it is asking me for a .py file, but I do not know how to create or how to set it up and WHAT to code to trigger stuff. Is it actually nessasary to have a Python file (besides the optional character animation) for a button that triggers a .ogg? I would really appriciate it if you could help me. :D And I can give any extra information if I did not give you enough since I seem to never do that. ;)

Thanks,

Valdez :geek:
Fighting, Horrible disposition to others based on beliefs... What's the point anymore? Was there ever a point? Dead is what it is and always will be until peace is achieved through everyone.
User avatar
Valdez
 
Posts: 106
Joined: Fri Jan 04, 2008 4:44 pm

Re: Lost with Python

Postby andylegate » Sat May 03, 2008 6:57 pm

A clickable needs a Python file, IF you are using python to do something. Technically, if all you are doing is having a button that clicks, with avatar animation, and a sound played, and that's ALL, you don't NEED a python file at all. All you need is ALCscripting!

You would use a python file to say....delay the sound, or move the button, or to have that action make a mesh move (because right now the only way to get meshes to move is with a python file).

But if all you are doing is having a sound play, then, no you don't need a python file at all. Just remove that part from the ALCscripting, and you should be fine.
"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 Valdez » Sat May 03, 2008 8:11 pm

Well, it exported correctly but it isn't clickable. I know I put all the alcscript in right and I postitioned it right. I have been checking my work with the tutorial and it seems to be right. I checked the post earliar about things not being clickable, but he was using python. Will I need it after all? And what are some common things to look out for? If you must see my AlcScript for it here it is:

Code: Select all
# insert AlcScript code here

FootStepRgn_grass:
   type: region
   regiontype: footstep
   surface: grass
      
Button_Decals:
   physical:
      pinned: true
   quickscript:
      simpleclick:
         region: Decal_Rgn_click
            
Button_Decals:
   physical:
      pinned: true
   quickscript:
      simpleclick:
         region: Decal_Rgn_click
         soundemitter: sound_emit_decals
            
sound_emit_decals:
   type: soundemit
   sound:
      file: DecalKate
       volume: 1.0
      type: NPCVoices


Is there something wrong there? If you need anymore information, like always, I will give it to you.

Thanks,

Valdez :geek:
Fighting, Horrible disposition to others based on beliefs... What's the point anymore? Was there ever a point? Dead is what it is and always will be until peace is achieved through everyone.
User avatar
Valdez
 
Posts: 106
Joined: Fri Jan 04, 2008 4:44 pm

Re: Lost with Python

Postby Trylon » Sat May 03, 2008 11:53 pm

I see you have "Button_Decals" declared twice. I don't know how that affects the script processing, but iit is quite possible that it only looks at the first declaration, which is not set to trigger a soundregion.

Code: Select all
Button_Decals:
   physical:
      pinned: true
   quickscript:
      simpleclick:
         region: Decal_Rgn_click
           
Button_Decals:
   physical:
      pinned: true
   quickscript:
      simpleclick:
         region: Decal_Rgn_click
         soundemitter: sound_emit_decals
One day I ran through the cleft for the fiftieth time, and found that uru held no peace for me anymore.
User avatar
Trylon
 
Posts: 1446
Joined: Fri Sep 28, 2007 11:08 pm
Location: Gone from Uru

Re: Lost with Python

Postby Valdez » Sun May 04, 2008 4:47 am

Oh! I have to bind the sound emitter with the first one! :oops: I see. Well I am going to see if that works.
Fighting, Horrible disposition to others based on beliefs... What's the point anymore? Was there ever a point? Dead is what it is and always will be until peace is achieved through everyone.
User avatar
Valdez
 
Posts: 106
Joined: Fri Jan 04, 2008 4:44 pm

Re: Lost with Python

Postby Valdez » Sun May 04, 2008 5:25 am

It was probably good I got rid of it and you were right about it not mattering for it still is not clickable. This is what my screen looks like in Blender, parts of the button have been listed for your convienience. ;)

http://www.photoshack.com/displayimage.php?pid=13554&fullsize=1

Is there anything modeled incorrectly? If you need to see another view I can happily put it on here. And also, what are some common problems for buttons that arn't clickable?
Fighting, Horrible disposition to others based on beliefs... What's the point anymore? Was there ever a point? Dead is what it is and always will be until peace is achieved through everyone.
User avatar
Valdez
 
Posts: 106
Joined: Fri Jan 04, 2008 4:44 pm

Re: Lost with Python

Postby D'Lanor » Sun May 04, 2008 6:17 am

The most common problem is probably when people forget to make the clickable an actor.
"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

Next

Return to Scripting

Who is online

Users browsing this forum: No registered users and 5 guests