Re: Fortified Line Leaders v 1.3 released
Posted: Sat Mar 09, 2013 7:55 am
You need to pass the unit ID, "200" don't seems to be an unit ID.
How do you get this value?
Show me your code.
How do you get this value?
Show me your code.
At first glass, you can't use the "template" ID as a unit ID. The Panzer Meyer you has created (in the squad.csv, no?) is a template, when you place an "instance" of that template (either from the editor, or by code) a unit is born and it will have a specific ID during the game. If you add three Panzer Meyer each one will have the same attributes that the template, but have a different ID to be able to refer to each of them during the game.Brummbar44 wrote:I made a specific unit thus the ID, "200" (Panzer Meyer).
Here is the code I used and put in the FUNCTION StartTurn (side)
// German deployment zone - bot left, top right
if ( GetTurn() == 1 )
{
SetAreaLOS(16, 34, 47, 47, 1, 1) ;
// Make a leader
makeUnitLeader (200, 2);
}
I don't see a squad file in your DATA/BATTLE/SCRIPTS, although I do see a reference to 'leader' in your startturn.bsf
Because you have a number of cool effects in your scenario, it is difficult to pick out what I need for just the leaders...so your help is appreciated. But if it's too much trouble, don't worry...it isn't necessary to my campaign.
Thanks.
enric wrote:
At first glass, you can't use the "template" ID as a unit ID. The Panzer Meyer you has created (in the squad.csv, no?) is a template, when you place an "instance" of that template (either from the editor, or by code) a unit is born and it will have a specific ID during the game. If you add three Panzer Meyer each one will have the same attributes that the template, but have a different ID to be able to refer to each of them during the game.
This is a little confusing because BA has used the same label for two different things (template ID, and unit ID).
For example, if you add a Panzer Meyer by code
AddUnit(x, y, side, "Panzer_Meyer"); // where x and y are the map coordinates for the tile
Then you can get the id by:
id = GetUnitOnTile(x, y);
And then
makeUnitLeader (id, 2);
The actions that a leader can do are in the DATA/SCRIPTS and you need to include which ones you need to.
Probably this is not as easy as you would like to be, maybe Pip can help you more.
Rally and Drill are the two of actions you seem to need. To avoid to be spotted by the enemy when promoted, I use also a PROMO.BSF that overrides the original way BA promotes a unit.Is the 'promo.bsf' the script I need? What about the 'drill.bsf'? 'rally.bsf'?