Turning torches from off to on...

Moderator: Event DM

Post Reply
Aralee
Prince of Bloated Discourse
Posts: 257
Joined: Tue Jan 14, 2003 3:54 pm
Location: WI
Contact:

Turning torches from off to on...

Post by Aralee » Thu Apr 17, 2003 8:41 pm

Here's a question I have.

I'm trying to get it so when I walk into my house, I have to walk around and "light" the torches.. so far it's not working, I've set it to disabled, activated, default.. and nothing. They all start with a glow about them already and when I "use" them, that's when the flame shows up.

Any suggestions would be appreciated.
User avatar
Nightface
Sage
Posts: 1744
Joined: Fri Jan 03, 2003 11:13 am
Location: Los Angeles, CA

Re: Turning torches from off to on...

Post by Nightface » Thu Apr 17, 2003 8:48 pm

Aralee wrote:Here's a question I have.

I'm trying to get it so when I walk into my house, I have to walk around and "light" the torches.. so far it's not working, I've set it to disabled, activated, default.. and nothing. They all start with a glow about them already and when I "use" them, that's when the flame shows up.

Any suggestions would be appreciated.
There's a script you have to place in the OnUsed event, nw_02_onoff. I've never tried it for a torch, but I know for a fact it works on candelabra and street lamps. Aslo be sure to set the Initial State to Deactivated, so they'll be off after a server restart.

Tanmar Stronghammer
Actually
Sage
Posts: 1823
Joined: Sat Dec 14, 2002 10:11 pm
Location: Red Zone: Cuba

Post by Actually » Thu Apr 17, 2003 9:06 pm

Hrrmm...

Off the top of my head, are the torches marked "Usable" and NOT marked "Static"?

Other than that, I know for a fact that there is a script in the OC that is used for turning braziers on and off. It's named something like "nw_02a_OnOff" or some such.

Hope that helps.

Bye Now,
Jerry Cornelius - Script Monkey
User avatar
Nightface
Sage
Posts: 1744
Joined: Fri Jan 03, 2003 11:13 am
Location: Los Angeles, CA

Post by Nightface » Thu Apr 17, 2003 9:12 pm

Actually wrote:Off the top of my head, are the torches marked "Usable" and NOT marked "Static"?
DOH! I forgot to mention that!

Tanmar
Aralee
Prince of Bloated Discourse
Posts: 257
Joined: Tue Jan 14, 2003 3:54 pm
Location: WI
Contact:

Post by Aralee » Fri Apr 18, 2003 3:35 pm

Thanks for your help guys, but no luck. Upon entering the house, the torches are in a semi-state of being on. If you "use" it once, the fire becomes visible, if "used" twice, the torches go completely out. I want them out to begin with. Urgh it's frustrating when you don't know enough about scripting like this.
User avatar
Nightface
Sage
Posts: 1744
Joined: Fri Jan 03, 2003 11:13 am
Location: Los Angeles, CA

Post by Nightface » Fri Apr 18, 2003 5:29 pm

Heck, I see your point. I just tried the Initial State Deactivated on a candelabra. It was off, but still emitting light. I don't think this is a scripting issue. I'll look into it, and get back to you, unless somebody else answers first.

Tanmar Stronghammer
User avatar
astoroth
Lord of Blithering Idiots
Posts: 92
Joined: Mon Apr 14, 2003 12:35 pm

Post by astoroth » Thu May 08, 2003 3:05 am

I use Candelabras.

Mark them usuable, and set the area to DARK under the visual tab.

You can then walk in and turn the candleabras on and off, and they DO EMIT Light, its very cool, and I use it all the time.

Doesn't work on the tileset torches though.
Astoroth Dyacon
Sage of The Magus Tower University of Mikona

"Knowledge is the foundation of a righteous society. For it is knowledge that allows us to think, to learn, and to grow together."
User avatar
Themicles
CoPaP Ambassador
Posts: 2673
Joined: Wed Jan 29, 2003 10:45 pm
Location: Wolverine Lake, MI
Contact:

