1 [
EntityEditorProps(
category:
"GameScripted/Campaign", description:
"Allow respawning at this vehicle in Campaign", color:
"0 0 255 255")]
4 [
Attribute(
"{6D282026AB95FC81}Prefabs/MP/Campaign/CampaignMobileAssemblySpawnpoint.et", UIWidgets.ResourceNamePicker,
"",
"et")]
5 protected ResourceName m_sSpawnpointPrefab;
9 ResourceName GetSpawnpointPrefab()
11 return m_sSpawnpointPrefab;
32 [
RplProp(onRplName:
"OnParentFactionIDSet")]
35 [
RplProp(onRplName:
"OnSpawnpointCreated")]
38 [
RplProp(onRplName:
"OnDeployChanged")]
52 super.OnPostInit(owner);
54 m_RplComponent = RplComponent.Cast(owner.FindComponent(RplComponent));
61 campaign.GetInstance().GetOnFactionAssignedLocalPlayer().Insert(
OnDeployChanged);
68 super.OnDelete(owner);
78 campaign.GetInstance().GetOnFactionAssignedLocalPlayer().Remove(
OnDeployChanged);
85 array<SCR_MilitaryBaseComponent> bases = {};
89 radioRange = radioRange * radioRange;
90 vector truckPosition =
GetOwner().GetOrigin();
95 foreach (SCR_MilitaryBaseComponent base : bases)
99 if (!campaignBase || !campaignBase.IsInitialized())
102 if (campaignBase.IsHQ() && campaignBase.GetFaction() !=
m_ParentFaction)
105 if (vector.DistanceSqXZ(truckPosition, campaignBase.GetOwner().GetOrigin()) < radioRange)
129 Replication.BumpMe();
142 SCR_CampaignFactionManager fManager = SCR_CampaignFactionManager.Cast(
GetGame().GetFactionManager());
163 int GetBasesInRange(notnull out array<SCR_CampaignMilitaryBaseComponent> basesInRange)
172 IEntity truck =
GetOwner().GetParent();
177 BaseRadioComponent comp = BaseRadioComponent.Cast(truck.FindComponent(BaseRadioComponent));
187 return tsv.GetRange();
227 Replication.BumpMe();
237 BaseRadioComponent radioComponent;
239 IEntity vehicle =
GetOwner().GetParent();
242 radioComponent = BaseRadioComponent.Cast(vehicle.FindComponent(BaseRadioComponent));
253 radioComponent.SetPower(
true);
260 supportClass.GenerateCaptureTasks(
GetOwner());
273 radioComponent.SetPower(
false);
284 IEntity truck =
GetOwner().GetParent();
297 if (damageComponent && damageComponent.GetState() ==
EDamageState.DESTROYED)
305 Physics physicsComponent = truck.GetPhysics();
307 if (!physicsComponent)
310 vector vel = physicsComponent.GetVelocity();
313 if (vel.LengthSq() <= 0.01)
391 Resource spawnpointResource = Resource.Load(componentData.GetSpawnpointPrefab());
393 if (!spawnpointResource || !spawnpointResource.IsValid())
396 EntitySpawnParams
params = EntitySpawnParams();
397 params.TransformMode = ETransformMode.WORLD;
417 Replication.BumpMe();
424 if (Replication.IsClient())