<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="fa">
	<id>https://fa.doc.boardgamearena.com/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Sourisdudesert</id>
	<title>Board Game Arena - مشارکت‌های کاربر [fa]</title>
	<link rel="self" type="application/atom+xml" href="https://fa.doc.boardgamearena.com/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Sourisdudesert"/>
	<link rel="alternate" type="text/html" href="https://fa.doc.boardgamearena.com/%D9%88%DB%8C%DA%98%D9%87:%D9%85%D8%B4%D8%A7%D8%B1%DA%A9%D8%AA%E2%80%8C%D9%87%D8%A7/Sourisdudesert"/>
	<updated>2026-10-18T02:52:11Z</updated>
	<subtitle>مشارکت‌های کاربر</subtitle>
	<generator>MediaWiki 1.39.0</generator>
	<entry>
		<id>https://fa.doc.boardgamearena.com/index.php?title=TermsOfService&amp;diff=2215</id>
		<title>TermsOfService</title>
		<link rel="alternate" type="text/html" href="https://fa.doc.boardgamearena.com/index.php?title=TermsOfService&amp;diff=2215"/>
		<updated>2017-01-26T10:38:57Z</updated>

		<summary type="html">&lt;p&gt;Sourisdudesert: Replaced content with &amp;quot;
See :
https://boardgamearena.com/#!legal&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
See :&lt;br /&gt;
https://boardgamearena.com/#!legal&lt;/div&gt;</summary>
		<author><name>Sourisdudesert</name></author>
	</entry>
	<entry>
		<id>https://fa.doc.boardgamearena.com/index.php?title=SandboxScripts&amp;diff=2158</id>
		<title>SandboxScripts</title>
		<link rel="alternate" type="text/html" href="https://fa.doc.boardgamearena.com/index.php?title=SandboxScripts&amp;diff=2158"/>
		<updated>2017-01-04T18:17:05Z</updated>

		<summary type="html">&lt;p&gt;Sourisdudesert: /* bga.getElement( selector, (optionnal) fields ) */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
This is the reference of functions you can call from your Sandbox scripts.&lt;br /&gt;
&lt;br /&gt;
= Javascript =&lt;br /&gt;
&lt;br /&gt;
BGA Sandbox scripts are written in Javascript.&lt;br /&gt;
&lt;br /&gt;
Using Javascript, you can write scripts to automate moves for your Sandbox games &amp;amp; provide rules reinforcement.&lt;br /&gt;
&lt;br /&gt;
Important : in the opposite of the most common usage of Javascript, Sandbox scripts are executed &#039;&#039;&#039;on server side&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
= BGA API =&lt;br /&gt;
&lt;br /&gt;
To interact with your BGA Sandbox game, we provide you an API.&lt;br /&gt;
&lt;br /&gt;
With this API, you can get properties values of game elements from the current game situation, modify them and/or trigger the game actions (ex : move this element here, flip this card, and so on).&lt;br /&gt;
&lt;br /&gt;
= Quick start =&lt;br /&gt;
&lt;br /&gt;
== Hello World Script ==&lt;br /&gt;
&lt;br /&gt;
From Sandbox editor &amp;quot;interface view&amp;quot; tab, select an element, and access to its property (top right icon).&lt;br /&gt;
&lt;br /&gt;
Go to &amp;quot;Scripts (advanced)&amp;quot; section.&lt;br /&gt;
&lt;br /&gt;
In front of &amp;quot;When this element is clicked&amp;quot;, enter &amp;quot;onMyClick&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
Close the window. Go to &amp;quot;script view&amp;quot; tab.&lt;br /&gt;
&lt;br /&gt;
Enter the following :&lt;br /&gt;
&lt;br /&gt;
 function onMyClick( element_id )&lt;br /&gt;
 {&lt;br /&gt;
    bga.log(&amp;quot;Hello world! You just clicked on element &amp;quot; + element_id + &amp;quot;. Congrats!&amp;quot;);&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
Save &amp;amp; publish your project, starts a test session, click on the previous element : your message appears in the log on the right!&lt;br /&gt;
&lt;br /&gt;
== Top useful tips ==&lt;br /&gt;
&lt;br /&gt;
* You don&#039;t have to save&amp;amp;publish from the Sandbox editor for each modification of your script : each time you save your script (control+S), the script used for all test sessions is updated. Note that the production version on BGA is of course NOT updated until you explicitly save&amp;amp;publish again your project.&lt;br /&gt;
&lt;br /&gt;
* Alternatively to bga.log(), you can use bga.exit( &amp;quot;my message&amp;quot; ) to debug your script. With bga.exit, the script execution immediately stops and all previous game changes are cancelled, so this is very practical to try and retry an action until your script is fine.&lt;br /&gt;
&lt;br /&gt;
* We advise you to develop first a full playable version of the game without the scripts, and THEN to script it.&lt;br /&gt;
&lt;br /&gt;
* This is not mandatory to script the full game! You can start by automate most painful game actions first, publish the game, and then continue later :)&lt;br /&gt;
&lt;br /&gt;
= Functions you can use in your Sandbox scripts=&lt;br /&gt;
&lt;br /&gt;
== Debugging functions ==&lt;br /&gt;
&lt;br /&gt;
=== bga.trace( txt / obj ) ===&lt;br /&gt;
&lt;br /&gt;
Write something immediately in the BGA log (on the right of the screen).&lt;br /&gt;
&lt;br /&gt;
This is the most practical way to debug your script :)&lt;br /&gt;
&lt;br /&gt;
Important : bga.trace is for debugging purpose only and won&#039;t be displayed on production.&lt;br /&gt;
&lt;br /&gt;
Note : you can also pass an object in parameter. This will dump the content of this object in the log.&lt;br /&gt;
&lt;br /&gt;
Note : in the opposite of bga.log, bga.trace is NOT cancelled if the game action failed (after a call to bga.cancel or bga.error). This makes bga.trace very practical to debug a game action that failed, and for this reason you should probably NEVER use bga.log for debugging purpose.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
  // Example : write &amp;quot;Hello world&amp;quot; in the log&lt;br /&gt;
  bga.trace( &amp;quot;Hello world&amp;quot; );&lt;br /&gt;
&lt;br /&gt;
  // Example : dump an associative array in the log&lt;br /&gt;
  bga.trace( { mykey: &#039;myvalue&#039;, another_key: &#039;another_value&#039; } );&lt;br /&gt;
&lt;br /&gt;
=== bga.exit( txt / obj ) ===&lt;br /&gt;
&lt;br /&gt;
Stop the script immediately, display the &amp;quot;txt&amp;quot; messages and cancel (ie : rollback) on every previous API call except bga.trace :&lt;br /&gt;
&lt;br /&gt;
ALL previous BGA api call are canceled and there will be no visible changes on the interface (ex : no moves, no visible property changes, ...). Only &amp;quot;bga.trace&amp;quot; API commands are kept so you can debug.&lt;br /&gt;
&lt;br /&gt;
bga.exit is very practical when you want to repeat a game action again and again to debug it : with a call to bga.exit at the end of your script, you make sure that your game situation will be kept unchanged after each test.&lt;br /&gt;
&lt;br /&gt;
  // Example :&lt;br /&gt;
  bga.exit( &amp;quot;My script is stopped by this call&amp;quot; );&lt;br /&gt;
&lt;br /&gt;
  // Example with dumping a javascript variable&lt;br /&gt;
  bga.exit( my_variable_to_dump );&lt;br /&gt;
&lt;br /&gt;
== Cancelling a game action ==&lt;br /&gt;
&lt;br /&gt;
=== bga.cancel( txt ) ===&lt;br /&gt;
&lt;br /&gt;
This is the function to use when a player is doing something against game rules.&lt;br /&gt;
&lt;br /&gt;
The text message in parameter will be displayed to this player as a &amp;quot;red message&amp;quot;, so he/she can understand the rule.&lt;br /&gt;
&lt;br /&gt;
All previous BGA api call are cancelled, and there will be no visible changes on the interface.&lt;br /&gt;
&lt;br /&gt;
   // Example :&lt;br /&gt;
   bga.cancel( _(&amp;quot;You cannot move this piece here&amp;quot;) );&lt;br /&gt;
&lt;br /&gt;
Note : most of the time, you should wrap your text inside a _() translation marker to make this string translatable.&lt;br /&gt;
&lt;br /&gt;
=== bga.error( text ) ===&lt;br /&gt;
&lt;br /&gt;
This is the function to use when some unexpected error happens in your script.&lt;br /&gt;
&lt;br /&gt;
The text message will be displayed to user, with mention &amp;quot;Unexpected error&amp;quot;. The player will be incited to fill a bug report. The purpose of the message is to help you to identify the bug.&lt;br /&gt;
&lt;br /&gt;
All previous BGA api call are cancelled, and there will be no visible changes on the interface.&lt;br /&gt;
&lt;br /&gt;
   // Example :&lt;br /&gt;
   if( card_picked === null )&lt;br /&gt;
   {&lt;br /&gt;
       bga.error( &amp;quot;Cannot find a card to pick !&amp;quot; );&lt;br /&gt;
   }&lt;br /&gt;
&lt;br /&gt;
Note : you should NEVER wrap text inside bga.error with _() translation marker, because unexpected error should not be translate (so you can eventually recognize them when reported by players in bug report).&lt;br /&gt;
&lt;br /&gt;
== Game log (history) ==&lt;br /&gt;
&lt;br /&gt;
=== bga.log( txt, (optional) args ) ===&lt;br /&gt;
&lt;br /&gt;
Write something in the BGA log on the right.&lt;br /&gt;
&lt;br /&gt;
  // Example : simple log&lt;br /&gt;
  bga.log( _(&amp;quot;A new round starts&amp;quot;) );&lt;br /&gt;
&lt;br /&gt;
You may add arguments to your log, like this :&lt;br /&gt;
&lt;br /&gt;
  // Example: log with argument to display a card name.&lt;br /&gt;
  //          In this example, variable &amp;quot;event_name&amp;quot; is specified afterwards.&lt;br /&gt;
  //          Note that using this, game translators only have to translate one &amp;quot;Event XXX is triggered&amp;quot; string for all possible events.&lt;br /&gt;
  bga.log( _(&amp;quot;Event ${event_name} is triggered&amp;quot;), {  event_name: _( &amp;quot;Armageddon&amp;quot; ) } ) );&lt;br /&gt;
&lt;br /&gt;
Note that argument &amp;quot;player_name&amp;quot; is ALWAYS pre-set with the name of the current player, so you can use it immediately.&lt;br /&gt;
&lt;br /&gt;
  // Example :&lt;br /&gt;
  bga.log( _(&amp;quot;${player_name} draw a card from the deck&amp;quot;) );&lt;br /&gt;
&lt;br /&gt;
== Get / search game elements and their properties ==&lt;br /&gt;
&lt;br /&gt;
== bga.getElement( selector, (optionnal) fields ) ==&lt;br /&gt;
&lt;br /&gt;
Allow you to retrieve informations about one game element specified using &amp;quot;selector&amp;quot; argument.&lt;br /&gt;
&lt;br /&gt;
Return null if no element is found.&lt;br /&gt;
&lt;br /&gt;
Note : getElement throw an error if several elements matches the selector. If you want to retrieve several elements, you should use &amp;quot;getElements&amp;quot; instead of &amp;quot;getElement&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
The following examples are showing all the possible use of bga.getElement :&lt;br /&gt;
&lt;br /&gt;
  // Basic example :&lt;br /&gt;
  &lt;br /&gt;
  // Retrieve the ID of a game element using its name (&amp;quot;Deck&amp;quot;)&lt;br /&gt;
  var deck_id = bga.getElement( { name: &amp;quot;Deck&amp;quot; } );&lt;br /&gt;
  // Return : 1234  &lt;br /&gt;
&lt;br /&gt;
  // Examples using &amp;quot;field&amp;quot; parameter :&lt;br /&gt;
  &lt;br /&gt;
  // Retrieve a specific property from a game element using its name (&amp;quot;Deck&amp;quot;)&lt;br /&gt;
  var deck_id = bga.getElement( { name: &amp;quot;Deck&amp;quot; }, &#039;x&#039; );&lt;br /&gt;
  // Return : 20&lt;br /&gt;
  &lt;br /&gt;
  // Retrieve several properties from the previous element&lt;br /&gt;
  var deck_properties = bga.getElement( { name: &amp;quot;Deck&amp;quot; }, [&#039;name&#039;,&#039;id&#039;,&#039;parent&#039;, &#039;x&#039;,&#039;y&#039;,&#039;canShuffle&#039;] );&lt;br /&gt;
  // Return : { name:&#039;Deck&#039;, id:1234, parent:4321, x: 20, y:50, canShuffle: true }&lt;br /&gt;
  &lt;br /&gt;
  // Note : as you can see, getElement returns:&lt;br /&gt;
  //        _ the element ID by default, or&lt;br /&gt;
  //        _ a single value if you request a single field, or&lt;br /&gt;
  //        _ an object if you request several fields&lt;br /&gt;
&lt;br /&gt;
  // Examples using different &amp;quot;selector&amp;quot; paramter&lt;br /&gt;
  &lt;br /&gt;
  // Retrieve an element name from its id&lt;br /&gt;
  var deck_name = bga.getElement( { id: 1234 }, [&#039;name&#039;] );&lt;br /&gt;
  // Return : &amp;quot;Deck&amp;quot;&lt;br /&gt;
&lt;br /&gt;
  // Retrieve the last child element of another element&lt;br /&gt;
  // Here, we are requesting for elements who has element with ID=1234 (Deck) as their parent&lt;br /&gt;
  // Note the use of &amp;quot;limit:1&amp;quot; which allows us to retrieve only 1 element.&lt;br /&gt;
  var first_card_on_deck_id = bga.getElement( { parent: 1234, limit:1 } );&lt;br /&gt;
  //&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== bga.getElementById( id )===&lt;br /&gt;
&lt;br /&gt;
Get an object with all the properties of the element with specified ID.&lt;br /&gt;
&lt;br /&gt;
Throw an exception if the element does not exists.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===bga.getElementsByIds( ids )===&lt;br /&gt;
&lt;br /&gt;
Get all specified elements with an array of ids.&lt;br /&gt;
&lt;br /&gt;
Return an associative array (element_id =&amp;gt; element).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===bga.getElementsByParent( parent_id )===&lt;br /&gt;
&lt;br /&gt;
Get all children (ie : all elements contained) of the specified element_id.&lt;br /&gt;
&lt;br /&gt;
Ex : if you call getElementsByParent on a deck of cards, you&#039;ll get all cards.&lt;br /&gt;
&lt;br /&gt;
  // Example : Get all cards of a deck with name &amp;quot;mydeck&amp;quot;&lt;br /&gt;
  var cards = bga.getElementsByParent( bga.getElementByName( &#039;mydeck&#039; ) );&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===bga.getElementIdByName( name )===&lt;br /&gt;
&lt;br /&gt;
Get the ID of a Sandbox element from its name.&lt;br /&gt;
&lt;br /&gt;
Return null if there are no element with this name.&lt;br /&gt;
Throw an exception if there are more than 1 element with this name.&lt;br /&gt;
&lt;br /&gt;
  // Example :&lt;br /&gt;
  var chess_square = bga.getElementIdByName( &#039;h3&#039; );&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===bga.getElementsIdsByName( name )===&lt;br /&gt;
&lt;br /&gt;
Get the IDs of all Sandbox elements with this name.&lt;br /&gt;
&lt;br /&gt;
  // Example :&lt;br /&gt;
  var pawn_pieces_ids = bga.getElementsIdByName( &#039;pawn&#039; );&lt;br /&gt;
  &lt;br /&gt;
  // Result : [ 41, 42, 43, ... ]&lt;br /&gt;
&lt;br /&gt;
== Utility methods ==&lt;br /&gt;
&lt;br /&gt;
=== bga.isOn( element_id, parent_id ) ===&lt;br /&gt;
&lt;br /&gt;
Return true if &amp;quot;element_id&amp;quot; is a descendant of &amp;quot;parent_id&amp;quot; (ie : if element_id game element has been placed on parent_id game element).&lt;br /&gt;
&lt;br /&gt;
  // Example :&lt;br /&gt;
  if( bga.isOn( bga.getElementIfByName( &#039;Turn counter&#039; ), bga.getElementIfByName( &#039;Turn 6&#039; ) )&lt;br /&gt;
  {&lt;br /&gt;
     // Trigger game end&lt;br /&gt;
  }&lt;br /&gt;
&lt;br /&gt;
== Trigger most common game actions ==&lt;br /&gt;
&lt;br /&gt;
===moveElement( element_id, target_id )===&lt;br /&gt;
&lt;br /&gt;
Move element to specified target id.&lt;br /&gt;
&lt;br /&gt;
The exact destination of element depends on target &amp;quot;howToArrange&amp;quot; property (&amp;quot;How elements are arranged on it?&amp;quot; : spreaded/deck/...).&lt;br /&gt;
&lt;br /&gt;
  // Example :&lt;br /&gt;
  bga.moveElement( bga.getElementIdByName( &#039;Turn counter&#039; ), bga.getElementIdByName( &#039;Turn 3&#039; ) );&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Other functions ==&lt;br /&gt;
&lt;br /&gt;
=== pause( milliseconds ) ===&lt;br /&gt;
&lt;br /&gt;
Pause the client interface during a specified number of milliseconds.&lt;br /&gt;
&lt;br /&gt;
If you do not use bga.pause, all Sandbox game actions are executed immediately and synchronously.&lt;br /&gt;
&lt;br /&gt;
  // Example :&lt;br /&gt;
  bga.log( &amp;quot;1&amp;quot; );    // Will be displayed immediately on the log&lt;br /&gt;
  bga.pause( 3000 ); // pause during 3 seconds&lt;br /&gt;
  bga.log( &amp;quot;2&amp;quot; );    // Will be displayed after the 3 second on the log&lt;br /&gt;
  bga.log( &amp;quot;3&amp;quot; );    // Will be displayed right after the previous one, without delay.&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
All game actions performed after this call will&lt;/div&gt;</summary>
		<author><name>Sourisdudesert</name></author>
	</entry>
	<entry>
		<id>https://fa.doc.boardgamearena.com/index.php?title=SandboxScripts&amp;diff=2157</id>
		<title>SandboxScripts</title>
		<link rel="alternate" type="text/html" href="https://fa.doc.boardgamearena.com/index.php?title=SandboxScripts&amp;diff=2157"/>
		<updated>2017-01-04T18:04:13Z</updated>

		<summary type="html">&lt;p&gt;Sourisdudesert: /* Get / search game elements and their properties */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
This is the reference of functions you can call from your Sandbox scripts.&lt;br /&gt;
&lt;br /&gt;
= Javascript =&lt;br /&gt;
&lt;br /&gt;
BGA Sandbox scripts are written in Javascript.&lt;br /&gt;
&lt;br /&gt;
Using Javascript, you can write scripts to automate moves for your Sandbox games &amp;amp; provide rules reinforcement.&lt;br /&gt;
&lt;br /&gt;
Important : in the opposite of the most common usage of Javascript, Sandbox scripts are executed &#039;&#039;&#039;on server side&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
= BGA API =&lt;br /&gt;
&lt;br /&gt;
To interact with your BGA Sandbox game, we provide you an API.&lt;br /&gt;
&lt;br /&gt;
With this API, you can get properties values of game elements from the current game situation, modify them and/or trigger the game actions (ex : move this element here, flip this card, and so on).&lt;br /&gt;
&lt;br /&gt;
= Quick start =&lt;br /&gt;
&lt;br /&gt;
== Hello World Script ==&lt;br /&gt;
&lt;br /&gt;
From Sandbox editor &amp;quot;interface view&amp;quot; tab, select an element, and access to its property (top right icon).&lt;br /&gt;
&lt;br /&gt;
Go to &amp;quot;Scripts (advanced)&amp;quot; section.&lt;br /&gt;
&lt;br /&gt;
In front of &amp;quot;When this element is clicked&amp;quot;, enter &amp;quot;onMyClick&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
Close the window. Go to &amp;quot;script view&amp;quot; tab.&lt;br /&gt;
&lt;br /&gt;
Enter the following :&lt;br /&gt;
&lt;br /&gt;
 function onMyClick( element_id )&lt;br /&gt;
 {&lt;br /&gt;
    bga.log(&amp;quot;Hello world! You just clicked on element &amp;quot; + element_id + &amp;quot;. Congrats!&amp;quot;);&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
Save &amp;amp; publish your project, starts a test session, click on the previous element : your message appears in the log on the right!&lt;br /&gt;
&lt;br /&gt;
== Top useful tips ==&lt;br /&gt;
&lt;br /&gt;
* You don&#039;t have to save&amp;amp;publish from the Sandbox editor for each modification of your script : each time you save your script (control+S), the script used for all test sessions is updated. Note that the production version on BGA is of course NOT updated until you explicitly save&amp;amp;publish again your project.&lt;br /&gt;
&lt;br /&gt;
* Alternatively to bga.log(), you can use bga.exit( &amp;quot;my message&amp;quot; ) to debug your script. With bga.exit, the script execution immediately stops and all previous game changes are cancelled, so this is very practical to try and retry an action until your script is fine.&lt;br /&gt;
&lt;br /&gt;
* We advise you to develop first a full playable version of the game without the scripts, and THEN to script it.&lt;br /&gt;
&lt;br /&gt;
* This is not mandatory to script the full game! You can start by automate most painful game actions first, publish the game, and then continue later :)&lt;br /&gt;
&lt;br /&gt;
= Functions you can use in your Sandbox scripts=&lt;br /&gt;
&lt;br /&gt;
== Debugging functions ==&lt;br /&gt;
&lt;br /&gt;
=== bga.trace( txt / obj ) ===&lt;br /&gt;
&lt;br /&gt;
Write something immediately in the BGA log (on the right of the screen).&lt;br /&gt;
&lt;br /&gt;
This is the most practical way to debug your script :)&lt;br /&gt;
&lt;br /&gt;
Important : bga.trace is for debugging purpose only and won&#039;t be displayed on production.&lt;br /&gt;
&lt;br /&gt;
Note : you can also pass an object in parameter. This will dump the content of this object in the log.&lt;br /&gt;
&lt;br /&gt;
Note : in the opposite of bga.log, bga.trace is NOT cancelled if the game action failed (after a call to bga.cancel or bga.error). This makes bga.trace very practical to debug a game action that failed, and for this reason you should probably NEVER use bga.log for debugging purpose.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
  // Example : write &amp;quot;Hello world&amp;quot; in the log&lt;br /&gt;
  bga.trace( &amp;quot;Hello world&amp;quot; );&lt;br /&gt;
&lt;br /&gt;
  // Example : dump an associative array in the log&lt;br /&gt;
  bga.trace( { mykey: &#039;myvalue&#039;, another_key: &#039;another_value&#039; } );&lt;br /&gt;
&lt;br /&gt;
=== bga.exit( txt / obj ) ===&lt;br /&gt;
&lt;br /&gt;
Stop the script immediately, display the &amp;quot;txt&amp;quot; messages and cancel (ie : rollback) on every previous API call except bga.trace :&lt;br /&gt;
&lt;br /&gt;
ALL previous BGA api call are canceled and there will be no visible changes on the interface (ex : no moves, no visible property changes, ...). Only &amp;quot;bga.trace&amp;quot; API commands are kept so you can debug.&lt;br /&gt;
&lt;br /&gt;
bga.exit is very practical when you want to repeat a game action again and again to debug it : with a call to bga.exit at the end of your script, you make sure that your game situation will be kept unchanged after each test.&lt;br /&gt;
&lt;br /&gt;
  // Example :&lt;br /&gt;
  bga.exit( &amp;quot;My script is stopped by this call&amp;quot; );&lt;br /&gt;
&lt;br /&gt;
  // Example with dumping a javascript variable&lt;br /&gt;
  bga.exit( my_variable_to_dump );&lt;br /&gt;
&lt;br /&gt;
== Cancelling a game action ==&lt;br /&gt;
&lt;br /&gt;
=== bga.cancel( txt ) ===&lt;br /&gt;
&lt;br /&gt;
This is the function to use when a player is doing something against game rules.&lt;br /&gt;
&lt;br /&gt;
The text message in parameter will be displayed to this player as a &amp;quot;red message&amp;quot;, so he/she can understand the rule.&lt;br /&gt;
&lt;br /&gt;
All previous BGA api call are cancelled, and there will be no visible changes on the interface.&lt;br /&gt;
&lt;br /&gt;
   // Example :&lt;br /&gt;
   bga.cancel( _(&amp;quot;You cannot move this piece here&amp;quot;) );&lt;br /&gt;
&lt;br /&gt;
Note : most of the time, you should wrap your text inside a _() translation marker to make this string translatable.&lt;br /&gt;
&lt;br /&gt;
=== bga.error( text ) ===&lt;br /&gt;
&lt;br /&gt;
This is the function to use when some unexpected error happens in your script.&lt;br /&gt;
&lt;br /&gt;
The text message will be displayed to user, with mention &amp;quot;Unexpected error&amp;quot;. The player will be incited to fill a bug report. The purpose of the message is to help you to identify the bug.&lt;br /&gt;
&lt;br /&gt;
All previous BGA api call are cancelled, and there will be no visible changes on the interface.&lt;br /&gt;
&lt;br /&gt;
   // Example :&lt;br /&gt;
   if( card_picked === null )&lt;br /&gt;
   {&lt;br /&gt;
       bga.error( &amp;quot;Cannot find a card to pick !&amp;quot; );&lt;br /&gt;
   }&lt;br /&gt;
&lt;br /&gt;
Note : you should NEVER wrap text inside bga.error with _() translation marker, because unexpected error should not be translate (so you can eventually recognize them when reported by players in bug report).&lt;br /&gt;
&lt;br /&gt;
== Game log (history) ==&lt;br /&gt;
&lt;br /&gt;
=== bga.log( txt, (optional) args ) ===&lt;br /&gt;
&lt;br /&gt;
Write something in the BGA log on the right.&lt;br /&gt;
&lt;br /&gt;
  // Example : simple log&lt;br /&gt;
  bga.log( _(&amp;quot;A new round starts&amp;quot;) );&lt;br /&gt;
&lt;br /&gt;
You may add arguments to your log, like this :&lt;br /&gt;
&lt;br /&gt;
  // Example: log with argument to display a card name.&lt;br /&gt;
  //          In this example, variable &amp;quot;event_name&amp;quot; is specified afterwards.&lt;br /&gt;
  //          Note that using this, game translators only have to translate one &amp;quot;Event XXX is triggered&amp;quot; string for all possible events.&lt;br /&gt;
  bga.log( _(&amp;quot;Event ${event_name} is triggered&amp;quot;), {  event_name: _( &amp;quot;Armageddon&amp;quot; ) } ) );&lt;br /&gt;
&lt;br /&gt;
Note that argument &amp;quot;player_name&amp;quot; is ALWAYS pre-set with the name of the current player, so you can use it immediately.&lt;br /&gt;
&lt;br /&gt;
  // Example :&lt;br /&gt;
  bga.log( _(&amp;quot;${player_name} draw a card from the deck&amp;quot;) );&lt;br /&gt;
&lt;br /&gt;
== Get / search game elements and their properties ==&lt;br /&gt;
&lt;br /&gt;
== bga.getElement( selector, (optionnal) fields ) ==&lt;br /&gt;
&lt;br /&gt;
Allow you to retrieve informations about one game element specified using &amp;quot;selector&amp;quot; argument.&lt;br /&gt;
&lt;br /&gt;
Return null if no element is found.&lt;br /&gt;
&lt;br /&gt;
Note : getElement throw an error if several elements matches the selector. If you want to retrieve several elements, you should use &amp;quot;getElements&amp;quot; instead of &amp;quot;getElement&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
The following examples are showing all the possible use of bga.getElement :&lt;br /&gt;
&lt;br /&gt;
  // Examples :&lt;br /&gt;
  &lt;br /&gt;
  // Retrieve the ID of a game element using its name (&amp;quot;Deck&amp;quot;)&lt;br /&gt;
  var deck_id = bga.getElement( { name: &amp;quot;Deck&amp;quot; } );&lt;br /&gt;
  &lt;br /&gt;
  // Retrieve several properties from the previous element&lt;br /&gt;
  var deck_properties = bga.getElement( { name: &amp;quot;Deck&amp;quot; }, [&#039;name&#039;,&#039;id&#039;,&#039;parent&#039;,&#039;canShuffle&#039;] );&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== bga.getElementById( id )===&lt;br /&gt;
&lt;br /&gt;
Get an object with all the properties of the element with specified ID.&lt;br /&gt;
&lt;br /&gt;
Throw an exception if the element does not exists.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===bga.getElementsByIds( ids )===&lt;br /&gt;
&lt;br /&gt;
Get all specified elements with an array of ids.&lt;br /&gt;
&lt;br /&gt;
Return an associative array (element_id =&amp;gt; element).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===bga.getElementsByParent( parent_id )===&lt;br /&gt;
&lt;br /&gt;
Get all children (ie : all elements contained) of the specified element_id.&lt;br /&gt;
&lt;br /&gt;
Ex : if you call getElementsByParent on a deck of cards, you&#039;ll get all cards.&lt;br /&gt;
&lt;br /&gt;
  // Example : Get all cards of a deck with name &amp;quot;mydeck&amp;quot;&lt;br /&gt;
  var cards = bga.getElementsByParent( bga.getElementByName( &#039;mydeck&#039; ) );&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===bga.getElementIdByName( name )===&lt;br /&gt;
&lt;br /&gt;
Get the ID of a Sandbox element from its name.&lt;br /&gt;
&lt;br /&gt;
Return null if there are no element with this name.&lt;br /&gt;
Throw an exception if there are more than 1 element with this name.&lt;br /&gt;
&lt;br /&gt;
  // Example :&lt;br /&gt;
  var chess_square = bga.getElementIdByName( &#039;h3&#039; );&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===bga.getElementsIdsByName( name )===&lt;br /&gt;
&lt;br /&gt;
Get the IDs of all Sandbox elements with this name.&lt;br /&gt;
&lt;br /&gt;
  // Example :&lt;br /&gt;
  var pawn_pieces_ids = bga.getElementsIdByName( &#039;pawn&#039; );&lt;br /&gt;
  &lt;br /&gt;
  // Result : [ 41, 42, 43, ... ]&lt;br /&gt;
&lt;br /&gt;
== Utility methods ==&lt;br /&gt;
&lt;br /&gt;
=== bga.isOn( element_id, parent_id ) ===&lt;br /&gt;
&lt;br /&gt;
Return true if &amp;quot;element_id&amp;quot; is a descendant of &amp;quot;parent_id&amp;quot; (ie : if element_id game element has been placed on parent_id game element).&lt;br /&gt;
&lt;br /&gt;
  // Example :&lt;br /&gt;
  if( bga.isOn( bga.getElementIfByName( &#039;Turn counter&#039; ), bga.getElementIfByName( &#039;Turn 6&#039; ) )&lt;br /&gt;
  {&lt;br /&gt;
     // Trigger game end&lt;br /&gt;
  }&lt;br /&gt;
&lt;br /&gt;
== Trigger most common game actions ==&lt;br /&gt;
&lt;br /&gt;
===moveElement( element_id, target_id )===&lt;br /&gt;
&lt;br /&gt;
Move element to specified target id.&lt;br /&gt;
&lt;br /&gt;
The exact destination of element depends on target &amp;quot;howToArrange&amp;quot; property (&amp;quot;How elements are arranged on it?&amp;quot; : spreaded/deck/...).&lt;br /&gt;
&lt;br /&gt;
  // Example :&lt;br /&gt;
  bga.moveElement( bga.getElementIdByName( &#039;Turn counter&#039; ), bga.getElementIdByName( &#039;Turn 3&#039; ) );&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Other functions ==&lt;br /&gt;
&lt;br /&gt;
=== pause( milliseconds ) ===&lt;br /&gt;
&lt;br /&gt;
Pause the client interface during a specified number of milliseconds.&lt;br /&gt;
&lt;br /&gt;
If you do not use bga.pause, all Sandbox game actions are executed immediately and synchronously.&lt;br /&gt;
&lt;br /&gt;
  // Example :&lt;br /&gt;
  bga.log( &amp;quot;1&amp;quot; );    // Will be displayed immediately on the log&lt;br /&gt;
  bga.pause( 3000 ); // pause during 3 seconds&lt;br /&gt;
  bga.log( &amp;quot;2&amp;quot; );    // Will be displayed after the 3 second on the log&lt;br /&gt;
  bga.log( &amp;quot;3&amp;quot; );    // Will be displayed right after the previous one, without delay.&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
All game actions performed after this call will&lt;/div&gt;</summary>
		<author><name>Sourisdudesert</name></author>
	</entry>
	<entry>
		<id>https://fa.doc.boardgamearena.com/index.php?title=SandboxScripts&amp;diff=2156</id>
		<title>SandboxScripts</title>
		<link rel="alternate" type="text/html" href="https://fa.doc.boardgamearena.com/index.php?title=SandboxScripts&amp;diff=2156"/>
		<updated>2017-01-04T17:58:04Z</updated>

		<summary type="html">&lt;p&gt;Sourisdudesert: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
This is the reference of functions you can call from your Sandbox scripts.&lt;br /&gt;
&lt;br /&gt;
= Javascript =&lt;br /&gt;
&lt;br /&gt;
BGA Sandbox scripts are written in Javascript.&lt;br /&gt;
&lt;br /&gt;
Using Javascript, you can write scripts to automate moves for your Sandbox games &amp;amp; provide rules reinforcement.&lt;br /&gt;
&lt;br /&gt;
Important : in the opposite of the most common usage of Javascript, Sandbox scripts are executed &#039;&#039;&#039;on server side&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
= BGA API =&lt;br /&gt;
&lt;br /&gt;
To interact with your BGA Sandbox game, we provide you an API.&lt;br /&gt;
&lt;br /&gt;
With this API, you can get properties values of game elements from the current game situation, modify them and/or trigger the game actions (ex : move this element here, flip this card, and so on).&lt;br /&gt;
&lt;br /&gt;
= Quick start =&lt;br /&gt;
&lt;br /&gt;
== Hello World Script ==&lt;br /&gt;
&lt;br /&gt;
From Sandbox editor &amp;quot;interface view&amp;quot; tab, select an element, and access to its property (top right icon).&lt;br /&gt;
&lt;br /&gt;
Go to &amp;quot;Scripts (advanced)&amp;quot; section.&lt;br /&gt;
&lt;br /&gt;
In front of &amp;quot;When this element is clicked&amp;quot;, enter &amp;quot;onMyClick&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
Close the window. Go to &amp;quot;script view&amp;quot; tab.&lt;br /&gt;
&lt;br /&gt;
Enter the following :&lt;br /&gt;
&lt;br /&gt;
 function onMyClick( element_id )&lt;br /&gt;
 {&lt;br /&gt;
    bga.log(&amp;quot;Hello world! You just clicked on element &amp;quot; + element_id + &amp;quot;. Congrats!&amp;quot;);&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
Save &amp;amp; publish your project, starts a test session, click on the previous element : your message appears in the log on the right!&lt;br /&gt;
&lt;br /&gt;
== Top useful tips ==&lt;br /&gt;
&lt;br /&gt;
* You don&#039;t have to save&amp;amp;publish from the Sandbox editor for each modification of your script : each time you save your script (control+S), the script used for all test sessions is updated. Note that the production version on BGA is of course NOT updated until you explicitly save&amp;amp;publish again your project.&lt;br /&gt;
&lt;br /&gt;
* Alternatively to bga.log(), you can use bga.exit( &amp;quot;my message&amp;quot; ) to debug your script. With bga.exit, the script execution immediately stops and all previous game changes are cancelled, so this is very practical to try and retry an action until your script is fine.&lt;br /&gt;
&lt;br /&gt;
* We advise you to develop first a full playable version of the game without the scripts, and THEN to script it.&lt;br /&gt;
&lt;br /&gt;
* This is not mandatory to script the full game! You can start by automate most painful game actions first, publish the game, and then continue later :)&lt;br /&gt;
&lt;br /&gt;
= Functions you can use in your Sandbox scripts=&lt;br /&gt;
&lt;br /&gt;
== Debugging functions ==&lt;br /&gt;
&lt;br /&gt;
=== bga.trace( txt / obj ) ===&lt;br /&gt;
&lt;br /&gt;
Write something immediately in the BGA log (on the right of the screen).&lt;br /&gt;
&lt;br /&gt;
This is the most practical way to debug your script :)&lt;br /&gt;
&lt;br /&gt;
Important : bga.trace is for debugging purpose only and won&#039;t be displayed on production.&lt;br /&gt;
&lt;br /&gt;
Note : you can also pass an object in parameter. This will dump the content of this object in the log.&lt;br /&gt;
&lt;br /&gt;
Note : in the opposite of bga.log, bga.trace is NOT cancelled if the game action failed (after a call to bga.cancel or bga.error). This makes bga.trace very practical to debug a game action that failed, and for this reason you should probably NEVER use bga.log for debugging purpose.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
  // Example : write &amp;quot;Hello world&amp;quot; in the log&lt;br /&gt;
  bga.trace( &amp;quot;Hello world&amp;quot; );&lt;br /&gt;
&lt;br /&gt;
  // Example : dump an associative array in the log&lt;br /&gt;
  bga.trace( { mykey: &#039;myvalue&#039;, another_key: &#039;another_value&#039; } );&lt;br /&gt;
&lt;br /&gt;
=== bga.exit( txt / obj ) ===&lt;br /&gt;
&lt;br /&gt;
Stop the script immediately, display the &amp;quot;txt&amp;quot; messages and cancel (ie : rollback) on every previous API call except bga.trace :&lt;br /&gt;
&lt;br /&gt;
ALL previous BGA api call are canceled and there will be no visible changes on the interface (ex : no moves, no visible property changes, ...). Only &amp;quot;bga.trace&amp;quot; API commands are kept so you can debug.&lt;br /&gt;
&lt;br /&gt;
bga.exit is very practical when you want to repeat a game action again and again to debug it : with a call to bga.exit at the end of your script, you make sure that your game situation will be kept unchanged after each test.&lt;br /&gt;
&lt;br /&gt;
  // Example :&lt;br /&gt;
  bga.exit( &amp;quot;My script is stopped by this call&amp;quot; );&lt;br /&gt;
&lt;br /&gt;
  // Example with dumping a javascript variable&lt;br /&gt;
  bga.exit( my_variable_to_dump );&lt;br /&gt;
&lt;br /&gt;
== Cancelling a game action ==&lt;br /&gt;
&lt;br /&gt;
=== bga.cancel( txt ) ===&lt;br /&gt;
&lt;br /&gt;
This is the function to use when a player is doing something against game rules.&lt;br /&gt;
&lt;br /&gt;
The text message in parameter will be displayed to this player as a &amp;quot;red message&amp;quot;, so he/she can understand the rule.&lt;br /&gt;
&lt;br /&gt;
All previous BGA api call are cancelled, and there will be no visible changes on the interface.&lt;br /&gt;
&lt;br /&gt;
   // Example :&lt;br /&gt;
   bga.cancel( _(&amp;quot;You cannot move this piece here&amp;quot;) );&lt;br /&gt;
&lt;br /&gt;
Note : most of the time, you should wrap your text inside a _() translation marker to make this string translatable.&lt;br /&gt;
&lt;br /&gt;
=== bga.error( text ) ===&lt;br /&gt;
&lt;br /&gt;
This is the function to use when some unexpected error happens in your script.&lt;br /&gt;
&lt;br /&gt;
The text message will be displayed to user, with mention &amp;quot;Unexpected error&amp;quot;. The player will be incited to fill a bug report. The purpose of the message is to help you to identify the bug.&lt;br /&gt;
&lt;br /&gt;
All previous BGA api call are cancelled, and there will be no visible changes on the interface.&lt;br /&gt;
&lt;br /&gt;
   // Example :&lt;br /&gt;
   if( card_picked === null )&lt;br /&gt;
   {&lt;br /&gt;
       bga.error( &amp;quot;Cannot find a card to pick !&amp;quot; );&lt;br /&gt;
   }&lt;br /&gt;
&lt;br /&gt;
Note : you should NEVER wrap text inside bga.error with _() translation marker, because unexpected error should not be translate (so you can eventually recognize them when reported by players in bug report).&lt;br /&gt;
&lt;br /&gt;
== Game log (history) ==&lt;br /&gt;
&lt;br /&gt;
=== bga.log( txt, (optional) args ) ===&lt;br /&gt;
&lt;br /&gt;
Write something in the BGA log on the right.&lt;br /&gt;
&lt;br /&gt;
  // Example : simple log&lt;br /&gt;
  bga.log( _(&amp;quot;A new round starts&amp;quot;) );&lt;br /&gt;
&lt;br /&gt;
You may add arguments to your log, like this :&lt;br /&gt;
&lt;br /&gt;
  // Example: log with argument to display a card name.&lt;br /&gt;
  //          In this example, variable &amp;quot;event_name&amp;quot; is specified afterwards.&lt;br /&gt;
  //          Note that using this, game translators only have to translate one &amp;quot;Event XXX is triggered&amp;quot; string for all possible events.&lt;br /&gt;
  bga.log( _(&amp;quot;Event ${event_name} is triggered&amp;quot;), {  event_name: _( &amp;quot;Armageddon&amp;quot; ) } ) );&lt;br /&gt;
&lt;br /&gt;
Note that argument &amp;quot;player_name&amp;quot; is ALWAYS pre-set with the name of the current player, so you can use it immediately.&lt;br /&gt;
&lt;br /&gt;
  // Example :&lt;br /&gt;
  bga.log( _(&amp;quot;${player_name} draw a card from the deck&amp;quot;) );&lt;br /&gt;
&lt;br /&gt;
== Get / search game elements and their properties ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== bga.getElementById( id )===&lt;br /&gt;
&lt;br /&gt;
Get an object with all the properties of the element with specified ID.&lt;br /&gt;
&lt;br /&gt;
Throw an exception if the element does not exists.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===bga.getElementsByIds( ids )===&lt;br /&gt;
&lt;br /&gt;
Get all specified elements with an array of ids.&lt;br /&gt;
&lt;br /&gt;
Return an associative array (element_id =&amp;gt; element).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===bga.getElementsByParent( parent_id )===&lt;br /&gt;
&lt;br /&gt;
Get all children (ie : all elements contained) of the specified element_id.&lt;br /&gt;
&lt;br /&gt;
Ex : if you call getElementsByParent on a deck of cards, you&#039;ll get all cards.&lt;br /&gt;
&lt;br /&gt;
  // Example : Get all cards of a deck with name &amp;quot;mydeck&amp;quot;&lt;br /&gt;
  var cards = bga.getElementsByParent( bga.getElementByName( &#039;mydeck&#039; ) );&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===bga.getElementIdByName( name )===&lt;br /&gt;
&lt;br /&gt;
Get the ID of a Sandbox element from its name.&lt;br /&gt;
&lt;br /&gt;
Return null if there are no element with this name.&lt;br /&gt;
Throw an exception if there are more than 1 element with this name.&lt;br /&gt;
&lt;br /&gt;
  // Example :&lt;br /&gt;
  var chess_square = bga.getElementIdByName( &#039;h3&#039; );&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===bga.getElementsIdsByName( name )===&lt;br /&gt;
&lt;br /&gt;
Get the IDs of all Sandbox elements with this name.&lt;br /&gt;
&lt;br /&gt;
  // Example :&lt;br /&gt;
  var pawn_pieces_ids = bga.getElementsIdByName( &#039;pawn&#039; );&lt;br /&gt;
  &lt;br /&gt;
  // Result : [ 41, 42, 43, ... ]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Utility methods ==&lt;br /&gt;
&lt;br /&gt;
=== bga.isOn( element_id, parent_id ) ===&lt;br /&gt;
&lt;br /&gt;
Return true if &amp;quot;element_id&amp;quot; is a descendant of &amp;quot;parent_id&amp;quot; (ie : if element_id game element has been placed on parent_id game element).&lt;br /&gt;
&lt;br /&gt;
  // Example :&lt;br /&gt;
  if( bga.isOn( bga.getElementIfByName( &#039;Turn counter&#039; ), bga.getElementIfByName( &#039;Turn 6&#039; ) )&lt;br /&gt;
  {&lt;br /&gt;
     // Trigger game end&lt;br /&gt;
  }&lt;br /&gt;
&lt;br /&gt;
== Trigger most common game actions ==&lt;br /&gt;
&lt;br /&gt;
===moveElement( element_id, target_id )===&lt;br /&gt;
&lt;br /&gt;
Move element to specified target id.&lt;br /&gt;
&lt;br /&gt;
The exact destination of element depends on target &amp;quot;howToArrange&amp;quot; property (&amp;quot;How elements are arranged on it?&amp;quot; : spreaded/deck/...).&lt;br /&gt;
&lt;br /&gt;
  // Example :&lt;br /&gt;
  bga.moveElement( bga.getElementIdByName( &#039;Turn counter&#039; ), bga.getElementIdByName( &#039;Turn 3&#039; ) );&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Other functions ==&lt;br /&gt;
&lt;br /&gt;
=== pause( milliseconds ) ===&lt;br /&gt;
&lt;br /&gt;
Pause the client interface during a specified number of milliseconds.&lt;br /&gt;
&lt;br /&gt;
If you do not use bga.pause, all Sandbox game actions are executed immediately and synchronously.&lt;br /&gt;
&lt;br /&gt;
  // Example :&lt;br /&gt;
  bga.log( &amp;quot;1&amp;quot; );    // Will be displayed immediately on the log&lt;br /&gt;
  bga.pause( 3000 ); // pause during 3 seconds&lt;br /&gt;
  bga.log( &amp;quot;2&amp;quot; );    // Will be displayed after the 3 second on the log&lt;br /&gt;
  bga.log( &amp;quot;3&amp;quot; );    // Will be displayed right after the previous one, without delay.&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
All game actions performed after this call will&lt;/div&gt;</summary>
		<author><name>Sourisdudesert</name></author>
	</entry>
	<entry>
		<id>https://fa.doc.boardgamearena.com/index.php?title=SandboxScripts&amp;diff=2155</id>
		<title>SandboxScripts</title>
		<link rel="alternate" type="text/html" href="https://fa.doc.boardgamearena.com/index.php?title=SandboxScripts&amp;diff=2155"/>
		<updated>2017-01-04T17:53:52Z</updated>

		<summary type="html">&lt;p&gt;Sourisdudesert: /* Top useful tips */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
This is the reference of functions you can call from your Sandbox scripts.&lt;br /&gt;
&lt;br /&gt;
= Javascript =&lt;br /&gt;
&lt;br /&gt;
BGA Sandbox scripts are written in Javascript.&lt;br /&gt;
&lt;br /&gt;
Using Javascript, you can write scripts to automate moves for your Sandbox games &amp;amp; provide rules reinforcement.&lt;br /&gt;
&lt;br /&gt;
Important : in the opposite of the most common usage of Javascript, Sandbox scripts are executed &#039;&#039;&#039;on server side&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
= BGA API =&lt;br /&gt;
&lt;br /&gt;
To interact with your BGA Sandbox game, we provide you an API.&lt;br /&gt;
&lt;br /&gt;
With this API, you can get properties values of game elements from the current game situation, modify them and/or trigger the game actions (ex : move this element here, flip this card, and so on).&lt;br /&gt;
&lt;br /&gt;
= Quick start =&lt;br /&gt;
&lt;br /&gt;
== Hello World Script ==&lt;br /&gt;
&lt;br /&gt;
From Sandbox editor &amp;quot;interface view&amp;quot; tab, select an element, and access to its property (top right icon).&lt;br /&gt;
&lt;br /&gt;
Go to &amp;quot;Scripts (advanced)&amp;quot; section.&lt;br /&gt;
&lt;br /&gt;
In front of &amp;quot;When this element is clicked&amp;quot;, enter &amp;quot;onMyClick&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
Close the window. Go to &amp;quot;script view&amp;quot; tab.&lt;br /&gt;
&lt;br /&gt;
Enter the following :&lt;br /&gt;
&lt;br /&gt;
 function onMyClick( element_id )&lt;br /&gt;
 {&lt;br /&gt;
    bga.log(&amp;quot;Hello world! You just clicked on element &amp;quot; + element_id + &amp;quot;. Congrats!&amp;quot;);&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
Save &amp;amp; publish your project, starts a test session, click on the previous element : your message appears in the log on the right!&lt;br /&gt;
&lt;br /&gt;
== Top useful tips ==&lt;br /&gt;
&lt;br /&gt;
* You don&#039;t have to save&amp;amp;publish from the Sandbox editor for each modification of your script : each time you save your script (control+S), the script used for all test sessions is updated. Note that the production version on BGA is of course NOT updated until you explicitly save&amp;amp;publish again your project.&lt;br /&gt;
&lt;br /&gt;
* Alternatively to bga.log(), you can use bga.exit( &amp;quot;my message&amp;quot; ) to debug your script. With bga.exit, the script execution immediately stops and all previous game changes are cancelled, so this is very practical to try and retry an action until your script is fine.&lt;br /&gt;
&lt;br /&gt;
* We advise you to develop first a full playable version of the game without the scripts, and THEN to script it.&lt;br /&gt;
&lt;br /&gt;
* This is not mandatory to script the full game! You can start by automate most painful game actions first, publish the game, and then continue later :)&lt;br /&gt;
&lt;br /&gt;
= Functions you can use in your Sandbox scripts=&lt;br /&gt;
&lt;br /&gt;
== Debugging functions ==&lt;br /&gt;
&lt;br /&gt;
=== bga.trace( txt / obj ) ===&lt;br /&gt;
&lt;br /&gt;
Write something immediately in the BGA log (on the right of the screen).&lt;br /&gt;
&lt;br /&gt;
This is the most practical way to debug your script :)&lt;br /&gt;
&lt;br /&gt;
Important : bga.trace is for debugging purpose only and won&#039;t be displayed on production.&lt;br /&gt;
&lt;br /&gt;
Note : you can also pass an object in parameter. This will dump the content of this object in the log.&lt;br /&gt;
&lt;br /&gt;
Note : in the opposite of bga.log, bga.trace is NOT cancelled if the game action failed (after a call to bga.cancel or bga.error). This makes bga.trace very practical to debug a game action that failed, and for this reason you should probably NEVER use bga.log for debugging purpose.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
  // Example : write &amp;quot;Hello world&amp;quot; in the log&lt;br /&gt;
  bga.trace( &amp;quot;Hello world&amp;quot; );&lt;br /&gt;
&lt;br /&gt;
  // Example : dump an associative array in the log&lt;br /&gt;
  bga.trace( { mykey: &#039;myvalue&#039;, another_key: &#039;another_value&#039; } );&lt;br /&gt;
&lt;br /&gt;
=== bga.exit( txt / obj ) ===&lt;br /&gt;
&lt;br /&gt;
Stop the script immediately, display the &amp;quot;txt&amp;quot; messages and cancel (ie : rollback) on every previous API call except bga.trace :&lt;br /&gt;
&lt;br /&gt;
ALL previous BGA api call are canceled and there will be no visible changes on the interface (ex : no moves, no visible property changes, ...). Only &amp;quot;bga.trace&amp;quot; API commands are kept so you can debug.&lt;br /&gt;
&lt;br /&gt;
bga.exit is very practical when you want to repeat a game action again and again to debug it : with a call to bga.exit at the end of your script, you make sure that your game situation will be kept unchanged after each test.&lt;br /&gt;
&lt;br /&gt;
  // Example :&lt;br /&gt;
  bga.exit( &amp;quot;My script is stopped by this call&amp;quot; );&lt;br /&gt;
&lt;br /&gt;
  // Example with dumping a javascript variable&lt;br /&gt;
  bga.exit( my_variable_to_dump );&lt;br /&gt;
&lt;br /&gt;
== Cancelling a game action ==&lt;br /&gt;
&lt;br /&gt;
=== bga.cancel( txt ) ===&lt;br /&gt;
&lt;br /&gt;
This is the function to use when a player is doing something against game rules.&lt;br /&gt;
&lt;br /&gt;
The text message in parameter will be displayed to this player as a &amp;quot;red message&amp;quot;, so he/she can understand the rule.&lt;br /&gt;
&lt;br /&gt;
All previous BGA api call are cancelled, and there will be no visible changes on the interface.&lt;br /&gt;
&lt;br /&gt;
   // Example :&lt;br /&gt;
   bga.cancel( _(&amp;quot;You cannot move this piece here&amp;quot;) );&lt;br /&gt;
&lt;br /&gt;
Note : most of the time, you should wrap your text inside a _() translation marker to make this string translatable.&lt;br /&gt;
&lt;br /&gt;
=== bga.error( text ) ===&lt;br /&gt;
&lt;br /&gt;
This is the function to use when some unexpected error happens in your script.&lt;br /&gt;
&lt;br /&gt;
The text message will be displayed to user, with mention &amp;quot;Unexpected error&amp;quot;. The player will be incited to fill a bug report. The purpose of the message is to help you to identify the bug.&lt;br /&gt;
&lt;br /&gt;
All previous BGA api call are cancelled, and there will be no visible changes on the interface.&lt;br /&gt;
&lt;br /&gt;
   // Example :&lt;br /&gt;
   if( card_picked === null )&lt;br /&gt;
   {&lt;br /&gt;
       bga.error( &amp;quot;Cannot find a card to pick !&amp;quot; );&lt;br /&gt;
   }&lt;br /&gt;
&lt;br /&gt;
Note : you should NEVER wrap text inside bga.error with _() translation marker, because unexpected error should not be translate (so you can eventually recognize them when reported by players in bug report).&lt;br /&gt;
&lt;br /&gt;
== Game log (history) ==&lt;br /&gt;
&lt;br /&gt;
=== bga.log( txt, (optional) args ) ===&lt;br /&gt;
&lt;br /&gt;
Write something in the BGA log on the right.&lt;br /&gt;
&lt;br /&gt;
  // Example : simple log&lt;br /&gt;
  bga.log( _(&amp;quot;A new round starts&amp;quot;) );&lt;br /&gt;
&lt;br /&gt;
You may add arguments to your log, like this :&lt;br /&gt;
&lt;br /&gt;
  // Example: log with argument to display a card name.&lt;br /&gt;
  //          In this example, variable &amp;quot;event_name&amp;quot; is specified afterwards.&lt;br /&gt;
  //          Note that using this, game translators only have to translate one &amp;quot;Event XXX is triggered&amp;quot; string for all possible events.&lt;br /&gt;
  bga.log( _(&amp;quot;Event ${event_name} is triggered&amp;quot;), {  event_name: _( &amp;quot;Armageddon&amp;quot; ) } ) );&lt;br /&gt;
&lt;br /&gt;
Note that argument &amp;quot;player_name&amp;quot; is ALWAYS pre-set with the name of the current player, so you can use it immediately.&lt;br /&gt;
&lt;br /&gt;
  // Example :&lt;br /&gt;
  bga.log( _(&amp;quot;${player_name} draw a card from the deck&amp;quot;) );&lt;br /&gt;
&lt;br /&gt;
== Get / search game elements and their properties ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== bga.getElementById( id )===&lt;br /&gt;
&lt;br /&gt;
Get an object with all the properties of the element with specified ID.&lt;br /&gt;
&lt;br /&gt;
Throw an exception if the element does not exists.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===bga.getElementsByIds( ids )===&lt;br /&gt;
&lt;br /&gt;
Get all specified elements with an array of ids.&lt;br /&gt;
&lt;br /&gt;
Return an associative array (element_id =&amp;gt; element).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===bga.getElementsByParent( parent_id )===&lt;br /&gt;
&lt;br /&gt;
Get all children (ie : all elements contained) of the specified element_id.&lt;br /&gt;
&lt;br /&gt;
Ex : if you call getElementsByParent on a deck of cards, you&#039;ll get all cards.&lt;br /&gt;
&lt;br /&gt;
  // Example : Get all cards of a deck with name &amp;quot;mydeck&amp;quot;&lt;br /&gt;
  var cards = bga.getElementsByParent( bga.getElementByName( &#039;mydeck&#039; ) );&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===bga.getElementIdByName( name )===&lt;br /&gt;
&lt;br /&gt;
Get the ID of a Sandbox element from its name.&lt;br /&gt;
&lt;br /&gt;
Return null if there are no element with this name.&lt;br /&gt;
Throw an exception if there are more than 1 element with this name.&lt;br /&gt;
&lt;br /&gt;
  // Example :&lt;br /&gt;
  var chess_square = bga.getElementIdByName( &#039;h3&#039; );&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===bga.getElementsIdsByName( name )===&lt;br /&gt;
&lt;br /&gt;
Get the IDs of all Sandbox elements with this name.&lt;br /&gt;
&lt;br /&gt;
  // Example :&lt;br /&gt;
  var pawn_pieces_ids = bga.getElementsIdByName( &#039;pawn&#039; );&lt;br /&gt;
  &lt;br /&gt;
  // Result : [ 41, 42, 43, ... ]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Utility methods ==&lt;br /&gt;
&lt;br /&gt;
=== bga.isOn( element_id, parent_id ) ===&lt;br /&gt;
&lt;br /&gt;
Return true if &amp;quot;element_id&amp;quot; is a descendant of &amp;quot;parent_id&amp;quot; (ie : if element_id game element has been placed on parent_id game element).&lt;br /&gt;
&lt;br /&gt;
  // Example :&lt;br /&gt;
  if( bga.isOn( bga.getElementIfByName( &#039;Turn counter&#039; ), bga.getElementIfByName( &#039;Turn 6&#039; ) )&lt;br /&gt;
  {&lt;br /&gt;
     // Trigger game end&lt;br /&gt;
  }&lt;br /&gt;
&lt;br /&gt;
== Trigger most common game actions ==&lt;br /&gt;
&lt;br /&gt;
===moveElement( element_id, target_id )===&lt;br /&gt;
&lt;br /&gt;
Move element to specified target id.&lt;br /&gt;
&lt;br /&gt;
The exact destination of element depends on target &amp;quot;howToArrange&amp;quot; property (&amp;quot;How elements are arranged on it?&amp;quot; : spreaded/deck/...).&lt;br /&gt;
&lt;br /&gt;
  // Example :&lt;br /&gt;
  bga.moveElement( bga.getElementIdByName( &#039;Turn counter&#039; ), bga.getElementIdByName( &#039;Turn 3&#039; ) );&lt;/div&gt;</summary>
		<author><name>Sourisdudesert</name></author>
	</entry>
	<entry>
		<id>https://fa.doc.boardgamearena.com/index.php?title=SandboxScripts&amp;diff=2154</id>
		<title>SandboxScripts</title>
		<link rel="alternate" type="text/html" href="https://fa.doc.boardgamearena.com/index.php?title=SandboxScripts&amp;diff=2154"/>
		<updated>2017-01-04T17:50:40Z</updated>

		<summary type="html">&lt;p&gt;Sourisdudesert: /* bga.error( text ) */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
This is the reference of functions you can call from your Sandbox scripts.&lt;br /&gt;
&lt;br /&gt;
= Javascript =&lt;br /&gt;
&lt;br /&gt;
BGA Sandbox scripts are written in Javascript.&lt;br /&gt;
&lt;br /&gt;
Using Javascript, you can write scripts to automate moves for your Sandbox games &amp;amp; provide rules reinforcement.&lt;br /&gt;
&lt;br /&gt;
Important : in the opposite of the most common usage of Javascript, Sandbox scripts are executed &#039;&#039;&#039;on server side&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
= BGA API =&lt;br /&gt;
&lt;br /&gt;
To interact with your BGA Sandbox game, we provide you an API.&lt;br /&gt;
&lt;br /&gt;
With this API, you can get properties values of game elements from the current game situation, modify them and/or trigger the game actions (ex : move this element here, flip this card, and so on).&lt;br /&gt;
&lt;br /&gt;
= Quick start =&lt;br /&gt;
&lt;br /&gt;
== Hello World Script ==&lt;br /&gt;
&lt;br /&gt;
From Sandbox editor &amp;quot;interface view&amp;quot; tab, select an element, and access to its property (top right icon).&lt;br /&gt;
&lt;br /&gt;
Go to &amp;quot;Scripts (advanced)&amp;quot; section.&lt;br /&gt;
&lt;br /&gt;
In front of &amp;quot;When this element is clicked&amp;quot;, enter &amp;quot;onMyClick&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
Close the window. Go to &amp;quot;script view&amp;quot; tab.&lt;br /&gt;
&lt;br /&gt;
Enter the following :&lt;br /&gt;
&lt;br /&gt;
 function onMyClick( element_id )&lt;br /&gt;
 {&lt;br /&gt;
    bga.log(&amp;quot;Hello world! You just clicked on element &amp;quot; + element_id + &amp;quot;. Congrats!&amp;quot;);&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
Save &amp;amp; publish your project, starts a test session, click on the previous element : your message appears in the log on the right!&lt;br /&gt;
&lt;br /&gt;
== Top useful tips ==&lt;br /&gt;
&lt;br /&gt;
* You don&#039;t have to save&amp;amp;publish from the Sandbox editor for each modification of your script : each time you save your script (control+S), the script used for all test sessions is updated. Note that the production version on BGA is of course NOT updated until you explicitly save&amp;amp;publish again your project.&lt;br /&gt;
&lt;br /&gt;
* Alternatively to bga.log(), you can use bga.exit( &amp;quot;my message&amp;quot; ) to debug your script. With bga.exit, the script execution immediately stops and all previous game changes are cancelled, so this is very practical to try and retry an action until your script is fine.&lt;br /&gt;
&lt;br /&gt;
= Functions you can use in your Sandbox scripts=&lt;br /&gt;
&lt;br /&gt;
== Debugging functions ==&lt;br /&gt;
&lt;br /&gt;
=== bga.trace( txt / obj ) ===&lt;br /&gt;
&lt;br /&gt;
Write something immediately in the BGA log (on the right of the screen).&lt;br /&gt;
&lt;br /&gt;
This is the most practical way to debug your script :)&lt;br /&gt;
&lt;br /&gt;
Important : bga.trace is for debugging purpose only and won&#039;t be displayed on production.&lt;br /&gt;
&lt;br /&gt;
Note : you can also pass an object in parameter. This will dump the content of this object in the log.&lt;br /&gt;
&lt;br /&gt;
Note : in the opposite of bga.log, bga.trace is NOT cancelled if the game action failed (after a call to bga.cancel or bga.error). This makes bga.trace very practical to debug a game action that failed, and for this reason you should probably NEVER use bga.log for debugging purpose.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
  // Example : write &amp;quot;Hello world&amp;quot; in the log&lt;br /&gt;
  bga.trace( &amp;quot;Hello world&amp;quot; );&lt;br /&gt;
&lt;br /&gt;
  // Example : dump an associative array in the log&lt;br /&gt;
  bga.trace( { mykey: &#039;myvalue&#039;, another_key: &#039;another_value&#039; } );&lt;br /&gt;
&lt;br /&gt;
=== bga.exit( txt / obj ) ===&lt;br /&gt;
&lt;br /&gt;
Stop the script immediately, display the &amp;quot;txt&amp;quot; messages and cancel (ie : rollback) on every previous API call except bga.trace :&lt;br /&gt;
&lt;br /&gt;
ALL previous BGA api call are canceled and there will be no visible changes on the interface (ex : no moves, no visible property changes, ...). Only &amp;quot;bga.trace&amp;quot; API commands are kept so you can debug.&lt;br /&gt;
&lt;br /&gt;
bga.exit is very practical when you want to repeat a game action again and again to debug it : with a call to bga.exit at the end of your script, you make sure that your game situation will be kept unchanged after each test.&lt;br /&gt;
&lt;br /&gt;
  // Example :&lt;br /&gt;
  bga.exit( &amp;quot;My script is stopped by this call&amp;quot; );&lt;br /&gt;
&lt;br /&gt;
  // Example with dumping a javascript variable&lt;br /&gt;
  bga.exit( my_variable_to_dump );&lt;br /&gt;
&lt;br /&gt;
== Cancelling a game action ==&lt;br /&gt;
&lt;br /&gt;
=== bga.cancel( txt ) ===&lt;br /&gt;
&lt;br /&gt;
This is the function to use when a player is doing something against game rules.&lt;br /&gt;
&lt;br /&gt;
The text message in parameter will be displayed to this player as a &amp;quot;red message&amp;quot;, so he/she can understand the rule.&lt;br /&gt;
&lt;br /&gt;
All previous BGA api call are cancelled, and there will be no visible changes on the interface.&lt;br /&gt;
&lt;br /&gt;
   // Example :&lt;br /&gt;
   bga.cancel( _(&amp;quot;You cannot move this piece here&amp;quot;) );&lt;br /&gt;
&lt;br /&gt;
Note : most of the time, you should wrap your text inside a _() translation marker to make this string translatable.&lt;br /&gt;
&lt;br /&gt;
=== bga.error( text ) ===&lt;br /&gt;
&lt;br /&gt;
This is the function to use when some unexpected error happens in your script.&lt;br /&gt;
&lt;br /&gt;
The text message will be displayed to user, with mention &amp;quot;Unexpected error&amp;quot;. The player will be incited to fill a bug report. The purpose of the message is to help you to identify the bug.&lt;br /&gt;
&lt;br /&gt;
All previous BGA api call are cancelled, and there will be no visible changes on the interface.&lt;br /&gt;
&lt;br /&gt;
   // Example :&lt;br /&gt;
   if( card_picked === null )&lt;br /&gt;
   {&lt;br /&gt;
       bga.error( &amp;quot;Cannot find a card to pick !&amp;quot; );&lt;br /&gt;
   }&lt;br /&gt;
&lt;br /&gt;
Note : you should NEVER wrap text inside bga.error with _() translation marker, because unexpected error should not be translate (so you can eventually recognize them when reported by players in bug report).&lt;br /&gt;
&lt;br /&gt;
== Game log (history) ==&lt;br /&gt;
&lt;br /&gt;
=== bga.log( txt, (optional) args ) ===&lt;br /&gt;
&lt;br /&gt;
Write something in the BGA log on the right.&lt;br /&gt;
&lt;br /&gt;
  // Example : simple log&lt;br /&gt;
  bga.log( _(&amp;quot;A new round starts&amp;quot;) );&lt;br /&gt;
&lt;br /&gt;
You may add arguments to your log, like this :&lt;br /&gt;
&lt;br /&gt;
  // Example: log with argument to display a card name.&lt;br /&gt;
  //          In this example, variable &amp;quot;event_name&amp;quot; is specified afterwards.&lt;br /&gt;
  //          Note that using this, game translators only have to translate one &amp;quot;Event XXX is triggered&amp;quot; string for all possible events.&lt;br /&gt;
  bga.log( _(&amp;quot;Event ${event_name} is triggered&amp;quot;), {  event_name: _( &amp;quot;Armageddon&amp;quot; ) } ) );&lt;br /&gt;
&lt;br /&gt;
Note that argument &amp;quot;player_name&amp;quot; is ALWAYS pre-set with the name of the current player, so you can use it immediately.&lt;br /&gt;
&lt;br /&gt;
  // Example :&lt;br /&gt;
  bga.log( _(&amp;quot;${player_name} draw a card from the deck&amp;quot;) );&lt;br /&gt;
&lt;br /&gt;
== Get / search game elements and their properties ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== bga.getElementById( id )===&lt;br /&gt;
&lt;br /&gt;
Get an object with all the properties of the element with specified ID.&lt;br /&gt;
&lt;br /&gt;
Throw an exception if the element does not exists.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===bga.getElementsByIds( ids )===&lt;br /&gt;
&lt;br /&gt;
Get all specified elements with an array of ids.&lt;br /&gt;
&lt;br /&gt;
Return an associative array (element_id =&amp;gt; element).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===bga.getElementsByParent( parent_id )===&lt;br /&gt;
&lt;br /&gt;
Get all children (ie : all elements contained) of the specified element_id.&lt;br /&gt;
&lt;br /&gt;
Ex : if you call getElementsByParent on a deck of cards, you&#039;ll get all cards.&lt;br /&gt;
&lt;br /&gt;
  // Example : Get all cards of a deck with name &amp;quot;mydeck&amp;quot;&lt;br /&gt;
  var cards = bga.getElementsByParent( bga.getElementByName( &#039;mydeck&#039; ) );&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===bga.getElementIdByName( name )===&lt;br /&gt;
&lt;br /&gt;
Get the ID of a Sandbox element from its name.&lt;br /&gt;
&lt;br /&gt;
Return null if there are no element with this name.&lt;br /&gt;
Throw an exception if there are more than 1 element with this name.&lt;br /&gt;
&lt;br /&gt;
  // Example :&lt;br /&gt;
  var chess_square = bga.getElementIdByName( &#039;h3&#039; );&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===bga.getElementsIdsByName( name )===&lt;br /&gt;
&lt;br /&gt;
Get the IDs of all Sandbox elements with this name.&lt;br /&gt;
&lt;br /&gt;
  // Example :&lt;br /&gt;
  var pawn_pieces_ids = bga.getElementsIdByName( &#039;pawn&#039; );&lt;br /&gt;
  &lt;br /&gt;
  // Result : [ 41, 42, 43, ... ]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Utility methods ==&lt;br /&gt;
&lt;br /&gt;
=== bga.isOn( element_id, parent_id ) ===&lt;br /&gt;
&lt;br /&gt;
Return true if &amp;quot;element_id&amp;quot; is a descendant of &amp;quot;parent_id&amp;quot; (ie : if element_id game element has been placed on parent_id game element).&lt;br /&gt;
&lt;br /&gt;
  // Example :&lt;br /&gt;
  if( bga.isOn( bga.getElementIfByName( &#039;Turn counter&#039; ), bga.getElementIfByName( &#039;Turn 6&#039; ) )&lt;br /&gt;
  {&lt;br /&gt;
     // Trigger game end&lt;br /&gt;
  }&lt;br /&gt;
&lt;br /&gt;
== Trigger most common game actions ==&lt;br /&gt;
&lt;br /&gt;
===moveElement( element_id, target_id )===&lt;br /&gt;
&lt;br /&gt;
Move element to specified target id.&lt;br /&gt;
&lt;br /&gt;
The exact destination of element depends on target &amp;quot;howToArrange&amp;quot; property (&amp;quot;How elements are arranged on it?&amp;quot; : spreaded/deck/...).&lt;br /&gt;
&lt;br /&gt;
  // Example :&lt;br /&gt;
  bga.moveElement( bga.getElementIdByName( &#039;Turn counter&#039; ), bga.getElementIdByName( &#039;Turn 3&#039; ) );&lt;/div&gt;</summary>
		<author><name>Sourisdudesert</name></author>
	</entry>
	<entry>
		<id>https://fa.doc.boardgamearena.com/index.php?title=SandboxScripts&amp;diff=2153</id>
		<title>SandboxScripts</title>
		<link rel="alternate" type="text/html" href="https://fa.doc.boardgamearena.com/index.php?title=SandboxScripts&amp;diff=2153"/>
		<updated>2017-01-04T17:50:31Z</updated>

		<summary type="html">&lt;p&gt;Sourisdudesert: /* bga.cancel( txt ) */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
This is the reference of functions you can call from your Sandbox scripts.&lt;br /&gt;
&lt;br /&gt;
= Javascript =&lt;br /&gt;
&lt;br /&gt;
BGA Sandbox scripts are written in Javascript.&lt;br /&gt;
&lt;br /&gt;
Using Javascript, you can write scripts to automate moves for your Sandbox games &amp;amp; provide rules reinforcement.&lt;br /&gt;
&lt;br /&gt;
Important : in the opposite of the most common usage of Javascript, Sandbox scripts are executed &#039;&#039;&#039;on server side&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
= BGA API =&lt;br /&gt;
&lt;br /&gt;
To interact with your BGA Sandbox game, we provide you an API.&lt;br /&gt;
&lt;br /&gt;
With this API, you can get properties values of game elements from the current game situation, modify them and/or trigger the game actions (ex : move this element here, flip this card, and so on).&lt;br /&gt;
&lt;br /&gt;
= Quick start =&lt;br /&gt;
&lt;br /&gt;
== Hello World Script ==&lt;br /&gt;
&lt;br /&gt;
From Sandbox editor &amp;quot;interface view&amp;quot; tab, select an element, and access to its property (top right icon).&lt;br /&gt;
&lt;br /&gt;
Go to &amp;quot;Scripts (advanced)&amp;quot; section.&lt;br /&gt;
&lt;br /&gt;
In front of &amp;quot;When this element is clicked&amp;quot;, enter &amp;quot;onMyClick&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
Close the window. Go to &amp;quot;script view&amp;quot; tab.&lt;br /&gt;
&lt;br /&gt;
Enter the following :&lt;br /&gt;
&lt;br /&gt;
 function onMyClick( element_id )&lt;br /&gt;
 {&lt;br /&gt;
    bga.log(&amp;quot;Hello world! You just clicked on element &amp;quot; + element_id + &amp;quot;. Congrats!&amp;quot;);&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
Save &amp;amp; publish your project, starts a test session, click on the previous element : your message appears in the log on the right!&lt;br /&gt;
&lt;br /&gt;
== Top useful tips ==&lt;br /&gt;
&lt;br /&gt;
* You don&#039;t have to save&amp;amp;publish from the Sandbox editor for each modification of your script : each time you save your script (control+S), the script used for all test sessions is updated. Note that the production version on BGA is of course NOT updated until you explicitly save&amp;amp;publish again your project.&lt;br /&gt;
&lt;br /&gt;
* Alternatively to bga.log(), you can use bga.exit( &amp;quot;my message&amp;quot; ) to debug your script. With bga.exit, the script execution immediately stops and all previous game changes are cancelled, so this is very practical to try and retry an action until your script is fine.&lt;br /&gt;
&lt;br /&gt;
= Functions you can use in your Sandbox scripts=&lt;br /&gt;
&lt;br /&gt;
== Debugging functions ==&lt;br /&gt;
&lt;br /&gt;
=== bga.trace( txt / obj ) ===&lt;br /&gt;
&lt;br /&gt;
Write something immediately in the BGA log (on the right of the screen).&lt;br /&gt;
&lt;br /&gt;
This is the most practical way to debug your script :)&lt;br /&gt;
&lt;br /&gt;
Important : bga.trace is for debugging purpose only and won&#039;t be displayed on production.&lt;br /&gt;
&lt;br /&gt;
Note : you can also pass an object in parameter. This will dump the content of this object in the log.&lt;br /&gt;
&lt;br /&gt;
Note : in the opposite of bga.log, bga.trace is NOT cancelled if the game action failed (after a call to bga.cancel or bga.error). This makes bga.trace very practical to debug a game action that failed, and for this reason you should probably NEVER use bga.log for debugging purpose.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
  // Example : write &amp;quot;Hello world&amp;quot; in the log&lt;br /&gt;
  bga.trace( &amp;quot;Hello world&amp;quot; );&lt;br /&gt;
&lt;br /&gt;
  // Example : dump an associative array in the log&lt;br /&gt;
  bga.trace( { mykey: &#039;myvalue&#039;, another_key: &#039;another_value&#039; } );&lt;br /&gt;
&lt;br /&gt;
=== bga.exit( txt / obj ) ===&lt;br /&gt;
&lt;br /&gt;
Stop the script immediately, display the &amp;quot;txt&amp;quot; messages and cancel (ie : rollback) on every previous API call except bga.trace :&lt;br /&gt;
&lt;br /&gt;
ALL previous BGA api call are canceled and there will be no visible changes on the interface (ex : no moves, no visible property changes, ...). Only &amp;quot;bga.trace&amp;quot; API commands are kept so you can debug.&lt;br /&gt;
&lt;br /&gt;
bga.exit is very practical when you want to repeat a game action again and again to debug it : with a call to bga.exit at the end of your script, you make sure that your game situation will be kept unchanged after each test.&lt;br /&gt;
&lt;br /&gt;
  // Example :&lt;br /&gt;
  bga.exit( &amp;quot;My script is stopped by this call&amp;quot; );&lt;br /&gt;
&lt;br /&gt;
  // Example with dumping a javascript variable&lt;br /&gt;
  bga.exit( my_variable_to_dump );&lt;br /&gt;
&lt;br /&gt;
== Cancelling a game action ==&lt;br /&gt;
&lt;br /&gt;
=== bga.cancel( txt ) ===&lt;br /&gt;
&lt;br /&gt;
This is the function to use when a player is doing something against game rules.&lt;br /&gt;
&lt;br /&gt;
The text message in parameter will be displayed to this player as a &amp;quot;red message&amp;quot;, so he/she can understand the rule.&lt;br /&gt;
&lt;br /&gt;
All previous BGA api call are cancelled, and there will be no visible changes on the interface.&lt;br /&gt;
&lt;br /&gt;
   // Example :&lt;br /&gt;
   bga.cancel( _(&amp;quot;You cannot move this piece here&amp;quot;) );&lt;br /&gt;
&lt;br /&gt;
Note : most of the time, you should wrap your text inside a _() translation marker to make this string translatable.&lt;br /&gt;
&lt;br /&gt;
== bga.error( text ) ==&lt;br /&gt;
&lt;br /&gt;
This is the function to use when some unexpected error happens in your script.&lt;br /&gt;
&lt;br /&gt;
The text message will be displayed to user, with mention &amp;quot;Unexpected error&amp;quot;. The player will be incited to fill a bug report. The purpose of the message is to help you to identify the bug.&lt;br /&gt;
&lt;br /&gt;
All previous BGA api call are cancelled, and there will be no visible changes on the interface.&lt;br /&gt;
&lt;br /&gt;
   // Example :&lt;br /&gt;
   if( card_picked === null )&lt;br /&gt;
   {&lt;br /&gt;
       bga.error( &amp;quot;Cannot find a card to pick !&amp;quot; );&lt;br /&gt;
   }&lt;br /&gt;
&lt;br /&gt;
Note : you should NEVER wrap text inside bga.error with _() translation marker, because unexpected error should not be translate (so you can eventually recognize them when reported by players in bug report).&lt;br /&gt;
&lt;br /&gt;
== Game log (history) ==&lt;br /&gt;
&lt;br /&gt;
=== bga.log( txt, (optional) args ) ===&lt;br /&gt;
&lt;br /&gt;
Write something in the BGA log on the right.&lt;br /&gt;
&lt;br /&gt;
  // Example : simple log&lt;br /&gt;
  bga.log( _(&amp;quot;A new round starts&amp;quot;) );&lt;br /&gt;
&lt;br /&gt;
You may add arguments to your log, like this :&lt;br /&gt;
&lt;br /&gt;
  // Example: log with argument to display a card name.&lt;br /&gt;
  //          In this example, variable &amp;quot;event_name&amp;quot; is specified afterwards.&lt;br /&gt;
  //          Note that using this, game translators only have to translate one &amp;quot;Event XXX is triggered&amp;quot; string for all possible events.&lt;br /&gt;
  bga.log( _(&amp;quot;Event ${event_name} is triggered&amp;quot;), {  event_name: _( &amp;quot;Armageddon&amp;quot; ) } ) );&lt;br /&gt;
&lt;br /&gt;
Note that argument &amp;quot;player_name&amp;quot; is ALWAYS pre-set with the name of the current player, so you can use it immediately.&lt;br /&gt;
&lt;br /&gt;
  // Example :&lt;br /&gt;
  bga.log( _(&amp;quot;${player_name} draw a card from the deck&amp;quot;) );&lt;br /&gt;
&lt;br /&gt;
== Get / search game elements and their properties ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== bga.getElementById( id )===&lt;br /&gt;
&lt;br /&gt;
Get an object with all the properties of the element with specified ID.&lt;br /&gt;
&lt;br /&gt;
Throw an exception if the element does not exists.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===bga.getElementsByIds( ids )===&lt;br /&gt;
&lt;br /&gt;
Get all specified elements with an array of ids.&lt;br /&gt;
&lt;br /&gt;
Return an associative array (element_id =&amp;gt; element).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===bga.getElementsByParent( parent_id )===&lt;br /&gt;
&lt;br /&gt;
Get all children (ie : all elements contained) of the specified element_id.&lt;br /&gt;
&lt;br /&gt;
Ex : if you call getElementsByParent on a deck of cards, you&#039;ll get all cards.&lt;br /&gt;
&lt;br /&gt;
  // Example : Get all cards of a deck with name &amp;quot;mydeck&amp;quot;&lt;br /&gt;
  var cards = bga.getElementsByParent( bga.getElementByName( &#039;mydeck&#039; ) );&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===bga.getElementIdByName( name )===&lt;br /&gt;
&lt;br /&gt;
Get the ID of a Sandbox element from its name.&lt;br /&gt;
&lt;br /&gt;
Return null if there are no element with this name.&lt;br /&gt;
Throw an exception if there are more than 1 element with this name.&lt;br /&gt;
&lt;br /&gt;
  // Example :&lt;br /&gt;
  var chess_square = bga.getElementIdByName( &#039;h3&#039; );&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===bga.getElementsIdsByName( name )===&lt;br /&gt;
&lt;br /&gt;
Get the IDs of all Sandbox elements with this name.&lt;br /&gt;
&lt;br /&gt;
  // Example :&lt;br /&gt;
  var pawn_pieces_ids = bga.getElementsIdByName( &#039;pawn&#039; );&lt;br /&gt;
  &lt;br /&gt;
  // Result : [ 41, 42, 43, ... ]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Utility methods ==&lt;br /&gt;
&lt;br /&gt;
=== bga.isOn( element_id, parent_id ) ===&lt;br /&gt;
&lt;br /&gt;
Return true if &amp;quot;element_id&amp;quot; is a descendant of &amp;quot;parent_id&amp;quot; (ie : if element_id game element has been placed on parent_id game element).&lt;br /&gt;
&lt;br /&gt;
  // Example :&lt;br /&gt;
  if( bga.isOn( bga.getElementIfByName( &#039;Turn counter&#039; ), bga.getElementIfByName( &#039;Turn 6&#039; ) )&lt;br /&gt;
  {&lt;br /&gt;
     // Trigger game end&lt;br /&gt;
  }&lt;br /&gt;
&lt;br /&gt;
== Trigger most common game actions ==&lt;br /&gt;
&lt;br /&gt;
===moveElement( element_id, target_id )===&lt;br /&gt;
&lt;br /&gt;
Move element to specified target id.&lt;br /&gt;
&lt;br /&gt;
The exact destination of element depends on target &amp;quot;howToArrange&amp;quot; property (&amp;quot;How elements are arranged on it?&amp;quot; : spreaded/deck/...).&lt;br /&gt;
&lt;br /&gt;
  // Example :&lt;br /&gt;
  bga.moveElement( bga.getElementIdByName( &#039;Turn counter&#039; ), bga.getElementIdByName( &#039;Turn 3&#039; ) );&lt;/div&gt;</summary>
		<author><name>Sourisdudesert</name></author>
	</entry>
	<entry>
		<id>https://fa.doc.boardgamearena.com/index.php?title=SandboxScripts&amp;diff=2151</id>
		<title>SandboxScripts</title>
		<link rel="alternate" type="text/html" href="https://fa.doc.boardgamearena.com/index.php?title=SandboxScripts&amp;diff=2151"/>
		<updated>2017-01-03T18:03:50Z</updated>

		<summary type="html">&lt;p&gt;Sourisdudesert: /* Debugging functions */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
This is the reference of functions you can call from your Sandbox scripts.&lt;br /&gt;
&lt;br /&gt;
= Javascript =&lt;br /&gt;
&lt;br /&gt;
BGA Sandbox scripts are written in Javascript.&lt;br /&gt;
&lt;br /&gt;
Using Javascript, you can write scripts to automate moves for your Sandbox games &amp;amp; provide rules reinforcement.&lt;br /&gt;
&lt;br /&gt;
Important : in the opposite of the most common usage of Javascript, Sandbox scripts are executed &#039;&#039;&#039;on server side&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
= BGA API =&lt;br /&gt;
&lt;br /&gt;
To interact with your BGA Sandbox game, we provide you an API.&lt;br /&gt;
&lt;br /&gt;
With this API, you can get properties values of game elements from the current game situation, modify them and/or trigger the game actions (ex : move this element here, flip this card, and so on).&lt;br /&gt;
&lt;br /&gt;
= Quick start =&lt;br /&gt;
&lt;br /&gt;
== Hello World Script ==&lt;br /&gt;
&lt;br /&gt;
From Sandbox editor &amp;quot;interface view&amp;quot; tab, select an element, and access to its property (top right icon).&lt;br /&gt;
&lt;br /&gt;
Go to &amp;quot;Scripts (advanced)&amp;quot; section.&lt;br /&gt;
&lt;br /&gt;
In front of &amp;quot;When this element is clicked&amp;quot;, enter &amp;quot;onMyClick&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
Close the window. Go to &amp;quot;script view&amp;quot; tab.&lt;br /&gt;
&lt;br /&gt;
Enter the following :&lt;br /&gt;
&lt;br /&gt;
 function onMyClick( element_id )&lt;br /&gt;
 {&lt;br /&gt;
    bga.log(&amp;quot;Hello world! You just clicked on element &amp;quot; + element_id + &amp;quot;. Congrats!&amp;quot;);&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
Save &amp;amp; publish your project, starts a test session, click on the previous element : your message appears in the log on the right!&lt;br /&gt;
&lt;br /&gt;
== Top useful tips ==&lt;br /&gt;
&lt;br /&gt;
* You don&#039;t have to save&amp;amp;publish from the Sandbox editor for each modification of your script : each time you save your script (control+S), the script used for all test sessions is updated. Note that the production version on BGA is of course NOT updated until you explicitly save&amp;amp;publish again your project.&lt;br /&gt;
&lt;br /&gt;
* Alternatively to bga.log(), you can use bga.exit( &amp;quot;my message&amp;quot; ) to debug your script. With bga.exit, the script execution immediately stops and all previous game changes are cancelled, so this is very practical to try and retry an action until your script is fine.&lt;br /&gt;
&lt;br /&gt;
= Functions you can use in your Sandbox scripts=&lt;br /&gt;
&lt;br /&gt;
== Debugging functions ==&lt;br /&gt;
&lt;br /&gt;
=== bga.trace( txt / obj ) ===&lt;br /&gt;
&lt;br /&gt;
Write something immediately in the BGA log (on the right of the screen).&lt;br /&gt;
&lt;br /&gt;
This is the most practical way to debug your script :)&lt;br /&gt;
&lt;br /&gt;
Important : bga.trace is for debugging purpose only and won&#039;t be displayed on production.&lt;br /&gt;
&lt;br /&gt;
Note : you can also pass an object in parameter. This will dump the content of this object in the log.&lt;br /&gt;
&lt;br /&gt;
Note : in the opposite of bga.log, bga.trace is NOT cancelled if the game action failed (after a call to bga.cancel or bga.error). This makes bga.trace very practical to debug a game action that failed, and for this reason you should probably NEVER use bga.log for debugging purpose.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
  // Example : write &amp;quot;Hello world&amp;quot; in the log&lt;br /&gt;
  bga.trace( &amp;quot;Hello world&amp;quot; );&lt;br /&gt;
&lt;br /&gt;
  // Example : dump an associative array in the log&lt;br /&gt;
  bga.trace( { mykey: &#039;myvalue&#039;, another_key: &#039;another_value&#039; } );&lt;br /&gt;
&lt;br /&gt;
=== bga.exit( txt / obj ) ===&lt;br /&gt;
&lt;br /&gt;
Stop the script immediately, display the &amp;quot;txt&amp;quot; messages and cancel (ie : rollback) on every previous API call except bga.trace :&lt;br /&gt;
&lt;br /&gt;
ALL previous BGA api call are canceled and there will be no visible changes on the interface (ex : no moves, no visible property changes, ...). Only &amp;quot;bga.trace&amp;quot; API commands are kept so you can debug.&lt;br /&gt;
&lt;br /&gt;
bga.exit is very practical when you want to repeat a game action again and again to debug it : with a call to bga.exit at the end of your script, you make sure that your game situation will be kept unchanged after each test.&lt;br /&gt;
&lt;br /&gt;
  // Example :&lt;br /&gt;
  bga.exit( &amp;quot;My script is stopped by this call&amp;quot; );&lt;br /&gt;
&lt;br /&gt;
  // Example with dumping a javascript variable&lt;br /&gt;
  bga.exit( my_variable_to_dump );&lt;br /&gt;
&lt;br /&gt;
== Cancelling a game action ==&lt;br /&gt;
&lt;br /&gt;
== bga.cancel( txt ) ==&lt;br /&gt;
&lt;br /&gt;
This is the function to use when a player is doing something against game rules.&lt;br /&gt;
&lt;br /&gt;
The text message in parameter will be displayed to this player as a &amp;quot;red message&amp;quot;, so he/she can understand the rule.&lt;br /&gt;
&lt;br /&gt;
All previous BGA api call are cancelled, and there will be no visible changes on the interface.&lt;br /&gt;
&lt;br /&gt;
   // Example :&lt;br /&gt;
   bga.cancel( _(&amp;quot;You cannot move this piece here&amp;quot;) );&lt;br /&gt;
&lt;br /&gt;
Note : most of the time, you should wrap your text inside a _() translation marker to make this string translatable.&lt;br /&gt;
&lt;br /&gt;
== bga.error( text ) ==&lt;br /&gt;
&lt;br /&gt;
This is the function to use when some unexpected error happens in your script.&lt;br /&gt;
&lt;br /&gt;
The text message will be displayed to user, with mention &amp;quot;Unexpected error&amp;quot;. The player will be incited to fill a bug report. The purpose of the message is to help you to identify the bug.&lt;br /&gt;
&lt;br /&gt;
All previous BGA api call are cancelled, and there will be no visible changes on the interface.&lt;br /&gt;
&lt;br /&gt;
   // Example :&lt;br /&gt;
   if( card_picked === null )&lt;br /&gt;
   {&lt;br /&gt;
       bga.error( &amp;quot;Cannot find a card to pick !&amp;quot; );&lt;br /&gt;
   }&lt;br /&gt;
&lt;br /&gt;
Note : you should NEVER wrap text inside bga.error with _() translation marker, because unexpected error should not be translate (so you can eventually recognize them when reported by players in bug report).&lt;br /&gt;
&lt;br /&gt;
== Game log (history) ==&lt;br /&gt;
&lt;br /&gt;
=== bga.log( txt, (optional) args ) ===&lt;br /&gt;
&lt;br /&gt;
Write something in the BGA log on the right.&lt;br /&gt;
&lt;br /&gt;
  // Example : simple log&lt;br /&gt;
  bga.log( _(&amp;quot;A new round starts&amp;quot;) );&lt;br /&gt;
&lt;br /&gt;
You may add arguments to your log, like this :&lt;br /&gt;
&lt;br /&gt;
  // Example: log with argument to display a card name.&lt;br /&gt;
  //          In this example, variable &amp;quot;event_name&amp;quot; is specified afterwards.&lt;br /&gt;
  //          Note that using this, game translators only have to translate one &amp;quot;Event XXX is triggered&amp;quot; string for all possible events.&lt;br /&gt;
  bga.log( _(&amp;quot;Event ${event_name} is triggered&amp;quot;), {  event_name: _( &amp;quot;Armageddon&amp;quot; ) } ) );&lt;br /&gt;
&lt;br /&gt;
Note that argument &amp;quot;player_name&amp;quot; is ALWAYS pre-set with the name of the current player, so you can use it immediately.&lt;br /&gt;
&lt;br /&gt;
  // Example :&lt;br /&gt;
  bga.log( _(&amp;quot;${player_name} draw a card from the deck&amp;quot;) );&lt;br /&gt;
&lt;br /&gt;
== Get / search game elements and their properties ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== bga.getElementById( id )===&lt;br /&gt;
&lt;br /&gt;
Get an object with all the properties of the element with specified ID.&lt;br /&gt;
&lt;br /&gt;
Throw an exception if the element does not exists.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===bga.getElementsByIds( ids )===&lt;br /&gt;
&lt;br /&gt;
Get all specified elements with an array of ids.&lt;br /&gt;
&lt;br /&gt;
Return an associative array (element_id =&amp;gt; element).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===bga.getElementsByParent( parent_id )===&lt;br /&gt;
&lt;br /&gt;
Get all children (ie : all elements contained) of the specified element_id.&lt;br /&gt;
&lt;br /&gt;
Ex : if you call getElementsByParent on a deck of cards, you&#039;ll get all cards.&lt;br /&gt;
&lt;br /&gt;
  // Example : Get all cards of a deck with name &amp;quot;mydeck&amp;quot;&lt;br /&gt;
  var cards = bga.getElementsByParent( bga.getElementByName( &#039;mydeck&#039; ) );&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===bga.getElementIdByName( name )===&lt;br /&gt;
&lt;br /&gt;
Get the ID of a Sandbox element from its name.&lt;br /&gt;
&lt;br /&gt;
Return null if there are no element with this name.&lt;br /&gt;
Throw an exception if there are more than 1 element with this name.&lt;br /&gt;
&lt;br /&gt;
  // Example :&lt;br /&gt;
  var chess_square = bga.getElementIdByName( &#039;h3&#039; );&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===bga.getElementsIdsByName( name )===&lt;br /&gt;
&lt;br /&gt;
Get the IDs of all Sandbox elements with this name.&lt;br /&gt;
&lt;br /&gt;
  // Example :&lt;br /&gt;
  var pawn_pieces_ids = bga.getElementsIdByName( &#039;pawn&#039; );&lt;br /&gt;
  &lt;br /&gt;
  // Result : [ 41, 42, 43, ... ]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Utility methods ==&lt;br /&gt;
&lt;br /&gt;
=== bga.isOn( element_id, parent_id ) ===&lt;br /&gt;
&lt;br /&gt;
Return true if &amp;quot;element_id&amp;quot; is a descendant of &amp;quot;parent_id&amp;quot; (ie : if element_id game element has been placed on parent_id game element).&lt;br /&gt;
&lt;br /&gt;
  // Example :&lt;br /&gt;
  if( bga.isOn( bga.getElementIfByName( &#039;Turn counter&#039; ), bga.getElementIfByName( &#039;Turn 6&#039; ) )&lt;br /&gt;
  {&lt;br /&gt;
     // Trigger game end&lt;br /&gt;
  }&lt;br /&gt;
&lt;br /&gt;
== Trigger most common game actions ==&lt;br /&gt;
&lt;br /&gt;
===moveElement( element_id, target_id )===&lt;br /&gt;
&lt;br /&gt;
Move element to specified target id.&lt;br /&gt;
&lt;br /&gt;
The exact destination of element depends on target &amp;quot;howToArrange&amp;quot; property (&amp;quot;How elements are arranged on it?&amp;quot; : spreaded/deck/...).&lt;br /&gt;
&lt;br /&gt;
  // Example :&lt;br /&gt;
  bga.moveElement( bga.getElementIdByName( &#039;Turn counter&#039; ), bga.getElementIdByName( &#039;Turn 3&#039; ) );&lt;/div&gt;</summary>
		<author><name>Sourisdudesert</name></author>
	</entry>
	<entry>
		<id>https://fa.doc.boardgamearena.com/index.php?title=SandboxScripts&amp;diff=2150</id>
		<title>SandboxScripts</title>
		<link rel="alternate" type="text/html" href="https://fa.doc.boardgamearena.com/index.php?title=SandboxScripts&amp;diff=2150"/>
		<updated>2017-01-03T17:56:04Z</updated>

		<summary type="html">&lt;p&gt;Sourisdudesert: /* bga.exit( txt ) */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
This is the reference of functions you can call from your Sandbox scripts.&lt;br /&gt;
&lt;br /&gt;
= Javascript =&lt;br /&gt;
&lt;br /&gt;
BGA Sandbox scripts are written in Javascript.&lt;br /&gt;
&lt;br /&gt;
Using Javascript, you can write scripts to automate moves for your Sandbox games &amp;amp; provide rules reinforcement.&lt;br /&gt;
&lt;br /&gt;
Important : in the opposite of the most common usage of Javascript, Sandbox scripts are executed &#039;&#039;&#039;on server side&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
= BGA API =&lt;br /&gt;
&lt;br /&gt;
To interact with your BGA Sandbox game, we provide you an API.&lt;br /&gt;
&lt;br /&gt;
With this API, you can get properties values of game elements from the current game situation, modify them and/or trigger the game actions (ex : move this element here, flip this card, and so on).&lt;br /&gt;
&lt;br /&gt;
= Quick start =&lt;br /&gt;
&lt;br /&gt;
== Hello World Script ==&lt;br /&gt;
&lt;br /&gt;
From Sandbox editor &amp;quot;interface view&amp;quot; tab, select an element, and access to its property (top right icon).&lt;br /&gt;
&lt;br /&gt;
Go to &amp;quot;Scripts (advanced)&amp;quot; section.&lt;br /&gt;
&lt;br /&gt;
In front of &amp;quot;When this element is clicked&amp;quot;, enter &amp;quot;onMyClick&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
Close the window. Go to &amp;quot;script view&amp;quot; tab.&lt;br /&gt;
&lt;br /&gt;
Enter the following :&lt;br /&gt;
&lt;br /&gt;
 function onMyClick( element_id )&lt;br /&gt;
 {&lt;br /&gt;
    bga.log(&amp;quot;Hello world! You just clicked on element &amp;quot; + element_id + &amp;quot;. Congrats!&amp;quot;);&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
Save &amp;amp; publish your project, starts a test session, click on the previous element : your message appears in the log on the right!&lt;br /&gt;
&lt;br /&gt;
== Top useful tips ==&lt;br /&gt;
&lt;br /&gt;
* You don&#039;t have to save&amp;amp;publish from the Sandbox editor for each modification of your script : each time you save your script (control+S), the script used for all test sessions is updated. Note that the production version on BGA is of course NOT updated until you explicitly save&amp;amp;publish again your project.&lt;br /&gt;
&lt;br /&gt;
* Alternatively to bga.log(), you can use bga.exit( &amp;quot;my message&amp;quot; ) to debug your script. With bga.exit, the script execution immediately stops and all previous game changes are cancelled, so this is very practical to try and retry an action until your script is fine.&lt;br /&gt;
&lt;br /&gt;
= Functions you can use in your Sandbox scripts=&lt;br /&gt;
&lt;br /&gt;
== Debugging functions ==&lt;br /&gt;
&lt;br /&gt;
=== bga.trace( txt ) ===&lt;br /&gt;
&lt;br /&gt;
Write something immediately in the BGA log (on the right of the screen).&lt;br /&gt;
&lt;br /&gt;
This is the most practical way to debug your script :)&lt;br /&gt;
&lt;br /&gt;
Important : bga.trace is for debugging purpose only and won&#039;t be displayed on production.&lt;br /&gt;
&lt;br /&gt;
Note : you can also pass an object in parameter. This will dump the content of this object in the log.&lt;br /&gt;
&lt;br /&gt;
Note : in the opposite of bga.log, bga.trace is NOT cancelled if the game action failed (after a call to bga.cancel or bga.error). This makes bga.trace very practical to debug a game action that failed, and for this reason you should probably NEVER use bga.log for debugging purpose.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
  // Example : write &amp;quot;Hello world&amp;quot; in the log&lt;br /&gt;
  bga.trace( &amp;quot;Hello world&amp;quot; );&lt;br /&gt;
&lt;br /&gt;
  // Example : dump an associative array in the log&lt;br /&gt;
  bga.trace( { mykey: &#039;myvalue&#039;, another_key: &#039;another_value&#039; } );&lt;br /&gt;
&lt;br /&gt;
=== bga.exit( txt ) ===&lt;br /&gt;
&lt;br /&gt;
Stop the script immediately, display the &amp;quot;txt&amp;quot; messages and cancel (ie : rollback) on every previous API call except bga.trace :&lt;br /&gt;
&lt;br /&gt;
ALL previous BGA api call are canceled and there will be no visible changes on the interface (ex : no moves, no visible property changes, ...). Only &amp;quot;bga.trace&amp;quot; API commands are kept so you can debug.&lt;br /&gt;
&lt;br /&gt;
bga.exit is very practical when you want to repeat a game action again and again to debug it : with a call to bga.exit at the end of your script, you make sure that your game situation will be kept unchanged after each test.&lt;br /&gt;
&lt;br /&gt;
  // Example :&lt;br /&gt;
  bga.exit( &amp;quot;My script is stopped by this call&amp;quot; );&lt;br /&gt;
&lt;br /&gt;
  // Example with dumping a javascript variable&lt;br /&gt;
  bga.exit( my_variable_to_dump );&lt;br /&gt;
&lt;br /&gt;
== Game log (history) ==&lt;br /&gt;
&lt;br /&gt;
=== bga.log( txt, (optional) args ) ===&lt;br /&gt;
&lt;br /&gt;
Write something in the BGA log on the right.&lt;br /&gt;
&lt;br /&gt;
  // Example : simple log&lt;br /&gt;
  bga.log( _(&amp;quot;A new round starts&amp;quot;) );&lt;br /&gt;
&lt;br /&gt;
You may add arguments to your log, like this :&lt;br /&gt;
&lt;br /&gt;
  // Example: log with argument to display a card name.&lt;br /&gt;
  //          In this example, variable &amp;quot;event_name&amp;quot; is specified afterwards.&lt;br /&gt;
  //          Note that using this, game translators only have to translate one &amp;quot;Event XXX is triggered&amp;quot; string for all possible events.&lt;br /&gt;
  bga.log( _(&amp;quot;Event ${event_name} is triggered&amp;quot;), {  event_name: _( &amp;quot;Armageddon&amp;quot; ) } ) );&lt;br /&gt;
&lt;br /&gt;
Note that argument &amp;quot;player_name&amp;quot; is ALWAYS pre-set with the name of the current player, so you can use it immediately.&lt;br /&gt;
&lt;br /&gt;
  // Example :&lt;br /&gt;
  bga.log( _(&amp;quot;${player_name} draw a card from the deck&amp;quot;) );&lt;br /&gt;
&lt;br /&gt;
== Get / search game elements and their properties ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== bga.getElementById( id )===&lt;br /&gt;
&lt;br /&gt;
Get an object with all the properties of the element with specified ID.&lt;br /&gt;
&lt;br /&gt;
Throw an exception if the element does not exists.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===bga.getElementsByIds( ids )===&lt;br /&gt;
&lt;br /&gt;
Get all specified elements with an array of ids.&lt;br /&gt;
&lt;br /&gt;
Return an associative array (element_id =&amp;gt; element).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===bga.getElementsByParent( parent_id )===&lt;br /&gt;
&lt;br /&gt;
Get all children (ie : all elements contained) of the specified element_id.&lt;br /&gt;
&lt;br /&gt;
Ex : if you call getElementsByParent on a deck of cards, you&#039;ll get all cards.&lt;br /&gt;
&lt;br /&gt;
  // Example : Get all cards of a deck with name &amp;quot;mydeck&amp;quot;&lt;br /&gt;
  var cards = bga.getElementsByParent( bga.getElementByName( &#039;mydeck&#039; ) );&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===bga.getElementIdByName( name )===&lt;br /&gt;
&lt;br /&gt;
Get the ID of a Sandbox element from its name.&lt;br /&gt;
&lt;br /&gt;
Return null if there are no element with this name.&lt;br /&gt;
Throw an exception if there are more than 1 element with this name.&lt;br /&gt;
&lt;br /&gt;
  // Example :&lt;br /&gt;
  var chess_square = bga.getElementIdByName( &#039;h3&#039; );&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===bga.getElementsIdsByName( name )===&lt;br /&gt;
&lt;br /&gt;
Get the IDs of all Sandbox elements with this name.&lt;br /&gt;
&lt;br /&gt;
  // Example :&lt;br /&gt;
  var pawn_pieces_ids = bga.getElementsIdByName( &#039;pawn&#039; );&lt;br /&gt;
  &lt;br /&gt;
  // Result : [ 41, 42, 43, ... ]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Utility methods ==&lt;br /&gt;
&lt;br /&gt;
=== bga.isOn( element_id, parent_id ) ===&lt;br /&gt;
&lt;br /&gt;
Return true if &amp;quot;element_id&amp;quot; is a descendant of &amp;quot;parent_id&amp;quot; (ie : if element_id game element has been placed on parent_id game element).&lt;br /&gt;
&lt;br /&gt;
  // Example :&lt;br /&gt;
  if( bga.isOn( bga.getElementIfByName( &#039;Turn counter&#039; ), bga.getElementIfByName( &#039;Turn 6&#039; ) )&lt;br /&gt;
  {&lt;br /&gt;
     // Trigger game end&lt;br /&gt;
  }&lt;br /&gt;
&lt;br /&gt;
== Trigger most common game actions ==&lt;br /&gt;
&lt;br /&gt;
===moveElement( element_id, target_id )===&lt;br /&gt;
&lt;br /&gt;
Move element to specified target id.&lt;br /&gt;
&lt;br /&gt;
The exact destination of element depends on target &amp;quot;howToArrange&amp;quot; property (&amp;quot;How elements are arranged on it?&amp;quot; : spreaded/deck/...).&lt;br /&gt;
&lt;br /&gt;
  // Example :&lt;br /&gt;
  bga.moveElement( bga.getElementIdByName( &#039;Turn counter&#039; ), bga.getElementIdByName( &#039;Turn 3&#039; ) );&lt;/div&gt;</summary>
		<author><name>Sourisdudesert</name></author>
	</entry>
	<entry>
		<id>https://fa.doc.boardgamearena.com/index.php?title=SandboxScripts&amp;diff=2149</id>
		<title>SandboxScripts</title>
		<link rel="alternate" type="text/html" href="https://fa.doc.boardgamearena.com/index.php?title=SandboxScripts&amp;diff=2149"/>
		<updated>2017-01-03T17:54:45Z</updated>

		<summary type="html">&lt;p&gt;Sourisdudesert: /* bga.trace( txt ) */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
This is the reference of functions you can call from your Sandbox scripts.&lt;br /&gt;
&lt;br /&gt;
= Javascript =&lt;br /&gt;
&lt;br /&gt;
BGA Sandbox scripts are written in Javascript.&lt;br /&gt;
&lt;br /&gt;
Using Javascript, you can write scripts to automate moves for your Sandbox games &amp;amp; provide rules reinforcement.&lt;br /&gt;
&lt;br /&gt;
Important : in the opposite of the most common usage of Javascript, Sandbox scripts are executed &#039;&#039;&#039;on server side&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
= BGA API =&lt;br /&gt;
&lt;br /&gt;
To interact with your BGA Sandbox game, we provide you an API.&lt;br /&gt;
&lt;br /&gt;
With this API, you can get properties values of game elements from the current game situation, modify them and/or trigger the game actions (ex : move this element here, flip this card, and so on).&lt;br /&gt;
&lt;br /&gt;
= Quick start =&lt;br /&gt;
&lt;br /&gt;
== Hello World Script ==&lt;br /&gt;
&lt;br /&gt;
From Sandbox editor &amp;quot;interface view&amp;quot; tab, select an element, and access to its property (top right icon).&lt;br /&gt;
&lt;br /&gt;
Go to &amp;quot;Scripts (advanced)&amp;quot; section.&lt;br /&gt;
&lt;br /&gt;
In front of &amp;quot;When this element is clicked&amp;quot;, enter &amp;quot;onMyClick&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
Close the window. Go to &amp;quot;script view&amp;quot; tab.&lt;br /&gt;
&lt;br /&gt;
Enter the following :&lt;br /&gt;
&lt;br /&gt;
 function onMyClick( element_id )&lt;br /&gt;
 {&lt;br /&gt;
    bga.log(&amp;quot;Hello world! You just clicked on element &amp;quot; + element_id + &amp;quot;. Congrats!&amp;quot;);&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
Save &amp;amp; publish your project, starts a test session, click on the previous element : your message appears in the log on the right!&lt;br /&gt;
&lt;br /&gt;
== Top useful tips ==&lt;br /&gt;
&lt;br /&gt;
* You don&#039;t have to save&amp;amp;publish from the Sandbox editor for each modification of your script : each time you save your script (control+S), the script used for all test sessions is updated. Note that the production version on BGA is of course NOT updated until you explicitly save&amp;amp;publish again your project.&lt;br /&gt;
&lt;br /&gt;
* Alternatively to bga.log(), you can use bga.exit( &amp;quot;my message&amp;quot; ) to debug your script. With bga.exit, the script execution immediately stops and all previous game changes are cancelled, so this is very practical to try and retry an action until your script is fine.&lt;br /&gt;
&lt;br /&gt;
= Functions you can use in your Sandbox scripts=&lt;br /&gt;
&lt;br /&gt;
== Debugging functions ==&lt;br /&gt;
&lt;br /&gt;
=== bga.trace( txt ) ===&lt;br /&gt;
&lt;br /&gt;
Write something immediately in the BGA log (on the right of the screen).&lt;br /&gt;
&lt;br /&gt;
This is the most practical way to debug your script :)&lt;br /&gt;
&lt;br /&gt;
Important : bga.trace is for debugging purpose only and won&#039;t be displayed on production.&lt;br /&gt;
&lt;br /&gt;
Note : you can also pass an object in parameter. This will dump the content of this object in the log.&lt;br /&gt;
&lt;br /&gt;
Note : in the opposite of bga.log, bga.trace is NOT cancelled if the game action failed (after a call to bga.cancel or bga.error). This makes bga.trace very practical to debug a game action that failed, and for this reason you should probably NEVER use bga.log for debugging purpose.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
  // Example : write &amp;quot;Hello world&amp;quot; in the log&lt;br /&gt;
  bga.trace( &amp;quot;Hello world&amp;quot; );&lt;br /&gt;
&lt;br /&gt;
  // Example : dump an associative array in the log&lt;br /&gt;
  bga.trace( { mykey: &#039;myvalue&#039;, another_key: &#039;another_value&#039; } );&lt;br /&gt;
&lt;br /&gt;
=== bga.exit( txt ) ===&lt;br /&gt;
&lt;br /&gt;
Stop the script immediately, display the &amp;quot;txt&amp;quot; messages and cancel (ie : rollback) on every previous API call except bga.trace :&lt;br /&gt;
&lt;br /&gt;
Again : ALL api call are canceled and there will be no visible changes on the interface (ex : no moves, no visible property changes, ...). Only &amp;quot;bga.trace&amp;quot; API commands are kept so you can debug.&lt;br /&gt;
&lt;br /&gt;
bga.exit is very practical when you want to repeat a game action again and again to debug it : with a call to bga.exit at the end of your script, you make sure that your game situation will be kept unchanged after each test.&lt;br /&gt;
&lt;br /&gt;
  // Example :&lt;br /&gt;
  bga.exit( &amp;quot;My script is stopped by this call&amp;quot; );&lt;br /&gt;
&lt;br /&gt;
== Game log (history) ==&lt;br /&gt;
&lt;br /&gt;
=== bga.log( txt, (optional) args ) ===&lt;br /&gt;
&lt;br /&gt;
Write something in the BGA log on the right.&lt;br /&gt;
&lt;br /&gt;
  // Example : simple log&lt;br /&gt;
  bga.log( _(&amp;quot;A new round starts&amp;quot;) );&lt;br /&gt;
&lt;br /&gt;
You may add arguments to your log, like this :&lt;br /&gt;
&lt;br /&gt;
  // Example: log with argument to display a card name.&lt;br /&gt;
  //          In this example, variable &amp;quot;event_name&amp;quot; is specified afterwards.&lt;br /&gt;
  //          Note that using this, game translators only have to translate one &amp;quot;Event XXX is triggered&amp;quot; string for all possible events.&lt;br /&gt;
  bga.log( _(&amp;quot;Event ${event_name} is triggered&amp;quot;), {  event_name: _( &amp;quot;Armageddon&amp;quot; ) } ) );&lt;br /&gt;
&lt;br /&gt;
Note that argument &amp;quot;player_name&amp;quot; is ALWAYS pre-set with the name of the current player, so you can use it immediately.&lt;br /&gt;
&lt;br /&gt;
  // Example :&lt;br /&gt;
  bga.log( _(&amp;quot;${player_name} draw a card from the deck&amp;quot;) );&lt;br /&gt;
&lt;br /&gt;
== Get / search game elements and their properties ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== bga.getElementById( id )===&lt;br /&gt;
&lt;br /&gt;
Get an object with all the properties of the element with specified ID.&lt;br /&gt;
&lt;br /&gt;
Throw an exception if the element does not exists.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===bga.getElementsByIds( ids )===&lt;br /&gt;
&lt;br /&gt;
Get all specified elements with an array of ids.&lt;br /&gt;
&lt;br /&gt;
Return an associative array (element_id =&amp;gt; element).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===bga.getElementsByParent( parent_id )===&lt;br /&gt;
&lt;br /&gt;
Get all children (ie : all elements contained) of the specified element_id.&lt;br /&gt;
&lt;br /&gt;
Ex : if you call getElementsByParent on a deck of cards, you&#039;ll get all cards.&lt;br /&gt;
&lt;br /&gt;
  // Example : Get all cards of a deck with name &amp;quot;mydeck&amp;quot;&lt;br /&gt;
  var cards = bga.getElementsByParent( bga.getElementByName( &#039;mydeck&#039; ) );&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===bga.getElementIdByName( name )===&lt;br /&gt;
&lt;br /&gt;
Get the ID of a Sandbox element from its name.&lt;br /&gt;
&lt;br /&gt;
Return null if there are no element with this name.&lt;br /&gt;
Throw an exception if there are more than 1 element with this name.&lt;br /&gt;
&lt;br /&gt;
  // Example :&lt;br /&gt;
  var chess_square = bga.getElementIdByName( &#039;h3&#039; );&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===bga.getElementsIdsByName( name )===&lt;br /&gt;
&lt;br /&gt;
Get the IDs of all Sandbox elements with this name.&lt;br /&gt;
&lt;br /&gt;
  // Example :&lt;br /&gt;
  var pawn_pieces_ids = bga.getElementsIdByName( &#039;pawn&#039; );&lt;br /&gt;
  &lt;br /&gt;
  // Result : [ 41, 42, 43, ... ]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Utility methods ==&lt;br /&gt;
&lt;br /&gt;
=== bga.isOn( element_id, parent_id ) ===&lt;br /&gt;
&lt;br /&gt;
Return true if &amp;quot;element_id&amp;quot; is a descendant of &amp;quot;parent_id&amp;quot; (ie : if element_id game element has been placed on parent_id game element).&lt;br /&gt;
&lt;br /&gt;
  // Example :&lt;br /&gt;
  if( bga.isOn( bga.getElementIfByName( &#039;Turn counter&#039; ), bga.getElementIfByName( &#039;Turn 6&#039; ) )&lt;br /&gt;
  {&lt;br /&gt;
     // Trigger game end&lt;br /&gt;
  }&lt;br /&gt;
&lt;br /&gt;
== Trigger most common game actions ==&lt;br /&gt;
&lt;br /&gt;
===moveElement( element_id, target_id )===&lt;br /&gt;
&lt;br /&gt;
Move element to specified target id.&lt;br /&gt;
&lt;br /&gt;
The exact destination of element depends on target &amp;quot;howToArrange&amp;quot; property (&amp;quot;How elements are arranged on it?&amp;quot; : spreaded/deck/...).&lt;br /&gt;
&lt;br /&gt;
  // Example :&lt;br /&gt;
  bga.moveElement( bga.getElementIdByName( &#039;Turn counter&#039; ), bga.getElementIdByName( &#039;Turn 3&#039; ) );&lt;/div&gt;</summary>
		<author><name>Sourisdudesert</name></author>
	</entry>
	<entry>
		<id>https://fa.doc.boardgamearena.com/index.php?title=SandboxScripts&amp;diff=2148</id>
		<title>SandboxScripts</title>
		<link rel="alternate" type="text/html" href="https://fa.doc.boardgamearena.com/index.php?title=SandboxScripts&amp;diff=2148"/>
		<updated>2017-01-03T17:51:40Z</updated>

		<summary type="html">&lt;p&gt;Sourisdudesert: /* Sandbox Scripts Hello World */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
This is the reference of functions you can call from your Sandbox scripts.&lt;br /&gt;
&lt;br /&gt;
= Javascript =&lt;br /&gt;
&lt;br /&gt;
BGA Sandbox scripts are written in Javascript.&lt;br /&gt;
&lt;br /&gt;
Using Javascript, you can write scripts to automate moves for your Sandbox games &amp;amp; provide rules reinforcement.&lt;br /&gt;
&lt;br /&gt;
Important : in the opposite of the most common usage of Javascript, Sandbox scripts are executed &#039;&#039;&#039;on server side&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
= BGA API =&lt;br /&gt;
&lt;br /&gt;
To interact with your BGA Sandbox game, we provide you an API.&lt;br /&gt;
&lt;br /&gt;
With this API, you can get properties values of game elements from the current game situation, modify them and/or trigger the game actions (ex : move this element here, flip this card, and so on).&lt;br /&gt;
&lt;br /&gt;
= Quick start =&lt;br /&gt;
&lt;br /&gt;
== Hello World Script ==&lt;br /&gt;
&lt;br /&gt;
From Sandbox editor &amp;quot;interface view&amp;quot; tab, select an element, and access to its property (top right icon).&lt;br /&gt;
&lt;br /&gt;
Go to &amp;quot;Scripts (advanced)&amp;quot; section.&lt;br /&gt;
&lt;br /&gt;
In front of &amp;quot;When this element is clicked&amp;quot;, enter &amp;quot;onMyClick&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
Close the window. Go to &amp;quot;script view&amp;quot; tab.&lt;br /&gt;
&lt;br /&gt;
Enter the following :&lt;br /&gt;
&lt;br /&gt;
 function onMyClick( element_id )&lt;br /&gt;
 {&lt;br /&gt;
    bga.log(&amp;quot;Hello world! You just clicked on element &amp;quot; + element_id + &amp;quot;. Congrats!&amp;quot;);&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
Save &amp;amp; publish your project, starts a test session, click on the previous element : your message appears in the log on the right!&lt;br /&gt;
&lt;br /&gt;
== Top useful tips ==&lt;br /&gt;
&lt;br /&gt;
* You don&#039;t have to save&amp;amp;publish from the Sandbox editor for each modification of your script : each time you save your script (control+S), the script used for all test sessions is updated. Note that the production version on BGA is of course NOT updated until you explicitly save&amp;amp;publish again your project.&lt;br /&gt;
&lt;br /&gt;
* Alternatively to bga.log(), you can use bga.exit( &amp;quot;my message&amp;quot; ) to debug your script. With bga.exit, the script execution immediately stops and all previous game changes are cancelled, so this is very practical to try and retry an action until your script is fine.&lt;br /&gt;
&lt;br /&gt;
= Functions you can use in your Sandbox scripts=&lt;br /&gt;
&lt;br /&gt;
== Debugging functions ==&lt;br /&gt;
&lt;br /&gt;
=== bga.trace( txt ) ===&lt;br /&gt;
&lt;br /&gt;
Write something immediately in the BGA log (on the right of the screen).&lt;br /&gt;
&lt;br /&gt;
This is the most practical way to debug your script :)&lt;br /&gt;
&lt;br /&gt;
Note : you can also pass an object in parameter. This will dump the content of this object in the log.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
  // Example : write &amp;quot;Hello world&amp;quot; in the log&lt;br /&gt;
  bga.trace( &amp;quot;Hello world&amp;quot; );&lt;br /&gt;
&lt;br /&gt;
  // Example : dump an associative array in the log&lt;br /&gt;
  bga.trace( { mykey: &#039;myvalue&#039;, another_key: &#039;another_value&#039; } );&lt;br /&gt;
&lt;br /&gt;
=== bga.exit( txt ) ===&lt;br /&gt;
&lt;br /&gt;
Stop the script immediately, display the &amp;quot;txt&amp;quot; messages and cancel (ie : rollback) on every previous API call except bga.trace :&lt;br /&gt;
&lt;br /&gt;
Again : ALL api call are canceled and there will be no visible changes on the interface (ex : no moves, no visible property changes, ...). Only &amp;quot;bga.trace&amp;quot; API commands are kept so you can debug.&lt;br /&gt;
&lt;br /&gt;
bga.exit is very practical when you want to repeat a game action again and again to debug it : with a call to bga.exit at the end of your script, you make sure that your game situation will be kept unchanged after each test.&lt;br /&gt;
&lt;br /&gt;
  // Example :&lt;br /&gt;
  bga.exit( &amp;quot;My script is stopped by this call&amp;quot; );&lt;br /&gt;
&lt;br /&gt;
== Game log (history) ==&lt;br /&gt;
&lt;br /&gt;
=== bga.log( txt, (optional) args ) ===&lt;br /&gt;
&lt;br /&gt;
Write something in the BGA log on the right.&lt;br /&gt;
&lt;br /&gt;
  // Example : simple log&lt;br /&gt;
  bga.log( _(&amp;quot;A new round starts&amp;quot;) );&lt;br /&gt;
&lt;br /&gt;
You may add arguments to your log, like this :&lt;br /&gt;
&lt;br /&gt;
  // Example: log with argument to display a card name.&lt;br /&gt;
  //          In this example, variable &amp;quot;event_name&amp;quot; is specified afterwards.&lt;br /&gt;
  //          Note that using this, game translators only have to translate one &amp;quot;Event XXX is triggered&amp;quot; string for all possible events.&lt;br /&gt;
  bga.log( _(&amp;quot;Event ${event_name} is triggered&amp;quot;), {  event_name: _( &amp;quot;Armageddon&amp;quot; ) } ) );&lt;br /&gt;
&lt;br /&gt;
Note that argument &amp;quot;player_name&amp;quot; is ALWAYS pre-set with the name of the current player, so you can use it immediately.&lt;br /&gt;
&lt;br /&gt;
  // Example :&lt;br /&gt;
  bga.log( _(&amp;quot;${player_name} draw a card from the deck&amp;quot;) );&lt;br /&gt;
&lt;br /&gt;
== Get / search game elements and their properties ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== bga.getElementById( id )===&lt;br /&gt;
&lt;br /&gt;
Get an object with all the properties of the element with specified ID.&lt;br /&gt;
&lt;br /&gt;
Throw an exception if the element does not exists.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===bga.getElementsByIds( ids )===&lt;br /&gt;
&lt;br /&gt;
Get all specified elements with an array of ids.&lt;br /&gt;
&lt;br /&gt;
Return an associative array (element_id =&amp;gt; element).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===bga.getElementsByParent( parent_id )===&lt;br /&gt;
&lt;br /&gt;
Get all children (ie : all elements contained) of the specified element_id.&lt;br /&gt;
&lt;br /&gt;
Ex : if you call getElementsByParent on a deck of cards, you&#039;ll get all cards.&lt;br /&gt;
&lt;br /&gt;
  // Example : Get all cards of a deck with name &amp;quot;mydeck&amp;quot;&lt;br /&gt;
  var cards = bga.getElementsByParent( bga.getElementByName( &#039;mydeck&#039; ) );&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===bga.getElementIdByName( name )===&lt;br /&gt;
&lt;br /&gt;
Get the ID of a Sandbox element from its name.&lt;br /&gt;
&lt;br /&gt;
Return null if there are no element with this name.&lt;br /&gt;
Throw an exception if there are more than 1 element with this name.&lt;br /&gt;
&lt;br /&gt;
  // Example :&lt;br /&gt;
  var chess_square = bga.getElementIdByName( &#039;h3&#039; );&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===bga.getElementsIdsByName( name )===&lt;br /&gt;
&lt;br /&gt;
Get the IDs of all Sandbox elements with this name.&lt;br /&gt;
&lt;br /&gt;
  // Example :&lt;br /&gt;
  var pawn_pieces_ids = bga.getElementsIdByName( &#039;pawn&#039; );&lt;br /&gt;
  &lt;br /&gt;
  // Result : [ 41, 42, 43, ... ]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Utility methods ==&lt;br /&gt;
&lt;br /&gt;
=== bga.isOn( element_id, parent_id ) ===&lt;br /&gt;
&lt;br /&gt;
Return true if &amp;quot;element_id&amp;quot; is a descendant of &amp;quot;parent_id&amp;quot; (ie : if element_id game element has been placed on parent_id game element).&lt;br /&gt;
&lt;br /&gt;
  // Example :&lt;br /&gt;
  if( bga.isOn( bga.getElementIfByName( &#039;Turn counter&#039; ), bga.getElementIfByName( &#039;Turn 6&#039; ) )&lt;br /&gt;
  {&lt;br /&gt;
     // Trigger game end&lt;br /&gt;
  }&lt;br /&gt;
&lt;br /&gt;
== Trigger most common game actions ==&lt;br /&gt;
&lt;br /&gt;
===moveElement( element_id, target_id )===&lt;br /&gt;
&lt;br /&gt;
Move element to specified target id.&lt;br /&gt;
&lt;br /&gt;
The exact destination of element depends on target &amp;quot;howToArrange&amp;quot; property (&amp;quot;How elements are arranged on it?&amp;quot; : spreaded/deck/...).&lt;br /&gt;
&lt;br /&gt;
  // Example :&lt;br /&gt;
  bga.moveElement( bga.getElementIdByName( &#039;Turn counter&#039; ), bga.getElementIdByName( &#039;Turn 3&#039; ) );&lt;/div&gt;</summary>
		<author><name>Sourisdudesert</name></author>
	</entry>
	<entry>
		<id>https://fa.doc.boardgamearena.com/index.php?title=SandboxScripts&amp;diff=2117</id>
		<title>SandboxScripts</title>
		<link rel="alternate" type="text/html" href="https://fa.doc.boardgamearena.com/index.php?title=SandboxScripts&amp;diff=2117"/>
		<updated>2016-12-14T10:17:09Z</updated>

		<summary type="html">&lt;p&gt;Sourisdudesert: /* bga.log( txt, (optional) args ) */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
This is the reference of functions you can call from your Sandbox scripts.&lt;br /&gt;
&lt;br /&gt;
= Javascript =&lt;br /&gt;
&lt;br /&gt;
BGA Sandbox scripts are written in Javascript.&lt;br /&gt;
&lt;br /&gt;
Using Javascript, you can write scripts to automate moves for your Sandbox games &amp;amp; provide rules reinforcement.&lt;br /&gt;
&lt;br /&gt;
Important : in the opposite of the most common usage of Javascript, Sandbox scripts are executed &#039;&#039;&#039;on server side&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
= BGA API =&lt;br /&gt;
&lt;br /&gt;
To interact with your BGA Sandbox game, we provide you an API.&lt;br /&gt;
&lt;br /&gt;
With this API, you can get properties values of game elements from the current game situation, modify them and/or trigger the game actions (ex : move this element here, flip this card, and so on).&lt;br /&gt;
&lt;br /&gt;
= Sandbox Scripts Hello World =&lt;br /&gt;
&lt;br /&gt;
From Sandbox editor &amp;quot;interface view&amp;quot; tab, select an element, and access to its property (top right icon).&lt;br /&gt;
&lt;br /&gt;
Go to &amp;quot;Scripts (advanced)&amp;quot; section.&lt;br /&gt;
&lt;br /&gt;
In front of &amp;quot;When this element is clicked&amp;quot;, enter &amp;quot;onMyClick&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
Close the window. Go to &amp;quot;script view&amp;quot; tab.&lt;br /&gt;
&lt;br /&gt;
Enter the following :&lt;br /&gt;
&lt;br /&gt;
 function onMyClick( element_id )&lt;br /&gt;
 {&lt;br /&gt;
    bga.log(&amp;quot;Hello world! You just clicked on element &amp;quot; + element_id + &amp;quot;. Congrats!&amp;quot;);&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
Save &amp;amp; publish your project, starts a test session, click on the previous element : your message appears in the log on the right!&lt;br /&gt;
&lt;br /&gt;
= Functions you can use in your Sandbox scripts=&lt;br /&gt;
&lt;br /&gt;
== Debugging functions ==&lt;br /&gt;
&lt;br /&gt;
=== bga.trace( txt ) ===&lt;br /&gt;
&lt;br /&gt;
Write something immediately in the BGA log (on the right of the screen).&lt;br /&gt;
&lt;br /&gt;
This is the most practical way to debug your script :)&lt;br /&gt;
&lt;br /&gt;
Note : you can also pass an object in parameter. This will dump the content of this object in the log.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
  // Example : write &amp;quot;Hello world&amp;quot; in the log&lt;br /&gt;
  bga.trace( &amp;quot;Hello world&amp;quot; );&lt;br /&gt;
&lt;br /&gt;
  // Example : dump an associative array in the log&lt;br /&gt;
  bga.trace( { mykey: &#039;myvalue&#039;, another_key: &#039;another_value&#039; } );&lt;br /&gt;
&lt;br /&gt;
=== bga.exit( txt ) ===&lt;br /&gt;
&lt;br /&gt;
Stop the script immediately, display the &amp;quot;txt&amp;quot; messages and cancel (ie : rollback) on every previous API call except bga.trace :&lt;br /&gt;
&lt;br /&gt;
Again : ALL api call are canceled and there will be no visible changes on the interface (ex : no moves, no visible property changes, ...). Only &amp;quot;bga.trace&amp;quot; API commands are kept so you can debug.&lt;br /&gt;
&lt;br /&gt;
bga.exit is very practical when you want to repeat a game action again and again to debug it : with a call to bga.exit at the end of your script, you make sure that your game situation will be kept unchanged after each test.&lt;br /&gt;
&lt;br /&gt;
  // Example :&lt;br /&gt;
  bga.exit( &amp;quot;My script is stopped by this call&amp;quot; );&lt;br /&gt;
&lt;br /&gt;
== Game log (history) ==&lt;br /&gt;
&lt;br /&gt;
=== bga.log( txt, (optional) args ) ===&lt;br /&gt;
&lt;br /&gt;
Write something in the BGA log on the right.&lt;br /&gt;
&lt;br /&gt;
  // Example : simple log&lt;br /&gt;
  bga.log( _(&amp;quot;A new round starts&amp;quot;) );&lt;br /&gt;
&lt;br /&gt;
You may add arguments to your log, like this :&lt;br /&gt;
&lt;br /&gt;
  // Example: log with argument to display a card name.&lt;br /&gt;
  //          In this example, variable &amp;quot;event_name&amp;quot; is specified afterwards.&lt;br /&gt;
  //          Note that using this, game translators only have to translate one &amp;quot;Event XXX is triggered&amp;quot; string for all possible events.&lt;br /&gt;
  bga.log( _(&amp;quot;Event ${event_name} is triggered&amp;quot;), {  event_name: _( &amp;quot;Armageddon&amp;quot; ) } ) );&lt;br /&gt;
&lt;br /&gt;
Note that argument &amp;quot;player_name&amp;quot; is ALWAYS pre-set with the name of the current player, so you can use it immediately.&lt;br /&gt;
&lt;br /&gt;
  // Example :&lt;br /&gt;
  bga.log( _(&amp;quot;${player_name} draw a card from the deck&amp;quot;) );&lt;br /&gt;
&lt;br /&gt;
== Get / search game elements and their properties ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== bga.getElementById( id )===&lt;br /&gt;
&lt;br /&gt;
Get an object with all the properties of the element with specified ID.&lt;br /&gt;
&lt;br /&gt;
Throw an exception if the element does not exists.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===bga.getElementsByIds( ids )===&lt;br /&gt;
&lt;br /&gt;
Get all specified elements with an array of ids.&lt;br /&gt;
&lt;br /&gt;
Return an associative array (element_id =&amp;gt; element).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===bga.getElementsByParent( parent_id )===&lt;br /&gt;
&lt;br /&gt;
Get all children (ie : all elements contained) of the specified element_id.&lt;br /&gt;
&lt;br /&gt;
Ex : if you call getElementsByParent on a deck of cards, you&#039;ll get all cards.&lt;br /&gt;
&lt;br /&gt;
  // Example : Get all cards of a deck with name &amp;quot;mydeck&amp;quot;&lt;br /&gt;
  var cards = bga.getElementsByParent( bga.getElementByName( &#039;mydeck&#039; ) );&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===bga.getElementIdByName( name )===&lt;br /&gt;
&lt;br /&gt;
Get the ID of a Sandbox element from its name.&lt;br /&gt;
&lt;br /&gt;
Return null if there are no element with this name.&lt;br /&gt;
Throw an exception if there are more than 1 element with this name.&lt;br /&gt;
&lt;br /&gt;
  // Example :&lt;br /&gt;
  var chess_square = bga.getElementIdByName( &#039;h3&#039; );&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===bga.getElementsIdsByName( name )===&lt;br /&gt;
&lt;br /&gt;
Get the IDs of all Sandbox elements with this name.&lt;br /&gt;
&lt;br /&gt;
  // Example :&lt;br /&gt;
  var pawn_pieces_ids = bga.getElementsIdByName( &#039;pawn&#039; );&lt;br /&gt;
  &lt;br /&gt;
  // Result : [ 41, 42, 43, ... ]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Utility methods ==&lt;br /&gt;
&lt;br /&gt;
=== bga.isOn( element_id, parent_id ) ===&lt;br /&gt;
&lt;br /&gt;
Return true if &amp;quot;element_id&amp;quot; is a descendant of &amp;quot;parent_id&amp;quot; (ie : if element_id game element has been placed on parent_id game element).&lt;br /&gt;
&lt;br /&gt;
  // Example :&lt;br /&gt;
  if( bga.isOn( bga.getElementIfByName( &#039;Turn counter&#039; ), bga.getElementIfByName( &#039;Turn 6&#039; ) )&lt;br /&gt;
  {&lt;br /&gt;
     // Trigger game end&lt;br /&gt;
  }&lt;br /&gt;
&lt;br /&gt;
== Trigger most common game actions ==&lt;br /&gt;
&lt;br /&gt;
===moveElement( element_id, target_id )===&lt;br /&gt;
&lt;br /&gt;
Move element to specified target id.&lt;br /&gt;
&lt;br /&gt;
The exact destination of element depends on target &amp;quot;howToArrange&amp;quot; property (&amp;quot;How elements are arranged on it?&amp;quot; : spreaded/deck/...).&lt;br /&gt;
&lt;br /&gt;
  // Example :&lt;br /&gt;
  bga.moveElement( bga.getElementIdByName( &#039;Turn counter&#039; ), bga.getElementIdByName( &#039;Turn 3&#039; ) );&lt;/div&gt;</summary>
		<author><name>Sourisdudesert</name></author>
	</entry>
	<entry>
		<id>https://fa.doc.boardgamearena.com/index.php?title=SandboxScripts&amp;diff=2116</id>
		<title>SandboxScripts</title>
		<link rel="alternate" type="text/html" href="https://fa.doc.boardgamearena.com/index.php?title=SandboxScripts&amp;diff=2116"/>
		<updated>2016-12-14T10:14:52Z</updated>

		<summary type="html">&lt;p&gt;Sourisdudesert: /* bga.log( txt ) */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
This is the reference of functions you can call from your Sandbox scripts.&lt;br /&gt;
&lt;br /&gt;
= Javascript =&lt;br /&gt;
&lt;br /&gt;
BGA Sandbox scripts are written in Javascript.&lt;br /&gt;
&lt;br /&gt;
Using Javascript, you can write scripts to automate moves for your Sandbox games &amp;amp; provide rules reinforcement.&lt;br /&gt;
&lt;br /&gt;
Important : in the opposite of the most common usage of Javascript, Sandbox scripts are executed &#039;&#039;&#039;on server side&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
= BGA API =&lt;br /&gt;
&lt;br /&gt;
To interact with your BGA Sandbox game, we provide you an API.&lt;br /&gt;
&lt;br /&gt;
With this API, you can get properties values of game elements from the current game situation, modify them and/or trigger the game actions (ex : move this element here, flip this card, and so on).&lt;br /&gt;
&lt;br /&gt;
= Sandbox Scripts Hello World =&lt;br /&gt;
&lt;br /&gt;
From Sandbox editor &amp;quot;interface view&amp;quot; tab, select an element, and access to its property (top right icon).&lt;br /&gt;
&lt;br /&gt;
Go to &amp;quot;Scripts (advanced)&amp;quot; section.&lt;br /&gt;
&lt;br /&gt;
In front of &amp;quot;When this element is clicked&amp;quot;, enter &amp;quot;onMyClick&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
Close the window. Go to &amp;quot;script view&amp;quot; tab.&lt;br /&gt;
&lt;br /&gt;
Enter the following :&lt;br /&gt;
&lt;br /&gt;
 function onMyClick( element_id )&lt;br /&gt;
 {&lt;br /&gt;
    bga.log(&amp;quot;Hello world! You just clicked on element &amp;quot; + element_id + &amp;quot;. Congrats!&amp;quot;);&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
Save &amp;amp; publish your project, starts a test session, click on the previous element : your message appears in the log on the right!&lt;br /&gt;
&lt;br /&gt;
= Functions you can use in your Sandbox scripts=&lt;br /&gt;
&lt;br /&gt;
== Debugging functions ==&lt;br /&gt;
&lt;br /&gt;
=== bga.trace( txt ) ===&lt;br /&gt;
&lt;br /&gt;
Write something immediately in the BGA log (on the right of the screen).&lt;br /&gt;
&lt;br /&gt;
This is the most practical way to debug your script :)&lt;br /&gt;
&lt;br /&gt;
Note : you can also pass an object in parameter. This will dump the content of this object in the log.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
  // Example : write &amp;quot;Hello world&amp;quot; in the log&lt;br /&gt;
  bga.trace( &amp;quot;Hello world&amp;quot; );&lt;br /&gt;
&lt;br /&gt;
  // Example : dump an associative array in the log&lt;br /&gt;
  bga.trace( { mykey: &#039;myvalue&#039;, another_key: &#039;another_value&#039; } );&lt;br /&gt;
&lt;br /&gt;
=== bga.exit( txt ) ===&lt;br /&gt;
&lt;br /&gt;
Stop the script immediately, display the &amp;quot;txt&amp;quot; messages and cancel (ie : rollback) on every previous API call except bga.trace :&lt;br /&gt;
&lt;br /&gt;
Again : ALL api call are canceled and there will be no visible changes on the interface (ex : no moves, no visible property changes, ...). Only &amp;quot;bga.trace&amp;quot; API commands are kept so you can debug.&lt;br /&gt;
&lt;br /&gt;
bga.exit is very practical when you want to repeat a game action again and again to debug it : with a call to bga.exit at the end of your script, you make sure that your game situation will be kept unchanged after each test.&lt;br /&gt;
&lt;br /&gt;
  // Example :&lt;br /&gt;
  bga.exit( &amp;quot;My script is stopped by this call&amp;quot; );&lt;br /&gt;
&lt;br /&gt;
== Game log (history) ==&lt;br /&gt;
&lt;br /&gt;
=== bga.log( txt, (optional) args ) ===&lt;br /&gt;
&lt;br /&gt;
Write something in the BGA log on the right.&lt;br /&gt;
&lt;br /&gt;
  // Example : simple log&lt;br /&gt;
  bga.log( _(&amp;quot;A new round starts&amp;quot;) );&lt;br /&gt;
&lt;br /&gt;
You may add arguments to your log, like this :&lt;br /&gt;
&lt;br /&gt;
  // Example: log with argument to display a card name.&lt;br /&gt;
  //          In this example, variable &amp;quot;event_name&amp;quot; is specified afterwards.&lt;br /&gt;
  //          Note that using this, game translators only have to translate one &amp;quot;Event XXX is triggered&amp;quot; string for all possible events.&lt;br /&gt;
  bga.log( _(&amp;quot;Event ${event_name} is triggered&amp;quot;), {  event_name: _( &amp;quot;Armageddon&amp;quot; ) } ) );&lt;br /&gt;
&lt;br /&gt;
== Get / search game elements and their properties ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== bga.getElementById( id )===&lt;br /&gt;
&lt;br /&gt;
Get an object with all the properties of the element with specified ID.&lt;br /&gt;
&lt;br /&gt;
Throw an exception if the element does not exists.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===bga.getElementsByIds( ids )===&lt;br /&gt;
&lt;br /&gt;
Get all specified elements with an array of ids.&lt;br /&gt;
&lt;br /&gt;
Return an associative array (element_id =&amp;gt; element).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===bga.getElementsByParent( parent_id )===&lt;br /&gt;
&lt;br /&gt;
Get all children (ie : all elements contained) of the specified element_id.&lt;br /&gt;
&lt;br /&gt;
Ex : if you call getElementsByParent on a deck of cards, you&#039;ll get all cards.&lt;br /&gt;
&lt;br /&gt;
  // Example : Get all cards of a deck with name &amp;quot;mydeck&amp;quot;&lt;br /&gt;
  var cards = bga.getElementsByParent( bga.getElementByName( &#039;mydeck&#039; ) );&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===bga.getElementIdByName( name )===&lt;br /&gt;
&lt;br /&gt;
Get the ID of a Sandbox element from its name.&lt;br /&gt;
&lt;br /&gt;
Return null if there are no element with this name.&lt;br /&gt;
Throw an exception if there are more than 1 element with this name.&lt;br /&gt;
&lt;br /&gt;
  // Example :&lt;br /&gt;
  var chess_square = bga.getElementIdByName( &#039;h3&#039; );&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===bga.getElementsIdsByName( name )===&lt;br /&gt;
&lt;br /&gt;
Get the IDs of all Sandbox elements with this name.&lt;br /&gt;
&lt;br /&gt;
  // Example :&lt;br /&gt;
  var pawn_pieces_ids = bga.getElementsIdByName( &#039;pawn&#039; );&lt;br /&gt;
  &lt;br /&gt;
  // Result : [ 41, 42, 43, ... ]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Utility methods ==&lt;br /&gt;
&lt;br /&gt;
=== bga.isOn( element_id, parent_id ) ===&lt;br /&gt;
&lt;br /&gt;
Return true if &amp;quot;element_id&amp;quot; is a descendant of &amp;quot;parent_id&amp;quot; (ie : if element_id game element has been placed on parent_id game element).&lt;br /&gt;
&lt;br /&gt;
  // Example :&lt;br /&gt;
  if( bga.isOn( bga.getElementIfByName( &#039;Turn counter&#039; ), bga.getElementIfByName( &#039;Turn 6&#039; ) )&lt;br /&gt;
  {&lt;br /&gt;
     // Trigger game end&lt;br /&gt;
  }&lt;br /&gt;
&lt;br /&gt;
== Trigger most common game actions ==&lt;br /&gt;
&lt;br /&gt;
===moveElement( element_id, target_id )===&lt;br /&gt;
&lt;br /&gt;
Move element to specified target id.&lt;br /&gt;
&lt;br /&gt;
The exact destination of element depends on target &amp;quot;howToArrange&amp;quot; property (&amp;quot;How elements are arranged on it?&amp;quot; : spreaded/deck/...).&lt;br /&gt;
&lt;br /&gt;
  // Example :&lt;br /&gt;
  bga.moveElement( bga.getElementIdByName( &#039;Turn counter&#039; ), bga.getElementIdByName( &#039;Turn 3&#039; ) );&lt;/div&gt;</summary>
		<author><name>Sourisdudesert</name></author>
	</entry>
	<entry>
		<id>https://fa.doc.boardgamearena.com/index.php?title=SandboxScripts&amp;diff=2115</id>
		<title>SandboxScripts</title>
		<link rel="alternate" type="text/html" href="https://fa.doc.boardgamearena.com/index.php?title=SandboxScripts&amp;diff=2115"/>
		<updated>2016-12-14T09:50:57Z</updated>

		<summary type="html">&lt;p&gt;Sourisdudesert: /* Get / search game elements and their properties */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
This is the reference of functions you can call from your Sandbox scripts.&lt;br /&gt;
&lt;br /&gt;
= Javascript =&lt;br /&gt;
&lt;br /&gt;
BGA Sandbox scripts are written in Javascript.&lt;br /&gt;
&lt;br /&gt;
Using Javascript, you can write scripts to automate moves for your Sandbox games &amp;amp; provide rules reinforcement.&lt;br /&gt;
&lt;br /&gt;
Important : in the opposite of the most common usage of Javascript, Sandbox scripts are executed &#039;&#039;&#039;on server side&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
= BGA API =&lt;br /&gt;
&lt;br /&gt;
To interact with your BGA Sandbox game, we provide you an API.&lt;br /&gt;
&lt;br /&gt;
With this API, you can get properties values of game elements from the current game situation, modify them and/or trigger the game actions (ex : move this element here, flip this card, and so on).&lt;br /&gt;
&lt;br /&gt;
= Sandbox Scripts Hello World =&lt;br /&gt;
&lt;br /&gt;
From Sandbox editor &amp;quot;interface view&amp;quot; tab, select an element, and access to its property (top right icon).&lt;br /&gt;
&lt;br /&gt;
Go to &amp;quot;Scripts (advanced)&amp;quot; section.&lt;br /&gt;
&lt;br /&gt;
In front of &amp;quot;When this element is clicked&amp;quot;, enter &amp;quot;onMyClick&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
Close the window. Go to &amp;quot;script view&amp;quot; tab.&lt;br /&gt;
&lt;br /&gt;
Enter the following :&lt;br /&gt;
&lt;br /&gt;
 function onMyClick( element_id )&lt;br /&gt;
 {&lt;br /&gt;
    bga.log(&amp;quot;Hello world! You just clicked on element &amp;quot; + element_id + &amp;quot;. Congrats!&amp;quot;);&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
Save &amp;amp; publish your project, starts a test session, click on the previous element : your message appears in the log on the right!&lt;br /&gt;
&lt;br /&gt;
= Functions you can use in your Sandbox scripts=&lt;br /&gt;
&lt;br /&gt;
== Debugging functions ==&lt;br /&gt;
&lt;br /&gt;
=== bga.trace( txt ) ===&lt;br /&gt;
&lt;br /&gt;
Write something immediately in the BGA log (on the right of the screen).&lt;br /&gt;
&lt;br /&gt;
This is the most practical way to debug your script :)&lt;br /&gt;
&lt;br /&gt;
Note : you can also pass an object in parameter. This will dump the content of this object in the log.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
  // Example : write &amp;quot;Hello world&amp;quot; in the log&lt;br /&gt;
  bga.trace( &amp;quot;Hello world&amp;quot; );&lt;br /&gt;
&lt;br /&gt;
  // Example : dump an associative array in the log&lt;br /&gt;
  bga.trace( { mykey: &#039;myvalue&#039;, another_key: &#039;another_value&#039; } );&lt;br /&gt;
&lt;br /&gt;
=== bga.exit( txt ) ===&lt;br /&gt;
&lt;br /&gt;
Stop the script immediately, display the &amp;quot;txt&amp;quot; messages and cancel (ie : rollback) on every previous API call except bga.trace :&lt;br /&gt;
&lt;br /&gt;
Again : ALL api call are canceled and there will be no visible changes on the interface (ex : no moves, no visible property changes, ...). Only &amp;quot;bga.trace&amp;quot; API commands are kept so you can debug.&lt;br /&gt;
&lt;br /&gt;
bga.exit is very practical when you want to repeat a game action again and again to debug it : with a call to bga.exit at the end of your script, you make sure that your game situation will be kept unchanged after each test.&lt;br /&gt;
&lt;br /&gt;
  // Example :&lt;br /&gt;
  bga.exit( &amp;quot;My script is stopped by this call&amp;quot; );&lt;br /&gt;
&lt;br /&gt;
== Game log (history) ==&lt;br /&gt;
&lt;br /&gt;
=== bga.log( txt ) ===&lt;br /&gt;
&lt;br /&gt;
Write something in the BGA log on the right.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Get / search game elements and their properties ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== bga.getElementById( id )===&lt;br /&gt;
&lt;br /&gt;
Get an object with all the properties of the element with specified ID.&lt;br /&gt;
&lt;br /&gt;
Throw an exception if the element does not exists.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===bga.getElementsByIds( ids )===&lt;br /&gt;
&lt;br /&gt;
Get all specified elements with an array of ids.&lt;br /&gt;
&lt;br /&gt;
Return an associative array (element_id =&amp;gt; element).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===bga.getElementsByParent( parent_id )===&lt;br /&gt;
&lt;br /&gt;
Get all children (ie : all elements contained) of the specified element_id.&lt;br /&gt;
&lt;br /&gt;
Ex : if you call getElementsByParent on a deck of cards, you&#039;ll get all cards.&lt;br /&gt;
&lt;br /&gt;
  // Example : Get all cards of a deck with name &amp;quot;mydeck&amp;quot;&lt;br /&gt;
  var cards = bga.getElementsByParent( bga.getElementByName( &#039;mydeck&#039; ) );&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===bga.getElementIdByName( name )===&lt;br /&gt;
&lt;br /&gt;
Get the ID of a Sandbox element from its name.&lt;br /&gt;
&lt;br /&gt;
Return null if there are no element with this name.&lt;br /&gt;
Throw an exception if there are more than 1 element with this name.&lt;br /&gt;
&lt;br /&gt;
  // Example :&lt;br /&gt;
  var chess_square = bga.getElementIdByName( &#039;h3&#039; );&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===bga.getElementsIdsByName( name )===&lt;br /&gt;
&lt;br /&gt;
Get the IDs of all Sandbox elements with this name.&lt;br /&gt;
&lt;br /&gt;
  // Example :&lt;br /&gt;
  var pawn_pieces_ids = bga.getElementsIdByName( &#039;pawn&#039; );&lt;br /&gt;
  &lt;br /&gt;
  // Result : [ 41, 42, 43, ... ]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Utility methods ==&lt;br /&gt;
&lt;br /&gt;
=== bga.isOn( element_id, parent_id ) ===&lt;br /&gt;
&lt;br /&gt;
Return true if &amp;quot;element_id&amp;quot; is a descendant of &amp;quot;parent_id&amp;quot; (ie : if element_id game element has been placed on parent_id game element).&lt;br /&gt;
&lt;br /&gt;
  // Example :&lt;br /&gt;
  if( bga.isOn( bga.getElementIfByName( &#039;Turn counter&#039; ), bga.getElementIfByName( &#039;Turn 6&#039; ) )&lt;br /&gt;
  {&lt;br /&gt;
     // Trigger game end&lt;br /&gt;
  }&lt;br /&gt;
&lt;br /&gt;
== Trigger most common game actions ==&lt;br /&gt;
&lt;br /&gt;
===moveElement( element_id, target_id )===&lt;br /&gt;
&lt;br /&gt;
Move element to specified target id.&lt;br /&gt;
&lt;br /&gt;
The exact destination of element depends on target &amp;quot;howToArrange&amp;quot; property (&amp;quot;How elements are arranged on it?&amp;quot; : spreaded/deck/...).&lt;br /&gt;
&lt;br /&gt;
  // Example :&lt;br /&gt;
  bga.moveElement( bga.getElementIdByName( &#039;Turn counter&#039; ), bga.getElementIdByName( &#039;Turn 3&#039; ) );&lt;/div&gt;</summary>
		<author><name>Sourisdudesert</name></author>
	</entry>
	<entry>
		<id>https://fa.doc.boardgamearena.com/index.php?title=SandboxScripts&amp;diff=2114</id>
		<title>SandboxScripts</title>
		<link rel="alternate" type="text/html" href="https://fa.doc.boardgamearena.com/index.php?title=SandboxScripts&amp;diff=2114"/>
		<updated>2016-12-14T09:47:43Z</updated>

		<summary type="html">&lt;p&gt;Sourisdudesert: /* Get / search game elements and their properties */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
This is the reference of functions you can call from your Sandbox scripts.&lt;br /&gt;
&lt;br /&gt;
= Javascript =&lt;br /&gt;
&lt;br /&gt;
BGA Sandbox scripts are written in Javascript.&lt;br /&gt;
&lt;br /&gt;
Using Javascript, you can write scripts to automate moves for your Sandbox games &amp;amp; provide rules reinforcement.&lt;br /&gt;
&lt;br /&gt;
Important : in the opposite of the most common usage of Javascript, Sandbox scripts are executed &#039;&#039;&#039;on server side&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
= BGA API =&lt;br /&gt;
&lt;br /&gt;
To interact with your BGA Sandbox game, we provide you an API.&lt;br /&gt;
&lt;br /&gt;
With this API, you can get properties values of game elements from the current game situation, modify them and/or trigger the game actions (ex : move this element here, flip this card, and so on).&lt;br /&gt;
&lt;br /&gt;
= Sandbox Scripts Hello World =&lt;br /&gt;
&lt;br /&gt;
From Sandbox editor &amp;quot;interface view&amp;quot; tab, select an element, and access to its property (top right icon).&lt;br /&gt;
&lt;br /&gt;
Go to &amp;quot;Scripts (advanced)&amp;quot; section.&lt;br /&gt;
&lt;br /&gt;
In front of &amp;quot;When this element is clicked&amp;quot;, enter &amp;quot;onMyClick&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
Close the window. Go to &amp;quot;script view&amp;quot; tab.&lt;br /&gt;
&lt;br /&gt;
Enter the following :&lt;br /&gt;
&lt;br /&gt;
 function onMyClick( element_id )&lt;br /&gt;
 {&lt;br /&gt;
    bga.log(&amp;quot;Hello world! You just clicked on element &amp;quot; + element_id + &amp;quot;. Congrats!&amp;quot;);&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
Save &amp;amp; publish your project, starts a test session, click on the previous element : your message appears in the log on the right!&lt;br /&gt;
&lt;br /&gt;
= Functions you can use in your Sandbox scripts=&lt;br /&gt;
&lt;br /&gt;
== Debugging functions ==&lt;br /&gt;
&lt;br /&gt;
=== bga.trace( txt ) ===&lt;br /&gt;
&lt;br /&gt;
Write something immediately in the BGA log (on the right of the screen).&lt;br /&gt;
&lt;br /&gt;
This is the most practical way to debug your script :)&lt;br /&gt;
&lt;br /&gt;
Note : you can also pass an object in parameter. This will dump the content of this object in the log.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
  // Example : write &amp;quot;Hello world&amp;quot; in the log&lt;br /&gt;
  bga.trace( &amp;quot;Hello world&amp;quot; );&lt;br /&gt;
&lt;br /&gt;
  // Example : dump an associative array in the log&lt;br /&gt;
  bga.trace( { mykey: &#039;myvalue&#039;, another_key: &#039;another_value&#039; } );&lt;br /&gt;
&lt;br /&gt;
=== bga.exit( txt ) ===&lt;br /&gt;
&lt;br /&gt;
Stop the script immediately, display the &amp;quot;txt&amp;quot; messages and cancel (ie : rollback) on every previous API call except bga.trace :&lt;br /&gt;
&lt;br /&gt;
Again : ALL api call are canceled and there will be no visible changes on the interface (ex : no moves, no visible property changes, ...). Only &amp;quot;bga.trace&amp;quot; API commands are kept so you can debug.&lt;br /&gt;
&lt;br /&gt;
bga.exit is very practical when you want to repeat a game action again and again to debug it : with a call to bga.exit at the end of your script, you make sure that your game situation will be kept unchanged after each test.&lt;br /&gt;
&lt;br /&gt;
  // Example :&lt;br /&gt;
  bga.exit( &amp;quot;My script is stopped by this call&amp;quot; );&lt;br /&gt;
&lt;br /&gt;
== Game log (history) ==&lt;br /&gt;
&lt;br /&gt;
=== bga.log( txt ) ===&lt;br /&gt;
&lt;br /&gt;
Write something in the BGA log on the right.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Get / search game elements and their properties ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== bga.getElementById( id )===&lt;br /&gt;
&lt;br /&gt;
Get an object with all the properties of the element with specified ID.&lt;br /&gt;
&lt;br /&gt;
Throw an exception if the element does not exists.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===bga.getElementsByIds( ids )===&lt;br /&gt;
&lt;br /&gt;
Get all specified elements with an array of ids.&lt;br /&gt;
&lt;br /&gt;
Return an associative array (element_id =&amp;gt; element).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===bga.getElementsByParent( parent_id )===&lt;br /&gt;
&lt;br /&gt;
Get all children (ie : all elements contained) of the specified element_id.&lt;br /&gt;
&lt;br /&gt;
Ex : if you call getElementsByParent on a deck of cards, you&#039;ll get all cards.&lt;br /&gt;
&lt;br /&gt;
  // Example : Get all cards of a deck with name &amp;quot;mydeck&amp;quot;&lt;br /&gt;
  var cards = bga.getElementsByParent( bga.getElementByName( &#039;mydeck&#039; ) );&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===bga.getElementIdByName( name )===&lt;br /&gt;
&lt;br /&gt;
Get the ID of a Sandbox element from its name.&lt;br /&gt;
&lt;br /&gt;
Return null if there are no element with this name.&lt;br /&gt;
Throw an exception if there are more than 1 element with this name.&lt;br /&gt;
&lt;br /&gt;
  // Example :&lt;br /&gt;
  var chess_square = bga.getElementIdByName( &#039;h3&#039; );&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===bga.getElementIdsByName( name )===&lt;br /&gt;
&lt;br /&gt;
Get the IDs of all Sandbox elements with this name.&lt;br /&gt;
&lt;br /&gt;
  // Example :&lt;br /&gt;
  var pawn_pieces_ids = bga.getElementIdByName( &#039;pawn&#039; );&lt;br /&gt;
  &lt;br /&gt;
  // Result : [ 41, 42, 43, ... ]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Trigger most common game actions ==&lt;br /&gt;
&lt;br /&gt;
===moveElement( element_id, target_id )===&lt;br /&gt;
&lt;br /&gt;
Move element to specified target id.&lt;br /&gt;
&lt;br /&gt;
The exact destination of element depends on target &amp;quot;howToArrange&amp;quot; property (&amp;quot;How elements are arranged on it?&amp;quot; : spreaded/deck/...).&lt;br /&gt;
&lt;br /&gt;
  // Example :&lt;br /&gt;
  bga.moveElement( bga.getElementIdByName( &#039;Turn counter&#039; ), bga.getElementIdByName( &#039;Turn 3&#039; ) );&lt;/div&gt;</summary>
		<author><name>Sourisdudesert</name></author>
	</entry>
	<entry>
		<id>https://fa.doc.boardgamearena.com/index.php?title=SandboxScripts&amp;diff=2113</id>
		<title>SandboxScripts</title>
		<link rel="alternate" type="text/html" href="https://fa.doc.boardgamearena.com/index.php?title=SandboxScripts&amp;diff=2113"/>
		<updated>2016-12-14T09:44:28Z</updated>

		<summary type="html">&lt;p&gt;Sourisdudesert: /* bga.getElementIdsByName( name ) */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
This is the reference of functions you can call from your Sandbox scripts.&lt;br /&gt;
&lt;br /&gt;
= Javascript =&lt;br /&gt;
&lt;br /&gt;
BGA Sandbox scripts are written in Javascript.&lt;br /&gt;
&lt;br /&gt;
Using Javascript, you can write scripts to automate moves for your Sandbox games &amp;amp; provide rules reinforcement.&lt;br /&gt;
&lt;br /&gt;
Important : in the opposite of the most common usage of Javascript, Sandbox scripts are executed &#039;&#039;&#039;on server side&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
= BGA API =&lt;br /&gt;
&lt;br /&gt;
To interact with your BGA Sandbox game, we provide you an API.&lt;br /&gt;
&lt;br /&gt;
With this API, you can get properties values of game elements from the current game situation, modify them and/or trigger the game actions (ex : move this element here, flip this card, and so on).&lt;br /&gt;
&lt;br /&gt;
= Sandbox Scripts Hello World =&lt;br /&gt;
&lt;br /&gt;
From Sandbox editor &amp;quot;interface view&amp;quot; tab, select an element, and access to its property (top right icon).&lt;br /&gt;
&lt;br /&gt;
Go to &amp;quot;Scripts (advanced)&amp;quot; section.&lt;br /&gt;
&lt;br /&gt;
In front of &amp;quot;When this element is clicked&amp;quot;, enter &amp;quot;onMyClick&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
Close the window. Go to &amp;quot;script view&amp;quot; tab.&lt;br /&gt;
&lt;br /&gt;
Enter the following :&lt;br /&gt;
&lt;br /&gt;
 function onMyClick( element_id )&lt;br /&gt;
 {&lt;br /&gt;
    bga.log(&amp;quot;Hello world! You just clicked on element &amp;quot; + element_id + &amp;quot;. Congrats!&amp;quot;);&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
Save &amp;amp; publish your project, starts a test session, click on the previous element : your message appears in the log on the right!&lt;br /&gt;
&lt;br /&gt;
= Functions you can use in your Sandbox scripts=&lt;br /&gt;
&lt;br /&gt;
== Debugging functions ==&lt;br /&gt;
&lt;br /&gt;
=== bga.trace( txt ) ===&lt;br /&gt;
&lt;br /&gt;
Write something immediately in the BGA log (on the right of the screen).&lt;br /&gt;
&lt;br /&gt;
This is the most practical way to debug your script :)&lt;br /&gt;
&lt;br /&gt;
Note : you can also pass an object in parameter. This will dump the content of this object in the log.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
  // Example : write &amp;quot;Hello world&amp;quot; in the log&lt;br /&gt;
  bga.trace( &amp;quot;Hello world&amp;quot; );&lt;br /&gt;
&lt;br /&gt;
  // Example : dump an associative array in the log&lt;br /&gt;
  bga.trace( { mykey: &#039;myvalue&#039;, another_key: &#039;another_value&#039; } );&lt;br /&gt;
&lt;br /&gt;
=== bga.exit( txt ) ===&lt;br /&gt;
&lt;br /&gt;
Stop the script immediately, display the &amp;quot;txt&amp;quot; messages and cancel (ie : rollback) on every previous API call except bga.trace :&lt;br /&gt;
&lt;br /&gt;
Again : ALL api call are canceled and there will be no visible changes on the interface (ex : no moves, no visible property changes, ...). Only &amp;quot;bga.trace&amp;quot; API commands are kept so you can debug.&lt;br /&gt;
&lt;br /&gt;
bga.exit is very practical when you want to repeat a game action again and again to debug it : with a call to bga.exit at the end of your script, you make sure that your game situation will be kept unchanged after each test.&lt;br /&gt;
&lt;br /&gt;
  // Example :&lt;br /&gt;
  bga.exit( &amp;quot;My script is stopped by this call&amp;quot; );&lt;br /&gt;
&lt;br /&gt;
== Game log (history) ==&lt;br /&gt;
&lt;br /&gt;
=== bga.log( txt ) ===&lt;br /&gt;
&lt;br /&gt;
Write something in the BGA log on the right.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Get / search game elements and their properties ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== bga.getElementById( id )===&lt;br /&gt;
&lt;br /&gt;
Get an object with all the properties of the element with specified ID.&lt;br /&gt;
&lt;br /&gt;
Throw an exception if the element does not exists.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===bga.getElementsByIds( ids )===&lt;br /&gt;
&lt;br /&gt;
Get all specified elements with an array of ids.&lt;br /&gt;
&lt;br /&gt;
Return an associative array (element_id =&amp;gt; element).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===bga.getElementsByParent( parent_id )===&lt;br /&gt;
&lt;br /&gt;
Get all children (ie : all elements contained) of the specified element_id.&lt;br /&gt;
&lt;br /&gt;
Ex : if you call getElementsByParent on a deck of cards, you&#039;ll get all cards.&lt;br /&gt;
&lt;br /&gt;
  // Example : Get all cards of a deck with name &amp;quot;mydeck&amp;quot;&lt;br /&gt;
  var cards = bga.getElementsByParent( bga.getElementByName( &#039;mydeck&#039; ) );&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===bga.getElementIdByName( name )===&lt;br /&gt;
&lt;br /&gt;
Get the ID of a Sandbox element from its name.&lt;br /&gt;
&lt;br /&gt;
Return null if there are no element with this name.&lt;br /&gt;
Throw an exception if there are more than 1 element with this name.&lt;br /&gt;
&lt;br /&gt;
  // Example :&lt;br /&gt;
  var chess_square = bga.getElementIdByName( &#039;h3&#039; );&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===bga.getElementIdsByName( name )===&lt;br /&gt;
&lt;br /&gt;
Get the IDs of all Sandbox elements with this name.&lt;br /&gt;
&lt;br /&gt;
  // Example :&lt;br /&gt;
  var pawn_pieces_ids = bga.getElementIdByName( &#039;pawn&#039; );&lt;br /&gt;
  &lt;br /&gt;
  // Result : [ 41, 42, 43, ... ]&lt;br /&gt;
&lt;br /&gt;
===moveElement( element_id, target_id )===&lt;br /&gt;
&lt;br /&gt;
Move element to specified target id.&lt;/div&gt;</summary>
		<author><name>Sourisdudesert</name></author>
	</entry>
	<entry>
		<id>https://fa.doc.boardgamearena.com/index.php?title=SandboxScripts&amp;diff=2112</id>
		<title>SandboxScripts</title>
		<link rel="alternate" type="text/html" href="https://fa.doc.boardgamearena.com/index.php?title=SandboxScripts&amp;diff=2112"/>
		<updated>2016-12-14T09:44:19Z</updated>

		<summary type="html">&lt;p&gt;Sourisdudesert: /* Get / search game elements and their properties */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
This is the reference of functions you can call from your Sandbox scripts.&lt;br /&gt;
&lt;br /&gt;
= Javascript =&lt;br /&gt;
&lt;br /&gt;
BGA Sandbox scripts are written in Javascript.&lt;br /&gt;
&lt;br /&gt;
Using Javascript, you can write scripts to automate moves for your Sandbox games &amp;amp; provide rules reinforcement.&lt;br /&gt;
&lt;br /&gt;
Important : in the opposite of the most common usage of Javascript, Sandbox scripts are executed &#039;&#039;&#039;on server side&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
= BGA API =&lt;br /&gt;
&lt;br /&gt;
To interact with your BGA Sandbox game, we provide you an API.&lt;br /&gt;
&lt;br /&gt;
With this API, you can get properties values of game elements from the current game situation, modify them and/or trigger the game actions (ex : move this element here, flip this card, and so on).&lt;br /&gt;
&lt;br /&gt;
= Sandbox Scripts Hello World =&lt;br /&gt;
&lt;br /&gt;
From Sandbox editor &amp;quot;interface view&amp;quot; tab, select an element, and access to its property (top right icon).&lt;br /&gt;
&lt;br /&gt;
Go to &amp;quot;Scripts (advanced)&amp;quot; section.&lt;br /&gt;
&lt;br /&gt;
In front of &amp;quot;When this element is clicked&amp;quot;, enter &amp;quot;onMyClick&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
Close the window. Go to &amp;quot;script view&amp;quot; tab.&lt;br /&gt;
&lt;br /&gt;
Enter the following :&lt;br /&gt;
&lt;br /&gt;
 function onMyClick( element_id )&lt;br /&gt;
 {&lt;br /&gt;
    bga.log(&amp;quot;Hello world! You just clicked on element &amp;quot; + element_id + &amp;quot;. Congrats!&amp;quot;);&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
Save &amp;amp; publish your project, starts a test session, click on the previous element : your message appears in the log on the right!&lt;br /&gt;
&lt;br /&gt;
= Functions you can use in your Sandbox scripts=&lt;br /&gt;
&lt;br /&gt;
== Debugging functions ==&lt;br /&gt;
&lt;br /&gt;
=== bga.trace( txt ) ===&lt;br /&gt;
&lt;br /&gt;
Write something immediately in the BGA log (on the right of the screen).&lt;br /&gt;
&lt;br /&gt;
This is the most practical way to debug your script :)&lt;br /&gt;
&lt;br /&gt;
Note : you can also pass an object in parameter. This will dump the content of this object in the log.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
  // Example : write &amp;quot;Hello world&amp;quot; in the log&lt;br /&gt;
  bga.trace( &amp;quot;Hello world&amp;quot; );&lt;br /&gt;
&lt;br /&gt;
  // Example : dump an associative array in the log&lt;br /&gt;
  bga.trace( { mykey: &#039;myvalue&#039;, another_key: &#039;another_value&#039; } );&lt;br /&gt;
&lt;br /&gt;
=== bga.exit( txt ) ===&lt;br /&gt;
&lt;br /&gt;
Stop the script immediately, display the &amp;quot;txt&amp;quot; messages and cancel (ie : rollback) on every previous API call except bga.trace :&lt;br /&gt;
&lt;br /&gt;
Again : ALL api call are canceled and there will be no visible changes on the interface (ex : no moves, no visible property changes, ...). Only &amp;quot;bga.trace&amp;quot; API commands are kept so you can debug.&lt;br /&gt;
&lt;br /&gt;
bga.exit is very practical when you want to repeat a game action again and again to debug it : with a call to bga.exit at the end of your script, you make sure that your game situation will be kept unchanged after each test.&lt;br /&gt;
&lt;br /&gt;
  // Example :&lt;br /&gt;
  bga.exit( &amp;quot;My script is stopped by this call&amp;quot; );&lt;br /&gt;
&lt;br /&gt;
== Game log (history) ==&lt;br /&gt;
&lt;br /&gt;
=== bga.log( txt ) ===&lt;br /&gt;
&lt;br /&gt;
Write something in the BGA log on the right.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Get / search game elements and their properties ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== bga.getElementById( id )===&lt;br /&gt;
&lt;br /&gt;
Get an object with all the properties of the element with specified ID.&lt;br /&gt;
&lt;br /&gt;
Throw an exception if the element does not exists.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===bga.getElementsByIds( ids )===&lt;br /&gt;
&lt;br /&gt;
Get all specified elements with an array of ids.&lt;br /&gt;
&lt;br /&gt;
Return an associative array (element_id =&amp;gt; element).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===bga.getElementsByParent( parent_id )===&lt;br /&gt;
&lt;br /&gt;
Get all children (ie : all elements contained) of the specified element_id.&lt;br /&gt;
&lt;br /&gt;
Ex : if you call getElementsByParent on a deck of cards, you&#039;ll get all cards.&lt;br /&gt;
&lt;br /&gt;
  // Example : Get all cards of a deck with name &amp;quot;mydeck&amp;quot;&lt;br /&gt;
  var cards = bga.getElementsByParent( bga.getElementByName( &#039;mydeck&#039; ) );&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===bga.getElementIdByName( name )===&lt;br /&gt;
&lt;br /&gt;
Get the ID of a Sandbox element from its name.&lt;br /&gt;
&lt;br /&gt;
Return null if there are no element with this name.&lt;br /&gt;
Throw an exception if there are more than 1 element with this name.&lt;br /&gt;
&lt;br /&gt;
  // Example :&lt;br /&gt;
  var chess_square = bga.getElementIdByName( &#039;h3&#039; );&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===bga.getElementIdsByName( name )===&lt;br /&gt;
&lt;br /&gt;
Get the IDs of all Sandbox elements with this name.&lt;br /&gt;
&lt;br /&gt;
  // Example :&lt;br /&gt;
  var pawn_pieces_ids = bga.getElementIdByName( &#039;pawn&#039; );&lt;br /&gt;
&lt;br /&gt;
  // Result : [ 41, 42, 43, ... ]&lt;br /&gt;
&lt;br /&gt;
===moveElement( element_id, target_id )===&lt;br /&gt;
&lt;br /&gt;
Move element to specified target id.&lt;/div&gt;</summary>
		<author><name>Sourisdudesert</name></author>
	</entry>
	<entry>
		<id>https://fa.doc.boardgamearena.com/index.php?title=SandboxScripts&amp;diff=2111</id>
		<title>SandboxScripts</title>
		<link rel="alternate" type="text/html" href="https://fa.doc.boardgamearena.com/index.php?title=SandboxScripts&amp;diff=2111"/>
		<updated>2016-12-14T09:41:46Z</updated>

		<summary type="html">&lt;p&gt;Sourisdudesert: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
This is the reference of functions you can call from your Sandbox scripts.&lt;br /&gt;
&lt;br /&gt;
= Javascript =&lt;br /&gt;
&lt;br /&gt;
BGA Sandbox scripts are written in Javascript.&lt;br /&gt;
&lt;br /&gt;
Using Javascript, you can write scripts to automate moves for your Sandbox games &amp;amp; provide rules reinforcement.&lt;br /&gt;
&lt;br /&gt;
Important : in the opposite of the most common usage of Javascript, Sandbox scripts are executed &#039;&#039;&#039;on server side&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
= BGA API =&lt;br /&gt;
&lt;br /&gt;
To interact with your BGA Sandbox game, we provide you an API.&lt;br /&gt;
&lt;br /&gt;
With this API, you can get properties values of game elements from the current game situation, modify them and/or trigger the game actions (ex : move this element here, flip this card, and so on).&lt;br /&gt;
&lt;br /&gt;
= Sandbox Scripts Hello World =&lt;br /&gt;
&lt;br /&gt;
From Sandbox editor &amp;quot;interface view&amp;quot; tab, select an element, and access to its property (top right icon).&lt;br /&gt;
&lt;br /&gt;
Go to &amp;quot;Scripts (advanced)&amp;quot; section.&lt;br /&gt;
&lt;br /&gt;
In front of &amp;quot;When this element is clicked&amp;quot;, enter &amp;quot;onMyClick&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
Close the window. Go to &amp;quot;script view&amp;quot; tab.&lt;br /&gt;
&lt;br /&gt;
Enter the following :&lt;br /&gt;
&lt;br /&gt;
 function onMyClick( element_id )&lt;br /&gt;
 {&lt;br /&gt;
    bga.log(&amp;quot;Hello world! You just clicked on element &amp;quot; + element_id + &amp;quot;. Congrats!&amp;quot;);&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
Save &amp;amp; publish your project, starts a test session, click on the previous element : your message appears in the log on the right!&lt;br /&gt;
&lt;br /&gt;
= Functions you can use in your Sandbox scripts=&lt;br /&gt;
&lt;br /&gt;
== Debugging functions ==&lt;br /&gt;
&lt;br /&gt;
=== bga.trace( txt ) ===&lt;br /&gt;
&lt;br /&gt;
Write something immediately in the BGA log (on the right of the screen).&lt;br /&gt;
&lt;br /&gt;
This is the most practical way to debug your script :)&lt;br /&gt;
&lt;br /&gt;
Note : you can also pass an object in parameter. This will dump the content of this object in the log.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
  // Example : write &amp;quot;Hello world&amp;quot; in the log&lt;br /&gt;
  bga.trace( &amp;quot;Hello world&amp;quot; );&lt;br /&gt;
&lt;br /&gt;
  // Example : dump an associative array in the log&lt;br /&gt;
  bga.trace( { mykey: &#039;myvalue&#039;, another_key: &#039;another_value&#039; } );&lt;br /&gt;
&lt;br /&gt;
=== bga.exit( txt ) ===&lt;br /&gt;
&lt;br /&gt;
Stop the script immediately, display the &amp;quot;txt&amp;quot; messages and cancel (ie : rollback) on every previous API call except bga.trace :&lt;br /&gt;
&lt;br /&gt;
Again : ALL api call are canceled and there will be no visible changes on the interface (ex : no moves, no visible property changes, ...). Only &amp;quot;bga.trace&amp;quot; API commands are kept so you can debug.&lt;br /&gt;
&lt;br /&gt;
bga.exit is very practical when you want to repeat a game action again and again to debug it : with a call to bga.exit at the end of your script, you make sure that your game situation will be kept unchanged after each test.&lt;br /&gt;
&lt;br /&gt;
  // Example :&lt;br /&gt;
  bga.exit( &amp;quot;My script is stopped by this call&amp;quot; );&lt;br /&gt;
&lt;br /&gt;
== Game log (history) ==&lt;br /&gt;
&lt;br /&gt;
=== bga.log( txt ) ===&lt;br /&gt;
&lt;br /&gt;
Write something in the BGA log on the right.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Get / search game elements and their properties ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== bga.getElementById( id )===&lt;br /&gt;
&lt;br /&gt;
Get an object with all the properties of the element with specified ID.&lt;br /&gt;
&lt;br /&gt;
Throw an exception if the element does not exists.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===bga.getElementsByIds( ids )===&lt;br /&gt;
&lt;br /&gt;
Get all specified elements with an array of ids.&lt;br /&gt;
&lt;br /&gt;
Return an associative array (element_id =&amp;gt; element).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===bga.getElementsByParent( parent_id )===&lt;br /&gt;
&lt;br /&gt;
Get all children (ie : all elements contained) of the specified element_id.&lt;br /&gt;
&lt;br /&gt;
Ex : if you call getElementsByParent on a deck of cards, you&#039;ll get all cards.&lt;br /&gt;
&lt;br /&gt;
  // Example : Get all cards of a deck with name &amp;quot;mydeck&amp;quot;&lt;br /&gt;
  var cards = bga.getElementsByParent( bga.getElementByName( &#039;mydeck&#039; ) );&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===bga.getElementIdByName( name )===&lt;br /&gt;
&lt;br /&gt;
Get the ID of a Sandbox element from its name.&lt;br /&gt;
&lt;br /&gt;
Return null if there are no element with this name.&lt;br /&gt;
Throw an exception if there are more than 1 element with this name.&lt;br /&gt;
&lt;br /&gt;
===moveElement( element_id, target_id )===&lt;br /&gt;
&lt;br /&gt;
Move element to specified target id.&lt;/div&gt;</summary>
		<author><name>Sourisdudesert</name></author>
	</entry>
	<entry>
		<id>https://fa.doc.boardgamearena.com/index.php?title=SandboxScripts&amp;diff=2110</id>
		<title>SandboxScripts</title>
		<link rel="alternate" type="text/html" href="https://fa.doc.boardgamearena.com/index.php?title=SandboxScripts&amp;diff=2110"/>
		<updated>2016-12-14T09:40:16Z</updated>

		<summary type="html">&lt;p&gt;Sourisdudesert: /* bga.exit( txt ) */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
This is the reference of functions you can call from your Sandbox scripts.&lt;br /&gt;
&lt;br /&gt;
= Javascript =&lt;br /&gt;
&lt;br /&gt;
BGA Sandbox scripts are written in Javascript.&lt;br /&gt;
&lt;br /&gt;
Using Javascript, you can write scripts to automate moves for your Sandbox games &amp;amp; provide rules reinforcement.&lt;br /&gt;
&lt;br /&gt;
Important : in the opposite of the most common usage of Javascript, Sandbox scripts are executed &#039;&#039;&#039;on server side&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
= BGA API =&lt;br /&gt;
&lt;br /&gt;
To interact with your BGA Sandbox game, we provide you an API.&lt;br /&gt;
&lt;br /&gt;
With this API, you can get properties values of game elements from the current game situation, modify them and/or trigger the game actions (ex : move this element here, flip this card, and so on).&lt;br /&gt;
&lt;br /&gt;
= Sandbox Scripts Hello World =&lt;br /&gt;
&lt;br /&gt;
From Sandbox editor &amp;quot;interface view&amp;quot; tab, select an element, and access to its property (top right icon).&lt;br /&gt;
&lt;br /&gt;
Go to &amp;quot;Scripts (advanced)&amp;quot; section.&lt;br /&gt;
&lt;br /&gt;
In front of &amp;quot;When this element is clicked&amp;quot;, enter &amp;quot;onMyClick&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
Close the window. Go to &amp;quot;script view&amp;quot; tab.&lt;br /&gt;
&lt;br /&gt;
Enter the following :&lt;br /&gt;
&lt;br /&gt;
 function onMyClick( element_id )&lt;br /&gt;
 {&lt;br /&gt;
    bga.log(&amp;quot;Hello world! You just clicked on element &amp;quot; + element_id + &amp;quot;. Congrats!&amp;quot;);&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
Save &amp;amp; publish your project, starts a test session, click on the previous element : your message appears in the log on the right!&lt;br /&gt;
&lt;br /&gt;
= Functions you can use in your Sandbox scripts=&lt;br /&gt;
&lt;br /&gt;
== Debugging functions ==&lt;br /&gt;
&lt;br /&gt;
=== bga.trace( txt ) ===&lt;br /&gt;
&lt;br /&gt;
Write something immediately in the BGA log (on the right of the screen).&lt;br /&gt;
&lt;br /&gt;
This is the most practical way to debug your script :)&lt;br /&gt;
&lt;br /&gt;
Note : you can also pass an object in parameter. This will dump the content of this object in the log.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
  // Example : write &amp;quot;Hello world&amp;quot; in the log&lt;br /&gt;
  bga.trace( &amp;quot;Hello world&amp;quot; );&lt;br /&gt;
&lt;br /&gt;
  // Example : dump an associative array in the log&lt;br /&gt;
  bga.trace( { mykey: &#039;myvalue&#039;, another_key: &#039;another_value&#039; } );&lt;br /&gt;
&lt;br /&gt;
=== bga.exit( txt ) ===&lt;br /&gt;
&lt;br /&gt;
Stop the script immediately, display the &amp;quot;txt&amp;quot; messages and cancel (ie : rollback) on every previous API call except bga.trace :&lt;br /&gt;
&lt;br /&gt;
Again : ALL api call are canceled and there will be no visible changes on the interface (ex : no moves, no visible property changes, ...). Only &amp;quot;bga.trace&amp;quot; API commands are kept so you can debug.&lt;br /&gt;
&lt;br /&gt;
bga.exit is very practical when you want to repeat a game action again and again to debug it : with a call to bga.exit at the end of your script, you make sure that your game situation will be kept unchanged after each test.&lt;br /&gt;
&lt;br /&gt;
  // Example :&lt;br /&gt;
  bga.exit( &amp;quot;My script is stopped by this call&amp;quot; );&lt;br /&gt;
&lt;br /&gt;
== Game log (history) ==&lt;br /&gt;
&lt;br /&gt;
=== bga.log( txt ) ===&lt;br /&gt;
&lt;br /&gt;
Write something in the BGA log on the right.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Get / search game elements and their properties ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== bga.getElementById( id )===&lt;br /&gt;
&lt;br /&gt;
Get an object with all the properties of the element with specified ID.&lt;br /&gt;
&lt;br /&gt;
Throw an exception if the element does not exists.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==bga.getElementsByIds( ids )===&lt;br /&gt;
&lt;br /&gt;
Get all specified elements with an array of ids.&lt;br /&gt;
&lt;br /&gt;
Return an associative array (element_id =&amp;gt; element).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==bga.getElementsByParent( parent_id )==&lt;br /&gt;
&lt;br /&gt;
Get all children (ie : all elements contained) of the specified element_id.&lt;br /&gt;
&lt;br /&gt;
Ex : if you call getElementsByParent on a deck of cards, you&#039;ll get all cards.&lt;br /&gt;
&lt;br /&gt;
  // Example : Get all cards of a deck with name &amp;quot;mydeck&amp;quot;&lt;br /&gt;
  var cards = bga.getElementsByParent( bga.getElementByName( &#039;mydeck&#039; ) );&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==bga.getElementIdByName( name )===&lt;br /&gt;
&lt;br /&gt;
Get the ID of a Sandbox element from its name.&lt;br /&gt;
&lt;br /&gt;
Return null if there are no element with this name.&lt;br /&gt;
Throw an exception if there are more than 1 element with this name.&lt;br /&gt;
&lt;br /&gt;
==moveElement( element_id, target_id )==&lt;br /&gt;
&lt;br /&gt;
Move element to specified target id.&lt;/div&gt;</summary>
		<author><name>Sourisdudesert</name></author>
	</entry>
	<entry>
		<id>https://fa.doc.boardgamearena.com/index.php?title=SandboxScripts&amp;diff=2109</id>
		<title>SandboxScripts</title>
		<link rel="alternate" type="text/html" href="https://fa.doc.boardgamearena.com/index.php?title=SandboxScripts&amp;diff=2109"/>
		<updated>2016-12-14T09:39:50Z</updated>

		<summary type="html">&lt;p&gt;Sourisdudesert: /* bga.trace( txt ) */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
This is the reference of functions you can call from your Sandbox scripts.&lt;br /&gt;
&lt;br /&gt;
= Javascript =&lt;br /&gt;
&lt;br /&gt;
BGA Sandbox scripts are written in Javascript.&lt;br /&gt;
&lt;br /&gt;
Using Javascript, you can write scripts to automate moves for your Sandbox games &amp;amp; provide rules reinforcement.&lt;br /&gt;
&lt;br /&gt;
Important : in the opposite of the most common usage of Javascript, Sandbox scripts are executed &#039;&#039;&#039;on server side&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
= BGA API =&lt;br /&gt;
&lt;br /&gt;
To interact with your BGA Sandbox game, we provide you an API.&lt;br /&gt;
&lt;br /&gt;
With this API, you can get properties values of game elements from the current game situation, modify them and/or trigger the game actions (ex : move this element here, flip this card, and so on).&lt;br /&gt;
&lt;br /&gt;
= Sandbox Scripts Hello World =&lt;br /&gt;
&lt;br /&gt;
From Sandbox editor &amp;quot;interface view&amp;quot; tab, select an element, and access to its property (top right icon).&lt;br /&gt;
&lt;br /&gt;
Go to &amp;quot;Scripts (advanced)&amp;quot; section.&lt;br /&gt;
&lt;br /&gt;
In front of &amp;quot;When this element is clicked&amp;quot;, enter &amp;quot;onMyClick&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
Close the window. Go to &amp;quot;script view&amp;quot; tab.&lt;br /&gt;
&lt;br /&gt;
Enter the following :&lt;br /&gt;
&lt;br /&gt;
 function onMyClick( element_id )&lt;br /&gt;
 {&lt;br /&gt;
    bga.log(&amp;quot;Hello world! You just clicked on element &amp;quot; + element_id + &amp;quot;. Congrats!&amp;quot;);&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
Save &amp;amp; publish your project, starts a test session, click on the previous element : your message appears in the log on the right!&lt;br /&gt;
&lt;br /&gt;
= Functions you can use in your Sandbox scripts=&lt;br /&gt;
&lt;br /&gt;
== Debugging functions ==&lt;br /&gt;
&lt;br /&gt;
=== bga.trace( txt ) ===&lt;br /&gt;
&lt;br /&gt;
Write something immediately in the BGA log (on the right of the screen).&lt;br /&gt;
&lt;br /&gt;
This is the most practical way to debug your script :)&lt;br /&gt;
&lt;br /&gt;
Note : you can also pass an object in parameter. This will dump the content of this object in the log.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
  // Example : write &amp;quot;Hello world&amp;quot; in the log&lt;br /&gt;
  bga.trace( &amp;quot;Hello world&amp;quot; );&lt;br /&gt;
&lt;br /&gt;
  // Example : dump an associative array in the log&lt;br /&gt;
  bga.trace( { mykey: &#039;myvalue&#039;, another_key: &#039;another_value&#039; } );&lt;br /&gt;
&lt;br /&gt;
=== bga.exit( txt ) ===&lt;br /&gt;
&lt;br /&gt;
Stop the script immediately, display the &amp;quot;txt&amp;quot; messages and cancel (ie : rollback) on every previous API call except bga.trace :&lt;br /&gt;
&lt;br /&gt;
Again : ALL api call are canceled and there will be no visible changes on the interface (ex : no moves, no visible property changes, ...). Only &amp;quot;bga.trace&amp;quot; API commands are kept so you can debug.&lt;br /&gt;
&lt;br /&gt;
bga.exit is very practical when you want to repeat a game action again and again to debug it : with a call to bga.exit at the end of your script, you make sure that your game situation will be kept unchanged after each test.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Game log (history) ==&lt;br /&gt;
&lt;br /&gt;
=== bga.log( txt ) ===&lt;br /&gt;
&lt;br /&gt;
Write something in the BGA log on the right.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Get / search game elements and their properties ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== bga.getElementById( id )===&lt;br /&gt;
&lt;br /&gt;
Get an object with all the properties of the element with specified ID.&lt;br /&gt;
&lt;br /&gt;
Throw an exception if the element does not exists.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==bga.getElementsByIds( ids )===&lt;br /&gt;
&lt;br /&gt;
Get all specified elements with an array of ids.&lt;br /&gt;
&lt;br /&gt;
Return an associative array (element_id =&amp;gt; element).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==bga.getElementsByParent( parent_id )==&lt;br /&gt;
&lt;br /&gt;
Get all children (ie : all elements contained) of the specified element_id.&lt;br /&gt;
&lt;br /&gt;
Ex : if you call getElementsByParent on a deck of cards, you&#039;ll get all cards.&lt;br /&gt;
&lt;br /&gt;
  // Example : Get all cards of a deck with name &amp;quot;mydeck&amp;quot;&lt;br /&gt;
  var cards = bga.getElementsByParent( bga.getElementByName( &#039;mydeck&#039; ) );&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==bga.getElementIdByName( name )===&lt;br /&gt;
&lt;br /&gt;
Get the ID of a Sandbox element from its name.&lt;br /&gt;
&lt;br /&gt;
Return null if there are no element with this name.&lt;br /&gt;
Throw an exception if there are more than 1 element with this name.&lt;br /&gt;
&lt;br /&gt;
==moveElement( element_id, target_id )==&lt;br /&gt;
&lt;br /&gt;
Move element to specified target id.&lt;/div&gt;</summary>
		<author><name>Sourisdudesert</name></author>
	</entry>
	<entry>
		<id>https://fa.doc.boardgamearena.com/index.php?title=SandboxScripts&amp;diff=2108</id>
		<title>SandboxScripts</title>
		<link rel="alternate" type="text/html" href="https://fa.doc.boardgamearena.com/index.php?title=SandboxScripts&amp;diff=2108"/>
		<updated>2016-12-14T09:38:38Z</updated>

		<summary type="html">&lt;p&gt;Sourisdudesert: /* Functions you can use in your Sandbox scripts */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
This is the reference of functions you can call from your Sandbox scripts.&lt;br /&gt;
&lt;br /&gt;
= Javascript =&lt;br /&gt;
&lt;br /&gt;
BGA Sandbox scripts are written in Javascript.&lt;br /&gt;
&lt;br /&gt;
Using Javascript, you can write scripts to automate moves for your Sandbox games &amp;amp; provide rules reinforcement.&lt;br /&gt;
&lt;br /&gt;
Important : in the opposite of the most common usage of Javascript, Sandbox scripts are executed &#039;&#039;&#039;on server side&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
= BGA API =&lt;br /&gt;
&lt;br /&gt;
To interact with your BGA Sandbox game, we provide you an API.&lt;br /&gt;
&lt;br /&gt;
With this API, you can get properties values of game elements from the current game situation, modify them and/or trigger the game actions (ex : move this element here, flip this card, and so on).&lt;br /&gt;
&lt;br /&gt;
= Sandbox Scripts Hello World =&lt;br /&gt;
&lt;br /&gt;
From Sandbox editor &amp;quot;interface view&amp;quot; tab, select an element, and access to its property (top right icon).&lt;br /&gt;
&lt;br /&gt;
Go to &amp;quot;Scripts (advanced)&amp;quot; section.&lt;br /&gt;
&lt;br /&gt;
In front of &amp;quot;When this element is clicked&amp;quot;, enter &amp;quot;onMyClick&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
Close the window. Go to &amp;quot;script view&amp;quot; tab.&lt;br /&gt;
&lt;br /&gt;
Enter the following :&lt;br /&gt;
&lt;br /&gt;
 function onMyClick( element_id )&lt;br /&gt;
 {&lt;br /&gt;
    bga.log(&amp;quot;Hello world! You just clicked on element &amp;quot; + element_id + &amp;quot;. Congrats!&amp;quot;);&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
Save &amp;amp; publish your project, starts a test session, click on the previous element : your message appears in the log on the right!&lt;br /&gt;
&lt;br /&gt;
= Functions you can use in your Sandbox scripts=&lt;br /&gt;
&lt;br /&gt;
== Debugging functions ==&lt;br /&gt;
&lt;br /&gt;
=== bga.trace( txt ) ===&lt;br /&gt;
&lt;br /&gt;
Write something immediately in the BGA log (on the right of the screen).&lt;br /&gt;
&lt;br /&gt;
This is the most practical way to debug your script :)&lt;br /&gt;
&lt;br /&gt;
Note : you can also pass an object in parameter. This will dump the content of this object in the log.&lt;br /&gt;
&lt;br /&gt;
=== bga.exit( txt ) ===&lt;br /&gt;
&lt;br /&gt;
Stop the script immediately, display the &amp;quot;txt&amp;quot; messages and cancel (ie : rollback) on every previous API call except bga.trace :&lt;br /&gt;
&lt;br /&gt;
Again : ALL api call are canceled and there will be no visible changes on the interface (ex : no moves, no visible property changes, ...). Only &amp;quot;bga.trace&amp;quot; API commands are kept so you can debug.&lt;br /&gt;
&lt;br /&gt;
bga.exit is very practical when you want to repeat a game action again and again to debug it : with a call to bga.exit at the end of your script, you make sure that your game situation will be kept unchanged after each test.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Game log (history) ==&lt;br /&gt;
&lt;br /&gt;
=== bga.log( txt ) ===&lt;br /&gt;
&lt;br /&gt;
Write something in the BGA log on the right.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Get / search game elements and their properties ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== bga.getElementById( id )===&lt;br /&gt;
&lt;br /&gt;
Get an object with all the properties of the element with specified ID.&lt;br /&gt;
&lt;br /&gt;
Throw an exception if the element does not exists.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==bga.getElementsByIds( ids )===&lt;br /&gt;
&lt;br /&gt;
Get all specified elements with an array of ids.&lt;br /&gt;
&lt;br /&gt;
Return an associative array (element_id =&amp;gt; element).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==bga.getElementsByParent( parent_id )==&lt;br /&gt;
&lt;br /&gt;
Get all children (ie : all elements contained) of the specified element_id.&lt;br /&gt;
&lt;br /&gt;
Ex : if you call getElementsByParent on a deck of cards, you&#039;ll get all cards.&lt;br /&gt;
&lt;br /&gt;
  // Example : Get all cards of a deck with name &amp;quot;mydeck&amp;quot;&lt;br /&gt;
  var cards = bga.getElementsByParent( bga.getElementByName( &#039;mydeck&#039; ) );&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==bga.getElementIdByName( name )===&lt;br /&gt;
&lt;br /&gt;
Get the ID of a Sandbox element from its name.&lt;br /&gt;
&lt;br /&gt;
Return null if there are no element with this name.&lt;br /&gt;
Throw an exception if there are more than 1 element with this name.&lt;br /&gt;
&lt;br /&gt;
==moveElement( element_id, target_id )==&lt;br /&gt;
&lt;br /&gt;
Move element to specified target id.&lt;/div&gt;</summary>
		<author><name>Sourisdudesert</name></author>
	</entry>
	<entry>
		<id>https://fa.doc.boardgamearena.com/index.php?title=SandboxScripts&amp;diff=2107</id>
		<title>SandboxScripts</title>
		<link rel="alternate" type="text/html" href="https://fa.doc.boardgamearena.com/index.php?title=SandboxScripts&amp;diff=2107"/>
		<updated>2016-12-14T09:34:12Z</updated>

		<summary type="html">&lt;p&gt;Sourisdudesert: /* Functions you can use in your Lua Sandbox scripts */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
This is the reference of functions you can call from your Sandbox scripts.&lt;br /&gt;
&lt;br /&gt;
= Javascript =&lt;br /&gt;
&lt;br /&gt;
BGA Sandbox scripts are written in Javascript.&lt;br /&gt;
&lt;br /&gt;
Using Javascript, you can write scripts to automate moves for your Sandbox games &amp;amp; provide rules reinforcement.&lt;br /&gt;
&lt;br /&gt;
Important : in the opposite of the most common usage of Javascript, Sandbox scripts are executed &#039;&#039;&#039;on server side&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
= BGA API =&lt;br /&gt;
&lt;br /&gt;
To interact with your BGA Sandbox game, we provide you an API.&lt;br /&gt;
&lt;br /&gt;
With this API, you can get properties values of game elements from the current game situation, modify them and/or trigger the game actions (ex : move this element here, flip this card, and so on).&lt;br /&gt;
&lt;br /&gt;
= Sandbox Scripts Hello World =&lt;br /&gt;
&lt;br /&gt;
From Sandbox editor &amp;quot;interface view&amp;quot; tab, select an element, and access to its property (top right icon).&lt;br /&gt;
&lt;br /&gt;
Go to &amp;quot;Scripts (advanced)&amp;quot; section.&lt;br /&gt;
&lt;br /&gt;
In front of &amp;quot;When this element is clicked&amp;quot;, enter &amp;quot;onMyClick&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
Close the window. Go to &amp;quot;script view&amp;quot; tab.&lt;br /&gt;
&lt;br /&gt;
Enter the following :&lt;br /&gt;
&lt;br /&gt;
 function onMyClick( element_id )&lt;br /&gt;
 {&lt;br /&gt;
    bga.log(&amp;quot;Hello world! You just clicked on element &amp;quot; + element_id + &amp;quot;. Congrats!&amp;quot;);&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
Save &amp;amp; publish your project, starts a test session, click on the previous element : your message appears in the log on the right!&lt;br /&gt;
&lt;br /&gt;
= Functions you can use in your Sandbox scripts=&lt;br /&gt;
&lt;br /&gt;
== Debugging functions ==&lt;br /&gt;
&lt;br /&gt;
=== bga.trace( txt ) ===&lt;br /&gt;
&lt;br /&gt;
Write something immediately in the BGA log (on the right of the screen).&lt;br /&gt;
&lt;br /&gt;
This is the most practical way to debug your script :)&lt;br /&gt;
&lt;br /&gt;
Note : you can also pass an object in parameter. This will dump the content of this object in the log.&lt;br /&gt;
&lt;br /&gt;
=== bga.exit( txt ) ===&lt;br /&gt;
&lt;br /&gt;
Stop the script immediately, display the &amp;quot;txt&amp;quot; messages and cancel (ie : rollback) on every previous API call except bga.trace :&lt;br /&gt;
&lt;br /&gt;
Again : ALL api call are canceled and there will be no visible changes on the interface (ex : no moves, no visible property changes, ...). Only &amp;quot;bga.trace&amp;quot; API commands are kept so you can debug.&lt;br /&gt;
&lt;br /&gt;
bga.exit is very practical when you want to repeat a game action again and again to debug it : with a call to bga.exit at the end of your script, you make sure that your game situation will be kept unchanged after each test.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== bga.log( txt )==&lt;br /&gt;
&lt;br /&gt;
Write something in the BGA log on the right.&lt;br /&gt;
&lt;br /&gt;
This is also a very practical to debug your script ;)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==getElementById( id )===&lt;br /&gt;
&lt;br /&gt;
Get an object with all the properties of the element with specified ID.&lt;br /&gt;
&lt;br /&gt;
Throw an exception if the element does not exists.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==getElementIdByName( name )===&lt;br /&gt;
&lt;br /&gt;
Get the ID of a Sandbox element from its name.&lt;br /&gt;
&lt;br /&gt;
Return null if there are no element with this name.&lt;br /&gt;
Throw an exception if there are more than 1 element with this name.&lt;br /&gt;
&lt;br /&gt;
==moveElement( element_id, target_id )==&lt;br /&gt;
&lt;br /&gt;
Move element to specified target id.&lt;/div&gt;</summary>
		<author><name>Sourisdudesert</name></author>
	</entry>
	<entry>
		<id>https://fa.doc.boardgamearena.com/index.php?title=SandboxScripts&amp;diff=2106</id>
		<title>SandboxScripts</title>
		<link rel="alternate" type="text/html" href="https://fa.doc.boardgamearena.com/index.php?title=SandboxScripts&amp;diff=2106"/>
		<updated>2016-12-14T09:22:19Z</updated>

		<summary type="html">&lt;p&gt;Sourisdudesert: /* Sandbox Scripts Hello World */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
This is the reference of functions you can call from your Sandbox scripts.&lt;br /&gt;
&lt;br /&gt;
= Javascript =&lt;br /&gt;
&lt;br /&gt;
BGA Sandbox scripts are written in Javascript.&lt;br /&gt;
&lt;br /&gt;
Using Javascript, you can write scripts to automate moves for your Sandbox games &amp;amp; provide rules reinforcement.&lt;br /&gt;
&lt;br /&gt;
Important : in the opposite of the most common usage of Javascript, Sandbox scripts are executed &#039;&#039;&#039;on server side&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
= BGA API =&lt;br /&gt;
&lt;br /&gt;
To interact with your BGA Sandbox game, we provide you an API.&lt;br /&gt;
&lt;br /&gt;
With this API, you can get properties values of game elements from the current game situation, modify them and/or trigger the game actions (ex : move this element here, flip this card, and so on).&lt;br /&gt;
&lt;br /&gt;
= Sandbox Scripts Hello World =&lt;br /&gt;
&lt;br /&gt;
From Sandbox editor &amp;quot;interface view&amp;quot; tab, select an element, and access to its property (top right icon).&lt;br /&gt;
&lt;br /&gt;
Go to &amp;quot;Scripts (advanced)&amp;quot; section.&lt;br /&gt;
&lt;br /&gt;
In front of &amp;quot;When this element is clicked&amp;quot;, enter &amp;quot;onMyClick&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
Close the window. Go to &amp;quot;script view&amp;quot; tab.&lt;br /&gt;
&lt;br /&gt;
Enter the following :&lt;br /&gt;
&lt;br /&gt;
 function onMyClick( element_id )&lt;br /&gt;
 {&lt;br /&gt;
    bga.log(&amp;quot;Hello world! You just clicked on element &amp;quot; + element_id + &amp;quot;. Congrats!&amp;quot;);&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
Save &amp;amp; publish your project, starts a test session, click on the previous element : your message appears in the log on the right!&lt;br /&gt;
&lt;br /&gt;
= Functions you can use in your Lua Sandbox scripts=&lt;br /&gt;
&lt;br /&gt;
==addToBgaLog( txt )==&lt;br /&gt;
&lt;br /&gt;
Write something in the BGA log on the right.&lt;br /&gt;
&lt;br /&gt;
This is also a very practical to debug your script ;)&lt;br /&gt;
&lt;br /&gt;
Note : you can also pass an object in parameter. This will dump the content of this object in the log (for debugging purpose).&lt;br /&gt;
&lt;br /&gt;
==getElementById( id )===&lt;br /&gt;
&lt;br /&gt;
Get an object with all the properties of the element with specified ID.&lt;br /&gt;
&lt;br /&gt;
Throw an exception if the element does not exists.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==getElementIdByName( name )===&lt;br /&gt;
&lt;br /&gt;
Get the ID of a Sandbox element from its name.&lt;br /&gt;
&lt;br /&gt;
Return null if there are no element with this name.&lt;br /&gt;
Throw an exception if there are more than 1 element with this name.&lt;br /&gt;
&lt;br /&gt;
==moveElement( element_id, target_id )==&lt;br /&gt;
&lt;br /&gt;
Move element to specified target id.&lt;/div&gt;</summary>
		<author><name>Sourisdudesert</name></author>
	</entry>
	<entry>
		<id>https://fa.doc.boardgamearena.com/index.php?title=SandboxScripts&amp;diff=2105</id>
		<title>SandboxScripts</title>
		<link rel="alternate" type="text/html" href="https://fa.doc.boardgamearena.com/index.php?title=SandboxScripts&amp;diff=2105"/>
		<updated>2016-12-14T09:21:37Z</updated>

		<summary type="html">&lt;p&gt;Sourisdudesert: /* BGA API */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
This is the reference of functions you can call from your Sandbox scripts.&lt;br /&gt;
&lt;br /&gt;
= Javascript =&lt;br /&gt;
&lt;br /&gt;
BGA Sandbox scripts are written in Javascript.&lt;br /&gt;
&lt;br /&gt;
Using Javascript, you can write scripts to automate moves for your Sandbox games &amp;amp; provide rules reinforcement.&lt;br /&gt;
&lt;br /&gt;
Important : in the opposite of the most common usage of Javascript, Sandbox scripts are executed &#039;&#039;&#039;on server side&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
= BGA API =&lt;br /&gt;
&lt;br /&gt;
To interact with your BGA Sandbox game, we provide you an API.&lt;br /&gt;
&lt;br /&gt;
With this API, you can get properties values of game elements from the current game situation, modify them and/or trigger the game actions (ex : move this element here, flip this card, and so on).&lt;br /&gt;
&lt;br /&gt;
= Sandbox Scripts Hello World =&lt;br /&gt;
&lt;br /&gt;
From Sandbox editor &amp;quot;interface view&amp;quot; tab, select an element, and access to its property (top right icon).&lt;br /&gt;
&lt;br /&gt;
Go to &amp;quot;Scripts (advanced)&amp;quot; section.&lt;br /&gt;
&lt;br /&gt;
In front of &amp;quot;When this element is clicked&amp;quot;, enter &amp;quot;onMyClick&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
Close the window. Go to &amp;quot;script view&amp;quot; tab.&lt;br /&gt;
&lt;br /&gt;
Enter the following :&lt;br /&gt;
&lt;br /&gt;
 function onMyClick(id)&lt;br /&gt;
    addToBgaLog(&amp;quot;Hello world! You just clicked on element &amp;quot;..id..&amp;quot;. Congrats!&amp;quot;)&lt;br /&gt;
 end&lt;br /&gt;
&lt;br /&gt;
Save &amp;amp; publish your project, starts a test session, click on the previous element : your message appears in the log on the right!&lt;br /&gt;
&lt;br /&gt;
= Functions you can use in your Lua Sandbox scripts=&lt;br /&gt;
&lt;br /&gt;
==addToBgaLog( txt )==&lt;br /&gt;
&lt;br /&gt;
Write something in the BGA log on the right.&lt;br /&gt;
&lt;br /&gt;
This is also a very practical to debug your script ;)&lt;br /&gt;
&lt;br /&gt;
Note : you can also pass an object in parameter. This will dump the content of this object in the log (for debugging purpose).&lt;br /&gt;
&lt;br /&gt;
==getElementById( id )===&lt;br /&gt;
&lt;br /&gt;
Get an object with all the properties of the element with specified ID.&lt;br /&gt;
&lt;br /&gt;
Throw an exception if the element does not exists.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==getElementIdByName( name )===&lt;br /&gt;
&lt;br /&gt;
Get the ID of a Sandbox element from its name.&lt;br /&gt;
&lt;br /&gt;
Return null if there are no element with this name.&lt;br /&gt;
Throw an exception if there are more than 1 element with this name.&lt;br /&gt;
&lt;br /&gt;
==moveElement( element_id, target_id )==&lt;br /&gt;
&lt;br /&gt;
Move element to specified target id.&lt;/div&gt;</summary>
		<author><name>Sourisdudesert</name></author>
	</entry>
	<entry>
		<id>https://fa.doc.boardgamearena.com/index.php?title=SandboxScripts&amp;diff=2104</id>
		<title>SandboxScripts</title>
		<link rel="alternate" type="text/html" href="https://fa.doc.boardgamearena.com/index.php?title=SandboxScripts&amp;diff=2104"/>
		<updated>2016-12-14T09:13:54Z</updated>

		<summary type="html">&lt;p&gt;Sourisdudesert: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
This is the reference of functions you can call from your Sandbox scripts.&lt;br /&gt;
&lt;br /&gt;
= Javascript =&lt;br /&gt;
&lt;br /&gt;
BGA Sandbox scripts are written in Javascript.&lt;br /&gt;
&lt;br /&gt;
Using Javascript, you can write scripts to automate moves for your Sandbox games &amp;amp; provide rules reinforcement.&lt;br /&gt;
&lt;br /&gt;
Important : in the opposite of the most common usage of Javascript, Sandbox scripts are executed &#039;&#039;&#039;on server side&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
= BGA API =&lt;br /&gt;
&lt;br /&gt;
To interact with your BGA Sandbox game, we provide you an API.&lt;br /&gt;
&lt;br /&gt;
With this API, you can get properties values of game elements from the current game situation, modify them and/or trigger the game actions (ex : move this element here, flip this card, and so on).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= Sandbox Scripts Hello World =&lt;br /&gt;
&lt;br /&gt;
From Sandbox editor &amp;quot;interface view&amp;quot; tab, select an element, and access to its property (top right icon).&lt;br /&gt;
&lt;br /&gt;
Go to &amp;quot;Scripts (advanced)&amp;quot; section.&lt;br /&gt;
&lt;br /&gt;
In front of &amp;quot;When this element is clicked&amp;quot;, enter &amp;quot;onMyClick&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
Close the window. Go to &amp;quot;script view&amp;quot; tab.&lt;br /&gt;
&lt;br /&gt;
Enter the following :&lt;br /&gt;
&lt;br /&gt;
 function onMyClick(id)&lt;br /&gt;
    addToBgaLog(&amp;quot;Hello world! You just clicked on element &amp;quot;..id..&amp;quot;. Congrats!&amp;quot;)&lt;br /&gt;
 end&lt;br /&gt;
&lt;br /&gt;
Save &amp;amp; publish your project, starts a test session, click on the previous element : your message appears in the log on the right!&lt;br /&gt;
&lt;br /&gt;
= Functions you can use in your Lua Sandbox scripts=&lt;br /&gt;
&lt;br /&gt;
==addToBgaLog( txt )==&lt;br /&gt;
&lt;br /&gt;
Write something in the BGA log on the right.&lt;br /&gt;
&lt;br /&gt;
This is also a very practical to debug your script ;)&lt;br /&gt;
&lt;br /&gt;
Note : you can also pass an object in parameter. This will dump the content of this object in the log (for debugging purpose).&lt;br /&gt;
&lt;br /&gt;
==getElementById( id )===&lt;br /&gt;
&lt;br /&gt;
Get an object with all the properties of the element with specified ID.&lt;br /&gt;
&lt;br /&gt;
Throw an exception if the element does not exists.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==getElementIdByName( name )===&lt;br /&gt;
&lt;br /&gt;
Get the ID of a Sandbox element from its name.&lt;br /&gt;
&lt;br /&gt;
Return null if there are no element with this name.&lt;br /&gt;
Throw an exception if there are more than 1 element with this name.&lt;br /&gt;
&lt;br /&gt;
==moveElement( element_id, target_id )==&lt;br /&gt;
&lt;br /&gt;
Move element to specified target id.&lt;/div&gt;</summary>
		<author><name>Sourisdudesert</name></author>
	</entry>
	<entry>
		<id>https://fa.doc.boardgamearena.com/index.php?title=SandboxScripts&amp;diff=2099</id>
		<title>SandboxScripts</title>
		<link rel="alternate" type="text/html" href="https://fa.doc.boardgamearena.com/index.php?title=SandboxScripts&amp;diff=2099"/>
		<updated>2016-12-12T15:48:24Z</updated>

		<summary type="html">&lt;p&gt;Sourisdudesert: /* getElementIdByName( name )= */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
This is the reference of functions you can call from your Sandbox scripts.&lt;br /&gt;
&lt;br /&gt;
= Lua programming language =&lt;br /&gt;
&lt;br /&gt;
Lua is a very simple &amp;amp; generic script language, very close from C or PHP.&lt;br /&gt;
&lt;br /&gt;
If you are familiar with most used languages, you can learn Lua basic structures in few minutes (for example from this page : https://awesome.naquadah.org/wiki/The_briefest_introduction_to_Lua).&lt;br /&gt;
&lt;br /&gt;
Using Lua, you can write scripts to automate moves for your Sandbox games &amp;amp; provide rules reinforcement.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= Sandbox Scripts Hello World =&lt;br /&gt;
&lt;br /&gt;
From Sandbox editor &amp;quot;interface view&amp;quot; tab, select an element, and access to its property (top right icon).&lt;br /&gt;
&lt;br /&gt;
Go to &amp;quot;Scripts (advanced)&amp;quot; section.&lt;br /&gt;
&lt;br /&gt;
In front of &amp;quot;When this element is clicked&amp;quot;, enter &amp;quot;onMyClick&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
Close the window. Go to &amp;quot;script view&amp;quot; tab.&lt;br /&gt;
&lt;br /&gt;
Enter the following :&lt;br /&gt;
&lt;br /&gt;
 function onMyClick(id)&lt;br /&gt;
    addToBgaLog(&amp;quot;Hello world! You just clicked on element &amp;quot;..id..&amp;quot;. Congrats!&amp;quot;)&lt;br /&gt;
 end&lt;br /&gt;
&lt;br /&gt;
Save &amp;amp; publish your project, starts a test session, click on the previous element : your message appears in the log on the right!&lt;br /&gt;
&lt;br /&gt;
= Functions you can use in your Lua Sandbox scripts=&lt;br /&gt;
&lt;br /&gt;
==addToBgaLog( txt )==&lt;br /&gt;
&lt;br /&gt;
Write something in the BGA log on the right.&lt;br /&gt;
&lt;br /&gt;
This is also a very practical to debug your script ;)&lt;br /&gt;
&lt;br /&gt;
Note : you can also pass an object in parameter. This will dump the content of this object in the log (for debugging purpose).&lt;br /&gt;
&lt;br /&gt;
==getElementById( id )===&lt;br /&gt;
&lt;br /&gt;
Get an object with all the properties of the element with specified ID.&lt;br /&gt;
&lt;br /&gt;
Throw an exception if the element does not exists.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==getElementIdByName( name )===&lt;br /&gt;
&lt;br /&gt;
Get the ID of a Sandbox element from its name.&lt;br /&gt;
&lt;br /&gt;
Return null if there are no element with this name.&lt;br /&gt;
Throw an exception if there are more than 1 element with this name.&lt;br /&gt;
&lt;br /&gt;
==moveElement( element_id, target_id )==&lt;br /&gt;
&lt;br /&gt;
Move element to specified target id.&lt;/div&gt;</summary>
		<author><name>Sourisdudesert</name></author>
	</entry>
	<entry>
		<id>https://fa.doc.boardgamearena.com/index.php?title=SandboxScripts&amp;diff=2098</id>
		<title>SandboxScripts</title>
		<link rel="alternate" type="text/html" href="https://fa.doc.boardgamearena.com/index.php?title=SandboxScripts&amp;diff=2098"/>
		<updated>2016-12-12T15:47:10Z</updated>

		<summary type="html">&lt;p&gt;Sourisdudesert: /* addToBgaLog( txt ) */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
This is the reference of functions you can call from your Sandbox scripts.&lt;br /&gt;
&lt;br /&gt;
= Lua programming language =&lt;br /&gt;
&lt;br /&gt;
Lua is a very simple &amp;amp; generic script language, very close from C or PHP.&lt;br /&gt;
&lt;br /&gt;
If you are familiar with most used languages, you can learn Lua basic structures in few minutes (for example from this page : https://awesome.naquadah.org/wiki/The_briefest_introduction_to_Lua).&lt;br /&gt;
&lt;br /&gt;
Using Lua, you can write scripts to automate moves for your Sandbox games &amp;amp; provide rules reinforcement.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= Sandbox Scripts Hello World =&lt;br /&gt;
&lt;br /&gt;
From Sandbox editor &amp;quot;interface view&amp;quot; tab, select an element, and access to its property (top right icon).&lt;br /&gt;
&lt;br /&gt;
Go to &amp;quot;Scripts (advanced)&amp;quot; section.&lt;br /&gt;
&lt;br /&gt;
In front of &amp;quot;When this element is clicked&amp;quot;, enter &amp;quot;onMyClick&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
Close the window. Go to &amp;quot;script view&amp;quot; tab.&lt;br /&gt;
&lt;br /&gt;
Enter the following :&lt;br /&gt;
&lt;br /&gt;
 function onMyClick(id)&lt;br /&gt;
    addToBgaLog(&amp;quot;Hello world! You just clicked on element &amp;quot;..id..&amp;quot;. Congrats!&amp;quot;)&lt;br /&gt;
 end&lt;br /&gt;
&lt;br /&gt;
Save &amp;amp; publish your project, starts a test session, click on the previous element : your message appears in the log on the right!&lt;br /&gt;
&lt;br /&gt;
= Functions you can use in your Lua Sandbox scripts=&lt;br /&gt;
&lt;br /&gt;
==addToBgaLog( txt )==&lt;br /&gt;
&lt;br /&gt;
Write something in the BGA log on the right.&lt;br /&gt;
&lt;br /&gt;
This is also a very practical to debug your script ;)&lt;br /&gt;
&lt;br /&gt;
Note : you can also pass an object in parameter. This will dump the content of this object in the log (for debugging purpose).&lt;br /&gt;
&lt;br /&gt;
==getElementIdByName( name )===&lt;br /&gt;
&lt;br /&gt;
Get the ID of a Sandbox element from its name.&lt;br /&gt;
&lt;br /&gt;
Return null if there are no element with this name.&lt;br /&gt;
Throw an exception if there are more than 1 element with this name.&lt;br /&gt;
&lt;br /&gt;
==moveElement( element_id, target_id )==&lt;br /&gt;
&lt;br /&gt;
Move element to specified target id.&lt;/div&gt;</summary>
		<author><name>Sourisdudesert</name></author>
	</entry>
	<entry>
		<id>https://fa.doc.boardgamearena.com/index.php?title=SandboxScripts&amp;diff=2097</id>
		<title>SandboxScripts</title>
		<link rel="alternate" type="text/html" href="https://fa.doc.boardgamearena.com/index.php?title=SandboxScripts&amp;diff=2097"/>
		<updated>2016-12-12T14:33:43Z</updated>

		<summary type="html">&lt;p&gt;Sourisdudesert: /* addToBgaLog( txt ) */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
This is the reference of functions you can call from your Sandbox scripts.&lt;br /&gt;
&lt;br /&gt;
= Lua programming language =&lt;br /&gt;
&lt;br /&gt;
Lua is a very simple &amp;amp; generic script language, very close from C or PHP.&lt;br /&gt;
&lt;br /&gt;
If you are familiar with most used languages, you can learn Lua basic structures in few minutes (for example from this page : https://awesome.naquadah.org/wiki/The_briefest_introduction_to_Lua).&lt;br /&gt;
&lt;br /&gt;
Using Lua, you can write scripts to automate moves for your Sandbox games &amp;amp; provide rules reinforcement.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= Sandbox Scripts Hello World =&lt;br /&gt;
&lt;br /&gt;
From Sandbox editor &amp;quot;interface view&amp;quot; tab, select an element, and access to its property (top right icon).&lt;br /&gt;
&lt;br /&gt;
Go to &amp;quot;Scripts (advanced)&amp;quot; section.&lt;br /&gt;
&lt;br /&gt;
In front of &amp;quot;When this element is clicked&amp;quot;, enter &amp;quot;onMyClick&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
Close the window. Go to &amp;quot;script view&amp;quot; tab.&lt;br /&gt;
&lt;br /&gt;
Enter the following :&lt;br /&gt;
&lt;br /&gt;
 function onMyClick(id)&lt;br /&gt;
    addToBgaLog(&amp;quot;Hello world! You just clicked on element &amp;quot;..id..&amp;quot;. Congrats!&amp;quot;)&lt;br /&gt;
 end&lt;br /&gt;
&lt;br /&gt;
Save &amp;amp; publish your project, starts a test session, click on the previous element : your message appears in the log on the right!&lt;br /&gt;
&lt;br /&gt;
= Functions you can use in your Lua Sandbox scripts=&lt;br /&gt;
&lt;br /&gt;
==addToBgaLog( txt )==&lt;br /&gt;
&lt;br /&gt;
Write somethine in the BGA log on the right.&lt;br /&gt;
&lt;br /&gt;
This is also a very practical to debug your script ;)&lt;br /&gt;
&lt;br /&gt;
==getElementIdByName( name )===&lt;br /&gt;
&lt;br /&gt;
Get the ID of a Sandbox element from its name.&lt;br /&gt;
&lt;br /&gt;
Return null if there are no element with this name.&lt;br /&gt;
Throw an exception if there are more than 1 element with this name.&lt;br /&gt;
&lt;br /&gt;
==moveElement( element_id, target_id )==&lt;br /&gt;
&lt;br /&gt;
Move element to specified target id.&lt;/div&gt;</summary>
		<author><name>Sourisdudesert</name></author>
	</entry>
	<entry>
		<id>https://fa.doc.boardgamearena.com/index.php?title=SandboxScripts&amp;diff=2096</id>
		<title>SandboxScripts</title>
		<link rel="alternate" type="text/html" href="https://fa.doc.boardgamearena.com/index.php?title=SandboxScripts&amp;diff=2096"/>
		<updated>2016-12-12T14:15:18Z</updated>

		<summary type="html">&lt;p&gt;Sourisdudesert: /* addToBgaLog( txt ) */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
This is the reference of functions you can call from your Sandbox scripts.&lt;br /&gt;
&lt;br /&gt;
= Lua programming language =&lt;br /&gt;
&lt;br /&gt;
Lua is a very simple &amp;amp; generic script language, very close from C or PHP.&lt;br /&gt;
&lt;br /&gt;
If you are familiar with most used languages, you can learn Lua basic structures in few minutes (for example from this page : https://awesome.naquadah.org/wiki/The_briefest_introduction_to_Lua).&lt;br /&gt;
&lt;br /&gt;
Using Lua, you can write scripts to automate moves for your Sandbox games &amp;amp; provide rules reinforcement.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= Sandbox Scripts Hello World =&lt;br /&gt;
&lt;br /&gt;
From Sandbox editor &amp;quot;interface view&amp;quot; tab, select an element, and access to its property (top right icon).&lt;br /&gt;
&lt;br /&gt;
Go to &amp;quot;Scripts (advanced)&amp;quot; section.&lt;br /&gt;
&lt;br /&gt;
In front of &amp;quot;When this element is clicked&amp;quot;, enter &amp;quot;onMyClick&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
Close the window. Go to &amp;quot;script view&amp;quot; tab.&lt;br /&gt;
&lt;br /&gt;
Enter the following :&lt;br /&gt;
&lt;br /&gt;
 function onMyClick(id)&lt;br /&gt;
    addToBgaLog(&amp;quot;Hello world! You just clicked on element &amp;quot;..id..&amp;quot;. Congrats!&amp;quot;)&lt;br /&gt;
 end&lt;br /&gt;
&lt;br /&gt;
Save &amp;amp; publish your project, starts a test session, click on the previous element : your message appears in the log on the right!&lt;br /&gt;
&lt;br /&gt;
= Functions you can use in your Lua Sandbox scripts=&lt;br /&gt;
&lt;br /&gt;
==addToBgaLog( txt )==&lt;br /&gt;
&lt;br /&gt;
Write somethine in the BGA log on the right.&lt;br /&gt;
&lt;br /&gt;
This is also a very practical to debug your script ;)&lt;/div&gt;</summary>
		<author><name>Sourisdudesert</name></author>
	</entry>
	<entry>
		<id>https://fa.doc.boardgamearena.com/index.php?title=SandboxScripts&amp;diff=2095</id>
		<title>SandboxScripts</title>
		<link rel="alternate" type="text/html" href="https://fa.doc.boardgamearena.com/index.php?title=SandboxScripts&amp;diff=2095"/>
		<updated>2016-12-12T14:13:16Z</updated>

		<summary type="html">&lt;p&gt;Sourisdudesert: /* Sandbox Scripts Hello World */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
This is the reference of functions you can call from your Sandbox scripts.&lt;br /&gt;
&lt;br /&gt;
= Lua programming language =&lt;br /&gt;
&lt;br /&gt;
Lua is a very simple &amp;amp; generic script language, very close from C or PHP.&lt;br /&gt;
&lt;br /&gt;
If you are familiar with most used languages, you can learn Lua basic structures in few minutes (for example from this page : https://awesome.naquadah.org/wiki/The_briefest_introduction_to_Lua).&lt;br /&gt;
&lt;br /&gt;
Using Lua, you can write scripts to automate moves for your Sandbox games &amp;amp; provide rules reinforcement.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= Sandbox Scripts Hello World =&lt;br /&gt;
&lt;br /&gt;
From Sandbox editor &amp;quot;interface view&amp;quot; tab, select an element, and access to its property (top right icon).&lt;br /&gt;
&lt;br /&gt;
Go to &amp;quot;Scripts (advanced)&amp;quot; section.&lt;br /&gt;
&lt;br /&gt;
In front of &amp;quot;When this element is clicked&amp;quot;, enter &amp;quot;onMyClick&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
Close the window. Go to &amp;quot;script view&amp;quot; tab.&lt;br /&gt;
&lt;br /&gt;
Enter the following :&lt;br /&gt;
&lt;br /&gt;
 function onMyClick(id)&lt;br /&gt;
    addToBgaLog(&amp;quot;Hello world! You just clicked on element &amp;quot;..id..&amp;quot;. Congrats!&amp;quot;)&lt;br /&gt;
 end&lt;br /&gt;
&lt;br /&gt;
Save &amp;amp; publish your project, starts a test session, click on the previous element : your message appears in the log on the right!&lt;br /&gt;
&lt;br /&gt;
= Functions you can use in your Lua Sandbox scripts=&lt;br /&gt;
&lt;br /&gt;
==addToBgaLog( txt )==&lt;/div&gt;</summary>
		<author><name>Sourisdudesert</name></author>
	</entry>
	<entry>
		<id>https://fa.doc.boardgamearena.com/index.php?title=SandboxScripts&amp;diff=2094</id>
		<title>SandboxScripts</title>
		<link rel="alternate" type="text/html" href="https://fa.doc.boardgamearena.com/index.php?title=SandboxScripts&amp;diff=2094"/>
		<updated>2016-12-12T14:12:39Z</updated>

		<summary type="html">&lt;p&gt;Sourisdudesert: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
This is the reference of functions you can call from your Sandbox scripts.&lt;br /&gt;
&lt;br /&gt;
= Lua programming language =&lt;br /&gt;
&lt;br /&gt;
Lua is a very simple &amp;amp; generic script language, very close from C or PHP.&lt;br /&gt;
&lt;br /&gt;
If you are familiar with most used languages, you can learn Lua basic structures in few minutes (for example from this page : https://awesome.naquadah.org/wiki/The_briefest_introduction_to_Lua).&lt;br /&gt;
&lt;br /&gt;
Using Lua, you can write scripts to automate moves for your Sandbox games &amp;amp; provide rules reinforcement.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= Sandbox Scripts Hello World =&lt;br /&gt;
&lt;br /&gt;
From Sandbox editor &amp;quot;interface view&amp;quot; tab, select an element, and access to its property (top right icon).&lt;br /&gt;
&lt;br /&gt;
Go to &amp;quot;Scripts (advanced)&amp;quot; section.&lt;br /&gt;
&lt;br /&gt;
In front of &amp;quot;When this element is clicked&amp;quot;, enter &amp;quot;onMyClick&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
Close the window. Go to &amp;quot;script view&amp;quot; tab.&lt;br /&gt;
&lt;br /&gt;
Enter the following :&lt;br /&gt;
&lt;br /&gt;
 function onMyClick(id)&lt;br /&gt;
    addToBgaLog(&amp;quot;Hello world! I just clicked on element &amp;quot;..id)&lt;br /&gt;
 end&lt;br /&gt;
&lt;br /&gt;
Save &amp;amp; publish your project, starts a test session, click on the previous element : your message appears in the log on the right!&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= Functions you can use in your Lua Sandbox scripts=&lt;br /&gt;
&lt;br /&gt;
==addToBgaLog( txt )==&lt;/div&gt;</summary>
		<author><name>Sourisdudesert</name></author>
	</entry>
	<entry>
		<id>https://fa.doc.boardgamearena.com/index.php?title=SandboxScripts&amp;diff=2093</id>
		<title>SandboxScripts</title>
		<link rel="alternate" type="text/html" href="https://fa.doc.boardgamearena.com/index.php?title=SandboxScripts&amp;diff=2093"/>
		<updated>2016-12-12T14:01:20Z</updated>

		<summary type="html">&lt;p&gt;Sourisdudesert: Created page with &amp;quot; This is the reference of functions you can call from your Sandbox scripts.&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
This is the reference of functions you can call from your Sandbox scripts.&lt;/div&gt;</summary>
		<author><name>Sourisdudesert</name></author>
	</entry>
	<entry>
		<id>https://fa.doc.boardgamearena.com/index.php?title=Moderationpolicy&amp;diff=2063</id>
		<title>Moderationpolicy</title>
		<link rel="alternate" type="text/html" href="https://fa.doc.boardgamearena.com/index.php?title=Moderationpolicy&amp;diff=2063"/>
		<updated>2016-11-22T08:06:45Z</updated>

		<summary type="html">&lt;p&gt;Sourisdudesert: /* Penalty grid */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
== General rules ==&lt;br /&gt;
&lt;br /&gt;
=== Beyond a Reasonable Doubt ===&lt;br /&gt;
&lt;br /&gt;
In case there is a any possible doubt, a player should be considered not guilty.&lt;br /&gt;
&lt;br /&gt;
=== Moderators independance ===&lt;br /&gt;
&lt;br /&gt;
Moderators must not process reports if they know the protagonists (author or targeted player). Playing online with the protagonist does not mean to &amp;quot;know&amp;quot; them. &amp;quot;Know&amp;quot; means: know them personally or playing with them online very regularly.&lt;br /&gt;
&lt;br /&gt;
=== Appeal ===&lt;br /&gt;
&lt;br /&gt;
Players has the right to appeal against the moderation decision, by forwarding received moderation email to &amp;quot;contact@boardgamearena.com&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
They &#039;&#039;&#039;MUST&#039;&#039;&#039; explain in the email why the moderator did not respect the BGA moderation policy. If the explanation is not convincing, the email will be ignored. If the player is obviously guilty and if the moderation policy hasn&#039;t been violated, BGA admins will double the penalties.&lt;br /&gt;
&lt;br /&gt;
=== Penalty grid ===&lt;br /&gt;
&lt;br /&gt;
Moderators should respect the penalties grid as much as possible. However, they have the right to adjust the penalty depending on the gravity of the case. The following situation can lead moderators to increase the penalties:&lt;br /&gt;
* the player has been reported several times for the same type of case.&lt;br /&gt;
* the player wrong action can be obviously qualified by one or several of the following terms: racism, xenophobia, homophobia, sexism, and as a rule of thumb any type of discrimination against a particular category of people.&lt;br /&gt;
* on case there is a provocation, the penalty may be be reduced a little, and the author of the provocation may have a warning BUT, as everyone should keep quiet and polite even if there are provoked, this is a moderator choice.&lt;br /&gt;
&lt;br /&gt;
=== Relapse ===&lt;br /&gt;
&lt;br /&gt;
In case there is a relapse, the penalty increases exponentially.&lt;br /&gt;
&lt;br /&gt;
This is the moderator job to determine the right penalty to apply in this case, considering the fact that the player has been warned by a first penalty.&lt;br /&gt;
&lt;br /&gt;
Moderators should consider there is a relapse only if the new wrong action occurs AFTER the previous penalty has been applied and the associated moderation email has been sent.&lt;br /&gt;
&lt;br /&gt;
Considering it&#039;s a lot of work to analyze reports about players who do the same action again and again, the &amp;quot;ban forever&amp;quot; penalty can be applied to any case if the player relapses.&lt;br /&gt;
&lt;br /&gt;
=== Special urgency ban procedure ===&lt;br /&gt;
&lt;br /&gt;
Whatever the case type, moderators has the right to ban a player from the website (forever) if this player set up a situation that is out of control and must be stopped within hours. This special procedure should only be used if there is an immediate danger for the community (ex: vandalism, flow of insults, massive spam, ...).&lt;br /&gt;
&lt;br /&gt;
=== About private jokes ===&lt;br /&gt;
&lt;br /&gt;
If a wrong action happened in a private circle (ex: at a game table, with no spectators), and if none of the present players reported the action, the moderator must consider this was a &amp;quot;private joke&amp;quot; and must not apply any penalty. In the contrary, if the wrong action is public (ex: post/comment on the wall), the moderator may consider this as a wrong action even if there is no report.&lt;br /&gt;
&lt;br /&gt;
Note: in case a moderator discovers that this is obviously not a private joke and that something must be reported, the moderator is allowed to create a report for the case. However, in this case, this moderator is not allowed to judge the report.&lt;br /&gt;
&lt;br /&gt;
=== Prescription ===&lt;br /&gt;
&lt;br /&gt;
For operational reason, a report that is older than 12 weeks may be closed by moderators because it is too old.&lt;br /&gt;
&lt;br /&gt;
As a rule of thumb, every report should be judge in a 4 weeks delay.&lt;br /&gt;
&lt;br /&gt;
=== Player profile influence ===&lt;br /&gt;
&lt;br /&gt;
The player profile IS taken into account to determine if the player is guilty or not guilty. Moderators give more credit to players with a good profile than the other.&lt;br /&gt;
&lt;br /&gt;
The player profile is NOT taken into account when choosing the penalty if the player is found guilty.&lt;br /&gt;
&lt;br /&gt;
Good profile elements are:&lt;br /&gt;
* A good thumb up / thumb down ratio.&lt;br /&gt;
* Player is registered since a long time / has a lot of games played.&lt;br /&gt;
* Players is involved in the website (ex: realized translations).&lt;br /&gt;
* Player is supporting BGA (member of the club).&lt;br /&gt;
&lt;br /&gt;
You should also take into account the profile of the reporting player (report author) : a bad reputation and/or an important number of reports already judged as &amp;quot;not guilty&amp;quot; should incite you to be very careful with this player report.&lt;br /&gt;
&lt;br /&gt;
=== Incomplete reports ===&lt;br /&gt;
&lt;br /&gt;
Analyzing reports takes a lot of time, and many reports are received. If any needed information is missing in the report, moderators may (and most of the time, should) close the report.&lt;br /&gt;
&lt;br /&gt;
== Penalty grid ==&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable alternance centre&amp;quot;&lt;br /&gt;
|+ Titre&lt;br /&gt;
 |-&lt;br /&gt;
 ! scope=&amp;quot;col&amp;quot; | Category&lt;br /&gt;
 ! scope=&amp;quot;col&amp;quot; | Case type&lt;br /&gt;
 ! scope=&amp;quot;col&amp;quot; | Details&lt;br /&gt;
 ! scope=&amp;quot;col&amp;quot; | Standard penalty&lt;br /&gt;
 |-&lt;br /&gt;
 ! Insults&lt;br /&gt;
 | Insults during a game, on table chat&lt;br /&gt;
 | Must be present in the report: table ID, and the insults terms. If the insult is not in English, or if the insult is not obvious, the report author must specify why this is insulting.&lt;br /&gt;
 | Devilkin 3 days for small insults and insanity, Devilkin 30 days for real insults. Smaller penalty (ex: 1 day) can be applied if this was obviously a stupid joke. In any case: the player should be warn that this is the last warning before ban.&lt;br /&gt;
 |-&lt;br /&gt;
 ! Insults&lt;br /&gt;
 | Insults on general chat&lt;br /&gt;
 | Must be present in the report: the insult terms. If the insult is not in English, or if the insult is not obvious, the report author must specify why this is insulting.&lt;br /&gt;
 | Devilkin 30 days for small insults and insanity, Devilkin forever for real insults. In any case: the player should be warn that this is the last warning before ban.&lt;br /&gt;
 |-&lt;br /&gt;
 ! Insults&lt;br /&gt;
 | Insults on public space (wall, forum, comments...)&lt;br /&gt;
 | Must be present in the report: where to find the insult, the insult terms. If the insult is not in English, or if the insult is not obvious, the report author must specify why this is insulting.&lt;br /&gt;
 | Devilkin 3 days for small insults and insanity, Devilkin 30 days for real insults. Smaller penalty (ex: 1 day) can be applied if this was obviously a stupid joke. In any case: the player should be warn that this is the last warning before ban.&lt;br /&gt;
 |-&lt;br /&gt;
 ! Aggressive attitude&lt;br /&gt;
 | Aggressive attitude during a game: can&#039;t wait the other player, provocation, ...&lt;br /&gt;
 | As a rule of thumb: as long as there is no insult, this is not an issue: thumb down are the solution. BUT, if the player is really borderline and should be warned, a moderation action is needed.&lt;br /&gt;
 | -1 to -10 reputation penalty. Moderators should explain that this is a small warning, and that a change of attitude is needed.&lt;br /&gt;
 |-&lt;br /&gt;
 ! Avatar&lt;br /&gt;
 | Inappropriate avatar: explicit sexual content, extreme violence, advertising...&lt;br /&gt;
 | If needed, report author should explain why this is inappropriate. Avatar is really inappropriate in 3 cases:&lt;br /&gt;
1°) It can hurt underage players (explicit sexual content, extreme violence)&lt;br /&gt;
2°) This is advertisement / this violate some intellectual property&lt;br /&gt;
3°) The avatar contains a reference that discriminate a group of people (ex: nazi cross)&lt;br /&gt;
 | Avatar immediate removal + Devilkin 3 days to devilkin forever depending on the gravity. In any case: the player should be warn that this is the last warning before ban. If the player obviously don&#039;t measure the meaning of the avatar, the penalty can be reduced.&lt;br /&gt;
 |-&lt;br /&gt;
 ! Avatar&lt;br /&gt;
 | Inappropriate username&lt;br /&gt;
 | If needed, report author should explain why this is inappropriate. Username are inappropriate when this is obviously an insult for many people. Moderators shouldn&#039;t moderate a username that is insulting by accident in a language that is not widely used on BGA.&lt;br /&gt;
 | Ban from the website. Moderators should explain that the player is welcome with another username on BGA. Note that if the player has a long seniority on BGA (=many games played), moderators should be very cautious on the case: if no one noticed the username until now, it is probably not inappropriate.&lt;br /&gt;
 |-&lt;br /&gt;
 ! Table description&lt;br /&gt;
 | Inappropriate table description&lt;br /&gt;
 | If needed, report author should explain why this is inappropriate. Table description is inappropriate when it contains insults, insanity, or tend to discriminate a group of people. &lt;br /&gt;
 | Devilkin 3 days for small insults and insanity, Devilkin 30 days for real insults. Smaller penalty (ex: 1 day) can be applied if this was obviously a stupid joke. In any case: the player should be warn that this is the last warning before ban.&lt;br /&gt;
 |-&lt;br /&gt;
 ! Kingmaking&lt;br /&gt;
 | Kingmaking action during a game&lt;br /&gt;
 | The report must contains SEVERAL table id of game with 3+ players (the CANNOT be any kingmaking on 2 players games), the exact moves numbers, and the exact explanation why this is a kingmaking action. To declare a player guilty, the player must have played an obvious move against his own interest, and it has to be a good player (clues: his ELO, number of game played, ...). As the difference between a mistake and a kingmaking action is very tight, one kingmaking report is not enough to find a player guilty: only players who regularly play against their interest should be found guilty. Note that 99% of kingmaking reports are not accurate enough, contains not enough information, and are closed because of this.&lt;br /&gt;
 | -1 to -10 reputation penalty. Moderators should warn the player that this is a only small warning. Relapses can lead to higher reputation points penalties.&lt;br /&gt;
 |-&lt;br /&gt;
 ! Bug exploit&lt;br /&gt;
 | Exploit a known bug during a game&lt;br /&gt;
 | The bug must have been reported in the forum, and an exact reference to this bug must be in the report, with the table id and the move number. Minor bugs that can be considered as &amp;quot;variants&amp;quot; are NOT concerned (ex: pick 4 cards instead of 3). Bugs that violate the spirit of the game are concerned.&lt;br /&gt;
 | No penalty applies: if there is a bug that has been widely used for a game, a global ELO reset (or an ELO adjustment for players who exploited the bug) will be done. &lt;br /&gt;
 |-&lt;br /&gt;
 ! Private information&lt;br /&gt;
 | Some player gives some private information during the game&lt;br /&gt;
 | Players have the right to pretend things during a game. As these infos could be true or false, and could be exploited by other players too, moderators should be cautious when judging these cases. This case concerns players that had a strong intent to kill the pleasure of the game by giving some private information during the game.&lt;br /&gt;
 | -1 to -10 reputation penalty. Moderators should warn the player that this is a only small warning. Relapses can lead to higher reputation points penalties.&lt;br /&gt;
 |-&lt;br /&gt;
 ! Multiple accounts&lt;br /&gt;
 | A player is using multiple accounts (most of the time: to boost his ELO rank)&lt;br /&gt;
 | The report must contains the usernames of all intimidated accounts, and the reason why the report author think that multiple accounts are used. It is very difficult to find out if different accounts corresponds to different person. For example: BGA accepts that multiple players plays from the same IP address, to allow people from the same family to play at the same table. In addition, some players are using multiple accounts, but these accounts are not playing together (which is acceptable). Strong tools are available for moderators to detect multiple accounts that are used the wrong way.&lt;br /&gt;
To detect multiple accounts, you should focus on ELO boosting, which is the reason of the multiple accounts 99% of the time. You should look at player game history, for a given game, and look at frequent opponents with a very good / perfect win rate.&lt;br /&gt;
 | For secondary accounts: ban forever. For main account: ELO reseted to 1500 / ELO penalty for all games.&lt;br /&gt;
 |-&lt;br /&gt;
 ! Something else&lt;br /&gt;
 | Spam / advertising / inappropriate links&lt;br /&gt;
 | The player is using BGA for advertising. In particular: links not related to the purpose of the page, advertising for other online boardgaming websites, spam, ... &lt;br /&gt;
 | &lt;br /&gt;
 |-&lt;br /&gt;
 ! Something else&lt;br /&gt;
 | Translation stealing / vandalism&lt;br /&gt;
 | The player is writing inappropriate / poor quality translations (or writes a lot of very minor modifications to someone else translation) to gain free club membership, &lt;br /&gt;
 | Immediate ban from the website (to avoid vandalism).&lt;br /&gt;
 |-&lt;br /&gt;
 ! Something else&lt;br /&gt;
 | Player is slow to play&lt;br /&gt;
 | Players have the right to think as long as they do not go over their allotted time. If the player is slow on purpose, the good answer is: thumb down.&lt;br /&gt;
 | No penalty&lt;br /&gt;
 |-&lt;br /&gt;
 ! Something else&lt;br /&gt;
 | Player quit the game before the end&lt;br /&gt;
 | In this case, player automatically gets a ELO penalty + a red mark on his profile. There is no need to do something else.&lt;br /&gt;
 | No penalty&lt;br /&gt;
 |-&lt;br /&gt;
&lt;br /&gt;
 |}&lt;/div&gt;</summary>
		<author><name>Sourisdudesert</name></author>
	</entry>
	<entry>
		<id>https://fa.doc.boardgamearena.com/index.php?title=Moderationpolicy&amp;diff=2062</id>
		<title>Moderationpolicy</title>
		<link rel="alternate" type="text/html" href="https://fa.doc.boardgamearena.com/index.php?title=Moderationpolicy&amp;diff=2062"/>
		<updated>2016-11-22T08:04:57Z</updated>

		<summary type="html">&lt;p&gt;Sourisdudesert: /* Player profile influence */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
== General rules ==&lt;br /&gt;
&lt;br /&gt;
=== Beyond a Reasonable Doubt ===&lt;br /&gt;
&lt;br /&gt;
In case there is a any possible doubt, a player should be considered not guilty.&lt;br /&gt;
&lt;br /&gt;
=== Moderators independance ===&lt;br /&gt;
&lt;br /&gt;
Moderators must not process reports if they know the protagonists (author or targeted player). Playing online with the protagonist does not mean to &amp;quot;know&amp;quot; them. &amp;quot;Know&amp;quot; means: know them personally or playing with them online very regularly.&lt;br /&gt;
&lt;br /&gt;
=== Appeal ===&lt;br /&gt;
&lt;br /&gt;
Players has the right to appeal against the moderation decision, by forwarding received moderation email to &amp;quot;contact@boardgamearena.com&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
They &#039;&#039;&#039;MUST&#039;&#039;&#039; explain in the email why the moderator did not respect the BGA moderation policy. If the explanation is not convincing, the email will be ignored. If the player is obviously guilty and if the moderation policy hasn&#039;t been violated, BGA admins will double the penalties.&lt;br /&gt;
&lt;br /&gt;
=== Penalty grid ===&lt;br /&gt;
&lt;br /&gt;
Moderators should respect the penalties grid as much as possible. However, they have the right to adjust the penalty depending on the gravity of the case. The following situation can lead moderators to increase the penalties:&lt;br /&gt;
* the player has been reported several times for the same type of case.&lt;br /&gt;
* the player wrong action can be obviously qualified by one or several of the following terms: racism, xenophobia, homophobia, sexism, and as a rule of thumb any type of discrimination against a particular category of people.&lt;br /&gt;
* on case there is a provocation, the penalty may be be reduced a little, and the author of the provocation may have a warning BUT, as everyone should keep quiet and polite even if there are provoked, this is a moderator choice.&lt;br /&gt;
&lt;br /&gt;
=== Relapse ===&lt;br /&gt;
&lt;br /&gt;
In case there is a relapse, the penalty increases exponentially.&lt;br /&gt;
&lt;br /&gt;
This is the moderator job to determine the right penalty to apply in this case, considering the fact that the player has been warned by a first penalty.&lt;br /&gt;
&lt;br /&gt;
Moderators should consider there is a relapse only if the new wrong action occurs AFTER the previous penalty has been applied and the associated moderation email has been sent.&lt;br /&gt;
&lt;br /&gt;
Considering it&#039;s a lot of work to analyze reports about players who do the same action again and again, the &amp;quot;ban forever&amp;quot; penalty can be applied to any case if the player relapses.&lt;br /&gt;
&lt;br /&gt;
=== Special urgency ban procedure ===&lt;br /&gt;
&lt;br /&gt;
Whatever the case type, moderators has the right to ban a player from the website (forever) if this player set up a situation that is out of control and must be stopped within hours. This special procedure should only be used if there is an immediate danger for the community (ex: vandalism, flow of insults, massive spam, ...).&lt;br /&gt;
&lt;br /&gt;
=== About private jokes ===&lt;br /&gt;
&lt;br /&gt;
If a wrong action happened in a private circle (ex: at a game table, with no spectators), and if none of the present players reported the action, the moderator must consider this was a &amp;quot;private joke&amp;quot; and must not apply any penalty. In the contrary, if the wrong action is public (ex: post/comment on the wall), the moderator may consider this as a wrong action even if there is no report.&lt;br /&gt;
&lt;br /&gt;
Note: in case a moderator discovers that this is obviously not a private joke and that something must be reported, the moderator is allowed to create a report for the case. However, in this case, this moderator is not allowed to judge the report.&lt;br /&gt;
&lt;br /&gt;
=== Prescription ===&lt;br /&gt;
&lt;br /&gt;
For operational reason, a report that is older than 12 weeks may be closed by moderators because it is too old.&lt;br /&gt;
&lt;br /&gt;
As a rule of thumb, every report should be judge in a 4 weeks delay.&lt;br /&gt;
&lt;br /&gt;
=== Player profile influence ===&lt;br /&gt;
&lt;br /&gt;
The player profile IS taken into account to determine if the player is guilty or not guilty. Moderators give more credit to players with a good profile than the other.&lt;br /&gt;
&lt;br /&gt;
The player profile is NOT taken into account when choosing the penalty if the player is found guilty.&lt;br /&gt;
&lt;br /&gt;
Good profile elements are:&lt;br /&gt;
* A good thumb up / thumb down ratio.&lt;br /&gt;
* Player is registered since a long time / has a lot of games played.&lt;br /&gt;
* Players is involved in the website (ex: realized translations).&lt;br /&gt;
* Player is supporting BGA (member of the club).&lt;br /&gt;
&lt;br /&gt;
You should also take into account the profile of the reporting player (report author) : a bad reputation and/or an important number of reports already judged as &amp;quot;not guilty&amp;quot; should incite you to be very careful with this player report.&lt;br /&gt;
&lt;br /&gt;
=== Incomplete reports ===&lt;br /&gt;
&lt;br /&gt;
Analyzing reports takes a lot of time, and many reports are received. If any needed information is missing in the report, moderators may (and most of the time, should) close the report.&lt;br /&gt;
&lt;br /&gt;
== Penalty grid ==&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable alternance centre&amp;quot;&lt;br /&gt;
|+ Titre&lt;br /&gt;
 |-&lt;br /&gt;
 ! scope=&amp;quot;col&amp;quot; | Category&lt;br /&gt;
 ! scope=&amp;quot;col&amp;quot; | Case type&lt;br /&gt;
 ! scope=&amp;quot;col&amp;quot; | Details&lt;br /&gt;
 ! scope=&amp;quot;col&amp;quot; | Standard penalty&lt;br /&gt;
 |-&lt;br /&gt;
 ! Insults&lt;br /&gt;
 | Insults during a game, on table chat&lt;br /&gt;
 | Must be present in the report: table ID, and the insults terms. If the insult is not in English, or if the insult is not obvious, the report author must specify why this is insulting.&lt;br /&gt;
 | Devilkin 3 days for small insults and insanity, Devilkin 30 days for real insults. Smaller penalty (ex: 1 day) can be applied if this was obviously a stupid joke. In any case: the player should be warn that this is the last warning before ban.&lt;br /&gt;
 |-&lt;br /&gt;
 ! Insults&lt;br /&gt;
 | Insults on general chat&lt;br /&gt;
 | Must be present in the report: the insult terms. If the insult is not in English, or if the insult is not obvious, the report author must specify why this is insulting.&lt;br /&gt;
 | Devilkin 30 days for small insults and insanity, Devilkin forever for real insults. In any case: the player should be warn that this is the last warning before ban.&lt;br /&gt;
 |-&lt;br /&gt;
 ! Insults&lt;br /&gt;
 | Insults on public space (wall, forum, comments...)&lt;br /&gt;
 | Must be present in the report: where to find the insult, the insult terms. If the insult is not in English, or if the insult is not obvious, the report author must specify why this is insulting.&lt;br /&gt;
 | Devilkin 3 days for small insults and insanity, Devilkin 30 days for real insults. Smaller penalty (ex: 1 day) can be applied if this was obviously a stupid joke. In any case: the player should be warn that this is the last warning before ban.&lt;br /&gt;
 |-&lt;br /&gt;
 ! Aggressive attitude&lt;br /&gt;
 | Aggressive attitude during a game: can&#039;t wait the other player, provocation, ...&lt;br /&gt;
 | As a rule of thumb: as long as there is no insult, this is not an issue: thumb down are the solution. BUT, if the player is really borderline and should be warned, a moderation action is needed.&lt;br /&gt;
 | -1 to -10 reputation penalty. Moderators should explain that this is a small warning, and that a change of attitude is needed.&lt;br /&gt;
 |-&lt;br /&gt;
 ! Avatar&lt;br /&gt;
 | Inappropriate avatar: explicit sexual content, extreme violence, advertising...&lt;br /&gt;
 | If needed, report author should explain why this is inappropriate. Avatar is really inappropriate in 3 cases:&lt;br /&gt;
1°) It can hurt underage players (explicit sexual content, extreme violence)&lt;br /&gt;
2°) This is advertisement / this violate some intellectual property&lt;br /&gt;
3°) The avatar contains a reference that discriminate a group of people (ex: nazi cross)&lt;br /&gt;
 | Avatar immediate removal + Devilkin 3 days to devilkin forever depending on the gravity. In any case: the player should be warn that this is the last warning before ban. If the player obviously don&#039;t measure the meaning of the avatar, the penalty can be reduced.&lt;br /&gt;
 |-&lt;br /&gt;
 ! Avatar&lt;br /&gt;
 | Inappropriate username&lt;br /&gt;
 | If needed, report author should explain why this is inappropriate. Username are inappropriate when this is obviously an insult for many people. Moderators shouldn&#039;t moderate a username that is insulting by accident in a language that is not widely used on BGA.&lt;br /&gt;
 | Ban from the website. Moderators should explain that the player is welcome with another username on BGA. Note that if the player has a long seniority on BGA (=many games played), moderators should be very cautious on the case: if no one noticed the username until now, it is probably not inappropriate.&lt;br /&gt;
 |-&lt;br /&gt;
 ! Table description&lt;br /&gt;
 | Inappropriate table description&lt;br /&gt;
 | If needed, report author should explain why this is inappropriate. Table description is inappropriate when it contains insults, insanity, or tend to discriminate a group of people. &lt;br /&gt;
 | Devilkin 3 days for small insults and insanity, Devilkin 30 days for real insults. Smaller penalty (ex: 1 day) can be applied if this was obviously a stupid joke. In any case: the player should be warn that this is the last warning before ban.&lt;br /&gt;
 |-&lt;br /&gt;
 ! Kingmaking&lt;br /&gt;
 | Kingmaking action during a game&lt;br /&gt;
 | The report must contains the table id, the exact move number, and the exact explanation why this is a kingmaking action. To declare a player guilty, the player must have played an obvious move against his own interest, and it has to be a good player (clues: his ELO, number of game played, ...). As the difference between a mistake and a kingmaking action is very tight, one kingmaking report is not enough to find a player guilty: only players who regularly play against their interest should be found guilty.&lt;br /&gt;
 | -1 to -10 reputation penalty. Moderators should warn the player that this is a only small warning. Relapses can lead to higher reputation points penalties.&lt;br /&gt;
 |-&lt;br /&gt;
 ! Bug exploit&lt;br /&gt;
 | Exploit a known bug during a game&lt;br /&gt;
 | The bug must have been reported in the forum, and an exact reference to this bug must be in the report, with the table id and the move number. Minor bugs that can be considered as &amp;quot;variants&amp;quot; are NOT concerned (ex: pick 4 cards instead of 3). Bugs that violate the spirit of the game are concerned.&lt;br /&gt;
 | No penalty applies: if there is a bug that has been widely used for a game, a global ELO reset (or an ELO adjustment for players who exploited the bug) will be done. &lt;br /&gt;
 |-&lt;br /&gt;
 ! Private information&lt;br /&gt;
 | Some player gives some private information during the game&lt;br /&gt;
 | Players have the right to pretend things during a game. As these infos could be true or false, and could be exploited by other players too, moderators should be cautious when judging these cases. This case concerns players that had a strong intent to kill the pleasure of the game by giving some private information during the game.&lt;br /&gt;
 | -1 to -10 reputation penalty. Moderators should warn the player that this is a only small warning. Relapses can lead to higher reputation points penalties.&lt;br /&gt;
 |-&lt;br /&gt;
 ! Multiple accounts&lt;br /&gt;
 | A player is using multiple accounts (most of the time: to boost his ELO rank)&lt;br /&gt;
 | The report must contains the usernames of all intimidated accounts, and the reason why the report author think that multiple accounts are used. It is very difficult to find out if different accounts corresponds to different person. For example: BGA accepts that multiple players plays from the same IP address, to allow people from the same family to play at the same table. In addition, some players are using multiple accounts, but these accounts are not playing together (which is acceptable). Strong tools are available for moderators to detect multiple accounts that are used the wrong way.&lt;br /&gt;
To detect multiple accounts, you should focus on ELO boosting, which is the reason of the multiple accounts 99% of the time. You should look at player game history, for a given game, and look at frequent opponents with a very good / perfect win rate.&lt;br /&gt;
 | For secondary accounts: ban forever. For main account: ELO reseted to 1500 / ELO penalty for all games.&lt;br /&gt;
 |-&lt;br /&gt;
 ! Something else&lt;br /&gt;
 | Spam / advertising / inappropriate links&lt;br /&gt;
 | The player is using BGA for advertising. In particular: links not related to the purpose of the page, advertising for other online boardgaming websites, spam, ... &lt;br /&gt;
 | &lt;br /&gt;
 |-&lt;br /&gt;
 ! Something else&lt;br /&gt;
 | Translation stealing / vandalism&lt;br /&gt;
 | The player is writing inappropriate / poor quality translations (or writes a lot of very minor modifications to someone else translation) to gain free club membership, &lt;br /&gt;
 | Immediate ban from the website (to avoid vandalism).&lt;br /&gt;
 |-&lt;br /&gt;
 ! Something else&lt;br /&gt;
 | Player is slow to play&lt;br /&gt;
 | Players have the right to think as long as they do not go over their allotted time. If the player is slow on purpose, the good answer is: thumb down.&lt;br /&gt;
 | No penalty&lt;br /&gt;
 |-&lt;br /&gt;
 ! Something else&lt;br /&gt;
 | Player quit the game before the end&lt;br /&gt;
 | In this case, player automatically gets a ELO penalty + a red mark on his profile. There is no need to do something else.&lt;br /&gt;
 | No penalty&lt;br /&gt;
 |-&lt;br /&gt;
&lt;br /&gt;
 |}&lt;/div&gt;</summary>
		<author><name>Sourisdudesert</name></author>
	</entry>
	<entry>
		<id>https://fa.doc.boardgamearena.com/index.php?title=Moderationpolicy&amp;diff=2061</id>
		<title>Moderationpolicy</title>
		<link rel="alternate" type="text/html" href="https://fa.doc.boardgamearena.com/index.php?title=Moderationpolicy&amp;diff=2061"/>
		<updated>2016-11-22T08:03:07Z</updated>

		<summary type="html">&lt;p&gt;Sourisdudesert: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
== General rules ==&lt;br /&gt;
&lt;br /&gt;
=== Beyond a Reasonable Doubt ===&lt;br /&gt;
&lt;br /&gt;
In case there is a any possible doubt, a player should be considered not guilty.&lt;br /&gt;
&lt;br /&gt;
=== Moderators independance ===&lt;br /&gt;
&lt;br /&gt;
Moderators must not process reports if they know the protagonists (author or targeted player). Playing online with the protagonist does not mean to &amp;quot;know&amp;quot; them. &amp;quot;Know&amp;quot; means: know them personally or playing with them online very regularly.&lt;br /&gt;
&lt;br /&gt;
=== Appeal ===&lt;br /&gt;
&lt;br /&gt;
Players has the right to appeal against the moderation decision, by forwarding received moderation email to &amp;quot;contact@boardgamearena.com&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
They &#039;&#039;&#039;MUST&#039;&#039;&#039; explain in the email why the moderator did not respect the BGA moderation policy. If the explanation is not convincing, the email will be ignored. If the player is obviously guilty and if the moderation policy hasn&#039;t been violated, BGA admins will double the penalties.&lt;br /&gt;
&lt;br /&gt;
=== Penalty grid ===&lt;br /&gt;
&lt;br /&gt;
Moderators should respect the penalties grid as much as possible. However, they have the right to adjust the penalty depending on the gravity of the case. The following situation can lead moderators to increase the penalties:&lt;br /&gt;
* the player has been reported several times for the same type of case.&lt;br /&gt;
* the player wrong action can be obviously qualified by one or several of the following terms: racism, xenophobia, homophobia, sexism, and as a rule of thumb any type of discrimination against a particular category of people.&lt;br /&gt;
* on case there is a provocation, the penalty may be be reduced a little, and the author of the provocation may have a warning BUT, as everyone should keep quiet and polite even if there are provoked, this is a moderator choice.&lt;br /&gt;
&lt;br /&gt;
=== Relapse ===&lt;br /&gt;
&lt;br /&gt;
In case there is a relapse, the penalty increases exponentially.&lt;br /&gt;
&lt;br /&gt;
This is the moderator job to determine the right penalty to apply in this case, considering the fact that the player has been warned by a first penalty.&lt;br /&gt;
&lt;br /&gt;
Moderators should consider there is a relapse only if the new wrong action occurs AFTER the previous penalty has been applied and the associated moderation email has been sent.&lt;br /&gt;
&lt;br /&gt;
Considering it&#039;s a lot of work to analyze reports about players who do the same action again and again, the &amp;quot;ban forever&amp;quot; penalty can be applied to any case if the player relapses.&lt;br /&gt;
&lt;br /&gt;
=== Special urgency ban procedure ===&lt;br /&gt;
&lt;br /&gt;
Whatever the case type, moderators has the right to ban a player from the website (forever) if this player set up a situation that is out of control and must be stopped within hours. This special procedure should only be used if there is an immediate danger for the community (ex: vandalism, flow of insults, massive spam, ...).&lt;br /&gt;
&lt;br /&gt;
=== About private jokes ===&lt;br /&gt;
&lt;br /&gt;
If a wrong action happened in a private circle (ex: at a game table, with no spectators), and if none of the present players reported the action, the moderator must consider this was a &amp;quot;private joke&amp;quot; and must not apply any penalty. In the contrary, if the wrong action is public (ex: post/comment on the wall), the moderator may consider this as a wrong action even if there is no report.&lt;br /&gt;
&lt;br /&gt;
Note: in case a moderator discovers that this is obviously not a private joke and that something must be reported, the moderator is allowed to create a report for the case. However, in this case, this moderator is not allowed to judge the report.&lt;br /&gt;
&lt;br /&gt;
=== Prescription ===&lt;br /&gt;
&lt;br /&gt;
For operational reason, a report that is older than 12 weeks may be closed by moderators because it is too old.&lt;br /&gt;
&lt;br /&gt;
As a rule of thumb, every report should be judge in a 4 weeks delay.&lt;br /&gt;
&lt;br /&gt;
=== Player profile influence ===&lt;br /&gt;
&lt;br /&gt;
The player profile IS taken into account to determine if the player is guilty or not guilty. Moderators give more credit to players with a good profile than the other.&lt;br /&gt;
&lt;br /&gt;
The player profile is NOT taken into account when choosing the penalty if the player is found guilty.&lt;br /&gt;
&lt;br /&gt;
Good profile elements are:&lt;br /&gt;
* A good thumb up / thumb down ratio.&lt;br /&gt;
* Player is registered since a long time / has a lot of games played.&lt;br /&gt;
* Players is involved in the website (ex: realized translations).&lt;br /&gt;
* Player is supporting BGA (member of the club).&lt;br /&gt;
&lt;br /&gt;
=== Incomplete reports ===&lt;br /&gt;
&lt;br /&gt;
Analyzing reports takes a lot of time, and many reports are received. If any needed information is missing in the report, moderators may (and most of the time, should) close the report.&lt;br /&gt;
&lt;br /&gt;
== Penalty grid ==&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable alternance centre&amp;quot;&lt;br /&gt;
|+ Titre&lt;br /&gt;
 |-&lt;br /&gt;
 ! scope=&amp;quot;col&amp;quot; | Category&lt;br /&gt;
 ! scope=&amp;quot;col&amp;quot; | Case type&lt;br /&gt;
 ! scope=&amp;quot;col&amp;quot; | Details&lt;br /&gt;
 ! scope=&amp;quot;col&amp;quot; | Standard penalty&lt;br /&gt;
 |-&lt;br /&gt;
 ! Insults&lt;br /&gt;
 | Insults during a game, on table chat&lt;br /&gt;
 | Must be present in the report: table ID, and the insults terms. If the insult is not in English, or if the insult is not obvious, the report author must specify why this is insulting.&lt;br /&gt;
 | Devilkin 3 days for small insults and insanity, Devilkin 30 days for real insults. Smaller penalty (ex: 1 day) can be applied if this was obviously a stupid joke. In any case: the player should be warn that this is the last warning before ban.&lt;br /&gt;
 |-&lt;br /&gt;
 ! Insults&lt;br /&gt;
 | Insults on general chat&lt;br /&gt;
 | Must be present in the report: the insult terms. If the insult is not in English, or if the insult is not obvious, the report author must specify why this is insulting.&lt;br /&gt;
 | Devilkin 30 days for small insults and insanity, Devilkin forever for real insults. In any case: the player should be warn that this is the last warning before ban.&lt;br /&gt;
 |-&lt;br /&gt;
 ! Insults&lt;br /&gt;
 | Insults on public space (wall, forum, comments...)&lt;br /&gt;
 | Must be present in the report: where to find the insult, the insult terms. If the insult is not in English, or if the insult is not obvious, the report author must specify why this is insulting.&lt;br /&gt;
 | Devilkin 3 days for small insults and insanity, Devilkin 30 days for real insults. Smaller penalty (ex: 1 day) can be applied if this was obviously a stupid joke. In any case: the player should be warn that this is the last warning before ban.&lt;br /&gt;
 |-&lt;br /&gt;
 ! Aggressive attitude&lt;br /&gt;
 | Aggressive attitude during a game: can&#039;t wait the other player, provocation, ...&lt;br /&gt;
 | As a rule of thumb: as long as there is no insult, this is not an issue: thumb down are the solution. BUT, if the player is really borderline and should be warned, a moderation action is needed.&lt;br /&gt;
 | -1 to -10 reputation penalty. Moderators should explain that this is a small warning, and that a change of attitude is needed.&lt;br /&gt;
 |-&lt;br /&gt;
 ! Avatar&lt;br /&gt;
 | Inappropriate avatar: explicit sexual content, extreme violence, advertising...&lt;br /&gt;
 | If needed, report author should explain why this is inappropriate. Avatar is really inappropriate in 3 cases:&lt;br /&gt;
1°) It can hurt underage players (explicit sexual content, extreme violence)&lt;br /&gt;
2°) This is advertisement / this violate some intellectual property&lt;br /&gt;
3°) The avatar contains a reference that discriminate a group of people (ex: nazi cross)&lt;br /&gt;
 | Avatar immediate removal + Devilkin 3 days to devilkin forever depending on the gravity. In any case: the player should be warn that this is the last warning before ban. If the player obviously don&#039;t measure the meaning of the avatar, the penalty can be reduced.&lt;br /&gt;
 |-&lt;br /&gt;
 ! Avatar&lt;br /&gt;
 | Inappropriate username&lt;br /&gt;
 | If needed, report author should explain why this is inappropriate. Username are inappropriate when this is obviously an insult for many people. Moderators shouldn&#039;t moderate a username that is insulting by accident in a language that is not widely used on BGA.&lt;br /&gt;
 | Ban from the website. Moderators should explain that the player is welcome with another username on BGA. Note that if the player has a long seniority on BGA (=many games played), moderators should be very cautious on the case: if no one noticed the username until now, it is probably not inappropriate.&lt;br /&gt;
 |-&lt;br /&gt;
 ! Table description&lt;br /&gt;
 | Inappropriate table description&lt;br /&gt;
 | If needed, report author should explain why this is inappropriate. Table description is inappropriate when it contains insults, insanity, or tend to discriminate a group of people. &lt;br /&gt;
 | Devilkin 3 days for small insults and insanity, Devilkin 30 days for real insults. Smaller penalty (ex: 1 day) can be applied if this was obviously a stupid joke. In any case: the player should be warn that this is the last warning before ban.&lt;br /&gt;
 |-&lt;br /&gt;
 ! Kingmaking&lt;br /&gt;
 | Kingmaking action during a game&lt;br /&gt;
 | The report must contains the table id, the exact move number, and the exact explanation why this is a kingmaking action. To declare a player guilty, the player must have played an obvious move against his own interest, and it has to be a good player (clues: his ELO, number of game played, ...). As the difference between a mistake and a kingmaking action is very tight, one kingmaking report is not enough to find a player guilty: only players who regularly play against their interest should be found guilty.&lt;br /&gt;
 | -1 to -10 reputation penalty. Moderators should warn the player that this is a only small warning. Relapses can lead to higher reputation points penalties.&lt;br /&gt;
 |-&lt;br /&gt;
 ! Bug exploit&lt;br /&gt;
 | Exploit a known bug during a game&lt;br /&gt;
 | The bug must have been reported in the forum, and an exact reference to this bug must be in the report, with the table id and the move number. Minor bugs that can be considered as &amp;quot;variants&amp;quot; are NOT concerned (ex: pick 4 cards instead of 3). Bugs that violate the spirit of the game are concerned.&lt;br /&gt;
 | No penalty applies: if there is a bug that has been widely used for a game, a global ELO reset (or an ELO adjustment for players who exploited the bug) will be done. &lt;br /&gt;
 |-&lt;br /&gt;
 ! Private information&lt;br /&gt;
 | Some player gives some private information during the game&lt;br /&gt;
 | Players have the right to pretend things during a game. As these infos could be true or false, and could be exploited by other players too, moderators should be cautious when judging these cases. This case concerns players that had a strong intent to kill the pleasure of the game by giving some private information during the game.&lt;br /&gt;
 | -1 to -10 reputation penalty. Moderators should warn the player that this is a only small warning. Relapses can lead to higher reputation points penalties.&lt;br /&gt;
 |-&lt;br /&gt;
 ! Multiple accounts&lt;br /&gt;
 | A player is using multiple accounts (most of the time: to boost his ELO rank)&lt;br /&gt;
 | The report must contains the usernames of all intimidated accounts, and the reason why the report author think that multiple accounts are used. It is very difficult to find out if different accounts corresponds to different person. For example: BGA accepts that multiple players plays from the same IP address, to allow people from the same family to play at the same table. In addition, some players are using multiple accounts, but these accounts are not playing together (which is acceptable). Strong tools are available for moderators to detect multiple accounts that are used the wrong way.&lt;br /&gt;
To detect multiple accounts, you should focus on ELO boosting, which is the reason of the multiple accounts 99% of the time. You should look at player game history, for a given game, and look at frequent opponents with a very good / perfect win rate.&lt;br /&gt;
 | For secondary accounts: ban forever. For main account: ELO reseted to 1500 / ELO penalty for all games.&lt;br /&gt;
 |-&lt;br /&gt;
 ! Something else&lt;br /&gt;
 | Spam / advertising / inappropriate links&lt;br /&gt;
 | The player is using BGA for advertising. In particular: links not related to the purpose of the page, advertising for other online boardgaming websites, spam, ... &lt;br /&gt;
 | &lt;br /&gt;
 |-&lt;br /&gt;
 ! Something else&lt;br /&gt;
 | Translation stealing / vandalism&lt;br /&gt;
 | The player is writing inappropriate / poor quality translations (or writes a lot of very minor modifications to someone else translation) to gain free club membership, &lt;br /&gt;
 | Immediate ban from the website (to avoid vandalism).&lt;br /&gt;
 |-&lt;br /&gt;
 ! Something else&lt;br /&gt;
 | Player is slow to play&lt;br /&gt;
 | Players have the right to think as long as they do not go over their allotted time. If the player is slow on purpose, the good answer is: thumb down.&lt;br /&gt;
 | No penalty&lt;br /&gt;
 |-&lt;br /&gt;
 ! Something else&lt;br /&gt;
 | Player quit the game before the end&lt;br /&gt;
 | In this case, player automatically gets a ELO penalty + a red mark on his profile. There is no need to do something else.&lt;br /&gt;
 | No penalty&lt;br /&gt;
 |-&lt;br /&gt;
&lt;br /&gt;
 |}&lt;/div&gt;</summary>
		<author><name>Sourisdudesert</name></author>
	</entry>
	<entry>
		<id>https://fa.doc.boardgamearena.com/index.php?title=Moderationpolicy&amp;diff=2060</id>
		<title>Moderationpolicy</title>
		<link rel="alternate" type="text/html" href="https://fa.doc.boardgamearena.com/index.php?title=Moderationpolicy&amp;diff=2060"/>
		<updated>2016-11-22T07:59:43Z</updated>

		<summary type="html">&lt;p&gt;Sourisdudesert: /* Prescription */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
== General rules ==&lt;br /&gt;
&lt;br /&gt;
=== Beyond a Reasonable Doubt ===&lt;br /&gt;
&lt;br /&gt;
In case there is a any possible doubt, a player should be considered not guilty.&lt;br /&gt;
&lt;br /&gt;
=== Moderators independance ===&lt;br /&gt;
&lt;br /&gt;
Moderators must not process reports if they know the protagonists (author or targeted player). Playing online with the protagonist does not mean to &amp;quot;know&amp;quot; them. &amp;quot;Know&amp;quot; means: know them personally or playing with them online very regularly.&lt;br /&gt;
&lt;br /&gt;
=== Appeal ===&lt;br /&gt;
&lt;br /&gt;
Players has the right to appeal against the moderation decision, by forwarding received moderation email to &amp;quot;contact@boardgamearena.com&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
They &#039;&#039;&#039;MUST&#039;&#039;&#039; explain in the email why the moderator did not respect the BGA moderation policy. If the explanation is not convincing, the email will be ignored. If the player is obviously guilty and if the moderation policy hasn&#039;t been violated, BGA admins will double the penalties.&lt;br /&gt;
&lt;br /&gt;
=== Penalty grid ===&lt;br /&gt;
&lt;br /&gt;
Moderators should respect the penalties grid as much as possible. However, they have the right to adjust the penalty depending on the gravity of the case. The following situation can lead moderators to increase the penalties:&lt;br /&gt;
* the player has been reported several times for the same type of case.&lt;br /&gt;
* the player wrong action can be obviously qualified by one or several of the following terms: racism, xenophobia, homophobia, sexism, and as a rule of thumb any type of discrimination against a particular category of people.&lt;br /&gt;
* on case there is a provocation, the penalty may be be reduced a little, and the author of the provocation may have a warning BUT, as everyone should keep quiet and polite even if there are provoked, this is a moderator choice.&lt;br /&gt;
&lt;br /&gt;
=== Relapse ===&lt;br /&gt;
&lt;br /&gt;
In case there is a relapse, the penalty increases exponentially.&lt;br /&gt;
&lt;br /&gt;
This is the moderator job to determine the right penalty to apply in this case, considering the fact that the player has been warned by a first penalty.&lt;br /&gt;
&lt;br /&gt;
Moderators should consider there is a relapse only if the new wrong action occurs AFTER the previous penalty has been applied and the associated moderation email has been sent.&lt;br /&gt;
&lt;br /&gt;
Considering it&#039;s a lot of work to analyze reports about players who do the same action again and again, the &amp;quot;ban forever&amp;quot; penalty can be applied to any case if the player relapses.&lt;br /&gt;
&lt;br /&gt;
=== Special urgency ban procedure ===&lt;br /&gt;
&lt;br /&gt;
Whatever the case type, moderators has the right to ban a player from the website (forever) if this player set up a situation that is out of control and must be stopped within hours. This special procedure should only be used if there is an immediate danger for the community (ex: vandalism, flow of insults, massive spam, ...).&lt;br /&gt;
&lt;br /&gt;
=== About private jokes ===&lt;br /&gt;
&lt;br /&gt;
If a wrong action happened in a private circle (ex: at a game table, with no spectators), and if none of the present players reported the action, the moderator must consider this was a &amp;quot;private joke&amp;quot; and must not apply any penalty. In the contrary, if the wrong action is public (ex: post/comment on the wall), the moderator may consider this as a wrong action even if there is no report.&lt;br /&gt;
&lt;br /&gt;
Note: in case a moderator discovers that this is obviously not a private joke and that something must be reported, the moderator is allowed to create a report for the case. However, in this case, this moderator is not allowed to judge the report.&lt;br /&gt;
&lt;br /&gt;
=== Prescription ===&lt;br /&gt;
&lt;br /&gt;
For operational reason, a report that is older than 12 weeks may be closed by moderators because it is too old.&lt;br /&gt;
&lt;br /&gt;
As a rule of thumb, every report should be judge in a 4 weeks delay.&lt;br /&gt;
&lt;br /&gt;
=== Player profile influence ===&lt;br /&gt;
&lt;br /&gt;
The player profile IS taken into account to determine if the player is guilty or not guilty. Moderators give more credit to players with a good profile than the other.&lt;br /&gt;
&lt;br /&gt;
The player profile is NOT taken into account when choosing the penalty if the player is found guilty.&lt;br /&gt;
&lt;br /&gt;
Good profile elements are:&lt;br /&gt;
* A good thumb up / thumb down ratio.&lt;br /&gt;
* Player is registered since a long time / has a lot of games played.&lt;br /&gt;
* Players is involved in the website (ex: realized translations).&lt;br /&gt;
* Player is supporting BGA (member of the club).&lt;br /&gt;
&lt;br /&gt;
=== Incomplete reports ===&lt;br /&gt;
&lt;br /&gt;
Analyzing reports takes a lot of time, and many reports are received. If any needed information is missing in the report, moderators may (and most of the time, should) close the report.&lt;br /&gt;
&lt;br /&gt;
== Penalty grid ==&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable alternance centre&amp;quot;&lt;br /&gt;
|+ Titre&lt;br /&gt;
 |-&lt;br /&gt;
 ! scope=&amp;quot;col&amp;quot; | Category&lt;br /&gt;
 ! scope=&amp;quot;col&amp;quot; | Case type&lt;br /&gt;
 ! scope=&amp;quot;col&amp;quot; | Details&lt;br /&gt;
 ! scope=&amp;quot;col&amp;quot; | Standard penalty&lt;br /&gt;
 |-&lt;br /&gt;
 ! Insults&lt;br /&gt;
 | Insults during a game, on table chat&lt;br /&gt;
 | Must be present in the report: table ID, and the insults terms. If the insult is not in English, or if the insult is not obvious, the report author must specify why this is insulting.&lt;br /&gt;
 | Devilkin 3 days for small insults and insanity, Devilkin 30 days for real insults. Smaller penalty (ex: 1 day) can be applied if this was obviously a stupid joke. In any case: the player should be warn that this is the last warning before ban.&lt;br /&gt;
 |-&lt;br /&gt;
 ! Insults&lt;br /&gt;
 | Insults on general chat&lt;br /&gt;
 | Must be present in the report: the insult terms. If the insult is not in English, or if the insult is not obvious, the report author must specify why this is insulting.&lt;br /&gt;
 | Devilkin 30 days for small insults and insanity, Devilkin forever for real insults. In any case: the player should be warn that this is the last warning before ban.&lt;br /&gt;
 |-&lt;br /&gt;
 ! Insults&lt;br /&gt;
 | Insults on public space (wall, forum, comments...)&lt;br /&gt;
 | Must be present in the report: where to find the insult, the insult terms. If the insult is not in English, or if the insult is not obvious, the report author must specify why this is insulting.&lt;br /&gt;
 | Devilkin 3 days for small insults and insanity, Devilkin 30 days for real insults. Smaller penalty (ex: 1 day) can be applied if this was obviously a stupid joke. In any case: the player should be warn that this is the last warning before ban.&lt;br /&gt;
 |-&lt;br /&gt;
 ! Aggressive attitude&lt;br /&gt;
 | Aggressive attitude during a game: can&#039;t wait the other player, provocation, ...&lt;br /&gt;
 | As a rule of thumb: as long as there is no insult, this is not an issue: thumb down are the solution. BUT, if the player is really borderline and should be warned, a moderation action is needed.&lt;br /&gt;
 | -1 to -10 reputation penalty. Moderators should explain that this is a small warning, and that a change of attitude is needed.&lt;br /&gt;
 |-&lt;br /&gt;
 ! Avatar&lt;br /&gt;
 | Inappropriate avatar: explicit sexual content, extreme violence, advertising...&lt;br /&gt;
 | If needed, report author should explain why this is inappropriate. Avatar is really inappropriate in 3 cases:&lt;br /&gt;
1°) It can hurt underage players (explicit sexual content, extreme violence)&lt;br /&gt;
2°) This is advertisement / this violate some intellectual property&lt;br /&gt;
3°) The avatar contains a reference that discriminate a group of people (ex: nazi cross)&lt;br /&gt;
 | Avatar immediate removal + Devilkin 3 days to devilkin forever depending on the gravity. In any case: the player should be warn that this is the last warning before ban. If the player obviously don&#039;t measure the meaning of the avatar, the penalty can be reduced.&lt;br /&gt;
 |-&lt;br /&gt;
 ! Avatar&lt;br /&gt;
 | Inappropriate username&lt;br /&gt;
 | If needed, report author should explain why this is inappropriate. Username are inappropriate when this is obviously an insult for many people. Moderators shouldn&#039;t moderate a username that is insulting by accident in a language that is not widely used on BGA.&lt;br /&gt;
 | Ban from the website. Moderators should explain that the player is welcome with another username on BGA. Note that if the player has a long seniority on BGA (=many games played), moderators should be very cautious on the case: if no one noticed the username until now, it is probably not inappropriate.&lt;br /&gt;
 |-&lt;br /&gt;
 ! Table description&lt;br /&gt;
 | Inappropriate table description&lt;br /&gt;
 | If needed, report author should explain why this is inappropriate. Table description is inappropriate when it contains insults, insanity, or tend to discriminate a group of people. &lt;br /&gt;
 | Devilkin 3 days for small insults and insanity, Devilkin 30 days for real insults. Smaller penalty (ex: 1 day) can be applied if this was obviously a stupid joke. In any case: the player should be warn that this is the last warning before ban.&lt;br /&gt;
 |-&lt;br /&gt;
 ! Kingmaking&lt;br /&gt;
 | Kingmaking action during a game&lt;br /&gt;
 | The report must contains the table id, the exact move number, and the exact explanation why this is a kingmaking action. To declare a player guilty, the player must have played an obvious move against his own interest, and it has to be a good player (clues: his ELO, number of game played, ...). As the difference between a mistake and a kingmaking action is very tight, one kingmaking report is not enough to find a player guilty: only players who regularly play against their interest should be found guilty.&lt;br /&gt;
 | -1 to -10 reputation penalty. Moderators should warn the player that this is a only small warning. Relapses can lead to higher reputation points penalties.&lt;br /&gt;
 |-&lt;br /&gt;
 ! Bug exploit&lt;br /&gt;
 | Exploit a known bug during a game&lt;br /&gt;
 | The bug must have been reported in the forum, and an exact reference to this bug must be in the report, with the table id and the move number. Minor bugs that can be considered as &amp;quot;variants&amp;quot; are NOT concerned (ex: pick 4 cards instead of 3). Bugs that violate the spirit of the game are concerned.&lt;br /&gt;
 | No penalty applies: if there is a bug that has been widely used for a game, a global ELO reset (or an ELO adjustment for players who exploited the bug) will be done. &lt;br /&gt;
 |-&lt;br /&gt;
 ! Private information&lt;br /&gt;
 | Some player gives some private information during the game&lt;br /&gt;
 | Players have the right to pretend things during a game. As these infos could be true or false, and could be exploited by other players too, moderators should be cautious when judging these cases. This case concerns players that had a strong intent to kill the pleasure of the game by giving some private information during the game.&lt;br /&gt;
 | -1 to -10 reputation penalty. Moderators should warn the player that this is a only small warning. Relapses can lead to higher reputation points penalties.&lt;br /&gt;
 |-&lt;br /&gt;
 ! Multiple accounts&lt;br /&gt;
 | A player is using multiple accounts (most of the time: to boost his ELO rank)&lt;br /&gt;
 | The report must contains the usernames of all intimidated accounts, and the reason why the report author think that multiple accounts are used. It is very difficult to find out if different accounts corresponds to different person. For example: BGA accepts that multiple players plays from the same IP address, to allow people from the same family to play at the same table. In addition, some players are using multiple accounts, but these accounts are not playing together (which is acceptable). Strong tools are available for moderators to detect multiple accounts that are used the wrong way.&lt;br /&gt;
 | For secondary accounts: ban forever. For main account: ELO reseted to 1500 / ELO penalty for all games.&lt;br /&gt;
 |-&lt;br /&gt;
 ! Something else&lt;br /&gt;
 | Spam / advertising / inappropriate links&lt;br /&gt;
 | The player is using BGA for advertising. In particular: links not related to the purpose of the page, advertising for other online boardgaming websites, spam, ... &lt;br /&gt;
 | &lt;br /&gt;
 |-&lt;br /&gt;
 ! Something else&lt;br /&gt;
 | Translation stealing / vandalism&lt;br /&gt;
 | The player is writing inappropriate / poor quality translations (or writes a lot of very minor modifications to someone else translation) to gain free club membership, &lt;br /&gt;
 | Immediate ban from the website (to avoid vandalism).&lt;br /&gt;
 |-&lt;br /&gt;
 ! Something else&lt;br /&gt;
 | Player is slow to play&lt;br /&gt;
 | Players have the right to think as long as they do not go over their allotted time. If the player is slow on purpose, the good answer is: thumb down.&lt;br /&gt;
 | No penalty&lt;br /&gt;
 |-&lt;br /&gt;
 ! Something else&lt;br /&gt;
 | Player quit the game before the end&lt;br /&gt;
 | In this case, player automatically gets a ELO penalty + a red mark on his profile. There is no need to do something else.&lt;br /&gt;
 | No penalty&lt;br /&gt;
 |-&lt;br /&gt;
&lt;br /&gt;
 |}&lt;/div&gt;</summary>
		<author><name>Sourisdudesert</name></author>
	</entry>
	<entry>
		<id>https://fa.doc.boardgamearena.com/index.php?title=Game_layout:_view_and_template:_yourgamename.view.php_and_yourgamename_yourgamename.tpl&amp;diff=2007</id>
		<title>Game layout: view and template: yourgamename.view.php and yourgamename yourgamename.tpl</title>
		<link rel="alternate" type="text/html" href="https://fa.doc.boardgamearena.com/index.php?title=Game_layout:_view_and_template:_yourgamename.view.php_and_yourgamename_yourgamename.tpl&amp;diff=2007"/>
		<updated>2016-10-07T06:58:04Z</updated>

		<summary type="html">&lt;p&gt;Sourisdudesert: /* Tips: displaying a nice button */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;These 2 files work together to provide the HTML layout of your game.&lt;br /&gt;
&lt;br /&gt;
Using these 2 files, you specify what HTML is rendered in your game client interface.&lt;br /&gt;
&lt;br /&gt;
In &amp;lt;yourgame.tpl&amp;gt;, you can directly write raw HTML that will be displayed by the browser.&lt;br /&gt;
&lt;br /&gt;
Example: extract of &amp;quot;hearts_hearts.tpl&amp;quot;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  &amp;lt;div id=&amp;quot;myhand_wrap&amp;quot; class=&amp;quot;whiteblock&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;h3&amp;gt;{MY_HAND}&amp;lt;/h3&amp;gt;&lt;br /&gt;
    &amp;lt;div id=&amp;quot;myhand&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;/div&amp;gt;&lt;br /&gt;
  &amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== WARNING ==&lt;br /&gt;
&lt;br /&gt;
Your view and your template are supposed to generate only the BASE layout of the game&lt;br /&gt;
&lt;br /&gt;
You shouldn&#039;t try to setup the current game situation in the view: this is the role of your Javascript code. Why? Because you&#039;ll have to write Javascript code to put game elements in place anyway, and you don&#039;t want to write it twice :)&lt;br /&gt;
&lt;br /&gt;
Example of things to generate in your view:&lt;br /&gt;
* The overall layout of your game interface (what is displayed where).&lt;br /&gt;
* The board and fixed elements on the board (ex: places for cards, squares, ...).&lt;br /&gt;
&lt;br /&gt;
Example of things that shouldn&#039;t be generate by your view:&lt;br /&gt;
* Game elements that come and go from the game area.&lt;br /&gt;
* Game elements that are moving from one place to another.&lt;br /&gt;
&lt;br /&gt;
== phplib template system ==&lt;br /&gt;
&lt;br /&gt;
BGA is using the phplib template system, used for example in PHPbb forums.&lt;br /&gt;
&lt;br /&gt;
More details about how to use phplib template system here:&lt;br /&gt;
http://www.phpbuilder.com/columns/david20000512.php3&lt;br /&gt;
&lt;br /&gt;
== Variables ==&lt;br /&gt;
&lt;br /&gt;
In your template (&amp;quot;tpl&amp;quot;) file, you can use variables. Then in your view (&amp;quot;.view.php&amp;quot;) file, you fill these variables with value.&lt;br /&gt;
&lt;br /&gt;
In the example above, &amp;quot;{MY_HAND}&amp;quot; is a variable. As you can see, a variable is uppercase characters border by &amp;quot;{&amp;quot; and &amp;quot;}&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
To give a value to this variable in your view.php:&lt;br /&gt;
&lt;br /&gt;
Examples:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
   // Display a translated version of &amp;quot;My hand&amp;quot; at the place of the variable in the template&lt;br /&gt;
   $this-&amp;gt;tpl[&#039;MY_HAND&#039;] = self::_(&amp;quot;My hand&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
   // Display some raw HTML material at the place of the variable&lt;br /&gt;
   $this-&amp;gt;tpl[&#039;MY_HAND&#039;] = self::raw( &amp;quot;&amp;lt;div class=&#039;myhand_icon&#039;&amp;gt;&amp;lt;/div&amp;gt;&amp;quot; );&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
WARNING: do not use a variable called {id} as it will interfere with action buttons.&lt;br /&gt;
&lt;br /&gt;
== Blocks ==&lt;br /&gt;
&lt;br /&gt;
Using &amp;quot;blocks&amp;quot;, you can repeat a piece of HTML from your template several time.&lt;br /&gt;
&lt;br /&gt;
You should use &amp;quot;blocks&amp;quot; everytime you have a block of HTML that you have to repeat a big number of time. For example, for Reversi, we have to generate 64 (8x8) squares:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
(in reversi_reversi.tpl)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div id=&amp;quot;board&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;!-- BEGIN square --&amp;gt;&lt;br /&gt;
        &amp;lt;div id=&amp;quot;square_{X}_{Y}&amp;quot; class=&amp;quot;square&amp;quot; style=&amp;quot;left: {LEFT}px; top: {TOP}px;&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
    &amp;lt;!-- END square --&amp;gt;&lt;br /&gt;
    &lt;br /&gt;
    &amp;lt;div id=&amp;quot;discs&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
(in reversi.view.php)&lt;br /&gt;
&lt;br /&gt;
 $this-&amp;gt;page-&amp;gt;begin_block( &amp;quot;reversi_reversi&amp;quot;, &amp;quot;square&amp;quot; );&lt;br /&gt;
        &lt;br /&gt;
 $hor_scale = 64.8;&lt;br /&gt;
 $ver_scale = 64.4;&lt;br /&gt;
 for( $x=1; $x&amp;lt;=8; $x++ )&lt;br /&gt;
 {&lt;br /&gt;
    for( $y=1; $y&amp;lt;=8; $y++ )&lt;br /&gt;
    {&lt;br /&gt;
       $this-&amp;gt;page-&amp;gt;insert_block( &amp;quot;square&amp;quot;, array(&lt;br /&gt;
         &#039;X&#039; =&amp;gt; $x,&lt;br /&gt;
         &#039;Y&#039; =&amp;gt; $y,&lt;br /&gt;
         &#039;LEFT&#039; =&amp;gt; round( ($x-1)*$hor_scale+10 ),&lt;br /&gt;
         &#039;TOP&#039; =&amp;gt; round( ($y-1)*$ver_scale+7 )&lt;br /&gt;
        ) );&lt;br /&gt;
    }        &lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Explanations:&lt;br /&gt;
* You specify a block in your template file, using &amp;quot;BEGIN&amp;quot; and &amp;quot;END&amp;quot; keywords. In the example above, we are creating a block named &amp;quot;square&amp;quot;.&lt;br /&gt;
* In your view, you declare your block using &amp;quot;begin_block&amp;quot; method.&lt;br /&gt;
* Then, you can insert as many block as you want to, using &amp;quot;insert_block&amp;quot; method.&lt;br /&gt;
&lt;br /&gt;
The insert_block method takes 2 parameters:&lt;br /&gt;
* the name of the block to insert.&lt;br /&gt;
* an associative array you can use to assign values to template variables of this block. In the example above, there are 4 parameters in the block (X, Y, LEFT and TOP).&lt;br /&gt;
&lt;br /&gt;
== Nested blocks ==&lt;br /&gt;
&lt;br /&gt;
You can use nested blocks. In the example below, we are going to add a mini-board for each player of the game, with 4 card places on each of it:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
(In template file)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- BEGIN player --&amp;gt;&lt;br /&gt;
    &amp;lt;div class=&amp;quot;miniboard&amp;quot; id=&amp;quot;miniboard_{PLAYER_ID}&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
        &amp;lt;div class=&amp;quot;card_places&amp;quot;&amp;gt;&lt;br /&gt;
            &amp;lt;!-- BEGIN card_place --&amp;gt;&lt;br /&gt;
            &amp;lt;div id=&amp;quot;card_place_{PLAYER_ID}_{PLACE_ID}&amp;quot;&amp;gt;&lt;br /&gt;
            &amp;lt;/div&amp;gt;&lt;br /&gt;
            &amp;lt;!-- END card_place --&amp;gt;&lt;br /&gt;
        &amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
    &amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;!-- END player --&amp;gt;&lt;br /&gt;
  &lt;br /&gt;
(In view file)&lt;br /&gt;
&lt;br /&gt;
$this-&amp;gt;page-&amp;gt;begin_block( &amp;quot;mygame_mygame.tpl&amp;quot;, &amp;quot;card_place&amp;quot; ); // Nested block must be declared first&lt;br /&gt;
$this-&amp;gt;page-&amp;gt;begin_block( &amp;quot;mygame_mygame.tpl&amp;quot;, &amp;quot;player&amp;quot; );&lt;br /&gt;
&lt;br /&gt;
foreach( $players as $player_id =&amp;gt; $player )&lt;br /&gt;
{&lt;br /&gt;
    // Important: nested block must be reset here, otherwise the second player miniboard will&lt;br /&gt;
    //  have 8 card_place, the third will have 12 card_place, and so one...&lt;br /&gt;
    $this-&amp;gt;page-&amp;gt;reset_subblocks( &#039;card_place&#039; ); &lt;br /&gt;
&lt;br /&gt;
    for( $i=1; $i&amp;lt;=4; $i++ )&lt;br /&gt;
    {&lt;br /&gt;
       $this-&amp;gt;page-&amp;gt;insert_block( &amp;quot;card_place&amp;quot;, array( &lt;br /&gt;
             &#039;PLAYER_ID&#039; =&amp;gt; $player_id,&lt;br /&gt;
             &#039;PLACE_ID&#039; =&amp;gt; $i&lt;br /&gt;
       );&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    $this-&amp;gt;page-&amp;gt;insert_block( &#039;player&#039;, array( &#039;PLAYER_ID&#039; =&amp;gt; $player_id );&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Javascript templates ==&lt;br /&gt;
&lt;br /&gt;
For game elements that come and go from the game area, we suggest you to define a Javascript template.&lt;br /&gt;
&lt;br /&gt;
A Javascript template is defined in your template file like this:&lt;br /&gt;
&lt;br /&gt;
(Reversi Token from Reversi example):&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;script type=&amp;quot;text/javascript&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
// Templates&lt;br /&gt;
&lt;br /&gt;
var jstpl_disc=&#039;&amp;lt;div class=&amp;quot;disc disccolor_${color}&amp;quot; id=&amp;quot;disc_${xy}&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&#039;;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/script&amp;gt;  &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Note: a section for javascript templates is already available at the end of your template skeleton file.&lt;br /&gt;
&lt;br /&gt;
Then, you can use this javascript template to insert this piece of HTML in your game interface, like this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
    dojo.place( this.format_block( &#039;jstpl_disc&#039;, {&lt;br /&gt;
           xy: x+&#039;&#039;+y,&lt;br /&gt;
           color: color&lt;br /&gt;
    } ) , &#039;discs&#039; );&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== How to access game information from .view.php? ==&lt;br /&gt;
&lt;br /&gt;
From your .view.php, you can access the following:&lt;br /&gt;
&lt;br /&gt;
=== Access current player id===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  global $g_user;&lt;br /&gt;
  $current_player_id = $g_user-&amp;gt;get_id();&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Access game object ===&lt;br /&gt;
&lt;br /&gt;
In your view file, &amp;quot;$this-&amp;gt;game&amp;quot; contains an instance of your main game class.&lt;br /&gt;
&lt;br /&gt;
Example:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
   // Access to some game elements description described in your &amp;quot;material.inc.php&amp;quot;:&lt;br /&gt;
   $my_cards_types = $this-&amp;gt;game-&amp;gt;card_types;&lt;br /&gt;
&lt;br /&gt;
   // Access to any (public) method defined in my .game.php file:&lt;br /&gt;
   $result = $this-&amp;gt;game-&amp;gt;myMethod();&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Tips: displaying a nice button ==&lt;br /&gt;
&lt;br /&gt;
From time to time, you need to display a standard button in your interface. BGA framework provides you a standard button that you can use directly in your interface:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
    &amp;lt;a href=&amp;quot;#&amp;quot; id=&amp;quot;my_button_id&amp;quot; class=&amp;quot;bgabutton bgabutton_blue&amp;quot;&amp;gt;&amp;lt;span&amp;gt;My blue button&amp;lt;/span&amp;gt;&amp;lt;/a&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
    &amp;lt;a href=&amp;quot;#&amp;quot; id=&amp;quot;my_button_id&amp;quot; class=&amp;quot;bgabutton bgabutton_gray&amp;quot;&amp;gt;&amp;lt;span&amp;gt;My gray button&amp;lt;/span&amp;gt;&amp;lt;/a&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
    &amp;lt;a href=&amp;quot;#&amp;quot; id=&amp;quot;my_button_id&amp;quot; class=&amp;quot;bgabutton bgabutton_red&amp;quot;&amp;gt;&amp;lt;span&amp;gt;My red button&amp;lt;/span&amp;gt;&amp;lt;/a&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
    &amp;lt;a href=&amp;quot;#&amp;quot; id=&amp;quot;my_button_id&amp;quot; class=&amp;quot;bgabutton bgabutton_red bgabutton_big&amp;quot;&amp;gt;&amp;lt;span&amp;gt;My big red button&amp;lt;/span&amp;gt;&amp;lt;/a&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Note: To see it in action, check for example a Coloretto game&lt;/div&gt;</summary>
		<author><name>Sourisdudesert</name></author>
	</entry>
	<entry>
		<id>https://fa.doc.boardgamearena.com/index.php?title=Contact_us&amp;diff=1947</id>
		<title>Contact us</title>
		<link rel="alternate" type="text/html" href="https://fa.doc.boardgamearena.com/index.php?title=Contact_us&amp;diff=1947"/>
		<updated>2016-09-01T11:20:42Z</updated>

		<summary type="html">&lt;p&gt;Sourisdudesert: /* Postal address */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&#039;&#039;&#039;Board Game Arena&#039;&#039;&#039; is located in France.&lt;br /&gt;
&lt;br /&gt;
== Contact e-mail ==&lt;br /&gt;
&lt;br /&gt;
contact(at)boardgamearena.com&lt;br /&gt;
&lt;br /&gt;
We receive &#039;&#039;&#039;a lot&#039;&#039;&#039; of e-mails. Please do not send us an e-mail in any of these two cases:&lt;br /&gt;
&lt;br /&gt;
* If you want to report a bug, please do it in the [http://boardgamearena.com/#!bugs bug reporting system]&lt;br /&gt;
* If you want to report a player for violation of BGA policy, use the &amp;quot;report this player&amp;quot; button on his/her profile.&lt;br /&gt;
&lt;br /&gt;
== Postal address ==&lt;br /&gt;
&lt;br /&gt;
AD2G Studio SAS&lt;br /&gt;
&lt;br /&gt;
19 rue des Ormeaux&lt;br /&gt;
&lt;br /&gt;
92 260 Fontenay-aux-Roses&lt;br /&gt;
&lt;br /&gt;
FRANCE&lt;br /&gt;
&lt;br /&gt;
+33 6 17 25 80 34&lt;/div&gt;</summary>
		<author><name>Sourisdudesert</name></author>
	</entry>
	<entry>
		<id>https://fa.doc.boardgamearena.com/index.php?title=Faq&amp;diff=1817</id>
		<title>Faq</title>
		<link rel="alternate" type="text/html" href="https://fa.doc.boardgamearena.com/index.php?title=Faq&amp;diff=1817"/>
		<updated>2016-04-24T19:15:01Z</updated>

		<summary type="html">&lt;p&gt;Sourisdudesert: /* Do you recruit? */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category:Help]]&lt;br /&gt;
&lt;br /&gt;
== General questions ==&lt;br /&gt;
&lt;br /&gt;
===What is Board Game Arena?===&lt;br /&gt;
&lt;br /&gt;
Board Game Arena (BGA) is an online board game platform. With BGA, you can play online and in real time against players from around the world. A selection of various board games and card games are available. In order to play, the only thing you need is your browser!&lt;br /&gt;
&lt;br /&gt;
===What do you mean by &amp;quot;real time play&amp;quot;?===&lt;br /&gt;
&lt;br /&gt;
On Board Game Arena your opponents are connected to the game platform during the entire game. They can see your moves and react to them immediately - as is the case in the real world.&lt;br /&gt;
&lt;br /&gt;
===What is &amp;quot;turn based play&amp;quot;?===&lt;br /&gt;
&lt;br /&gt;
This is often referred to as &amp;quot;asynchronous play&amp;quot; on other sites, and is used here to differentiate from &amp;quot;real time play&amp;quot;.  Instead of all players being around the table at the same time, players leave and come back.  After your opponent takes a move you are notified that it is your turn (via email or on your next visit to the site).  You then go to your game, take your turn, and the process repeats for the next player.&lt;br /&gt;
&lt;br /&gt;
For details please read [[Turn based FAQ]].&lt;br /&gt;
&lt;br /&gt;
===What do I need to play?===&lt;br /&gt;
&lt;br /&gt;
Your browser ... and that&#039;s it!&lt;br /&gt;
&lt;br /&gt;
Board Game Arena does not require anything else on your computer. Thus, you can play from any computer, anywhere, anytime!&lt;br /&gt;
&lt;br /&gt;
In order to make this possible, we are using the latest technologies available for the web. This is the reason you should play with the most up to date web browsers to enjoy an optimal BGA experience (read more about our [[Browser_support|browser policy]]).&lt;br /&gt;
&lt;br /&gt;
===How much does it cost to play on BGA?===&lt;br /&gt;
&lt;br /&gt;
Playing on BGA is free.&lt;br /&gt;
&lt;br /&gt;
You can also choose to help us by making a donation and becoming a [http://en.boardgamearena.com/#!club Board Game Arena club] member.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===What games are available on BGA?===&lt;br /&gt;
&lt;br /&gt;
Board Game Arena offers a selection of board and card games, but  specializes in modern (&amp;quot;European style&amp;quot;) adult games.&lt;br /&gt;
&lt;br /&gt;
[http://en.boardgamearena.com/#!gamelist See available games].&lt;br /&gt;
&lt;br /&gt;
== Meeting players and starting games ==&lt;br /&gt;
&lt;br /&gt;
===I launched a new table but nobody is joining?===&lt;br /&gt;
&lt;br /&gt;
For the most popular games, you can find players at any time of day. For other games, we advise you to come back at peak hour (around 22:00 CEST) if you can&#039;t find opponents at the moment.&lt;br /&gt;
&lt;br /&gt;
Tip: check the number of online/available players for a game before launching the table.&lt;br /&gt;
&lt;br /&gt;
Tip: if nobody is available for a realtime game, you can turn your table into a turn-based table, so another player can join even hours/days after you created it.&lt;br /&gt;
&lt;br /&gt;
===I joined a game. When does the game start?===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;For realtime games&#039;&#039;&#039;:&lt;br /&gt;
&lt;br /&gt;
Each table has an administrator, who is the table creator. It is the responsibility of the table administrator to start the game when he or she is satisfied with the number of players who have joined the table.&lt;br /&gt;
&lt;br /&gt;
If you are the table administrator and can&#039;t launch the game, most of the time it&#039;s because there are not yet enough players who have joined the table.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;For turnbased games&#039;&#039;&#039;:&lt;br /&gt;
&lt;br /&gt;
The game starts as soon as the maximum number of players has been reached. The table administrator can also start the game manually any time after the minimum number of required players have joined.&lt;br /&gt;
&lt;br /&gt;
===What does the small colored circle next to a player&#039;s name mean?===&lt;br /&gt;
&lt;br /&gt;
* http://fr.boardgamearena.com/theme/img/status/online_.png : this player is active. He or she completed an action very recently.&lt;br /&gt;
* http://fr.boardgamearena.com/theme/img/status/inactive_.png : this player is inactive. He or she is connected to the website but has not performed any action recently.&lt;br /&gt;
* http://fr.boardgamearena.com/theme/img/status/offline_.png : this player is offline.&lt;br /&gt;
&lt;br /&gt;
===What does the &#039;% hits&#039; statistic mean?===&lt;br /&gt;
% hits = number of victory points / number of games played&lt;br /&gt;
&lt;br /&gt;
Players earn more victory points for winning a game that has more players (half a point per player).  So:&lt;br /&gt;
* When you win a 2 players game: 1 point.&lt;br /&gt;
* When you win a 3 players game: 1.5 points.&lt;br /&gt;
* When you win a 4 players game: 2 points.&lt;br /&gt;
* etc.&lt;br /&gt;
&lt;br /&gt;
For example, a player who plays a three player game and wins a third of the time will have: &amp;quot;50% hits&amp;quot;, while a player who plays a four person game and wins a third of the time, will have: &amp;quot;67% hits&amp;quot;&lt;br /&gt;
&lt;br /&gt;
== During the game ==&lt;br /&gt;
&lt;br /&gt;
===What do the icons next to players&#039; names mean?===&lt;br /&gt;
&lt;br /&gt;
* http://fr.boardgamearena.com/theme/img/layout/active_player.gif : this player must make a move now.&lt;br /&gt;
* http://fr.boardgamearena.com/theme/img/layout/active_player_clockalert.gif : this player must make a move now, and has used up their reflection time. Can someone wake them up? ;)&lt;br /&gt;
* http://fr.boardgamearena.com/theme/img/layout/active_player_nonack.gif : this player must make a move now, but is probably not aware of this fact. If the situation doesn&#039;t change, it might suggest that this player has a connection issue.&lt;br /&gt;
* http://fr.boardgamearena.com/theme/img/common/zombie.png : this player is a &amp;quot;zombie&amp;quot; (has left the game or been fired from the game). The game is going on without this player.&lt;br /&gt;
&lt;br /&gt;
When the &amp;quot;normal&amp;quot; avatar of a player is displayed, it means that this player is waiting for their turn to play.&lt;br /&gt;
&lt;br /&gt;
===A player has to make a move but he/she doesn&#039;t. What can I do?===&lt;br /&gt;
&lt;br /&gt;
* First, please remember that this player has the right to think as long as they need to about the next move...  well as long as there is still some time left on the game clock, that is.&lt;br /&gt;
* Then you can ask this player to confirm that he or she is still thinking about how to play.&lt;br /&gt;
* If this player seems to be away, we advise you to wait a few  minutes: this player may be experiencing some network problems or have left the computer temporarily.&lt;br /&gt;
* If the player is not coming back, you can skip their turn as soon as the clock is negative. This player will get a &amp;quot;leave&amp;quot; penalty and you will win &amp;quot;by forfeit&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
For more details, please read [[Game clock]].&lt;br /&gt;
&lt;br /&gt;
===What is the current progression of the game I&#039;m playing?===&lt;br /&gt;
&lt;br /&gt;
A percentage of progression is displayed on the top of the web page.&lt;br /&gt;
There is also a progress bar at the bottom of the web page shows you the current progression of the game.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===What is forbidden on Board Game Arena?===&lt;br /&gt;
&lt;br /&gt;
* Leaving a game in progress on purpose.&lt;br /&gt;
* Taking an unnecessary and unreasonable amount of time at the end of game in an obvious losing situation.&lt;br /&gt;
* Kingmaking: enabling another player to win on purpose while there is a better move to make for yourself.&lt;br /&gt;
* Running out of time on the game clock.&lt;br /&gt;
* Giving some piece of information about the current game situation that corrupts the normal game flow.&lt;br /&gt;
* Communicating with another player about the game privately (ex: with MSN).&lt;br /&gt;
* Provocation / triumphalism / defeatism ... anything which is not fair play.&lt;br /&gt;
* Having a shocking avatar (no advertisement, no politics, ...)&lt;br /&gt;
&lt;br /&gt;
Going against these rules will affect your reputation.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===What is absolutely forbidden in Board Game Arena?===&lt;br /&gt;
&lt;br /&gt;
* Creating multiple accounts and playing against oneself.&lt;br /&gt;
* Insulting other players in any manner.&lt;br /&gt;
&lt;br /&gt;
Going against these rules can lead to the removal of your account and/or to the blacklisting of your IP.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===What if some player does something wrong?===&lt;br /&gt;
&lt;br /&gt;
The Board Game Arena platform has been designed to encourage players to maintain good behavior. The reputation system allows you to distinguish between good and bad players. Then, it is up to you to decide whether to start a game with them or not.&lt;br /&gt;
&lt;br /&gt;
If you think a player has behaved badly during a game, you can give them a &amp;quot;red thumb&amp;quot; at the end of the game.&lt;br /&gt;
&lt;br /&gt;
If you think a player has committed a serious wrongdoing during a game (ex: insult), please report this player to us, using the &amp;quot;report this player&amp;quot; link from their profile or game result page, so that we can take appropriate measures.&lt;br /&gt;
&lt;br /&gt;
== Tournaments ==&lt;br /&gt;
&lt;br /&gt;
Tournaments is a BETA feature of BGA (for a long time).&lt;br /&gt;
&lt;br /&gt;
Tournament management is very complex. We&#039;d like to open tournament creation to everyone at some time in the future but it need a lot of work and until then we always had something more urgent to do.&lt;br /&gt;
&lt;br /&gt;
When tournaments will be improved, this FAQ section will be improved too.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== About board games we proposed on BGA ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===What is the legal status of this website?===&lt;br /&gt;
&lt;br /&gt;
All the games currently available on this site have been licensed or otherwise authorized by copyright holders. Please be aware that games available on BGA can be removed at the copyright holders demand (for example: if they publish their own adaptation of the game).&lt;br /&gt;
&lt;br /&gt;
Board Game Arena would like to thank all game publishers and game designers who allow us to have their games here, thus making it possible for this website to exist.&lt;br /&gt;
&lt;br /&gt;
=== How do we select games that are on BGA? Why the game XXX is not on BGA? ===&lt;br /&gt;
&lt;br /&gt;
To have a game published on BGA we need 2 things:&lt;br /&gt;
* The authorization of the rights owner (most of the time: original publisher of the game).&lt;br /&gt;
* A software developer who develops the adaptation (ie: has some time available to develop it).&lt;br /&gt;
&lt;br /&gt;
We (= BGA team) are trying a lot of board games ourselves. Sometimes we are lucky enough to play prototypes too. And of course we receive a lot of game suggestions through the BGA forum, the BoardGameGeek &amp;quot;most wanted games&amp;quot; list, or by any other means. Based on this we are asking game publishers for authorizations, and sometimes we also receive requests directly from game publishers - there is no rule.&lt;br /&gt;
&lt;br /&gt;
As it is today, BGA has a very good reputation and very productive relationships with almost all major board game publishers, but this is not enough: each situation is specific, and there can be various reasons why a game publisher can refuse to see a game adaptation on BGA (for example: board games with a third party licence, like &amp;quot;Star Wars&amp;quot;, is practically impossible to negotiate).&lt;br /&gt;
&lt;br /&gt;
On the other hand, we got some authorizations for some very good games but no developers volunteering to develop them, or sometimes some of them don&#039;t manage to finish the job. Developers of adaptations are volunteers, and we don&#039;t blame them for this.&lt;br /&gt;
&lt;br /&gt;
Finally, some games are authorized and being developed, but the time frame is not good. For example, it happened that we had too many games to release and we decided to delay some of them. It also frequently happens that we must synchronize the release of a game with a publisher event, so the game adaptation can stay &amp;quot;on hold&amp;quot; for some months.&lt;br /&gt;
&lt;br /&gt;
So if you are asking yourself: why game XXX is not on BGA, it could be for various reasons:&lt;br /&gt;
* Maybe we never asked authorization for this game. Note that usually we ask authorizations for every popular games (ex: &amp;quot;Most wanted games&amp;quot;). So if the game is popular, the reason is probably not this one.&lt;br /&gt;
* The publisher refused.&lt;br /&gt;
* The publisher accepted, but we didn&#039;t find a developer until now for this game.&lt;br /&gt;
* The game adaptation is ready, but we are waiting for a specific event to release it.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
To conclude: yes we are taking into account your suggestions, but as you can see there are many factors than can influence the fact that a game is (or is not) on BGA. In addition, as a rule of thumb, we don&#039;t communicate about &amp;quot;why&amp;quot; this game is not on BGA. If we already got the authorization, we want to keep the &amp;quot;surprise&amp;quot;, and if we didn&#039;t get the authorization, the game publisher may not want to explain the reasons.&lt;br /&gt;
&lt;br /&gt;
=== Are you taking into account the &amp;quot;Most wanted games&amp;quot; list? When will these games be on BGA? ===&lt;br /&gt;
&lt;br /&gt;
You should read first the previous section (&amp;quot;how do we select games that are on BGA?&amp;quot;).&lt;br /&gt;
&lt;br /&gt;
So the answer is:&lt;br /&gt;
* Yes, we are taking this list into account.&lt;br /&gt;
* For most of these games we already asked for authorizations.&lt;br /&gt;
* Some of these games won&#039;t be on BGA (authorization refused), some may be, some are in an &amp;quot;intermediate&amp;quot; step.&lt;br /&gt;
* We don&#039;t communicate about future game releases anyway.&lt;br /&gt;
&lt;br /&gt;
=== Why do some games have expansions on BGA and some don&#039;t? ===&lt;br /&gt;
&lt;br /&gt;
You should read first the previous section (&amp;quot;how do we select games that are on BGA?&amp;quot;).&lt;br /&gt;
&lt;br /&gt;
Game expansions follow the same steps than games. There can be various reasons why a game publisher doesn&#039;t want the expansion online, and sometimes we don&#039;t find a developer that has the time to develop it.&lt;br /&gt;
&lt;br /&gt;
===I&#039;m a game publisher: why would I like to have my game on Board Game Arena?===&lt;br /&gt;
&lt;br /&gt;
The main goal of Board Game Arena is to make it easy for people to discover and love new games. We think that there are only two kinds of players on Board Game Arena: those who already bought the games they are playing online, and those who plan to buy them soon!&lt;br /&gt;
&lt;br /&gt;
As the activity of this website contributes to increasing a game&#039;s popularity and thus generates hard copy sales in the &amp;quot;real world&amp;quot;, we think it is beneficial to the board game community: people from all over the world can play online, we can have fun developing this game platform to the best of our ability, and game publishers get money from the box sales and build a special relationship with their player&#039;s community.&lt;br /&gt;
&lt;br /&gt;
=== I&#039;m a game publisher: how to get my game on Board Game Arena ===&lt;br /&gt;
&lt;br /&gt;
At first, you just have to write us an email (contact (at) boardgamearena.com) with a description of your game(s).&lt;br /&gt;
&lt;br /&gt;
Then, we add this game to the list of &amp;quot;available licences&amp;quot; on our website dedicated to game developers ([http://studio.boardgamearena.com BGA Studio]).&lt;br /&gt;
&lt;br /&gt;
The most difficult part is to find a developer among our community. Our only requirement is that the developer must love the game. Of course, the most popular the game is, the easiest it is to find a volunteer developer. Sometimes it is very fast, sometimes it takes months, sometimes it never happens. We can&#039;t say in advance.&lt;br /&gt;
&lt;br /&gt;
It is also possible to find your own developer: of course it accelerates the process a lot!&lt;br /&gt;
&lt;br /&gt;
== Turn-based mode ==&lt;br /&gt;
&lt;br /&gt;
Please read [[Turn based FAQ]].&lt;br /&gt;
&lt;br /&gt;
== Issues with BGA ==&lt;br /&gt;
&lt;br /&gt;
===What can I do if I have an issue with the website?===&lt;br /&gt;
&lt;br /&gt;
Most of the issues on this website should be solved with a simple web page refresh (or &amp;quot;F5&amp;quot;).&lt;br /&gt;
&lt;br /&gt;
If you experience persistent issues, you can browse the [http://boardgamearena.com/#!bugs bug tool], see if someone already reported the issue, and add a new bug report if that&#039;s not the case. Please take some time to describe the bug you are reporting in detail so that we can quickly reproduce and fix it.&lt;br /&gt;
&lt;br /&gt;
=== Why is my bug still not fixed? ===&lt;br /&gt;
&lt;br /&gt;
We fix bugs every weeks. Of course we have priorities:&lt;br /&gt;
* We give the highest priority to recent features and recent games, because the most important bugs are reported fast.&lt;br /&gt;
* We give the highest priority to the bugs with the biggest number of &amp;quot;green thumb&amp;quot; on the [http://boardgamearena.com/#!bugs bug tool].&lt;br /&gt;
* Usually we fix bugs by group. So if we decide to fix an important bug on a game, there is a chance that we will fix 3 or 4 minor bugs at the same time.&lt;br /&gt;
&lt;br /&gt;
BGA is known for the quality of its adaptations, and if you look at the bug tool, you can see that -considering the number of games and the size of the community- there are not so many critical bugs with a lot of &amp;quot;green thumbs&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
Please also note that BGA adaptations are realized by volunteers (even if most of them are also professional developers). It is not always easy for them to fix bugs, especially when some players are complaining violently and/or do not give precise information in bug reports.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== I played on smartphone / tablet / touch device and I have some difficulties: what can I do? ===&lt;br /&gt;
&lt;br /&gt;
As a rule of thumb, BGA does not support tablets/smartphones. There are tons of board game adaptations for tablets/smartphones, and some BGA adaptations are not well designed for small screens. Thus, we don&#039;t have plans to do a mobile / tablet version at the moment.&lt;br /&gt;
&lt;br /&gt;
So if you want to use BGA from a smartphone / tablet you can, but we don&#039;t promise to fix all bugs so it&#039;s at your own risk :)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Why is BGA slow? Why do I have bad connections performances on BGA? ===&lt;br /&gt;
&lt;br /&gt;
We are constantly monitoring server responsiveness. Some incidents occurs, but most of the time BGA is responsive.&lt;br /&gt;
&lt;br /&gt;
We designed our game servers (ie: servers used when you are inside a game) to be very responsive. Usually, less than 2% of the game moves take more than 200 milliseconds to process, and less than 0.2% take more than 1 second.&lt;br /&gt;
&lt;br /&gt;
BGA servers are located in Europe (France), but we bought servers all across the world (19 locations) so that the big files (ex: images) are loaded fast even if you are far from us.&lt;br /&gt;
&lt;br /&gt;
Most of bad performances came from your internet connection or your system. Try to connect with a different browser / computer / internet connection to troubleshoot the issue.&lt;br /&gt;
&lt;br /&gt;
As a rule of thumb, is BGA is not responsive enough, you shouldn&#039;t engage yourself into a game because there is a risk for you to get clock penalties.&lt;br /&gt;
&lt;br /&gt;
=== I got issue with a specific player: how does the moderation works? ===&lt;br /&gt;
&lt;br /&gt;
You should read [[Moderation and grades]] page.&lt;br /&gt;
&lt;br /&gt;
== Contribute to BGA ==&lt;br /&gt;
&lt;br /&gt;
=== How can I contribute to BGA? ===&lt;br /&gt;
&lt;br /&gt;
Please visit page [http://boardgamearena.com/#!contribute Contribute to BGA].&lt;br /&gt;
&lt;br /&gt;
=== I&#039;m a software developer. What can I do? ===&lt;br /&gt;
&lt;br /&gt;
We created a website specifically dedicated to board games adaptation development: [http://studio.boardgamearena.com BGA Studio].&lt;br /&gt;
&lt;br /&gt;
== About the BGA team ==&lt;br /&gt;
&lt;br /&gt;
=== Who are you? How to contact you? ===&lt;br /&gt;
&lt;br /&gt;
Please read page [[About us]].&lt;br /&gt;
&lt;br /&gt;
=== How you guys make money? Do you make a living of it? ===&lt;br /&gt;
&lt;br /&gt;
Since the beginning of 2016, one BGA Founder (Sourisdudesert) is working full-time on BGA. It was really required by the growing audience playing on this website, and this has been made possible thanks to all paying members (thank you again!).&lt;br /&gt;
&lt;br /&gt;
But to be honest, there is so much work to do on BGA that a single person is not enough. This is not really an issue because we think the &amp;quot;community based&amp;quot; approach is the best for BGA and we&#039;d like to continue to give you the possibility to contribute to make this service running.&lt;/div&gt;</summary>
		<author><name>Sourisdudesert</name></author>
	</entry>
	<entry>
		<id>https://fa.doc.boardgamearena.com/index.php?title=Faq&amp;diff=1816</id>
		<title>Faq</title>
		<link rel="alternate" type="text/html" href="https://fa.doc.boardgamearena.com/index.php?title=Faq&amp;diff=1816"/>
		<updated>2016-04-24T19:14:42Z</updated>

		<summary type="html">&lt;p&gt;Sourisdudesert: /* How you guys make money? Do you make a living of it? */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category:Help]]&lt;br /&gt;
&lt;br /&gt;
== General questions ==&lt;br /&gt;
&lt;br /&gt;
===What is Board Game Arena?===&lt;br /&gt;
&lt;br /&gt;
Board Game Arena (BGA) is an online board game platform. With BGA, you can play online and in real time against players from around the world. A selection of various board games and card games are available. In order to play, the only thing you need is your browser!&lt;br /&gt;
&lt;br /&gt;
===What do you mean by &amp;quot;real time play&amp;quot;?===&lt;br /&gt;
&lt;br /&gt;
On Board Game Arena your opponents are connected to the game platform during the entire game. They can see your moves and react to them immediately - as is the case in the real world.&lt;br /&gt;
&lt;br /&gt;
===What is &amp;quot;turn based play&amp;quot;?===&lt;br /&gt;
&lt;br /&gt;
This is often referred to as &amp;quot;asynchronous play&amp;quot; on other sites, and is used here to differentiate from &amp;quot;real time play&amp;quot;.  Instead of all players being around the table at the same time, players leave and come back.  After your opponent takes a move you are notified that it is your turn (via email or on your next visit to the site).  You then go to your game, take your turn, and the process repeats for the next player.&lt;br /&gt;
&lt;br /&gt;
For details please read [[Turn based FAQ]].&lt;br /&gt;
&lt;br /&gt;
===What do I need to play?===&lt;br /&gt;
&lt;br /&gt;
Your browser ... and that&#039;s it!&lt;br /&gt;
&lt;br /&gt;
Board Game Arena does not require anything else on your computer. Thus, you can play from any computer, anywhere, anytime!&lt;br /&gt;
&lt;br /&gt;
In order to make this possible, we are using the latest technologies available for the web. This is the reason you should play with the most up to date web browsers to enjoy an optimal BGA experience (read more about our [[Browser_support|browser policy]]).&lt;br /&gt;
&lt;br /&gt;
===How much does it cost to play on BGA?===&lt;br /&gt;
&lt;br /&gt;
Playing on BGA is free.&lt;br /&gt;
&lt;br /&gt;
You can also choose to help us by making a donation and becoming a [http://en.boardgamearena.com/#!club Board Game Arena club] member.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===What games are available on BGA?===&lt;br /&gt;
&lt;br /&gt;
Board Game Arena offers a selection of board and card games, but  specializes in modern (&amp;quot;European style&amp;quot;) adult games.&lt;br /&gt;
&lt;br /&gt;
[http://en.boardgamearena.com/#!gamelist See available games].&lt;br /&gt;
&lt;br /&gt;
== Meeting players and starting games ==&lt;br /&gt;
&lt;br /&gt;
===I launched a new table but nobody is joining?===&lt;br /&gt;
&lt;br /&gt;
For the most popular games, you can find players at any time of day. For other games, we advise you to come back at peak hour (around 22:00 CEST) if you can&#039;t find opponents at the moment.&lt;br /&gt;
&lt;br /&gt;
Tip: check the number of online/available players for a game before launching the table.&lt;br /&gt;
&lt;br /&gt;
Tip: if nobody is available for a realtime game, you can turn your table into a turn-based table, so another player can join even hours/days after you created it.&lt;br /&gt;
&lt;br /&gt;
===I joined a game. When does the game start?===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;For realtime games&#039;&#039;&#039;:&lt;br /&gt;
&lt;br /&gt;
Each table has an administrator, who is the table creator. It is the responsibility of the table administrator to start the game when he or she is satisfied with the number of players who have joined the table.&lt;br /&gt;
&lt;br /&gt;
If you are the table administrator and can&#039;t launch the game, most of the time it&#039;s because there are not yet enough players who have joined the table.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;For turnbased games&#039;&#039;&#039;:&lt;br /&gt;
&lt;br /&gt;
The game starts as soon as the maximum number of players has been reached. The table administrator can also start the game manually any time after the minimum number of required players have joined.&lt;br /&gt;
&lt;br /&gt;
===What does the small colored circle next to a player&#039;s name mean?===&lt;br /&gt;
&lt;br /&gt;
* http://fr.boardgamearena.com/theme/img/status/online_.png : this player is active. He or she completed an action very recently.&lt;br /&gt;
* http://fr.boardgamearena.com/theme/img/status/inactive_.png : this player is inactive. He or she is connected to the website but has not performed any action recently.&lt;br /&gt;
* http://fr.boardgamearena.com/theme/img/status/offline_.png : this player is offline.&lt;br /&gt;
&lt;br /&gt;
===What does the &#039;% hits&#039; statistic mean?===&lt;br /&gt;
% hits = number of victory points / number of games played&lt;br /&gt;
&lt;br /&gt;
Players earn more victory points for winning a game that has more players (half a point per player).  So:&lt;br /&gt;
* When you win a 2 players game: 1 point.&lt;br /&gt;
* When you win a 3 players game: 1.5 points.&lt;br /&gt;
* When you win a 4 players game: 2 points.&lt;br /&gt;
* etc.&lt;br /&gt;
&lt;br /&gt;
For example, a player who plays a three player game and wins a third of the time will have: &amp;quot;50% hits&amp;quot;, while a player who plays a four person game and wins a third of the time, will have: &amp;quot;67% hits&amp;quot;&lt;br /&gt;
&lt;br /&gt;
== During the game ==&lt;br /&gt;
&lt;br /&gt;
===What do the icons next to players&#039; names mean?===&lt;br /&gt;
&lt;br /&gt;
* http://fr.boardgamearena.com/theme/img/layout/active_player.gif : this player must make a move now.&lt;br /&gt;
* http://fr.boardgamearena.com/theme/img/layout/active_player_clockalert.gif : this player must make a move now, and has used up their reflection time. Can someone wake them up? ;)&lt;br /&gt;
* http://fr.boardgamearena.com/theme/img/layout/active_player_nonack.gif : this player must make a move now, but is probably not aware of this fact. If the situation doesn&#039;t change, it might suggest that this player has a connection issue.&lt;br /&gt;
* http://fr.boardgamearena.com/theme/img/common/zombie.png : this player is a &amp;quot;zombie&amp;quot; (has left the game or been fired from the game). The game is going on without this player.&lt;br /&gt;
&lt;br /&gt;
When the &amp;quot;normal&amp;quot; avatar of a player is displayed, it means that this player is waiting for their turn to play.&lt;br /&gt;
&lt;br /&gt;
===A player has to make a move but he/she doesn&#039;t. What can I do?===&lt;br /&gt;
&lt;br /&gt;
* First, please remember that this player has the right to think as long as they need to about the next move...  well as long as there is still some time left on the game clock, that is.&lt;br /&gt;
* Then you can ask this player to confirm that he or she is still thinking about how to play.&lt;br /&gt;
* If this player seems to be away, we advise you to wait a few  minutes: this player may be experiencing some network problems or have left the computer temporarily.&lt;br /&gt;
* If the player is not coming back, you can skip their turn as soon as the clock is negative. This player will get a &amp;quot;leave&amp;quot; penalty and you will win &amp;quot;by forfeit&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
For more details, please read [[Game clock]].&lt;br /&gt;
&lt;br /&gt;
===What is the current progression of the game I&#039;m playing?===&lt;br /&gt;
&lt;br /&gt;
A percentage of progression is displayed on the top of the web page.&lt;br /&gt;
There is also a progress bar at the bottom of the web page shows you the current progression of the game.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===What is forbidden on Board Game Arena?===&lt;br /&gt;
&lt;br /&gt;
* Leaving a game in progress on purpose.&lt;br /&gt;
* Taking an unnecessary and unreasonable amount of time at the end of game in an obvious losing situation.&lt;br /&gt;
* Kingmaking: enabling another player to win on purpose while there is a better move to make for yourself.&lt;br /&gt;
* Running out of time on the game clock.&lt;br /&gt;
* Giving some piece of information about the current game situation that corrupts the normal game flow.&lt;br /&gt;
* Communicating with another player about the game privately (ex: with MSN).&lt;br /&gt;
* Provocation / triumphalism / defeatism ... anything which is not fair play.&lt;br /&gt;
* Having a shocking avatar (no advertisement, no politics, ...)&lt;br /&gt;
&lt;br /&gt;
Going against these rules will affect your reputation.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===What is absolutely forbidden in Board Game Arena?===&lt;br /&gt;
&lt;br /&gt;
* Creating multiple accounts and playing against oneself.&lt;br /&gt;
* Insulting other players in any manner.&lt;br /&gt;
&lt;br /&gt;
Going against these rules can lead to the removal of your account and/or to the blacklisting of your IP.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===What if some player does something wrong?===&lt;br /&gt;
&lt;br /&gt;
The Board Game Arena platform has been designed to encourage players to maintain good behavior. The reputation system allows you to distinguish between good and bad players. Then, it is up to you to decide whether to start a game with them or not.&lt;br /&gt;
&lt;br /&gt;
If you think a player has behaved badly during a game, you can give them a &amp;quot;red thumb&amp;quot; at the end of the game.&lt;br /&gt;
&lt;br /&gt;
If you think a player has committed a serious wrongdoing during a game (ex: insult), please report this player to us, using the &amp;quot;report this player&amp;quot; link from their profile or game result page, so that we can take appropriate measures.&lt;br /&gt;
&lt;br /&gt;
== Tournaments ==&lt;br /&gt;
&lt;br /&gt;
Tournaments is a BETA feature of BGA (for a long time).&lt;br /&gt;
&lt;br /&gt;
Tournament management is very complex. We&#039;d like to open tournament creation to everyone at some time in the future but it need a lot of work and until then we always had something more urgent to do.&lt;br /&gt;
&lt;br /&gt;
When tournaments will be improved, this FAQ section will be improved too.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== About board games we proposed on BGA ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===What is the legal status of this website?===&lt;br /&gt;
&lt;br /&gt;
All the games currently available on this site have been licensed or otherwise authorized by copyright holders. Please be aware that games available on BGA can be removed at the copyright holders demand (for example: if they publish their own adaptation of the game).&lt;br /&gt;
&lt;br /&gt;
Board Game Arena would like to thank all game publishers and game designers who allow us to have their games here, thus making it possible for this website to exist.&lt;br /&gt;
&lt;br /&gt;
=== How do we select games that are on BGA? Why the game XXX is not on BGA? ===&lt;br /&gt;
&lt;br /&gt;
To have a game published on BGA we need 2 things:&lt;br /&gt;
* The authorization of the rights owner (most of the time: original publisher of the game).&lt;br /&gt;
* A software developer who develops the adaptation (ie: has some time available to develop it).&lt;br /&gt;
&lt;br /&gt;
We (= BGA team) are trying a lot of board games ourselves. Sometimes we are lucky enough to play prototypes too. And of course we receive a lot of game suggestions through the BGA forum, the BoardGameGeek &amp;quot;most wanted games&amp;quot; list, or by any other means. Based on this we are asking game publishers for authorizations, and sometimes we also receive requests directly from game publishers - there is no rule.&lt;br /&gt;
&lt;br /&gt;
As it is today, BGA has a very good reputation and very productive relationships with almost all major board game publishers, but this is not enough: each situation is specific, and there can be various reasons why a game publisher can refuse to see a game adaptation on BGA (for example: board games with a third party licence, like &amp;quot;Star Wars&amp;quot;, is practically impossible to negotiate).&lt;br /&gt;
&lt;br /&gt;
On the other hand, we got some authorizations for some very good games but no developers volunteering to develop them, or sometimes some of them don&#039;t manage to finish the job. Developers of adaptations are volunteers, and we don&#039;t blame them for this.&lt;br /&gt;
&lt;br /&gt;
Finally, some games are authorized and being developed, but the time frame is not good. For example, it happened that we had too many games to release and we decided to delay some of them. It also frequently happens that we must synchronize the release of a game with a publisher event, so the game adaptation can stay &amp;quot;on hold&amp;quot; for some months.&lt;br /&gt;
&lt;br /&gt;
So if you are asking yourself: why game XXX is not on BGA, it could be for various reasons:&lt;br /&gt;
* Maybe we never asked authorization for this game. Note that usually we ask authorizations for every popular games (ex: &amp;quot;Most wanted games&amp;quot;). So if the game is popular, the reason is probably not this one.&lt;br /&gt;
* The publisher refused.&lt;br /&gt;
* The publisher accepted, but we didn&#039;t find a developer until now for this game.&lt;br /&gt;
* The game adaptation is ready, but we are waiting for a specific event to release it.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
To conclude: yes we are taking into account your suggestions, but as you can see there are many factors than can influence the fact that a game is (or is not) on BGA. In addition, as a rule of thumb, we don&#039;t communicate about &amp;quot;why&amp;quot; this game is not on BGA. If we already got the authorization, we want to keep the &amp;quot;surprise&amp;quot;, and if we didn&#039;t get the authorization, the game publisher may not want to explain the reasons.&lt;br /&gt;
&lt;br /&gt;
=== Are you taking into account the &amp;quot;Most wanted games&amp;quot; list? When will these games be on BGA? ===&lt;br /&gt;
&lt;br /&gt;
You should read first the previous section (&amp;quot;how do we select games that are on BGA?&amp;quot;).&lt;br /&gt;
&lt;br /&gt;
So the answer is:&lt;br /&gt;
* Yes, we are taking this list into account.&lt;br /&gt;
* For most of these games we already asked for authorizations.&lt;br /&gt;
* Some of these games won&#039;t be on BGA (authorization refused), some may be, some are in an &amp;quot;intermediate&amp;quot; step.&lt;br /&gt;
* We don&#039;t communicate about future game releases anyway.&lt;br /&gt;
&lt;br /&gt;
=== Why do some games have expansions on BGA and some don&#039;t? ===&lt;br /&gt;
&lt;br /&gt;
You should read first the previous section (&amp;quot;how do we select games that are on BGA?&amp;quot;).&lt;br /&gt;
&lt;br /&gt;
Game expansions follow the same steps than games. There can be various reasons why a game publisher doesn&#039;t want the expansion online, and sometimes we don&#039;t find a developer that has the time to develop it.&lt;br /&gt;
&lt;br /&gt;
===I&#039;m a game publisher: why would I like to have my game on Board Game Arena?===&lt;br /&gt;
&lt;br /&gt;
The main goal of Board Game Arena is to make it easy for people to discover and love new games. We think that there are only two kinds of players on Board Game Arena: those who already bought the games they are playing online, and those who plan to buy them soon!&lt;br /&gt;
&lt;br /&gt;
As the activity of this website contributes to increasing a game&#039;s popularity and thus generates hard copy sales in the &amp;quot;real world&amp;quot;, we think it is beneficial to the board game community: people from all over the world can play online, we can have fun developing this game platform to the best of our ability, and game publishers get money from the box sales and build a special relationship with their player&#039;s community.&lt;br /&gt;
&lt;br /&gt;
=== I&#039;m a game publisher: how to get my game on Board Game Arena ===&lt;br /&gt;
&lt;br /&gt;
At first, you just have to write us an email (contact (at) boardgamearena.com) with a description of your game(s).&lt;br /&gt;
&lt;br /&gt;
Then, we add this game to the list of &amp;quot;available licences&amp;quot; on our website dedicated to game developers ([http://studio.boardgamearena.com BGA Studio]).&lt;br /&gt;
&lt;br /&gt;
The most difficult part is to find a developer among our community. Our only requirement is that the developer must love the game. Of course, the most popular the game is, the easiest it is to find a volunteer developer. Sometimes it is very fast, sometimes it takes months, sometimes it never happens. We can&#039;t say in advance.&lt;br /&gt;
&lt;br /&gt;
It is also possible to find your own developer: of course it accelerates the process a lot!&lt;br /&gt;
&lt;br /&gt;
== Turn-based mode ==&lt;br /&gt;
&lt;br /&gt;
Please read [[Turn based FAQ]].&lt;br /&gt;
&lt;br /&gt;
== Issues with BGA ==&lt;br /&gt;
&lt;br /&gt;
===What can I do if I have an issue with the website?===&lt;br /&gt;
&lt;br /&gt;
Most of the issues on this website should be solved with a simple web page refresh (or &amp;quot;F5&amp;quot;).&lt;br /&gt;
&lt;br /&gt;
If you experience persistent issues, you can browse the [http://boardgamearena.com/#!bugs bug tool], see if someone already reported the issue, and add a new bug report if that&#039;s not the case. Please take some time to describe the bug you are reporting in detail so that we can quickly reproduce and fix it.&lt;br /&gt;
&lt;br /&gt;
=== Why is my bug still not fixed? ===&lt;br /&gt;
&lt;br /&gt;
We fix bugs every weeks. Of course we have priorities:&lt;br /&gt;
* We give the highest priority to recent features and recent games, because the most important bugs are reported fast.&lt;br /&gt;
* We give the highest priority to the bugs with the biggest number of &amp;quot;green thumb&amp;quot; on the [http://boardgamearena.com/#!bugs bug tool].&lt;br /&gt;
* Usually we fix bugs by group. So if we decide to fix an important bug on a game, there is a chance that we will fix 3 or 4 minor bugs at the same time.&lt;br /&gt;
&lt;br /&gt;
BGA is known for the quality of its adaptations, and if you look at the bug tool, you can see that -considering the number of games and the size of the community- there are not so many critical bugs with a lot of &amp;quot;green thumbs&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
Please also note that BGA adaptations are realized by volunteers (even if most of them are also professional developers). It is not always easy for them to fix bugs, especially when some players are complaining violently and/or do not give precise information in bug reports.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== I played on smartphone / tablet / touch device and I have some difficulties: what can I do? ===&lt;br /&gt;
&lt;br /&gt;
As a rule of thumb, BGA does not support tablets/smartphones. There are tons of board game adaptations for tablets/smartphones, and some BGA adaptations are not well designed for small screens. Thus, we don&#039;t have plans to do a mobile / tablet version at the moment.&lt;br /&gt;
&lt;br /&gt;
So if you want to use BGA from a smartphone / tablet you can, but we don&#039;t promise to fix all bugs so it&#039;s at your own risk :)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Why is BGA slow? Why do I have bad connections performances on BGA? ===&lt;br /&gt;
&lt;br /&gt;
We are constantly monitoring server responsiveness. Some incidents occurs, but most of the time BGA is responsive.&lt;br /&gt;
&lt;br /&gt;
We designed our game servers (ie: servers used when you are inside a game) to be very responsive. Usually, less than 2% of the game moves take more than 200 milliseconds to process, and less than 0.2% take more than 1 second.&lt;br /&gt;
&lt;br /&gt;
BGA servers are located in Europe (France), but we bought servers all across the world (19 locations) so that the big files (ex: images) are loaded fast even if you are far from us.&lt;br /&gt;
&lt;br /&gt;
Most of bad performances came from your internet connection or your system. Try to connect with a different browser / computer / internet connection to troubleshoot the issue.&lt;br /&gt;
&lt;br /&gt;
As a rule of thumb, is BGA is not responsive enough, you shouldn&#039;t engage yourself into a game because there is a risk for you to get clock penalties.&lt;br /&gt;
&lt;br /&gt;
=== I got issue with a specific player: how does the moderation works? ===&lt;br /&gt;
&lt;br /&gt;
You should read [[Moderation and grades]] page.&lt;br /&gt;
&lt;br /&gt;
== Contribute to BGA ==&lt;br /&gt;
&lt;br /&gt;
=== How can I contribute to BGA? ===&lt;br /&gt;
&lt;br /&gt;
Please visit page [http://boardgamearena.com/#!contribute Contribute to BGA].&lt;br /&gt;
&lt;br /&gt;
=== I&#039;m a software developer. What can I do? ===&lt;br /&gt;
&lt;br /&gt;
We created a website specifically dedicated to board games adaptation development: [http://studio.boardgamearena.com BGA Studio].&lt;br /&gt;
&lt;br /&gt;
== About the BGA team ==&lt;br /&gt;
&lt;br /&gt;
=== Who are you? How to contact you? ===&lt;br /&gt;
&lt;br /&gt;
Please read page [[About us]].&lt;br /&gt;
&lt;br /&gt;
=== How you guys make money? Do you make a living of it? ===&lt;br /&gt;
&lt;br /&gt;
Since the beginning of 2016, one BGA Founder (Sourisdudesert) is working full-time on BGA. It was really required by the growing audience playing on this website, and this has been made possible thanks to all paying members (thank you again!).&lt;br /&gt;
&lt;br /&gt;
But to be honest, there is so much work to do on BGA that a single person is not enough. This is not really an issue because we think the &amp;quot;community based&amp;quot; approach is the best for BGA and we&#039;d like to continue to give you the possibility to contribute to make this service running.&lt;br /&gt;
&lt;br /&gt;
=== Do you recruit? ===&lt;br /&gt;
&lt;br /&gt;
If we had enough money we would start by &amp;quot;recruiting ourselves&amp;quot; :)&lt;/div&gt;</summary>
		<author><name>Sourisdudesert</name></author>
	</entry>
	<entry>
		<id>https://fa.doc.boardgamearena.com/index.php?title=Club_Board_Game_Arena&amp;diff=1809</id>
		<title>Club Board Game Arena</title>
		<link rel="alternate" type="text/html" href="https://fa.doc.boardgamearena.com/index.php?title=Club_Board_Game_Arena&amp;diff=1809"/>
		<updated>2016-04-13T12:44:18Z</updated>

		<summary type="html">&lt;p&gt;Sourisdudesert: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Why can&#039;t you just have a standard donation system where I can choose any money amount ?==&lt;br /&gt;
&lt;br /&gt;
With this &amp;quot;club&amp;quot; system, we try to highlight players who have supported this website recently or do so on a regular basis. Depending on the amount of your donation, you are a member of the club for a given period of time.&lt;br /&gt;
&lt;br /&gt;
Many websites are using a more classic approach with a simple &amp;quot;donation box&amp;quot;. By experience, we know that these websites rely on just a few generous users. Board Game Arena has chosen to set 3 fixed amounts for donations, in order to rely on a bigger number of small donors.&lt;br /&gt;
&lt;br /&gt;
==Is it mandatory to join the club ?==&lt;br /&gt;
&lt;br /&gt;
Of course not.&lt;br /&gt;
&lt;br /&gt;
You can play for free with few limitation even if you are not a member of the club: Board Game Arena is a free service. Statistics are just an extra!  You don&#039;t need statistics to play and have fun, do you?  As a matter of fact, most players are not club members.&lt;br /&gt;
&lt;br /&gt;
==What is a beginner account ? ==&lt;br /&gt;
&lt;br /&gt;
When you join Board Game Arena, you get a &amp;quot;beginner account&amp;quot; for 30 days. This beginner account allows you to view your own ELO ranking for each game. After 30 days, your account becomes a standard &#039;&#039;&#039;non-member&#039;&#039;&#039; account.&lt;br /&gt;
&lt;br /&gt;
==What becomes of the money ?==&lt;br /&gt;
&lt;br /&gt;
Board Game Arena&#039;s service is managed by a semi-professional team who needs money to make it run (in particular: hosting cost).&lt;br /&gt;
&lt;br /&gt;
Player donations are used to develop this website (new features, new games), to make it run (hosting, maintenance), to build the player community (events)...&lt;br /&gt;
&lt;br /&gt;
A big &amp;quot;thank you&amp;quot; to all members of the Board Game Arena Club whose contributions allow this website to exist for the enjoyment of everyone !&lt;/div&gt;</summary>
		<author><name>Sourisdudesert</name></author>
	</entry>
	<entry>
		<id>https://fa.doc.boardgamearena.com/index.php?title=Contact_us&amp;diff=1794</id>
		<title>Contact us</title>
		<link rel="alternate" type="text/html" href="https://fa.doc.boardgamearena.com/index.php?title=Contact_us&amp;diff=1794"/>
		<updated>2016-03-14T18:04:46Z</updated>

		<summary type="html">&lt;p&gt;Sourisdudesert: Reverted edits by Timmymike (talk) to last revision by Een&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&#039;&#039;&#039;Board Game Arena&#039;&#039;&#039; is located in France.&lt;br /&gt;
&lt;br /&gt;
== Contact e-mail ==&lt;br /&gt;
&lt;br /&gt;
contact(at)boardgamearena.com&lt;br /&gt;
&lt;br /&gt;
We receive &#039;&#039;&#039;a lot&#039;&#039;&#039; of e-mails. Please do not send us an e-mail in any of these two cases:&lt;br /&gt;
&lt;br /&gt;
* If you want to report a bug, please do it in the [http://boardgamearena.com/#!bugs bug reporting system]&lt;br /&gt;
* If you want to report a player for violation of BGA policy, use the &amp;quot;report this player&amp;quot; button on his/her profile.&lt;br /&gt;
&lt;br /&gt;
== Postal address ==&lt;br /&gt;
&lt;br /&gt;
G. Isabelli&lt;br /&gt;
&lt;br /&gt;
19 bd république&lt;br /&gt;
&lt;br /&gt;
92 260 Fontenay-aux-Roses&lt;br /&gt;
&lt;br /&gt;
FRANCE&lt;br /&gt;
&lt;br /&gt;
+33 6 17 25 80 34&lt;/div&gt;</summary>
		<author><name>Sourisdudesert</name></author>
	</entry>
	<entry>
		<id>https://fa.doc.boardgamearena.com/index.php?title=Your_game_mobile_version&amp;diff=1725</id>
		<title>Your game mobile version</title>
		<link rel="alternate" type="text/html" href="https://fa.doc.boardgamearena.com/index.php?title=Your_game_mobile_version&amp;diff=1725"/>
		<updated>2015-12-29T08:12:59Z</updated>

		<summary type="html">&lt;p&gt;Sourisdudesert: /* Touchscreen compatibility */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
Board Game Arena is now adaptated for Mobiles and Tablets too.&lt;br /&gt;
&lt;br /&gt;
It is very easy to have a mobile version of the game you developed with BGA Studio. In fact, your game is probably already 100% playable on mobile.&lt;br /&gt;
&lt;br /&gt;
However, to provide your players the best experience, you should follow the 2 advices below.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Declare your interface minimum width ==&lt;br /&gt;
&lt;br /&gt;
By default, your game can run in an window up to 740 pixels width. Considering the informations of the right column (player&#039;s panel), it fits on a 1024px wide screen.&lt;br /&gt;
&lt;br /&gt;
However, you can choose to declare that your game is able to run with a smaller width. This way, the game will appear much better on mobile and tablets.&lt;br /&gt;
&lt;br /&gt;
For example, Reversi board is only 540px wide. If we stay with the default width (740px), the game interface displayed on mobile will be too large and some space will be lost on the left and on the right. Consequently the Reversi board is going to appear very small on the mobile screen, and players will have to &amp;quot;pinch &amp;amp; zoom&amp;quot; to display it correctly.&lt;br /&gt;
&lt;br /&gt;
To avoid that, we can specify that the game can be played with an interface with a minimum width of 540 pixels, by adding the following to gameinfos.inc.php :&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
  // Game interface width range (pixels)&lt;br /&gt;
  // Note: game interface = space on the left side, without the column on the right&lt;br /&gt;
  &#039;game_interface_width&#039; =&amp;gt; array(&lt;br /&gt;
  &lt;br /&gt;
    // Minimum width&lt;br /&gt;
    //  default: 740&lt;br /&gt;
    //  maximum possible value: 740 (ie: your game interface should fit with a 740px width (correspond to a 1024px screen)&lt;br /&gt;
    //  minimum possible value: 320 (the lowest value you specify, the better the display is on mobile)&lt;br /&gt;
    &#039;min&#039; =&amp;gt; 540,&lt;br /&gt;
  &lt;br /&gt;
    // Maximum width&lt;br /&gt;
    //  default: null (ie: no limit, the game interface is as big as the player&#039;s screen allows it).&lt;br /&gt;
    //  maximum possible value: unlimited&lt;br /&gt;
    //  minimum possible value: 740&lt;br /&gt;
    &#039;max&#039; =&amp;gt; null&lt;br /&gt;
  ),&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
And that&#039;s it! Now, BGA can choose the better display for your game interface, whatever the device.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Important&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
If you declare that your interface can run with a 540 pixels width, it must effectively run on an interface with 540 pixels width.&lt;br /&gt;
&lt;br /&gt;
Note that this doesn&#039;t mean that your interface must ALWAYS be 540 pixels width: you just have to make your interface fluid and/or to use CSS media query to fit in any width.&lt;br /&gt;
&lt;br /&gt;
Examples :&lt;br /&gt;
&lt;br /&gt;
* On Can&#039;t Stop, when the screen is too narrow, we move the dices on another position (below the main board) to fit in the width :&lt;br /&gt;
&lt;br /&gt;
  @media only screen and (max-width: 990px) {&lt;br /&gt;
  &lt;br /&gt;
    #dicechoices {&lt;br /&gt;
        left: 180px;&lt;br /&gt;
        top: 530px;&lt;br /&gt;
    }&lt;br /&gt;
    #cantstop_wrap {&lt;br /&gt;
        height: 900px;&lt;br /&gt;
        width: 550px;&lt;br /&gt;
    }&lt;br /&gt;
  }&lt;br /&gt;
&lt;br /&gt;
* On Seasons, we have some panels on the right of the board. On small screens, we display these panels below the board:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
  @media only screen and (max-width: 970px) {&lt;br /&gt;
  &lt;br /&gt;
    #board {&lt;br /&gt;
        float: none;&lt;br /&gt;
        margin: auto;&lt;br /&gt;
    }&lt;br /&gt;
    .seasons_rightpanel {&lt;br /&gt;
        margin-left: 0px;&lt;br /&gt;
    }&lt;br /&gt;
  &lt;br /&gt;
  }&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Tip: on mobile, BGA displays player panels at the top of the page (instead of displaying them on the right). When doing this, BGA applies the CSS class &amp;quot;mobile_version&amp;quot; to the root HTML element with id &amp;quot;ebd-body&amp;quot;. If you want you can use this CSS &amp;quot;mobile_version&amp;quot; class to optimize some of your game adaptations to this change. In the opposite, when the &amp;quot;normal&amp;quot; version is active, the CSS class &amp;quot;desktop_version&amp;quot; BGA applies the CSS class &amp;quot;desktop_version&amp;quot; to the root HTML element with id &amp;quot;ebd-body&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
== Touchscreen compatibility ==&lt;br /&gt;
&lt;br /&gt;
Most of your games should work with touchscreen devices without needing any changes.&lt;br /&gt;
&lt;br /&gt;
Note: when your game is running on a touchscreen device, the global CSS class &amp;quot;touch-device&amp;quot; is added to the to the root HTML element with id &amp;quot;ebd-body&amp;quot; (and &amp;quot;notouch-device&amp;quot; is added for the opposite).&lt;br /&gt;
&lt;br /&gt;
What may not work :&lt;br /&gt;
* &amp;quot;:hover&amp;quot; CSS switch. Because there is no mouse, &amp;quot;:hover&amp;quot; won&#039;t be triggered. This is not an issue unless it is needed to play the game. In addition, some touch devices consider that a short touch must trigger a &amp;quot;:hover&amp;quot; (and should apply corresponding CSS), which can block an interaction in your game. We advise you to explicitely disable &amp;quot;:hover&amp;quot; effects when your game is running on a touchscreen device (for ex. by adding &amp;quot;.notouch-device&amp;quot; as a prefix to all your CSS :hover rules).&lt;br /&gt;
* Mouseover events : like the previous one : if you associated Javascript events to &amp;quot;onmouseover&amp;quot; event, it won&#039;t work on tablets.&lt;br /&gt;
* Drag&#039;n&#039;drop : it won&#039;t work. To make it work, you should listen to &amp;quot;ontouchstart&amp;quot;, &amp;quot;ontouchmove&amp;quot; and &amp;quot;ontouchend&amp;quot; event and trigger the same logic you already have for &amp;quot;onmousedown&amp;quot;, &amp;quot;onmousemove&amp;quot; and &amp;quot;onmouseup&amp;quot;. You should also make sure to stop the Javascript &amp;quot;ontouchmove&amp;quot; event (ex: dojo.stopEvent( evt ) ) during the drag n drop, otherwise the interface is going to scroll while drag&#039;n&#039;dropping.&lt;/div&gt;</summary>
		<author><name>Sourisdudesert</name></author>
	</entry>
	<entry>
		<id>https://fa.doc.boardgamearena.com/index.php?title=Main_game_logic:_yourgamename.game.php&amp;diff=1723</id>
		<title>Main game logic: yourgamename.game.php</title>
		<link rel="alternate" type="text/html" href="https://fa.doc.boardgamearena.com/index.php?title=Main_game_logic:_yourgamename.game.php&amp;diff=1723"/>
		<updated>2015-12-28T10:42:27Z</updated>

		<summary type="html">&lt;p&gt;Sourisdudesert: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
This file is the main file for your game logic. Here you initialize the game, persist data, implement the rules and notify changes to the client interface.&lt;br /&gt;
&lt;br /&gt;
== File Structure ==&lt;br /&gt;
&lt;br /&gt;
The details on how the file is structured is described directly with comments on the code skeleton provided to you.&lt;br /&gt;
 &lt;br /&gt;
Basically, here&#039;s this structure:&lt;br /&gt;
* EmptyGame (constructor): where you define global variables.&lt;br /&gt;
* setupNewGame: initial setup of the game.&lt;br /&gt;
* getAllDatas: where you retrieve all game data during a complete reload of the game.&lt;br /&gt;
* getGameProgression: where you compute the game progression indicator.&lt;br /&gt;
* Utility functions: your utility functions.&lt;br /&gt;
* Player actions: the entry points for players actions. &lt;br /&gt;
* Game state arguments: methods to return additional data on specific game states ([http://en.doc.boardgamearena.com/Your_game_state_machine:_states.inc.php#args more info here]).&lt;br /&gt;
* Game state actions: the logic to run when entering a new game state ([http://en.doc.boardgamearena.com/Your_game_state_machine:_states.inc.php#action more info here]).&lt;br /&gt;
* zombieTurn: what to do it&#039;s the turn of a zombie player.&lt;br /&gt;
&lt;br /&gt;
== Accessing player informations ==&lt;br /&gt;
&lt;br /&gt;
; getPlayersNumber()&lt;br /&gt;
: Returns the number of players playing at the table&lt;br /&gt;
: Note: doesn&#039;t work in setupNewGame so use count($players) instead&lt;br /&gt;
&lt;br /&gt;
; getActivePlayerId()&lt;br /&gt;
: Get the &amp;quot;active_player&amp;quot;, whatever what is the current state type.&lt;br /&gt;
: Note: it does NOT mean that this player is active right now, because state type could be &amp;quot;game&amp;quot; or &amp;quot;multiplayer&amp;quot;&lt;br /&gt;
: Note: avoid using this method in a &amp;quot;multiplayer&amp;quot; state because it does not mean anything.&lt;br /&gt;
&lt;br /&gt;
; getActivePlayerName()&lt;br /&gt;
: Get the &amp;quot;active_player&amp;quot; name&lt;br /&gt;
: Note: avoid using this method in a &amp;quot;multiplayer&amp;quot; state because it does not mean anything.&lt;br /&gt;
&lt;br /&gt;
; loadPlayersBasicInfos()&lt;br /&gt;
: Get an associative array with generic data about players (ie: not game specific data).&lt;br /&gt;
: The key of the associative array is the player id.&lt;br /&gt;
: The content of each value is:&lt;br /&gt;
: * player_name&lt;br /&gt;
: * player_color (ex: ff0000)&lt;br /&gt;
&lt;br /&gt;
; getCurrentPlayerId()&lt;br /&gt;
: Get the &amp;quot;current_player&amp;quot;. The current player is the one from which the action originated (the one who send the request).&lt;br /&gt;
: &#039;&#039;&#039;Be careful&#039;&#039;&#039;: It is not always the active player.&lt;br /&gt;
: In general, you shouldn&#039;t use this method, unless you are in &amp;quot;multiplayer&amp;quot; state.&lt;br /&gt;
&lt;br /&gt;
; getCurrentPlayerName()&lt;br /&gt;
: Get the &amp;quot;current_player&amp;quot; name&lt;br /&gt;
: Be careful using this method (see above).&lt;br /&gt;
&lt;br /&gt;
; getCurrentPlayerColor()&lt;br /&gt;
: Get the &amp;quot;current_player&amp;quot; color&lt;br /&gt;
: Be careful using this method (see above).&lt;br /&gt;
&lt;br /&gt;
; isCurrentPlayerZombie()&lt;br /&gt;
: Check the &amp;quot;current_player&amp;quot; zombie status. If true, player leave the game.&lt;br /&gt;
&lt;br /&gt;
== Accessing database ==&lt;br /&gt;
&lt;br /&gt;
The main game logic should be the only point from where you should access to the game database. You access your database using SQL queries with the methods below.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;IMPORTANT&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
BGA is using [http://dev.mysql.com/doc/refman/5.0/en/sql-syntax-transactions.html database transactions]. It means that your database changes WON&#039;T BE APPLIED to the database until your request ends normally. Using transaction is in fact very useful for you: at any time, if your game logic detects that something is wrong (ex: unallowed move), you just have to throw an exception and all the changes already performed on the game situation will be removed.&lt;br /&gt;
&lt;br /&gt;
; DbQuery( $sql )&lt;br /&gt;
: This is the generic method to access the database.&lt;br /&gt;
: It can execute any type of SELECT/UPDATE/DELETE/REPLACE query on the database.&lt;br /&gt;
: You should use it for UPDATE/DELETE/REPLACE query. For SELECT queries, the specialized methods below are much better.&lt;br /&gt;
&lt;br /&gt;
; getUniqueValueFromDB( $sql )&lt;br /&gt;
: Returns a unique value from DB or null if no value is found.&lt;br /&gt;
: $sql must be a SELECT query.&lt;br /&gt;
: Raise an exception if more than 1 row is returned.&lt;br /&gt;
&lt;br /&gt;
; getCollectionFromDB( $sql, $bSingleValue=false )&lt;br /&gt;
: Returns an associative array of rows for a sql SELECT query.&lt;br /&gt;
: The key of the resulting associative array is the first field specified in the SELECT query.&lt;br /&gt;
: The value of the resulting associative array if an associative array with all the field specified in the SELECT query and associated values.&lt;br /&gt;
: First column must be a primary or alternate key.&lt;br /&gt;
: The resulting collection can be empty.&lt;br /&gt;
: If you specified $bSingleValue=true and if your SQL query request 2 fields A and B, the method returns an associative array &amp;quot;A=&amp;gt;B&amp;quot;&lt;br /&gt;
&lt;br /&gt;
Example 1:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
self::getCollectionFromDB( &amp;quot;SELECT player_id id, player_name name, player_score score FROM player&amp;quot; );&lt;br /&gt;
&lt;br /&gt;
Result:&lt;br /&gt;
array(&lt;br /&gt;
 1234 =&amp;gt; array( &#039;id&#039;=&amp;gt;1234, &#039;name&#039;=&amp;gt;&#039;myuser0&#039;, &#039;score&#039;=&amp;gt;1 ),&lt;br /&gt;
 1235 =&amp;gt; array( &#039;id&#039;=&amp;gt;1235, &#039;name&#039;=&amp;gt;&#039;myuser1&#039;, &#039;score&#039;=&amp;gt;0 )&lt;br /&gt;
)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Example 2:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
self::getCollectionFromDB( &amp;quot;SELECT player_id id, player_name name FROM player&amp;quot;, true );&lt;br /&gt;
&lt;br /&gt;
Result:&lt;br /&gt;
array(&lt;br /&gt;
 1234 =&amp;gt; &#039;myuser0&#039;,&lt;br /&gt;
 1235 =&amp;gt; &#039;myuser1&#039;&lt;br /&gt;
)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
; getNonEmptyCollectionFromDB( $sql )&lt;br /&gt;
: Idem than previous one, but raise an exception if the collection is empty&lt;br /&gt;
&lt;br /&gt;
; function getObjectFromDB( $sql )&lt;br /&gt;
: Returns one row for the sql SELECT query as an associative array or null if there is no result&lt;br /&gt;
: Raise an exception if the query return more than one row&lt;br /&gt;
&lt;br /&gt;
Example:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
self::getObjectFromDB( &amp;quot;SELECT player_id id, player_name name, player_score score FROM player WHERE player_id=&#039;$player_id&#039;&amp;quot; );&lt;br /&gt;
&lt;br /&gt;
Result:&lt;br /&gt;
array(&lt;br /&gt;
  &#039;id&#039;=&amp;gt;1234, &#039;name&#039;=&amp;gt;&#039;myuser0&#039;, &#039;score&#039;=&amp;gt;1 &lt;br /&gt;
)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
; getNonEmptyObjectFromDB( $sql )&lt;br /&gt;
: Idem than previous one, but raise an exception if no row is found&lt;br /&gt;
&lt;br /&gt;
; getObjectListFromDB( $sql, $bUniqueValue=false )&lt;br /&gt;
: Return an array of rows for a sql SELECT query.&lt;br /&gt;
: the result if the same than &amp;quot;getCollectionFromDB&amp;quot; except that the result is a simple array (and not an associative array).&lt;br /&gt;
: The result can be empty.&lt;br /&gt;
: If you specified $bUniqueValue=true and if your SQL query request 1 field, the method returns directly an array of values.&lt;br /&gt;
&lt;br /&gt;
Example 1:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
self::getObjectListFromDB( &amp;quot;SELECT player_id id, player_name name, player_score score FROM player&amp;quot; );&lt;br /&gt;
&lt;br /&gt;
Result:&lt;br /&gt;
array(&lt;br /&gt;
 array( &#039;id&#039;=&amp;gt;1234, &#039;name&#039;=&amp;gt;&#039;myuser0&#039;, &#039;score&#039;=&amp;gt;1 ),&lt;br /&gt;
 array( &#039;id&#039;=&amp;gt;1235, &#039;name&#039;=&amp;gt;&#039;myuser1&#039;, &#039;score&#039;=&amp;gt;0 )&lt;br /&gt;
)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Example 2:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
self::getObjectListFromDB( &amp;quot;SELECT player_name name FROM player&amp;quot;, true );&lt;br /&gt;
&lt;br /&gt;
Result:&lt;br /&gt;
array(&lt;br /&gt;
 &#039;myuser0&#039;,&lt;br /&gt;
 &#039;myuser1&#039;&lt;br /&gt;
)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
; getDoubleKeyCollectionFromDB( $sql, $bSingleValue=false )&lt;br /&gt;
: Return an associative array of associative array, from a SQL SELECT query.&lt;br /&gt;
: First array level correspond to first column specified in SQL query.&lt;br /&gt;
: Second array level correspond to second column specified in SQL query.&lt;br /&gt;
: If bSingleValue = true, keep only third column on result&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
; DbGetLastId()&lt;br /&gt;
: Return the PRIMARY key of the last inserted row (see PHP mysql_insert_id function).&lt;br /&gt;
&lt;br /&gt;
; DbAffectedRow()&lt;br /&gt;
: Return the number of row affected by the last operation&lt;br /&gt;
&lt;br /&gt;
; escapeStringForDB( $string )&lt;br /&gt;
: You must use this function on every string type data in your database that contains unsafe data.&lt;br /&gt;
: (unsafe = can be modified by a player).&lt;br /&gt;
: This method makes sure that no SQL injection will be done through the string used.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
self::getObjectFromDB( &amp;quot;SELECT player_name name, player_color color FROM player WHERE player_id=&#039;1234&#039;&amp;quot; );&lt;br /&gt;
&lt;br /&gt;
Result:&lt;br /&gt;
array(&lt;br /&gt;
 &#039;id&#039; =&amp;gt; 1234,&lt;br /&gt;
 &#039;name&#039; =&amp;gt; &#039;myuser1&#039;,&lt;br /&gt;
 &#039;color&#039; =&amp;gt; &#039;ff0000&#039;&lt;br /&gt;
)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Note: see Editing [[Game database model: dbmodel.sql]] to know how to define your database model.&lt;br /&gt;
&lt;br /&gt;
== Use globals ==&lt;br /&gt;
&lt;br /&gt;
Sometimes, you have to keep a single integer value that is global to your game, and you don&#039;t want to create a DB table specifically for it.&lt;br /&gt;
&lt;br /&gt;
Using a BGA framework &amp;quot;global&amp;quot;, you can do such a thing. Your value will be stored in the &amp;quot;global&amp;quot; table in database, and you can access it with simple methods.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;initGameStateLabels&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
This method is located at the beginning of your game logic. This is the place you defines the globals used in your game logic, by assigning them IDs.&lt;br /&gt;
&lt;br /&gt;
You can define up to 79 globals, with IDs from 10 to 89. You must NOT use globals outside this range as globals are used by other components of the framework.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
        self::initGameStateLabels( array( &lt;br /&gt;
                &amp;quot;my_first_global_variable&amp;quot; =&amp;gt; 10,&lt;br /&gt;
                &amp;quot;my_second_global_variable&amp;quot; =&amp;gt; 11&lt;br /&gt;
        ) );&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;setGameStateInitialValue( $value_label, $value_value )&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Init your global value. Must be called before any use of your global, so you should call this method from your &amp;quot;setupNewGame&amp;quot; method.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;getGameStateValue( $value_label )&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Retrieve the current value of a global.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;setGameStateValue( $value_label, $value_value )&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Set the current value of a global.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;incGameStateValue( $value_label, $increment )&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Increment the current value of a global. If increment is negative, decrement the value of the global.&lt;br /&gt;
&lt;br /&gt;
Return the final value of the global.&lt;br /&gt;
&lt;br /&gt;
== Game states and active players ==&lt;br /&gt;
&lt;br /&gt;
; checkAction( $actionName, $bThrowException=true )&lt;br /&gt;
: Check if action is valid regarding current game state (exception if fails)&lt;br /&gt;
: The action is valid if it is listed as a &amp;quot;possibleactions&amp;quot; in the current game state (see game state description).&lt;br /&gt;
: This method MUST be called in the first place in ALL your PHP methods that handle players action, in order to make sure a player can&#039;t do an action when the rules disallow it at this moment of the game.&lt;br /&gt;
: if &amp;quot;bThrowException&amp;quot; is set to &amp;quot;false&amp;quot;, the function return false in case of failure instead of throwing and exception. This is useful when several actions are possible in order to test each of them without throwing exceptions.&lt;br /&gt;
&lt;br /&gt;
; activeNextPlayer()&lt;br /&gt;
: Make the next player active in the natural player order.&lt;br /&gt;
: Note: you CANT use this method in a &amp;quot;activeplayer&amp;quot; or &amp;quot;multipleactiveplayer&amp;quot; state. You must use a &amp;quot;game&amp;quot; type game state for this.&lt;br /&gt;
&lt;br /&gt;
; activePrevPlayer()&lt;br /&gt;
: Make the previous player active (in the natural player order).&lt;br /&gt;
: Note: you CANT use this method in a &amp;quot;activeplayer&amp;quot; or &amp;quot;multipleactiveplayer&amp;quot; state. You must use a &amp;quot;game&amp;quot; type game state for this.&lt;br /&gt;
&lt;br /&gt;
; $this-&amp;gt;gamestate-&amp;gt;changeActivePlayer( $player_id )&lt;br /&gt;
: You can call this method to make any player active.&lt;br /&gt;
: Note: you CANT use this method in a &amp;quot;activeplayer&amp;quot; or &amp;quot;multipleactiveplayer&amp;quot; state. You must use a &amp;quot;game&amp;quot; type game state for this.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
; $this-&amp;gt;gamestate-&amp;gt;getActivePlayerList()&lt;br /&gt;
: With this method you can retrieve the list of the active player at any time.&lt;br /&gt;
: During a &amp;quot;game&amp;quot; type gamestate, it will return a void array.&lt;br /&gt;
: During a &amp;quot;activeplayer&amp;quot; type gamestate, it will return an array with one value (the active player id).&lt;br /&gt;
: during a &amp;quot;multipleactiveplayer&amp;quot; type gamestate, it will return an array of the active players id.&lt;br /&gt;
: Note: you should only use this method is the latter case.&lt;br /&gt;
&lt;br /&gt;
; $this-&amp;gt;gamestate-&amp;gt;setAllPlayersMultiactive()&lt;br /&gt;
: With this method, all playing players are made active.&lt;br /&gt;
: Usually, you use this method at the beginning (ex: &amp;quot;st&amp;quot; action method) of a multiplayer game state when all players have to do some action.&lt;br /&gt;
&lt;br /&gt;
; $this-&amp;gt;gamestate-&amp;gt;setPlayersMultiactive( $players, $next_state )&lt;br /&gt;
: Make a specific list of players active during a multiactive gamestate.&lt;br /&gt;
: Bare in mind it doesn&#039;t deactivate other previously active players.&lt;br /&gt;
: &amp;quot;players&amp;quot; is the array of player id that should be made active.&lt;br /&gt;
: In case &amp;quot;players&amp;quot; is empty, the method trigger the &amp;quot;next_state&amp;quot; transition to go to the next game state.&lt;br /&gt;
&lt;br /&gt;
; $this-&amp;gt;gamestate-&amp;gt;setPlayerNonMultiactive( $player_id, $next_state )&lt;br /&gt;
: During a multiactive game state, make the specified player inactive.&lt;br /&gt;
: Usually, you call this method during a multiactive game state after a player did his action.&lt;br /&gt;
: If this player was the last active player, the method trigger the &amp;quot;next_state&amp;quot; transition to go to the next game state.&lt;br /&gt;
&lt;br /&gt;
; $this-&amp;gt;gamestate-&amp;gt;checkPossibleAction( $action )&lt;br /&gt;
: (rarely used)&lt;br /&gt;
: This works exactly like &amp;quot;checkAction&amp;quot;, except that it do NOT check if current player is active.&lt;br /&gt;
: This is used specifically in certain game states when you want to authorize some additional actions for players that are not active at the moment.&lt;br /&gt;
: Example: in Libertalia game, you want to authorize players to change their mind about card played. They are of course not active at the time they change their mind, so you cannot use &amp;quot;checkAction&amp;quot; and use &amp;quot;checkPossibleAction&amp;quot; instead.&lt;br /&gt;
&lt;br /&gt;
== Players turn order ==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;getNextPlayerTable()&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Return an associative array which associate each player with the next player around the table.&lt;br /&gt;
&lt;br /&gt;
In addition, key 0 is associated to the first player to play.&lt;br /&gt;
&lt;br /&gt;
Example: if three player with ID 1, 2 and 3 are around the table, in this order, the method returns:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
   array( &lt;br /&gt;
    1 =&amp;gt; 2, &lt;br /&gt;
    2 =&amp;gt; 3, &lt;br /&gt;
    3 =&amp;gt; 1, &lt;br /&gt;
    0 =&amp;gt; 1 &lt;br /&gt;
   );&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;getPrevPlayerTable()&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Same as above, but the associative array associate the previous player around the table.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;getPlayerAfter( $player_id )&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Get player playing after given player in natural playing order.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;getPlayerBefore( $player_id )&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Get player playing before given player in natural playing order.&lt;br /&gt;
&lt;br /&gt;
== Notify players ==&lt;br /&gt;
&lt;br /&gt;
To understand notifications, please read [http://www.slideshare.net/boardgamearena/the-bga-framework-at-a-glance The BGA Framework at a glance] first.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;IMPORTANT&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Notifications are sent at the very end of the request, when it ends normally. It means that if you throw an exception for any reason (ex: move not allowed), no notifications will be sent to players.&lt;br /&gt;
Notifications sent between the game start (setupNewGame) and the end of the &amp;quot;action&amp;quot; method of the first active state will never reach their destination.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;notifyAllPlayers( $notification_type, $notification_log, $notification_args )&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Send a notification to all players of the game.&lt;br /&gt;
&lt;br /&gt;
* notification_type:&lt;br /&gt;
A string that defines the type of your notification.&lt;br /&gt;
&lt;br /&gt;
Your game interface Javascript logic will use this to know what is the type of the received notification (and to trigger the corresponding method).&lt;br /&gt;
&lt;br /&gt;
* notification_log:&lt;br /&gt;
A string that defines what is to be displayed in the game log.&lt;br /&gt;
&lt;br /&gt;
You can use an empty string here (&amp;quot;&amp;quot;). In this case, nothing is displayed in the game log.&lt;br /&gt;
&lt;br /&gt;
If you define a real string here, you should use &amp;quot;clienttranslate&amp;quot; method to make sure it can be translate.&lt;br /&gt;
&lt;br /&gt;
You can use arguments in your notification_log strings, that refers to values defines in the &amp;quot;notification_args&amp;quot; argument (see below). NB: Make sure you only use single quotes (&#039;), otherwise PHP will try to interpolate the variable and will ignore the values in the args array.&lt;br /&gt;
&lt;br /&gt;
Note: you CAN use some HTML inside your notification log, and it is working. However:&lt;br /&gt;
_ pay attention to keep the log clear.&lt;br /&gt;
_ try to not include some HTML tags inside the &amp;quot;clienttranslate&amp;quot; method, otherwise it will make the translators work more difficult. You can use a notification argument instead, and provide your HTML through this argument.&lt;br /&gt;
&lt;br /&gt;
* notification_args:&lt;br /&gt;
The arguments of your notifications, as an associative array.&lt;br /&gt;
&lt;br /&gt;
This array will be transmitted to the game interface logic, in order the game interface can be updated.&lt;br /&gt;
&lt;br /&gt;
Complete notifyAllPlayers example (from &amp;quot;Reversi&amp;quot;):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
self::notifyAllPlayers( &amp;quot;playDisc&amp;quot;, clienttranslate( &#039;${player_name} plays a disc and turns over ${returned_nbr} disc(s)&#039; ), array(&lt;br /&gt;
        &#039;player_id&#039; =&amp;gt; $player_id,&lt;br /&gt;
        &#039;player_name&#039; =&amp;gt; self::getActivePlayerName(),&lt;br /&gt;
        &#039;returned_nbr&#039; =&amp;gt; count( $turnedOverDiscs ),&lt;br /&gt;
        &#039;x&#039; =&amp;gt; $x,&lt;br /&gt;
        &#039;y&#039; =&amp;gt; $y&lt;br /&gt;
     ) );&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You can see in the example above the use of the &amp;quot;clienttranslate&amp;quot; method, and the use of 2 arguments &amp;quot;player_name&amp;quot; and &amp;quot;returned_nbr&amp;quot; in the notification log.&lt;br /&gt;
&lt;br /&gt;
Important: NO private date must be sent with this method, as a cheater could see it even it is not used explicitly by the game interface logic. If you want to send private information to a player, please use notifyPlayer below.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;notifyPlayer( $player_id, $notification_type, $notification_log, $notification_args )&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Same as above, except that the notification is sent to one player only.&lt;br /&gt;
&lt;br /&gt;
This method must be used each time some private information must be transmitted to a player.&lt;br /&gt;
&lt;br /&gt;
== Game statistics ==&lt;br /&gt;
&lt;br /&gt;
There are 2 types of statistics:&lt;br /&gt;
* a &amp;quot;player&amp;quot; statistic is a statistic associated to a player&lt;br /&gt;
* a &amp;quot;table&amp;quot; statistics is a statistic not associated to a player (global statistic for this game).&lt;br /&gt;
&lt;br /&gt;
See [[Game statistics: stats.inc.php]] to see how you defines statistics for your game.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;initStat( $table_or_player, $name, $value, $player_id=null )&#039;&#039;&#039;&lt;br /&gt;
Create a statistic entry for the specified statistics with a default value.&lt;br /&gt;
This method must be called for each statistics of your game, in your setupNewGame method.&lt;br /&gt;
&lt;br /&gt;
&#039;table_or_player&#039; must be set to &amp;quot;table&amp;quot; if this is a table statistics, or &amp;quot;player&amp;quot; if this is a player statistics.&lt;br /&gt;
&lt;br /&gt;
&#039;name&#039; is the name of your statistics, as it has been defined in your stats.inc.php file.&lt;br /&gt;
&lt;br /&gt;
&#039;value&#039; is the initial value of the statistics. If this is a player statistics and if the player is not specified by &amp;quot;player_id&amp;quot; argument, the value is set for ALL players.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;function setStat( $value, $name, $player_id = null )&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Set a statistic value.&lt;br /&gt;
&lt;br /&gt;
If &amp;quot;player_id&amp;quot; is not specified, setStat consider it is a TABLE statistic.&lt;br /&gt;
&lt;br /&gt;
If &amp;quot;player_id&amp;quot; is specified, setStat consider it is a PLAYER statistic.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;incStat( $delta, $name, $player_id = null )&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Increment (or decrement) specified statistic value. Same behavior as above.&lt;br /&gt;
&lt;br /&gt;
== Translations ==&lt;br /&gt;
&lt;br /&gt;
See [[Translations]]&lt;br /&gt;
&lt;br /&gt;
== Manage player scores and Tie breaker ==&lt;br /&gt;
&lt;br /&gt;
At the end of the game, players automatically get a rank depending on their score: the player with the biggest score is #1, the player with the second biggest score is #2, and so on...&lt;br /&gt;
&lt;br /&gt;
During the game, you update player&#039;s score directly by updating &amp;quot;player_score&amp;quot; field of &amp;quot;player&amp;quot; table in database.&lt;br /&gt;
&lt;br /&gt;
Examples:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
  // +2 points to active player&lt;br /&gt;
  self::DbQuery( &amp;quot;UPDATE player SET player_score=player_score+2 WHERE player_id=&#039;&amp;quot;.self::getActivePlayerId().&amp;quot;&#039;&amp;quot; );&lt;br /&gt;
&lt;br /&gt;
  // Set score of active player to 5&lt;br /&gt;
  self::DbQuery( &amp;quot;UPDATE player SET player_score=5 WHERE player_id=&#039;&amp;quot;.self::getActivePlayerId().&amp;quot;&#039;&amp;quot; );&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Note: don&#039;t forget to notify the client side in order the score control can be updated accordingly.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Tie breaker&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Tie breaker is used when two players get the same score at the end of a game.&lt;br /&gt;
&lt;br /&gt;
Tie breaker is using &amp;quot;player_score_aux&amp;quot; field of &amp;quot;player&amp;quot; table. It is updated exactly like the &amp;quot;player_score&amp;quot; field.&lt;br /&gt;
&lt;br /&gt;
Tie breaker score is displayed only for players who are tied at the end of the game. Most of the time, it is not supposed to be displayed explicitly during the game.&lt;br /&gt;
&lt;br /&gt;
When you are using &amp;quot;player_score_aux&amp;quot; functionality, you must describe the formula to use in your gameinfos.inc.php file like this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
         &#039;tie_breaker_description&#039; =&amp;gt; totranslate(&amp;quot;Describe here your tie breaker formula&amp;quot;),&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This description will be used as a tooltip to explain to players how this auxiliary score has been calculated.&lt;br /&gt;
&lt;br /&gt;
== Reflexion time ==&lt;br /&gt;
&lt;br /&gt;
; function giveExtraTime( $player_id, $specific_time=null )&lt;br /&gt;
: Give standard extra time to this player.&lt;br /&gt;
: Standard extra time depends on the speed of the game (small with &amp;quot;slow&amp;quot; game option, bigger with other options).&lt;br /&gt;
: You can also specify an exact time to add, in seconds, with the &amp;quot;specified_time&amp;quot; argument (rarely used).&lt;br /&gt;
&lt;br /&gt;
== Managing errors and exceptions ==&lt;br /&gt;
&lt;br /&gt;
Note: when you throw an exception, all database changes and all notifications are cancelled immediately. This way, the game situation that were existing before the request is completely restored.&lt;br /&gt;
&lt;br /&gt;
; throw new BgaUserException ( $error_message)&lt;br /&gt;
: Base class to notify a user error&lt;br /&gt;
: You must throw this exception when a player want to do something that he is not allowed to do.&lt;br /&gt;
: The error message will be shown to the player as a &amp;quot;red message&amp;quot;, so it must be translated.&lt;br /&gt;
: Throwing such an exception is NOT considered as a bug, so it is not traced in BGA error logs.&lt;br /&gt;
&lt;br /&gt;
Example from Gomoku:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
     throw new BgaUserException( self::_(&amp;quot;There is already a stone on this intersection, you can&#039;t play there&amp;quot;) );&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
; throw new BgaVisibleSystemException ( $error_message)&lt;br /&gt;
: You must throw this exception when you detect something that is not supposed to happened into your code.&lt;br /&gt;
: The error message is shown to the user as an &amp;quot;Unexpected error&amp;quot;, in order he can report it in the forum.&lt;br /&gt;
: The error message is logged in BGA error logs. If it happens regularly, we will report it to you.&lt;br /&gt;
&lt;br /&gt;
; throw new BgaSystemException ( $error_message)&lt;br /&gt;
: Base class to notify a system exception. The message will be hidden from the user, but show in the logs. Use this if the message contains technical information.&lt;br /&gt;
: You shouldn&#039;t use this type of exception except if you think the information shown could be critical. Indeed: a generic error message will be shown to the user, so it&#039;s going to be difficult for you to see what happened.&lt;br /&gt;
&lt;br /&gt;
== Zombie mode ==&lt;br /&gt;
&lt;br /&gt;
When a player leaves a game for any reason (expelled, quit), he becomes a &amp;quot;zombie player&amp;quot;. In this case, the results of the game won&#039;t count for statistics, but this is cool if the other players can finish the game anyway. That&#039;s why zombie mode exists: allow the other player to finish the game, even if the situation is not ideal.&lt;br /&gt;
&lt;br /&gt;
While developing your zombie mode, keep in mind that:&lt;br /&gt;
* Do not refer to the rules, because this situation is not planned by the rules.&lt;br /&gt;
* Try to figure that you are playing with your friends and one of them has to leave: how can we finish the game without killing the spirit of the game?&lt;br /&gt;
* The idea is NOT to develop an artificial intelligence for the game.&lt;br /&gt;
&lt;br /&gt;
Most of the time, the best thing to do when it is zombie player turn is to jump immediately to a state where he is not active anymore. For example, if he is in a game state where he has a choice between playing A and playing B, the best thing to do is NOT to choose A or B, but to pass. So, even if there&#039;s no &amp;quot;pass&amp;quot; action in the rules, add a &amp;quot;zombiepass&amp;quot; transitition in your game state and use it.&lt;br /&gt;
&lt;br /&gt;
Each time a zombie player must play, your &amp;quot;zombieTurn&amp;quot; method is called.&lt;br /&gt;
&lt;br /&gt;
Parameters:&lt;br /&gt;
* $state: the name of the current game state.&lt;br /&gt;
* $active_player: the id of the active player.&lt;br /&gt;
&lt;br /&gt;
Most of the time, your zombieTurn method looks like this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
    function zombieTurn( $state, $active_player )&lt;br /&gt;
    {&lt;br /&gt;
    	$statename = $state[&#039;name&#039;];&lt;br /&gt;
&lt;br /&gt;
        if( $statename == &#039;myFirstGameState&#039;&lt;br /&gt;
             ||  $statename == &#039;my2ndGameState&#039;&lt;br /&gt;
             ||  $statename == &#039;my3rdGameState&#039;&lt;br /&gt;
               ....&lt;br /&gt;
           )&lt;br /&gt;
        {&lt;br /&gt;
            $this-&amp;gt;gamestate-&amp;gt;nextState( &amp;quot;zombiePass&amp;quot; );&lt;br /&gt;
        }&lt;br /&gt;
        else&lt;br /&gt;
            throw new BgaVisibleSystemException( &amp;quot;Zombie mode not supported at this game state: &amp;quot;.$statename );&lt;br /&gt;
    }&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Note that in the example above, all corresponding game state should implement &amp;quot;zombiePass&amp;quot; as a transition.&lt;br /&gt;
&lt;br /&gt;
== Player elimination ==&lt;br /&gt;
&lt;br /&gt;
In some games, this is useful to eliminate a player from the game in order he/she can start another game without waiting for the current game end.&lt;br /&gt;
&lt;br /&gt;
This case should be rare. Please don&#039;t use player elimination feature if some player just has to wait the last 10% of the game for game end. This feature should be used only in games where players are eliminated all along the game (typical examples: &amp;quot;Perudo&amp;quot; or &amp;quot;The Werewolves of Miller&#039;s Hollow&amp;quot;).&lt;br /&gt;
&lt;br /&gt;
Usage:&lt;br /&gt;
&lt;br /&gt;
* Player to eliminate should NOT be active anymore (preferably use the feature in a &amp;quot;game&amp;quot; type game state).&lt;br /&gt;
* In your PHP code:&lt;br /&gt;
  self::eliminatePlayer( &amp;lt;player_to_eliminate_id&amp;gt; );&lt;br /&gt;
* the player is informed in a dialog box that he no longer have to played and can start another game if he/she wants too (whith buttons &amp;quot;stay at this table&amp;quot; &amp;quot;quit table and back to main site&amp;quot;). In any case, the player is free to tart&amp;amp;join another table from now.&lt;br /&gt;
* When your game is over, all players who have been eliminated before receive a &amp;quot;notification&amp;quot; (the small &amp;quot;!&amp;quot; icon on the top right of the BGA interface) that indicate them that &amp;quot;the game has ended&amp;quot; and invite them to review the game results.&lt;br /&gt;
&lt;br /&gt;
== Player color preferences ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
BGA players (Club members) may now choose their preferred color for playing. For example, if they are used to play green for every board game, they can select &amp;quot;green&amp;quot; in their BGA preferences page.&lt;br /&gt;
&lt;br /&gt;
Making your game compatible with colors preferences is very easy and requires only 1 line of PHP and 1 configuration change :&lt;br /&gt;
&lt;br /&gt;
On your gameinfos.inc.php file, add the following lines :&lt;br /&gt;
&lt;br /&gt;
  // Favorite colors support : if set to &amp;quot;true&amp;quot;, support attribution of favorite colors based on player&#039;s preferences (see reattributeColorsBasedOnPreferences PHP method)&lt;br /&gt;
  &#039;favorite_colors_support&#039; =&amp;gt; true,&lt;br /&gt;
&lt;br /&gt;
Then, on your main &amp;lt;your_game&amp;gt;.game.php file, find the &amp;quot;reloadPlayersBasicInfos&amp;quot; call in your &amp;quot;setupNewGame&amp;quot; method and replace :&lt;br /&gt;
&lt;br /&gt;
        $sql .= implode( $values, &#039;,&#039; );&lt;br /&gt;
        self::DbQuery( $sql );&lt;br /&gt;
        self::reloadPlayersBasicInfos();&lt;br /&gt;
&lt;br /&gt;
By :&lt;br /&gt;
&lt;br /&gt;
        $sql .= implode( $values, &#039;,&#039; );&lt;br /&gt;
        self::DbQuery( $sql );&lt;br /&gt;
        self::reattributeColorsBasedOnPreferences( $players, array(  /* LIST HERE THE AVAILABLE COLORS OF YOUR GAME INSTEAD OF THESE ONES */&amp;quot;ff0000&amp;quot;, &amp;quot;008000&amp;quot;, &amp;quot;0000ff&amp;quot;, &amp;quot;ffa500&amp;quot;, &amp;quot;773300&amp;quot; ) );&lt;br /&gt;
        self::reloadPlayersBasicInfos();&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The &amp;quot;reattributeColorsBasedOnPreferences&amp;quot; method reattributes all colors, taking into account players color preferences and available colors.&lt;br /&gt;
&lt;br /&gt;
Note that you must update the colors to indicate the colors available for your game.&lt;br /&gt;
&lt;br /&gt;
2 important remarks :&lt;br /&gt;
* for some games (ex : Chess), the color has an influence on a mechanism of the game, most of the time by giving a special advantage to a player (ex : Starting the game). Color preference mechanism must NOT be used in such a case.&lt;br /&gt;
* your logic should NEVER consider that the first player has the color X, that the second player has the color Y, and so on. If this is the case, your game will NOT be compatible with reattributeColorsBasedOnPreferences as this method attribute colors to players based on their preferences and not based as their order at the table.&lt;/div&gt;</summary>
		<author><name>Sourisdudesert</name></author>
	</entry>
	<entry>
		<id>https://fa.doc.boardgamearena.com/index.php?title=Your_game_mobile_version&amp;diff=1722</id>
		<title>Your game mobile version</title>
		<link rel="alternate" type="text/html" href="https://fa.doc.boardgamearena.com/index.php?title=Your_game_mobile_version&amp;diff=1722"/>
		<updated>2015-12-28T10:32:35Z</updated>

		<summary type="html">&lt;p&gt;Sourisdudesert: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
Board Game Arena is now adaptated for Mobiles and Tablets too.&lt;br /&gt;
&lt;br /&gt;
It is very easy to have a mobile version of the game you developed with BGA Studio. In fact, your game is probably already 100% playable on mobile.&lt;br /&gt;
&lt;br /&gt;
However, to provide your players the best experience, you should follow the 2 advices below.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Declare your interface minimum width ==&lt;br /&gt;
&lt;br /&gt;
By default, your game can run in an window up to 740 pixels width. Considering the informations of the right column (player&#039;s panel), it fits on a 1024px wide screen.&lt;br /&gt;
&lt;br /&gt;
However, you can choose to declare that your game is able to run with a smaller width. This way, the game will appear much better on mobile and tablets.&lt;br /&gt;
&lt;br /&gt;
For example, Reversi board is only 540px wide. If we stay with the default width (740px), the game interface displayed on mobile will be too large and some space will be lost on the left and on the right. Consequently the Reversi board is going to appear very small on the mobile screen, and players will have to &amp;quot;pinch &amp;amp; zoom&amp;quot; to display it correctly.&lt;br /&gt;
&lt;br /&gt;
To avoid that, we can specify that the game can be played with an interface with a minimum width of 540 pixels, by adding the following to gameinfos.inc.php :&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
  // Game interface width range (pixels)&lt;br /&gt;
  // Note: game interface = space on the left side, without the column on the right&lt;br /&gt;
  &#039;game_interface_width&#039; =&amp;gt; array(&lt;br /&gt;
  &lt;br /&gt;
    // Minimum width&lt;br /&gt;
    //  default: 740&lt;br /&gt;
    //  maximum possible value: 740 (ie: your game interface should fit with a 740px width (correspond to a 1024px screen)&lt;br /&gt;
    //  minimum possible value: 320 (the lowest value you specify, the better the display is on mobile)&lt;br /&gt;
    &#039;min&#039; =&amp;gt; 540,&lt;br /&gt;
  &lt;br /&gt;
    // Maximum width&lt;br /&gt;
    //  default: null (ie: no limit, the game interface is as big as the player&#039;s screen allows it).&lt;br /&gt;
    //  maximum possible value: unlimited&lt;br /&gt;
    //  minimum possible value: 740&lt;br /&gt;
    &#039;max&#039; =&amp;gt; null&lt;br /&gt;
  ),&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
And that&#039;s it! Now, BGA can choose the better display for your game interface, whatever the device.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Important&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
If you declare that your interface can run with a 540 pixels width, it must effectively run on an interface with 540 pixels width.&lt;br /&gt;
&lt;br /&gt;
Note that this doesn&#039;t mean that your interface must ALWAYS be 540 pixels width: you just have to make your interface fluid and/or to use CSS media query to fit in any width.&lt;br /&gt;
&lt;br /&gt;
Examples :&lt;br /&gt;
&lt;br /&gt;
* On Can&#039;t Stop, when the screen is too narrow, we move the dices on another position (below the main board) to fit in the width :&lt;br /&gt;
&lt;br /&gt;
  @media only screen and (max-width: 990px) {&lt;br /&gt;
  &lt;br /&gt;
    #dicechoices {&lt;br /&gt;
        left: 180px;&lt;br /&gt;
        top: 530px;&lt;br /&gt;
    }&lt;br /&gt;
    #cantstop_wrap {&lt;br /&gt;
        height: 900px;&lt;br /&gt;
        width: 550px;&lt;br /&gt;
    }&lt;br /&gt;
  }&lt;br /&gt;
&lt;br /&gt;
* On Seasons, we have some panels on the right of the board. On small screens, we display these panels below the board:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
  @media only screen and (max-width: 970px) {&lt;br /&gt;
  &lt;br /&gt;
    #board {&lt;br /&gt;
        float: none;&lt;br /&gt;
        margin: auto;&lt;br /&gt;
    }&lt;br /&gt;
    .seasons_rightpanel {&lt;br /&gt;
        margin-left: 0px;&lt;br /&gt;
    }&lt;br /&gt;
  &lt;br /&gt;
  }&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Tip: on mobile, BGA displays player panels at the top of the page (instead of displaying them on the right). When doing this, BGA applies the CSS class &amp;quot;mobile_version&amp;quot; to the root HTML element with id &amp;quot;ebd-body&amp;quot;. If you want you can use this CSS &amp;quot;mobile_version&amp;quot; class to optimize some of your game adaptations to this change. In the opposite, when the &amp;quot;normal&amp;quot; version is active, the CSS class &amp;quot;desktop_version&amp;quot; BGA applies the CSS class &amp;quot;desktop_version&amp;quot; to the root HTML element with id &amp;quot;ebd-body&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
== Touchscreen compatibility ==&lt;br /&gt;
&lt;br /&gt;
Most of your games should work with touchscreen devices without needing any changes.&lt;br /&gt;
&lt;br /&gt;
Note: when your game is running on a touchscreen device, the global CSS class &amp;quot;touch-device&amp;quot; is added to the to the root HTML element with id &amp;quot;ebd-body&amp;quot; (and &amp;quot;notouch-device&amp;quot; is added for the opposite).&lt;br /&gt;
&lt;br /&gt;
What may not work :&lt;br /&gt;
* &amp;quot;:hover&amp;quot; CSS switch. Because there is no mouse, &amp;quot;:hover&amp;quot; won&#039;t be triggered. This is not an issue unless it is needed to play the game. In addition, some touch devices consider that a short touch must trigger a &amp;quot;:hover&amp;quot; (and should apply corresponding CSS), which can block an interaction in your game. We advise you to explicitely disable &amp;quot;:hover&amp;quot; effects when your game is running on a touchscreen device.&lt;br /&gt;
* Mouseover events : like the previous one : if you associated Javascript events to &amp;quot;onmouseover&amp;quot; event, it won&#039;t work on tablets.&lt;br /&gt;
* Drag&#039;n&#039;drop : it won&#039;t work. To make it work, you should listen to &amp;quot;ontouchstart&amp;quot;, &amp;quot;ontouchmove&amp;quot; and &amp;quot;ontouchend&amp;quot; event and trigger the same logic you already have for &amp;quot;onmousedown&amp;quot;, &amp;quot;onmousemove&amp;quot; and &amp;quot;onmouseup&amp;quot;. You should also make sure to stop the Javascript &amp;quot;ontouchmove&amp;quot; event (ex: dojo.stopEvent( evt ) ) during the drag n drop, otherwise the interface is going to scroll while drag&#039;n&#039;dropping.&lt;/div&gt;</summary>
		<author><name>Sourisdudesert</name></author>
	</entry>
	<entry>
		<id>https://fa.doc.boardgamearena.com/index.php?title=Your_game_mobile_version&amp;diff=1721</id>
		<title>Your game mobile version</title>
		<link rel="alternate" type="text/html" href="https://fa.doc.boardgamearena.com/index.php?title=Your_game_mobile_version&amp;diff=1721"/>
		<updated>2015-12-28T10:26:09Z</updated>

		<summary type="html">&lt;p&gt;Sourisdudesert: /* Declare your interface minimum width */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
Board Game Arena is now adaptated for Mobiles and Tablets too.&lt;br /&gt;
&lt;br /&gt;
It is very easy to have a mobile version of the game you developed with BGA Studio. In fact, your game is probably already 100% playable on mobile.&lt;br /&gt;
&lt;br /&gt;
However, to provide your players the best experience, you should follow the 2 advices below.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Declare your interface minimum width ==&lt;br /&gt;
&lt;br /&gt;
By default, your game can run in an window up to 740 pixels width. Considering the informations of the right column (player&#039;s panel), it fits on a 1024px wide screen.&lt;br /&gt;
&lt;br /&gt;
However, you can choose to declare that your game is able to run with a smaller width. This way, the game will appear much better on mobile and tablets.&lt;br /&gt;
&lt;br /&gt;
For example, Reversi board is only 540px wide. If we stay with the default width (740px), the game interface displayed on mobile will be too large and some space will be lost on the left and on the right. Consequently the Reversi board is going to appear very small on the mobile screen, and players will have to &amp;quot;pinch &amp;amp; zoom&amp;quot; to display it correctly.&lt;br /&gt;
&lt;br /&gt;
To avoid that, we can specify that the game can be played with an interface with a minimum width of 540 pixels, by adding the following to gameinfos.inc.php :&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
  // Game interface width range (pixels)&lt;br /&gt;
  // Note: game interface = space on the left side, without the column on the right&lt;br /&gt;
  &#039;game_interface_width&#039; =&amp;gt; array(&lt;br /&gt;
  &lt;br /&gt;
    // Minimum width&lt;br /&gt;
    //  default: 740&lt;br /&gt;
    //  maximum possible value: 740 (ie: your game interface should fit with a 740px width (correspond to a 1024px screen)&lt;br /&gt;
    //  minimum possible value: 320 (the lowest value you specify, the better the display is on mobile)&lt;br /&gt;
    &#039;min&#039; =&amp;gt; 540,&lt;br /&gt;
  &lt;br /&gt;
    // Maximum width&lt;br /&gt;
    //  default: null (ie: no limit, the game interface is as big as the player&#039;s screen allows it).&lt;br /&gt;
    //  maximum possible value: unlimited&lt;br /&gt;
    //  minimum possible value: 740&lt;br /&gt;
    &#039;max&#039; =&amp;gt; null&lt;br /&gt;
  ),&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
And that&#039;s it! Now, BGA can choose the better display for your game interface, whatever the device.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Important&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
If you declare that your interface can run with a 540 pixels width, it must effectively run on an interface with 540 pixels width.&lt;br /&gt;
&lt;br /&gt;
Note that this doesn&#039;t mean that your interface must ALWAYS be 540 pixels width: you just have to make your interface fluid and/or to use CSS media query to fit in any width.&lt;br /&gt;
&lt;br /&gt;
Examples :&lt;br /&gt;
&lt;br /&gt;
* On Can&#039;t Stop, when the screen is too narrow, we move the dices on another position (below the main board) to fit in the width :&lt;br /&gt;
&lt;br /&gt;
  @media only screen and (max-width: 990px) {&lt;br /&gt;
  &lt;br /&gt;
    #dicechoices {&lt;br /&gt;
        left: 180px;&lt;br /&gt;
        top: 530px;&lt;br /&gt;
    }&lt;br /&gt;
    #cantstop_wrap {&lt;br /&gt;
        height: 900px;&lt;br /&gt;
        width: 550px;&lt;br /&gt;
    }&lt;br /&gt;
  }&lt;br /&gt;
&lt;br /&gt;
* On Seasons, we have some panels on the right of the board. On small screens, we display these panels below the board:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
  @media only screen and (max-width: 970px) {&lt;br /&gt;
  &lt;br /&gt;
    #board {&lt;br /&gt;
        float: none;&lt;br /&gt;
        margin: auto;&lt;br /&gt;
    }&lt;br /&gt;
    .seasons_rightpanel {&lt;br /&gt;
        margin-left: 0px;&lt;br /&gt;
    }&lt;br /&gt;
  &lt;br /&gt;
  }&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Tip: on mobile, BGA displays player panels at the top of the page (instead of displaying them on the right). When doing this, BGA applies the CSS class &amp;quot;mobile_version&amp;quot; to the root HTML element. If you want you can use this CSS &amp;quot;mobile_version&amp;quot; class to optimize some of your game adaptations to this change.&lt;br /&gt;
&lt;br /&gt;
== Touchscreen compatibility ==&lt;br /&gt;
&lt;br /&gt;
Most of your games should work with touchscreen devices without needing any changes.&lt;br /&gt;
&lt;br /&gt;
Note: when your game is running on a touchscreen device, the global CSS class &amp;quot;touch-device&amp;quot; is added to the root HTML element (and &amp;quot;notouch-device&amp;quot; is added for the opposite).&lt;br /&gt;
&lt;br /&gt;
What may not work :&lt;br /&gt;
* &amp;quot;:hover&amp;quot; CSS switch. Because there is no mouse, &amp;quot;:hover&amp;quot; won&#039;t be triggered. This is not an issue unless it is needed to play the game. In addition, some touch devices consider that a short touch must trigger a &amp;quot;:hover&amp;quot; (and should apply corresponding CSS), which can block an interaction in your game. We advise you to explicitely disable &amp;quot;:hover&amp;quot; effects when your game is running on a touchscreen device.&lt;br /&gt;
* Mouseover events : like the previous one : if you associated Javascript events to &amp;quot;onmouseover&amp;quot; event, it won&#039;t work on tablets.&lt;br /&gt;
* Drag&#039;n&#039;drop : it won&#039;t work. To make it work, you should listen to &amp;quot;ontouchstart&amp;quot;, &amp;quot;ontouchmove&amp;quot; and &amp;quot;ontouchend&amp;quot; event and trigger the same logic you already have for &amp;quot;onmousedown&amp;quot;, &amp;quot;onmousemove&amp;quot; and &amp;quot;onmouseup&amp;quot;. You should also make sure to stop the Javascript &amp;quot;ontouchmove&amp;quot; event (ex: dojo.stopEvent( evt ) ) during the drag n drop, otherwise the interface is going to scroll while drag&#039;n&#039;dropping.&lt;/div&gt;</summary>
		<author><name>Sourisdudesert</name></author>
	</entry>
	<entry>
		<id>https://fa.doc.boardgamearena.com/index.php?title=Your_game_mobile_version&amp;diff=1720</id>
		<title>Your game mobile version</title>
		<link rel="alternate" type="text/html" href="https://fa.doc.boardgamearena.com/index.php?title=Your_game_mobile_version&amp;diff=1720"/>
		<updated>2015-12-28T10:24:07Z</updated>

		<summary type="html">&lt;p&gt;Sourisdudesert: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
Board Game Arena is now adaptated for Mobiles and Tablets too.&lt;br /&gt;
&lt;br /&gt;
It is very easy to have a mobile version of the game you developed with BGA Studio. In fact, your game is probably already 100% playable on mobile.&lt;br /&gt;
&lt;br /&gt;
However, to provide your players the best experience, you should follow the 2 advices below.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Declare your interface minimum width ==&lt;br /&gt;
&lt;br /&gt;
By default, your game can run in an window up to 740 pixels width. Considering the informations of the right column (player&#039;s panel), it fits on a 1024px wide screen.&lt;br /&gt;
&lt;br /&gt;
However, you can choose to declare that your game is able to run with a smaller width. This way, the game will appear much better on mobile and tablets.&lt;br /&gt;
&lt;br /&gt;
For example, Reversi board is only 540px wide. If we stay with the default width (740px), the game interface displayed on mobile will be too large and some space will be lost on the left and on the right. Consequently the Reversi board is going to appear very small on the mobile screen, and players will have to &amp;quot;pinch &amp;amp; zoom&amp;quot; to display it correctly.&lt;br /&gt;
&lt;br /&gt;
To avoid that, we can specify that the game can be played with an interface with a minimum width of 540 pixels, by adding the following to gameinfos.inc.php :&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
  // Game interface width range (pixels)&lt;br /&gt;
  // Note: game interface = space on the left side, without the column on the right&lt;br /&gt;
  &#039;game_interface_width&#039; =&amp;gt; array(&lt;br /&gt;
  &lt;br /&gt;
    // Minimum width&lt;br /&gt;
    //  default: 740&lt;br /&gt;
    //  maximum possible value: 740 (ie: your game interface should fit with a 740px width (correspond to a 1024px screen)&lt;br /&gt;
    //  minimum possible value: 320 (the lowest value you specify, the better the display is on mobile)&lt;br /&gt;
    &#039;min&#039; =&amp;gt; 540,&lt;br /&gt;
  &lt;br /&gt;
    // Maximum width&lt;br /&gt;
    //  default: null (ie: no limit, the game interface is as big as the player&#039;s screen allows it).&lt;br /&gt;
    //  maximum possible value: unlimited&lt;br /&gt;
    //  minimum possible value: 740&lt;br /&gt;
    &#039;max&#039; =&amp;gt; null&lt;br /&gt;
  ),&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
And that&#039;s it! Now, BGA can choose the better display for your game interface, whatever the device.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Important&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
If you declare that your interface can run with a 540 pixels width, it must effectively run on an interface with 540 pixels width.&lt;br /&gt;
&lt;br /&gt;
Note that this doesn&#039;t mean that your interface must ALWAYS be 540 pixels width: you just have to make your interface fluid and/or to use CSS media query to fit in any width.&lt;br /&gt;
&lt;br /&gt;
Examples :&lt;br /&gt;
&lt;br /&gt;
* On Can&#039;t Stop, when the screen is too wide, we move the dices on another position (below the main board) to fit in the width :&lt;br /&gt;
&lt;br /&gt;
  @media only screen and (max-width: 990px) {&lt;br /&gt;
  &lt;br /&gt;
    #dicechoices {&lt;br /&gt;
        left: 180px;&lt;br /&gt;
        top: 530px;&lt;br /&gt;
    }&lt;br /&gt;
    #cantstop_wrap {&lt;br /&gt;
        height: 900px;&lt;br /&gt;
        width: 550px;&lt;br /&gt;
    }&lt;br /&gt;
  }&lt;br /&gt;
&lt;br /&gt;
* On Seasons, we have some panels on the right of the board. On small screens, we display these panels below the board:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
  @media only screen and (max-width: 970px) {&lt;br /&gt;
  &lt;br /&gt;
    #board {&lt;br /&gt;
        float: none;&lt;br /&gt;
        margin: auto;&lt;br /&gt;
    }&lt;br /&gt;
    .seasons_rightpanel {&lt;br /&gt;
        margin-left: 0px;&lt;br /&gt;
    }&lt;br /&gt;
  &lt;br /&gt;
  }&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Tip: on mobile, BGA displays player panels at the top of the page (instead of displaying them on the right). When doing this, BGA applies the CSS class &amp;quot;mobile_version&amp;quot; to the root HTML element. If you want you can use this CSS &amp;quot;mobile_version&amp;quot; class to optimize some of your game adaptations to this change.&lt;br /&gt;
&lt;br /&gt;
== Touchscreen compatibility ==&lt;br /&gt;
&lt;br /&gt;
Most of your games should work with touchscreen devices without needing any changes.&lt;br /&gt;
&lt;br /&gt;
Note: when your game is running on a touchscreen device, the global CSS class &amp;quot;touch-device&amp;quot; is added to the root HTML element (and &amp;quot;notouch-device&amp;quot; is added for the opposite).&lt;br /&gt;
&lt;br /&gt;
What may not work :&lt;br /&gt;
* &amp;quot;:hover&amp;quot; CSS switch. Because there is no mouse, &amp;quot;:hover&amp;quot; won&#039;t be triggered. This is not an issue unless it is needed to play the game. In addition, some touch devices consider that a short touch must trigger a &amp;quot;:hover&amp;quot; (and should apply corresponding CSS), which can block an interaction in your game. We advise you to explicitely disable &amp;quot;:hover&amp;quot; effects when your game is running on a touchscreen device.&lt;br /&gt;
* Mouseover events : like the previous one : if you associated Javascript events to &amp;quot;onmouseover&amp;quot; event, it won&#039;t work on tablets.&lt;br /&gt;
* Drag&#039;n&#039;drop : it won&#039;t work. To make it work, you should listen to &amp;quot;ontouchstart&amp;quot;, &amp;quot;ontouchmove&amp;quot; and &amp;quot;ontouchend&amp;quot; event and trigger the same logic you already have for &amp;quot;onmousedown&amp;quot;, &amp;quot;onmousemove&amp;quot; and &amp;quot;onmouseup&amp;quot;. You should also make sure to stop the Javascript &amp;quot;ontouchmove&amp;quot; event (ex: dojo.stopEvent( evt ) ) during the drag n drop, otherwise the interface is going to scroll while drag&#039;n&#039;dropping.&lt;/div&gt;</summary>
		<author><name>Sourisdudesert</name></author>
	</entry>
	<entry>
		<id>https://fa.doc.boardgamearena.com/index.php?title=Your_game_mobile_version&amp;diff=1717</id>
		<title>Your game mobile version</title>
		<link rel="alternate" type="text/html" href="https://fa.doc.boardgamearena.com/index.php?title=Your_game_mobile_version&amp;diff=1717"/>
		<updated>2015-12-26T12:20:24Z</updated>

		<summary type="html">&lt;p&gt;Sourisdudesert: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
Board Game Arena is now adaptated for Mobiles and Tablets too.&lt;br /&gt;
&lt;br /&gt;
This is very easy to have a mobile version of the game you developed with BGA Studio. In fact, your game is probably already 100% playable on mobile.&lt;br /&gt;
&lt;br /&gt;
However, to provide your players the best experience, you should follow the 2 advices below.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Declare your interface minimum width ==&lt;br /&gt;
&lt;br /&gt;
By default, your game can run in an window up to 740 pixels width. Considering the informations of the right column (player&#039;s panel), it fits on a 1024px wide screen.&lt;br /&gt;
&lt;br /&gt;
However, you can choose to declare that your game is able to run with a smaller width. This way, the game will appear much better on mobile and tablets.&lt;br /&gt;
&lt;br /&gt;
For example, Reversi board is only 540px wide. If we stay with the default width (740px), the game interface displayed on mobile will be too large and some space will be lost on the left and on the right. Consequently the Reversi board is going to appear very small on the mobile screen, and players will have to &amp;quot;pinch &amp;amp; zoom&amp;quot; to display it correctly.&lt;br /&gt;
&lt;br /&gt;
To avoid that, we can specify that the game can be played with an interface with a minimum width of 540 pixels, by adding the following to gameinfos.inc.php :&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
  // Game interface width range (pixels)&lt;br /&gt;
  // Note: game interface = space on the left side, without the column on the right&lt;br /&gt;
  &#039;game_interface_width&#039; =&amp;gt; array(&lt;br /&gt;
  &lt;br /&gt;
    // Minimum width&lt;br /&gt;
    //  default: 760&lt;br /&gt;
    //  maximum possible value: 760 (ie: your game interface should fit with a 760px width (correspond to a 1024px screen)&lt;br /&gt;
    //  minimum possible value: 320 (the lowest value you specify, the better the display is on mobile)&lt;br /&gt;
    &#039;min&#039; =&amp;gt; 540,&lt;br /&gt;
  &lt;br /&gt;
    // Maximum width&lt;br /&gt;
    //  default: null (ie: no limit, the game interface is as big as the player&#039;s screen allows it).&lt;br /&gt;
    //  maximum possible value: unlimited&lt;br /&gt;
    //  minimum possible value: 760&lt;br /&gt;
    &#039;max&#039; =&amp;gt; null&lt;br /&gt;
  ),&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
And that&#039;s it! Now, BGA can choose the better display for your game interface, whatever the device.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Important&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
If you declare that your interface can run with a 540 pixels width, it must effectively run on an interface with 540 pixels width.&lt;br /&gt;
&lt;br /&gt;
Note that it doesn&#039;t mean that your interface must ALWAYS be 540 pixels width : you just have to make your interface fluid and/or to use CSS media query to fit in any width.&lt;br /&gt;
&lt;br /&gt;
Examples :&lt;br /&gt;
&lt;br /&gt;
* On Can&#039;t Stop, when the screen is too wide, we move the dices on another position (below the main board) to fit in the width :&lt;br /&gt;
&lt;br /&gt;
  @media only screen and (max-width: 990px) {&lt;br /&gt;
  &lt;br /&gt;
    #dicechoices {&lt;br /&gt;
        left: 180px;&lt;br /&gt;
        top: 530px;&lt;br /&gt;
    }&lt;br /&gt;
    #cantstop_wrap {&lt;br /&gt;
        height: 900px;&lt;br /&gt;
        width: 550px;&lt;br /&gt;
    }&lt;br /&gt;
  }&lt;br /&gt;
&lt;br /&gt;
* On Seasons, we have some panels on the right of the boards. On small screen, we display these panels below :&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
  @media only screen and (max-width: 970px) {&lt;br /&gt;
  &lt;br /&gt;
    #board {&lt;br /&gt;
        float: none;&lt;br /&gt;
        margin: auto;&lt;br /&gt;
    }&lt;br /&gt;
    .seasons_rightpanel {&lt;br /&gt;
        margin-left: 0px;&lt;br /&gt;
    }&lt;br /&gt;
  &lt;br /&gt;
  }&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Tips : on mobile, BGA displays players&#039; panels at the top of the page (instead of displaying them on the right). When doing this, BGA applies the CSS class &amp;quot;mobile_version&amp;quot; to the root HTML element. If you want you can use this CSS &amp;quot;mobile_version&amp;quot; class to synchronize some of your game adaptations to this change.&lt;br /&gt;
&lt;br /&gt;
== Touchscreen compatibility ==&lt;br /&gt;
&lt;br /&gt;
Most of your game should work with touchscreen device.&lt;br /&gt;
&lt;br /&gt;
Note : When your game is running on a touchscreen device, the global CSS class &amp;quot;touch-device&amp;quot; is added to the root HTML element (and &amp;quot;notouch-device&amp;quot; is added in the contrary).&lt;br /&gt;
&lt;br /&gt;
What may not work :&lt;br /&gt;
* &amp;quot;:hover&amp;quot; CSS switch. Because there is no mouse, &amp;quot;:hover&amp;quot; won&#039;t be triggered. This is not an issue unless it is needed to play the game. In addition, some touch device considers that a short touch must trigger a &amp;quot;:hover&amp;quot; (and should apply corresponding CSS), which can block an interaction in your game. We advise you to explicitely disable &amp;quot;:hover&amp;quot; effects when your game is running on a touchscreen device.&lt;br /&gt;
* Mouseover events : like the previous one : if you associated Javascript events to &amp;quot;onmouseover&amp;quot; event, it won&#039;t work on tablets.&lt;br /&gt;
* Drag&#039;n&#039;drop : it won&#039;t work. To make it work, you should listen to &amp;quot;ontouchstart&amp;quot;, &amp;quot;ontouchmove&amp;quot; and &amp;quot;ontouchend&amp;quot; event and trigger the same logic you already have for &amp;quot;onmousedown&amp;quot;, &amp;quot;onmousemove&amp;quot; and &amp;quot;onmouseup&amp;quot;. You should also make sure to stop the Javascript &amp;quot;ontouchmove&amp;quot; event (ex: dojo.stopEvent( evt ) ) during the drag n drop, otherwise the interface is going to scroll while drag&#039;n&#039;droping.&lt;/div&gt;</summary>
		<author><name>Sourisdudesert</name></author>
	</entry>
	<entry>
		<id>https://fa.doc.boardgamearena.com/index.php?title=Your_game_mobile_version&amp;diff=1716</id>
		<title>Your game mobile version</title>
		<link rel="alternate" type="text/html" href="https://fa.doc.boardgamearena.com/index.php?title=Your_game_mobile_version&amp;diff=1716"/>
		<updated>2015-12-26T12:18:01Z</updated>

		<summary type="html">&lt;p&gt;Sourisdudesert: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
Board Game Arena is now adaptated for Mobiles and Tablets too.&lt;br /&gt;
&lt;br /&gt;
This is very easy to have a mobile version of the game you developed with BGA Studio. In fact, your game is probably already 100% playable on mobile.&lt;br /&gt;
&lt;br /&gt;
However, to provide your players the best experience, you should follow the 2 advices below.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Declare your interface minimum width ==&lt;br /&gt;
&lt;br /&gt;
By default, your game can run in an window up to 740 pixels width. Considering the informations of the right column (player&#039;s panel), it fits on a 1024px wide screen.&lt;br /&gt;
&lt;br /&gt;
However, you can choose to declare that your game is able to run with a smaller width. This way, the game will appear much better on mobile and tablets.&lt;br /&gt;
&lt;br /&gt;
For example, Reversi board is only 540px wide. If we stay with the default width (740px), the game interface displayed on mobile will be too large and some space will be lost on the left and on the right. Consequently the Reversi board is going to appear very small on the mobile screen, and players will have to &amp;quot;pinch &amp;amp; zoom&amp;quot; to display it correctly.&lt;br /&gt;
&lt;br /&gt;
To avoid that, we can specify that the game can be played with an interface with a minimum width of 540 pixels, by adding the following to gameinfos.inc.php :&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
  // Game interface width range (pixels)&lt;br /&gt;
  // Note: game interface = space on the left side, without the column on the right&lt;br /&gt;
  &#039;game_interface_width&#039; =&amp;gt; array(&lt;br /&gt;
  &lt;br /&gt;
    // Minimum width&lt;br /&gt;
    //  default: 760&lt;br /&gt;
    //  maximum possible value: 760 (ie: your game interface should fit with a 760px width (correspond to a 1024px screen)&lt;br /&gt;
    //  minimum possible value: 320 (the lowest value you specify, the better the display is on mobile)&lt;br /&gt;
    &#039;min&#039; =&amp;gt; 540,&lt;br /&gt;
  &lt;br /&gt;
    // Maximum width&lt;br /&gt;
    //  default: null (ie: no limit, the game interface is as big as the player&#039;s screen allows it).&lt;br /&gt;
    //  maximum possible value: unlimited&lt;br /&gt;
    //  minimum possible value: 760&lt;br /&gt;
    &#039;max&#039; =&amp;gt; null&lt;br /&gt;
  ),&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
And that&#039;s it! Now, BGA can choose the better display for your game interface, whatever the device.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Important&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
If you declare that your interface can run with a 540 pixels width, it must effectively run on an interface with 540 pixels width.&lt;br /&gt;
&lt;br /&gt;
Note that it doesn&#039;t mean that your interface must ALWAYS be 540 pixels width : you just have to make your interface fluid and/or to use CSS media query to fit in any width.&lt;br /&gt;
&lt;br /&gt;
Examples :&lt;br /&gt;
&lt;br /&gt;
* On Can&#039;t Stop, when the screen is too wide, we move the dices on another position (below the main board) to fit in the width :&lt;br /&gt;
&lt;br /&gt;
  @media only screen and (max-width: 990px) {&lt;br /&gt;
  &lt;br /&gt;
    #dicechoices {&lt;br /&gt;
        left: 180px;&lt;br /&gt;
        top: 530px;&lt;br /&gt;
    }&lt;br /&gt;
    #cantstop_wrap {&lt;br /&gt;
        height: 900px;&lt;br /&gt;
        width: 550px;&lt;br /&gt;
    }&lt;br /&gt;
  }&lt;br /&gt;
&lt;br /&gt;
* On Seasons, we have some panels on the right of the boards. On small screen, we display these panels below :&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
  @media only screen and (max-width: 970px) {&lt;br /&gt;
  &lt;br /&gt;
    #board {&lt;br /&gt;
        float: none;&lt;br /&gt;
        margin: auto;&lt;br /&gt;
    }&lt;br /&gt;
    .seasons_rightpanel {&lt;br /&gt;
        margin-left: 0px;&lt;br /&gt;
    }&lt;br /&gt;
  &lt;br /&gt;
  }&lt;br /&gt;
&lt;br /&gt;
== Touchscreen compatibility ==&lt;br /&gt;
&lt;br /&gt;
Most of your game should work with touchscreen device.&lt;br /&gt;
&lt;br /&gt;
Note : When your game is running on a touchscreen device, the global CSS class &amp;quot;touch-device&amp;quot; is added to the root HTML element (and &amp;quot;notouch-device&amp;quot; is added in the contrary).&lt;br /&gt;
&lt;br /&gt;
What may not work :&lt;br /&gt;
* &amp;quot;:hover&amp;quot; CSS switch. Because there is no mouse, &amp;quot;:hover&amp;quot; won&#039;t be triggered. This is not an issue unless it is needed to play the game. In addition, some touch device considers that a short touch must trigger a &amp;quot;:hover&amp;quot; (and should apply corresponding CSS), which can block an interaction in your game. We advise you to explicitely disable &amp;quot;:hover&amp;quot; effects when your game is running on a touchscreen device.&lt;br /&gt;
* Mouseover events : like the previous one : if you associated Javascript events to &amp;quot;onmouseover&amp;quot; event, it won&#039;t work on tablets.&lt;br /&gt;
* Drag&#039;n&#039;drop : it won&#039;t work. To make it work, you should listen to &amp;quot;ontouchstart&amp;quot;, &amp;quot;ontouchmove&amp;quot; and &amp;quot;ontouchend&amp;quot; event and trigger the same logic you already have for &amp;quot;onmousedown&amp;quot;, &amp;quot;onmousemove&amp;quot; and &amp;quot;onmouseup&amp;quot;. You should also make sure to stop the Javascript &amp;quot;ontouchmove&amp;quot; event (ex: dojo.stopEvent( evt ) ) during the drag n drop, otherwise the interface is going to scroll while drag&#039;n&#039;droping.&lt;/div&gt;</summary>
		<author><name>Sourisdudesert</name></author>
	</entry>
	<entry>
		<id>https://fa.doc.boardgamearena.com/index.php?title=Your_game_mobile_version&amp;diff=1715</id>
		<title>Your game mobile version</title>
		<link rel="alternate" type="text/html" href="https://fa.doc.boardgamearena.com/index.php?title=Your_game_mobile_version&amp;diff=1715"/>
		<updated>2015-12-26T12:17:39Z</updated>

		<summary type="html">&lt;p&gt;Sourisdudesert: /* Declare your interface minimum width */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
Board Game Arena is now adaptated for Mobiles and Tablets too.&lt;br /&gt;
&lt;br /&gt;
This is very easy to have a mobile version of the game you developed with BGA Studio. In fact, your game is probably already 100% playable on mobile.&lt;br /&gt;
&lt;br /&gt;
However, to provide your players the best experience, you should follow the 2 advices below.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Declare your interface minimum width ==&lt;br /&gt;
&lt;br /&gt;
By default, your game can run in an window up to 740 pixels width. Considering the informations of the right column (player&#039;s panel), it fits on a 1024px wide screen.&lt;br /&gt;
&lt;br /&gt;
However, you can choose to declare that your game is able to run with a smaller width. This way, the game will appear much better on mobile and tablets.&lt;br /&gt;
&lt;br /&gt;
For example, Reversi board is only 540px wide. If we stay with the default width (740px), the game interface displayed on mobile will be too large and some space will be lost on the left and on the right. Consequently the Reversi board is going to appear very small on the mobile screen, and players will have to &amp;quot;pinch &amp;amp; zoom&amp;quot; to display it correctly.&lt;br /&gt;
&lt;br /&gt;
To avoid that, we can specify that the game can be played with an interface with a minimum width of 540 pixels, by adding the following to gameinfos.inc.php :&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
  // Game interface width range (pixels)&lt;br /&gt;
  // Note: game interface = space on the left side, without the column on the right&lt;br /&gt;
  &#039;game_interface_width&#039; =&amp;gt; array(&lt;br /&gt;
  &lt;br /&gt;
    // Minimum width&lt;br /&gt;
    //  default: 760&lt;br /&gt;
    //  maximum possible value: 760 (ie: your game interface should fit with a 760px width (correspond to a 1024px screen)&lt;br /&gt;
    //  minimum possible value: 320 (the lowest value you specify, the better the display is on mobile)&lt;br /&gt;
    &#039;min&#039; =&amp;gt; 540,&lt;br /&gt;
  &lt;br /&gt;
    // Maximum width&lt;br /&gt;
    //  default: null (ie: no limit, the game interface is as big as the player&#039;s screen allows it).&lt;br /&gt;
    //  maximum possible value: unlimited&lt;br /&gt;
    //  minimum possible value: 760&lt;br /&gt;
    &#039;max&#039; =&amp;gt; null&lt;br /&gt;
  ),&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
And that&#039;s it! Now, BGA can choose the better display for your game interface, whatever the device.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Important&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
If you declare that your interface can run with a 540 pixels width, it must effectively run on an interface with 540 pixels width.&lt;br /&gt;
&lt;br /&gt;
Note that it doesn&#039;t mean that your interface must ALWAYS be 540 pixels width : you just have to make your interface fluid and/or to use CSS media query to fit in any width.&lt;br /&gt;
&lt;br /&gt;
Examples :&lt;br /&gt;
&lt;br /&gt;
* On Can&#039;t Stop, when the screen is too wide, we move the dices on another position (below the main board) to fit in the width :&lt;br /&gt;
&lt;br /&gt;
  @media only screen and (max-width: 990px) {&lt;br /&gt;
&lt;br /&gt;
    #dicechoices {&lt;br /&gt;
        left: 180px;&lt;br /&gt;
        top: 530px;&lt;br /&gt;
    }&lt;br /&gt;
    #cantstop_wrap {&lt;br /&gt;
        height: 900px;&lt;br /&gt;
        width: 550px;&lt;br /&gt;
    }&lt;br /&gt;
  }&lt;br /&gt;
&lt;br /&gt;
* On Seasons, we have some panels on the right of the boards. On small screen, we display these panels below :&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
  @media only screen and (max-width: 970px) {&lt;br /&gt;
&lt;br /&gt;
    #board {&lt;br /&gt;
        float: none;&lt;br /&gt;
        margin: auto;&lt;br /&gt;
    }&lt;br /&gt;
    .seasons_rightpanel {&lt;br /&gt;
        margin-left: 0px;&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
  }&lt;br /&gt;
&lt;br /&gt;
== Touchscreen compatibility ==&lt;br /&gt;
&lt;br /&gt;
Most of your game should work with touchscreen device.&lt;br /&gt;
&lt;br /&gt;
Note : When your game is running on a touchscreen device, the global CSS class &amp;quot;touch-device&amp;quot; is added to the root HTML element (and &amp;quot;notouch-device&amp;quot; is added in the contrary).&lt;br /&gt;
&lt;br /&gt;
What may not work :&lt;br /&gt;
* &amp;quot;:hover&amp;quot; CSS switch. Because there is no mouse, &amp;quot;:hover&amp;quot; won&#039;t be triggered. This is not an issue unless it is needed to play the game. In addition, some touch device considers that a short touch must trigger a &amp;quot;:hover&amp;quot; (and should apply corresponding CSS), which can block an interaction in your game. We advise you to explicitely disable &amp;quot;:hover&amp;quot; effects when your game is running on a touchscreen device.&lt;br /&gt;
* Mouseover events : like the previous one : if you associated Javascript events to &amp;quot;onmouseover&amp;quot; event, it won&#039;t work on tablets.&lt;br /&gt;
* Drag&#039;n&#039;drop : it won&#039;t work. To make it work, you should listen to &amp;quot;ontouchstart&amp;quot;, &amp;quot;ontouchmove&amp;quot; and &amp;quot;ontouchend&amp;quot; event and trigger the same logic you already have for &amp;quot;onmousedown&amp;quot;, &amp;quot;onmousemove&amp;quot; and &amp;quot;onmouseup&amp;quot;. You should also make sure to stop the Javascript &amp;quot;ontouchmove&amp;quot; event (ex: dojo.stopEvent( evt ) ) during the drag n drop, otherwise the interface is going to scroll while drag&#039;n&#039;droping.&lt;/div&gt;</summary>
		<author><name>Sourisdudesert</name></author>
	</entry>
</feed>