SAR Script Issue in Game_LuaInit

All discussions & material related to Command's Lua interface

Moderators: RoryAndersonCDT, michaelm75au, angster, MOD_Command

Post Reply
aesguitar
Posts: 1
Joined: Sat Jan 28, 2023 4:42 pm

SAR Script Issue in Game_LuaInit

Post by aesguitar »

I was playing the Brother Against Brother, 2011 Standalone scenario. I was trying to get the SAR to work and discovered a bug in the Game_LuaInit file. When the liferafts are spawned and appear on the map, they aren't selectable as contacts - they just appear as friendly units.

In the Lua Script, the selections for SAR are checked assuming the survivors will always be a selected contact and never a selected unit.

Even when the correct units are selected in game, selectedUnits.contacts == nil is ALWAYS true. The survivors are always in the selectedUnits.units list. I rewrote the function to handle this issue appropriately, outputting the same information in the same format.

When I tried to update the scenario file directly, there is no Game_LuaInit file in the scenario directory. My question is, how do I either change which LuaInit file gets run at the start of the scenario or how do I modify the Game_LuaInit file itself? Reloading the scenario did nothing.
Attachments
LuaInit.zip
Original file and modified file.
(10.86 KiB) Downloaded 19 times
Kushan04
Posts: 1293
Joined: Tue Jun 28, 2005 9:27 pm
Location: USA
Contact:

Re: SAR Script Issue in Game_LuaInit

Post by Kushan04 »

This should go under Tech Support as it's an issue with an official scenario.

I'll take a look at it.

Reloading the scenario is just going to reload LuaInit. To change it you'd need to open the in game event action and change the event script.

Proper practice, IMO, is to use an external script file for editing then to copy the script into the in game event action. That's how most of the scripts for official scenarios are setup.
Post Reply

Return to “Lua Legion”