Author Topic: Tentative changes for next version  (Read 1818 times)

Offline Wisp

  • Moderator
  • Planewalker
  • *****
  • Posts: 1169
Tentative changes for next version
« on: November 09, 2021, 11:49:32 AM »
Thus far I have:
Code: [Select]
  * Add --ask-only command-line option.
  * --parse-check does not fail on trarefs in BAF.
  * MODDER FUN_ARGS report name of function and type of argument.
  * WeiDU does not terminate if it fails to resolve a traref for
    MOD_VERSION.
  * Having the VERSION string be a traref does not result in an error.
  * The variable WEIDU_VER is set correctly.
  * HANDLE_CHARSETS can convert non-TRA files. Thanks, the_bigg.
  * Attempts to load movie files are made with the WBM extension on
    EE-type games.
  * Fix failure to re-run WeiDU after auto-update if the file name
    contained spaces.
  * Fix regression that mangled Latin-1 characters.
  * TP2_BASE_NAME once again does not include a file extension, to
    match previous de facto behaviour.
  * Fix regression involving SUBCOMPONENT predicates.
  * Fix bug that had GET_UNIQUE_FILE_NAME returning non-unique results
    if variable base was empty. Thanks, DavidW.
  * Fix variable leak in ADD_JOURNAL.
  * Changes to fj_are_structure parameters to better reflect file
    structure, as well as additions for EE.
  * Optimise processing of LABELs in own TP2.
  * Fix incorrect line-breaking in DLGs that resulted in broken IDS
    symbols, and possibly other problems. Affected DLGs need to be
    recreated.
  * WeiDU does not fail to load, for example, the file ".BCS".
  * Support EE 2.6's MISSILE.IDS.

Have I overlooked anything? Is there something you think should be fixed for or included in v248?

Offline AL|EN

  • Planewalker
  • *****
  • Posts: 390
  • Gender: Male
Re: Tentative changes for next version
« Reply #1 on: November 09, 2021, 04:32:41 PM »
You asked you shall receive:

Bugs:
1. WeiDU 247 %MOD_FOLDER% has an incorrect value, 246 works - https://forums.pocketplane.net/index.php?topic=29956.0 - fixed!
    AFAIR, the above bug caused yet another bug: mods can't use %MOD_FOLDER% variable inside LANGUAGE statement because the component names are "UNDEFINED STRING: ..." - fixed!
2. WeiDU is destroying every executable which is called 'Setup-xxx' even if the returned version is -1. - https://forums.pocketplane.net/index.php?topic=29925.msg340248#msg340248

Inclusion:
3. Add evaluate variables to AUTO_TRA - https://forums.pocketplane.net/index.php?topic=29971.msg340545#msg340545 - done!
4. Add evaluate variables to  REQUIRE_COMPONENT - https://forums.pocketplane.net/index.php?topic=29974.msg340459#msg340459
« Last Edit: April 27, 2022, 06:35:54 AM by AL|EN »
Project Infinity public BETA - mod manager for Infinity Engine games
Modder's Guide to Github - you cannot have progress without committing changes

Offline Graion Dilach

  • Planewalker
  • *****
  • Posts: 4
Re: Tentative changes for next version
« Reply #2 on: November 09, 2021, 10:39:20 PM »
WeiDU 247 %MOD_FOLDER% has an incorrect value, 246 works - https://forums.pocketplane.net/index.php?topic=29956.0
    AFAIR, the above bug caused yet another bug: mods can't use %MOD_FOLDER% variable inside LANGUAGE statement because the component names are "UNDEFINED STRING: ..."

This is listed actually, as
Code: [Select]
TP2_BASE_NAME once again does not include a file extension, to match previous de facto behaviour.

Offline AL|EN

  • Planewalker
  • *****
  • Posts: 390
  • Gender: Male
Re: Tentative changes for next version
« Reply #3 on: November 09, 2021, 11:13:22 PM »
@Graion Dilach I think you are confusing MOD_FOLDER with TP2_BASE_NAME, those variables aren't related and they serve different puporse.
Project Infinity public BETA - mod manager for Infinity Engine games
Modder's Guide to Github - you cannot have progress without committing changes

Offline Wisp

  • Moderator
  • Planewalker
  • *****
  • Posts: 1169
