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!

Visible (Conditional) Objects?

Postby boblishman » Wed Jul 02, 2008 12:10 pm

I know this was touched upon in THIS thread ... but what I want to do now is slightly different (and re-reading the thread hasn't really helpe ... in fact it's left me more confuded ... :oops: )

What I want to do is have an object appear ONLY when the avatar is in a region (i.e. it appears as you enter the region and dissappears when you leave the region) ...

I'm assuming it is done by making the object "conditional" ... i.e. it is a condition that the avatar is within a region before the object becomes visible?

How exactly would I do that ? Is there a quick script ? ... or does this require a python file and Alcscript ?

(as always. any help would be appreciated) ...
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 » Wed Jul 02, 2008 2:36 pm

If you set up a conditional object it would only be a very short Python script that you can trigger with a region. But it all depends how it has to work for multiple players.

The great thing about conditional objects (the ObjectnameVis SDL variables linked to the xAgeSDLBoolShowHide Python script) is that they are already set up to be synched for multiplayer purposes. If only the avatar inside the region should see the object you would be better off using the draw property of the 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 » Wed Jul 02, 2008 2:47 pm

Isn't this what visregions are for? If only someone would look at those. :roll: *looks at Nadnerb*
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 » Wed Jul 02, 2008 2:55 pm

D'Lanor wrote: If only the avatar inside the region should see the object you would be better off using the draw property of the object.


yes... that is what I want ... but HOW do I use the draw property ... in Alcscript ? (if so, a "template" aclscript 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 Nadnerb » Wed Jul 02, 2008 3:19 pm

boblishman wrote:yes... that is what I want ... but HOW do I use the draw property ... in Alcscript ? (if so, a "template" aclscript would be a godsend ... ;) )

Okay, here is a completely untested alcscript that should do what you're asking for if I did it right. Bear in mind that this is a hack and visregions would probably be better, but whatever. :P

Code: Select all
<RgnObjectName>:
    logic:
        modifiers:
          - name: EnterRgn
            flags:
             - multitrigger
            activators:
             - type: objectinvolume
            conditions:
             - type: volumesensor
               satisfied: true
               direction: enter
            actions:
             - type: responder
               ref: :ToggleDraw
          - name: ExitRgn
            flags:
             - multitrigger
            activators:
             - type: objectinvolume
            conditions:
             - type: volumesensor
               satisfied: true
               direction: exit
            actions:
             - type: responder
               ref: :ToggleDraw
        actions:
          - type: responder
            name: ToggleDraw
            responder:
               states:
                - cmds:
                   - type: enablemsg
                     params:
                        receivers:
                         - scnobj:<AffectedObjectName>
                        cmds:
                         - drawable
                     waiton: -1
                  nextstate: 1
                  waittocmd: 0
                - cmds:
                   - type: enablemsg
                     params:
                        receivers:
                         - scnobj:<AffectedObjectName>
                        cmds:
                         - drawable
                         - disable
                     waiton: -1
                  nextstate: 0
                  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 andylegate » Wed Jul 02, 2008 4:05 pm

Visregions? Did someone say-?

Oh....aw man. got my hopes up there for a sec Nad! :P
"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: Visible (Conditional) Objects?

Postby boblishman » Wed Jul 02, 2008 4:11 pm

thanks for the script Nad ... I'll give it a run (tomorrow morning ... it's midnight here!) ... and let you know how it goes ... (don't you just LOVE these guys ... :) )
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 » Thu Jul 03, 2008 9:45 am

ok... I've been trying with this script for about three hours ... with no luck :( .

The object is still visible when I link in and does not change when I enter the region (i.e. it remains visible at all times). I know you said the script was untested (and I'm NOT being ungrateful ... far from it!) ... I just thought I'd report back to save anyone else a lot of time trying to get it to work. (I have played around with the indentation - I know that posting Alcscript as "code" sometimes messes those up - but still no joy. I tried also numberous variations on the ": ToggleDraw" too ... with and without those "extra" colons ... but still no luck... I even added bounds to the region but still no luck.

The script exports fine (no complaints from the Blender console) ... it just doesn't seem to toggle the visibility of the object in any way ... either before entering, during or leaving the region ... like I said ... its just visible all the time ... :(
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 » Thu Jul 03, 2008 11:10 am

You can still use the Python method. Let the region trigger a pythonfilemod, pass it the object as parameter and use objectname.draw.disable() and objectname.draw.enable()
"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 boblishman » Thu Jul 03, 2008 11:20 am

errr ... I wish I could D'Lanor ... but I have no idea where to start with python ... if I had a sample script I could change the object names ... and I have no idea what the alcscript for that would be either ... :(
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

Next

Return to Building

Who is online

Users browsing this forum: No registered users and 3 guests