Author Topic: Perl script regquest. Two actually.  (Read 1746 times)

Legacy_Bannor Bloodfist

  • Hero Member
  • *****
  • Posts: 1578
  • Karma: +0/-0
Perl script regquest. Two actually.
« Reply #15 on: June 20, 2011, 02:05:45 pm »


               well, dm client feedback in nwn sucks, no way to tell if the damned thing is actually running the script or not.

I changed the texture names as needed.  loaded it up via nwnx2, then logged in as dmclient. then enabled debug mode, ran command "dm_runscript sh_mdlchange" without quotes, get message success, but no files are written anywhere.

If, as you say, this thing takes a long time on a single mdl file, it won't help me anyway, as I have over 950 mdl files to process so this will likely tie up the computer for a very long time.

Don't take me wrong ShaDoW, I do appreciate you trying to help out.
               
               

               
            

Legacy_Shadooow

  • Hero Member
  • *****
  • Posts: 7698
  • Karma: +0/-0
Perl script regquest. Two actually.
« Reply #16 on: June 20, 2011, 05:30:23 pm »


               

Bannor Bloodfist wrote...

well, dm client feedback in nwn sucks, no way to tell if the damned thing is actually running the script or not.

I changed the texture names as needed.  loaded it up via nwnx2, then logged in as dmclient. then enabled debug mode, ran command "dm_runscript sh_mdlchange" without quotes, get message success, but no files are written anywhere.

If, as you say, this thing takes a long time on a single mdl file, it won't help me anyway, as I have over 950 mdl files to process so this will likely tie up the computer for a very long time.

Don't take me wrong ShaDoW, I do appreciate you trying to help out.