Re: Tentative changes for next version
« Reply #4 on: November 10, 2021, 12:59:48 PM »
1. WeiDU 247 %MOD_FOLDER% has an incorrect value, 246 works - https://forums.pocketplane.net/index.php?topic=29956.0
Done.
Quote
AFAIR, the above bug caused yet another bug: mods can't use %MOD_FOLDER% variable inside LANGUAGE statement because the component names are "UNDEFINED STRING: ..."
If you by that mean LANGUAGE has never evaluated variables or claimed it does, no, no it hasn't. I might be able to add that, but not for this release and I'd have to sort through all the stack-management code to make sure LANGUAGE would never be evaluated against a stale or incorrect variable environment before I could provide an answer.

Offline AL|EN

  • Planewalker
  • *****
  • Posts: 390
  • Gender: Male
Re: Tentative changes for next version
« Reply #5 on: November 10, 2021, 01:59:40 PM »
1. WeiDU 247 %MOD_FOLDER% has an incorrect value, 246 works - https://forums.pocketplane.net/index.php?topic=29956.0
Done.
Thanks!


Quote
AFAIR, the above bug caused yet another bug: mods can't use %MOD_FOLDER% variable inside LANGUAGE statement because the component names are "UNDEFINED STRING: ..."
If you by that mean LANGUAGE has never evaluated variables or claimed it does, no, no it hasn't. I might be able to add that, but not for this release and I'd have to sort through all the stack-management code to make sure LANGUAGE would never be evaluated against a stale or incorrect variable environment before I could provide an answer.
No, I simply mean this:
Quote
LANGUAGE "English" "english" "%MOD_FOLDER%/lang/english/setup.tra"
and with Ad.1 being fixed, this problem is gone!

P.S. So making AUTO_TRA evaluate variables won't make it?
« Last Edit: November 10, 2021, 02:01:35 PM by AL|EN »
Project Infinity public BETA - mod manager for Infinity Engine games
Modder's Guide to Github - you cannot have progress without committing changes

Offline Wisp

  • Moderator
  • Planewalker
  • *****
  • Posts: 1169
Re: Tentative changes for next version
« Reply #6 on: November 10, 2021, 02:52:56 PM »
P.S. So making AUTO_TRA evaluate variables won't make it?
I can't very well say it's done until it's actually done, can I?

I figure I'll give this thread a few days, maybe release on saturday. I'll keep adding stuff as time allows until then.

Offline _Luke_

  • Planewalker
  • *****
  • Posts: 15
Re: Tentative changes for next version
« Reply #7 on: November 11, 2021, 04:00:02 AM »
Inclusion:
4. Add evaluate variables to  REQUIRE_COMPONENT - https://forums.pocketplane.net/index.php?topic=29974.msg340459#msg340459

I'd also add REQUIRE_PREDICATE...

Thus far I have:
Code: [Select]
  * Changes to fj_are_structure parameters to better reflect file
    structure, as well as additions for EE.

What about making sure this function works as intended when MODDER fun_args is enabled https://github.com/WeiDUorg/weidu/issues/182#issuecomment-775031472 ?

Offline AL|EN

  • Planewalker
  • *****
  • Posts: 390
  • Gender: Male
Re: Tentative changes for next version
« Reply #8 on: November 11, 2021, 04:11:35 AM »
P.S. So making AUTO_TRA evaluate variables won't make it?
I can't very well say it's done until it's actually done, can I?

I figure I'll give this thread a few days, maybe release on saturday. I'll keep adding stuff as time allows until then.
I'm sorry for my impatience. I was under impression that a reply from your side means "I did what I could, I'm done now". Now it seems that this new process of asking about 'personally needed stuff before the new release' is wonderful and already exciting my expectations. Many thanks!
Project Infinity public BETA - mod manager for Infinity Engine games
Modder's Guide to Github - you cannot have progress without committing changes

Offline Wisp

  • Moderator
  • Planewalker
  • *****
  • Posts: 1169
