ModShardTeam / ModShardTeam/ModShardLauncher
[BUG] Specific .gml Fails to Enable Correctly
Nobody has claimed this yet.
- Dominant language
- C#
- Stars
- 55
- Forks
- 13
- PR merge metrics
- No merged PRs in 30d
Description
Describe the Bug :
A .sml file with this code:
Msl.LoadGML("gml_GlobalScript_scr_unitTurnPositionEvents")
.MatchFrom("var _isGround = scr_is_ground_unit(x, y)")
.InsertBelow("")
.Save();
yields this error:
System.Exception: GML Compile Error: Errors parsing code when trying to compile modified "gml_GlobalScript_scr_unitTurnPositionEvents":
Expected assignment operator around line 40, column 13.
Unexpected end of code.
Unexpected end of code.
Unexpected end of code.
Unexpected end of code.
Unexpected end of code.
Unexpected end of code.
at UndertaleModLib.Models.UndertaleCode.ReplaceGML(String gmlCode, UndertaleData data) in D:\UndertaleModToolCE-master\UndertaleModLib\Models\UndertaleCode.cs:line 1585
at ModShardLauncher.Msl.Save(FileEnumerable`1 fe)
at DraxisstheBookwyrm.DraxisstheBookwyrm.PatchMod()
at ModShardLauncher.ModLoader.PatchMods()
at ModShardLauncher.ModLoader.PatchFile()
at ModShardLauncher.Controls.ModInfos.Save_Click(Object sender, EventArgs e)
when I try to enable it. This issue is likely with other .gml files as well.
Steps To Reproduce :
Include my code in a new .sml file, then try to enable it through MSL.
Expected Behavior :
It is enabled normally.
Screenshots if applicable :
You can directly paste screenshots here, no need for external hosting.
...
Additional Information :
- Stoneshard Version : 0.9.2.12
- MSL Version : 0.13.2.0
Additional Context :
Add any other context about the problem here.
...
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with UndertaleModLib/Models/UndertaleCode.cs around line 1585, then follow the Msl.Save path shown in the stack trace. Reproduce with the supplied .sml snippet and the named gml_GlobalScript_scr_unitTurnPositionEvents code. Done means the mod enables without the reported GML compile errors and the relevant regression is covered.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- csharp
- Domain
- tooling
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100