Jump to content

String descriptions for new kit and enginest.2da


testlum

Recommended Posts

Hiya. I've managed to cobble together the various files needed for a new Ranger kit, but now I'm having difficulty with adding the descriptions in game.

Most of what I've done is taken from THIS GUIDE on the Beamdog forums. After running weidu, certain places still say Ranger instead of Kitname - the pictures in attachment. The first is from character creation screen, the second and third from in-game character panel.

From THIS COMMENT and jmerry's reply below, enginest.2da might be the culprit. I have tried appending STRREF_GUI_HELP_KIT_Kitname to enginest.2da, but that didn't work. Any tips?

2023-08-07 18_59_40-Baldur's Gate II - Enhanced Edition - v2.6.6.0.jpg

2023-08-07 19_00_17-Baldur's Gate II - Enhanced Edition - v2.6.6.0.jpg

2023-08-07 19_00_13-Baldur's Gate II - Enhanced Edition - v2.6.6.0.jpg

For reference, this is my WEIDU tp2.

Spoiler

BEGIN @1 // Ranger Kit
INCLUDE ~warrior_kitpack/lib/fl#add_kit_ee.tpa~

OUTER_SET t_01_lower = RESOLVE_STR_REF (@10001)
OUTER_SET t_01_mixed = RESOLVE_STR_REF (@10002)
OUTER_SET t_01_descr = RESOLVE_STR_REF (@10003)
OUTER_SET t_01_fdesc = RESOLVE_STR_REF (@10006)

ADD_KIT ~T_01~    
        ~T_01 1 1 1 1 1 1 1 1~
        ~T_01 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 2 2 2 3 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0~
        ~T_01 13 13 14 3 14 3~
        ~T_01 0 0 0 0 0 0~
        ~T_01 33 33 33 33 33 33~
        ~T_01 15 15 0 0 17 0~
        ~T_01 1 0 0 0 0 0 0 0 0~
        ~T_01 0 1 0 0 0 0~
        ~warrior_kitpack/2da/CLABT_01.2da~
        ~K_R_H K_R_E K_R_HE~
        ~0x00000000 12~
        ~T_01~
        ~LEAT14 * HELM07 BAG24 RING06 RING31 CLCK02 BOOT01 AMUL19 BRAC16 BELT06 AROW11,40 BULL03,40 BOLT06,40 POTN52,5 POTN04,2 POTN14,5 HAMM07 SW1H39 STAF08~
        SAY @10001
        SAY @10002
        SAY @10003

LAF fl#add_kit_ee
        INT_VAR
                fallen = 1
                fallen_notice = %t_01_fdesc%
        STR_VAR
                kit_name = ~T_01~
                clswpbon = ~1 0 3~
                clsrcreq = ~1 1 1 0 0 0 0~
                clasthac = ~0~
        END

COPY ~warrior_kitpack/spl/T_RN001.spl~ ~override~
        SAY NAME1 @10004
        SAY UNIDENTIFIED_DESC @10005

COPY
        ~warrior_kitpack/spl/T_RN002.spl~ ~override~ // Cast 1 less spell per level known
        ~warrior_kitpack/2da/CLABT_01.2da~ ~override~
        ~warrior_kitpack/2da/LUT_01.2da~ ~override~

COPY_EXISTING ~enginest.2da~ ~override~
APPEND ~enginest.2da~ ~STRREF_GUI_LOWER_KIT_T_01 %t_01_lower%~
APPEND ~enginest.2da~ ~STRREF_GUI_MIXED_KIT_T_01 %t_01_mixed%~
APPEND ~enginest.2da~ ~STRREF_GUI_HELP_KIT_T_01 %t_01_descr%~

 

Edited by testlum
Link to comment

Looking around in UI.MENU, I'm pretty sure I found the function that decides what to show on that screen:

function getClassString()
	local out = characters[currentID].classlevel.first.details
	if ( characters[currentID].classlevel.second ) then
		out = out .. '\n\n' .. characters[currentID].classlevel.second.details
	end
	if ( characters[currentID].classlevel.third ) then
		out = out .. '\n\n' .. characters[currentID].classlevel.third.details
	end

	out = out .. '\n\n' .. characters[currentID].kitDesc

	return out
end

Which then refers back to the "characters[currentID]" object, and its associated "kitdesc" value/function. That doesn't appear to be defined anywhere that's accessible to normal modding, so how it parses the 2DAs isn't something I can verify.

Link to comment
14 hours ago, testlum said:

Strange enough, that did not seem to work. I ended up solving it by using Weidu's innate ADD_KIT function together with LAF fl#add_kit_ee STR_VAR kit_name, as demonstrated in the Song and Silence mod.

Did you define ADD_KIT_EX's mixed and lower? Those are the counterparts.

Link to comment

While I'm hardly the guy to be providing coding advice, I've actually managed to make this work previously...

BACKUP ~Mercenary Kit/Backup~
AUTHOR ~Greener~														
VERSION ~1.1~

LANGUAGE ~English~ ~English~ ~Mercenary Kit/Language/English/Setup.tra~

BEGIN @1
REQUIRE_PREDICATE ENGINE_IS ~bgee~ @2
ACTION_IF FILE_EXISTS_IN_GAME ~enginest.2da~ BEGIN
INCLUDE ~Mercenary Kit/Library/fl#add_kit_ee.tpa~

