[1.5.9 Bug + Save + Cause] Raiding completely broken (Event_CB_OnCheckingRaid in Host.bsf)

Field of Glory: Empires is a grand strategy game in which you will have to move in an intricate and living tapestry of nations and tribes, each one with their distinctive culture.
Set in Europe and in the Mediterranean Area during the Classical Age, experience what truly means to manage an Empire.

Moderator: Pocus

Post Reply
gruntsmart
Private First Class - Wehrmacht Inf
Private First Class - Wehrmacht Inf
Posts: 5
Joined: Mon Nov 11, 2019 4:05 am

[1.5.9 Bug + Save + Cause] Raiding completely broken (Event_CB_OnCheckingRaid in Host.bsf)

Post by gruntsmart »

Hi Pocus,

Following up on the reports in the 1.5.8 and 1.5.9 threads regarding raiding no longer occurring: I have linked a Gothones Grand Campaign save file (https://limewire.com/d/RAlrr#76YKJuUnWB) demonstrating the issue and tracked down the exact cause in the script files.

How to Reproduce:
1. Load the attached Gothones save (or start a new 310 BCE Grand Campaign as the Gothones).
2. Set an army with raiding capability to the Raid posture next to valid neutral/hostile border regions and end the turn across multiple turns.
3. No raid ever triggers (neither success nor failure messages, and adjacent regions are never given the raided status). This affects both land raids and naval/pirate raids for all factions.

Root Cause in Data/Scripts/Host.bsf:
In Host_RaidRegions() (Host.bsf, lines 1640-1646), there is an unguarded callback check ported from Kingdoms:

Code: Select all

// This group can't specifically raids this region (e.g. KO against Christians)
if (targetID > 0)
{
	if (CallFunctionInScenario("Event_CB_OnCheckingRaid", groupID, targetID) == FALSE)
	{
		targetID = 0
	}
}
In Kingdoms, Event_CB_OnCheckingRaid is defined in Events_CB.BSF and returns TRUE by default. In Empires, Event_CB_OnCheckingRaid does not exist in the scenario scripts, so CallFunctionInScenario always returns 0 (FALSE). As a result, targetID is unconditionally reset to 0 for every potential raid target.
Guarding that block with if (SYS_IS_AMK) (or inverting the callback so FALSE is the allow-raid default) resolves the issue.
Post Reply

Return to “Field of Glory: Empires”