HowTo:Edit Missions:Python:Summary

From VsWiki
Revision as of 16:03, 21 April 2008 by pyramid (talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search
  • Missions must inherit from Director.Mission
  • AI's must inherit from VS.PythonAI
  • Missions must have an __init__ function with any number of arguments that calls Director.Mission.__init__ (self); to trigger the C++ binding
  • AI's must have an init(self, un) function with those exact 2 arguments... the second one is the parent Unit. I don't recommend you save the unit currently--I'm not sure if it will garbage collect the unit in that case... just call the self.GetParent() function as the AI script.
  • Both AI's and Missions may have an Execute(self) function that does something each frame depending on the disired result.
  • Missions may have a Pickle and Unpickle function in order to save and load the state of a campaign (this can be incredibly complex!)