Mission system - API - Attributes to read

= Description =

Those are attributes you don't define yourself, but that you may occasionally want to read within your functions.

= times_mission_run =

Introduced in: alpha2.3

Value: integer

Description: Gives the number of times the mission has been played by the current player. The first time the player is playing the mission, it is set to 1, the second time to 2, etc. A typical use of this attribute is to prevent repeating lengthy explanations about what the player needs to do when he has already played it in the past. Only useful for missions that can be repeated.

Example:  class MyMission extends Mission { ...   function my_method { if($this->times_mission_run > 1) { $this->say("You have already played this mission!"); ...

= current_site =

Introduced in: alpha2.0

Value: Site object

Description: Contains details about the site the player is currently seeing in the game. See the Site object description for details about the available attributes and methods.

Example:  class MyMission extends Mission { ...   function my_method { $this->say("I see that you are currently on this URL {$this->current_site->url}"); ...

= mission_tag =

Introduced in: alpha2.3

Value: string

Description: A unique string identifying the mission. This is not meant to be displayed to the user. As of alpha2.3, it is constructed by appending the mission_category and mission_name strings.

Example:  class MyMission extends Mission { ...   function my_method { $this->current_site->add_user_tag($this->mission_tag, $this->user); ...

= user =

Introduced in: alpha2.0

Value: User object

Description: Contains details about the player currently playing the mission. See the User object description for details about the available attributes and methods.

Example:  class MyMission extends Mission { ...   function my_method { $this->say("Hello, {$this->user->nickname}"); ...