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 Valdez » Sun May 04, 2008 6:50 am

Well my clickable and my bound are both set as actors. Is there anything else? Like logic properties in the logic panel?
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 » Sun May 04, 2008 7:16 am

Make sure that you have bounds set for your clickable object too. I'd make your click region a bit bigger, it looks like it just barely can contain the avie.

Check for mispellings in your ALCscript.

You have a sound emitter, that's good. I would add some flags to it in your script, like making it a 3D sound.

Make sure that if you change after you change the size and position of both the click region and the object that is the clickable, you give them a new center, and you use Cntl-A. I've had clickables not work because of that.

When asking us for help, make sure you tell us the following:

Is your cursor turning "hot" when you move your mouse over the object?
"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 » Sun May 04, 2008 7:46 am

I made the bound larger, reset the centerpoints and double checked my AlcScript and it still doesn't work. What I mean by not clickable is there is no hotspot on the button. There is bounds set to the clickable object and it is an actor, same for the clickable region. I made my sound emitter a 3D one but I can't hear it until the button 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 D'Lanor » Sun May 04, 2008 3:19 pm

It is not your fault. I checked the quickscript and it is set up in a way that makes the pythonfile required. We seem to have forgotten that this quickscript was originally made for calling Python files.

There is another way to make this work though. You have to write out the full logic script like this:

Code: Select all
Button_Decals:
    physical:
        pinned: true
    logic:
        modifiers:
          - tag: AutoClick
            cursor: poised
            flags:
              - localelement
            activators:
              - type: objectinvolume
                remote: Decal_Rgn_click
                triggers:
                  - any
            conditions:
              - type: activator
                activators:
                  - type: picking
              - type: objectinbox
                satisfied: true
              - type: facing
                satisfied: true
                directional: true
            actions:
              - type: responder
                ref: $SoundResp
        actions:
          - type: responder
            tag: SoundResp
            responder:
              states:
                - cmds:
                    - type: soundmsg
                      params:
                          receivers:
                            - 0011:sound_emit_decals
                          cmds:
                            - play
                            - setvolume
                          volume: 1
                      waiton: -1
                  nextstate: 0
                  waittocmd: 0
              curstate: 0
              flags:
                - detecttrigger
"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 » Sun May 04, 2008 3:47 pm

Ah! This explains why my stuff is working okay. I had remembered that you (D'Lanor) had simplified this and told me about it, but by the time I was ready to do other clickables, I couldn't find it right away, so I just copied and pasted that long logic version we first came up with!!!....I assumed that the new one was a done deal.
"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 » Sun May 04, 2008 3:53 pm

The sound I added to the quickscript is a done deal, but the whole thing only works if there is a pythonfile. If no pythonfile is given it just quits. I did not change anything in the original way this was set up.
"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 Valdez » Sun May 04, 2008 4:38 pm

Thanks a bunch D'Lanor! :D :D :D My buttons work perfectly! My training age is back on track! WOOT! :D :D
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 Nadnerb » Sun May 04, 2008 6:47 pm

This has come up every time someone has tried to use the simpleclick quickscript, and almost every time it has resulted in them setting up the full logic mod manually. Is this not a good indicator that the quickscript should be set up to not require a python file? :? (The real question: is anyone actually using the quickscript in it's current form that would object to it's being changed?)
Image
Live KI: 34914 MOULa KI: 23247 Gehn KI: 11588 Available Ages: TunnelDemo3, BoxAge, Odema
Nadnerb
 
Posts: 1057
Joined: Fri Sep 28, 2007 8:01 pm
Location: US (Eastern Time)

Re: Lost with Python

Postby boblishman » Mon May 05, 2008 2:15 am

D'Lanor wrote:There is another way to make this work though. You have to write out the full logic script like this:

Code: Select all
Button_Decals:
    physical:
        pinned: true
    logic:
        modifiers:
          - tag: AutoClick
            cursor: poised
            flags:
              - localelement
            activators:
              - type: objectinvolume
                remote: Decal_Rgn_click
                triggers:
                  - any
            conditions:
              - type: activator
                activators:
                  - type: picking
              - type: objectinbox
                satisfied: true
              - type: facing
                satisfied: true
                directional: true
            actions:
              - type: responder
                ref: $SoundResp
        actions:
          - type: responder
            tag: SoundResp
            responder:
              states:
                - cmds:
                    - type: soundmsg
                      params:
                          receivers:
                            - 0011:sound_emit_decals
                          cmds:
                            - play
                            - setvolume
                          volume: 1
                      waiton: -1
                  nextstate: 0
                  waittocmd: 0
              curstate: 0
              flags:
                - detecttrigger


A quick question D'Lanor ... is there a way to add an animation to this Alcscript - so that it doesn't need a python file ... ?
(My idea is to have a button to click, the avatar presses it, it makes a sound like it's not working (just a click noise) ... but doesn't actually make anything move
(i.e. - it's "broken" - or has no "power" - at the moment ;))
when it comes to Age creation ... "DOH" seems to be my middle name...
User avatar
boblishman
 
Posts: 882
Joined: Fri Oct 05, 2007 4:47 pm
Location: Spain

Re: Lost with Python

Postby D'Lanor » Mon May 05, 2008 4:31 am

Nadnerb wrote:This has come up every time someone has tried to use the simpleclick quickscript, and almost every time it has resulted in them setting up the full logic mod manually. Is this not a good indicator that the quickscript should be set up to not require a python file? :? (The real question: is anyone actually using the quickscript in it's current form that would object to it's being changed?)

Yes, I am using the quickscript in its current form. Not that I personally would mind writing out the full logic script but if this is going to change it should remain compatible with people's current alcscripts. Too many things have already been broken in the past by updates.

It would be good to make all parameters optional and independent.

Also the oneshotmod should be set up so that you can choose to either feed it through Python or run it directly (although I would still recommend the Python method for multiplayer compatibility).

A quick question D'Lanor ... is there a way to add an animation to this Alcscript - so that it doesn't need a python file ... ?

Yes. I will show you when I get home from work if someone does not beat me to it.

Edit: Here you go.

Code: Select all
<clickable>:
    logic:
        modifiers:
          - tag: AutoClick
            cursor: poised
            flags:
              - localelement
            activators:
              - type: objectinvolume
                remote: <region>
                triggers:
                  - any
            conditions:
              - type: activator
                activators:
                  - type: picking
              - type: objectinbox
                satisfied: true
              - type: facing
                satisfied: true
                directional: true
            actions:
              - type: responder
                ref: $SoundResp
              - type: oneshot
                ref: $ClickAnim
        actions:
          - type: oneshot
            tag: ClickAnim
            oneshot:
                animation: <animation name>
                seektime: <time in seconds>
                remote: <animation target>
          - type: responder
            tag: SoundResp
            responder:
              states:
                - cmds:
                    - type: soundmsg
                      params:
                          receivers:
                            - 0011:<soundemitter>
                          cmds:
                            - play
                            - setvolume
                          volume: <sound volume>
                      waiton: -1
                  nextstate: 0
                  waittocmd: 0
              curstate: 0
              flags:
                - detecttrigger
"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 0 guests