ADD_KIT ~MERCENARY~

 ~MERCENARY 1 1 1 1 1 1 1 1~  													
 ~MERCENARY 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 2 2 2 3 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0~  		
 ~MERCENARY 9 0 0 0 0 0~  													
 ~MERCENARY 0 0 0 0 0 0~ 													
 ~MERCENARY 17 0 0 0 0 0~ 													
 ~MERCENARY 15 0 0 0 0 0~ 													
 ~MERCENARY 0 1 1 1 1 1 1 1 1~ 													
 ~MERCENARY 0 1 1 1 1 0~ 													
 ~MERCENARY Kit/CLAB/CLABFI01.2da~ 												
 ~~ 																
 ~0x40000000    2~ 														
 ~Fi0~ 																
 ~* * * * * * * * * * * * * * * * * * * *~ 											
 
 SAY @3
 SAY @4
 SAY @5

LAF fl#add_kit_ee STR_VAR kit_name = MERCENARY END

Here is my .tra file

@1 = ~Add Mercenary Kit to Kagain~ 
@2 = ~This mod is only available for BGEE~

@3 = ~mercenary~
@4 = ~Mercenary~
@5 = ~MERCENARY: Mercenaries are soldiers who sell their services to the highest bidder. Traveling great distances in harsh conditions for coin and fame, the mercenary is a man or woman who must master a variety of weapons and styles to satisfy his or her employer's needs.
 
Advantages:
- Begins with two extra proficiency slots at 1st level.
 
Disadvantages:
- May not exceed High Mastery (four slots) in any weapon.~

In game proof this actually works...

image.thumb.jpeg.25b94c8a85b8017777b4054163e9d2e3.jpeg

Link to comment
13 hours ago, a.greene said:

While I'm hardly the guy to be providing coding advice, I've actually managed to make this work previously...

BACKUP ~Mercenary Kit/Backup~
AUTHOR ~Greener~														
VERSION ~1.1~

LANGUAGE ~English~ ~English~ ~Mercenary Kit/Language/English/Setup.tra~

BEGIN @1
REQUIRE_PREDICATE ENGINE_IS ~bgee~ @2
ACTION_IF FILE_EXISTS_IN_GAME ~enginest.2da~ BEGIN
INCLUDE ~Mercenary Kit/Library/fl#add_kit_ee.tpa~

ADD_KIT ~MERCENARY~

 ~MERCENARY 1 1 1 1 1 1 1 1~  													
 ~MERCENARY 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 2 2 2 3 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0~  		
 ~MERCENARY 9 0 0 0 0 0~  													
 ~MERCENARY 0 0 0 0 0 0~ 													
 ~MERCENARY 17 0 0 0 0 0~ 													
 ~MERCENARY 15 0 0 0 0 0~ 													
 ~MERCENARY 0 1 1 1 1 1 1 1 1~ 													
 ~MERCENARY 0 1 1 1 1 0~ 													
 ~MERCENARY Kit/CLAB/CLABFI01.2da~ 												
 ~~ 																
 ~0x40000000    2~ 														
 ~Fi0~ 																
 ~* * * * * * * * * * * * * * * * * * * *~ 											
 
 SAY @3
 SAY @4
 SAY @5

LAF fl#add_kit_ee STR_VAR kit_name = MERCENARY END

 

 

Just for reference, to make it easy to see side-by-side, this same thing with ADD_KIT_EX would be:

LAF ADD_KIT_EX
  INT_VAR
    kit_class = 2
    mixed = RESOLVE_STR_REF (@4)
    lower = RESOLVE_STR_REF (@3)
    help = RESOLVE_STR_REF (@5)
  STR_VAR
    kit_name = ~MERCENARY~
    clab_path = ~MERCENARY Kit/CLAB/CLABFI01.2da~
    unusable = ~0x40000000~
    alignmnt = ~0 1 1 1 1 1 1 1 1~
    weapprof = ~4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 2 2 2 3~
END

 

And OP's would be something like:

Spoiler
BEGIN @1 // Ranger Kit
INCLUDE ~warrior_kitpack/lib/a7#add_kit_ex.tpa~

COPY ~warrior_kitpack/spl/T_RN001.spl~ ~override~
        SAY NAME1 @10004
        SAY UNIDENTIFIED_DESC @10005

COPY
        ~warrior_kitpack/spl/T_RN002.spl~ ~override~ // Cast 1 less spell per level known
        ~warrior_kitpack/2da/CLABT_01.2da~ ~override~
        ~warrior_kitpack/2da/LUT_01.2da~ ~override~


LAF ADD_KIT_EX
  INT_VAR
    kit_class = 12
    mixed = RESOLVE_STR_REF (@10002)
    lower = RESOLVE_STR_REF (@10001)
    help = RESOLVE_STR_REF (@10003)
    fallen_notice = RESOLVE_STR_REF (@10006)
  STR_VAR
    kit_name = ~T_01~
    clab_path = ~CLABT_01~
    luabbr = ~T_01 T_01~
    alignmnt = ~1 0 0 0 0 0 0 0 0~
    weapprof = ~3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 2 2 2 3~
END

NOTE: With the luabbr variable, because your internal kit name and file abbreviation are identical (T_01), you need to have both in the string. If they were different, then you could put just the file abbreviation, and ADD_KIT_EX would automatically add the kit name in front.

Link to comment

I don't understand the why behind it, but I've traced the issue back to this particular bit of code. This isn't the original code in the opening post but rather what I'm using now to add the kit. The below code will cause the base class (not kit) to display during character creation.

Quote

LAF fl#add_kit_ee
    INT_VAR
        fallen = 1
        fallen_notice = RESOLVE_STR_REF (@106)
    STR_VAR
        kit_name = ~_TRN01~
    END

However if I change it to :

Quote

LAF fl#add_kit_ee
    STR_VAR
        kit_name = ~_TRN01~
    END

The kit name and description shows up properly on the character creation page.

Edited by testlum
Link to comment

Join the conversation

You are posting as a guest. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...