grmblf Posted September 23, 2009 Share Posted September 23, 2009 If you're gonna suggest again that light/switch tutorial on the wiki I must tell you that I've already read it deeply :thumbsup: I'm having a slepless night... but still get stuck thinking a way to make all candles switchable without having to place them manually. Seeing the tutorial I've thought maybe it's possible to create a replica of each candle with light or without so we have both at same place and then we disable the last one created, but in order to work properly we need to be able to:- create invisible activators in-game, from a script at same position- link both candles (parent ref) also in-game, from a script If both are doable I think the rest would be easily done with a script running once for each candle on cell load but this would mean a 'placeAtMe' for every candle present in every cell we visit, and not only the ones we activate, and also would leave unaffected fake lights. But once again I'm assuming things I do not know so I'll wait for an answer before taking it further. Link to comment Share on other sites More sharing options...
Pronam Posted September 23, 2009 Share Posted September 23, 2009 again that light/switch tutoriaNo.link both candles (parent ref) also in-game, from a scriptIf that was possible...that would save a lot of trouble. I haven't found it yet... create invisible activators in-game, from a script at same positionthat would require creating a new model, as that doesn't exist yet. The invisible things there are already can't be activated on touch. I'm not sure of your use of placeatme. As both have the same problem. You can remove them from the game but they'll still be added to the save. And you can't remove them all, as that invisible activator couldn't be deleted or the player has to run the script themselves/spell to do it all over again. Link to comment Share on other sites More sharing options...
grmblf Posted September 23, 2009 Share Posted September 23, 2009 If isn't that tutorial then go ahead and give me a link, I'm absorbing all the knowledge I'm able to store until my head explodes :biggrin: The light/switch tutorial comes with an object wich is in fact an invisible activator, so the object is already done. My question is if it is possible to placeAtMe it. I supose it is, as long as they're objects. If not placeAtMe then how do you create objects in-game? Keep it comming, I'm learning a lot and I'm so thankfull for that. Link to comment Share on other sites More sharing options...
Pronam Posted September 23, 2009 Share Posted September 23, 2009 Ah owk, I've never read that one :). that's quite an useful resource..You can't create new objects in another way than using PlaceAtMe inside the game.The problem is, you're going to use it more than 10 times, so instead of creating items you could move items instead.Even when you'd use just one..as there are at least a 100 different lights, so that doesn't really help that much...In CS, just a large set of duplicates could be made (and just put in an interior than none should/could acces), with a Refname that way it would a lot easier to script it. As it doesn't need to search for type of lights, as when you know the name is used in the room, so that skips the whole Getbasicobject thing after the firs time. Link to comment Share on other sites More sharing options...
thecopy Posted September 24, 2009 Author Share Posted September 24, 2009 Getting anywhere? :) Link to comment Share on other sites More sharing options...
Pronam Posted September 24, 2009 Share Posted September 24, 2009 This is also interesting to look at...:link Link to comment Share on other sites More sharing options...
grmblf Posted September 24, 2009 Share Posted September 24, 2009 interesting, indeed. It doesn't mess with objects and it does it's job. I'll take a look at how it wokrs, perhaps a little adjustment lets you light them again at will using the same procedure. Link to comment Share on other sites More sharing options...
QQuix Posted September 25, 2009 Share Posted September 25, 2009 If I may suggest a simpler approach . . . Turning the lights off:Just walk all lights in the cell with GetFirst/nextRef and disable all that are within a given radius from the player (Ref.GetDistance player < 500 (?)). Save the disabled lights references in an array. Turning the lights Back on:Using the array of saved refs, turn all back on (enable them). This takes care of the real light sources. Now, to get rid of the fakes: two possibilities: (1) a simple one: disable/ enable them just as you did with the lights. They will vanish, but since the place will be dark, it may not be a problem. Or, to get fancy, (2) replace them with a correspondent 'no-flame' kind of object (would look better as you could see the extinguished candle or the turned off wall light. For (1) you will need a list of all base objects that you want to disable. For (2) you will need the same list with the matching no-flame objects. You can prepare the lists either by going thru all the inns and houses taking note of the fake lights there, or go thru the statics list in the CS and pick all fake lights there. Either way, a hard, boring task. I would advise against PlaceAtMe for the temporary no-flame objects. Create half a dozen of each in a hidden cell and use/reuse them. Be aware that, even disabling all lights, the rooms will not be completely dark as the cell itself usually have its own Ambient and Directional Lights, which, AFAIK, cannot be changed dynamically. Good luck, anyway. Link to comment Share on other sites More sharing options...
grmblf Posted September 26, 2009 Share Posted September 26, 2009 @ QQuix:Thanks for your contribution! I like the proximity check, probably better than creating an invisible activator for each light, but it doesn't solve the problem that if you 'disable' a real light spot like a flickering candle both the light and the candle disappear, so we still need calling a 'placeAtMe' for every affected candle or fire or moving it's extinguished counterpart from an unreachable cell to that position. It seems that moving objects will be less harmful than placeAtMe them, but won't that limit the maximum lights that can be disabled at the same time? I mean, I see great use for this mod for stealthy characters that want to remain undetected or plan to steal something, so if they go extinguishing every flame they encounter would this be a problem? Question #2: would the enabled/disabled status remain as we set it if the cell content respawns? That's for the real lights, but for the fake ones I don't get your point. If you disable a fake candle you remove the object but not the light. At first I thought it could be possible to check then for the nearest light bulb to delete it too, but there's a few interiors where one single light bulb covers the area of multiple fake candles, so it's not as easy. Otherwise, if you get rid of the light and leave the fake canlde you will end up seeing a white spot where the fake flame is, even with no light at all, not very nice. Anyway, 'Real Lights' mod deals with this as it deletes almost every light bulb and replaces most of the fake lights with real ones, so making a mod to lit and extinguish real lights would mean that it could work on almost every light if used in conjunction with real lights mod. @ Pronam:I tested the mod you linked here. It works fine but the result is somehow poor. It really annuls the light from candles but sometimes the 'darkness' it places upon the light doesn't match it exactly in radius or in intensity so sometimes you see the white spot I mentioned before or a slightly shining aura around the candle. I'll still gathering info while learning how all this works. Damn, it seems I haven't choose the easiest way to start modding. Link to comment Share on other sites More sharing options...
Pronam Posted September 26, 2009 Share Posted September 26, 2009 Question #2: would the enabled/disabled status remain as we set it if the cell content respawns?Objects that have not been scripted to do so will not return to their original state.I'll still gathering info while learning how all this works. Damn, it seems I haven't choose the easiest way to start modding.Far from it... :) Link to comment Share on other sites More sharing options...
Recommended Posts