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.
Fortified Line Leaders v 1.3 released
Moderators: Slitherine Core, BA Moderators
Re: Fortified Line Leaders v 1.3 released
Another thing, I'm assuming you're using my squad file and my DATA/BATTLE/SCRIPTS.
-
Brummbar44
- 2nd Lieutenant - Panzer IVF/2

- Posts: 689
- Joined: Sun Oct 16, 2011 3:53 pm
- Location: Canada
- Contact:
Re: Fortified Line Leaders v 1.3 released
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.
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.
Re: Fortified Line Leaders v 1.3 released
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.
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
-
Brummbar44
- 2nd Lieutenant - Panzer IVF/2

- Posts: 689
- Joined: Sun Oct 16, 2011 3:53 pm
- Location: Canada
- Contact:
Re: Fortified Line Leaders v 1.3 released
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.
Ahhh...excellent point, I hadn't thought about the difference but now that you point out that there could be multiple 'Panzer Meyers' it make sense that I would need to specify which one on the map is to be the actual leader.
I'll experiment with that and see how it works.
Is the 'promo.bsf' the script I need? What about the 'drill.bsf'? 'rally.bsf'? just trying to make sure I have what would be needed to make the leader work...once I figure out how to make a leader! LOL!
Your work is excellent here...hope I can apply it. Thanks again for the help.
Re: Fortified Line Leaders v 1.3 released
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'?
Notice that if you don't use my squads file, you will need to add the leaders attributes by code, usually this is done in INIT.bsf
Everything in BA is parsered (fragmented) and you need to learn where should a thing be defined, or changed, look at $DEFAULT.BSF where you define which actions must be loaded.
