Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

New Premium Module: Tyrants of the Moonsea! Read More
Attention, new and old users! Please read the new rules of conduct for the forums, and we hope you enjoy your stay!

How to use WeiDU to edit Carsomyr?

LathspellguestLathspellguest Member Posts: 60
edited April 2016 in General Modding
Basically, I want to change the MR from 50% to 20%, remove the additional damage to chaotic evil, remove the "dispel magic 3x per day," make it usable only by wizard slayers, and also rename the sword and change the description.

Or is it easier to create a new +5 two-handed sword that dispels on hit and provides 20% magic, and then replace Carsomyr in Firkraag's drop?

In either case, I have no idear how to use WeiDU to accomplish my goals. I can make the appropriate changes in Near Infinity, but they're undone by mod installs after the fact.

Post edited by Lathspellguest on

Comments

  • DeltharisDeltharis Member Posts: 124
    While I wouldn't mind seeing how to do that easily - it would be easier if you just did your Near Infinity edits after modding? It's not like you'll be doing it more than once per playthrough. And than keep your edited Carsomyr file in a safe location and just copy it to override when you do another installation...

    Lathspellguest
  • LathspellguestLathspellguest Member Posts: 60
    Actually that probably is the easiest way to do it. In that case, I'd just need to know how to have WeiDU replace the description text, right?

  • ErgErg Member Posts: 1,756
    edited April 2016
    The following has been tested only on BG2, because I don't have BGII:EE, so it is possible that some changes may be required, but it should get you started.

    First you need to create a tp2 file containing something like:
    BACKUP ~Your_mod_name/backup~
    AUTHOR ~Lathspellguest, at http://forum.baldursgate.com~
    VERSION ~v1~

    BEGIN ~Your mod~

    COPY_EXISTING ~SW2H10.ITM~ ~override~ // Carsomyr +5
    PATCH_IF SOURCE_SIZE > 0x71 BEGIN
    // here we use patch functions and/or macros
    END
    BUT_ONLY_IF_IT_CHANGES
    then you can modify the Carsomyr. Check WeiDU documentation for more info, but basically that's what you need to do:

    change the MR from 50% to 20%

        LPF ALTER_EFFECT
    INT_VAR
    match_opcode = 166
    parameter1 = 20
    END

    remove the additional damage to chaotic evil

       SET opcode_to_delete = 177
    LPM DELETE_ITEM_EQEFFECT

    remove the "dispel magic 3x per day,"

       LPF DELETE_ITEM_HEADER
    INT_VAR header_type = 3
    END

    make it usable only by wizard slayers

        WRITE_LONG 0x1e THIS BOR BIT20 // remove usability for Paladins
    WRITE_LONG 0x1e THIS BAND BNOT BIT11 // add usability for Fighters
    WRITE_LONG 0x29 THIS BOR BIT6 // remove usability for Barbarians
    WRITE_LONG 0x2f THIS BOR BIT0 // remove usability for Berserkers
    WRITE_LONG 0x2f THIS BOR BIT2 // remove usability for Kensai
    PATCH_IF GAME_IS ~bg2ee~ THEN BEGIN // remove usability for True Class Fighters (EEs only)
    LPF ~ADD_ITEM_EQEFFECT~
    INT_VAR
    opcode = 319 // Item Usability
    target = 1 // Self
    parameter1 = 0x4000 // True Class
    parameter2 = 9 // KIT.IDS
    timing = 2 // Instant/While Equipped
    END
    END

    rename the sword and change the description

        SAY NAME2 ~write here the new name~
    SAY IDENTIFIED_DESC ~write here the new description~

    Or is it easier to create a new +5 two-handed sword that dispels on hit and provides 20% magic, and then replace Carsomyr in Firkraag's drop?

    Alternatively, you can create a new item by modifying the original Carsomyr with NI. Let's say it's called MYCARS.ITM, then you can replace in Firkraag inventory with
    BACKUP ~Your_mod_name/backup~
    AUTHOR ~Lathspellguest, at http://forum.baldursgate.com~
    VERSION ~v1~

    BEGIN ~Your mod~

    COPY ~Your_mod_name\items\MYCARS.ITM~ ~override~
    PATCH_IF SOURCE_SIZE > 0x71 BEGIN
    SAY NAME2 ~write here the new name~
    SAY IDENTIFIED_DESC ~write here the new description~
    END
    BUT_ONLY_IF_IT_CHANGES

    COPY_EXISTING ~FIRKRA02.CRE~ ~override~
    PATCH_IF SOURCE_SIZE > 0x2c8 BEGIN
    REPLACE_CRE_ITEM MYCARS #0 #0 #0 ~NONE~ ~QITEM2~
    END
    BUT_ONLY_IF_IT_CHANGES

    LathspellguestlansounetSalk
  • subtledoctorsubtledoctor Member Posts: 11,468
    Or, if you've already made the changes in Near Infinity: grab the changed .ITM file from your override folder, drop it in a mod folder, set up the basic Weidu structure as described above, and just do:
    COPY ~mymod/*******.itm~ ~override~
    SAY IDENTIFIED_DESC ~[new description here]~
    (where "*****" is the Carsomyr filename)

    Sometimes using Weidu to patch the file is overkil; if it's just one item then it's probably easier/quicker to edit it manually and simply use Weidu to overwrite the file and add the new string for the description.

    Lathspellguestlansounet
  • LathspellguestLathspellguest Member Posts: 60
    @subtledoctor Awesome! That's exactly what I was looking for. Thanks so much.

  • lansounetlansounet Member Posts: 1,182
    In any case, for local modding no weidu is required, you could just as well do everything in NI, modify the effects, add new lines to dialog.tlk and reference them in the .itm file.

    Some say NI dialog.tlk editing is unstable but I've never had any issue with it

  • rapsam2003rapsam2003 Member Posts: 1,636
    lansounet said:

    Some say NI dialog.tlk editing is unstable but I've never had any issue with it

    It's actually quite unstable, depending on what you do. WeiDU is the only safe way to edit the dialog.tlk.

  • subtledoctorsubtledoctor Member Posts: 11,468
    lansounet said:

    In any case, for local modding no weidu is required, you could just as well do everything in NI, modify the effects, add new lines to dialog.tlk and reference them in the .itm file.

    Some say NI dialog.tlk editing is unstable but I've never had any issue with it

    NI has indeed gotten pretty stable in this regard. But Weidu's SAY command is still more stable, and really very easy to use.

Sign In or Register to comment.