Jump to content

Optimizing Mod/Script


AFGMAlpha

Recommended Posts

Continuing from here (as suggested by mcgoy) since my mod is working now, just trying to optimize the mod/script.

-----

 

If you haven't done the displayfloaty test, then go ahead and do that before you decide which option to use.

 

The first thing to realize is that your program/script will run almost every time (possibly every time) an EVENT occurs (for a list see: http://social.bioware.com/wiki/datoolset/index.php/Category:Event_types). I believe it is my responsibility to make sure that my mods run as rarely as possible and efficiently as possible. How many mods do you have installed and how often do they 'run'? I ended up deleting almost all of the equipment mods - even those I liked - because so many were adding 'just a little more' lag and when you added them all together.... It became noticeable.

 

So how to prevent/reduce lag:

1) PRCSCR to run the script. This is my preferred option for a small mod like yours that adds something to one area and one area only. Using PRCSCR means that the script will run only once each time you enter the specific area. It can be a bit finicky and you may not be able to put the chest in the templar quarters based on areas, area lists, and such that just give me a headache to think about. But could you put the chest in the area where the quartermaster is? Your call on what is most important. For efficiency and least possible increase in lag, I believe it is the way to go. For more information go to: http://social.bioware.com/wiki/datoolset/index.php/PRCSCR_Script_Templates

 

2) Plot flags. Check a flag such as 'ITEM_PLACED' when you first enter the script. If 'ITEM_PLACED' TRUE, then you just execute a few lines of code and exit the script. If ITEM_PLACED FALSE, then you execute additional lines to see if it has already been placed, etc etc - and set ITEM_PLACED TRUE when the item is placed.

 

3) Areaid - Same concept, check the areaid and execute only if you are in the correct area no reason to check IsObjectValid if you are in Lothering.

 

4) Combination AreaID & Plot Flags - I created a little mod for my own use that puts Origin specific items in chest in all of the different Origins (and Ostagar). I checked the Origin and area to determine which items to place where. When I had placed the chest, I set a flag "ORIGIN_COMPLETE" and would exit the program "before Ostagar". In Ostagar, it would place the chest and then set a flag to COMPLETE. For the remainder of the game, it checks one flag (COMPLETE) and then exits the script. I keep telling myself that I should go back and find a way to do it with PRCSCR, but it works the way it is. And someday I might get ambitious and decide to add equipment chests in each area that a Companion is met and/or recruited.

 

Now that you have a working mod (woohoo!), I suggest adding lines/scripts for efficiency. I can't be a huge help on PRCSCR files because they don't always like me. I like THEM from an efficiency standpoint, but they don't always seem to like me! :wink:

 

Going to do the displayfloaty test now, PRCSCR or Plot looks like a good way to go.

 

EDIT: Ran around on another character that was outside the tower and the message appears most of the time unless I went into a conversation, then it'd be gone, but for the most part, the message would just be over my head between 2-6 lines.

Edited by AFGMAlpha
Link to comment
Share on other sites

Yep, that is what you can expect unless you are running it from a PRCSCR file. Those lines will just keep appearing which means that your script is running. If you go the PRCSCR route, you can do a comparison and see how rarely you see those lines.

 

And the PRCSCR file might work in the Templar's Quarters - you're right, it DOES make sense for them to be there. You can always try, and if it doesn't work then you move it down to the Quartermaster's area.

 

And if I didn't say it.... when you start working on the PRCSCR file, you remove your script name from 'Manage Modules/Script' and just leave it blank.

Link to comment
Share on other sites

Not sure if I'm understanding this correctly, but I basically want to make the example from here (with my script name and correct area), then toss it in the ExcellProcessor.exe and place it in my module's override folder? Edited by AFGMAlpha
Link to comment
Share on other sites

yep, pretty much. and you might want to download, I think it is GDApp which lets you modify a GDA file directly. After I have the first one through excelprocessor, I usually modify them directly. I'll look for it if you can't find it with a search.

 

 

Added: http://social.bioware.com/project/755/

I went ahead and looked it up for you

Edited by mcgoy
Link to comment
Share on other sites

yep, pretty much. and you might want to download, I think it is GDApp which lets you modify a GDA file directly. After I have the first one through excelprocessor, I usually modify them directly. I'll look for it if you can't find it with a search.

 

Got a link for it, but when I drop "PRCSCR_afgm_armor1.xls" file on the ExcellProcesssor.exe, I don't get a .GDA file or anything.

 

Nevermind, supposedly ExcellProcessor doesn't like OpenOfficeCalc lol I'll try Google Docs

Edited by AFGMAlpha
Link to comment
Share on other sites

You don't have excel? If not, I'll look up a PRCSCR file and give you the layout so that you can use GDApp to create it. Give me 30-60 minutes, I need to finish something up before I start playing with toys

 

I do not, just OpenOffice and I just got done trying multiple ways of creating the .GDA file with no luck.

 

I'd appreciate it, thanks. Downloading GDApp now while I wait.

 

EDIT: Think I made one correctly myself, gonna test it now and see if it works.

 

EDIT 2: Loaded up my save in the previous area to the Templar Quarters and didn't get any displayfloaty messages, then I entered the Templar Quarters and had "storage script running" or whatever and then under it "storage chest created", each only once. Checked to see if the armor stand was there, it was and I could get the items from it. DID I WIN, COACH?!

Edited by AFGMAlpha
Link to comment
Share on other sites

woohoo! success! Test it a few times (make sure you're using an ID in the PRCSCR that is big enough to be unique) and then you can say that you're done!

 

Yeah I did, one of the pages on the wiki said BioWare used 0-1 million, so I went with 100075.

 

Thank you very much for all the help, I'll be sure to give thanks on my mod page (so scrubs like me can send you PMs for help lol). :)

Link to comment
Share on other sites

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...