Changes between Version 1 and Version 2 of MissionLifetime


Ignore:
Timestamp:
11/25/10 18:12:11 (2 years ago)
Author:
knowknowledge
Comment:

Added pretty Headers

Legend:

Unmodified
Added
Removed
Modified
  • MissionLifetime

    v1 v2  
     1= Mission Lifetime = 
     2 
     3== Creation == 
     4 
    15Every time that the player lands on a planet, several "potential" missions are created and stored in a global table named availableMissions. 
    26 
     
    1317 
    1418Notice that the availableMissions are being Created by the "Create" function that I tried to explain before.  At this point the mission is just the missionTable, there is no c++ representation (or even knowledge) of this mission.  Once the player lands on a new planet, the availableMissions array is reinitialized, removing all references to the missionTables which the Lua garbage collector will later free. 
     19 
     20== Acceptance == 
    1521 
    1622If the player clicks on one of the "Accept" buttons, the Button will run this string: 
     
    3541}}} 
    3642 
     43== Life == 
     44 
    3745Every tick after this, the player will check if that mission has completed by calling it's Update function.  If the Mission has completed, then the Mission object on the heap is deleted.  The Mission destructor should destroy the missionTable by removing it from Lua's global registry. 
     46 
     47== Saving and Loading == 
    3848 
    3949Whenever the game is saved (whenever the player leaves a planet), the mission is converted into an XML Node and saved in the saved-games.xml file.  This required a conversion between arbitrary lua tables and XML that was only written recently.  The converter doesn't produce the most beautiful XML code, but the goal here is to make it easy for modders to create creative missions and not to create pretty XML tables.  The XML converter also can't handle lua functions as first class objects.