Chronis Posted August 20, 2009 Share Posted August 20, 2009 So I am working with this little piece of code that I don't really understand. EXTEND_TOP_REGEXP ~.*\(PRIE\|CLER\|HEAL\|PRST\|SHAM\).*\.BCS~ This works in BGII for all priest scripts. I want to add paladins and druids to it and use it for my BGT/Tutu mod but I am having trouble figuring out how to code it. Any help would be greatly appreciated. Link to comment
Mike1072 Posted August 20, 2009 Share Posted August 20, 2009 That piece of code will modify all scripts that have a filename containing either PRIE, CLER, HEAL, PRST, or SHAM. Within BG1, there aren't many enemy paladins or druids. All the ones I looked at in Tutu, with the exception of Seniyad (_seniya.cre), used a combat script like _priest4.bcs, which should already be matched by the regular expression you are using. I couldn't say whether the same holds true for mod-added (BG1NPC) creatures or if SCS changes this (I don't think it does). Link to comment
Miloch Posted August 20, 2009 Share Posted August 20, 2009 There are Tutu druids that use a _druid3 script, and BG1 NPC druids use custom scripts (beginning with X#). You could try to get clever by reading the class of all CREs and extending all their class scripts or something, but honestly, I'd probably just hardcode the list of scripts you want to extend. Link to comment
DavidW Posted August 20, 2009 Share Posted August 20, 2009 That piece of code will modify all scripts that have a filename containing either PRIE, CLER, HEAL, PRST, or SHAM. Within BG1, there aren't many enemy paladins or druids. All the ones I looked at in Tutu, with the exception of Seniyad (_seniya.cre), used a combat script like _priest4.bcs, which should already be matched by the regular expression you are using. I couldn't say whether the same holds true for mod-added (BG1NPC) creatures or if SCS changes this (I don't think it does). SCS changes basically all the spellcaster scripts. So a druid capable of casting fourth level spells, for instance, gets his script changed to dw#1dru4 (catchy, huh?) Link to comment
Ardanis Posted August 20, 2009 Share Posted August 20, 2009 You could try to get clever by reading the class of all CREs and extending all their class scripts or something, but honestly, I'd probably just hardcode the list of scripts you want to extend.Reading class may not be the wisest idea - there's no telling which slot to check, as script may be placed in any of those. Worse, you may accidentally get wtasight.bcs as a resource and voila, everybody will get updated, not just goody-two-shoes and tree-huggers. On the other hand, one can add ~OR(2) Class(Myself,PALADIN_ALL) Class(Myself,DRUID_ALL)~ into condition, so that it will return true for valid targets only. Meanwhile, try running this to get a list of all paladins/druids and scripts they use. Perhaps it will provide a bit of useful info. BACKUP ~chronis/backup~ AUTHOR ~chronis~ BEGIN ~Build a list of paladins and druids and their scripts~ OUTER_SET counter=1 COPY_EXISTING_REGEXP GLOB ~.*\.cre~ ~override~ READ_BYTE 0x273 class PATCH_IF (class=6 OR class=11) BEGIN READ_ASCII 0x248 over (8) READ_ASCII 0x250 clas (8) READ_ASCII 0x258 race (8) READ_ASCII 0x260 gene (8) READ_ASCII 0x268 defa (8) PATCH_IF class=6 BEGIN SPRINT me ~pal~ END ELSE BEGIN SPRINT me ~dru~ END SPRINT $print("%counter%") ~%SOURCE_RES% %me% %over% %clas% %race% %gene% %defa%~ counter+=1 END BUT_ONLY <<<<<<<<creature_scripts.txt RESOURCE my_class override class race general default >>>>>>>> COPY ~creature_scripts.txt~ ~creature_scripts.txt~ FOR (i=1;i<counter;i+=1) BEGIN SPRINT print $print("%i%") INSERT_2DA_ROW i 1 ~%print%~ END Link to comment
Chronis Posted August 21, 2009 Author Share Posted August 21, 2009 Thanks for the help everyone. This thread is full of people who put my weidu skills to shame. So I pulled the paladins and druids using the above code and many have either PALAD or DRUID somewhere in the script name. So.. EXTEND_TOP_REGEXP .*\(PRIE\|CLER\|HEAL\|PRST\|SHAM\|PALA\|DRU\).*\.BCS~ Should work for both BGT and TUTU right? I want to add a script that makes most non party paladins/druids/and good clerics go hostile when certain conditions are met. Link to comment
Miloch Posted August 21, 2009 Share Posted August 21, 2009 So I pulled the paladins and druids using the above code and many have either PALAD or DRUID somewhere in the script name. So.. EXTEND_TOP_REGEXP .*\(PRIE\|CLER\|HEAL\|PRST\|SHAM\|PALA\|DRU\).*\.BCS~ Should work for both BGT and TUTU right? I suppose so, but if you pulled a list of all paladins and druids, then there really is no reason not to hardcode the scripts you want to extend and skip the REGEXP. You could change that list code pretty easily to add the other classes you're interested in (clerics etc.). Also, if you know which script slots are filled and which are open, you might just patch the CREs to add your script to an open slot, assuming it doesn't need to go absolutely first (it probably doesn't). That way you'd have fewer potential conflicts too - for example, you wouldn't be accidentally patching a script containing "dru" that is used by a dragon, or a cleric script that is also used by a lich, or who knows what. Link to comment
Recommended Posts
Archived
This topic is now archived and is closed to further replies.