Goto http://www.stucuk.netGoto http://www.atlanticaonlinewiki.comGoto http://www.game-requirements.com

Giving Medals

From Original War Support Wiki

Jump to: navigation, search

Tutorials -> Giving Medals

Contents

Introduction

Giving medals in the end of a mission is a little sophisticated. In short: What you have to do is to use function AddMedal three times to add information about all three medals to a temporary pool of data and then execute this data using function GiveMedals. It is therefor essential that function GiveMedals is executed after the AddMedal functions (if it was executed before, nothing would happen since the information pool would be empty). The mentioned information about the medals is not just if a medal should be given or not – it is also what text should be displayed when the player mouses over the medal (or the empty medal slot if the medal was not given). This text is defined in texts.txt.

Syntax "Medal info"

This is syntax for defining information about a medal in texts.txt:

* Identifier
+ Medal text 1 (medal is given)
+ Medal text 2 (medal is given)
...
- Medal text 1 (medal is not given)
- Medal text 2 (medal is not given)
...
*

Template AddMedal

AddMedal('Medal_text_identifier',integer);

Medal_text_identifier - The identifier of the "medal text" defined in texts.txt (must be in inverted commas since it's an external reference).
integer - An integer. If the integer is positive, the medal is given; if it is negative the medal is not given. If it is "1" the text after the first "+" in texts.txt is displayed; if it is "2" the text after the second "+" in texts.txt is shown and so on. The same applies for "-".

Example 1

Texts.txt:

* Destroy
+ You destroyed all enemy buildings
+ You destroyed almost all enemy buildings
- You destroyed no enemy buildings
- You destroyed only few enemy buildings
*

SAIL:

AddMedal('Destroy',-2);

Now this medal is not given and the following text will be displayed when you mouse over the medal slot: "You destroyed only few enemy buildings".

Template GiveMedals

GiveMedals('texts.txt_identifier');

texts.txt_identifier - an identifier in texts.txt defined before the "medal info" (must be in inverted commas since it's an external reference).

Syntax "GiveMedals identifier"

^ Identifier

Example 2

Texts.txt:

^ MAIN

* Destroy
+ You destroyed all enemy buildings
+ You destroyed almost all enemy buildings
- You destroyed no enemy buildings
- You destroyed only few enemy buildings
*

SAIL:

AddMedal('Destroy',-2);
GiveMedals('MAIN');
Personal tools
Clanbase
This is a cached copy of the requested page, and may not be up to date.

Sorry! This site is experiencing technical difficulties.
Try waiting a few minutes and reloading.

(Cannot contact the database server: MySQL functions missing, have you compiled PHP with the --with-mysql option? )


You can try searching via Google in the meantime.
Note that their indexes of our content may be out of date.