Jump to content

Seggestion; Light candles


thecopy

Recommended Posts

a noob question wich answer may dismantle or reinforce my plan: if you attach a script to a base object, isn't that script automatically attached to ALL references of that object? Otherwise why do you want to point them with the crosshair and cast a spell instead of making all them activable?

 

I'll try it out, though I feel more of such noob questions will show up-on the process.

 

I'll also check out candles in inn's bedrooms, maybe they use to be all of one type, either fake or real-lighted, so the effords could be put in that direction.

Link to comment
Share on other sites

  • Replies 40
  • Created
  • Last Reply

Top Posters In This Topic

Lol, yes it would, but my plan is just to check the base-object to know which one it is. You can't derive from a reference which one it is. But it'll continue on the reference ..But it is a rightful question, as it has been done a quite of few times.

The problem is that I can't replace them all correctly, as they are all set different, they guys from bethesda manually placed each light-bulb. So that shadows are done correctly. Otherwise the light may shine under the table instead of up.

 

And those aren't noob question, they are normal...keep asking them..

Link to comment
Share on other sites

You can't derive from a reference which [base-object] it is.

Bad news, I assumed it was possible. Can be performed some kind of string comparison to get it from it's ID?

 

I also bring bad news. I've been checking some inns and houses at random for a while and it seems that most of them use real lights, basicaly inns, basements and lower class houses, all the small places, using light spots mostly near the windows, wich is good, but there's a big problem as some of the candles are set in groups of 3 to 5 candles, being only one of them real while the others have fake flames. It stills doable, but I start to feel that making a script able to handle all this possibilities would be much more time-consuming than tweaking manually all the interior cells. Well, I was kidding, but just in part.

 

But... doesn't 'Real Lights' mod solve this by removing all lightspots and replacing the fake lights with ones that really shine? Woudn't it be easier to work upon this mod, so the only thing to do would be adding a script to candles so you can activate them and forget light spots? I mean, it seems to me that would be easier if only one type of candles is present.

Link to comment
Share on other sites

? No, it is ..when you use GetBaseObject:)...I meant that you can't click on a reference, like in the game, when you open the console.. When you click on any item it will show the reference/ the one that's placed there. But you can't do anything with it.

With OBSE, you can use GetBaseObject to know what the basic object is. (if you type GetBaseObject, after you've clicked on something, you'll get th base object returned..)

 

A good example, there is a carrot. I open the console and click on the carrot. It will return the FormID (number).

If I say Player.additem (refnumber) 1. I will not get a carrot.

If I type GetBaseObject. (Only works with OBSE loaded), it will return me the FormID of the basic item and if I use that number, I'll be able to add a carrot to my inventory.

 

I tried another shot at the official forums, but I have to be lucky too..Let's hope they'll say at least something...

Link to comment
Share on other sites

I get your point, but my question was if there is a way to find out a reference's base-object from inside a script, not in-game. Let's say you activate an object with a script attached to it. I think the reference is passed some way to the script. So once we know the reference, is any way to ask it the 'type' of object it is? Is getBaseObject the only way to get it, meaning only OBSE can perform that?
Link to comment
Share on other sites

Yes, you're actually asking for its last name. The Reference is the first name, that one could be one of hundred, but the Last name stays the same. The things is, you get them always in a seperate way.and you can only go from the reference to the basic-object, not the other way. (I make this simple as you're not the only one reading it ;). )

 

The reference FormID is just the number that happens to be the object placed in the game at that time.

The things is, new references can be created inside the game, new base-objects not. that's very logical of course.

If you have a script on an object, it will almost always work from the reference (Actors can be an exception).

 

If you want to the script to know a object's Basic ID in the game. It will need the reference first (If the script is on the object you want the base id of, you don't need to ask its reference, it is already working from that one.), and you ask that reference for its Basic ID. OBSE is the only one offering that, indeed.

Link to comment
Share on other sites

I've made my first -unsuccessful- attempt to give it form in a rough manner, more or less like what thecopy was asking for, but I've failed making candles activable objects; it's not enought you attach to them a script with an onAct block, I think I remember I've read somewhere that something called 'harsh collision' has something to do with this, really I have no idea and I haven't find the way to make them activable.

 

Sorting the lights by uses I saw that the first 5 or 6 candles covers a big percentage of usages so I tried to make a different script for every one of them and their 'Off' version (without flames nor lights) to be attached to base-objects. The script is very short and the only thing it does is a 'placeAtMe', readjusts the position and then disables the callling object. But according to wiki that's pretty dangerous because every item 'placed-at-me' is stored in the savegames, wich bumps it a lot, so I wonder if there's a better approach or an alternative way to create objects in-game.

 

I'll still working on it as far as I'm able to.

Link to comment
Share on other sites

It can be a bit tricky, You need something like BSA-commander to extract the .bsa of oblivion.

There you'll find the mesh you need. You need to turn it into an object that has the possibility to attach a script.

(Lights/activators) then you'll assign the the script..There is a light-switch tutorial on the CS Wiki if you need any reference. That was referring to the manual replacement of all lights in inns and buy-able houses.

Indeed, placeatme is never a good idea, as it Piles up.

 

It should be enough to attach a script to a light though.... (but to enable to Activate themself it needs to be an activator...)

(That explains the whole, onactive-thought.... AnvilLighthouseBowl is a very good example how to turn lights on and off)

 

If I skip too much explanation, just say so..

Link to comment
Share on other sites

No it's ok, so you need to make a new object of the 'activator' type and it's not possible to simply edit vanilla candles to make them activators, so a fast solution involving mostly scripting work is not feasible this way. What a nasty thing, it could be just a simple parameter, kind of 'isObjectActivator = 1' or a checkbox, but it's not... oh pal it makes me feel sad... :confused: hehe. Well then I think I'm done here, unless Pronam or someone else would want to care about this pre-mod and give me some homework :biggrin:
Link to comment
Share on other sites

t's not possible to simply edit vanilla candles to make them activators

Nope, annoying eh? :)...

 

Well, what If I give a full tutorial how to handle the thing, with an .esp showing an example activator with a script?

Link to comment
Share on other sites

  • Recently Browsing   0 members

    • No registered users viewing this page.

×
×
  • Create New...