SceneUnitManager: properly determine and spawn only default objects

This commit is contained in:
xeon 2024-07-29 23:33:13 +03:00
parent fc121c7cba
commit 2ccdf84dd0
5 changed files with 816 additions and 7 deletions

View file

@ -0,0 +1,800 @@
[
{
"TagID": 1,
"MCHJEPCIEOC": "",
"EFPBDDJIJBO": "",
"InteractIDs": [],
"MOBKGMGMIDA": ""
},
{
"TagID": 2,
"MCHJEPCIEOC": "",
"EFPBDDJIJBO": "",
"InteractIDs": [],
"MOBKGMGMIDA": ""
},
{
"TagID": 3,
"MCHJEPCIEOC": "",
"EFPBDDJIJBO": "",
"InteractIDs": [],
"MOBKGMGMIDA": ""
},
{
"TagID": 4,
"MCHJEPCIEOC": "",
"EFPBDDJIJBO": "",
"InteractIDs": [],
"MOBKGMGMIDA": ""
},
{
"TagID": 5,
"MCHJEPCIEOC": "",
"EFPBDDJIJBO": "",
"InteractIDs": [],
"MOBKGMGMIDA": ""
},
{
"TagID": 6,
"MCHJEPCIEOC": "",
"EFPBDDJIJBO": "",
"InteractIDs": [],
"MOBKGMGMIDA": ""
},
{
"TagID": 7,
"MCHJEPCIEOC": "",
"EFPBDDJIJBO": "",
"InteractIDs": [],
"MOBKGMGMIDA": ""
},
{
"TagID": 8,
"MCHJEPCIEOC": "",
"EFPBDDJIJBO": "",
"InteractIDs": [],
"MOBKGMGMIDA": ""
},
{
"TagID": 9,
"MCHJEPCIEOC": "",
"EFPBDDJIJBO": "",
"InteractIDs": [],
"MOBKGMGMIDA": ""
},
{
"TagID": 10,
"MCHJEPCIEOC": "",
"EFPBDDJIJBO": "",
"InteractIDs": [],
"MOBKGMGMIDA": ""
},
{
"TagID": 1001,
"MCHJEPCIEOC": "1040140086",
"EFPBDDJIJBO": "",
"InteractIDs": [],
"MOBKGMGMIDA": ""
},
{
"TagID": 1002,
"MCHJEPCIEOC": "",
"EFPBDDJIJBO": "",
"InteractIDs": [],
"MOBKGMGMIDA": ""
},
{
"TagID": 1003,
"MCHJEPCIEOC": "1040140214",
"EFPBDDJIJBO": "",
"InteractIDs": [],
"MOBKGMGMIDA": ""
},
{
"TagID": 1004,
"MCHJEPCIEOC": "",
"EFPBDDJIJBO": "",
"InteractIDs": [],
"MOBKGMGMIDA": ""
},
{
"TagID": 1005,
"MCHJEPCIEOC": "1040140077",
"EFPBDDJIJBO": "1040140077",
"InteractIDs": [10000014],
"MOBKGMGMIDA": ""
},
{
"TagID": 1006,
"MCHJEPCIEOC": "1040140073",
"EFPBDDJIJBO": "",
"InteractIDs": [],
"MOBKGMGMIDA": ""
},
{
"TagID": 1008,
"MCHJEPCIEOC": "1040140070",
"EFPBDDJIJBO": "",
"InteractIDs": [],
"MOBKGMGMIDA": ""
},
{
"TagID": 1009,
"MCHJEPCIEOC": "1040140126",
"EFPBDDJIJBO": "",
"InteractIDs": [],
"MOBKGMGMIDA": ""
},
{
"TagID": 1011,
"MCHJEPCIEOC": "1040140091",
"EFPBDDJIJBO": "",
"InteractIDs": [],
"MOBKGMGMIDA": ""
},
{
"TagID": 1012,
"MCHJEPCIEOC": "1040140071",
"EFPBDDJIJBO": "1040140071",
"InteractIDs": [10000029],
"MOBKGMGMIDA": ""
},
{
"TagID": 1018,
"MCHJEPCIEOC": "",
"EFPBDDJIJBO": "",
"InteractIDs": [],
"MOBKGMGMIDA": ""
},
{
"TagID": 2016,
"MCHJEPCIEOC": "",
"EFPBDDJIJBO": "1040140073",
"InteractIDs": [10000015],
"MOBKGMGMIDA": ""
},
{
"TagID": 2017,
"MCHJEPCIEOC": "",
"EFPBDDJIJBO": "",
"InteractIDs": [],
"MOBKGMGMIDA": ""
},
{
"TagID": 2018,
"MCHJEPCIEOC": "",
"EFPBDDJIJBO": "",
"InteractIDs": [],
"MOBKGMGMIDA": ""
},
{
"TagID": 2019,
"MCHJEPCIEOC": "1040140082",
"EFPBDDJIJBO": "",
"InteractIDs": [],
"MOBKGMGMIDA": ""
},
{
"TagID": 2028,
"MCHJEPCIEOC": "",
"EFPBDDJIJBO": "1040140117",
"InteractIDs": [100700],
"MOBKGMGMIDA": ""
},
{
"TagID": 2099,
"MCHJEPCIEOC": "1040140115",
"EFPBDDJIJBO": "",
"InteractIDs": [],
"MOBKGMGMIDA": "0:1|0:2|0:3"
},
{
"TagID": 5004,
"MCHJEPCIEOC": "",
"EFPBDDJIJBO": "",
"InteractIDs": [],
"MOBKGMGMIDA": ""
},
{
"TagID": 5005,
"MCHJEPCIEOC": "",
"EFPBDDJIJBO": "",
"InteractIDs": [],
"MOBKGMGMIDA": ""
},
{
"TagID": 5007,
"MCHJEPCIEOC": "",
"EFPBDDJIJBO": "",
"InteractIDs": [],
"MOBKGMGMIDA": ""
},
{
"TagID": 5009,
"MCHJEPCIEOC": "",
"EFPBDDJIJBO": "",
"InteractIDs": [],
"MOBKGMGMIDA": ""
},
{
"TagID": 5010,
"MCHJEPCIEOC": "",
"EFPBDDJIJBO": "",
"InteractIDs": [],
"MOBKGMGMIDA": ""
},
{
"TagID": 5011,
"MCHJEPCIEOC": "",
"EFPBDDJIJBO": "",
"InteractIDs": [],
"MOBKGMGMIDA": ""
},
{
"TagID": 5012,
"MCHJEPCIEOC": "",
"EFPBDDJIJBO": "",
"InteractIDs": [],
"MOBKGMGMIDA": ""
},
{
"TagID": 5013,
"MCHJEPCIEOC": "",
"EFPBDDJIJBO": "",
"InteractIDs": [],
"MOBKGMGMIDA": ""
},
{
"TagID": 5014,
"MCHJEPCIEOC": "",
"EFPBDDJIJBO": "",
"InteractIDs": [],
"MOBKGMGMIDA": ""
},
{
"TagID": 5015,
"MCHJEPCIEOC": "",
"EFPBDDJIJBO": "",
"InteractIDs": [],
"MOBKGMGMIDA": ""
},
{
"TagID": 5016,
"MCHJEPCIEOC": "",
"EFPBDDJIJBO": "",
"InteractIDs": [],
"MOBKGMGMIDA": ""
},
{
"TagID": 5017,
"MCHJEPCIEOC": "",
"EFPBDDJIJBO": "",
"InteractIDs": [],
"MOBKGMGMIDA": ""
},
{
"TagID": 5018,
"MCHJEPCIEOC": "",
"EFPBDDJIJBO": "",
"InteractIDs": [],
"MOBKGMGMIDA": ""
},
{
"TagID": 5019,
"MCHJEPCIEOC": "",
"EFPBDDJIJBO": "",
"InteractIDs": [],
"MOBKGMGMIDA": ""
},
{
"TagID": 10022,
"MCHJEPCIEOC": "1060140220",
"EFPBDDJIJBO": "",
"InteractIDs": [],
"MOBKGMGMIDA": ""
},
{
"TagID": 20281,
"MCHJEPCIEOC": "",
"EFPBDDJIJBO": "",
"InteractIDs": [],
"MOBKGMGMIDA": ""
},
{
"TagID": 100301,
"MCHJEPCIEOC": "1040140072",
"EFPBDDJIJBO": "",
"InteractIDs": [],
"MOBKGMGMIDA": ""
},
{
"TagID": 100303,
"MCHJEPCIEOC": "1040140072",
"EFPBDDJIJBO": "",
"InteractIDs": [],
"MOBKGMGMIDA": ""
},
{
"TagID": 100503,
"MCHJEPCIEOC": "1040140126",
"EFPBDDJIJBO": "",
"InteractIDs": [],
"MOBKGMGMIDA": ""
},
{
"TagID": 100603,
"MCHJEPCIEOC": "1040140070",
"EFPBDDJIJBO": "",
"InteractIDs": [],
"MOBKGMGMIDA": ""
},
{
"TagID": 100901,
"MCHJEPCIEOC": "1040890044",
"EFPBDDJIJBO": "",
"InteractIDs": [],
"MOBKGMGMIDA": ""
},
{
"TagID": 100910,
"MCHJEPCIEOC": "1040140263",
"EFPBDDJIJBO": "1040140263",
"InteractIDs": [15001404],
"MOBKGMGMIDA": ""
},
{
"TagID": 100913,
"MCHJEPCIEOC": "1040140264",
"EFPBDDJIJBO": "1040140264",
"InteractIDs": [15001405],
"MOBKGMGMIDA": ""
},
{
"TagID": 100914,
"MCHJEPCIEOC": "",
"EFPBDDJIJBO": "",
"InteractIDs": [],
"MOBKGMGMIDA": ""
},
{
"TagID": 100915,
"MCHJEPCIEOC": "",
"EFPBDDJIJBO": "",
"InteractIDs": [],
"MOBKGMGMIDA": ""
},
{
"TagID": 100916,
"MCHJEPCIEOC": "",
"EFPBDDJIJBO": "",
"InteractIDs": [],
"MOBKGMGMIDA": ""
},
{
"TagID": 101016,
"MCHJEPCIEOC": "1040140071",
"EFPBDDJIJBO": "",
"InteractIDs": [],
"MOBKGMGMIDA": ""
},
{
"TagID": 101017,
"MCHJEPCIEOC": "",
"EFPBDDJIJBO": "",
"InteractIDs": [],
"MOBKGMGMIDA": ""
},
{
"TagID": 101018,
"MCHJEPCIEOC": "1040140071",
"EFPBDDJIJBO": "",
"InteractIDs": [],
"MOBKGMGMIDA": ""
},
{
"TagID": 101202,
"MCHJEPCIEOC": "1040140115",
"EFPBDDJIJBO": "",
"InteractIDs": [],
"MOBKGMGMIDA": "0:4"
},
{
"TagID": 102101,
"MCHJEPCIEOC": "1040140114",
"EFPBDDJIJBO": "",
"InteractIDs": [],
"MOBKGMGMIDA": ""
},
{
"TagID": 102102,
"MCHJEPCIEOC": "1040140298",
"EFPBDDJIJBO": "1040140298",
"InteractIDs": [15001109],
"MOBKGMGMIDA": ""
},
{
"TagID": 102201,
"MCHJEPCIEOC": "1040140215",
"EFPBDDJIJBO": "",
"InteractIDs": [],
"MOBKGMGMIDA": ""
},
{
"TagID": 102202,
"MCHJEPCIEOC": "",
"EFPBDDJIJBO": "1060140051",
"InteractIDs": [15001104],
"MOBKGMGMIDA": ""
},
{
"TagID": 102204,
"MCHJEPCIEOC": "1040140298",
"EFPBDDJIJBO": "",
"InteractIDs": [],
"MOBKGMGMIDA": ""
},
{
"TagID": 102205,
"MCHJEPCIEOC": "1040140193",
"EFPBDDJIJBO": "",
"InteractIDs": [],
"MOBKGMGMIDA": ""
},
{
"TagID": 102302,
"MCHJEPCIEOC": "1040140193",
"EFPBDDJIJBO": "1040140193",
"InteractIDs": [15001108],
"MOBKGMGMIDA": ""
},
{
"TagID": 102501,
"MCHJEPCIEOC": "",
"EFPBDDJIJBO": "",
"InteractIDs": [],
"MOBKGMGMIDA": ""
},
{
"TagID": 102502,
"MCHJEPCIEOC": "",
"EFPBDDJIJBO": "",
"InteractIDs": [],
"MOBKGMGMIDA": ""
},
{
"TagID": 102503,
"MCHJEPCIEOC": "",
"EFPBDDJIJBO": "",
"InteractIDs": [],
"MOBKGMGMIDA": ""
},
{
"TagID": 102504,
"MCHJEPCIEOC": "",
"EFPBDDJIJBO": "",
"InteractIDs": [],
"MOBKGMGMIDA": ""
},
{
"TagID": 102601,
"MCHJEPCIEOC": "1060140044",
"EFPBDDJIJBO": "1060140044",
"InteractIDs": [15001107],
"MOBKGMGMIDA": ""
},
{
"TagID": 102602,
"MCHJEPCIEOC": "1060140044",
"EFPBDDJIJBO": "1060140044",
"InteractIDs": [],
"MOBKGMGMIDA": ""
},
{
"TagID": 103101,
"MCHJEPCIEOC": "",
"EFPBDDJIJBO": "1040140339",
"InteractIDs": [15001201],
"MOBKGMGMIDA": ""
},
{
"TagID": 103201,
"MCHJEPCIEOC": "",
"EFPBDDJIJBO": "",
"InteractIDs": [],
"MOBKGMGMIDA": ""
},
{
"TagID": 103202,
"MCHJEPCIEOC": "",
"EFPBDDJIJBO": "",
"InteractIDs": [],
"MOBKGMGMIDA": ""
},
{
"TagID": 103203,
"MCHJEPCIEOC": "1040140339",
"EFPBDDJIJBO": "",
"InteractIDs": [],
"MOBKGMGMIDA": ""
},
{
"TagID": 103302,
"MCHJEPCIEOC": "1040140260",
"EFPBDDJIJBO": "",
"InteractIDs": [],
"MOBKGMGMIDA": ""
},
{
"TagID": 104101,
"MCHJEPCIEOC": "",
"EFPBDDJIJBO": "",
"InteractIDs": [],
"MOBKGMGMIDA": ""
},
{
"TagID": 104102,
"MCHJEPCIEOC": "1040140260",
"EFPBDDJIJBO": "",
"InteractIDs": [],
"MOBKGMGMIDA": ""
},
{
"TagID": 104108,
"MCHJEPCIEOC": "",
"EFPBDDJIJBO": "",
"InteractIDs": [],
"MOBKGMGMIDA": ""
},
{
"TagID": 104110,
"MCHJEPCIEOC": "",
"EFPBDDJIJBO": "",
"InteractIDs": [],
"MOBKGMGMIDA": ""
},
{
"TagID": 104111,
"MCHJEPCIEOC": "",
"EFPBDDJIJBO": "",
"InteractIDs": [],
"MOBKGMGMIDA": ""
},
{
"TagID": 104112,
"MCHJEPCIEOC": "",
"EFPBDDJIJBO": "",
"InteractIDs": [],
"MOBKGMGMIDA": ""
},
{
"TagID": 104113,
"MCHJEPCIEOC": "",
"EFPBDDJIJBO": "",
"InteractIDs": [],
"MOBKGMGMIDA": ""
},
{
"TagID": 104201,
"MCHJEPCIEOC": "1040140302",
"EFPBDDJIJBO": "1040140302",
"InteractIDs": [15001801],
"MOBKGMGMIDA": ""
},
{
"TagID": 104202,
"MCHJEPCIEOC": "1030140001",
"EFPBDDJIJBO": "1030140001",
"InteractIDs": [15001802],
"MOBKGMGMIDA": ""
},
{
"TagID": 104205,
"MCHJEPCIEOC": "1030140002",
"EFPBDDJIJBO": "1030140002",
"InteractIDs": [15001803],
"MOBKGMGMIDA": ""
},
{
"TagID": 104206,
"MCHJEPCIEOC": "1030140003",
"EFPBDDJIJBO": "1030140003",
"InteractIDs": [15001804],
"MOBKGMGMIDA": ""
},
{
"TagID": 202646,
"MCHJEPCIEOC": "1040140279",
"EFPBDDJIJBO": "",
"InteractIDs": [],
"MOBKGMGMIDA": ""
},
{
"TagID": 500021,
"MCHJEPCIEOC": "",
"EFPBDDJIJBO": "",
"InteractIDs": [],
"MOBKGMGMIDA": "0:4"
},
{
"TagID": 500022,
"MCHJEPCIEOC": "",
"EFPBDDJIJBO": "",
"InteractIDs": [],
"MOBKGMGMIDA": "0:3"
},
{
"TagID": 500023,
"MCHJEPCIEOC": "",
"EFPBDDJIJBO": "",
"InteractIDs": [],
"MOBKGMGMIDA": "0:2"
},
{
"TagID": 500024,
"MCHJEPCIEOC": "",
"EFPBDDJIJBO": "",
"InteractIDs": [],
"MOBKGMGMIDA": "0:1"
},
{
"TagID": 500025,
"MCHJEPCIEOC": "",
"EFPBDDJIJBO": "",
"InteractIDs": [],
"MOBKGMGMIDA": "0:2"
},
{
"TagID": 500026,
"MCHJEPCIEOC": "",
"EFPBDDJIJBO": "",
"InteractIDs": [],
"MOBKGMGMIDA": "0:1"
},
{
"TagID": 504001,
"MCHJEPCIEOC": "",
"EFPBDDJIJBO": "",
"InteractIDs": [],
"MOBKGMGMIDA": ""
},
{
"TagID": 504002,
"MCHJEPCIEOC": "",
"EFPBDDJIJBO": "",
"InteractIDs": [],
"MOBKGMGMIDA": ""
},
{
"TagID": 504003,
"MCHJEPCIEOC": "",
"EFPBDDJIJBO": "",
"InteractIDs": [],
"MOBKGMGMIDA": ""
},
{
"TagID": 504004,
"MCHJEPCIEOC": "",
"EFPBDDJIJBO": "",
"InteractIDs": [],
"MOBKGMGMIDA": ""
},
{
"TagID": 504005,
"MCHJEPCIEOC": "",
"EFPBDDJIJBO": "",
"InteractIDs": [],
"MOBKGMGMIDA": ""
},
{
"TagID": 504006,
"MCHJEPCIEOC": "",
"EFPBDDJIJBO": "",
"InteractIDs": [],
"MOBKGMGMIDA": ""
},
{
"TagID": 504007,
"MCHJEPCIEOC": "",
"EFPBDDJIJBO": "",
"InteractIDs": [],
"MOBKGMGMIDA": ""
},
{
"TagID": 504008,
"MCHJEPCIEOC": "",
"EFPBDDJIJBO": "",
"InteractIDs": [],
"MOBKGMGMIDA": ""
},
{
"TagID": 504009,
"MCHJEPCIEOC": "",
"EFPBDDJIJBO": "",
"InteractIDs": [],
"MOBKGMGMIDA": ""
},
{
"TagID": 504010,
"MCHJEPCIEOC": "",
"EFPBDDJIJBO": "",
"InteractIDs": [],
"MOBKGMGMIDA": ""
},
{
"TagID": 520001,
"MCHJEPCIEOC": "",
"EFPBDDJIJBO": "",
"InteractIDs": [],
"MOBKGMGMIDA": ""
},
{
"TagID": 520002,
"MCHJEPCIEOC": "",
"EFPBDDJIJBO": "",
"InteractIDs": [],
"MOBKGMGMIDA": "0:3"
},
{
"TagID": 41120101,
"MCHJEPCIEOC": "",
"EFPBDDJIJBO": "",
"InteractIDs": [],
"MOBKGMGMIDA": ""
},
{
"TagID": 41120201,
"MCHJEPCIEOC": "",
"EFPBDDJIJBO": "",
"InteractIDs": [],
"MOBKGMGMIDA": ""
},
{
"TagID": 41120202,
"MCHJEPCIEOC": "",
"EFPBDDJIJBO": "",
"InteractIDs": [],
"MOBKGMGMIDA": ""
},
{
"TagID": 41120203,
"MCHJEPCIEOC": "",
"EFPBDDJIJBO": "",
"InteractIDs": [],
"MOBKGMGMIDA": ""
},
{
"TagID": 41120301,
"MCHJEPCIEOC": "",
"EFPBDDJIJBO": "",
"InteractIDs": [],
"MOBKGMGMIDA": ""
},
{
"TagID": 41120302,
"MCHJEPCIEOC": "",
"EFPBDDJIJBO": "",
"InteractIDs": [],
"MOBKGMGMIDA": ""
},
{
"TagID": 41120401,
"MCHJEPCIEOC": "",
"EFPBDDJIJBO": "",
"InteractIDs": [],
"MOBKGMGMIDA": "0:1|0:2|0:3"
},
{
"TagID": 41500001,
"MCHJEPCIEOC": "",
"EFPBDDJIJBO": "",
"InteractIDs": [],
"MOBKGMGMIDA": ""
},
{
"TagID": 241062001,
"MCHJEPCIEOC": "",
"EFPBDDJIJBO": "",
"InteractIDs": [],
"MOBKGMGMIDA": ""
}
]

