fix: OutcropData.json
This commit is contained in:
@@ -52,7 +52,7 @@ def create_target_jsons():
|
||||
'id': 1,
|
||||
'x': last_position['x'],
|
||||
'y': last_position['y'],
|
||||
'type': last_position.get('type', 'target'), # Keep type, default to 'target' if not present
|
||||
'type': 'target', # Keep type, default to 'target' if not present
|
||||
'move_mode': 'walk'
|
||||
}
|
||||
new_data['positions'] = [simplified_position]
|
||||
|
||||
@@ -232,9 +232,9 @@ def generate_ley_line_data():
|
||||
target_x = format_coord(float(last_pos["x"]))
|
||||
target_y = format_coord(float(last_pos["y"]))
|
||||
|
||||
# Determine node type - default to blossom if type is not specified or is target
|
||||
# Determine node type - default to blossom for target or if not specified
|
||||
node_type = last_pos.get("type", "blossom")
|
||||
if node_type == "target":
|
||||
if node_type == "path":
|
||||
node_type = "blossom"
|
||||
|
||||
# Check if we already have a nearby node of the same type
|
||||
@@ -262,7 +262,6 @@ def generate_ley_line_data():
|
||||
"node": blossom_node,
|
||||
"file_path": file_path
|
||||
}
|
||||
|
||||
# Special handling for files with only target positions (like 纳塔4-溶水域-2.json)
|
||||
for file_path in pathing_files:
|
||||
file_name = os.path.basename(file_path)
|
||||
@@ -331,27 +330,29 @@ def generate_ley_line_data():
|
||||
|
||||
# For teleport source type, connect to destination
|
||||
if first_pos.get("type") == "teleport":
|
||||
# Find teleport node
|
||||
# 查找第一个点(传送点)
|
||||
x = format_coord(float(first_pos["x"]))
|
||||
y = format_coord(float(first_pos["y"]))
|
||||
teleport_node = find_nearby_node(nodes, x, y, "teleport")
|
||||
|
||||
# Find destination node
|
||||
# 查找最后一个点(目标点,通常是blossom)
|
||||
dest_x = format_coord(float(last_pos["x"]))
|
||||
dest_y = format_coord(float(last_pos["y"]))
|
||||
|
||||
# Determine node type, default to blossom for target or if not specified
|
||||
# 确定节点类型,默认为blossom
|
||||
dest_type = last_pos.get("type", "blossom")
|
||||
if dest_type == "target":
|
||||
if dest_type == "target" or dest_type == "path":
|
||||
dest_type = "blossom"
|
||||
|
||||
# 查找目标节点
|
||||
dest_node = find_nearby_node(nodes, dest_x, dest_y, dest_type)
|
||||
|
||||
# 如果找到了传送点和目标节点,则建立连接
|
||||
if teleport_node and dest_node:
|
||||
# Add connection
|
||||
# 添加相对路径
|
||||
relative_path = generate_relative_path(file_path, script_dir)
|
||||
|
||||
# Add destination to teleport's next array if not already there
|
||||
# 将目标添加到传送点的next数组中(如果尚未添加)
|
||||
route_exists = False
|
||||
for route in teleport_node["next"]:
|
||||
if route["target"] == dest_node["id"]:
|
||||
@@ -364,9 +365,18 @@ def generate_ley_line_data():
|
||||
"route": relative_path
|
||||
})
|
||||
|
||||
# Add teleport to destination's prev array if not already there
|
||||
# 将传送点添加到目标的prev数组中(如果尚未添加)
|
||||
if teleport_node["id"] not in dest_node["prev"]:
|
||||
dest_node["prev"].append(teleport_node["id"])
|
||||
|
||||
# 输出调试信息,帮助排查问题
|
||||
else:
|
||||
debug_info = f"无法连接传送点到目标: 文件={file_name}"
|
||||
if not teleport_node:
|
||||
debug_info += f", 未找到传送点({x},{y})"
|
||||
if not dest_node:
|
||||
debug_info += f", 未找到目标点({dest_x},{dest_y}, 类型={dest_type})"
|
||||
print(debug_info)
|
||||
|
||||
# Fourth pass: Connect nodes based on numerical sequence and handle branch paths
|
||||
for region_area, num_to_target in region_area_num_to_target.items():
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -13,7 +13,7 @@
|
||||
"id": 1,
|
||||
"x": 1333.25,
|
||||
"y": 266.26,
|
||||
"type": "path",
|
||||
"type": "target",
|
||||
"move_mode": "walk"
|
||||
}
|
||||
]
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"info": {
|
||||
"name": "蒙德2-清泉镇-3.5",
|
||||
"name": "蒙德2-清泉镇-4-1",
|
||||
"type": "collect",
|
||||
"author": "ddaodan",
|
||||
"version": "1.1",
|
||||
@@ -0,0 +1,19 @@
|
||||
{
|
||||
"info": {
|
||||
"name": "蒙德2-清泉镇-4-2",
|
||||
"type": "collect",
|
||||
"author": "ddaodan",
|
||||
"version": "1.1",
|
||||
"description": "",
|
||||
"bgi_version": "0.42.3"
|
||||
},
|
||||
"positions": [
|
||||
{
|
||||
"id": 1,
|
||||
"x": -319.46,
|
||||
"y": 2156.93,
|
||||
"type": "target",
|
||||
"move_mode": "walk"
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1,20 @@
|
||||
{
|
||||
"info": {
|
||||
"name": "蒙德2-清泉镇-5-1",
|
||||
"type": "collect",
|
||||
"author": "秋云",
|
||||
"version": "1.0",
|
||||
"description": "",
|
||||
"map_name": "Teyvat",
|
||||
"bgi_version": "0.45.0"
|
||||
},
|
||||
"positions": [
|
||||
{
|
||||
"id": 1,
|
||||
"x": -319.57,
|
||||
"y": 2156.48,
|
||||
"type": "target",
|
||||
"move_mode": "walk"
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -1153,13 +1153,6 @@
|
||||
"steps": 4,
|
||||
"order": 2
|
||||
},
|
||||
{
|
||||
"x": -347,
|
||||
"y": 1902,
|
||||
"strategy": "蒙德2-清泉镇",
|
||||
"steps": 4,
|
||||
"order": 3
|
||||
},
|
||||
{
|
||||
"x": -420,
|
||||
"y": 1998,
|
||||
@@ -1174,6 +1167,27 @@
|
||||
"steps": 4,
|
||||
"order": 4
|
||||
},
|
||||
{
|
||||
"x": -347,
|
||||
"y": 1902,
|
||||
"strategy": "蒙德2-清泉镇-4",
|
||||
"steps": 2,
|
||||
"order": 1
|
||||
},
|
||||
{
|
||||
"x": -319,
|
||||
"y": 2156,
|
||||
"strategy": "蒙德2-清泉镇-4",
|
||||
"steps": 2,
|
||||
"order": 2
|
||||
},
|
||||
{
|
||||
"x": -319,
|
||||
"y": 2156,
|
||||
"strategy": "蒙德2-清泉镇-5",
|
||||
"steps": 1,
|
||||
"order": 1
|
||||
},
|
||||
{
|
||||
"x": -281,
|
||||
"y": 2310,
|
||||
|
||||
Reference in New Issue
Block a user