Skip to content

[Question] Set a creature's override script via WeiDU

I recently learned that using the "Interact" command in a creature's "override script" could force banters, and decided to control the rate of banter in my NPC mod to happen more frequently than the base game attempts banters. Thing is, not all of the banters are initiated by the modded NPC, so I need to extend the override script of the characters in question. Second thing is, not all characters have their override scripts attached to begin with. (For instance, it seems like Faldorn and Skie don't have their override scripts attached, despite the scripts themselves existing.)

So my question is this: is there a way to modify existing CRE files to attach an override script? More importantly, is there a way to do this that uses the override folder's modded version of the file if necessary?

Comments

  • ErgErg Member Posts: 1,756
    Using WeiDU, you could do something like

    COPY_EXISTING_REGEXP GLOB ~FALDOR.*.CRE~ ~override~ // Faldorn (All CRE Files)
    PATCH_IF SOURCE_SIZE > 0x2d3 BEGIN
    WRITE_ASCII 0x248 ~FALDORN~ #8 // Add and/or Replace the Override Script
    END
    BUT_ONLY_IF_IT_CHANGES

    the argument #8 for WRITE_ASCII in the example above is not really necessary (it's only required when the script name is less than 8 characters long). You just need to provide the script name without the extension BCS.

    If there is a modified FALDORN.BCS in the override folder, it would be used in place of the original one.

    Hope this helps.
  • Jackkel_DragonJackkel_Dragon Member Posts: 103
    Thanks, that code seems to work perfectly. Now the problem is going to be rooting out which NPCs were left without their scripts, and which ones I broke through my own mods...
Sign In or Register to comment.