118 return slot.GetOccupant();
139 override array<ref WB_UIMenuItem> _WB_GetContextMenuItems()
141 array<ref WB_UIMenuItem> items = {
new WB_UIMenuItem(
"Compute collision damage", 0) };
147 override void _WB_OnContextMenu(
int id)
153 WorldEditorAPI api = _WB_GetEditorAPI();
161 float criticalFrontalDamage = dmgManagerComp.CalculateCriticalCollisionDamage();
162 if (criticalFrontalDamage <= 0)
164 Print(
"Error during critical collision damage callculation (returned value = " + criticalFrontalDamage +
"). Check damage manager setup!",
LogLevel.ERROR);
168 api.BeginEntityAction();
170 IEntitySource ownerSource = api.EntityToSource(
this);
172 int componentIndex = SCR_BaseContainerTools.FindComponentIndex(ownerSource, dmgManagerComp.Type());
175 if (api.SetVariableValue(ownerSource,
path,
"m_fVehicleDestroyDamage", criticalFrontalDamage.ToString()))
176 Print(
"Entity instance's m_fVehicleDestroyDamage set to " + criticalFrontalDamage +
". Apply this change to the prefab!",
LogLevel.WARNING);
178 Print(
"Error setting m_fVehicleDestroyDamage set to " + criticalFrontalDamage,
LogLevel.ERROR);
180 api.EndEntityAction();
198 m_VehicleController = VehicleControllerComponent.Cast(FindComponent(VehicleControllerComponent));
200 m_pPerceivableComponent = SCR_VehiclePerceivableComponent.Cast(FindComponent(SCR_VehiclePerceivableComponent));
void ContainerIdPathEntry(string propertyName, int index=-1)
@ REPAIR
Job is fixing corrupted fragments.
SCR_ResourceComponent GetResourceComponent()
Caches and returns the resource component.
SCR_CampaignFaction GetFaction()
FactionAffiliationComponent m_pFactionComponent
SCR_CharacterPerceivableComponent m_pPerceivableComponent
SCR_CommunicationSoundComponentClass COMM_TRUCK
SCR_CommunicationSoundComponentClass APC
SCR_CommunicationSoundComponentClass FUEL_TRUCK
SCR_CommunicationSoundComponentClass TRUCK
SCR_CommunicationSoundComponentClass CAR
SCR_CommunicationSoundComponentClass MORTAR
SCR_CommunicationSoundComponentClass SUPPLY_TRUCK
bool IsOccupied()
Returns true, if slot is occupied.
SCR_ResourceComponent m_ResourceComponent
void SCR_VehicleDamageManagerComponent(IEntityComponentSource src, IEntity ent, IEntity parent)
void EOnPhysicsActive(IEntity owner, bool activeState)
EVehicleType m_eVehicleType
PilotCompartmentSlot GetPilotCompartmentSlot()
Get primary pilot compartment slot.
void UpdateResourceComponent()
enum EVehicleType m_OnPhysicsActive
VehicleControllerComponent m_VehicleController
SCR_VehicleFactionAffiliationComponent GetFactionAffiliation()
VehicleControllerComponent GetVehicleController()
Get vehicle controller.
ScriptInvoker GetOnPhysicsActive()
Faction GetDefaultFaction()
enum EPhysicsLayerPresets Vehicle
override void EOnInit(IEntity owner)
proto void Print(void var, LogLevel level=LogLevel.NORMAL)
Prints content of variable to console/log.
LogLevel
Enum with severity of the logging message.
SCR_FieldOfViewSettings Attribute
EntityEvent
Various entity events.