External Scripts Receiving Error in HSSE [SOLVED]

I was testing exporting a library but once I loaded a preset in HALion Sonic SE I’d immediately get a script error.

I’ve narrowed the issue down to the addLayerPassword function in the scripts. All of my script modules are protected using the addLayerPassword function at the top of the script. The password is the same as the password I used to protect the layer. To troubleshoot, I got rid of all other code except for the addLayerPassword. I noticed I only received the error if the scripts were external and not internally loading from the preset. If I implemented the script internally I no longer received any script error in HALion Sonic SE.
I’ve been using ZeroBrane to script but I can’t imagine that would be causing any problems since that is just being used to write the code. From other threads I’ve read on here and the manual it seems like all of this should work fine. I’m on the most recent versions of HALion 6 and HALion Sonic SE.

Any ideas what could be happening or how I could troubleshoot?

Thanks!

If you are accessing the program from the ui script you might need to use addLayerPassword in the ui script as well.

If you can post an excerpt of the script it might be easier to help.

Thanks for your reply.

For this program, I do not have a UI Script. All the scripts are Midi Module Scripts and they are loaded externally. I’ve tested this with nothing but the “addLayerPassword (“abc123”)” function in the script. I have multiple script modules in the program and they all have the password function at the top of the script. If I take everything out of the scripts but just leave the addLayerPassword at the top, protect the layer above it with the same password and then export the program as a library and bring up in HSSE, I get a script error.

If I take out the addLayerPassword and unprotect the layer above and export the program as a library, I do not receive the error.

I have added layer protection in the past with no problems and I’m not sure why I’m experiencing this now. I’ve trashed the preferences of HALion 6 and HALion Sonic SE, but to no avail.

Not at my pc at the moment, but I’ll try to put the code in here. But as I’ve said, I’ve had this issue with only the addLayerPassword in the script using a simple password and the layer protection is the same.

Thanks!

What exactly do you mean by protecting the layer above it.

I ask because usually the script module is above the layers it has to access.
It could be that Halion allows the layout you have, but HSSE doesn’t.

Have you tried opening the exported program in H6 in HSSE Edit mode to have a look at the structure?

Yeah, I’ve exported the program as an HALion Sonic SE layer and tested it. No errors. The errors seem to come when I export a library with that same preset. I’ve included in the export the script files. But for some reason when I export the library and load up the preset in HALion Sonic SE, I get script errors.

My program tree:
Program
…-Layer(this one is protected)
…-Top Layer
…-Script (with password)
…-Script (with password)
…-Midi Modules
…-Layer
…-Zone
…-Program Bus

The way I’ve protected the layers and scripts is what I’ve done in the past but have never had any issues…until now.

And opening the exported program in H6 in HSSE Edit mode results in no errors either…

I’ve tested this with a basic program preset and set it up with a similar structure but got the same results. I’ve compiled the files into a link below as to give a better understanding.

Link: Microsoft OneDrive - Access files anywhere. Create docs with free Office Online.

You will have to move the script module outside the of layer with the protection.

There was an update some time ago where H6 changed the way it deals with protection.
The password can’t be added if the script module can’t be reached due to being inside a protected layer.

If you want to protect your script module you have to do that under “options” in the top left corner of the library creator.

Oh, I didn’t realize that. That would make sense. I just tested it and as expected it works right.

Thanks so much for your help. I’ll fix my process and move forward.

Thanks, again!

Glad it worked.