BP Logo
Home » MODDING HQ 1.13 » v1.13 Bug Reports » cant move militia after reinforcement
cant move militia after reinforcement[message #363475] Wed, 07 July 2021 12:58 Go to next message
rasz

 
Messages:38
Registered:August 2006
I took in order B13 C13 and D13. Fought big battle at D13. Trained militia at D13. Enemy retook empty B13.

I think what happened next (not 100% sure) was enemy entering C13 and militia doing auto resolve battle. Now militia was at C13.

At this point I could move militia freely between C13 and D13 - both sectors I owned, with enemy occupying B13.

I retook Drassen airport from C13 with militia reinforcement (from C13). After the battle I cant order them back to C13, B13 is grayed out - looks like some part of the game didnt get the info about sector being re-secured?

https://i.imgur.com/WLrHSMX.jpg

FACT_DRASSEN_LIBERATED is False
FACT_CURRENT_SECTOR_IS_SAFE is True while at B13

ALLOW_MOBILE_MILITIA is missing in Ja2_Options.INI of JA2-Unstable-r9125-g2596

next best thing, ALLOW_MILITIA_STRATEGIC_COMMAND, works and I can manually order them around. But even after successfully moving them back to C13 B13 is still grayed out. Merc "Get Items" command also ignores B13 sector not acknowledging that I took it back.

changing FACT_DRASSEN_LIBERATED (F11 debug menu) to true doesnt fix it.

EDIT: I fixed it! I had to leave and return to B13 with one merc to rewrite sector status. This also set FACT_DRASSEN_LIBERATED correctly.

Not sure about the cause, maybe attacking sector together with militia reinforcements generated unhandled state and skipped setting fPlayerControlled on JA25_SECTOR_AI?

btw:
Debug shows more quests than 28 defined in https://github.com/aimnas/ja2-1.13-source-mirror/blob/master/Strategic/Quests.h
FACT_PLAYER_SPOKE_TO_DRASSEN_MINER 232 is wrong in Debug screen, it shows "Hans mentioned Joey" from https://github.com/aimnas/ja2-1.13-source-mirror/blob/master/Utils/_EnglishText.cpp#L784 instead

[Updated on: Wed, 07 July 2021 13:28]

Re: cant move militia after reinforcement[message #363476 is a reply to message #363475] Wed, 07 July 2021 19:27 Go to previous messageGo to next message
ShaDoOoW

 
Messages:68
Registered:April 2009
Location: Czech Republic
rasz wrote on Wed, 07 July 2021 12:58
I took in order B13 C13 and D13. Fought big battle at D13. Trained militia at D13. Enemy retook empty B13.
I never saw sector I was already in getting grayed again. Is that perhaps another feature you turned on?

Eitherway, to fix something I need to be able to reproduce it, which is not possible with the instructions you gave. Can you send a savegame before this happened with instructions how to reproduce it? Debug mode in game is useless and tells me nothing, you can ignore that.
Re: cant move militia after reinforcement[message #363477 is a reply to message #363476] Wed, 07 July 2021 21:45 Go to previous messageGo to next message
rasz

 
Messages:38
Registered:August 2006
r9125
How is debug useless? it shows state of FACT_ variables. It might be neglected (hence not synced with current Quests.h), but its still useful.

I think this is happening if you attack along with Militia reinforcement. Another thing that breaks in this case is reveal_dropped_enemy_items_after_combat, attacking with militia reinforcement doesnt seem to reveal all dropped items after battle. Ill remember to copy a save before such battle next time.

Edit: thinking about it a little more - Roaming militia also doesnt reveal sectors, right? It seems as if game acts like the battle was vs roaming militia only, despite my mercs initiating it and militia just coming along for the ride.

[Updated on: Wed, 07 July 2021 21:51]

Re: cant move militia after reinforcement[message #363479 is a reply to message #363477] Wed, 07 July 2021 23:55 Go to previous messageGo to next message
ShaDoOoW

 
Messages:68
Registered:April 2009
Location: Czech Republic
Because these FACT_ variables are used rarely and only for quest-based issues.

For example, the issue you have is technical, not quest-based. FACT_DRASSEN_LIBERATED is only used to run the drassen counterattack. It has nothing to do with the actual map state. Ie. if you force a TRUE to this FACT, all you achieve is triggering the counterattack and possibly meanwhile with queen, but nothing else will change.

I fixed over 2 hundred of bugs in the last 4 months (or was it more since I started?) and I didn't have to mess with FACTs yet.
Re: cant move militia after reinforcement[message #363480 is a reply to message #363477] Thu, 08 July 2021 03:41 Go to previous messageGo to next message
Kitty

 
Messages:322
Registered:October 2017
Location: Germany
rasz wrote on Wed, 07 July 2021 12:58
Not sure about the cause, maybe attacking sector together with militia reinforcements generated unhandled state and skipped setting fPlayerControlled on JA25_SECTOR_AI?
I might be wrong, but as far as I know "JA25" is refering to UB-Code. Shouldn't effect JA2.

rasz wrote on Wed, 07 July 2021 21:45
Roaming militia also doesnt reveal sectors, right? It seems as if game acts like the battle was vs roaming militia only, despite my mercs initiating it and militia just coming along for the ride.
There is no more Roaming Militia in recent versions (7609 has them). And I'm not 100% sure, but iirc, shouldn't you get asked if you want to bring along reinforcements? Or did they auto tag-along?

A savegame from right before it's happening and description how to trigger it could prove helpful. With that, coders probably could run a full debug and hopefully find the issue.



How to get: latest 1.13, 7609 and more | 7609 SCI (eng) | Compiling+SVN

I need more details. (Didi Hallervorden)
Re: cant move militia after reinforcement[message #363483 is a reply to message #363479] Thu, 08 July 2021 15:27 Go to previous message
rasz

 
Messages:38
Registered:August 2006
ShaDoOoW wrote on Wed, 07 July 2021 20:55
Because these FACT_ variables are used rarely and only for quest-based issues.

For example, the issue you have is technical, not quest-based. FACT_DRASSEN_LIBERATED is only used to run the drassen counterattack. It has nothing to do with the actual map state. Ie. if you force a TRUE to this FACT, all you achieve is triggering the counterattack and possibly meanwhile with queen, but nothing else will change.

I fixed over 2 hundred of bugs in the last 4 months (or was it more since I started?) and I didn't have to mess with FACTs yet.
First of all Thank You for all the work!

Somehow FACT_DRASSEN_LIBERATED was set to False after this bug happened, despite this happening long after big counterattack event. And moving my merc out and back to the sector not only fixed Controlled status of the sector, but also once again flipped FACT_DRASSEN_LIBERATED to true. Im not saying the bug is in the quest, Im saying FACT_DRASSEN_LIBERATED being flipped here might be a clue as to where the problem is. I grepped for SetFact/GetFact/SetFactTrue/SetFactFalse/gubFact (including lua scripts) and couldnt find where FACT_DRASSEN_LIBERATED is being manipulated in the code at all angry

Im clearly missing something because I also couldnt find whats going on with FACT_PLAYER_IN_CONTROLLED_DRASSEN_MINE (324). The only place where its referenced at all is
https://github.com/aimnas/ja2-1.13-source-mirror/blob/master/Strategic/Quests.cpp#L1235
		case FACT_PLAYER_IN_CONTROLLED_DRASSEN_MINE:
			gubFact[usFact] = ( GetIdOfMineForSector( gWorldSectorX, gWorldSectorY, gbWorldSectorZ ) == MINE_DRASSEN && !(StrategicMap[CALCULATE_STRATEGIC_INDEX(gWorldSectorX, gWorldSectorY)].fEnemyControlled) );
this part of code is only ever triggered by F11 quest debug menu https://github.com/aimnas/ja2-1.13-source-mirror/blob/master/Strategic/QuestDebugSystem.cpp#L1689
What is weird about it FACT_PLAYER_IN_CONTROLLED_DRASSEN_MINE is still set to False in my game despite checking it while sitting in D13 sector (Drassen Mine) that I fully control, even while sitting in the actual mine underground in D13. BUT if I talk to any random miner while underground all of a sudden FACT_PLAYER_IN_CONTROLLED_DRASSEN_MINE is set to True.
https://file.io/cb7NebJWRiZ3 (JA2-Unstable-r9125-g2596) load save, pick merc named Rasz, enter tactical, CTRL-G for cheats, F11 for quest debug menu, press "pg facts down" button 11 times, look at last fact on the list 324 FACT_PLAYER_IN_CONTROLLED_DRASSEN_MINE, F11 to exit this menu, talk to one of the civs, F11, look at FACT_PLAYER_IN_CONTROLLED_DRASSEN_MINE again. WTF is going on?

Where do I sent eventual patches? The best I could find was silversurfers vague "Best would be if you take the most current XML file, fix the typos and then upload it somewhere. One of the persons with code access can then upload it to SVN.". Where is that somewhere? happy this subforum, general, some mailing list?

Kitty wrote on Thu, 08 July 2021 00:41
I might be wrong, but as far as I know "JA25" is refering to UB-Code. Shouldn't effect JA2.
Thank you for the clue. I dont know my way around the codebase yet. So am I right its
StrategicMapElement StrategicMap[MAP_WORLD_X*MAP_WORLD_Y] and its fEnemyControlled field? Kinda weird if they went from fEnemyControlled to fPlayerControlled when making UB.


Kitty wrote on Thu, 08 July 2021 00:41
There is no more Roaming Militia in recent versions (7609 has them).
Didnt know that, INIEditorJA2.xml shipping in latest JA2-Unstable-r9125-g2596.7z
	  If ALLOW_MILITIA_STRATEGIC_COMMAND is TRUE, ALLOW_MOBILE_MILITIA and its subsequent settings are IGNORED!</Description_ENG>
suggesting ALLOW_MOBILE_MILITIA being ignored only IF ALLOW_MILITIA_STRATEGIC_COMMAND, hence confusion.

Kitty wrote on Thu, 08 July 2021 00:41

And I'm not 100% sure, but iirc, shouldn't you get asked if you want to bring along reinforcements? Or did they auto tag-along?
that was "I think what happened next (not 100% sure)", I dont remember that part happy
BUT militia reinforcement does happen even after refusing by clicking No _if_ you are being attacked:
https://file.io/L2pGG2sYjnlA (JA2-Unstable-r9125-g2596) load save, fast forward time until B13 or D13 is attacked, click NO to reinforcements, click auto resolve, militia forces themselves into a fight. Militia 0:
https://i.imgur.com/Jc1GR7x.png

Kitty wrote on Thu, 08 July 2021 00:41

A savegame from right before it's happening and description how to trigger it could prove helpful. With that, coders probably could run a full debug and hopefully find the issue.
I tried but was unable, second time after this same battle sector became controlled by me, here is how it looked when it was bugged:

https://imgur.com/a/AjDaHl3
you can see my mercs sitting at B13

ps:
>Debug shows more quests than 28 defined in https://github.com/aimnas/ja2-1.13-source-mirror/blob/master/Strategic/Quests.h
that explains it:
https://github.com/aimnas/ja2-1.13-source-mirror/blob/master/Strategic/Quests.h
#define MAX_QUESTS								255
https://github.com/aimnas/ja2-1.13-source-mirror/blob/master/Strategic/Quest Debug System.cpp
#define		QUEST_DBS_NUM_DISPLAYED_QUESTS			MAX_QUESTS
Previous Topic: Unable to select mercs on Strategic Map after sector reinforcement
Next Topic: Game crashes after flo random event
Goto Forum:
  


Current Time: Thu Sep 16 13:57:06 EEST 2021

Total time taken to generate the page: 0.03265 seconds