Where is the code that runs reaction fire?

Modders can post their questions on scripting and more.

Moderators: Slitherine Core, BA Moderators

Post Reply
GottaLove88s
Lieutenant-General - Do 217E
Lieutenant-General - Do 217E
Posts: 3151
Joined: Fri Apr 06, 2012 6:18 pm
Location: Palau

Where is the code that runs reaction fire?

Post by GottaLove88s »

Hi Gents,

Does anyone know where the code is that executes reaction fire?
Specifically the code that tests 'AmbushSkill' to decide whether a firing unit has been seen or not?

Thanks!
GL88
SCENARIO LINKS
Seelow'45 -> www.slitherine.com/forum/viewtopic.php?f=313&t=55132
Normandy'44 -> www.slitherine.com/forum/viewtopic.php?f=87&t=42094
Dieppe'42 -> www.slitherine.com/forum/viewtopic.php?f=87&t=42347
rf900
Staff Sergeant - Kavallerie
Staff Sergeant - Kavallerie
Posts: 339
Joined: Fri May 04, 2012 6:59 am

Re: Where is the code that runs reaction fire?

Post by rf900 »

The code that checks if a unit is spotted is in CombatTools:
FUNCTION AmbushCheck (me, unit )
pipfromslitherine
Site Admin
Site Admin
Posts: 9928
Joined: Wed Mar 23, 2005 10:35 pm

Re: Where is the code that runs reaction fire?

Post by pipfromslitherine »

Reaction fire is an optional function for any order - the fn that gets called to score a reaction is in the same file as the action (IIRC only AP and HE actually have reaction fire, though I wait breathlessly to be proven wrong... ;) )

Cheers

Pip
follow me on Twitter here
GottaLove88s
Lieutenant-General - Do 217E
Lieutenant-General - Do 217E
Posts: 3151
Joined: Fri Apr 06, 2012 6:18 pm
Location: Palau

Re: Where is the code that runs reaction fire?

Post by GottaLove88s »

Thanks Pip/Rf,

Am trying to improve how reaction fire works during the nighttime phase of the Dieppe scenario... so that

i) chances of ambushing (ie. not being detected) are doubled at night
ii) accuracy is halved at night

It sounds like I can make that happen with Combat Tools, AP and HE bsfs... right?

Will give it a go!
:D
SCENARIO LINKS
Seelow'45 -> www.slitherine.com/forum/viewtopic.php?f=313&t=55132
Normandy'44 -> www.slitherine.com/forum/viewtopic.php?f=87&t=42094
Dieppe'42 -> www.slitherine.com/forum/viewtopic.php?f=87&t=42347
pipfromslitherine
Site Admin
Site Admin
Posts: 9928
Joined: Wed Mar 23, 2005 10:35 pm

Re: Where is the code that runs reaction fire?

Post by pipfromslitherine »

Yes, it is all accessible in the scripts.

Cheers

Pip
follow me on Twitter here
GottaLove88s
Lieutenant-General - Do 217E
Lieutenant-General - Do 217E
Posts: 3151
Joined: Fri Apr 06, 2012 6:18 pm
Location: Palau

Re: Where is the code that runs reaction fire?

Post by GottaLove88s »

Looking in FIRE_AP.BSF, I don't see any reference to the Accuracy stats from squads.csv
Is the Accuracy data used anywhere?
SCENARIO LINKS
Seelow'45 -> www.slitherine.com/forum/viewtopic.php?f=313&t=55132
Normandy'44 -> www.slitherine.com/forum/viewtopic.php?f=87&t=42094
Dieppe'42 -> www.slitherine.com/forum/viewtopic.php?f=87&t=42347
pipfromslitherine
Site Admin
Site Admin
Posts: 9928
Joined: Wed Mar 23, 2005 10:35 pm

Re: Where is the code that runs reaction fire?

Post by pipfromslitherine »

I can't tell you off the top of my head. Notepad++'s Find in Files is your friend :)

Cheers

Pip
follow me on Twitter here
GottaLove88s
Lieutenant-General - Do 217E
Lieutenant-General - Do 217E
Posts: 3151
Joined: Fri Apr 06, 2012 6:18 pm
Location: Palau

Re: Where is the code that runs reaction fire?

Post by GottaLove88s »

Is Notepad++ available on Mac?

I'm just using the 'Find' in TextEdit and it shows zero hits searching for 'Accuracy' with FIRE_AP.BSF open (but, knowing me, this may not be the best way to do it, sorry! :cry: )
Which made me wonder if the accuracy stats are legacy from an earlier version? And not actually used in the current?
Or perhaps more likely, accuracy stats could be being applied in calculations somewhere else...?
SCENARIO LINKS
Seelow'45 -> www.slitherine.com/forum/viewtopic.php?f=313&t=55132
Normandy'44 -> www.slitherine.com/forum/viewtopic.php?f=87&t=42094
Dieppe'42 -> www.slitherine.com/forum/viewtopic.php?f=87&t=42347
pipfromslitherine
Site Admin
Site Admin
Posts: 9928
Joined: Wed Mar 23, 2005 10:35 pm

Re: Where is the code that runs reaction fire?

Post by pipfromslitherine »

I don't think Notepad++ is available on OSX, but I am sure someone has a recommendation for an alternative. You need something that is able to search (e.g.) all the BSF files in the game folder, as often work is being done in functions living in other files.

Cheers

Pip
follow me on Twitter here
Richcat
Sergeant - 7.5 cm FK 16 nA
Sergeant - 7.5 cm FK 16 nA
Posts: 219
Joined: Sun Nov 07, 2010 10:09 pm

Re: Where is the code that runs reaction fire?

Post by Richcat »

GL88 found this for mac, which maybe of use. Haven't tried it as don't have a mac.
http://www.barebones.com/products/textwrangler/
Cheers
Richcat
GottaLove88s
Lieutenant-General - Do 217E
Lieutenant-General - Do 217E
Posts: 3151
Joined: Fri Apr 06, 2012 6:18 pm
Location: Palau

Re: Where is the code that runs reaction fire?

Post by GottaLove88s »

Thanks Richcat! TextWrangler looks great (quite a step up from TextEdit and it's free too! :D). Will test it out tonight...
SCENARIO LINKS
Seelow'45 -> www.slitherine.com/forum/viewtopic.php?f=313&t=55132
Normandy'44 -> www.slitherine.com/forum/viewtopic.php?f=87&t=42094
Dieppe'42 -> www.slitherine.com/forum/viewtopic.php?f=87&t=42347
Post Reply

Return to “Battle Academy : Modders Corner ”