Author Topic: Bug report: add kit (kit_name not implemented correctly??)  (Read 3775 times)

RK

  • Guest
Bug report: add kit (kit_name not implemented correctly??)
« on: February 03, 2014, 12:32:30 PM »
This bug should be pretty easy to reproduce since I used the latest Weidu 236 example after trying to install my own kit (same error). I believe that the following implementation in the Weidu is not working:
 STR_VAR
    kit_name = flrustle

DEBUG INFDORMATION
Doing EE-type kit extensions for kit flrustle
[kitlist.2da] loaded, 4983 bytes
FAILURE:
The variable kit_name is required to name a valid kit
Stopping installation because of error.
Stopping installation because of error.
Stopping installation because of error.

ERROR Installing [example], rolling back to previous state
Unable to Unlink [example/backup/0/OTHER.0]: Unix.Unix_error(1, "unlink", "example/backup/0/OTHER.0")

Offline pro5

  • Planewalker
  • *****
  • Posts: 68
Re: Bug report: add kit (kit_name not implemented correctly??)
« Reply #1 on: February 03, 2014, 02:25:15 PM »
Maybe you should post the whole component code you're trying to run. Something's not right, because it's working fine on my end.

There's a small typo in the example TP2 (variable name "briefidesc" is spelled as "briefdesc") shipped with v236, but it gives a different error message than what you posted and is easy to correct.

EDIT: No, actually, it seems like a typo in the .TPA code itself. It sets the default value for a different variable than what it checks later. Something for Wysp to fix for the next version:
Quote
DEFINE_ACTION_FUNCTION fl#add_kit_ee
  INT_VAR
    biography = "-2"
    briefdesc = "-2"
  STR_VAR
    kit_name = ""
    backstab = ""
    clsrcreq = ""
    clswpbon = ""
    hpclass = ""
    numwslot = ""
    thiefskl = ""
    traplimt = ""
    clascolr = ""
    clasiskl = ""
    clasthac = ""
    thiefscl = ""
BEGIN
//  ...
    ACTION_IF biography < "-1" OR briefidesc < "-1" BEGIN
      COPY_EXISTING clastext.2da override
        PATCH_IF biography < "-1" BEGIN
          LPF fl#add_kit_ee#get_2da_value
            STR_VAR
              row = EVAL "%class%"
              column = biography
              req_column_count = 8
            RET
              biography = value
          END
        END
        PATCH_IF briefdesc < "-1" BEGIN
          LPF fl#add_kit_ee#get_2da_value
            STR_VAR
              row = EVAL "%class%"
              column = briefdesc
              req_column_count = 8
            RET
              briefdesc = value
          END
        END
      BUT_ONLY
    END

Perhaps this is what causes your error, if you don't specify the desc var at all. Anyway, this should work:
Code: [Select]
ADD_KIT ~flrustle~
  ~flrustle                1           1           1           1           1           0           0           0~
  ~flrustle 0 1 0 0 1 0 0 1 0 1 1 0 0 1 1 1 0 1 0 0 0 0 1 1 0 1 1 1 1 1 1 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0~
  ~flrustle                0       9       0       0       0       0~
  ~flrustle                0       0       0       0       0       0~
  ~flrustle                0       17      0       0       0       0~
  ~flrustle                0       15      0       0       0       0~
  ~flrustle                0       1       1       1       1       1       1       1       1~
  ~flrustle                1       1       1       0       0       0~
  ~example/flrustle.2da~
  ~K_T_H    K_T_D   K_T_G   K_T_E   K_T_HE   K_T_HL   K_T_HO~
  ~0x00080000    4~
  ~fl1~
  ~LEAT14 * * BAG28 RING06 RING05,10 * BOOT02 AMUL19 BRAC16 BELT06 AROW11,40 BULL03,40 BOLT06,40 POTN52,5 POTN04,2 POTN14,5 DAGG12 SW1H28 STAF08~
  SAY ~chickenrustler~
  SAY ~Chickenrustler~
  SAY ~CHICKENRUSTLER: kit description~

