random reinforcements?

Moderators: rbodleyscott, Slitherine Core, Gothic Labs

Post Reply
Ubberdorc
Corporal - 5 cm Pak 38
Corporal - 5 cm Pak 38
Posts: 30
Joined: Thu Aug 07, 2014 11:03 pm

random reinforcements?

Post by Ubberdorc » Wed Dec 11, 2019 3:07 am

Is it possible to set up random reinforcements?
So instead of reinforcements showing up on turn 5 they would show up between turn 4 and turn 10?

Paul59
Brigadier-General - Elite Grenadier
Brigadier-General - Elite Grenadier
Posts: 2166
Joined: Tue Jul 21, 2015 11:26 pm

Re: random reinforcements?

Post by Paul59 » Wed Dec 11, 2019 9:13 am

Ubberdorc wrote:
Wed Dec 11, 2019 3:07 am
Is it possible to set up random reinforcements?
So instead of reinforcements showing up on turn 5 they would show up between turn 4 and turn 10?
I am sure it would be possible, but not by using the Editor method of reinforcement. You would have to use the scripted method, and then add a script to add a random element to the reinforcement. I wrote a guide to using the scripted method in the Field of Glory 2 forum, FOG2 uses similar mechanics to Pike and Shot, but there maybe some differences;

viewtopic.php?f=491&t=81096

I have never had random reinforcements in any of my scenarios, so I don't know what the actual random element script would look like.
Field of Glory 2 Scenario Designer - Age of Belisarius, Rise of Persia, and Wolves at the Gate.

TT Mod Creator

Athos1660
Staff Sergeant - Kavallerie
Staff Sergeant - Kavallerie
Posts: 328
Joined: Wed May 29, 2019 3:23 pm

Re: random reinforcements?

Post by Athos1660 » Wed Dec 11, 2019 11:01 am

Image

Image

Cronos09
Corporal - Strongpoint
Corporal - Strongpoint
Posts: 74
Joined: Thu Feb 22, 2018 4:28 pm

Re: random reinforcements?

Post by Cronos09 » Sun Dec 15, 2019 1:09 pm

Ubberdorc wrote:
Wed Dec 11, 2019 3:07 am
Is it possible to set up random reinforcements?
So instead of reinforcements showing up on turn 5 they would show up between turn 4 and turn 10?
Your question seemed interesting to me. I thought about it. And here's the script:
1) export your reinforcement to (ScenarioName).BSF with the editor;
2) open the (ScenarioName).BSF and add the next blocks - to FUNCTION PreBattleSetup()

Code: Select all

int b

	b = SkewedRandom(8, 20, 0);
	SetGlobal("B", b);
then to FUNCTION StartTurn(side)

Code: Select all

int a;
int c;
	  
	  	a = GetTurn();
	  	c = GetGlobal("B");

	// Autogenerated script for reinforcement group 0 on side 0 - Paste this code into your StartTurn function:
	if (a == c)
	{...
	}
The disadvantage of this script is that reinforcements for side 0 can appear during the turn of player 0 and the turn of player 1

Odenathus
Staff Sergeant - StuG IIIF
Staff Sergeant - StuG IIIF
Posts: 287
Joined: Sat Jun 27, 2009 10:02 pm

Re: random reinforcements?

Post by Odenathus » Sat Dec 28, 2019 1:42 pm

Richard wrote a script for me to use in my Waterloo scenario so that the Prussian unit arrive over a range of 2-3 turns. If you look at the Waterloo BSF you should find the relevant code.

Good luck.

Ubberdorc
Corporal - 5 cm Pak 38
Corporal - 5 cm Pak 38
Posts: 30
Joined: Thu Aug 07, 2014 11:03 pm

Re: random reinforcements?

Post by Ubberdorc » Sat Dec 28, 2019 10:33 pm

Thank you for the help, I will give them A try!

Post Reply

Return to “Scenario Design”