Page 1 of 1
Problems with Mods after v1.5.40 update
Posted: Tue Jan 25, 2022 9:25 pm
by Adebar
rbodleyscott wrote: ↑Wed Jan 26, 2022 11:00 am (Added to this post by RBS as I cannot insert a post above the posts transferred from the thread where they were off-topic)
Some mods won't work correctly in v1.5.40 until they have been updated.
This is mostly because the new parser is stricter than the old one, and will not allow extraneous extra ")"s at the ends of lines.
Though, as usual after an update, some mods with modded scripts may also fall foul of other changes to the vanilla scripts, which may make their modded scripts invalid - e.g. a change in the number of parameters that a function expects.
rbodleyscott wrote: ↑Sat Jan 22, 2022 7:53 am
The latest parser in the game engine is intolerant of extraneous ")" at the end of statements. The old parser used to ignore these, hence they slipped through un-noticed.
Sorry if that is not the adequate place to bring this up:
The same error appears with the custom Pyrrhus the Eagle campaign which can be downloaded from within the game - and causes a CTD.
I experience CTDs with the same error message ("Context: FUNCTION IsKeil(me)" etc.) with two of my custom scenarios (unpublished).
Have invested much time and work in these scenarios - is there an easy way to fix this problem?
Re: Rise of AI Global Mod v3.1/v3.0
Posted: Wed Jan 26, 2022 7:30 am
by rbodleyscott
Adebar wrote: ↑Tue Jan 25, 2022 9:25 pm
rbodleyscott wrote: ↑Sat Jan 22, 2022 7:53 am
The latest parser in the game engine is intolerant of extraneous ")" at the end of statements. The old parser used to ignore these, hence they slipped through un-noticed.
Sorry if that is not the adequate place to bring this up:
The same error appears with the custom Pyrrhus the Eagle campaign which can be downloaded from within the game - and causes a CTD.
I experience CTDs with the same error message ("Context: FUNCTION IsKeil(me)" etc.) with two of my custom scenarios (unpublished).
Have invested much time and work in these scenarios - is there an easy way to fix this problem?
Yes. Remove the second ) at the end of the
block_size = percent * GetAttrib(me, "UnitSize"));
line, in the modded version of CombatTools.BSF in the custom "campaign" folder.
Then run the scenario again. If that reveals any further ) errors, do the same for whatever function the error message throws up - in the modded scripts in the scenario "campaign" folder.
Re: Rise of AI Global Mod v3.1/v3.0
Posted: Wed Jan 26, 2022 8:11 am
by Adebar
Thanks for the info, Richard!
There seem to be more problems with the campaign scripts, error messages continue to pop up like this:
Hope that Desicat will fix his campaign if he finds the time.
Checking my scenarios now. I wish the new parser would behave a bit more ... tolerant.
EDIT:
Have checked my customs scens: The modded combattool files are causing the problems there too. Removing the files solves that.
Re: Rise of AI Global Mod v3.1/v3.0
Posted: Wed Jan 26, 2022 10:41 am
by rbodleyscott
Adebar wrote: ↑Wed Jan 26, 2022 8:11 amHave checked my customs scens: The modded combattool files are causing the problems there too. Removing the files solves that.
Why were the modded script files in there if you didn't need their mods?
If you do need them, back them up, copy the files from the current vanilla build, then re-add the mods.
I am wondering why the Pyrrhos the Eagle campaign and Pyrrhos at Sparta scenario needed modded scripts. You could try simply removing all of the modded scripts from it.
Re: Rise of AI Global Mod v3.1/v3.0
Posted: Wed Jan 26, 2022 10:56 am
by rbodleyscott
On a quick compare, I found two mods in the Pyrrhos CombatTools.bsf.
There may, of course, be more.
In GetImpactPOA()
Code: Select all
// Scythed Chariots
if (IsUnitSquadType(me, "Scythed_Chariots") == 1)
{
if (enemy == -1)
{
if (print == 1)
{
any_printed = 1;
PrintStringIndexedX(1, test, "IDS_SQUADTYPE", 17);
PrintStringLiteralX(1, test, ": ");
PrintStringX(1, test, "IDS_UI_INFO_IMPACT_SPARTAN_HEROS");
PrintStringLiteralX(1, test, "\n");
}
increment = 250; // average vs horse and foot
POA += increment;
}
else
The mod is IDS_UI_INFO_IMPACT_
SPARTAN_HEROS
Code: Select all
// Returns 1 if unit is baggage, otherwise 0
FUNCTION IsBaggage(id)
{
int ret;
ret = 0;
GetUnitTypeString(GetUnitTypeIndex(id));
if (StringCompareLeft(GetWorkString(),"Hospital_Cart",7) == 1)
{
ret = 1;
}
return ret;
}
The mod is
"
Hospital_Cart" instead of "Baggage"
Problems with Mods after v1.5.40 update
Posted: Wed Jan 26, 2022 11:00 am
by rbodleyscott
Some mods won't work correctly in v1.5.40 until they have been updated.
This is mostly because the new parser is stricter than the old one, and will not allow extraneous extra ")"s at the ends of lines.
Though, as usual after an update, some mods with modded scripts may also fall foul of other changes to the vanilla scripts, which may make their modded scripts invalid - e.g. a change in the number of parameters that a function expects.
Re: Rise of AI Global Mod v3.1/v3.0
Posted: Wed Jan 26, 2022 12:35 pm
by Adebar
rbodleyscott wrote: ↑Wed Jan 26, 2022 10:41 am
Why were the modded script files in there if you didn't need their mods?
Funny enough, I have no idea.
Did the scenarios years ago, therefore I can´t recall all the details of the design process. My guess is that ages ago someone did some awesome small mod using those files that I incorporated in the scens and I completely suppressed their existence afterwards.
Re: Problems with Mods after v1.5.40 update
Posted: Mon Feb 07, 2022 1:45 am
by Schweetness101
is this line in AI.bsf supposed to be commented out:
cost = CheckFallBackPossible(me, x2, y2, 0); // v1.3.57 change. Fallback
or am I messing something up by even having that? it's in the field of glory base ai.bsf, not a mod one.
Re: Problems with Mods after v1.5.40 update
Posted: Mon Feb 07, 2022 7:34 am
by rbodleyscott
Schweetness101 wrote: ↑Mon Feb 07, 2022 1:45 am
is this line in AI.bsf supposed to be commented out:
cost = CheckFallBackPossible(me, x2, y2, 0); // v1.3.57 change. Fallback
or am I messing something up by even having that? it's in the field of glory base ai.bsf, not a mod one.
Code: Select all
// cost = CheckFallBackPossible(me, x2, y2);
cost = CheckFallBackPossible(me, x2, y2, 0); // v1.3.57 change. Fallback
Only the first of these two lines is commented out. The reason is because an extra parameter was added to the CheckFallBackPossible() function in v1.3.57 - which was almost certainly before you developed your mod.
The correct version is:
Code: Select all
cost = CheckFallBackPossible(me, x2, y2, 0); // v1.3.57 change. Fallback
A comment at the end of a line does not comment out the line.
Re: Problems with Mods after v1.5.40 update
Posted: Mon Feb 07, 2022 9:34 pm
by Schweetness101
right yeah I was confused why it seemed to have two calls to the same function where the second would just reset the value of cost, so i was wondering if one of them needed // at the beginning of the line, but what's weird is that 4 parameter version seems to be giving me errors and I think the mod only calls it in that one place, maybe I am redefining it somewhere.
Re: Problems with Mods after v1.5.40 update
Posted: Mon Feb 07, 2022 9:40 pm
by Schweetness101
so the error I get is:
which is weird as that's what the vanilla, not the mod file, looks like, and the mod does overwrite AI.bsf, so maybe it's not picking up the mod version of AI.bsf? Weirdly, if I just comment out the 4 parameter line, then it works. Dunno why it's expecting 3 parameters in the mod when this didn't cause an issue before.
also, shouldn't the 3 parameter one on the previous line in vanilla cause an error if it's supposed to have 4 parameters? or does it assume a default value for non included parameters?
Re: Problems with Mods after v1.5.40 update
Posted: Mon Feb 07, 2022 9:42 pm
by Schweetness101
oh it's because of this change in tools.bsf:
// Checks whether fall back is possible
// Returns true cost of fallback if it is possible, otherwise -2;
// v1.5.37 change - ignore ZOCs if breakoff.
//FUNCTION CheckFallBackPossible(me, tilex, tiley)
FUNCTION CheckFallBackPossible(me, tilex, tiley, breakoff) // v1.5.37 change
Re: Problems with Mods after v1.5.40 update
Posted: Tue Feb 08, 2022 8:13 am
by rbodleyscott
Schweetness101 wrote: ↑Mon Feb 07, 2022 9:42 pm
oh it's because of this change in tools.bsf:
// Checks whether fall back is possible
// Returns true cost of fallback if it is possible, otherwise -2;
// v1.5.37 change - ignore ZOCs if breakoff.
//FUNCTION CheckFallBackPossible(me, tilex, tiley)
FUNCTION CheckFallBackPossible(me, tilex, tiley, breakoff) // v1.5.37 change
Ah, right, seems that v1.3.57 in the comment in the other place is a typo for v1.5.37. Hence probably after you did the mod.
Re: Problems with Mods after v1.5.40 update
Posted: Tue Feb 08, 2022 8:14 am
by rbodleyscott
Schweetness101 wrote: ↑Mon Feb 07, 2022 9:34 pm
right yeah I was confused why it seemed to have two calls to the same function where the second would just reset the value of cost, so i was wondering if one of them needed // at the beginning of the line, but what's weird is that 4 parameter version seems to be giving me errors and I think the mod only calls it in that one place, maybe I am redefining it somewhere.
The first call is commented out, so isn't called.