LAF fl#add_kit_ee
  INT_VAR
    biography = 15883 // Normal biography for thieves
    briefidesc = RESOLVE_STR_REF (~CHICKENRUSTLER: Not much of a thief, but the chickenrustler learns to fight pretty well due to frequently getting into scraps over <PRO_HISHER> chickenrustling ways.~)
    briefdesc = RESOLVE_STR_REF (~CHICKENRUSTLER: Not much of a thief, but the chickenrustler learns to fight pretty well due to frequently getting into scraps over <PRO_HISHER> chickenrustling ways.~)
  STR_VAR
    kit_name = flrustle
    backstab = ~1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1~
    clswpbon = ~1 0 3~
    numwslot = 2
    thiefskl = ~40 20~
    traplimt = 6
    clascolr = ~35 67 67 25 80~
    clasiskl = "" // Inherit from parent class
                  // clasthac is omitted and thus also inherited
                  // As is thiefscl
                  // As is hpclass
                  // As is clsrcreq
END
« Last Edit: February 03, 2014, 02:46:56 PM by pro5 »

RK

  • Guest
Re: Bug report: add kit (kit_name not implemented correctly??)
« Reply #2 on: February 03, 2014, 10:53:03 PM »
Thanks pro5, but I still have the same error message, and even if I remove all the optional parts in the TP2. Actually, Weidu's README says that only kit_name is mandatory, so I removed everything else, and here's how the TP2 looks like:

Quote
LAF fl#add_kit_ee
        STR_VAR
    kit_name = flrustle
END

Also, here's the TPA (quite different from yours) in the lib:
Quote
/*
 * Author: Fredrik Lindgren, a.k.a., Wisp
 * Licence: public domain
 * Date: 2013-11-11
 */

OUTER_SET fl#add_kit_ee#version = 1

DEFINE_ACTION_FUNCTION fl#add_kit_ee#get_row
  STR_VAR
    file = ""
    row_rame = ""
    column = 0
  RET
    row
BEGIN
  COPY_EXISTING "%file%.2da" override
    COUNT_2DA_COLS num_col
    READ_2DA_ENTRIES_NOW file num_col
    SPRINT row ""
    FOR (i = 0; i < file; ++i) BEGIN
      READ_2DA_ENTRY_FORMER file i column label
      PATCH_IF "%label%" STRING_EQUAL_CASE "%row_name%" BEGIN
        FOR (j = 1; j < num_col; ++j) BEGIN
          READ_2DA_ENTRY_FORMER file i j item
          SPRINT row "%row% %item%"
        END
      END
    END
  BUT_ONLY
END

DEFINE_ACTION_FUNCTION fl#add_kit_ee#get_column
  STR_VAR
    file = ""
    column_name = ""
  RET
    column
BEGIN
  COPY_EXISTING "%file%.2da" override
    COUNT_2DA_COLS num_col
    READ_2DA_ENTRIES_NOW file num_col - 1
    SPRINT column ""
    FOR (i = 0; i < num_col - 1; ++i) BEGIN
      READ_2DA_ENTRY_FORMER file 0 i label
      PATCH_IF "%label%" STRING_EQUAL_CASE "%column_name%" BEGIN
        FOR (j = 1; j < file; ++j) BEGIN
          READ_2DA_ENTRY_FORMER file j i + 1 item
          SPRINT column "%column% %item%"
        END
      END
    END
  BUT_ONLY
END

DEFINE_ACTION_FUNCTION fl#add_kit_ee#add_row
  STR_VAR
    kit_name = ""
    input = ""
    file = ""
    clone = ""
BEGIN
  ACTION_IF "%input%" STR_CMP "" BEGIN
    OUTER_SPRINT append "%kit_name% %input%"
    APPEND "%file%.2da" "%append%" UNLESS "%kit_name%"
  END ELSE ACTION_IF "%clone%" STR_CMP "" BEGIN
    LAF fl#add_kit_ee#get_row
      STR_VAR
        file
        row_name = EVAL "%clone%"
      RET
        row
    END
    OUTER_SPRINT append "%kit_name% %row%"
    APPEND "%file%.2da" "%append%" UNLESS "%kit_name%"
  END
END

DEFINE_ACTION_FUNCTION fl#add_kit_ee#add_column
  STR_VAR
    kit_name = ""
    input = ""
    file = ""
    clone = ""