Re: Tentative changes for next version
« Reply #9 on: November 13, 2021, 03:01:26 AM »
[What about making sure this function works as intended when MODDER fun_args is enabled https://github.com/WeiDUorg/weidu/issues/182#issuecomment-775031472 ?
You can still use FUN_ARGS with array arguments (unless you've set MODDER to FAIL), can't you? While the false positives are unfortunate, I don't think it's a pressing issue.

Edit: oh, and the AUTO_TRA thing is done, as well as the auto-update thing.
« Last Edit: November 13, 2021, 03:32:39 AM by Wisp »

Offline _Luke_

  • Planewalker
  • *****
  • Posts: 15
Re: Tentative changes for next version
« Reply #10 on: November 13, 2021, 03:56:48 AM »
[What about making sure this function works as intended when MODDER fun_args is enabled https://github.com/WeiDUorg/weidu/issues/182#issuecomment-775031472 ?
You can still use FUN_ARGS with array arguments (unless you've set MODDER to FAIL), can't you? While the false positives are unfortunate, I don't think it's a pressing issue.

I usually set fun_args fail since it's quite important for me...
Having said that, this advice (https://github.com/WeiDUorg/weidu/issues/212#issue-1052634054) should be enough to warn modders about how to silence the false positives...

Separately, what can you tell me of this?
Inclusion:
4. Add evaluate variables to  REQUIRE_COMPONENT - https://forums.pocketplane.net/index.php?topic=29974.msg340459#msg340459

I'd also add REQUIRE_PREDICATE...

As of now, the following mod will fail to install
Code: [Select]
BACKUP ~test/backup~ // location to store files for uninstall purposes
SUPPORT ~~
AUTO_EVAL_STRINGS

ALWAYS
OUTER_SET "foo" = 67
END

VERSION ~v1.0~

LANGUAGE
~English~
~english~
~test/lang/english/setup.tra~

BEGIN "Does REQUIRE_PREDICATE evaluate variables?"
REQUIRE_PREDICATE (VARIABLE_IS_SET ~foo~) ~Should not happen~

PRINT "~%foo%~"
« Last Edit: November 13, 2021, 04:08:05 AM by _Luke_ »

Offline Argent77

  • Planewalker
  • *****
  • Posts: 184
Re: Tentative changes for next version
« Reply #11 on: November 13, 2021, 04:30:56 AM »
Separately, what can you tell me of this?
Inclusion:
4. Add evaluate variables to  REQUIRE_COMPONENT - https://forums.pocketplane.net/index.php?topic=29974.msg340459#msg340459

I'd also add REQUIRE_PREDICATE...

As of now, the following mod will fail to install
Code: [Select]
BACKUP ~test/backup~ // location to store files for uninstall purposes
SUPPORT ~~
AUTO_EVAL_STRINGS

ALWAYS
OUTER_SET "foo" = 67
END

VERSION ~v1.0~

LANGUAGE
~English~
~english~
~test/lang/english/setup.tra~

BEGIN "Does REQUIRE_PREDICATE evaluate variables?"
REQUIRE_PREDICATE (VARIABLE_IS_SET ~foo~) ~Should not happen~

PRINT "~%foo%~"

I can imagine that a change like this will introduce compatibility issues with existing mods which expect the ALWAYS block to be executed *after* the mod requirements have been evaluated.

There is already the ABORT action available which can be used to terminate a mod component in a safe manner.

Offline Wisp

  • Moderator
  • Planewalker
  • *****
  • Posts: 1169
Re: Tentative changes for next version
« Reply #12 on: November 13, 2021, 05:28:37 AM »
Separately, what can you tell me of this?
That will never work, as Argent77 is correct in that ALWAYS is executed before your component's actions, but well after its predicates are evaluated.

So I may as well ask, what kind of variables are you and  AL|EN planning on evaluating here? REQUIRE_PREDICATE does already evaluate variables, those occurring inside each value.

Offline _Luke_

  • Planewalker
  • *****
  • Posts: 15
Re: Tentative changes for next version
« Reply #13 on: November 13, 2021, 06:51:59 AM »
I can imagine that a change like this will introduce compatibility issues with existing mods which expect the ALWAYS block to be executed *after* the mod requirements have been evaluated.

There is already the ABORT action available which can be used to terminate a mod component in a safe manner.

@Wisp
Ah, yes, you're right.
The only real case scenario I can think of is the following one:

For some unknown reason, the BGEE version of SPELL.IDS has the entry 2610 WIZARD_MONSTER_SUMMONING_4.
However, the file spwi610.spl does not actually exist as a game resource, so checks like this one
Code: [Select]
REQUIRE_PREDICATE (RESOURCE_CONTAINS "SPELL.IDS" "[ %TAB%]WIZARD_MONSTER_SUMMONING_4[ %TAB%%WNL%$]")are not reliable.

As a result, checking if a var is set
Code: [Select]
REQUIRE_PREDICATE (VARIABLE_IS_SET "WIZARD_MONSTER_SUMMONING_4")would be more reliable in this case (provided that such variable has been defined in your ALWAYS block, along with making sure that "%WIZARD_MONSTER_SUMMONING_4%.spl" does exist as a game resource).
But as you said, the ALWAYS block is executed *after* the mod requirements have been evaluated, so I can't use that either...

Sure, I could write
Code: [Select]
REQUIRE_PREDICATE (FILE_EXISTS_IN_GAME "SPWI610.SPL")but you know better than me that functional programming is the way, so nope, that's not ideal either... Moreover, it won't work on IWDEE (since WIZARD_MONSTER_SUMMONING_4 is SPWI627 there...)

So to sum up, guess I'll use ABORT...
« Last Edit: November 13, 2021, 09:13:40 AM by _Luke_ »

Offline _Luke_

  • Planewalker
  • *****
  • Posts: 15
Re: Tentative changes for next version
« Reply #14 on: November 13, 2021, 09:19:48 AM »
Is there something you think should be fixed for or included in v248?

What about including all of this https://github.com/Argent77/A7-add_kit_ex ?

Offline Wisp

  • Moderator
  • Planewalker
  • *****
  • Posts: 1169
Re: Tentative changes for next version
« Reply #15 on: November 13, 2021, 03:22:16 PM »
What about including all of this https://github.com/Argent77/A7-add_kit_ex ?
If Argent77 thinks it's a good idea, I can see about adding it for next version.

Offline Argent77

  • Planewalker
  • *****
  • Posts: 184
Re: Tentative changes for next version
« Reply #16 on: November 13, 2021, 04:05:17 PM »
What about including all of this https://github.com/Argent77/A7-add_kit_ex ?
If Argent77 thinks it's a good idea, I can see about adding it for next version.

I have no problems with having the library added to WeiDU. It's pretty much feature-complete and well enough tested by now.

Offline AL|EN

  • Planewalker
  • *****
  • Posts: 390
  • Gender: Male
Re: Tentative changes for next version
« Reply #17 on: November 16, 2021, 03:13:27 PM »
Separately, what can you tell me of this?
That will never work, as Argent77 is correct in that ALWAYS is executed before your component's actions, but well after its predicates are evaluated.

So I may as well ask, what kind of variables are you and  AL|EN planning on evaluating here? REQUIRE_PREDICATE does already evaluate variables, those occurring inside each value.


FWIW, this is my use-case:

Quote

 BACKUP "weidu_external/backup/RCVar"
SUPPORT "RCVar"
VERSION "0.1.0"


ALWAYS
    // for internal components only
    OUTER_SET RCVar-C1 = ID_OF_LABEL "%TP2_FILE_NAME%" "RCVar-Component-1"
    PRINT "%RCVar-C1%"
END


BEGIN "RCVar-1" DESIGNATED 1000 LABEL "RCVar-Component-1"
PRINT ""


BEGIN "RCVar-2" DESIGNATED 2000 LABEL "RCVar-Component-2" NO_LOG_RECORD
// dosen't work: REQUIRE_COMPONENT "%TP2_FILE_NAME%" "%RCVar-C1%" "This component require: RCVar-Component-1"
REQUIRE_COMPONENT "RCVar.tp2" "1000" "This component require: RCVar-Component-1"


PRINT ""
My main motivation for the request was the inability to use ID_OF_LABEL for REQUIRE_COMPONENT combined with the awful syntax required for REQUIRE_PREDICTATE+ID_OF_LABEL.
« Last Edit: November 16, 2021, 03:28:54 PM by AL|EN »
Project Infinity public BETA - mod manager for Infinity Engine games
Modder's Guide to Github - you cannot have progress without committing changes

Offline Wisp

  • Moderator
  • Planewalker
  • *****
  • Posts: 1169
Re: Tentative changes for next version
« Reply #18 on: November 17, 2021, 02:55:01 PM »
...
So shall I close the issue? You are better off requesting some semantic sugar, or whatever would be the proper term for it. I have not looked at it and I reserve the right to tell you it cannot be done, but I could probably do something like REQUIRE_LABEL tp2 label.
« Last Edit: November 17, 2021, 03:04:46 PM by Wisp »

 

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)?: