Hi guys,
I was thinking about modding the shooting range of horse archers from 2 to 3 squares.
It shouldn't be much complicated but I don't know in which file I have to work in order to modify this parameter.
Is there anyone out here able to give me an hint?
Thank's a lot for any reply and Good Easter everybody!
Modding shooting range
-
Lysimachos
- Colonel - Fallschirmjäger

- Posts: 1415
- Joined: Tue Dec 08, 2009 9:38 am
- Location: Italy
Modding shooting range
"Audentis fortuna iuvat"
- Virgilius
(Good luck favours the brave)
- Virgilius
(Good luck favours the brave)
Re: Modding shooting range
Greeting to Alexander the Great's DiadochosLysimachos wrote: ↑Sun Apr 17, 2022 8:54 am Hi guys,
I was thinking about modding the shooting range of horse archers from 2 to 3 squares.
It shouldn't be much complicated but I don't know in which file I have to work in order to modify this parameter.
Is there anyone out here able to give me an hint?
Thank's a lot for any reply and Good Easter everybody!
CombatTools.BSF, FUNCTION MaximumRange(me), next script block:
Code: Select all
// if ((GetAttrib(me, "Bow") > 0) || (GetAttrib(me, "Crossbow") > 0))
if ((GetAttrib(me, "Bow") > 0) || (GetAttrib(me, "Longbow") > 0) || (GetAttrib(me, "Crossbow") > 0)) //v1.3.0
{
if (IsMounted(me) == 1)
{
range = 2;
}
else
{
range = 4;
}And do not change the main game folder!
PS. You should also to add FUNCTION IsLongRange(me, target) - comment out like this
Code: Select all
// if (IsFoot(me) == 1)
// {
if (distance > 2)
{
ret = 1;
}
// }Code: Select all
// Bow (Foot or Mounted)
percent = GetAttrib(me, "Bow");
if (percent > 20) // Stop Late Romans long distance shooting
{
any_shooters = 1;
if (IsMounted(me) == 1)
{
range = 2;
}
else
{
range = 4;
}-
Lysimachos
- Colonel - Fallschirmjäger

- Posts: 1415
- Joined: Tue Dec 08, 2009 9:38 am
- Location: Italy
Re: Modding shooting range
Thank's mate, you've been really clear.
I didn't imagine it could be so complex!
I didn't imagine it could be so complex!
"Audentis fortuna iuvat"
- Virgilius
(Good luck favours the brave)
- Virgilius
(Good luck favours the brave)
-
Lysimachos
- Colonel - Fallschirmjäger

- Posts: 1415
- Joined: Tue Dec 08, 2009 9:38 am
- Location: Italy
Re: Modding shooting range
And what about improving the horse archers ammunitions from 5 to 6 or 7 turns?
I think there should be a way also to do this!!
As you can imagine I'm feeling as this kind of unit is quite underrepresented in its strength now ...
I think there should be a way also to do this!!
As you can imagine I'm feeling as this kind of unit is quite underrepresented in its strength now ...
"Audentis fortuna iuvat"
- Virgilius
(Good luck favours the brave)
- Virgilius
(Good luck favours the brave)
Re: Modding shooting range
There are a few ways to do so:Lysimachos wrote: ↑Mon Apr 18, 2022 9:53 am And what about improving the horse archers ammunitions from 5 to 6 or 7 turns?
I think there should be a way also to do this!!
As you can imagine I'm feeling as this kind of unit is quite underrepresented in its strength now ...
1) If you wish to increase the ammunition for all units - copy Macros.BSF to your module folder
Code: Select all
#define FULL_EFFECT_SHOTS 10 // Number of shots before ammunition is low. (Number of turns of full effect shooting will be half this as there are 2 shots per turn of shooting)2) If you only wish to do so for horse archers and you are creating a custom historical battle - (Your scenario name).BSF
Code: Select all
FUNCTION StartTurn(side)
{
int id;
int i;
...
if (GetTurn() == 0) // Increase horse archers full ammunition
{
for (i = 0; i < GetUnitCount(side); i++)
{
id = GetUnitID(side,i);
if (id != -1)
{
if ((IsMounted(id) == 1) && ((GetAttrib(id, "Bow") == 100) || (GetAttrib(id, "Crossbow") == 100)))
{
SetAttrib(id, "TotalShots", -2);
}
}
}
} In the line SetAttrib(id, "TotalShots", -2); you can change the number -2 (6 full ammo turns), -4 (7 full ammo turns) etc
For an example see Crecy_E.BSF from Storm of Arrows FoG Medieval.
-
Lysimachos
- Colonel - Fallschirmjäger

- Posts: 1415
- Joined: Tue Dec 08, 2009 9:38 am
- Location: Italy
Re: Modding shooting range
Thank's Cronos, you're precious!

"Audentis fortuna iuvat"
- Virgilius
(Good luck favours the brave)
- Virgilius
(Good luck favours the brave)
