Dynamic Script Import
...
It seems the uneditable, imported scripts are taken directly from the libraries in the main game folder upon load [of the map-file].
That still leaves the question of how i can tell a map-file's script collection to import current existing libraries upon load automatically. The system is quite good since the singular components are dynamically incorporated, but i still have no idea how.
...
Found the answer to that, so i thought i better share. No-one seems to have known about it, or at least no-one bothered to tell me, so for those not in the know, this is how to dynamically incorporate scripts into map-files.
What's it used for?: Well, EA used this to incorporate the gollum-spawn scripts into every map for BfMe2. This can easily be used to do the same for new BfMe2 maps, or for converting BfMe1 maps to the Ring-mechanics. The idea is this: If you open the gollumspawn-scripts-library and change a few lines (like adjust the spawnpoint-choice randomizer), it will effect
all maps that have the gollumspawn-scripts added in this dynamic fashion! Cool, eh?
If you check out the BfMe1-AI-scripts, you will see that just about ALL of the scripts in there have been added in this fashion (the scripts that say 'imported'):
In this example there is a folder ('AI-Mordor') that contains a small number of scripts almost identical to the imported scripts, but with Mordor specific variations. As long as they have the exact same name as the dynamically imported scripts, the latter will be 'overidden' and will be designated as such. Pretty elegant!
Now, how to do it? I'll show you with the gollum scripts. Make sure you have the file 'libraries.big' extracted in the game's main folder:
Step 1: Start a new map-file or open a map-file you want to add the scripts to (yes, this includes libraries as well as maps)
Step 2: Edit --> Edit Player List ... -> Press 'Add Skirmish Players' if it's a new skirmish map, otherwise check EA's tutorials for details on adding the right Players.
Step 3: Select 'Plyr/Creeps'
Step 4: Press the button 'Library Maps' situated next to 'color'.
Step 5: At the right side of the probably empty window is a button named 'New...'. Press it.
Step 6: Now you get the usual 'open map' menu. Press 'libraries', go look for and open 'lib_gollumspawn'. Now the window from step 5 has listed the chosen library, which now is a dynamic reference. Press 'OK', and again 'OK' to exit to the main WB-window.
Step 7: Open the scripts editor (Edit --> Scripts... or CTRL+ALT+R). It should now look like this:
That's it. The imported scripts for the BfMe1-skirmishAI are using the same function. All the dynamic scripts can be added/removed in the 'Player List'.
Now please don't tell me you knew all along, grrrr!