The script will start automatically when you load module and thats why all debugging informantions are written into logs.0/nwserverlog1.txt as I already said. (I did it this way as its fastest for testing, logging in as PC/DM and then do something is quite slow. So check that log file first.

Its was approximately 30sec for 5k lines model file.
               
               

               
            

Legacy_Bannor Bloodfist

  • Hero Member
  • *****
  • Posts: 1578
  • Karma: +0/-0
Perl script regquest. Two actually.
« Reply #17 on: June 21, 2011, 03:40:45 am »


               well, the logs are full, with the statement that the file is not in ascii format.  They are, all of them.  So your test is failing, you need to search for #MAXMODEL ASCII but not by specific line location.  It could be anywhere in the first 5 or six lines.  Anything with a $ is a comment line, so just finding that text anywhere in the mdl will work.

Since the sh_mdlchange is searching for #MAXMODEL ASCII in line one only, all files fail.  So no actual processing is occurring.
               
               

               
            

Legacy_Shadooow

  • Hero Member
  • *****
  • Posts: 7698
  • Karma: +0/-0
Perl script regquest. Two actually.
« Reply #18 on: June 21, 2011, 03:46:51 am »


               

Bannor Bloodfist wrote...

well, the logs are full, with the statement that the file is not in ascii format.  They are, all of them.  So your test is failing, you need to search for #MAXMODEL ASCII but not by specific line location.  It could be anywhere in the first 5 or six lines.  Anything with a $ is a comment line, so just finding that text anywhere in the mdl will work.

Since the sh_mdlchange is searching for #MAXMODEL ASCII in line one only, all files fail.  So no actual processing is occurring.

I see, didnt know that. The best would be if you upload all those files what do you want to replace and I modify the script and run it...
               
               

               
            

Legacy_Bannor Bloodfist

  • Hero Member
  • *****
  • Posts: 1578
  • Karma: +0/-0
Perl script regquest. Two actually.
« Reply #19 on: June 21, 2011, 06:09:36 am »


               I sent you a PM asking for an email addy.
               
               

               
            

Legacy_Borden Haelven

  • Hero Member
  • *****
  • Posts: 681
  • Karma: +0/-0
Perl script regquest. Two actually.
« Reply #20 on: June 21, 2011, 01:19:06 pm »


               Might be a silly suggestion but:-

Try using a regular mass text replacer to find and replace

bitmap tctl0_grass02
orientation 0 0 0 0
alpha 1

including carraige returns

with:-

bitmap tctl0_grass02
orientation 0 0 0 0
alpha 0.8

Might be worth a try...
               
               

               
            

Legacy_Bannor Bloodfist

  • Hero Member
  • *****
  • Posts: 1578
  • Karma: +0/-0
Perl script regquest. Two actually.
« Reply #21 on: June 21, 2011, 01:58:09 pm »


               Won't work, too many variations in the tiles, for example the bit map name is 7-9 lines below the alpha line, and the rest of the lines in-between can be different.  The export routines in 3dsmax, export by order of creation or change while working on the tile.  So, if someone adjusted something else in between, the orientation can be above, OR below the bitmap line,  The "center" location is almost always different depending on size and position of water plane etc...

I truly wish it was otherwise or I never would have asked for a set of scripts to help with this.
               
               

               
            

Legacy_Lightfoot8

  • Hero Member
  • *****
  • Posts: 4797
  • Karma: +0/-0
Perl script regquest. Two actually.
« Reply #22 on: June 21, 2011, 02:20:18 pm »


               @ Bannor Bloodfist:  What OS are you useing?
               
               

               
            

Legacy_Bannor Bloodfist

  • Hero Member
  • *****
  • Posts: 1578
  • Karma: +0/-0
Perl script regquest. Two actually.
« Reply #23 on: June 21, 2011, 02:30:30 pm »


               

Lightfoot8 wrote...

@ Bannor Bloodfist:  What OS are you useing?


XP SP3.
               
               

               
            

Legacy_Baragg

  • Sr. Member
  • ****
  • Posts: 496
  • Karma: +0/-0
Perl script regquest. Two actually.
« Reply #24 on: June 21, 2011, 09:37:00 pm »


               You fellas are on a level way over my head.
               
               

               
            

Legacy_Borden Haelven

  • Hero Member
  • *****
  • Posts: 681
  • Karma: +0/-0
Perl script regquest. Two actually.
« Reply #25 on: June 21, 2011, 10:53:29 pm »


               Sorry I couldn't help. 'Posted
               
               

               


                     Modifié par Borden Haelven, 21 juin 2011 - 09:57 .
                     
                  


            

Legacy_Calvinthesneak

  • Hero Member
  • *****
  • Posts: 1159
  • Karma: +0/-0
Perl script regquest. Two actually.
« Reply #26 on: June 22, 2011, 12:21:50 am »


               I appreciate the situation Bannor is in, because I've been  there myself.  Hundreds or thousands of ACII mdls to edit, and it's really dull and tedious.  I know it's possible to script up PERL or Python to do it, it's just not easy.  I could probably do it given several weeks to research the languages since I've done almost no programming with them.  Fortunately for me, most of my editing has been simpler and with Wildcards in Useful File utilities I've been able to manage even multi line edits.

Sadly what Bannor is looking for is just a bit too complex to really be done there because of variable spacing.  Hopefully virusman gets him sorted.
               
               

               
            

Legacy_Lightfoot8

  • Hero Member
  • *****
  • Posts: 4797
  • Karma: +0/-0
Perl script regquest. Two actually.
« Reply #27 on: June 29, 2011, 05:09:07 pm »


               bump.

Where you still needing a solution for this Bannor.  
I am comming close to a solution for this via HLA.  

hopefully I will have time to compleate it tonight after I get home from work.
               
               

               
            

Legacy_Shadooow

  • Hero Member
  • *****
  • Posts: 7698
  • Karma: +0/-0
Perl script regquest. Two actually.
« Reply #28 on: June 29, 2011, 05:42:54 pm »


               yeah sorry Bannor but I havent make any progress on my solution, its going to be especially complicated when you stated that the position of the "alpha" dont have to be always below bitmap which is quite problematic to script then.

It is possible to do via my method, but nwscript isnt really made for this so its very tough to script it...

Sh
               
               

               
            

Legacy_Bannor Bloodfist

  • Hero Member
  • *****
  • Posts: 1578
  • Karma: +0/-0
Perl script regquest. Two actually.
« Reply #29 on: June 29, 2011, 06:18:09 pm »


               Oh, completely forgot that this topic was still open.

Actually, having a script would still be useful, but I don't think nwscript can handle it ShaDoOow, I really appreciate you attempting it, but we found too many inconsistancies in the various mdls.  IT seems that things can change easily, and are affected by access order/link order in the individual mdl file.  So, if I were to open a tile, edit an object, it would change placement of the various options for the graphics bits, the alpha, luminosity, shininess etc... and put those lines in different locations.  Likely, that could be changed, all at once, meaning just do a complete replacement of about 8-10 lines of text in the node, and make them all the same, but it just wasn't worth the effort for that.  

Olias Stormcrow had a professional text editing apllication that allows for conditional testing, and replacement, he processed the tiles for me manually.  His app, whatever it was, could not handle all of the tiles in question, but it did severely cut down on the ones that required manual intervention.  This actually turned out to be a good report anyway, as it pointed out some other errors in those specific tiles which required different fixes anyway.  Things that likely would have been missed.

Since I only have about 15-20 left to work on, I can handle these by hand now.

Thanks for the offers guys, it is appreciated, but no longer really necessary, although, someone might be able to use a script like that to make mass changes in other tilesets too.

IF you are still interested in attempting this, I can maybe help identify what lines are actually required for each instance, and just make it a quick search for node with bitmap, and replace everything between node and verts in the mdl.  Everything after the vert can NOT be changed as it affects the uvw-mapping on the object, and is encoded somehow.