Page 3 of 3

Re: controlling lights?

PostPosted: Sun Feb 10, 2008 11:06 am
by andylegate
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.....

Re: controlling lights?

PostPosted: Sun Feb 10, 2008 12:44 pm
by Trylon
Oh, sh*t. Forgot.
pm me your mail address and I'll send you the code.

Re: controlling lights?

PostPosted: Sun Feb 10, 2008 1:06 pm
by Nadnerb
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.)

Re: controlling lights?

PostPosted: Sun Feb 10, 2008 2:26 pm
by andylegate
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

Re: controlling lights?

PostPosted: Sun Feb 10, 2008 3:10 pm
by andylegate
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......*

Re: controlling lights?

PostPosted: Sun Mar 16, 2008 7:26 am
by D'Lanor
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.

Re: controlling lights?

PostPosted: Mon Mar 17, 2008 4:36 pm
by Grogyan
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

Re: controlling lights?

PostPosted: Mon Mar 17, 2008 5:18 pm
by D'Lanor
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. ;)

Re: controlling lights?

PostPosted: Tue Mar 18, 2008 4:43 am
by Robert The Rebuilder
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).

Re: controlling lights?

PostPosted: Fri Mar 21, 2008 10:07 pm
by Lontahv
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