temnix Posted June 29, 2020 Share Posted June 29, 2020 (edited) This mod I'm making is making Weidu go a little slower, possibly because of memory stress, but not terribly so, and then it stops and just continues to blink there, going nowhere. This is the second time. The last time I had to close the window, and this means lots of files got patched midway, without even a way to undo the changes. My own installation must have gotten messed up. But more important, it's happening again, and not for any kind of extreme patching either. Simply scripts are getting extended, on top, with a small snippet of code on top, unproblematic, and in a long list of updates that were successful one hangs the system. It isn't the same script as the last file either, judging by the recent files that appeared in override. Weidu just hangs. I'm going to restart the computer now and see if that helps, but - any suggestions? Edit: okay, restarting and trying the installation on a more powerful machine didn't do the job. But since some of the scripts are getting extended before this freeze, clearly the fault is not with the code being added but with how I wrote my tp2. It overburdens Weidu somehow. Here is the culprit code, I think. This is actually already past the script extension stage, it's for setting an area variable that will mark "wild" areas. Without this, the mod installs. But Weidu doesn't find logical errors here, only the code somehow bogs it down. The part in red is several checks to exclude starting areas in all of the games. The part in green covers area types - dungeons, forests and general-wild (outdoor but not a city) that should be included, an OR links it to areas in purple, which are indoor but in wild places (cabins etc.) and should get patched as well. PATCH_IF !(((GAME_IS ~bgee~) & (~%SOURCE_RES%~ STRING_EQUAL_CASE ~AR2600~)) || ((GAME_IS ~bg2ee~) & (~%SOURCE_RES%~ STRING_EQUAL_CASE ~AR0601~) & (~%SOURCE_RES%~ STRING_EQUAL_CASE ~AR0602~) & (~%SOURCE_RES%~ STRING_EQUAL_CASE ~AR0603~)) || ((GAME_IS ~iwdee~) & (~%SOURCE_RES%~ STRING_EQUAL_CASE ~AR1000~)) || ((GAME_IS ~eet~) & (~%SOURCE_RES%~ STRING_EQUAL_CASE ~BG2600~) & (~%SOURCE_RES%~ STRING_EQUAL_CASE ~AR0601~) & (~%SOURCE_RES%~ STRING_EQUAL_CASE ~AR0602~) & (~%SOURCE_RES%~ STRING_EQUAL_CASE ~AR0603~))) & ((((flags2 & BIT4) == BIT4) || ((flags2 & BIT5) == BIT5) || (((flags2 & BIT0) == BIT0) & ((flags2 & BIT3) != BIT3))) || (~%SOURCE_RES%~ STRING_EQUAL_CASE ~AR1009~) || (~%SOURCE_RES%~ STRING_EQUAL_CASE ~AR1010~) || (~%SOURCE_RES%~ STRING_EQUAL_CASE ~AR2000~) || (~%SOURCE_RES%~ STRING_EQUAL_CASE ~AR1008~) || (~%SOURCE_RES%~ STRING_EQUAL_CASE ~AR2001~) || (~%SOURCE_RES%~ STRING_EQUAL_CASE ~AR2002~) || (~%SOURCE_RES%~ STRING_EQUAL_CASE ~AR2003~) || (~%SOURCE_RES%~ STRING_EQUAL_CASE ~AR2004~) || (~%SOURCE_RES%~ STRING_EQUAL_CASE ~AR2005~) || (~%SOURCE_RES%~ STRING_EQUAL_CASE ~AR2006~) || (~%SOURCE_RES%~ STRING_EQUAL_CASE ~AR2007~) || (~%SOURCE_RES%~ STRING_EQUAL_CASE ~AR2008~) || (~%SOURCE_RES%~ STRING_EQUAL_CASE ~AR2009~) || (~%SOURCE_RES%~ STRING_EQUAL_CASE ~AR2010~) || (~%SOURCE_RES%~ STRING_EQUAL_CASE ~AR2011~) || (~%SOURCE_RES%~ STRING_EQUAL_CASE ~AR2012~) || (~%SOURCE_RES%~ STRING_EQUAL_CASE ~BG1009~) || (~%SOURCE_RES%~ STRING_EQUAL_CASE ~BG1010~) || (~%SOURCE_RES%~ STRING_EQUAL_CASE ~BG2000~) || (~%SOURCE_RES%~ STRING_EQUAL_CASE ~BG1008~) || (~%SOURCE_RES%~ STRING_EQUAL_CASE ~BG2001~) || (~%SOURCE_RES%~ STRING_EQUAL_CASE ~BG2002~) || (~%SOURCE_RES%~ STRING_EQUAL_CASE ~BG2003~) || (~%SOURCE_RES%~ STRING_EQUAL_CASE ~BG2004~) || (~%SOURCE_RES%~ STRING_EQUAL_CASE ~BG2005~) || (~%SOURCE_RES%~ STRING_EQUAL_CASE ~BG2006~) || (~%SOURCE_RES%~ STRING_EQUAL_CASE ~BG2007~) || (~%SOURCE_RES%~ STRING_EQUAL_CASE ~BG2008~) || (~%SOURCE_RES%~ STRING_EQUAL_CASE ~BG2009~) || (~%SOURCE_RES%~ STRING_EQUAL_CASE ~BG2010~) || (~%SOURCE_RES%~ STRING_EQUAL_CASE ~BG2011~) || (~%SOURCE_RES%~ STRING_EQUAL_CASE ~BG2012~) || (~%SOURCE_RES%~ STRING_EQUAL_CASE ~AR3201~) || (~%SOURCE_RES%~ STRING_EQUAL_CASE ~BG3201~) || (~%SOURCE_RES%~ STRING_EQUAL_CASE ~AR1601~) || (~%SOURCE_RES%~ STRING_EQUAL_CASE ~BG1601~) || (~%SOURCE_RES%~ STRING_EQUAL_CASE ~AR1602~) || (~%SOURCE_RES%~ STRING_EQUAL_CASE ~BG1602~) || (~%SOURCE_RES%~ STRING_EQUAL_CASE ~AR1805~) || (~%SOURCE_RES%~ STRING_EQUAL_CASE ~AR1806~) || (~%SOURCE_RES%~ STRING_EQUAL_CASE ~AR1807~) || (~%SOURCE_RES%~ STRING_EQUAL_CASE ~AR1808~) || (~%SOURCE_RES%~ STRING_EQUAL_CASE ~AR1809~) || (~%SOURCE_RES%~ STRING_EQUAL_CASE ~BG1805~) || (~%SOURCE_RES%~ STRING_EQUAL_CASE ~BG1806~) || (~%SOURCE_RES%~ STRING_EQUAL_CASE ~BG1807~) || (~%SOURCE_RES%~ STRING_EQUAL_CASE ~BG1808~) || (~%SOURCE_RES%~ STRING_EQUAL_CASE ~BG1809~) || (~%SOURCE_RES%~ STRING_EQUAL_CASE ~AR2101~) || (~%SOURCE_RES%~ STRING_EQUAL_CASE ~BG2101~) || (~%SOURCE_RES%~ STRING_EQUAL_CASE ~AR1901~) || (~%SOURCE_RES%~ STRING_EQUAL_CASE ~AR1902~) || (~%SOURCE_RES%~ STRING_EQUAL_CASE ~AR1903~) || (~%SOURCE_RES%~ STRING_EQUAL_CASE ~AR1904~) || (~%SOURCE_RES%~ STRING_EQUAL_CASE ~AR1905~) || (~%SOURCE_RES%~ STRING_EQUAL_CASE ~AR1906~) || (~%SOURCE_RES%~ STRING_EQUAL_CASE ~AR1907~) || (~%SOURCE_RES%~ STRING_EQUAL_CASE ~BG1901~) || (~%SOURCE_RES%~ STRING_EQUAL_CASE ~BG1902~) || (~%SOURCE_RES%~ STRING_EQUAL_CASE ~BG1903~) || (~%SOURCE_RES%~ STRING_EQUAL_CASE ~BG1904~) || (~%SOURCE_RES%~ STRING_EQUAL_CASE ~BG1905~) || (~%SOURCE_RES%~ STRING_EQUAL_CASE ~BG1906~) || (~%SOURCE_RES%~ STRING_EQUAL_CASE ~BG1907~) || (~%SOURCE_RES%~ STRING_EQUAL_CASE ~AR3202~) || (~%SOURCE_RES%~ STRING_EQUAL_CASE ~BG3202~) || (~%SOURCE_RES%~ STRING_EQUAL_CASE ~AR4101~) || (~%SOURCE_RES%~ STRING_EQUAL_CASE ~BG4101~)) THEN BEGIN LPF fj_are_structure STR_VAR fj_structure_type = variable fj_name = ~REP-WILD~ fj_variable_value = 1 END END Edited June 29, 2020 by temnix Quote Link to comment
subtledoctor Posted June 29, 2020 Share Posted June 29, 2020 That doesn’t show much of the code. Either it’s just taking a long time and you’re not being sufficiently patient (I don’t know how efficient that function is... running 100 times might just be really slow), or you have a loop somewhere and the code is running ad infinitum. Maybe break this up into different pieces rather than having various conditions in a single patch command. In fact you don’t seem to have a BUT_ONLY so this will copy every file, regardless of the patch conditions. Rather than copying all files and setting filenames as patch conditions, why not just ACTION_FOR_EACH filename IN ~BG1900~ ~BG1901~ [etc.] BEGIN COPY_EXISTING ~%filename%.are~ ~override~ LPF whatever IF_EXISTS BUT_ONLY END ? Either way, if you close the installer mid-stream, it can hose your install. Best to start from a clean backup at that point - running the code again on the unclean game files might itself cause problems. Quote Link to comment
temnix Posted June 29, 2020 Author Share Posted June 29, 2020 With that code I would only patch specific files. My code is for excluding some files and including others that wouldn't normally meet the criteria (not a wild area). But this is only a part of the code, the conclusion, as I said. I did separate it out, hoping it would make Weidu's job easier, but even by itself it never gets anywhere. I have a BUT_ONLY after this, of course. It's not an essential part of the mod, but it would be handy to assign a variable to all areas of the right kind that could be looked up instead of going through AreaCheck and so on. Quote Link to comment
Mike1072 Posted August 25, 2020 Share Posted August 25, 2020 See here. You define the array before the COPY action. 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.