Anyway to attach a script to a large group of objects?

Post » Sat Nov 17, 2012 12:25 am

I just recently completed my first original script, which overhauls the mining mechanics in the game. Problem is, there are a ton of Ore Vein base objects, and I don't really want to resort to removing the old mining script and adding the new one manually for each one. Is there an easier way to attach/remove a script to an object? Or should I just resort to just copying my new mining script over the older one, and making a back up of the old script just in case.
User avatar
Karen anwyn Green
 
Posts: 3448
Joined: Thu Jun 15, 2006 4:26 pm

Post » Fri Nov 16, 2012 1:45 pm

Based on how many there are, you might want to rework your approach. Since I don't know what your script tries to accomplish, I can't say if your script would be well suited for, say, a quest script that monitors things.

Either way, I see two options beyond that:
  • Edit the old mining script. Someone else will have to tell you what the ramifications of doing that are since I've never really replaced a vanilla script before like that.
  • Add your script to each one. Yes, there are a lot, and yes, it will svck. You could break it up into a multi-day affair; "Today, I will do all of the Corundum Veins", until you get them all done.
Good luck!
User avatar
Allison Sizemore
 
Posts: 3492
Joined: Wed Jul 19, 2006 6:09 am

Post » Fri Nov 16, 2012 12:23 pm

You might look at SkyProc which is supposed to be good at bulk patching exercises like this one.

It does have some things it doesn't work so well on, but if it's ok with scripts it could save a lot of bother.
User avatar
Cayal
 
Posts: 3398
Joined: Tue Jan 30, 2007 6:24 pm

Post » Sat Nov 17, 2012 12:11 am

Make a new base object and attach your new script to it. Give it a name that is the same as the existing objects and add a suffix.
ie. GoldOreVein becomes GoldOreVein_New.
Then type GoldOreVein in the Cell view and select each in turn. Do a find and replace on each selection.
User avatar
Melis Hristina
 
Posts: 3509
Joined: Sat Jun 17, 2006 10:36 pm

Post » Fri Nov 16, 2012 9:06 pm

You can use the Reference Batch Actiion dialogue from the View menu. There is an option to attach scripts. Among other things.
User avatar
Teghan Harris
 
Posts: 3370
Joined: Mon Mar 05, 2007 1:31 pm

Post » Fri Nov 16, 2012 6:39 pm

I just recently completed my first original script, which overhauls the mining mechanics in the game. Problem is, there are a ton of Ore Vein base objects, and I don't really want to resort to removing the old mining script and adding the new one manually for each one. Is there an easier way to attach/remove a script to an object? Or should I just resort to just copying my new mining script over the older one, and making a back up of the old script just in case.
I'm also working on a complete mining overhaul. If you don't use any new form or leveled lists, and you stick with a single script, you shouldn't have to go through each activator. I have to http://www.gamesas.com/topic/1391727-papyrus-add-item-from-formlist/ because I'm not using the default leveled list. http://www.uesp.net/wiki/Tes5Mod:SkyProc looks like a good solution if you really know what you're doing, but I think it would add unnecessary overhead. Also, the Reference Batch Action feature doesn't work for what we want to do; although, technically, you could theoretically create a custom cell and place all of the veins in that cell, but that's probably more work, not less.
User avatar
Averielle Garcia
 
Posts: 3491
Joined: Fri Aug 24, 2007 3:41 pm

Post » Fri Nov 16, 2012 12:54 pm

The question was how to attach a script to a large group of objects. If you can group the objects, Reference Batch Action will help attach the script. If you are in a mine with 16 veins, you can attach to all sixteen. Seems better than doing each one individually, but its your choice.
User avatar
Ash
 
Posts: 3392
Joined: Tue Jun 13, 2006 8:59 am

Post » Fri Nov 16, 2012 2:23 pm

http://www.uesp.net/wiki/Tes5Mod:SkyProc looks like a good solution if you really know what you're doing, but I think it would add unnecessary overhead.

SkyProc, unless I've misunderstood something fundamental, is an install time solution. You run it once to generate an esp that patches your ore veins and nothing else. If you later install a mod that adds new veins, you'd need to run it again to regenerate the patch, but that's it.

It should be the lowest overhead of any of the solutions. but you do need to know a little bit of Java.

That said, I've just skimmed the relevant articles a couple of times, never used it in anger. So I could be way off base.
User avatar
steve brewin
 
Posts: 3411
Joined: Thu Jun 21, 2007 7:17 am

Post » Fri Nov 16, 2012 4:55 pm

The question was how to attach a script to a large group of objects. If you can group the objects, Reference Batch Action will help attach the script. If you are in a mine with 16 veins, you can attach to all sixteen. Seems better than doing each one individually, but its your choice.
There are 601 ore veins. If he's overhauling mining, he needs to modify all of them. Reference Batch Action only helps if he can access them all in a cell, so he'd need to place 601 ore veins in a cell to use that dialog. It really svcks that you can't use Batch with the Object Window.
User avatar
suniti
 
Posts: 3176
Joined: Mon Sep 25, 2006 4:22 pm


Return to V - Skyrim