Adding new functionality to engineers...?

Modders can post their questions on scripting and more.

Moderators: Slitherine Core, BA Moderators

Amaris
Captain - Heavy Cruiser
Captain - Heavy Cruiser
Posts: 929
Joined: Fri Jul 23, 2010 11:08 am
Location: France
Contact:

Re: Adding new functionality to engineers...?

Post by Amaris » Wed Mar 27, 2013 9:38 am

Open the ADDTANK.BSF and remplace the CHECK_ALL_ADDTRAPP function by:

Code: Select all

FUNCTION CHECK_ALL_ADDTRAP(me, tilex, tiley) 
{
int ret ;
int tuilex;
int tuiley;
int object;
int count;
int id;
int id2;
int id3;

	ret = -2 ;
	
	tuilex = GetUnitX(me);
	tuiley = GetUnitY(me);
	
	id = GetTileOnTile(0, tuilex, tuiley);
	
	id2 = GetTileID("MoreTiles", "Tile8") ;
	id3 = GetTileID("MoreTiles", "Tile9") ;	
	
	if ((id == id2) || (id == id3))
	{
		return ret;
	}
	
	if ((tuilex == tilex) && (tuiley == tiley))
	{
		if (IsUnitValid(me) == 1)
		{
			if ((IsUnitType(me, "us_engineer") == 1) || (IsUnitType(me, "afrika_korps_engineer") == 1) || (IsUnitType(me, "british_engineer") == 1) || (IsUnitType(me, "german_engineer") == 1))
			{
				if ((GetAttrib(me, "AP") >= 8) && (GetAttrib(me, "moved") == 0))
				{
					ret = 1;
				}	
				for (count = 0 ; count < 100; count++)
				{
					object = GetTileObject(tilex, tiley, count);	
					
					if (object != -1)
					{
						if (IsObjectName(object, "TANKTRAPS") == 1)
						{
							ret = -2;
						}
					}
				}
			}
		}
	}
	return ret ;
}
Warning I didn't test it (BA is not allowed at my work :shock: :cry: ) it but it should work.
“Take care, my friend; watch your six, and do one more roll… just for me.”

dcoffin
Corporal - 5 cm Pak 38
Corporal - 5 cm Pak 38
Posts: 32
Joined: Fri Aug 02, 2013 5:24 am

Re: Adding new functionality to engineers...?

Post by dcoffin » Sun Sep 08, 2013 7:36 pm

Hello Amaris,

I had seen your improved Engineer mods on your webpage and wanted to ask a question about installation FAQ found on your website.

How to use it in my own campaign?

First this mod is do with the vanilla version of BA. Particularly for the units.
If you have your own squad.csv you must check if the unit of engineer ( “us_engineer”, “afrika_korps_engineer”, “british_engineer” and “german_engineer”) are still here.
If not you must add them or edit all the scripts.

Then just copy the DATA folder of improved engineer mod in your own campaign’s folder.
Open the TEXT1.TXT file of improved engineer and copy the marked part into your own TEXT1.TXT.


What directory or file do I extract the zip file to if I want to add this to the vanilla version of BA. Have the latest version out of the base game.

Thanks in advance for your assistance.

dcoffin

Amaris
Captain - Heavy Cruiser
Captain - Heavy Cruiser
Posts: 929
Joined: Fri Jul 23, 2010 11:08 am
Location: France
Contact:

Re: Adding new functionality to engineers...?

Post by Amaris » Mon Sep 09, 2013 10:18 am

dcoffin wrote:Hello Amaris,
...

What directory or file do I extract the zip file to if I want to add this to the vanilla version of BA. Have the latest version out of the base game.

Thanks in advance for your assistance.

dcoffin
Hi !

Well I am not sure that I understand you... If you want to use this scripts on the BA vanilla campaigns, you must extract the zip file into \Battlefield Academy\Battlefield Academy\Data\Battle\Scripts and you must modify the original $DEFAULT.BSF file (don't erase it) with the lines founds into the $DEFAULT.BSF of zip archives.

This says two things to consider:
- I'm not sure that my (old) scripts works with the latest version of BA.
- the use of these scripts on battles that were not expected with little cause severe malfunction.

This is not something I recommend!
“Take care, my friend; watch your six, and do one more roll… just for me.”

Post Reply

Return to “Battle Academy : Modders Corner ”