Difference between revisions of "Creating Libraries and Modules"

From ADRIFT 5 Manual Wiki
Jump to: navigation, search
m (fixed link)
(Exporting your Module)
Line 31: Line 31:
  
 
[[File:MenuExport.jpg]]
 
[[File:MenuExport.jpg]]
 
+
 
 +
== Player perspective ==
 +
One of the [[Options]] for a game developer is to set the player perspective.
 +
That is, whether the player's character should be refered to in the first person ("I am"), second person ("You are") or third person ("Simon is").
 +
 
 +
Our module needs to change ALL of its output and restriction message to conform to this setting.
 +
 
 +
ADRIFT provides a special syntax to help us do this. We only need to place the words that need to change inside of square brackets "[ ]", providing the 3 different perspectives separated by slashes like this:
 +
[i am/you are/%CharacterName% is] wearing %ListWorn[%Player%]%.
 +
 
 +
== Point of View ==
 +
Someone using your module to create a game may wish to change the point of view and play as more than one character during the game.
 +
 
 +
This means that we cannot use the "Player" key directly in our module, we must always use the %Player% function to get the key of the character that the player is currently using.
 +
 
 +
We also need to ensure that we use the correct name for the character, and for this we can use the %CharacterName% function.
 +
 
 +
== Past, Present and Future Tense ==
 +
ADRIFT does not currently support switch the tense of the game between past, present and future, using the present tense exclusively.
 +
 
 +
The only way to support a different tense, for example to make your interactive fiction sound more like reading a normal book (which usually use past tense), is to make your own version of the standard library by making a copy of it and rewriting all of its text.
 +
 
 +
== Using Properties ==
 +
 +
 
  
 
<TABLE ALIGN=CENTER BORDER=1 WIDTH="50%"><TD WIDTH="33%" ALIGN=CENTER>[[Choose Your Own Adventure|<<< Choose Your Own Adventure]]</TD><TD WIDTH="34%" ALIGN=CENTER>[[Main Page#Advanced Tutorials|Main Page]]</TD><TD ALIGN=CENTER>[[Locations|ADRIFT Reference: Locations >>>]]</TD></TABLE>
 
<TABLE ALIGN=CENTER BORDER=1 WIDTH="50%"><TD WIDTH="33%" ALIGN=CENTER>[[Choose Your Own Adventure|<<< Choose Your Own Adventure]]</TD><TD WIDTH="34%" ALIGN=CENTER>[[Main Page#Advanced Tutorials|Main Page]]</TD><TD ALIGN=CENTER>[[Locations|ADRIFT Reference: Locations >>>]]</TD></TABLE>
 
[[Category:Advanced Tutorials]]
 
[[Category:Advanced Tutorials]]

Revision as of 08:40, 24 August 2013

ADRIFT 5 lets you create your own libraries to replace or add features to the standard library, and export it as a .AMF file that you can use in all of your own games, or publish on the ADRIFT web site for other people to use.

Construction.gif

Libraries and Modules

The same .AMF file can be used as both a library and as a module, the only difference is in the way you use it.

A module can be manually imported into a game at any time, simply by choosing "Import" from the main menu and selecting "Module":

MenuImport.jpg

A Library is just a module which is automatically imported whenever you begin a new game, and is automatically re-imported if a new version of the library has replaced the old one.

A new library is added to ADRIFT by going to the Libraries page of Settings and pressing the "Add New Library" button.

LibrarySettings.jpg

Reserving a key prefix

If you think you might ever share your module with anyone else then you should go to the bottom of the Options page to check which prefix codes are being used by other people, decide what prefix you want to use (your initials followed by an underscore "_" character for example) then add it to the list so that nobody else uses the same one.

Creating a Module

Create a NEW file in the developer for your module, then go to the Advanced page of the Options and enter your prefix code into the "Key Prefix" field.

Even if you are only making a module for your own use, you still need to specify a key prefix so that none of the keys in your module will be the same as any of the keys in the game files that you load it into.

Player Perspective

If you are creating a module for other people to use, or just want the option to use different player perspectives in your own games, then all of your text output needs to take this into consideration.

Exporting your Module

A copy of the module can be exported as a .AMF file at any time, simply by choosing "Export" from the main menu and selecting "Module":

MenuExport.jpg

Player perspective

One of the Options for a game developer is to set the player perspective. That is, whether the player's character should be refered to in the first person ("I am"), second person ("You are") or third person ("Simon is").

Our module needs to change ALL of its output and restriction message to conform to this setting.

ADRIFT provides a special syntax to help us do this. We only need to place the words that need to change inside of square brackets "[ ]", providing the 3 different perspectives separated by slashes like this:

[i am/you are/%CharacterName% is] wearing %ListWorn[%Player%]%.

Point of View

Someone using your module to create a game may wish to change the point of view and play as more than one character during the game.

This means that we cannot use the "Player" key directly in our module, we must always use the %Player% function to get the key of the character that the player is currently using.

We also need to ensure that we use the correct name for the character, and for this we can use the %CharacterName% function.

Past, Present and Future Tense

ADRIFT does not currently support switch the tense of the game between past, present and future, using the present tense exclusively.

The only way to support a different tense, for example to make your interactive fiction sound more like reading a normal book (which usually use past tense), is to make your own version of the standard library by making a copy of it and rewriting all of its text.

Using Properties

<<< Choose Your Own AdventureMain PageADRIFT Reference: Locations >>>