Jump to content

argent77

Modders
  • Posts

    1,608
  • Joined

Everything posted by argent77

  1. I think the KITIDS column in kitlist.2da must correspond to the row number, but I have to do some more tests to be certain. A quick test showed that character creation can't be completed if row number and the lowest order byte of the KITIDS value are different. Exceptions are specialist mages and the barbarian kit. If KITIDS is indeed linked to the kitlist row number then you'd have to update a lot of game resources.
  2. If you rearrange kit entries in kitlist.2da you might also have to update kit references in game scripts and effect opcodes, maybe even references in saved games (if you're thorough).
  3. You can fake it by using the non-breaking space (U+00A0). It doesn't count as column separator in 2da files. Typing a non-breaking space can be tricky. On Windows the keyboard shortcut Alt+255 (digits entered on the numeric keypad) might work.
  4. This definition doesn't work as intended: ACTION_DEFINE_ASSOCIATIVE_ARRAY response_strrefs BEGIN %63960% => 1 %65051% => 1 %70436% => 1 END The percent sign is, along with tilde (~) and quotation mark ("), one of several options to enclose strings. The percent sign is special as it has a double meaning depending on context. It can be used to enclose strings as well as evaluate variables inside strings. So in this example you're just using the literal number 63960 as the array index since the percent signs aren't placed inside a string. This code should work as intended: ACTION_DEFINE_ASSOCIATIVE_ARRAY response_strrefs BEGIN ~%63960%~ => 1 ~%65051%~ => 1 ~%70436%~ => 1 END I would generally advise against using the percent sign for enclosing strings. Both tilde and quotation mark are much more readable and less ambiguous.
  5. There is no need to call ADD_TRANS_TRIGGER multiple times for the same state. All responses that should be updated are listed in the variable following the DO keyword. For example, this code ADD_TRANS_TRIGGER ARAN 39 ~Global("C#IM_ImoenStays","GLOBAL",0)~ DO %responses_39% will be resolved as ADD_TRANS_TRIGGER ARAN 39 ~Global("C#IM_ImoenStays","GLOBAL",0)~ DO 1 3 if the code structure from your earlier comment found matching strrefs in response entries 1 and 3. This .d command will then add the trigger "Global("C#IM_ImoenStays","GLOBAL",0)" to both response entries in one go.
  6. That example code (together with the function GET_RESPONSE_STRREFS I posted in an earlier comment) should work fine with multiple responses in individual states. Have you encountered any problems?
  7. What exactly fails? Should only one of the two responses be patched? I think that could be solved with an UNLESS or IF condition.
  8. Near Infinity (or short: NI) is an open source cross-platform browser and editor, based on Java, for resources of Infinity Engine games. This version provides a couple of nifty features such as filtered list items, launching games directly from NI or improved loading times. You can grab the latest release from the download link below. Links: Discussion: SHS, Beamdog Download Documentation
  9. It should be supported by all EE games since patch 2.0. There are several instances in Beamdog NPC-specific maps in BG2:EE as well.
  10. Add PRETTY_PRINT_2DA after you're done modifying the 2DA file.
  11. Congratulations from me too! Looks like GemRB is even (slightly) older than Near Infinity.
  12. In case there are no matching response indices found the variable will be empty and the whole expression evaluates to ADD_TRANS_TRIGGER ARAN 39 ~Global("C#IM_ImoenStays","GLOBAL",0)~ DO This is a valid expression, but results in the script trigger added to all available responses found in state 39 (according to WeiDU docs). One way to solve it is by adding an IF condition to the ADD_TRANS_TRIGGER that never evaluates to "true". For example: ADD_TRANS_TRIGGER ARAN 39 ~Global("C#IM_ImoenStays","GLOBAL",0)~ DO IF ~a_nonexisting_trigger()~ That can be realized by adding this code right before the line "TEXT_SPRINT EVAL ~responses_%state%~ ~%indices%~" in the example code from my previous comment. // prevent adding a trigger if index list is empty PATCH_IF (~%indices%~ STR_EQ ~~) BEGIN TEXT_SPRINT indices "IF ~a_nonexisting_trigger()~" END
  13. This is an example how the whole dialog could be processed in one go. Current implementation requires that all variables contain at least one index or WeiDU will update all available responses of a state. That could be solved by adding a dActionWhen condition that is guaranteed to fail.
  14. You could do all the variable initializations before compiling the respective .d files. That way the .d may contain as many commands as you want (provided each command references a unique variable name). Btw, a variable doesn't only have to include a single response index. It can just as well be a string containing multiple indices created by multiple calls of TEXT_SPRINT variable ~%variable% %idx%~.
  15. In that case, change the .d command to this: ADD_TRANS_TRIGGER ARAN 39 ~Global("C#IM_ImoenStays","GLOBAL",0)~ DO %idx% And use this example .tp2 code: COPY_EXISTING ~aran.dlg~ ~override~ LPF GET_RESPONSE_STRREFS INT_VAR state = 39 RET strrefs RET_ARRAY strrefs END BUT_ONLY OUTER_FOR (idx = 0; idx < strrefs; ++idx) BEGIN ACTION_IF ($strrefs(~%idx%~) = 43058) BEGIN // patching response trigger COMPILE EVAL ~%MOD_FOLDER%/dialogs/aran.d~ END END I'd recommend to use a more unique variable name in place of "idx" though.
  16. This will only return the state index. I don't think there is a WeiDU command that returns the response index. Try this: // Returns all response strrefs for a given state as an array. DEFINE_PATCH_FUNCTION GET_RESPONSE_STRREFS INT_VAR state = 0 RET strrefs // returns number of array elements RET_ARRAY strrefs // indexed array with response strrefs BEGIN SET strrefs = 0 SET $strrefs(~0~) = "-1" // workaround for WeiDU bug READ_ASCII 0 sig (8) PATCH_IF (~%sig%~ STR_EQ ~DLG V1.0~) BEGIN READ_LONG 0x08 num_states READ_LONG 0x0c ofs_states READ_LONG 0x14 ofs_responses PATCH_IF (state >= 0 && state < num_states) BEGIN SET ofs = ofs_states + (state * 16) READ_LONG (ofs + 4) idx_response READ_LONG (ofs + 8) num_response FOR (idx = 0; idx < num_response; ++idx) BEGIN SET ofs = ofs_responses + (idx_response + idx) * 32 PATCH_IF ((BYTE_AT ofs) & BIT0) BEGIN // has text? SET $strrefs(~%strrefs%~) = LONG_AT (ofs + 4) END ELSE BEGIN SET $strrefs(~%strrefs%~) = "-1" END SET strrefs += 1 END END END END // Example usage COPY_EXISTING ~aran.dlg~ ~override~ LPF GET_RESPONSE_STRREFS INT_VAR state = 39 RET strrefs RET_ARRAY strrefs END FOR (idx = 0; idx < strrefs; ++idx) BEGIN PATCH_IF ($strrefs(~%idx%~) = 43058) BEGIN // patch response trigger %idx% END END BUT_ONLY
  17. dActionWhen refers to the string the command is about to alter. In the case of ADD_TRANS_TRIGGER it checks the content of an existing trigger block (if available). For example, this check would add the trigger only if it doesn't exist yet: ADD_TRANS_TRIGGER ARAN 39 ~Global("C#IM_ImoenStays","GLOBAL",0)~ DO 0 UNLESS ~"C#IM_ImoenStays"~ I guess you'll have to code your own function if you want to search specific responses for keywords. To simplify the code you could instead check for predefined strrefs, since you want to check vanilla game dialog lines. The strref for the above-mentioned line would be 43058 in BG2/BG2EE.
  18. I noticed something weird (not sure if added by the recent update). The forum editor automatically replaces "x" by a multiplication sign when placed between two digits (whitespace is ignored), e.g. when used by hexadecimal notation for numbers. Can this kind of "autocorrection" be turned off somewhere? Examples: 0x123, 0xx123, 0 x 123, 0 xx 123
  19. Another info about ARE animation appearance flags (offset 0x34) bit 14. Formerly called "Underground?" this can be used to stencil animations using the water overlay mask of the tileset (e.g. to give water surface a more natural look). It's called "Draw stenciled" in NI. An example to illustrate this feature:
  20. There are no EE-specific additions listed for the GAME file format yet, so here they are: GAME V2.0 Header: Offset Size Description 0x001c 2 (word) Use active area from party member (0=Player1, 1=Player2, ... 5=Player6, -1=Not in party). This overrides current area at offset 0x0058. ^^ This applies to original BG2 as well. 0x0080 4 (dword) Zoom level (in percent), 0 or 100: default zoom level, >100: zoomed out, <100: zoomed in 0x0084 8 (resref) Random encounter area set by script action ForceRandomEncounter() or ForceRandomEncounterEntry(). 0x008c 8 (resref) Current worldmap 0x0094 8 (char array) Current campaign (e.g. "SOD" for Siege of Dragonspear) 0x009c 4 (dword) Familiar owner (0=Player1, 1=Player2, ..., 5=Player6) <- used by IWD:EE 0x00a0 20 (char array) Random encounter entry set by script action ForceRandomEncounterEntry().
  21. The recent update removed the option whether to sign in anonymously from the login box. Since I logged in anonymously recently it now always default to that state for me. Is there a way to change it?
  22. The campaign name is stored in the baldur.gam (offset 94 h), but I don't know of a way to check the current campaign in-game. The closest check is probably a chapter check. If you want to add an artificial marker whether SoD campaign has already started I'd suggest to set a variable by the SoD-specific global script (bdbaldur.bcs). To redefine starting location for the new campaign look for the entry defined by column "STARTARE" in CAMPAIGN.2DA. It points to the 2DA file containing starting area information.
  23. You might want to take a look at this WeiDU function: ADD_STORE_CURE It's one of several store-related (still) undocumented functions that are part of the base WeiDU interpreter (so no external library needed). The general syntax is not unlike other WeiDU functions: COPY_EXISTING ~mystore.sto~ ~override~ LPF ADD_STORE_CURE INT_VAR price = 100 STR_VAR spell_name = ~MYCURE~ position = ~LAST~ END BUT_ONLY
  24. Update: NPC Generator 1.2 Full changelog: - Added Russian translation (thanks yota13) - Internal optimizations
×
×
  • Create New...