CSharpRedotTools / Template

A template used for quickly setting up new Redot 4 C# games.
MIT License
111 stars 8 forks source link

Duplicate Mod Scripts Causing Errors #15

Open valkyrienyanko opened 4 months ago

valkyrienyanko commented 4 months ago

Description

When creating duplicate mods with identical script names, errors occur during runtime. This issue affects both C# and GDScript mods.

Steps to Reproduce

  1. Duplicate the res://Mods/Example Mod directory to res://Mods/Example Mod 2.
  2. Modify the id in the mod.json of the new mod from example_mod to example_mod_2.
  3. Run the game.

Expected Behavior

Both mods should load and execute without errors, printing unique greetings.

Actual Behavior

C# Mods

GDScript Mods

Observations

Proposed Solutions

  1. Switch to GDScript for Mods:

    • If GDScript does not have the same naming conflict issues, consider using GDScript for modding.
  2. Refactor C# Mod Loading:

    • Modify the mod loading logic to search for the first DLL file in the mod folder and load it. This might resolve DLL naming conflicts.

Additional Notes

Conclusion

The current mod loading mechanism needs to be revised to handle duplicate script names across different mods effectively. Switching to GDScript or refactoring the C# mod loading process are potential solutions to address this issue.