BEGIN
  ACTION_IF "%input%" STR_CMP "" BEGIN
    OUTER_SPRINT append "$ $ %kit_name% %input%"
    APPEND_COL "%file%.2da" "%append%" UNLESS "%kit_name%"
  END ELSE ACTION_IF "%clone%" STR_CMP "" BEGIN
    LAF fl#add_kit_ee#get_column
      STR_VAR
        file
        column_name = EVAL "%clone%"
      RET
        column
    END
    OUTER_SPRINT append "$ $ %kit_name% %column%"
    APPEND_COL "%file%.2da" "%append%" UNLESS "%kit_name%"
  END
END

DEFINE_ACTION_FUNCTION fl#add_kit_ee#validate
  INT_VAR
    kit_number = 0
    kit_class = 0
  STR_VAR
    kit_name = ""
    backstab = ""
    clswpbon = ""
    hpclass = ""
    numwslot = ""
    thiefskl = ""
    traplimt = ""
    clascolr = ""
    clasiskl = ""
    clasthac = ""
    thiefscl = ""
  RET
    backstab
    thiefskl
    traplimt
BEGIN
  ACTION_IF kit_class != 4 AND ("%backstab%" STR_CMP "" OR
                                "%thiefskl%" STR_CMP "" OR
                                "%traplimt%" STR_CMP "")
  BEGIN
    WARN ~WARNING: the arguments backstab, thiefskl and traplimt should only be provided for thief kits~
    OUTER_SPRINT backstab ""
    OUTER_SPRINT thiefskl ""
    OUTER_SPRINT traplimt ""
  END
END

DEFINE_PATCH_FUNCTION fl#add_kit_ee#get_2da_value
  STR_VAR
    row = ""
    column = ""
    req_column_count = 2
  RET
    value
BEGIN
  COUNT_2DA_COLS num_col
  READ_2DA_ENTRIES_NOW file req_column_count
  FOR (i = 0; i < file; ++i) BEGIN
    READ_2DA_ENTRY_FORMER file i 0 row_label
    PATCH_IF "%row_label%" STRING_EQUAL_CASE "%row%" BEGIN
      // We assume the top row is off by one
      FOR (j = 0; j < num_col - 1; ++j) BEGIN
        READ_2DA_ENTRY_FORMER file 0 j col_label
        PATCH_IF "%col_label%" STRING_EQUAL_CASE "%column%" BEGIN
          READ_2DA_ENTRY_FORMER file i j + 1 value
          i = file
          j = num_col
        END
      END
    END
  END
  PATCH_IF !VARIABLE_IS_SET value BEGIN
    PATCH_FAIL "ERROR: fl#add_kit_ee#get_2da_value could not find row %row% and column %column% with %req_column_count% required columns"
  END
END

DEFINE_ACTION_FUNCTION fl#add_kit_ee
  INT_VAR
    biography = "-2"
    briefdesc = "-2"
  STR_VAR
    kit_name = ""
    backstab = ""
    clsrcreq = ""
    clswpbon = ""
    hpclass = ""
    numwslot = ""
    thiefskl = ""
    traplimt = ""
    clascolr = ""
    clasiskl = ""
    clasthac = ""
    thiefscl = ""
