(sk) Jazyk WML

From The Battle for Wesnoth Wiki
Revision as of 05:07, 5 August 2012 by BettyMorgan (talk | contribs) (minor updates)

(Návod - Tvorba - Jazyk WML)


Jazyk WML (Wesnoth Markup Language) je špeciálny jazyk na programovanie súčastí hry Bitka o Wesnoth. Program v jazyku WML sa skladá zo značiek a vlastností.


Vlastnosti

Vlastnosť má dve časti; kľúč a hodnotu. Kľúč určuje, čo táto vlastnosť popisuje, hodnota označuje poradie, množstvo, názov, alebo niečo také.

gold=100

Takáto vlastnosť (umiestnená na správnom mieste) označuje, že daná strana má na začiatku scenára k dispozícii 100 zlatiek.

V danom prípade je kľúčom slovo "gold" a hodnotou číslo "100". Ako kľúče možno používať iba slová uvedené v návode. Znamienko "=" musí nasledovať hneď za kľúčom, bez medzery. Všetko, čo nasleduje po znamienku "=", je hodnota.

Číselné aj textové hodnoty možno písať priamo; textové hodnoty možno okrem toho uzavrieť do úvodzoviek. Textová hodnota v úvodzovkách môže byť aj viacriadková. Ak pred textovou hodnotou v úvodzovkách použijeme znamienko "_", znamená to, že táto hodnota sa v rôznych jazykoch prekladá (uvedená hodnota zodpovedá americkej angličtine). Znamienko "+" možno použiť na spojenie dvoch textových hodnôt.

type=Fighter
description=Konrad
user_description= _ "Konrad"

Táto skupina vlastností označuje, že daná jednotka je typu "Fighter" (Bojovník), v rámci programu ju budeme označovať slovom "Konrad", a jej názov v americkej angličtine je "Konrad" (ale napríklad v slovenčine je preložený ako "Konrád" s dĺžňom).

Na jednom riadku možno zadať aj viacero vlastností, napríklad takto:

x,y=10,20

Znamená to to isté ako:

x=10
y=20


Značky

Značka je skupina súvisiacich informácií.

[unit]
  type=Elder Mage
  description=Delfador
  user_description= _ "Delfador"
[/unit]

Táto značka popisuje jednotku; na začiatku aj na konci značky je rovnaký text, ale pred koncom je lomka.

Ak sa na začiatku značky použije znamienko "+", pripoja sa uvedené vlastnosti k poslednej značke rovnakého mena. (Ak sa niektoré vlastnosti zhodujú, potom nové vlastnosti prepisujú staré.)

[+unit]
  x,y=10,20
[/unit]

Predchádzajúce dva príklady napísané po sebe urobia to isté, ako keby bolo napísané:

[unit]
  type=Elder Mage
  description=Delfador
  user_description= _ "Delfador"
  x,y=10,20
[/unit]

Seeking Silence & Stillness in the Rush of Business Life

Pico Iyer -- essayist, author, travel writer and thinker -- has a unique perspective on many things. His physical domain ranges from California (where he lived as a child) and England (where he studied) to Cuba, North Korea and Ethiopia (which he visited) and Japan (where he resides). His mental domain knows no limiting boundaries. In this interview with Wharton associate dean and chief information officer Deirdre Woods and Knowledge@Wharton

[Seeking Silence & Stillness in the Rush of Business Life]

[GoodvilleNews.com - good, positive news, inspirational stories, articles]

The Power of You! Living Life Without Limits

To every person there comes in their lifetime that special moment when you are figuratively tapped on the shoulder and offered the chance to do a very special thing, unique to you and your talents. What a tragedy if that moment finds you unprepared or unqualified for work which could have been your finest hour. Winston Churchill

[The Power of You! Living Life Without Limits]

[GoodvilleNews.com - good, positive news, inspirational stories, articles]

Starting A Slow Story Movement

"It is said that we become the stories that we tell among ourselves. This might have been true before we became salespersons. For a few decades now, I think we have become numb to the stories that we tell among ourselves. So stories have become shorter and crisper to the length of a tweet. We are so committed to telling a story to the point that finally what remains is a dimensionless point.

[Starting A Slow Story Movement]

[GoodvilleNews.com - good, positive news, inspirational stories, articles]

Research Reveals Largest Ancient Dam Built by Maya Civilization

Recent excavations, sediment coring and mapping by a multi-university team led by the University of Cincinnati at the pre-Columbian city of Tikal, a paramount urban center of the ancient Maya, have identified new landscaping and engineering feats, including the largest ancient dam built by the Maya of Central America.

[Research Reveals Largest Ancient Dam Built by Maya Civilization]

[GoodvilleNews.com - good, positive news, inspirational stories, articles]

What Is Your Legacy? Living A Meaningful life

I want the world to be better because I was here. I want my life, I want my work, my family, I want it to mean something and if you are not making someone elses life better then you are wasting your time Will Smith

[What Is Your Legacy? Living A Meaningful life]

[GoodvilleNews.com - good, positive news, inspirational stories, articles]