|
Re: [Tutorial] Main Campaign Modding
[Re: Rhidian]
#574903
09/11/15 01:05 PM
09/11/15 01:05 PM
|
Joined: Nov 2015
Posts: 3
Dindono
stranger
|
stranger
Joined: Nov 2015
Posts: 3
|
Hello,
Thank you Rhidian for all the info. I am currently working and learning about charscripts, and I found this post to be the most useful regarding the subject. Charscripts appears to be the most effective way to script NPC state management and routines -like habits, patrols- that can be overrided/suspended by Osiris whenever a Player interact with said NPC. I have found using Osiris alone doesn't give me enough freedom because some Osiris calls (CharacterUseItem, (Proc)CharacterMoveToTrigger...) override everything, including NPC generic behaviors like reactions to stealing and vandalizing. This is the reason why I want to experiment with charscripts.
I actually have a hard time implementing it. I have followed Rhidian's instructions: I created a Package under my Mod in the Resource Manager and imported my created charscript into it... which allows me to add the script in the SideBar properties of the NPC Character. Unfortunately, with such a configuration, whenever I playtest the game in the editor, I receive a ton of errors non-stop: "Attempted to read or write protected memory. This is often an indication that other memory is corrupt".
So I kind of know where this error comes from. The content of the Main infrastructure is read-only and shouldn't be messed up with... but I don't understand why it throws this error in this specific scenario...?
There are things I should add to better describe the situation: - In the Resource Manager, I first tried to import my charscript into the Main/Assets/Scripts/Scripts package. Thus I could add the script to the Character, but it throwed the memory error. - Then I moved the script into a newly created package under the Mod ID -as described here- so that I thought it won't mess up with the Main package. But the error was still throwned whenever I add the charscript to the Character and hit Play. - I have tried it with and without the patched LSToolFramework.dll in order to remove the main module protection. I used the Steam Verify Cache after deleting the dll to recover the proper one, so I tried with both, to no avail.
At this point I am quite clueless about what to do. I might try to do a backup of my Mod Data and try again on a fresh install of the Divinity Engine.
I'll report my findings, meanwhile if anyone have a clue about what's happening with this error in this context, I'll be very happy :)
Good day
|
|
|
Re: [Tutorial] Main Campaign Modding
[Re: Dindono]
#575006
10/11/15 05:32 AM
10/11/15 05:32 AM
|
Joined: Apr 2013
Posts: 459
Norbyte
addict
|
addict
Joined: Apr 2013
Posts: 459
|
Hello, "Attempted to read or write protected memory. This is often an indication that other memory is corrupt".
So I kind of know where this error comes from. The content of the Main infrastructure is read-only and shouldn't be messed up with... That is not what the error message means. It means that the native code encountered an unhandled error that the editors .NET runtime caught and re-threw as a managed exception (and as a side effect prevented it from crashing completely). ... so it can be anything; maybe one of the materials is not assigned? the story was not compiled beforehand? you're missing one of the main characters? Literally anything. Unfortunately the error doesn't give as much insight into what exactly is the problem 
|
|
|
Re: [Tutorial] Main Campaign Modding
[Re: SniperHF]
#575749
18/11/15 10:17 PM
18/11/15 10:17 PM
|
Joined: Nov 2015
Posts: 3
Dindono
stranger
|
stranger
Joined: Nov 2015
Posts: 3
|
Hello, Late news! Problem solved. There was no need to reinstall &all. I simply made a mistake in the charscript, which throwed the error. It is now corrected. The catch is that When you import a script it will in my experience always throw the errors you described. A restart of the editor has always fixed this for me.
|
|
|
Moderated by Bvs, Devin at Larian, Dom_Larian, EinTroll, Elwyn, ForkTong, gbnf, Issh, Kurnster, Larian_QA, LarSeb, Lar_q, Lynn, Monodon, Mr. C, Raze, Stauff1138, Stephen_Larian, vometia
|
|
|