Skip to content

Commit 38f456a

Browse files
H2xDevMickeon
andauthored
Patch v2.1.12 (#52)
* Inherit instantiated scenes properly to save disk space (#48) * Do not use text resources for import save extensions (#49) * Fix VMFConfig not loaded on project startup (#53) * Patch v2.1.12 --------- Co-authored-by: Micky <66727710+Mickeon@users.noreply.github.com>
1 parent 702f1e6 commit 38f456a

File tree

9 files changed

+10
-8
lines changed

9 files changed

+10
-8
lines changed

addons/godotvmf/entities/func_instance.gd

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ func assign_instance(instance_scene):
1515
queue_free();
1616
return;
1717

18-
var node = instance_scene.instantiate() as VMFNode;
18+
var node = instance_scene.instantiate(PackedScene.GEN_EDIT_STATE_MAIN_INHERITED) as VMFNode;
1919

2020
var i = 1
2121
for child: Node in get_parent().get_children():

addons/godotvmf/entities/prop_studio.gd

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ func _apply_entity(e: Dictionary) -> void:
2222
VMFLogger.error("Failed to load model scene: " + model_path);
2323
return;
2424

25-
var instance := model_scene.instantiate();
25+
var instance := model_scene.instantiate(PackedScene.GEN_EDIT_STATE_MAIN_INHERITED);
2626
instance.name = "model";
2727

2828
add_child(instance);

addons/godotvmf/godotmdl/import.gd

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ class_name MDLImporter extends EditorImportPlugin
44
func _get_importer_name(): return "MDL"
55
func _get_visible_name(): return "MDL"
66
func _get_recognized_extensions(): return ["mdl"];
7-
func _get_save_extension(): return "tscn";
7+
func _get_save_extension(): return "scn";
88
func _get_resource_type(): return "PackedScene";
99
func _get_priority(): return 1;
1010
func _get_preset_count(): return 0;

addons/godotvmf/godotvmf.gd

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,9 @@ func _enter_tree() -> void:
3838
entity_context_plugin = VMFEntityContextMenu.new();
3939
add_context_menu_plugin(EditorContextMenuPlugin.CONTEXT_SLOT_FILESYSTEM, entity_context_plugin);
4040

41+
VMFConfig.load_config()
42+
4143
func _exit_tree():
42-
remove_autoload_singleton("VMFConfig");
4344
remove_custom_type("VMFNode");
4445
remove_custom_type("ValveIONode");
4546

addons/godotvmf/godotvmt/vmt_import.gd

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ class_name VMTImporter extends EditorImportPlugin
44
func _get_importer_name(): return "VMT";
55
func _get_visible_name(): return "VMT Importer";
66
func _get_recognized_extensions(): return ["vmt"];
7-
func _get_save_extension(): return "vmt.tres";
7+
func _get_save_extension(): return "vmt.res";
88
func _get_resource_type(): return "Material";
99
func _get_preset_count(): return 0;
1010
func _get_import_order(): return 1;

addons/godotvmf/godotvmt/vtf_import.gd

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ class_name VTFImporter extends EditorImportPlugin
44
func _get_importer_name(): return "VTF";
55
func _get_visible_name(): return "VTF Importer";
66
func _get_recognized_extensions(): return ["vtf"];
7-
func _get_save_extension(): return "vtf.tres";
7+
func _get_save_extension(): return "vtf.res";
88
func _get_resource_type(): return "Texture";
99
func _get_preset_count(): return 0;
1010
func _get_import_order(): return 0;

addons/godotvmf/plugin.cfg

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,5 +3,5 @@
33
name="GodotVMF"
44
description="Allows use VMF files in Godot"
55
author="H2xDev"
6-
version="2.1.11"
6+
version="2.1.12"
77
script="godotvmf.gd"

addons/godotvmf/src/VMFNode.gd

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -389,7 +389,7 @@ func import_entities(is_reimport := false) -> void:
389389
var tscn = get_entity_scene(ent.classname);
390390
if not tscn: continue;
391391

392-
var node = tscn.instantiate();
392+
var node = tscn.instantiate(PackedScene.GEN_EDIT_STATE_MAIN_INHERITED);
393393
if "is_runtime" in node:
394394
node.is_runtime = is_runtime;
395395

readme.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,7 @@ Or for those who just want to port their map from Source Engine to Godot and see
5757
- [Echo Point](https://www.youtube.com/watch?v=z7LcKb0XRzY) by Lazy
5858
- [Vampire Bloodlines map example](https://www.youtube.com/watch?v=dV3nllCZYNM) by Rendara
5959
- [SurfsUp](https://store.steampowered.com/app/3454830/SurfsUp) by [@bearlikelion](https://github.com/bearlikelion)
60+
- [Team Fortress Jumper](https://github.com/Mickeon/team-fortress-jumper) by [Mickeon](https://github.com/Mickeon)
6061

6162
## Known issues
6263
- Extraction of materials and models from VPKs is not supported

0 commit comments

Comments
 (0)