Jump to content

DavidW

Gibberlings
  • Posts

    8,019
  • Joined

  • Last visited

Posts posted by DavidW

  1. FWIW, here is code that just enables the extended night for an area:

    DEFINE_ACTION_FUNCTION are_extended_night
    	STR_VAR are=""
    BEGIN
    	// get the WED file; add the extended_night flag
    	COPY_EXISTING "%are%.are" override
    		READ_ASCII 0x8 wed // get wed file
    		WRITE_LONG 0x48 (THIS BOR BIT6) // set extended night
    	// already done? If so don't worry
    	ACTION_IF !FILE_EXISTS_IN_GAME "%wed%n.wed" BEGIN
    		// clone the wed file
    		COPY_EXISTING "%wed%.wed" "override/%wed%n.wed"
    			READ_ASCII 0x24 tis
    			WRITE_ASCIIE 0x24 "%tis%N"
    		BUT_ONLY
    		// clone the tis file
    		COPY_EXISTING "%tis%.tis" "override/%tis%n.tis"
    		// clone the PVRZ files
    		OUTER_PATCH_SAVE pvrz_base "%tis%" BEGIN
    			DELETE_BYTES 0x1 1 // get the (dumb) BD convention for PVRZ file names
    		END
    		ACTION_CLEAR_ARRAY pvrz_copy
    		OUTER_FOR (digit1=0;digit1<10;++digit1) BEGIN
    			OUTER_FOR (digit2=0;digit2<10;++digit2) BEGIN
    				ACTION_IF FILE_EXISTS_IN_GAME "%pvrz_base%%digit1%%digit2%.pvrz" BEGIN
    					COPY_EXISTING "%pvrz_base%%digit1%%digit2%.pvrz" "override/%pvrz_base%N%digit1%%digit2%.pvrz"
    				END
    			END
    		END
    		// clone the light map
    		COPY_EXISTING "%tis%lm.bmp" "override/%tis%ln.bmp"
    	END
    END

    If you include this function and just do

    LAF are_extended_night STR_VAR are=ar3300 END

    then extended night should work without CTDs.

    That said, this won't give you all that you want, because the new 'night' TIS is just a daytime TIS, so it won't get dark. You still need to recolor the TIS. But it might be helpful to use this as a starting point, so that at least you know the game isn't going to crash on you.

  2. I've written a bit of code that tries to automatically update the 'STATISTICS' field of an item description. It automatically sets the standard weapon and armor features, the weight, and (on classic BG2) the 'usable by/unusable by' descriptions. The description is formatted in either EE or classic format, as appropriate. 

    The code can't automatically build special details like bonuses to hit against certain creatures, on-equip powers, or special abilities, but it does leave them in place from the existing description.

    I've packaged it as a mod for clarity, but there are really only 2 files: the code (lib_itemdesc.tph) and a tra file (dw_itemdesc.tra). You need to INCLUDE the former and put the latter wherever you keep your .tra files, and you need to set the variable 'sfo_tra_loc' to the path for your tra files.

    Here's an example of use:

    INCLUDE "%MOD_FOLDER%/lib/lib_itemdesc.tph" // includes the library
    OUTER_SPRINT "sfo_tra_loc" "%MOD_FOLDER%/lang" // needs to point to wherever you keep tra files
    LAM itemdesc_initialize // do once, to set the code up
    
    COPY_EXISTING "chan03.itm" override // whatever your item might be
    	LPF itemdesc END
    BUT_ONLY

    There's also a much more lightweight version that just updates the armor string:

    INCLUDE "%MOD_FOLDER%/lib/lib_itemdesc.tph" // includes the library
    OUTER_SPRINT "sfo_tra_loc" "%MOD_FOLDER%/lang" // needs to point to wherever you keep tra files
    LAM itemdesc_initialize // do once, to set the code up
    
    COPY_EXISTING "chan03.itm" override // whatever your item might be
    	LPF itemdesc_armor END
    BUT_ONLY

    EDIT: I've moved this to github. Gibberlings3/itemdesc: Automated generation of item descriptions (this is a tool for mod-users) (github.com

     

  3. Just creating a 'night' copy is fairly trivial, iirc. Copy the tileset and add an 'N' suffix; copy the light map and change 'LM' to 'LN', and set the extended night flag. There might be one or two more steps (I haven't done it for a while) but that's basically all you need.

    To get different lighting effects, you need to alter the lightmap, the bitmap that determines lighting. To actually get beams of visible light from the windows, and the like, you need to alter the artwork. 

  4. 6 hours ago, Guest Mantis said:

    To add to that, the install error persists if the IWD arcane / divine spells install option is selected.

    That's compatible with my theory: if SCS detects an Acid Storm spell, it won't install its own, and it assumes anyone else who's installed it has provided a scroll. I suspect some earlier mod in your install is doing a partial/broken install of Acid Storm.

  5. 15 minutes ago, Guest Remar said:

    Yes, I updated midgame, I expected that could be some problems with it I but I didn't changed mod order or components, just updated SCS. Btw I loaded early save from beginning before Jaheira join and her spells already were like that. Are you sure that problem is in pre-34 saves and new game will fix it?

    I'm not sure of drawing my next breath.

    But if you saved a game when Jaheira had some spells and then reloaded that save and she had different spells, the only feasible explanation is that the spell filenames changed between saving and loading. SCS doesn't edit the savegame itself. And even if Jaheira didn't join the party, she's present in your savegame as soon as you meet her. (The version of Jaheira in my local copy has the correct spells.)

    In any case, if you're unsure, just test it. Start a new game, recruit Jaheira (she's in the starting dungeon, assuming you're playing BG2; otherwise, just create a copy with the console.) Should only take five minutes.

  6. 9 hours ago, temnix said:

    a small, excellent, forgotten adventure 

    This is theoretically possible but I doubt it happens in practice. It is extremely difficult to produce new quest content for IE games, at least if you want reasonable production values - it requires mastery of a wide range of skills (AI scripting, artwork, area design, dialog design, actual ability to plot and write) and most individuals only have a subset. So there aren't many high-quality adventures and those that exist are well known.

    (Prove me wrong by linking to a 'small, excellent, forgotten adventure'!)

  7. 56 minutes ago, Guest Remar said:

    After updating from SCS 33.7 to 34.3 (with installed Icewind Dale spells component) something strange happened with Jaheira spells:
    She lost Sunscorch and Spike Growth.
    She also got Circle of Bones and all Cause Wounds spells (except for Cause Moderate Wounds).

    I'm guessing you had a savegame for 33.7 and then loaded it into 34.3? If so some of the spells may have shifted: they get assigned resource names dynamically and they're not guaranteed to be the same between versions (or between installs of the same version, if you change other bits of your mod load).

    The workaround is to fix it with a savegame editor; future spells she gets when she levels should be fine.

    (Updating mods mid-game generally runs the risk of this sort of thing, hence the usual advice to start a new game - though I can quite see why that's awkward if you're partway through a long playthrough.)

  8. They ought to be fine. I use Cam's code (the one included in WEIDU) as a base and then just add other functionality. If you don't use that other functionality, the results should be identical.

    It's always possible I broke something, of course, but I don't think so (I've been using these modified functions for a while, including in SCS and (iirc) Ascension, and problems haven't arisen.

  9. 19 minutes ago, Bartimaeus said:

    Oh no, I'm not concerned with how the player might deal with it - that's easy, they can just run away and rest after the battle is over. Do enemy mages even use Blindness to begin with? No, I'm more concerned with players using it and it effectively serving as a death sentence for enemies.

    I was talking about how enemies might deal with it (this is how SCS tries to deal with it). I'm not disputing that it's overpowered though! (& SCS mages use blindness.)

     

    22 minutes ago, Bartimaeus said:

    ust in case it wasn't clear, this is not the current behavior of base SR and hasn't been for years - only through Detect Invisibility and True Seeing do you have the option to target improved invisible creatures with any kind of targeted spellcasting.

    Oh yes, that does ring a bell. I don't know how well SCS handles that; not terribly, I assume, or I'd have heard about it, but I don't allow for it explicitly.

  10. 31 minutes ago, Bartimaeus said:

    Perhaps, but [antimagic penetrates Improved Invisibility is] actually a change that SCS, AFAIK, will allready do itself (if it doesn't detect you playing an SR game, question mark?) and I think having the option makes sense given that many struggle with or don't enjoy high-level mage battles.

    SCS won't do this if it detects SR, but only because it assumes you've done it already (back in the day this was part of Demi and my discussions of how to align SR and SCS). SCS will get very confused if you use it without this.

    Incidentally, this is also vanilla-game behavior on the EE as of 2.6.

  11. 26 minutes ago, Bartimaeus said:

    Oh hey, you're right, it did originally last for two hours. Right now, SRR's version lasts for 1 turn, which is already too long. Two hours is the equivalent of 10 turns, which is basically just a death spell at that point.

    Except that it's relatively readily reversible. And you do have a few combat options if blinded: run around in confusion, cast self-targeted AoE that you're immune to, summon monsters.

  12. 1 minute ago, Salk said:

    No, I do want SCS to handle all combat script except for 3-4 cases for which I created custom scripts for a few NPCs. Since they are not generic combat scripts then there should not be any compatibility problems after what you told me. 

    OK, cool. Yes, that's a common situation, and you have the right solution: if you don't want SCS to handle your NPC's AI, you just need to write your own AI for them (which can just be a renamed copy of a vanilla script - all that matters is the name). Provided your script uses your modder prefix, SCS will definitely ignore it. (But make sure you don't leave a WTASIGHT or something lying around in the script list along with your custom script.)

  13. 1 minute ago, Salk said:

    It is useful information. Is there a place inside SCS I can look for that list you mentioned?

    It's not externalized, so you need to look in the code.

    • for mages: the read_in_mage_scripts macro at the bottom of mage/mage.tpa.
    • for priests: the read_in_priest_scripts macro at the bottom of priest/priest.tpa.
    • for general AI: the read_in_combat_scripts macro at the bottom of genai/genai_shared.tph.

    There are also some special cases contained deeper in the code, but that's most of them.

  14. 4 hours ago, Salk said:

    I might add another question: is there a way to manually exclude some specific CRE scripts from being changed by SCS prior to installation?

    Not without editing the code. Replacing the script with a new-named copy on the creatures you want protected is the simplest workaround.

    (Though to some extent, if you want to prevent a generic combat script from being SCS-ified, you might want to ask if you want SCS at all.)

    4 hours ago, Salk said:

    One last curiosity. It seems the size of SCS increased with 30-35% since v33. What's the cause?

    The new version of IWD Spells has a larger footprint - partly because of the resources for vanilla-BG2 conversion, partly because it's common code with IWDification and so contains the resources for IWD bard spells even though SCS doesn't implement them.

  15. On 9/19/2021 at 2:26 AM, Salk said:

    A question, DavidW.

    If I modify some creature's original script(s) and/or swap the original script(s) with a new one(s) before installing SCS, what does SCS do when it comes to it?

    I'm asking because I customized a few combat scripts for some BG1 NPCs and was wondering if they'd be affected.

    Thanks.

    SCS looks in CRE files for scripts from a certain list (e.g., MAGE8). If it finds one, it deletes it and replaces it with a new SCS script, and also processes the CRE file for weapon proficiencies, spell allocations, etc. (There is some more complex functionality to handle the small number of scripts that have both combat and non-combat contents.

    So: If you modify MAGE8, your modifications will be lost. If you replace MAGE8 with SALK01, SCS will skip the creature and your script will be unchanged.

  16. 3 hours ago, maus said:

    In addiotion to DavidW's answer: Always start a new playthrough. If there is a serious bug in the way you install or play game, DavidW would be happy to know about it. And this is the only way to detect it ;)

     

    It's true that from my selfish point of view it's better to start a new playthrough, yes. But I don't begrudge someone wanting to wait a bit for the release to stabilize.

×
×
  • Create New...