Post Sun Nov 14, 2004 4:05 am

Problems with Sectiondelete

Matthew,
I have sent this also per email, but I am not sure it passes your email filters.
I am experiencing problems with the scripting tool of FLMM 1.3.1. and the sectiondelete command in particular. I have searched on the TLR thread and could not find anyhting on this. I have tried various scenarios, but the results are not the way I expected them to be. I have been struggling for days now, time to get help.

This what I would like to do: I would like to remove all loadouts of secret_wrecks from the loadouts.ini and the loadouts_utility.ini in the ships folder. Then append them in a modifed form to the loadouts.ini in the Solar folder.
Now the second part is not likely to cause problems, but I am having serious problems with the first part.

Problem 1: Trying to delete several sections from loadsouts.ini
This is the entry in the script file, intention to remove the the loadouts. The actual entries from the loadouts.ini file have been copied and pasted into the script file.
<data file="data\ships\loadouts.ini" method="sectiondelete" numTimes="2">
<section>
[Loadout
nickname = SECRET_g_ge_fighter2_bw10
archetype = ge_fighter2
equip = fc_g_gun01_mark04, HpWeapon01
equip = fc_g_gun01_mark04, HpWeapon02
equip = ge_s_cm_01, HpCM01
cargo = ge_s_cm_01_ammo, 20

</section>
<section>
[Loadout
nickname = SECRET_rh_p_rh_fighter_rh03a
archetype = rh_fighter
equip = rh_gun01_mark01, HpWeapon01
equip = rh_gun01_mark01, HpWeapon02

[Loadout
nickname = SECRET_rh_p_rh_fighter_rh03b
archetype = rh_fighter
equip = rh_gun01_mark02, HpWeapon01
equip = rh_gun01_mark02, HpWeapon02

</section>

This is the result of the removal in the loadouts.ini:The first 2 entries are removed, the 3rd is still there.

[Loadout
nickname = SECRET_rh_p_rh_fighter_rh03b
archetype = rh_fighter
equip = rh_gun01_mark02, HpWeapon01
equip = rh_gun01_mark02, HpWeapon02

Since there are 2 sections declared in my script I set numTimes="2". Okay I thought, weard, but maybe I need to set it to 3.
So I did, but the result remained the same.
Next I inserted </section><section> before the entry for the rh03b fighter, but the result remained the same, the entry for the rh03b fighter was still there.
Next I removed the linefeeds from the entries in the script file, the result still the same.
Next I inserted a 4th and 5th enry for the script to delete and choose 2 entries that were directly after one another in the file. Set numTimes="5"
The result was even worse now: the 3rd, 4th and 5th entry were not removed.
Next I removed the 3rd entry from the script. No luck either, the 4th and 5th entry still remain in there.

Question1: What am I doing wrong in configuring the sectiondelete?

Problem 2: Trying to delete the entry and the trailing linefeed as well
This is the entry in the script file, intention to remove the the loadout and the trailing linefeed as well.
<data file="data\ships\loadouts.ini" method="sectiondelete">
<section>
[Loadout
nickname = SECRET_g_ge_fighter2_bw10
archetype = ge_fighter2
equip = fc_g_gun01_mark04, HpWeapon01
equip = fc_g_gun01_mark04, HpWeapon02
equip = ge_s_cm_01, HpCM01
cargo = ge_s_cm_01_ammo, 20

</section>

Loadouts.ini before:
equip = DockingLightRedSmall, HpDockLight02

[Loadout
nickname = SECRET_g_ge_fighter2_bw10
archetype = ge_fighter2
equip = fc_g_gun01_mark04, HpWeapon01
equip = fc_g_gun01_mark04, HpWeapon02
equip = ge_s_cm_01, HpCM01
cargo = ge_s_cm_01_ammo, 20

[Loadout
nickname = MSN04_IMG

Loadouts.ini after:
equip = DockingLightRedSmall, HpDockLight02


[Loadout
nickname = MSN04_IMG

As you can see the linefeed was not removed although specified in the section.
Question2: Is this caused by an ill designed section in my script file, or is it something in FLMM?

Problem 3: Using sectionreplace to do removal job.
This is the script part that I created to do the job:
<data file="data\ships\loadouts.ini" method="sectionreplace">
<section>
[Loadout
nickname = SECRET_g_ge_fighter2_bw10
</section>
<dest>
[Loadout
nickname = SECRET_g_ge_fighter2_bw10
archetype = ge_fighter2
equip = fc_g_gun01_mark04, HpWeapon01
equip = fc_g_gun01_mark04, HpWeapon02
equip = ge_s_cm_01, HpCM01
cargo = ge_s_cm_01_ammo, 20
</dest>
<source>
;The loadout entry for SECRET_g_ge_fighter2_bw10 is moved to Solar\loadouts.ini
</source>

This is the result in the loadouts.ini:
[Loadout
nickname = SECRET_g_ge_fighter2_bw10
;The loadout entry for SECRET_g_ge_fighter2_bw10 is moved to Solar\loadouts.ini


Okay I thought may be the pointer is already on the archtype line and FLMM starts looking for [Loadout from there. So I changed the section part and placed there the line preceeding the target entry.
To get the same result as above.

Question 3: Is the observed behaviour caused by an ill designed section in my script file, or is it something intended in FLMM?

To summarize:
Problem 1: Trying to delete several sections from loadsouts.ini
Question1: What am I doing wrong in configuring the sectiondelete?

Problem 2: Trying to delete the entry and the trailing linefeed as well
Question 2: Is this caused by an ill designed section in my script file, or is it something in FLMM?

Problem 3: Using sectionreplace to do removal job.
Question 3: Is the observed behaviour caused by an ill designed section in my script file, or is it something intended in FLMM?

Some additional questions:
Question 4: When mod is build with files and scripts, is it true that the files are first loaded and next the scripts are executed?

Question 5: Do you happen to know in which order the scripts files are executed? Alphabetical, date or random?

I would be very gratefull if you could find the time to answer my questions.



BuckDanny