This is the documentation for the new goal structure on the Planet Oit. It is very open to change and modification. If you have any comments or suggestions on how to make it work even better, or need some clarification on how it works, send me an e-mail Table of ContentsOverviewImportant Object Numbers $g.goals $g.id_goal $g.secondary_ID_goals #1459 (Interpretive Module) $g.first_interp_goal $g.dike_id_interp_goal #1458 (Hydrology Module) $g.first_hydro_goal Scenarios How to build new modules
The goal structure is divided into separate modules. Presently there are 5 different modules. The identification module, the interpretive module, the hydrology module, the survey module, and the endgame. The identification module is the only module tested, working, and used in experiments. Return to Table of Contents |
Return to Table of Contents |
New Generic Goal (#1454)
Overview - This is the object that controls which goal should be chosen
next in the student's progression. Which module is picked is based on
the property module_search_order. Goals are chosen based on the results of each particular module's select_goal function.
Return to Table of Contents
module_search_order - This is a list of object numbers. The order of the object numbers in this list is the order that the modules will be assigned in. The initial list given to a player is stored in a their particular player class object. You can change the modules that players need to complete by changing the module_search_order on either that particular player's object or on a class object (normally the direct parent of the player object) goal_points - The number of points this particular goal is worth. For example, $g.secondary_ID_goal is worth 25, all of the $g.id_goal goals are 100, etc. goal_msg - A property set up to store the show_goal message of this particular goal, it is not necessarily used by all goals, but is set up for the purpose of storing goal messages. Return to Table of Contents
assign_goalFormat: assign_goal ( explorer )Return Value: none Arguments - explorer = player to assign the goal to Purpose - Control function, if a goal is assigned to a player already, show that, otherwise assign them a new goal and call start_goal if it is defined. Called by - complete_goal and $g.game_player:confunc
goal_name_stringFormat: goal_name_string ( goal )Return Value: string saying what the name of this goal is Arguments - goal = The goal that you want the name of (could even be #-1!) Purpose - Used by the exploration tutor (and the GUI) to determine the name of this goal Called by - $g.old_exploration_tutor:leave_room, $g.exploration_tutor:inform_tutor, and $directive:gui_status
is_completedFormat: is_completed ( explorer )Return Value: 1 if module is completed, 0 if not Arguments - explorer = player who could have completed the module Purpose - Determine if a module/goal has been completed by a player or not Called by - Generic Goal:select_goal
random_goalFormat: random_goal ( )Return Value: random goal in the children of this object Arguments - none Purpose - return a random goal from the children of this object Called by - $g.id_goal:select_goal
select_goalFormat: select_goal ( explorer, module_search_order )Return Value: Object number of new goal Arguments - explorer = player to choose the module of module_search_order = ordering that the next module should be selected in. Use this function to change the ordering of modules for different players Purpose - Return the next goal in this players progression. Called by - assign_goal Default select_goal behavior. Searches through the module_search_order recursively. If a module's select_goal function returns something, that will be the next goal
show_goalFormat: show_goal ( explorer, goal )Return Value: none Arguments - explorer = player to assign the goal to, goal = goal to display Purpose - Will display the goal message however it is supposed to be displayed Called by - assign_goal and $g.game_player:showgoal
show_goal_pointsFormat: show_goal_points ( history_entry )Return Value: number of points achieved in this history_entry Arguments - history_entry = the history entry you want to print out Purpose - Used by all scoring routines to determine how many points you have and how to print out something in showscore Called by - show_goal and $directive:gui_status This is the default behavior, there is no score capability in the object that was called, so we print a message saying so, and return 0 points. Another potential change. $directive:gui_status should simply check a property on player for the number of points. complete_goal should add points to this property Return to Table of Contents |
complete_goalFormat: complete_goal ( explorer )Return Value: none Arguments - explorer = player who has completed the goal Purpose - Function that is called by external functions to say a goal has been completed Called by - $g.thing:report identify
get_test_setFormat: get_test_set ( goal )Return Value: the test set for the rock or mineral represented by goal (or an empty list) Arguments - goal = the goal we want to know the test set of Purpose - Called by the equipment tutor to determine what instruments are needed Called by - $g.old_equipment_tutor:equip_needs and $g.equipment_tutor:equip_needs
is_completedSee $g.goals:is_completed. This module returns 1 if 500 points have been scored by the player. Otherwise, it returns 0.
record_goal_pointsFormat: record_goal_points ( explorer, {goal_info} )Return Value: none Arguments - explorer = player who scored some points, goal_info = information about how this goal was completed, in the form {"correct" or "incorrect", outcrop object number, guess object number"} Purpose - change the value in the player's goal record in their history to give them points for achieving a goal Called by - complete_goal This replaces an old behavior. You need to search backwards through the history entries looking for the history entry {date, "goal", goal object number, 0} and replace it with the new {date, goal object number, points, "goal assigned"} syntax. Then you can add the fact that the player has completed the goal
select_goalOverrides $g.goals:select_goal behaviorFor the first goal, a player is given a random mineral that requires an instrument to positively identify it (an instrument must be listed in that mineral's test set) For the second goal, a player is given a random mineral For all subsequent goals, a player is given a random goal No given goal will be in goal_stoplist
show_goalSee $g.goals:show_goal. Prints a goal message for the playerMight want to redo this function for code readability...
show_goal_pointsSee $g.goals:show_goal_points. This prints out showscore information on "goal assigned" and "correct" goal information and returns goal_points points for correct answers
start_goalFormat: start_goal ( explorer )Return Value: none Arguments - explorer = player who has started the goal Purpose - Used to put in goal assigned message into the player's history when we started this goal Called by - $g.goals:assign_goal Return to Table of Contents |
record_goal_pointsFormat: record_goal_points ( explorer, sample_object_number, museum_object_number, points, "correct" or "incorrect" )Return Value: none Arguments - explorer - Person who needs goal points written, sample_object_number - the object number of the sample they got correct, museum_object_number - the object in the museum that this sample represents, points - number of points they received, "correct", "incorrect", or "correct again" - Whether they got the guess right or not. Purpose - change the value in the player's goal record in their history to give them points for achieving a goal Called by - $g.thing:report identify There are three cases when this function is called. Either they got it correct and scored points, the got it correct but didn't score any points, or they didn't get it right Could add checks to see if they are in the identification game before giving them points here
show_goal_pointsOverrides $g.goals:show_goal_points behavior. Prints out information if a player correctly or incorrectly identified an outcropReturn to Table of Contents |
show_goalSee $g.goals:show_goal. Prints a goal message by simply printing out the goal_msg. This function is called calling child(this):show_goal, so that their particular goal_msg is printedrReturn to Table of Contents |
complete_goalSee $g.goals:complete_goal for a complete description. This function also sets the interpretive module in motion with the in_quiz_rooms variable on players.Called by - $g.quiz_tutor:q_level_0
is_completedSee $g.goals:is_completed. This module returns 1 if there is a "Welcome" entry in explorer's history.tutor list. Otherwise, it returns 0.
record_goal_pointsFormat: record_goal_points ( explorer )Return Value: none Arguments - explorer = player who scored some points Purpose - change the value in the player's goal record in their history to give them points for achieving this goal Called by - complete_goal show_goal_pointsSee $g.goals:show_goal_points. This prints out showscore information on the fact that they got an introduction to the interpretive moduleReturn to Table of Contents |
Return to Table of Contents
complete_goalSee $g.goals:complete_goal for a complete description. This function doesn't necessarily complete the goal every time it is called It checks to see if you are all completed and runs show_goal if you are not.Called by - $g.thing:report identify
is_completedSee $g.goals:is_completed. This module returns 1 if all the types of outcrops in $g.dike_im:first_goal_list have been identified (as outcrops in the Interpretive Module) Otherwise, it returns 0.Called by: $g.dike_id_interp_goal:complete_goal (as well as those listed in $g.goals:is_completed)
show_goalSee $g.goals:show_goal. Prints a goal message for the player. This function adds the functionality of printing the outcrops that are left to identify in this goal
record_goal_pointsFormat: record_goal_points ( explorer )Return Value: none Arguments - explorer = player who scored some points Purpose - change the value in the player's goal record in their history to give them points for achieving this goal Called by - complete_goal show_goal_pointsSee $g.goals:show_goal_points. This prints out showscore information on the fact that they found all necessary outcrops in the interpretive moduleReturn to Table of Contents |
show_goalSee $g.goals:show_goal. Prints a goal message by simply printing out the goal_msg. This function is called calling child(this):show_goal, so that their particular goal_msg is printedrReturn to Table of Contents |
complete_goalSee $g.goals:complete_goal for a complete description.Called by - $g.hydro_tutor:q_level_0
is_completedSee $g.goals:is_completed. This module returns 1 if there is any reference to this goal in the player's .history.goal list. Otherwise, it returns 0.
record_goal_pointsFormat: record_goal_points ( explorer )Return Value: none Arguments - explorer = player who scored some points Purpose - change the value in the player's goal record in their history to give them points for achieving this goal Called by - complete_goal show_goal_pointsSee $g.goals:show_goal_points. This prints out showscore information on the fact that they got an introduction to the hydrology moduleReturn to Table of Contents |
ScenariosThere are a number of different scenarios which occur in order to activate the goal structure. Here is the present list and the function calls necessary to achieve each scenario. When a player creates a new character
When a player connects to the game
When a player completes a goal
When a player wishes to print her goal message
When a player wishes to print their score (text version only, graphics is displayed in the status panel)
Note: show_goal calls $directive_gui_status in order to print the current goal and score to the graphical client in all cases where show_goal is shown above Return to Table of Contents |
How to build new modules:Now to the really important stuff. How do I build a new module into the present goal structure? It's semi-complicated process, but not nearly as difficult as it once was. Here are the steps.
|
To do in this documentation:
|