How do I overwrite a scene?

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By Kingdud

I am not a developer. I’m trying to make a mod for a game that supports it. We have a scene, called ‘sceneA.tscn’, it lives at ‘res://path/to/sceneA.tscn’

SceneA is NOT a full-screen element. Rather, it is just one piece of the overall HUD in the game. So, think numerical health display vs an HP bar.

So I go, and I make my own version of the scene and call it ‘sceneA.tscn’ , making sure all internal reference names/tags/script calls are the same, so that everything should, in theory, ‘just work’.

My end goal is that I should be able, according to the docs, to call ‘take_over_path’ via something like this:

_imported_scene = ResourceLoader.load("res://mySceneMod/path/to/sceneA.tscn")
_imported_scene.new()
		
_imported_scene.take_over_path("res://path/to/sceneA.tscn")

and in theory all the HP number displays in the game, on every screen, should be replaced with my HP bars. But that doesn’t happen and I don’t understand why. Can anyone shed some light on what’s going on?

Which game are you trying to mod? Maybe the developer of that game can help you? Is your idea to modify the PCH file?

Did you read through this part of the documentation - Exporting packs, patches, and mods — Godot Engine (stable) documentation in English ?

Juxxec | 2022-11-29 21:10

:bust_in_silhouette: Reply From: LordBoots

Is there any reason you can’t just save the scene with the same name to the original scene’s location?

I did try to do that. Specifically what I did was create a .zip with the .tscn at the same folder path and with the same name as in the base game, and drop that in the game’s root directory. I didn’t see a way to create a blank godot project where I could import just the one scene and leave all of its dependencies out and have it work, but maybe I’m just an idiot? The reason to create the blank project would be so I could create a new .pck file instead of a .zip.

From what I understand of Godot’s documentation, the game maker has to put support in for loading different .pck files other than the main one for the game, and I don’t think the game dev put that there.

It’s entirely possible I missed some small detail and what your proposing actually does work, and I’m just not seeing the 1-2 extra steps I need. I just have no idea what those steps actually are. :confused:

Kingdud | 2022-12-03 15:22

I’ll have a look through the documentation for you but I can’t promise anything as I’m no expert. I’ve been answering a few of these questions over the past few hours to test my knowledge and hopefully get a couple people on their way to success.

I think maybe you are missing a step or a setting, if it’s stated in the documentation it’s doable then there’s probably something missing. I’ll get back you you soon with what I discover (if anything). There’s a good possibility it’s one of those things we have to write ourselves. Might be time for me to figure out the C languages.

LordBoots | 2022-12-03 16:34