unique index id

Modders can post their questions on scripting and more.

Moderators: Slitherine Core, BA Moderators

Post Reply
enric
Brigadier-General - 8.8 cm Pak 43/41
Brigadier-General - 8.8 cm Pak 43/41
Posts: 1855
Joined: Sun May 15, 2011 8:47 am

unique index id

Post by enric »

In the editor, when placing units, each has a unique index (by side), the first unit is 0, the next 1, etc.
Is this a primary key safe, e.i, will BA keep always that id during play. When scripting can be referred a unit by this id?
pipfromslitherine
Site Admin
Site Admin
Posts: 9937
Joined: Wed Mar 23, 2005 10:35 pm

Re: unique index id

Post by pipfromslitherine »

You can use this in the scripting, but bear in mind that adding and removing units can then alter these values.

Cheers

Pip
enric
Brigadier-General - 8.8 cm Pak 43/41
Brigadier-General - 8.8 cm Pak 43/41
Posts: 1855
Joined: Sun May 15, 2011 8:47 am

Re: unique index id

Post by enric »

pipfromslitherine wrote:You can use this in the scripting, but bear in mind that adding and removing units can then alter these values.

Cheers

Pip
You're referring in the editor, no?, once the game starts, when a unit is eliminated , the unique value doesn't change, right?
pipfromslitherine
Site Admin
Site Admin
Posts: 9937
Joined: Wed Mar 23, 2005 10:35 pm

Re: unique index id

Post by pipfromslitherine »

Correct - currently units never really 'die' - they just get removed from the board.

Cheers

Pip
Post Reply

Return to “Battle Academy : Modders Corner ”