This is an add-on to my previous question:
The code I have so far is:
@echo off
set "Effective="
for /F "tokens=2 delims=%%) " %%I in ('%SystemRoot%\System32\find.exe /I "flyer" file.cfg') do set "Effective=%%I"
if defined Effective echo The effective value is: %Effective%
This code takes number 100
from line Effective("flyer", 100%);
in file.cfg
.
But what to do if there are two lines with flyer
in file.cfg
?
I have already tried it and this code takes the last flyer value 50
.
Effective("flyer", 100%);
Effective("flyer", 50%);
How to choose between them?
The first code block containing first flyer is:
CreateWeaponType("jda.weapon.aatower")
{
Style("Projectile");
MaxRange(96);
HorizAngle(90);
HorizSeparation(180);
VertAngle(0);
VertSeparation(120);
TurnRate(90);
Speed(100);
Fixed(1);
Damage()
{
Amount(10);
Effective("infantry", 0%);
Effective("vehicle", 0%);
Effective("structure", 0%);
Effective("flyer", 100%);
Effective("mine", 0%);
}
Projectile("jda.proj.aatower");
Delay(1);
FirePoints()
{
Add("HP-Fire1");
Add("HP-Fire2");
Add("HP-Fire3");
Add("HP-Fire4");
}
}
The second flyer is in:
CreateObjectType("jda.exp.aatower", "Explosion")
{
MapObj()
{
Mesh();
GenericFX()
{
Add("ExplosionObj::Explode", "jda.fx.aatower.exp");
}
}
ExplosionObj()
{
Damage()
{
Amount(16);
Effective("infantry", 0%);
Effective("vehicle", 0%);
Effective("structure", 0%);
Effective("flyer", 50%);
Effective("mine", 0%);
}
AreaInner(4);
AreaOuter(4);
Persist(0);
}
}
How to set a different variable for each one?