Some scripting questions

Moderators: rbodleyscott, Slitherine Core, Gothic Labs

Post Reply
companion
Corporal - 5 cm Pak 38
Corporal - 5 cm Pak 38
Posts: 46
Joined: Fri Jul 08, 2016 2:16 pm

Some scripting questions

Post by companion » Mon Jun 14, 2021 8:49 pm

1. I'm trying to give all later tercio types +25 POA against foot if not fragmented. Can it be done by copy-pasting "pike" entry and modifying it? Or do I have to fiddle with the keil rules?

2. I'm also trying to make later tercios vulnerable to charges that originate from behind the unit and end up in the rear 3 tiles. To put it differently, I want them to be immune only against 90 degrees flank attacks. What is the angle value that I need to use?

3. I want to make early tercios "unmaneuverable" like some units in FoG 2 (no free turn). Is there an easy way to do it other than wrestling with the free turn entry of tools.bsf?

4. I want to replicate the bow cavalry evade-pursuit relationship in FoG2:M, as in non-light bow armed cavalries can evade but pursuing heavy cav such as knight has IIRC max 25% chance of catching them if started charge in adjacent tile. Can I simply copy the relevant lines from FoG2:M? Or is the engine too old for that?

companion
Corporal - 5 cm Pak 38
Corporal - 5 cm Pak 38
Posts: 46
Joined: Fri Jul 08, 2016 2:16 pm

Re: Some scripting questions

Post by companion » Mon Jun 14, 2021 11:23 pm

Nevermind on #1, I think I know how to do it

companion
Corporal - 5 cm Pak 38
Corporal - 5 cm Pak 38
Posts: 46
Joined: Fri Jul 08, 2016 2:16 pm

Re: Some scripting questions

Post by companion » Tue Jun 15, 2021 10:49 pm

It seems to work but I'd like to be sure: is the following correct code to make later tercios immune to only flank attacks coming at right angles?

Code: Select all

if (GetAngleFrom(me, enemy) >= 85) // Charger behind flank
				{
					if (GetAngleFromTile(startX, startY, enemy) >= 85) // Charger started turn behind flank
						{
							// Keils and tercios immune to ill effects of flank attack
							if ((PercentKeil(enemy) == 0) && (GetAttrib(enemy, "LaterTercio") == 0))					
								{
									ret = 1;
								}
						}
				}
			if (GetAngleFrom(me, enemy) > 95) // Charger behind flank
				{
					if (GetAngleFromTile(startX, startY, enemy) >= 85) // Charger started turn behind flank
						{
							// Keils and tercios immune to ill effects of flank attack
							//if ((PercentKeil(enemy) == 0) && (GetAttrib(enemy, "LaterTercio") == 0))
							if ((PercentKeil(enemy) == 0))
								{
									ret = 1;
								}
						}
				}

companion
Corporal - 5 cm Pak 38
Corporal - 5 cm Pak 38
Posts: 46
Joined: Fri Jul 08, 2016 2:16 pm

Re: Some scripting questions

Post by companion » Wed Jun 16, 2021 12:43 am

#1 and #3 done (I think)
#4 no idea, posted a relevant question on the FoG2:M modding forum

companion
Corporal - 5 cm Pak 38
Corporal - 5 cm Pak 38
Posts: 46
Joined: Fri Jul 08, 2016 2:16 pm

Re: Some scripting questions

Post by companion » Wed Jun 16, 2021 7:33 pm

Relevant answer by RBS in FOG2M forum:

viewtopic.php?p=930293#p930293

Post Reply

Return to “Modders Corner”