Turning torches from off to on...
Moderator: Event DM
-
- Prince of Bloated Discourse
- Posts: 257
- Joined: Tue Jan 14, 2003 3:54 pm
- Location: WI
- Contact:
Turning torches from off to on...
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.
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.
Re: Turning torches from off to on...
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.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.
Tanmar Stronghammer
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
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
-
- Prince of Bloated Discourse
- Posts: 257
- Joined: Tue Jan 14, 2003 3:54 pm
- Location: WI
- Contact:
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.
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.
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."
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."
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.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
This works is an area as small as a 2x2 room.
- JollyOrc
- Elder Sage
- Posts: 3984
- Joined: Fri Jan 17, 2003 11:41 am
- Timezone: Europe, CE(S)T
- Location: Germany
- Contact:
ok, with this as onUsed:
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
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)));
}
}
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;
- JollyOrc
- Elder Sage
- Posts: 3984
- Joined: Fri Jan 17, 2003 11:41 am
- Timezone: Europe, CE(S)T
- Location: Germany
- Contact:
think I found the reason for the "flames stay" problem
affects the object_Self. I need it to affect another object. How to do that ?
Code: Select all
PlayAnimation(ANIMATION_PLACEABLE_ACTIVATE);
- JollyOrc
- Elder Sage
- Posts: 3984
- Joined: Fri Jan 17, 2003 11:41 am
- Timezone: Europe, CE(S)T
- Location: Germany
- Contact:
okay, I made it. Here's for your viewing pleasure, in case someone else wants to do the same thing:
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.
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)));
}
- 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:
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.

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

Member of the MadKat Fan Club

Member of the MadKat Fan Club
- Sindol
- Team Member; Retired with Honors
- Posts: 6479
- Joined: Mon Jan 06, 2003 4:23 pm
- Location: Nijmegen - Netherlands (GMT+1)
- Contact:
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.
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
yet so little time to enjoy it.
- Sindol
- 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:
This is what I want. Are there "emitter" scripts that I can use for player housing?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.
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.

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.
- 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:
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.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.

- 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:
Ok.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.
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

Member of the MadKat Fan Club

Member of the MadKat Fan Club
-
- Team Member; Retired with Honors
- Posts: 8330
- Joined: Mon May 26, 2003 3:47 pm
- Timezone: +2
- Location: Norway (GMT +2)
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!

IIRC, it's x2_somethingsomething, hah, hope that helps!

Always consider alignment as a tool, not a straitjacket that restricts the character.
— AD&D, 2nd Edition Player's Handbook
— AD&D, 2nd Edition Player's Handbook
- 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:
Does it work on all things that can give off light, or only torches?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!
Thanks.
CoEMF

Member of the MadKat Fan Club

Member of the MadKat Fan Club
-
- Team Member; Retired with Honors
- Posts: 8330
- Joined: Mon May 26, 2003 3:47 pm
- Timezone: +2
- Location: Norway (GMT +2)
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! 


Always consider alignment as a tool, not a straitjacket that restricts the character.
— AD&D, 2nd Edition Player's Handbook
— AD&D, 2nd Edition Player's Handbook
- slave_of_emotions
- Scholar of Fools
- Posts: 470
- Joined: Sun Sep 05, 2004 10:04 pm
- Location: The European Union(Germany)
- Contact:
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
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