Author Topic: Retrieving resources references  (Read 527 times)

Legacy_Kato -

  • Hero Member
  • *****
  • Posts: 747
  • Karma: +0/-0
Retrieving resources references
« on: August 19, 2011, 02:43:24 am »


                Hi,

In the process of cleaning a huge module of unused ressources, I'm trying to determine wich npc(s) use(s) a specific convo, or wich convo uses a specific script etc...

Would there be a quicker method than examining the npcs and convos individually?

Thank you

Kato
               
               

               
            

Legacy_Lightfoot8

  • Hero Member
  • *****
  • Posts: 4797
  • Karma: +0/-0
Retrieving resources references
« Reply #1 on: August 19, 2011, 03:36:22 am »


               Interesting question and one I have never seen a good answer to.   So I am going to go out on a limb and try to give an answer.  This is something that I have been needing to do myself for a long time.  I am just lacking the time to dedicate to it.   Just keep in mind that the sugestions I am giving are untested by me.  So I am unsure what kind of resources may be missed in the process. 

steps:

  • create a new module. Make sure the first area has a unique name. meaning that the name for the area is not in the original module to be cleaned.

  • Set up the module proptries to match the original module.

       
    • Hak list
    • Talk table.
    • Event scripts.-move the event scripts to the module if needed.
  • Open the old module and export all of the areas to an ERF.

  • Open the new module and Inport the ERF.  

  • Figure out what was missed and export/inport them as needed.  

  • Do the same with each palette catagory If needed.

I think just doing the areas will get about 90% of what you need for the module.  Things that are dynamicly created via script may be missed. Scripts that are only called by another script will also be missed.  

But to answer your original question.  If you exported all of your NPC's and inported them into a clean module you would be able to see all of the scripts and conversations that where attached to them.

If you do try the entire module rout,  I would love to hear about the pit falls you run into.
               
               

               
            

Legacy_Kato -

  • Hero Member
  • *****
  • Posts: 747
  • Karma: +0/-0
Retrieving resources references
« Reply #2 on: August 19, 2011, 03:53:25 am »


               Sounds good, thank you Lightfoot. I'll have to try the entire mod rout, indeed...

Kato
               
               

               
            

Legacy_FunkySwerve

  • Hero Member
  • *****
  • Posts: 2325
  • Karma: +0/-0
Retrieving resources references
« Reply #3 on: August 19, 2011, 05:55:54 am »


               That's a terrible approach - no offense, lightfoot. Much better to use Moneo to scan resources for subresources. You'll get a complete listing that way, with no having to backtrack in an very error-susceptible search for missed resources.

I've been planning a post on using letoscript with Moneo for mass-editing modules. I'll see about working out an unused resources script to go with it. Could be a few days, though - HG is in the middle of a very big update.

Funky
               
               

               
            

Legacy_Lightfoot8

  • Hero Member
  • *****
  • Posts: 4797
  • Karma: +0/-0
Retrieving resources references
« Reply #4 on: August 19, 2011, 06:53:09 am »


               @Funky,

No offence taken.
               
               

               
            

Legacy_Kato -

  • Hero Member
  • *****
  • Posts: 747
  • Karma: +0/-0
Retrieving resources references
« Reply #5 on: August 19, 2011, 05:14:49 pm »


               Oh, very nice, thanks Funky!

Kato
               
               

               


                     Modifié par Kato_Yang, 19 août 2011 - 04:28 .
                     
                  


            

Legacy__Guile

  • Hero Member
  • *****
  • Posts: 1308
  • Karma: +0/-0
Retrieving resources references
« Reply #6 on: August 22, 2011, 06:16:38 am »


               Yeah exporting areas into an ERF is guaranteed to bring you a whole lot more work than digging through conversations, besides, if you didn't build the module and there is 500+ script (mine usually have 2000+) sorting things out could be a real nightmare!

Have you performed a build module using the advanced box to search for missing resources?
               
               

               


                     Modifié par _Guile, 22 août 2011 - 05:20 .
                     
                  


            

Legacy_Kato -

  • Hero Member
  • *****
  • Posts: 747
  • Karma: +0/-0
Retrieving resources references
« Reply #7 on: August 22, 2011, 05:10:04 pm »


               Yes, of course, thank you Guile. Using Moneo to scan ressources as suggested by Funky has solved the problems I had, though.

Kato
               
               

               
            

Legacy_FunkySwerve

  • Hero Member
  • *****
  • Posts: 2325
  • Karma: +0/-0
Retrieving resources references
« Reply #8 on: August 22, 2011, 05:16:10 pm »


               One issue that neither of those methods can address completely is script spawnins, just so you're aware. Any complete check would also have to parse all the mod scripts for strings, looking for CreateObjects and the like. This is nearly impossible to automate, because of the different ways resrefs can be stored in code - nevermind databased information.

Funky
               
               

               
            

Legacy_acomputerdood

  • Sr. Member
  • ****
  • Posts: 378
  • Karma: +0/-0