Post by Themicles » Thu May 08, 2003 4:54 am

Torch brackets are broken and you wont
see the fire. Only in the toolset will the fire
be visible.

Be warned, recalculating static lighting (as
I believe the default Bio script does) is not
noticable in small areas... but in large areas,
you're looking at a decent second or two
freeze.

-Themicles
User avatar
jadeia
Elder Sage
Posts: 3539
Joined: Tue Jan 21, 2003 10:56 am
Location: London, UK
Contact:

Post by jadeia » Thu May 08, 2003 5:02 am

Nightface wrote:Heck, I see your point. I just tried the Initial State Deactivated on a candelabra. It was off, but still emitting light. I don't think this is a scripting issue. I'll look into it, and get back to you, unless somebody else answers first.

Tanmar Stronghammer
Leave it on by default in the toolset. Then turn it off when playing, the area WILL go dark (if the area IS dark naturally) and when you use it again to turn it back on, the area will light up again.

This works is an area as small as a 2x2 room.
User avatar
JollyOrc
Elder Sage
Posts: 3984
Joined: Fri Jan 17, 2003 11:41 am
Timezone: Europe, CE(S)T
Location: Germany
Contact:

Post by JollyOrc » Thu May 22, 2003 9:11 am

quick question from a newbie builder:

I managed to set a candelabra in "off" state into the module, and it's usable too, but:

what's the command to activate / deactivate an object (ie the candelabra) ?
User avatar
JollyOrc
Elder Sage
Posts: 3984
Joined: Fri Jan 17, 2003 11:41 am
Timezone: Europe, CE(S)T
Location: Germany
Contact:

Post by JollyOrc » Sun May 25, 2003 10:38 am

ok, with this as onUsed:

Code: Select all

void main()
{
    if (GetLocalInt(OBJECT_SELF,"NW_L_AMION") == 0)
    {
        PlayAnimation(ANIMATION_PLACEABLE_ACTIVATE);
        DelayCommand(0.4,SetPlaceableIllumination(OBJECT_SELF, TRUE));
        SetLocalInt(OBJECT_SELF,"NW_L_AMION",1);
        DelayCommand(0.5,RecomputeStaticLighting(GetArea(OBJECT_SELF)));
    }
    else
    {
        PlayAnimation(ANIMATION_PLACEABLE_DEACTIVATE);
        DelayCommand(0.4,SetPlaceableIllumination(OBJECT_SELF, FALSE));
        SetLocalInt(OBJECT_SELF,"NW_L_AMION",0);
        DelayCommand(0.9,RecomputeStaticLighting(GetArea(OBJECT_SELF)));
    }
}
I can walk up to a candelabra, and turn it on /off. If it is on at module load, everythings fine.

Now: I want to turn a number of candelabras *off* at once. I manage that somehow, but the flames do not disappear.

Is it possible to "call" the onUse script of an object from a script ?

as in

Code: Select all

command1;
Candelabra1.onUse();
command2;
User avatar
JollyOrc
Elder Sage
Posts: 3984
Joined: Fri Jan 17, 2003 11:41 am
Timezone: Europe, CE(S)T
Location: Germany
Contact:

Post by JollyOrc » Sun May 25, 2003 10:41 am

think I found the reason for the "flames stay" problem

Code: Select all

PlayAnimation(ANIMATION_PLACEABLE_ACTIVATE);
affects the object_Self. I need it to affect another object. How to do that ?
User avatar
JollyOrc
Elder Sage
Posts: 3984
Joined: Fri Jan 17, 2003 11:41 am
Timezone: Europe, CE(S)T
Location: Germany
Contact:

Post by JollyOrc » Thu Jun 05, 2003 5:21 am

okay, I made it. Here's for your viewing pleasure, in case someone else wants to do the same thing:

Code: Select all