View file

@ -0,0 +1,12 @@
use serde::Deserialize;
template_id!(MainCityDefaultObject u32 tag_id);
#[derive(Deserialize, Debug)]
#[serde(rename_all = "PascalCase")]
pub struct MainCityDefaultObjectTemplate {
#[serde(rename = "TagID")]
pub tag_id: MainCityDefaultObjectID,
#[serde(rename = "InteractIDs")]
pub interact_ids: Vec<u32>,
}

View file

@ -83,4 +83,5 @@ template_tables! {
TrainingQuestTemplate; TrainingQuestTemplate;
WeaponTemplate; WeaponTemplate;
MainCityObjectTemplate; MainCityObjectTemplate;
MainCityDefaultObjectTemplate;
} }

View file

@ -51,7 +51,7 @@ impl Default for MainCityModel {
position: Vector3f::default(), position: Vector3f::default(),
rotation: Vector3f::default(), rotation: Vector3f::default(),
main_city_time: MainCityTime::default(), main_city_time: MainCityTime::default(),
section_id: SectionConfigID::new_unchecked(1), section_id: SectionConfigID::new_unchecked(2),
} }
} }
} }

View file

@ -1,4 +1,4 @@
use data::tables::{self, SectionConfigID}; use data::tables::{self, MainCityDefaultObjectID, SectionConfigID};
use super::SceneUnit; use super::SceneUnit;
@ -12,11 +12,7 @@ impl SceneUnitManager {
let unit_vec = tables::main_city_object_template_tb::iter() let unit_vec = tables::main_city_object_template_tb::iter()
.filter(|tmpl| tmpl.get_section_name() == section_template.section_name) .filter(|tmpl| tmpl.get_section_name() == section_template.section_name)
.filter(|tmpl| { .filter(|tmpl| MainCityDefaultObjectID::new(tmpl.tag_id.value()).is_some()) // check if npc tag present in default object table
tmpl.create_type == 0
&& !tmpl.create_position.contains("Test")
&& !tmpl.default_interact_ids.is_empty()
})
.map(|tmpl| SceneUnit::new(tmpl.tag_id)) .map(|tmpl| SceneUnit::new(tmpl.tag_id))
.collect(); .collect();