Goto http://www.stucuk.netGoto http://www.atlanticaonlinewiki.comGoto


From Original War Support Wiki

Jump to: navigation, search

Tutorials -> Counters

Tutorial By: Radzio

How can I add counters to the mission?
Where I should put the text for them?

I'll try to answer these questions in my tutorial.


Step 1:
Extract file Texts/Counters.wri (or Texts/#LNG/Counters.wri [where LNG is a short form of your language name]) to your mod's directory.

Step 2:
Look into extracted file. This is a part of it (english version):

   Crates to collect: %d 
   Remaining time: %t 

Step 3:
Add your own text. Example:

   You will win a car in %t minutes. 

Identifier is an identifier which you will use in SAIL.
Remember: First and last line have to be empty. Lines between every counter also have to be empty.

Step 4:
Use correct value type in text of counter.
%d is used for numerical values
%t is used for time values

Step 5:
Add counters to the mission. It's the simplest step. Just add this to the code:


You can also display more than one string.


Remember about   ' '   and   #   before identifier.

Values can change.

 //beginning of the code
 EXPORT timer_value; 
 //somewhere in code 
 every 0$1 do 

Code above will add 1 to the value every second. You can also reduce values.
Note: I've added 0$1 because it's time value. For numerical values use 1.

Multiple values

A counter can consist of multiple values (both numerical and timer values). E.g. if we add this to Counters.wri

  You have %t left to gather %d crates

In SAIL display_strings now need two inputs - the first a timer value, the second a numerical value.

display_strings = ['#Am07-Count1',3$19,50];


You can furthermore color the displayed text by adding %c to the text in Counters.wri. All text after %c will be colored in the defined color. This coloring also needs an input in display_strings - an integer from 0 to 8 corresponding to the colors of side 0 to 8. If the integer is anything else, the displayed text will not be colored.

in Counters.wri:

  %cBeware! You have only %t left!

We want to color this warning red (like side 3). SAIL:

display_strings = ['#Ru02-Count2',3,0$31];
Personal tools
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.