void main()
{
        object oCandelabra1 = GetObjectByTag("RS_IN_1");
        AssignCommand(oCandelabra1, PlayAnimation(ANIMATION_PLACEABLE_DEACTIVATE));
        DelayCommand(1.0,SetPlaceableIllumination(oCandelabra1, FALSE));
        SetLocalInt(oCandelabra1,"NW_L_AMION",0);
        DelayCommand(1.0,RecomputeStaticLighting(GetArea(oCandelabra1)));

}
This turns the Lights of the object RS_IN_1 effectively off, if they have been "activated" before. So change the initial state from default to activated. The delays seem to be important too. Also, always keep in mind that all tags are case sensitive, took me a while to remember.
User avatar
szabot
Team Member; Retired with Honors
Posts: 10693
Joined: Thu Jun 17, 2004 11:36 pm
Timezone: Central (GMT-5)
DM Avatar: Wilsash
Location: The Abyss
Contact:

Post by szabot » Sat Feb 04, 2006 5:13 am

Building an area...need some help. ;)

I want to use the torch-lit only visual scheme, but I also want to add some fires, fire basins and that sort of stuff around and I want those to give off light. I've added a script to the OnUsed event of these items: nw_02_onoff. However, I don't know what to do beyond that to actually make them light the area around them at all (and I want them lit when someone comes into the area). I think I read (here or somewhere else) about the RecomputeStaticLighting(object) script, and that I need the ~area~ itself to run that script? Is that right? If so, how do I add a script to an area?

Any help is much appreciated. I really know absolutely nothing about scripting.

Thanks.
CoEMF
:devil:
Member of the MadKat Fan Club
User avatar
Sindol
Team Member; Retired with Honors
Posts: 6479
Joined: Mon Jan 06, 2003 4:23 pm
Location: Nijmegen - Netherlands (GMT+1)
Contact:

Post by Sindol » Sat Feb 04, 2006 9:16 am

If you want them always lit when someone enters the area, I'd go for emitters. You only need to tie a script to the onenter event of the area that way, and not one to each placeable.

If you want to turn them all on or off, and all individually too, I'd go for some light scripts I wrote for Avlis a long time ago. They can be downloaded here: http://www.catara.org/files/Player_scripts.rar
The one you need is called something like ply_light_onoff iirc.
So much fun,
yet so little time to enjoy it.
- Sindol
User avatar
szabot
Team Member; Retired with Honors
Posts: 10693
Joined: Thu Jun 17, 2004 11:36 pm
Timezone: Central (GMT-5)
DM Avatar: Wilsash
Location: The Abyss
Contact:

Post by szabot » Sat Feb 04, 2006 9:22 am

Sindol wrote:If you want them always lit when someone enters the area, I'd go for emitters. You only need to tie a script to the onenter event of the area that way, and not one to each placeable.
This is what I want. Are there "emitter" scripts that I can use for player housing?

edit: I can't find a script on the list that has the word "emitter" in it, and I don't know how else I'd find one. :P
edit: found one! It's "zep_torches_on" and it seemed to light some candles. Didn't light the fire basins though....
edit: since the script lights flames, I just placed some extra flames in the basins and that did the trick. :)

And this may be a silly question, but how do I place a script for the area itself? When I go to area properties, I don't see any option for scripts. :?

edit: aha! There is no script tab, but there is an "events" tab. ;)

Thanks. ;)
Last edited by szabot on Sat Feb 04, 2006 9:56 am, edited 1 time in total.
User avatar
Marleh
Demigod of Posts
Posts: 8650
Joined: Mon Jun 07, 2004 5:34 pm
Location: GMT -8

Post by Marleh » Sat Feb 04, 2006 9:54 am

dont use the ZEP_torch script, its buggy. You can turn an item on, but it then becomes a static placeable, and you cant turn it off again.

I used a different script for the bards academy, let me find it and Ill post the name.
User avatar
szabot
Team Member; Retired with Honors
Posts: 10693
Joined: Thu Jun 17, 2004 11:36 pm
Timezone: Central (GMT-5)
DM Avatar: Wilsash
Location: The Abyss
Contact:

Post by szabot » Sat Feb 04, 2006 9:57 am

Marleh wrote:dont use the ZEP_torch script, its buggy. You can turn an item on, but it then becomes a static placeable, and you cant turn it off again.

I used a different script for the bards academy, let me find it and Ill post the name.
I don't need to turn them off again, but if there's still something buggy about it, then I'll be happy to try other options. Thanks. :)
User avatar
Marleh
Demigod of Posts
Posts: 8650
Joined: Mon Jun 07, 2004 5:34 pm
Location: GMT -8

Post by Marleh » Sat Feb 04, 2006 11:49 am

by buggy, I meant that it only works once per reset. If you dont need to turn it on and off, just on, then the ZEP is good to go.
User avatar
szabot
Team Member; Retired with Honors
Posts: 10693
Joined: Thu Jun 17, 2004 11:36 pm
Timezone: Central (GMT-5)
DM Avatar: Wilsash
Location: The Abyss
Contact:

Post by szabot » Sat Feb 04, 2006 6:49 pm

Marleh wrote:by buggy, I meant that it only works once per reset. If you dont need to turn it on and off, just on, then the ZEP is good to go.
Ok.

I do notice, though, that I get a message in my combat window five times when entering the area: something like "ZEP_candle001." Anyway to avoid having those lines show up?
CoEMF
:devil:
Member of the MadKat Fan Club
Moredo
Team Member; Retired with Honors
Posts: 8330
Joined: Mon May 26, 2003 3:47 pm
Timezone: +2
Location: Norway (GMT +2)

Post by Moredo » Sat Feb 04, 2006 7:15 pm

There is a default bioware script for turning torches on and off, one that isn't buggy. I would have listed it's name, but it seems my toolset is bugged, so I can't open it. :(

IIRC, it's x2_somethingsomething, hah, hope that helps! 8)
Always consider alignment as a tool, not a straitjacket that restricts the character.
— AD&D, 2nd Edition Player's Handbook
User avatar
szabot
Team Member; Retired with Honors
Posts: 10693
Joined: Thu Jun 17, 2004 11:36 pm
Timezone: Central (GMT-5)
DM Avatar: Wilsash
Location: The Abyss
Contact:

Post by szabot » Sat Feb 04, 2006 7:31 pm

Moredo wrote:There is a default bioware script for turning torches on and off, one that isn't buggy. I would have listed it's name, but it seems my toolset is bugged, so I can't open it. :(

IIRC, it's x2_somethingsomething, hah, hope that helps! 8)
Does it work on all things that can give off light, or only torches?

Thanks.
CoEMF
:devil:
Member of the MadKat Fan Club
Moredo
Team Member; Retired with Honors
Posts: 8330
Joined: Mon May 26, 2003 3:47 pm
Timezone: +2
Location: Norway (GMT +2)

Post by Moredo » Sat Feb 04, 2006 7:36 pm

I've only tested it on the CEP candles and, the regular and CEP braciers. It workes perfectly on both. :) I'll see what's wrong with my toolset tomorrow, and past the script name here, unless somebody else already has. But now, I'm out! }8)
Always consider alignment as a tool, not a straitjacket that restricts the character.
— AD&D, 2nd Edition Player's Handbook
User avatar
slave_of_emotions
Scholar of Fools
Posts: 470
Joined: Sun Sep 05, 2004 10:04 pm
Location: The European Union(Germany)
Contact:

Post by slave_of_emotions » Sat Feb 04, 2006 7:41 pm

Some torches lights etc have a static light that will be visible even when the object is off. The CEP items have versions for being on and off , use the last one and removed the heartbeat script, then use the script mentioned in second post (nw_xxx_onoff or some like that) that turns it on and off to OnUsed.

I have being making fires by first seting up the required placables that actualy dont burn. After that create a flame on/inside (you will have to experiment abit with locations to make it look good), and add the same script as above to OnUsed.

This is a housing i have been working on, with lights turnable on and off, you can take a look at how i made it if you want: http://slaveofemotions.sl.funpic.de/e10 ... php?view.9
Post Reply