BEGIN
  PRINT "Doing EE-type kit extensions for kit %kit_name%"
  ACTION_IF "%kit_name%" STRING_EQUAL "" OR
            NOT FILE_CONTAINS_EVALUATED (kitlist.2da "%kit_name%")
  BEGIN
    FAIL ~The variable kit_name is required to name a valid kit~
  END

  ACTION_IF GAME_IS ~bgee bg2ee~ BEGIN
    COPY_EXISTING kitlist.2da override
      READ_2DA_ENTRIES_NOW kitlist 9
      FOR (i = 0; i < kitlist; ++i) BEGIN
        READ_2DA_ENTRY_FORMER kitlist i 1 k
        PATCH_IF "%k%" STRING_EQUAL_CASE "%kit_name%" BEGIN
          READ_2DA_ENTRY_FORMER kitlist i 0 kit_number
          READ_2DA_ENTRY_FORMER kitlist i 2 kit_lower
          READ_2DA_ENTRY_FORMER kitlist i 3 kit_mixed
          READ_2DA_ENTRY_FORMER kitlist i 4 kit_desc
          READ_2DA_ENTRY_FORMER kitlist i 8 kit_class
        END
      END
    BUT_ONLY

    ACTION_IF !VARIABLE_IS_SET kit_number BEGIN
      FAIL ~The kit %kit_name% was not found in kitlist.2da~
    END
    LAF fl#add_kit_ee#validate
      INT_VAR
        kit_number
        kit_class
      STR_VAR
        kit_name
        backstab
        clsrcreq
        clswpbon
        hpclass
        numwslot
        thiefskl
        traplimt
        clascolr
        clasiskl
        clasthac
        thiefscl
      RET
        backstab
        thiefskl
        traplimt
    END

    COPY_EXISTING kitlist.2da override
      INNER_ACTION BEGIN
        COPY_EXISTING kit.ids override
          READ_2DA_ENTRIES_NOW file 2
          FOR (i = file - 1; i >= 0; --i) BEGIN
            READ_2DA_ENTRY_FORMER file i 1 k
            PATCH_IF "%k%" STRING_EQUAL_CASE "%kit_name%" BEGIN
              READ_2DA_ENTRY_FORMER file i 0 number
            END
          END
        BUT_ONLY
      END
      INNER_PATCH_SAVE kitids "%number%" BEGIN
        REPLACE_TEXTUALLY "0x\([0-9]+\)" "0x0000\1"
      END
      SPRINT w "[ %TAB%]+"
      SPRINT ow "[ %TAB%]*"
      SPRINT d "[0-9]+"
      SPRINT h "[0-9x]+"
      REPLACE_TEXTUALLY ~\(%d%%w%%kit_name%%w%%d%%w%%d%%w%%d%%w%.+%w%%d%%w%%h%%w%%d%%ow%$\)~ ~\1 %kitids%~
    BUT_ONLY

    OUTER_PATCH 0 BEGIN
      LOOKUP_IDS_SYMBOL_OF_INT class class kit_class
    END

    ACTION_IF biography < "-1" OR briefidesc < "-1" BEGIN
      COPY_EXISTING clastext.2da override
        PATCH_IF biography < "-1" BEGIN
          LPF fl#add_kit_ee#get_2da_value
            STR_VAR
              row = EVAL "%class%"
              column = biography
              req_column_count = 8
            RET
              biography = value
          END
        END
        PATCH_IF briefdesc < "-1" BEGIN
          LPF fl#add_kit_ee#get_2da_value
            STR_VAR
              row = EVAL "%class%"
              column = briefdesc
              req_column_count = 8
            RET
              briefdesc = value
          END
        END
      BUT_ONLY
    END

    OUTER_SPRINT clastext "%kit_name% %kit_class% %kit_number% %kit_lower% %kit_desc% %kit_mixed% %biography% 0 %briefdesc%"
    APPEND clastext.2da "%clastext%" UNLESS "%kit_name%"

    ACTION_FOR_EACH item IN
                    backstab
                    clsrcreq
                    clswpbon
                    hpclass
                    numwslot
                    thiefskl
                    traplimt
    BEGIN
      ACTION_IF FILE_CONTAINS_EVALUATED ("%item%.2da" "^[ %TAB%]*%class%[ %TAB%]+") BEGIN
        OUTER_SPRINT clone "%class%"
      END ELSE BEGIN
        OUTER_SPRINT clone ""
      END
      LAF fl#add_kit_ee#add_row
        STR_VAR
          kit_name
          input = EVAL EVAL "%%item%%"
          file = EVAL "%item%"
          clone
      END
    END

    ACTION_FOR_EACH item IN
                    clascolr
                    clasiskl
                    clasthac
                    thiefscl
    BEGIN
      LAF fl#add_kit_ee#add_column
        STR_VAR
          kit_name
          input = EVAL EVAL "%%item%%"
          file = EVAL "%item%"
          clone = EVAL "%class%"
      END
    END

    ACTION_FOR_EACH file IN
                    backstab
                    clascolr
                    clasiskl
                    clastext
                    clasthac
                    clsrcreq
                    clswpbon
                    hpclass
                    numwslot
                    thiefscl
                    thiefskl
                    traplimt
                    kitlist
    BEGIN
      COPY_EXISTING "%file%.2da" override
        PRETTY_PRINT_2DA
      BUT_ONLY
    END
  END
