Placeable with a light that can turn on/off with scripts

So i have not been able to fully figure this one out. I have ported a candle stand that has a blender light and a 2da Aurora light set up as well, but i cannot figure out why it will not turn on and off with the built in toolset on/off script. I played around with some settings in blender on the OC candle01 model. With the on/off script set in “on close” on the candle, when you close the candle it will turn both lights on/off in-game, but i cannot figure out how to set mine up to do the same. The best I could do is get the emitter to turn off, but not the aurora light. Does anyone know how to set up a model so that it can be turned on/off with scripts? Even a link to a guide would be helpful.

https://neverwintervault.org/forums/neverwinter-nights-1/nwn1-tutorials/placeables-light-how-do-it
^- Does this thread help? Giving it a glance over, it looks like it might’ve been figured out, here. :smiley:

1 Like

Thank you, I will look these over after i get off from work in the morning.

1 Like

Sorry I did not get to check these yesterday. It looks like all of those are about using scripts to turn the light on/off in different ways, a model needs to have its on/off animations set up right and it looks like you cannot just copy another object that has the on/off animations into your scene to make it work. It looks like I might have to manually set up my animations.

Sorry been busy, but let see I can get you back on track.

  1. AuroraDlight helper does not need any animation to work, animations you seeing on placables are turning off emitters or flares or rotating text planes more then likely. I have a set of working lights that have no animations at all on the models and can be turn on and off with script.
  2. Sound like the blender light is not supported by nwn engine right now or export error, maybe ask Symmetric if he put a working version in blender for nwn and if you have to set it up in a special way in neverblender.
  3. In the conversation I not just talking scripts, but how the 2da affect the location of the lights in relation to AuroraBase of the model.
    Hope this helps. Hope you get it working, I give the model a look if you want.
2 Likes

Yeah I have looked at it some more in neverblender and I think I have finally figured it out,it is going to be a pain though. In neverblender there is a text file/emitter data set up for each of the on,off,on/off and off/on animations. they are not emitter settings data they are different. They are single frame animation points or actions that are tied to specified emitters that go off as a animation is triggered. In those text files you have to specify the specific name of each emitter and the information that you want it to do, and the actions are in some type of code. I believe each of them go off when you activate a specific animation on a placeable in-game if you set them up to do so with scripts, the default on/off script will trigger and turn the light and the emitters on/off on the OC candle.You may not have to have them but the candle model is set up with them. Here is a example text file called PLC_Cndl01.anim.on2off set up on the on2off animation on the candle model in neverblender.

node emitter candleflame
alphastartkey 2
0 0.00000
1 0.00000
e n d l i s t
alphaendkey 2
0 0.00000
1 0.00000
e n d l i s t
birthratekey 2
0 0.00000
1 0.00000
e n d l i s t
sizestartkey 2
0 0.00000
1 0.00000
e n d l i s t
sizeendkey 2
0 0.00000
1 0.00000
e n d l i s t
endnode

As for the light turning on and off there is not setting that I have found anywhere in neverblender that will tell a light what to with scripts like the emitters. But if you look in the MDL for the PLC_Cndl01 model at line 492-500 which is part of the default animation, it says
node light AuroraLight01
parent damage
colorkey
0.0 1.0 1.0 0.866669
endlist
radiuskey
0.0 4.0
endlist
endnode

colorkey
0.0 1.0 1.0 0.866669 is the light color setting for the light in neverblender

And at 560-569 which is the on2off animation it will say
node light AuroraLight01
parent damage
colorkey
0.0 1.0 1.0 0.866669
endlist
radiuskey
0.0 4.0
0.0333333 0.0
endlist
endnode

The colorkey stays the same but the radiuskey says go from the default 0.0 4.0 to 0.0333333 0.0

And at lines 634-643 which is the off2on animation it says

node light AuroraLight01
parent damage
colorkey
0.0333333 1.0 1.0 0.866669
endlist
radiuskey
0.0 0.0
0.0333333 4.0
endlist
endnode

It says change the colorkey from 0.0333333 which it was set to in the on2off animation to 1.0 1.0 0.866669 which is the default color and it says change the last 2 digits in the current radiuskey from 0.0333333 to 4.0 which 0.0 4.0 was the radiuskey setting in the default animation. I do not know what the 0.0 0.0 is in the line above is. I have not tested this yet but if I am right you may be able to set up a models light through its MDLs animations settings so that you can tell it in-game to turn on/off and off/on with scripts tied to animation points. Really you may not even NEED to do this to make lights work, but it is the way the OC candle01 model is set up.

1 Like

Ok I did my testing and got my candle stand working. From what I can see there is no way to turn off a dynamic aurora light that is set up from the 2da,not even destroying either the candle 1 model or my candle stand will make it or its light go away. So I am guessing anything with a dynamic aurora light is suppose to be static. I made 2 candle models one with the dynamic light and one without it and both of their emitters and their blender lights turn on/off now. I had to adjust some of the text files in neverblender but it all works on export, I did not have to manually edit the MDL. Both models turn on/off with the on/off script without any editing now. The only thing different still is the candle 1 still creates a new dynamic light when you turn it on and I still do not know why. It may be because it is closer to the ground and it just looks like it does but I do not know. Either way I am happy, the candle stands work in the way I wanted them to now. Thank you for the help ShadowM and TheBarbarian.

1 Like

If you look at my HR base, it has some placable lights and if you look at the PDF under system / lighting bookmark it goes over lighting Dynamic vs static and explains how nwn handles flares. If might help looking at the models etc…
LINKhttps://neverwintervault.org/project/nwn1/other/hr-base-1150a-ee

1 Like