Austin Posted October 7, 2020 Share Posted October 7, 2020 (edited) Hello! When creating my mod, I have a problem installing on a vanilla (non-EE) version. Error text: ERROR: processing .D actions [NPC_Interjections/dlg/ANspellh.d]: Failure("hd") Stopping installation because of error. The reason for the error is in these lines (excerpt) INTERJECT_COPY_TRANS3 PPTIAX 1 ANALLtiax1 == IF_FILE_EXISTS RASAADJ IF ~InParty("Rasaad") InMyArea("Rasaad") !Dead("Rasaad") !StateCheck("Rasaad",CD_STATE_NOTVALID) Global("ANRasaadTiax","GLOBAL",0)~ THEN @777 DO ~SetGlobal("ANRasaadTiax","GLOBAL",1)~ == PPTIAX IF ~InParty("Rasaad") InMyArea("Rasaad") !Dead("Rasaad") !StateCheck("Rasaad",CD_STATE_NOTVALID) Global("ANRasaadTiax","GLOBAL",0)~ THEN @778 END If I delete all the lines about EE-NPCs, the error disappears. Everything works fine on the EE version. But not "vanilla". Why does it arise and what does "Failure("hd")" mean? I studied the WeiDU documentation and it says that lines containing IF_FILE_EXISTS should be skipped in this case. But it doesn't work as expected and an error appears. Edited October 7, 2020 by Austin Quote Link to comment
Austin Posted October 8, 2020 Author Share Posted October 8, 2020 I never found the cause of the problem, but I managed to solve it! The method suggested by tipun from our Russian forum. Problematic lines in d-files are replaced with variables, for example: INTERJECT_COPY_TRANS3 VALYGAR 43 ANallvalyg43 == EDWINJ IF ~ InParty ("Edwin") InMyArea ("Edwin")! Dead ("Edwin")! StateCheck ("Edwin", CD_STATE_NOTVALID) ~ THEN @ 24 == KORGANJ IF ~ InParty ("Korgan") InMyArea ("Korgan")! Dead ("Korgan")! StateCheck ("Korgan", CD_STATE_NOTVALID) ~ THEN @ 25 % dlg_string11% END And the code added to the tp2-file before compiling the problematic d-files: OUTER_SPRINT ~tilde~ "~" ACTION_IF (GAME_IS ~bg2ee eet~) BEGIN OUTER_SPRINT ~dlg_string11~ ~== DORNJ IF %tilde%InParty("Dorn") InMyArea("Dorn") !Dead("Dorn") !StateCheck("Dorn",CD_STATE_NOTVALID)%tilde% THEN @26~ END ELSE BEGIN OUTER_SPRINT ~dlg_string11~ ~~ END COPY ~%MOD_FOLDER%/dlg/ANmisc.d~ ~%MOD_FOLDER%/dlg~ EVALUATE_BUFFER COMPILE ~AboutHerUs/dlg/ANmisc.d~ EVALUATE_BUFFER Now the mod is normally installed on both the EE version and the "vanilla" version! Quote Link to comment
Magus Posted October 14, 2020 Share Posted October 14, 2020 I think chainText doesn't support IF_FILE_EXISTS in first line. Now would probably be a good time to put in such a request. Quote Link to comment
Wisp Posted October 17, 2020 Share Posted October 17, 2020 The ICT line of actions do support IF_FILE_EXISTS, but it's not really documented. The error likely means that WeiDU tried to take the first element of an empty list and it's essentially a WeiDU bug that you are getting it, since it's completely unhelpful. However, I'm not able to reproduce the problem. The code in the first post compiles without errors. If it's a better error message that is needed, I can likely take care of that without a test case, but if the error shouldn't be happening, I am going to need some code sample with which I can reproduce the problem. Quote Link to comment
Austin Posted October 19, 2020 Author Share Posted October 19, 2020 (edited) SOLVED Edited January 29, 2021 by Austin Quote Link to comment
Austin Posted January 29, 2021 Author Share Posted January 29, 2021 (edited) I found the reason for this error!! It turned out that in the I_C_T3 block it is impossible to do the last line containing IF_FILE_EXIST. In this case, Error ("Failure ("hd")") appears during installation. If after that we add one more, last, line for the character, which is in the game anyway, then the processing ends without errors! Example. This block led to an error during installation: INTERJECT_COPY_TRANS3 PPSTAT01 21 ANanswerALL21 == NALIAJ IF ~InParty("Nalia") InMyArea("Nalia") !StateCheck("Nalia",CD_STATE_NOTVALID)~ THEN @48 == ANOMENJ IF ~InParty("Anomen") InMyArea("Anomen") !StateCheck("Anomen",CD_STATE_NOTVALID)~ THEN @49 == IMOEN2J IF ~InParty("Imoen2") InMyArea("Imoen2") !StateCheck("Imoen2",CD_STATE_NOTVALID)~ THEN @50 == IF_FILE_EXISTS 7XMONTJ IF ~InParty("7XMONT") InMyArea("7XMONT") !StateCheck("7XMONT",CD_STATE_NOTVALID)~ THEN @90 == IF_FILE_EXISTS 7XSafaJ IF ~InParty("7XSAFA") InMyArea("7XSAFA") !StateCheck("7XSAFA",CD_STATE_NOTVALID)~ THEN @91 == IF_FILE_EXISTS 7XSkiJ IF ~InParty("7XSKI") InMyArea("7XSKI") !StateCheck("7XSKI",CD_STATE_NOTVALID)~ THEN @92 == IF_FILE_EXISTS 7XsharJ IF ~InParty("7XSHAR") InMyArea("7XSHAR") !StateCheck("7XSHAR",CD_STATE_NOTVALID)~ THEN @93 END But if I add one more line at the end for the usual character of the game, then the Error ("Failure ("hd")") disappears and everything installs well: INTERJECT_COPY_TRANS3 PPSTAT01 21 ANanswerALL21 == NALIAJ IF ~InParty("Nalia") InMyArea("Nalia") !StateCheck("Nalia",CD_STATE_NOTVALID)~ THEN @48 == ANOMENJ IF ~InParty("Anomen") InMyArea("Anomen") !StateCheck("Anomen",CD_STATE_NOTVALID)~ THEN @49 == IMOEN2J IF ~InParty("Imoen2") InMyArea("Imoen2") !StateCheck("Imoen2",CD_STATE_NOTVALID)~ THEN @50 == IF_FILE_EXISTS 7XMONTJ IF ~InParty("7XMONT") InMyArea("7XMONT") !StateCheck("7XMONT",CD_STATE_NOTVALID)~ THEN @90 == IF_FILE_EXISTS 7XSafaJ IF ~InParty("7XSAFA") InMyArea("7XSAFA") !StateCheck("7XSAFA",CD_STATE_NOTVALID)~ THEN @91 == IF_FILE_EXISTS 7XSkiJ IF ~InParty("7XSKI") InMyArea("7XSKI") !StateCheck("7XSKI",CD_STATE_NOTVALID)~ THEN @92 == IF_FILE_EXISTS 7XsharJ IF ~InParty("7XSHAR") InMyArea("7XSHAR") !StateCheck("7XSHAR",CD_STATE_NOTVALID)~ THEN @93 == CERNDJ IF ~InParty("Cernd") InMyArea("Cernd") !StateCheck("Cernd",CD_STATE_NOTVALID)~ THEN @877 END And it seems the same problem sometimes happens if the first line contains IF_FILE_EXISTS. I don't know why this is happening - here is a question for Wisp, I guess. The main thing is that we managed to solve this problem. It is necessary to do the first and the last lines without checks IF_FILE_EXISTS Edited January 29, 2021 by Austin Quote Link to comment
Recommended Posts
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.