Changes

Jump to navigation Jump to search
→‎Argument format: add more info on argument quoting
Line 12: Line 12:     
===Argument format===
 
===Argument format===
Game state queries take space-delimited arguments. For example, <code>BUILDINGS_CONSTRUCTED Here Cabins</code> has two arguments: <code>Here</code> and <code>Cabins</code>.
+
Game state queries can take space-delimited arguments. For example, <code>BUILDINGS_CONSTRUCTED Here Cabins</code> has two arguments: <code>Here</code> and <code>Cabins</code>.
   −
You can add quotes to keep spaces within an argument. For example, <code>BUILDINGS_CONSTRUCTED Here "Junimo Hut"</code> passes <code>Junimo Hut</code> as one argument. You can escape inner quotes with backslashes like <code>ANY "BUILDINGS_CONSTRUCTED Here \"Junimo Hut\""</code>. Remember that quotes and backslashes inside JSON strings need to be escaped too, like <code>"Condition": "BUILDINGS_CONSTRUCTED Here \"Junimo Hut\""</code>.
+
If you have spaces within an argument, you can surround it with quotes to keep it together. For example, <code>BUILDINGS_CONSTRUCTED Here "Junimo Hut"</code> passes <code>Junimo Hut</code> as one argument. You can escape inner quotes with backslashes, like <code>ANY "BUILDINGS_CONSTRUCTED Here \"Junimo Hut\""</code>.
 +
 
 +
Remember that quotes and backslashes inside JSON strings need to be escaped too. For example, <code>"Condition": "BUILDINGS_CONSTRUCTED Here \"Junimo Hut\""</code> will send <code>BUILDINGS_CONSTRUCTED Here "Junimo Hut"</code> to the game code. Alternatively, you can use single-quotes for the JSON string instead, like <code>"Condition": 'BUILDINGS_CONSTRUCTED Here "Junimo Hut"'</code>.
    
===Queries versus Content Patcher conditions===
 
===Queries versus Content Patcher conditions===
translators
8,439

edits

Navigation menu