#anyone familiar with the vehicle repair
1 messages · Page 1 of 1 (latest)
this is what you looking for
fireState can be 0, 20 or 40
0 = NO Fire, NO Smoke
20 = Smoke, NO fire
40 = Fire + Smoke
the best would be to extinguish to 20 and then after some delay set it to 0, a bit realistic
btw, maybe you can use this somehow
yes I already have that rigged to show as a gadget in left hand, I think it was 1.1 or 1.2 that broke it, finally getting around to fixing it. Im using SCR_EBurningState.NONE which according to the enum for SCR_EBurningState thats 0 and SCR_EBurningState.BURNING is 40.
and still on smoke with 0?
Ill try 0 instead of NONE, but using NONE its still smoking yes.
NONE and 0 is normally not the same
none is like null
and null is not equal to anything, just null
0 is an integer
that's what would happen in normal programming, idk if NONE here means 0
enum SCR_EBurningState // Rename to SCR_EBurningState - we have conflict with gamecode
{
NONE = 0,
SMOKING_LIGHT = 10,
SMOKING_HEAVY = 20,
SMOKING_IGNITING = 30,
BURNING = 40
}
now im curious about that comment
weird stuff
it seems already renamed but comment is still there, wonder if theres a game code conflict still
well, i set the debug, set on fire, remove fire, set smoke and that's what i saw, so new investigation required if after setting to 0 smoke persists
Pretty sure I saw that already gets called when you use SetFireState()
relevant code: ```c
override void PerformAction(IEntity pOwnerEntity, IEntity pUserEntity)
{
// Get all flamable hitzones
SCR_VehicleDamageManagerComponent VDMComponent = SCR_VehicleDamageManagerComponent.Cast(pOwnerEntity.FindComponent(SCR_VehicleDamageManagerComponent));
array<HitZone> hitzones = {};
int count = VDMComponent.GetAllHitZones(hitzones);
for (int i = 0; i < count; i++)
{
SCR_FlammableHitZone fhZone = SCR_FlammableHitZone.Cast(VDMComponent.GetDefaultHitZone());
if (fhZone && fhZone.GetFireState() == 0) return; // If no fire, stop here
// Stop fire, fire light, and smoke
fhZone.StopDestructionFire();
VDMComponent.UpdateFireDamage(0);
// Get and Delete used fire extinguisher
SCR_InventoryStorageManagerComponent inventoryComp = SCR_InventoryStorageManagerComponent.Cast(pUserEntity.FindComponent(SCR_InventoryStorageManagerComponent));
array<IEntity> items = new array<IEntity>();
SCR_PrefabNamePredicate pred = new SCR_PrefabNamePredicate();
pred.prefabName = "{99009C0A844FB993}Prefabs/Props/Civilian/FireExtinguisher.et";
if(inventoryComp.FindItems(items, pred))
{
CharacterControllerComponent ccComp = CharacterControllerComponent.Cast(pUserEntity.FindComponent(CharacterControllerComponent));
IEntity extinguisher = ccComp.GetAttachedGadgetAtLeftHandSlot()/*)*/;
for(int j = 0; j < items.Count(); j++)
{
if(items[j] == extinguisher)
{
RplComponent.DeleteRplEntity(items[j], false);
break;
}
}
}
}
}
override bool CanBeShownScript(IEntity user)
{
// Detect if user has fire extinguisher in inventory
SCR_InventoryStorageManagerComponent inventoryComp = SCR_InventoryStorageManagerComponent.Cast(user.FindComponent(SCR_InventoryStorageManagerComponent));
array<IEntity> items = new array<IEntity>();
SCR_PrefabNamePredicate pred = new SCR_PrefabNamePredicate();
pred.prefabName = "{99009C0A844FB993}Prefabs/Props/Civilian/FireExtinguisher.et";
if(inventoryComp.FindItems(items, pred))
{
// Fire extinguisher found, get all vehicle hitzones
SCR_VehicleDamageManagerComponent VDMComponent = SCR_VehicleDamageManagerComponent.Cast(m_Owner.FindComponent(SCR_VehicleDamageManagerComponent));
array<HitZone> hitzones = {};
int count = VDMComponent.GetAllHitZones(hitzones);
for (int i = 0; i < count; i++)
{
// Detect if vehicle is on fire
SCR_FlammableHitZone fhZone = SCR_FlammableHitZone.Cast(VDMComponent.GetDefaultHitZone());
if (fhZone && fhZone.GetFireState() > 0)
{
CharacterControllerComponent ccComp = CharacterControllerComponent.Cast(user.FindComponent(CharacterControllerComponent));
IEntity extinguisher = ccComp.GetAttachedGadgetAtLeftHandSlot();
if(extinguisher == items[0]) return true; // If extinguisher is in left hand, show extinguish action
}
}
}
// No fire extinguisher, no action shown
return false;
}
the vehicle you testing with has to much damage? i notice that damage vehicles does like light smoke, and ofc "healing" the vehicle removes this smoke