New scripting function: getDerrick()
Posted: 22 Jan 2011, 15:11
I have added a new script function getDerrick() to master that takes an int index and returns a corresponding derrick or oil resource. This gives a nice way to quickly iterate over all positions known to contain oil. If an index value is passed that is larger than the number of objects, it returns a NULLOBJECT. The semperfi AI has been modified to use this for attacks of opportunity against undefended oil derricks.
Note that it will return a derrick object even if it is not known to the player, and thus can leak vision information (ie cheating). It is up to the script to handle this. For the semperfi AI, I decided that it would merely assume that non-owned oil resources are enemy derricks, so it did not matter.
Note that it will return a derrick object even if it is not known to the player, and thus can leak vision information (ie cheating). It is up to the script to handle this. For the semperfi AI, I decided that it would merely assume that non-owned oil resources are enemy derricks, so it did not matter.