END

Addiitonal info:
The Weidu version used is 236
I have the following MODs installed: Dungeon be gone, Kelsey, Keto, NPC  flirt

Offline pro5

  • Planewalker
  • *****
  • Posts: 68
Re: Bug report: add kit (kit_name not implemented correctly??)
« Reply #3 on: February 04, 2014, 08:33:04 AM »
Thanks pro5, but I still have the same error message, and even if I remove all the optional parts in the TP2. Actually, Weidu's README says that only kit_name is mandatory, so I removed everything else, and here's how the TP2 looks like:

Quote
LAF fl#add_kit_ee
        STR_VAR
    kit_name = flrustle
END

Well, there's your problem - you are trying to call fl#add_kit_ee without first executing ADD_KIT. That's not how it works, as the readme says, add_kit_ee "complements" ADD_KIT by handling EE-specific things, but does not replace it.

Quote
Also, here's the TPA (quite different from yours) in the lib:
It's the same file, I just quoted only the relevant parts of it - the location where the typo I mentioned takes place, so Wysp doesn't waste time looking for it later. If you run a search for "briefidesc" in your copy, you should find it too.

Quote
Actually, Weidu's README says that only kit_name is mandatory, so I removed everything else
For fl#add_kit_ee, yes, only kit_name is required - but this kit_name must have already been added into kitlist.2da using ADD_KIT previously.
To sum up, this is the bare minimum code to get your sample kit in the game:
Code: [Select]
ADD_KIT ~flrustle~
  ~flrustle                1           1           1           1           1           0           0           0~
  ~flrustle 0 1 0 0 1 0 0 1 0 1 1 0 0 1 1 1 0 1 0 0 0 0 1 1 0 1 1 1 1 1 1 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0~
  ~flrustle                0       9       0       0       0       0~
  ~flrustle                0       0       0       0       0       0~
  ~flrustle                0       17      0       0       0       0~
  ~flrustle                0       15      0       0       0       0~
  ~flrustle                0       1       1       1       1       1       1       1       1~
  ~flrustle                1       1       1       0       0       0~
  ~example/flrustle.2da~
  ~K_T_H    K_T_D   K_T_G   K_T_E   K_T_HE   K_T_HL   K_T_HO~
  ~0x00080000    4~
  ~fl1~
  ~LEAT14 * * BAG28 RING06 RING05,10 * BOOT02 AMUL19 BRAC16 BELT06 AROW11,40 BULL03,40 BOLT06,40 POTN52,5 POTN04,2 POTN14,5 DAGG12 SW1H28 STAF08~
  SAY ~chickenrustler~
  SAY ~Chickenrustler~
  SAY ~CHICKENRUSTLER: kit description~

LAF fl#add_kit_ee
  STR_VAR
    kit_name = flrustle
END
« Last Edit: February 04, 2014, 08:35:57 AM by pro5 »

RK

  • Guest
Re: Bug report: add kit (kit_name not implemented correctly??)
« Reply #4 on: February 04, 2014, 10:38:07 AM »
Actually, I tried with the same TP2.
Quote
ADD_KIT ~flrustle~
  ~flrustle                1           1           1           1           1           0           0           0~
  ~flrustle 0 1 0 0 1 0 0 1 0 1 1 0 0 1 1 1 0 1 0 0 0 0 1 1 0 1 1 1 1 1 1 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0~
  ~flrustle                0       9       0       0       0       0~
  ~flrustle                0       0       0       0       0       0~
  ~flrustle                0       17      0       0       0       0~
  ~flrustle                0       15      0       0       0       0~
  ~flrustle                0       1       1       1       1       1       1       1       1~
  ~flrustle                1       1       1       0       0       0~
  ~example/flrustle.2da~
  ~K_T_H    K_T_D   K_T_G   K_T_E   K_T_HE   K_T_HL   K_T_HO~
  ~0x00080000    4~
  ~fl1~
  ~LEAT14 * * BAG28 RING06 RING05,10 * BOOT02 AMUL19 BRAC16 BELT06 AROW11,40 BULL03,40 BOLT06,40 POTN52,5 POTN04,2 POTN14,5 DAGG12 SW1H28 STAF08~
  SAY ~chickenrustler~
  SAY ~Chickenrustler~
  SAY ~CHICKENRUSTLER: kit description~

