Cannot Use Custom Game Template

Started by TheVolumeRemote, Wed 05/06/2024 04:06:13

Previous topic - Next topic

TheVolumeRemote

Hey everyone! So, within the editor I created a template of my game. I then quit AGS, launched it again and tried to create a new game from my template and this is the error I'm getting:

Code: ags
Error: The process cannot access the file 'acsprset.spr' because it is being used by another process.
Version: AGS 3.6.1.24

System.IO.IOException: The process cannot access the file 'acsprset.spr' because it is being used by another process.
   at System.IO.Directory.DeleteHelper(String fullPath, String userPath, Boolean recursive, Boolean throwOnTopLevelDirectoryNotFound, WIN32_FIND_DATA& data)
   at System.IO.Directory.Delete(String fullPath, String userPath, Boolean recursive, Boolean checkHost)
   at AGS.Editor.GUIController.CreateNewGame(String newGamePath, String newFileName, String newGameName, GameTemplate createFromTemplate)
   at AGS.Editor.GUIController.ShowNewGameWizard()
   at AGS.Editor.GUIController.ShowWelcomeScreen()
   at AGS.Editor.frmMain.frmMain_Shown(Object sender, EventArgs e)
   at System.Windows.Forms.Form.OnShown(EventArgs e)
   at System.Windows.Forms.Form.CallShownEvent()
   at System.Windows.Forms.Control.InvokeMarshaledCallbackDo(ThreadMethodEntry tme)
   at System.Windows.Forms.Control.InvokeMarshaledCallbackHelper(Object obj)
   at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
   at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
   at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
   at System.Windows.Forms.Control.InvokeMarshaledCallback(ThreadMethodEntry tme)
   at System.Windows.Forms.Control.InvokeMarshaledCallbacks()

I've tried the following:

- Restart computer
- Run AGS as Admin
- Remove backup_acsprset.spr before creating template
- Checked task manager to make sure no instance of AGS was running
- Tried creating and loading the template on another PC with even more memory
- Changed the templates save path from the default C:\Users\me\AppData\Local\AGS\Templates
To where the preset templates are stored C:\Program Files (x86)\Adventure Game Studio 3.6.1

I'd appreciate any tips or help with this, thank you :)

Crimson Wizard

So, if you notice from this log, Editor is trying to do delete something.

Apparently, it tries to delete the created game folder in case something went wrong while creating it.
According to the program code, Editor is supposed to display a error message in that case, explaining the reason why it could not create a game from template. Do you get any messages like that?

Can you PM me your game template for a test?

Khris

Just in case this matters: Windows Defender isn't too fond of AGS unfortunately.
You should
a) upgrade to AGS 3.6.1 if you haven't already
b) add your main AGS folder to the list of exclusions

TheVolumeRemote

#3
Quote from: Crimson Wizard on Wed 05/06/2024 08:49:57Do you get any messages like that?

Hey CW and @Khris thanks for you help! I just now tried Khris' idea, adding AGS to the exclusions list and unfortunately it didn't work. Here is a screen grab of me creating the template and trying to launch it because it does throw up multiple errors. Meanwhile I will upload a copy of the template and PM you with it soon :)

https://www.dropbox.com/scl/fi/zuajv6h5h1c73bvjq7al0/template_example.mov?rlkey=62ocoozqsjryffj20d6bmkjfy&dl=0

Edit: Here's the 3 errors it throws up if you wanna skip the video (thought seeing the order of operations might help but its probably more superfluous)

1st error
Screenshot-2024-06-06-at-4-27-08-PM" border="0
2nd error (this is the one I put in code brackets in the OP)
Screenshot-2024-06-06-at-4-27-20-PM" border="0
3rd/final error
Screenshot-2024-06-06-at-4-27-30-PM" border="0


TheVolumeRemote

CW if these warning aren't enough direction to fix this, I'll send you my games template, just a heads up it's a gigantic 2.5gb file. I'll upload it asap and have it ready to DM you :)

Crimson Wizard

#5
Quote from: TheVolumeRemote on Fri 14/06/2024 22:53:53CW if these warning aren't enough direction to fix this, I'll send you my games template, just a heads up it's a gigantic 2.5gb file. I'll upload it asap and have it ready to DM you :)

I was just waiting for that template, I did not know it's that big.

I can see that there's some bad error during template extraction, and everything is likely a consequence of that, maybe the error occured during unpacking of the "acspreset.spr" file, and it got locked.

Maybe this is related to files being of big size. I will investigate the extraction function and see if anything may be wrong there.


TheVolumeRemote

I am so happy to report this fixed it! I had zero issues creating and launching a template with this replacement DLL. Thank you so much :)

Crimson Wizard

Very well; this fix will be included into the next 3.6.1 patch then.

SMF spam blocked by CleanTalk