Overwriting default scripts
nwfan87
Member Posts: 99
I'm sure it has happened to others, but I think that in the process of importing erf. I might have accidently overwritten some key piece of coding that deals with the behavior of the PC and NPC's
Is there a way to reimport the default NWN scripts to overwrite any that were changed?
For a risky procedure such as this, I would be sure to make a back up first before trying!
Is there a way to reimport the default NWN scripts to overwrite any that were changed?
For a risky procedure such as this, I would be sure to make a back up first before trying!
0
Comments
TR
With the ERF. I know that at some stage I might have chosen to override some of the scripts when importing the files, so that might have been the problem? I'm quite sure that also included default scripts.
My idea was to find someway of getting all of NWN EE's default script and putting them in some sort of ERF and importing that into the module and overriding all the default scripts. There has to be a default script that deals with the JumpToObject Function.
Most likely something else is wrong with the script that isn't working.
No chance that when the toolset crashes it causes damage to the mod file?
While The Sherlock Maxim is very useful, you should never discount Occam's Razor: (Edited to add): If you ever accidentally overwrite a default script, my understanding is that the script still exists but is overridden by your same-named script. If you delete your same-named script, then it should be possible to once again select the default script and attach it to an event.
A moment of victory this morning when I finally got the thing to work! Turns out it was a combination of factors.
Though I don't like posting exact script online, these were the problems I was having:
1) order of functions
My particular script is quite complicated with many things happening in one script + the JumpToObject. I found that by moving the definitions and jump action to the top of the sequence, even putting stuff that happen before the function after the function is executed, seemed to help
2) This line here: if (GetAreaFromLocation(lLocation2)==OBJECT_INVALID) return;
Turned out to stop the rest of the script from firing, which lead to
3) Invalid Area
I duplicated the area which may or may not have had a fundamental issue. After this I:
4) Deleted added a new waypoint with a new tag
I know that sometimes, for some reason, the engine can get confused over long tags or sometimes they just break.
5) double checked my code with another similar code that works
Turned out I had made some errors such as using JumpToLocation, and using an incorrect tag.
6) It was my fault
Not much else to say, all the time I blamed the system and it was my own oversights. Just the one line or tiniest typo. But the important thing that makes me happy, is that the script now works and I can move on, without thinking something is catastrophically wrong with the mod file.
Thank you all for your help again!
Note. EE may or may not have altered that size. Without a lot more searching, I don't know if it has or not.
TR
I just tags short and simple