LAF fl#add_kit_ee
  STR_VAR
    kit_name = flrustle
END

The error message is still the same.

I managed to get my own kit working using Camdawg's tutorial @ G3:
http://forums.gibberlings3.net/index.php?showtopic=25609&st=0

BUT I also needed to add manually my kit to the CLSRCREQ.2DA file and copy it to the override, else it appeared in the game (in black), but was not selectable.
(that's a lot of hard work and tinkering for a kit.)

At this point, I'm starting to suspect that my own version of BG2EE might be the culprit. I'll have to test with someone else's kit to be sure...

Offline pro5

  • Planewalker
  • *****
  • Posts: 68
Re: Bug report: add kit (kit_name not implemented correctly??)
« Reply #5 on: February 04, 2014, 11:40:09 AM »
CLSRCREQ.2DA

The .lib attached to that G3 thread is a bit outdated now and doesn't handle this file. The .TPA file shipped with v236 does. Perhaps the v236 also has tighter validity checks that are causing your install attempts to fail for some reason. Just a wild guess, can only speculate at this point without hands-on look at your mod.

One thing comes to mind, this line from your DEBUG in original post:
Quote
Doing EE-type kit extensions for kit flrustle
[kitlist.2da] loaded, 4983 bytes
FAILURE:
suggests the kitlist.2da is not loaded from the override folder. If ADD_KIT succeeded in modifying that file prior to fl#add_kit_ee, it should be in override and that line should look like this instead:
Quote
Doing EE-type kit extensions for kit flrustle
[./override/kitlist.2da] loaded, 6985 bytes

The size also seems off... Why is your file less than 5 kb in size? The biffed KITLIST.2DA in my BG2EE install is 6,68 kb.

If you haven't already done so, try a clean install - remove any modified .2da and .ids files from the BG2EE override folder. If it fails again, I can only recommend repairing your install.
« Last Edit: February 04, 2014, 12:09:29 PM by pro5 »

RK

  • Guest
Re: Bug report: add kit (kit_name not implemented correctly??)
« Reply #6 on: February 04, 2014, 01:49:48 PM »
I have made a new installation of BG2EE and try to reinstall the example:
Here's the TP2
Quote
BACKUP "example/backup"
AUTHOR Wisp

BEGIN example

INCLUDE ~example/lib/fl#add_kit_ee.tpa~

ADD_KIT ~flrustle~
  ~flrustle                1           1           1           1           1           0           0           0~
  ~flrustle 0 1 0 0 1 0 0 1 0 1 1 0 0 1 1 1 0 1 0 0 0 0 1 1 0 1 1 1 1 1 1 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0~
  ~flrustle                0       9       0       0       0       0~
  ~flrustle                0       0       0       0       0       0~
  ~flrustle                0       17      0       0       0       0~
  ~flrustle                0       15      0       0       0       0~
  ~flrustle                0       1       1       1       1       1       1       1       1~
  ~flrustle                1       1       1       0       0       0~
  ~example/flrustle.2da~
  ~K_T_H    K_T_D   K_T_G   K_T_E   K_T_HE   K_T_HL   K_T_HO~
  ~0x00080000    4~
  ~fl1~
  ~LEAT14 * * BAG28 RING06 RING05,10 * BOOT02 AMUL19 BRAC16 BELT06 AROW11,40 BULL03,40 BOLT06,40 POTN52,5 POTN04,2 POTN14,5 DAGG12 SW1H28 STAF08~
  SAY ~chickenrustler~
  SAY ~Chickenrustler~
  SAY ~CHICKENRUSTLER: kit description~

LAF fl#add_kit_ee
   STR_VAR
    kit_name = flrustle
END


Here's the complete DEBUG:

Quote
WeiDU v 23600 Log

 C:\Program Files (x86)\Baldur's Gate II Enhanced Edition\Setup-example.exe
[./chitin.key] loaded, 843510 bytes
[./chitin.key] 185 BIFFs, 59857 resources
[.\weidu.conf] loaded, 17 bytes
[lang\en_us/dialog.tlk] loaded, 11539717 bytes
[lang\en_us/dialog.tlk] 102827 string entries

Using lang\en_us/dialog.tlk

Install Component [example]?
nstall, or [N]ot Install or [Q]uit?
Installing [example]
Adding flrustle Kit ...
[kitlist.2da] loaded, 4983 bytes
BIFF may be in hard-drive CD-path [./lang/en_us/DATA/DEFAULT.BIF]
BIFF may be in hard-drive CD-path [./cache/DATA/DEFAULT.BIF]
[./DATA/DEFAULT.BIF] 2816852 bytes, 508 files, 0 tilesets
Appending to files ...
Appended text to [CLASWEAP.2DA]
Appending to files column-wise ...
Appended text to [WEAPPROF.2DA] column-wise
Appending to files ...
Appended text to [ABCLASRQ.2DA]
Appending to files ...
Appended text to [ABDCDSRQ.2DA]
Appending to files ...
Appended text to [ABDCSCRQ.2DA]
Appending to files ...
Appended text to [ALIGNMNT.2DA]
Copying 1 file ...
[example/flrustle.2da] loaded, 11 bytes
Copied [example/flrustle.2da] to [override/FLRUSTLE.2DA]
Appending to files ...
Appended text to [KITLIST.2DA]
Appending to files ...
BIFF may be in hard-drive CD-path [./lang/en_us/DATA/25DEFLT.BIF]
BIFF may be in hard-drive CD-path [./cache/DATA/25DEFLT.BIF]
[./DATA/25DEFLT.BIF] 2924484 bytes, 163 files, 0 tilesets
Appended text to [LUABBR.2DA]
Set text in [25STWEAP.2DA] column-wise
Appending to files ...
Appended text to [KIT.IDS]
Appending to files ...
Appended text to [ABCLSMOD.2DA]
Appending to files ...
Appended text to [DUALCLAS.2DA]
Copying and patching 2 files ...
[./override/weapprof.2da] loaded, 79607 bytes
Copied [weapprof.2da] to [override/weapprof.2da]
[./override/25stweap.2da] loaded, 27006 bytes
Copied [25stweap.2da] to [override/25stweap.2da]
Copying and patching 1 file ...
[./override/kitlist.2da] loaded, 6954 bytes
Copied [kitlist.2da] to [override/kitlist.2da]
Appending to files ...
Appended text to [K_T_H.2DA]
Appending to files ...
Appended text to [K_T_D.2DA]
Appending to files ...
Appended text to [K_T_G.2DA]
Appending to files ...
Appended text to [K_T_E.2DA]
Appending to files ...
Appended text to [K_T_HE.2DA]
Appending to files ...
Appended text to [K_T_HL.2DA]
Appending to files ...
Appended text to [K_T_HO.2DA]
Copying and patching 2 files ...
[./override/weapprof.2da] loaded, 80743 bytes
Copied [weapprof.2da] to [override/weapprof.2da]
[./override/25stweap.2da] loaded, 26539 bytes
Copied [25stweap.2da] to [override/25stweap.2da]
Copying and patching 1 file ...
[./override/kitlist.2da] loaded, 6985 bytes
Copied [kitlist.2da] to [override/kitlist.2da]
Added flrustle Kit

Doing EE-type kit extensions for kit flrustle
[kitlist.2da] loaded, 4983 bytes
FAILURE:
The variable kit_name is required to name a valid kit
Stopping installation because of error.
Stopping installation because of error.
Stopping installation because of error.

ERROR Installing [example], rolling back to previous state
Unable to Unlink [example/backup/0/OTHER.0]: Unix.Unix_error(1, "unlink", "example/backup/0/OTHER.0")
[example/backup/0/UNSETSTR.0] SET_STRING uninstall info not found
Will uninstall  20 files for [SETUP-EXAMPLE.TP2] component 0.
Uninstalled     20 files for [SETUP-EXAMPLE.TP2] component 0.
Unable to Unlink [example/backup/0/READLN.0]: Unix.Unix_error(20, "unlink", "example/backup/0/READLN.0")
Unable to Unlink [example/backup/0/READLN.0.TEXT]: Unix.Unix_error(20, "unlink", "example/backup/0/READLN.0.TEXT")
ERROR: Failure("The variable kit_name is required to name a valid kit")
PLEASE email the file SETUP-EXAMPLE.DEBUG to Wisp

As you will see the Kitlist.2da is copied to the override folder:
Copied [kitlist.2da] to [override/kitlist.2da]
Now if I copy the Kitlist.2da to the folder with the Kit name already added manually, I also get the same message:
Quote
Doing EE-type kit extensions for kit flrustle
[kitlist.2da] loaded, 4983 bytes
FAILURE:
The variable kit_name is required to name a valid kit
Stopping installation because of error.


Offline pro5

  • Planewalker
  • *****
  • Posts: 68
Re: Bug report: add kit (kit_name not implemented correctly??)
« Reply #7 on: February 04, 2014, 02:14:00 PM »
I think I've discovered what causes this error, RK. Almost by accident.

As of my last post, I extracted the .2da file from biff to check its size so it was now residing in the same folder as the weidu .exe. The next time I tried to install the sample kit, I successfully replicated your error. :)

