Hi Merrie,
As an alternative to using ini files, you can also use the "LoadParameter" and "SaveParameter; commands (more info
here).
However, both the ini files and the two other commands have the drawback that the information is stored on the computer. Therefore, if you have multiple players playing the game on the same computer, they will share the same name. Furthermore, with those methods, the information is not stored in the savegames (saving the information in savegames can be useful for resuming the game on another computer for example).
There is another method, which solves those problems and which is very simple:
1. Just create a global variable of type "variant" (to do so, click "VBS Global Variables" from the Adventure Maker Project Menu). Give a name to the variable (for example, call it "CharacterNameVariable").
2. Ask for the character name with the following code:
- Code: Select all
CharacterNameVariable = InputBox("Please enter the name of the character.")
3. To reuse the name in your game, just use the variable. For example, if you have a text element on the frame, you can display the name by using the following code:
(updated on July 14, 2008)- Code: Select all
Text(1).Caption = CharacterNameVariable
Or, if you want to display a message box, just use:
- Code: Select all
MsgBox "The character name is: " + CharacterNameVariable
The global variable will be automatically stored in the savegames.
Best regards,
GM-Support