0 of 0

File information

Last updated

Original upload

Created by

psydel

Uploaded by

sylee0424

Virus scan

Safe to use

About this mod

a framework for add new console command

Requirements
Permissions and credits
Changelogs
Donations
Now work for Fallout4 v1.10.163.0 / v1.10.984.0

In the case of mods that allow the use of their own console commands, they were implemented by overwriting commands that already existed but had no function (in the case of S.A.M., ShowBones function is overwritten), in which case a conflict may occur.

I made it because there could be problems such as this.

In the mod example, the plmove command was added to lift the player character upward by 256 units. You can check this by running tcl -> plmove.

how to add new console command:

When creating a f4se mode, export void ECMD_RegisterCommand(CommandExtension* extension) function and call the extension->RegisterExtension or RegisterReturnExtension function within ECMD_RegisterCommand to register a function to process the command.

CommandExtension structure is defined as follows, and just needs to be declared before ECMD_RegisterCommand.


struct CommandExtension
{
    typedef bool (*_ProcessExtensionCommand)(const char*, TESObjectREFR*);

    bool (*RegisterExtension)(_ProcessExtensionCommand);

    typedef bool (*_ProcessReturnExtensionCommand)(const char*, TESObjectREFR*, char[0x400]);

    bool (*RegisterReturnExtension)(_ProcessReturnExtensionCommand);
};



_ProcessExtensionCommand is a function to be called when the command is actually executed, const char* is the command content, and TESObjectREFR* corresponds to the reference specified in the console window.

return value (bool) is a function that determines whether command processing has finished.

You can think of it as returning true if the command is processed in its own mode, and false otherwise.

_ProcessReturnExtensionCommand same to _ProcessExtensionCommand  except char[0x400], this is command of changed by your mod.

when you write "player.modpos z 256" to char[0x400] and return true, "player.modpos z 256" is execute by console.

For parts that are not explained, please refer to the mod example. If there is a problem or you are not sure, please leave a comment.