Basically, the problem lies with weidu checking the wrong file - instead of using the successfuly patched kitlist.2da file in the override folder, it's looking for your kit_name in the file you have in the folder with your installer's .exe file. Delete or move this file, and the problem should go away.

This is because of how this check in the .TPA is processed by WeiDU:
Code: [Select]
  PRINT "Doing EE-type kit extensions for kit %kit_name%"
  ACTION_IF "%kit_name%" STRING_EQUAL "" OR
            NOT FILE_CONTAINS_EVALUATED (kitlist.2da "%kit_name%")
  BEGIN
    FAIL ~The variable kit_name is required to name a valid kit~
  END
FILE_CONTAINS_EVALUATED will try to load the specified file (kitlist.2da) from several possible locations in this order:
1. Inlined files.
2. Specified file path (no path specified = current folder)
3. Override folder.
4. Biff files.

In your case, it was finding #2 before getting to #3.

For Wysp: I don't know if this qualifies as a bug or something that should be fixed, but this can be easily foolproofed against by changing the check to this instead:
Quote
  PRINT "Doing EE-type kit extensions for kit %kit_name%"
  COPY_EXISTING kitlist.2da ~override~
  ACTION_IF "%kit_name%" STRING_EQUAL "" OR
            NOT FILE_CONTAINS_EVALUATED (~override\kitlist.2da~ "%kit_name%")
  BEGIN
    FAIL ~The variable kit_name is required to name a valid kit~
  END

