Page MenuHomeFeedback Tracker

ActionDismantlePart to make codelock fall off
Assigned, UrgentPublic

Description

I've asked Impuls and Sumrak, and I got a remark that I should try here .....

I'm trying to revive the Old MoreDoors mod and made it more codelock compatible.

I got the attach function going fine, made the codelocks show up on the doorframe and all, made the destroy door function work fine again, only thing I'm stuck on is dismantle gate option from the inside so the codelocks fall off

I know fence.c uses wall_gate but I'm not sure if I need to make mods to the model or just the c file it both.

Could you please guide me ? Or give hints where to look. I'll do it myself to not take your time too much.

Details

Severity
Minor
Resolution
Open
Reproducibility
Always
Operating System
Windows 10 x64
Operating System Version
Latest Server 2019
Category
General
Steps To Reproduce

I can post full codeblocks if needed

Additional Information

Impuls sent me :D

Event Timeline

Using this code for the ActionDismantlePart

modded class ActionDismantlePart {
    protected override bool DismantleCondition(PlayerBase player, ActionTarget target, ItemBase item, bool camera_check) {
        Fence fence = Fence.Cast(target.GetObject());

        if (fence && GetDayZGame().GetCodeLockConfig().OwnerOnlyDismantle()) {
            CodeLock codelock = CodeLock.Cast(fence.GetCodeLock());

            if (codelock && !codelock.IsOwner(player.GetIdentity().GetId())) {
                return false;
            }
        }
        return super.DismantleCondition(player, target, item, camera_check);
    }
}

But in game, I do not get the option 'dismantle gate' so I most likely miss the box in the model to aim at ?

Maybe the question would be, what triggers the dismantle gate option ? is it a selection in the model ?

Geez changed the task status from New to Assigned.May 16 2022, 1:34 PM

So I've gotten a few steps further

I found out I'm not getting the Dismantle Gate (my custom door) option because probably the ActionCondition is not correct even, I think if I understand correctly that the ActionCondition enables the DismantleCondition right ? Does OnPartDismantledServer in the custom door c file validate the ActionCondition for dismantle ?

I've fixed it by looking at classes from Codelock mod, I needed to import some classes to get codelock functions.

Can be closed .....