Important Dates

Latest Posts

Topic: LUA: "Strings" and [[Strings]]

kaputtnik
Avatar
Joined: 2013-02-18, 20:48
Posts: 1810
Ranking
One Elder of Players
Location: Germany
Posted at: 2017-04-11, 21:30

While looking at some scripts of campaigns i found that strings have different syntax. Some are within [[brackets]] and some are within "quotation marks". Example:

initial_message_01 = {
   title = _"Welcome to the Widelands Tutorial!",
   body = rt(
      h1(_"Welcome to Widelands!") ..
      p(_[[Widelands is a slow-paced build-up strategy game with an emphasis on construction rather than destruction. This tutorial will guide you through the basics of the game.]]) ..
      paragraphdivider() ..
      listitem_bullet(_[[Dismiss this box by left-clicking on the button below.]])
   ),
   h = 300,
   w = 400
}

Is there a difference?


Top Quote
kaputtnik
Avatar
Joined: 2013-02-18, 20:48
Posts: 1810
Ranking
One Elder of Players
Location: Germany
Posted at: 2017-04-12, 16:57

Ah, found it: Lua strings tutorial


Top Quote