Visible (Conditional) Objects?

If you feel like you're up to the challenge of building your own Ages in Blender or 3ds Max, this is the place for you!

Re: Visible (Conditional) Objects?

Postby D'Lanor » Thu Jul 03, 2008 11:32 am

Here is the basic principle. All you have to add to the pythonfilemod is a third parameter for the scene object:

Code: Select all
                  - type: sceneobject
                    ref: scnobj:<object name>


And catch it in the Python code like this:

Code: Select all
MyObj = ptAttribSceneobject(3, 'My Scene Object')
"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: Visible (Conditional) Objects?

Postby Nadnerb » Thu Jul 03, 2008 11:36 am

been busy with the whole MORE conference thing. I'll see if I can get that script tested today if I don't have to leave play in the parade first. :roll: The parade of things to do never ends. :P
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: Visible (Conditional) Objects?

Postby boblishman » Fri Jul 04, 2008 4:51 pm

that would be great Nadnerb ...I know how busy you are ... but a working Alcscript would be a godsend!
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: Visible (Conditional) Objects?

Postby boblishman » Sat Jul 05, 2008 6:28 am

ok... now, embarrasment time for me ... :oops:

Seems that I had multiple scripts folders (due to Vista and the new Blender install) ... I have now got a "clean" install of Blender (and therefore a true (single) scripts folder) and the new "nightly" plugin (1.5.0) ... and your Alcscript now WORKS!! (Thanks Nadnerb, sorry about the confusion) ... :oops:
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: Visible (Conditional) Objects?

Postby boblishman » Sat Jul 05, 2008 7:14 pm

Now, (with the 1.5.0. plugin, well, actualy the "nightly") ... the script DOES work ... BUT ... (why is there always a "but" ? ) ... the object is visible when I first link into the Age (presumably because it hasn't been triggered by the region and it's default state is "drawable").

As soon as I enter the region and then leave ... it becomes invisible (though it still has it's physical bounds - which I quite like actually ... ;) ).

When I re-enter the region, it appears again ... and dissapears when I leave (exactly what I want it to do).

Now, ... can I add something to the Aclscript to set the object to "invisible" as it's "initial" state when I link into the Age ?
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: Visible (Conditional) Objects?

Postby Nadnerb » Sat Jul 05, 2008 7:49 pm

Good to hear! :D

(and yay, I don't have to test my script, only to tell you that it works for me. :P)

As for making it vanish on link in... You could make a region on your link in point that has a responder that disables the draw as soon as you link in, and then disables itself. (happens to be exactly what the region this code was taken from does) Hold on while I whip together an example.

Edit: Code:
Code: Select all
<region object>:
    logic:
        modifiers:
          - name: <logic name>
            flags:
             - multitrigger
            activators:
             - type: objectinvolume
            conditions:
             - type: volumesensor
               satisfied: true
               direction: enter
            actions:
             - type: responder
               ref: :<responder name>
        actions:
          - type: responder
            name: <responder name>
            responder:
               states:
                - cmds:
                   - type: enablemsg
                     params:
                        receivers:
                         - scnobj:<disabled object name>
                        cmds:
                         - drawable
                         - disable
                     waiton: -1
                   - type: enablemsg
                     params:
                        receivers:
                         - 002D:<logic name>
                        cmds:
                         - disable
                     waiton: -1
                  nextstate: 1
                  waittocmd: 0
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: Visible (Conditional) Objects?

Postby Erik » Sun Jul 06, 2008 2:53 am

Nadnerb wrote:As for making it vanish on link in... You could make a region on your link in point that has a responder that disables the draw as soon as you link in, and then disables itself. (happens to be exactly what the region this code was taken from does) Hold on while I whip together an example.

Now I'm wondering, did Cyan use that method as well for their Ages to hide things? I just had to think of the everything-on bug that happened sometimes. :)
User avatar
Erik
 
Posts: 124
Joined: Wed Oct 03, 2007 7:49 am
Location: the Netherlands

Re: Visible (Conditional) Objects?

Postby boblishman » Sun Jul 06, 2008 3:58 am

Thanks Nadberb ....works like a DREAM! ... 8-)

(I have two link in points so I created two regions - one for each link in point - but using the same login name and responder name in both.)

This is excellent!! Thank you!
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: Visible (Conditional) Objects?

Postby D'Lanor » Sun Jul 06, 2008 4:12 am

Erik wrote:Now I'm wondering, did Cyan use that method as well for their Ages to hide things? I just had to think of the everything-on bug that happened sometimes. :)

No, they use SDL states. Which is the preferred method in a multiplayer environment.

This is a highly unusual method and it remains yet to be seen how it will hold up online. Does this object show up for all players or only for the player inside the region? With the Python/SDL method that would be easy to control. With this method... I have no idea.

Perhaps Nadnerb can explain how netforcing or netpropagation is controlled with alcscript?
"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: Visible (Conditional) Objects?

Postby Nadnerb » Sun Jul 06, 2008 11:34 am

I said from the start it was a hack that I came up with because I couldn't just tell him to use visregions. :P

Think of it like you would using python to animate things. Works in a pinch if you're impatient, but there's another feature that was actually made for what you're doing.
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)

Previous

Return to Building

Who is online

Users browsing this forum: No registered users and 3 guests

cron