[info] how to hack in unlock doors/chests function

+
You could attach this to the 'interact' key for specific 'actions', or create a custom keybind.
I decided to render it like this, sort of hackish, since it's simpler to implement and illustrate.
Some knowledge of modding and coding is required, keybingings are optional, run from console.

This function only works within 5 feet, for the currently highlighted object (focus text or icon).

Disclaimer: Use at your own risk, this is only intended for testing or fixing quest bugs. Some quest objectives trigger when doors and chests are locked or unlocked, thus it has the potential to mess up quest 'facts' or objectives and progression as well.

Code:
exec function Unlock()
{
    var entities : array<CGameplayEntity>;
    var entity : W3LockableEntity;
    var actor : CActor;
    var i, size : int;

    actor = (CActor)GetWitcherPlayer();
    FindGameplayEntitiesInRange(entities, actor, 5, 50, '', FLAG_ExcludePlayer);
    size = entities.Size();

    for ( i=0 ; i<=size ; i+=1 )
    {
        entity = (W3LockableEntity)entities[i];
        if ( !entity.isHighlightedByMedallion ) { continue; }
        if ( entity.IsLocked() ) { entity.Unlock(); }
        else { entity.Lock(entity.GetKeyName()); }
    }
}

Create a file called '\modUnlock\content\scripts\modUnlock.ws' in 'The Witcher 3\mods' folder, paste the code above into it.

Edit '\bin\config\base\general.ini', insert the line 'DBGConsoleOn=true', then open console with ~tilde in game and type 'Unlock'.

May need to run the game executable with the parameter '-forcescriptcompilation', although I can't recall if that's the case.
 
Last edited:
Top Bottom