7 {
8 JsonDataContaminatedAreas effectAreaData;
9
10
12 {
13
14 PrintToRPT(
"[WARNING] :: [EffectAreaLoader CreateZones] :: No contaminated area file found in MISSION folder, your path is " +
m_Path +
" Attempting DATA folder");
15
18 m_Path =
string.Format(
"dz/worlds/%1/ce/cfgeffectarea.json",
m_Path );
19
21 {
22 PrintToRPT(
"[WARNING] :: [EffectAreaLoader CreateZones] :: No contaminated area file found in DATA folder, your path is " +
m_Path);
23 return;
24 }
25 }
26
27
28 effectAreaData = EffectAreaLoader.GetData();
29 if ( effectAreaData )
30 {
31
32
33
34 for (
int i = 0; i < effectAreaData.
Areas.Count(); i++ )
35 {
36 EffectAreaParams params = new EffectAreaParams();
37
38
39 params.m_ParamName = effectAreaData.
Areas.Get( i ).AreaName;
40 string areaType = effectAreaData.
Areas.Get( i ).Type;
41 params.m_ParamTriggerType = effectAreaData.
Areas.Get( i ).TriggerType;
42 JsonDataAreaData data = effectAreaData.
Areas.Get( i ).Data;
43
44
46 params.m_ParamRadius = data.
Radius;
60
61
62 JsonDataPlayerData playerData = effectAreaData.
Areas.Get( i ).PlayerData;
66
67
68 if (particleName != "")
69 params.m_ParamPartId = ParticleList.GetParticleID( particleName );
70
71 if (aroundPartName != "")
72 params.m_ParamAroundPartId = ParticleList.GetParticleID( aroundPartName );
73
74 if (tinyPartName != "")
75 params.m_ParamTinyPartId = ParticleList.GetParticleID( tinyPartName );
76
77 params.m_ParamPpeRequesterType = ppeRequesterType;
78
79 EffectArea newZone;
80
81
82 if ( pos[1] == 0 )
83 {
86 }
87 else
88 Class.CastTo( newZone,
GetGame().CreateObjectEx( areaType, pos,
ECE_NONE ) );
89
90
91 if ( newZone )
92 newZone.SetupZoneData( params );
93 else
94 Error(
"[WARNING] :: [EffectAreaLoader CreateZones] :: Cast failed, are you sure your class ( 'Type:' ) inherits from EffectArea and that there are no Typos?");
95 }
96 }
97 else
98 Error(
"[WARNING] :: [EffectAreaLoader CreateZones] :: Data could not be read, please check data and syntax");
99 }
const int ECE_PLACE_ON_SURFACE
proto void GetWorldName(out string world_name)
proto native float SurfaceRoadY(float x, float z, RoadSurfaceDetection rsd=RoadSurfaceDetection.LEGACY)
ref array< ref JsonDataContaminatedArea > Areas
proto native CGame GetGame()
void Error(string err)
Messagebox with error message.
proto void PrintToRPT(void var)
Prints content of variable to RPT file (performance warning - each write means fflush!...
proto bool FileExist(string name)
Check existence of file.
proto native vector Vector(float x, float y, float z)
Vector constructor from components.