Latest Posts

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

kaputtnik
Avatar
Topic Opener
Joined: 2013-02-18, 20:48
Posts: 2433
OS: Archlinux
Version: current master
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?


Fight simulator for Widelands:
https://wide-fighter.netlify.app/

Top Quote
kaputtnik
Avatar
Topic Opener
Joined: 2013-02-18, 20:48
Posts: 2433
OS: Archlinux
Version: current master
Ranking
One Elder of Players
Location: Germany
Posted at: 2017-04-12, 16:57

Ah, found it: Lua strings tutorial


Fight simulator for Widelands:
https://wide-fighter.netlify.app/

Top Quote