All-
With the latest upgrade to the EVNgine which allows defense fleets to be correctly calculated for spobs added in plugins, my life became easier and a utility I named BitChanger is usable/ready for testing, but lacks one major ability. I'm asking for the advice of the community as how best to approach the issue. Read on....
As I said in a recent post, BitChanger allows one to activate perses defined in a plugin. What's the big whoop, you ask? Well, pers data is stored as either a 1 (alive) or 0 (dead) in the pilot file. When you start a new pilot file, the game engine reads the data files and plugins and sets all the appropriate bits in the new pilot file to 1. As you kill them off in the game (if they are killable) those bits are set to 0.
The problem is that there is currently no way for the engine to know whether a brand new pers added in a plug in is new and inactivated or is killed. Therefore, if yo are designing a plugin and put a new pers in it, that pers will only show up if a new pilot file is made after the plugin is installed.
Which sucks if you want to write an add on to a mission thread and don't want to have the player have to start over.
As a means around this problem, BitChanger allows the plugin maker to define a configuration file. The configuration file is a text file listing which pers IDs to turn on. The configuration fiel is placed in the plugin folder (I've even successfully tested a plugin in which the data fork contained the BitChanger data and the resource fork contained the actual game mods). With the exception of asking for a pilot file, BitChanger asks for nothing, scanning the plugin folder for the info it needs. It reads the configuration file and makes sure the pers resources defined are turned on in the pilot file selected.
The problem is, how can I make sure BitChanger doesn't accidentially re-activate a pers? In theory, there could be multiple configuration files in the plugin folder. Because BitChanger automatically scans the folder, it would encounter any previously used configuratio file.
One of the ideas I had was to write the name of the plugin and the pers IDs activated to the data fork of the pilot file, but discovered that writing to the data fork when a resource fork is present destroys the resource fork (the converse is not true).
The other idea is to make a new resource stored in the pilot file that saves that data. So, npil 130 would contain BitChanger data. I could even encrypt that data using the same method that the rest of the pilot file.
The final idea is a BitChanger preference file. This would be fine, but would mean that the data on which perses had been previously activated would be seperate from the pilot.
Any sage advice? I'm strongly leaning toward making npil 130 for my use, though I'm sure doing that violates some basic programming ethic I'm unaware of.
-STH
------------------
"Create enigmas, not explanations." -Robert Smithson