RK

  • Guest
Re: Bug report: add kit (kit_name not implemented correctly??)
« Reply #8 on: February 05, 2014, 12:10:43 AM »
Yes, you solved the problem and found two issues in the process:
1. TPA needs to be amended (briefidesc to briefdesc)
2. No extracted kitlist.2DA file should be lying around in the same folder as your Weidu install (you cannot guarantee players or modders won't accidentally extract it here...)

Thanks a lot,
RK

Offline Wisp

  • Moderator
  • Planewalker
  • *****
  • Posts: 1176
Re: Bug report: add kit (kit_name not implemented correctly??)
« Reply #9 on: February 08, 2014, 08:01:58 PM »
"briefidesc" was fixed a while ago. Until WeiDU 237 is released, the latest version can be had here.

I'll make the validity check more robust. Thanks for figuring the problem out.

 

With Quick-Reply you can write a post when viewing a topic without loading a new page. You can still use bulletin board code and smileys as you would in a normal post.

Warning: this topic has not been posted in for at least 120 days.
Unless you're sure you want to reply, please consider starting a new topic.

Name: Email:
Verification:
Type the letters shown in the picture
Listen to the letters / Request another image
Type the letters shown in the picture:
What color is grass?:
What is the seventh word in this sentence?:
What is five minus two (use the full word)?: