Conflicts of Papyrus fragments - maybe rare but inevitable?

Post » Wed Jun 20, 2012 1:33 am

I was just thinking....

I have a mod that uses A LOT of Papyrus fragments. Each fragment created has its default name that starts with TIF__ prefix, then two digits for load order (usually that's 01) followed by 6 random hex numbers. So the final name is like TIF__0100A1CB.pex, and such file ends in Skyrim\Data\Scripts folder by default.

So, no any problem should occur for me even while I have thousands of such generated fragments. But... I am not alone O_o

What IF some other modder creates his/her mod with dialogue and puts some code in those fragments? And of course -surprisingly- it will generate a script with exactly the same name as one of my files?
I suppose that default location for all scripts is the same for everyone, and also that TIF__ prefix, and first two digits as well (usually someone edits only one plugin, so it starts with 01 by default). This leaves "only" six hex digits for an unique name. The point is that probably for everyone of us it just starts with LOW random numbers, so any chances for conflicts are more possible here (for nearly 1500 custom script fragments in my Scripts folder more than 99% of files have only the last four digits different).

Just think about it - if such things may happen then any conflicts would be almost impossible to spot - because the problem is not so well known, and messing with load order won't help here - as the files will be overwritten (who will even bother with the check whether any file names in Scripts folder are the same with those of newly installed mod while thousands of them are there?).

This may be not much of a problem now, but for a year, two, or three when more and more such files will be created?


Any thoughts, or am I paranoid? O_o
User avatar
Eduardo Rosas
 
Posts: 3381
Joined: Thu Oct 18, 2007 3:15 pm

Post » Wed Jun 20, 2012 1:59 am

Hmm TIF - Topic Info fragment scripts. I see no reason why this couldn't become a problem at any point, really. But it only affects mods which use dialog.

What numbers are you getting for your scripts, because the vanilla ones seem only semi random, only the last three digits. The lowest value I see is 0x0001A0B3 and a few TIF scripts have names - weird convention.
Using a hash, even a simple CRC32 might have been a better idea.
User avatar
Rob Smith
 
Posts: 3424
Joined: Wed Oct 03, 2007 5:30 pm

Post » Wed Jun 20, 2012 7:13 am

I always prefix the fragments with my initials. Certainly makes backing them up much easier, and the only thing they will conflict with is my own stuff.
User avatar
casey macmillan
 
Posts: 3474
Joined: Fri Feb 09, 2007 7:37 pm

Post » Tue Jun 19, 2012 7:50 pm

What numbers are you getting for your scripts, because the vanilla ones seem only semi random, only the last three digits.
I have the whole spectrum of hex values on last four digits.


rlilewi -
I discovered by an accident that you can set your own default prefix for all TIFs in File -> Preferences -> Scripts tab. But it requires CK to restart and it doesn't convert any filenames you already have.
If I would like to change names for all script fragments in my mod that would be dozens of thousands clicks and two full weeks of work ;]
User avatar
Aaron Clark
 
Posts: 3439
Joined: Fri Oct 26, 2007 2:23 pm

Post » Wed Jun 20, 2012 8:37 am

http://www.gamesas.com/topic/1346664-topic-info-scripts-non-unique-names/page__fromsearch__1
User avatar
Veronica Martinez
 
Posts: 3498
Joined: Tue Jun 20, 2006 9:43 am

Post » Wed Jun 20, 2012 4:12 am

Nice, though pity I've learned it in a hard way ;p
As for one of your statements there Arthmoor, possibility of conflicts between own mods can be avoided by setting different prefix for each mod.

Darn, time to edit those 1000+ entries... :/
User avatar
Alister Scott
 
Posts: 3441
Joined: Sun Jul 29, 2007 2:56 am

Post » Wed Jun 20, 2012 6:36 am

Well it was also suggested (don't recall where) that renaming the script will solve the problem too. I use the prefix to mark scripts that belong to me. Then I rename the scripts at creation time to tag them further as to which mod they go to. Setting a different prefix each time would be something I'd find too easy to forget about.

So for my alt-start, the topic info scripts all look like this: ARTH_TIF_LALNewStart_0200C721.psc

I too had to learn the hard way, but fortunately only had about 50 scripts to fix instead of 1000. That's gotta hurt.
User avatar
rebecca moody
 
Posts: 3430
Joined: Mon Mar 05, 2007 3:01 pm

Post » Tue Jun 19, 2012 8:10 pm

i sooooo wish i read this earlier. FML

i have to rename all the scripts individually?


why can't they organize the script folders in a esp/esm folder name like the voices and facegen
User avatar
Leilene Nessel
 
Posts: 3428
Joined: Sun Apr 15, 2007 2:11 am

Post » Wed Jun 20, 2012 12:12 am

Hmm writing a little app to rename the files and update the scriptname would be trivial, but I guess then the mapping between the file and esp would be lost?
Maybe someone can test that scenario; whether setting the prefix would restore that mapping once the scripts are fixed.

Actually, most text editors should make that rather easy using just regular expressions and then some batch-rename tool.
User avatar
Mimi BC
 
Posts: 3282
Joined: Sat Oct 07, 2006 10:30 pm

Post » Wed Jun 20, 2012 10:35 am

Yeah They'd probably have to re-attached to the esp. The scriptnames and function names are stored in the VMAD sub record.
(In the CK the values can be seen (but not editted) on the Advanced tab)

Er... so how the hell would you do that in the CK???
If the script name changed then I'd guess the Properties would need reinitialising.
And if a Fragment script changed name then s there a guarantee that it would choose the same automatic function name?
User avatar
Everardo Montano
 
Posts: 3373
Joined: Mon Dec 03, 2007 4:23 am

Post » Wed Jun 20, 2012 8:15 am

http://uesp.net/wiki/Tes5Mod:Mod_File_Format/VMAD_Field, I guess that's Virual Machine Attached Data?
I took a look at one such record using http://skyrim.nexusmods.com/downloads/file.php?id=5064, my take away from looking at both links. Shouldn't be hard to add a new spell to tesvnip which allows for batch renaming fragment scripts.
User avatar
Chris Ellis
 
Posts: 3447
Joined: Thu Jul 26, 2007 10:00 am

Post » Wed Jun 20, 2012 5:02 am

I tested briefly yesterday, how to add prefix to already existing fragment in a "normal" way in CK without any additional tricks. And results were not so promising.
As to do this in CK only without complains from it or any warning messages, I had to delete all content from script fragments, then select script's name and use remove button. Finally save the plugin, RESTART the CK, load plugin again and paste content to those fragments. Without the restart, CK always creates the same name for script fragment.
Well, I need to experiment some more, otherwise it's quite ridiculous... O_o
User avatar
Alexandra Louise Taylor
 
Posts: 3449
Joined: Mon Aug 07, 2006 1:48 pm

Post » Wed Jun 20, 2012 12:28 am

@Xetril, Aha, thanks for that link. I did search for that before posting the thread about the http://www.gamesas.com/topic/1357862-setting-a-form-as-a-property-works-ok/.

Yep, a batch rename spell would be good.

@Artisanix, for now it might be easier just using an 'identical length' replacement filename string that you could edit directly into the VNAM in TESVEdit.
Oh... hang on you have 1000 to do :/


For those too lazy to read Arthmoors linked thread though, check your Papyrus Options and edit your Prefix.
User avatar
SWagg KId
 
Posts: 3488
Joined: Sat Nov 17, 2007 8:26 am

Post » Wed Jun 20, 2012 3:06 am

16^6 is close to 17 million combinations. What would the odds be that 1) two different mods uses the exact same name and 2) a given user will use both those mods at the same time.

Yes it's a good idea to prefix your scripts but it's not the end of the world if you don't...
User avatar
Carlos Rojas
 
Posts: 3391
Joined: Thu Aug 16, 2007 11:19 am

Post » Wed Jun 20, 2012 3:47 am

