Jump to content

kjeron

Members
  • Posts

    485
  • Joined

  • Last visited

Posts posted by kjeron

  1.  

    43 minutes ago, Luke said:
    • WIZARD_OTILUKES_FREEZING_SPHERE: make sure all its effects (not just opcode #12) are flagged as "Not bypass resistance". Also, in IWDEE this spell has no exclusion flags and that is clearly an oversight/unintended. Since it's flagged as INVOKER / OFFENSIVEDAMAGE, it should probably be treated as Magic Missile. As a result, make sure Conjurers cannot cast it (and cannot use the corresponding scroll...)
    • Speaking of Exclusion flags, you might want to conform to the BG world where each arcane spell has just one Exclusion flag, so you might want to remove the second flag when importing arcane spells from IWDEE... Or you could alternatively add the second exclusion flag to all BG spells...

    Otiluke's exclusions are correct, for IWD, see: https://forums.beamdog.com/discussion/comment/1112924/#Comment_1112924

    Though if importing the spells into BG, exclusion flags would have to be updated anyway, as they differ between games.

  2. 51 minutes ago, Taylan said:

    I still don't see why it would be an issue to use the names from SNDSLOT.IDS. That the game engine doesn't actually read that file isn't important, so long as the mapping in it is accurate. I'm not proposing to write to the file, only to use it as a reference.

    How about SELECT_ACTION4 (and 5-7), same label and slot in all games.

    In BG2EE their slots represent ordering an action.

    In BGEE/IWDEE their slots represent selecting a character.

  3. 6 hours ago, Graion Dilach said:

    Partially disagreeing with this one - the IWD1 slot restorations are not used in any of the new voicesets (thereby dummied out in CHARSND.2DA on all characters), but they are part of the game and they function and one's only aware of this if said one looked at SNDSLOT.IDS. I do agree one should use custom labels though and not what it provides, which is why in the EE soundset tool has human-readable variable names for the slots as well.

    Not sure what you mean, only one sound slot is currently (v2.6) omitted from CHARSND.2d - slot #0.  Every other slot is listed.

  4.  

    1 hour ago, Taylan said:

    2. The numeric ID will always be looked up from the current game's SNDSLOT.IDS, the mod utility never assuming any knowledge of numeric IDs.

    ...

    The only "special knowledge" a sound set installer needs is a mapping from sound to WAV filename suffix, for pre-2.6 compatibility, because that mapping isn't defined in any game file, correct me if I'm wrong?

    It's not defined in any game file, for any EE game, unless you're talking about the EXE.

    Index 75 will always point to the 75th sound index (offset 0x1d0 of the CRE file), no matter what label it has in SNDSLOT.IDS.  Which event triggers it to play is determined only by the EXE (and sound options), and yes some of the same indexes are used for different purposes in different games.

    That IDS file is for assigning arbitrary labels to hardcoded indexes.  Renaming the label won't change the index's function or existence, though it may change which index a uncompiled script (dlg/d/baf file) points to when it's compiled/processed (assuming it was using those arbitrary labels instead of indexes in the first place).

    In contrast to IDS files such as INSTANT.IDS, for which an entry's mere presence has function, you can overwrite SNDSLOT.IDS with a blank file and sound sets will continue to function as if nothing changed.

    You're better off ignoring what's in SNDSLOT.IDS, and mapping it yourself with custom labels (per game) for each sound.  Use CHARSND.2da to determine if a slot is used by the game, not SNDSLOTS.IDS.

  5. If you made any change to the file during the COPY then that version is going to overwrite the version that receives the APPEND/EXTEND.

    COPY_EXISTING file override	// current state of file is read into memory
    	DO y	// "y" is performed upon that copy (doesn't matter if "DO y" is before and/or after the INNER_ACTION block)
    	INNER_ACTION	BEGIN
    		APPEND file ~test~	// copies the current state of the file (not the current COPY) to override with ~test~ appended
    	END
    BUT_ONLY
    // if "DO y" made any changes to the file (or if the "BUT_ONLY" is removed), then it is copied to the override with those changes, effectively negating the APPEND action.
    // if "DO y" made no changes to the file, then the APPEND version remains in override.

     

  6. AFAIK no way to detect Bash attempts separate from other actions.  "Clicked()" will catch Bash attempts, among others.

    "Unlock Message" is displayed when you attempt to pick an impossible lock (diff=100). (Generally the message informs you as much).

    Haven't noticed any function of the others (AC,HP).

  7. 13 minutes ago, Taylan said:

    Hmm, help me understand if I got this right: for <=2.5 compatibility, the WAV files need to have a suffix of one character (letter/digit/symbol) in their name, is that right? And the character is equivalent to one of the integer sound IDs, as per the mapping in your code?

    Yes, though as I originally mentioned I don't know if my mapping is 100% accurate, one or two were a best guess.

  8. 1 hour ago, Taylan said:

    Tell me that's not a lot nicer! :D

    It's really not.  I think you're confusing IE compatibility for Weidu complexity.

    On any game prior to v2.6, one sound file per slot is mandatory, as their suffix is fixed, and which is about 30% of the code I posted (since your original post had them named with other suffixes).  Storing the original files by row# is actually very practical, especially now.

  9. 41 minutes ago, Graion Dilach said:

    EDIT: Oh, @kjeron just FYI, 2.6 heavily expanded CHARSND.2DA. It has more than 70 elements by now, although some of them are padding, but basically the NPC slots are all available and listed now.

    Yes, my code will fill in any of the 99 rows it may have for which a WAV and tra entry are provided (even if some are still unused by the game).  I don't see it expanding past 99, as that would require reformatting the CRE structure.

  10. You can give this a try.  Can't guarantee I have all of the legacy slots accurate (char_slot array), but it should take a folder of WAV files suffixed 01-99 and assign them to the rows 1-99 that are available in CHARSND.2DA.  Takes a separate TRA file, named same as the WAV files without number suffix, with entries @01 - @99 (only requires entries for those that have a matching WAV file).  May not work as is for the gendered languages.

    DEFINE_ACTION_FUNCTION  ADD_SND  INT_VAR  label = 0  STR_VAR  res = ~~  res_path = ~~  tra_path = $res(path)  BEGIN
    	ACTION_DEFINE_ASSOCIATIVE_ARRAY  char_slot BEGIN
    		09=>A  06=>B  07=>C  08=>D  20=>E  26=>F 27=>G  28=>H  32=>I  33=>J  34=>K  18=>L  19=>M  21=>N  22=>O  23=>P 24=>Q  25=>R  75=>S  76=>T  77=>U  78=>V  53=>W
    		63=>X  64=>Y  65=>Z  29=>0  66=>1  67=>2  68=>3  69=>4  70=>5  71=>6  72=>7  10=>8  11=>9
    	END
    	ACTION_CLEAR_ARRAY  CHECK  ACTION_CLEAR_ARRAY  WRITE
    	LOAD_TRA  ~%tra_path%/%res%.tra~  OUTER_SPRINT  col ~$ $ %res%~
    	COPY_EXISTING  ~CHARSND.2DA~  override  READ_2DA_ENTRIES_NOW  READ 3
    		FOR  (i = 1; i < READ; ++i)  BEGIN  SET  $CHECK($READ(~%i%~ 0)) = 0  END
    	BUT_ONLY
    	ACTION_PHP_EACH  CHECK  AS x => y  BEGIN
    		OUTER_WHILE (STRING_LENGTH ~%x%~) < 2  BEGIN  OUTER_SPRINT x ~0%x%~  END
    		ACTION_IF  FILE_EXISTS ~%res_path%/%res%%x%.WAV~  BEGIN
    			ACTION_MATCH  ~%x%~  WITH
    				09 06 07 08 20 26 27 28 32 33 34 18 19 21 22 23 24 25 75 76 77 78 53 63 64 65 29 66 67 68 69 70 71 72 10 11
    					BEGIN  OUTER_SPRINT dest $char_slot(~%x%~)  OUTER_SPRINT  dest_path ~sounds~  END
    				DEFAULT  OUTER_SPRINT dest ~%x%~              OUTER_SPRINT  dest_path ~override~
    			END
    			COPY  ~%res_path%/%res%%x%.WAV~ ~%dest_path%/%res%%dest%.WAV~  SPRINT  text (AT x)  SET  $WRITE(~%x%~) = RESOLVE_STR_REF (~%text%~ [%res%%dest%])
    		END  ELSE  BEGIN
    			OUTER_SET  $WRITE(~%x%~) = ~-1~
    		END
    	END
    	ACTION_PHP_EACH  WRITE  AS  x => y  BEGIN  OUTER_SPRINT   col ~%col% %y%~  END
    	APPEND_COL ~CHARSND.2DA~ ~%col%~  COPY_EXISTING ~CHARSND.2DA~ override PRETTY_PRINT_2DA
    	APPEND  ~BGEE.LUA~  ~filenames_stringrefs['%res%'] = {%label%, 2}~
    END
    
    LAF	ADD_SND INT_VAR label = RESOLVE_STR_REF (~Male: Test Voice~) STR_VAR res = ~TEST~ res_path = EVAL ~%MOD_FOLDER%/SOUNDS~ tra_path = EVAL ~%MOD_FOLDER%/LANG~ END

     

  11. 2 hours ago, subtledoctor said:

    That's an issue. Does this imply that I could make 50 different .eff files, and selectively apply the effect?

    Don't need 50 EFF files, just an extra SPL file:

    Resource 1: Op326 (filter) -> Resource2.

    Resource2(Just one ability header, Minlev 1): Op146 (p2=1) -> Resource3.

    Resource3(Abilities with proper Minlev field): Casting level based on spell type (wizard/priest/innate).

  12. Yes, op326 overrides the casting level of the spell it casts

    Quote

    The spell specified by the resource field is cast at the same level as the current effect, regardless of Spell type.
    Note: If this effect is applied through opcode #177, the spell specified by the resource key is cast at the level specified at offset 0xc8 of the EFF.

    Since op326 came from an innate, it will use your innate/character level.

  13. In general, any spell without BIT15 (Ignore Wild Surge) that is cast in a non-instant manner is subject to both forced (from opcode 280) and random (from the wildmage kit) wild surges.

    Exceptions include:

    • the "ReallyForceSpellPoint()" action, which is not instant, but is supposed to be, and is not subject to wild surges,
    • spells cast through opcodes 258/260 (sequencer activation), which are instant but still subject to wild surges.
  14. A variables "area" string can only be 6 characters long: GLOBAL, LOCALS, MYAREA, ARXXXX, etc....

    Actions/triggers store variables as a single string:  "#LBG0006#LNoGo"

    The first 6 characters are assigned to the area parameter, the rest are assigned to the variable name.

    Scripts/Dialogs can store and check area variables for areas with 7 or 8 character name with MYAREA, but not through directly referencing the area resref.

    The console can handle 8-char area names with it's GetGlobal() and SetGlobal() commands.

  15. 2 bytes, though there are only 16 orientations, so anything beyond the first 4 bits results in an invisible animation, as there is no animation assigned to those orientations.

    Unrelated, but using the "Face(Orientation)" action with a value higher that 15 results in the animation spinning around in place.

×
×
  • Create New...