Skip to content

Druids using bows - need help

ArdulArdul Member Posts: 211
Hello everyone,

I like to tinker a bit with modding and make some edits to some of the mods I am using. One of the things I would like to do, is removing the item usability restrictions on bows from druids. I am writing about it here, in the hope that somebody could cook up the few lines of code needed to make bows useable by druids?

Thanks!

Comments

  • sarevok57sarevok57 Member Posts: 5,975
    if you have NI infinity im pretty sure you can make it happen

    first, you need to go into all the bow files in the .ITM folder

    coincidentally all the bows are marked with BOWxx.ITM

    so they are pretty easy to find

    once you find the bow files you can select each one and press the "Edit" tab and then unselect all the boxes that have druid in the name

    next, you need to adjust some .2da files ( which is in the 2DA folder up top )

    and you will need to adjust the WEAPPROF.2da so that all druids can at least become proficient in bows and make it so fighter druids can specialize in them ( aka highlighting line 6, and replacing 0s with 1s for the druid and druid class kits, and replacing the 0 with 2 for fighter/druid

    now, this will work perfectly for bg1ee

    if you want this to work for bg2ee as well, you can make things a little easier by copy pasting your now "overwritten files" ( which will be in your override folder and there should be things like; BOW01.itm, BOW02.itm, BOW03.itm, WEAPPROF.2da, ect ) from your bg1 over ride folder into your bg2 over ride folder, and now half the work is done

    for bg2, all you have to do now is make all the bows that werent in bg1 usable by your druid using the above step of going into edit and unselecting all the boxes with druid in the name

    and if you want this to go into IWD as well, take your BG1 over ride files ( since IWD has more similarities with bg1, and then like bg2 go into the IWD bow files and edit the bows that arent in bg1 )

    and voila, if everything is done correctly, you should now be able to have druids use bows in all 3 games and even get some proficiency out of them as well
    OrlonKronsteen
  • RaduzielRaduziel Member Posts: 4,714
    edited October 2019
    I wrote this piece of code, but I have no idea why it is only affecting Longbows and ignoring Shortbows.

    Also, IDK how to allow Druids to equip arrows - ATM they can't. I've run this mod in IWDEE for purpose of testing.

    If someone else can take a look and say what I'm missing, I appreciate.
    BACKUP ~Test/Backup~
    SUPPORT ~Raduziel www.twitter.com/raduziel~
    VERSION ~0.1~
    
    BEGIN ~Bows for Druids~
    
    COPY_EXISTING_REGEXP ~.*\.itm~ override
    	READ_BYTE 0x31 proficiency
    	PATCH_MATCH proficiency WITH 
    		104 105 BEGIN
    	PATCH_IF (SOURCE_SIZE > 0x71)     BEGIN
    		READ_LONG	0x64	       ex_off
    		READ_SHORT	0x68	       glob_ex
    		FOR	(j = 0; j < glob_ex; ++j)	BEGIN
    			READ_SHORT (ex_off + (j * 0x38) + 0x0002) location
    			PATCH_IF location = 1 BEGIN
    			WRITE_BYTE 0x21 (THIS BAND 0b10111111)
    			WRITE_BYTE 0x1f (THIS BAND 0b11101111) 
    			SET j = glob_ex
    			END
    		END
    	END
    END
    DEFAULT
    END
    BUT_ONLY
    
    COPY_EXISTING ~WEAPPROF.2DA~ override
    SET_2DA_ENTRY_LATER ~RAWEAPPROF~ 5  10  ~1~ //Druid
    SET_2DA_ENTRY_LATER ~RAWEAPPROF~ 27 10  ~1~
    SET_2DA_ENTRY_LATER ~RAWEAPPROF~ 28 10  ~1~
    SET_2DA_ENTRY_LATER ~RAWEAPPROF~ 5  19  ~2~ //Fighter/Druid
    SET_2DA_ENTRY_LATER ~RAWEAPPROF~ 27 19  ~2~
    SET_2DA_ENTRY_LATER ~RAWEAPPROF~ 28 19  ~2~
    SET_2DA_ENTRY_LATER ~RAWEAPPROF~ 5  45  ~1~ //Totemic Druid
    SET_2DA_ENTRY_LATER ~RAWEAPPROF~ 27 45  ~1~
    SET_2DA_ENTRY_LATER ~RAWEAPPROF~ 28 45  ~1~
    SET_2DA_ENTRY_LATER ~RAWEAPPROF~ 5  46  ~1~ //Shapeshifter
    SET_2DA_ENTRY_LATER ~RAWEAPPROF~ 27 46  ~1~
    SET_2DA_ENTRY_LATER ~RAWEAPPROF~ 28 46  ~1~
    SET_2DA_ENTRY_LATER ~RAWEAPPROF~ 5  47  ~1~ //Avenger
    SET_2DA_ENTRY_LATER ~RAWEAPPROF~ 27 47  ~1~
    SET_2DA_ENTRY_LATER ~RAWEAPPROF~ 28 47  ~1~
    SET_2DA_ENTRIES_NOW ~RAWEAPPROF~ 1
    PRETTY_PRINT_2DA
    BUT_ONLY_IF_IT_CHANGES
    
    //EoF
    
  • sarevok57sarevok57 Member Posts: 5,975
    unfortunately cant help much with @Raduziel code up above ( that looks way too intense and out of my league for me, perhaps its the ex_off and glob_ex or READ_SHORT (ex_off + (j * 0x38) + 0x0002) location throwing it off? )

    but if you do it my way, i forgot to mention that ( Raduziel reminded me ) you will also have to change the arrows as well to make them usable by druids by again going to the edit tab and unselecting the correct box ( they are also easy to find in the .ITM folder because their item names are under ARROWxx.itm )

    luckily bg1 has the most arrows so you can export all of your arrow over rides to SoA and IWD and then just have to do the odd arrow editing for SoA and IWD afterwards
  • kjeronkjeron Member Posts: 2,367
    Due to the addition of the Shaman class, all items usable by one but not the other now carry an op319 effect to disallow the item instead of using the Druid class flag.
    Longbows aren't usable by either, so unchecking the class flag is enough.
    Arrows and Shortbows are usable by Shamans, so it needs a different approach.
    ...
    	PATCH_MATCH proficiency WITH 
    		104 105 BEGIN
    			LPF DELETE_EFFECT match_opcode = 319 match_parameter1 = 11 match_parameter2 = 5 END
    ...
    
    Raduzielartificial_sunlight
  • RaduzielRaduziel Member Posts: 4,714
    @kjeron Weidu is chocking after adding this line.
    BACKUP ~Test/Backup~
    SUPPORT ~Raduziel www.twitter.com/raduziel~
    VERSION ~0.1~
    
    BEGIN ~Bows for Druids~
    
    COPY_EXISTING_REGEXP ~.*\.itm~ override
    	READ_BYTE 0x31 proficiency
    	PATCH_MATCH proficiency WITH 
    		104 105 BEGIN
    		PATCH_IF (SOURCE_SIZE > 0x71)  BEGIN
    		LPF DELETE_EFFECT match_opcode = 319 match_parameter1 = 11 match_parameter2 = 5 END
    		READ_LONG	0x64 ex_off
    		READ_SHORT	0x68 glob_ex
    		FOR	(j = 0; j < glob_ex; ++j)	BEGIN
    			READ_SHORT (ex_off + (j * 0x38) + 0x0002) location
    			PATCH_IF location = 1 BEGIN
    			WRITE_BYTE 0x21 (THIS BAND 0b10111111)
    			WRITE_BYTE 0x1f (THIS BAND 0b11101111) 
    			SET j = glob_ex
    			END
    		END
    	END
    END
    DEFAULT
    END
    BUT_ONLY
    
    COPY_EXISTING ~WEAPPROF.2DA~ override
    SET_2DA_ENTRY_LATER ~RAWEAPPROF~ 5  10  ~1~ //Druid
    SET_2DA_ENTRY_LATER ~RAWEAPPROF~ 27 10  ~1~
    SET_2DA_ENTRY_LATER ~RAWEAPPROF~ 28 10  ~1~
    SET_2DA_ENTRY_LATER ~RAWEAPPROF~ 5  19  ~2~ //Fighter/Druid
    SET_2DA_ENTRY_LATER ~RAWEAPPROF~ 27 19  ~2~
    SET_2DA_ENTRY_LATER ~RAWEAPPROF~ 28 19  ~2~
    SET_2DA_ENTRY_LATER ~RAWEAPPROF~ 5  45  ~1~ //Totemic Druid
    SET_2DA_ENTRY_LATER ~RAWEAPPROF~ 27 45  ~1~
    SET_2DA_ENTRY_LATER ~RAWEAPPROF~ 28 45  ~1~
    SET_2DA_ENTRY_LATER ~RAWEAPPROF~ 5  46  ~1~ //Shapeshifter
    SET_2DA_ENTRY_LATER ~RAWEAPPROF~ 27 46  ~1~
    SET_2DA_ENTRY_LATER ~RAWEAPPROF~ 28 46  ~1~
    SET_2DA_ENTRY_LATER ~RAWEAPPROF~ 5  47  ~1~ //Avenger
    SET_2DA_ENTRY_LATER ~RAWEAPPROF~ 27 47  ~1~
    SET_2DA_ENTRY_LATER ~RAWEAPPROF~ 28 47  ~1~
    SET_2DA_ENTRIES_NOW ~RAWEAPPROF~ 1
    PRETTY_PRINT_2DA
    BUT_ONLY_IF_IT_CHANGES
    
    //EoF
    
  • GwendolyneGwendolyne Member Posts: 461
    You should have a look here.
  • [Deleted User][Deleted User] Posts: 0
    edited October 2019
    The user and all related content has been deleted.
    Raduzielartificial_sunlight
  • RaduzielRaduziel Member Posts: 4,714
    edited October 2019
    Taking a piece of @subtledoctor's code I was able to remove the restriction for both longbows and shortbows. No luck with arrows yet, though.
    BACKUP ~Test/Backup~
    SUPPORT ~Raduziel www.twitter.com/raduziel~
    VERSION ~0.2~
    
    BEGIN ~Bows for Druids~
    
    COPY_EXISTING_REGEXP ~.*\.itm~ override
    	READ_BYTE 0x31 proficiency
    	PATCH_MATCH proficiency WITH 
    		104 105 BEGIN
    		LPF DELETE_EFFECT INT_VAR match_opcode = 319 match_parameter1 = 11 match_timing = 2 END
            LPF DELETE_EFFECT INT_VAR match_opcode = 319 match_parameter1 = 16 match_timing = 2 END
    		PATCH_IF (SOURCE_SIZE > 0x71)  BEGIN
    		READ_LONG	0x64 ex_off
    		READ_SHORT	0x68 glob_ex
    		FOR	(j = 0; j < glob_ex; ++j)	BEGIN
    			READ_SHORT (ex_off + (j * 0x38) + 0x0002) location
    			PATCH_IF location = 1 BEGIN
    			WRITE_BYTE 0x21 (THIS BAND 0b10111111)
    			WRITE_BYTE 0x1f (THIS BAND 0b11101111) 
    			SET j = glob_ex
    			END
    		END
    	END
    END
    DEFAULT
    END
    BUT_ONLY
    
    COPY_EXISTING ~WEAPPROF.2DA~ override
    SET_2DA_ENTRY_LATER ~RAWEAPPROF~ 5  10  ~1~ //Druid
    SET_2DA_ENTRY_LATER ~RAWEAPPROF~ 27 10  ~1~
    SET_2DA_ENTRY_LATER ~RAWEAPPROF~ 28 10  ~1~
    SET_2DA_ENTRY_LATER ~RAWEAPPROF~ 5  19  ~2~ //Fighter/Druid
    SET_2DA_ENTRY_LATER ~RAWEAPPROF~ 27 19  ~2~
    SET_2DA_ENTRY_LATER ~RAWEAPPROF~ 28 19  ~2~
    SET_2DA_ENTRY_LATER ~RAWEAPPROF~ 5  45  ~1~ //Totemic Druid
    SET_2DA_ENTRY_LATER ~RAWEAPPROF~ 27 45  ~1~
    SET_2DA_ENTRY_LATER ~RAWEAPPROF~ 28 45  ~1~
    SET_2DA_ENTRY_LATER ~RAWEAPPROF~ 5  46  ~1~ //Shapeshifter
    SET_2DA_ENTRY_LATER ~RAWEAPPROF~ 27 46  ~1~
    SET_2DA_ENTRY_LATER ~RAWEAPPROF~ 28 46  ~1~
    SET_2DA_ENTRY_LATER ~RAWEAPPROF~ 5  47  ~1~ //Avenger
    SET_2DA_ENTRY_LATER ~RAWEAPPROF~ 27 47  ~1~
    SET_2DA_ENTRY_LATER ~RAWEAPPROF~ 28 47  ~1~
    SET_2DA_ENTRIES_NOW ~RAWEAPPROF~ 1
    PRETTY_PRINT_2DA
    BUT_ONLY_IF_IT_CHANGES
    
    //EoF
    
    artificial_sunlight
  • ArdulArdul Member Posts: 211
    Hey @subtledoctor that worked for arrows and short bows, but not for long bows and composite bows for some reason.
  • ArdulArdul Member Posts: 211
    And thanks to everyone else who are trying to come up with some solutions - it is really appreciated!
  • ArdulArdul Member Posts: 211
    @Raduziel you guys are getting close then :smile: . Subtledoctors code did also make arrows useable.
  • RaduzielRaduziel Member Posts: 4,714
    I think I know what to do, gimme a second.
  • RaduzielRaduziel Member Posts: 4,714
    edited October 2019
    @Ardul

    Nailed it.
    BACKUP ~BowsForDruids/Backup~
    SUPPORT ~Raduziel www.twitter.com/raduziel~
    VERSION ~0.3~
    
    BEGIN ~Bows for Druids~
    
    COPY_EXISTING_REGEXP ~.*\.itm~ override
    	READ_BYTE  0x31 proficiency
    	READ_SHORT 0x1c type
    	PATCH_IF (type = 5 OR proficiency = 104 OR proficiency = 105) BEGIN
    		LPF DELETE_EFFECT INT_VAR match_opcode = 319 match_parameter1 = 11 match_timing = 2 END
           		LPF DELETE_EFFECT INT_VAR match_opcode = 319 match_parameter1 = 16 match_timing = 2 END
    		PATCH_IF (SOURCE_SIZE > 0x71)  BEGIN
    		READ_LONG	0x64 ex_off
    		READ_SHORT	0x68 glob_ex
    		FOR	(j = 0; j < glob_ex; ++j)	BEGIN
    			READ_SHORT (ex_off + (j * 0x38) + 0x0002) location
    			PATCH_IF location = 1 BEGIN
    			WRITE_BYTE 0x21 (THIS BAND 0b10111111)
    			WRITE_BYTE 0x1f (THIS BAND 0b11101111) 
    			SET j = glob_ex
    			END
    		END
    	END
    END
    BUT_ONLY
    
    COPY_EXISTING ~WEAPPROF.2DA~ override
    SET_2DA_ENTRY_LATER ~RAWEAPPROF~ 5  10  ~1~ //Druid
    SET_2DA_ENTRY_LATER ~RAWEAPPROF~ 27 10  ~1~
    SET_2DA_ENTRY_LATER ~RAWEAPPROF~ 28 10  ~1~
    SET_2DA_ENTRY_LATER ~RAWEAPPROF~ 5  19  ~2~ //Fighter/Druid
    SET_2DA_ENTRY_LATER ~RAWEAPPROF~ 27 19  ~2~
    SET_2DA_ENTRY_LATER ~RAWEAPPROF~ 28 19  ~2~
    SET_2DA_ENTRY_LATER ~RAWEAPPROF~ 5  45  ~1~ //Totemic Druid
    SET_2DA_ENTRY_LATER ~RAWEAPPROF~ 27 45  ~1~
    SET_2DA_ENTRY_LATER ~RAWEAPPROF~ 28 45  ~1~
    SET_2DA_ENTRY_LATER ~RAWEAPPROF~ 5  46  ~1~ //Shapeshifter
    SET_2DA_ENTRY_LATER ~RAWEAPPROF~ 27 46  ~1~
    SET_2DA_ENTRY_LATER ~RAWEAPPROF~ 28 46  ~1~
    SET_2DA_ENTRY_LATER ~RAWEAPPROF~ 5  47  ~1~ //Avenger
    SET_2DA_ENTRY_LATER ~RAWEAPPROF~ 27 47  ~1~
    SET_2DA_ENTRY_LATER ~RAWEAPPROF~ 28 47  ~1~
    SET_2DA_ENTRIES_NOW ~RAWEAPPROF~ 1
    PRETTY_PRINT_2DA
    BUT_ONLY_IF_IT_CHANGES
    
    //EoF
    

    I think that Subtledoctor's code for proficiency allowance is better than mine, as if I understood correctly it will automatically check for all druids - instead of manually inputting kit-by-kit as I did. Haven't tested, though.
    Ardulartificial_sunlightGusinda
  • ArdulArdul Member Posts: 211
    Yes that worked @Raduziel. Thank you so much! And thank you Kjeron and Subtledoctor for your help as well. Really appreciated!
    Raduziel
  • The user and all related content has been deleted.
  • kjeronkjeron Member Posts: 2,367
    I don't understand some of what Raduziel's code is doing - it is checking each header (and maybe each effect?) but the resulting change to usability affects the whole item, not just particular headers/effects. <So why bother with the check? It seems superfluous.
    To make sure the item is actually a weapon.
  • The user and all related content has been deleted.
  • RaduzielRaduziel Member Posts: 4,714
    kjeron wrote: »
    I don't understand some of what Raduziel's code is doing - it is checking each header (and maybe each effect?) but the resulting change to usability affects the whole item, not just particular headers/effects. <So why bother with the check? It seems superfluous.
    To make sure the item is actually a weapon.

    Said the author of the code that I ripped off from DoF and adapted for this purpose.

    I also had to ask the first time I saw it.
Sign In or Register to comment.