dudster -

For everyone it usually starts with low numbers, and uses mostly the last four digits, so it's 16^4 = 65536. And every dialogue tree has a very high probability of having many of such fragments.
Though I agree that the odds definitly aren't high, but still if there's any chance to make own mods less prone to such encounters, why not to take it?
User avatar
мistrєss
 
Posts: 3168
Joined: Thu Dec 14, 2006 3:13 am

Post » Tue Jun 19, 2012 11:54 pm

I remember 'What are the odds' arguments relating to wether ppl should to bother to register GUIDs for Sims 2 modding.
These ones are http://sims.ambertation.de/en/guiddb/?&action=listall&first=0&count=25&sort=UserGuid&desc=1&filteruser=tunaisafish#guid_start, so hands off lol

Oh, and if you're choosing randonly then avoid 0x0001000 to 0xEC1952FF

I agree that chances are slim of a user having 2 clashing mods, but if it does happen it's the one case that has you scratching your head for days wondering.
User avatar
Charles Weber
 
Posts: 3447
Joined: Wed Aug 08, 2007 5:14 pm

Post » Wed Jun 20, 2012 8:40 am

16^6 is close to 17 million combinations. What would the odds be that 1) two different mods uses the exact same name and 2) a given user will use both those mods at the same time.

Yes it's a good idea to prefix your scripts but it's not the end of the world if you don't...
You don't understand. Script files are not stored with any association whatsoever to a mod's name. They exist as independent files.

Myscript.psc could be anything to anyone. For me, it might be the miracle that makes me rich. For you, it could be what summons 10 fire atronachs to burn down the city. If we both attach a script with this name to our mod, only one of us gets to win this fight and the other script is cast into Oblivion.

The prefix system doesn't apply in cases like this either because when you specify "new script" you are the one supplying the entire filename. The CK does NOT attach your prefix ahead of that.

With topic info scripts that the CK generates in this form: TIF__0100A1CB.pex

It isn't as unlikely as you might think for 10 mods to each have a form ID of 0100A1CB since the CK generates them in a more or less sequential manner. Fortunately for fragments, the prefix does get applied, so ARTH_TIF__0100A1CB.pex is different from ARTI_TIF__0100A1CB.pex and you get no overlap. Except for the possibility of overlapping yourself. Which is why it then becomes very useful to further differentiate the filename by adding something in between the empty underscores. Quest, Package, Scene, and every other fragment type insert the name of the object the script becomes part of in that space. Only the topic infos got left out of that scheme. Unfortunately dialogue is also the most likely thing we could all step on each other with.

Good naming practices don't just benefit us as a collective. It becomes that much easier for you to distinguish your own work from vanilla and makes it easier to separate one mod from another if you happen to be someone who churns out a lot of mods.
User avatar
Lisha Boo
 
Posts: 3378
Joined: Fri Aug 18, 2006 2:56 pm

Post » Wed Jun 20, 2012 1:52 am

With topic info scripts that the CK generates in this form: TIF__0100A1CB.pex
Please do not kid of me. I already have such file name in my mod ;D
User avatar
REVLUTIN
 
Posts: 3498
Joined: Tue Dec 26, 2006 8:44 pm

Post » Wed Jun 20, 2012 6:33 am

Hmn...those fragments are primarily used to keep track of which topics are active, right? Like "If you've already asked about such-and-such, switch to this topic next" kind of thing?
User avatar
Conor Byrne
 
Posts: 3411
Joined: Wed Jul 11, 2007 3:37 pm

Post » Wed Jun 20, 2012 5:29 am

No, those fragments in dialogues contain code that usually changes things in game.

Let's say that NPC asks you whether to build a house in particular place. And you have two options: YES and NO.
If you choose YES, then script fragment for this topic executes actual papyrus function which enables that building in the world.
Scripts fragments are just like normal scripts that can make an impact on everything.
User avatar
loste juliana
 
Posts: 3417
Joined: Sun Mar 18, 2007 7:37 pm


Return to V - Skyrim