controlling lights?

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

Re: controlling lights?

Postby andylegate » Sun Feb 10, 2008 11:06 am

NNNNNNGGGGGHHHHH! Grrrrrrrr!!!!!

Don't you just HATE it when Trylon says something like that???

It's like he has this Evil side that pops up and makes the rest of us wait in suspense!

Speaking of which.....*AHEM!* Trylon, you, PM, me, rotation of objects, remember? Said you figured it out.....then.....nothing.....
"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: controlling lights?

Postby Trylon » Sun Feb 10, 2008 12:44 pm

Oh, sh*t. Forgot.
pm me your mail address and I'll send you the code.
Last edited by Trylon on Mon Feb 18, 2008 11:37 pm, edited 1 time in total.
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: controlling lights?

Postby Nadnerb » Sun Feb 10, 2008 1:06 pm

This is entirely possible, as Trylon hinted, without using any python. It's all done in alcscript. You just use a start sound message. I had this as an example in the original sound tutorial, but someone wrote another sound tutorial and stripped out my demo sound message alcscript.

the original wiki article is here

the script is here:
Code: Select all
<some object>:
    logic:
        actions:
          - type: responder
            name: SoundResp (name or tag for modifier ref)
            responder:
               states:
                - cmds:
                   - type: soundmsg
                     params:
                        receivers:
                         - 0011:<Name of emitter object>
                        cmds:
                         - play (start the sound)
                         - stop (stop the sound)
                         - setvolume (set the volume)
                        volume: 1 (volume only set if setvolume cmd is used)
                     waiton: -1
                  nextstate: 0
                  waittocmd: 0
               curstate: 0
               flags:
                - detect_trigger


Basically, to use that message, you just have some sort of trigger, such as a region, or a clickable alcscript reference SoundResp, and it will send the message to either start or stop the sound.

I've been meaning to update the sound region quickscript so that it supports one way triggers for sounds, (ie, only turns the sound on, or off) but haven't had the time recently.

(I realize this may not be an adequate explanation for those who don't already understand alcscript, but this was a quick post. Perhaps I'll either make a template, or make a new quickscript, sometime in the near future.)
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: controlling lights?

Postby andylegate » Sun Feb 10, 2008 2:26 pm

Hmmmmmm.......Well, I can set it up with one of my training Ages and give it a spin. Would love to see how it works.

I'll come back here and post what my result was a little later from now.

I mean, I've been learning ALCscript at a expotential rate since the new plugin came out!

I mean, I started out with 0 knowledge.....so now it's like: (0 x 10^8) for me....which....is......still.....0.

Ah crud....... :D
"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: controlling lights?

Postby andylegate » Sun Feb 10, 2008 3:10 pm

Well PPPPPPPPPPPPTTTTHHHHHH! :P

Ooops! I need to learn how to do conditional objects first! Hehehe, there I go, half-cocked again, thinking I can do something, when it involves something I've totally put aside......

*breaks out glasses and starts reading......*
"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: controlling lights?

Postby D'Lanor » Sun Mar 16, 2008 7:26 am

Getting back on subject, I recently tried to set a light as a conditional object... and PyPRP just ignored it. So this currently does not work for lights. That means we can forget about my proposed method. :(

Since we know that Cyan does have conditional objects which include lights I am inclined to consider this a PyPRP bug as well.
"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: controlling lights?

Postby Grogyan » Mon Mar 17, 2008 4:36 pm

I was just thinking about this topic less than half an hour ago.
I too am wanting to implement conditional objects, lights, textures but still need to know how to do it.
Future plans for shell 119

I also just realised that Robert has some in his shell, perhaps he can shed some info on them
Better to have loved and lost than never to have loved at all
User avatar
Grogyan
 
Posts: 1203
Joined: Thu Oct 11, 2007 1:27 am

Re: controlling lights?

Postby D'Lanor » Mon Mar 17, 2008 5:18 pm

Well, I was going to suggest using the page loading/unloading workaround to switch lights on/off but the main problem with that is that a light cannot affect objects in another page... :(

I have no idea why my lights refuse to go conditional. Normal conditional objects simply work as I described previously.

btw, I don't think Robert uses them. Conditional objects typically add a "Vis" postfix and I don't see those in the Pahts SDL. He probably sets the physics directly. That is another way for the lights possibly. However, I have been hacking around so much in the past that I actually get a kick out of doing things the proper way. ;)
"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: controlling lights?

Postby Robert The Rebuilder » Tue Mar 18, 2008 4:43 am

D'Lanor is right - I don't have any conditional lights in my shell. The SDL variables are to preserve state of the buttons, levers, doors and "Toblerone" platforms (to use Jojon's phrase) between sessions and to ensure other players see the same state (which I've been dying to try out).
Can we rebuild it? Yes, we can - here's how.

MOULagain KI# 1299

Myst Movie coming soon - spread the word!
User avatar
Robert The Rebuilder
 
Posts: 1383
Joined: Sat Sep 29, 2007 7:24 am
Location: Virginia, US

Re: controlling lights?

Postby Lontahv » Fri Mar 21, 2008 10:07 pm

We can just have it be python controlled.

Code: Select all
obj = PtFindSceneobject("<lampname>", PtGetAgeName())
PtSetLightValue(obj.getKey(), <color(float)>, <color(float)>, <color(float)>, <brightness(float)>)



~Lontahv
Currently getting some ink on my hands over at the Guild Of Ink-Makers (PyPRP2).
User avatar
Lontahv
Councilor of Artistic Direction
 
Posts: 1331
Joined: Wed Oct 03, 2007 2:09 pm

Previous

Return to Scripting

Who is online

Users browsing this forum: No registered users and 0 guests

cron