Special functions can be limited to ships at a particular experience level. A line of the form
Level = 3
indicates that the following RacesAllowed or PlayersAllowed statement will apply only to ships at level 3 and above. You can also specify a range. A function defined with
Level = 0-2
applies to ships at levels 0 to 2, inclusive.
► Note: This assignment only applies to the one following RacesAllowed or PlayersAllowed statement. The next-but-one statement will again generate special functions which are not limited to any level. If ConfigLevel is non-zero, PHost will print a warning if you write a Level assignment followed by two or more of these action statements, because this is most likely not what you want. To turn off the warning, place a (redundant) Hull assignment between the statements or merge the action statements into one.
Level-restricted devices are managed by creating "virtual" special devices. For example,
Function = Cloak Level = 2 Hull = Large Deep Space Freighter RacesAllowed = +
defines a new special function "Cloaking device which works on level 2 and above", and assigns that function to the Large Deep Space Freighter. Normally, you don't have to think about that, but it has the following implications:
- You can only define a limited number of modified devices. This limit is 256 as of PHost 4.1e. Previously, the limit was 64. If you try to define more functions than your PHost version supports, PHost will abort with an error message. Note that if you have assigned such a modified device to a ship, that device will stay around until the ship gets destroyed.
- The "Cloaking device which works on level 2 and above" is a different device than the ordinary "Cloak" device.
Function = Cloak Hull = Large Deep Space Freighter RacesAllowed = -5
will not disallow Privateer LDSFs to cloak at level 2. It will take away the ordinary cloaking device; the ship will still have its level-2-and-above device. To take away that, you must include the Level = 2 line again. - The modified devices are reported to client programs in util.dat record 57.
The Level statement only works in PHost 4.0h and later. Older versions reject it.
For compatibility with PHost 4.x games, PHost 3.x versions since 3.4j accept this statement, too. Since there are no experience levels in these PHost versions, only devices declared to work at level zero will actually be assigned to ships in these versions.