Retrieving resources references
« Reply #9 on: May 01, 2012, 05:37:39 pm »


               

FunkySwerve wrote...

That's a terrible approach - no offense, lightfoot. Much better to use Moneo to scan resources for subresources. You'll get a complete listing that way, with no having to backtrack in an very error-susceptible search for missed resources.

I've been planning a post on using letoscript with Moneo for mass-editing modules. I'll see about working out an unused resources script to go with it. Could be a few days, though - HG is in the middle of a very big update.

Funky


was this moneo script ever released?  i skimmed through your "mass editing" sticky, and i didn't see 
anything alluding to this effect.  i also didn't see one of the provided letoscripts that looked complex enough to accomplish something like this.

i'm growing concerned that my module is at 16,005(ish) resources now in the temp0 directory, and i really don't consider it bigger than some of the modules you guys are talking about.  i have a feeling there's a bunch of junk sitting in there i don't think is needed.

how safe is it to go by the "unused resources" checkbox and just delete stuff based on that list?  mine's like a mile long.  i would guess that creature blueprints on the list can't be trusted because most of my monsters are spawned via some waypoint spawning system, but the list should be legit for scripts, right?
               
               

               
            

Legacy_Kato -

  • Hero Member
  • *****
  • Posts: 747
  • Karma: +0/-0
Retrieving resources references
« Reply #10 on: May 01, 2012, 07:23:05 pm »


               

acomputerdood wrote...

was this moneo script ever released?  i skimmed through your "mass editing" sticky, and i didn't see 
anything alluding to this effect.  i also didn't see one of the provided letoscripts that looked complex enough to accomplish something like this.

i'm growing concerned that my module is at 16,005(ish) resources now in the temp0 directory, and i really don't consider it bigger than some of the modules you guys are talking about.  i have a feeling there's a bunch of junk sitting in there i don't think is needed.

how safe is it to go by the "unused resources" checkbox and just delete stuff based on that list?  mine's like a mile long.  i would guess that creature blueprints on the list can't be trusted because most of my monsters are spawned via some waypoint spawning system, but the list should be legit for scripts, right?


You might have to write your own tailored Moneo script, since there are several different resource categories to check(areas, creatures, placeables etc...) but if you're comfortable with coding it should be easy considering the numerous resource scanning examples provided in the sticky, including the ones pointed by the provided links.

Wichever your method, for scripts, you should run a text search for the dubious ones, since they could potentially be called through ExecuteScript() from any other script(s). For objects, you should do the same, searching for refs and/or tags since they could be used by CreateObject(), CreateItemOnObject etc...

Hopefully this can help, although no doubt Funky will have more recommendations...



Kato
               
               

               


                     Modifié par Kato_Yang, 01 mai 2012 - 06:36 .
                     
                  


            

Legacy_Lightfoot8

  • Hero Member
  • *****
  • Posts: 4797
  • Karma: +0/-0
Retrieving resources references
« Reply #11 on: May 01, 2012, 09:32:48 pm »


               

acomputerdood wrote...

how safe is it to go by the "unused resources" checkbox and just delete stuff based on that list?  mine's like a mile long.  i would guess that creature blueprints on the list can't be trusted because most of my monsters are spawned via some waypoint spawning system, but the list should be legit for scripts, right?


No,  That list is tottaly untrust worthy.   The only thing you can get from that list is that the scan did not see it used.  But just like your blueprints, Just because a script is not directly attached to an object, does not mean thai it is not indirecty used.
               
               

               
            

Legacy__Guile

  • Hero Member
  • *****
  • Posts: 1308
  • Karma: +0/-0
Retrieving resources references
« Reply #12 on: May 03, 2012, 07:43:34 am »


               I had to migrate a module one time, into a new module, there were far too many scripts & resources for the module, it was a nightmare sorting through everything, to say the least...

Inexperienced builders often bloat their palette not realizing the resource limit, I have a tendency to bloat my # of scripts, but I fixed that tremendously by cutting down the number of redundant scripts through integration into better scripted systems, but it cost me building module time, for building scripts takes much more time now.  '<img'>

It's tough to find a solid way to do things, it's even tougher to refine everything...

With experience you learn to avoid mistakes, mistakes you never want to make again. '<img'>

I have to say NWN has been quite an experience for me, building & playing, definitely...

You grow as you learn, you become a better builder / scripter as time goes on...

Just keep hacking away at it mate, you will figure things out in due time.. '<img'>
               
               

               
            

Legacy_acomputerdood

  • Sr. Member
  • ****
  • Posts: 378
  • Karma: +0/-0
Retrieving resources references
« Reply #13 on: May 04, 2012, 06:20:11 pm »


               for anyone interested, i started a new thread in the builder's forum about my question here:

http://social.biowar...index/11860583/

only cross-posting it here because this forum seems a little more active than the other and i'm sure some of you have opinions on the topic '<img'>