This repository has been archived by the owner on Apr 28, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
96ccf3f
commit a1094b1
Showing
15 changed files
with
172 additions
and
22 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
extends "res://Menus/Editor/TDMspawnEditor.gd" | ||
|
||
var zspawn = preload("res://Objects/Game_modes/ZombieMod/zombieSpawner.tscn") | ||
|
||
func saveSpawnPoints() -> bool: | ||
var spawn_parent = $spawns | ||
var points = $editorSpawns.get_children() | ||
|
||
if points.size() == 0: | ||
return false | ||
|
||
var teams = [0,0] | ||
|
||
for i in points: | ||
if i .team_id == 0: | ||
var point = zspawn.instance() | ||
point.position = i.position | ||
teams[i.team_id] += 1 | ||
spawn_parent.add_child(point) | ||
point.owner = spawn_parent | ||
else: | ||
var point = spawn_point.instance() | ||
point.position = i.position | ||
point.team_id = i.team_id | ||
teams[i.team_id] += 1 | ||
spawn_parent.add_child(point) | ||
point.owner = spawn_parent | ||
|
||
if teams[0] == 0 or teams[1] == 0: | ||
var spawns = $spawns.get_children() | ||
for i in spawns: | ||
i.queue_free() | ||
return false | ||
|
||
remove_child(spawn_parent) | ||
var packed_scene = PackedScene.new() | ||
var result = packed_scene.pack(spawn_parent) | ||
var save_path = "user://custom_maps/gameModes/" + gameMode + "/" + game_server.serverInfo.map + ".tscn" | ||
if result == OK: | ||
ResourceSaver.save(save_path, packed_scene) | ||
else: | ||
push_error("An error occurred while saving the scene to disk.") | ||
spawn_parent.queue_free() | ||
return true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
[gd_scene load_steps=5 format=2] | ||
|
||
[ext_resource path="res://Menus/Editor/TDMspawnEditor.tscn" type="PackedScene" id=1] | ||
[ext_resource path="res://Menus/Editor/ZMspawnEditor.gd" type="Script" id=2] | ||
[ext_resource path="res://Menus/Editor/CT_icon.png" type="Texture" id=3] | ||
[ext_resource path="res://Menus/Editor/T_icon.png" type="Texture" id=4] | ||
|
||
[node name="ZMspawnEditor" instance=ExtResource( 1 )] | ||
script = ExtResource( 2 ) | ||
gameMode = "Zombie" | ||
|
||
[node name="ItemList" parent="uiLayer" index="0"] | ||
items = [ "Zombie", ExtResource( 4 ), false, "Counter Terrorist", ExtResource( 3 ), false ] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters