diff --git a/.gitignore b/.gitignore index 96374c4e..34cf1e69 100644 --- a/.gitignore +++ b/.gitignore @@ -41,3 +41,6 @@ $RECYCLE.BIN/ Network Trash Folder Temporary Items .apdisk + +# java class files +plugin/*/bin/ diff --git a/plugin/Raven.SQDev.Editors/.gitignore b/plugin/Raven.SQDev.Editors/.gitignore new file mode 100644 index 00000000..ae3c1726 --- /dev/null +++ b/plugin/Raven.SQDev.Editors/.gitignore @@ -0,0 +1 @@ +/bin/ diff --git a/plugin/Raven.SQDev.Editors/META-INF/MANIFEST.MF b/plugin/Raven.SQDev.Editors/META-INF/MANIFEST.MF index 90697139..9a818d7c 100644 --- a/plugin/Raven.SQDev.Editors/META-INF/MANIFEST.MF +++ b/plugin/Raven.SQDev.Editors/META-INF/MANIFEST.MF @@ -2,17 +2,17 @@ Manifest-Version: 1.0 Bundle-ManifestVersion: 2 Bundle-Name: Editors Bundle-SymbolicName: raven.sqdev.editors;singleton:=true -Bundle-Version: 0.7.1.stable +Bundle-Version: 0.7.2.stable Bundle-Activator: raven.sqdev.editors.activator.Activator Require-Bundle: org.eclipse.ui, org.eclipse.core.runtime, - org.eclipse.ui.editors;bundle-version="3.8.200", - org.eclipse.jface.text;bundle-version="3.9.2", + org.eclipse.ui.editors, + org.eclipse.jface.text, org.eclipse.swt, org.eclipse.core.resources, org.eclipse.ui.ide, - org.eclipse.core.filesystem;bundle-version="1.4.100", - raven.sqdev.misc;bundle-version="0.6.0" + org.eclipse.core.filesystem, + raven.sqdev.misc Bundle-RequiredExecutionEnvironment: JavaSE-1.8 Bundle-ActivationPolicy: lazy Export-Package: raven.sqdev.editors; @@ -42,6 +42,5 @@ Import-Package: raven.sqdev.constants, raven.sqdev.parser.misc, raven.sqdev.parser.preprocessor, raven.sqdev.pluginManagement, - raven.sqdev.pluginManager, raven.sqdev.sqdevFile, raven.sqdev.util diff --git a/plugin/Raven.SQDev.Editors/bin/raven/sqdev/editors/BasicCodeEditor$1.class b/plugin/Raven.SQDev.Editors/bin/raven/sqdev/editors/BasicCodeEditor$1.class deleted file mode 100644 index 02760f60..00000000 Binary files a/plugin/Raven.SQDev.Editors/bin/raven/sqdev/editors/BasicCodeEditor$1.class and /dev/null differ diff --git a/plugin/Raven.SQDev.Editors/bin/raven/sqdev/editors/BasicCodeEditor$2.class b/plugin/Raven.SQDev.Editors/bin/raven/sqdev/editors/BasicCodeEditor$2.class deleted file mode 100644 index e4aa427d..00000000 Binary files a/plugin/Raven.SQDev.Editors/bin/raven/sqdev/editors/BasicCodeEditor$2.class and /dev/null differ diff --git a/plugin/Raven.SQDev.Editors/bin/raven/sqdev/editors/BasicCodeEditor$3.class b/plugin/Raven.SQDev.Editors/bin/raven/sqdev/editors/BasicCodeEditor$3.class deleted file mode 100644 index 91287570..00000000 Binary files a/plugin/Raven.SQDev.Editors/bin/raven/sqdev/editors/BasicCodeEditor$3.class and /dev/null differ diff --git a/plugin/Raven.SQDev.Editors/bin/raven/sqdev/editors/BasicCodeEditor.class b/plugin/Raven.SQDev.Editors/bin/raven/sqdev/editors/BasicCodeEditor.class deleted file mode 100644 index c32a243d..00000000 Binary files a/plugin/Raven.SQDev.Editors/bin/raven/sqdev/editors/BasicCodeEditor.class and /dev/null differ diff --git a/plugin/Raven.SQDev.Editors/bin/raven/sqdev/editors/BasicCompletionProposal$1.class b/plugin/Raven.SQDev.Editors/bin/raven/sqdev/editors/BasicCompletionProposal$1.class deleted file mode 100644 index 76da3ca5..00000000 Binary files a/plugin/Raven.SQDev.Editors/bin/raven/sqdev/editors/BasicCompletionProposal$1.class and /dev/null differ diff --git a/plugin/Raven.SQDev.Editors/bin/raven/sqdev/editors/BasicCompletionProposal$2.class b/plugin/Raven.SQDev.Editors/bin/raven/sqdev/editors/BasicCompletionProposal$2.class deleted file mode 100644 index 1805f551..00000000 Binary files a/plugin/Raven.SQDev.Editors/bin/raven/sqdev/editors/BasicCompletionProposal$2.class and /dev/null differ diff --git a/plugin/Raven.SQDev.Editors/bin/raven/sqdev/editors/BasicCompletionProposal.class b/plugin/Raven.SQDev.Editors/bin/raven/sqdev/editors/BasicCompletionProposal.class deleted file mode 100644 index 79c6cdd5..00000000 Binary files a/plugin/Raven.SQDev.Editors/bin/raven/sqdev/editors/BasicCompletionProposal.class and /dev/null differ diff --git a/plugin/Raven.SQDev.Editors/bin/raven/sqdev/editors/BasicContentAssistProcessor.class b/plugin/Raven.SQDev.Editors/bin/raven/sqdev/editors/BasicContentAssistProcessor.class deleted file mode 100644 index a55fbb54..00000000 Binary files a/plugin/Raven.SQDev.Editors/bin/raven/sqdev/editors/BasicContentAssistProcessor.class and /dev/null differ diff --git a/plugin/Raven.SQDev.Editors/bin/raven/sqdev/editors/BasicDocumentProvider.class b/plugin/Raven.SQDev.Editors/bin/raven/sqdev/editors/BasicDocumentProvider.class deleted file mode 100644 index cf653e01..00000000 Binary files a/plugin/Raven.SQDev.Editors/bin/raven/sqdev/editors/BasicDocumentProvider.class and /dev/null differ diff --git a/plugin/Raven.SQDev.Editors/bin/raven/sqdev/editors/BasicFoldingManager.class b/plugin/Raven.SQDev.Editors/bin/raven/sqdev/editors/BasicFoldingManager.class deleted file mode 100644 index 824801cf..00000000 Binary files a/plugin/Raven.SQDev.Editors/bin/raven/sqdev/editors/BasicFoldingManager.class and /dev/null differ diff --git a/plugin/Raven.SQDev.Editors/bin/raven/sqdev/editors/BasicInformationControl$1.class b/plugin/Raven.SQDev.Editors/bin/raven/sqdev/editors/BasicInformationControl$1.class deleted file mode 100644 index 3c3e84eb..00000000 Binary files a/plugin/Raven.SQDev.Editors/bin/raven/sqdev/editors/BasicInformationControl$1.class and /dev/null differ diff --git a/plugin/Raven.SQDev.Editors/bin/raven/sqdev/editors/BasicInformationControl$2.class b/plugin/Raven.SQDev.Editors/bin/raven/sqdev/editors/BasicInformationControl$2.class deleted file mode 100644 index 11063819..00000000 Binary files a/plugin/Raven.SQDev.Editors/bin/raven/sqdev/editors/BasicInformationControl$2.class and /dev/null differ diff --git a/plugin/Raven.SQDev.Editors/bin/raven/sqdev/editors/BasicInformationControl$InfoComposite.class b/plugin/Raven.SQDev.Editors/bin/raven/sqdev/editors/BasicInformationControl$InfoComposite.class deleted file mode 100644 index 5add7161..00000000 Binary files a/plugin/Raven.SQDev.Editors/bin/raven/sqdev/editors/BasicInformationControl$InfoComposite.class and /dev/null differ diff --git a/plugin/Raven.SQDev.Editors/bin/raven/sqdev/editors/BasicInformationControl.class b/plugin/Raven.SQDev.Editors/bin/raven/sqdev/editors/BasicInformationControl.class deleted file mode 100644 index 3016f2f9..00000000 Binary files a/plugin/Raven.SQDev.Editors/bin/raven/sqdev/editors/BasicInformationControl.class and /dev/null differ diff --git a/plugin/Raven.SQDev.Editors/bin/raven/sqdev/editors/BasicKeywordProvider.class b/plugin/Raven.SQDev.Editors/bin/raven/sqdev/editors/BasicKeywordProvider.class deleted file mode 100644 index 286ce2b4..00000000 Binary files a/plugin/Raven.SQDev.Editors/bin/raven/sqdev/editors/BasicKeywordProvider.class and /dev/null differ diff --git a/plugin/Raven.SQDev.Editors/bin/raven/sqdev/editors/BasicMarkerManager.class b/plugin/Raven.SQDev.Editors/bin/raven/sqdev/editors/BasicMarkerManager.class deleted file mode 100644 index c7d6b991..00000000 Binary files a/plugin/Raven.SQDev.Editors/bin/raven/sqdev/editors/BasicMarkerManager.class and /dev/null differ diff --git a/plugin/Raven.SQDev.Editors/bin/raven/sqdev/editors/BasicParseTimeListener$1.class b/plugin/Raven.SQDev.Editors/bin/raven/sqdev/editors/BasicParseTimeListener$1.class deleted file mode 100644 index 68e1c8ff..00000000 Binary files a/plugin/Raven.SQDev.Editors/bin/raven/sqdev/editors/BasicParseTimeListener$1.class and /dev/null differ diff --git a/plugin/Raven.SQDev.Editors/bin/raven/sqdev/editors/BasicParseTimeListener.class b/plugin/Raven.SQDev.Editors/bin/raven/sqdev/editors/BasicParseTimeListener.class deleted file mode 100644 index 846ca27c..00000000 Binary files a/plugin/Raven.SQDev.Editors/bin/raven/sqdev/editors/BasicParseTimeListener.class and /dev/null differ diff --git a/plugin/Raven.SQDev.Editors/bin/raven/sqdev/editors/BasicPartitionScanner.class b/plugin/Raven.SQDev.Editors/bin/raven/sqdev/editors/BasicPartitionScanner.class deleted file mode 100644 index 37b9ba0d..00000000 Binary files a/plugin/Raven.SQDev.Editors/bin/raven/sqdev/editors/BasicPartitionScanner.class and /dev/null differ diff --git a/plugin/Raven.SQDev.Editors/bin/raven/sqdev/editors/BasicSourceViewerConfiguration.class b/plugin/Raven.SQDev.Editors/bin/raven/sqdev/editors/BasicSourceViewerConfiguration.class deleted file mode 100644 index 7e3eb6ec..00000000 Binary files a/plugin/Raven.SQDev.Editors/bin/raven/sqdev/editors/BasicSourceViewerConfiguration.class and /dev/null differ diff --git a/plugin/Raven.SQDev.Editors/bin/raven/sqdev/editors/BasicTextHover$1.class b/plugin/Raven.SQDev.Editors/bin/raven/sqdev/editors/BasicTextHover$1.class deleted file mode 100644 index 6e096fca..00000000 Binary files a/plugin/Raven.SQDev.Editors/bin/raven/sqdev/editors/BasicTextHover$1.class and /dev/null differ diff --git a/plugin/Raven.SQDev.Editors/bin/raven/sqdev/editors/BasicTextHover.class b/plugin/Raven.SQDev.Editors/bin/raven/sqdev/editors/BasicTextHover.class deleted file mode 100644 index ce14df3f..00000000 Binary files a/plugin/Raven.SQDev.Editors/bin/raven/sqdev/editors/BasicTextHover.class and /dev/null differ diff --git a/plugin/Raven.SQDev.Editors/bin/raven/sqdev/editors/CharacterPair.class b/plugin/Raven.SQDev.Editors/bin/raven/sqdev/editors/CharacterPair.class deleted file mode 100644 index 6bc1d5e9..00000000 Binary files a/plugin/Raven.SQDev.Editors/bin/raven/sqdev/editors/CharacterPair.class and /dev/null differ diff --git a/plugin/Raven.SQDev.Editors/bin/raven/sqdev/editors/CharacterPairHandler$1.class b/plugin/Raven.SQDev.Editors/bin/raven/sqdev/editors/CharacterPairHandler$1.class deleted file mode 100644 index ff34f79b..00000000 Binary files a/plugin/Raven.SQDev.Editors/bin/raven/sqdev/editors/CharacterPairHandler$1.class and /dev/null differ diff --git a/plugin/Raven.SQDev.Editors/bin/raven/sqdev/editors/CharacterPairHandler.class b/plugin/Raven.SQDev.Editors/bin/raven/sqdev/editors/CharacterPairHandler.class deleted file mode 100644 index 1b9a242e..00000000 Binary files a/plugin/Raven.SQDev.Editors/bin/raven/sqdev/editors/CharacterPairHandler.class and /dev/null differ diff --git a/plugin/Raven.SQDev.Editors/bin/raven/sqdev/editors/ColorManager.class b/plugin/Raven.SQDev.Editors/bin/raven/sqdev/editors/ColorManager.class deleted file mode 100644 index ca5d654e..00000000 Binary files a/plugin/Raven.SQDev.Editors/bin/raven/sqdev/editors/ColorManager.class and /dev/null differ diff --git a/plugin/Raven.SQDev.Editors/bin/raven/sqdev/editors/EditorKeyEventManager.class b/plugin/Raven.SQDev.Editors/bin/raven/sqdev/editors/EditorKeyEventManager.class deleted file mode 100644 index 0a4d29c9..00000000 Binary files a/plugin/Raven.SQDev.Editors/bin/raven/sqdev/editors/EditorKeyEventManager.class and /dev/null differ diff --git a/plugin/Raven.SQDev.Editors/bin/raven/sqdev/editors/EditorKeyEventQueue.class b/plugin/Raven.SQDev.Editors/bin/raven/sqdev/editors/EditorKeyEventQueue.class deleted file mode 100644 index 1b74906e..00000000 Binary files a/plugin/Raven.SQDev.Editors/bin/raven/sqdev/editors/EditorKeyEventQueue.class and /dev/null differ diff --git a/plugin/Raven.SQDev.Editors/bin/raven/sqdev/editors/KeywordScanner.class b/plugin/Raven.SQDev.Editors/bin/raven/sqdev/editors/KeywordScanner.class deleted file mode 100644 index 651a7b26..00000000 Binary files a/plugin/Raven.SQDev.Editors/bin/raven/sqdev/editors/KeywordScanner.class and /dev/null differ diff --git a/plugin/Raven.SQDev.Editors/bin/raven/sqdev/editors/MarkerInformation.class b/plugin/Raven.SQDev.Editors/bin/raven/sqdev/editors/MarkerInformation.class deleted file mode 100644 index b94348fa..00000000 Binary files a/plugin/Raven.SQDev.Editors/bin/raven/sqdev/editors/MarkerInformation.class and /dev/null differ diff --git a/plugin/Raven.SQDev.Editors/bin/raven/sqdev/editors/MultiKeywordScanner$1.class b/plugin/Raven.SQDev.Editors/bin/raven/sqdev/editors/MultiKeywordScanner$1.class deleted file mode 100644 index f6e45bf0..00000000 Binary files a/plugin/Raven.SQDev.Editors/bin/raven/sqdev/editors/MultiKeywordScanner$1.class and /dev/null differ diff --git a/plugin/Raven.SQDev.Editors/bin/raven/sqdev/editors/MultiKeywordScanner.class b/plugin/Raven.SQDev.Editors/bin/raven/sqdev/editors/MultiKeywordScanner.class deleted file mode 100644 index 23f69437..00000000 Binary files a/plugin/Raven.SQDev.Editors/bin/raven/sqdev/editors/MultiKeywordScanner.class and /dev/null differ diff --git a/plugin/Raven.SQDev.Editors/bin/raven/sqdev/editors/NonRuleBasedDamagerRepairer.class b/plugin/Raven.SQDev.Editors/bin/raven/sqdev/editors/NonRuleBasedDamagerRepairer.class deleted file mode 100644 index 1f98ac3b..00000000 Binary files a/plugin/Raven.SQDev.Editors/bin/raven/sqdev/editors/NonRuleBasedDamagerRepairer.class and /dev/null differ diff --git a/plugin/Raven.SQDev.Editors/bin/raven/sqdev/editors/WordDetector.class b/plugin/Raven.SQDev.Editors/bin/raven/sqdev/editors/WordDetector.class deleted file mode 100644 index 228b428f..00000000 Binary files a/plugin/Raven.SQDev.Editors/bin/raven/sqdev/editors/WordDetector.class and /dev/null differ diff --git a/plugin/Raven.SQDev.Editors/bin/raven/sqdev/editors/activator/Activator.class b/plugin/Raven.SQDev.Editors/bin/raven/sqdev/editors/activator/Activator.class deleted file mode 100644 index 2745d60f..00000000 Binary files a/plugin/Raven.SQDev.Editors/bin/raven/sqdev/editors/activator/Activator.class and /dev/null differ diff --git a/plugin/Raven.SQDev.Editors/bin/raven/sqdev/editors/exceptions/IllegalConstructorException.class b/plugin/Raven.SQDev.Editors/bin/raven/sqdev/editors/exceptions/IllegalConstructorException.class deleted file mode 100644 index 4674c8a0..00000000 Binary files a/plugin/Raven.SQDev.Editors/bin/raven/sqdev/editors/exceptions/IllegalConstructorException.class and /dev/null differ diff --git a/plugin/Raven.SQDev.Editors/bin/raven/sqdev/editors/exceptions/IllegalModificationException.class b/plugin/Raven.SQDev.Editors/bin/raven/sqdev/editors/exceptions/IllegalModificationException.class deleted file mode 100644 index cb21bd16..00000000 Binary files a/plugin/Raven.SQDev.Editors/bin/raven/sqdev/editors/exceptions/IllegalModificationException.class and /dev/null differ diff --git a/plugin/Raven.SQDev.Editors/bin/raven/sqdev/editors/exceptions/SQDevEditorException.class b/plugin/Raven.SQDev.Editors/bin/raven/sqdev/editors/exceptions/SQDevEditorException.class deleted file mode 100644 index 2d7c1325..00000000 Binary files a/plugin/Raven.SQDev.Editors/bin/raven/sqdev/editors/exceptions/SQDevEditorException.class and /dev/null differ diff --git a/plugin/Raven.SQDev.Editors/bin/raven/sqdev/editors/other/ConfigEditor.class b/plugin/Raven.SQDev.Editors/bin/raven/sqdev/editors/other/ConfigEditor.class deleted file mode 100644 index 23e6a7f4..00000000 Binary files a/plugin/Raven.SQDev.Editors/bin/raven/sqdev/editors/other/ConfigEditor.class and /dev/null differ diff --git a/plugin/Raven.SQDev.Editors/bin/raven/sqdev/editors/sqdevEditor/SQDevFileEditor.class b/plugin/Raven.SQDev.Editors/bin/raven/sqdev/editors/sqdevEditor/SQDevFileEditor.class deleted file mode 100644 index 6020a9c6..00000000 Binary files a/plugin/Raven.SQDev.Editors/bin/raven/sqdev/editors/sqdevEditor/SQDevFileEditor.class and /dev/null differ diff --git a/plugin/Raven.SQDev.Editors/bin/raven/sqdev/editors/stringTableEditor/Language$1.class b/plugin/Raven.SQDev.Editors/bin/raven/sqdev/editors/stringTableEditor/Language$1.class deleted file mode 100644 index b1ae9acb..00000000 Binary files a/plugin/Raven.SQDev.Editors/bin/raven/sqdev/editors/stringTableEditor/Language$1.class and /dev/null differ diff --git a/plugin/Raven.SQDev.Editors/bin/raven/sqdev/editors/stringTableEditor/Language.class b/plugin/Raven.SQDev.Editors/bin/raven/sqdev/editors/stringTableEditor/Language.class deleted file mode 100644 index f62dd6f7..00000000 Binary files a/plugin/Raven.SQDev.Editors/bin/raven/sqdev/editors/stringTableEditor/Language.class and /dev/null differ diff --git a/plugin/Raven.SQDev.Editors/bin/raven/sqdev/editors/stringTableEditor/StringTableCellEditingSupport$1.class b/plugin/Raven.SQDev.Editors/bin/raven/sqdev/editors/stringTableEditor/StringTableCellEditingSupport$1.class deleted file mode 100644 index f59e0cb2..00000000 Binary files a/plugin/Raven.SQDev.Editors/bin/raven/sqdev/editors/stringTableEditor/StringTableCellEditingSupport$1.class and /dev/null differ diff --git a/plugin/Raven.SQDev.Editors/bin/raven/sqdev/editors/stringTableEditor/StringTableCellEditingSupport$2.class b/plugin/Raven.SQDev.Editors/bin/raven/sqdev/editors/stringTableEditor/StringTableCellEditingSupport$2.class deleted file mode 100644 index 338dc53a..00000000 Binary files a/plugin/Raven.SQDev.Editors/bin/raven/sqdev/editors/stringTableEditor/StringTableCellEditingSupport$2.class and /dev/null differ diff --git a/plugin/Raven.SQDev.Editors/bin/raven/sqdev/editors/stringTableEditor/StringTableCellEditingSupport.class b/plugin/Raven.SQDev.Editors/bin/raven/sqdev/editors/stringTableEditor/StringTableCellEditingSupport.class deleted file mode 100644 index 0bf30314..00000000 Binary files a/plugin/Raven.SQDev.Editors/bin/raven/sqdev/editors/stringTableEditor/StringTableCellEditingSupport.class and /dev/null differ diff --git a/plugin/Raven.SQDev.Editors/bin/raven/sqdev/editors/stringTableEditor/StringTableCellLabelProvider.class b/plugin/Raven.SQDev.Editors/bin/raven/sqdev/editors/stringTableEditor/StringTableCellLabelProvider.class deleted file mode 100644 index d9ec1d24..00000000 Binary files a/plugin/Raven.SQDev.Editors/bin/raven/sqdev/editors/stringTableEditor/StringTableCellLabelProvider.class and /dev/null differ diff --git a/plugin/Raven.SQDev.Editors/bin/raven/sqdev/editors/stringTableEditor/StringTableContainer.class b/plugin/Raven.SQDev.Editors/bin/raven/sqdev/editors/stringTableEditor/StringTableContainer.class deleted file mode 100644 index e9901bba..00000000 Binary files a/plugin/Raven.SQDev.Editors/bin/raven/sqdev/editors/stringTableEditor/StringTableContainer.class and /dev/null differ diff --git a/plugin/Raven.SQDev.Editors/bin/raven/sqdev/editors/stringTableEditor/StringTableContentProvider.class b/plugin/Raven.SQDev.Editors/bin/raven/sqdev/editors/stringTableEditor/StringTableContentProvider.class deleted file mode 100644 index 9ae39b6a..00000000 Binary files a/plugin/Raven.SQDev.Editors/bin/raven/sqdev/editors/stringTableEditor/StringTableContentProvider.class and /dev/null differ diff --git a/plugin/Raven.SQDev.Editors/bin/raven/sqdev/editors/stringTableEditor/StringTableEditor$1.class b/plugin/Raven.SQDev.Editors/bin/raven/sqdev/editors/stringTableEditor/StringTableEditor$1.class deleted file mode 100644 index ba62cbfc..00000000 Binary files a/plugin/Raven.SQDev.Editors/bin/raven/sqdev/editors/stringTableEditor/StringTableEditor$1.class and /dev/null differ diff --git a/plugin/Raven.SQDev.Editors/bin/raven/sqdev/editors/stringTableEditor/StringTableEditor$10.class b/plugin/Raven.SQDev.Editors/bin/raven/sqdev/editors/stringTableEditor/StringTableEditor$10.class deleted file mode 100644 index 23bcf98e..00000000 Binary files a/plugin/Raven.SQDev.Editors/bin/raven/sqdev/editors/stringTableEditor/StringTableEditor$10.class and /dev/null differ diff --git a/plugin/Raven.SQDev.Editors/bin/raven/sqdev/editors/stringTableEditor/StringTableEditor$11.class b/plugin/Raven.SQDev.Editors/bin/raven/sqdev/editors/stringTableEditor/StringTableEditor$11.class deleted file mode 100644 index 51005b9b..00000000 Binary files a/plugin/Raven.SQDev.Editors/bin/raven/sqdev/editors/stringTableEditor/StringTableEditor$11.class and /dev/null differ diff --git a/plugin/Raven.SQDev.Editors/bin/raven/sqdev/editors/stringTableEditor/StringTableEditor$12$1.class b/plugin/Raven.SQDev.Editors/bin/raven/sqdev/editors/stringTableEditor/StringTableEditor$12$1.class deleted file mode 100644 index 4a436404..00000000 Binary files a/plugin/Raven.SQDev.Editors/bin/raven/sqdev/editors/stringTableEditor/StringTableEditor$12$1.class and /dev/null differ diff --git a/plugin/Raven.SQDev.Editors/bin/raven/sqdev/editors/stringTableEditor/StringTableEditor$12.class b/plugin/Raven.SQDev.Editors/bin/raven/sqdev/editors/stringTableEditor/StringTableEditor$12.class deleted file mode 100644 index 6ccae7d4..00000000 Binary files a/plugin/Raven.SQDev.Editors/bin/raven/sqdev/editors/stringTableEditor/StringTableEditor$12.class and /dev/null differ diff --git a/plugin/Raven.SQDev.Editors/bin/raven/sqdev/editors/stringTableEditor/StringTableEditor$13.class b/plugin/Raven.SQDev.Editors/bin/raven/sqdev/editors/stringTableEditor/StringTableEditor$13.class deleted file mode 100644 index bd5f683e..00000000 Binary files a/plugin/Raven.SQDev.Editors/bin/raven/sqdev/editors/stringTableEditor/StringTableEditor$13.class and /dev/null differ diff --git a/plugin/Raven.SQDev.Editors/bin/raven/sqdev/editors/stringTableEditor/StringTableEditor$14.class b/plugin/Raven.SQDev.Editors/bin/raven/sqdev/editors/stringTableEditor/StringTableEditor$14.class deleted file mode 100644 index 0b2fde2e..00000000 Binary files a/plugin/Raven.SQDev.Editors/bin/raven/sqdev/editors/stringTableEditor/StringTableEditor$14.class and /dev/null differ diff --git a/plugin/Raven.SQDev.Editors/bin/raven/sqdev/editors/stringTableEditor/StringTableEditor$15.class b/plugin/Raven.SQDev.Editors/bin/raven/sqdev/editors/stringTableEditor/StringTableEditor$15.class deleted file mode 100644 index 32f3a3b5..00000000 Binary files a/plugin/Raven.SQDev.Editors/bin/raven/sqdev/editors/stringTableEditor/StringTableEditor$15.class and /dev/null differ diff --git a/plugin/Raven.SQDev.Editors/bin/raven/sqdev/editors/stringTableEditor/StringTableEditor$16.class b/plugin/Raven.SQDev.Editors/bin/raven/sqdev/editors/stringTableEditor/StringTableEditor$16.class deleted file mode 100644 index 889111fb..00000000 Binary files a/plugin/Raven.SQDev.Editors/bin/raven/sqdev/editors/stringTableEditor/StringTableEditor$16.class and /dev/null differ diff --git a/plugin/Raven.SQDev.Editors/bin/raven/sqdev/editors/stringTableEditor/StringTableEditor$17.class b/plugin/Raven.SQDev.Editors/bin/raven/sqdev/editors/stringTableEditor/StringTableEditor$17.class deleted file mode 100644 index 73b98b0e..00000000 Binary files a/plugin/Raven.SQDev.Editors/bin/raven/sqdev/editors/stringTableEditor/StringTableEditor$17.class and /dev/null differ diff --git a/plugin/Raven.SQDev.Editors/bin/raven/sqdev/editors/stringTableEditor/StringTableEditor$18.class b/plugin/Raven.SQDev.Editors/bin/raven/sqdev/editors/stringTableEditor/StringTableEditor$18.class deleted file mode 100644 index db13fd1f..00000000 Binary files a/plugin/Raven.SQDev.Editors/bin/raven/sqdev/editors/stringTableEditor/StringTableEditor$18.class and /dev/null differ diff --git a/plugin/Raven.SQDev.Editors/bin/raven/sqdev/editors/stringTableEditor/StringTableEditor$2.class b/plugin/Raven.SQDev.Editors/bin/raven/sqdev/editors/stringTableEditor/StringTableEditor$2.class deleted file mode 100644 index c6758a5a..00000000 Binary files a/plugin/Raven.SQDev.Editors/bin/raven/sqdev/editors/stringTableEditor/StringTableEditor$2.class and /dev/null differ diff --git a/plugin/Raven.SQDev.Editors/bin/raven/sqdev/editors/stringTableEditor/StringTableEditor$3$1.class b/plugin/Raven.SQDev.Editors/bin/raven/sqdev/editors/stringTableEditor/StringTableEditor$3$1.class deleted file mode 100644 index 0a577a25..00000000 Binary files a/plugin/Raven.SQDev.Editors/bin/raven/sqdev/editors/stringTableEditor/StringTableEditor$3$1.class and /dev/null differ diff --git a/plugin/Raven.SQDev.Editors/bin/raven/sqdev/editors/stringTableEditor/StringTableEditor$3$2.class b/plugin/Raven.SQDev.Editors/bin/raven/sqdev/editors/stringTableEditor/StringTableEditor$3$2.class deleted file mode 100644 index 4e64f892..00000000 Binary files a/plugin/Raven.SQDev.Editors/bin/raven/sqdev/editors/stringTableEditor/StringTableEditor$3$2.class and /dev/null differ diff --git a/plugin/Raven.SQDev.Editors/bin/raven/sqdev/editors/stringTableEditor/StringTableEditor$3.class b/plugin/Raven.SQDev.Editors/bin/raven/sqdev/editors/stringTableEditor/StringTableEditor$3.class deleted file mode 100644 index 006c7945..00000000 Binary files a/plugin/Raven.SQDev.Editors/bin/raven/sqdev/editors/stringTableEditor/StringTableEditor$3.class and /dev/null differ diff --git a/plugin/Raven.SQDev.Editors/bin/raven/sqdev/editors/stringTableEditor/StringTableEditor$4.class b/plugin/Raven.SQDev.Editors/bin/raven/sqdev/editors/stringTableEditor/StringTableEditor$4.class deleted file mode 100644 index fcd6662d..00000000 Binary files a/plugin/Raven.SQDev.Editors/bin/raven/sqdev/editors/stringTableEditor/StringTableEditor$4.class and /dev/null differ diff --git a/plugin/Raven.SQDev.Editors/bin/raven/sqdev/editors/stringTableEditor/StringTableEditor$5.class b/plugin/Raven.SQDev.Editors/bin/raven/sqdev/editors/stringTableEditor/StringTableEditor$5.class deleted file mode 100644 index bfabdb9c..00000000 Binary files a/plugin/Raven.SQDev.Editors/bin/raven/sqdev/editors/stringTableEditor/StringTableEditor$5.class and /dev/null differ diff --git a/plugin/Raven.SQDev.Editors/bin/raven/sqdev/editors/stringTableEditor/StringTableEditor$6.class b/plugin/Raven.SQDev.Editors/bin/raven/sqdev/editors/stringTableEditor/StringTableEditor$6.class deleted file mode 100644 index f6c1b8e2..00000000 Binary files a/plugin/Raven.SQDev.Editors/bin/raven/sqdev/editors/stringTableEditor/StringTableEditor$6.class and /dev/null differ diff --git a/plugin/Raven.SQDev.Editors/bin/raven/sqdev/editors/stringTableEditor/StringTableEditor$7.class b/plugin/Raven.SQDev.Editors/bin/raven/sqdev/editors/stringTableEditor/StringTableEditor$7.class deleted file mode 100644 index 7154abba..00000000 Binary files a/plugin/Raven.SQDev.Editors/bin/raven/sqdev/editors/stringTableEditor/StringTableEditor$7.class and /dev/null differ diff --git a/plugin/Raven.SQDev.Editors/bin/raven/sqdev/editors/stringTableEditor/StringTableEditor$8.class b/plugin/Raven.SQDev.Editors/bin/raven/sqdev/editors/stringTableEditor/StringTableEditor$8.class deleted file mode 100644 index a4f37e53..00000000 Binary files a/plugin/Raven.SQDev.Editors/bin/raven/sqdev/editors/stringTableEditor/StringTableEditor$8.class and /dev/null differ diff --git a/plugin/Raven.SQDev.Editors/bin/raven/sqdev/editors/stringTableEditor/StringTableEditor$9.class b/plugin/Raven.SQDev.Editors/bin/raven/sqdev/editors/stringTableEditor/StringTableEditor$9.class deleted file mode 100644 index 272e3063..00000000 Binary files a/plugin/Raven.SQDev.Editors/bin/raven/sqdev/editors/stringTableEditor/StringTableEditor$9.class and /dev/null differ diff --git a/plugin/Raven.SQDev.Editors/bin/raven/sqdev/editors/stringTableEditor/StringTableEditor.class b/plugin/Raven.SQDev.Editors/bin/raven/sqdev/editors/stringTableEditor/StringTableEditor.class deleted file mode 100644 index dd69e029..00000000 Binary files a/plugin/Raven.SQDev.Editors/bin/raven/sqdev/editors/stringTableEditor/StringTableEditor.class and /dev/null differ diff --git a/plugin/Raven.SQDev.Editors/bin/raven/sqdev/editors/stringTableEditor/StringTableKey.class b/plugin/Raven.SQDev.Editors/bin/raven/sqdev/editors/stringTableEditor/StringTableKey.class deleted file mode 100644 index 82b915e4..00000000 Binary files a/plugin/Raven.SQDev.Editors/bin/raven/sqdev/editors/stringTableEditor/StringTableKey.class and /dev/null differ diff --git a/plugin/Raven.SQDev.Editors/bin/raven/sqdev/editors/stringTableEditor/StringTablePackage.class b/plugin/Raven.SQDev.Editors/bin/raven/sqdev/editors/stringTableEditor/StringTablePackage.class deleted file mode 100644 index c21b1635..00000000 Binary files a/plugin/Raven.SQDev.Editors/bin/raven/sqdev/editors/stringTableEditor/StringTablePackage.class and /dev/null differ diff --git a/plugin/Raven.SQDev.Editors/bin/raven/sqdev/editors/stringTableEditor/StringTableSourceViewerConfiguration.class b/plugin/Raven.SQDev.Editors/bin/raven/sqdev/editors/stringTableEditor/StringTableSourceViewerConfiguration.class deleted file mode 100644 index 853ef9f2..00000000 Binary files a/plugin/Raven.SQDev.Editors/bin/raven/sqdev/editors/stringTableEditor/StringTableSourceViewerConfiguration.class and /dev/null differ diff --git a/plugin/Raven.SQDev.Editors/bin/raven/sqdev/editors/stringTableEditor/StringTableXMLEditor.class b/plugin/Raven.SQDev.Editors/bin/raven/sqdev/editors/stringTableEditor/StringTableXMLEditor.class deleted file mode 100644 index 36867fbb..00000000 Binary files a/plugin/Raven.SQDev.Editors/bin/raven/sqdev/editors/stringTableEditor/StringTableXMLEditor.class and /dev/null differ diff --git a/plugin/Raven.SQDev.Editors/bin/raven/sqdev/editors/stringtableParsing/StringTable.tokens b/plugin/Raven.SQDev.Editors/bin/raven/sqdev/editors/stringtableParsing/StringTable.tokens deleted file mode 100644 index 3002f98e..00000000 --- a/plugin/Raven.SQDev.Editors/bin/raven/sqdev/editors/stringtableParsing/StringTable.tokens +++ /dev/null @@ -1,19 +0,0 @@ -PROJECT=6 -EQUALS=5 -CLOSE=4 -ANY=15 -PKG=8 -OPEN=3 -NAME=7 -OPEN_CLOSE=2 -CONTAINER=9 -STRING=12 -IDENTIFIER=11 -ID=13 -WS=14 -INFO_TAG=1 -KEY=10 -'>'=4 -'='=5 -'<'=3 -''=4 -'='=5 -'<'=3 -'ParseTree representing the input of this editor + * Gets the {@linkplain IParseResult} representing the input of this editor * - * @return The ParseTree or null if none has been set + * @return The result or null if none has been set * so far */ - public ParseTree getParseTree() { - return parseTree; + public IParseResult getParseResult() { + return parseResult; } /** @@ -360,8 +360,8 @@ public List getParseRuleNames() { } /** - * This is a helper method that will do the parsing for the given input wihtout - * any checks (whetehr there is an active parsing job) and in the same thread as + * This is a helper method that will do the parsing for the given input without + * any checks (whether there is an active parsing job) and in the same thread as * it is called * * @param input @@ -370,7 +370,7 @@ public List getParseRuleNames() { */ private IStatus startParsingInput(String input) { // preprocess - doPreprocessorParsing(input); + doPreprocessorParsing(new ByteArrayInputStream(input.getBytes())); // check if this parsing should be cancelled synchronized (parsingIsCancelled) { @@ -381,7 +381,7 @@ private IStatus startParsingInput(String input) { } // parse - ParseTree output = doParse(input); + IParseResult output = doParse(new ByteArrayInputStream(input.getBytes())); // check if this parsing should be cancelled synchronized (parsingIsCancelled) { @@ -391,14 +391,17 @@ private IStatus startParsingInput(String input) { } } - if (output == null || output.getChildCount() == 0) { + if (output == null + || output.getMarkers().stream().filter((element) -> element.getSeverity() == IMarker.SEVERITY_ERROR) + .collect(Collectors.toList()).size() > 0) { + // don't process the parse tree if errors came up during lexing/parsing applyParseChanges(); return Status.CANCEL_STATUS; } else { - parseTree = output; + parseResult = output; - if (!processParseTree(parseTree)) { + if (!processParseTree(parseResult)) { applyParseChanges(); } @@ -433,30 +436,29 @@ public boolean parseInput(boolean suspend) { return false; } - String input = document.get(); + String content = document.get(); - if (input == null) { + if (content == null) { return false; } synchronized (parsingIsCancelled) { if (parsingIsCancelled && (parseJob == null || parseJob.getResult() != null)) { // There is no other parsing in progress that should be - // cancelled and cancelling is only possible after having + // cancelled and canceling is only possible after having // initialized it parsingIsCancelled = false; } } if (parseJob != null && parseJob.getState() != Job.NONE) { - // Ther previous Job is still running -> reschedule + // The previous Job is still running -> reschedule parseJob.addJobChangeListener(new JobChangeAdapter() { @Override public void done(IJobChangeEvent event) { // As there has been a request to parse the input again - // do - // it now as the old parsing process is finished + // do it now as the old parsing process is finished parseInput(); } }); @@ -465,13 +467,13 @@ public void done(IJobChangeEvent event) { } if (suspend) { - startParsingInput(input); + startParsingInput(content); } else { parseJob = new Job("Parsing \"" + getEditorInput().getName() + "\"...") { @Override protected IStatus run(IProgressMonitor monitor) { - return startParsingInput(input); + return startParsingInput(content); } }; @@ -514,10 +516,17 @@ public void cancelParsing() { * and sets the found macros if this editor is an instance of * IMacroSupport. */ - protected void doPreprocessorParsing(String input) { + protected void doPreprocessorParsing(InputStream input) { if (this instanceof IMacroSupport && getEditorInput() instanceof IFileEditorInput) { - PreprocessorParseResult result = ParseUtil.parseAndValidatePreprocess(input, - ((IFileEditorInput) getEditorInput()).getFile().getLocation()); + PreprocessorParseResult result; + try { + result = ParseUtil.parseAndValidatePreprocess(input, + ((IFileEditorInput) getEditorInput()).getFile().getLocation()); + } catch (IOException e) { + e.printStackTrace(); + createMarker(IMarker.PROBLEM, 0, 0, "Unable to preprocess the file", IMarker.SEVERITY_ERROR); + return; + } ((IMacroSupport) this).setMacros(result.getMacros(), true); @@ -533,18 +542,18 @@ protected void doPreprocessorParsing(String input) { * Note: You might want to call {@link #applyParseChanges()} after the * processing * - * @param tree - * The generated tree + * @param parseResult + * The generated parse result * @return Whether this function has called {@link #applyParseChanges()}. If not * the default implementation of {@link #parseInput()} will call this * function afterwards. */ - protected boolean processParseTree(ParseTree parseTree) { + protected boolean processParseTree(IParseResult parseResult) { return false; } /** - * Parses the input of this editor in order to set the {@link #parseTree} for + * Parses the input of this editor in order to set the {@link #parseResult} for * this editor.
* Note: You might want to call {@link #applyParseChanges()} after parsing (or * rather after {@link #processParseTree(ParseTree)}.
@@ -559,7 +568,7 @@ protected boolean processParseTree(ParseTree parseTree) { * parsing failed (if not overridden by subclasses this method always * returns null */ - protected ParseTree doParse(String input) { + protected IParseResult doParse(InputStream input) { // parsing diabled return null; } @@ -573,8 +582,7 @@ protected ParseTree doParse(String input) { */ protected void createManagers(List managerList) { // add folding manager - managerList.add(new BasicFoldingManager( - ((ProjectionViewer) getSourceViewer()).getProjectionAnnotationModel())); + managerList.add(new BasicFoldingManager(((ProjectionViewer) getSourceViewer()).getProjectionAnnotationModel())); // add marker manager managerList.add(new BasicMarkerManager(this)); } @@ -598,8 +606,8 @@ public void createMarker(String type, int offset, int length, String message, in } } - ((BasicMarkerManager) getManager(BasicMarkerManager.TYPE)).addMarker(type, line, offset, length, - severity, message); + ((BasicMarkerManager) getManager(BasicMarkerManager.TYPE)).addMarker(type, line, offset, length, severity, + message); } @Override @@ -651,8 +659,8 @@ public void addFoldingArea(Position position) { // don't fold if the code is only one line long try { - if (doc == null || doc.getLineOfOffset(position.offset) == doc - .getLineOfOffset(position.offset + position.length)) { + if (doc == null + || doc.getLineOfOffset(position.offset) == doc.getLineOfOffset(position.offset + position.length)) { return; } } catch (BadLocationException e) { @@ -666,15 +674,14 @@ public void addFoldingArea(Position position) { ProjectionAnnotation annotation = new ProjectionAnnotation(); - BasicFoldingManager foldingManager = (BasicFoldingManager) getManager( - BasicFoldingManager.getManagerType()); + BasicFoldingManager foldingManager = (BasicFoldingManager) getManager(BasicFoldingManager.getManagerType()); if (foldingManager == null) { return; } - foldingManager.addFoldingArea( - new AbstractMap.SimpleEntry(annotation, position)); + foldingManager + .addFoldingArea(new AbstractMap.SimpleEntry(annotation, position)); } /** diff --git a/plugin/Raven.SQDev.Editors/src/raven/sqdev/editors/BasicContentAssistProcessor.java b/plugin/Raven.SQDev.Editors/src/raven/sqdev/editors/BasicContentAssistProcessor.java index c083ba77..83bc8479 100644 --- a/plugin/Raven.SQDev.Editors/src/raven/sqdev/editors/BasicContentAssistProcessor.java +++ b/plugin/Raven.SQDev.Editors/src/raven/sqdev/editors/BasicContentAssistProcessor.java @@ -1,7 +1,10 @@ package raven.sqdev.editors; import java.util.ArrayList; -import java.util.List; +import java.util.Map; +import java.util.function.Consumer; +import java.util.function.Predicate; +import java.util.stream.Stream; import org.eclipse.jface.text.ITextViewer; import org.eclipse.jface.text.contentassist.CompletionProposal; @@ -33,26 +36,32 @@ public BasicContentAssistProcessor(BasicCodeEditor editor) { @Override public ICompletionProposal[] computeCompletionProposals(ITextViewer viewer, int offset) { - String prefix = EditorUtil.getWordPartBeforeOffset(viewer.getDocument(), offset); + String prefix = EditorUtil.getWordPartBeforeOffset(viewer.getDocument(), offset).toLowerCase(); - List keywords; - // get the respective list of keywords - if (prefix.isEmpty()) { - keywords = editor.getBasicConfiguration().getAllConfiguredKeywords(); - } else { - keywords = editor.getBasicConfiguration().getConfiguredKeywordsFor(prefix.charAt(0)); - } + Map keywords = editor.getBasicConfiguration().getAllConfiguredKeywords(); ArrayList proposals = new ArrayList(); // create proposals - for (Keyword currentKeyword : keywords) { - if (currentKeyword.getKeyword().toLowerCase().startsWith(prefix.toLowerCase())) { + Stream keywordStream = keywords.values().stream().filter(new Predicate() { + + @Override + public boolean test(Keyword keyword) { + return keyword.getKeyword().toLowerCase().startsWith(prefix); + } + }); + + keywordStream = keywordStream.sorted(); + + keywordStream.forEachOrdered(new Consumer() { + + @Override + public void accept(Keyword keyword) { // add a proposal - proposals.add(new BasicCompletionProposal(currentKeyword, offset - prefix.length(), + proposals.add(new BasicCompletionProposal(keyword, offset - prefix.length(), prefix.length())); } - } + }); if (proposals.size() > 0) { return proposals.toArray(new ICompletionProposal[proposals.size()]); diff --git a/plugin/Raven.SQDev.Editors/src/raven/sqdev/editors/BasicParseTimeListener.java b/plugin/Raven.SQDev.Editors/src/raven/sqdev/editors/BasicParseTimeListener.java index 94e28fd5..cabc605c 100644 --- a/plugin/Raven.SQDev.Editors/src/raven/sqdev/editors/BasicParseTimeListener.java +++ b/plugin/Raven.SQDev.Editors/src/raven/sqdev/editors/BasicParseTimeListener.java @@ -12,7 +12,7 @@ import raven.sqdev.misc.SQDevPreferenceUtil; /** - * This listener will cause the editor to reparse it's input when the user + * This listener will cause the editor to re-parse its input when the user * stopped typing for a longer time * * @author Raven diff --git a/plugin/Raven.SQDev.Editors/src/raven/sqdev/editors/BasicSourceViewerConfiguration.java b/plugin/Raven.SQDev.Editors/src/raven/sqdev/editors/BasicSourceViewerConfiguration.java index d1e833f2..1c4a1880 100644 --- a/plugin/Raven.SQDev.Editors/src/raven/sqdev/editors/BasicSourceViewerConfiguration.java +++ b/plugin/Raven.SQDev.Editors/src/raven/sqdev/editors/BasicSourceViewerConfiguration.java @@ -36,14 +36,13 @@ * @see {@linkplain SourceViewerConfiguration} * */ -public class BasicSourceViewerConfiguration extends SourceViewerConfiguration - implements IPropertyChangeListener { - +public class BasicSourceViewerConfiguration extends SourceViewerConfiguration implements IPropertyChangeListener { + /** * The color manager */ protected ColorManager colorManager; - + /** * The configured keywordScanner providing the keywords for the syntax * highlighting
@@ -51,109 +50,98 @@ public class BasicSourceViewerConfiguration extends SourceViewerConfiguration * their keyword highlighting */ protected Map configuredKeywordScanners; - + /** * The MultiKeywordScanner that will be applied for this * SourceViewerConfiguration */ protected MultiKeywordScanner multiScanner; - + /** * The editor this SourceViewer is applied on */ protected BasicCodeEditor editor; - + /** * The contentAssistant for this editor */ protected ContentAssistant assistant; - + public BasicSourceViewerConfiguration(ColorManager manager, BasicCodeEditor editor) { this.setColorManager(manager); this.editor = editor; - + this.configuredKeywordScanners = new HashMap(); this.multiScanner = new MultiKeywordScanner(editor); - + // register to get notified about preference changes SQDevPreferenceUtil.getPreferenceStore().addPropertyChangeListener(this); } - + @Override public String[] getConfiguredContentTypes(ISourceViewer sourceViewer) { return editor.getBasicProvider().getPartitionScanner().getConfiguredContentTypes(); } - + public ColorManager getColorManager() { return colorManager; } - + public void setColorManager(ColorManager colorManager) { this.colorManager = colorManager; } - + /** * Gets all configured Keywords */ - public List getAllConfiguredKeywords() { + public List getAllConfiguredKeywordsAsList() { ArrayList keywordList = new ArrayList(); - - Iterator> iterator = configuredKeywordScanners.entrySet() - .iterator(); - + + Iterator> iterator = configuredKeywordScanners.entrySet().iterator(); + while (iterator.hasNext()) { // add the respective keywords to the list - keywordList.addAll( - iterator.next().getValue().getKeywordProvider().getKeywordList().getKeywords()); + keywordList.addAll(iterator.next().getValue().getKeywordProvider().getKeywordList().getKeywords().values()); } - + return keywordList; } - + /** - * Gets a list of all configured Keywords starting with the given character - * - * @param c - * The starting charcter + * Gets all configured Keywords */ - public List getConfiguredKeywordsFor(char c) { - ArrayList keywordList = new ArrayList(); - - Iterator> iterator = configuredKeywordScanners.entrySet() - .iterator(); - - while (iterator.hasNext()) { - // add the respective keywords to the list - keywordList.addAll( - iterator.next().getValue().getKeywordProvider().getKeywordList().getListFor(c)); + public Map getAllConfiguredKeywords() { + Map keywords = new HashMap<>(); + + for (KeywordScanner currentScanner : configuredKeywordScanners.values()) { + keywords.putAll(currentScanner.getKeywordProvider().getKeywordList().getKeywords()); } - - return keywordList; + + return keywords; } - + /** * Gets the keywordScanner for this configuration * * @param colorPreferenceKey * The preference key for the color of the desired * KeywordScanner - * @return The KeywordScanner working for the given preference - * key or null if no such scanner could be found + * @return The KeywordScanner working for the given preference key + * or null if no such scanner could be found */ public KeywordScanner getKeywordScanner(String colorPreferenceKey) { if (!configuredKeywordScanners.containsKey(colorPreferenceKey)) { return null; } - + // return scanner return configuredKeywordScanners.get(colorPreferenceKey); } - + /** - * Creates a KeywordScanner for the given preference key that - * is automatically registered to this - * BasicSourceViewerConfiguration if there is no other scanner - * for that key + * Creates a KeywordScanner for the given preference key that is + * automatically registered to this BasicSourceViewerConfiguration + * if there is no other scanner for that key * * @param colorPreferenceKey * The key the scanner should be configured for @@ -163,20 +151,19 @@ public KeywordScanner getKeywordScanner(String colorPreferenceKey) { public void createKeywordScanner(String colorPreferenceKey, boolean caseSensitive) { if (!configuredKeywordScanners.containsKey(colorPreferenceKey)) { // create new scanner - KeywordScanner scanner = new KeywordScanner(new BasicKeywordProvider(), - colorPreferenceKey, this.editor); - + KeywordScanner scanner = new KeywordScanner(new BasicKeywordProvider(), colorPreferenceKey, this.editor); + if (!caseSensitive) { scanner.makeCaseSensitive(caseSensitive); } - + configuredKeywordScanners.put(colorPreferenceKey, scanner); - + // add to multiScanner multiScanner.addScanner(scanner); } } - + /** * Checks if a KeywordScanner for the given preference key does * exist in this BasicSourceViewerConfiguration @@ -187,80 +174,77 @@ public void createKeywordScanner(String colorPreferenceKey, boolean caseSensitiv public boolean scannerExists(String colorPreferenceKey) { return configuredKeywordScanners.containsKey(colorPreferenceKey); } - + /** * Gets the KeywordScanner that contains the given * Keyword * * @param keyword * The Keyword to search for - * @return The matching KeywordScanner or null if - * none could be found + * @return The matching KeywordScanner or null if none + * could be found */ public KeywordScanner getKeywordScannerContaining(Keyword keyword) { - Iterator> iterator = configuredKeywordScanners.entrySet() - .iterator(); - + Iterator> iterator = configuredKeywordScanners.entrySet().iterator(); + while (iterator.hasNext()) { KeywordScanner currentScanner = iterator.next().getValue(); - + if (currentScanner.contains(keyword)) { return currentScanner; } } - + return null; } - + /** * Gets the KeywordScanner that contains a Keyword * matching the given word * * @param word * The word to search for - * @return The matching KeywordScanner or null if - * none could be found + * @return The matching KeywordScanner or null if none + * could be found */ public KeywordScanner getKeywordScannerContaining(String word) { - Iterator> iterator = configuredKeywordScanners.entrySet() - .iterator(); - + Iterator> iterator = configuredKeywordScanners.entrySet().iterator(); + while (iterator.hasNext()) { KeywordScanner currentScanner = iterator.next().getValue(); - + if (currentScanner.contains(word)) { return currentScanner; } } - + return null; } - + @Override public IPresentationReconciler getPresentationReconciler(ISourceViewer sourceViewer) { PresentationReconciler reconciler = new PresentationReconciler(); - + // syntax highlighting for keywords DefaultDamagerRepairer dr_Default = new DefaultDamagerRepairer(multiScanner); reconciler.setDamager(dr_Default, IDocument.DEFAULT_CONTENT_TYPE); reconciler.setRepairer(dr_Default, IDocument.DEFAULT_CONTENT_TYPE); - + boolean containsString = false; boolean containsComment = false; - - for (String currentType : editor.getBasicProvider().getPartitionScanner() - .getConfiguredContentTypes()) { + + for (String currentType : editor.getBasicProvider().getPartitionScanner().getConfiguredContentTypes()) { switch (currentType) { - case BasicPartitionScanner.BASIC_STRING: - containsString = true; - break; - - case BasicPartitionScanner.BASIC_COMMENT: - containsComment = true; - break; + case BasicPartitionScanner.BASIC_STRING: + containsString = true; + break; + + case BasicPartitionScanner.BASIC_COMMENT: + containsComment = true; + break; } } - + if (containsString) { // colorize strings NonRuleBasedDamagerRepairer ndr_String = new NonRuleBasedDamagerRepairer( @@ -268,7 +252,7 @@ public IPresentationReconciler getPresentationReconciler(ISourceViewer sourceVie reconciler.setDamager(ndr_String, BasicPartitionScanner.BASIC_STRING); reconciler.setRepairer(ndr_String, BasicPartitionScanner.BASIC_STRING); } - + if (containsComment) { // colorize comments NonRuleBasedDamagerRepairer ndr_Comment = new NonRuleBasedDamagerRepairer( @@ -276,58 +260,58 @@ public IPresentationReconciler getPresentationReconciler(ISourceViewer sourceVie reconciler.setDamager(ndr_Comment, BasicPartitionScanner.BASIC_COMMENT); reconciler.setRepairer(ndr_Comment, BasicPartitionScanner.BASIC_COMMENT); } - + return reconciler; } - + @Override public IContentAssistant getContentAssistant(ISourceViewer viewer) { assistant = new ContentAssistant(); assistant.enableAutoInsert(SQDevPreferenceUtil.isAutoCompleteEnabled()); assistant.enableColoredLabels(true); - + IContentAssistProcessor processor = new BasicContentAssistProcessor(editor); - + assistant.setContentAssistProcessor(processor, IDocument.DEFAULT_CONTENT_TYPE); - + assistant.setInformationControlCreator(getInformationControlCreator(viewer)); - + return assistant; } - + @Override public ITextHover getTextHover(ISourceViewer sv, String contentType) { return new BasicTextHover(editor); } - + @Override public IAnnotationHover getAnnotationHover(ISourceViewer sourceViewer) { return new DefaultAnnotationHover(); } - + @Override public void propertyChange(PropertyChangeEvent event) { if (event.getNewValue() == null) { // if there is no useful new value just ignore it return; } - + // watch out for a change concerning the autoCompletion switch (event.getProperty()) { - case SQDevPreferenceConstants.SQDEV_EDITOR_ENABLE_AUTOCOMPLETE_KEY: - assistant.enableAutoActivation((boolean) event.getNewValue()); - break; - - default: - if (configuredKeywordScanners.containsKey(event.getProperty())) { - // configure respective keyword scanner - configuredKeywordScanners.get(event.getProperty()).syncToPropertyChange(event); - } else { - // don't update editor - return; - } + case SQDevPreferenceConstants.SQDEV_EDITOR_ENABLE_AUTOCOMPLETE_KEY: + assistant.enableAutoActivation((boolean) event.getNewValue()); + break; + + default: + if (configuredKeywordScanners.containsKey(event.getProperty())) { + // configure respective keyword scanner + configuredKeywordScanners.get(event.getProperty()).syncToPropertyChange(event); + } else { + // don't update editor + return; + } } - + editor.update(true); } } diff --git a/plugin/Raven.SQDev.Editors/src/raven/sqdev/editors/BasicTextHover.java b/plugin/Raven.SQDev.Editors/src/raven/sqdev/editors/BasicTextHover.java index 062018f1..8b00fce8 100644 --- a/plugin/Raven.SQDev.Editors/src/raven/sqdev/editors/BasicTextHover.java +++ b/plugin/Raven.SQDev.Editors/src/raven/sqdev/editors/BasicTextHover.java @@ -13,17 +13,16 @@ import raven.sqdev.miscellaneous.AdditionalKeywordProposalInformation; import raven.sqdev.util.EditorUtil; -public class BasicTextHover - implements ITextHover, ITextHoverExtension, ITextHoverExtension2 { - +public class BasicTextHover implements ITextHover, ITextHoverExtension, ITextHoverExtension2 { + /** * The editor this assist works on */ private BasicCodeEditor editor; - + /** - * Creates an instance of this hover assist that will use the keywords of - * the given editor as a foundation + * Creates an instance of this hover assist that will use the keywords of the + * given editor as a foundation * * @param editor * The editor this assist works on @@ -31,56 +30,53 @@ public class BasicTextHover public BasicTextHover(BasicCodeEditor editor) { this.editor = editor; } - + @Override public String getHoverInfo(ITextViewer textViewer, IRegion hoverRegion) { // won't get called return null; } - + @Override public IRegion getHoverRegion(ITextViewer textViewer, int offset) { return new Region(offset, 0); } - + @Override public IInformationControlCreator getHoverControlCreator() { return new IInformationControlCreator() { - + @Override public IInformationControl createInformationControl(Shell parent) { return new BasicInformationControl(parent, false); } }; } - + @Override public Object getHoverInfo2(ITextViewer textViewer, IRegion hoverRegion) { // get the respective word - String word = EditorUtil.getWordAroundOffset(textViewer.getDocument(), - hoverRegion.getOffset()); - + String word = EditorUtil.getWordAroundOffset(textViewer.getDocument(), hoverRegion.getOffset()); + AdditionalKeywordProposalInformation info = null; - + if (!word.isEmpty()) { // check if there is a corresponding keyword - KeywordScanner scanner = editor.getBasicConfiguration() - .getKeywordScannerContaining(word); - + KeywordScanner scanner = editor.getBasicConfiguration().getKeywordScannerContaining(word); + if (scanner != null) { // create the info for this keyword info = new AdditionalKeywordProposalInformation( - scanner.getKeywordProvider().getKeywordList() - .getKeyword(word, scanner.isCaseSensitive())); - - if(info.isEmpty()) { + scanner.getKeywordProvider().getKeywordList().getKeyword(word)); + + if (info.isEmpty()) { // There isn't actually information to display info = null; } } } - + return info; } - + } diff --git a/plugin/Raven.SQDev.Editors/src/raven/sqdev/editors/KeywordScanner.java b/plugin/Raven.SQDev.Editors/src/raven/sqdev/editors/KeywordScanner.java index 84279b51..88c5c84c 100644 --- a/plugin/Raven.SQDev.Editors/src/raven/sqdev/editors/KeywordScanner.java +++ b/plugin/Raven.SQDev.Editors/src/raven/sqdev/editors/KeywordScanner.java @@ -2,6 +2,7 @@ import java.util.ArrayList; import java.util.List; +import java.util.Map; import org.eclipse.core.runtime.Assert; import org.eclipse.jface.text.TextAttribute; @@ -33,78 +34,74 @@ * @author Raven * */ -public class KeywordScanner extends RuleBasedScanner - implements IKeywordListChangeListener { +public class KeywordScanner extends RuleBasedScanner implements IKeywordListChangeListener { /** * The preferenceKey for the color of the token */ protected String preferenceKey; - + /** * The keyworProvider for this token */ protected IKeywordProvider provider; - + /** * The editor this scanner is working for */ protected BasicCodeEditor editor; - + /** * The token this scanner produces */ protected IToken token; - + /** * The default token the corrsponding WordRule will use */ protected IToken defaultToken; - + /** * indicates whether the keywords should be matched case sensitively */ protected boolean caseSensitive; - + /** * A list of IKeywordListChangeListeners */ protected List keywordListListeners; - + /** * A list of IUpdateListener */ protected List updateListeners; - + /** - * Indicates whether this scanner is part of a - * MultiKeywordScanner + * Indicates whether this scanner is part of a MultiKeywordScanner */ protected boolean isPartOfMultiScanner; - + /** * Creates an instance of this scanner * * @param provider - * An IKeyowrdProvider that will supply this method - * with keywords + * An IKeyowrdProvider that will supply this method with + * keywords * @param colorPreferenceKey - * The key of the preference describing the color of the - * highlighting of the keywords + * The key of the preference describing the color of the highlighting + * of the keywords * @param editor * The editor this scanner is working on * @param caseSensitive * Whether or not to match keywords case sensitive */ - public KeywordScanner(IKeywordProvider provider, String colorPreferenceKey, - BasicCodeEditor editor, boolean caseSensitive) { - String strColor = SQDevPreferenceUtil.getPreferenceStore() - .getString(colorPreferenceKey); - + public KeywordScanner(IKeywordProvider provider, String colorPreferenceKey, BasicCodeEditor editor, + boolean caseSensitive) { + String strColor = SQDevPreferenceUtil.getPreferenceStore().getString(colorPreferenceKey); + if (strColor == null || strColor.isEmpty()) { - throw new IllegalArgumentException( - "Invalid preference key \"" + colorPreferenceKey + "\""); + throw new IllegalArgumentException("Invalid preference key \"" + colorPreferenceKey + "\""); } - + // assign variables preferenceKey = colorPreferenceKey; this.provider = provider; @@ -113,58 +110,55 @@ public KeywordScanner(IKeywordProvider provider, String colorPreferenceKey, defaultToken = Token.UNDEFINED; keywordListListeners = new ArrayList(); updateListeners = new ArrayList(); - - Color color = new Color(Display.getCurrent(), - ColorUtils.decodeRGB(strColor)); - + + Color color = new Color(Display.getCurrent(), ColorUtils.decodeRGB(strColor)); + token = new Token(new TextAttribute(color, null, SWT.BOLD)); - + updateRules(provider.getKeywordList().getKeywords().size() > 0); - + // add this as a listener for the keyword provider this.provider.addKeywordListChangeListener(this); } - + /** * Creates an instance of this scanner (case sensitive) * * @param provider - * An IKeyowrdProvider that will supply this method - * with keywords + * An IKeyowrdProvider that will supply this method with + * keywords * @param colorPreferenceKey - * The key of the preference describing the color of the - * highlighting of the keywords + * The key of the preference describing the color of the highlighting + * of the keywords * @param editor * The editor this scanner is working on */ - public KeywordScanner(IKeywordProvider provider, String colorPreferenceKey, - BasicCodeEditor editor) { + public KeywordScanner(IKeywordProvider provider, String colorPreferenceKey, BasicCodeEditor editor) { this(provider, colorPreferenceKey, editor, true); } - + /** - * Synchronizes this scanner to a PropertyChangeEvent (adjusts the color of - * the highlighting + * Synchronizes this scanner to a PropertyChangeEvent (adjusts the color of the + * highlighting * * @param event - * The respective PropertyChangeEvent. Must be the same as the - * one this scanner has been initialized with + * The respective PropertyChangeEvent. Must be the same as the one + * this scanner has been initialized with */ public void syncToPropertyChange(PropertyChangeEvent event) { if (event.getProperty().equals(preferenceKey)) { // if the changed property is the one for the color this scanner // depends on if (event.getNewValue() != null) { - Color color = new Color(Display.getCurrent(), - ColorUtils.decodeRGB((String) event.getNewValue())); - + Color color = new Color(Display.getCurrent(), ColorUtils.decodeRGB((String) event.getNewValue())); + token = new Token(new TextAttribute(color, null, SWT.BOLD)); - + updateRules(true); } } } - + /** * Will update the applied rules for this scanner according to the * keywordProvider and the {@link #token}.
@@ -174,33 +168,30 @@ public void syncToPropertyChange(PropertyChangeEvent event) { * Indicates if the editor shoukd be updated */ protected void updateRules(boolean updateEditor) { - ArrayList keywordList = provider.getKeywordList() - .getKeywords(); - - Keyword[] keywords = keywordList - .toArray(new Keyword[keywordList.size()]); - + Map keywordList = provider.getKeywordList().getKeywords(); + + Keyword[] keywords = keywordList.values().toArray(new Keyword[keywordList.size()]); + // create the respective WordRule - WordRule keywordRule = new WordRule(new WordDetector(), - getDefaultToken(), !isCaseSensitive()); - + WordRule keywordRule = new WordRule(new WordDetector(), getDefaultToken(), !isCaseSensitive()); + // add keywords for (Keyword currentKeyword : keywords) { keywordRule.addWord(currentKeyword.getKeyword(), token); } - + IRule[] rules = { keywordRule }; - + this.setRules(rules); - + if (!isPartOfMultiScanner && updateEditor) { // only update editor if this scanner is autonomous editor.update(false); } - + notifyUpdateListener(); } - + /** * Gets the rule for this KeywordScanner that describes which * keywords to color in the respective color of this scanner @@ -212,33 +203,31 @@ public IRule getRule() { if (fRules == null || fRules.length == 0) { return null; } - + return fRules[0]; } - + /** * Gets the keywordProvider of this scanner */ public IKeywordProvider getKeywordProvider() { return provider; } - + /** - * Sets the keywordProvider for this scanner and updates the editor - * accordingly + * Sets the keywordProvider for this scanner and updates the editor accordingly * * @param provider * The new keywordProvider */ public void setKeywordProvider(IKeywordProvider provider) { this.provider = provider; - + updateRules(true); - - notifyKeywordListChangeListeners( - IKeywordListChangeListener.CTX_LIST_REMOVED); + + notifyKeywordListChangeListeners(IKeywordListChangeListener.CTX_LIST_REMOVED); } - + /** * Sets the keywords for this scanner * @@ -248,14 +237,13 @@ public void setKeywordProvider(IKeywordProvider provider) { public void setKeywords(KeywordList list) { IKeywordProvider provider = getKeywordProvider(); provider.setKeywordList(list); - + setKeywordProvider(provider); - + // notify listeners about change - notifyKeywordListChangeListeners( - IKeywordListChangeListener.CTX_LIST_CHANGED); + notifyKeywordListChangeListeners(IKeywordListChangeListener.CTX_LIST_CHANGED); } - + /** * Gets the token of this scanner */ @@ -263,19 +251,18 @@ public IToken getToken() { if (token == null) { token = new Token(new TextAttribute(getColor(), null, SWT.BOLD)); } - + return token; } - + /** * Gets the color for the token of this keywordScanner */ protected Color getColor() { return new Color(Display.getCurrent(), - ColorUtils.decodeRGB(SQDevPreferenceUtil.getPreferenceStore() - .getString(preferenceKey))); + ColorUtils.decodeRGB(SQDevPreferenceUtil.getPreferenceStore().getString(preferenceKey))); } - + /** * Sets whether the keywords should be matched case sensitively * @@ -284,31 +271,31 @@ protected Color getColor() { */ public void makeCaseSensitive(boolean sensitive) { caseSensitive = sensitive; - + // apply changes updateRules(true); } - + /** * Checks whether this scanner matches keywords case sensitivelys */ public boolean isCaseSensitive() { return caseSensitive; } - + /** - * Sets the default token the WordRule corresponding to this KeywordScanner - * will use as the default token + * Sets the default token the WordRule corresponding to this KeywordScanner will + * use as the default token * * @param token * The new default token */ public void setDefaultToken(IToken token) { Assert.isNotNull(token); - + defaultToken = token; } - + /** * Gets the default token of this KeywordScanner * @@ -317,7 +304,7 @@ public void setDefaultToken(IToken token) { public IToken getDefaultToken() { return defaultToken; } - + /** * Checks whether this KeywordScanner contains the given * Keyword @@ -328,7 +315,7 @@ public IToken getDefaultToken() { public boolean contains(Keyword keyword) { return getKeywordProvider().getKeywordList().contains(keyword); } - + /** * Checks whether this KeywordScanner contains a * Keyword matching the given word @@ -337,10 +324,9 @@ public boolean contains(Keyword keyword) { * The word to search for */ public boolean contains(String word) { - return getKeywordProvider().getKeywordList().getKeyword(word, - isCaseSensitive()) != null; + return getKeywordProvider().getKeywordList().getKeyword(word) != null; } - + /** * Notifies all IKeywordListChangeListeners * @@ -352,7 +338,7 @@ protected void notifyKeywordListChangeListeners(String ctx) { listener.keywordListChanged(ctx); } } - + /** * Notifies all IUpdateListeners */ @@ -361,32 +347,30 @@ protected void notifyUpdateListener() { listener.updated(); } } - + /** - * Adds the given IKeywordListChangeListener if it is not - * already registered + * Adds the given IKeywordListChangeListener if it is not already + * registered * * @param listener * The listener to add */ - public void addKeywordListChangeListener( - IKeywordListChangeListener listener) { + public void addKeywordListChangeListener(IKeywordListChangeListener listener) { if (!keywordListListeners.contains(listener)) { keywordListListeners.add(listener); } } - + /** * Removes the given IKeywordListChangeListener * * @param listener * The listener to remove */ - public void removeKeywordListChangeListener( - IKeywordListChangeListener listener) { + public void removeKeywordListChangeListener(IKeywordListChangeListener listener) { keywordListListeners.remove(listener); } - + /** * Adds the given listener if it is not already added * @@ -398,7 +382,7 @@ public void addUpdateListener(IUpdateListener listener) { updateListeners.add(listener); } } - + /** * Removes the given listener * @@ -408,15 +392,15 @@ public void addUpdateListener(IUpdateListener listener) { public void removeUpdateListener(IUpdateListener listener) { updateListeners.remove(listener); } - + @Override public void keywordListChanged(String ctx) { if (ctx.equals(IKeywordListChangeListener.CTX_LIST_CHANGED)) { // update rules - + updateRules(true); } - + // forward event notifyKeywordListChangeListeners(ctx); } diff --git a/plugin/Raven.SQDev.Editors/src/raven/sqdev/editors/activator/Activator.java b/plugin/Raven.SQDev.Editors/src/raven/sqdev/editors/activator/Activator.java index efeed618..29b8705e 100644 --- a/plugin/Raven.SQDev.Editors/src/raven/sqdev/editors/activator/Activator.java +++ b/plugin/Raven.SQDev.Editors/src/raven/sqdev/editors/activator/Activator.java @@ -5,7 +5,7 @@ import org.osgi.framework.BundleContext; import raven.sqdev.misc.SQDevPreferenceUtil; -import raven.sqdev.pluginManager.SQDevPluginManager; +import raven.sqdev.pluginManagement.SQDevPluginManager; /** * The activator class controls the plug-in life cycle diff --git a/plugin/Raven.SQDev.Editors/src/raven/sqdev/editors/other/ConfigEditor.java b/plugin/Raven.SQDev.Editors/src/raven/sqdev/editors/other/ConfigEditor.java index ff526b16..cf239017 100644 --- a/plugin/Raven.SQDev.Editors/src/raven/sqdev/editors/other/ConfigEditor.java +++ b/plugin/Raven.SQDev.Editors/src/raven/sqdev/editors/other/ConfigEditor.java @@ -1,7 +1,8 @@ package raven.sqdev.editors.other; import java.util.ArrayList; -import java.util.List; +import java.util.HashMap; +import java.util.Map; import org.eclipse.jface.text.rules.MultiLineRule; import org.eclipse.jface.text.rules.Token; @@ -16,74 +17,65 @@ import raven.sqdev.misc.Macro; public class ConfigEditor extends BasicCodeEditor implements IMacroSupport { - - private List macros; - + + private Map macros; + public ConfigEditor() { super(); - - macros = new ArrayList(); - + + macros = new HashMap(); + // configure macro syntax highlighting - configuration.createKeywordScanner( - SQDevPreferenceConstants.SQDEV_EDITOR_MACROHIGHLIGHTING_COLOR_KEY, - true); - configuration.createKeywordScanner( - SQDevPreferenceConstants.SQDEV_EDITOR_KEYWORDHIGHLIGHTING_COLOR_KEY, - true); - + configuration.createKeywordScanner(SQDevPreferenceConstants.SQDEV_EDITOR_MACROHIGHLIGHTING_COLOR_KEY, true); + configuration.createKeywordScanner(SQDevPreferenceConstants.SQDEV_EDITOR_KEYWORDHIGHLIGHTING_COLOR_KEY, true); + // set keywords for this scanner - setKeywords(configuration.getKeywordScanner( - SQDevPreferenceConstants.SQDEV_EDITOR_KEYWORDHIGHLIGHTING_COLOR_KEY)); - + setKeywords( + configuration.getKeywordScanner(SQDevPreferenceConstants.SQDEV_EDITOR_KEYWORDHIGHLIGHTING_COLOR_KEY)); + // get PartitionScanner - BasicPartitionScanner partitionScanner = getBasicProvider() - .getPartitionScanner(); - + BasicPartitionScanner partitionScanner = getBasicProvider().getPartitionScanner(); + // exchange the string rule of the partitionScanner + partitionScanner.removeRule(BasicPartitionScanner.DOUBLE_QUOTE_STRING_RULE); partitionScanner - .removeRule(BasicPartitionScanner.DOUBLE_QUOTE_STRING_RULE); - partitionScanner.addRule(new MultiLineRule("\"", "\"", - new Token(BasicPartitionScanner.BASIC_STRING), (char) 0, true)); + .addRule(new MultiLineRule("\"", "\"", new Token(BasicPartitionScanner.BASIC_STRING), (char) 0, true)); } - + /** * Sets the keywords available in this editor * * @param scanner - * The KeywordScanner the Keywords have to be added - * to (e.g. in form of a KeywordProvider). By - * default this scanner is case-sensitive + * The KeywordScanner the Keywords have to be added to + * (e.g. in form of a KeywordProvider). By default this + * scanner is case-sensitive */ protected void setKeywords(KeywordScanner scanner) { scanner.getKeywordProvider().addKeyword(new Keyword("class")); } - + @Override - public boolean setMacros(List macros, boolean update) { + public boolean setMacros(Map macros, boolean update) { if (!this.macros.equals(macros)) { - this.macros = new ArrayList(macros); - - configuration - .getKeywordScanner( - SQDevPreferenceConstants.SQDEV_EDITOR_MACROHIGHLIGHTING_COLOR_KEY) - .getKeywordProvider() - .setKeywordList(new KeywordList(this.macros)); - + this.macros = new HashMap<>(macros); + + configuration.getKeywordScanner(SQDevPreferenceConstants.SQDEV_EDITOR_MACROHIGHLIGHTING_COLOR_KEY) + .getKeywordProvider().setKeywordList(new KeywordList(new ArrayList<>(this.macros.values()))); + if (update) { update(false); } - + return true; } - - + + return false; } - + @Override - public List getMacros() { + public Map getMacros() { return macros; } - + } diff --git a/plugin/Raven.SQDev.Editors/src/raven/sqdev/editors/sqdevEditor/SQDevFileEditor.java b/plugin/Raven.SQDev.Editors/src/raven/sqdev/editors/sqdevEditor/SQDevFileEditor.java index c67c0ef5..57a514dd 100644 --- a/plugin/Raven.SQDev.Editors/src/raven/sqdev/editors/sqdevEditor/SQDevFileEditor.java +++ b/plugin/Raven.SQDev.Editors/src/raven/sqdev/editors/sqdevEditor/SQDevFileEditor.java @@ -1,5 +1,7 @@ package raven.sqdev.editors.sqdevEditor; +import java.io.InputStream; + import raven.sqdev.constants.SQDevPreferenceConstants; import raven.sqdev.editors.BasicCodeEditor; import raven.sqdev.editors.BasicPartitionScanner; @@ -73,7 +75,7 @@ protected void setKeywords() { } @Override - protected void doPreprocessorParsing(String input) { + protected void doPreprocessorParsing(InputStream input) { // Do nothing } diff --git a/plugin/Raven.SQDev.Editors/src/raven/sqdev/editors/stringTableEditor/StringTableXMLEditor.java b/plugin/Raven.SQDev.Editors/src/raven/sqdev/editors/stringTableEditor/StringTableXMLEditor.java index 7a28d6d8..9ebf8b2c 100644 --- a/plugin/Raven.SQDev.Editors/src/raven/sqdev/editors/stringTableEditor/StringTableXMLEditor.java +++ b/plugin/Raven.SQDev.Editors/src/raven/sqdev/editors/stringTableEditor/StringTableXMLEditor.java @@ -1,5 +1,7 @@ package raven.sqdev.editors.stringTableEditor; +import java.io.IOException; +import java.io.InputStream; import java.util.ArrayList; import java.util.List; @@ -16,7 +18,9 @@ import raven.sqdev.editors.stringtableParsing.StringTableLexer; import raven.sqdev.editors.stringtableParsing.StringTableParser; import raven.sqdev.editors.stringtableParsing.StringTableWalkListener; +import raven.sqdev.interfaces.IParseResult; import raven.sqdev.misc.CharacterPair; +import raven.sqdev.misc.SQDevInfobox; import raven.sqdev.parser.misc.BasicErrorListener; /** @@ -43,8 +47,19 @@ public StringTableXMLEditor() { } @Override - protected ParseTree doParse(String input) { - ANTLRInputStream in = new ANTLRInputStream(input); + protected IParseResult doParse(InputStream input) { + ANTLRInputStream in; + try { + in = new ANTLRInputStream(input); + } catch (IOException e) { + e.printStackTrace(); + + SQDevInfobox info = new SQDevInfobox("Error while parsing stringtable", e); + + info.open(false); + + return null; + } BasicErrorListener listener = new BasicErrorListener(); @@ -61,17 +76,19 @@ protected ParseTree doParse(String input) { ParseTree tree = parser.content(); listener.getParseResult().applyMarkersTo(this); + + listener.getParseResult().setParseTree(tree); - return tree; + return listener.getParseResult(); } @Override - protected boolean processParseTree(ParseTree tree) { + protected boolean processParseTree(IParseResult result) { ParseTreeWalker walker = new ParseTreeWalker(); StringTableWalkListener listener = new StringTableWalkListener(stream); - walker.walk(listener, tree); + walker.walk(listener, result.getANTRLParseTree()); packageList = listener.getPackageList(); diff --git a/plugin/Raven.SQDev.Misc/.classpath b/plugin/Raven.SQDev.Misc/.classpath index cea67ffa..f26a260c 100644 --- a/plugin/Raven.SQDev.Misc/.classpath +++ b/plugin/Raven.SQDev.Misc/.classpath @@ -4,5 +4,8 @@ + + + diff --git a/plugin/Raven.SQDev.Misc/.gitignore b/plugin/Raven.SQDev.Misc/.gitignore new file mode 100644 index 00000000..ae3c1726 --- /dev/null +++ b/plugin/Raven.SQDev.Misc/.gitignore @@ -0,0 +1 @@ +/bin/ diff --git a/plugin/Raven.SQDev.Misc/Abego/AbegoSWT.jar b/plugin/Raven.SQDev.Misc/Abego/AbegoSWT.jar new file mode 100644 index 00000000..075b0f61 Binary files /dev/null and b/plugin/Raven.SQDev.Misc/Abego/AbegoSWT.jar differ diff --git a/plugin/Raven.SQDev.UI/Abego/org.abego.treelayout.core-1.0.3.jar b/plugin/Raven.SQDev.Misc/Abego/org.abego.treelayout.core-1.0.3.jar similarity index 100% rename from plugin/Raven.SQDev.UI/Abego/org.abego.treelayout.core-1.0.3.jar rename to plugin/Raven.SQDev.Misc/Abego/org.abego.treelayout.core-1.0.3.jar diff --git a/plugin/Raven.SQDev.Misc/META-INF/MANIFEST.MF b/plugin/Raven.SQDev.Misc/META-INF/MANIFEST.MF index 60cbbcde..e23dc3fc 100644 --- a/plugin/Raven.SQDev.Misc/META-INF/MANIFEST.MF +++ b/plugin/Raven.SQDev.Misc/META-INF/MANIFEST.MF @@ -2,7 +2,7 @@ Manifest-Version: 1.0 Bundle-ManifestVersion: 2 Bundle-Name: Misc Bundle-SymbolicName: raven.sqdev.misc;singleton:=true -Bundle-Version: 0.6.1.stable +Bundle-Version: 0.7.0.stable Bundle-Activator: raven.sqdev.activator.Activator Require-Bundle: org.eclipse.core.runtime, org.eclipse.swt, @@ -13,28 +13,94 @@ Require-Bundle: org.eclipse.core.runtime, org.junit Bundle-RequiredExecutionEnvironment: JavaSE-1.8 Bundle-ActivationPolicy: lazy -Export-Package: org.antlr.v4.runtime, - org.antlr.v4.runtime.atn, - org.antlr.v4.runtime.dfa, - org.antlr.v4.runtime.misc, - org.antlr.v4.runtime.tree, - org.antlr.v4.runtime.tree.pattern, - org.antlr.v4.runtime.tree.xpath, - raven.sqdev.constants, - raven.sqdev.exceptions, - raven.sqdev.fileSystemListener, - raven.sqdev.infoCollection, - raven.sqdev.infoCollection.base, - raven.sqdev.interfaces, - raven.sqdev.misc, - raven.sqdev.parser.misc, - raven.sqdev.parser.preprocessor, - raven.sqdev.parser.sqf, - raven.sqdev.pluginManagement, - raven.sqdev.pluginManager, - raven.sqdev.styles, - raven.sqdev.syntax +Export-Package: dataStructures, + lexer;uses:="dataStructures", + org.abego.treelayout, + org.abego.treelayout.util, + org.antlr.v4.runtime; + uses:="new org.antlr.v4.runtime, + org.antlr.v4.runtime.dfa, + org.antlr.v4.runtime.atn, + org.antlr.v4.runtime.tree, + org.antlr.v4.runtime.misc, + org.antlr.v4.runtime.tree.pattern", + org.antlr.v4.runtime.atn;uses:="org.antlr.v4.runtime,org.antlr.v4.runtime.dfa,org.antlr.v4.runtime.misc", + org.antlr.v4.runtime.dfa;uses:="org.antlr.v4.runtime,org.antlr.v4.runtime.atn", + org.antlr.v4.runtime.misc;uses:="org.antlr.v4.runtime", + org.antlr.v4.runtime.tree;uses:="org.antlr.v4.runtime,org.antlr.v4.runtime.misc", + org.antlr.v4.runtime.tree.pattern;uses:="org.antlr.v4.runtime,org.antlr.v4.runtime.tree,org.antlr.v4.runtime.misc", + org.antlr.v4.runtime.tree.xpath;uses:="org.antlr.v4.runtime,org.antlr.v4.runtime.tree,org.antlr.v4.runtime.atn", + parser;uses:="dataStructures", + raven.sqdev.constants;uses:="org.eclipse.swt.graphics,raven.sqdev.misc", + raven.sqdev.exceptions;uses:="raven.sqdev.infoCollection.base", + raven.sqdev.fileSystemListener;uses:="org.eclipse.core.runtime,raven.sqdev.interfaces", + raven.sqdev.infoCollection;uses:="org.eclipse.core.runtime,raven.sqdev.infoCollection.base", + raven.sqdev.infoCollection.base;uses:="raven.sqdev.syntax,raven.sqdev.misc,raven.sqdev.interfaces", + raven.sqdev.interfaces; + uses:="org.eclipse.swt.events, + raven.sqdev.pluginManagement, + dataStructures, + raven.sqdev.fileSystemListener, + raven.sqdev.infoCollection.base, + raven.sqdev.misc, + org.eclipse.swt.widgets", + raven.sqdev.misc; + uses:="raven.sqdev.pluginManagement, + org.eclipse.swt.graphics, + org.eclipse.swt.widgets, + org.eclipse.core.runtime.preferences, + org.osgi.framework, + org.eclipse.core.runtime, + org.eclipse.jface.util, + raven.sqdev.infoCollection.base, + org.eclipse.jface.preference, + org.eclipse.swt.custom, + org.eclipse.core.resources, + raven.sqdev.styles, + raven.sqdev.interfaces", + raven.sqdev.parser.misc; + uses:="org.antlr.v4.runtime, + dataStructures, + org.eclipse.jface.text, + raven.sqdev.parser.preprocessor, + lexer, + org.eclipse.core.runtime, + parser, + org.antlr.v4.runtime.tree, + raven.sqdev.parser.sqf, + raven.sqdev.interfaces", + raven.sqdev.parser.preprocessor; + uses:="org.antlr.v4.runtime, + org.eclipse.core.runtime, + raven.sqdev.misc, + org.antlr.v4.runtime.tree, + raven.sqdev.parser.misc, + org.antlr.v4.runtime.atn", + raven.sqdev.parser.sqf; + uses:="org.antlr.v4.runtime, + raven.sqdev.infoCollection.base, + raven.sqdev.misc, + org.eclipse.jface.text, + org.antlr.v4.runtime.tree, + raven.sqdev.parser.misc, + org.antlr.v4.runtime.atn, + raven.sqdev.interfaces", + raven.sqdev.pluginManagement; + uses:="org.eclipse.core.runtime.jobs, + org.osgi.framework, + org.eclipse.ui.plugin, + raven.sqdev.interfaces", + raven.sqdev.styles;uses:="org.eclipse.swt.custom,org.eclipse.swt.widgets", + raven.sqdev.syntax;uses:="raven.sqdev.misc", + ui; + uses:="org.abego.treelayout.util, + abego.swt, + dataStructures, + org.eclipse.swt.widgets" Import-Package: raven.sqdev.misc Bundle-Vendor: Raven Bundle-ClassPath: ANTLR/antlr-runtime-4.7.jar, - . + SQFParser/SQFParser.jar, + Abego/AbegoSWT.jar, + Abego/org.abego.treelayout.core-1.0.3.jar, + . diff --git a/plugin/Raven.SQDev.Misc/SQFParser/SQFParser.jar b/plugin/Raven.SQDev.Misc/SQFParser/SQFParser.jar new file mode 100644 index 00000000..264ecdfb Binary files /dev/null and b/plugin/Raven.SQDev.Misc/SQFParser/SQFParser.jar differ diff --git a/plugin/Raven.SQDev.Misc/bin/raven/sqdev/activator/Activator.class b/plugin/Raven.SQDev.Misc/bin/raven/sqdev/activator/Activator.class deleted file mode 100644 index b0c18750..00000000 Binary files a/plugin/Raven.SQDev.Misc/bin/raven/sqdev/activator/Activator.class and /dev/null differ diff --git a/plugin/Raven.SQDev.Misc/bin/raven/sqdev/constants/ISQDevColorConstants.class b/plugin/Raven.SQDev.Misc/bin/raven/sqdev/constants/ISQDevColorConstants.class deleted file mode 100644 index 705f17d5..00000000 Binary files a/plugin/Raven.SQDev.Misc/bin/raven/sqdev/constants/ISQDevColorConstants.class and /dev/null differ diff --git a/plugin/Raven.SQDev.Misc/bin/raven/sqdev/constants/ProblemMessages.class b/plugin/Raven.SQDev.Misc/bin/raven/sqdev/constants/ProblemMessages.class deleted file mode 100644 index 766f614b..00000000 Binary files a/plugin/Raven.SQDev.Misc/bin/raven/sqdev/constants/ProblemMessages.class and /dev/null differ diff --git a/plugin/Raven.SQDev.Misc/bin/raven/sqdev/constants/SQDevPreferenceConstants.class b/plugin/Raven.SQDev.Misc/bin/raven/sqdev/constants/SQDevPreferenceConstants.class deleted file mode 100644 index f9fb19ea..00000000 Binary files a/plugin/Raven.SQDev.Misc/bin/raven/sqdev/constants/SQDevPreferenceConstants.class and /dev/null differ diff --git a/plugin/Raven.SQDev.Misc/bin/raven/sqdev/constants/TextConstants.class b/plugin/Raven.SQDev.Misc/bin/raven/sqdev/constants/TextConstants.class deleted file mode 100644 index 7f79489d..00000000 Binary files a/plugin/Raven.SQDev.Misc/bin/raven/sqdev/constants/TextConstants.class and /dev/null differ diff --git a/plugin/Raven.SQDev.Misc/bin/raven/sqdev/exceptions/BadSyntaxException.class b/plugin/Raven.SQDev.Misc/bin/raven/sqdev/exceptions/BadSyntaxException.class deleted file mode 100644 index a8f2c916..00000000 Binary files a/plugin/Raven.SQDev.Misc/bin/raven/sqdev/exceptions/BadSyntaxException.class and /dev/null differ diff --git a/plugin/Raven.SQDev.Misc/bin/raven/sqdev/exceptions/FailedAtCreatingFileException.class b/plugin/Raven.SQDev.Misc/bin/raven/sqdev/exceptions/FailedAtCreatingFileException.class deleted file mode 100644 index b8610099..00000000 Binary files a/plugin/Raven.SQDev.Misc/bin/raven/sqdev/exceptions/FailedAtCreatingFileException.class and /dev/null differ diff --git a/plugin/Raven.SQDev.Misc/bin/raven/sqdev/exceptions/IllegalAccessStateException.class b/plugin/Raven.SQDev.Misc/bin/raven/sqdev/exceptions/IllegalAccessStateException.class deleted file mode 100644 index db7de0ed..00000000 Binary files a/plugin/Raven.SQDev.Misc/bin/raven/sqdev/exceptions/IllegalAccessStateException.class and /dev/null differ diff --git a/plugin/Raven.SQDev.Misc/bin/raven/sqdev/exceptions/IllegalConstructorException.class b/plugin/Raven.SQDev.Misc/bin/raven/sqdev/exceptions/IllegalConstructorException.class deleted file mode 100644 index d620a566..00000000 Binary files a/plugin/Raven.SQDev.Misc/bin/raven/sqdev/exceptions/IllegalConstructorException.class and /dev/null differ diff --git a/plugin/Raven.SQDev.Misc/bin/raven/sqdev/exceptions/IllegalModificationException.class b/plugin/Raven.SQDev.Misc/bin/raven/sqdev/exceptions/IllegalModificationException.class deleted file mode 100644 index 75e180f8..00000000 Binary files a/plugin/Raven.SQDev.Misc/bin/raven/sqdev/exceptions/IllegalModificationException.class and /dev/null differ diff --git a/plugin/Raven.SQDev.Misc/bin/raven/sqdev/exceptions/IllegalRGBSyntaxException.class b/plugin/Raven.SQDev.Misc/bin/raven/sqdev/exceptions/IllegalRGBSyntaxException.class deleted file mode 100644 index f081cb3c..00000000 Binary files a/plugin/Raven.SQDev.Misc/bin/raven/sqdev/exceptions/IllegalRGBSyntaxException.class and /dev/null differ diff --git a/plugin/Raven.SQDev.Misc/bin/raven/sqdev/exceptions/SQDevCollectionException.class b/plugin/Raven.SQDev.Misc/bin/raven/sqdev/exceptions/SQDevCollectionException.class deleted file mode 100644 index 5434beca..00000000 Binary files a/plugin/Raven.SQDev.Misc/bin/raven/sqdev/exceptions/SQDevCollectionException.class and /dev/null differ diff --git a/plugin/Raven.SQDev.Misc/bin/raven/sqdev/exceptions/SQDevCoreException.class b/plugin/Raven.SQDev.Misc/bin/raven/sqdev/exceptions/SQDevCoreException.class deleted file mode 100644 index 70292901..00000000 Binary files a/plugin/Raven.SQDev.Misc/bin/raven/sqdev/exceptions/SQDevCoreException.class and /dev/null differ diff --git a/plugin/Raven.SQDev.Misc/bin/raven/sqdev/exceptions/SQDevEditorException.class b/plugin/Raven.SQDev.Misc/bin/raven/sqdev/exceptions/SQDevEditorException.class deleted file mode 100644 index 6652659a..00000000 Binary files a/plugin/Raven.SQDev.Misc/bin/raven/sqdev/exceptions/SQDevEditorException.class and /dev/null differ diff --git a/plugin/Raven.SQDev.Misc/bin/raven/sqdev/exceptions/SQDevException.class b/plugin/Raven.SQDev.Misc/bin/raven/sqdev/exceptions/SQDevException.class deleted file mode 100644 index 883ed3a8..00000000 Binary files a/plugin/Raven.SQDev.Misc/bin/raven/sqdev/exceptions/SQDevException.class and /dev/null differ diff --git a/plugin/Raven.SQDev.Misc/bin/raven/sqdev/exceptions/SQDevFileIsInvalidException.class b/plugin/Raven.SQDev.Misc/bin/raven/sqdev/exceptions/SQDevFileIsInvalidException.class deleted file mode 100644 index c501afca..00000000 Binary files a/plugin/Raven.SQDev.Misc/bin/raven/sqdev/exceptions/SQDevFileIsInvalidException.class and /dev/null differ diff --git a/plugin/Raven.SQDev.Misc/bin/raven/sqdev/exceptions/SQDevFileNoSuchAttributeException.class b/plugin/Raven.SQDev.Misc/bin/raven/sqdev/exceptions/SQDevFileNoSuchAttributeException.class deleted file mode 100644 index 0d3597c7..00000000 Binary files a/plugin/Raven.SQDev.Misc/bin/raven/sqdev/exceptions/SQDevFileNoSuchAttributeException.class and /dev/null differ diff --git a/plugin/Raven.SQDev.Misc/bin/raven/sqdev/exceptions/SQDevIllegalFileChangeException.class b/plugin/Raven.SQDev.Misc/bin/raven/sqdev/exceptions/SQDevIllegalFileChangeException.class deleted file mode 100644 index e69f2d8b..00000000 Binary files a/plugin/Raven.SQDev.Misc/bin/raven/sqdev/exceptions/SQDevIllegalFileChangeException.class and /dev/null differ diff --git a/plugin/Raven.SQDev.Misc/bin/raven/sqdev/exceptions/SQDevSyntaxException.class b/plugin/Raven.SQDev.Misc/bin/raven/sqdev/exceptions/SQDevSyntaxException.class deleted file mode 100644 index 087ff1c1..00000000 Binary files a/plugin/Raven.SQDev.Misc/bin/raven/sqdev/exceptions/SQDevSyntaxException.class and /dev/null differ diff --git a/plugin/Raven.SQDev.Misc/bin/raven/sqdev/exceptions/activator/Activator.class b/plugin/Raven.SQDev.Misc/bin/raven/sqdev/exceptions/activator/Activator.class deleted file mode 100644 index 5d4e1645..00000000 Binary files a/plugin/Raven.SQDev.Misc/bin/raven/sqdev/exceptions/activator/Activator.class and /dev/null differ diff --git a/plugin/Raven.SQDev.Misc/bin/raven/sqdev/fileSystemListener/AbstractFileSystemChangeListener.class b/plugin/Raven.SQDev.Misc/bin/raven/sqdev/fileSystemListener/AbstractFileSystemChangeListener.class deleted file mode 100644 index 7b8dd353..00000000 Binary files a/plugin/Raven.SQDev.Misc/bin/raven/sqdev/fileSystemListener/AbstractFileSystemChangeListener.class and /dev/null differ diff --git a/plugin/Raven.SQDev.Misc/bin/raven/sqdev/fileSystemListener/EFileChangeType.class b/plugin/Raven.SQDev.Misc/bin/raven/sqdev/fileSystemListener/EFileChangeType.class deleted file mode 100644 index 825ea429..00000000 Binary files a/plugin/Raven.SQDev.Misc/bin/raven/sqdev/fileSystemListener/EFileChangeType.class and /dev/null differ diff --git a/plugin/Raven.SQDev.Misc/bin/raven/sqdev/fileSystemListener/FileSystemChangeAdapter.class b/plugin/Raven.SQDev.Misc/bin/raven/sqdev/fileSystemListener/FileSystemChangeAdapter.class deleted file mode 100644 index a4cf9823..00000000 Binary files a/plugin/Raven.SQDev.Misc/bin/raven/sqdev/fileSystemListener/FileSystemChangeAdapter.class and /dev/null differ diff --git a/plugin/Raven.SQDev.Misc/bin/raven/sqdev/fileSystemListener/FileSystemChangeEvent.class b/plugin/Raven.SQDev.Misc/bin/raven/sqdev/fileSystemListener/FileSystemChangeEvent.class deleted file mode 100644 index e30137d3..00000000 Binary files a/plugin/Raven.SQDev.Misc/bin/raven/sqdev/fileSystemListener/FileSystemChangeEvent.class and /dev/null differ diff --git a/plugin/Raven.SQDev.Misc/bin/raven/sqdev/fileSystemListener/FileSystemWatcher$1.class b/plugin/Raven.SQDev.Misc/bin/raven/sqdev/fileSystemListener/FileSystemWatcher$1.class deleted file mode 100644 index 2271d7a3..00000000 Binary files a/plugin/Raven.SQDev.Misc/bin/raven/sqdev/fileSystemListener/FileSystemWatcher$1.class and /dev/null differ diff --git a/plugin/Raven.SQDev.Misc/bin/raven/sqdev/fileSystemListener/FileSystemWatcher.class b/plugin/Raven.SQDev.Misc/bin/raven/sqdev/fileSystemListener/FileSystemWatcher.class deleted file mode 100644 index 529cee9d..00000000 Binary files a/plugin/Raven.SQDev.Misc/bin/raven/sqdev/fileSystemListener/FileSystemWatcher.class and /dev/null differ diff --git a/plugin/Raven.SQDev.Misc/bin/raven/sqdev/infoCollection/SQFCommandCollector$1.class b/plugin/Raven.SQDev.Misc/bin/raven/sqdev/infoCollection/SQFCommandCollector$1.class deleted file mode 100644 index d0b8ee47..00000000 Binary files a/plugin/Raven.SQDev.Misc/bin/raven/sqdev/infoCollection/SQFCommandCollector$1.class and /dev/null differ diff --git a/plugin/Raven.SQDev.Misc/bin/raven/sqdev/infoCollection/SQFCommandCollector.class b/plugin/Raven.SQDev.Misc/bin/raven/sqdev/infoCollection/SQFCommandCollector.class deleted file mode 100644 index f0b5f7ef..00000000 Binary files a/plugin/Raven.SQDev.Misc/bin/raven/sqdev/infoCollection/SQFCommandCollector.class and /dev/null differ diff --git a/plugin/Raven.SQDev.Misc/bin/raven/sqdev/infoCollection/SQFCommandPageProvider.class b/plugin/Raven.SQDev.Misc/bin/raven/sqdev/infoCollection/SQFCommandPageProvider.class deleted file mode 100644 index 20952a6f..00000000 Binary files a/plugin/Raven.SQDev.Misc/bin/raven/sqdev/infoCollection/SQFCommandPageProvider.class and /dev/null differ diff --git a/plugin/Raven.SQDev.Misc/bin/raven/sqdev/infoCollection/base/ELocality$1.class b/plugin/Raven.SQDev.Misc/bin/raven/sqdev/infoCollection/base/ELocality$1.class deleted file mode 100644 index 74481b75..00000000 Binary files a/plugin/Raven.SQDev.Misc/bin/raven/sqdev/infoCollection/base/ELocality$1.class and /dev/null differ diff --git a/plugin/Raven.SQDev.Misc/bin/raven/sqdev/infoCollection/base/ELocality$2.class b/plugin/Raven.SQDev.Misc/bin/raven/sqdev/infoCollection/base/ELocality$2.class deleted file mode 100644 index 1f553607..00000000 Binary files a/plugin/Raven.SQDev.Misc/bin/raven/sqdev/infoCollection/base/ELocality$2.class and /dev/null differ diff --git a/plugin/Raven.SQDev.Misc/bin/raven/sqdev/infoCollection/base/ELocality$3.class b/plugin/Raven.SQDev.Misc/bin/raven/sqdev/infoCollection/base/ELocality$3.class deleted file mode 100644 index ec85c6e3..00000000 Binary files a/plugin/Raven.SQDev.Misc/bin/raven/sqdev/infoCollection/base/ELocality$3.class and /dev/null differ diff --git a/plugin/Raven.SQDev.Misc/bin/raven/sqdev/infoCollection/base/ELocality.class b/plugin/Raven.SQDev.Misc/bin/raven/sqdev/infoCollection/base/ELocality.class deleted file mode 100644 index 704c4804..00000000 Binary files a/plugin/Raven.SQDev.Misc/bin/raven/sqdev/infoCollection/base/ELocality.class and /dev/null differ diff --git a/plugin/Raven.SQDev.Misc/bin/raven/sqdev/infoCollection/base/Keyword.class b/plugin/Raven.SQDev.Misc/bin/raven/sqdev/infoCollection/base/Keyword.class deleted file mode 100644 index b7e9da24..00000000 Binary files a/plugin/Raven.SQDev.Misc/bin/raven/sqdev/infoCollection/base/Keyword.class and /dev/null differ diff --git a/plugin/Raven.SQDev.Misc/bin/raven/sqdev/infoCollection/base/KeywordList.class b/plugin/Raven.SQDev.Misc/bin/raven/sqdev/infoCollection/base/KeywordList.class deleted file mode 100644 index 1a0b7085..00000000 Binary files a/plugin/Raven.SQDev.Misc/bin/raven/sqdev/infoCollection/base/KeywordList.class and /dev/null differ diff --git a/plugin/Raven.SQDev.Misc/bin/raven/sqdev/infoCollection/base/SQFCommand.class b/plugin/Raven.SQDev.Misc/bin/raven/sqdev/infoCollection/base/SQFCommand.class deleted file mode 100644 index eb6869c2..00000000 Binary files a/plugin/Raven.SQDev.Misc/bin/raven/sqdev/infoCollection/base/SQFCommand.class and /dev/null differ diff --git a/plugin/Raven.SQDev.Misc/bin/raven/sqdev/infoCollection/base/SQFElement.class b/plugin/Raven.SQDev.Misc/bin/raven/sqdev/infoCollection/base/SQFElement.class deleted file mode 100644 index 526b04cf..00000000 Binary files a/plugin/Raven.SQDev.Misc/bin/raven/sqdev/infoCollection/base/SQFElement.class and /dev/null differ diff --git a/plugin/Raven.SQDev.Misc/bin/raven/sqdev/infoCollection/base/Variable.class b/plugin/Raven.SQDev.Misc/bin/raven/sqdev/infoCollection/base/Variable.class deleted file mode 100644 index 3bbcb369..00000000 Binary files a/plugin/Raven.SQDev.Misc/bin/raven/sqdev/infoCollection/base/Variable.class and /dev/null differ diff --git a/plugin/Raven.SQDev.Misc/bin/raven/sqdev/interfaces/IAdditionalProposalInformation.class b/plugin/Raven.SQDev.Misc/bin/raven/sqdev/interfaces/IAdditionalProposalInformation.class deleted file mode 100644 index c630d083..00000000 Binary files a/plugin/Raven.SQDev.Misc/bin/raven/sqdev/interfaces/IAdditionalProposalInformation.class and /dev/null differ diff --git a/plugin/Raven.SQDev.Misc/bin/raven/sqdev/interfaces/IEditorKeyHandler.class b/plugin/Raven.SQDev.Misc/bin/raven/sqdev/interfaces/IEditorKeyHandler.class deleted file mode 100644 index bb1f649d..00000000 Binary files a/plugin/Raven.SQDev.Misc/bin/raven/sqdev/interfaces/IEditorKeyHandler.class and /dev/null differ diff --git a/plugin/Raven.SQDev.Misc/bin/raven/sqdev/interfaces/IFileSystemChangeListener.class b/plugin/Raven.SQDev.Misc/bin/raven/sqdev/interfaces/IFileSystemChangeListener.class deleted file mode 100644 index 29c253fe..00000000 Binary files a/plugin/Raven.SQDev.Misc/bin/raven/sqdev/interfaces/IFileSystemChangeListener.class and /dev/null differ diff --git a/plugin/Raven.SQDev.Misc/bin/raven/sqdev/interfaces/IKeywordListChangeListener.class b/plugin/Raven.SQDev.Misc/bin/raven/sqdev/interfaces/IKeywordListChangeListener.class deleted file mode 100644 index 3107e700..00000000 Binary files a/plugin/Raven.SQDev.Misc/bin/raven/sqdev/interfaces/IKeywordListChangeListener.class and /dev/null differ diff --git a/plugin/Raven.SQDev.Misc/bin/raven/sqdev/interfaces/IKeywordProvider.class b/plugin/Raven.SQDev.Misc/bin/raven/sqdev/interfaces/IKeywordProvider.class deleted file mode 100644 index b125ced4..00000000 Binary files a/plugin/Raven.SQDev.Misc/bin/raven/sqdev/interfaces/IKeywordProvider.class and /dev/null differ diff --git a/plugin/Raven.SQDev.Misc/bin/raven/sqdev/interfaces/IMacroSupport.class b/plugin/Raven.SQDev.Misc/bin/raven/sqdev/interfaces/IMacroSupport.class deleted file mode 100644 index a488acdc..00000000 Binary files a/plugin/Raven.SQDev.Misc/bin/raven/sqdev/interfaces/IMacroSupport.class and /dev/null differ diff --git a/plugin/Raven.SQDev.Misc/bin/raven/sqdev/interfaces/IManager.class b/plugin/Raven.SQDev.Misc/bin/raven/sqdev/interfaces/IManager.class deleted file mode 100644 index 42fadf20..00000000 Binary files a/plugin/Raven.SQDev.Misc/bin/raven/sqdev/interfaces/IManager.class and /dev/null differ diff --git a/plugin/Raven.SQDev.Misc/bin/raven/sqdev/interfaces/IMarkerSupport.class b/plugin/Raven.SQDev.Misc/bin/raven/sqdev/interfaces/IMarkerSupport.class deleted file mode 100644 index 0a1c4fe5..00000000 Binary files a/plugin/Raven.SQDev.Misc/bin/raven/sqdev/interfaces/IMarkerSupport.class and /dev/null differ diff --git a/plugin/Raven.SQDev.Misc/bin/raven/sqdev/interfaces/IPluginListener.class b/plugin/Raven.SQDev.Misc/bin/raven/sqdev/interfaces/IPluginListener.class deleted file mode 100644 index 7b38c300..00000000 Binary files a/plugin/Raven.SQDev.Misc/bin/raven/sqdev/interfaces/IPluginListener.class and /dev/null differ diff --git a/plugin/Raven.SQDev.Misc/bin/raven/sqdev/interfaces/IProposalInformationCategory.class b/plugin/Raven.SQDev.Misc/bin/raven/sqdev/interfaces/IProposalInformationCategory.class deleted file mode 100644 index df80fea7..00000000 Binary files a/plugin/Raven.SQDev.Misc/bin/raven/sqdev/interfaces/IProposalInformationCategory.class and /dev/null differ diff --git a/plugin/Raven.SQDev.Misc/bin/raven/sqdev/interfaces/IReplaceTester.class b/plugin/Raven.SQDev.Misc/bin/raven/sqdev/interfaces/IReplaceTester.class deleted file mode 100644 index fb49f452..00000000 Binary files a/plugin/Raven.SQDev.Misc/bin/raven/sqdev/interfaces/IReplaceTester.class and /dev/null differ diff --git a/plugin/Raven.SQDev.Misc/bin/raven/sqdev/interfaces/ISQFParseInformation.class b/plugin/Raven.SQDev.Misc/bin/raven/sqdev/interfaces/ISQFParseInformation.class deleted file mode 100644 index 228dc759..00000000 Binary files a/plugin/Raven.SQDev.Misc/bin/raven/sqdev/interfaces/ISQFParseInformation.class and /dev/null differ diff --git a/plugin/Raven.SQDev.Misc/bin/raven/sqdev/interfaces/ISaveable.class b/plugin/Raven.SQDev.Misc/bin/raven/sqdev/interfaces/ISaveable.class deleted file mode 100644 index 7b919576..00000000 Binary files a/plugin/Raven.SQDev.Misc/bin/raven/sqdev/interfaces/ISaveable.class and /dev/null differ diff --git a/plugin/Raven.SQDev.Misc/bin/raven/sqdev/interfaces/IUpdateListener.class b/plugin/Raven.SQDev.Misc/bin/raven/sqdev/interfaces/IUpdateListener.class deleted file mode 100644 index aa551360..00000000 Binary files a/plugin/Raven.SQDev.Misc/bin/raven/sqdev/interfaces/IUpdateListener.class and /dev/null differ diff --git a/plugin/Raven.SQDev.Misc/bin/raven/sqdev/interfaces/IVersionListener.class b/plugin/Raven.SQDev.Misc/bin/raven/sqdev/interfaces/IVersionListener.class deleted file mode 100644 index fcc4cb7b..00000000 Binary files a/plugin/Raven.SQDev.Misc/bin/raven/sqdev/interfaces/IVersionListener.class and /dev/null differ diff --git a/plugin/Raven.SQDev.Misc/bin/raven/sqdev/misc/AbstractAdditionalProposalInformation.class b/plugin/Raven.SQDev.Misc/bin/raven/sqdev/misc/AbstractAdditionalProposalInformation.class deleted file mode 100644 index d0f0c04a..00000000 Binary files a/plugin/Raven.SQDev.Misc/bin/raven/sqdev/misc/AbstractAdditionalProposalInformation.class and /dev/null differ diff --git a/plugin/Raven.SQDev.Misc/bin/raven/sqdev/misc/AdvancedLineReader.class b/plugin/Raven.SQDev.Misc/bin/raven/sqdev/misc/AdvancedLineReader.class deleted file mode 100644 index 86333d7d..00000000 Binary files a/plugin/Raven.SQDev.Misc/bin/raven/sqdev/misc/AdvancedLineReader.class and /dev/null differ diff --git a/plugin/Raven.SQDev.Misc/bin/raven/sqdev/misc/ArrayUtils.class b/plugin/Raven.SQDev.Misc/bin/raven/sqdev/misc/ArrayUtils.class deleted file mode 100644 index f607dbac..00000000 Binary files a/plugin/Raven.SQDev.Misc/bin/raven/sqdev/misc/ArrayUtils.class and /dev/null differ diff --git a/plugin/Raven.SQDev.Misc/bin/raven/sqdev/misc/CharacterPair.class b/plugin/Raven.SQDev.Misc/bin/raven/sqdev/misc/CharacterPair.class deleted file mode 100644 index 1bc441d4..00000000 Binary files a/plugin/Raven.SQDev.Misc/bin/raven/sqdev/misc/CharacterPair.class and /dev/null differ diff --git a/plugin/Raven.SQDev.Misc/bin/raven/sqdev/misc/ColorUtils.class b/plugin/Raven.SQDev.Misc/bin/raven/sqdev/misc/ColorUtils.class deleted file mode 100644 index 7a650c63..00000000 Binary files a/plugin/Raven.SQDev.Misc/bin/raven/sqdev/misc/ColorUtils.class and /dev/null differ diff --git a/plugin/Raven.SQDev.Misc/bin/raven/sqdev/misc/DataTypeList.class b/plugin/Raven.SQDev.Misc/bin/raven/sqdev/misc/DataTypeList.class deleted file mode 100644 index e6819b48..00000000 Binary files a/plugin/Raven.SQDev.Misc/bin/raven/sqdev/misc/DataTypeList.class and /dev/null differ diff --git a/plugin/Raven.SQDev.Misc/bin/raven/sqdev/misc/EDataType$1.class b/plugin/Raven.SQDev.Misc/bin/raven/sqdev/misc/EDataType$1.class deleted file mode 100644 index f69f1543..00000000 Binary files a/plugin/Raven.SQDev.Misc/bin/raven/sqdev/misc/EDataType$1.class and /dev/null differ diff --git a/plugin/Raven.SQDev.Misc/bin/raven/sqdev/misc/EDataType$10.class b/plugin/Raven.SQDev.Misc/bin/raven/sqdev/misc/EDataType$10.class deleted file mode 100644 index c31b74f4..00000000 Binary files a/plugin/Raven.SQDev.Misc/bin/raven/sqdev/misc/EDataType$10.class and /dev/null differ diff --git a/plugin/Raven.SQDev.Misc/bin/raven/sqdev/misc/EDataType$11.class b/plugin/Raven.SQDev.Misc/bin/raven/sqdev/misc/EDataType$11.class deleted file mode 100644 index 63bc9c3b..00000000 Binary files a/plugin/Raven.SQDev.Misc/bin/raven/sqdev/misc/EDataType$11.class and /dev/null differ diff --git a/plugin/Raven.SQDev.Misc/bin/raven/sqdev/misc/EDataType$12.class b/plugin/Raven.SQDev.Misc/bin/raven/sqdev/misc/EDataType$12.class deleted file mode 100644 index 53d16662..00000000 Binary files a/plugin/Raven.SQDev.Misc/bin/raven/sqdev/misc/EDataType$12.class and /dev/null differ diff --git a/plugin/Raven.SQDev.Misc/bin/raven/sqdev/misc/EDataType$13.class b/plugin/Raven.SQDev.Misc/bin/raven/sqdev/misc/EDataType$13.class deleted file mode 100644 index 4aa77837..00000000 Binary files a/plugin/Raven.SQDev.Misc/bin/raven/sqdev/misc/EDataType$13.class and /dev/null differ diff --git a/plugin/Raven.SQDev.Misc/bin/raven/sqdev/misc/EDataType$14.class b/plugin/Raven.SQDev.Misc/bin/raven/sqdev/misc/EDataType$14.class deleted file mode 100644 index e49066d4..00000000 Binary files a/plugin/Raven.SQDev.Misc/bin/raven/sqdev/misc/EDataType$14.class and /dev/null differ diff --git a/plugin/Raven.SQDev.Misc/bin/raven/sqdev/misc/EDataType$15.class b/plugin/Raven.SQDev.Misc/bin/raven/sqdev/misc/EDataType$15.class deleted file mode 100644 index 32c788cf..00000000 Binary files a/plugin/Raven.SQDev.Misc/bin/raven/sqdev/misc/EDataType$15.class and /dev/null differ diff --git a/plugin/Raven.SQDev.Misc/bin/raven/sqdev/misc/EDataType$16.class b/plugin/Raven.SQDev.Misc/bin/raven/sqdev/misc/EDataType$16.class deleted file mode 100644 index 03d4da3a..00000000 Binary files a/plugin/Raven.SQDev.Misc/bin/raven/sqdev/misc/EDataType$16.class and /dev/null differ diff --git a/plugin/Raven.SQDev.Misc/bin/raven/sqdev/misc/EDataType$17.class b/plugin/Raven.SQDev.Misc/bin/raven/sqdev/misc/EDataType$17.class deleted file mode 100644 index 6f6104c3..00000000 Binary files a/plugin/Raven.SQDev.Misc/bin/raven/sqdev/misc/EDataType$17.class and /dev/null differ diff --git a/plugin/Raven.SQDev.Misc/bin/raven/sqdev/misc/EDataType$18.class b/plugin/Raven.SQDev.Misc/bin/raven/sqdev/misc/EDataType$18.class deleted file mode 100644 index 3f4c00b8..00000000 Binary files a/plugin/Raven.SQDev.Misc/bin/raven/sqdev/misc/EDataType$18.class and /dev/null differ diff --git a/plugin/Raven.SQDev.Misc/bin/raven/sqdev/misc/EDataType$19.class b/plugin/Raven.SQDev.Misc/bin/raven/sqdev/misc/EDataType$19.class deleted file mode 100644 index ac7f7359..00000000 Binary files a/plugin/Raven.SQDev.Misc/bin/raven/sqdev/misc/EDataType$19.class and /dev/null differ diff --git a/plugin/Raven.SQDev.Misc/bin/raven/sqdev/misc/EDataType$2.class b/plugin/Raven.SQDev.Misc/bin/raven/sqdev/misc/EDataType$2.class deleted file mode 100644 index d8c3231d..00000000 Binary files a/plugin/Raven.SQDev.Misc/bin/raven/sqdev/misc/EDataType$2.class and /dev/null differ diff --git a/plugin/Raven.SQDev.Misc/bin/raven/sqdev/misc/EDataType$20.class b/plugin/Raven.SQDev.Misc/bin/raven/sqdev/misc/EDataType$20.class deleted file mode 100644 index b3f1a11c..00000000 Binary files a/plugin/Raven.SQDev.Misc/bin/raven/sqdev/misc/EDataType$20.class and /dev/null differ diff --git a/plugin/Raven.SQDev.Misc/bin/raven/sqdev/misc/EDataType$21.class b/plugin/Raven.SQDev.Misc/bin/raven/sqdev/misc/EDataType$21.class deleted file mode 100644 index 54024eb6..00000000 Binary files a/plugin/Raven.SQDev.Misc/bin/raven/sqdev/misc/EDataType$21.class and /dev/null differ diff --git a/plugin/Raven.SQDev.Misc/bin/raven/sqdev/misc/EDataType$22.class b/plugin/Raven.SQDev.Misc/bin/raven/sqdev/misc/EDataType$22.class deleted file mode 100644 index 5dcaf952..00000000 Binary files a/plugin/Raven.SQDev.Misc/bin/raven/sqdev/misc/EDataType$22.class and /dev/null differ diff --git a/plugin/Raven.SQDev.Misc/bin/raven/sqdev/misc/EDataType$23.class b/plugin/Raven.SQDev.Misc/bin/raven/sqdev/misc/EDataType$23.class deleted file mode 100644 index 1f1fd633..00000000 Binary files a/plugin/Raven.SQDev.Misc/bin/raven/sqdev/misc/EDataType$23.class and /dev/null differ diff --git a/plugin/Raven.SQDev.Misc/bin/raven/sqdev/misc/EDataType$24.class b/plugin/Raven.SQDev.Misc/bin/raven/sqdev/misc/EDataType$24.class deleted file mode 100644 index 6eecaa80..00000000 Binary files a/plugin/Raven.SQDev.Misc/bin/raven/sqdev/misc/EDataType$24.class and /dev/null differ diff --git a/plugin/Raven.SQDev.Misc/bin/raven/sqdev/misc/EDataType$25.class b/plugin/Raven.SQDev.Misc/bin/raven/sqdev/misc/EDataType$25.class deleted file mode 100644 index cb4df0bb..00000000 Binary files a/plugin/Raven.SQDev.Misc/bin/raven/sqdev/misc/EDataType$25.class and /dev/null differ diff --git a/plugin/Raven.SQDev.Misc/bin/raven/sqdev/misc/EDataType$26.class b/plugin/Raven.SQDev.Misc/bin/raven/sqdev/misc/EDataType$26.class deleted file mode 100644 index 682118a6..00000000 Binary files a/plugin/Raven.SQDev.Misc/bin/raven/sqdev/misc/EDataType$26.class and /dev/null differ diff --git a/plugin/Raven.SQDev.Misc/bin/raven/sqdev/misc/EDataType$27.class b/plugin/Raven.SQDev.Misc/bin/raven/sqdev/misc/EDataType$27.class deleted file mode 100644 index 2d4773f3..00000000 Binary files a/plugin/Raven.SQDev.Misc/bin/raven/sqdev/misc/EDataType$27.class and /dev/null differ diff --git a/plugin/Raven.SQDev.Misc/bin/raven/sqdev/misc/EDataType$28.class b/plugin/Raven.SQDev.Misc/bin/raven/sqdev/misc/EDataType$28.class deleted file mode 100644 index 3ea0b0cb..00000000 Binary files a/plugin/Raven.SQDev.Misc/bin/raven/sqdev/misc/EDataType$28.class and /dev/null differ diff --git a/plugin/Raven.SQDev.Misc/bin/raven/sqdev/misc/EDataType$29.class b/plugin/Raven.SQDev.Misc/bin/raven/sqdev/misc/EDataType$29.class deleted file mode 100644 index ed9aacbc..00000000 Binary files a/plugin/Raven.SQDev.Misc/bin/raven/sqdev/misc/EDataType$29.class and /dev/null differ diff --git a/plugin/Raven.SQDev.Misc/bin/raven/sqdev/misc/EDataType$3.class b/plugin/Raven.SQDev.Misc/bin/raven/sqdev/misc/EDataType$3.class deleted file mode 100644 index 7f3c5a47..00000000 Binary files a/plugin/Raven.SQDev.Misc/bin/raven/sqdev/misc/EDataType$3.class and /dev/null differ diff --git a/plugin/Raven.SQDev.Misc/bin/raven/sqdev/misc/EDataType$30.class b/plugin/Raven.SQDev.Misc/bin/raven/sqdev/misc/EDataType$30.class deleted file mode 100644 index cb9107bd..00000000 Binary files a/plugin/Raven.SQDev.Misc/bin/raven/sqdev/misc/EDataType$30.class and /dev/null differ diff --git a/plugin/Raven.SQDev.Misc/bin/raven/sqdev/misc/EDataType$31.class b/plugin/Raven.SQDev.Misc/bin/raven/sqdev/misc/EDataType$31.class deleted file mode 100644 index 4e8c3e28..00000000 Binary files a/plugin/Raven.SQDev.Misc/bin/raven/sqdev/misc/EDataType$31.class and /dev/null differ diff --git a/plugin/Raven.SQDev.Misc/bin/raven/sqdev/misc/EDataType$32.class b/plugin/Raven.SQDev.Misc/bin/raven/sqdev/misc/EDataType$32.class deleted file mode 100644 index ed7832d3..00000000 Binary files a/plugin/Raven.SQDev.Misc/bin/raven/sqdev/misc/EDataType$32.class and /dev/null differ diff --git a/plugin/Raven.SQDev.Misc/bin/raven/sqdev/misc/EDataType$33.class b/plugin/Raven.SQDev.Misc/bin/raven/sqdev/misc/EDataType$33.class deleted file mode 100644 index a1b56e16..00000000 Binary files a/plugin/Raven.SQDev.Misc/bin/raven/sqdev/misc/EDataType$33.class and /dev/null differ diff --git a/plugin/Raven.SQDev.Misc/bin/raven/sqdev/misc/EDataType$34.class b/plugin/Raven.SQDev.Misc/bin/raven/sqdev/misc/EDataType$34.class deleted file mode 100644 index 5c8aef43..00000000 Binary files a/plugin/Raven.SQDev.Misc/bin/raven/sqdev/misc/EDataType$34.class and /dev/null differ diff --git a/plugin/Raven.SQDev.Misc/bin/raven/sqdev/misc/EDataType$35.class b/plugin/Raven.SQDev.Misc/bin/raven/sqdev/misc/EDataType$35.class deleted file mode 100644 index 86bac5ab..00000000 Binary files a/plugin/Raven.SQDev.Misc/bin/raven/sqdev/misc/EDataType$35.class and /dev/null differ diff --git a/plugin/Raven.SQDev.Misc/bin/raven/sqdev/misc/EDataType$36.class b/plugin/Raven.SQDev.Misc/bin/raven/sqdev/misc/EDataType$36.class deleted file mode 100644 index 667c255d..00000000 Binary files a/plugin/Raven.SQDev.Misc/bin/raven/sqdev/misc/EDataType$36.class and /dev/null differ diff --git a/plugin/Raven.SQDev.Misc/bin/raven/sqdev/misc/EDataType$37.class b/plugin/Raven.SQDev.Misc/bin/raven/sqdev/misc/EDataType$37.class deleted file mode 100644 index b882dbf2..00000000 Binary files a/plugin/Raven.SQDev.Misc/bin/raven/sqdev/misc/EDataType$37.class and /dev/null differ diff --git a/plugin/Raven.SQDev.Misc/bin/raven/sqdev/misc/EDataType$38.class b/plugin/Raven.SQDev.Misc/bin/raven/sqdev/misc/EDataType$38.class deleted file mode 100644 index 5e15e07d..00000000 Binary files a/plugin/Raven.SQDev.Misc/bin/raven/sqdev/misc/EDataType$38.class and /dev/null differ diff --git a/plugin/Raven.SQDev.Misc/bin/raven/sqdev/misc/EDataType$39.class b/plugin/Raven.SQDev.Misc/bin/raven/sqdev/misc/EDataType$39.class deleted file mode 100644 index 5c85dafe..00000000 Binary files a/plugin/Raven.SQDev.Misc/bin/raven/sqdev/misc/EDataType$39.class and /dev/null differ diff --git a/plugin/Raven.SQDev.Misc/bin/raven/sqdev/misc/EDataType$4.class b/plugin/Raven.SQDev.Misc/bin/raven/sqdev/misc/EDataType$4.class deleted file mode 100644 index 5492aab3..00000000 Binary files a/plugin/Raven.SQDev.Misc/bin/raven/sqdev/misc/EDataType$4.class and /dev/null differ diff --git a/plugin/Raven.SQDev.Misc/bin/raven/sqdev/misc/EDataType$40.class b/plugin/Raven.SQDev.Misc/bin/raven/sqdev/misc/EDataType$40.class deleted file mode 100644 index 5dc33865..00000000 Binary files a/plugin/Raven.SQDev.Misc/bin/raven/sqdev/misc/EDataType$40.class and /dev/null differ diff --git a/plugin/Raven.SQDev.Misc/bin/raven/sqdev/misc/EDataType$41.class b/plugin/Raven.SQDev.Misc/bin/raven/sqdev/misc/EDataType$41.class deleted file mode 100644 index 41909b52..00000000 Binary files a/plugin/Raven.SQDev.Misc/bin/raven/sqdev/misc/EDataType$41.class and /dev/null differ diff --git a/plugin/Raven.SQDev.Misc/bin/raven/sqdev/misc/EDataType$42.class b/plugin/Raven.SQDev.Misc/bin/raven/sqdev/misc/EDataType$42.class deleted file mode 100644 index 25b1d685..00000000 Binary files a/plugin/Raven.SQDev.Misc/bin/raven/sqdev/misc/EDataType$42.class and /dev/null differ diff --git a/plugin/Raven.SQDev.Misc/bin/raven/sqdev/misc/EDataType$43.class b/plugin/Raven.SQDev.Misc/bin/raven/sqdev/misc/EDataType$43.class deleted file mode 100644 index 86515cc5..00000000 Binary files a/plugin/Raven.SQDev.Misc/bin/raven/sqdev/misc/EDataType$43.class and /dev/null differ diff --git a/plugin/Raven.SQDev.Misc/bin/raven/sqdev/misc/EDataType$44.class b/plugin/Raven.SQDev.Misc/bin/raven/sqdev/misc/EDataType$44.class deleted file mode 100644 index 3d78449d..00000000 Binary files a/plugin/Raven.SQDev.Misc/bin/raven/sqdev/misc/EDataType$44.class and /dev/null differ diff --git a/plugin/Raven.SQDev.Misc/bin/raven/sqdev/misc/EDataType$45.class b/plugin/Raven.SQDev.Misc/bin/raven/sqdev/misc/EDataType$45.class deleted file mode 100644 index c70fac43..00000000 Binary files a/plugin/Raven.SQDev.Misc/bin/raven/sqdev/misc/EDataType$45.class and /dev/null differ diff --git a/plugin/Raven.SQDev.Misc/bin/raven/sqdev/misc/EDataType$46.class b/plugin/Raven.SQDev.Misc/bin/raven/sqdev/misc/EDataType$46.class deleted file mode 100644 index 66a7b712..00000000 Binary files a/plugin/Raven.SQDev.Misc/bin/raven/sqdev/misc/EDataType$46.class and /dev/null differ diff --git a/plugin/Raven.SQDev.Misc/bin/raven/sqdev/misc/EDataType$47.class b/plugin/Raven.SQDev.Misc/bin/raven/sqdev/misc/EDataType$47.class deleted file mode 100644 index 24ff137e..00000000 Binary files a/plugin/Raven.SQDev.Misc/bin/raven/sqdev/misc/EDataType$47.class and /dev/null differ diff --git a/plugin/Raven.SQDev.Misc/bin/raven/sqdev/misc/EDataType$48.class b/plugin/Raven.SQDev.Misc/bin/raven/sqdev/misc/EDataType$48.class deleted file mode 100644 index 88945ab6..00000000 Binary files a/plugin/Raven.SQDev.Misc/bin/raven/sqdev/misc/EDataType$48.class and /dev/null differ diff --git a/plugin/Raven.SQDev.Misc/bin/raven/sqdev/misc/EDataType$5.class b/plugin/Raven.SQDev.Misc/bin/raven/sqdev/misc/EDataType$5.class deleted file mode 100644 index 1be4fc89..00000000 Binary files a/plugin/Raven.SQDev.Misc/bin/raven/sqdev/misc/EDataType$5.class and /dev/null differ diff --git a/plugin/Raven.SQDev.Misc/bin/raven/sqdev/misc/EDataType$6.class b/plugin/Raven.SQDev.Misc/bin/raven/sqdev/misc/EDataType$6.class deleted file mode 100644 index 0374277a..00000000 Binary files a/plugin/Raven.SQDev.Misc/bin/raven/sqdev/misc/EDataType$6.class and /dev/null differ diff --git a/plugin/Raven.SQDev.Misc/bin/raven/sqdev/misc/EDataType$7.class b/plugin/Raven.SQDev.Misc/bin/raven/sqdev/misc/EDataType$7.class deleted file mode 100644 index ea3216d4..00000000 Binary files a/plugin/Raven.SQDev.Misc/bin/raven/sqdev/misc/EDataType$7.class and /dev/null differ diff --git a/plugin/Raven.SQDev.Misc/bin/raven/sqdev/misc/EDataType$8.class b/plugin/Raven.SQDev.Misc/bin/raven/sqdev/misc/EDataType$8.class deleted file mode 100644 index 385aa6b8..00000000 Binary files a/plugin/Raven.SQDev.Misc/bin/raven/sqdev/misc/EDataType$8.class and /dev/null differ diff --git a/plugin/Raven.SQDev.Misc/bin/raven/sqdev/misc/EDataType$9.class b/plugin/Raven.SQDev.Misc/bin/raven/sqdev/misc/EDataType$9.class deleted file mode 100644 index e5691a27..00000000 Binary files a/plugin/Raven.SQDev.Misc/bin/raven/sqdev/misc/EDataType$9.class and /dev/null differ diff --git a/plugin/Raven.SQDev.Misc/bin/raven/sqdev/misc/EDataType.class b/plugin/Raven.SQDev.Misc/bin/raven/sqdev/misc/EDataType.class deleted file mode 100644 index d8a50918..00000000 Binary files a/plugin/Raven.SQDev.Misc/bin/raven/sqdev/misc/EDataType.class and /dev/null differ diff --git a/plugin/Raven.SQDev.Misc/bin/raven/sqdev/misc/FileUtil.class b/plugin/Raven.SQDev.Misc/bin/raven/sqdev/misc/FileUtil.class deleted file mode 100644 index 69aeb85f..00000000 Binary files a/plugin/Raven.SQDev.Misc/bin/raven/sqdev/misc/FileUtil.class and /dev/null differ diff --git a/plugin/Raven.SQDev.Misc/bin/raven/sqdev/misc/LineBuffer.class b/plugin/Raven.SQDev.Misc/bin/raven/sqdev/misc/LineBuffer.class deleted file mode 100644 index e140dbbc..00000000 Binary files a/plugin/Raven.SQDev.Misc/bin/raven/sqdev/misc/LineBuffer.class and /dev/null differ diff --git a/plugin/Raven.SQDev.Misc/bin/raven/sqdev/misc/ListUtils.class b/plugin/Raven.SQDev.Misc/bin/raven/sqdev/misc/ListUtils.class deleted file mode 100644 index 3a6dce1e..00000000 Binary files a/plugin/Raven.SQDev.Misc/bin/raven/sqdev/misc/ListUtils.class and /dev/null differ diff --git a/plugin/Raven.SQDev.Misc/bin/raven/sqdev/misc/Macro.class b/plugin/Raven.SQDev.Misc/bin/raven/sqdev/misc/Macro.class deleted file mode 100644 index c6e18e93..00000000 Binary files a/plugin/Raven.SQDev.Misc/bin/raven/sqdev/misc/Macro.class and /dev/null differ diff --git a/plugin/Raven.SQDev.Misc/bin/raven/sqdev/misc/Marker.class b/plugin/Raven.SQDev.Misc/bin/raven/sqdev/misc/Marker.class deleted file mode 100644 index 3b6698a0..00000000 Binary files a/plugin/Raven.SQDev.Misc/bin/raven/sqdev/misc/Marker.class and /dev/null differ diff --git a/plugin/Raven.SQDev.Misc/bin/raven/sqdev/misc/MultiPreferenceStore.class b/plugin/Raven.SQDev.Misc/bin/raven/sqdev/misc/MultiPreferenceStore.class deleted file mode 100644 index a562cd70..00000000 Binary files a/plugin/Raven.SQDev.Misc/bin/raven/sqdev/misc/MultiPreferenceStore.class and /dev/null differ diff --git a/plugin/Raven.SQDev.Misc/bin/raven/sqdev/misc/Pair.class b/plugin/Raven.SQDev.Misc/bin/raven/sqdev/misc/Pair.class deleted file mode 100644 index 6f3f36b0..00000000 Binary files a/plugin/Raven.SQDev.Misc/bin/raven/sqdev/misc/Pair.class and /dev/null differ diff --git a/plugin/Raven.SQDev.Misc/bin/raven/sqdev/misc/SQDev.class b/plugin/Raven.SQDev.Misc/bin/raven/sqdev/misc/SQDev.class deleted file mode 100644 index dda22df9..00000000 Binary files a/plugin/Raven.SQDev.Misc/bin/raven/sqdev/misc/SQDev.class and /dev/null differ diff --git a/plugin/Raven.SQDev.Misc/bin/raven/sqdev/misc/SQDevComposite.class b/plugin/Raven.SQDev.Misc/bin/raven/sqdev/misc/SQDevComposite.class deleted file mode 100644 index 0b72b913..00000000 Binary files a/plugin/Raven.SQDev.Misc/bin/raven/sqdev/misc/SQDevComposite.class and /dev/null differ diff --git a/plugin/Raven.SQDev.Misc/bin/raven/sqdev/misc/SQDevInfobox$1.class b/plugin/Raven.SQDev.Misc/bin/raven/sqdev/misc/SQDevInfobox$1.class deleted file mode 100644 index aa0aae47..00000000 Binary files a/plugin/Raven.SQDev.Misc/bin/raven/sqdev/misc/SQDevInfobox$1.class and /dev/null differ diff --git a/plugin/Raven.SQDev.Misc/bin/raven/sqdev/misc/SQDevInfobox.class b/plugin/Raven.SQDev.Misc/bin/raven/sqdev/misc/SQDevInfobox.class deleted file mode 100644 index f2d5a42d..00000000 Binary files a/plugin/Raven.SQDev.Misc/bin/raven/sqdev/misc/SQDevInfobox.class and /dev/null differ diff --git a/plugin/Raven.SQDev.Misc/bin/raven/sqdev/misc/SQDevPreferenceUtil.class b/plugin/Raven.SQDev.Misc/bin/raven/sqdev/misc/SQDevPreferenceUtil.class deleted file mode 100644 index 1f8f54e7..00000000 Binary files a/plugin/Raven.SQDev.Misc/bin/raven/sqdev/misc/SQDevPreferenceUtil.class and /dev/null differ diff --git a/plugin/Raven.SQDev.Misc/bin/raven/sqdev/misc/SQDevProjectNature.class b/plugin/Raven.SQDev.Misc/bin/raven/sqdev/misc/SQDevProjectNature.class deleted file mode 100644 index 27e99ac2..00000000 Binary files a/plugin/Raven.SQDev.Misc/bin/raven/sqdev/misc/SQDevProjectNature.class and /dev/null differ diff --git a/plugin/Raven.SQDev.Misc/bin/raven/sqdev/misc/StringProposalInformationCategory.class b/plugin/Raven.SQDev.Misc/bin/raven/sqdev/misc/StringProposalInformationCategory.class deleted file mode 100644 index b95c1d69..00000000 Binary files a/plugin/Raven.SQDev.Misc/bin/raven/sqdev/misc/StringProposalInformationCategory.class and /dev/null differ diff --git a/plugin/Raven.SQDev.Misc/bin/raven/sqdev/misc/StyledProposalInformationCategory.class b/plugin/Raven.SQDev.Misc/bin/raven/sqdev/misc/StyledProposalInformationCategory.class deleted file mode 100644 index 25005590..00000000 Binary files a/plugin/Raven.SQDev.Misc/bin/raven/sqdev/misc/StyledProposalInformationCategory.class and /dev/null differ diff --git a/plugin/Raven.SQDev.Misc/bin/raven/sqdev/misc/StyledRegion.class b/plugin/Raven.SQDev.Misc/bin/raven/sqdev/misc/StyledRegion.class deleted file mode 100644 index 097186d2..00000000 Binary files a/plugin/Raven.SQDev.Misc/bin/raven/sqdev/misc/StyledRegion.class and /dev/null differ diff --git a/plugin/Raven.SQDev.Misc/bin/raven/sqdev/misc/TextUtils.class b/plugin/Raven.SQDev.Misc/bin/raven/sqdev/misc/TextUtils.class deleted file mode 100644 index 37972e0d..00000000 Binary files a/plugin/Raven.SQDev.Misc/bin/raven/sqdev/misc/TextUtils.class and /dev/null differ diff --git a/plugin/Raven.SQDev.Misc/bin/raven/sqdev/misc/TreeUtils.class b/plugin/Raven.SQDev.Misc/bin/raven/sqdev/misc/TreeUtils.class deleted file mode 100644 index b5516f66..00000000 Binary files a/plugin/Raven.SQDev.Misc/bin/raven/sqdev/misc/TreeUtils.class and /dev/null differ diff --git a/plugin/Raven.SQDev.Misc/bin/raven/sqdev/misc/UpdateReporter.class b/plugin/Raven.SQDev.Misc/bin/raven/sqdev/misc/UpdateReporter.class deleted file mode 100644 index a016c92e..00000000 Binary files a/plugin/Raven.SQDev.Misc/bin/raven/sqdev/misc/UpdateReporter.class and /dev/null differ diff --git a/plugin/Raven.SQDev.Misc/bin/raven/sqdev/misc/VersionChangeEvent.class b/plugin/Raven.SQDev.Misc/bin/raven/sqdev/misc/VersionChangeEvent.class deleted file mode 100644 index e15a8bbe..00000000 Binary files a/plugin/Raven.SQDev.Misc/bin/raven/sqdev/misc/VersionChangeEvent.class and /dev/null differ diff --git a/plugin/Raven.SQDev.Misc/bin/raven/sqdev/parser/misc/BasicErrorListener.class b/plugin/Raven.SQDev.Misc/bin/raven/sqdev/parser/misc/BasicErrorListener.class deleted file mode 100644 index 9cb0965a..00000000 Binary files a/plugin/Raven.SQDev.Misc/bin/raven/sqdev/parser/misc/BasicErrorListener.class and /dev/null differ diff --git a/plugin/Raven.SQDev.Misc/bin/raven/sqdev/parser/misc/ParseResult.class b/plugin/Raven.SQDev.Misc/bin/raven/sqdev/parser/misc/ParseResult.class deleted file mode 100644 index e06e4a92..00000000 Binary files a/plugin/Raven.SQDev.Misc/bin/raven/sqdev/parser/misc/ParseResult.class and /dev/null differ diff --git a/plugin/Raven.SQDev.Misc/bin/raven/sqdev/parser/misc/ParseUtil.class b/plugin/Raven.SQDev.Misc/bin/raven/sqdev/parser/misc/ParseUtil.class deleted file mode 100644 index 92164f76..00000000 Binary files a/plugin/Raven.SQDev.Misc/bin/raven/sqdev/parser/misc/ParseUtil.class and /dev/null differ diff --git a/plugin/Raven.SQDev.Misc/bin/raven/sqdev/parser/preprocessor/Preprocessor.tokens b/plugin/Raven.SQDev.Misc/bin/raven/sqdev/parser/preprocessor/Preprocessor.tokens deleted file mode 100644 index 63badf73..00000000 --- a/plugin/Raven.SQDev.Misc/bin/raven/sqdev/parser/preprocessor/Preprocessor.tokens +++ /dev/null @@ -1,31 +0,0 @@ -COMMENT=1 -WS=2 -PREP_PREFIX=3 -NL=4 -INCLUDE=5 -DEFINE=6 -UNDEFINE=7 -IF=8 -IFN=9 -ELSE=10 -ENDIF=11 -LPAREN=12 -RPAREN=13 -COMMA=14 -STRING=15 -ID=16 -LETTER=17 -INT=18 -OTHER=19 -'#'=3 -'\n'=4 -'#include'=5 -'#define'=6 -'#undef'=7 -'#ifdef'=8 -'#ifndef'=9 -'#else'=10 -'#endif'=11 -'('=12 -')'=13 -','=14 diff --git a/plugin/Raven.SQDev.Misc/bin/raven/sqdev/parser/preprocessor/PreprocessorBaseListener.class b/plugin/Raven.SQDev.Misc/bin/raven/sqdev/parser/preprocessor/PreprocessorBaseListener.class deleted file mode 100644 index 71436786..00000000 Binary files a/plugin/Raven.SQDev.Misc/bin/raven/sqdev/parser/preprocessor/PreprocessorBaseListener.class and /dev/null differ diff --git a/plugin/Raven.SQDev.Misc/bin/raven/sqdev/parser/preprocessor/PreprocessorBaseVisitor.class b/plugin/Raven.SQDev.Misc/bin/raven/sqdev/parser/preprocessor/PreprocessorBaseVisitor.class deleted file mode 100644 index 30cba504..00000000 Binary files a/plugin/Raven.SQDev.Misc/bin/raven/sqdev/parser/preprocessor/PreprocessorBaseVisitor.class and /dev/null differ diff --git a/plugin/Raven.SQDev.Misc/bin/raven/sqdev/parser/preprocessor/PreprocessorErrorListener.class b/plugin/Raven.SQDev.Misc/bin/raven/sqdev/parser/preprocessor/PreprocessorErrorListener.class deleted file mode 100644 index 2392de68..00000000 Binary files a/plugin/Raven.SQDev.Misc/bin/raven/sqdev/parser/preprocessor/PreprocessorErrorListener.class and /dev/null differ diff --git a/plugin/Raven.SQDev.Misc/bin/raven/sqdev/parser/preprocessor/PreprocessorLexer.class b/plugin/Raven.SQDev.Misc/bin/raven/sqdev/parser/preprocessor/PreprocessorLexer.class deleted file mode 100644 index 43b422d3..00000000 Binary files a/plugin/Raven.SQDev.Misc/bin/raven/sqdev/parser/preprocessor/PreprocessorLexer.class and /dev/null differ diff --git a/plugin/Raven.SQDev.Misc/bin/raven/sqdev/parser/preprocessor/PreprocessorLexer.tokens b/plugin/Raven.SQDev.Misc/bin/raven/sqdev/parser/preprocessor/PreprocessorLexer.tokens deleted file mode 100644 index 63badf73..00000000 --- a/plugin/Raven.SQDev.Misc/bin/raven/sqdev/parser/preprocessor/PreprocessorLexer.tokens +++ /dev/null @@ -1,31 +0,0 @@ -COMMENT=1 -WS=2 -PREP_PREFIX=3 -NL=4 -INCLUDE=5 -DEFINE=6 -UNDEFINE=7 -IF=8 -IFN=9 -ELSE=10 -ENDIF=11 -LPAREN=12 -RPAREN=13 -COMMA=14 -STRING=15 -ID=16 -LETTER=17 -INT=18 -OTHER=19 -'#'=3 -'\n'=4 -'#include'=5 -'#define'=6 -'#undef'=7 -'#ifdef'=8 -'#ifndef'=9 -'#else'=10 -'#endif'=11 -'('=12 -')'=13 -','=14 diff --git a/plugin/Raven.SQDev.Misc/bin/raven/sqdev/parser/preprocessor/PreprocessorListener.class b/plugin/Raven.SQDev.Misc/bin/raven/sqdev/parser/preprocessor/PreprocessorListener.class deleted file mode 100644 index 41ac685b..00000000 Binary files a/plugin/Raven.SQDev.Misc/bin/raven/sqdev/parser/preprocessor/PreprocessorListener.class and /dev/null differ diff --git a/plugin/Raven.SQDev.Misc/bin/raven/sqdev/parser/preprocessor/PreprocessorParseListener$1.class b/plugin/Raven.SQDev.Misc/bin/raven/sqdev/parser/preprocessor/PreprocessorParseListener$1.class deleted file mode 100644 index d7095c8c..00000000 Binary files a/plugin/Raven.SQDev.Misc/bin/raven/sqdev/parser/preprocessor/PreprocessorParseListener$1.class and /dev/null differ diff --git a/plugin/Raven.SQDev.Misc/bin/raven/sqdev/parser/preprocessor/PreprocessorParseListener$2.class b/plugin/Raven.SQDev.Misc/bin/raven/sqdev/parser/preprocessor/PreprocessorParseListener$2.class deleted file mode 100644 index 51d1b280..00000000 Binary files a/plugin/Raven.SQDev.Misc/bin/raven/sqdev/parser/preprocessor/PreprocessorParseListener$2.class and /dev/null differ diff --git a/plugin/Raven.SQDev.Misc/bin/raven/sqdev/parser/preprocessor/PreprocessorParseListener.class b/plugin/Raven.SQDev.Misc/bin/raven/sqdev/parser/preprocessor/PreprocessorParseListener.class deleted file mode 100644 index ea776327..00000000 Binary files a/plugin/Raven.SQDev.Misc/bin/raven/sqdev/parser/preprocessor/PreprocessorParseListener.class and /dev/null differ diff --git a/plugin/Raven.SQDev.Misc/bin/raven/sqdev/parser/preprocessor/PreprocessorParseResult.class b/plugin/Raven.SQDev.Misc/bin/raven/sqdev/parser/preprocessor/PreprocessorParseResult.class deleted file mode 100644 index e2084e74..00000000 Binary files a/plugin/Raven.SQDev.Misc/bin/raven/sqdev/parser/preprocessor/PreprocessorParseResult.class and /dev/null differ diff --git a/plugin/Raven.SQDev.Misc/bin/raven/sqdev/parser/preprocessor/PreprocessorParser$DefineContext.class b/plugin/Raven.SQDev.Misc/bin/raven/sqdev/parser/preprocessor/PreprocessorParser$DefineContext.class deleted file mode 100644 index ecc43f24..00000000 Binary files a/plugin/Raven.SQDev.Misc/bin/raven/sqdev/parser/preprocessor/PreprocessorParser$DefineContext.class and /dev/null differ diff --git a/plugin/Raven.SQDev.Misc/bin/raven/sqdev/parser/preprocessor/PreprocessorParser$ErrorContext.class b/plugin/Raven.SQDev.Misc/bin/raven/sqdev/parser/preprocessor/PreprocessorParser$ErrorContext.class deleted file mode 100644 index 393c388b..00000000 Binary files a/plugin/Raven.SQDev.Misc/bin/raven/sqdev/parser/preprocessor/PreprocessorParser$ErrorContext.class and /dev/null differ diff --git a/plugin/Raven.SQDev.Misc/bin/raven/sqdev/parser/preprocessor/PreprocessorParser$IncludeContext.class b/plugin/Raven.SQDev.Misc/bin/raven/sqdev/parser/preprocessor/PreprocessorParser$IncludeContext.class deleted file mode 100644 index 9ae80eab..00000000 Binary files a/plugin/Raven.SQDev.Misc/bin/raven/sqdev/parser/preprocessor/PreprocessorParser$IncludeContext.class and /dev/null differ diff --git a/plugin/Raven.SQDev.Misc/bin/raven/sqdev/parser/preprocessor/PreprocessorParser$MacroArgsContext.class b/plugin/Raven.SQDev.Misc/bin/raven/sqdev/parser/preprocessor/PreprocessorParser$MacroArgsContext.class deleted file mode 100644 index 86a60263..00000000 Binary files a/plugin/Raven.SQDev.Misc/bin/raven/sqdev/parser/preprocessor/PreprocessorParser$MacroArgsContext.class and /dev/null differ diff --git a/plugin/Raven.SQDev.Misc/bin/raven/sqdev/parser/preprocessor/PreprocessorParser$OtherContext.class b/plugin/Raven.SQDev.Misc/bin/raven/sqdev/parser/preprocessor/PreprocessorParser$OtherContext.class deleted file mode 100644 index 182281a2..00000000 Binary files a/plugin/Raven.SQDev.Misc/bin/raven/sqdev/parser/preprocessor/PreprocessorParser$OtherContext.class and /dev/null differ diff --git a/plugin/Raven.SQDev.Misc/bin/raven/sqdev/parser/preprocessor/PreprocessorParser$PrepIfContext.class b/plugin/Raven.SQDev.Misc/bin/raven/sqdev/parser/preprocessor/PreprocessorParser$PrepIfContext.class deleted file mode 100644 index 6b97408c..00000000 Binary files a/plugin/Raven.SQDev.Misc/bin/raven/sqdev/parser/preprocessor/PreprocessorParser$PrepIfContext.class and /dev/null differ diff --git a/plugin/Raven.SQDev.Misc/bin/raven/sqdev/parser/preprocessor/PreprocessorParser$PreprocessorStatementContext.class b/plugin/Raven.SQDev.Misc/bin/raven/sqdev/parser/preprocessor/PreprocessorParser$PreprocessorStatementContext.class deleted file mode 100644 index 024a7b37..00000000 Binary files a/plugin/Raven.SQDev.Misc/bin/raven/sqdev/parser/preprocessor/PreprocessorParser$PreprocessorStatementContext.class and /dev/null differ diff --git a/plugin/Raven.SQDev.Misc/bin/raven/sqdev/parser/preprocessor/PreprocessorParser$StartContext.class b/plugin/Raven.SQDev.Misc/bin/raven/sqdev/parser/preprocessor/PreprocessorParser$StartContext.class deleted file mode 100644 index c698844d..00000000 Binary files a/plugin/Raven.SQDev.Misc/bin/raven/sqdev/parser/preprocessor/PreprocessorParser$StartContext.class and /dev/null differ diff --git a/plugin/Raven.SQDev.Misc/bin/raven/sqdev/parser/preprocessor/PreprocessorParser$UndefineContext.class b/plugin/Raven.SQDev.Misc/bin/raven/sqdev/parser/preprocessor/PreprocessorParser$UndefineContext.class deleted file mode 100644 index e5a4f0e7..00000000 Binary files a/plugin/Raven.SQDev.Misc/bin/raven/sqdev/parser/preprocessor/PreprocessorParser$UndefineContext.class and /dev/null differ diff --git a/plugin/Raven.SQDev.Misc/bin/raven/sqdev/parser/preprocessor/PreprocessorParser.class b/plugin/Raven.SQDev.Misc/bin/raven/sqdev/parser/preprocessor/PreprocessorParser.class deleted file mode 100644 index ec1fc4ab..00000000 Binary files a/plugin/Raven.SQDev.Misc/bin/raven/sqdev/parser/preprocessor/PreprocessorParser.class and /dev/null differ diff --git a/plugin/Raven.SQDev.Misc/bin/raven/sqdev/parser/preprocessor/PreprocessorVisitor.class b/plugin/Raven.SQDev.Misc/bin/raven/sqdev/parser/preprocessor/PreprocessorVisitor.class deleted file mode 100644 index c5748423..00000000 Binary files a/plugin/Raven.SQDev.Misc/bin/raven/sqdev/parser/preprocessor/PreprocessorVisitor.class and /dev/null differ diff --git a/plugin/Raven.SQDev.Misc/bin/raven/sqdev/parser/sqf/ERelativPosition.class b/plugin/Raven.SQDev.Misc/bin/raven/sqdev/parser/sqf/ERelativPosition.class deleted file mode 100644 index 479c54b4..00000000 Binary files a/plugin/Raven.SQDev.Misc/bin/raven/sqdev/parser/sqf/ERelativPosition.class and /dev/null differ diff --git a/plugin/Raven.SQDev.Misc/bin/raven/sqdev/parser/sqf/SQF.tokens b/plugin/Raven.SQDev.Misc/bin/raven/sqdev/parser/sqf/SQF.tokens deleted file mode 100644 index fd7116b5..00000000 --- a/plugin/Raven.SQDev.Misc/bin/raven/sqdev/parser/sqf/SQF.tokens +++ /dev/null @@ -1,42 +0,0 @@ -OPERATOR_PRECEDENCE_MULTIPLY=1 -OPERATOR_PRECEDENCE_ADD=2 -PUCTUATION_OTHER=3 -OR=4 -AND=5 -COMPARE_PRECEDENCE_OPERATOR=6 -ELSE=7 -POWER=8 -SEMICOLON=9 -COMMA=10 -EQUALS=11 -PRIVATE=12 -MACRO_DECLARATION=13 -WHITESPACE=14 -COMMENT=15 -NUMBER=16 -ID=17 -BINARY_OPERATOR=18 -STRING=19 -C_B_O=20 -C_B_C=21 -S_B_O=22 -S_B_C=23 -R_B_O=24 -R_B_C=25 -OTHER=26 -MACRO_NAME=27 -UNARY_OPERATOR=28 -'!'=3 -'||'=4 -'&&'=5 -'^'=8 -';'=9 -','=10 -'='=11 -':'=18 -'{'=20 -'}'=21 -'['=22 -']'=23 -'('=24 -')'=25 diff --git a/plugin/Raven.SQDev.Misc/bin/raven/sqdev/parser/sqf/SQFBaseListener.class b/plugin/Raven.SQDev.Misc/bin/raven/sqdev/parser/sqf/SQFBaseListener.class deleted file mode 100644 index 90e46015..00000000 Binary files a/plugin/Raven.SQDev.Misc/bin/raven/sqdev/parser/sqf/SQFBaseListener.class and /dev/null differ diff --git a/plugin/Raven.SQDev.Misc/bin/raven/sqdev/parser/sqf/SQFBaseVisitor.class b/plugin/Raven.SQDev.Misc/bin/raven/sqdev/parser/sqf/SQFBaseVisitor.class deleted file mode 100644 index 58b8fd4c..00000000 Binary files a/plugin/Raven.SQDev.Misc/bin/raven/sqdev/parser/sqf/SQFBaseVisitor.class and /dev/null differ diff --git a/plugin/Raven.SQDev.Misc/bin/raven/sqdev/parser/sqf/SQFLexer.class b/plugin/Raven.SQDev.Misc/bin/raven/sqdev/parser/sqf/SQFLexer.class deleted file mode 100644 index 1539b412..00000000 Binary files a/plugin/Raven.SQDev.Misc/bin/raven/sqdev/parser/sqf/SQFLexer.class and /dev/null differ diff --git a/plugin/Raven.SQDev.Misc/bin/raven/sqdev/parser/sqf/SQFLexer.tokens b/plugin/Raven.SQDev.Misc/bin/raven/sqdev/parser/sqf/SQFLexer.tokens deleted file mode 100644 index 99407c04..00000000 --- a/plugin/Raven.SQDev.Misc/bin/raven/sqdev/parser/sqf/SQFLexer.tokens +++ /dev/null @@ -1,40 +0,0 @@ -OPERATOR_PRECEDENCE_MULTIPLY=1 -OPERATOR_PRECEDENCE_ADD=2 -PUCTUATION_OTHER=3 -OR=4 -AND=5 -COMPARE_PRECEDENCE_OPERATOR=6 -ELSE=7 -POWER=8 -SEMICOLON=9 -COMMA=10 -EQUALS=11 -PRIVATE=12 -MACRO_DECLARATION=13 -WHITESPACE=14 -COMMENT=15 -NUMBER=16 -ID=17 -BINARY_OPERATOR=18 -STRING=19 -C_B_O=20 -C_B_C=21 -S_B_O=22 -S_B_C=23 -R_B_O=24 -R_B_C=25 -OTHER=26 -'!'=3 -'||'=4 -'&&'=5 -'^'=8 -';'=9 -','=10 -'='=11 -':'=18 -'{'=20 -'}'=21 -'['=22 -']'=23 -'('=24 -')'=25 diff --git a/plugin/Raven.SQDev.Misc/bin/raven/sqdev/parser/sqf/SQFListener.class b/plugin/Raven.SQDev.Misc/bin/raven/sqdev/parser/sqf/SQFListener.class deleted file mode 100644 index a1e063d6..00000000 Binary files a/plugin/Raven.SQDev.Misc/bin/raven/sqdev/parser/sqf/SQFListener.class and /dev/null differ diff --git a/plugin/Raven.SQDev.Misc/bin/raven/sqdev/parser/sqf/SQFParseInformation.class b/plugin/Raven.SQDev.Misc/bin/raven/sqdev/parser/sqf/SQFParseInformation.class deleted file mode 100644 index f5615767..00000000 Binary files a/plugin/Raven.SQDev.Misc/bin/raven/sqdev/parser/sqf/SQFParseInformation.class and /dev/null differ diff --git a/plugin/Raven.SQDev.Misc/bin/raven/sqdev/parser/sqf/SQFParseResult.class b/plugin/Raven.SQDev.Misc/bin/raven/sqdev/parser/sqf/SQFParseResult.class deleted file mode 100644 index de427c7b..00000000 Binary files a/plugin/Raven.SQDev.Misc/bin/raven/sqdev/parser/sqf/SQFParseResult.class and /dev/null differ diff --git a/plugin/Raven.SQDev.Misc/bin/raven/sqdev/parser/sqf/SQFParser$ArrayContext.class b/plugin/Raven.SQDev.Misc/bin/raven/sqdev/parser/sqf/SQFParser$ArrayContext.class deleted file mode 100644 index 0fe851bf..00000000 Binary files a/plugin/Raven.SQDev.Misc/bin/raven/sqdev/parser/sqf/SQFParser$ArrayContext.class and /dev/null differ diff --git a/plugin/Raven.SQDev.Misc/bin/raven/sqdev/parser/sqf/SQFParser$AssignmentContext.class b/plugin/Raven.SQDev.Misc/bin/raven/sqdev/parser/sqf/SQFParser$AssignmentContext.class deleted file mode 100644 index 2bcd2073..00000000 Binary files a/plugin/Raven.SQDev.Misc/bin/raven/sqdev/parser/sqf/SQFParser$AssignmentContext.class and /dev/null differ diff --git a/plugin/Raven.SQDev.Misc/bin/raven/sqdev/parser/sqf/SQFParser$BinaryExpressionContext.class b/plugin/Raven.SQDev.Misc/bin/raven/sqdev/parser/sqf/SQFParser$BinaryExpressionContext.class deleted file mode 100644 index c0e78dd8..00000000 Binary files a/plugin/Raven.SQDev.Misc/bin/raven/sqdev/parser/sqf/SQFParser$BinaryExpressionContext.class and /dev/null differ diff --git a/plugin/Raven.SQDev.Misc/bin/raven/sqdev/parser/sqf/SQFParser$CodeContext.class b/plugin/Raven.SQDev.Misc/bin/raven/sqdev/parser/sqf/SQFParser$CodeContext.class deleted file mode 100644 index b3f839dd..00000000 Binary files a/plugin/Raven.SQDev.Misc/bin/raven/sqdev/parser/sqf/SQFParser$CodeContext.class and /dev/null differ diff --git a/plugin/Raven.SQDev.Misc/bin/raven/sqdev/parser/sqf/SQFParser$CommonErrorContext.class b/plugin/Raven.SQDev.Misc/bin/raven/sqdev/parser/sqf/SQFParser$CommonErrorContext.class deleted file mode 100644 index f846fa0c..00000000 Binary files a/plugin/Raven.SQDev.Misc/bin/raven/sqdev/parser/sqf/SQFParser$CommonErrorContext.class and /dev/null differ diff --git a/plugin/Raven.SQDev.Misc/bin/raven/sqdev/parser/sqf/SQFParser$ErrorContext.class b/plugin/Raven.SQDev.Misc/bin/raven/sqdev/parser/sqf/SQFParser$ErrorContext.class deleted file mode 100644 index a3e83537..00000000 Binary files a/plugin/Raven.SQDev.Misc/bin/raven/sqdev/parser/sqf/SQFParser$ErrorContext.class and /dev/null differ diff --git a/plugin/Raven.SQDev.Misc/bin/raven/sqdev/parser/sqf/SQFParser$InlineCodeContext.class b/plugin/Raven.SQDev.Misc/bin/raven/sqdev/parser/sqf/SQFParser$InlineCodeContext.class deleted file mode 100644 index e6d024be..00000000 Binary files a/plugin/Raven.SQDev.Misc/bin/raven/sqdev/parser/sqf/SQFParser$InlineCodeContext.class and /dev/null differ diff --git a/plugin/Raven.SQDev.Misc/bin/raven/sqdev/parser/sqf/SQFParser$MacroArgumentContext.class b/plugin/Raven.SQDev.Misc/bin/raven/sqdev/parser/sqf/SQFParser$MacroArgumentContext.class deleted file mode 100644 index 5503ec39..00000000 Binary files a/plugin/Raven.SQDev.Misc/bin/raven/sqdev/parser/sqf/SQFParser$MacroArgumentContext.class and /dev/null differ diff --git a/plugin/Raven.SQDev.Misc/bin/raven/sqdev/parser/sqf/SQFParser$MacroContext.class b/plugin/Raven.SQDev.Misc/bin/raven/sqdev/parser/sqf/SQFParser$MacroContext.class deleted file mode 100644 index 21d424dd..00000000 Binary files a/plugin/Raven.SQDev.Misc/bin/raven/sqdev/parser/sqf/SQFParser$MacroContext.class and /dev/null differ diff --git a/plugin/Raven.SQDev.Misc/bin/raven/sqdev/parser/sqf/SQFParser$NularExpressionContext.class b/plugin/Raven.SQDev.Misc/bin/raven/sqdev/parser/sqf/SQFParser$NularExpressionContext.class deleted file mode 100644 index 34cd63b5..00000000 Binary files a/plugin/Raven.SQDev.Misc/bin/raven/sqdev/parser/sqf/SQFParser$NularExpressionContext.class and /dev/null differ diff --git a/plugin/Raven.SQDev.Misc/bin/raven/sqdev/parser/sqf/SQFParser$NularOperatorContext.class b/plugin/Raven.SQDev.Misc/bin/raven/sqdev/parser/sqf/SQFParser$NularOperatorContext.class deleted file mode 100644 index dfb66415..00000000 Binary files a/plugin/Raven.SQDev.Misc/bin/raven/sqdev/parser/sqf/SQFParser$NularOperatorContext.class and /dev/null differ diff --git a/plugin/Raven.SQDev.Misc/bin/raven/sqdev/parser/sqf/SQFParser$NumberContext.class b/plugin/Raven.SQDev.Misc/bin/raven/sqdev/parser/sqf/SQFParser$NumberContext.class deleted file mode 100644 index 6c563ff6..00000000 Binary files a/plugin/Raven.SQDev.Misc/bin/raven/sqdev/parser/sqf/SQFParser$NumberContext.class and /dev/null differ diff --git a/plugin/Raven.SQDev.Misc/bin/raven/sqdev/parser/sqf/SQFParser$OperatorContext.class b/plugin/Raven.SQDev.Misc/bin/raven/sqdev/parser/sqf/SQFParser$OperatorContext.class deleted file mode 100644 index 7902a86f..00000000 Binary files a/plugin/Raven.SQDev.Misc/bin/raven/sqdev/parser/sqf/SQFParser$OperatorContext.class and /dev/null differ diff --git a/plugin/Raven.SQDev.Misc/bin/raven/sqdev/parser/sqf/SQFParser$ParenthesisContext.class b/plugin/Raven.SQDev.Misc/bin/raven/sqdev/parser/sqf/SQFParser$ParenthesisContext.class deleted file mode 100644 index 9cbc0565..00000000 Binary files a/plugin/Raven.SQDev.Misc/bin/raven/sqdev/parser/sqf/SQFParser$ParenthesisContext.class and /dev/null differ diff --git a/plugin/Raven.SQDev.Misc/bin/raven/sqdev/parser/sqf/SQFParser$PrimaryExpressionContext.class b/plugin/Raven.SQDev.Misc/bin/raven/sqdev/parser/sqf/SQFParser$PrimaryExpressionContext.class deleted file mode 100644 index 6204b112..00000000 Binary files a/plugin/Raven.SQDev.Misc/bin/raven/sqdev/parser/sqf/SQFParser$PrimaryExpressionContext.class and /dev/null differ diff --git a/plugin/Raven.SQDev.Misc/bin/raven/sqdev/parser/sqf/SQFParser$PunctuationContext.class b/plugin/Raven.SQDev.Misc/bin/raven/sqdev/parser/sqf/SQFParser$PunctuationContext.class deleted file mode 100644 index 422a1fc9..00000000 Binary files a/plugin/Raven.SQDev.Misc/bin/raven/sqdev/parser/sqf/SQFParser$PunctuationContext.class and /dev/null differ diff --git a/plugin/Raven.SQDev.Misc/bin/raven/sqdev/parser/sqf/SQFParser$StartContext.class b/plugin/Raven.SQDev.Misc/bin/raven/sqdev/parser/sqf/SQFParser$StartContext.class deleted file mode 100644 index ea937833..00000000 Binary files a/plugin/Raven.SQDev.Misc/bin/raven/sqdev/parser/sqf/SQFParser$StartContext.class and /dev/null differ diff --git a/plugin/Raven.SQDev.Misc/bin/raven/sqdev/parser/sqf/SQFParser$StatementContext.class b/plugin/Raven.SQDev.Misc/bin/raven/sqdev/parser/sqf/SQFParser$StatementContext.class deleted file mode 100644 index 687d3634..00000000 Binary files a/plugin/Raven.SQDev.Misc/bin/raven/sqdev/parser/sqf/SQFParser$StatementContext.class and /dev/null differ diff --git a/plugin/Raven.SQDev.Misc/bin/raven/sqdev/parser/sqf/SQFParser$StringContext.class b/plugin/Raven.SQDev.Misc/bin/raven/sqdev/parser/sqf/SQFParser$StringContext.class deleted file mode 100644 index b3301f10..00000000 Binary files a/plugin/Raven.SQDev.Misc/bin/raven/sqdev/parser/sqf/SQFParser$StringContext.class and /dev/null differ diff --git a/plugin/Raven.SQDev.Misc/bin/raven/sqdev/parser/sqf/SQFParser$UnaryExpressionContext.class b/plugin/Raven.SQDev.Misc/bin/raven/sqdev/parser/sqf/SQFParser$UnaryExpressionContext.class deleted file mode 100644 index 605a4e5c..00000000 Binary files a/plugin/Raven.SQDev.Misc/bin/raven/sqdev/parser/sqf/SQFParser$UnaryExpressionContext.class and /dev/null differ diff --git a/plugin/Raven.SQDev.Misc/bin/raven/sqdev/parser/sqf/SQFParser.class b/plugin/Raven.SQDev.Misc/bin/raven/sqdev/parser/sqf/SQFParser.class deleted file mode 100644 index deb841cb..00000000 Binary files a/plugin/Raven.SQDev.Misc/bin/raven/sqdev/parser/sqf/SQFParser.class and /dev/null differ diff --git a/plugin/Raven.SQDev.Misc/bin/raven/sqdev/parser/sqf/SQFSyntaxProcessor.class b/plugin/Raven.SQDev.Misc/bin/raven/sqdev/parser/sqf/SQFSyntaxProcessor.class deleted file mode 100644 index b1102fc7..00000000 Binary files a/plugin/Raven.SQDev.Misc/bin/raven/sqdev/parser/sqf/SQFSyntaxProcessor.class and /dev/null differ diff --git a/plugin/Raven.SQDev.Misc/bin/raven/sqdev/parser/sqf/SQFValidator.class b/plugin/Raven.SQDev.Misc/bin/raven/sqdev/parser/sqf/SQFValidator.class deleted file mode 100644 index 550ccd10..00000000 Binary files a/plugin/Raven.SQDev.Misc/bin/raven/sqdev/parser/sqf/SQFValidator.class and /dev/null differ diff --git a/plugin/Raven.SQDev.Misc/bin/raven/sqdev/parser/sqf/SQFVisitor.class b/plugin/Raven.SQDev.Misc/bin/raven/sqdev/parser/sqf/SQFVisitor.class deleted file mode 100644 index be481878..00000000 Binary files a/plugin/Raven.SQDev.Misc/bin/raven/sqdev/parser/sqf/SQFVisitor.class and /dev/null differ diff --git a/plugin/Raven.SQDev.Misc/bin/raven/sqdev/parser/sqf/tests/SQFParserTest$1.class b/plugin/Raven.SQDev.Misc/bin/raven/sqdev/parser/sqf/tests/SQFParserTest$1.class deleted file mode 100644 index a42e2ef5..00000000 Binary files a/plugin/Raven.SQDev.Misc/bin/raven/sqdev/parser/sqf/tests/SQFParserTest$1.class and /dev/null differ diff --git a/plugin/Raven.SQDev.Misc/bin/raven/sqdev/parser/sqf/tests/SQFParserTest.class b/plugin/Raven.SQDev.Misc/bin/raven/sqdev/parser/sqf/tests/SQFParserTest.class deleted file mode 100644 index d6cc3e70..00000000 Binary files a/plugin/Raven.SQDev.Misc/bin/raven/sqdev/parser/sqf/tests/SQFParserTest.class and /dev/null differ diff --git a/plugin/Raven.SQDev.Misc/bin/raven/sqdev/parser/sqf/tests/TestScripts/VariableDeclaration.sqf b/plugin/Raven.SQDev.Misc/bin/raven/sqdev/parser/sqf/tests/TestScripts/VariableDeclaration.sqf deleted file mode 100644 index 87237edd..00000000 --- a/plugin/Raven.SQDev.Misc/bin/raven/sqdev/parser/sqf/tests/TestScripts/VariableDeclaration.sqf +++ /dev/null @@ -1,39 +0,0 @@ -_myTestVar1 = 5; -_myTestVar2 = getPos player; - -params [ - ["_parameter1", nil, [0]], - ["_parameter2", nil, [[], 4]], - ["", nil, []], - ["_parameter4", nil, ["", objNull]] -]; - -{ - GlobalTestVar = "Hello World"; - - if (isNil "Miau") then { - _innerVariable = ["Hello", "There", "You", "Stranger"]; - - for "_forVar" from 0 to 12 step 3 do { - for[{_innerForVar = 0},{_innerForVar < 5},{_innerForVar = _innerForVar + 1}] do { - - }; - }; - }; -} count []; - -private ["_private1", "_private2"]; - -private _private3 = "Ola"; -// _commentVar = 5; } -/* - * CommentVar = "Mammamia"; - * ( - */ - -hint Implicit1; -[] call Implicit2; - -_ifVar = if(Implicit3) then {"One"} else {"Two"}; - -nil; \ No newline at end of file diff --git a/plugin/Raven.SQDev.Misc/bin/raven/sqdev/pluginManagement/ESQDevPlugin$1.class b/plugin/Raven.SQDev.Misc/bin/raven/sqdev/pluginManagement/ESQDevPlugin$1.class deleted file mode 100644 index 99e5283f..00000000 Binary files a/plugin/Raven.SQDev.Misc/bin/raven/sqdev/pluginManagement/ESQDevPlugin$1.class and /dev/null differ diff --git a/plugin/Raven.SQDev.Misc/bin/raven/sqdev/pluginManagement/ESQDevPlugin$2.class b/plugin/Raven.SQDev.Misc/bin/raven/sqdev/pluginManagement/ESQDevPlugin$2.class deleted file mode 100644 index 407d4fd7..00000000 Binary files a/plugin/Raven.SQDev.Misc/bin/raven/sqdev/pluginManagement/ESQDevPlugin$2.class and /dev/null differ diff --git a/plugin/Raven.SQDev.Misc/bin/raven/sqdev/pluginManagement/ESQDevPlugin$3.class b/plugin/Raven.SQDev.Misc/bin/raven/sqdev/pluginManagement/ESQDevPlugin$3.class deleted file mode 100644 index b31bf91c..00000000 Binary files a/plugin/Raven.SQDev.Misc/bin/raven/sqdev/pluginManagement/ESQDevPlugin$3.class and /dev/null differ diff --git a/plugin/Raven.SQDev.Misc/bin/raven/sqdev/pluginManagement/ESQDevPlugin$4.class b/plugin/Raven.SQDev.Misc/bin/raven/sqdev/pluginManagement/ESQDevPlugin$4.class deleted file mode 100644 index 9c23a4a6..00000000 Binary files a/plugin/Raven.SQDev.Misc/bin/raven/sqdev/pluginManagement/ESQDevPlugin$4.class and /dev/null differ diff --git a/plugin/Raven.SQDev.Misc/bin/raven/sqdev/pluginManagement/ESQDevPlugin$5.class b/plugin/Raven.SQDev.Misc/bin/raven/sqdev/pluginManagement/ESQDevPlugin$5.class deleted file mode 100644 index e38438a0..00000000 Binary files a/plugin/Raven.SQDev.Misc/bin/raven/sqdev/pluginManagement/ESQDevPlugin$5.class and /dev/null differ diff --git a/plugin/Raven.SQDev.Misc/bin/raven/sqdev/pluginManagement/ESQDevPlugin$6.class b/plugin/Raven.SQDev.Misc/bin/raven/sqdev/pluginManagement/ESQDevPlugin$6.class deleted file mode 100644 index a9d81bd7..00000000 Binary files a/plugin/Raven.SQDev.Misc/bin/raven/sqdev/pluginManagement/ESQDevPlugin$6.class and /dev/null differ diff --git a/plugin/Raven.SQDev.Misc/bin/raven/sqdev/pluginManagement/ESQDevPlugin$7.class b/plugin/Raven.SQDev.Misc/bin/raven/sqdev/pluginManagement/ESQDevPlugin$7.class deleted file mode 100644 index 45dd8e27..00000000 Binary files a/plugin/Raven.SQDev.Misc/bin/raven/sqdev/pluginManagement/ESQDevPlugin$7.class and /dev/null differ diff --git a/plugin/Raven.SQDev.Misc/bin/raven/sqdev/pluginManagement/ESQDevPlugin.class b/plugin/Raven.SQDev.Misc/bin/raven/sqdev/pluginManagement/ESQDevPlugin.class deleted file mode 100644 index cc95be04..00000000 Binary files a/plugin/Raven.SQDev.Misc/bin/raven/sqdev/pluginManagement/ESQDevPlugin.class and /dev/null differ diff --git a/plugin/Raven.SQDev.Misc/bin/raven/sqdev/pluginManagement/ResourceManager.class b/plugin/Raven.SQDev.Misc/bin/raven/sqdev/pluginManagement/ResourceManager.class deleted file mode 100644 index e650240f..00000000 Binary files a/plugin/Raven.SQDev.Misc/bin/raven/sqdev/pluginManagement/ResourceManager.class and /dev/null differ diff --git a/plugin/Raven.SQDev.Misc/bin/raven/sqdev/pluginManagement/SQDevEclipseEventManager$1$1.class b/plugin/Raven.SQDev.Misc/bin/raven/sqdev/pluginManagement/SQDevEclipseEventManager$1$1.class deleted file mode 100644 index e10f76f7..00000000 Binary files a/plugin/Raven.SQDev.Misc/bin/raven/sqdev/pluginManagement/SQDevEclipseEventManager$1$1.class and /dev/null differ diff --git a/plugin/Raven.SQDev.Misc/bin/raven/sqdev/pluginManagement/SQDevEclipseEventManager$1.class b/plugin/Raven.SQDev.Misc/bin/raven/sqdev/pluginManagement/SQDevEclipseEventManager$1.class deleted file mode 100644 index b87bc77e..00000000 Binary files a/plugin/Raven.SQDev.Misc/bin/raven/sqdev/pluginManagement/SQDevEclipseEventManager$1.class and /dev/null differ diff --git a/plugin/Raven.SQDev.Misc/bin/raven/sqdev/pluginManagement/SQDevEclipseEventManager.class b/plugin/Raven.SQDev.Misc/bin/raven/sqdev/pluginManagement/SQDevEclipseEventManager.class deleted file mode 100644 index f754c484..00000000 Binary files a/plugin/Raven.SQDev.Misc/bin/raven/sqdev/pluginManagement/SQDevEclipseEventManager.class and /dev/null differ diff --git a/plugin/Raven.SQDev.Misc/bin/raven/sqdev/pluginManagement/SQDevPluginManager.class b/plugin/Raven.SQDev.Misc/bin/raven/sqdev/pluginManagement/SQDevPluginManager.class deleted file mode 100644 index 993317ec..00000000 Binary files a/plugin/Raven.SQDev.Misc/bin/raven/sqdev/pluginManagement/SQDevPluginManager.class and /dev/null differ diff --git a/plugin/Raven.SQDev.Misc/bin/raven/sqdev/pluginManagement/VersionManager.class b/plugin/Raven.SQDev.Misc/bin/raven/sqdev/pluginManagement/VersionManager.class deleted file mode 100644 index 8916ce16..00000000 Binary files a/plugin/Raven.SQDev.Misc/bin/raven/sqdev/pluginManagement/VersionManager.class and /dev/null differ diff --git a/plugin/Raven.SQDev.Misc/bin/raven/sqdev/pluginManager/SQDevPluginManager.class b/plugin/Raven.SQDev.Misc/bin/raven/sqdev/pluginManager/SQDevPluginManager.class deleted file mode 100644 index cf9d8a72..00000000 Binary files a/plugin/Raven.SQDev.Misc/bin/raven/sqdev/pluginManager/SQDevPluginManager.class and /dev/null differ diff --git a/plugin/Raven.SQDev.Misc/bin/raven/sqdev/styles/BoldStyle.class b/plugin/Raven.SQDev.Misc/bin/raven/sqdev/styles/BoldStyle.class deleted file mode 100644 index a7519afe..00000000 Binary files a/plugin/Raven.SQDev.Misc/bin/raven/sqdev/styles/BoldStyle.class and /dev/null differ diff --git a/plugin/Raven.SQDev.Misc/bin/raven/sqdev/styles/CodeStyle.class b/plugin/Raven.SQDev.Misc/bin/raven/sqdev/styles/CodeStyle.class deleted file mode 100644 index 6c853f24..00000000 Binary files a/plugin/Raven.SQDev.Misc/bin/raven/sqdev/styles/CodeStyle.class and /dev/null differ diff --git a/plugin/Raven.SQDev.Misc/bin/raven/sqdev/styles/SQDevStyle.class b/plugin/Raven.SQDev.Misc/bin/raven/sqdev/styles/SQDevStyle.class deleted file mode 100644 index 5f69fbe9..00000000 Binary files a/plugin/Raven.SQDev.Misc/bin/raven/sqdev/styles/SQDevStyle.class and /dev/null differ diff --git a/plugin/Raven.SQDev.Misc/bin/raven/sqdev/syntax/Syntax.class b/plugin/Raven.SQDev.Misc/bin/raven/sqdev/syntax/Syntax.class deleted file mode 100644 index b45b7139..00000000 Binary files a/plugin/Raven.SQDev.Misc/bin/raven/sqdev/syntax/Syntax.class and /dev/null differ diff --git a/plugin/Raven.SQDev.Misc/bin/raven/sqdev/syntax/SyntaxElement.class b/plugin/Raven.SQDev.Misc/bin/raven/sqdev/syntax/SyntaxElement.class deleted file mode 100644 index 34dafe2b..00000000 Binary files a/plugin/Raven.SQDev.Misc/bin/raven/sqdev/syntax/SyntaxElement.class and /dev/null differ diff --git a/plugin/Raven.SQDev.Misc/build.properties b/plugin/Raven.SQDev.Misc/build.properties index d713dcfa..cde26ab6 100644 --- a/plugin/Raven.SQDev.Misc/build.properties +++ b/plugin/Raven.SQDev.Misc/build.properties @@ -5,7 +5,12 @@ bin.includes = META-INF/,\ plugin.xml,\ resources/,\ ANTLR/,\ - ANTLR/antlr-runtime-4.5.3.jar + SQFParser/SQFParser.jar,\ + Abego/AbegoSWT.jar,\ + Abego/org.abego.treelayout.core-1.0.3.jar src.includes = resources/,\ ANTLR/,\ + SQFParser/,\ + Abego/ + diff --git a/plugin/Raven.SQDev.Misc/resources/icons/parseTreeIcon.png b/plugin/Raven.SQDev.Misc/resources/icons/syntaxTreeIcon.png similarity index 100% rename from plugin/Raven.SQDev.Misc/resources/icons/parseTreeIcon.png rename to plugin/Raven.SQDev.Misc/resources/icons/syntaxTreeIcon.png diff --git a/plugin/Raven.SQDev.Misc/resources/sqf/SQFKeywords.txt b/plugin/Raven.SQDev.Misc/resources/sqf/SQFKeywords.txt index 355a558a..2fbaf9d4 100644 --- a/plugin/Raven.SQDev.Misc/resources/sqf/SQFKeywords.txt +++ b/plugin/Raven.SQDev.Misc/resources/sqf/SQFKeywords.txt @@ -2,97 +2,125 @@ - ! + isTutHintsEnabled - Negates the given Boolean value. Synonym for 'not'. + Returns the status of TUTORIAL HINTS setting in UI (OPTIONS GAME GENERAL TUTORIAL HINTS). - https://community.bistudio.com/wiki/!_a + https://community.bistudio.com/wiki/isTutHintsEnabled - ! Boolean + isTutHintsEnabled - + isTutHintsEnabled + - + $Code$hint str isTutHintsEnabled ;$/Code$ + undefined / undefined - Boolean + Boolean + - != + createGroup - Returns whether one value is not equal to another. Both values have need be of the same type. + Creates a new Group for the given Side. An HQ (center) for that side must already be in the Mission.sqm or have been initialized with createCenter. For the available sides see Side. + NOTES + The default limit of groups created per side was 144. Since Arma 3 v1.67 it is increased to 288. + Since Arma 3 v 1.67 it is possible to mark created group for automatic deletion when the group becomes empty (see Alt Syntax). When group is set to be automatically deleted when empty, when group becomes empty it may take up to a minute for it to get deleted. + In Arma 3 when last unit leaves its group, the group usually gets immediately auto deleted, regardless of whether or not if it was set for auto deletion manually - https://community.bistudio.com/wiki/a_!%3D_b + https://community.bistudio.com/wiki/createGroup - Anything != Anything + createGroup Side + + createGroup Array - + createGroup side + + createGroup [side, deleteWhenEmpty] + - + $Code$_group = createGroup east$/Code$ + + $Code$_group = createGroup [ east, true ];$/Code$ + - undefined / undefined + undefined / global + (December 15, 2006) + The group limit is 144 groups groups per side. If you attempt to create a group, and there is no room for another, it simply doesn't create, and it doesn't error. + + (July 10,2007) + In Armed Assault, empty groups are not automatically deleted - if you created 144 groups, you will not be able to create new group even if all units in all those groups died, because all the 144 groups still exists - you will have to delete some groups manually. + + (January 04, 2011) + A group created with createGroup will get a waypoint at [0,0,0]. When you use createUnit to fill it with units, it will get an additional waypoint at the position the first unit is created. This new waypoint will also be set as currentWaypoint. However keep these two waypoints in mind when you do some scripting involving this groups' waypoints. - Boolean + Group - Group + - % + lightDetachObject - Returns the remainder of a corresponding division + Detach light from object. - https://community.bistudio.com/wiki/a_%25_b + https://community.bistudio.com/wiki/lightDetachObject - Number % Number + lightDetachObject Object - + lightDetachObject light + - + $Code$LightDetachObject _light$/Code$ + undefined / undefined - Number + Nothing + - && + assignedGunner - Returns true only if both conditions are true. In case of the alternative syntax (code as right argument), lazy evaluation is used (if left operand is false, evaluation of the right side is skipped completely). Identical to: a and b + Returns the soldier assigned to the given vehicle as a gunner. - https://community.bistudio.com/wiki/a_%26%26_b + https://community.bistudio.com/wiki/assignedGunner - Boolean && Boolean/Code + assignedGunner Object - + assignedGunner vehicle + @@ -101,24 +129,26 @@ - Boolean + Object + - * + menuCollapse - Multiplies the given numbers. + Collapses item on given path and all its childs. - https://community.bistudio.com/wiki/a_*_b + https://community.bistudio.com/wiki/menuCollapse - Number * Number + menuCollapse Array - + menuCollapse [idc, path] + @@ -127,34 +157,26 @@ - Number + Nothing + - + + removeSwitchableUnit - Adds the given two values together or if used only with one argument it returns a copy of that argument + Remove a unit from the list of units available for Team Switch. - https://community.bistudio.com/wiki/valuea_plus_valueb + https://community.bistudio.com/wiki/removeSwitchableUnit - Number + Number - - String + String - - Array + Array - - + Number - - + Array - - + String + removeSwitchableUnit Object - + removeSwitchableUnit unitName + @@ -163,321 +185,388 @@ - Number - String - Array - Number - Array - String + Nothing + - - + scriptName - Subtracts the right value from the left one. Both need to be of the same type, both Numbers or both Arrays. In Arma 3 it is possible to subtract nested arrays. + Assign a user friendly name to the VM script this command is executed from. + Once name is assigned, it cannot be changed. - https://community.bistudio.com/wiki/a_-_b + https://community.bistudio.com/wiki/scriptName - Number - Number - - Array - Array - - - Number + scriptName String - + scriptName name + - + $Code$scriptName "leetScript.sqf";$/Code$ + + $Code$scriptName format ["%1ARTY\data\scripts\ARTY_sadarmDeploy.sqf (_this: %1)",_this];$/Code$ + undefined / undefined + (17:39, 13 June 2009 (CEST)) + scriptName is good when you want to load the handle of some spawn or call with some name: + on top of leetscript.sqf + $Code$ + scriptName "LEETSCRIPT"; + GLOBAL_SCR_NAME = [] spawn "leetscript.sqf"; + hint format ["%1",GLOBAL_SCR_NAME]; + //display "LEETSCRIPT"$/Code$ - Number - Array - Number + Nothing + - / + addGroupIcon - Divides the left number by the right one. Division by 0 throws "Division by zero" error, however script doesn't stop and the result of such division is assumed to be 0. If used with config and String as arguments it returns the subentry of the given config entry with the given name. + Add icon to a group. Returns icon ID - https://community.bistudio.com/wiki/a_/_b + https://community.bistudio.com/wiki/addGroupIcon - Number / Number - - Config / String + Group addGroupIcon Array - + group addGroupIcon properties + - + $Code$groupName addGroupIcon ["b_inf",[offsetX,offsetY]]$/Code$ + undefined / undefined - Number - Config + Number + - : + setImportance - Helper construct used in a switch-construct + Sets the importance value of location. - https://community.bistudio.com/wiki/a:b + https://community.bistudio.com/wiki/setImportance - Switch_Type : Code + Location setImportance Number - + location setImportance value + - + $Code$myLocation setImportance 2$/Code$ + undefined / undefined - Nothing + Nothing + - < + removeItem - Checks if the left number is smaller than the right one + Removes item from the inventory. - https://community.bistudio.com/wiki/a_less_b + https://community.bistudio.com/wiki/removeItem - Number < Number + Object removeItem String - + unit removeItem item + - + $Code$bluforUnit unassignItem "NVGoggles"; + bluforUnit removeItem "NVGoggles"; + opforUnit unassignItem "NVGoggles_OPFOR"; + opforUnit removeItem "NVGoggles_OPFOR"; + independentUnit unassignItem "NVGoggles_INDEP"; + independentUnit removeItem "NVGoggles_INDEP";$/Code$ + - undefined / undefined + global / global - Boolean + Nothing + - <= + setSimpleTaskDescription - Checks if the left number is smaller than or equal to the right one + Attach descriptions to the simple task. - https://community.bistudio.com/wiki/a_less%3D_b + https://community.bistudio.com/wiki/setSimpleTaskDescription - Number <= Number + Task setSimpleTaskDescription Array - + task setSimpleTaskDescription [description, descriptionShort, descriptionHUD] + - + $Code$mytask setSimpleTaskDescription ["Today you have to kill Spongebob","Kill Spongebob","Here he is!"];$/Code$ + undefined / undefined - Boolean + Nothing + - == + simulInClouds - Check if one value is equal to another. Both values need to be of the same type. + Returns if given position is in clouds. - https://community.bistudio.com/wiki/a_%3D%3D_b + https://community.bistudio.com/wiki/simulInClouds - Anything == Anything + simulInClouds Position - + simulInClouds pos + - + $Code$simulInClouds (getPos player)$/Code$ + undefined / undefined - Boolean + Boolean + - > + itemCargo - Checks if the left number is greater than the right one + Get array with items from ammo box (or any general weapon holder container). - https://community.bistudio.com/wiki/a_greater_b + https://community.bistudio.com/wiki/itemCargo - Number > Number + itemCargo Object - + itemCargo box + - + $Code$hint str itemCargo vestContainer player ;$/Code$ + - undefined / undefined + global / undefined - Boolean + Array + - >= + preloadObject - Checks if the left number is greater than or equal to the right one + Preloads all textures, materials and proxies needed to render given object. Works with both class names and objects. Returns true once all data is loaded and ready. - https://community.bistudio.com/wiki/a_greater%3D_b + https://community.bistudio.com/wiki/preloadObject - Number >= Number + Number preloadObject Object + + Number preloadObject String - + distance preloadObject object + + distance preloadObject classname + - + $Code$[] spawn + { + waitUntil {10 preloadObject "SoldierW"}; + hint "Preload finished"; + };$/Code$ + + $Code$[] spawn + { + waitUntil {10 preloadObject leader player }; + hint "Preload finished"; + };$/Code$ + undefined / undefined - Boolean + Boolean - Boolean + - >> + vehicleChat - Returns subentry of config entry with given name. Identical to config/name. + Types text to the vehicle radio channel. The text will be visible only on the PC where command was executed. If you need the message to show on all computers, you have to execute it globally (see remoteExec ) + Note: Object parameter must be a vehicle, not a player. + Note: If you are in a crew seat (i.e. driver, gunner or commander), then it will include that role in the chat name output (Eg: Driver (you_name): "Message"). - https://community.bistudio.com/wiki/config_greater_greater_name + https://community.bistudio.com/wiki/vehicleChat - Config >> String + Object vehicleChat String - + vehicleName vehicleChat chatText + - + $Code$vehicle player vehicleChat "Show this text";$/Code$ + + $Code$driver vehicle player sideChat "sideChat"; + driver vehicle player globalChat "globalChat"; + driver vehicle player groupChat "groupChat"; + vehicle player vehicleChat "vehicleChat"; + driver vehicle player commandChat "commandChat"; + driver vehicle player customChat [1, "customChat"]; + systemChat "systemChat";$/Code$ + - undefined / undefined + global / local - Config + Nothing + - ^ + deleteStatus - Returns the left number to the power of the right one. + Delete a status (created with saveStatus ) from the campaign's progress file. - https://community.bistudio.com/wiki/a_%5E_b + https://community.bistudio.com/wiki/deleteStatus - Number ^ Number + deleteStatus String - + deleteStatus statusName + - + $Code$? deleteStatus "playerStatus" : "saved status gone from campaign"$/Code$ + - undefined / undefined + undefined / global - Number + Boolean + - || + setTargetAge - Returns true only if one or both conditions are true. In case of the alternative syntax(code as right argument), lazy evaluation is used (if left operand is true, evaluation of the right side is skipped completely). Identical to: a or b + Sets how the target is known to the other centers. They behave like the target was seen age seconds ago. + Possible age values are: "ACTUAL", "5 MIN", "10 MIN", "15 MIN", "30 MIN", "60 MIN", "120 MIN" or "UNKNOWN". - https://community.bistudio.com/wiki/a_or_b + https://community.bistudio.com/wiki/setTargetAge - Boolean || Boolean/Code + Object setTargetAge String - + object setTargetAge age + - + $Code$player setTargetAge "10 MIN"$/Code$ + undefined / undefined - Boolean + Nothing + - AGLToASL + removeSimpleTask - Converts position from PositionAGL to PositionASL + Remove a simple task from the list of simple tasks. - https://community.bistudio.com/wiki/AGLToASL + https://community.bistudio.com/wiki/removeSimpleTask - AGLToASL PositionAGL + Object removeSimpleTask Task - AGLToASL posAGL + person removeSimpleTask task - $Code$_playerPosASL = AGLToASL ( player modelToWorld [0,0,0]);$/Code$ - - $Code$_camPosASL = AGLToASL positionCameraToWorld [0,0,0];$/Code$ + $Code$player removeSimpleTask _tskKillSpongebob$/Code$ undefined / undefined @@ -485,263 +574,260 @@ - PositionASL + Nothing + - AISFinishHeal + ! - Alternative Injury Simulation (AIS) end state. Used to tell engine that script side healing is done when using "HandleHeal" event handler. + Negates the given Boolean value. Synonym for 'not'. - https://community.bistudio.com/wiki/AISFinishHeal + https://community.bistudio.com/wiki/!_a - AISFinishHeal Array + ! Boolean - AISFinishHeal [unit, healer, healercanheal] - + - $Code$AISFinishHeal [_wounded, _medic, true ];$/Code$ - + undefined / undefined - Nothing + Boolean + - ASLToAGL + addScoreSide - Converts position from PositionASL to PositionAGL + Adds side score. This is shown in the MP score tab as the total score. MP Only. Server execution only. - https://community.bistudio.com/wiki/ASLToAGL + https://community.bistudio.com/wiki/addScoreSide - ASLToAGL PositionASL + Side addScoreSide Number - ASLToAGL posASL + side addScoreSide value - $Code$_playerPosAGL = ASLToAGL getPosASL player ;$/Code$ + $Code$west addScoreSide 10;$/Code$ - undefined / undefined + global / global + This scripting command must be executed on the server to work properly in multiplayer - PositionAGL + Nothing + - ASLToATL + % - Converts a position from PositionASL to PositionATL + Returns the remainder of a corresponding division - https://community.bistudio.com/wiki/ASLToATL + https://community.bistudio.com/wiki/a_%25_b - ASLToATL PositionASL + Number % Number - ASLToATL pos - + - $Code$ASLToATL ( getPosASL player ) isEqualTo getPosATL player$/Code$ - + undefined / undefined - PositionATL + Number + - ATLToASL + showWatch - Converts a position from PositionATL to PositionASL + Shows or hides the watch on the map screen, if enabled for the mission and you possess the item. (default true ) - https://community.bistudio.com/wiki/ATLToASL + https://community.bistudio.com/wiki/showWatch - ATLToASL PositionATL + showWatch Boolean - ATLToASL pos + showWatch show - $Code$ATLToASL ( getPosATL player ) isEqualTo getPosASL player$/Code$ - - $Code$_camPosASL = ATLToASL positionCameraToWorld [0,0,0];$/Code$ + $Code$showWatch false ;$/Code$ undefined / undefined + (16 Aug, 2009) + In Arma 2, the Watch is now an inventory item. Class path is CfgWeapons- ItemWatch. Use the commands addWeapon and removeWeapon to add or remove it from a unit's inventory. (example: player addweapon "ItemWatch") - PositionASL + Nothing + - abs + curatorCameraArea - Absolute value of a real number + Returns all curator camera areas. - https://community.bistudio.com/wiki/abs + https://community.bistudio.com/wiki/curatorCameraArea - abs Number + curatorCameraArea Object - abs n + curatorCameraArea curatorObj - $Code$_n = abs -3; - // Returns 3$/Code$ + $Code$_camArea = curatorCameraArea myCurator;$/Code$ - local / undefined + undefined / undefined - Number + Array + - accTime + setCuratorWaypointCost - Returns the current time acceleration factor + Sets cost of waypoints (used for placing, editing and deleting). - https://community.bistudio.com/wiki/accTime + https://community.bistudio.com/wiki/setCuratorWaypointCost - accTime + Object setCuratorWaypointCost Number - accTime + curatorObj setCuratorWaypointCost cost - $Code$_acc = accTime$/Code$ + $Code$myCUrator setCuratorWaypointCost 0.1;$/Code$ undefined / undefined - (August 2, 2006) - Use setAccTime to change the time acceleration factor. Not to be confused with skipTime. + This scripting command must be executed on the server to work properly in multiplayer - Number + Nothing + - acos + unitAimPosition - ArcCosine of a number, result in Degrees + Returns the position on the unit other units can aim at. Same as aimPos only returns position in PositionAGL format and has render scope alternative unitAimPositionVisual. - https://community.bistudio.com/wiki/acos + https://community.bistudio.com/wiki/unitAimPosition - acos Number + unitAimPosition Object - acos x + unitAimPosition unit - $Code$_degrees = acos 0.5 - // returns 60$/Code$ + $Code$unitAimPosition player ;$/Code$ - undefined / undefined + global / undefined - Number + Array + - actionIDs + addItemCargoGlobal - Returns Array of Numbers, where numbers are IDs of all user actions added to given entity with addAction command. + Creates new items and stores them in the given container. Works with items, weapons and magazines. - https://community.bistudio.com/wiki/actionIDs + https://community.bistudio.com/wiki/addItemCargoGlobal - actionIDs Object + Object addItemCargoGlobal Array - actionIDs entity + box addItemCargoGlobal [item, count] - $Code$_actions = actionIDs player ;$/Code$ + $Code$supplyBox addItemCargoGlobal ["optic_ARCO2", 10];$/Code$ - undefined / undefined + global / global - Array + Nothing + - actionKeysImages + ctrlModelScale - Returns a list of button images or names assigned to the given user action. A maximum of maxKeys keys is listed. You can find the action names in config class ControllerSchemes or user action names. + Returns 3D control model scale - https://community.bistudio.com/wiki/actionKeysImages + https://community.bistudio.com/wiki/ctrlModelScale - actionKeysImages String - - actionKeysImages Array + ctrlModelScale Control - actionKeysImages userAction - - actionKeysImages [userAction, maxKeys] + ctrlModelScale control - $Code$_text = actionKeysImages "ReloadMagazine"$/Code$ - - $Code$_reload = actionKeysImages ["ReloadMagazine",1] will return "R" (incl. the quotation marks!)$/Code$ + $Code$_currentScale = ctrlModelScale _ctrl3D;$/Code$ undefined / undefined @@ -749,164 +835,123 @@ - Structured_Text - Structured_Text + Number + - actionKeysNamesArray + * - Returns a list of button names assigned to the given user action. You can find the action names in config class ControllerSchemes or user action names. + Multiplies the given numbers. - https://community.bistudio.com/wiki/actionKeysNamesArray + https://community.bistudio.com/wiki/a_*_b - actionKeysNamesArray String - - actionKeysNamesArray Array + Number * Number - actionKeysNamesArray userAction - - actionKeysNamesArray [userAction, maxKeys] - - actionKeysNamesArray [userAction, maxKeys, inputDevicePriority] - + - $Code$list = actionKeysNamesArray "ReloadMagazine";$/Code$ - - $Code$list = actionKeysNamesArray ["ReloadMagazine", 1];$/Code$ - + undefined / undefined - (October 26, 2014) - inputDevicePriority 'Controler' is not a spelling mistake in description. - Array - Array + Number + - actionKeysNames + + - Returns a list of button names assigned to the given user action. You can find the action names in config class ControllerSchemes or user action names. + Adds the given two values together or if used only with one argument it returns a copy of that argument - https://community.bistudio.com/wiki/actionKeysNames + https://community.bistudio.com/wiki/valuea_plus_valueb - actionKeysNames String + Number + Number - actionKeysNames Array + String + String + + Array + Array + + + Number + + + Array + + + String - actionKeysNames userAction - - actionKeysNames [userAction, maxKeys] - - actionKeysNames [userAction, maxKeys, inputDevicePriority] - + - $Code$_list = actionKeysNames "ReloadMagazine"; //"R"$/Code$ - + undefined / undefined - (20:14, 20 January 2010 (CET)) - The return type is a stacked string. A string inside a string. To compare use first single and inside double quotes: - if ((actionKeysNames "User1") == '"W"') then... - - (October 26, 2014) - inputDevicePriority 'Controler' is not a spelling mistake in description. - String - String + Number - String - Array - Number - Array - String + - actionKeys + - - Returns Array containing dikCodes of keys, buttons and combos assigned to the given user action. Action names could be found in config class ControllerSchemes or user action names or user profile, for example: - keyWatch [ ] = { 24 } ; - To retrieve the value, use the property name without 'key': - $Code$ actionKeys "Watch"; // 24$/Code$ - In addition, some of the actions are also listed in here: inputAction/actions + Subtracts the right value from the left one. Both need to be of the same type, both Numbers or both Arrays. In Arma 3 it is possible to subtract nested arrays. - https://community.bistudio.com/wiki/actionKeys + https://community.bistudio.com/wiki/a_-_b - actionKeys String + Number - Number + + Array - Array + + - Number - actionKeys userAction - + - $Code$_array = actionKeys "ReloadMagazine"$/Code$ - + undefined / undefined - (May 11, 2016) - If an action key is configured with a modifier (e.g. "Right Ctrl + M" for "MiniMapToggle"), the DIK code returned by this command has a weird value, equivalent to the following: - Left Ctrl + Key = 486539264 + DIK - Left Shift + Key = 704643072 + DIK - Left Alt + Key = 939524096 + DIK - Right Ctrl + Key = -1660944384 + DIK - Right Shift + Key = 905969664 + DIK - Right Alt + Key = -1207959552 + DIK - For example, to detect if actionKeys "NetworkPlayers" contain a match for "Right Ctrl + P", one must do the following: - $Code$ if (-1660944359 in actionKeys "NetworkPlayers") then$/Code$ - with -1660944359 being equal to -1660944384 + 25, and 25 being the DIK code for the "P" key. - This increases the difficulty of accurately comparing key codes to actionKeys in UI event handlers. Those strange numbers are probably due to bit flags being added to the DIK value by the game engine for easier storage in the ArmaProfile. - In case of mouse buttons, actionKeys will also return values that are different from those in "MouseButton" UI events: - LMB: MouseButton 0 = actionKeys 65536 - RMB: MouseButton 1 = actionKeys 65665 (65536 + 1 + 128) - MMB: MouseButton 2 = actionKeys 65538 (65536 + 2) - 4MB: MouseButton 3 = actionKeys 65539 (65536 + 3) - 5MB: MouseButton 4 = actionKeys 65540 (65536 + 4) - The values above are valid for a right-handed mouse configuration, and may or may not differ for a left-handed config. - - (August 6, 2016) - The method described by @AgentRev does not work. - All numbers in SQF are floats and those are only precise up to 6...7 digits. - $Code$486539264 + 19 == 486539264 + 20 - - true - $/Code$ - The DIK codes for 'LCtrl + R' and 'LCtrl + T' are indistinguishable. - Array + Number - Array - Number + - actionName + isSprintAllowed - Returns localized name of action. + Returns true if player is allowed to sprint - https://community.bistudio.com/wiki/actionName + https://community.bistudio.com/wiki/isSprintAllowed - actionName String + isSprintAllowed Object - actionName action + isSprintAllowed unit - $Code$actionName "ReloadMagazine"$/Code$ + $Code$isSprintAllowed player;$/Code$ undefined / undefined @@ -914,154 +959,114 @@ - String + Boolean + - actionParams + / - Returns Array with params for given user action id (similar to addAction param array). The output array is of the following format: - [title, script, arguments, priority, showWindow, hideOnUse, shortcut, condition, radius, unconscious, textWindowBackground, textWindowForeground, selection], where: - title: String - action title text - script: String - script file or script expression assigned to the action - arguments: Anything or nil - arguments passed to the action - priority: Number - action priority on the action menu - showWindow: Boolean - whether the action is shown in the center of the screen too - hideOnUse: Boolean - whether the action menu should close after selecting the action - shortcut: String - action bindings to some existing engine action if any - condition: String - expression returning true or nil for action to appear on the action menu - radius: Number - max distance to entity at which action becomes available. -1 means it is engine default (~15m) - unconscious: Boolean - whether the action is available to unconscious person - textWindowBackground: String - same as textWindowBackground in setUserActionText - textWindowForeground: String - same as textWindowForeground in setUserActionText - selection: String - named selection in Geometry LOD to which the action is attached - New array element selection is available since Arma 3 v1.69.140846 + Divides the left number by the right one. Division by 0 throws "Division by zero" error, however script doesn't stop and the result of such division is assumed to be 0. If used with config and String as arguments it returns the subentry of the given config entry with the given name. - https://community.bistudio.com/wiki/actionParams + https://community.bistudio.com/wiki/a_/_b - Object actionParams Number + Number / Number + + Config / String - entity actionParams id - + - $Code$_params = player actionParams 0;$/Code$ - + undefined / undefined - Array/Nothing + Number - Config + - action + removeItemFromVest - Make a unit to perform an action. Use the List of Actions for reference about the available actions and their syntax. - NOTES: - While this command should be executed where unit is local, it is not always the case. Actions such as "Eject", "GetOut", "GetInXXXX", "MoveToXXXX", etc can be executed on remote units. - In SP, when user Alt+Tabs the simulation is paused and so the action will also halt until user returns to the game. For example, player action ["GetInDriver", car] executed while user is Alt+Tabbed will result in user seeing the action happening when he returns to the game screen. This doesn't happen in MP. + Removes item from soldier's vest. - https://community.bistudio.com/wiki/action + https://community.bistudio.com/wiki/removeItemFromVest - Object action Array + Object removeItemFromVest String - unit action actionArray + unit removeItemFromVest item - $Code$player action ["SitDown", player ];$/Code$ - - $Code$_soldier action ["Eject", vehicle _soldier];$/Code$ - + - local / global + global / global - (28 Aug, 2009) - In ArmA 2, you can place a unique unit (for example a boat, far of all combats) and use it for all command lines with action. - - (March 27, 2015) - This command has no effect when a dead unit is used as input. - - (June 27, 2017) - $Code$player action ["SWITCHWEAPON",player,player,-1]$/Code$ - Switching weapon to the back. - - (July 20, 2017) - Some of the actions (such as "DropWeapon") do not always execute, and there should be a set of conditions for them to run. - The unit must be able to perform the dropping animation in order for the action to properly execute. - So, if for example we spawn a unit at [0,0,0] and make it perform a "DropWeapon" action - it won't work if [0,0,0] is water (which it is, if the current map is an island) because the unit will be swimming. - Also, you cannot stack up actions right after the other. If you run a "DropWeapon" action when the current action animation is still going - it will not perform. - There are a few more conditions for an action to perform, but relying on a hundred percent success of the action is not a good practice. - Nothing + Nothing + - activateAddons + keyImage - Activates the listed addons. The list of active addons is initialized during this function. + Returns a structured text, containing an image or name (if no image is found) of the button, on the keyboard, mouse or joystick, with the given code. - https://community.bistudio.com/wiki/activateAddons + https://community.bistudio.com/wiki/keyImage - activateAddons Array + keyImage Number - activateAddons [addon1,] + keyImage dikCode - $Code$activateAddons ["BISOFP"];$/Code$ + $Code$_name = keyImage 28; //result is "Enter"$/Code$ undefined / undefined - (Jan 21, 2009) - Be aware that "Addon1" is the cfgPatches class of the desired addon to preload. - - (May 10, 2009) - This command will activate addons that are referenced via scripts but not included in a missions required addons section. If executed from a configs init event with the call command, it will effectively override a missions required addons, preventing them from being activated (Appears to only happen in multi player). - To activate the passed addons along with those defined in the mission.sqm, execute the command from a configs init event using spawn or execVM. UNN - Nothing + Structured_Text + - activateKey + size - Activates the given keyname for the current user profile. The keys are used to unlock missions or campaigns. - See keys, keysLimit and doneKeys in the description.ext file of the missions. + Returns a location's size. - https://community.bistudio.com/wiki/activateKey + https://community.bistudio.com/wiki/size - activateKey String + size Location - activateKey keyname + size location - $Code$activateKey "Mission04Key";$/Code$ + $Code$_locSize = size myLocation$/Code$ undefined / undefined @@ -1069,59 +1074,59 @@ - Nothing + Array + - activatedAddons + allowFleeing - Returns a list of all activated addons. + Sets the cowardice level (the lack of courage or bravery) of a group or unit. + The more cowardice a Group or Object has, the sooner it will start fleeing. + 0 means maximum courage, while 1 means always fleeing. - https://community.bistudio.com/wiki/activatedAddons + https://community.bistudio.com/wiki/allowFleeing - activatedAddons + Object/Group allowFleeing Number - activatedAddons + name allowFleeing cowardice - $Code$_addons = activatedAddons ;$/Code$ + $Code$_group1 allowFleeing 0;$/Code$ - undefined / undefined + local / global - (March 28, 2014) - This command can return a large array, often too large to be diag_log'd or hinted. At the time of writing, my game returned an array with 389 elements. The code below will ignore all the BI addons (they start with a3_) and writes the rest (ie, all your custom addons) to the RPT. - $Code${ if (! (["a3_", _x] call BIS_fnc_inString )) then { diag_log _x;} } forEach activatedAddons ;$/Code$ - Array + Nothing + - add3DENConnection + camPreloaded - Connect entities together. + Checks whether the camera has finished preloading. - https://community.bistudio.com/wiki/add3DENConnection + https://community.bistudio.com/wiki/camPreloaded - add3DENConnection Array + camPreloaded Object - add3DENConnection [type, from, to] + camPreloaded camera - $Code$add3DENConnection ["RandomStart", get3DENSelected "Object","marker_0"] - // Set random start on marker "marker_0" for all selected objects.$/Code$ + $Code$?(camPreloaded _camera) : exit$/Code$ undefined / undefined @@ -1129,392 +1134,340 @@ - Boolean + Boolean + - add3DENEventHandler + : - Add code to be run when a Eden Editor event is triggered. - See the list of all Eden Editor Event Handlers. + Helper construct used in a switch-construct - https://community.bistudio.com/wiki/add3DENEventHandler + https://community.bistudio.com/wiki/a:b - add3DENEventHandler Array + Switch_Type : Code - add3DENEventHandler [type,code] - + - $Code$eh = add3DENEventHandler ["onUndo",{ systemChat "Zip..."}];$/Code$ - + undefined / undefined - Number + Nothing + - add3DENLayer + customRadio - Add an editing layer in Eden Editor. + Sends the message to the custom radio channel. The message is defined in the description.ext file or radio protocol. - https://community.bistudio.com/wiki/add3DENLayer + https://community.bistudio.com/wiki/customRadio - Number add3DENLayer String + Object customRadio Array - parentLayerID add3DENLayer name + unit customRadio [channel, message] - $Code$_myLayer = -1 add3DENLayer "Enemy Base"; - _myLayerFort = _myLayer add3DENLayer "Fortifications"; - _myLayerPatrol = _myLayer add3DENLayer "Patrols";$/Code$ + $Code$_soldierOne customRadio [1, "WordEnemy"];$/Code$ - undefined / undefined + global / local + (December 3, 2016) + To transmit user custom sounds (see Multiplayer_Custom_Sounds_Tutorial ), prefix the full filename including file extension with #. For example if there is a custom user sound file called MySound.ogg, to play it on the radio use: + $Code$ player customRadio [1, "#MySound.ogg"];$/Code$ - Number + Nothing + - addAction + getMissionConfig - This command syntax is for Arma 3 only. For TKOH and older versions see addAction TKOH - Adds an entry to the action menu of an object (scroll wheel menu). The action can only be activated when in proximity to the object (eg: building). Adding an action to the player obviously makes that action available to the player at all times. The appearance of onscreen text could be further tweaked with setUserActionText. For event handling of user interaction see inGameUISetEventHandler - This command has local effect. Created action is only available on the computer where command was executed. To make action available to all players, command must be executed on all connected clients (see remoteExec ). addAction is also ignored on dedicated server, because of no user interface. In Arma 3 addAction does not work on animals. This is intended behavior. - Since Arma 3 v1.63.136787, two new params are available: radius and unconscious. - Since Arma 3 v1.69.140846, new param is available: selection. + Returns Config entry for the given scenario attribute from the 1st tier. The attribute can be config class or config property. If it is defined in multiple places, the command checks them in the following order: + External Description.ext file + Eden Editor scenario attribute + So if attribute exists in both places, attribute from description.ext is used. Previously, scenario attributes were extracted from Description.ext using missionConfigFile. That still works, but it ignores attributes set directly in the editor and it should not be used anymore. - https://community.bistudio.com/wiki/addAction + https://community.bistudio.com/wiki/getMissionConfig - Object addAction Array + getMissionConfig String - object addAction [title, script, arguments, priority, showWindow, hideOnUse, shortcut, condition, radius, unconscious, selection] + getMissionConfig attribute - $Code$// Short and sweet: - player addAction ["A Useless Action That Does Nothing", {}]; - player addAction [" t color='#FF0000' This Useless Action Is RED /t ", { hint "RED"}]; - player addAction ["Hint Hello!", { hint format ["Hello %1!", _this select 3]}, name player ]; - player addAction ["String Exec", " hint 'this is also compiled'"];$/Code$ - - $Code$// SQF file example: - _act = player addAction ["Exec the file", "somescript.sqf"] - // somescript.sqf: hint str _this;$/Code$ - - $Code$// SQS file example: - _genAct = generator addAction ["Switch on generator", "activate_generator.sqs"] - // activate_generator.sqs:_gen = _this select 0 - _caller = _this select 1 - _id = _this select 2 - ; remove the action once it is activated - _gen removeAction _id - // This example shows an action called "Switch on generator" added to an object with the name 'generator'. As soon as the player gets close to this object, he can execute the given action via the action menu. Then the script 'activate_generator.sqs' is executed, which in our example only removes the action from the generator.$/Code$ - - $Code$// Create object on dedicated server and add action to the object on every client: - if ( isDedicated ) then - { - _obj = "some_obj_class" createVehicle [1234, 1234, 0]; - [_obj, ["Greetings!", { hint "Hello!"}]] remoteExec ["addAction", -2, _obj]; - };$/Code$ + $Code$_header = getMissionConfig "Header" + // Returns scenario header config. Replaces the previous approach which would scan only the external Description.ext file, but ignore the value set in the Eden Editor:_header = missionConfigFile "Header"; // Old approach$/Code$ - global / local + undefined / undefined - (August 2, 2006) - An easy way to keep track of and remove actions is to store the IDs of the actions in variables. - This can be accomplished by doing the following: - $Code$_myaction = player addAction ["Hello", "hello.sqs"];$/Code$ - This stores the action's ID in the local variable "_myaction" and assists in keeping track of the action ID. - To remove the above action, you would use the following line: - $Code$ player removeAction _myaction;$/Code$ - - (June 19, 2014) - If executing actual script code like this: - $Code$_unit addAction [ "yourAction", { hint "A line of code" } ];$/Code$ - you can have a user action that uses and/or affects variables used elsewhere in the script that adds the action. - But beware! - The variable(s) must be global otherwise it won't work! i.e. - Fail - $Code$_variable = false ; _unit addAction [ "action", { _variable = true } ];$/Code$ - Succeed - $Code$variable = false ; _unit addAction [ "action", { variable = true } ];$/Code$ - - (March 10, 2015) - Actionception: $Code$actions = []; - actions set [0, player addAction ["Actionception", { - if ( count actions == 1) then { - actions set [1, player addAction [" Actionception ", { - if ( count actions == 2) then { - actions set [2, player addAction [" Actionception ", { - if ( count actions == 3) then { - actions set [3, player addAction [" Actionception ", { - { - player removeAction _x ; - } forEach actions; - }, [], 10, false, true ]]; - }; - }, [], 10, false, false ]]; - }; - }, [], 10, false, false ]]; - }; - }, [], 10, false, false ]];$/Code$ - Function to remove user actions with unknown ids: - $Code$KK_fnc_removeUnknownUserActions = { - for "_i" from 0 to ( player addAction ["",""]) do { - if !(_i in _this ) then { - player removeAction _i; - }; - }; - };$/Code$ - To test: - $Code$ for "_i" from 0 to 9 do { - player addAction ["Action #" + str _i, { - [0,5,6] call KK_fnc_removeUnknownUserActions; - }]; - }; - $/Code$ - Removes all user actions but 0, 5 and 6. - - (July 18, 2016) - A3 v1.62.137494 : Condition is not evaluated when map is opened (and probably also true for other displays or opened dialog) - Number + Config + - addBackpackCargoGlobal + setSoundEffect - Add backpack(s) to the cargo space of vehicle. MP synchronized. Classname list of available backpacks is here + Defines the different sound effects. + Sound - plays a 2D sound from CfgSounds + Voice - plays a 3D sound from CfgSounds + SoundEnv - plays an environmental sound from CfgEnvSounds + SoundDet (only for triggers) - creates a dynamic sound object attached to a trigger defined in CfgSFX + To stop any sound, deactivate the trigger (might take up to 0.5 sec to stop) or delete the trigger (immediate). Also use "$NONE$" to skip the sound (1st item), when there is none to be used (Example 3, 4, 5). - https://community.bistudio.com/wiki/addBackpackCargoGlobal + https://community.bistudio.com/wiki/setSoundEffect - Object addBackpackCargoGlobal Array + Object setSoundEffect Array + + Array setSoundEffect Array - vehicle addBackpackCargoGlobal [packClassName, count] + trigger setSoundEffect [sound, voice, soundEnv, soundDet] + + waypoint setSoundEffect [sound, voice, soundEnv, soundDet] - $Code$this addBackpackCargoGlobal ["TK_RPG_Backpack_EP1",2];$/Code$ + $Code$_trigger setSoundEffect ["Alarm", "", "", ""];$/Code$ - $Code$_apc addBackpackCargoGlobal ["US_Patrol_Pack_EP1",4];$/Code$ + $Code$[_group1,2] setSoundEffect ["Alarm", "", "", ""];$/Code$ + + $Code$_trigger setSoundEffect ["$NONE$", "Alarm", "", ""];$/Code$ + + $Code$_trigger setSoundEffect ["$NONE$", "", "BattlefieldFirefight1", ""];$/Code$ + + $Code$_trigger setSoundEffect ["$NONE$", "", "", "Owl"];$/Code$ - global / global + undefined / undefined + (October 2, 2013) + To avoid having to create a dummy sound definition, you can use $NONE$ instead. + $Code$private "_trigger"; + _trigger = createTrigger ["EmptyDetector", position player]; + _trigger setTriggerStatements ["true", "", ""]; + _trigger setSoundEffect ["$NONE$", "", "BattlefieldFirefight1", ""]; + $/Code$ + + (March 7, 2012) + When using this function, I found that if the parameter sound was empty, then you would always get a 'Sound not found' error. The following code fixes this problem. You need to create a dummy sound. This is what example 3 is hinting towards. + description.ext: + $Code$class CfgSounds + { + sounds[] = {}; + class NoSound + { + name = "NoSound"; + sound[] = {"", 0, 1}; + titles[] = {}; + }; //Dummy sound needed for setSoundEffect command, due to stupid bug in engine. + }; + $/Code$ + (code sample above written by 'CarlGustaffa' on the Bohemia Interactive forums.) + script.sqf: + $Code$_trigger = createTrigger[ "EmptyDetector", _position ]; + _trigger setTriggerStatements [ "true", "", "" ]; + _trigger setSoundEffect[ "NoSound", "", "", "Wind2_EP1" ]; + $/Code$ - Nothing + Nothing - Nothing + - addBackpackCargo + < - Add backpack(s) to the cargo space of vehicle. Classname list of available backpacks is here. - In Arma 3, arguments for this command must be local ( ). For global variant see addBackpackCargoGlobal + Checks if the left number is smaller than the right one - https://community.bistudio.com/wiki/addBackpackCargo + https://community.bistudio.com/wiki/a_less_b - Object addBackpackCargo Array + Number < Number - vehicle addBackpackCargo [packClassName,count] - + - $Code$this addBackpackCargo ["TK_RPG_Backpack_EP1",2];$/Code$ - - $Code$_apc addBackpackCargo ["US_Patrol_Pack_EP1",4];$/Code$ - + - global / local + undefined / undefined - Nothing + Boolean + - addBackpackGlobal + logNetworkTerminate - Adds a backpack to a unit (even non-local) + Terminates a network log file started with logNetwork with the given handle - https://community.bistudio.com/wiki/addBackpackGlobal + https://community.bistudio.com/wiki/logNetworkTerminate - Object addBackpackGlobal String + logNetworkTerminate Number - unit addBackpackGlobal backpack + logNetworkTerminate handle - $Code$player addBackpackGlobal "B_AssaultPack_khk";$/Code$ - + - global / global + undefined / undefined - Nothing + Nothing + - addBackpack + > - Adds a backpack for a unit. If a unit already has a backpack, the old backpack will be placed on the ground under the unit. - Classname list of available backpacks : - Arma 2 OA backpacks - Arma 3 backpacks - objects starting with "B_", starts with " B_AssaultPack_khk " + Checks if the left number is greater than the right one - https://community.bistudio.com/wiki/addBackpack + https://community.bistudio.com/wiki/a_greater_b - Object addBackpack String + Number > Number - unit addBackpack packClassName - + - $Code$this addBackpack "TK_RPG_Backpack_EP1";$/Code$ - - $Code$_mySoldierDude addBackpack "US_Patrol_Pack_EP1";$/Code$ - + - local / global + undefined / undefined - Nothing + Boolean + - addCamShake + wind - Creates the camera shaking effect, like when you are near an explosion + Returns the current wind vector (in m/s) as array [x, y, z]. + NOTE: the last value (z, "up-down") always returns 0 – wind being only horizontal. - https://community.bistudio.com/wiki/addCamShake + https://community.bistudio.com/wiki/wind - addCamShake Array + wind - addCamShake [power, duration, frequency] + wind - $Code$addCamShake [10, 1, 25];$/Code$ - - $Code$enableCamShake true ; - addCamShake [5, 5, 25];$/Code$ + $Code$_windArray = wind ;$/Code$ - undefined / local + undefined / undefined + In OFP 1.96, wind speed and direction are directly related to overcast. - Nothing + Array + - addCuratorAddons + createMissionDisplay - Allow curator use of given addon. + Create single missions display as a child of given display. The mission dialog will be set to the directory given as an argument "root". - https://community.bistudio.com/wiki/addCuratorAddons + https://community.bistudio.com/wiki/createMissionDisplay - Object addCuratorAddons Array + Display createMissionDisplay String - curatorObj addCuratorAddons addons + display createMissionDisplay string - $Code$curatorObj addCuratorAddons ["A3_Armor_F_AMV","A3_Armor_F_Panther"];$/Code$ - - $Code$curatorObj addCuratorAddons ["A3_Modules_F_Curator_Lightning"];$/Code$ + $Code$_ChildDisplay = _Rootdisplay createMissionDisplay "Tutorial";$/Code$ - $Code$// Addons can be stacked: - curatorObj addCuratorAddons ["A3_Armor_F_AMV","A3_Armor_F_Panther"]; - curatorObj addCuratorAddons ["A3_Modules_F_Curator_Lightning"]; - diag_log curatorAddons curatorObj;[ - "A3_Armor_F_AMV", - "A3_Armor_F_Panther", - "A3_Modules_F_Curator_Lightning" - ]$/Code$ + $Code$// In Arma 3 this would create scenarios UI + findDisplay 46 createMissionDisplay "";$/Code$ undefined / undefined - This scripting command must be executed on the server to work properly in multiplayer - Nothing + Display + - addCuratorCameraArea + camPrepareBank - Adds or changes curator camera area (depends on if ID is already used). + Prepares the camera bank angle. + This command is non-functional ! - https://community.bistudio.com/wiki/addCuratorCameraArea + https://community.bistudio.com/wiki/camPrepareBank - Object addCuratorCameraArea Array + Object camPrepareBank Number - curatorObj addCuratorCameraArea [cameraAreaID,position,radius] + camera camPrepareBank bank - $Code$myCurator addCuratorCameraArea [3, position mySoldier,300];$/Code$ + $Code$_camera camPrepareBank -0.1$/Code$ undefined / undefined @@ -1522,56 +1475,81 @@ - Nothing + Nothing + - addCuratorEditableObjects + currentWaypoint - Register objects which can be edited by a curator. + Return the index of the current waypoint. + To determine the validity of the index, compare it to the waypoints count. + If all waypoints are 'completed', then the index is 1 greater than the last valid index. + If there are no waypoints, then the index is 0. + By default, a group has 1 waypoint at their starting position, which is considered completed and so the currentWaypoint is 1. - https://community.bistudio.com/wiki/addCuratorEditableObjects + https://community.bistudio.com/wiki/currentWaypoint - Object addCuratorEditableObjects Array + currentWaypoint Group - curatorObj addCuratorEditableObjects [objects,addCrew] + currentWaypoint groupName - $Code$curatorModule addCuratorEditableObjects [[car], true ];$/Code$ + $Code$_index = currentWaypoint group player ;$/Code$ undefined / undefined - This scripting command must be executed on the server to work properly in multiplayer - Nothing + Number + - addCuratorEditingArea + ctrlMapMouseOver - Adds or changes curator edit area (depends on if ID is already used). + Returns description of map sign mouse cursor is over. Works with in-game map as well as 2D editor map in edit mode. - https://community.bistudio.com/wiki/addCuratorEditingArea + https://community.bistudio.com/wiki/ctrlMapMouseOver - Object addCuratorEditingArea Array + ctrlMapMouseOver Control - curatorObj addCuratorEditingArea [editAreaID,position,radius] + ctrlMapMouseOver control - $Code$myCurator addCuratorEditingArea [4, position player,1000];$/Code$ + $Code$( uiNamespace getVariable "_map") ctrlMapCursor ["Track","HC_overFriendly"]; + _mouseover = if ( count ( ctrlMapMouseOver (uiNamespace getVariable "_map")) 0) then + { + ctrlMapMouseOver ( uiNamespace getVariable "_map") + } + else + { + [""] + }; + if (_mouseover select 0 == "task" && str (_logic getVariable "onTaskAssigned") != str {}) then + { + //--- Task + ( uiNamespace getVariable "_map") ctrlMapCursor ["Track","HC_overMission"]; + } + else + { + //--- Waypoint + ( uiNamespace getVariable "_map") ctrlMapCursor ["Track","HC_move"]; + };$/Code$ + + $Code$onEachFrame { hintSilent str ctrlMapMouseOver ( findDisplay 12 displayCtrl 51)};$/Code$ undefined / undefined @@ -1579,27 +1557,30 @@ - Nothing + Array + - addCuratorPoints + airDensityRTD - Adds or removes curator points. Points can be only in range from 0 to 1. + Returns air density in given altitude - https://community.bistudio.com/wiki/addCuratorPoints + https://community.bistudio.com/wiki/airDensityRTD - Object addCuratorPoints Number + airDensityRTD Number - curatorObj addCuratorPoints points + airDensityRTD altitude - $Code$curatorModule addCuratorPoints 0.5$/Code$ + $Code$_density = airDensityRTD 0;//Returns 1.22406$/Code$ + + $Code$_density = airDensityRTD 1000;//Returns 1.11096$/Code$ undefined / undefined @@ -1607,446 +1588,487 @@ - Nothing + Number + - addEditorObject + independent - Add an object to the editor and assign arguments. Create script is,called with _new equal to true. Returns the ID of the new EditorObject.,Subtype class is optional. - i - Some Old Editor Command + Pre-defined variable for the independent side. + Alias for resistance. - https://community.bistudio.com/wiki/addEditorObject + https://community.bistudio.com/wiki/independent - Control addEditorObject Array + independent - map addEditorObject [type,[name1,value1,],subtype class] + independent - + $Code$// SQF: + if (( side _unit) == independent ) then { + hint "This is a independent unit!"; + };$/Code$ + undefined / undefined - String + Side + - addEventHandler + hcSetGroup - Adds event handler (EH) to the given object and returns EH handle. If EH has some data to return upon event (e.g. the "killed" EH will return an array with 2 elements: the killed unit, and the killer), it is passed in _this variable. Since Arma 3 v.1.63.137807 the EH handle is also stored in _thisEventHandler variable and is available during EH code execution. For more information about event handlers and their types check the scripting topic Event handlers in this reference. You may add as many event handlers of any type as you like to every unit. For instance, if you add an event handler of type "killed" and one already exists, the old one doesn't get overwritten. Use removeEventHandler to delete event handlers. + Add group to unit's high command bar. + Array parameters are group, group-name and team (teammain, teamred, teamgreen, teamblue, teamyellow). + Group is the only necessary parameter. - https://community.bistudio.com/wiki/addEventHandler + https://community.bistudio.com/wiki/hcSetGroup - Object addEventHandler Array + Object hcSetGroup Array - object addEventHandler [type, command] + unit hcSetGroup array - $Code$_EHkilledIdx = player addEventHandler ["killed", {_this exec "playerKilled.sqs"}]$/Code$ + $Code$unit hcSetGroup [group, "HQ", teamred];$/Code$ - $Code$this addEventHandler ["killed", " hint format ['Killed by %1',_this select 1]"]$/Code$ + $Code$player hcSetGroup [group];$/Code$ - global / local + undefined / undefined - (July 7, 2015) - When using overridable EH, such as "InventoryOpened" and similar, where returning true allows to override default action, exitWith cannot be used to return value. So: - $Code$ if (whatever) exitWith { true }; false ;$/Code$ - Forget about it, will not work. Instead use: - $Code$ if (whatever) then { true } else { false };$/Code$ - 100% satisfaction guaranteed! - Number + Nothing + - addForce + findCover - Applies force to given object at given position. Force is defined as vector [x, y, z] in world space, position is vector [x, y, z] in model space. If you need to define force in model space, use vectorModelToWorld or vectorModelToWorldVisual commands first. The force applied as impulse. For more information see NVIDIA docs + Returns the object around where the unit finds cover. The minDist, visibilityPosition and ignoreObject parameters are optional. Command is not functional since Arma 2. + This function is no longer available in ArmA 2. + This function is no longer available in Arma 3. - https://community.bistudio.com/wiki/addForce + https://community.bistudio.com/wiki/findCover - Object addForce Array + Object findCover Array - object addForce [force, position] + object findCover [position, hidePosition, maxDist, minDist, visibilityPosition, ignoreObject] - $Code$// Apply force [0,1000,0] defined in world space (not factoring object actual positioning) to object position [1,0,0]: - _object addForce [[0,1000,0],[1,0,0]];$/Code$ - - $Code$// Apply force [0,1000,0] defined in model space (relative to object) to object position [1,0,0]: - _object addForce [_object vectorModelToWorld [0,1000,0],[1,0,0]];$/Code$ - + - global / global + undefined / undefined + (July 4, 2015) + An alternative function in Arma 3 might be BIS_fnc_findSafePos - Nothing + Object + - addGoggles + logNetwork - Create a new item and try to link it into goggles slot. This command doesn't add NVGoggles. Use addItem and assignItem or just linkItem for latter. + Registers new log file recording a network traffic and returns handle of the log. - https://community.bistudio.com/wiki/addGoggles + https://community.bistudio.com/wiki/logNetwork - Object addGoggles String + logNetwork String - unit addGoggles type + logNetwork logFile - $Code$player addGoggles "G_Tactical_Clear";$/Code$ - - $Code$diver addGoggles "G_Diving";$/Code$ + $Code$_handle = logNetwork "myLog.txt";$/Code$ undefined / undefined + (March 15, 2016) + With his syntax i get an error... - logNetwork "networkLog.txt"; + $Code$ 5:37:06 Error in expression logNetwork "networkLog.txt"; + 5:37:06 Error position: logNetwork "networkLog.txt"; + 5:37:06 Error lognetwork: Typ Zeichenfolge(STRING), erwartet(except) Array + $/Code$ - Nothing + Number + - addGroupIcon + hcGroupParams - Add icon to a group. Returns icon ID + Returns parameters describing group in high command bar. + Return value is [string, float[4]] - https://community.bistudio.com/wiki/addGroupIcon + https://community.bistudio.com/wiki/hcGroupParams - Group addGroupIcon Array + Object hcGroupParams Group - group addGroupIcon properties + unit hcGroupParams group - $Code$groupName addGroupIcon ["b_inf",[offsetX,offsetY]]$/Code$ - + undefined / undefined - Number + Array + - addHandgunItem + speedMode - Adds weapon item to the weapon cargo space. This is used for infantry weapons. - As of Arma 3 DEV 1.37, this command also supports weapon magazines. + Returns speed mode of the group, which can be any of the following: + "LIMITED" + "NORMAL" + "FULL" - https://community.bistudio.com/wiki/addHandgunItem + https://community.bistudio.com/wiki/speedMode - Object addHandgunItem String + speedMode Object/Group - unit addHandgunItem item + speedMode groupName - $Code$player addHandgunItem "muzzle_snds_L";$/Code$ + $Code$_grpspeed1 = speedMode grp1$/Code$ - local / global + undefined / undefined - Nothing + String + - addHeadgear + isWeaponDeployed - Creates a headgear item and tries to link it to headgear slot. If slot is occupied with another item, the item in the slot will be replaced. + Returns true if weapon is currently deployed. - https://community.bistudio.com/wiki/addHeadgear + https://community.bistudio.com/wiki/isWeaponDeployed - Object addHeadgear String + isWeaponDeployed Object - unit addHeadgear item + isWeaponDeployed unit - $Code$player addHeadgear "H_HelmetB";$/Code$ + $Code$_dep = isWeaponDeployed player ;$/Code$ - global / global + global / undefined + (July 1, 2015) + You can force a unit out of bipod or resting with: + $Code$_unit playMove "";$/Code$ + + (March 4, 2017) + playMove, as well as switchMove, appear to not work when forcing a player out of being deployed. A more reliable method is: $Code$_player setPos (_player modelToWorld [0,0,0]);$/Code$ - Nothing + Boolean + - addItemCargoGlobal + leaveVehicle - Creates new items and stores them in the given container. Works with items, weapons and magazines. + Ceases the using of the vehicle by a group and unassigns vehicle from the group. If the argument is a single unit, the vehicle will be unassigned from unit's group. After vehicle is unassigned from the group, each individual crew member then unassigned from the vehicle. + In short the command could be hypothetically presented as: + leaveVehicle = un- addVehicle + unassignVehicle forEach crew + However, to make it more reliable, it is best to move unit out of the vehicle manually with moveOut command and force unassign the vehicle with unassignVehicle - https://community.bistudio.com/wiki/addItemCargoGlobal + https://community.bistudio.com/wiki/leaveVehicle - Object addItemCargoGlobal Array + Group/Object leaveVehicle Object - box addItemCargoGlobal [item, count] + group leaveVehicle vehicle - $Code$supplyBox addItemCargoGlobal ["optic_ARCO2", 10];$/Code$ + $Code$_unit leaveVehicle _vehicle$/Code$ + + $Code$_grp leaveVehicle _vehicle$/Code$ - global / global + local / local + (August 31, 2013) + In ArmA 3 this command will not force a player to exit from a vehicle. It will unassign vehicle role for this player. AI crew however will also disembark. - Nothing + Nothing + - addItemCargo + removeAllEventHandlers - Creates new items and stores them in given container. Works with items, weapons and magazines. For global variant see addItemCargoGlobal + Removes all event handlers of given type that were added by addEventHandler. Since VBS2 v1.24 can be applied on individual weapon rounds. - https://community.bistudio.com/wiki/addItemCargo + https://community.bistudio.com/wiki/removeAllEventHandlers - Object addItemCargo Array + Object removeAllEventHandlers String - box addItemCargo [item, count] + objectName removeAllEventHandlers handlerType - $Code$supplyBox addItemCargo ["optic_ARCO", 10];$/Code$ + $Code$player removeAllEventHandlers "killed";$/Code$ - local / local + undefined / undefined - Nothing + Nothing + - addItemPool + lbSetTextRight - Adds count items of type name into the weapon pool (used in the campaign to transfer items to the next mission) + Sets the text on the right side of the item with the given index of the listbox or combobox with id idc of the topmost user dialog. - https://community.bistudio.com/wiki/addItemPool + https://community.bistudio.com/wiki/lbSetTextRight - addItemPool Array + lbSetTextRight Array + + Control lbSetTextRight Array - addItemPool [itemName, count] + lbSetTextRight [idc, index, name] + + control lbSetTextRight [index, name] - $Code$addItemPool ["ItemGPS", 5];$/Code$ + $Code$lbSetTextRight [101, 0, "iskoda"];$/Code$ + + $Code$_control lbSetTextRight [0, "iskoda"];$/Code$ - undefined / undefined + local / local + More information on the LB command family can be found here - Nothing + Nothing - Nothing + - addItemToBackpack + getSpeed - Create new item and store it to soldier's backpack. The item can also be a weapon or a magazine. + Get the speed for the given speed mode. + SpeedMode can be: + "AUTO" + "SLOW" + "NORMAL" + "FAST" - https://community.bistudio.com/wiki/addItemToBackpack + https://community.bistudio.com/wiki/getSpeed - Object addItemToBackpack String + Object getSpeed String - unit addItemToBackpack item + object getSpeed speedMode - $Code$player addItemToBackpack "arifle_MXM_Hamr_pointer_F";$/Code$ - - $Code$player addItemToBackpack "itemGPS";$/Code$ + $Code$_spd = player getSpeed "FAST";$/Code$ - global / global + global / undefined - Nothing + Number + - addItemToUniform + deleteMarkerLocal - Create new item and store it to soldier's uniform. The item can also be a weapon or a magazine. + Destroys the given marker. - https://community.bistudio.com/wiki/addItemToUniform + https://community.bistudio.com/wiki/deleteMarkerLocal - Object addItemToUniform String + deleteMarkerLocal String - unit addItemToUniform item + deleteMarkerLocal markerName - $Code$player addItemToUniform "itemGPS";$/Code$ - - $Code$player addItemToUniform "hgun_Rook40_F";$/Code$ + $Code$deleteMarkerLocal "Marker1"$/Code$ - global / global + undefined / local + (7 January, 2012) + Unproven: I believe that if you use this command on a globally-created marker, and subsequently another machine executes a global command on the same marker (e.g. setMarkerPos), then the marker will be re-created on the machine it was previously deleted on. Can result in confusing marker behaviour. - Nothing + Nothing + - addItemToVest + ^ - Create new item and store it to soldier's vest. The item can also be a weapon or a magazine. + Returns the left number to the power of the right one. - https://community.bistudio.com/wiki/addItemToVest + https://community.bistudio.com/wiki/a_%5E_b - Object addItemToVest String + Number ^ Number - unit addItemToVest item - + - $Code$player addItemToVest "itemGPS";$/Code$ - - $Code$player addItemToVest "hgun_Rook40_F";$/Code$ - + - global / global + undefined / undefined - Nothing + Number + - addItem + systemChat - Creates new item and tries to add it into inventory. Inventory must have enough space to accomodate new item or command will fail.The item can also be a weapon or a magazine. + Types text to the system radio channel. The text will be visible only on the PC where command was executed. If you need the message to show on all computers, you have to execute it globally (see remoteExec ) - https://community.bistudio.com/wiki/addItem + https://community.bistudio.com/wiki/systemChat - Object addItem String + systemChat String - unit addItem item + systemChat text - $Code$bluforUnit addItem "NVGoggles"; - bluforUnit assignItem "NVGoggles"; - opforUnit addItem "NVGoggles_OPFOR"; - opforUnit assignItem "NVGoggles_OPFOR"; - independentUnit addItem "NVGoggles_INDEP"; - independentUnit assignItem "NVGoggles_INDEP";$/Code$ + $Code$systemChat "Hello world!";$/Code$ + + $Code$driver vehicle player sideChat "sideChat"; + driver vehicle player globalChat "globalChat"; + driver vehicle player groupChat "groupChat"; + vehicle player vehicleChat "vehicleChat"; + driver vehicle player commandChat "commandChat"; + driver vehicle player customChat [1, "customChat"]; + systemChat "systemChat";$/Code$ - global / global + undefined / local - Nothing + Nothing + - addLiveStats + titleCut - Adds score to the Xbox Live Statistics score for the given unit (or the commander unit of the given vehicle). (Also available in OFPE & VBS2) + this command was obsoleted, use cutText instead. - https://community.bistudio.com/wiki/addLiveStats + https://community.bistudio.com/wiki/titleCut - Object addLiveStats Number + titleCut Array - unit addLiveStats score + titleCut [text, type, speed] - $Code$player addLiveStats 10$/Code$ + $Code$titleCut ["Hello, how are you?","Plain Down",3];$/Code$ undefined / undefined @@ -2054,342 +2076,388 @@ - Nothing + Nothing + - addMPEventHandler + animationSourcePhase - Adds MP event handler (EH) to the given object and returns EH handle. MP event handlers are added globally to every client on network in multiplayer and will fire on every client too upon event. If EH has some data to return upon event (e.g. the "MPKilled" EH will return an array with 2 elements: the killed unit, and the killer), it is passed in _this variable. Since Arma 3 v.1.63.137807 the EH handle is also stored in _thisEventHandler variable and is available during EH code execution. For more information see: Arma_3:_Event_Handlers#addMPEventHandler + Returns current animation phase of given source. Similar to animationPhase or doorPhase but designed to complement animateSource. - https://community.bistudio.com/wiki/addMPEventHandler + https://community.bistudio.com/wiki/animationSourcePhase - Object addMPEventHandler Array + Object animationSourcePhase String - object addMPEventHandler [type, expression] + object animationSourcePhase source - $Code$_index = player addMPEventHandler ["mpkilled", {Null = _this execVM "playerkilled.sqf";}];$/Code$ + $Code$_phase = house animationSourcePhase "Door_1_source";$/Code$ - global / global + undefined / undefined - (May 8, 2015) - MP EHs are added on every PC and execute on every PC, apart from MPRespawn, that only executes at the locality where unit respawns. - Number + Number + - addMagazineAmmoCargo + selectNoPlayer - Adds magazines with specified ammo count to the cargo space of a vehicle or a container. + Switches player to no unit, makes player return objNull. SP only, the command is completely ignored in MP. - https://community.bistudio.com/wiki/addMagazineAmmoCargo + https://community.bistudio.com/wiki/selectNoPlayer - Object addMagazineAmmoCargo Array + selectNoPlayer - cargospace addMagazineAmmoCargo [magazine, quantity, ammocount] + selectNoPlayer - $Code$_ammobox addMagazineAmmoCargo ["30Rnd_65x39_caseless_mag", 2, 5];$/Code$ + $Code$// Single player: + selectNoPlayer ; + hint str player ; // NULL-object + // Rough multiplayer emulation:_noPlayer = createGroup sideLogic createUnit [ + "Logic", + [0,0,1000], + [], + 0, + "NONE" + ]; + selectPlayer _noPlayer; + hint str player ; //L Charlie 4-3:1 (KK)$/Code$ - global / global + undefined / undefined + Player returns objNull after this command has been used. It also has at least the following side effects: closeDialog won't work anymore and onKeyDown event handlers cease to detect the ESC key. In order to get things back to normal a new player object has to be set with selectPlayer. Using objNull won't cut it in this case. - Nothing + Nothing + - addMagazineCargoGlobal + publicVariableClient - Add magazines to the cargo space of vehicles, which can be taken out by infantry units. - MP Synchronized + Send the variable value to the client computer - same limitations regarding variable type as publicVariable. + The Client ID is the temporary ID given to a connected client for that session. You can find out this ID with the owner command (using it on a player's character, for example, will give you that players client ID). + In Arma 3 it is possible to broadcast nil value - https://community.bistudio.com/wiki/addMagazineCargoGlobal + https://community.bistudio.com/wiki/publicVariableClient - Object addMagazineCargoGlobal Array + Number publicVariableClient String - vehicleName addMagazineCargoGlobal [magazineName, count] + clientID publicVariableClient varName - $Code$_truck addMagazineCargoGlobal ["M16", 5];$/Code$ + $Code$3 publicVariableClient "CTFscoreOne";$/Code$ - global / global + undefined / undefined - (November 7, 2011) - Synchronized to JIP as well. + (24 Aug, 2012) + publicVariableServer (run on client) + publicVariableClient (run on server) + Publishes a variable (name as STRING) to a specific client, from the server. This is useful where you want to synchronize a variable with only a specific client. + This is a useful way to cut down on network traffic, as publicVariable commands are issued as a priority message. So use publicVariable sparingly, and these commands where they apply. - Rocket + + (21 Sep, 2013) + While publicVariable is JIP compatible and persistent, publicVariableClient is not. If you log out then log in with the same owner id the public variable sent to your client prior will be nil. + $Code$//server + pv = 123; + 3 publicVariableClient "pv"; + //connected client with id 3 + hint str pv; //123 + // + //client log out/log in + // + //client id is still 3 + hint str pv; //error, undefined variable pv$/Code$ + + (April 12, 2015) + Tested in Arma 3 v1.43, publicVariableClient works client-to-client if owner id of the targeted client is known. - Nothing + Nothing + - addMagazineCargo + countType - Add magazines to the cargo space of vehicles, which can be taken out by infantry units. Once the magazine cargo space is filled up, any further addMagazineCargo commands are ignored. - In Arma 3, arguments for this command must be local ( ). For global variant see addMagazineCargoGlobal + Count how many objects in the array are of given type. This command also works with parent classes like "Air", "Tank", and "Car". For a full class reference see Classes. - https://community.bistudio.com/wiki/addMagazineCargo + https://community.bistudio.com/wiki/countType - Object addMagazineCargo Array + String countType Array - vehicleName addMagazineCargo [magazineName, count] + type countType objects - $Code$_truck addMagazineCargo ["M16", 5];$/Code$ + $Code$_count = "Tank" countType list _triggerOne;$/Code$ + + $Code$_count = "B_medic_F" countType units player ;$/Code$ - global / local + global / undefined - (October 24, 2009) - Only works on clients. + (April 23, 2007) + This command can be used on the whole hierarchical class tree (i.e. when checking a HMMWV, one could test for "HMMWV50", "Car", "LandVehicle", etc.) + + (May 4, 2016) + To complement Kronzky's note, if one needs to count exact types, countType is not suitable for this, use count instead: + $Code$_count = { typeOf _x == "B_medic_F"} count units player ;$/Code$ - Nothing + Number + - addMagazineGlobal + worldSize - Adds a magazine to the unit. - Note: You may create invalid combinations by adding more magazines than the free space in unit's inventory allows. When doing so, application behaviour is undefined. - This command is broken in MP as it dupes inventory items. Use addMagazine array for now, it takes global argument and has global effect too. + Returns config size of the current world. - https://community.bistudio.com/wiki/addMagazineGlobal + https://community.bistudio.com/wiki/worldSize - Object addMagazineGlobal String + worldSize - unit addMagazineGlobal magazineName + worldSize - $Code$player addMagazineGlobal "30Rnd_65x39_caseless_mag";$/Code$ + $Code$_size = worldSize ; //8192$/Code$ - global / global + undefined / undefined - Nothing + Number + - addMagazinePool + lbPicture - Add magazines to the magazine pool, of which the player may choose in the following mission. Available in campaigns only. + Returns the picture name of the item with the given index of the listbox or combobox with id idc of the topmost user dialog. - https://community.bistudio.com/wiki/addMagazinePool + https://community.bistudio.com/wiki/lbPicture - addMagazinePool Array + lbPicture Array + + Control lbPicture Number - addMagazinePool [magazineName, count] + lbPicture [idc, index] + + control lbPicture index - $Code$addMagazinePool ["M16", 20];$/Code$ + $Code$_picture = lbPicture [101, 0];$/Code$ + + $Code$_picture = _control lbPicture 0;$/Code$ undefined / undefined + More information on the LB command family can be found here - Nothing + String - String + - addMagazineTurret + selectEditorObject - Adds a magazine to the turret. Use turret path [-1] for driver's turret. - Note: you may create invalid combinations by using this function, for example by adding 20 grenades. When doing so, application behaviour is undefined. Since Arma 3 v1.55.133817 it is possible to set custom ammo count in added magazine. + Select an editor object. Does not un-select previously selected objects. + i + Some Old Editor Command - https://community.bistudio.com/wiki/addMagazineTurret + https://community.bistudio.com/wiki/selectEditorObject - Object addMagazineTurret Array + Control selectEditorObject String - vehicle addMagazineTurret [magazineName, turretPath, ammoCount] + map selectEditorObject object - $Code$_tank addMagazineTurret ["SmokeLauncherMag",[0,0]];$/Code$ - - $Code$_tank addMagazineTurret ["20Rnd_120mmSABOT_M1A2",[0]];$/Code$ - + - local / global + undefined / undefined - Nothing + Any_Value + - addMagazines + setCurrentTask - Adds multiple magazines to the unit. For cargo containers use addMagazineCargoGlobal command. + Set the task as a current task of the person. - https://community.bistudio.com/wiki/addMagazines + https://community.bistudio.com/wiki/setCurrentTask - Object addMagazines Array + Object setCurrentTask Task - unit addMagazines [magazineName, count] + object setCurrentTask task - $Code$player addMagazines ["30Rnd_65x39_caseless_mag", 3];$/Code$ + $Code$player setCurrentTask tskKillSpongebob;$/Code$ - global / global + undefined / undefined - Nothing + Nothing + - addMagazine + currentVisionMode - Add a magazine to a person. Infantry units can only carry a specific number of magazines, once the magazine slots are filled, any further addMagazine commands are ignored. - Note: When you add a new weapon via scripting commands as well as the magazines for it, the addMagazine command has to be given before the addWeapon command, otherwise the weapon won't be loaded. - In Arma 3, the alternative variant of this command (addMagazine ARRAY) accepts global arguments, i.e. you can use it on the server to give remote unit a magazine with limited ammo. - + Returns current vision mode of unit's weapon. + 0 - daytime + 1 - night vision + 2 - thermal vision + - https://community.bistudio.com/wiki/addMagazine + https://community.bistudio.com/wiki/currentVisionMode - Object addMagazine String - - Object addMagazine Array + currentVisionMode Object - unitName addMagazine magazineName - - unitName addMagazine [magazineName, ammoCount] + currentVisionMode unit - $Code$player addMagazine "30Rnd_556x45_STANAG";$/Code$ + $Code$_currMode = currentVisionMode gunner _tank$/Code$ - $Code$player addMagazine ["30Rnd_556x45_STANAG", 15];$/Code$ + $Code$if ( currentVisionMode player == 1) then + { + hint "nightvision active"; + };$/Code$ - local / global + global / undefined - (August 2, 2006) - If the unit has magazines already, you may need to use the commands removeMagazine or removeMagazines to make space for the mags you want to add. - - (February 21, 2010) - In turreted vehicles the magazine is added to the first turret with primaryGunner = 1; set in the Vehicles turret config part (and the magazine is ONLY added to the very first turret if more than one is configged with primaryGunner = 1; ). - - (May 12, 2010) - When wanting to add many magazines to an object's init-line it can be easier to use loops than to just repeat the addMagazine command. - If you want to add N magazines to an object either of the two below ways are handy, the first for fewer magazines, and the latter when you want to add many since it then is the easiest of the two to read. - $Code${this addMagazine "magazineClassName"} forEach [1,2,3,...,N]; - for "_i" from 0 to (N - 1) do {this addMagazine "magazineClassName"};$/Code$ + (April 29, 2016) + The return value is somewhat erratic for UAVs. For example, if you are connected to a UAV, with the turret set to thermal vision and PIP feed enabled, "currentVisionMode gunner _uav" returns 2 when controlling the turret, but returns 0 after releasing control, even thought the PIP feed is still in thermal mode. WIth nightvision, it will return 1 whether or not you are controlling the turret, but if you switch from 1st to 3rd person before releasing control, then it returns 0 afterwards... - Nothing - Nothing + Number + - addMenuItem + ctrlCommitted - Creates a new menu item. Menu can be "file" or "view",index is index,as returned from addMenu command. priority is optional and determines,where in the menu the item will reside (higher priority items first). - i - Some Old Editor Command + Check if the control animation is finished. - https://community.bistudio.com/wiki/addMenuItem + https://community.bistudio.com/wiki/ctrlCommitted - Control addMenuItem Array + ctrlCommitted Control - map addMenuItem [menu or index,text,command,priority] + ctrlCommitted controlName - + $Code$_done = ctrlCommitted _control$/Code$ + undefined / undefined - Number + Boolean + - addMenu + ctrlSetStructuredText - Adds a new menu button. Priority is optional. - i - Some Old Editor Command + Set the structured text which will be displayed in structured text control. - https://community.bistudio.com/wiki/addMenu + https://community.bistudio.com/wiki/ctrlSetStructuredText - Control addMenu Array + Control ctrlSetStructuredText Structured_Text - map addMenu [text,priority] + control ctrlSetStructuredText structuredText - $Code$example$/Code$ + $Code$_control ctrlSetStructuredText parseText "First line img image=data\isniper.paa / br / Second line"$/Code$ + + $Code$// To center text vertically, add extra line above with blank space ( ) and set its size to adjust: + with uiNamespace do { + button = findDisplay 46 ctrlCreate ["RscShortcutButton", -1]; + button ctrlSetPosition [0,0,0.3,0.1]; + button ctrlCommit 0; + button ctrlSetStructuredText parseText + " t size='0.5' /t br/ t size='1' align='center' Button Text /t "; + };$/Code$ undefined / undefined @@ -2397,28 +2465,28 @@ - Number + Nothing + - addMissionEventHandler + halt - Adds event handler (EH) attached to the current mission and returns EH handle. If EH has some data to return upon event, it is passed in _this variable. Since Arma 3 v.1.63.137807 the EH handle is also stored in _thisEventHandler variable and is available during EH code execution. For the list of available mission event handlers see: Arma_3:_Event_Handlers/addMissionEventHandler + Stops the program into a debugger. In retail version using halt results in error. - https://community.bistudio.com/wiki/addMissionEventHandler + https://community.bistudio.com/wiki/halt - addMissionEventHandler Array + halt - addMissionEventHandler [type, command] + halt - $Code$// A script could be executed to stop custom scripts graciously, or save progress & stats, for example: - _id = addMissionEventHandler ["Ended",{ _this execVM "missionEnded.sqf" }];$/Code$ + $Code$? _DbugWanted :halt$/Code$ undefined / undefined @@ -2426,61 +2494,147 @@ - Number + Nothing + - addMusicEventHandler + isFlatEmpty - Adds playMusic event handler. Returns id of the handler or -1 when failed. Just like addMissionEventHandler, music EH is also attached to the mission. + Checks given position against given filter params. Filter includes checks for: + If there are any objects closer than given distance from given position (in 2D) + If the area around position is flat enough to match given gradient + If the given position is over water or land + If the given position is over shore line + The gradient seems to correlate with general hill steepness: 0.1 (10%) ~6 o, 0.5 (50%) ~27 o, 1.0 (100%) ~45 o, etc.There are also some oddities about this command that need to be noted: + Objects accounted for proximity check seem to be static objects. Nearby vehicles and units do not seem to affect the output + Given position will be magically transferred into given position + getTerrainHeightASL value + The second element must be -1 ( = 0 really) at all times, otherwise command becomes unusable + The command might be a bit heavy on computations so avoid frequent and large area checks + See also: BIS_fnc_findSafePos - https://community.bistudio.com/wiki/addMusicEventHandler + https://community.bistudio.com/wiki/isFlatEmpty - addMusicEventHandler Array + Array isFlatEmpty Array - addMusicEventHandler [type, function] + position isFlatEmpty [minDistance, mode, maxGradient, maxGradientRadius, overLandOrWater, shoreLine, ignoreObject] - $Code$_ehID = addMusicEventHandler ["MusicStart", { hint str _this}];$/Code$ + $Code$// Check if player position is over land: + _overLand = !( position player isFlatEmpty [-1, -1, -1, -1, 0, false ] isEqualTo []);$/Code$ - $Code$_ehID = addMusicEventHandler ["MusicStop", { hint str _this}];$/Code$ + $Code$// Check if player position is over shore line: + _overShore = !( position player isFlatEmpty [-1, -1, -1, -1, 0, true ] isEqualTo []);$/Code$ + + $Code$// Check if player position is over water: + _overWater = !( position player isFlatEmpty [-1, -1, -1, -1, 2, false ] isEqualTo []);$/Code$ + + $Code$// Check if no object is closer than 5m to player position: + _isEmpty = !( position player isFlatEmpty [5, -1, -1, -1, -1, false, player ] isEqualTo []);$/Code$ + + $Code$// Check if area 10m around player position is relatively flat: + _isFlat = !( position player isFlatEmpty [-1, -1, 0.3, 10, -1] isEqualTo []);$/Code$ + + $Code$// Check if area 15m around player position is very flat and empty: + _isFlatEmpty = !( position player isFlatEmpty [15, -1, 0.1, 15, -1, false, player ] isEqualTo []);$/Code$ undefined / undefined - (March 4, 2013) - There are these two types at this time: - MusicStart - It is triggered when the music is started (command playMusic ). In variable _this is stored class name from CfgMusic. - MusicStop - It is triggered when the music is ended (command playMusic ). In variable _this is stored class name from CfgMusic. + (April 24, 2016) + When this command is instructed to check if area at given position is empty it takes into account the radius of the bounding sphere of surrounding objects. Because of this, the high voltage columns such as "Land_HighVoltageColumnWire_F" and such objects may appear extremely large to the calculations and the position will be rejected even if visually it doesn't look too bad. To avoid this, use findEmptyPosition command first to find guaranteed empty position, then pass the result to isFlatEmpty making sure you switched off proximity check by setting 1st param to -1. For example: + $Code$// Check if given position is flat and empty within 1m radius + [4274.66,12113,0.00139618] isFlatEmpty [1, -1, 0.1, 1, -1, false, objNull ]; //[]$/Code$ + The result suggests it is not flat and empty. + $Code$// Check if given position is flat within 1m radius + [4274.66,12113,0.00139618] isFlatEmpty [-1, -1, 0.1, 1, -1, false, objNull ]; //[4274.66,12113,48.3209]$/Code$ + The result suggests it is. + $Code$// Check if given position is empty within 1m radius + [4274.66,12113,0.00139618] isFlatEmpty [1, -1, -1, -1, -1, false, objNull ]; //[]$/Code$ + The result suggests it is not empty. But the position is in the middle of a road and there is nothing within 1m but there is "Land_HighVoltageColumnWire_F" not far. + $Code$// Check if given position is empty within 1m radius ignoring nearest "Land_HighVoltageColumnWire_F" + [4274.66,12113,0.00139618] isFlatEmpty [1, -1, -1, 1, -1, false, nearestObject [[4274.66,12113,0.00139618], "Land_HighVoltageColumnWire_F"]]; //[4274.66,12113,48.3209]$/Code$ + The result now suggests it is empty. So instead of relying on internal proximity check we can combine both commands: + $Code$fnc_isFlatEmpty = + { + params ["_pos", "_params"]; + _pos = _pos findEmptyPosition [0, _params select 0]; + if (_pos isEqualTo []) exitWith {[]}; + _params =+ _params; + _params set [0, -1]; + _pos = _pos isFlatEmpty _params; + if (_pos isEqualTo []) exitWith {[]}; + _pos + }; + // Test + [[4274.66,12113,0.00139618], [1, -1, 0.1, 1, -1, false, objNull ]] call fnc_isFlatEmpty; //[4274.53,12113,48.3175] + $/Code$ - Number + Array + - addOwnedMine + throw - Sets ownership over a remotely detonatable mine to the unit. + Throws an exception. The exception is processed by first catch block. This command will terminate further execution of the code. + NOTE : Avoid using alternative shorthand syntax if you are planning on preparing your exception information dynamically, as it will have to be generated first regardless of the condition of the if statement before it, as shown in example 3. - https://community.bistudio.com/wiki/addOwnedMine + https://community.bistudio.com/wiki/throw - Object addOwnedMine Object + throw Anything + + If_Type throw Anything - Unit addOwnedMine mine + throw expression + + if throw exception - $Code$player addOwnedMine SuperMine;$/Code$ + $Code$try { throw "invalid argument"} catch { hint str _exception};$/Code$ + + $Code$// Since Arma 3 v1.53.133045: + 123 try { if (_this != 123) throw "invalid argument"} catch { hint str _exception};$/Code$ + + $Code$// The correct usage of shorthand alt syntax: + try { + if (a b) throw "Error: some error"; /// OK + /// The command argument is static + } catch { + hint str _exception; + }; + try { + _someFunc = { + ..... + }; + if (a b) throw ( call _someFunc); /// NOT OK + /// The command argument is dynamic + /// _someFunc is called first to get the value regardless of (a b) outcome + } catch { + hint str _exception; + }; + try { + _someFunc = { + ..... + }; + if (a b) then { throw ( call _someFunc)}; /// OK + /// The command argument is dynamic + /// _someFunc is only called when (a b) is true + } catch { + hint str _exception; + };$/Code$ undefined / undefined @@ -2488,508 +2642,464 @@ - Nothing + Nothing - Nothing + - addPlayerScores + setAnimAimPrecision - MP server only: Adds player score. + Set aimPrecision value of the current animation state (parameter aimPrecision) - https://community.bistudio.com/wiki/addPlayerScores + https://community.bistudio.com/wiki/setAnimAimPrecision - Object addPlayerScores Array + Object setAnimAimPrecision Number - unit addPlayerScores values + unit setAnimAimPrecision value - $Code$player addPlayerScores [0, 1, 0, 0, 1];$/Code$ + $Code$player setAnimAimPrecision 1$/Code$ - undefined / undefined + global / global - This scripting command must be executed on the server to work properly in multiplayer - - (May 2, 2017) - As this command will add the given number to a player's score, a little bit of thought needs to be given to friendly-fire if it's for something like a deathmatch or a FFA, due to friendly-fire incurring negative points. So to counter this just add 2 points every time a player kills a unit from the same side: - $Code$player addPlayerScores [2, 0, 0, 0, 0];$/Code$ - The 2 points will add 1 point to counter the negative friendly-fire point and 1 point to add correctly to the score. - Nothing + Nothing + - addPrimaryWeaponItem + disableCollisionWith - Adds weapon item to the weapon cargo space. This is used for infantry weapons. - As of Arma 3 DEV 1.37, this command also supports weapon magazines. + Disable collision between vehicles. This command doesn't disable collision between PhysX objects. + ! + Command has to be executed where objects are local, and as long as they don't change locality, the effect of this command will be global. + If the 2 objects are not local to the same computer, then it has to be executed on both computers to achieve the desired effect. + If one or both objects change locality, the command needs to be executed again on the new owner 's machine(s) to maintain the effect. - https://community.bistudio.com/wiki/addPrimaryWeaponItem + https://community.bistudio.com/wiki/disableCollisionWith - Object addPrimaryWeaponItem String + Object disableCollisionWith Object - unit addPrimaryWeaponItem item + vehicle disableCollisionWith vehicle - $Code$player addPrimaryWeaponItem "muzzle_snds_H";$/Code$ - + local / global - (June 22, 2014) - If the item being added is not supported by the unit's weapon then the command will simply fail silently. The item is also not added to the unit's inventory in such a case. + (April 4, 2015) + disableCollisionWith is basically a script that when you apply it to an object, and your unit can go through it like a ghost. However, if you wish the object to be solid again, you may wish to use the enableCollisionWith. + An example for this is: + $Code$//name of unit in editor such as player1 + //name of object in editor such as barrel1 + barrel1 disableCollisionWith player1; + //to make the barrel solid again, do this as vice versa if you know what your doing! + barrel1 enableCollisionWith player1 $/Code$ + On a side note: this can come in handy a lot if you want a unit to sit on the back of a car or on top of a container - Nothing + Nothing + - addPublicVariableEventHandler + composeText - This event handler will detect if a missionNamespace variable (it is attached to) has been broadcast over network with publicVariable, publicVariableClient or publicVariableServer commands and will execute EH code upon detection. Arguments passed to the code in _this array are: - _this select 0: String - broadcast variable name (same variable name EH is attached to) - _this select 1: Anything - broadcast variable value - _this select 2: Object, Group - target the variable got set on with setVariable (see: alternative syntax) - Please note: - * EH works only in Multiplayer environment. - * EH will not fire on the machine that executed broadcast command, only on the machines that receive the broadcast. - * The value of broadcast variable can be exactly the same, it is the actual broadcast that triggers EH not the change in variable. - Alt syntax of this command doesn't work as intended + Creates a structured text by joining the given structured or plain texts. - https://community.bistudio.com/wiki/addPublicVariableEventHandler + https://community.bistudio.com/wiki/composeText - String addPublicVariableEventHandler Code - - String addPublicVariableEventHandler Array + composeText Array - varName addPublicVariableEventHandler code - - varName addPublicVariableEventHandler [target, code] + composeText [text1, text2,] - $Code$"publicThis" addPublicVariableEventHandler { - hint format [ - "%1 has been updated to: %2", - _this select 0, - _this select 1 - ] - };$/Code$ - - $Code$// Client: - "'^:)123BURP,+=lol" addPublicVariableEventHandler { hint ("NUTS are " + (_this select 1))}; - // Server: missionNamespace setVariable ["'^:)123BURP,+=lol", "craZZZZy"]; - publicVariable "'^:)123BURP,+=lol";$/Code$ + $Code$_txt = composeText ["First line", image "data\isniper.paa", lineBreak, "Second line"];$/Code$ - global / local + undefined / undefined - (22 Dec, 2007) - Please note that varName indicates which variable you want to monitor with this eventhandler. - As a result, the example eventhandler on this page will only fire when the variable publicThis has been changed, - but not if any other variable was changed by any other client via the publicVariable command. - - (27 Feb, 2014 00:57) - Note on using addPublicVariableEventHandler during initialization: If you need a function to call addPublicVariableEventHandler during initialization, you must use postInit. addPublicVariableEventHandler does not work during preInit. - - (27 Feb, 2014 08:40) - MulleDK13 note above needs some clarification. You don't "must" use postInit and you absolutely can use preInit function to initialise addPublicVariableEventHandler if you start scheduled script from it. - $Code$//script with preInit = 1; in CfgFunctions - 0 = 0 spawn { - "someVar" addPublicVariableEventHandler { - //yourcode - }; - };$/Code$ - - (November 23, 2015) - While it is true that the event handler will only fire on the machine receiving the broadcast value. Please note that this machine can actually be the same machine broadcasting it in the cases of publicVariableClient and publicVariableServer. - Examples: $Code$if ( isServer ) then { - "OnServer" addPublicVariableEventHandler { hint "This event handler still fired!"; }; - publicVariableServer "OnServer"; - };$/Code$ - $Code$// This example assumes the client knows their own client ID - // It does also work on the server (when the server ID is used) irrespective of the command name - "OnClient" addPublicVariableEventHandler { hint "This event handler still fired!"; }; - client ID publicVariableClient "OnClient"; - $/Code$ - Nothing - Nothing + Structured_Text + - addRating + someAmmo - Add a number to the rating of a unit - negative values can be used to reduce the rating. - This command is usually used to reward for completed mission objectives. The rating is given at the end of the mission and is automatically adjusted when killing enemies or friendlies. - When the rating gets below -2000, the unit's side switches to "ENEMY" ( sideEnemy ) and the unit is attacked by everyone.(see Rating Values ) - See also: Arma_3:_Event_Handlers#HandleRating + Check if unit has some ammo. - https://community.bistudio.com/wiki/addRating + https://community.bistudio.com/wiki/someAmmo - Object addRating Number + someAmmo Object - unitName addRating rating + someAmmo unitName - $Code$player addRating 2000;$/Code$ + $Code$? not (someAmmo _loon1) : hint "Loon1 is out of ammo!"$/Code$ - local / global + undefined / undefined - (November 16, 2014) - Since there is no setRating command, its expected behaviour can scripted as such: - $Code$BNRG_fnc_setRating = { - _setRating = _this select 0; - _unit = _this select 1; - _getRating = rating _unit; - _addVal = _setRating - _getRating; - _unit addRating _addVal; - }; - [1000,player] call BNRG_fnc_setRating//set player rating 1000$/Code$ - Using this example, no matter what the units rating was before, it will always set its rating to 1000. - Nothing + Boolean + - addResources + diag_captureFrameToFile - Adds resources to a team member. + This command starts counting frames from the moment it is executed and when the count reaches the number passed as param, the current frame is captured and + written to a log file in the same directory as the.rpt file. + The full Path to the log file is logged to simultaneously. + The data in the log file can be copied and pasted into the diag_captureFrame UI dialog to get a visualisation later on. + Note : Only available in specific builds. See Performance Profiling for details. - https://community.bistudio.com/wiki/addResources + https://community.bistudio.com/wiki/diag_captureFrameToFile - Team_Member addResources Array + diag_captureFrameToFile Number - teamMember addResources [resource1, resource2,] + diag_captureFrameToFile frame - + $Code$diag_captureFrameToFile 1; //capture the first frame after command execution$/Code$ + + $Code$diag_captureFrameToFile 24; //capture 24th frame after command execution$/Code$ + - global / local + undefined / undefined - Nothing + Nothing + - addScoreSide + diag_activeSQSScripts - Adds side score. This is shown in the MP score tab as the total score. MP Only. Server execution only. + Returns array with active SQSs. - https://community.bistudio.com/wiki/addScoreSide + https://community.bistudio.com/wiki/diag_activeSQSScripts - Side addScoreSide Number + diag_activeSQSScripts - side addScoreSide value + diag_activeSQSScripts - $Code$west addScoreSide 10;$/Code$ + $Code${ systemChat str _x} forEach diag_activeSQSScripts ;$/Code$ - global / global + undefined / undefined - This scripting command must be executed on the server to work properly in multiplayer - Nothing + Array + - addScore + menuChecked - Add a number to the score of a unit. This score is shown in multiplayer in the "I" ("P" in Arma 3) screen. Negative values will remove from the score. Server execution only. - See also: Arma_3:_Event_Handlers#HandleScore + Returns if item on given path is checked or not. - https://community.bistudio.com/wiki/addScore + https://community.bistudio.com/wiki/menuChecked - Object addScore Number + menuChecked Array - unit addScore score + menuChecked [idc, path] - $Code$unit addScore 10;$/Code$ - + - global / global + undefined / undefined - This scripting command must be executed on the server to work properly in multiplayer - Nothing + Boolean + - addSecondaryWeaponItem + remove3DENConnection - Adds weapon item to the weapon cargo space. This is used for infantry weapons. - As of Arma 3 DEV 1.37, this command also supports weapon magazines. + Remove connection between entities. - https://community.bistudio.com/wiki/addSecondaryWeaponItem + https://community.bistudio.com/wiki/remove3DENConnection - Object addSecondaryWeaponItem String + remove3DENConnection Array - unit addSecondaryWeaponItem item + remove3DENConnection [type, from, to] - + $Code$remove3DENConnection ["RandomStart", get3DENSelected "Object","marker_0"] + // Remove random start on marker "marker_0" from all selected objects.$/Code$ + - local / global + undefined / undefined - Nothing + Boolean + - addSwitchableUnit + addResources - Adds a unit into the list of units available for Team Switch. Units marked as playable in editor are automatically switchable. This command allows to add non-playable unit into array of switchableUnits and make them available for teamSwitch. SP only. + Adds resources to a team member. - https://community.bistudio.com/wiki/addSwitchableUnit + https://community.bistudio.com/wiki/addResources - addSwitchableUnit Object + Team_Member addResources Array - addSwitchableUnit unitName + teamMember addResources [resource1, resource2,] - $Code$addSwitchableUnit bob$/Code$ - + - undefined / undefined + global / local - Nothing + Nothing + - addTeamMember + addHeadgear - Add given member to given team. Effect is local, unless both member and team are local to PC on which command is executed, then effect is global. - The same Team Member can be member of several different teams at the same time. + Creates a headgear item and tries to link it to headgear slot. If slot is occupied with another item, the item in the slot will be replaced. - https://community.bistudio.com/wiki/addTeamMember + https://community.bistudio.com/wiki/addHeadgear - Team_Member addTeamMember Team_Member + Object addHeadgear String - team addTeamMember member + unit addHeadgear item - $Code$_team addTeamMember _teamMember;$/Code$ + $Code$player addHeadgear "H_HelmetB";$/Code$ - local / local + global / global - Nothing + Nothing + - addToRemainsCollector + enableAudioFeature - Adds an array of vehicles/units to disposal manager for automatic wreck/body removal. The disposal manager follows wreck/body removal values set in description.ext + Enable/disable an audio feature, features are: "lowpass", "building_interior". Return previous state - https://community.bistudio.com/wiki/addToRemainsCollector + https://community.bistudio.com/wiki/enableAudioFeature - addToRemainsCollector Array + enableAudioFeature Array - addToRemainsCollector remains + enableAudioFeature [feature, enable] - $Code$addToRemainsCollector [unit1, unit2, vehicle1];$/Code$ + $Code$prevState = enableAudioFeature ["lowpass", true ];$/Code$ - global / global + undefined / undefined - Nothing + Boolean + - addTorque + showRadio - Applies torque (rotation momentum) to the center of mass of the given object. Torque force is defined as vector [x, y, z] applied in world space. If you need to define torque in model space, convert the torque vector first by vectorModelToWorld or vectorModelToWorldVisual command. The torque applied as impulse. Diagram below explain which way the object would rotate. For more information see NVIDIA docs + Shows or hides the radio on the map screen, if enabled for the mission and you possess the item. (default true ) - https://community.bistudio.com/wiki/addTorque + https://community.bistudio.com/wiki/showRadio - Object addTorque Array + showRadio Boolean - object addTorque torque + showRadio show - $Code$// Apply torque [1000,0,0] to object not factoring object positioning: - _wheel addTorque [1000,0,0];$/Code$ - - $Code$// Apply torque [1000,0,0] relative to object: - _wheel addTorque (_wheel vectorModelToWorld [1000,0,0]);$/Code$ + $Code$showRadio false$/Code$ - global / global + undefined / undefined + (16 Aug, 2009) + In Arma 2, the radio is now an item in ArmA 2. Class path is CfgWeapons- ItemRadio. Use the command addWeapon and removeWeapon to remove it from a unit's inventory. (example: player removeweapon "ItemRadio") - Nothing + Nothing + - addUniform + getUnitTrait - Create a new uniform and try to link it into uniform slot (given uniform has to be supported by allowedUniforms list of target soldier). To check if uniform is allowed use isUniformAllowed and to force add incompatible uniform use forceAddUniform + Gets the current value of a trait of the given unit. + Default traits are: + audibleCoef (scalar) + camouflageCoef (scalar) + engineer (bool) + explosiveSpecialist (bool) + loadCoef (scalar) + medic (bool) + UAVHacker (bool) - https://community.bistudio.com/wiki/addUniform + https://community.bistudio.com/wiki/getUnitTrait - Object addUniform String + Object getUnitTrait String - unit addUniform type + unit getUnitTrait skill_name - $Code$_unit addUniform "U_B_CombatUniform_mcam";$/Code$ + $Code$player getUnitTrait "Medic";$/Code$ - global / global + global / undefined - Nothing + Boolean/Number + - addVehicle + clearRadio - Adds a specified vehicle for use by a specified AI led group taking into account vehicle's cost. The vehicle will be considered as an available vehicle for use by this group. - When vehicle is added in this way, it can appear as a target for the enemy even if the vehicle is currently free of the crew. Vehicles with crew, which are placed in the editor, get automatically added to the group. To remove vehicle from a group, use leaveVehicle. + Clean up the content of radio protocol history. - https://community.bistudio.com/wiki/addVehicle + https://community.bistudio.com/wiki/clearRadio - Group addVehicle Object + clearRadio - groupName addVehicle vehicleName + clearRadio - $Code$_grp addVehicle _vehicle$/Code$ - - $Code$// Using on crewed vehicle: - group tank addVehicle tank;$/Code$ + $Code$clearRadio;$/Code$ - local / undefined + undefined / local - (22 Nov, 2008 00:40) - This command works best when used on empty vehicles. If used on a vehicle already driven by a member of another group, the driver will continue under his own group's orders, which may not benefit the addVehicle group. - More than one vehicle can be added to a group, and more than one group can be added to a vehicle. - When deciding whether to board a vehicle, AI leaders seem to only consider the transport benefit of a vehicle, ignoring any combat benefits the vehicle may provide. + Use $Code$ enableRadio false;$/Code$ to disable the chat. - Nothing + Nothing + - addVest + ATLToASL - Create a new vest and try to link it into vest slot. + Converts a position from PositionATL to PositionASL - https://community.bistudio.com/wiki/addVest + https://community.bistudio.com/wiki/ATLToASL - Object addVest String + ATLToASL PositionATL - unit addVest type + ATLToASL pos - $Code$player addVest "V_TacVest_blk_POLICE";$/Code$ + $Code$ATLToASL ( getPosATL player ) isEqualTo getPosASL player$/Code$ + + $Code$_camPosASL = ATLToASL positionCameraToWorld [0,0,0];$/Code$ undefined / undefined @@ -2997,334 +3107,371 @@ - Nothing + PositionASL + - addWaypoint + lnbData - Adds (or inserts when index is given) a new waypoint to a group. - The waypoint is placed randomly within a circle with the given center and radius. - The function returns a waypoint with format [group, index]. + Returns the additional text (invisible) in an item with the given position of the 2D listbox. - https://community.bistudio.com/wiki/addWaypoint + https://community.bistudio.com/wiki/lnbData - Group addWaypoint Array + lnbData Array + + Control lnbData Array - groupName addWaypoint [center, radius, index, name] + lnbData [idc, [row, column]] + + ctrl lnbData [row, column] - $Code$_wp =_grp addWaypoint [ position player, 0];$/Code$ + $Code$_ctrl lnbData [ lnbCurSelRow _ctrl,0]; //"#1"$/Code$ - global / global + local / local - (November 26, 2009) - In game versions prior to Arma 3 v1.22: - If you add a waypoint to your group and then want them to start moving to that waypoint, make sure to call setWaypointType "MOVE" on your waypoint. - - (18:23, 28 April 2011 (CEST)) - In VBS2 1.30, the randomization of addWaypoint doesn't seem to work correctly all of the time. - The alternative syntax of addWaypoint with a specified index doesn't seem to work correctly. - - (June 21, 2014) - if you want to create a waypoint of type "MOVE" and set it as actual waypoint, you can use the move command that does everything for you with only one line of code ! Be aware that move command intercepts multiple waypoints and it will not line up in waypoints queue. In other word it is a quick solution if you want your group to get only one waypoint, but for several waypoints you'll have to use addwaypoint and all setwaypointXXXXXX commands around. see move command. - - (August 4, 2014) - The waypoint may not be created exactly at the center position even if radius is zero. The position will be moved away if there are e.g. rocks at the center position or if it is placed at the edge of water on a shore. + (Sep 9 2014) + (A3 1.28)As for invisible data processing, lnbAddArray, lnbAddColumn, lnbData, lnbGetColumnsPosition, lnbSetColumnsPos, lnbSetData, lnbSetText, lnbSetValue, lnbText and lnbValue store data types into exact position of the listNbox with different spaces. Accessing data with coordinate command at nearly the same syntax: + $Code$ + //Set same value to one position of a Control + _ctrl lnbSetData [ [0,0],"#1"]; + lnbSetColumnsPos [102, [0,1], 1]; + _ctrl lnbSetText [ [0,1], "#1"]; + _ctrl lnbSetValue [ [0,0],1]; + //Accessing the value disregard affecting one another. + _ctrl lnbData [0,0]; //"#1" + lnbGetColumnsPosition _ctrl //[1]; + _ctrl lnbText [0,0];//"#1" + _ctrl lnbValue [0,0];//1 + $/Code$ + For a direct visible control over CT_LISTNBOX: + $Code$ + 0 = [_CT_LISTNBOX] spawn { + private ["_CT_LISTNBOX","_color","_current","_pic"]; + disableSerialization ; + _CT_LISTNBOX = _this select 0; + { + _CT_LISTNBOX lnbAddRow [ getText (_x "displayNameShort"), getText (_x "displayName")]; + _CT_LISTNBOX lnbSetPicture [ [_foreachIndex,0], getText (_x "texture")]; + } forEach (" isClass _x" configClasses ( configFile "CfgRanks")); + _CT_LISTNBOX lnbSetCurSelRow 0; + _current = lnbCurSelRow _CT_LISTNBOX; + _color = _CT_LISTNBOX lnbColor [_current,0]; + _CT_LISTNBOX lnbSetColor [ [_current,1], [(_color select 0)/2,0,0,1] ]; + _CT_LISTNBOX lnbDeleteColumn 0; + _CT_LISTNBOX lnbDeleteRow 1; + sleep 1; + lnbClear _CT_LISTNBOX;//Clear all items but control still remains just invisible. + }; + $/Code$ + A combined use of both invisible and visible data processing commands alive the Control. - Array + String - String + - addWeaponCargoGlobal + fillWeaponsFromPool - Add weapons to the cargo space of vehicles, which can be taken out by infantry units. - MP Synchronized + Adds magazines from the campaign pool to the given unit, depending on his weapons. - https://community.bistudio.com/wiki/addWeaponCargoGlobal + https://community.bistudio.com/wiki/fillWeaponsFromPool - Object addWeaponCargoGlobal Array + fillWeaponsFromPool Object - vehicleName addWeaponCargoGlobal [weaponName, count] + fillWeaponsFromPool unitName - $Code$_truck addWeaponCargoGlobal["M16",5];$/Code$ + $Code$fillWeaponsFromPool _soldier$/Code$ - global / global + undefined / undefined - (November 7, 2011) - Synchronized to JIP as well. - Nothing + Nothing + - addWeaponCargo + cameraInterest - Add weapons to the cargo space of vehicles, which can be taken out by infantry units. Ignores available cargo space. - In Arma 3, arguments for this command must be local ( ). For global variant see addWeaponCargoGlobal + Return camera interest for given entity, as set by setCameraInterest, or as autodetected. - https://community.bistudio.com/wiki/addWeaponCargo + https://community.bistudio.com/wiki/cameraInterest - Object addWeaponCargo Array + cameraInterest Object - vehicleName addWeaponCargo [weaponName, count] + cameraInterest entity - $Code$_truck addWeaponCargo ["M16",5]$/Code$ + $Code$camInterest = cameraInterest myUnit;$/Code$ - global / local + undefined / undefined - (October 24, 2009) - Only works on clients. - - (July 10, 2010) - When players add/remove gear directly via the gear menu that gear is synchronized across the network. Since this command is local only, using it during a mission can cause all sorts of weird issues. To get proper synchronization use this command in the object's init line or in a script called from its init line with a call compile preprocessFile command (and not execVM ). - Nothing + Number + - addWeaponGlobal + surfaceIsWater - Add a weapon to a unit. Infantry units can only carry weapons in their respective slots (primary, secondary and handgun), the addWeaponGlobal command will replace the weapon currently in a slot with the added weapon if it shares the same slot. - To make sure the added weapon is loaded and ready, add the magazine first. - This command is broken when used on dedicated server + Returns whether water is at given position. - https://community.bistudio.com/wiki/addWeaponGlobal + https://community.bistudio.com/wiki/surfaceIsWater - Object addWeaponGlobal String + surfaceIsWater Array - unit addWeaponGlobal weapon + surfaceIsWater position - $Code${ - _x addMagazineGlobal "Laserbatteries"; - _x addWeaponGlobal "Laserdesignator"; - } forEach allUnits ;$/Code$ + $Code$_isWater= surfaceIsWater [1000, 3000];$/Code$ - $Code${ - if ( typeOf _x == "O_Heli_Attack_02_black_F") then { - _x addMagazineGlobal "38Rnd_80mm_rockets"; - _x addWeaponGlobal "rockets_Skyfire"; - }; - } forEach vehicles ;$/Code$ + $Code$_isWater = surfaceIsWater position player ;$/Code$ - global / global + undefined / undefined - (July 7, 2015) - If you do not remove weapon first, using this command from dedicated server will duplicate weapon. + (4 May, 2012) + Does not work with inland water. Works only with sea water. - Nothing + Boolean + - addWeaponItem + addItem - Adds a weapon item to the specified weapon. The item can be weapon magazine, in which case the amount of ammo and target muzzle could also be specified. + Creates new item and tries to add it into inventory. Inventory must have enough space to accomodate new item or command will fail.The item can also be a weapon or a magazine. - https://community.bistudio.com/wiki/addWeaponItem + https://community.bistudio.com/wiki/addItem - Object addWeaponItem Array + Object addItem String - unit addWeaponItem [weaponName, itemName] - - unit addWeaponItem [weaponName, [itemName, ammoCount, muzzleName]] + unit addItem item - $Code$player addWeaponItem ["arifle_MX_GL_ACO_F", "1Rnd_HE_Grenade_shell"];$/Code$ - - $Code$player addWeaponItem ["arifle_MX_GL_ACO_F", ["1Rnd_HE_Grenade_shell", 1, "GL_3GL_F"]];$/Code$ + $Code$bluforUnit addItem "NVGoggles"; + bluforUnit assignItem "NVGoggles"; + opforUnit addItem "NVGoggles_OPFOR"; + opforUnit assignItem "NVGoggles_OPFOR"; + independentUnit addItem "NVGoggles_INDEP"; + independentUnit assignItem "NVGoggles_INDEP";$/Code$ - local / global + global / global - Nothing + Nothing + - addWeaponPool + setRain - Add weapons to the weapon pool, of which the player may choose in the following mission. Available in campaigns only. + Set rain density smoothly over the given transition time (in seconds). A transition time of zero means an immediate change. A rain density of zero is no rain, one is maximum rain. Rain is not possible when overcast is less than 0.7. + NOTE : Since Arma 3 this command is MP synchronised, if executed on server, the changes will propagate globally. If executed on client effect is temporary as it will soon change to the server setting. - https://community.bistudio.com/wiki/addWeaponPool + https://community.bistudio.com/wiki/setRain - addWeaponPool Array + Number setRain Number - addWeaponPool [weaponName, count] + time setRain rain - $Code$addWeaponPool ["M16",5];$/Code$ + $Code$60 setRain 1;$/Code$ + + $Code$// Force no rain: + 0 setRain 0; + forceWeatherChange ; + 999999 setRain 0;$/Code$ - undefined / undefined + undefined / global + This scripting command must be executed on the server to work properly in multiplayer + + (December 15, 2015) + setTimeMultiplier does NOT affect transition time. + + (November 16, 2016) + Using Example 2 on dedicated server might need additional interference on JIP clients. The reason is that JIP has rain value 0 slowly changing to 0. To force client to sync one can execute this on client: $Code$ skipTime 1; skipTime -1;$/Code$ - Nothing + Nothing + - addWeaponTurret + list - Adds a weapon to the turret. Use turret path [-1] for driver's turret. + List of units that would activate given Trigger. + It returns nothing before the simulation started, i.e. in (undelayed) init.sqf files. Returns a pointer to the trigger's list after the simulation started. Since this is just a reference this means that the value in your local variable will change as the content of the trigger area changes. To permanently copy the returned list to a different variable, use _mylist = +(list triggerOne). + The second example can be used inside the trigger (in that case, no need to name your trigger). + The list returned for trigger of type "Not present" is the same as that returned for type "present". + NOTE: While the command can query any trigger, local or remote, the result will be only for the trigger condition set on the local client. See createTrigger for more info. - https://community.bistudio.com/wiki/addWeaponTurret + https://community.bistudio.com/wiki/list - Object addWeaponTurret Array + list Object - vehicle addWeaponTurret [weaponName, turretPath] + list trigger - $Code$_tank addWeaponTurret ["LMG_M200",[0,0]];$/Code$ + $Code$_tlist = list _triggerOne;$/Code$ + + $Code$hint format ["%1", thislist ];$/Code$ - local / global + global / local + (March 6, 2013) + Calling list immediately after creating a trigger via createTrigger (and setting up activation, area, statements, timeout, etc..), will return null instead of an array. It seems the trigger needs about 1 second to initialise, after which it will behave as expected: returning an array of all the objects inside the trigger (the ones matching the criteria), or an empty array. - Nothing + Array/Nothing + - addWeapon + groupFromNetId - Add a weapon to a unit. The unit must be local to the computer where command is executed. For a global version of this command see addWeaponGlobal. - Infantry units can only carry a specific number of weapons, once the weapon slots are filled, any further addWeapon commands are ignored. + Get group with given unique ID. For objects use objectFromNetId. As this command is MP only, you can use BIS_fnc_groupFromNetId, which extends the use to SP as well. - https://community.bistudio.com/wiki/addWeapon + https://community.bistudio.com/wiki/groupFromNetId - Object addWeapon String + groupFromNetId String - unit addWeapon weapon + groupFromNetId id - $Code$player addMagazine "30Rnd_556x45_Stanag"; - player addWeapon "BAF_L85A2_RIS_SUSAT";$/Code$ - - $Code$An_2 addMagazine "100Rnd_762x51_M240"; - An_2 addWeapon "M240_veh";$/Code$ + $Code$_group = groupFromNetId "4:45";$/Code$ - local / global + undefined / undefined - (August 2, 2006) - Notes from before the conversion: - To ensure that the weapon is loaded at the start of the mission, add at least one magazine ( addMagazine ) before adding the weapon. To remove weapons use the removeAllWeapons or the removeWeapon commands. - - When adding a weapon in-game, a bug means that sometimes the weapon can't be fired. Swap to a different weapon and swap back again to enable the newly added weapon to fire; or drop and pick up the weapon again. - Nothing + Group + - admin + WFSideText - This is dedicated server command, which queries the admin state of any client on the network by their client ( owner ) id. Possible results are: - 1 - client is admin that is voted in - 2 - client is admin that is logged in - In all other cases it returns 0. To self check the admin state of a local client, use BIS_fnc_admin. + Returns the un localized text value of an object's side / a group's side or a side as: + east, opfor - "East" + west, blufor - "West" + resistance, independent - "Resistance" + civilian - "Civilian" + sideUnknown - "Unknown" + sideEnemy - "Unknown" + sideFriendly - "Unknown" + sideLogic - "Unknown" + sideEmpty - "Unknown" + sideAmbientLife - "Unknown" - https://community.bistudio.com/wiki/admin + https://community.bistudio.com/wiki/WFSideText - admin Number + WFSideText Object/Group/Side - admin ownerID + WFSideText param - $Code$_isLoggedInAdmin = admin 3 == 2;$/Code$ + $Code$WFSideText player ;$/Code$ - $Code$_adminState = admin owner unit1;$/Code$ + $Code$WFSideText group player ;$/Code$ + + $Code$WFSideText west$/Code$ undefined / undefined - This scripting command must be executed on the server to work properly in multiplayer + (August 17, 2014) + WF stands for Warfare - Number + String + - agent + weaponAccessoriesCargo - Return a person for a given agent. + Returns array with all items assigned to the given weapon in given cargo container. - https://community.bistudio.com/wiki/agent + https://community.bistudio.com/wiki/weaponAccessoriesCargo - agent Team_Member + Object weaponAccessoriesCargo Array - agent teamMember + container weaponAccessoriesCargo [weaponId, creatorId] @@ -3334,596 +3481,660 @@ - Object + Array + - agents + camPrepareDir - Return a list of agents in the current mission. + Prepares the camera heading. + This command is non-functional ! - https://community.bistudio.com/wiki/agents + https://community.bistudio.com/wiki/camPrepareDir - agents + Object camPrepareDir Number - agents + camera camPrepareDir direction - $Code${ agent _x moveTo position player } forEach agents ;$/Code$ + $Code$_camera camPrepareDir 150$/Code$ undefined / undefined - (April 4, 2012) - Note that agents returns a reference to the agent itself, not the object. For example: {alive _x} count agents; would return an error. But you can assign the agent a reference using setVariable, and then reference it, for example: {alive (_x getVariable ["agentObject",objNull]) count agents; would return the number of agents still alive - BUT you would need to define "agentObject" after you create the agent, for example: - _agent = createAgent [_type, _position, [], _radius, "NONE"];_agent setVariable["agentObject",_agent,true]; - - (August 1, 2013) - Alternatively, to get object from agent reference use agent command. - Array + Nothing + - aimPos + diag_activeSQFScripts - Returns the position of the object other units can aim to. + Returns an array with active SQFs. - https://community.bistudio.com/wiki/aimPos + https://community.bistudio.com/wiki/diag_activeSQFScripts - aimPos Object + diag_activeSQFScripts - aimPos object + diag_activeSQFScripts - $Code$aimPos player$/Code$ + $Code${ systemChat str _x} forEach diag_activeSQFScripts ;$/Code$ + + $Code$[] spawn { + hint str diag_activeSQFScripts ; //[[" spawn ","",true,1]] + }; + [] spawn { + scriptName "myScript"; + hint str diag_activeSQFScripts ; //[["myScript","",true,1]] + };$/Code$ - global / undefined + undefined / undefined - (July 7, 2015) - Generally returns the center position of the object (middle of the geometry, not the model's [0,0,0]). - Array + Array + - aimedAtTarget + lockCameraTo - Returns how good the weapon of the vehicle is aimed at the target. + Lock/Unlock stabilized camera (in vanilla used currently only for UAVs) to target. - https://community.bistudio.com/wiki/aimedAtTarget + https://community.bistudio.com/wiki/lockCameraTo - Object aimedAtTarget Array + Object lockCameraTo Array - vehicle aimedAtTarget [target, weapon] + vehicle lockCameraTo [target, turretPath] - $Code$_aimingQuality = heli aimedAtTarget [target];$/Code$ - - $Code$_aimingQuality = heli aimedAtTarget [target,"M197"];$/Code$ + $Code$uav lockCameraTo [vehicle, [0,0]];$/Code$ undefined / undefined - (November 19, 2013) - The command doesn't work with soldier weapons, only vehicle weapons (in Arma 3 at least). The return value is either 1 or 0, very rarely the value falls in between. 1 doesn't mean you are going to hit the target, while 0 means you're definitely off. + (April 10, 2015) + The command also accepts a position (ASL) instead of an object. The vehicle has to have a stabilized optic for this command to work. - Number + Nothing + - airDensityRTD + tvSetValue - Returns air density in given altitude + Sets scalar data to item on given path. IDC means id of parent Tree View. If the given value is not integer, it will be converted to integer - https://community.bistudio.com/wiki/airDensityRTD + https://community.bistudio.com/wiki/tvSetValue - airDensityRTD Number + tvSetValue Array + + Control tvSetValue Array - airDensityRTD altitude + tvSetValue [idc, [path], val] + + _ctrl tvSetValue [ [path], val] - $Code$_density = airDensityRTD 0;//Returns 1.22406$/Code$ + $Code$tvSetValue [101, [0], 555];$/Code$ - $Code$_density = airDensityRTD 1000;//Returns 1.11096$/Code$ + $Code$_ctrl tvSetValue [ [0,0,0], 14];$/Code$ - undefined / undefined + local / local + (September 11, 2014) + (A3 1.28)tv command family overview + $Code$ + //tv command family available for CT_TREE (type 12) + private ["_count","_current","_data","_text","_value","_pic"]; + _CT_TREE tvAdd [ [],"Parent_A"]; + _CT_TREE tvAdd [ [0],"Child_A"]; + _CT_TREE tvAdd [ [0,0],"Grandchild_A"]; + _CT_TREE tvAdd [ [],"Parent_B"]; + _CT_TREE tvAdd [ [1],"Child_B"]; + _count = _CT_TREE tvCount []; //return 2 + _CT_TREE tvSetCurSel [0,0,0]; //select grandchild_A + _current = tvCurSel _CT_TREE; //return [0,0,0] + _CT_TREE tvSetData [_current,"I'm grandchild_A"]; + _data = _CT_TREE tvData _current; // "I'm grandchild_A" + _text = _CT_TREE tvText _current; //"Grandchild_A" + _CT_TREE tvSetValue [_current,14]; + _value = _CT_TREE tvValue _current; // 14 + _CT_TREE tvSetPicture [_current, getText ( configFile "CfgWeapons" "optic_NVS" "picture")]; + _pic = _CT_TREE tvPicture _current; + _CT_TREE tvExpand [1]; + _CT_TREE tvSort [[], false ]; + _CT_TREE tvSortByValue [[], false ]; + _CT_TREE tvDelete [0,0]; //remove child_b + tvClear 12; + _CT_TREE tvCollapse []; + $/Code$ - Number + Nothing - Nothing + - airplaneThrottle + setLightIntensity - Returns throttle position. Works only on player's vehicle. + Sets intensity of light. - https://community.bistudio.com/wiki/airplaneThrottle + https://community.bistudio.com/wiki/setLightIntensity - airplaneThrottle Object + Object setLightIntensity Number - airplaneThrottle airplane + light setLightIntensity value - $Code$_trottle = airplaneThrottle myPlane$/Code$ + $Code$myLight setLightIntensity 4;$/Code$ - undefined / undefined + local / local + (Mar 24, 2014) + In ArmA3 ver1.14 setLightIntensity will overwrite the previous effect processed by setLightBrightness on the same light source, vice versa. And both of them currently play the same role on brightness, for example: $Code$_light setLightIntensity 3000;// same as _light setLightBrightness 1;$/Code$ - Number + Nothing + - airportSide + weaponAccessories - Checks a side of the airport. ID is the number to identify which airport on the island you want to check. - Possible values for sara are: - 0 - Paraiso - 1 - Rahmadi - 2 - Pita - 3 - Antigua + Get array with all items linked to a given weapon. - https://community.bistudio.com/wiki/airportSide + https://community.bistudio.com/wiki/weaponAccessories - airportSide Number - - airportSide Object + Object weaponAccessories String - airportSide id - - airportSide target + unit weaponAccessories weapon - $Code$airportSide 0;$/Code$ + $Code$player weaponAccessories primaryWeapon player ; ["","acc_pointer_IR","optic_Aco",""]$/Code$ undefined / undefined + (October 26, 2014) + To check if currently selected muzzle has a silencer: + $Code$hasSilencer = player weaponAccessories currentMuzzle player param [0, ""] != "";$/Code$ + + (March 16, 2015) + Since revision 129742, this command also returns an attached bipod. - Side - Side + Array + - alive + musicVolume - Check if given vehicle/person/building is alive (i.e. not dead or destroyed). alive objNull returns false. + Checks the current music volume (set by fadeMusic ) - https://community.bistudio.com/wiki/alive + https://community.bistudio.com/wiki/musicVolume - alive Object + musicVolume - alive object + musicVolume - $Code$// SQS: - ?!( alive player ) : exit$/Code$ - - $Code$// SQF: - if (! alive player ) exitWith {};$/Code$ - + - global / undefined + undefined / undefined - (October 19, 2015) - Alive or not could be the question! in multi-player, missions come with respawn module(s). When a player is dead shot, (alive player) will return false, then almost immediately true if the "revive" respawn template is enabled, then could turn on false if time for assistance is elapsed or if the player activates the respawn menu before; and finally true after player respawns. Just be aware that in that case (respawn + revive enabled), the status of the player is toggling: true false true false true. Then, alive status while player is waiting for being rescued could lead to some error scripts as player is supposed to be alive but in limbo and the dead entity "player" passed to server. - Boolean + Number + - all3DENEntities + createLocation - Returns an array of all currently placed Eden Editor entities, including groups, waypoints, and markers in following format: - [objects, groups, triggers, systems, waypoints, markers, layers, comments] - objects: Array of Objects - groups: Array of Groups - triggers: Array of Objects - systems: Array of Objects - waypoints: Array of Arrays in Waypoint format - markers: Array of Strings - layers: Array of Numbers - comments: Array of Numbers + Creates a location of the specified class and dimensions at the specified position. Classes are defined in CfgLocationTypes. - https://community.bistudio.com/wiki/all3DENEntities + https://community.bistudio.com/wiki/createLocation - all3DENEntities + createLocation Array - all3DENEntities + createLocation [className, position, sizeX, sizeY] - $Code$systemChat str all3DENEntities ;$/Code$ + $Code$_location = createLocation [ "NameVillage", [4035,2151,10], 100, 100];$/Code$ + + $Code$_location = createLocation [ "NameVillage", [4035,2151,10], 30, 30]; + _location setText "Player town";$/Code$ - undefined / undefined + undefined / local + (12:25, 12 February 2010) + Possible location types, see: Location Types + For the actual name text of the location, use setText. - Array + Location + - allAirports + getDLCs - Returns all map airports, both static and dynamic + Returns array of appIDs of DLCs. Use filter param to get specific type of DLCs: + 0 - all + 1 - owned + 2 - not owned - https://community.bistudio.com/wiki/allAirports + https://community.bistudio.com/wiki/getDLCs - allAirports + getDLCs Number - allAirports + getDLCs filter - $Code$_allAirports = allAirports ;$/Code$ + $Code$_ownedDLCs = getDLCs 1;$/Code$ + + $Code$// Is the Karts DLC owned by this client? + hintSilent str (288520 in ( getDLCs 1));$/Code$ undefined / undefined + (May 30, 2014) + Current list of IDs that correspond to the available DLCs: + 275700 - Arma 3 Zeus + 249860 - Arma 3 Soundtrack + 304400 - Arma 3 DLC Bundle + 249861 - Arma 3 Maps + 249862 - Arma 3 Tactical Guide + 288520 - Arma 3 Karts + 304380 - Arma 3 Helicopters + 332350 - Arma 3 Marksmen + + (April 7, 2015) + To add to the note above, app ID can be found in CfgMods. Here is an example path from zeus using the Splendid Config Viewer: + $Code$ configFile "CfgMods" "Curator" "appId"$/Code$ + This method can be used to find app IDs without having to find a list like the one above. + I am also pretty sure you are able to define your own app ID for your own mods using this method. + + (July 1, 2016) + The required DLC-IDs equal to the Steam App-IDs of each obtainable DLC. + To extend Sniperwolfs list: + 395180 - Arma 3 Apex + + (October 30, 2017) + More dlc + Arma 3 Laws of War 571710 + Arma 3 Jets 601670 - Array + Array + - allControls + ctSetValue - Returns a list of all controls for desired existing display. Returned controls also include controls from control groups + Associates metadata (number) with the row determined by the index. Returns Nothing. - https://community.bistudio.com/wiki/allControls + https://community.bistudio.com/wiki/ctSetValue - allControls Display + Control ctSetValue Number - allControls display + Control ctSetValue Number - $Code$_allCtrls = allControls findDisplay 46;$/Code$ + $Code$_control ctSetValue 0;$/Code$ - undefined / undefined + local / local - Array + Nothing + - allCurators + lnbGetColumnsPosition - Returns list of all curators. + Returns relative screen X of ListNBox control columns position [0.1,0.3,0.6...]. Use lnbSetColumnsPos to set positions. - https://community.bistudio.com/wiki/allCurators + https://community.bistudio.com/wiki/lnbGetColumnsPosition - allCurators + lnbGetColumnsPosition Control - allCurators + lnbGetColumnsPosition _ctrl - $Code$_myVariable = allCurators;$/Code$ + $Code$lnbGetColumnsPosition _ctrl;$/Code$ - undefined / undefined + local / local - (June 20, 2015) - This returns all curator logic units, not the units assigned to the logic. + (Sep 9 2014) + (A3 1.28)As for invisible data processing, lnbAddArray, lnbAddColumn, lnbData, lnbGetColumnsPosition, lnbSetColumnsPos, lnbSetData, lnbSetText, lnbSetValue, lnbText and lnbValue store data types into exact position of the listNbox with different spaces. Accessing data with coordinate command at nearly the same syntax: + $Code$ + //Set same value to one position of a Control + _ctrl lnbSetData [ [0,0],"#1"]; + lnbSetColumnsPos [102, [0,1], 1]; + _ctrl lnbSetText [ [0,1], "#1"]; + _ctrl lnbSetValue [ [0,0],1]; + //Accessing the value disregard affecting one another. + _ctrl lnbData [0,0]; //"#1" + lnbGetColumnsPosition _ctrl //[1]; + _ctrl lnbText [0,0];//"#1" + _ctrl lnbValue [0,0];//1 + $/Code$ + For a direct visible control over CT_LISTNBOX: + $Code$ + 0 = [_CT_LISTNBOX] spawn { + private ["_CT_LISTNBOX","_color","_current","_pic"]; + disableSerialization ; + _CT_LISTNBOX = _this select 0; + { + _CT_LISTNBOX lnbAddRow [ getText (_x "displayNameShort"), getText (_x "displayName")]; + _CT_LISTNBOX lnbSetPicture [ [_foreachIndex,0], getText (_x "texture")]; + } forEach (" isClass _x" configClasses ( configFile "CfgRanks")); + _CT_LISTNBOX lnbSetCurSelRow 0; + _current = lnbCurSelRow _CT_LISTNBOX; + _color = _CT_LISTNBOX lnbColor [_current,0]; + _CT_LISTNBOX lnbSetColor [ [_current,1], [(_color select 0)/2,0,0,1] ]; + _CT_LISTNBOX lnbDeleteColumn 0; + _CT_LISTNBOX lnbDeleteRow 1; + sleep 1; + lnbClear _CT_LISTNBOX;//Clear all items but control still remains just invisible. + }; + $/Code$ + A combined use of both invisible and visible data processing commands alive the Control. - Array + Array + - allCutLayers + removeAllMPEventHandlers - Returns all named layers used by cutRsc, cutText, cutObj or cutFadeOut. The layer normally would be added on the first use of any of the aforementioned commands, however if a layer needs to be reserved it could be done like so: _layerNum = "myLayerName" cutFadeOut 0;. The index of the layer name in the array corresponds to the layer number the cut effect will be displayed on. If no layers were defined, the return is [""], because 0 layer is reserved for usage in cut commands without layer param or when name of the layer given is empty "". + Removes all MP event handlers of the given type which were added by addMPEventHandler. Command needs to be executed only on one PC for MP event handler to be removed globally. - https://community.bistudio.com/wiki/allCutLayers + https://community.bistudio.com/wiki/removeAllMPEventHandlers - allCutLayers + Object removeAllMPEventHandlers String - allCutLayers + objectName removeAllMPEventHandlers event - $Code$_allLayers = allCutLayers ;$/Code$ + $Code$player removeAllMPEventHandlers "mpkilled";$/Code$ - undefined / undefined + global / global - Array + Nothing + - allDeadMen + addMagazineCargo - Return a list of dead units including agents. Dead unit might be inside vehicle. + Add magazines to the cargo space of vehicles, which can be taken out by infantry units. Once the magazine cargo space is filled up, any further addMagazineCargo commands are ignored. + In Arma 3, arguments for this command must be local ( ). For global variant see addMagazineCargoGlobal - https://community.bistudio.com/wiki/allDeadMen + https://community.bistudio.com/wiki/addMagazineCargo - allDeadMen + Object addMagazineCargo Array - allDeadMen + vehicleName addMagazineCargo [magazineName, count] - $Code${ deleteVehicle _x } forEach allDeadMen;$/Code$ + $Code$_truck addMagazineCargo ["M16", 5];$/Code$ - undefined / undefined + global / local - (17 Oct, 2009) - As dead men are civilian side, don't try to count them with {side _x isEqualTo EAST} count allDeadMen; result will always be 0. - Use the configfile "side" instead: - 0 = [] spawn {while {true} do {sleep 0.1; _westScore = {getNumber (configfile "CfgVehicles" typeOf _x "side") == 0} count allDeadMen; hintSilent format ["East killed: %1",_westScore]};}; + (October 24, 2009) + Only works on clients. - Array + Nothing + - allDead + ctFindRowHeader - Return a list of all dead units including agents and destroyed vehicles. Dead units may be in vehicles. + Takes index of a row as a parameter. Returns index of the closest header above this row. - https://community.bistudio.com/wiki/allDead + https://community.bistudio.com/wiki/ctFindRowHeader - allDead + Control ctFindRowHeader Number - allDead + ctrl ctFindRowHeader row - $Code${ deleteVehicle _x } forEach allDead ;$/Code$ - - $Code$// allAlive: - _all = allUnits + vehicles ; - { - _all pushBack agent _x; - } forEach ( agents - [ teamMemberNull ]); - allAlive = _all - allDead ;$/Code$ + $Code$_index = _control ctFindRowHeader 0;$/Code$ - undefined / undefined + local / local - (April 6, 2017) - This also returns bodies hidden with hideBody until they are deleted. Tested in A2OA 1.63.131129 - Array + Number + - allDisplays + curatorRegisteredObjects - Returns a list of all opened GUI displays. Other displays, such as IGUI displays could be accessed via uiNamespace variable, which is updated every time display is opened or closed. For example, to access IGUI displays: - $Code$ uiNamespace getVariable ["IGUI_displays", []];$/Code$. Other display variables: - 3DENDisplays_displays - 3DENDisplaysTemp_displays - GUI_displays - IGUI_displays - Loading_displays - CuratorDisplays_displays - BootcampDisplays_displays - CuratorTitles_displays - BootcampTitles_displays - KartDisplays_displays + Returns array with all objects that has curator registered and their settings. - https://community.bistudio.com/wiki/allDisplays + https://community.bistudio.com/wiki/curatorRegisteredObjects - allDisplays + curatorRegisteredObjects Object - allDisplays + curatorRegisteredObjects curatorObj - $Code$_allDisps = allDisplays ;$/Code$ - + undefined / undefined - Array + Array + - allGroups + addCuratorAddons - Return a list of all groups created on the following sides east, west, resistance / independent and civilian only. Does not contain groups of sideLogic. + Allow curator use of given addon. - https://community.bistudio.com/wiki/allGroups + https://community.bistudio.com/wiki/addCuratorAddons - allGroups + Object addCuratorAddons Array - allGroups + curatorObj addCuratorAddons addons - $Code${( leader _x) sideChat "Go ! Go ! Go !"} forEach allGroups ;$/Code$ + $Code$curatorObj addCuratorAddons ["A3_Armor_F_AMV","A3_Armor_F_Panther"];$/Code$ - $Code$// All groups with players: - private _allGroupsWithPlayers = []; - {_allGroupsWithPlayers pushBackUnique group _x} forEach allPlayers ;$/Code$ + $Code$curatorObj addCuratorAddons ["A3_Modules_F_Curator_Lightning"];$/Code$ + + $Code$// Addons can be stacked: + curatorObj addCuratorAddons ["A3_Armor_F_AMV","A3_Armor_F_Panther"]; + curatorObj addCuratorAddons ["A3_Modules_F_Curator_Lightning"]; + diag_log curatorAddons curatorObj;[ + "A3_Armor_F_AMV", + "A3_Armor_F_Panther", + "A3_Modules_F_Curator_Lightning" + ]$/Code$ undefined / undefined + This scripting command must be executed on the server to work properly in multiplayer - Array + Nothing + - allMapMarkers + menuSetData - Return all markers in map including user placed markers (_USER_DEFINED #). - Since Arma 3 v1.57.134377 User defined markers have the following name format: _USER_DEFINED # PlayerID / MarkerID / ChannelID where: - PlayerID - unique network id of the player (same as _id in onPlayerConnected ) - MarkerID - a marker counter id - ChannelID - id of the chat channel on which marker was placed (see currentChannel ) + Sets new data into item on given path. - https://community.bistudio.com/wiki/allMapMarkers + https://community.bistudio.com/wiki/menuSetData - allMapMarkers + menuSetData Array - allMapMarkers + menuSetData [idc, path, data] - $Code$_markers = allMapMarkers ; - // returns: ["marker1","_USER_DEFINED #2/0"]$/Code$ - - $Code${ - private "_a"; - _a = toArray _x; - _a resize 15; - if ( toString _a == "_USER_DEFINED #") then { - deleteMarker _x; - } - } forEach allMapMarkers ;$/Code$ - - $Code$if (_someString in allMapMarkers ) then { - hint (_someString + " is a valid marker name"); - };$/Code$ - + undefined / undefined - (March 17, 2014) - A3 1.12 : Markers placed in editor will be in the array as a string of their name. Markers placed by the player will begin with "_USER_DEFINED #." - - (March 17, 2014) - To expand on the comment above. In Multiplayer, user created marker will appear in allMapMarkers as _USER_DEFINED #ID/Number, where ID is unique id related to _id param from onPlayerConnected and Number is sequential integer incremented by 1 with each marker placement by the IDed user. - Array + Nothing + - allMines + getShotParents - Returns an array of all mines in the mission + Returns shot information Array for the given projectile in format [vehicle, instigator], where vehicle is the vehicle the shot was fired from, and the instigator is the person who pulled the trigger. If shot was fired by a soldier on foot or in FFV position in vehicle, the soldier is returned for the vehicle. - https://community.bistudio.com/wiki/allMines + https://community.bistudio.com/wiki/getShotParents - allMines + getShotParents Object - allMines + getShotParents projectile - $Code$allMines$/Code$ + $Code$_shotParents = getShotParents myProjectile;$/Code$ - $Code$( allMines select 0) mineDetectedBy west ;$/Code$ + $Code$tank addEventHandler ["Fired", { systemChat str getShotParents (_this select 6)}];$/Code$ undefined / undefined @@ -3931,393 +4142,364 @@ - Array + Array + - allMissionObjects + camCommitPrepared - Returns all mission objects (created by or during a mission) with given type (or its subtype). In some cases allMissionObjects could be substituted with entities, which would be much much faster alternative. Some of the unusual mission objects that can be detected with this command (as well as with nearestObject ): - "#slop" - blood drop - "#mark" - unit footprints - "#track" - vehicle tracks - "#crater" - explosion crater on the ground - "#crateronvehicle" - bullet marks on vehicle - "#explosion" - an explosion - "#objectdestructed" - building, tree or bush destruction - "#soundonvehicle" - sound created with say3D for example - "#dynamicsound" - sound source created using createSoundSource + Smoothly conduct the changes that were assigned to a camera within the given time. If the time is set to zero, the changes are done immediately. - https://community.bistudio.com/wiki/allMissionObjects + https://community.bistudio.com/wiki/camCommitPrepared - allMissionObjects String + Object camCommitPrepared Number - allMissionObjects type + camera camCommitPrepared time - $Code$_airObjects = allMissionObjects "Air";$/Code$ - - $Code${ deleteVehicle _x } forEach ( allMissionObjects "");$/Code$ - - $Code$_allMObjects = allMissionObjects "All";$/Code$ + $Code$//create a camera object + _cam = "camera" camCreate [5600,4800,10]; + _cam camPrepareTarget player ; + _cam cameraEffect ["internal", "BACK"]; + _cam camCommitPrepared 0; + //smoothly move the camera to its new position in 6 seconds. + _cam camPreparePos [5680,4720,20]; + _cam camCommitPrepared 6; + waitUntil { camCommitted _cam}; + //proceed$/Code$ - undefined / undefined + local / local - (June 22, 2012) - Be VERY careful with the use of this command. It is very demanding as it must iterate through all mission created objects. Particular care should be taken exercising this often on dedicated servers. - - (Decembere 15, 2013) - For some reason in Arma 3 this command is up to 5 times faster on the dedicated server than on a connected client. In my experiments it took on average 5 ms for the command to complete on a client while under 1 ms on the server. - Array + Nothing + - allPlayers + simulCloudOcclusion - Returns a list of all human players including dead players. The command also returns all connected headless clients. To filter headless clients out: - $Code$_justPlayers = allPlayers - entities "HeadlessClient_F";$/Code$ - NOTES: - In player hosted game, the complete array of allPlayers may get delayed at the start. Use BIS_fnc_listPlayers if you need it earlier - The order of players in the return array may differ from server to clients + Returns clouds occlusion between two given points (0 - no clouds, 1 - full clouds). - https://community.bistudio.com/wiki/allPlayers + https://community.bistudio.com/wiki/simulCloudOcclusion - allPlayers + simulCloudOcclusion Array - allPlayers + simulCloudOcclusion [pos1,pos2] - $Code${ - systemChat format [ - "Player %1 is %2", - name _x, - ["dead", "alive"] select alive _x - ]; - } forEach allPlayers ;$/Code$ - - $Code$_bluNums = west countSide allPlayers ;$/Code$ - - $Code$// Find all human players if headless clients are used: - _allHCs = entities "HeadlessClient_F"; - _allHPs = allPlayers - _allHCs;$/Code$ + $Code$canSeeSun = ( simulCloudOcclusion == 0)$/Code$ undefined / undefined + (8 August, 2014) + The simulCloudOcclusion command is not recognized on dedicated servers, and will produce an error. If you use this command, it cannot be anywhere within a script that is run on the dedicated server, or the entire script will halt. To get around this, you can use: $Code$if ! isDedicated then {[] execVM "simulCloudOcclusionScript.sqf"};$/Code$ - Array + Number + - allSimpleObjects + getCameraViewDirection - Returns array of all simple objects that belong to the listed class names. If the array of types is empty [], all simple objects are returned including those without class name. NOTE : There is no inheritance in simple objects, so only exact class match is allowed. className is not case sensitive. + Returns the direction unit is looking in render time scope. While for AI the origin for the view direction vector can be taken from eyePos unit, for human player the origin should be taken from player camera position positionCameraToWorld [0,0,0] - https://community.bistudio.com/wiki/allSimpleObjects + https://community.bistudio.com/wiki/getCameraViewDirection - allSimpleObjects Array + getCameraViewDirection Object - allSimpleObjects [className1, className2,classNameN] + getCameraViewDirection unit - $Code$allSimpleObjects ["Box_NATO_Equip_F", "Land_CampingChair_V2_F"];$/Code$ - - $Code$_allSimpleObjects = allSimpleObjects [];$/Code$ + $Code$// Draw AI eye direction (green), weapon direction (red) and camera direction (blue) in 3D: + bob = createGroup east createUnit ["O_Soldier_F", [0,0,0], [], 0, "NONE"]; + bob setVehiclePosition [ player modelToWorld [0,100,0], [], 0, "NONE"]; + onEachFrame + { + _beg = ASLToAGL eyePos bob; + _endE = (_beg vectorAdd ( eyeDirection bob vectorMultiply 100)); + drawLine3D [ _beg, _endE, [0,1,0,1]]; + _endW = (_beg vectorAdd (bob weaponDirection currentWeapon bob vectorMultiply 100)); + drawLine3D [_beg, _endW, [1,0,0,1]]; + _endV = (_beg vectorAdd ( getCameraViewDirection bob vectorMultiply 100)); + drawLine3D [_beg, _endV, [0,0,1,1]]; + };$/Code$ - undefined / undefined + global / undefined - Array + Array + - allSites + getMass - Return all sites in map. - This command is considered deprecated and is no longer supported + Returns mass of a PhysX object. - https://community.bistudio.com/wiki/allSites + https://community.bistudio.com/wiki/getMass - allSites + getMass Object - allSites + getMass object - $Code$_allSites = allSites ;$/Code$ + $Code$_mass = getMass _myCar$/Code$ - undefined / undefined + global / undefined + (April 15, 2015) + This function will return 0 for infantry AI units. That means a manned Blufor Hunter has the same mass than an empty one (8306.63). + Crates return their initial mass, but if you empty them or load items, magazines and weapons, the mass remains the same. In fact, none of these (non-physx) objects has a mass. - Array + Number + - allTurrets + endLoadingScreen - Returns array of available turret paths from vehicle object. To look up turrets from config, use BIS_fnc_allTurrets + Finishes loading screen started by startLoadingScreen. - https://community.bistudio.com/wiki/allTurrets + https://community.bistudio.com/wiki/endLoadingScreen - allTurrets Object - - allTurrets Array + endLoadingScreen - allTurrets vehicle - - allTurrets [vehicle, personTurrets] + endLoadingScreen - $Code$_turretPaths = allTurrets SlammerUP; //[[0],[0,0]] - _turretPaths = allTurrets [SlammerUP, true ]; //[[0],[0,0]] - Commander turret is also FFV turret - _turretPaths = allTurrets [SlammerUP, false ]; //[[0]]$/Code$ - - $Code$// Return FFV turrets only: - _FFVTurrets = allTurrets [tank, true ] - allTurrets [tank, false ];$/Code$ + $Code$startLoadingScreen ["Loading My Mission"]; + //Batch of code + //Batch of code + //Batch of code + progressLoadingScreen 0.5; + //Batch of code + //Batch of code + //Batch of code + endLoadingScreen ;$/Code$ undefined / undefined - (April 13, 2016) - The first syntax (vehicle only without boolean) will include commander turrets like in the example, and does not include actual FFV turrets like offroad back seats, as expected. - Also, the driver turret [-1] is never included in the results, which can be solved as follows: - $Code$_paths = [[-1]] + allTurrets _vehicle;$/Code$ - Array - Array + Nothing + - allUnitsUAV + ctRowCount - Return a list of all UAV vehicles. + Returns number of rows (headers not included) in the RscControlsTable. - https://community.bistudio.com/wiki/allUnitsUAV + https://community.bistudio.com/wiki/ctRowCount - allUnitsUAV + ctRowCount Control - allUnitsUAV + ctRowCount Control - $Code$hint format ["No. of UAV(s) on the map: %1", count allUnitsUAV ];$/Code$ - - $Code${_x setDamage 1} forEach allUnitsUAV ;$/Code$ + $Code$ctRowCount _control;$/Code$ - undefined / undefined + local / local - (October 10, 2014) - This command returns a list of all unmanned vehicles, not the UAV AI units inside them, as the name might otherwise suggest. - Array + Number + - allUnits + ctrlDelete - Return a list of all units (all persons except agents) created on the following sides east, west, resistance / independent and civilian only. Does not contain units of sideLogic. Dead units and units awaiting for respawn are also excluded. + Deletes given control. + Returns whether the deletion was successful. - https://community.bistudio.com/wiki/allUnits + https://community.bistudio.com/wiki/ctrlDelete - allUnits + ctrlDelete Control - allUnits + ctrlDelete control - $Code${_x setDamage 0.5; _x groupChat "Braaains"} forEach allUnits ;$/Code$ + $Code$ctrlDelete (( findDisplay 20000) displayCtrl 20001);$/Code$ undefined / undefined - (July 15, 2011) - It returns infantry outside and inside vehicles. + (April 18, 2015) + ctrlDelete can only delete controls created with ctrlCreate. Use ctrlShow false and ctrlEnable false to disable existing controls. - Array + Boolean + - allVariables + globalRadio - Returns a list of all variables from desired namespace. Namespaces supported: - Control - Team_Member - Namespace - Object - Group - Task - Location + Sends the audio message to the global radio channel. The message is defined in CfgRadio in the description.ext file or config radio protocol. The transmission will play only on the PC where command was executed. If you need the transmission to play on all computers, you have to execute it globally (see remoteExec ). + Note: When transmitting unit gets killed, transmission will be interrupted, however when receiving unit gets killed, the transmission continues to play. - https://community.bistudio.com/wiki/allVariables + https://community.bistudio.com/wiki/globalRadio - allVariables Control/Team_Member + Object globalRadio String - allVariables namespace + unit globalRadio radioName - $Code$_allVarsUINamespace = allVariables uiNamespace ;$/Code$ + $Code$_soldierOne globalRadio "messageOne";$/Code$ - $Code$_allVarsTrigger = allVariables trigger1;$/Code$ + $Code$player globalRadio configName selectRandom ("true" configClasses ( configFile "CfgRadio"));$/Code$ - undefined / undefined + global / local - (June 11, 2016) - Using profileNamespace and uiNamespace with this command has been disabled in multiplayer. [1] - - (October 1, 2016) - One still can use allVariables in Multiplayer against profileNamespace and uiNamespace using config parser. In Description.ext - $Code$_EXEC(somevar = allVariables profileNamespace)$/Code$ - in code - $Code$_allprofilevars = parsingNamespace getVariable "somevar"$/Code$ - but list will be valid only at the moment of parsing config. + (December 3, 2016) + To transmit user custom sounds (see Multiplayer_Custom_Sounds_Tutorial ), prefix the full filename including file extension with #. For example if there is a custom user sound file called MySound.ogg, to play it on the radio use: + $Code$ player globalRadio "#MySound.ogg";$/Code$ - Array + Nothing + - allow3DMode + checkAIFeature - Allow/dissallow 3D mode., - i - Some Old Editor Command + Check if given AI feature is currently enabled. Feature may be one of: + "AwareFormationSoft", "CombatFormationSoft". - https://community.bistudio.com/wiki/allow3DMode + https://community.bistudio.com/wiki/checkAIFeature - Control allow3DMode Boolean + checkAIFeature String - map allow3DMode bool + checkAIFeature feature - + $Code$_featureUsed = checkAIFeature "AwareFormationSoft"$/Code$ + undefined / undefined - Nothing + Boolean + - allowCrewInImmobile + isSimpleObject - If true, units can be in a vehicle with broken tracks/wheels. + Returns true if given object is simple object - https://community.bistudio.com/wiki/allowCrewInImmobile + https://community.bistudio.com/wiki/isSimpleObject - Object allowCrewInImmobile Boolean + isSimpleObject Object - vehicle allowCrewInImmobile bool + isSimpleObject object - $Code$_vehicle allowCrewInImmobile true ;$/Code$ + $Code$_isSimple = isSimpleObject _obj1;$/Code$ undefined / undefined - (April 27, 2015) - This will stop AI disembarking when immobile - $Code$KK_fnc_allowCrewInImmobile = { - _this allowCrewInImmobile true; - { - _x disableAI "FSM"; - _x setBehaviour "CARELESS"; - } forEach crew _this; - }; - //example - car call KK_fnc_allowCrewInImmobile;$/Code$ - Nothing + Boolean + - allowCuratorLogicIgnoreAreas + kbAddDatabase - Allows curator placing and working with modules outside of edit areas. + Register knowledge base database to given person. See Conversations for more details. + This function is no longer available in ArmA 2. + This function is no longer available in Arma 3. - https://community.bistudio.com/wiki/allowCuratorLogicIgnoreAreas + https://community.bistudio.com/wiki/kbAddDatabase - Object allowCuratorLogicIgnoreAreas Boolean + Object kbAddDatabase String - curatorObj allowCuratorLogicIgnoreAreas allow + person kbAddDatabase fileName - $Code$curatorModule allowCuratorLogicIgnoreAreas true$/Code$ + $Code$_hasBeenAdded = _unit kbAddDatabase "chat.txt"$/Code$ undefined / undefined @@ -4325,681 +4507,714 @@ - Nothing + Boolean + - allowDamage + primaryWeaponMagazine - Allow or prevent an object being damaged (or injured, or killed). The command does not prevent object from taking scripted damage such as setHit, setHitIndex, setHitPointDamage or setDamage. To check if damage is allowed at current locality, see isDamageAllowed. - ! - This command has to be executed where object is local and as long as object does not change locality the effect of this command will be global. If object changes locality, the command needs to be executed again on the new owner 's machine to maintain the effect + Returns array containing class name of currently loaded primary weapon magazine (or magazine s in case of weapon having grenade launcher), otherwise it returns []. This command is used for infantry weapons only. - https://community.bistudio.com/wiki/allowDamage + https://community.bistudio.com/wiki/primaryWeaponMagazine - Object allowDamage Boolean + primaryWeaponMagazine Object - object allowDamage allow + primaryWeaponMagazine unit - $Code$player allowDamage false ;$/Code$ + $Code$hint primaryWeaponMagazine player ; //["30Rnd_65x39_caseless_mag"]$/Code$ + + $Code$_array = primaryWeaponMagazine player ; + if ( count _array 0) then { + hint ("Primary weapon is loaded with " + (_array select 0) + "!"); + } else { + if ( primaryWeapon player != "") then { + hint "Primary weapon is not loaded!"; + } else { + hint "Player doesn't have a primary weapon!"; + }; + };$/Code$ - local / global + undefined / undefined - (September 2, 2013) - $Code$_object allowDamage false$/Code$ - has the same effect as - $Code$_object addEventHandler ["HandleDamage", {0}]$/Code$ - (except for buildings that are native to the map; for those, the effects of HandleDamage will not sync properly across all clients, even if added to the building on every client and the server) + (June 8, 2014) + This function returns an array like ["type of magazine loaded in primary weapon", "type of grenade loaded in launcher if exist"] + For example ["30Rnd_556x45_Stanag", "1Rnd_HE_Grenade_shell"], with no consideration about amount of these ammo. + However, be careful if you intend to use it in expression like : (magazines _unit) - (primaryWeaponMagazine _unit), i.e. magazines "minus" this array, + The result will inventory all magazines (with grenades, chemlights...) except ALL magazines (and grenades eventually) belonging to the TYPE of the loaded one! i.e. you suppress ALL "30Rnd_556x45_Stanag" but the "30Rnd_556x45_Stanag_Tracer_Green" are still remaining. + If you kill the unit, the same expression will return a consistent inventory as primary weapon "disappears" and primaryWeaponMagazine is empty. "30Rnd_556x45_Stanag" are back! - Nothing + Array + - allowDammage + waypointDescription - Allow or prevent an object being damaged (or injured, or killed). Alias of allowDamage. - The command does not prevent object from taking scripted damage such as setDamage or setHit. - ! - Command has to be executed where object is local and as long as object does not change locality the effect of this command will be global. - If object changes locality, the command needs to be executed again on the new owner 's machine to maintain the effect. + Gets the waypoint description. - https://community.bistudio.com/wiki/allowDammage + https://community.bistudio.com/wiki/waypointDescription - Object allowDammage Boolean + waypointDescription Array - object allowDammage allow + waypointDescription waypoint - $Code$player allowDammage false ;$/Code$ + $Code$waypointDescription [groupOne,1]$/Code$ undefined / undefined - (October 24, 2014) - This command is still working in A3 1.32.127785, at least in single player. I didn't test multiplayer. - Nothing + String + - allowFileOperations + setParticleFire - Allow/dissallow file ops (load/save etc). - i - Some Old Editor Command + Set fire parameters to particle effect. + Note: You need to create emitter at first. Basic parameters of particle effect must be defined too. You can use script commands setParticleClass or setParticleParams to do so (see example). Correspondence between CfgCloudlets class param names and command array of params: + $Code$particleSource setParticleFire + [ + coreIntensity, + coreDistance, + damageTime + ];$/Code$ - https://community.bistudio.com/wiki/allowFileOperations + https://community.bistudio.com/wiki/setParticleFire - Control allowFileOperations Boolean + Object setParticleFire Array - map allowFileOperations bool + source setParticleFire [coreIntensity, coreDistance, damageTime] - + $Code$_emitter = "#particlesource" createVehicleLocal ( getPos player ); + _emitter setParticleClass "MediumSmoke"; + _emitter setParticleFire [0.3,1.0,0.1];$/Code$ + undefined / undefined - Nothing + Nothing + - allowFleeing + registerTask - Sets the cowardice level (the lack of courage or bravery) of a group or unit. - The more cowardice a Group or Object has, the sooner it will start fleeing. - 0 means maximum courage, while 1 means always fleeing. + Register a new task type. Parameters are defined in the given config class (subclass of CfgTasks). - https://community.bistudio.com/wiki/allowFleeing + https://community.bistudio.com/wiki/registerTask - Object/Group allowFleeing Number + Team_Member registerTask String - name allowFleeing cowardice + teamMember registerTask entryName - $Code$_group1 allowFleeing 0;$/Code$ - + - local / global + undefined / undefined - Nothing + Boolean + - allowGetIn + commandFire - Set if the units given in the list are allowed to enter vehicles. + Order the given unit to fire on the given target (via the radio). + If the target is objNull, the unit is ordered to fire on its current target (set with doTarget or commandTarget ). - https://community.bistudio.com/wiki/allowGetIn + https://community.bistudio.com/wiki/commandFire - Array allowGetIn Boolean + Object/Array commandFire Object - unitArray allowGetIn allow + unitName commandFire target - $Code$[_soldier1, _soldier2] allowGetIn true ;$/Code$ + $Code$_ESoldier1 commandFire _WSoldier1$/Code$ - global / global + local / local - (8 May, 2014) - (ArmA3 ver 1.18), here's a quick reference to unit's embarkation and disembarkation. - Command - Remote Control - Behavior - Role Unassigning - orderGetIn - false - orderGetIn won't take effect on player controlled AI units, and which needs to be used together with assaignAs command family. Generally speaking, orderGetIn is a Role Excuator. - When orderGetIn was disabled it won't automatically unassign unit's vehicle role but will force the unit get out of the vehicle and stop him re-entering until it was enabled again. orderGetIn false won't stop a unit when he is embarking a vehicle in the half way but unassignVehicle will do. orderGetIn false will wait to fire until the unit enter a vehicle. - allowGetIn - false - allowGetIn won't take effect on player controlled AI units. Different from orderGetIn, this command is a Role Holder, it can control the unit's movement in the half way set by orderGetIn but not by setWaypointType, unit will be forced to get out from a vehicle by allowGetIn false and won't automatically re-enter the vehicle until allowGetIn true - allowGetIn won't do anything with unit's vehicle role - doGetOut - true - Works on player controlled ai silently, unit will automatically get back to the vehicle after disembarkation. (Unit won't get out until vehicle is stopped or landed) - false - commandGetOut - true - Same as doGetOut with radio message. (Unit won't get out until vehicle is stopped or landed) - false - leaveVehicle - false - leaveVehicle can't force a player controlled AI disembark - true - action ["GetOut",_veh] - true - Eject immediately without parachute - false - action ["Eject",_veh] - true - Eject immediately with parachute if needed - false - setWaypointType "GETIN" - false - Waypoint won't be affected by orderGetIn false or allowGetIn false until the unit is on the vehicle. - N/A - Nothing + Nothing + - allowSprint + createMarkerLocal - Force player to run/jog if set to false. + Creates a local marker at the given position. Marker exists only on PC that created it. The marker name has to be unique. + NOTE: Local markers have own set of local commands "XXXXLocal" to work with. If you use global marker command on a local marker, the local marker will become global marker. - https://community.bistudio.com/wiki/allowSprint + https://community.bistudio.com/wiki/createMarkerLocal - Object allowSprint Boolean + createMarkerLocal Array - unit allowSprint state + createMarkerLocal [name, position] - $Code$player allowSprint false$/Code$ + $Code$_marker = createMarkerLocal ["Marker1", position player ];$/Code$ - undefined / undefined + undefined / local + To create a marker which is visible on the map you need to define at least the following three settings: + $Code$_markerstr = createMarkerLocal ["markername",[_Xpos,_Ypos]]; + _markerstr setMarkerShapeLocal "ICON"; + _markerstr setMarkerTypeLocal "DOT";$/Code$ - Nothing + String + - ammoOnPylon + with - Returns ammo count on given pylon. - Returns false ( Bool ) on failure. + Creates a With Type that is used inside a do construct in order to execute code inside a given namespace. + when used in a do-construct in scripts with allowed suspension, an unexpected namespace switch could happen (see note below) + NOTE for the reasons unknown, namespace switching might unexpectedly occur inside some scopes ( for, if, try, call ) started in scheduled scripts ( canSuspend true) after small suspension if with was not the main scope. For example: + $Code$[] spawn + { + with uiNamespace do + { + for "_i" from 1 to 1 do + { + systemChat str [ + currentNamespace isEqualTo uiNamespace, + currentNamespace isEqualTo missionNamespace + ]; + // result [true, false] + sleep 0.05; // -- small suspension + systemChat str [ + currentNamespace isEqualTo uiNamespace, + currentNamespace isEqualTo missionNamespace + ]; + // result [false, true] -- switching + }; + }; + };$/Code$ + However if with used in parent scope, everything works correctly: + $Code$ with uiNamespace do + { + [] spawn + { + for "_i" from 1 to 1 do + { + systemChat str [ + currentNamespace isEqualTo uiNamespace, + currentNamespace isEqualTo missionNamespace + ]; + // result [true, false] + sleep 0.05; // -- small suspension + systemChat str [ + currentNamespace isEqualTo uiNamespace, + currentNamespace isEqualTo missionNamespace + ]; + // result [true, false] -- NO switching + }; + }; + };$/Code$ + To eliminate possibility of error you can also use setVariable or getVariable with desired Namespace, which is also scheduled environment safe. - https://community.bistudio.com/wiki/ammoOnPylon + https://community.bistudio.com/wiki/with - Object ammoOnPylon String/Number + with Namespace - vehicle ammoOnPylon pylon + with namespace - $Code$_ammoCount = ( vehicle player ) ammoOnPylon "pylon1";$/Code$ + $Code$_myWithType = with uiNamespace ;$/Code$ - $Code$hint str (( vehicle player ) ammoOnPylon "pylonCenter");$/Code$ + $Code$with missionNamespace do {global = global + 1};$/Code$ undefined / undefined - (August 18, 2017) - The pylon indices start at 1 and not at 0. - Number/Boolean + With_Type + - ammo + vectorDistance - Check how many rounds are left in the currently loaded magazine in the given muzzle. Since Arma v1.55.133505 the command also returns ammo for units in vehicles. + Distance between two 3D vectors. - https://community.bistudio.com/wiki/ammo + https://community.bistudio.com/wiki/vectorDistance - Object ammo String + Array vectorDistance Array - unit ammo muzzle + vector1 vectorDistance vector2 - $Code$_count = player ammo "M16"; //returns 30 in case of a full magazine$/Code$ - - $Code$_count = player ammo "M203Muzzle";$/Code$ + $Code$_euclideanDist = getPosASL player vectorDistance [0,0,0];$/Code$ - $Code$_count = player ammo primaryWeapon player ;$/Code$ + $Code$( getPosASL _a) vectorDistance ( getPosASL _b); /* same as */( getPosATL _a) distance ( getPosATL _b);$/Code$ - global / undefined + undefined / undefined - (February 17, 2012) - OA 1.60 : The command works (now?) also for units in vehicles. However only for the vehicle's gunners' weapons - aka those returned by "weapons vehicle". + (28 Jun, 2014) + (ArmA3 1.22)Algorithm: + $Code$ + Vector1 = [x1,y1,z1]; Vector2 = [x2,y2,z2]; + Result = sqrt ((x2 - x1) ^ 2 + (y2 - y1) ^ 2 + (z2 - z1) ^ 2); + $/Code$ - Number + Number + - and + getSlingLoad - Returns true only if both conditions are true. In case of the alternative syntax, lazy evaluation is used (if left operand is false, evaluation of the right side is skipped completely). + Return object which is sling loaded by vehicle - https://community.bistudio.com/wiki/and + https://community.bistudio.com/wiki/getSlingLoad - Boolean and Boolean - - Boolean and Code + getSlingLoad Object - a and b - - a and b + getSlingLoad vehicle - $Code$if (( alive player ) and (_enemycount == 0)) then { hint "you win !"}$/Code$ - - $Code$if (( count _array 0) and {(_array select 0) == player }) then { hint "It works! Without lazy evaluation it would throw an error if array was empty."}$/Code$ + $Code$_cargo = getSlingLoad heli1;$/Code$ undefined / undefined - (April 12, 2015) - Just like the "or" command, the "and" command allows several conditions to be checked. Example: - $Code$if(alive player and speed player 0 and _someOtherVar) then { hint"All three condtions are true" };$/Code$ - The example above will check if the player is alive and if the player is moving and checks if _someOtherVar is true. + (05 April, 2014) + Returns objNull when nothing is sling loaded. - Boolean - Boolean + Object + - animateBay + addMagazines - Force animation of bay to given state, -1 for reset to engine handling, can cause weapon inoperative, because weapon is released when bay state =1. + Adds multiple magazines to the unit. For cargo containers use addMagazineCargoGlobal command. - https://community.bistudio.com/wiki/animateBay + https://community.bistudio.com/wiki/addMagazines - Object animateBay Array + Object addMagazines Array - vehicle animateBay [pylon nameindex, anim phase] + unit addMagazines [magazineName, count] - $Code$( vehicle player ) animateBay ["pylonLeft1", 0.5];$/Code$ + $Code$player addMagazines ["30Rnd_65x39_caseless_mag", 3];$/Code$ - undefined / undefined + global / global - Nothing + Nothing + - animateDoor + markerShape - Animates a door on a vehicle. Animation is defined in config file in CfgVehicles - AnimationSources. Wanted animation phase is set with phase param. This command works only on animation sources with "door" controller. Door_L in the example below can be animated with animateDoor but not CargoRamp_Open: heli animateDoor ["Door_L", 1]; - class AnimationSources - { - class CargoRamp_Open - { - source = "user" ; - animPeriod = 5 ; - initPhase = 0 ; - } ; - class Door_L - { - source = "door" ; - animPeriod = 1.6 ; - } ; - } ; - To animate doors or other sources that have "user" controller, use animate command, or even better, animateSource (recommended). Sources with "hit" controller can be animated with setHitPointDamage command applied to the name contained in hitpoint property. For availability of animation sources and their controller types see: createVehicle/vehicles + Gets the marker shape. See setMarkerShape for a list of strings that can be returned. - https://community.bistudio.com/wiki/animateDoor + https://community.bistudio.com/wiki/markerShape - Object animateDoor Array + markerShape String - object animateDoor [doorname, phase, instant] + markerShape name - $Code$Taru animateDoor ["Door_1_source", 1];$/Code$ - - $Code$// Open left front door on Ifrit instantly: - Ifrit animateDoor ["Door_LF", 1, true ];$/Code$ + $Code$if ( markerShape "Marker1" == "RECTANGLE") then { hint "Marker1 is a rectangle!"}$/Code$ - global / global + global / undefined + (May 30, 2016) + Free hand drawn markers return "POLYLINE" - Nothing + String + - animatePylon + surfaceType - Force animation of pylon to given state, -1 for reset to engine handling, can cause weapon inoperative, because weapon is released when pylon state =1. + Returns what surface type is at the given position. + See the spoiler for surface types: + Show text + A3 1.28: + "#GdtStratisConcrete" + "#GdtStratisDryGrass" + "#GdtStratisGreenGrass" + "#GdtStratisRocky" + "#GdtStratisForestPine" + "#GdtStratisBeach" + "#GdtStratisDirt" + "#GdtVRsurface01" + "#GdtDirt" + "#GdtGrassGreen" + "#GdtGrassDry" + "#GdtSoil" + "#GdtThorn" + "#GdtStony" + "#GdtConcrete" + "#GdtMarsh" + "#GdtBeach" + "#GdtSeabed" + "#GdtDead" + A3 1.66: + "#Default" + "#Water" + "#SurfRoadDirt" + "#SurfRoadConcrete" + "#SurfRoadTarmac" + "#SurfWood" + "#SurfMetal" + "#SurfRoofTin" + "#SurfRoofTiles" + "#SurfIntWood" + "#SurfIntConcrete" + "#SurfIntTiles" + "#SurfIntMetal" + "#SurfWater" + "#TEST_SurfNormal" + "#GdtStratisConcrete" + "#GdtStratisBeach" + "#GdtStratisDirt" + "#GdtStratisSeabedCluttered" + "#GdtStratisSeabed" + "#GdtStratisDryGrass" + "#GdtStratisGreenGrass" + "#GdtStratisRocky" + "#GdtStratisThistles" + "#GdtStratisForestPine" + "#GdtRubble" + "#GdtForestPine" + "#GdtConcrete" + "#GdtSoil" + "#GdtBeach" + "#GdtRock" + "#GdtDead" + "#GdtDirt" + "#GdtDesert" + "#GdtGrassGreen" + "#GdtGrassDry" + "#GdtGrassWild" + "#GdtWeed" + "#GdtWildField" + "#GdtThorn" + "#GdtStony" + "#GdtStonyThistle" + "#GdtMud" + "#GdtMarsh" + "#GdtSeabed" + "#concrete" + "#concrete_out" + "#concrete_inside" + "#dirtrunway" + "#road" + "#floor" + "#floor_inside" + "#carpet_inside" + "#carpet" + "#mud" + "#concrete_hall" + "#stones" + "#cardboard" + "#lino" + "#steel" + "#trash" + "#parquet" + "#sand" + "#metalPlate" + "#woodenFloor" + "#planks" + "#planks_inside" + "#grid" + "#rubble" + "#BuildingRubble" + "#tiling" + "#wavyMetal" + "#GdtVRsurface01" + "#surf_metal" + "#surf_roadconcrete" + "#surf_roaddirt" + "#surf_roadtarmac" + "#surf_rooftiles" + "#surf_rooftin" + "#surf_wood" + "#surfint_concrete" + "#surfint_metal" + "#surfint_tiles" + "#surfint_wood" + "#road_exp" + "#sand_exp" + "#SurfRoadDirt_exp" + "#SurfRoadConcrete_exp" + "#SurfRoadTarmac_exp" + "#SurfTrailDirt_exp" + "#concrete_exp" + "#concrete_in_exp" + "#concrete_hall_exp" + "#floor_exp" + "#floor_in_exp" + "#stones_exp" + "#planks_in_exp" + "#planks_exp" + "#softwood_in_exp" + "#steel_exp" + "#metalPlate_exp" + "#metalPlatePressed_exp" + "#metalPlate_in_exp" + "#grid_exp" + "#wavyMetal_exp" + "#carpet_exp" + "#carpet_in_exp" + "#mat_in_exp" + "#mud_exp" + "#straw_exp" + "#cardboard_exp" + "#lino_in_exp" + "#lino_exp" + "#roof_tiles_exp" + "#trash_exp" + "#rubble_exp" + "#BuildingRubble_exp" + "#GdtGrassShort" + "#GdtGrassTall" + "#GdtGrassLong" + "#GdtVolcanoBeach" + "#GdtRedDirt" + "#GdtAsphalt" + "#GdtField" + "#GdtForest" + "#GdtVolcano" + "#GdtCliff" - https://community.bistudio.com/wiki/animatePylon + https://community.bistudio.com/wiki/surfaceType - Object animatePylon Array + surfaceType Array - vehicle animatePylon [pylon nameindex, anim phase] + surfaceType position - $Code$( vehicle player ) animatePylon [1, 0.5];$/Code$ + $Code$_surface = surfaceType [4500, 4500];$/Code$ + + $Code$_surface = surfaceType position player ;$/Code$ undefined / undefined + (February 05, 2010) + In ArmA 2 returned value is "#UTGRASS" for natural surface and "#UTCONCRETE" for urban surface. + + (December 16, 2006) + Only seems to return either "#GRASSSOUTH" or "#GRASSGENERAL", even when you're in a building or in water. + + (December 30, 2006) + Another returned value is "#SANDGENERAL". However, when providing an exact [x,y] position the "surfaceType" function seems to return the general surface type of the environment rather than the exact type on that given position. - Nothing + String + - animateSource + opfor - Process an animation of the object. If animate uses class name from CfgModels Animations, animateSource uses name defined by source property. This allows to use just one command on a bunch of animations related to the same source simultaneously. Since Arma 3 v1.65.138459 speed of animation can be altered with coefficient. - A class with the same source name should also be present in main config in CfgVehicles AnimationSources and have to be bound to the "user" controller for the command to work. If in order to animate door in example below using animate command it would require 2 calls: - house animate ["Door_1_rot", 1]; - house animate ["Door_Handle_1_rot", 1]; - With animateSource this would require only 1 (provided everything is configured correctly): - house animateSource ["Door_1_sound_source", 1]; - // model.cfg - .... - class Animations - { - class Door_1_rot - { - type = rotation ; - source = Door_1_sound_source ; - selection = Door_1 ; - axis = Door_1_axis ; - memory = 1 ; - minValue = 0.1 ; - maxValue = 1 ; - angle0 = 0 ; - angle1 = ( rad 110 ) ; - } ; - class Door_Handle_1_rot - { - type = rotation ; - source = Door_1_noSound_source ; - selection = Door_Handle_1 ; - axis = Door_Handle_1_axis ; - memory = 1 ; - minValue = 0 ; - maxValue = 0.1 ; - angle0 = 0 ; - angle1 = ( rad - 50 ) ; - } ; - } ; - ... - // config.cpp - ... - class AnimationSources - { - class Door_1_sound_source - { - source = "user" ; - initPhase = 0 ; - animPeriod = 1 ; - sound = "GenericDoorsSound" ; - soundPosition = "Door_1_trigger" ; - } ; - } ; - ... - If you don't know much about model config you can use this page createVehicle/vehicles for reference. Some of the AnimationSources are listed with the class names of the available assets in Arma 3. If it says "user", the chances are it could work with animateSource (see example 2). - It is recommended that animateSource command is used instead of animate whenever is possible, as it is more efficient and optimized for MP - Mixing animateSource command with animate command to animate the same part can lead to unexpected behavior + Pre-defined variable for the opfor side. + Alias for east. - https://community.bistudio.com/wiki/animateSource + https://community.bistudio.com/wiki/opfor - Object animateSource Array + opfor - object animateSource [source, phase, speed] + opfor - $Code$house animateSource ["Door_1_source", 1, true ];$/Code$ - - $Code$// Create UGV and manipulate its turret (Currently not possible to do with animate command. See createVehicle/vehicles for reference) - ugv = "B_UGV_01_F" createVehicle ( player getRelPos [5, 0]); - ugv addAction ["Show Turret", - { - ugv animateSource ["Turret", 0]; - ugv animateSource ["MainTurret", rad 0, true ]; - ugv animateSource ["MainGun", rad 0, true ]; - }]; - ugv addAction ["Hide Turret", {ugv animateSource ["Turret", 1]}]; - ugv addAction ["Turret Left", {ugv animateSource ["MainTurret", rad 90]}]; - ugv addAction ["Turret Right", {ugv animateSource ["MainTurret", - rad 90]}]; - ugv addAction ["Turret Up", {ugv animateSource ["MainGun", rad 30]}]; - ugv addAction ["Turret Down", {ugv animateSource ["MainGun", - rad 20]}];$/Code$ - - $Code$barGate animateSource ["Door_1_source",0]; //Close - barGate animateSource ["Door_1_source",1]; //Open$/Code$ + $Code$if ( side player == opfor ) then { + hint "OPFOR"; + };$/Code$ - global / global + undefined / undefined - Nothing + Side + - animate + taskCompleted - Activates given object animation. Animation is defined in CfgModels Animations class of model.cfg or another model config. Since Arma 3 v1.65.138459 speed of animation can be altered with coefficient. - To animate door of the house from example below: house animate ["Door_1_rot", 1]; - class Animations - { - class Door_1_rot - { - type = rotation ; - source = Door_1_source ; - selection = Door_1 ; - axis = Door_1_axis ; - memory = 1 ; - minValue = 0.1 ; - maxValue = 1 ; - angle0 = 0 ; - angle1 = ( rad 110 ) ; - } ; - class Door_Handle_1_rot_1 - { - type = rotation ; - source = Door_1_handle_source ; - selection = Door_Handle_1 ; - axis = Door_Handle_1_axis ; - memory = 1 ; - minValue = 0 ; - maxValue = 0.1 ; - angle0 = 0 ; - angle1 = ( rad - 50 ) ; - } ; - } ; - Since model.cfg is not always available for reference, most animation names could also be obtained from animationNames command. Class names listed in CfgVehicles AnimationSources bound to "Proxy" controller can also be animated with animate command (see createVehicle/vehicles ): offroad animate ["HideBackpacks", 0]; - It is recommended that animateSource command is used instead of animate whenever is possible, as it is more efficient and optimised for MP - Mixing animateSource command with animate command to animate the same part may produce some undefined behaviour + Return if task is completed. (state Succeeded, Failed or Canceled) - https://community.bistudio.com/wiki/animate + https://community.bistudio.com/wiki/taskCompleted - Object animate Array + taskCompleted Task - objectName animate [animationName, phase, speed] + taskCompleted task - $Code$_building animate ["maindoor", 1];$/Code$ - - $Code$_building animate ["Door_1_rot", 1, true ];$/Code$ - - $Code$// Create Offroad and add flashing police light bar: - offroad = "C_Offroad_01_F" createVehicle ( player getRelPos [5, 0]); - offroad animate ["HidePolice", 0]; - offroad animate ["BeaconsStart", 1];$/Code$ - + - global / global + undefined / undefined - (Aug 2007) - Animations can be used on existing game models such as houses that have doors eg. The general syntax is house animate ["dvere1",1] to 'open' the door and house animate ["dvere1",0] to 'close it'. Whether used on Oem addons, or official ones, an internal working knowledge (via config.cpp) of the model's animated name(s) is required. - 'open' and 'close' are visual perceptions of the state of the model, and are a design decision of the p3d. Open does not, necessarily mean, 1, and close does not mean 0. - '0' and '1' are better seen as FULLY_OFF and FULLY_ON - If a door is initially closed in the model, FULLY_ON, will open it. If it is initialy OPEN visually, in the model, FULLY_ON will close it. - initphase=1; (in config cpp) does not alter open and close meanings, all it does, is, set the model to the 'on' (rather than 'off') state to begin with. Whether on means open or close visually, is a p3d design decision. - - (June 2011) - Also, to animate the object called "Bar Gate" in ArmA, use the following: $Code$myGate animate ["Bargate",1]$/Code$ to close it, and $Code$myGate animate ["Bargate", 0]$/Code$ to open it. - - (June 21, 2015) - With this command you can switch the offroad police lights on like this : - $Code$_vehicle animate ["BeaconsStart",1];$/Code$ - And switch it off : - $Code$_vehicle animate ["BeaconsStart",0];$/Code$ - - (February 16, 2016) - Aparently "Bargate" was exchainged with "Door_1_rot" - Doesen't work: - $Code$object animate ["Bargate", 0];$/Code$ - Works: - $Code$object animate ["Door_1_rot", 0];$/Code$ - - (March 14, 2016) - To animate bargate use animateSource : - $Code$bargate animateSource ["Door_1_source", 1];$/Code$ - Nothing + Boolean + - animationNames + currentCommand - Returns Array of Strings where elements are the names of model animations, which should theoretically be available for use with animate command. However in practice this depends on whether animation is also made available for use in scripts via config. + Return the current command type (empty string when no command) for the commander of given vehicle (or for a given soldier). Value returned can be one of: + "WAIT", "ATTACK", "HIDE", "MOVE", "HEAL", "REPAIR", "REFUEL", "REARM", "SUPPORT", "JOIN", "GET IN", "FIRE", "GET OUT", "STOP", "EXPECT", "ACTION", "ATTACKFIRE", - https://community.bistudio.com/wiki/animationNames + https://community.bistudio.com/wiki/currentCommand - animationNames Object + currentCommand Object - animationNames object + currentCommand vehicleName - $Code$_names = animationNames static_AT; - // Returns: ["MainTurret", "MainGun", "MainTurret_destructX", "MainTurret_destructY", "MainTurret_destructZ", "MainGun_destructX", "MainGun_destructY", "MainGun_destructZ", "magazine_destruct", "ammo_belt_destruct", "bolt_destruct", "charging_handle_destruct", "damagehideVez_destruct", "damagehideHlaven_destruct", "damagehideRecoil_destruct", "Turret_shake", "Turret_shake_aside", "Magazine_hide", "Ammo_belt_hide", "muzzleFlash", "AddAutonomous_unhide", "bullet001_reload_hide", "bullet002_reload_hide", "bullet003_reload_hide", "bullet004_reload_hide", "bullet005_reload_hide", "bullet006_reload_hide", "bullet007_reload_hide", "bullet008_reload_hide"]$/Code$ - + undefined / undefined - Array + String + - animationPhase + flagAnimationPhase - Returns the phase of the given animation on the given object. Animation can be scripted ( animate, animateSource, animateDoor ) or engine driven. Animation names for an object could be found out with animationNames command. When animation is rotation, like with "MainTurret" for example, the output is in radians, to convert to degrees use deg command. + Returns flag position on the flag pole in range of 0..1, where 0 is bottom of the flag pole, 1 is the top of the flag pole. The result is local to the PC on which command is executed - https://community.bistudio.com/wiki/animationPhase + https://community.bistudio.com/wiki/flagAnimationPhase - Object animationPhase String + flagAnimationPhase Object - object animationPhase animationName + flagAnimationPhase flag - $Code$_building animate ["maindoor",1]; - sleep 1; - _p = _building animationPhase "maindoor"; - // returns 1 (if the animation speed is = 2 seconds)$/Code$ - - $Code$_flagPole animationPhase "flag";$/Code$ - - $Code$_tank animationPhase "MainTurret";$/Code$ + $Code$flagAnimationPhase _flag1; //0.5$/Code$ global / undefined @@ -5007,240 +5222,238 @@ - Number + Number + - animationSourcePhase + setMarkerPos - Returns current animation phase of given source. Similar to animationPhase or doorPhase but designed to complement animateSource. + Moves the marker. Pos format is Position2D. - https://community.bistudio.com/wiki/animationSourcePhase + https://community.bistudio.com/wiki/setMarkerPos - Object animationSourcePhase String + String setMarkerPos Array - object animationSourcePhase source + markerName setMarkerPos pos - $Code$_phase = house animationSourcePhase "Door_1_source";$/Code$ + $Code$"MarkerOne" setMarkerPos getMarkerPos "MarkerTwo"$/Code$ - undefined / undefined + undefined / global + Effect is local in OFP. + + (March 31, 2008) + This command will not move a marker on dedicated server (if a client calls it). AI will continue to respawn at old spot if you are moving something like respawn_west. + + (August 7, 2009) + The marker position can actually be set in 3D. This has a benefit for respawn markers, when placed at the correct altitude ASL on the LHD, the correct altitude will be used for respawn. There is no particular benefit for regular markers since markerPos will still return 0 for the altitude array element. - Number + Nothing + - animationState + addItemPool - Returns the name of a unit's current primary animation. Seems to be forced to lower case in Arma 3. + Adds count items of type name into the weapon pool (used in the campaign to transfer items to the next mission) - https://community.bistudio.com/wiki/animationState + https://community.bistudio.com/wiki/addItemPool - animationState Object + addItemPool Array - animationState unitName + addItemPool [itemName, count] - $Code$_state = animationState player ;$/Code$ + $Code$addItemPool ["ItemGPS", 5];$/Code$ - global / undefined + undefined / undefined - (August 22, 2014) - (A3 1.26) To sort animation state by keyword, use BIS_fnc_ambientAnimGetParams - $Code$ ("KNEEL" call BIS_fnc_ambientAnimGetParams ) select 0; - //return: ["amovpknlmstpslowwrfldnon"…]$/Code$ - Useful keywords are: "STAND", "WATCH", "GUARD", "LISTEN_BRIEFING", "LEAN_ON_TABLE", "LEAN", "SIT_AT_TABLE", "KNEEL", "PRONE_INJURED", "BRIEFING" ect. - String + Nothing + - append + cbSetChecked - Appends array2 to the back of array1 modifying array1. - NOTE: append does not return array, it modifies existing array. If you need to return a copy, use "+": - $Code$array3 = array1 + array2;$/Code$ + Sets the current state of a checkbox (CT_CHECKBOX type 77 of Dialog Control ). - https://community.bistudio.com/wiki/append + https://community.bistudio.com/wiki/cbSetChecked - Array append Array + Control cbSetChecked Boolean - array1 append array2 + control cbSetChecked state - $Code$_arr = [1,2,3]; - _arr append [4,5,6]; - hint str _arr; //[1,2,3,4,5,6]$/Code$ + $Code$_myCheckBox cbSetChecked true ;$/Code$ + + $Code$_disp = findDisplay 46 createDisplay "RscDisplayEmpty"; + _chk = _disp ctrlCreate ["RscCheckBox", -1]; + _chk cbSetChecked true ;$/Code$ undefined / undefined - (March 9, 2015) - $Code$_array1 append _array2$/Code$ is roughly 1.2x faster (depending on array size) than $Code$_array1 = _array1 + _array2$/Code$ (Averaged over 10.000 iterations with two identical arrays containing the numbers 0 through 9) - The larger the arrays to append, the faster append is as it does not create a new array, which happens with array addition. - - (May 21, 2015) - Array "unshift" implementation using append, a faster alternative to BIS_fnc_arrayUnShift : - $Code$KK_fnc_unshift = { - private ["_arr", "_tmp"]; - _arr = _this select 0; - _tmp = [_this select 1]; - _tmp append _arr; - _arr resize 0; - _arr append _tmp; - _arr - }; - // Example - arr = [1,2,3]; - [arr, 0] call KK_fnc_unshift; //both arr and return of function are [0,1,2,3] - $/Code$ - - (May 21, 2015) - Array "insert" implementation using append, much faster alternative to BIS_fnc_arrayInsert : - $Code$KK_fnc_insert = { - private ["_arr", "_i", "_res"]; - _arr = _this select 0; - _i = _this select 2; - _res = []; - _res append (_arr select [0, _i]); - _res append (_this select 1); - _res append (_arr select [_i, count _arr - _i]); - _res - }; - // Example - arr = [1,2,3,4]; - [arr, ["a","b"], 2] call KK_fnc_insert; //[1,2,"a","b",3,4]$/Code$ - - (May 21, 2015) - A faster alternative to BIS_fnc_arrayPushStack using append : - $Code$KK_fnc_pushStack = { - _this select 0 append (_this select 1); - _this select 0 - }; - // Example - arr = [1,2,3]; - [arr,[4,5,6]] call KK_fnc_pushStack; //both arr and function return are [1,2,3,4,5,6]$/Code$ - Nothing + Nothing + - apply + setWaypointTimeout - Applies given code to each element of the array and returns resulting array. The value of the current array element, to which the code will be applied, is stored in variable _x. + Defines the time between condition satisfaction and waypoint finish (randomly from min to max, with an average value mid). - https://community.bistudio.com/wiki/apply + https://community.bistudio.com/wiki/setWaypointTimeout - Array apply Code + Array setWaypointTimeout Array - array apply code + waypoint setWaypointTimeout [min, mid, max] - $Code$_arr = [1,2,3,4,5,6,7,8,9,0] apply {[1,0] select (_x % 2 == 0)}; //[1,0,1,0,1,0,1,0,1,0]$/Code$ - - $Code$_arr = [1,2,3,4,5,6,7,8,9,0] apply {_x ^ _x}; //[1,4,27,256,3125,46656,823543,16777216,387420480,1]$/Code$ - - $Code$_arr1 = []; - _arr1 resize 20; - _arr2 = _arr1 apply {0}; //[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]$/Code$ + $Code$[_grp, 2] setWaypointTimeout [5, 10, 6];$/Code$ undefined / undefined - (February 18, 2016) - (to anyone else wondering, I took a minute to get it): This is Array.map() is JavaScript + (00:32, 12 December 2010) + The example doesn't seem to make sense, according to the listed syntax. It seems to set a Max time greater than the Mid time. + + (03:30, 12 December 2010) + If mid is greater than max, the result will be really near the mid value. + Results with the values of the example: 8.237, 9.383, 10.425, 9.417, 9.43401, 10.425, 9.90601, 9.96701, 9.42401, 9.42502, 9.96698, 9.89999... - Array + Nothing + - armoryPoints + allowGetIn - Returns, stored in [USERNAME].ArmaXProfile, value of armoryPoints entry. If the entry doesn't exist, it returns 0. + Set if the units given in the list are allowed to enter vehicles. - https://community.bistudio.com/wiki/armoryPoints + https://community.bistudio.com/wiki/allowGetIn - armoryPoints + Array allowGetIn Boolean - armoryPoints + unitArray allowGetIn allow - $Code$_points = armoryPoints ;$/Code$ + $Code$[_soldier1, _soldier2] allowGetIn true ;$/Code$ - undefined / undefined + global / global + (8 May, 2014) + (ArmA3 ver 1.18), here's a quick reference to unit's embarkation and disembarkation. + Command + Remote Control + Behavior + Role Unassigning + orderGetIn + false + orderGetIn won't take effect on player controlled AI units, and which needs to be used together with assaignAs command family. Generally speaking, orderGetIn is a Role Excuator. + When orderGetIn was disabled it won't automatically unassign unit's vehicle role but will force the unit get out of the vehicle and stop him re-entering until it was enabled again. orderGetIn false won't stop a unit when he is embarking a vehicle in the half way but unassignVehicle will do. orderGetIn false will wait to fire until the unit enter a vehicle. + allowGetIn + false + allowGetIn won't take effect on player controlled AI units. Different from orderGetIn, this command is a Role Holder, it can control the unit's movement in the half way set by orderGetIn but not by setWaypointType, unit will be forced to get out from a vehicle by allowGetIn false and won't automatically re-enter the vehicle until allowGetIn true + allowGetIn won't do anything with unit's vehicle role + doGetOut + true + Works on player controlled ai silently, unit will automatically get back to the vehicle after disembarkation. (Unit won't get out until vehicle is stopped or landed) + false + commandGetOut + true + Same as doGetOut with radio message. (Unit won't get out until vehicle is stopped or landed) + false + leaveVehicle + false + leaveVehicle can't force a player controlled AI disembark + true + action ["GetOut",_veh] + true + Eject immediately without parachute + false + action ["Eject",_veh] + true + Eject immediately with parachute if needed + false + setWaypointType "GETIN" + false + Waypoint won't be affected by orderGetIn false or allowGetIn false until the unit is on the vehicle. + N/A - Number + Nothing + - arrayIntersect + getUnitLoadout - Intersects array1 with array2 returning array of unique common elements. Additionally, using the same array for array1 and array2 will simply return array of unique elements. Intersects only 1st dimension of an array. + Returns an array with all assigned items, weapons, containers and their stored items. + Detailed explanation of the returned array: Talk:getUnitLoadout + This command is not final and might be changed in a near future. - https://community.bistudio.com/wiki/arrayIntersect + https://community.bistudio.com/wiki/getUnitLoadout - Array arrayIntersect Array + getUnitLoadout Object + + getUnitLoadout String/Config - array1 arrayIntersect array2 + getUnitLoadout unit + + getUnitLoadout class - $Code$_arr1 = [1,2,3,4,5,2,3,4]; - _arr2 = [4,5,6,1,2,3,5,6]; - hint str (_arr1 arrayIntersect _arr2); // [4,5,1,2,3]$/Code$ - - $Code$_arr = [1,2,3,1,2,3,1,2,3,4,5]; - hint str (_arr arrayIntersect _arr); // [1,2,3,4,5]$/Code$ + $Code$getUnitLoadout player ;$/Code$ - $Code$// Remove nils : - hint str ([1,2, nil,3] arrayIntersect [1,2, nil,3]); // [1,2,3]$/Code$ + $Code$getUnitLoadout "B_Soldier_F";$/Code$ - $Code$// Also works with array elements which are equal : - hint str ([[1],[2],[3]] arrayIntersect [[2],[3],[4]]); // [[2],[3]]$/Code$ + $Code$getUnitLoadout ( configFile "CfgVehicles" "B_Soldier_F");$/Code$ undefined / undefined @@ -5248,28 +5461,28 @@ - Array + Array - Array + - asin + visibleGPS - Arcsine of a number, result in Degrees. + Checks if the player has GPS receiver opened and visible - https://community.bistudio.com/wiki/asin + https://community.bistudio.com/wiki/visibleGPS - asin Number + visibleGPS - asin x + visibleGPS - $Code$_degrees=asin 0.5 - returns 30$/Code$ + $Code$if ( visibleGPS ) then { hint "GPS is visible"};$/Code$ undefined / undefined @@ -5277,73 +5490,79 @@ - Number + Boolean + - assert + loadVest - Tests a condition and if the condition is false, displays error on screen (if -showscripterrors enabled) and logs error into.rpt file. It does not interrupt the script execution. - If script was pre-processed with preprocessFileLineNumbers, it will also show/log the error line number and the file name. + Returns current sum of mass from items stored in a vest. - https://community.bistudio.com/wiki/assert + https://community.bistudio.com/wiki/loadVest - assert Boolean + loadVest Object - assert condition + loadVest unit - $Code$assert (1 2);$/Code$ - - $Code$// Check function params (Faster alternative to BIS_fnc_param ) - some_func = { - _0 = _this select 0; - _1 = _this select 1; - _2 = _this select 2; - if (! assert ( - typeName _0 == "ARRAY" && - typeName _1 == "STRING" && - typeName _2 == "SCALAR" - )) exitWith {/*optional error logging*/}; - hint "Alright!"; - }; - [1,2,3] call some_func; //assert error - [[1],"2",3] call some_func; //Alright!$/Code$ - + undefined / undefined - (May 15, 2010) - Returns false, if condition is false, and returns true, if condition is true. - Boolean + Number + - assignAsCargoIndex + serverCommand - Assigns the character to a specific cargo / passenger index of the given vehicle. + Executes a server command. Which command is available for execution can be found with serverCommandAvailable and whether or not it can be executed with serverCommandExecutable. + If serverCommand is executed on a client, it must be executed from UI event handler ( ctrlAddEventHandler, displayAddEventHandler ), such as onButtonDown or other User_Interface_Event_Handlers. + As of Arma 3 v1.39 serverCommand can be used on dedicated server and headless clients. This requires a password, both set in server.cfg and passed to the command itself (See Alt Syntax). This new version also doesn't need to be executed from within a UI Eventhandler. - https://community.bistudio.com/wiki/assignAsCargoIndex + https://community.bistudio.com/wiki/serverCommand - Object assignAsCargoIndex Array + serverCommand String + + String serverCommand String - character assignAsCargoIndex [vehicle, index] + serverCommand command + + password serverCommand command - $Code$player assignAsCargoIndex [myHelicopter, 1];$/Code$ + $Code$serverCommand "#logout";$/Code$ + + $Code$// Create button on the main map which will show userlist to anyone who clicks on it: + with uiNamespace do + { + ctrl = findDisplay 12 ctrlCreate ["RscButton", -1]; + ctrl ctrlSetPosition [0,0,0.5,0.1]; + ctrl ctrlSetText "USERLIST"; + ctrl ctrlCommit 0; + ctrl ctrlAddEventHandler ["ButtonDown", + { + serverCommand "#userlist"; + }]; + };$/Code$ + + $Code$serverCommand format ["#kick %1",_name];$/Code$ + + $Code$_isOK = "MyServerCommandPassword" serverCommand "#lock";$/Code$ undefined / undefined @@ -5351,140 +5570,146 @@ - Boolean + Boolean - Boolean + - assignAsCargo + lbDelete - Assign a unit as cargo of a vehicle. Used together with orderGetIn to order a unit to get in as cargo into a specific vehicle. Before usage of this command a subordinate unit hasn't got the option to get into the cargo space of the vehicle. + Removes the item with the given index from the listbox or combobox with id idc of the topmost user dialog. - https://community.bistudio.com/wiki/assignAsCargo + https://community.bistudio.com/wiki/lbDelete - Object assignAsCargo Object + lbDelete Array + + Control lbDelete Number - unitName assignAsCargo vehicleName + lbDelete [idc, index] + + control lbDelete index - $Code$_soldier1 assignAsCargo _truck - [_soldier1] orderGetIn true$/Code$ + $Code$lbDelete [101, 0];$/Code$ + + $Code$_control lbDelete 0;$/Code$ - global / global + local / local + More information on the LB command family can be found here - Nothing + Nothing - Nothing + - assignAsCommander + setMimic - Assign a unit as commander of a vehicle. Used together with orderGetIn to order subordinate units to get in as commander of a specific vehicle. Before usage of this command a subordinate unit hasn't got the option to get into the commander place of the vehicle. - - - https://community.bistudio.com/wiki/assignAsCommander - - - Object assignAsCommander Object - - - unitName assignAsCommander vehicleName - - - $Code$_soldier1 assignAsCommander _tank - [_soldier1] orderGetIn true$/Code$ - - - global / global - - - - - Nothing - - - - - assignAsDriver - - - Assign a unit as driver of a vehicle. Used together with orderGetIn to order subordinate units to get in as driver of a specific vehicle. Before usage of this command a subordinate unit hasn't got the option to get into the driver place of the vehicle. + Set person's facial expression. Following mimic values are recognized: + "Default" + "Normal" + "Smile" + "Hurt" + "Ironic" + "Sad" + "Cynic" + "Surprised" + "Agresive" + "Angry" + Since Arma 2 OA 1.6*, these values are used : + "neutral" + "dead" + "danger" + "hurt" + "aware" + "safe" + "combat" - https://community.bistudio.com/wiki/assignAsDriver + https://community.bistudio.com/wiki/setMimic - Object assignAsDriver Object + Object setMimic String - unitName assignAsDriver vehicleName + person setMimic mimic - $Code$_soldier1 assignAsDriver _tank - [_soldier1] orderGetIn true$/Code$ + $Code$_soldier1 setmimic "angry"$/Code$ - global / global + global / local + To give the impression of hard faced guys going into a mission, use the setmimic "angry" command. I always have this on my guys to stop them grinning during a cutscene/mission. + + In OFP v1.96, a character will keep any facial expression you set indefinately. Setmimic to "" to return soldier to automatic facial expressions. + + (Jan 19, 2010) + Not working in Arma 2 1.05. + + (September 2, 2013) + In Arma 3 the following face expressions work: "neutral","dead","danger","hurt","aware","safe","combat". Names must be written in all lower case letters. There is another grimace in config - "unconscious", which doesn't quite work. - Nothing + Nothing + - assignAsGunner + getPosASLVisual - Assign a unit as gunner of a vehicle. Used together with orderGetIn to order subordinate units to get in as gunner of a specific vehicle. Before usage of this command a subordinate unit hasn't got the option to get into the gunner place of the vehicle. + Returns an object's rendered 3D position ASL (z value above sea level) in render time scope. Alias of visiblePositionASL. - https://community.bistudio.com/wiki/assignAsGunner + https://community.bistudio.com/wiki/getPosASLVisual - Object assignAsGunner Object + getPosASLVisual Object - unitName assignAsGunner vehicleName + getPosASLVisual object - $Code$_soldier1 assignAsGunner _tank - [_soldier1] orderGetIn true$/Code$ + $Code$_playerRenderedPosASL = getPosASLVisual player ;$/Code$ - global / global + global / undefined - Nothing + Array + - assignAsTurret + taskChildren - Assigns the soldier to turret. + Return the child tasks of the specified task. - https://community.bistudio.com/wiki/assignAsTurret + https://community.bistudio.com/wiki/taskChildren - Object assignAsTurret Array + taskChildren Task - unit assignAsTurret [vehicle, [turretPath]] + taskChildren task @@ -5494,134 +5719,158 @@ - Nothing + Array + - assignCurator + arrayIntersect - Assign player as curator. Two players cannot act as one curator. + Intersects array1 with array2 returning array of unique common elements. Additionally, using the same array for array1 and array2 will simply return array of unique elements. Intersects only 1st dimension of an array. - https://community.bistudio.com/wiki/assignCurator + https://community.bistudio.com/wiki/arrayIntersect - Object assignCurator Object + Array arrayIntersect Array - player assignCurator curatorObj + array1 arrayIntersect array2 - $Code$player assignCurator myCurator;$/Code$ + $Code$_arr1 = [1,2,3,4,5,2,3,4]; + _arr2 = [4,5,6,1,2,3,5,6]; + hint str (_arr1 arrayIntersect _arr2); // [4,5,1,2,3]$/Code$ + + $Code$_arr = [1,2,3,1,2,3,1,2,3,4,5]; + hint str (_arr arrayIntersect _arr); // [1,2,3,4,5]$/Code$ + + $Code$// Remove nils : + hint str ([1,2, nil,3] arrayIntersect [1,2, nil,3]); // [1,2,3]$/Code$ + + $Code$// Also works with array elements which are equal : + hint str ([[1],[2],[3]] arrayIntersect [[2],[3],[4]]); // [[2],[3]]$/Code$ undefined / undefined - This scripting command must be executed on the server to work properly in multiplayer - Nothing + Array + - assignItem + commandStop - Assigns existing item from inventory (uniform, vest, backpack) to a correct slot. If the slot is occupied by another item, it gets replaced. + Order the given unit(s) to stop (via the radio). A stop command will never finish, the unit will never be ready. - https://community.bistudio.com/wiki/assignItem + https://community.bistudio.com/wiki/commandStop - Object assignItem String + commandStop Object/Array - unit assignItem item + commandStop unitName - $Code$bluforUnit addItem "NVGoggles"; - bluforUnit assignItem "NVGoggles"; - opforUnit addItem "NVGoggles_OPFOR"; - opforUnit assignItem "NVGoggles_OPFOR"; - independentUnit addItem "NVGoggles_INDEP"; - independentUnit assignItem "NVGoggles_INDEP";$/Code$ + $Code$commandStop _soldier1;$/Code$ + + $Code$commandStop [_soldier1, _soldier2];$/Code$ + + $Code$commandStop ( units player );$/Code$ global / global + In ArmA 1.14, this command will not stop a unit that has been given a move order by means of selecting the unit, then clicking on the in game map (or ground). - Nothing + Nothing + - assignTeam + selectRandomWeighted - Assigns the unit (in case of a vehicle, its commander) to the given team. Team is an option in group control (unit management) menu that allows to split player group in teams and then give bulk order to separate teams. In order to operate properly, the command requires specific conditions: - The command requires player to be fully initialised - The unit getting assigned must be either player himself or a unit in player's group - Units in player's group as well as player himself can all have different teams assigned - The colour of the assigned team for a unit is seen on the group management UI as well as squad radar - The possible team values (colours) are: - "MAIN" - (white) - "RED" - (red) - "GREEN" - (green) - "BLUE" - (blue) - "YELLOW" - (yellow) - NOTE : In older version of the game the effect of this command is local + Returns a random element from the given array according to assigned weights. Engine solution to BIS_fnc_selectRandomWeighted. A few notes: + Negative weights are not supported + If an item's weight is 0, the item is ignored + The weights don't have to total to 1 + If numbers of items and weights do not match, the shortest array is used + A single array Syntax is slightly faster then Alt Syntax - https://community.bistudio.com/wiki/assignTeam + https://community.bistudio.com/wiki/selectRandomWeighted - Object assignTeam String + selectRandomWeighted Array + + Array selectRandomWeighted Array - unit assignTeam team + selectRandomWeighted valuesAndWeights + + values selectRandomWeighted weights - $Code$_soldier2 assignTeam "RED";$/Code$ + $Code$_randomWeightedElement = selectRandomWeighted [1,0.1,2,0.2,3,1.3,4,2.4,5,7.5];$/Code$ + + $Code$_randomWeightedElement = [1,2,3,4,5] selectRandomWeighted [0.1,0.2,1.3,2.4,7.5];$/Code$ - global / global + undefined / undefined - (July 12, 2016) - Since Arma 3 v1.62 this command has global effects and is persistent even on machines that join in progress. + (June 26, 2017) + A 100000 runs of the following code: + $Code$_values = [0,1,2,3,4,5,6,7,8,9]; + _weights = [0.109,0.65,0.01,1.01,1.24,0,1.59,0.09,1.15,0.55]; + _result = _values selectRandomWeighted _weights;$/Code$ + Gave this result: + 0 - 0 + 0.01 - 144 + 0.09 - 1409 + 0.109 - 1633 + 0.55 - 8673 + 0.65 - 10127 + 1.01 - 15668 + 1.15 - 18059 + 1.24 - 19518 + 1.59 - 24769 - Nothing + Anything - Anything + - assignToAirport + setPlateNumber - Not correctly implemented yet, currently it does the same as landAt. As the implementation may get fixed sometime, please do not use this command until then. + Change the license plates on any vehicle which has plates configured. Max 15 characters are allowed! - https://community.bistudio.com/wiki/assignToAirport + https://community.bistudio.com/wiki/setPlateNumber - Object assignToAirport Number - - Object assignToAirport Object + Object setPlateNumber String - plane assignToAirport id - - plane assignToAirport target + vehicle setPlateNumber string - $Code$plane1 assignToAirport 0$/Code$ + $Code$vehicle player setPlateNumber "Custom Plate 99"$/Code$ undefined / undefined @@ -5629,364 +5878,449 @@ - Nothing - Nothing + Nothing + - assignedCargo + setVelocityTransformation - Returns the list of soldiers assigned to the given vehicle as a cargo. + Places an object at an interpolated position between two other objects and sets its vectors in proportion to the relative position. + The final position/vector is determined by the "interval" specified in the command. + This assumes an imaginary path between the two reference objects, where + at the beginning of the path (interval: 0) the position and vector are identical to the first reference object, + at the end of the path (interval: 1) they're identical to the second reference object, + and at 0.5 they are halfway in-between. + See setVelocityTransformation (VBS2) for more details. - https://community.bistudio.com/wiki/assignedCargo + https://community.bistudio.com/wiki/setVelocityTransformation - assignedCargo Object + Object setVelocityTransformation Array - assignedCargo vehicle + object setVelocityTransformation [position1, position2, velocity1, velocity2, direction1, direction2, upVector1, upVector2, interval] - $Code$_list = assignedCargo _vehicleName$/Code$ + $Code$_tracker setVelocityTransformation [ + getPosASL _currentPos, + getPosASL _nextPos, + velocity _currentVelocity, + velocity _nextVelocity, + vectorDir _currentVectorDir, + vectorDir _nextVectorDir, + vectorUp _currentVectorUp, + vectorUp _nextVectorUp, + _timeDiff + ];$/Code$ + + $Code$// Bob on imaginary stairway to heaven: + bob = createAgent ["C_man_1", player getRelPos [5, 0], [], 0, "CAN_COLLIDE"]; + bob switchMove "ladderciviluploop"; + pos1 = getPosASL bob; + pos2 = pos1 vectorAdd [0,0,0.75]; + bob addEventHandler ["AnimDone", + { + pos1 = pos2; + pos2 = pos2 vectorAdd [0,0,0.75] + }]; + onEachFrame + { + if (! alive bob) then + { + onEachFrame {}; + bob switchMove ""; + bob removeAllEventHandlers "AnimDone"; + }; + bob setVelocityTransformation [ + pos1, + pos2, + [0,0,0], + [0,0,0], + [0,1,0], + [0,1,0], + [0,0,1], + [0,0,1], + moveTime bob + ]; + };$/Code$ undefined / undefined + (Aug 4, 2014 – 12:35) + (A3 1.24) Generally speaking setVelocityTransformation is more likely a combination of setPosASL, setVectorDirAndUp (or BIS_fnc_setPitchBank ) and time multiplier. It can be used as a position tracker with all necessary information collected, copied and then released within one function. Here’s a simple reproduction on how setVelocityTransformation works in game: + $Code$ + private ["_dataOld","_dataNext","_capturedData","_obj","_fps","_startTrackingTime","_stepOld","_stepNext","_tracker","_tempTime"]; + _stepOld = 0; + _tempTime = 0; + _stepNext = 1; + while { true } do { + _capturedData = _capturedData + [[ getPosASL _obj, velocity _obj, vectorDir _obj, vectorUp _obj]]; + sleep _fps; + _tempTime = _tempTime + _fps; + if (_tempTime = _startTrackingTime) then { + _dataOld = _capturedData select _stepOld; + _dataNext = _capturedData select _stepNext; + _stepOld = _stepOld + 1; + _stepNext = if (_stepNext = ( count _capturedData)) then [{_stepOld},{_stepNext + 1}]; + _tracker setVelocityTransformation + [_dataOld select 0,_dataNext select 0,_dataOld select 1,_dataNext select 1, + _dataOld select 2,_dataNext select 2,_dataOld select 3,_dataNext select 3,1]; + }; + };$/Code$ + Tracker starts coping the route and stance from the object when time start counting. TimeDiff determines the distance multiply between the current position and the next position. - Array + Nothing + - assignedCommander + lbSortByValue - Returns the soldier assigned to the given vehicle as a commander. + Sorts the ListBox entries by lbValue. The entries are sorted in ascending order. Also note that this command will mix up the entries randomly if multiple entries have the same value. - https://community.bistudio.com/wiki/assignedCommander + https://community.bistudio.com/wiki/lbSortByValue - assignedCommander Object + lbSortByValue Control + + lbSortByValue Number - assignedCommander vehicle + lbSortByValue control + + lbSortByValue idc - $Code$_commander = assignedCommander vehicleName$/Code$ + $Code$lbSortByValue _control;$/Code$ + + $Code$lbSortByValue 101;$/Code$ undefined / undefined + A good way to avoid that this Command will mix your Listbox up is, to assign your Value summed up with the Index ID returned by lbAdd to your Listbox Entries. + Posted: Sep 10 2014 + + More information on the LB command family can be found here - Object + Nothing - Nothing + - assignedDriver + camCommand - Returns the soldier assigned to the given vehicle as a driver. + Executes a command on the given camera / actor object. Known commands for: + All camera types - "manual on", "manual off" + "camera" - "inertia on", "inertia off" + "seagull" - "landed", "airborne" + When you execute camCommand "landed" on a flying seagull, it will land and sit on the floor until you call camCommand "airborne". The camCommand changes are conducted immediately, the command doesn't wait for camCommit. - https://community.bistudio.com/wiki/assignedDriver + https://community.bistudio.com/wiki/camCommand - assignedDriver Object + Object camCommand String - assignedDriver vehicle + camera camCommand command - $Code$_driver= assignedDriver vehicleName$/Code$ + $Code$_camera camCommand "manual on";$/Code$ - undefined / undefined + local / local + (May 23, 2017) + In Arma 3 with the addition of the curator camera type, the following commands are supported: + $Code$_camera = "CamCurator" camCreate [0,0,0]; + _camera camCommand "maxPitch 89"; + _camera camCommand "minPitch -89"; + _camera camCommand "speedDefault 0.1"; + _camera camCommand "speedMax 2"; + _camera camCommand "ceilingHeight 5000"; + _camera camCommand "atl off"; + _camera camCommand "surfaceSpeed off"; + $/Code$ - Object + Nothing + - assignedGunner + controlsGroupCtrl - Returns the soldier assigned to the given vehicle as a gunner. + Returns a child control with specified idc from a controls group - https://community.bistudio.com/wiki/assignedGunner + https://community.bistudio.com/wiki/controlsGroupCtrl - assignedGunner Object + Control controlsGroupCtrl Number - assignedGunner vehicle + ctrlgrp controlsGroupCtrl idc - + $Code$_control = _controlsGroup controlsGroupCtrl 101;$/Code$ + undefined / undefined - Object + Control + - assignedItems + windStr - Get array with all assigned items. + Returns the current wind strength. - https://community.bistudio.com/wiki/assignedItems + https://community.bistudio.com/wiki/windStr - assignedItems Object + windStr - assignedItems unit + windStr - $Code$hint str assignedItems player ;$/Code$ + $Code$10 setWindStr (0.5 * windStr );$/Code$ undefined / undefined - (June 18, 2013) - Arma 3, version 0.70 - headgear and goggles are not present in returned array now. - - (August 22, 2013) - For head gear use headgear, addHeadgear and removeHeadgear. For goggles use goggles, addGoggles and removeGoggles - Array + Number + - assignedTarget + magazinesDetailBackpack - Returns the target assigned to the vehicle/unit. To unassign the target use doWatch objNull or commandWatch objNull. + Returns an array with the type names of all the unit's backpack magazines. - https://community.bistudio.com/wiki/assignedTarget + https://community.bistudio.com/wiki/magazinesDetailBackpack - assignedTarget Object + magazinesDetailBackpack Object - assignedTarget vehicleName + magazinesDetailBackpack unit - $Code$_target = assignedTarget _T72$/Code$ + $Code$magazinesDetailBackpack player$/Code$ - local / undefined + undefined / undefined - Object + Array + - assignedTeam + getFriend - Returns the team the unit belongs to. Possible values: - MAIN (default and white) - RED - GREEN - BLUE - YELLOW - This command will return nil if given unit is objNull, remoteControling another unit or is not local + Returns if sides are friendly or hostile. For a value smaller than 0.6 it results in being enemy, otherwise it's friendly. See also Side relations. - https://community.bistudio.com/wiki/assignedTeam + https://community.bistudio.com/wiki/getFriend - assignedTeam Object + Side getFriend Side - assignedTeam unitName + side1 getFriend side2 - $Code$_team = assignedTeam player ;$/Code$ + $Code$value = west getFriend east ;$/Code$ + + $Code$_isEnemy = side _killer getFriend side _victim 0.6;$/Code$ - local / undefined + global / undefined - (December 13, 2014) - As of Arma 3 version 1.36. assignedTeam might return nil instead of any of the STRINGs above if the player is currently remote controlling a unit. - $Code$ assignedTeam player - - $/Code$ - - (May 23, 2017) - Executed on server also nothing is returned... so arguments need to be local. - String/Nothing + Number + - assignedVehicleRole + isKindOf - Return the role a unit is assigned to within its assigned vehicle. - The array which is returned contains: - [] - Not assigned to any vehicle - ["Driver"] - Assigned as driver - ["Cargo"] (or ["Cargo", [turret path]] since Arma 3 1.31.127272) - Assigned as cargo - ["Turret", [turret path]] - Assigned to a turret - If no vehicle role is assigned, an empty array is returned. + Checks whether the object is (a subtype) of the given type. While main syntax and alt syntax support only CfgVehicles, CfgAmmo and CfgNonAIVehicles, alt syntax 2 allows to specify any config, including mission config. - https://community.bistudio.com/wiki/assignedVehicleRole + https://community.bistudio.com/wiki/isKindOf - assignedVehicleRole Object + Object isKindOf String + + String isKindOf String + + String isKindOf Array - assignedVehicleRole unitName + object isKindOf typeName + + typeName1 isKindOf typeName2 + + typeName1 isKindOf [typeName2, targetConfig] - $Code$_RoleArray = assignedVehicleRole player ;$/Code$ + $Code$vehicle player isKindOf "Tank";$/Code$ - $Code$// Get weapons available to player at player occupied turret: - _weaponsTurret = vehicle player weaponsTurret ( assignedVehicleRole player select 1);$/Code$ + $Code$"BMP2" isKindOf "Tank";$/Code$ + + $Code$currentWeapon player isKindOf ["Rifle", configFile "CfgWeapons"];$/Code$ - global / undefined + undefined / undefined - (August 31, 2013) - When unit with unassigned vehicle role enters a vehicle, it gets assigned vehicle role automatically. The unit then will hold on to its assigned role after exiting the vehicle. To add, when player is in the group of AIs and is not the leader, assignedVehicleRole of the player could be unpredictable and absolutely not related to the position player occupies. In short, forget about this command, it is unreliable and has been broken too many times in the past. + (April 23, 2007) + This command can be used on the whole hierarchical class tree (i.e. when checking a HMMWV, one could test for "HMMWV50", "Car", "LandVehicle", etc., all of which would return true.) - (November 15, 2014) - In multiplayer (tested in v1.34), this only works reliably on the server. - Behaviour is as follows: - On a client, the command will return empty arrays for every unit that is not local. - On the server, the command correctly returns the position, regardless of the units locality. + (16 Apr, 2008) + It appears isKindOf is limited to the CfgVehicles branch of the class hierachy. + So CfgWeapons, CfgMagazines, etc will return false for checks like: + ("M9" isKindOf "Pistol") returns false + + (8 Nov, 2009) + In a2 isKindOf also works for CfgAmmo in addition to CfgVehicles: ("M_9M311_AA" isKindOf "MissileBase") returns true. NOT for CfgWeapons, CfgMagazines and others.. + + (June 16, 2015) + In case you cannot use isKindOf because of the reasons stated, just use BIS fnc returnParents with class names as return value: + $Code$ _isKindOf = "Rifle" in [( configFile "CfgWeapons" "BWA3_G36K"), true ] call BIS_fnc_returnParents ; // is true$/Code$ + + (September 6, 2015) + In A3 isKindOf works well with CfgWeapons and CfgMagazines using the syntax from example 3. + It should be prefered to James' solution as it performs more than 25x faster. Tested in debug console with the following code snippets: + $Code$bool = "CA_Magazine" in ([( configFile "CfgMagazines" "HandGrenade"),true] call BIS_fnc_returnParents ); -- 0.12111ms$/Code$ + $Code$bool = "HandGrenade" isKindOf ["CA_Magazine", configFile "CfgMagazines"]; -- 0.00439453ms$/Code$ + When checking in CfgVehicles the syntax from example 2 performs a little faster. - Array + Boolean - Boolean - Boolean + - assignedVehicle + pixelGridNoUIScale - Returns the vehicle a unit is assigned to. If no vehicle is assigned objNull is returned. + Returns grid size based on screen resolution and configs: uiScaleFactor, uiScaleMaxGrids + As mentioned in the name of this command, the user interface scale is ignored. - https://community.bistudio.com/wiki/assignedVehicle + https://community.bistudio.com/wiki/pixelGridNoUIScale - assignedVehicle Object + pixelGridNoUIScale - assignedVehicle unit + pixelGridNoUIScale - $Code$_vehicle = assignedVehicle player ;$/Code$ + $Code$_gridHeightNoUIScale = pixelH * pixelGridNoUIScale ;$/Code$ - local / undefined + undefined / undefined - Object + Number + - atan2 + waypointLoiterRadius - ArcTangent of x/y. Used to determine the angle of a vector [x,y]. Result in Degrees between -180 and 180. - Note that this command can handle y being 0, unlike when using atan, and will return 90 + Gets the waypoint loiter radius. Waypoint uses format Waypoint. - https://community.bistudio.com/wiki/atan2 + https://community.bistudio.com/wiki/waypointLoiterRadius - Number atan2 Number + waypointLoiterRadius Waypoint - x atan2 y + waypointLoiterRadius Waypoint - $Code$_xy = [5,3]; - _degrees = (_xy select 0) atan2 (_xy select 1); //59.0362$/Code$ - - $Code$// Get direction from _obj1 to _obj2: - _vd = getPosASL _obj2 vectorDiff getPosASL _obj1; - _dir = (_vd select 0) atan2 (_vd select 1); //_dir range from -180 to +180 - if (_dir 0) then {_dir = 360 + _dir}; //_dir range from 0 to 360$/Code$ - - $Code$// Get relative direction from _obj1 to _obj2: - _xy = _obj1 worldToModel getPosASL _obj2; - _dir = (_xy select 0) atan2 (_xy select 1); //_dir range from -180 to +180 - if (_dir 0) then {_dir = 360 + _dir}; //_dir range from 0 to 360$/Code$ + $Code$_radius = waypointLoiterRadius [groupOne, 1];$/Code$ undefined / undefined - (08:00, 18 November 2009) - To get the direction of an object from the player: - $Code$ - _dir = (( getPos _obj select 0) - ( getPos player select 0)) atan2 (( getPos _obj select 1) - ( getPos player select 1)); - //_dir will be from -180 to 180. - $/Code$ - If positive values are needed then use: - $Code$ - if (_dir 0) then {_dir = _dir + 360}; - $/Code$ - Or just use BIS_fnc_dirTo directly. - Number + Number + - atan + allSites - ArcTangent of a number, result in Degrees. + Return all sites in map. + This command is considered deprecated and is no longer supported - https://community.bistudio.com/wiki/atan + https://community.bistudio.com/wiki/allSites - atan Number + allSites - atan x + allSites - $Code$_degrees = atan 1; //45$/Code$ + $Code$_allSites = allSites ;$/Code$ undefined / undefined @@ -5994,24 +6328,25 @@ - Number + Array + - atg + moveToFailed - Equivalent to atan + Check if latest low level moveTo command failed. - https://community.bistudio.com/wiki/atg + https://community.bistudio.com/wiki/moveToFailed - atg Number + moveToFailed Object - atg x + moveToFailed person @@ -6021,265 +6356,229 @@ - Number + Boolean + - attachObject + removeHeadgear - Attaches a location to the specified object. To detach a location, attach it to objNull. + Removes headgear from a unit. If unit has no headgear command quietly fails. - https://community.bistudio.com/wiki/attachObject + https://community.bistudio.com/wiki/removeHeadgear - Location attachObject Object + removeHeadgear Object - location attachObject object + removeHeadgear unit - $Code$myLocation attachObject player ;$/Code$ + $Code$removeHeadgear player ;$/Code$ - undefined / undefined + global / global + (August 5, 2016) + To clarify, this command effectively DELETES the headgear. It does not simply remove it from unit's head and move it into inventory. - Nothing + Nothing + - attachTo + flagOwner - Attaches an object to another object. The offset is applied to the object center unless a memory point is provided. If no offset is specified, the offset used will be the current relative positioning of objects against each other. + Returns the global owner of a flag. A getter for setFlagOwner. Note that owner of a flag is Object rather than Number, as how it is usually with other owner commands - https://community.bistudio.com/wiki/attachTo + https://community.bistudio.com/wiki/flagOwner - Object attachTo Array + flagOwner Object - object1 attachTo [object2, offset, memPoint] + flagOwner flag - $Code$player attachTo [car, [0, 0, 1] ];$/Code$ - - $Code$player attachTo [tank, [0, -1, 0], "Usti hlavne"];$/Code$ - - $Code$// Automatic offset: - ammoCrate attachTo [ player ];$/Code$ - - $Code$To set orientation of attached object use setVectorDirAndUp command: - _expl1 = "DemoCharge_Remote_Ammo" createVehicle position player ; - _expl1 attachTo [ player, [-0.1, 0.1, 0.15], "Pelvis"]; - _expl1 setVectorDirAndUp [ [0.5, 0.5, 0], [-0.5, 0.5, 0] ]; - _expl2 = "DemoCharge_Remote_Ammo" createVehicle position player ; - _expl2 attachTo [ player, [0, 0.15, 0.15], "Pelvis"]; - _expl2 setVectorDirAndUp [ [1, 0, 0], [0, 1, 0] ]; - _expl3 = "DemoCharge_Remote_Ammo" createVehicle position player ; - _expl3 attachTo [ player, [0.1, 0.1, 0.15], "Pelvis"]; - _expl3 setVectorDirAndUp [ [0.5, -0.5, 0], [0.5, 0.5, 0] ];$/Code$ + $Code$_person = flagOwner _flagOne;$/Code$ global / global - (June 6, 2009) - You can use setDir to change the direction of the attached object. The direction is relative to the object you attach it to, so setDir 180 won't point to the south but to the rear of the object you attach it to. - Use setPos to synchronize the direction of the object in a network game. - Example code: - $Code$ - _obj setDir 180; - _obj setPos getPos _obj;$/Code$ - - (September 17, 2011) - Some objects you cannot attach anything to. To be more precise, you can attach objects to them, but the behaviour is unexpected. For instance: $Code$ - SuitcaseObject attachTo [FoldingTableObject, [0,0,0]];$/Code$ - You would expect the suitcase to jump to the pivot point of the table, and stick to it. - Instead, the suitcase will freeze in it's original position. Even if the table is moved, the suitcase will be unaffected: it will not follow the table, it will not even respond to actions it reacted to prior to being attached: pushing, being shot at, etc.. It's just an object frozen in space. In MP it's even weirder, the suitcase would turn invisible. - Dodgy objects when it comes to attaching things to them: most in Objects(small), Objects(signs), all of Objects(helpers) categories, etc.. - - (March 28, 2014) - If you attach an explosive charge to an object (e.g. ammobox), the charge will not detonate when you simply set the damage to 1. You must detach it before. - $Code$ private ["_target"]; - _target = your_ammobox ; - // create and attach charge - private ["_charge"]; - _charge = "DemoCharge_Remote_Ammo_Scripted" createVehicle position player ; - _charge attachTo [_target, [0,0,0.2]]; - _charge setVectorDirAndUp [[0.5,0.5,0],[-0.5,0.5,0]]; - // now detonate charge - detach _charge; //Important! - _charge setDamage 1; - $/Code$ - - (1 Jun, 2014) - (ArmA3 ver 1.20) attachTo overwrites setVectorDirAndUp if attached obj was changed to attach another one. - $Code$ - _obj attachTo [_logic,[0,0,0]]; - _obj setVectorDirAndUp [[0,1,0],[0,0,-1]]; - _obj attachTo [_logic,[0,0,2]]; //vector no changes - _obj attachTo [_anotherOne,[0,0,0]]; //vector changes to default - $/Code$ - - (September 25, 2014) - Attaching an object does not update the accessibility of a place for the AI. The command shouldn't be used for positioning large static objects - the AI will simply walk thru such objects. - - (September 1, 2016) - Using attachTo with an objects that have ragdoll physics (such as ammo boxes, containers, etc.) may cause unexpected behaviour. When you do so, if the attached object intersect origin object, origin object may gain some - enormous collision properties even if the collision model for the attached object is not present localy to origin object, until detached. Vehicles may start flipping with no mass calculation (ie tank might fly), player object might gain inifinite - Z-vector velocity on any interaction with terrain relief and other objects. - Nothing + Object + - attachedObjects + lnbSize - Returns a list of attached objects. + Returns size of 2D listbox or combobox as [rows, columns]. - https://community.bistudio.com/wiki/attachedObjects + https://community.bistudio.com/wiki/lnbSize - attachedObjects Object + lnbSize Control/Number - attachedObjects obj + lnbSize ctrl - $Code${ - detach _x; - } forEach attachedObjects player ;$/Code$ - - $Code$if ( count attachedObjects player == 0) then { - hint "There are no objects attached to player"; - };$/Code$ + $Code$lnbSize _ctrl;//[8,2]$/Code$ - undefined / undefined + local / local - Array + Array + - attachedObject + goto - Returns the object a location is attached to. If the location is unattached, then objNull is returned. + In SQS scripts only: Go to given label. + String argument is used here. + Be sure to use double quotes around label name in goto. Define the label with #. Note that Labels are not case sensitive and that labels are searched for from the top of the script, so multiple occurrences of a label will only result in the top most one ever being found. - https://community.bistudio.com/wiki/attachedObject + https://community.bistudio.com/wiki/goto - attachedObject Location + goto String - attachedObject location + goto label - $Code$_locAttachedObj = attachedObject myLocation;$/Code$ - + undefined / undefined + (August 4, 2006) + Notes from before the conversion: + This function works only inside of SQS script. + The search for labels always begins at the top of the script so that if there are multiple occurrences of a label the first occurrence will always be the one found. + Because of the searching order, it is faster to place loops which are executed often at the top of a script. + Labels are not case sensitive. + Loops which look something like the example below should be avoided as many of them could cause the mission to slow down: + #wait + if (condition) then { goto "wait"} + It is better to use the @ command to wait for a condition to be true, or put a small delay into the wait loop. + Example + While it is not required to include a delay in a loop, such a loop without a delay can cause the script to slow the game down, as the loop will be executed many times before the game engine interrupts the script. + Unless you really want the loop to execute multiple times during a frame, you should include a small delay. + You would need to have many scripts running for this to be a significant issue. + Deciding whether to use a script with a loop or a trigger or even a @ statement to detect a condition is a complicated matter and should be subject to experimentation. + + (August 4, 2006) + A goto command called within a forEach loop, will only execute a single jump to goto, once the forEach loop has finished: + { goto "wait"} forEach [0,1,2,3,4] - Object + Nothing + - attachedTo + setPitch - Returns the object it is attached to. - Returns objNull if not attached to anything. + Sets the pitch of a persons voice. - https://community.bistudio.com/wiki/attachedTo + https://community.bistudio.com/wiki/setPitch - attachedTo Object + Object setPitch Number - attachedTo object + person setPitch pitch - $Code$if ( isNull attachedTo _obj1) then { - hint "_obj1 is not attached to anything."; - };$/Code$ + $Code$unit1 setPitch 1$/Code$ - undefined / undefined + undefined / local - Object + Nothing + - attackEnabled + animationState - Return whether a group's leader can issue attack commands to soldiers under his command. + Returns the name of a unit's current primary animation. Seems to be forced to lower case in Arma 3. - https://community.bistudio.com/wiki/attackEnabled + https://community.bistudio.com/wiki/animationState - attackEnabled Object/Group + animationState Object - attackEnabled name + animationState unitName - $Code$if (not attackEnabled _soldier) then {_soldier setCombatMode "Careless"}$/Code$ + $Code$_state = animationState player ;$/Code$ global / undefined + (August 22, 2014) + (A3 1.26) To sort animation state by keyword, use BIS_fnc_ambientAnimGetParams + $Code$ ("KNEEL" call BIS_fnc_ambientAnimGetParams ) select 0; + //return: ["amovpknlmstpslowwrfldnon"…]$/Code$ + Useful keywords are: "STAND", "WATCH", "GUARD", "LISTEN_BRIEFING", "LEAN_ON_TABLE", "LEAN", "SIT_AT_TABLE", "KNEEL", "PRONE_INJURED", "BRIEFING" ect. - Boolean + String + - backpackCargo + teamMember - Get array with backpacks from ammo box (or any general weapon holder container). + Return an agent for given person. - https://community.bistudio.com/wiki/backpackCargo + https://community.bistudio.com/wiki/teamMember - backpackCargo Object + teamMember Object - backpackCargo box + teamMember person - $Code$hint str backpackCargo vehicle player ;$/Code$ + $Code$_agent = teamMember player ;$/Code$ undefined / undefined @@ -6287,135 +6586,173 @@ - Array + Team_Member + - backpackContainer + animatePylon - Returns a cargo container of a unit's backpack. + Force animation of pylon to given state, -1 for reset to engine handling, can cause weapon inoperative, because weapon is released when pylon state =1. - https://community.bistudio.com/wiki/backpackContainer + https://community.bistudio.com/wiki/animatePylon - backpackContainer Object + Object animatePylon Array - backpackContainer unit + vehicle animatePylon [pylon nameindex, anim phase] - $Code$hint str backpackContainer player ; //1a5f7900# 163944: backpack_fast.p3d$/Code$ - - $Code$hint str getMagazineCargo backpackContainer player ; - // [ - //[ - //"APERSBoundingMine_Range_Mag", - //"ClaymoreDirectionalMine_Remote_Mag", - //"SLAMDirectionalMine_Wire_Mag", - //"DemoCharge_Remote_Mag" - //],[ - //3, - //2, - //2, - //1 - //] - //]$/Code$ - - $Code$( backpackContainer player ) addWeaponCargoGlobal [ weapons player select 0,1];$/Code$ + $Code$( vehicle player ) animatePylon [1, 0.5];$/Code$ undefined / undefined - (Apr 29, 2014) - In ArmA3 ver 1.16, we can use either backpackContainer or unitBackpack at present since both of them enjoy same operand type and return value. - Object + Nothing + - backpackItems + isNil - Get array with all items (of any kind, even weapons) in backpack of the given unit. + Tests whether the variable defined by the String argument is undefined, or whether an expression result passed as Code is undefined. + The command returns true if the variable or the expression result is undefined (i.e. the expression result is Void ), and false in all other cases. - https://community.bistudio.com/wiki/backpackItems + https://community.bistudio.com/wiki/isNil - backpackItems Object + isNil String + + isNil Code - backpackItems unit + isNil variableName + + isNil code - $Code$backpackItems player ;[ - "hgun_P07_F", - "Titan_AT" - ]$/Code$ + $Code$if ( isNil "_pokus") then {_pokus = 0};$/Code$ + + $Code$isNil { player getVariable "someVar"};$/Code$ undefined / undefined + I recently had a strange experience with this command. I forgot to wrap the name of the variable with quotes, and it returned the opposite of the true null status of the variable. Just something to watch out for. + + ^ If you don't wrap the name of the variable in quotes, then it will instead read the value of the variable itself. If that variable is a string or code, then the command will use that string or code held by the variable. Example: + _myvar = "_hisvar"; + isnil _myvar; + //will return true if _hisvar is null + _myvar = {tank1}; + sleep (random 50); + isnil _myvar; + //will return if tank1 is nil, at the time the isnil command is checked (not at the time _myvar is established) + -- General Barron 10:37, 30 December 2009 (CET) + + isNil is also able to check if an expression is undefined. As such, an alternative way to check variables would be: + isNil {variable} + you can use this method to also check if variables defined using setVariable exist as well: + isNil {player getVariable "Something"} + As well as testing if a function returns a value + func_ChangeVehicleName = + { + _this setVehicleVarName "newName"; + }; + if (isNil {player call func_ChangeVehicleName}) // returns true, because this function does not return anything + + (September 25, 2014) + While isNil isn't available in OFP/CWA you can easily emulate it with something like this: + _nil = format["%1",_nilstring]; + ?(format["%1",foo]==_nil): foo = "Hello World!" + + (October 25, 2014) + You can also use isNil to check if an array element exists or if a setVariable variable exists + $Code$_array = [0,1,2,3]; + if (isNil {_array select 4}) then {hint "Element does not exist";};$/Code$ + $Code$if ( isNil { missionNamespace getVariable "MY_VARIABLE"})$/Code$ + When trying to test array elements, you can only test elements that are 1 element out of range. Testing elements 2 or more elements out of range will result in a script error. + + (June 25, 2017) + isNil in combination with code will execute that code so be aware. + + (July 18, 2017) + isNil CODE will execute the code in unscheduled environment - Array + Boolean - Boolean + - backpackMagazines + addWeapon - Get array with all magazines from backpack of the given unit. + Add a weapon to a unit. The unit must be local to the computer where command is executed. For a global version of this command see addWeaponGlobal. + Infantry units can only carry a specific number of weapons, once the weapon slots are filled, any further addWeapon commands are ignored. - https://community.bistudio.com/wiki/backpackMagazines + https://community.bistudio.com/wiki/addWeapon - backpackMagazines Object + Object addWeapon String - backpackMagazines unit + unit addWeapon weapon - $Code$backpackMagazines player ;[ - "Titan AT Missile(1/1)[id/cr:16/0](2x)" - ]$/Code$ + $Code$player addMagazine "30Rnd_556x45_Stanag"; + player addWeapon "BAF_L85A2_RIS_SUSAT";$/Code$ + + $Code$An_2 addMagazine "100Rnd_762x51_M240"; + An_2 addWeapon "M240_veh";$/Code$ - undefined / undefined + local / global + (August 2, 2006) + Notes from before the conversion: + To ensure that the weapon is loaded at the start of the mission, add at least one magazine ( addMagazine ) before adding the weapon. To remove weapons use the removeAllWeapons or the removeWeapon commands. + + When adding a weapon in-game, a bug means that sometimes the weapon can't be fired. Swap to a different weapon and swap back again to enable the newly added weapon to fire; or drop and pick up the weapon again. - Array + Nothing + - backpack + listVehicleSensors - Returns a class of a backpack. + Returns an array of the sensors in the given vehicle's config (configfile CfgVehicles vehicle Components SensorsManagerComponent Components). - https://community.bistudio.com/wiki/backpack + https://community.bistudio.com/wiki/listVehicleSensors - backpack Object + listVehicleSensors Object - backpack unit + listVehicleSensors vehicle - $Code$_classname = backpack player ;$/Code$ + $Code$_sensors = listVehicleSensors ( vehicle player ); + hint str _sensors;$/Code$ undefined / undefined @@ -6423,236 +6760,284 @@ - String + Array + - backpackSpaceFor + cheatsEnabled - Returns how much space is in backpack for given weapon or magazine + Checks whether cheats are enabled (whether the designers' version is running). - https://community.bistudio.com/wiki/backpackSpaceFor + https://community.bistudio.com/wiki/cheatsEnabled - Object backpackSpaceFor String + cheatsEnabled - backpack backpackSpaceFor weaponName + cheatsEnabled - $Code$( backpack player ) backpackSpaceFor "m16"; // [weapons, magazines]$/Code$ - + undefined / undefined - Array + Boolean + - behaviour + boundingBox - Return the behaviour of a unit. For Arma 3 behaviour explanation see Arma_3_AI_Behavior + Returns a bounding box of given object in model coordinate space. This command is rather generous on the size estimation, for more precise coordinates use boundingBoxReal - https://community.bistudio.com/wiki/behaviour + https://community.bistudio.com/wiki/boundingBox - behaviour Object + boundingBox Object - behaviour unitName + boundingBox model - $Code$_soldier setBehaviour "CARELESS"; - _b = behaviour _soldier; //returns "CARELESS"$/Code$ + $Code$_box = boundingBox _abrams$/Code$ - global / undefined + undefined / undefined - (14 Feb 2010) - Although behaviour is called on an individual unit, what you are really getting back is the behaviour of that unit's group. Behaviour is a group setting. - String + Array + - benchmark + ctrlModelDirAndUp - Returns the value of "3D Performance" in OFP Preferences (flashpoint.cfg). This can be used to estimate the computer performance to adapt CPU and GPU demanding settings like view distance dynamically in missions. + Returns vectorDir and vectorUp of the model used in 3D Dialog Control. - https://community.bistudio.com/wiki/benchmark + https://community.bistudio.com/wiki/ctrlModelDirAndUp - benchmark + ctrlModelDirAndUp Control - benchmark + ctrlModelDirAndUp control - $Code$? (benchmark 2000) : setViewDistance 2000$/Code$ + $Code$_vectorDirAndUp = ctrlModelDirAndUp _control3D;$/Code$ undefined / undefined - (14 March 2014) - The command is obsolete, it was used in OFP to measure PC performance. In A3 it returns 2000. - Number + Array + - binocular + vectorMagnitudeSqr - Returns class name of currently used binocular weapon. + Squared magnitude of a 3D vector. - https://community.bistudio.com/wiki/binocular + https://community.bistudio.com/wiki/vectorMagnitudeSqr - binocular Object + vectorMagnitudeSqr Array - binocular unit + vectorMagnitudeSqr vector - $Code$_binocs = binocular player ; //Rangefinder$/Code$ + $Code$_sizeSqr = vectorMagnitudeSqr [0,3,4]; //25$/Code$ undefined / undefined + (28 Jun, 2014) + (ArmA3 1.22)Algorithm: + $Code$ + Vector = [x,y,z]; + Result = (x ^ 2) + (y ^ 2) + (z ^ 2) + $/Code$ + It is recommended to use vectorMagnitudeSqr instead of BIS_fnc_magnitudeSqr. - String + Number + - blufor + isLightOn - Pre-defined variable for the blufor side. - Alias for west. + Returns true if vehicle headlights are on otherwise false. - https://community.bistudio.com/wiki/blufor + https://community.bistudio.com/wiki/isLightOn - blufor + isLightOn Object - blufor + isLightOn vehicle - $Code$if ( side player == blufor ) then { - hint "BLUFOR"; - };$/Code$ + $Code$_lightsOn = isLightOn vehicle player ;$/Code$ + + $Code$_pilotLightOn = isLightOn heli;$/Code$ - undefined / undefined + global / undefined - Side + Boolean + - boundingBoxReal + setWaypointStatements - Returns a bounding box of given object in model coordinates space. This command is similar to boundingBox but gives more precise measurements. + The waypoint is done only when the condition is fulfilled. When the waypoint is done, the statement expression is executed. + Within the Condition & Statement code string: + this refers to the group leader + thisList refers to an array containing each unit in the group - https://community.bistudio.com/wiki/boundingBoxReal + https://community.bistudio.com/wiki/setWaypointStatements - boundingBoxReal Object + Array setWaypointStatements Array - boundingBoxReal obj + waypoint setWaypointStatements [condition, statement] - $Code$_bbr = boundingBoxReal vehicle player ; - _p1 = _bbr select 0; - _p2 = _bbr select 1; - _maxWidth = abs ((_p2 select 0) - (_p1 select 0)); - _maxLength = abs ((_p2 select 1) - (_p1 select 1)); - _maxHeight = abs ((_p2 select 2) - (_p1 select 2));$/Code$ + $Code$new_wp setWaypointStatements [" true ", " hint 'hello'; hint 'goodbye'"];$/Code$ + + $Code$new_wp setWaypointStatements [" true ", " diag_log ['GroupLeader: ', this ]; diag_log ['Units: ', thislist ]"];$/Code$ undefined / undefined + (May 21, 2016) + Within the completion statement currentWaypoint will give the index of the waypoint being completed (as opposed to the following one). + This is particularly useful if you need a self deleting waypoint: $Code$ setWaypointStatements [" true "," deleteWaypoint [ group this, currentWaypoint ( group this)]"]$/Code$ + + (May 9, 2017) + The condition block carries the same rules as functions which return a value. The return value must be of type Boolean. I can bypass the use of triggers in this manner. + $Code$_wp setWaypointStatements [" code code code; _returnBool ", " onActivation block; "];$/Code$ - Array + Nothing + - boundingBox + tvSetData - Returns a bounding box of given object in model coordinate space. This command is rather generous on the size estimation, for more precise coordinates use boundingBoxReal + Sets string data to item on given path. IDC means id of parent Tree View. - https://community.bistudio.com/wiki/boundingBox + https://community.bistudio.com/wiki/tvSetData - boundingBox Object + tvSetData Array + + Control tvSetData Array - boundingBox model + tvSetData [idc, [path], data] + + _ctrl tvSetData [ [path], data] - $Code$_box = boundingBox _abrams$/Code$ + $Code$tvSetData [101, [0], "Test data"];$/Code$ + + $Code$_ctrl tvSetData [ [0,0,0], "Test data"];$/Code$ - undefined / undefined + local / local + (Sep 11 2014) + (A3 1.28)tv command family overview + $Code$ + //tv command family available for CT_TREE (type 12) + private ["_count","_current","_data","_text","_value","_pic"]; + _CT_TREE tvAdd [ [],"Parent_A"]; + _CT_TREE tvAdd [ [0],"Child_A"]; + _CT_TREE tvAdd [ [0,0],"Grandchild_A"]; + _CT_TREE tvAdd [ [],"Parent_B"]; + _CT_TREE tvAdd [ [1],"Child_B"]; + _count = _CT_TREE tvCount []; //return 2 + _CT_TREE tvSetCurSel [0,0,0]; //select grandchild_A + _current = tvCurSel _CT_TREE; //return [0,0,0] + _CT_TREE tvSetData [_current,"I'm grandchild_A"]; + _data = _CT_TREE tvData _current; // "I'm grandchild_A" + _text = _CT_TREE tvText _current; //"Grandchild_A" + _CT_TREE tvSetValue [_current,14]; + _value = _CT_TREE tvValue _current; // 14 + _CT_TREE tvSetPicture [_current, getText ( configFile "CfgWeapons" "optic_NVS" "picture")]; + _pic = _CT_TREE tvPicture _current; + _CT_TREE tvExpand [1]; + _CT_TREE tvSort [[], false ]; + _CT_TREE tvSortByValue [[], false ]; + _CT_TREE tvDelete [0,0]; //remove child_b + tvClear 12; + _CT_TREE tvCollapse []; + $/Code$ - Array + Nothing - Nothing + - boundingCenter + shownMap - Returns the position of original (loaded) center of object in model coordinates. + Checks if client has Map enabled in description.ext ( showMap param) or force enabled with showMap command. - https://community.bistudio.com/wiki/boundingCenter + https://community.bistudio.com/wiki/shownMap - boundingCenter Object + shownMap - boundingCenter object + shownMap - $Code$_center = boundingCenter TruckOne$/Code$ + $Code$if ( shownMap ) then { hint "You have Map enabled"};$/Code$ undefined / undefined @@ -6660,867 +7045,818 @@ - Array + Boolean + - breakOut + setWeaponReloadingTime - Breaks the code execution out of scope {} named name. nil is returned. Scope name can be assigned using scopeName command. - Since Arma 3 v1.47, breakOut can be used to return a value. It is the closest SQF comes to having "return" like operation. + Sets states and/or makes an action of/on weapon. Reload time is between 0 and 1 inclusive, where 1 is 100% of maximum reloading time. - https://community.bistudio.com/wiki/breakOut + https://community.bistudio.com/wiki/setWeaponReloadingTime - breakOut String - - Anything breakOut String + Object setWeaponReloadingTime Array - breakOut name - - value breakOut name + vehicle setWeaponReloadingTime [gunner, muzzleName, reloadTime] - $Code$scopeName "main"; - while { true } do { - scopeName "loop1"; - while { true } do { - scopeName "loop2"; - if (condition1) then { breakTo "main"}; // Breaks all scopes and return to "main" - if (condition2) then { breakOut "loop2"}; // Breaks scope named "loop2" - sleep 1; - }; - sleep 1; - };$/Code$ - - $Code$call { - scopeName "main"; - call { - 123 breakOut "main" - }; - 345 - }; // call returns 123$/Code$ + $Code$_done = _vehicle setWeaponReloadingTime [ gunner ( vehicle player ), currentMuzzle ( gunner ( vehicle player )), 0.5];$/Code$ undefined / undefined - (19 Aug, 2008) - When "name" is nil, the command is ignored. - When "name" is an undefined scope name or "", the script quits current scope. - $Code$if (true) then { - hint "1"; - breakOut nil; - hint "2"; - }; //result "2" - if (true) then { - hint "1"; - breakOut ""; - hint "2"; - }; //result "1" - if (true) then { - hint "1"; - breakOut "dskfhdsklfh"; - hint "2"; - }; //result "1" - $/Code$ + (January 15, 2012) + The description is confusing to me. What the command essential does is to set the reloading state/time of the given weapon. For example you can fire a missile, and make the weapon available to fire again instantly if you apply 0. + Or you can delay or stop the reload event indefinitely. The 0-1 range is a percentage - the reload time is taken from the weapons's config value (either reloadTime or magazineReloadTime - not sure). The effect is one time only each - it does not modify the weapon's general reload time. + Works also for infantry weapons - probably useful weapons with longer reload time like sniper weapons or launchers: + player setWeaponReloadingTime [player,currentWeapon player,0]; + No idea what's point of the return value. - (August 27, 2015) - breakOut can still be used if multiple scopes share identical names. It will simply break out of the nearest scope that matches the name parameter you've used. For example: - $Code$call { - scopeName "Main"; //Parent Main - call { - scopeName "Main"; //Child Main - "String" breakOut "Main"; //Will break out of child main and return "String" to parent main - }; + (May 14, 2017) + Note that setWeaponReloadingTime is only having effect on a current weapon state (loaded projectile) so since the projectile is fired the next one will be reverted to a weapon config defaults. To keep the fire rate speed changed over time, use this code: + $Code$player addEventHandler ["FiredMan",{ + params ["","_weapon","_muzzle"]; + private _type = _weapon call BIS_fnc_itemType; + private _time = -1; + switch (_type select 1) do { + case 'SniperRifle' : {_time = 0.5}; + case 'AssaultRifle' : {}; + case 'Handgun' : {}; + case 'Rifle' : {}; + case 'SubmachineGun' : {}; + case 'MachineGun' : {}; + case 'Mortar' : {}; + case 'GrenadeLauncher' : {}; + case 'BombLauncher' : {}; + case 'MissileLauncher' : {}; + case 'RocketLauncher' : {}; + case 'Cannon' : {}; + case 'Throw' : {}; }; + if (_time isEqualTo -1) exitWith {}; + (vehicle player) setWeaponReloadingTime [(vehicle player), _muzzle, _time]; + }]; $/Code$ - Therefore you are able to consistently reuse scope names such as "Main", "Child", "Primary", "Secondary", etc throughout functions without worrying about having to ensure you create unique names for each scope. + This Event Handler makes the gun of specific type shoot at a desired rate on each weapon state (sniper rifle will shoot 50% faster in this example). For more information about weapon kinds are there, visit BIS_fnc_itemType. - Nothing - Anything + Boolean + - breakTo + enableDynamicSimulation - Breaks block to scope named name. Nil is returned. - Scope name can be assigned using scopeName command. + Enables or disables Arma_3_Dynamic_Simulation for given non AI object - https://community.bistudio.com/wiki/breakTo + https://community.bistudio.com/wiki/enableDynamicSimulation - breakTo String + Object/Group enableDynamicSimulation Boolean - breakTo name + object enableDynamicSimulation enable - $Code$scopeName "main"; - while { true } do { - scopeName "loop1"; - while { true } do { - scopeName "loop2"; - if (condition1) then { breakTo "main"}; // Breaks all scopes and return to "main" - if (condition2) then { breakOut "loop2"}; // Breaks scope named "loop2" - sleep 1; - }; - sleep 1; - };$/Code$ + $Code$_myObject enableDynamicSimulation true ;$/Code$ undefined / undefined - (May 18, 2017) - This command can not be used to re-execute scopes in which command is inside of. Example: - $Code$scopeName "whatever"; - if true then { - breakTo "whatever" - }; - $/Code$ - The example above will not make the engine jump back to line 1 and re-execute the 2nd line. Instead, it will just jump across line 2 to line 5 if it [ line 5 ] exists. - Nothing + Nothing + - briefingName + preprocessFile - Returns the name of the current briefing/scenario name. + Reads and processes the content of the specified file. Preprocessor is C-like, supports comments using // or /* and */ and PreProcessor Commands. Due to the hard-drive access this command executes (and the lack of caching) this command should not be used in time-critical script loops. - https://community.bistudio.com/wiki/briefingName + https://community.bistudio.com/wiki/preprocessFile - briefingName + preprocessFile String - briefingName + preprocessFile fileName - $Code$_name = briefingName ;$/Code$ + $Code$_content = preprocessFile "myFunction.sqf";$/Code$ undefined / undefined + (March 4, 2008) + File path is always relative to mission directory. If script dir\a.sqf includes dir\b.sqf, use "dir\b.sqf" and not "b.sqf". + + (July 8, 2011) + Use preprocessFileLineNumbers instead as it provides more context information on error. + + (December 17, 2013) + The main difference between preprocessFile and preprocessFileLineNumbers is that the latter adds #line directive to the target file, which allows to log the __LINE__ error happened at and the __FILE__ error happened in. + + (July 25, 2014) + Essentially what the preprocessFile command does is it refers to the contents of a file as a string: + Example 1: + boop.html: + $Code$ t align = 'center' valign = 'middle' shadow = '0' size = '2' structured text /t $/Code$ + init.sqf: + $Code$_text = parseText preprocessFile "boop.html"; + hint _text; + $/Code$ + This is especially useful for long strings, and it works on files with any file extension as long as they can be edited with a text editor. + Example 2: + init.sqf: + $Code$ hint preprocessFile "description.ext"; + copyToClipboard preprocessFile "mission.sqm"; + $/Code$ + The above is all valid. However, using *.jpg or any other files saved in an image format is not possible. - String + String + - buildingExit + menuClear - Returns the given indexed exit in a building. The returned value is in format Position. + Removes all entries from given menu strip. - https://community.bistudio.com/wiki/buildingExit + https://community.bistudio.com/wiki/menuClear - Object buildingExit Number + menuClear Number - building buildingExit index + menuClear idc - $Code$_building buildingExit 0$/Code$ - + undefined / undefined - Array + Nothing + - buildingPos + getAnimAimPrecision - Returns PositionAGL of a given indexed position in a building. The index is 0-based (i.e. the first possible position would be 0. So if a building has 5 positions listed in the editor, 4 would be the highest position index usable with this command). Command will return [0,0,0] if buildingPos with given index is non-existent. - Since Arma 3 v.155.133934 if index -1 is supplied, the command will return array with all available positions. + Returns aim precision for current animation - https://community.bistudio.com/wiki/buildingPos + https://community.bistudio.com/wiki/getAnimAimPrecision - Object buildingPos Number + getAnimAimPrecision Object - building buildingPos index + getAnimAimPrecision unit - $Code$_soldier setPosATL (_house1 buildingPos 2);$/Code$ - - $Code$_allpositions = nearestBuilding player buildingPos -1;$/Code$ + $Code$getAnimAimPrecision player;$/Code$ - global / undefined + undefined / undefined - (August 2, 2006) - Notes from before the conversion: - These examples will move a unit to the 1st position specified in a buildings model, in the second example - bunker1. - $Code$this move (building buildingPos 1); - this move (bunker1 buildingPos 1);$/Code$ - In the default game buildings, the buildingPos is usually right behind a window. This can make it easy to place units in the windows of buildings, by putting the unit near a building and putting this in its init field: - $Code$this setPosATL (( nearestBuilding this) buildingPos 1);$/Code$ - The location returned by buildingPos is not reliable after the player has exited and then resumed the mission. For code that is executed immediately after the mission starts there is no problem. - If buildingPos locations are to be accessed during the mission when the player may have exited and then resumed, save the locations you require at the start of the mission and use these saved locations in your subsequent scripts. - - (January 26, 2007) - The highest index is not necessarily the highest position in a building! Check the z-value to find out the absolute height of a position. - - (February 16, 2007) - (building buildingPos 1) will return [0,0,0] if buildingPos with this index does not exist. - - (January 08, 2011) - Almost all buildings loose their building positions when they get (visually) damaged or destroyed. Some debris do still have building positions though. So it is no technical limitation. Just most damaged/destructed buildings models do not (yet?) have building positions. Keep in mind that a damaged or destroyed building is a different object instance (and model). - Array + Number + - buttonAction + setIdentity - Return the action assigned to a control of the currently active user dialog. Can be used for buttons and active texts. Read Dialog Control for more information about user dialogs and controls. + Set identity of person. + Identities are defined in Description.ext of the mission or campaign. For a list of available faces, glasses and speakers check Category:CfgIdentities. - https://community.bistudio.com/wiki/buttonAction + https://community.bistudio.com/wiki/setIdentity - buttonAction Number - - buttonAction Control + Object setIdentity String - buttonAction idc - - buttonAction control + person setIdentity identity - $Code$buttonSetAction [100, {player exec "reply.sqs"}] - _action = buttonAction 100 - returns {player exec "reply.sqs"}$/Code$ + $Code$_soldier1 setIdentity "MyLittleSoldier";$/Code$ - local / undefined + undefined / undefined + (August 28, 2013) + For ArmA3 the definition format in the Description.ext file is: + class CfgIdentities + { + class MyLittleSoldier + { + name = "Givens"; + nameSound = "Givens"; + face="WhiteHead_06"; + glasses="None"; + speaker="Male05ENG"; + pitch=1.1; + }; + }; + nameSound can be any preset BIS recorded name value. By default units will be called out in voice by their number. By using nameSound you can call them out by name using the following values: + Default: + Armstrong + Nichols + Tanny + Frost + Lacey + Larkin + Kerry + Jackson + Miller + McKendrick + Levine + Reynolds + BLUFOR: + Adams + Bennett + Campbell + Dixon + Everett + Franklin + Givens + Hawkins + Lopez + Martinez + O'Connor + Ryan + Patterson + Sykes + Taylor + Walker + OPFOR: + Amin + Masood + Fahim + Habibi + Kushan + Jawadi + Nazari + Siddiqi + Takhtar + Wardak + Yousuf + INDEPENDENT: + Anthis + Costa + Dimitirou + Elias + Gekas + Kouris + Leventis + Markos + Nikas + Nicolo + Panas + Petros + Rosi + Samaras + Stavrou + Thanos + Vega + CODE NAMES: + Ghost + Stranger + Fox + Snake + Razer + Jester + Nomad + Viper + Korneedler + face can be any of the following: + AfricanHead_01 + AfricanHead_02 + AfricanHead_03 + AsianHead_A3_01 + AsianHead_A3_02 + AsianHead_A3_03 + GreekHead_A3_01 + GreekHead_A3_02 + GreekHead_A3_03 + GreekHead_A3_04 + GreekHead_A3_05 + GreekHead_A3_06 + GreekHead_A3_07 + GreekHead_A3_08 + GreekHead_A3_09 + PersianHead_A3_01 + PersianHead_A3_02 + PersianHead_A3_03 + NATOHead_01 + WhiteHead_02 + WhiteHead_03 + WhiteHead_04 + WhiteHead_05 + WhiteHead_06 + WhiteHead_07 + WhiteHead_08 + WhiteHead_09 + WhiteHead_10 + WhiteHead_11 + WhiteHead_12 + WhiteHead_13 + WhiteHead_14 + WhiteHead_15 + speaker can be any of the following: + Male01ENG + Male01ENGB + Male01GRE + Male01PER + Male02ENG + Male02ENGB + Male02GRE + Male02PER + Male03ENG + Male03ENGB + Male03GRE + Male03PER + Male04ENG + Male04ENGB + Male04GRE + Male05ENG + Male06ENG + Male07ENG + Male08ENG + Male09ENG + In ArmA 3 1.04+ these settings can also be set individually without description.ext editing by using the following commands: setFace, setName, setNameSound, setSpeaker, setPitch + + (August 4, 2006) + Notes from before the conversion: + The definition format in the Description.ext file is: + class CfgIdentities + { + class John_Doe + { + name = "John Bartholemew Doe"; + face = "Face20"; + glasses = "None"; + speaker = "Dan"; + pitch = 1.1; + }; + }; + In Operation Flashpoint, + Name can be any string. + Face can take any of the following values: + Male: "Face1"... to "Face52", "Face99" & "FaceR01" to "Face R04" + Female: "Eva", "Kamila", "Lada", "Lucie", "Marketa" & "Nada" + Glasses can take the following values: "None", "Spectacles" & "Sunglasses" + Speaker determines which voice is used and can take any of the following values: + "Adam" + "Dan" + "George" + "Greg" + "John" + "Jonah" + "Marc" + "Patrick" + "Paul" + "Peter" + "Rich" + "Rob" + "Ted" + "Tom" + "Nikolai" + "Vitaliy" + "Sergey" + "Oleg" + "Ruslan" + "Aleksei" + "Andrei" + "Boris" + "Georgiy" + "Vadim" + "Vladimir" + "Ivan" + Pitch sets the tone of voice. 1.0 for normal; 1.0 for deep; 1.0 for high pitched + + (November 18, 2006) + Preview of all faces in Armed Assault can be found on Czech Biki + + (May 10, 2008) + Glasses and Female faces do not work as of Arma patch 1.12beta. - String - String + Nothing + - buttonSetAction + velocityModelSpace - Set the action of a control of the currently active user dialog. Can be used for buttons and active texts. See Dialog Control for more information about user dialogs. Works with: - CT_BUTTON - CT_XBUTTON - CT_ACTIVETEXT - CT_SHORTCUTBUTTON - The action code is expected to be in SQS format + Returns the velocity (speed vector) of the vehicle as an array with format [x, y, z]. Vector is in model space. - https://community.bistudio.com/wiki/buttonSetAction + https://community.bistudio.com/wiki/velocityModelSpace - buttonSetAction Array - - Control buttonSetAction String + velocityModelSpace Object - buttonSetAction [idc, action] - - control buttonSetAction action + velocityModelSpace vehicle - $Code$buttonSetAction [100, " player exec ""reply.sqs"""];$/Code$ - - $Code$_ctrl buttonSetAction " if ( alive bob) then { hint 'alive'} else { hint 'dead'}"; // SQF but SQS compatible, see SQS$/Code$ + $Code$velocityModelSpace _chopper; + comment "Returns [X (left(-) right(+)), Y (backward(-) forward(+)), Z (down(-) up(+))]";$/Code$ - local / local + undefined / undefined - (October 5, 2009) - When using buttonSetAction for an ActiveText control from a script, you cannot use any variables local to the script in it. - /* This will print 'any bar' in the hint box, - since _foo has no value according to buttonSetAction */ - _foo = "foo"; - buttonSetAction [100, "hint format[""%1 bar"", _foo];"]; - - (February 15, 2016) - This command does not overwride the buttonaction which was set via "action" in the hpp of the dialog + (December 11, 2014) + This function is useful for helicopters as it returns Z vector like an indicator of thrust/load ratio. More or less climb (+) or descent (-) tendency but: + As X,Y,Z vectors are relative to vehicle attitude, this function doesn't return a climb or descend rate (as the attitude of the vehicle can be far from horizontal). You can get negative Z vector, in jets, while climbing fast, peeling off in the sky! + More or less, you can use as a Z accelerometer factor but invert the sign: +G acceleration (negative vector below the jet) is -Z here. + If not "physically" correct, the behavior is sufficient enough for Arma flight model. - (June 11, 2016) - To use variables local to the defining script, a syntax like the one below needs to be used: - $Code$_foo = "foo"; - buttonSetAction [100, format["hint '%1 bar'", _foo]]; - $/Code$ - works! thanks to Kronzky for commenting this workaround in the VBS wiki + (June 21, 2015) + Previous note is physically incorrect. Velocity can not be used to give information about Thrust/Load ratio or G-Forces/acceleration. To get acceleration you have to create the derivative of velocity after time dv/dt - the difference of velocity between 2 timesteps divided by the time that passed between the 2 steps. - Nothing - Nothing + Array + - cadetMode + importAllGroups - Returns if the player is currently playing in cadet or veteran mode. + Imports all groups into the RTE. + i + Some Old Editor Command - https://community.bistudio.com/wiki/cadetMode + https://community.bistudio.com/wiki/importAllGroups - cadetMode + importAllGroups Control - cadetMode + importAllGroups map - $Code$? ( cadetMode ) : _AIsoldier setSkill 0.1 //sqs$/Code$ - - $Code$if ( cadetMode ) then {_AIsoldier setSkill 0.1}; //sqf$/Code$ - + undefined / undefined - (December 1, 2009) - In ArmA II, this command will return true if the difficulty level is set to "Recruit" or "Regular". It returns false for the "Veteran" and "Expert" difficulty levels. - Boolean + Nothing + - callExtension + menuData - Calls custom.dll also known as Extension. The name of the extension is the name of the extension.dll without ".dll" part (or without "_x64.dll" part on 64-bit Arma). For example if the file is 'myExtension.dll' the name of the extension will be "myExtension". For 64-bit extensions, the name of the extension doesn't need to change and is still "myExtension". The game will automatically look for 'myExtension_x64.dll' when you use 64-bit Arma exe. - This command is blocking, meaning that the game will wait for the extension to return before continuing. This may cause FPS drop if extension is not optimised. If extension takes too long, consider making asynchronous extension, where the result of the work of the extension is collected in a separate call. - Currently there is no limit how much data you can send to the extension. However there is a limit on how much data you can return from extension in one call. The limit is known to the extension and is passed in int outputSize. The limit may or may not change in the future and is currently 10240 bytes. It is up to extension designer to handle multipart results if returned data exceeds output limit. - Since Arma 3 v1.67 it is possible to pass array of arguments to extensions. The array of arguments could be anything and all elements will be converted to strings, however you might want to only send simple types like Booleans, Strings, Numbers and Arrays of all of the above. There is currently a limit on how many arguments can be sent and it is 1024. However an argument could be an Array itself, in this case extension maker will have to provide additional methods for parsing such arguments. - Possible error codes: - 101: SYNTAX_ERROR_WRONG_PARAMS_SIZE - 102: SYNTAX_ERROR_WRONG_PARAMS_TYPE - 201: PARAMS_ERROR_TOO_MANY_ARGS - 301: EXECUTION_WARNING_TAKES_TOO_LONG - Each error will have entry in.rpt file with more details. - Since Arma 3 v1.69, RVExtensionVersion interface (see source code example below) has been added, which is called by the engine on extension load and expects extension version. This interface is designed to work with both, Linux and Windows. The max buffer size is 32 bytes. The version information will then appear in. rpt file like so: - $Code$19:06:36 CallExtension loaded: test_extension (.\test_extension.dll) [1.0.0.1]$/Code$ - For more information see Extensions. + Returns data stored in menu entry on given path. - https://community.bistudio.com/wiki/callExtension + https://community.bistudio.com/wiki/menuData - String callExtension String - - String callExtension Array + menuData Array - extension callExtension function - - extension callExtension [function, arguments] + menuData [idc, path] - $Code$_return = "myExtension" callExtension "stringToBeParsed";$/Code$ - - $Code$_result = "test_extension" callExtension str weapons player ; - _result = "test_extension" callExtension ["fnc1", getUnitLoadout player ]; - _result = "test_extension" callExtension ["fnc2", magazinesAmmoFull player ]; - _result = "test_extension" callExtension ["fnc1", [ weapons player, magazines player ]];$/Code$ - - $Code$_result = "test_extension" callExtension ["fnc1", [1,"two", true,[4,"five", false ]]]; - parseSimpleArray (_result select 0) params ["_number","_string","_boolean","_array"]; - systemChat str [_number,_string,_boolean,_array]; - // Source Code ( Download.dll ) - //This is an example of an extension compatible with both syntaxes. When using 1st syntax, the data is just copied from input to output. When using alt syntax, the arguments are parsed and then assembled back into string array in 2 ways: fnc1 and fnc2. fnc1 is a fraction faster. - //#include string - //#include vector - //#include iterator - //#include sstream - //#define CURRENT_VERSION "1.0.0.1" - //extern "C" - //{ - ////--- Engine called on extension load - //__declspec ( dllexport ) void __stdcall RVExtensionVersion ( char * output, int outputSize ) ; - ////--- STRING callExtension STRING - //__declspec ( dllexport ) void __stdcall RVExtension ( char * output, int outputSize, const char * function ) ; - ////--- STRING callExtension ARRAY - //__declspec ( dllexport ) int __stdcall RVExtensionArgs ( char * output, int outputSize, const char * function, const char ** args, int argsCnt ) ; - //} - ////--- Extension version information shown in.rpt file - //void __stdcall RVExtensionVersion ( char * output, int outputSize ) - //{ - ////--- max outputSize is 32 bytes - //strncpy_s ( output, outputSize, CURRENT_VERSION, _TRUNCATE ) ; - //} - ////--- name callExtension function - //void __stdcall RVExtension ( char * output, int outputSize, const char * function ) - //{ - //std :: string str = function ; - //strncpy_s ( output, outputSize, ( "Input Was: " + str ). c_str ( ), _TRUNCATE ) ; - //} - ////--- name callExtension [function, args] - //int __stdcall RVExtensionArgs ( char * output, int outputSize, const char * function, const char ** args, int argsCnt ) - //{ - //if ( strcmp ( function, "fnc1" ) == 0 ) - //{ - ////--- Manually assemble output array - //int i = 0 ; - //std :: string str = "[" ; - ////--- Each argument can be accessed via args[n] - //if ( argsCnt 0 ) - //str + = args [ i ++ ] ; - //while ( i argsCnt ) - //{ - //str + = "," ; - //str + = args [ i ++ ] ; - //} - //str + = "]" ; - ////--- Extension result - //strncpy_s ( output, outputSize, str. c_str ( ), _TRUNCATE ) ; - ////--- Extension return code - //return 100 ; - //} - //else if ( strcmp ( function, "fnc2" ) == 0 ) - //{ - ////--- Parse args into vector - //std :: vector std :: string vec ( args, std :: next ( args, argsCnt ) ) ; - //std :: ostringstream oss ; - //if ( ! vec. empty ( ) ) - //{ - ////--- Assemble output array - //std :: copy ( vec. begin ( ), vec. end ( ) - 1, std :: ostream_iterator std :: string ( oss, "," ) ) ; - //oss vec. back ( ) ; - //} - ////--- Extension result - //strncpy_s ( output, outputSize, ( "[" + oss. str ( ) + "]" ). c_str ( ), _TRUNCATE ) ; - ////--- Extension return code - //return 200 ; - //} - //else - //{ - //strncpy_s ( output, outputSize, "Avaliable Functions: fnc1, fnc2", outputSize - 1 ) ; - //return - 1 ; - //} - //}$/Code$ - + undefined / undefined - String - Array + String + - call + overcast - Executes given set of compiled instructions with an option to pass arguments to the executed Code. In OFP this command used to accept String for the code. + Return the current overcast level. Zero is clear skies, one is maximum cloud cover. - https://community.bistudio.com/wiki/call + https://community.bistudio.com/wiki/overcast - call Code - - Anything call Code + overcast - call code - - args call code + overcast - $Code$call { hint str 123};$/Code$ - - $Code$123 call { hint str _this};$/Code$ - - $Code$_sum = [1, 2] call {(_this select 0) + (_this select 1)}; - hint str _sum; //3$/Code$ - - $Code$123 call compile " hint str _this";$/Code$ - - $Code$_result = 123 call compile preprocessFileLineNumbers "myfile.sqf";$/Code$ + $Code$_cloudLevel = overcast$/Code$ undefined / undefined - (July 5, 2014) - A called function may only use suspension ( sleep, uiSleep, waitUntil ) if it originates in a scheduled environment. If the called function originates in a non-scheduled environment it will return a generic error. - $Code$// *** non-scheduled origin *** - [] spawn { - // *** scheduled scope *** - [] call { - // *** scheduled scope *** - sleep 3; // - OK - hintSilent "Hello World!"; - }; - }; - $/Code$ - $Code$// *** non-scheduled origin *** - [] call { - // *** non-scheduled scope*** - [] call { - // *** non-scheduled scope *** - sleep 3; // - NOT OK - hintSilent "Hello World!"; - }; - }; - $/Code$ - $Code$// *** scheduled origin *** - [] spawn { - // *** scheduled scope *** - [] call { - // *** scheduled scope *** - sleep 3; // - OK - hintSilent "Hello World!"; - }; - }; - $/Code$ - $Code$// *** scheduled origin *** - [] call { - // *** scheduled scope*** - [] call { - // *** scheduled scope *** - sleep 3; // - OK - hintSilent "Hello World!"; - }; - }; - $/Code$ - - (February 17, 2015) - If the code is in non-scheduled scope and contains while-do statement, the code runs only 10,000 times at the maximum, even if the statement makes infinite loop. (ARMA3 Ver. 1.38.128937) - $Code$// *** non-scheduled origin *** - [] call { - // *** non-scheduled scope*** - [] call { - // *** non-scheduled scope *** - _a=0; - while{_a 15000} do{ - _a=_a+1; - }; - hint str(_a);//10000 - }; - };$/Code$ - Anything - Anything + Number + - camCommand + copyToClipboard - Executes a command on the given camera / actor object. Known commands for: - All camera types - "manual on", "manual off" - "camera" - "inertia on", "inertia off" - "seagull" - "landed", "airborne" - When you execute camCommand "landed" on a flying seagull, it will land and sit on the floor until you call camCommand "airborne". The camCommand changes are conducted immediately, the command doesn't wait for camCommit. + Copy text string to the clipboard. + In MP available only on the client that is server - https://community.bistudio.com/wiki/camCommand + https://community.bistudio.com/wiki/copyToClipboard - Object camCommand String + copyToClipboard String - camera camCommand command + copyToClipboard text - $Code$_camera camCommand "manual on";$/Code$ + $Code$copyToClipboard str _data;$/Code$ - local / local + undefined / undefined - (May 23, 2017) - In Arma 3 with the addition of the curator camera type, the following commands are supported: - $Code$_camera = "CamCurator" camCreate [0,0,0]; - _camera camCommand "maxPitch 89"; - _camera camCommand "minPitch -89"; - _camera camCommand "speedDefault 0.1"; - _camera camCommand "speedMax 2"; - _camera camCommand "ceilingHeight 5000"; - _camera camCommand "atl off"; - _camera camCommand "surfaceSpeed off"; + (October 12, 2014) + To add a line break in output text do this: + $Code$_br = toString [13,10];//(carriage return & line feed) + _string = "Line 1" + _br + "Line 2"; + copyToClipboard _string; $/Code$ + Paste into text editor of choice, you get: + $Code$Line 1 + Line 2$/Code$ + (A3 1.30 Stable executed inside.sqf via execVM ) - Nothing + Nothing + - camCommitPrepared + cos - Smoothly conduct the changes that were assigned to a camera within the given time. If the time is set to zero, the changes are done immediately. + Cosine of a number, argument in degrees. - https://community.bistudio.com/wiki/camCommitPrepared + https://community.bistudio.com/wiki/cos - Object camCommitPrepared Number + cos Number - camera camCommitPrepared time + cos x - $Code$//create a camera object - _cam = "camera" camCreate [5600,4800,10]; - _cam camPrepareTarget player ; - _cam cameraEffect ["internal", "BACK"]; - _cam camCommitPrepared 0; - //smoothly move the camera to its new position in 6 seconds. - _cam camPreparePos [5680,4720,20]; - _cam camCommitPrepared 6; - waitUntil { camCommitted _cam}; - //proceed$/Code$ + $Code$cos 60;//returns 0.5$/Code$ - local / local + undefined / undefined + (August 8, 2006) + Be aware that there might be rounding errors in the results of this command. + cos 90 + for example doesn't return the expected '0', but '-4.37114e-008'. So, if you want to compare results of Cosinus, don't use the compare operator + (cos 90)==0 + but rather use less than. + (cos 90) 0.00001 - Nothing + Number + - camCommitted + fuel - Checks if the conduction of the last camCommit call already finished. + Checks how much fuel is left in the gas tank of a vehicle. - https://community.bistudio.com/wiki/camCommitted + https://community.bistudio.com/wiki/fuel - camCommitted Object + fuel Object - camCommitted camera + fuel vehicle - $Code$// SQS: - ; create a camera object - _cam = "camera" camCreate [5600,4800,10] - _cam camSetTarget player - _cam cameraEffect ["internal", "BACK"] - _cam camCommit 0 - ; smoothly move the camera to its new position in 6 seconds - _cam camSetPos [5680,4720,20] - _cam camCommit 6 - @ camCommitted _cam - ; proceed$/Code$ + $Code$if ( fuel vehicle player == 0) then { hint "The vehicle is out of fuel!"};$/Code$ - undefined / undefined + global / undefined + Vehicles refuelled in game with the Fuel trucks e.t.c never get completely refuelled. After refuelling, rather than returning a value of 1 when the fuel command is called. They return a value greater than 0.98 and less than 1. - Boolean + Number + - camCommit + setDetailMapBlendPars - Smoothly conduct the changes that were assigned to a camera within the given time. If the time is set to zero, the changes are done immediately. + Sets the detail texture map blend pars. Allows for smooth transition between detailed and undetailed terrain texture at distance. If noDetail fullDetail, the texture detail will incur smooth transition in the area between the thresholds. If noDetail = fullDetail there will be obvious visible edge between texture detail changes at fullDetail distance. - https://community.bistudio.com/wiki/camCommit + https://community.bistudio.com/wiki/setDetailMapBlendPars - Object camCommit Number + setDetailMapBlendPars Array - camera camCommit time + setDetailMapBlendPars [fullDetail, noDetail] - $Code$// SQS - ; create a camera object - _cam = "camera" camCreate [5600,4800,10] - _cam camSetTarget player - _cam cameraEffect ["internal", "BACK"] - _cam camCommit 0 - ; smoothly move the camera to its new position in 6 seconds - _cam camSetPos [5680,4720,20] - _cam camCommit 6 - @ camCommitted _cam - ; proceed$/Code$ + $Code$setDetailMapBlendPars [20, 50];$/Code$ - $Code$// SQF - private "_cam"; - comment "create a camera object"; - _cam = "camera" camCreate [ position player select 0, position player select 1, 2]; - _cam camSetTarget player ; - _cam cameraEffect ["internal", "BACK"]; - _cam camCommit 0; - comment "smoothly move the camera to its new position in 6 seconds"; - _cam camSetPos [ position player select 0, ( position player select 1) + 10, 20]; - _cam camCommit 6; - waitUntil { camCommitted _cam; };$/Code$ + $Code$setDetailMapBlendPars ( if ( currentWeapon player in [ + "Binocular", + "Rangefinder", + "Laserdesignator" + ]) then [ + {[300,600]}, + {[20,50]} + ]);$/Code$ - local / local + undefined / local - Nothing + Nothing + - camConstuctionSetParams + setFSMVariable - Sets construction camera parameters. To work with "camconstruct" object. + Set variable to given value in the variable space of given FSM. + The FSM handle is the number returned by the execFSM command. - https://community.bistudio.com/wiki/camConstuctionSetParams + https://community.bistudio.com/wiki/setFSMVariable - Object camConstuctionSetParams Array + Number setFSMVariable Array - camera camConstuctionSetParams [[x,y,z], radius, maxAboveLand] + handle setFSMVariable [name, value] - $Code$_camera camConstuctionSetParams [ getPos player, 50, 20];$/Code$ + $Code$_handle = execFSM "test.fsm"; + _handle setFSMVariable ["_foo", 23]; + + // sets variable _foo in the FSM to 23$/Code$ undefined / undefined + (March 23, 2014) + If the variable is not yet defined within the FSM it will be created. - Nothing + Nothing + - camCreate + isAutonomous - Create a camera or a seagull object on the given position. Also other objects can be created this way, but vehicles created with camCreate cannot be entered. Any units created with camCreate will remain static. Differently to createVehicle, objects are created without consideration of the collision detection with surrounding objects, thus the objects are spawned exactly at the given position. camCreate is conducted immediately, the command doesn't wait for camCommit. + Returns true if UAV is in autonomous mode. - https://community.bistudio.com/wiki/camCreate + https://community.bistudio.com/wiki/isAutonomous - String camCreate Array + isAutonomous Object - type camCreate position + isAutonomous uav - $Code$_cam = "camera" camCreate ( position player )$/Code$ + $Code$bool = isAutonomous uav;$/Code$ - undefined / local + global / undefined - (August 3, 2006) - Notes from before the conversion: - (CWR 1.91) createVehicle is a valid replacement (with special consideration to locality). - You can also use camCreate to create objects. - $Code$flare1 = "flare" camCreate getPos gameLogic_1$/Code$ - However, soldier units created in this way have little or no AI. - Object + Boolean + - camDestroy + airplaneThrottle - Destroy an object created with camCreate. camDestroy is conducted immediately, the command doesn't wait for camCommit. - NOTE: Destroying camera object does not terminate camera effect automatically. + Returns throttle position. Works only on player's vehicle. - https://community.bistudio.com/wiki/camDestroy + https://community.bistudio.com/wiki/airplaneThrottle - camDestroy Object + airplaneThrottle Object - camDestroy object + airplaneThrottle airplane - $Code$camDestroy _cam;$/Code$ - - $Code$_cam cameraEffect ["terminate","back"]; - camDestroy _cam;$/Code$ + $Code$_trottle = airplaneThrottle myPlane$/Code$ - local / local + undefined / undefined - Nothing + Number + - camPreloaded + setPylonLoadOut - Checks whether the camera has finished preloading. + Will add missile to vehicle pylon, TransportPylonsComponent in config is required - https://community.bistudio.com/wiki/camPreloaded + https://community.bistudio.com/wiki/setPylonLoadOut - camPreloaded Object + Object setPylonLoadOut Array - camPreloaded camera + vehicle setPylonLoadOut [pylon nameindex, magazine name, forced, turret] - $Code$?(camPreloaded _camera) : exit$/Code$ + $Code$( vehicle player ) setPylonLoadOut ["pylon1", ""];$/Code$ undefined / undefined @@ -7528,56 +7864,110 @@ - Boolean + Boolean + - camPreload + logEntities - Preload the scene for the prepared camera. Time gives timeout, zero means no (infinite) timeout. + Creates a log file containing the list of all game entities in scene. + File is created in the same directory as.rpt file. + Special: BattlEye's RCON variant of this command is #logEntities (see also Multiplayer_Server_Commands ) - https://community.bistudio.com/wiki/camPreload + https://community.bistudio.com/wiki/logEntities - Object camPreload Number + logEntities - camera camPreload time + logEntities - $Code$_camera camPreload 5$/Code$ + $Code$logEntities ;$/Code$ undefined / undefined + File name example: + logEntities_4688_12-04-2014_12-19-39.log + File content example: + ====================== Vehicles ======================= + Loc:1, ForDel:0, Dstr:0, DmgDstr:0, DmgDead:0, Sim:1, Inv: 0, AnyPl:1, Out: 0, NetID:2:3, Pos: [2476.243896][73.782043], N:B_Soldier_F + Loc:1, ForDel:0, Dstr:0, DmgDstr:0, DmgDead:0, Sim:1, Inv: 0, AnyPl:0, Out: 0, NetID:0:0, Pos: [2471.500977][62.477680], N:Snake_random_F + Loc:1, ForDel:0, Dstr:0, DmgDstr:0, DmgDead:0, Sim:1, Inv: 0, AnyPl:0, Out: 0, NetID:0:0, Pos: [2489.192383][73.935181], N:Snake_random_F + Loc:1, ForDel:0, Dstr:0, DmgDstr:0, DmgDead:0, Sim:1, Inv: 0, AnyPl:0, Out: 0, NetID:0:0, Pos: [2487.953857][73.828362], N:Snake_random_F + Loc:1, ForDel:0, Dstr:0, DmgDstr:0, DmgDead:0, Sim:1, Inv: 0, AnyPl:0, Out: 0, NetID:0:0, Pos: [2800.174805][96.234093], N:Rabbit_F + Loc:1, ForDel:0, Dstr:0, DmgDstr:0, DmgDead:0, Sim:1, Inv: 0, AnyPl:0, Out: 0, NetID:0:0, Pos: [2825.378418][2.068635], N:Rabbit_F + Loc:1, ForDel:0, Dstr:0, DmgDstr:0, DmgDead:0, Sim:1, Inv: 0, AnyPl:0, Out: 0, NetID:0:0, Pos: [2888.919434][6.837101], N:Rabbit_F + Loc:1, ForDel:0, Dstr:0, DmgDstr:0, DmgDead:0, Sim:1, Inv: 0, AnyPl:0, Out: 0, NetID:0:0, Pos: [2910.756104][16.089361], N:Rabbit_F + Loc:0, ForDel:0, Dstr:0, DmgDstr:0, DmgDead:0, Sim:1, Inv: 1, AnyPl:0, Out: 0, NetID:2:0, Pos: [9.000000][9.000000], N:Logic + Total objects: 9 + Statistics objects: 9 + IsLocal: 8 + IsMarkedToDelete: 0 + IsDestroyed: 0 + IsDamageDestroyed: 0 + IsDamageDead: 0 + IsNotSimulated: 9 + IsVisible: 1 + IsAnyPlayer: 1 + IsOutsideMap: 0 + =================== Slow vehicles ===================== + Total objects: 214 + Statistics objects: 0 + Static objects are accounted in total object count but not included in statistics + IsLocal: 0 + IsMarkedToDelete: 0 + IsDestroyed: 0 + IsDamageDestroyed: 0 + IsDamageDead: 0 + IsNotSimulated: 0 + IsVisible: 0 + IsAnyPlayer: 0 + IsOutsideMap: 0 + =================== Out vehicles ==================== + Loc:1, ForDel:0, Dstr:0, DmgDstr:0, DmgDead:0, Sim:1, Inv: 0, AnyPl:0, Out: 0, NetID:2:1, Pos: [2476.243896][73.782043], N:Supply40 + Loc:1, ForDel:0, Dstr:0, DmgDstr:0, DmgDead:0, Sim:1, Inv: 0, AnyPl:0, Out: 0, NetID:2:2, Pos: [2476.243896][73.782043], N:Supply140 + Total objects: 2 + Statistics objects: 2 + IsLocal: 2 + IsMarkedToDelete: 0 + IsDestroyed: 0 + IsDamageDestroyed: 0 + IsDamageDead: 0 + IsNotSimulated: 2 + IsVisible: 0 + IsAnyPlayer: 0 + IsOutsideMap: 0 - Nothing + Nothing + - camPrepareBank + radioVolume - Prepares the camera bank angle. - This command is non-functional ! + Checks the current radio volume (set by fadeRadio ). - https://community.bistudio.com/wiki/camPrepareBank + https://community.bistudio.com/wiki/radioVolume - Object camPrepareBank Number + radioVolume - camera camPrepareBank bank + radioVolume - $Code$_camera camPrepareBank -0.1$/Code$ + $Code$_volume = radioVolume;$/Code$ undefined / undefined @@ -7585,57 +7975,59 @@ - Nothing + Number + - camPrepareDir + unlinkItem - Prepares the camera heading. - This command is non-functional ! + Unassign and delete existing item from its assigned slot. If item does not exist or is not in the assigned slot, command simply fails. - https://community.bistudio.com/wiki/camPrepareDir + https://community.bistudio.com/wiki/unlinkItem - Object camPrepareDir Number + Object unlinkItem String - camera camPrepareDir direction + unit unlinkItem item - $Code$_camera camPrepareDir 150$/Code$ + $Code$bluforUnit unlinkItem "NVGoggles"; + opforUnit unlinkItem "NVGoggles_OPFOR"; + independentUnit unlinkItem "NVGoggles_INDEP";$/Code$ - undefined / undefined + global / global - Nothing + Nothing + - camPrepareDive + members - Prepares the camera dive angle. - This command is non-functional ! + Return a list of members in given team. - https://community.bistudio.com/wiki/camPrepareDive + https://community.bistudio.com/wiki/members - Object camPrepareDive Number + members Team_Member - camera camPrepareDive dive + members team - $Code$_camera camPrepareDive -0.1$/Code$ + $Code$_members = members _team$/Code$ undefined / undefined @@ -7643,28 +8035,34 @@ - Nothing + Array + - camPrepareFocus + west - focusRange is in format [distance,blur]. Prepares the camera focus blur. - [-1,1] will reset default values (auto focusing), [-1,-1] will disable postprocessing (all is focused). + West side. - https://community.bistudio.com/wiki/camPrepareFocus + https://community.bistudio.com/wiki/west - Object camPrepareFocus Array + west - camera camPrepareFocus focusRange + west - $Code$_camera camPrepareFocus [50, 1]$/Code$ + $Code$// SQS: + ?((side _unit) == west ) : hint "This is a western unit!"$/Code$ + + $Code$// SQF: + if (( side _unit) == west ) then { + hint "This is a western unit!"; + };$/Code$ undefined / undefined @@ -7672,28 +8070,42 @@ - Nothing + Side + - camPrepareFovRange + nearestLocations - Prepares the camera field of view range for auto zooming. - This command is non-functional ! + Returns an array of locations of chosen type(s) within the given radius of the given position, sorted from nearest to farthest. - https://community.bistudio.com/wiki/camPrepareFovRange + https://community.bistudio.com/wiki/nearestLocations - Object camPrepareFovRange Array + nearestLocations Array - camera camPrepareFovRange fovRange + nearestLocations [position, [locationType,], radius, sortPosition] - $Code$_camera camPrepareFovRange [0.1, 0.5]$/Code$ + $Code$_nearbyLocations = nearestLocations [ position player, ["RockArea","VegetationFir"], 100];$/Code$ + + $Code$// Find any of nearest locations: + allLocationTypes = []; + "allLocationTypes pushBack configName _x" configClasses ( + configFile "CfgLocationTypes" + ); + { + systemChat format [ + "%1 (%2) - %3m", + _x, + text _x, + position player distance _x + ]; + } forEach nearestLocations [ player, allLocationTypes, 500];$/Code$ undefined / undefined @@ -7701,27 +8113,28 @@ - Nothing + Array + - camPrepareFov + shownHUD - Prepares the camera field of view (zoom). The default zoom level is 0.75, 0.01 is the nearest and 2 the furthest zoom value. The angle of the field of view is atan(FOV)*2 radians when in 4:3 aspect ratio. Needs the call of camCommitPrepared to be conducted. + Returns array of Booleans corresponding to the visibility of various HUD elements (see extended showHUD ). - https://community.bistudio.com/wiki/camPrepareFov + https://community.bistudio.com/wiki/shownHUD - Object camPrepareFov Number + shownHUD - camera camPrepareFov fieldOfView + shownHUD - $Code$_camera camPrepareFov 0.1$/Code$ + $Code$_hudStatus = shownHUD ;$/Code$ undefined / undefined @@ -7729,27 +8142,32 @@ - Nothing + Array + - camPreparePos + sliderSpeed - Prepares the camera position (format Position ). + Return speed, as an Array [min, max] of slider idc of topmost user dialog. - https://community.bistudio.com/wiki/camPreparePos + https://community.bistudio.com/wiki/sliderSpeed - Object camPreparePos Array - + sliderSpeed Number + + sliderSpeed Control + - camera camPreparePos position + sliderSpeed idc + + sliderSpeed control - $Code$_camera camPreparePos getPos player$/Code$ + $Code$_slidespeed1 = sliderSpeed 105;$/Code$ undefined / undefined @@ -7757,27 +8175,29 @@ - Nothing + Array - Array + - camPrepareRelPos + add3DENEventHandler - Prepares the camera position relative to the current position of the currect target (see camPrepareTarget ). + Add code to be run when a Eden Editor event is triggered. + See the list of all Eden Editor Event Handlers. - https://community.bistudio.com/wiki/camPrepareRelPos + https://community.bistudio.com/wiki/add3DENEventHandler - Object camPrepareRelPos Array + add3DENEventHandler Array - camera camPrepareRelPos position + add3DENEventHandler [type,code] - $Code$_camera camPrepareRelPos [10,5,-2]$/Code$ + $Code$eh = add3DENEventHandler ["onUndo",{ systemChat "Zip..."}];$/Code$ undefined / undefined @@ -7785,33 +8205,29 @@ - Nothing + Number + - camPrepareTarget + emptyPositions - Prepares the camera target to a position or to a target. + Returns the number of given positions in the vehicle. + Positions can be "Commander", "Driver", "Gunner" or "Cargo" - https://community.bistudio.com/wiki/camPrepareTarget + https://community.bistudio.com/wiki/emptyPositions - Object camPrepareTarget Array - - Object camPrepareTarget Object + Object emptyPositions String - camera camPrepareTarget position - - camera camPrepareTarget target + vehicle emptyPositions position - $Code$_camera camPrepareTarget getPos player$/Code$ - - $Code$_camera camPrepareTarget player$/Code$ + $Code$_freeCargoPositions = vehicle player emptyPositions "cargo";$/Code$ undefined / undefined @@ -7819,355 +8235,533 @@ - Nothing - Nothing + Number + - camSetBank + assignItem - Sets camera bank angle. Does not commit changes. - This command is non-functional ! + Assigns existing item from inventory (uniform, vest, backpack) to a correct slot. If the slot is occupied by another item, it gets replaced. - https://community.bistudio.com/wiki/camSetBank + https://community.bistudio.com/wiki/assignItem - Object camSetBank Number + Object assignItem String - camera camSetBank bank + unit assignItem item - $Code$_camera camSetBank -0.1$/Code$ + $Code$bluforUnit addItem "NVGoggles"; + bluforUnit assignItem "NVGoggles"; + opforUnit addItem "NVGoggles_OPFOR"; + opforUnit assignItem "NVGoggles_OPFOR"; + independentUnit addItem "NVGoggles_INDEP"; + independentUnit assignItem "NVGoggles_INDEP";$/Code$ - undefined / undefined + global / global - (Apr 15, 2010) - Command is non-functional. Instead, use fn vbs setPitchBank in VBS2, or setVectorUp or this user function in Arma. - Nothing + Nothing + - camSetDir + tvSetColor - Sets the orientation of the given camera in the direction of the given vector. Needs camCommit. + Sets text color on given Tree View Item - https://community.bistudio.com/wiki/camSetDir + https://community.bistudio.com/wiki/tvSetColor - Object camSetDir Array + tvSetColor Array + + Control tvSetColor Array - camera camSetDir direction + tvSetColor [idc, path, color] + + control tvSetColor [path, color] - $Code$pos1 = player modelToWorld [0,5,5]; - cam = "camera" camCreate pos1; - cam cameraEffect ["INTERNAL", "BACK"]; - pos2 = player modelToWorld [0,50,50]; - cam camSetPos pos2; - cam camSetDir (pos2 vectorFromTo pos1); - cam camCommit 5; - 0 = [] spawn - { - waitUntil { camCommitted cam}; - cam camSetPos pos1; - cam camCommit 5; - };$/Code$ + $Code$tvSetColor [101, [0,0], [1,0,0,1]];$/Code$ + + $Code$_ctrl tvSetColor [[0,0], [1,0,0,1]];$/Code$ - local / local + undefined / undefined - (May 9, 2016) - cameraEffect "INTERNAL" works better than "EXTERNAL" with this command. - Nothing + Nothing - Nothing + - camSetDive + waypointScript - Sets camera dive angle. Does not commit changes. - This command is non-functional ! + Gets the waypoint script. - https://community.bistudio.com/wiki/camSetDive + https://community.bistudio.com/wiki/waypointScript - Object camSetDive Number + waypointScript Array - camera camSetDive dive + waypointScript waypoint - $Code$_camera camSetDive -0.1$/Code$ + $Code$waypointScript [groupOne,1]$/Code$ undefined / undefined - (Apr 15, 2010) - Command is non-functional. Instead, use fn vbs setPitchBank in VBS2, or setVectorUp or this user function in Arma. - Nothing + String + - camSetFocus + globalChat - Sets camera focus range in format [distance, blur]. blur param - sets the camera focus blur. It does not automatically commit changes (see camCommit ). Use [-1, -1] to disable focus completely. + Types text to the global radio channel. The text will be visible only on the PC where command was executed. If you need the message to show on all computers, you have to execute it globally (see remoteExec ) - https://community.bistudio.com/wiki/camSetFocus + https://community.bistudio.com/wiki/globalChat - Object camSetFocus Array + Object globalChat String - camera camSetFocus focusRange + unitName globalChat chatText - $Code$_camera camSetFocus [50, 1];$/Code$ + $Code$_soldierOne globalChat "Show this text";$/Code$ + + $Code$driver vehicle player sideChat "sideChat"; + driver vehicle player globalChat "globalChat"; + driver vehicle player groupChat "groupChat"; + vehicle player vehicleChat "vehicleChat"; + driver vehicle player commandChat "commandChat"; + driver vehicle player customChat [1, "customChat"]; + systemChat "systemChat";$/Code$ - undefined / undefined + global / local + In OFP 1.96, this command can be used by a Game_Logic unit, which will result in the text being displayed on screen without any indication of the side of radio source, or quotation marks. For example : gamelogic1 globalchat "hello world" will create the text hello world in the radio log. - Nothing + Nothing + - camSetFovRange + ctrlParent - Set the zoom level ( F ield O f V iew) start and end values for automatical zooming. - The default zoom level is 0.7 where 0 is the nearest and 1 is the most far zoom value. - This command is non-functional ! + Returns container of the given control. - https://community.bistudio.com/wiki/camSetFovRange + https://community.bistudio.com/wiki/ctrlParent - Object camSetFovRange Array + ctrlParent Control - camera camSetFovRange fovRange + ctrlParent controlName - $Code$_cam camSetFovRange [0.1, 0.7];$/Code$ + $Code$_display = ctrlParent _control$/Code$ - local / local + undefined / undefined - Nothing + Display + - camSetFov + setNameSound - Set the zoom level ( F ield O f V iew) of the given camera. - The zoom level is from 0.01 for the nearest and 2 for the furthest zoom value, with a default zoom level of 0.75 - The angle of the field of view is atan(FOV)*2 radians when in 4:3 aspect ratio. + Sets the nameSound of a person. By default, when giving orders, the units are addressed by their number. When nameSound is set, it will be used instead to address the unit. For example: "Two, hold fire!", one can have: "Miller, hold fire!" - https://community.bistudio.com/wiki/camSetFov + https://community.bistudio.com/wiki/setNameSound - Object camSetFov Number + Object setNameSound String - camera camSetFov level + person setNameSound name - $Code$_cam camSetFov 0.75;$/Code$ + $Code$unit1 setNameSound "dixon";$/Code$ + + $Code$unit1 setNameSound ""; // will reset to default behaviour$/Code$ + + $Code$_name = "Masood"; + unit1 setNameSound _name; + unit1 setName _name;$/Code$ - local / local + undefined / undefined + (September 19, 2013) + nameSound can be any preset BIS recorded name value. By default units will be called out in voice by their number. By using nameSound you can call them out by name using the following values: + Default: + Armstrong + Nichols + Tanny + Frost + Lacey + Larkin + Kerry + Jackson + Miller + McKendrick + Levine + Reynolds + BLUFOR: + Adams + Bennett + Campbell + Dixon + Everett + Franklin + Givens + Hawkins + Lopez + Martinez + OConnor + Ryan + Patterson + Sykes + Taylor + Walker + OPFOR: + Amin + Masood + Fahim + Habibi + Kushan + Jawadi + Nazari + Siddiqi + Takhtar + Wardak + Yousuf + INDEPENDENT: + Anthis + Costa + Dimitirou + Elias + Gekas + Kouris + Leventis + Markos + Nikas + Nicolo + Panas + Petros + Rosi + Samaras + Stavrou + Thanos + Vega + CODE NAMES: + Ghost + Stranger + Fox + Snake + Razer + Jester + Nomad + Viper + Korneedler + + (December 22, 2013) + setting an incorrect value like "0" or "randomString" will remove the callsign (" /* 2, */ fall back") + + (April 25, 2015) + While kylania listed available names, you can use any word you want. Available words for english can be found in configfile "RadioProtocolENG" "Words". - Nothing + Nothing + - camSetPos + disableAI - Sets the position of the given camera or seagull (see camCreate ). It is worth mentioning that camera position can also be set with setPos, in which case it would be instant. With camSetPos it is possible to make smooth position transition in time, defined with camCommit, which is required in this case. + Disable parts of the AI behaviour to get a better control over the actions of a unit. Must be executed where AI unit is local. If unit changes locality, it might need to be executed again at the new locality to maintain effect. + Possible values are: + "TARGET" - stop the unit to watch the assigned target / group commander may not assign targets + "AUTOTARGET" - prevent the unit from assigning a target independently and watching unknown objects / no automatic target selection + "MOVE" - disable the AI's movement / do not move + "ANIM" - disable ability of AI to change animation. Available only since ArmA: Cold War Assault (OFP 1.99). + "TEAMSWITCH" - AI disabled because of Team Switch + "FSM" - disable the execution of AI behavior scripts. Available only since Operation Arrowhead v1.60. + "WEAPONAIM" - no weapon aiming + "AIMINGERROR" - prevents AI's aiming from being distracted by its shooting, moving, turning, reloading, hit, injury, fatigue, suppression or concealed/lost target Available only since Arma 3 v1.42. + "SUPPRESSION" - prevents AI from being suppressed Available only since Arma 3 v1.42. + "CHECKVISIBLE" - disables visibility raycasts Available only since Arma 3 v1.54. + "COVER" - disables usage of cover positions by the AI Available only since Arma 3 v1.56. + "AUTOCOMBAT" - disables autonomous switching to COMBAT when in danger Available only since Arma 3 v1.56. + "PATH" - stops the AI’s movement but not the target alignment Available only since Arma 3 v1.61. + "MINEDETECTION" - disable Ai mine detection. + "ALL" - all of the above Available since Arma 3 v1.65 + Note: In OFP there is no way to undo this command. - https://community.bistudio.com/wiki/camSetPos + https://community.bistudio.com/wiki/disableAI - Object camSetPos Array + Object disableAI String - camera camSetPos position + unitName disableAI section - $Code$_cam camSetPos [2300,1000,130]; - _cam camCommit 10;$/Code$ + $Code$_soldier1 disableAI "AUTOTARGET";$/Code$ - local / local + local / global + (26.9.2013) + After substantial testing in ArmA3 1.01, the AI sections are as follows: + MOVE: disabling this will stop units from turning and moving. Units will still change stance and fire at the enemy if the enemy happens to walk right in front of the barrel. Unit will watch enemies that are in their line of sight, but won't turn their bodies to face the enemy, only their head. Works for grouped units as well. Good for staging units and holding them completely still. Movement can't be controlled by a script either, you have to re-enable movement for that. Unit will still be able to aim within his cone of fire. + AUTOTARGET: Essentially makes single units without a group, "deaf". The unit still goes prone and combat ready if he hears gunfire. They won't turn around when gunfire comes from the behind, but if an enemy walks in front they will target the enemy and fire as normal. WON'T WORK FOR GROUPED UNITS WITH A LEADER, the leader will assign targets to the units and effectively enables the AI back on. + TARGET: Will prevent units from engaging the target. Units still move around for cover etc...but won't hunt down the player. Works in groups as well. Excellent for keeping units inside bases or other areas without having them flank or engage anyone. They will still seek good cover if something is close by. + ANIM: completely freezes the unit, including breathing. Won't even blink. No move command works until the unit is unfrozen. + FSM: Essentially makes the enemy "dumber". Enemies react slower to enemy fire and the enemy stops using hand signals. Disabling FSM, can give the impression of untrained units as they react slower and are more disorganized than when FSM is enabled. Good for rebel fighters and when enabled better for professional armies. + + (August 3, 2006) + Notes from before the conversion: + The "TARGET" section of the AI is likely different than what you would think. Normally, when an AI group is standing still and sees an enemy, the group will break formation and start moving towards the enemy. If you disable the "TARGET" AI, then the AI units will stay where they are at. Even if you disable the "MOVE" AI, the units will still move out to attack the enemy, unless you disable the "TARGET" AI. Disabling both these AI sections is useful when placing units in defensive positions. This way, you can have them stay behind their cover, and not run out into the open. + This command has also a bug: after mission save or load the effect will be no longer active and you must set it again. It's also good way to detect number of saves and loads (loads can be recognized using time command). + + (Feb 7, 2009) + Multiplayer Use as of ArmA v1.14: + Contrary to the post above, using this command WILL disable A.I. movement ability if used with the "MOVE" parameter. Works even when the A.I. is grouped with other units. I use this command to set up stationary targets at objectives all the time. Works on a dedicated server. + + (September 19, 2015) + Beware that disabling "TARGET" AI to units in the player's group will disable the ability to execute engage orders issued by the player. + + (August 24, 2016) + As of version 1.65 dev., disableAI "MOVE" will also stop vehicles driven by AI. + + (September 26, 2016) + Command is buggy in version 1.64.138497 as it disables the ability to drive vehicles for players. Tested with $Code$player disableAI "move"$/Code$. Entering a vehicle is possible, but not starting the engine. $Code$player enableAI "move"$/Code$ enables the player to drive again. + Already in the feedback tracker: https://feedback.bistudio.com/T120346 + + (Januaary 21, 2017) + Does not lower CPU usage of still AI without enemies in range - Nothing + Nothing + - camSetRelPos + onGroupIconClick - Sets the position of the given camera relative to its target, set with camSetTarget. Needs a call to camCommit to be conducted. Note, that since it sets relative position to the target, the camSetTarget command should be executed already, before camSetRelPos. + Defines an action performed when player clicked on group marker (3D or in a map). The code executed once. This EH, unlike onGroupIconOverEnter and onGroupIconOverLeave, has one more param which returns 1 if RMB was pressed, 0 otherwise. + i + Since Arma 3 v1.57 a stackable version of this EH is available: GroupIconClick - https://community.bistudio.com/wiki/camSetRelPos + https://community.bistudio.com/wiki/onGroupIconClick - Object camSetRelPos Array + onGroupIconClick String/Code - camera camSetRelPos position + onGroupIconClick command - $Code$_cam camSetTarget _car; - _cam camSetRelPos [0,10,8];$/Code$ + $Code$onGroupIconClick + { + // Passed values for _this are: + _is3D = _this select 0; + _group = _this select 1; + _wpID = _this select 2; + _RMB = _this select 3; + _posx = _this select 4; + _posy = _this select 5; + _shift = _this select 6; + _ctrl = _this select 7; + _alt = _this select 8; + _message = format ["____ Info ____"]; + {_message = _message + format ["\n %1",_x]} forEach _this; + hint _message; + }$/Code$ - local / local + undefined / undefined - The location of the camera will depend on the direction the target object is facing. - The camera does not bank with the target (bug?). - Nothing + Nothing + - camSetTarget + diag_log - Set the target object or position where the given camera should point at. Needs the call of camCommit to be conducted. + Dumps the argument's value to the report file. Each call creates a new line in the file. - https://community.bistudio.com/wiki/camSetTarget + https://community.bistudio.com/wiki/diag_log - Object camSetTarget Object - - Object camSetTarget Array + diag_log Anything - camera camSetTarget target - - camera camSetTarget position + diag_log anything - $Code$_camera camSetTarget player ;$/Code$ + $Code$diag_log time ;$/Code$ - $Code$_camera camSetTarget [2540,1503,26];$/Code$ + $Code$diag_log format ["%1, %2", player, time ];$/Code$ - $Code$_cam = "camera" camCreate ( player modelToWorld [0,100,10]); - _cam camSetTarget player ; - _cam camSetRelPos [0, 0.5, 1.5]; - _cam cameraEffect ["internal", "back"]; - _cam camCommit 1; - player setRandomLip true ;$/Code$ + $Code$_arr = [1, "foo", player, "bar"]; + { + diag_log _x ; + } forEach _arr; // Creates 4 entries on 4 lines$/Code$ + + $Code$_arr = [1, "foo", player, "bar"]; + diag_log _arr; + // Creates one entry of e.g. [1,"foo",B Alpha 1-1:1 (Player Name),"bar"]$/Code$ - local / local + undefined / undefined + To dump a string without "" use text. + Posted 23:35, 19 April 2011 + + in patch 1.59 there is a limit of 1044 characters to be printed, no error or crash but diag_log line will simply end at character number 1044. - Nothing - Nothing + Nothing + - camTarget + tvData - Returns camera's target. + Returns string data from item on given path. IDC means id of parent Tree View. - https://community.bistudio.com/wiki/camTarget + https://community.bistudio.com/wiki/tvData - camTarget Object + tvData Array + + Control tvData Array - camTarget camera + tvData [idc, [path]] + + control tvData [path] - + $Code$tvData [101, [0]];$/Code$ + + $Code$(_display displayCtrl 101) tvData [0];$/Code$ + - undefined / undefined + local / local + (Sep 11 2014) + (A3 1.28)tv command family overview + $Code$ + //tv command family available for CT_TREE (type 12) + private ["_count","_current","_data","_text","_value","_pic"]; + _CT_TREE tvAdd [ [],"Parent_A"]; + _CT_TREE tvAdd [ [0],"Child_A"]; + _CT_TREE tvAdd [ [0,0],"Grandchild_A"]; + _CT_TREE tvAdd [ [],"Parent_B"]; + _CT_TREE tvAdd [ [1],"Child_B"]; + _count = _CT_TREE tvCount []; //return 2 + _CT_TREE tvSetCurSel [0,0,0]; //select grandchild_A + _current = tvCurSel _CT_TREE; //return [0,0,0] + _CT_TREE tvSetData [_current,"I'm grandchild_A"]; + _data = _CT_TREE tvData _current; // "I'm grandchild_A" + _text = _CT_TREE tvText _current; //"Grandchild_A" + _CT_TREE tvSetValue [_current,14]; + _value = _CT_TREE tvValue _current; // 14 + _CT_TREE tvSetPicture [_current, getText ( configFile "CfgWeapons" "optic_NVS" "picture")]; + _pic = _CT_TREE tvPicture _current; + _CT_TREE tvExpand [1]; + _CT_TREE tvSort [[], false ]; + _CT_TREE tvSortByValue [[], false ]; + _CT_TREE tvDelete [0,0]; //remove child_b + tvClear 12; + _CT_TREE tvCollapse []; + $/Code$ - Object + String - String + - camUseNVG + setSimpleTaskDestination - Set / clear using of night vision during cutscenes. This command only works with camCreate created camera that is currently the main camera for the player (see example). + Attach a destination to the simple task. Overrides setSimpleTaskTarget - https://community.bistudio.com/wiki/camUseNVG + https://community.bistudio.com/wiki/setSimpleTaskDestination - camUseNVG Boolean + Task setSimpleTaskDestination Array - camUseNVG set + task setSimpleTaskDestination pos - $Code$camUseNVG true ;$/Code$ - - $Code$setDate [2000,12,31,0,0]; - _cam = "camera" camCreate [0,0,0]; - _cam camSetTarget player ; - _cam camSetRelPos [0,-5,3]; - _cam cameraEffect ["Internal","Back"]; - _cam camCommit 0; - camUseNVG true ;$/Code$ + $Code$_tskGoHere setSimpleTaskDestination ( getMarkerPos "obj1");$/Code$ undefined / undefined @@ -8175,236 +8769,320 @@ - Nothing + Nothing + - cameraEffectEnableHUD + shownArtilleryComputer - Enable / disable showing of in-game UI during currently active camera effect. + Checks whether the player has the artillery computer currently open. - https://community.bistudio.com/wiki/cameraEffectEnableHUD + https://community.bistudio.com/wiki/shownArtilleryComputer - cameraEffectEnableHUD Boolean + shownArtilleryComputer - cameraEffectEnableHUD enable + shownArtilleryComputer - $Code$cameraEffectEnableHUD true ;$/Code$ + $Code$if ( shownArtilleryComputer ) then { hint "Artillery Computer shown on screen"; };$/Code$ undefined / undefined - (November 3, 2015) - Must be executed after camCommit. - Nothing + Boolean + - cameraEffect + kbTell - Sets the given effect on the given camera. If you want to switch the screen directly to the first-person, aiming, third-person or group view of an object, use switchCamera instead. The effect type "Terminate" is used to exit the current camera view and switch back to the player's view. Does not need camCommit. - Since Arma 3 v1.73.142217, it is possible to terminate individual r2t source. For example: $Code$cam cameraEffect ["terminate", "back", "rtt1"]; // would terminate "rtt1" r2t source - cam cameraEffect ["terminate", "back"]; // would terminate all r2t sources$/Code$ + Make the person tell to the receiver the sentence. See Conversations for more details. - https://community.bistudio.com/wiki/cameraEffect + https://community.bistudio.com/wiki/kbTell - Object cameraEffect Array + Object kbTell Array - camera cameraEffect [effectName, effectPosition, r2tName] + person kbTell [receiver, topicName, sentenceClass] - $Code$_cam cameraEffect ["internal", "BACK"];$/Code$ - - $Code$_cam cameraEffect ["internal", "back", "rendersurface"];$/Code$ + $Code$player kbTell [BIS_HQ, "myTopic", "playerSentence1"];$/Code$ - $Code$cam = "seagull" camCreate ( player modelToWorld [0,0,100]); - cam cameraEffect ["FIXED", "LEFT TOP"]; - cam camCommand "MANUAL ON";$/Code$ + $Code$player kbTell [ + BIS_HQ, // to + "Airstrike", // topic + "AirstrikeRequest", // sentence + ["Team", {}, "Anvil", ["Anvil"]], // argument 1 + ["Location", {}, "Strelka", ["Strelka"]], // argument 2 + true]; // use radio + // bikb reference: + /* + class AirstrikeRequest + { + text = "%team requesting close air support at grid %location "; + speech[] = { %Team, RequestingCloseAirSupportAtGrid, %Location }; + class Arguments + { + class Team { type = "simple"; }; + class Location { type = "simple"; }; + }; + };*/$/Code$ - local / local + undefined / undefined - (October 30, 2016) - Types of camera for CfgCameraEffects config: - CamExternal (CamInterpolated) type = 0; // linked directly with object - CamStatic type = 1; // fixed point in space - CamStaticWithZoom type = 2; // fixed point in space - CamChained type = 3; // chained - CamTerminate type = 4; // terminate - CamInternal type = 5; // internal view + (may 02, 2010) + Jezuro's helping topic on BIforum : link - Nothing + Nothing + - cameraInterest + try - Return camera interest for given entity, as set by setCameraInterest, or as autodetected. + Defines a try-catch structure. This sets up an exception handling block. Any thrown exception in a try block is caught in a catch block. The structured exception block has the following form: + $Code$ try //begin of try-catch block + { //block, that can throw exception } + catch + { //block, that process an exception. Exception is described in _exception variable };$/Code$ - https://community.bistudio.com/wiki/cameraInterest + https://community.bistudio.com/wiki/try - cameraInterest Object + try Code + + Anything try Code - cameraInterest entity + try code + + args try code - $Code$camInterest = cameraInterest myUnit;$/Code$ - + undefined / undefined + (June 9, 2015) + Do not expect this behave like Javascript try catch and ignore all errors. But it does have one useful behaviour. Normally when runtime error occurs in SQF (unlike when there is compile error) it continues to execute till the end. But if the script is placed in try {} scope and throw is used upon error, the script immediately terminates, exits the try {} scope and enters catch {} scope. This way it is possible to process possible exceptions in civilised manner. - Number + Exception - Exception + - cameraOn + camCreate - Returns the vehicle to which the camera is attached. + Create a camera or a seagull object on the given position. Also other objects can be created this way, but vehicles created with camCreate cannot be entered. Any units created with camCreate will remain static. Differently to createVehicle, objects are created without consideration of the collision detection with surrounding objects, thus the objects are spawned exactly at the given position. camCreate is conducted immediately, the command doesn't wait for camCommit. - https://community.bistudio.com/wiki/cameraOn + https://community.bistudio.com/wiki/camCreate - cameraOn + String camCreate Array - cameraOn + type camCreate position - + $Code$_cam = "camera" camCreate ( position player )$/Code$ + - undefined / undefined + undefined / local - (November 2, 2015) - $Code$ _MyScreenPos = getPos cameraOn; code - This would getPos for the current player or vehicle that the client's camera is attached to. - code _CameraOnSetPos = cameraOn setPos _pos; code - This would do setPos for the current player or vehicle that the client's camera is attached to. - /dd - /dl - $/Code$ + (August 3, 2006) + Notes from before the conversion: + (CWR 1.91) createVehicle is a valid replacement (with special consideration to locality). + You can also use camCreate to create objects. + $Code$flare1 = "flare" camCreate getPos gameLogic_1$/Code$ + However, soldier units created in this way have little or no AI. - Object + Object + - cameraView + createSoundSource - Returns mode of active camera view. Mode is one of: - "INTERNAL" (1st person) - "EXTERNAL" (3rd person) - "GUNNER" (optics / sights) - "GROUP" (commander view) + Creates a sound source of the given type (type is the name of the subclass of CfgVehicles which is pointing to the sound defined in CfgSFX ). If the markers array contains several marker names, the position of a random one is used, otherwise, the given position is used. The sound source is placed inside a circle with this position as its center and placement as its radius. Some of the vanilla classes pre-configured in Arma 3: + "Sound_Alarm" + "Sound_Alarm2" + "Sound_BattlefieldExplosions" + "Sound_BattlefieldFirefight" + "Sound_Fire" + "Sound_SmokeWreck1" + "Sound_SparklesWreck1" + "Sound_SparklesWreck2" + "Sound_Stream" + Since Arma 3 v1.69.141183 it is possible to define sounds for use with createSoundSource in mission config. As mentioned earlier, the sounds needed for this command should be defined inside CfgVehicles class, which itself references CfgSFX class. If given class searched in main config and is not found, the search will continue in description.ext. Here is an example of suitable mission config definition: + // description.ext + class CfgSFX + { + class MyOwl + { + sound0 [] = { "@A3\Sounds_F\environment\animals\birds\owl1", db - 10, 1.0, 1000, 0.2, 0, 15, 30 }; // path to addon sound + sound1 [] = { "@A3\Sounds_F\environment\animals\birds\owl2", db - 10, 1.0, 1000, 0.2, 0, 15, 30 }; // path to addon sound + sound2 [] = { "@A3\Sounds_F\environment\animals\birds\owl3", db - 10, 1.0, 1000, 0.2, 0, 15, 30 }; // path to addon sound + sounds [] = { sound0, sound1, sound2 }; + empty [] = { "", 0, 0, 0, 0, 0, 0, 0 }; + }; + }; + class CfgVehicles + { + class MyOwlSound // class name to be used with createSoundSource + { + sound = "MyOwl" ; // reference to CfgSFX class + }; + }; + $Code$_owl = createSoundSource ["MyOwlSound", position player, [], 0];$/Code$ + Note that the sound created by createSoundSource will always be looping. Also when CfgSFX sound definition contains more than 1 sound, there is no guarantee that the sound played will be the same on every PC in Multiplayer. - https://community.bistudio.com/wiki/cameraView + https://community.bistudio.com/wiki/createSoundSource - cameraView + createSoundSource Array - cameraView + createSoundSource [type, position, markers, placement] - $Code$if ( cameraOn == _vehicle && cameraView == "External") then + $Code$_soundSource = createSoundSource ["LittleDog", position player, [], 0]$/Code$ + + $Code$[] spawn { - _vehicle switchCamera "Internal"; + _alarm = createSoundSource ["Sound_Alarm", position player, [], 0]; //starts alarm + sleep 10; + deleteVehicle _alarm; //stops alarm };$/Code$ - undefined / undefined + global / global - String + Object + - campaignConfigFile + lnbSetPicture - Return root of campaign description.ext entries hierarchy. + Sets the picture in the item with the given position of the 2D listbox. + Name is the picture name. + The picture is searched in the mission, directory, the dtaExt subdirectory of the campaign directory, and the dtaExt directory and the data bank (or directory). - https://community.bistudio.com/wiki/campaignConfigFile + https://community.bistudio.com/wiki/lnbSetPicture - campaignConfigFile + lnbSetPicture Array + + Control lnbSetPicture Array - campaignConfigFile + lnbSetPicture [IDC, [Row, Column], PicturePathOrPictureName] + + _ctrl lnbSetPicture [ [Row, Column], PicturePathOrPictureName] - + $Code$lnbSetPicture [1, [0, 0], "Picture"];$/Code$ + + $Code$_ctrl lnbSetPicture [ [0, 0], "\A3\Ui_f\data\GUI\Cfg\Ranks\lieutenant_gs.paa"];$/Code$ + - undefined / undefined + local / local + (Sep 9 2014) + (A3 1.28)As for invisible data processing, lnbAddArray, lnbAddColumn, lnbData, lnbGetColumnsPosition, lnbSetColumnsPos, lnbSetData, lnbSetText, lnbSetValue, lnbText and lnbValue store data types into exact position of the listNbox with different spaces. Accessing data with coordinate command at nearly the same syntax: + $Code$ + //Set same value to one position of a Control + _ctrl lnbSetData [ [0,0],"#1"]; + lnbSetColumnsPos [102, [0,1], 1]; + _ctrl lnbSetText [ [0,1], "#1"]; + _ctrl lnbSetValue [ [0,0],1]; + //Accessing the value disregard affecting one another. + _ctrl lnbData [0,0]; //"#1" + lnbGetColumnsPosition _ctrl //[1]; + _ctrl lnbText [0,0];//"#1" + _ctrl lnbValue [0,0];//1 + $/Code$ + For a direct visible control over CT_LISTNBOX: + $Code$ + 0 = [_CT_LISTNBOX] spawn { + private ["_CT_LISTNBOX","_color","_current","_pic"]; + disableSerialization ; + _CT_LISTNBOX = _this select 0; + { + _CT_LISTNBOX lnbAddRow [ getText (_x "displayNameShort"), getText (_x "displayName")]; + _CT_LISTNBOX lnbSetPicture [ [_foreachIndex,0], getText (_x "texture")]; + } forEach (" isClass _x" configClasses ( configFile "CfgRanks")); + _CT_LISTNBOX lnbSetCurSelRow 0; + _current = lnbCurSelRow _CT_LISTNBOX; + _color = _CT_LISTNBOX lnbColor [_current,0]; + _CT_LISTNBOX lnbSetColor [ [_current,1], [(_color select 0)/2,0,0,1] ]; + _CT_LISTNBOX lnbDeleteColumn 0; + _CT_LISTNBOX lnbDeleteRow 1; + sleep 1; + lnbClear _CT_LISTNBOX;//Clear all items but control still remains just invisible. + }; + $/Code$ + A combined use of both invisible and visible data processing commands alive the Control. - Config + Nothing - Nothing + - canAddItemToBackpack + selectRandom - Checks if given object can be stored into soldier's backpack. + Returns a random element from the given array. Engine solution to BIS_fnc_selectRandom - https://community.bistudio.com/wiki/canAddItemToBackpack + https://community.bistudio.com/wiki/selectRandom - Object canAddItemToBackpack String - - Object canAddItemToBackpack Array + selectRandom Array - unit canAddItemToBackpack item - - unit canAddItemToBackpack [item, count] + selectRandom array - $Code$_item = "HandGrenade"; - _fits = player canAddItemToBackpack _item; - if (_fits) then { - player addItemToBackpack _item; - } else { - hint "no room!"; - };$/Code$ + $Code$_randomElement = selectRandom [1,2,3,4,5];$/Code$ undefined / undefined @@ -8412,37 +9090,29 @@ - Boolean - Boolean + Anything + - canAddItemToUniform + copyFromClipboard - Checks if given object can be stored into soldier's uniform. + Return the content of the (text) clipboard. + Disabled in Multiplayer for security reasons - https://community.bistudio.com/wiki/canAddItemToUniform + https://community.bistudio.com/wiki/copyFromClipboard - Object canAddItemToUniform String - - Object canAddItemToUniform Array + copyFromClipboard - unit canAddItemToUniform item - - unit canAddItemToUniform [item, count] + copyFromClipboard - $Code$_item = "HandGrenade"; - _fits = player canAddItemToUniform _item; - if (_fits) then { - player addItemToUniform _item; - } else { - hint "no room!"; - };$/Code$ + $Code$hint copyFromClipboard ;$/Code$ undefined / undefined @@ -8450,286 +9120,238 @@ - Boolean - Boolean + String + - canAddItemToVest + vectorCos - Checks if given object can be stored into soldier's vest. + Cosine of angle between two 3D vectors. - https://community.bistudio.com/wiki/canAddItemToVest + https://community.bistudio.com/wiki/vectorCos - Object canAddItemToVest String - - Object canAddItemToVest Array + Array vectorCos Array - unit canAddItemToVest item - - unit canAddItemToVest [item, count] + vector1 vectorCos vector2 - $Code$_item = "HandGrenade"; - _fits = player canAddItemToVest _item; - if (_fits) then { - player addItemToVest _item; - } else { - hint "no room!"; - };$/Code$ + $Code$_cos = getPos player vectorCos [0,0,2];$/Code$ undefined / undefined + (28 Jun, 2014) + (ArmA3 1.22)Algorithm: + $Code$ + Vector1 = [x1,y1,z1]; Vector2 = [x2,y2,z2]; + Result = ((x1 * x2) + (y1 * y2) + (z1 * z2))/(( sqrt (x1 ^ 2 + y1 ^ 2 + z1 ^ 2))*( sqrt (x2 ^ 2 + y2 ^ 2 + z2 ^ 2))) + $/Code$ + Given two vectors of attributes, A and B, the cosine similarity, cos(θ), is represented using a dot product and magnitude. The resulting similarity values indicating intermediate similarity or dissimilarity between two vectors. - Boolean - Boolean + Number + - canAdd + units - Checks if given object can be stored in inventory of given object or any inventory container ( uniform, vest, backpack ) of given unit. + Returns an array with all the units in the group or group of the unit. For a destroyed object an empty array is returned. - https://community.bistudio.com/wiki/canAdd + https://community.bistudio.com/wiki/units - Object canAdd String - - Object canAdd Array + units Group/Object - object canAdd item - - object canAdd [item, count] + units groupOrUnit - $Code$if ( player canAdd "FirstAidKit") then { - player addItem "FirstAidKit"; - } else { - hint "Not enough space"; - };$/Code$ - - $Code$if (_box canAdd "FirstAidKit") then { - _box addWeaponCargo ["FirstAidKit", 1]; - } else { - hint "Not enough space"; - };$/Code$ + $Code$_myUnitCount = count units group player ;$/Code$ - $Code$car canAdd [ currentWeapon player, 50];$/Code$ + $Code$_isInMyGroup = _soldier1 in units player ;$/Code$ undefined / undefined - (November 29, 2015) - Can also be used on any object that has inventory, not only player inventory containers. - Where _box is B_supplyCrate_F : - $Code$// Empty - _box canAdd "FirstAidKit"; - - true - // Full - _box canAdd "FirstAidKit"; - - false - $/Code$ - - (February 11, 2017) - This can also be used as alternative to canAddItemToBackpack, canAddItemToUniform, canAddItemToVest where container might not be strictly defined.In some cases it might be a good optimisation for your code, where you also don't need to perform checks on which type of player container this is. Example: - $Code$_i = [(uniformContainer player),(vestContainer player),(backpackContainer player)] call BIS_fnc_selectRandom; - if (_i canAdd "Rangefinder") then { - _i addItemCargoGlobal ["Rangefinder",1]; - }; - $/Code$ + (September 24, 2009) + The returned array on MP clients is not updated when team members die (only when they are deleted). ( Tested on VBS2 ) - Boolean - Boolean + Array + - canFire + setDammage - Returns true if the given vehicle is still able to fire. For the command to return true, vehicle must be alive, have weapon operator and the weapon cannot be damaged = 0.9 but can be empty due to running out of ammo. If mission starts with vehicle having no ammo or setVehicleAmmo 0 command is executed on the vehicle, then canFire will always report false for it. + Damage / repair object. + Damage 0 means fully functional, damage 1 means completely destroyed / dead. + Alias of setDamage, which was introduced to fix a spelling error in this operator's name. - https://community.bistudio.com/wiki/canFire + https://community.bistudio.com/wiki/setDammage - canFire Object + Object setDammage Number - canFire unitName + object setDammage damage - $Code$// SQS: - ?!( canFire _tank) : player sideChat "Tank disabled!"$/Code$ - - $Code$// SQF: - if ( ! ( canFire _tank)) then { - player sideChat "Tank disabled!"; - };$/Code$ + $Code$_soldier1 setDammage 1;$/Code$ - global / undefined + global / global - (07:16, 20 January 2007 (CEST)) - true even if unit is out of ammo. Only false if gun is damaged. - - (05:20, 24 August 2008 (CEST)) - False if there is no gunner in the vehicle, regardless of damage level. - - (07:20, 23 April 2018 (UTC)) - This command seems to have evolved. Returns "true" (on Hunter, Ifrit) even if Gun's damage is set to 1 and turret also, as far there is a gunner. The only way to obtain a canFire "false" is to make the crew disembark (2 burned tires for example). Then no matter the gun state, if the gunner disembarks without order, the vehicle can't fire. In this case: can't move can't fire. - NB: if you jump into a hunter HMG after having setHitPointDamage(d) "hitTurret" and "hitGun" to 1, the turret can't rotate any more, the gun is pitched down but you can fire (trigger) to the ground. Difficult to check the behavior for each vehicles. + In OFP, setting a unit's damage to a negative value will set it's health to full, but impair their aim. - Boolean + Nothing + - canMove + taskState - Returns if the given vehicle is still able to move. This command checks only the damage value, not the amount of fuel! + Returns the current state of a task. + Possible return values are: + None + Created + Assigned + Succeeded + Failed + Canceled - https://community.bistudio.com/wiki/canMove + https://community.bistudio.com/wiki/taskState - canMove Object + taskState Task - canMove unitName + taskState task - $Code$// SQS : - ?!( canMove _tank) : player sideChat "He's nailed on the ground! Now hurry!"$/Code$ - - $Code$if (! canMove _tank) then - { - player sideChat "He's nailed on the ground! Now hurry!"; - };$/Code$ + $Code$tskSomeTask = player createSimpleTask ["NewTask"]; + hint format["Taskstate: %1", taskState tskSomeTask];$/Code$ - global / undefined + undefined / undefined - (08:17, 22 Juil 2016 (UTC)) - This command will return true for a car or a tank out of fuel, but false for an helicopter or a plane for the same condition. - Boolean + String + - canSlingLoad + addMusicEventHandler - Returns true if it is possible to sling load cargo + Adds playMusic event handler. Returns id of the handler or -1 when failed. Just like addMissionEventHandler, music EH is also attached to the mission. - https://community.bistudio.com/wiki/canSlingLoad + https://community.bistudio.com/wiki/addMusicEventHandler - Object canSlingLoad Object + addMusicEventHandler Array - vehicle canSlingLoad cargo + addMusicEventHandler [type, function] - $Code$_slingable = veh1 canSlingLoad veh2;$/Code$ + $Code$_ehID = addMusicEventHandler ["MusicStart", { hint str _this}];$/Code$ - $Code$hint str (( vehicle player ) canSlingLoad veh1);$/Code$ + $Code$_ehID = addMusicEventHandler ["MusicStop", { hint str _this}];$/Code$ undefined / undefined + (March 4, 2013) + There are these two types at this time: + MusicStart - It is triggered when the music is started (command playMusic ). In variable _this is stored class name from CfgMusic. + MusicStop - It is triggered when the music is ended (command playMusic ). In variable _this is stored class name from CfgMusic. - Boolean + Number + - canStand + setRank - Returns if the given soldier is able to stand up. + Sets rank of given unit. + Possible values: PRIVATE, CORPORAL, SERGEANT, LIEUTENANT, CAPTAIN, MAJOR or COLONEL. + Since Arma 3 v1.67 this command is - https://community.bistudio.com/wiki/canStand + https://community.bistudio.com/wiki/setRank - canStand Object + Object setRank String - canStand unitName + unitName setRank rank - $Code$// SQS : - ?!( canStand player ) : player groupChat "My legs! They hit my legs!"$/Code$ - - $Code$if (! canStand player ) then - { - player groupChat "My legs! They hit my legs!"; - };$/Code$ + $Code$player setRank "COLONEL"$/Code$ - global / undefined + global / local - The command may return true for dead units. + (Mar 26, 2009) + Changing a unit's rank using either setUnitRank or setRank will also REPLACE their current rating dependent on their new rank (colonels have a rating of 7500 etc). That is to say REPLACE, not add to: the unit's old rating will disappear with the rank change. + + (April 12, 2014) + Behavior when used on players in multiplayer seems unpredictable. (ArmA 3 1.00) - Boolean + Nothing + - canSuspend + isNumber - Returns true if sleep, uiSleep or waitUntil commands can be used in current scope. Usually when suspension is not allowed but used, for example when code is executed in unscheduled environment, the script engine would ignore any suspension command and throw error: "Suspending not allowed in this context". Using canSuspend command allows to detect the correct environment for the code. - Note : The definition of scheduled and unscheduled environment is not the same as whether or not the script execution can or cannot be suspended. For example while. sqs and. fsm scripts are scheduled (i.e. added to the scheduler : diag_activeSQSScripts, diag_activeMissionFSMs ), they cannot use sleep or be suspended like execVM or spawn scripts can, therefore canSuspend for these types of scripts will return false. + Check if config entry represents number. - https://community.bistudio.com/wiki/canSuspend + https://community.bistudio.com/wiki/isNumber - canSuspend + isNumber Config - canSuspend + isNumber config - $Code$onEachFrame - { - systemChat str canSuspend ; //false - [] spawn { hint str canSuspend }; //true - onEachFrame {}; - };$/Code$ - - $Code$// Make sure the function code is always spawned even when called: - mysleep = - { - if (! canSuspend ) exitWith {_this spawn mysleep}; - sleep _this; - hint ("slept " + str _this); - }; - 5 call mysleep;$/Code$ + $Code$_ok = isNumber (configFile "CfgVehicles") + // Result is false$/Code$ undefined / undefined @@ -8737,27 +9359,29 @@ - Boolean + Boolean + - canTriggerDynamicSimulation + diag_enable - A getter for triggerDynamicSimulation + Used to enable/disabled various diagnostics. + Only available in the Arma 3 Diagnostic exe - https://community.bistudio.com/wiki/canTriggerDynamicSimulation + https://community.bistudio.com/wiki/diag_enable - canTriggerDynamicSimulation Object + String diag_enable Boolean - canTriggerDynamicSimulation unit + diag_mode diag_enable state - $Code$hint str canTriggerDynamicSimulation player ;$/Code$ + $Code$"All" diag_enable true$/Code$ undefined / undefined @@ -8765,191 +9389,300 @@ - Boolean + Nothing + - canUnloadInCombat + fireAtTarget - Check if cargo of this vehicle want to get out when in combat. + Remotely forces a unit to fire the given weapon. See also: BIS_fnc_fire - https://community.bistudio.com/wiki/canUnloadInCombat + https://community.bistudio.com/wiki/fireAtTarget - canUnloadInCombat Object + Object fireAtTarget Array - canUnloadInCombat vehicle + sourceVehicle fireAtTarget [targetVehicle, weaponMuzzleName] - $Code$if (canUnloadInCombat _vehicle) then {...};$/Code$ + $Code$_handle = this fireAtTarget [groundtarget1,"HellfireLauncher"];$/Code$ + + $Code$_handle = Igla_AA_pod_TK_EP1 fireAtTarget [_helicopter, currentWeapon Igla_AA_pod_TK_EP1];$/Code$ + + $Code$_handle = Igla_AA_pod_TK_EP1 fireAtTarget [helicopter];$/Code$ undefined / undefined + (Sep 16, 2010) + Most likely only for missiles and for interaction with player only. + + (Apr 8, 2014) + (A3 1.14) Source vehicle is only limited to manned vehicle while any other types won’t be able to active fireAtTarget handle, e.g. + $Code$ + _handle = _InfantryUnit fireAtTarget [_Infnatrytarget,( weapons _Infantryunit select 0)]; + //false & no bullet shoot + $/Code$ + Target has no limitation and can be any object: + $Code$ + _handle = ( vehicle _veh) fireAtTarget [ObjNull,( weapons ( vehicle _veh) select 0)]; + //true & a bullet shoot + $/Code$ + Handle returns false if weapon class name is inaccurate, e.g. + $Code$ + _Handle = ( vehicle _veh) fireAtTarget [ObjNull,”UnknownWeapon”]; + //false & no bullet shoot. + $/Code$ + Handle still returns true even though the vehicle is unavailable to shoot any bullet: + $Code$ + _weapon = weapons ( vehicle _veh) select 0; + ( vehicle _veh) setAmmo [_weapon,0]; + _Handle = ( vehicle _veh) fireAtTarget [ObjNull,_weapon]; + //true & no bullet shoot + $/Code$ + difference + command + Source + Target + Behavior + Workaround templets + fire + Either Unit or manned vehicle + N/A + Fired aiming at air for infantry rifle + Together with selectWeapon, + suggested to work with "throw","put" weapon type + for infantry, or vehicle entity indeed. + fireAtTarget + Manned vehicle only + Any object + Normal shoot, won’t aim at target automatically + _veh doWatch _target; + waitUntil {_veh aimedAtTarget [_target] 0}; + _veh fireAtTarget [_target]; + forceWeaponFire + Either Unit or manned aircraft (weapon operator) + N/A + Normal shoot, can change fire mode + //E.g. unit won't shoot until he is facing the target. + _unit doWatch _tar; + waitUntil { + _dir = direction _unit; + _relative = [_unit,_tar] call BIS_fnc_relativeDirTo ; + if (_dir == _relative) exitWith { + _unit forceWeaponFire [ currentWeapon _unit,"single"]; + }; + false + }; + doFire + Unit only + Either unit or vehicle + automatic aiming and shooting + No special example. + commandFire + Unit only + Either unit or vehicle + automatic aiming and shooting + No special example. + action ["UseWeapon"] + Either unit or manned vehicle + N/A + unexpected behavior + N/A - Boolean + Boolean + - canVehicleCargo + sideChat - Returns bool array if it is possible to load cargo inside vehicle and if possible to load cargo into empty vehicle + Types text to the side radio channel. Must have assigned "ItemRadio" to see or transmit the messages. The text will be visible only on the PC where command was executed. If you need the message to show on all computers, you have to execute it globally (see remoteExec ) - https://community.bistudio.com/wiki/canVehicleCargo + https://community.bistudio.com/wiki/sideChat - Object canVehicleCargo Object + Object sideChat String + + Array sideChat String - vehicle canVehicleCargo cargo + unitName sideChat chatText + + [side, identity] sideChat chatText - $Code$// Blackfish with no vehicle cargo loaded - _result = blackfish canVehicleCargo offroad; //[true, true]$/Code$ + $Code$_soldierOne sideChat "Show this text";$/Code$ - $Code$// Blackfish with one vehicle cargo called offroad already loaded - _result = blackfish canVehicleCargo offroad; //[false, false] - - // Even if the Blackfish was empty offroad can't be loaded because it's already in a cargo space$/Code$ + $Code$[ west, "HQ"] sideChat "Hi there";$/Code$ - $Code$// Blackfish with one vehicle cargo called offroad already loaded - _result = blackfish canVehicleCargo offroad2; //[false, true] - - // offroad2 can't be loaded because there isn't enough space in the Blackfish, but if there was space offroad2 could be loaded into the Blackfish$/Code$ + $Code$driver vehicle player sideChat "sideChat"; + driver vehicle player globalChat "globalChat"; + driver vehicle player groupChat "groupChat"; + vehicle player vehicleChat "vehicleChat"; + driver vehicle player commandChat "commandChat"; + driver vehicle player customChat [1, "customChat"]; + systemChat "systemChat";$/Code$ - undefined / undefined + global / local + In OFP v1.96, sideChat messages can be sent from 2 abstract sources: "Papa_Bear" and "Base FireFly". Use sideChat on an array in the form [SIDE,"base"],[SIDE,"HQ"],[SIDE,"Papa_bear"] or [SIDE,"airbase"], where SIDE is the side broadcasting. "HQ", "base" and "Papa_bear" seem to be the same object. The callsign strings can be re-defined using a stringTable.csv file, using STR_CFG_PAPABEAR and STR_CFG_FIREFLYBASE. Example : [EAST,"base"] sideChat "Return to base!". - Array + Nothing - Nothing + - cancelSimpleTaskDestination + land - Cancels a simple task destination. + Force helicopter landing. Landing mode may be: + "LAND" (complete stop) + "GET IN" (hovering very low, for another unit to get in) + "GET OUT" (hovering low,for another unit to get out) + "NONE" (cancel a landing) Available since ArmA 2 57463 build. - https://community.bistudio.com/wiki/cancelSimpleTaskDestination + https://community.bistudio.com/wiki/land - cancelSimpleTaskDestination Task + Object land String - cancelSimpleTaskDestination task + helicopter land mode - $Code$cancelSimpleTaskDestination myTask;$/Code$ + $Code$_cobraOne land "LAND"$/Code$ - undefined / undefined + local / global + (August 4, 2006) + Notes from before the conversion: + Helos will land at the nearest "H" or "Invisible H", if there is one around (within 500m in ArmA). + + To make a helicopter LAND correctly and not hovering over the landing position use unitReady to check if the helicopter already has reached his destination. + You can fix a landing bug by using a short delay bevore checking the unitReady command. + _helicopter move (getPos _destination); + sleep 3; + while { ( (alive _helicopter) && !(unitReady _helicopter) ) } do + { + sleep 1; + }; + if (alive _helicopter) then + { + _helicopter land "LAND"; + }; - Nothing + Nothing + - captiveNum + vectorWorldToModelVisual - Checks whether the unit is a captive. If the unit is a vehicle, its commander is checked instead. - If a unit's captivity level was set as a Boolean, then the returned number is either 0 (for false ) or 1 (for true ). + Converts vector direction from world to model space in render time scope. - https://community.bistudio.com/wiki/captiveNum + https://community.bistudio.com/wiki/vectorWorldToModelVisual - captiveNum Object + Object vectorWorldToModelVisual Array - captiveNum unit + object vectorWorldToModelVisual worldDir - $Code$_captivity = captiveNum _unit;$/Code$ - - $Code$_unit setCaptive 1024; - hint str captive _unit; //true - hint str captiveNum _unit; //1024$/Code$ + $Code$// Convert world space vector [0,-10,4] to model space of object _airplane: + _airplane vectorWorldToModelVisual [0,-10,4];$/Code$ - global / undefined + undefined / undefined - Number + Array + - captive + getObjectType - Returns if the given unit is captive. "captive" means that enemies will not shoot at the unit. + Returns object type as a number: + 1 - Primary - Normal object placed in Visitor, part of landscape + 2 - Network - Road placed in Visitor, part of landscape + 4 - Temporary - Temporary object (like tracks) + 8 - TypeVehicle - Some entity added by game + 16 - TypeTempVehicle - Temporary entity + 32 - LandDecal - Land decal - https://community.bistudio.com/wiki/captive + https://community.bistudio.com/wiki/getObjectType - captive Object + getObjectType Object - captive object + getObjectType object - $Code$if (! captive _general) then {_general setCaptive true };$/Code$ + $Code$_objType = getObjectType player ;$/Code$ + + $Code$_objType = getObjectType cursorObject ;$/Code$ - global / undefined + undefined / undefined - (August 3, 2006) - Notes from before the conversion: - Use setCaptive to make a unit captive. - Boolean + Number + - case + floor - This command is used inside a switch do construct. Although the syntax below states that this operator takes only one argument, that is most likely not true. It seems like it needs two arguments of which the left one is some sort of hidden variable that gets defined inside a switch do construct. That is the reason why this operator can not be used outside a switch do construct. (see https://foxhound.international/arma-3-sqf-grammar.html for further explaination) - Also note that it is not possible to store the returned Switch Type in a variable and use that variable in another switch do construct. It will never lead to an execution of the corresponding code block. + Returns the next lowest integer in relation to x. - https://community.bistudio.com/wiki/case + https://community.bistudio.com/wiki/floor - case Anything + floor Number - case b + floor x - $Code$switch (_condition) do { - case 1: { hint "1" }; - case 2: { hint "2" }; - default { hint "default" }; - };$/Code$ + $Code$floor 5.25 + Result is 5$/Code$ + + $Code$floor -5.25 + Result is -6$/Code$ undefined / undefined @@ -8957,54 +9690,62 @@ - Switch_Type + Number + - catch + direction - Processes code when an exception is thrown in a try block. The exception caught can be found in the _exception variable. + Returns the direction an object or a location is facing (differs from getDir in that this also works with locations). - https://community.bistudio.com/wiki/catch + https://community.bistudio.com/wiki/direction - Exception catch Code + direction Object/Location - try-block catch code + direction object - + $Code$player setDir 90; + _d = direction player ;//returns 90$/Code$ + - undefined / undefined + global / undefined - Anything + Number + - cbChecked + collect3DENHistory - Returns the current state of a checkbox (CT_CHECKBOX type 77 of Dialog Control ). + Execute a block of code in which all Eden Editor operations will be recorded as one history step. For example creating an entity, setting its attributes and then connections would normally be recorded as three different steps. Calling them all within single collect3DENHistory block will group them together and the user will need to undo only once to revert the changes. - https://community.bistudio.com/wiki/cbChecked + https://community.bistudio.com/wiki/collect3DENHistory - cbChecked Control + collect3DENHistory Code - cbChecked control + collect3DENHistory code - $Code$_checked = cbChecked _myCheckBox;$/Code$ + $Code$collect3DENHistory { + _logic = create3DENEntity ["Logic", "Logic", position player ]; + add3DENConnection ["Sync", [_logic], player ]; + }; + // Creates a logic and connects it to player in one history step.$/Code$ undefined / undefined @@ -9012,31 +9753,30 @@ - Boolean + Nothing + - cbSetChecked + slingLoadAssistantShown - Sets the current state of a checkbox (CT_CHECKBOX type 77 of Dialog Control ). + Returns true of Sling Load Assistant is open - https://community.bistudio.com/wiki/cbSetChecked + https://community.bistudio.com/wiki/slingLoadAssistantShown - Control cbSetChecked Boolean + slingLoadAssistantShown - control cbSetChecked state + slingLoadAssistantShown - $Code$_myCheckBox cbSetChecked true ;$/Code$ - - $Code$_disp = findDisplay 46 createDisplay "RscDisplayEmpty"; - _chk = _disp ctrlCreate ["RscCheckBox", -1]; - _chk cbSetChecked true ;$/Code$ + $Code$waitUntil { slingLoadAssistantShown }; + hint "You lack rudimentary motor skills and basic eye-hand coordination."; + //scold user for unethical practices$/Code$ undefined / undefined @@ -9044,125 +9784,153 @@ - Nothing + Boolean + - ceil + publicVariableServer - The ceil value of x. + Send the variable value to the server - same limitations regarding variable type as publicVariable. + In Arma 3 it is possible to broadcast nil value - https://community.bistudio.com/wiki/ceil + https://community.bistudio.com/wiki/publicVariableServer - ceil Number + publicVariableServer String - ceil x + publicVariableServer varName - $Code$ceil 5.25 - Result is 6$/Code$ - - $Code$ceil -5.25 - Result is -5$/Code$ + $Code$publicVariableServer "CTFscoreOne";$/Code$ undefined / undefined + (24 Aug, 2012) + publicVariableServer (run on client) + publicVariableClient (run on server) + Publishers the variable (name as STRING) to the server only. Useful when you want to synchronize a variable with the server but not any other clients. - Rocket - Number + Nothing + - channelEnabled + splitString - Returns true or false depending on whether the given channel is enabled or disabled. For more information about enabling/disabling of chat channels see enableChannel. Channel / Number correspondence: - 0 = Global - 1 = Side - 2 = Command - 3 = Group - 4 = Vehicle - 5 = Direct - 6-15 = Custom Radio (Is not supported by channelEnabled ) - Please note that since Arma 3 v1.59.135661 the output of this command was changed from Boolean to Array in format [ Boolean, Boolean ] + An SQF version of C++ strtok. Splits given string str into an array of tokens according to given delimiters. In addition, if empty string "" is used for delimiters, str is split by each character. - https://community.bistudio.com/wiki/channelEnabled + https://community.bistudio.com/wiki/splitString - channelEnabled Number + String splitString String - channelEnabled channel + str splitString delimiters - $Code$_isGlobalChatEnabled = ( channelEnabled 0) select 0; // Check if user can use text on global channel$/Code$ + $Code$_str = "- This, is a sample string." splitString "-,. "; // ["This","is","a","sample","string"] + _str joinString " "; // "This is a sample string"$/Code$ - $Code$_isGlobalVoiceEnabled = ( channelEnabled 0) select 1; // Check if user can use the VoN on global channel$/Code$ + $Code$"\A3\ui_f\data\map\vehicleicons\iconLogic_ca.paa" splitString "\."; + // ["A3","ui_f","data","map","vehicleicons","iconLogic_ca","paa"]$/Code$ + + $Code$"1:2:3" splitString ":"; // ["1","2","3"]$/Code$ + + $Code$["test","test"] joinString toString [12345] splitString toString [12345]; // ["test","test"]$/Code$ + + $Code$"Japa is the best!" splitString "" joinString " "; // "J a p a i s t h e b e s t !"$/Code$ + + $Code$_cmd = currentMagazineDetail player ; //"9mm 16Rnd Mag(13/16)[id/cr:10000011/0]" + _cmd splitString "([ ]/:)"; //["9mm","16Rnd","Mag","13","16","id","cr","10000011","0"]$/Code$ + + $Code$// Remove all \r\n from file: + loadFile "somefile.txt" splitString toString [13,10] joinString " "$/Code$ undefined / undefined + (May 17, 2016) + This command is unreliable/broken when it comes to some non-ASCII characters (as of Arma 3 1.58): + $Code$"Mörser" splitString "" + - ["M"," "," ","r","s","e","r"] + "Mörser" splitString "ö" + - ["M","rser"] + "Mörser" splitString "ä" + - ["M"," rser"]$/Code$ + + (October 17, 2016) + This commands works only with ASCII chars, any chars with codes 127, also used in different languages, will be converted to [" ", " "]. Use toArray to preserve special characters: + $Code$_spaced = toArray "Mörser" apply { toString [_x]} joinString " "; // M ö r s e r$/Code$ - Array + Array + - cheatsEnabled + skillFinal - Checks whether cheats are enabled (whether the designers' version is running). + Returns final, recalculated sub skill value of given unit. (with regard to AI Level coefficient (Difficulty settings)). - https://community.bistudio.com/wiki/cheatsEnabled + https://community.bistudio.com/wiki/skillFinal - cheatsEnabled + Object skillFinal String - cheatsEnabled + unit skillFinal skillName - + $Code$_unitTrueEndurance = unit1 skillFinal "endurance";$/Code$ + undefined / undefined + Since 1.40 the command works also in MP environment + + (January 31, 2015) - Boolean + Number + - checkAIFeature + uniformMagazines - Check if given AI feature is currently enabled. Feature may be one of: - "AwareFormationSoft", "CombatFormationSoft". + Get array with all magazines from uniform of the given unit. - https://community.bistudio.com/wiki/checkAIFeature + https://community.bistudio.com/wiki/uniformMagazines - checkAIFeature String + uniformMagazines Object - checkAIFeature feature + uniformMagazines unit - $Code$_featureUsed = checkAIFeature "AwareFormationSoft"$/Code$ + $Code$uniformMagazines player ;[ + "6.5mm 30Rnd STANAG Mag(30/30)[id/cr:1/0](3x)" + ]$/Code$ undefined / undefined @@ -9170,91 +9938,83 @@ - Boolean + Array + - checkVisibility + setCompassOscillation - Checks if one position is visible from another position and how much. The results can be affected by getTerrainGrid value, especially if position is near the ground. Particle effects such as smoke can also affect the results. + Sets compass oscillation. - https://community.bistudio.com/wiki/checkVisibility + https://community.bistudio.com/wiki/setCompassOscillation - Array checkVisibility Array + setCompassOscillation Array - [ignore, LOD, ignore2] checkVisibility [beg, end] + setCompassOscillation [angle, frequencyMin, frequencyMax] - $Code$_cansee = [ objNull, "VIEW"] checkVisibility [ eyePos player, eyePos unit1];$/Code$ + $Code$setCompassOscillation [1, 1, 1];$/Code$ undefined / undefined - (August 8, 2016) - Particles that have blockAIVisibility set to 1 will influence the result, but will not make checkVisibility return 0. Instead an extremly small number will be returned. - Distance, fog, overcast, rain and nighttime have no effect on the result. - Number + Nothing + - civilian + getPilotCameraRotation - Pre-defined variable for the civilian side. - When used in a format statement ( hint format ["%1",civilian] ), the string returned is "CIV". + Returns rotation (relative to the centered camera position) of the object airplane or helicopter pilotCamera. - https://community.bistudio.com/wiki/civilian + https://community.bistudio.com/wiki/getPilotCameraRotation - civilian + getPilotCameraRotation Object - civilian + getPilotCameraRotation object - $Code$// SQS: - ?((side _unit) == civilian ) : hint "This is a civilian unit!"$/Code$ - - $Code$// SQF: - if (( side _unit) == civilian ) then { - hint "This is a civilian unit!"; - };$/Code$ + $Code$_pilotCamRot = getPilotCameraRotation vehicle player$/Code$ - undefined / undefined + local / undefined - In OFP v1.96, empty vehicles, objects and dead soldiers are on side civilian. - Side + Array + - className + menuSize - Returns short name of location. + Returns how many sub entries is in item on given path. - https://community.bistudio.com/wiki/className + https://community.bistudio.com/wiki/menuSize - className Location + menuSize Array - className loc + menuSize [idc, path] @@ -9264,675 +10024,825 @@ - String + Number + - clearAllItemsFromBackpack + setDestination - Removes all items from the backpack. + Set the destination for path planning of the pilot. + Possible values for planningMode are: + "DoNotPlan" - used when not moving + "DoNotPlanFormation" - used in formation when simple path testing is used + "LEADER PLANNED" - used for formation leader (full path finding used) + "LEADER DIRECT" - used for DirectGo (like getin, supply) + "FORMATION PLANNED" - used in formation when full path finding is used + "VEHICLE PLANNED" - used for vehicle driver + Works best when used on agents - https://community.bistudio.com/wiki/clearAllItemsFromBackpack + https://community.bistudio.com/wiki/setDestination - clearAllItemsFromBackpack Object + Object setDestination Array - clearAllItemsFromBackpack unit + object setDestination [position, planningMode, forceReplan] - + $Code$bob setDestination [ screenToWorld [0.5,0.5], "LEADER PLANNED", true ]$/Code$ + - undefined / undefined + local / global - Nothing + Nothing + - clearBackpackCargo + setWaypointHousePosition - Removes all backpacks from ammo box (or any general weapon holder container). + For waypoints attached to a house, this defines the target house position. - https://community.bistudio.com/wiki/clearBackpackCargo + https://community.bistudio.com/wiki/setWaypointHousePosition - clearBackpackCargo Object + Array setWaypointHousePosition Number - clearBackpackCargo box + waypoint setWaypointHousePosition pos - $Code$clearBackpackCargo myBox;$/Code$ + $Code$[_grp, 2] setWaypointHousePosition 1;$/Code$ undefined / undefined - (July 6, 2017) - This will remove not only backpacks, but vests and uniforms as well. - Nothing + Nothing + - clearBackpackCargoGlobal + boundingCenter - Removes all backpacks from the vehicle cargo space. MP synchronized. + Returns the position of original (loaded) center of object in model coordinates. - https://community.bistudio.com/wiki/clearBackpackCargoGlobal + https://community.bistudio.com/wiki/boundingCenter - clearBackpackCargoGlobal Object + boundingCenter Object - clearBackpackCargoGlobal unit + boundingCenter object - $Code$clearBackpackCargoGlobal jeepOne;$/Code$ + $Code$_center = boundingCenter TruckOne$/Code$ - global / global + undefined / undefined - (July 6, 2017) - This will remove not only backpacks, but vests and uniforms as well. - Nothing + Array + - clearGroupIcons + getTotalDLCUsageTime - Removes all icon from group. + Returns total DLC usage time in this game session - https://community.bistudio.com/wiki/clearGroupIcons + https://community.bistudio.com/wiki/getTotalDLCUsageTime - clearGroupIcons Group + getTotalDLCUsageTime - clearGroupIcons group + getTotalDLCUsageTime - + $Code$_dlcTime = getTotalDLCUsageTime ;$/Code$ + undefined / undefined - Nothing + Number + - clearItemCargoGlobal + switchLight - Removes all items from ammo box (or any general weapon holder container). + Controls whether a lamp is lit or not. For working with CfgNonAIVehicles class "StreetLamp" only. - https://community.bistudio.com/wiki/clearItemCargoGlobal + https://community.bistudio.com/wiki/switchLight - clearItemCargoGlobal Object + Object switchLight String - clearItemCargoGlobal box + lamp switchLight mode - + $Code$( object 12345) switchLight "OFF"$/Code$ + + $Code$nearestObject [player, "Streetlamp"] switchLight "OFF"$/Code$ + - global / global + undefined / undefined + (January 23, 2010) + If you want turn street lamp off in ArmA2, the syntax is: + ID959522=position player nearestObject 959522 + ID959522 switchLight "off" + + (September 16, 2013) + In ArmA3 use setHit instead: + $Code$_lamp = nearestObject [ player, "Lamps_base_F"]; + _lamp setHit ["light_1_hitpoint", 0.97]; //off + _lamp setHit ["light_1_hitpoint", 0]; //on$/Code$ + Switch all lights off in the 500 radius of player: + $Code${ + for "_i" from 0 to count getAllHitPointsDamage _x - 1 do + { + _x setHitIndex [_i, 0.97]; + }; + } + forEach nearestObjects + [ + player, + [ + "Lamps_base_F", + "PowerLines_base_F", + "PowerLines_Small_base_F" + ], + 500 + ];$/Code$ - Nothing + Nothing + - clearItemCargo + tvExpandAll - Removes all items from ammo box (or any general weapon holder container). + Expands all tree items for the given Tree View. - https://community.bistudio.com/wiki/clearItemCargo + https://community.bistudio.com/wiki/tvExpandAll - clearItemCargo Object + tvExpandAll Number + + tvExpandAll Control - clearItemCargo box + tvExpandAll idc + + tvExpandAll control - $Code$clearItemCargo myBox;$/Code$ + $Code$tvExpandAll 101;$/Code$ + + $Code$tvExpandAll _ctrl;$/Code$ - undefined / undefined + local / local - Nothing + Nothing - Nothing + - clearItemPool + lbSetPictureColor - Removes all items from ammo box (or any general weapon holder container) + Sets the color of item's picture (left) with the given index of the listbox with id idc of the topmost user dialog to the given color. Color is in format Color. Color which consists from only zeros means disable this override. - https://community.bistudio.com/wiki/clearItemPool + https://community.bistudio.com/wiki/lbSetPictureColor - clearItemPool Object + lbSetPictureColor Array + + Control lbSetPictureColor Array - clearItemPool box + lbSetPictureColor [idc, index, color] + + control lbSetPictureColor [index, color] - $Code$clearItemPool jeepOne$/Code$ + $Code$lbSetPictureColor [101, 0, [0, 1, 0, 0.5]];$/Code$ + + $Code$_ctrl lbSetPictureColor [0, [1, 1, 1, 1]];$/Code$ undefined / undefined + More information on the LB command family can be found here + + (August 18, 2015) + (ArmA 3 1.48) To give an image on the right side of a listbox item: + $Code$_ctrl lbSetPictureRightColor [_index, [1,1,1,0.7]];$/Code$ - Nothing + Nothing - Nothing + - clearMagazineCargoGlobal + weaponInertia - Removes all magazines from the vehicle cargo space. MP synchronized. + Returns current rate of how much the weapon view is distorted because of quick aiming - https://community.bistudio.com/wiki/clearMagazineCargoGlobal + https://community.bistudio.com/wiki/weaponInertia - clearMagazineCargoGlobal Object + weaponInertia Object - clearMagazineCargoGlobal unit + weaponInertia unit - $Code$clearMagazineCargoGlobal jeepOne;$/Code$ + $Code$_inertia = weaponInertia player ;$/Code$ - global / global + undefined / undefined - Nothing + Array + - clearMagazineCargo + hideObjectGlobal - Remove all magazines from the given vehicle's magazine cargo space. + This command is designed for MP. Hides object on all connected clients as well as JIP. Call on the server only. Can be used on all objects with class names, i.e. ( typeOf object != ""). In SP this command behaves just like hideObject. - https://community.bistudio.com/wiki/clearMagazineCargo + https://community.bistudio.com/wiki/hideObjectGlobal - clearMagazineCargo Object + hideObjectGlobal Object + + Object hideObjectGlobal Boolean - clearMagazineCargo vehicleName + hideObjectGlobal object + + object hideObjectGlobal hidden - $Code$clearMagazineCargo _truck;$/Code$ + $Code$hideObjectGlobal nearestBuilding [2500,2500,0];$/Code$ + + $Code$objectname hideObjectGlobal true;$/Code$ - global / local + global / global - (11:02, 24 October 2009 (CEST)) - Effect is local, run on each client for global effect. - - - Nothing - - - - - clearMagazinePool + This scripting command must be executed on the server to work properly in multiplayer + + (June 27, 2015) + hideObject and hideObjectGlobal disable object collision in addition to rendering. A3 1.45.131175 + (tested by hiding buildings and running through, driving through, flying through, and shooting through where the building used to be) + + (September 1, 2016) + As of A3 1,62.134494 running hideObjectGlobal in big loop may cause some objects not to be hidden for a players already connected or passed JIP. To avoid players rendering desync consider running that in preInit schedule of a server. + + (August 7, 2017) + In A3 1.72.142342 when you hide object via hideObjectGlobal, model sounds still be audible. + For e.g. if you delete apex house from map, you still hear a conditioner sound at this spot + + + Nothing - Nothing + + + + + + ctValue - Remove all magazines from the magazine pool, of which the player may choose in the following missions. Available in campaigns only. + Returns metadata (number) associated with a particular row of RscControlsTable. - https://community.bistudio.com/wiki/clearMagazinePool + https://community.bistudio.com/wiki/ctValue - clearMagazinePool + ctValue Control - clearMagazinePool + ctValue Control - + $Code$_number = ctValue _control;$/Code$ + - undefined / undefined + local / local - Nothing + Number + - clearOverlay + hasPilotCamera - Clear the current overlay. - i - Some Old Editor Command + Returns true if the object airplane or helicopter has a pilotCamera. - https://community.bistudio.com/wiki/clearOverlay + https://community.bistudio.com/wiki/hasPilotCamera - clearOverlay Control + hasPilotCamera Object - clearOverlay map + hasPilotCamera object - $Code$clearOverlay _map,$/Code$ + $Code$hasPilotCamera vehicle player$/Code$ - undefined / undefined + global / undefined - Nothing + Boolean + - clearRadio + sliderSetRange - Clean up the content of radio protocol history. + Set limits of slider idc of topmost user dialog. - https://community.bistudio.com/wiki/clearRadio + https://community.bistudio.com/wiki/sliderSetRange - clearRadio + sliderSetRange Array + + Control sliderSetRange Array - clearRadio + sliderSetRange [idc, min, max] + + control sliderSetRange [min, max] - $Code$clearRadio;$/Code$ + $Code$sliderSetRange [101, 0, 100];$/Code$ - undefined / local + undefined / undefined - Use $Code$ enableRadio false;$/Code$ to disable the chat. - Nothing + Nothing - Nothing + - clearWeaponCargoGlobal + removeAllItemsWithMagazines - Removes all weapons from the vehicle cargo space. MP synchronized. + Removes all itemsWithMagazines from the uniform, vest and backpack. - https://community.bistudio.com/wiki/clearWeaponCargoGlobal + https://community.bistudio.com/wiki/removeAllItemsWithMagazines - clearWeaponCargoGlobal Object + removeAllItemsWithMagazines Object - clearWeaponCargoGlobal unit + removeAllItemsWithMagazines unit - $Code$clearWeaponCargoGlobal jeepOne;$/Code$ + $Code$removeAllItemsWithMagazines player ;$/Code$ - global / global + undefined / undefined - Nothing + Nothing + - clearWeaponCargo + current3DENOperation - Remove all weapons from the given vehicle's weapon cargo space. + Returns the currently performed editing operation in Eden Editor. - https://community.bistudio.com/wiki/clearWeaponCargo + https://community.bistudio.com/wiki/current3DENOperation - clearWeaponCargo Object + current3DENOperation - clearWeaponCargo vehicleName + current3DENOperation - $Code$clearWeaponCargo _truck$/Code$ + $Code$if ( current3DENOperation == "Move") then { hint "Moving";};$/Code$ - global / local + undefined / undefined - (October 24, 2009) - Only works on clients. - Nothing + String + - clearWeaponPool + setUnitLoadout - Remove all weapons from the weapon pool, of which the player may choose in the following missions. Available in campaigns only. + Creates a loadout from given inventory structure and applies it to a unit. + This command is not final and might be changed in a near future. - https://community.bistudio.com/wiki/clearWeaponPool + https://community.bistudio.com/wiki/setUnitLoadout - clearWeaponPool + Object setUnitLoadout Array - clearWeaponPool + unit setUnitLoadout [loadout, rearm] - + $Code$_loadout = getUnitLoadout player_1 ; + player_2 setUnitLoadout _loadout;//Copies loadout from player_1 and applies it to player_2$/Code$ + - undefined / undefined + global / global - Nothing + Nothing + - clientOwner + clearAllItemsFromBackpack - Returns the client's owner id + Removes all items from the backpack. - https://community.bistudio.com/wiki/clientOwner + https://community.bistudio.com/wiki/clearAllItemsFromBackpack - clientOwner + clearAllItemsFromBackpack Object - clientOwner + clearAllItemsFromBackpack unit - $Code$_id = clientOwner ;$/Code$ - + undefined / undefined - (February 17, 2016) - On hosted server there could be some inconsistency between clientOwner, owner and object creator id, especially in missions started from save. On the dedicated server this command however works reliably. - Number + Nothing + - closeDialog + createDisplay - Close the currently active user dialog with exit code. Most common exit codes are: - $Code$#define IDC_OK 1 //emulate "Ok" button$/Code$ - $Code$#define IDC_CANCEL 2 //emulate "Cancel" button$/Code$ + Creates child display of given display and loads from "resourceName". The notable difference between createDisplay and createDialog is that with createDisplay the player would be able to move whilst having control of the mouse pointer. + Since Arma 3 v1.49.131653 createDisplay returns Display and will first look in description.ext for resourceName config, if not found, it will then look in main config. + Displays created with both createDisplay and createDialog will take control of the mouse pointer and will close when user presses Esc. + $Code$_emptyDisplay = findDisplay 46 createDisplay "RscDisplayEmpty";$/Code$ + If display is needed which exists independently, it can be created in IGUI layer with cutRsc command. + $Code$"someLayer" cutRsc ["RscTitleDisplayEmpty", "PLAIN"]; + _emptyDisplay = uiNamespace getVariable "RscTitleDisplayEmpty";$/Code$ + Such display can be closed with closeDisplay command or by overwriting the same cut layer with another output. Note that "Unload" EH for some reason does not work with such display. - https://community.bistudio.com/wiki/closeDialog + https://community.bistudio.com/wiki/createDisplay - closeDialog Number + Display createDisplay String - closeDialog exitcode + parent createDisplay resourceName - $Code$closeDialog 2;$/Code$ - - $Code$#define IDC_CANCEL 2 - closeDialog IDC_CANCEL;$/Code$ + $Code$findDisplay 46 createDisplay "RscCredits";$/Code$ - local / local + undefined / undefined + (August 23, 2014) + Do not simply createDisplay from UI context code such as "ButtonDown" UI Event handler, as it will crash the game. Instead use spawn scope: + $Code$[] spawn { findDisplay 46 createDisplay "RscCredits"};$/Code$ + + (November 15, 2014) + Arma3 v1.34 + When using CreateDisplay instead of CreateDialog, all the commands for working with the controls of the display only work with the control version, not the IDC version. + EXAMPLE: + $Code$LbAdd [1234, "item"]; // does not work on displays, and won't error either + _ctrl LbAdd "item"; // does work with displays$/Code$ + So you have to use the control(DisplayCtrl) and not the IDC. + + (July 29, 2017) + A user dialog created with createDisplay over mission display ( findDisplay 46) will stop display event handlers added to mission display from firing. However if it is created with createDialog then the event handlers continue to work. - Nothing + Nothing/Display + - closeDisplay + getText - Close given display with exit code. Most common exit codes are: - $Code$#define IDC_OK 1 //emulate "Ok" button$/Code$ - $Code$#define IDC_CANCEL 2 //emulate "Cancel" button$/Code$ + Extract text from config entry. - https://community.bistudio.com/wiki/closeDisplay + https://community.bistudio.com/wiki/getText - Display closeDisplay Number + getText Config - display closeDisplay exitcode + getText config - $Code$_display closeDisplay 1;$/Code$ - - $Code$#define IDC_OK 1 - _display closeDisplay IDC_OK;$/Code$ + $Code$_text = getText ( configFile "CfgVehicles" "Thing" "icon");$/Code$ undefined / undefined - (November 18, 2015) - closeDisplay does not instantly close the display but does it on next display simulation cycle (when display becomes active) + (Mar 28, 2014) + (ArmA3 1.14) It's recommended to use BIS_fnc_GetCfgData or BIS_fnc_returnConfigEntry to get variable cfg data rather than conditioning via isNumber, isText, isArray, getNumber, getText and getArray combination. + Traditional workaround: + $Code$ + _cfg = configFile "CfgVehicles" _SomeAddonClassName "DestructionEffects" "Smoke1" "type" + switch ( true ) do + { + case ( isNumber _cfg): { getNumber _cfg}; + case ( isText _cfg): { getText _cfg}; + case ( isArray _cfg): { getArray _cfg;}; + default { nil }; + }; + $/Code$ + Recommended workaround: + $Code$ + ( configFile "CfgVehicles" _SomeAddonClassName "DestructionEffects" "Smoke1" "type") call BIS_fnc_GetCfgData ; + $/Code$ + To return default value once entry was not found, we can use BIS_fnc_returnConfigEntry instead of BIS_fnc_GetCfgData. e.g. + $Code$ + [( configFile "CannonFire" "LightExp"),"lifeTime",0] call BIS_fnc_returnConfigEntry ;//0.5 + $/Code$ + To compose collected String into Array, use BIS_fnc_getCfgDataArray instead. E.g. + $Code$ + ( configFile "CfgVehicles" _SomeAddonClassName "DestructionEffects" "Smoke1" "type") call BIS_fnc_getCfgDataArray ; + $/Code$ - Nothing + String + - closeOverlay + triggerAttachObject - Closes the current overlay without committing. - i - Some Old Editor Command + Assigns a static object to the trigger. The activation source is changed to "STATIC". - https://community.bistudio.com/wiki/closeOverlay + https://community.bistudio.com/wiki/triggerAttachObject - closeOverlay Control + Object triggerAttachObject Number - closeOverlay map + triggerName triggerAttachObject objectId - + $Code$_trigger triggerAttachObject 1234;$/Code$ + undefined / undefined + (October 31, 2013) + This command doesn't quite work in Arma 3 [1] + Further investigation reveals that objectId param for this command is some kind of map id and not the id you can see in the editor. This map id could be seen in multiplayer when looking at netId of the static objects, for example "1:-23984219837", the -23984219837 would be the objectId. Unfortunately it still doesn't work. - Nothing + Nothing + - collapseObjectTree + hasInterface - Collapse the object tree. - i - Some Old Editor Command + Returns true if the computer has an interface (a real player). False for a dedicated server or for a headless client. - https://community.bistudio.com/wiki/collapseObjectTree + https://community.bistudio.com/wiki/hasInterface - collapseObjectTree Control + hasInterface - collapseObjectTree map + hasInterface - $Code$collapseObjectTree _map,$/Code$ + $Code$headless = !( hasInterface || isDedicated );$/Code$ + + $Code$_isHC = ! hasInterface && ! isDedicated ;$/Code$ undefined / undefined + (December 21, 2014) + $Code$ if ( isDedicated ) then { + //run on dedicated server only + }; + if ( isServer ) then { + //run on dedicated server or player host + }; + if ( hasInterface ) then { + //run on all player clients incl. player host + }; + if (! isDedicated ) then { + //run on all player clients incl. player host and headless clients + }; + if (! isServer ) then { + //run on all player clients incl. headless clients but not player host + }; + if (! hasInterface ) then { + //run on headless clients and dedicated server + }; + if (! hasInterface && ! isDedicated ) then { + //run on headless clients only + };$/Code$ - Nothing + Boolean + - collect3DENHistory + removeMagazineGlobal - Execute a block of code in which all Eden Editor operations will be recorded as one history step. For example creating an entity, setting its attributes and then connections would normally be recorded as three different steps. Calling them all within single collect3DENHistory block will group them together and the user will need to undo only once to revert the changes. + Removes the magazine from the unit. - https://community.bistudio.com/wiki/collect3DENHistory + https://community.bistudio.com/wiki/removeMagazineGlobal - collect3DENHistory Code + Object removeMagazineGlobal String - collect3DENHistory code + unit removeMagazineGlobal magazineName - $Code$collect3DENHistory { - _logic = create3DENEntity ["Logic", "Logic", position player ]; - add3DENConnection ["Sync", [_logic], player ]; - }; - // Creates a logic and connects it to player in one history step.$/Code$ + $Code$player removeMagazineGlobal "30Rnd_65x39_caseless_mag";$/Code$ - undefined / undefined + global / global - Nothing + Nothing + - combatMode + setUnloadInCombat - Returns the combat mode of the given unit. See setCombatMode for more information about combat modes. + If cargo or turret units should get out of vehicle when in combat. If true, vehicle will stop and units will dismount. Vehicle must be local. - https://community.bistudio.com/wiki/combatMode + https://community.bistudio.com/wiki/setUnloadInCombat - combatMode Object/Group + Object setUnloadInCombat Array - combatMode grp + vehicle setUnloadInCombat [allowCargo, allowTurrets] - $Code$if (( combatMode _grp1) == "BLUE") then {_grp1 setCombatMode "GREEN"};$/Code$ + $Code$_veh setUnloadInCombat [ true, false ];$/Code$ - global / undefined + local / global - (August 3, 2006) - Notes from before the conversion: - Use setCombatMode to set the combat mode. The definitions of the colours are given under that command. - - In OFP v1.96, combatMode return value does not change when unit's combat mode is set with radio commands, ie troops under the player's command. - String + Nothing + - commandArtilleryFire + airportSide - Orders a unit to reload defined magazine commence fire burst on the given position (via the radio). + Checks a side of the airport. ID is the number to identify which airport on the island you want to check. + Possible values for sara are: + 0 - Paraiso + 1 - Rahmadi + 2 - Pita + 3 - Antigua - https://community.bistudio.com/wiki/commandArtilleryFire + https://community.bistudio.com/wiki/airportSide - Object commandArtilleryFire Array + airportSide Number + + airportSide Object - unit commandArtilleryFire [position, type, rounds] + airportSide id + + airportSide target - $Code$mortar1 commandArtilleryFire [[3000, 120, 1000], "8Rnd_82mm_Mo_shells", 3];$/Code$ + $Code$airportSide 0;$/Code$ undefined / undefined @@ -9940,906 +10850,863 @@ - Nothing + Side - Side + - commandChat + setCurrentChannel - Types text to the command radio channel. Must have assigned "ItemRadio" to see or transmit the messages. The text will be visible only on the PC where command was executed. If you need the message to show on all computers, you have to execute it globally (see remoteExec ) + Sets given channel as current chat channel. Scripted way of selecting desired channel on the UI. The given channel may be disabled (see enableChannel ), this is why this command returns boolean, true on success or false on failure. Correspondence between channel and number: + 0 = Global + 1 = Side + 2 = Command + 3 = Group + 4 = Vehicle + 5 = Direct + 6-15 = Custom Radio (see radioChannelCreate ) - https://community.bistudio.com/wiki/commandChat + https://community.bistudio.com/wiki/setCurrentChannel - Object commandChat String - - Array commandChat String + setCurrentChannel Number - unitName commandChat chatText - - [side, identity] commandChat chatText + setCurrentChannel channel - $Code$_soldierOne commandChat "Show this text";$/Code$ - - $Code$[ playerSide, "HQ"] commandChat "Do this! That's an order!";$/Code$ - - $Code$driver vehicle player sideChat "sideChat"; - driver vehicle player globalChat "globalChat"; - driver vehicle player groupChat "groupChat"; - vehicle player vehicleChat "vehicleChat"; - driver vehicle player commandChat "commandChat"; - driver vehicle player customChat [1, "customChat"]; - systemChat "systemChat";$/Code$ + $Code$_isDirectSelected = setCurrentChannel 5; // sets Direct channel as current active$/Code$ - global / local + undefined / local + (December 9, 2015) + This command can be used together with custom radio channels, but an offset of 5 must be added to the index from radioChannelCreate. + $Code$_index = radioChannelCreate [[1, 0, 0, 1], "Custom Channel 1", "%UNIT_NAME", [player]]; + setCurrentChannel (_index + 5); + $/Code$ - Nothing - Nothing + Boolean + - commandFSM + isEqualTypeAll - Orders a unit to process command defined by FSM file (via the radio). + Compares types of all elements of an array to the type of a single value. - https://community.bistudio.com/wiki/commandFSM + https://community.bistudio.com/wiki/isEqualTypeAll - Object/Array commandFSM Array + Array isEqualTypeAll Anything - unitName commandFSM [fsm name, position, target] + arr isEqualTypeAll val - $Code$_soldierOne commandFSM ["move.fsm", position player, player]$/Code$ + $Code$_arr = [1,2,3,4,5,6,7,8,9,0]; + _arr isEqualTypeAll ""; //false + _arr isEqualTypeAll 0; //true$/Code$ undefined / undefined + (November 25, 2015) + This command will return false if the array on the left side is empty ([]) regardless of the sample value. + $Code$[] isEqualTypeAll "" + - false + $/Code$ - Nothing + Boolean + - commandFire + assignedCommander - Order the given unit to fire on the given target (via the radio). - If the target is objNull, the unit is ordered to fire on its current target (set with doTarget or commandTarget ). + Returns the soldier assigned to the given vehicle as a commander. - https://community.bistudio.com/wiki/commandFire + https://community.bistudio.com/wiki/assignedCommander - Object/Array commandFire Object + assignedCommander Object - unitName commandFire target + assignedCommander vehicle - $Code$_ESoldier1 commandFire _WSoldier1$/Code$ + $Code$_commander = assignedCommander vehicleName$/Code$ - local / local + undefined / undefined - Nothing + Object + - commandFollow + ctrlTextHeight - Order the given unit to follow the given other unit (via the radio). + Returns the control text height. Supported control types are: + CT_STATIC 0 + CT_EDIT 2 ( Since Arma 3 v1.57.135040 ) + CT_STRUCTURED_TEXT 13 - https://community.bistudio.com/wiki/commandFollow + https://community.bistudio.com/wiki/ctrlTextHeight - Object/Array commandFollow Object + ctrlTextHeight Control - unitName commandFollow followedunit + ctrlTextHeight control - $Code$_soldier1 commandFollow _soldier2$/Code$ + $Code$_h = ctrlTextHeight _ctrl;$/Code$ - local / undefined + undefined / undefined + (May 24, 2017) + in ArmA 3 v.1.70.141764, this command always returns 0 if the control has no width. - Nothing + Number + - commandGetOut + isForcedWalk - Orders the unit to get out from the vehicle (via the radio). + Returns true if player is forced to walk with forceWalk. - https://community.bistudio.com/wiki/commandGetOut + https://community.bistudio.com/wiki/isForcedWalk - commandGetOut Object/Array + isForcedWalk Object - commandGetOut unitName + isForcedWalk unitName - $Code$commandGetOut _unitOne$/Code$ + $Code$_bool = isForcedWalk player ;$/Code$ - local / global + undefined / undefined - Nothing + Boolean + - commandMove + lbSetPictureColorDisabled - Order the given unit(s) to move to the given location (via the radio). Exactly the same as doMove, except this command displays a radio message. + Sets the disabled color of item's picture (left) with the given index of the listbox with id idc of the topmost user dialog to the given color. Color is in format Color. Color which consists from only zeros means disable this override. - https://community.bistudio.com/wiki/commandMove + https://community.bistudio.com/wiki/lbSetPictureColorDisabled - Object/Array commandMove Array + lbSetPictureColorDisabled Array + + Control lbSetPictureColorDisabled Array - unitName commandMove position + lbSetPictureColorDisabled [idc, index, color] + + control lbSetPictureColorDisabled [index, color] - $Code$_soldier1 commandMove ( getMarkerPos "Marker1")$/Code$ + $Code$lbSetPictureColorDisabled [101, 0, [1, 1, 1, 0.25]];$/Code$ + + $Code$_ctrl lbSetPictureColorDisabled [0, [1, 1, 1, 0.25]];$/Code$ - local / global + undefined / undefined + More information on the LB command family can be found here - Nothing + Nothing - Nothing + - commandRadio + currentMagazineDetailTurret - Sends the audio message to the command radio channel. Must have assigned "ItemRadio" to send or receive the transmission. The message is defined in CfgRadio in the description.ext file or config radio protocol. The transmission will play only on the PC where command was executed. If you need the transmission to play on all computers, you have to execute it globally (see remoteExec ). - Note: When transmitting unit gets killed, transmission will be interrupted, however when receiving unit gets killed, the transmission continues to play. + Returns the class name of currently used magazine on specified turret. Use turret path [-1] for driver's turret. Note that a turret is not loaded until unit enters it, so this command will return "". - https://community.bistudio.com/wiki/commandRadio + https://community.bistudio.com/wiki/currentMagazineDetailTurret - Object commandRadio String - - Array commandRadio String + Object currentMagazineDetailTurret Array - unit commandRadio radioName - - [side, identity] commandRadio radioName + vehicle currentMagazineDetailTurret [turret path] - $Code$_soldierOne commandRadio "messageOne";$/Code$ - - $Code$player commandRadio configName selectRandom ("true" configClasses ( configFile "CfgRadio"));$/Code$ - - $Code$[ west, "Base"] commandRadio configName selectRandom ("true" configClasses ( configFile "CfgRadio"));$/Code$ + $Code$_magazineDetail = MBT_Kuma currentMagazineDetailTurret [0];$/Code$ - global / local + undefined / undefined - (June 24, 2010) - example: $Code$ _unit commandRadio "SentCmdHide";$/Code$ - radio command from CA_Dubbing config should work - - (December 3, 2016) - To transmit user custom sounds (see Multiplayer_Custom_Sounds_Tutorial ), prefix the full filename including file extension with #. For example if there is a custom user sound file called MySound.ogg, to play it on the radio use: - $Code$ player commandRadio "#MySound.ogg";$/Code$ - Nothing - Nothing + String + - commandStop + addMagazineAmmoCargo - Order the given unit(s) to stop (via the radio). A stop command will never finish, the unit will never be ready. + Adds magazines with specified ammo count to the cargo space of a vehicle or a container. - https://community.bistudio.com/wiki/commandStop + https://community.bistudio.com/wiki/addMagazineAmmoCargo - commandStop Object/Array + Object addMagazineAmmoCargo Array - commandStop unitName + cargospace addMagazineAmmoCargo [magazine, quantity, ammocount] - $Code$commandStop _soldier1;$/Code$ - - $Code$commandStop [_soldier1, _soldier2];$/Code$ - - $Code$commandStop ( units player );$/Code$ + $Code$_ammobox addMagazineAmmoCargo ["30Rnd_65x39_caseless_mag", 2, 5];$/Code$ global / global - In ArmA 1.14, this command will not stop a unit that has been given a move order by means of selecting the unit, then clicking on the in game map (or ground). - Nothing + Nothing + - commandSuppressiveFire + cursorTarget - Order the given unit to suppress a given position or target (via the radio). + Returns the target pointed at by the player (usually with cross-hairs). The target has to be known to the player to some degree ( knowsAbout 0). If target is completely unknown, command returns objNull. + A valid target could belong to an enemy or a friendly side. Buildings are normally known to player and so are valid targets. Try nearTargets to see what else is considered a target. While friendly targets are usually known to the player, enemy targets can be totally unknown, especially if "auto-spotting" (or sometimes called "auto-reporting") is switched off. To check if auto-spotting is enabled: difficultyEnabled "autospot" + cursorTarget also returns locked target for the duration of the lock even if there is another target under the cursor. As soon as missile is fired, cursorTarget switches to current known target under cursor or objNull. Targeting (currently "T" in Arma 3) works regardless of the state of "auto-spotting". + Adding a target to the known list could be done with reveal command. When auto-spotting is enabled, zooming on the enemy target with cross-hairs usually reveals the target. As friendly targets are always known, zooming on friendly target could improve knowsAbout value. + Side relations can also influence target knowledge. For example east target is unknown target for civilian, but making them friends with setFriend instantly improves civilian knowledge of the east. - https://community.bistudio.com/wiki/commandSuppressiveFire + https://community.bistudio.com/wiki/cursorTarget - Object/Array commandSuppressiveFire Object/Array + cursorTarget - unitName commandSuppressiveFire target + cursorTarget - $Code$_soldier commandSuppressiveFire [1869.508,5760.962,0.000]$/Code$ - - $Code$_soldier commandSuppressiveFire cursorTarget$/Code$ + $Code$alive cursorTarget ;$/Code$ - local / local + undefined / undefined - (October 8, 2016) - Command expects position as second argument in format ASL in A3 1.64.138497. + (01:25, 18 February 2011 (CET)) + If the player is in a vehicle and a lockable weapon is selected and a target is locked, the locked target will be returned, regardless if it's in sight or not. + + (11 March 2011) + Addition to Myke's note: + It also works for infantry with launchers that canLock, like Javelin or AA. + Only the lock cursor must be visible on the target - not a full lock necessarily. + + (13:09, 11 July 2009 (CEST)) + Player must knows about what he is pointing to for this command to return something other than NULL-OBJECT + This command doesn't work through building windows + This recognition doesn't work with every object : soldiers, vehicles, big houses are ok, but not trees, plants, road signs or others little things + + (22:11, 23 August 2013 (CEST)) + To add to Lou Montana's note, use reveal command on the object you want to be detected with cursorTarget when pointing at it. Without it, distant units are most likely to return objNull even if you shoot and hit them. Units that have been previously subjected to enableSimulation false; or enableSimulationGlobal false; may stay unrecognised for a long time even after simulation was re-enabled, returning objNull as cursorTarget. Force revealing units with reveal command usually solves the problem. For example: $Code${ player reveal _x} forEach allUnits ;$/Code$ + + (December 3, 2014) + cursorTarget seems to change when your cursor enters an object's boundingBox. Because of this, if the player is inside the boundingBox, the object will always be the current cursorTarget if the player is not looking at another object, although sometimes the object will remain the cursorTarget even if the player does. + + (April 21, 2015) + Cursortarget will not return enemy units, even very close, if "autoreport" is disabled in game difficulty settings, and if player is alone. + However, when enemy units open fire on player, the cursortarget becomes functional on these units. If player is in a group, cursortarget is also functional (report by other units). + + (February 5, 2016) + CursorTarget will return a Null_Object for all of thus which have a disabled simulation (_object enableSimulation false). - Nothing + Object + - commandTarget + inputAction - Order the given unit(s) to target the given target (via the radio). Command given to the player, puts a red square with words Target and Distance on player's HUD at target location. If player in vehicle and has radar facilities, it also adds target marker to the radar. + Return the state of input devices mapped to given input action. + For Arma 3 inputActions see: inputAction/actions. + For Arma 3 inputActions bindings see: inputAction/actions/bindings. + For earlier Arma editions see Category:Key Actions. - https://community.bistudio.com/wiki/commandTarget + https://community.bistudio.com/wiki/inputAction - Object commandTarget Object + inputAction String - unitName commandTarget target + inputAction name - $Code$_ESoldier1 commandTarget _WSoldier1;$/Code$ + $Code$inputAction "leanLeft" + // Returns 1 if the button mapped to "leanLeft" is pressed currently else 0.$/Code$ - $Code$player commandTarget bob;$/Code$ + $Code$[] spawn { + waitUntil { inputAction "reloadMagazine" 0}; + hint "Reload Key Pressed"; + };$/Code$ - local / global + undefined / undefined + (07:38, 15 October 2010 (CEST)) + This command also returns values other than 0 and 1 (like 0.02 or 1.3). Any value greater than zero usually signals that the key or button is pressed. inputAction does not work reliably when used in RscDisplayMission's onKeyDown event handler (the same is probably true for other input related event handlers). + + (May 8, 2014) + inputAction does not return the actual state of the queried key when a dialog screen is open. Instead, it will always return 0. + + (July 31, 2015) + inputAction is capable of returning the state of analog inputs. This includes mouse, joystick, and even TrackIR. A joystick axis will return a value from 0 to 1, while mouse movement returns the rate of change, which can be 1. + Right mouse click is currently not supported, but right mouse hold is. http://feedback.arma3.com/view.php?id=25015 - Nothing + Number + - commandWatch + setSpeedMode - Orders the unit(s) to watch the given position or target (via the radio). Use objNull as the target to order a unit to stop watching a position/target + Set group speed mode. Mode may be one of: + "LIMITED" (half speed) + "NORMAL" (full speed, maintain formation) + "FULL" (do not wait for any other units in formation) - https://community.bistudio.com/wiki/commandWatch + https://community.bistudio.com/wiki/setSpeedMode - Object/Array commandWatch Array - - Object/Array commandWatch Object + Object/Group setSpeedMode String - unitName commandWatch position - - unitName commandWatch target + groupName setSpeedMode mode - $Code$_soldierOne commandWatch markerPos "MarkerMoveOne"$/Code$ - - $Code$[s1,s2] commandWatch player$/Code$ + $Code$_groupOne setSpeedMode "LIMITED"$/Code$ local / global - - - Nothing - Nothing - - - - - commander - - - In OFP it returns the commander of a vehicle. Since ArmA and VBS2 it returns the primary observer. The commander of a vehicle can be found with effectiveCommander. - - - https://community.bistudio.com/wiki/commander - - - commander Object - - - commander vehicleName - - - $Code$moveOut commander _tank;$/Code$ - - $Code$// Detect if player is in commander turret of a vehicle: - _isVehicleCommander = player isEqualTo commander objectParent player ;$/Code$ - - - global / undefined - - - (August 3, 2006) - Notes from before the conversion: - It is also possible to find the commander of a vehicle by placing a C after the name of the vehicle so Tank1C and commander Tank1 both refer to the same unit, providing the original commander has not got out of the tank. - The difference between the two is Tank1C is always the unit that was commander of the tank when the mission started, whilst commander Tank1 is the commander which is now there. + (14 Feb 2010) + Although setSpeedMode can be called on an individual unit, the entire group will be affected. - (August 3, 2006) - WARNING about Hardrock note: - Take very care about this : if you give a vehiculeVarName to one crew, so his referent will not be Tank1x anymore ! Also, if in the mission editor, you put something in the name field, when this soldier will getin a vehicle, it will not be a Tank1x too. So do not take consideration about Hardrock note, if you don't want to have bad surprise. It Is better to force names by using setVehicleVarName command. - $Code$(( crew tank) select 0) setVehicleVarName "Tankcrew0"$/Code$ + (17 May 2008) + In Multiplayer, this command is overwritten by itself to NORMAL or FULLSPEED (i don't know which one, but it's fast move) when you ask the unit to move via script (ex : _unit doMove (getMarkerPos "destination"); ) + The solution to solve this problem is to initialize the setSpeedMode after your order the unit to move. + So basically it gives you : + _unit doMove (getMarkerPos "destination"); + _unit setSpeedMode "LIMITED"; + If you plan to move the unit again after it reaches its destination, you will have to set the speed mode to LIMITED again like i did just above. - Object + Nothing + - commandingMenu + isVehicleCargo - Return the name of the player actual topmost commanding menu. + Return transporting vehicle if vehicle is loaded in one. - https://community.bistudio.com/wiki/commandingMenu + https://community.bistudio.com/wiki/isVehicleCargo - commandingMenu + isVehicleCargo Object - commandingMenu + isVehicleCargo vehicle - $Code$waitUntil { commandingMenu == "RscStatus"}; hint "Press 4, I'm bleeding !";$/Code$ + $Code$// Blackfish with given variable name blackfish, with a vehicle inside called quad + _transportingVehicle = isVehicleCargo quad; //returns blackfish + //Vehicle called quad that is not being transported as cargo + _transportingVehicle = getVehicleCargo quad; //returns objNull$/Code$ undefined / undefined - (July 15, 2009) - Possible values are : - "" - means menu is closed - "RscMainMenu" - Main menu, by pressing backspace - "RscMoveHigh" - Move menu (1) - "#WATCH" - Watch menu (2) - "#WATCH0" - Watch menu - next page (2-0) - "RscWatchDir" - Engage menu (3) - "RscWatchMoreDir" - Engage menu - watch a direction (3-8) - "#GET_IN" - Mount menu (4) - "RscStatus" - Status menu (5) - "RscCallSupport" - Mount menu - call support (5-1) - "#ACTION" - Action menu (6) - "RscCombatMode" - Combat mode menu (7) - "RscFormations" - Formation menu(8) - "RscTeam" - Team menu (9) - "RscSelectTeam" - Team menu - select team (0-5) - "RscReply" - Reply menu (0) - "#User:BIS_Menu_GroupCommunication" - Communication menu (0-8) - "#CUSTOM_RADIO" - Custom sounds menu (0-9) - "RscRadio" - Radio menu (0-0) - "RscGroupRootMenu" - "simplified" menu - String + Object + - comment + items - Define a comment. - Mainly used in SQF Syntax, as you're able to introduce comment lines with semicolons in a SQS script. + Returns an array of names of all special items of a vehicle or a soldier. - https://community.bistudio.com/wiki/comment + https://community.bistudio.com/wiki/items - comment String + items Object - comment commentMsg + items unit - $Code$// script.sqs - comment "This is a commented line"$/Code$ + $Code$_itemsplayer = items player ;$/Code$ - $Code$// function.sqf - comment "This is a commented line";$/Code$ + $Code$player sideChat format ["%1", items player ];$/Code$ - undefined / undefined + global / undefined - (September 12, 2009) - Like ArmA, you can't use brackets to make a multi-lines comment. But, in a sqf file, you can make a comment as follow : - $Code$ comment " - first line - seconde line";$/Code$ - - (November 4, 2016) - If a file is loaded with preprocessFile, execVM or spawn (but not loadFile), you may also define C-like comments using //... and /*...*/. - - (November 4, 2016) - comment can also be used to create comments inside trigger activation fields where // or */...*/ does not work. + (June 18, 2013) + Arma 3, version 0.70 - magazines, explosives, grenades and all items currently linked on the unit are not returned now. - Nothing + Array + - commitOverlay + preprocessFileLineNumbers - Commit the current overlay. - i - Some Old Editor Command + Returns the preprocessed content of the given file. The preprocessor is C-like, it supports comments using /* */ and PreProcessor_Commands. The preprocessor also adds a default debug entrypoint for compiler at the begining of script: #line 1 "aFilename" + The #line keyword can be used in any script that are not preprocess, or with preprocess script with extra macro to protect reserverd sharp character. The format is: + #line number " name " + followed by new line. number could be only positive integer and name could be any name. This will be used only if an error occurs in the script. The error will contain the line: + File filename, line linenumber + where filename will be the name you set and linenumber will be number + how many lines it is from the #line line. If the error happened on the line right under #line it will add 0 to number, if on second line, it will add 1 etc. + It is possible to use more than one #line keywords, but it seems having just one at the top for little script is enough to pinpoint position of the error easily. - https://community.bistudio.com/wiki/commitOverlay + https://community.bistudio.com/wiki/preprocessFileLineNumbers - commitOverlay Control + preprocessFileLineNumbers String - commitOverlay map + preprocessFileLineNumbers fileName - $Code$commitOverlay _map,$/Code$ + $Code$_string = preprocessFileLineNumbers "A3\ui_f\scripts\IGUI\RscUnitInfo.sqf" + // Result is: + //#line 1 "A3\ui_f\scripts\IGUI\RscUnitInfo.sqf" + //disableserialization; + //........$/Code$ undefined / undefined + (December 17, 2013) + The main difference between preprocessFile and preprocessFileLineNumbers is that the latter adds #line keyword to the target file, which allows to log the __LINE__ error happened at and the __FILE__ error happened in. + + (November 4, 2017) + The #line directive get's removed from the output. + So to add a custom #line directive before while using preprocessFileLineNumbers, you have to use a preprocessor macro like this: + #define DEBUG(sharp,name) sharp##line 0 name + and add this at the right place in your code + DEBUG(#,"your filename"); + This way you can have custom filenames in error messages. - Nothing + String + - compileFinal + setLightAmbient - Compile expression and makes it final, preventing it from: - repeated compile or compileFinal - removal by nil - remote rewrite using publicVariable, publicVariableClient and publicVariableServer + Set ambient color of light. This includes surfaces that face away from the light, unlike setLightColor. - https://community.bistudio.com/wiki/compileFinal + https://community.bistudio.com/wiki/setLightAmbient - compileFinal String + Object setLightAmbient Array - compileFinal expression + light setLightAmbient [r, g, b] - $Code$myCode = compileFinal "a = a + 1"; - call myCode; - //--- Repeated compile won't have any effect - myCode = compileFinal "a = a + 2"; - //--- Duplicate code will be final as well - myDuplicateCode = myCode;$/Code$ + $Code$myLight setLightAmbient [0.5,0,0]; //produces red light around the origin source$/Code$ - undefined / local + local / local - (August 14, 2013) - When broadcasting a compileFinal'ed variable using publicVariable or its variants, the variable also becomes final on the other client(s) and/or the server. - Also, compileFinal does not prevent event handlers from being removed or overwritten. + (Dec 1, 2006) + Light can be created with command createVehicleLocal with special vehicle class "#lightpoint" + for example: + $Code$_light = "#lightpoint" createVehicleLocal pos; + _light setLightBrightness 1.0; + _light setLightAmbient [0.0, 1.0, 0.0]; + _light setLightColor [0.0, 1.0, 0.0]; + _light lightAttachObject [_object, [0,0,0]]; + $/Code$ - (May 27, 2017) - in ArmA 3 1.70.141838, compileFinal also works for profileNamespace and uiNamespace. But be careful with that. + (Aug 17, 2007) + To clarify: + setLightAmbient - Terrain and surrounding objects are bathed in this colour. + setLightColor - Controls the "haze" seen around the lightsource (ex flares). + + (Mar 25, 2014) + When both setLightAmbient and setLightColor were [0,0,0], there won’t be any visual presentation on the light source. - Code + Nothing + - compile + getPosASLW - Compile expression. + Returns the object position height above sea surface (waves included). - https://community.bistudio.com/wiki/compile + https://community.bistudio.com/wiki/getPosASLW - compile String + getPosASLW Object - compile expression + getPosASLW obj - $Code$_string = "a = a + 1"; - _code = compile _string; - call _code;$/Code$ - - $Code$hint str compile "a = b"; - //Result: {a=b}$/Code$ + $Code$_pos = getPosASLW _diver;$/Code$ - undefined / undefined + global / undefined - Code + Array + - completedFSM + getPosWorld - Check whether the given FSM completes. - The FSM handle is the number returned by the execFSM command. + Returns PositionWorld, which is PositionASL of the model centre [0,0,0] of an object, rather than transformed boundingCenter or LandContact vertices. - https://community.bistudio.com/wiki/completedFSM + https://community.bistudio.com/wiki/getPosWorld - completedFSM Number + getPosWorld Object - completedFSM fsmHandle + getPosWorld object - $Code$_completed = completedFSM _fsmHandle;$/Code$ + $Code$_obj setPosWorld getPosWorld _obj;$/Code$ + + $Code$ATLToASL (_groundObj modelToWorld [0,0,0]) isEqualTo getPosWorld _groundObj; //true$/Code$ + + $Code$// Wave height under a boat: + _h = ((boat modelToWorld [0,0,0]) vectorDiff getPosWorld boat) select 2;$/Code$ - undefined / undefined + global / undefined - Boolean + Array + - composeText + menuHover - Creates a structured text by joining the given structured or plain texts. + Returns path to menu entry mouse is currently hovering over. - https://community.bistudio.com/wiki/composeText + https://community.bistudio.com/wiki/menuHover - composeText Array + menuHover Number - composeText [text1, text2,] + menuHover idc - $Code$_txt = composeText ["First line", image "data\isniper.paa", lineBreak, "Second line"];$/Code$ - + undefined / undefined - Structured_Text + Array + - configClasses + ctrlSetFontSecondary - Returns an array of config entries which meet criteria in condition code. Command iterates through all available config sub classes of the given config class. Current looked at config is stored in _x variable (similar to alternative count command implementation). Condition has to return true in order for the looked at config to be added to the resulting array. Slightly faster than configProperties, but doesn't account for config properties or inherited entries. - The condition code passed to configClasses should only be used for simple filter expressions and nothing more + Sets the font size of the secondary text of given control. - https://community.bistudio.com/wiki/configClasses + https://community.bistudio.com/wiki/ctrlSetFontSecondary - String configClasses Config + Control ctrlSetFontSecondary String - condition configClasses config + ctrl ctrlSetFontSecondary fontClass - $Code$// collect all CfgVehicles configs: - _configs = " true " configClasses ( configFile "CfgVehicles");$/Code$ - - $Code$// Return all classes that can transport 10 and more soldiers: - _transporters = " getNumber (_x 'transportSoldier') = 10" configClasses ( configFile "CfgVehicles");$/Code$ - - $Code$// Return all classes that inherit from 'RscText': - hint str (" inheritsFrom _x == ( configFile 'RscText')" configClasses configFile );$/Code$ + $Code$_control ctrlSetFontSecondary "TahomaB";$/Code$ undefined / undefined - (oct 19, 2014) - A fantastic way to filter stuff. eg; Create an array of west vehicles and spawn then in front of the player in rows of 5 - $Code$ - private ["_cfgArray","_xPos","_yPos","_veh"]; - _cfgArray = "( - (getNumber (_x 'scope') = 2) && - {getNumber (_x 'side') == 1 && - {getText (_x 'vehicleClass') in ['Armored', 'Car', 'Air'] - } - } - )" configClasses (configFile "CfgVehicles"); - _xPos = 0; - _yPos = 0; - { - _yPos = _yPos + 20; - _veh = createVehicle [ ( configName _x ), player modelToWorld [_xPos, _yPos, 0], [], 0, "None"]; - if (_yPos = 100) then { - _yPos = 0; - _xPos = _xPos + 20; - }; - } forEach _cfgArray; - $/Code$ - - (May 28, 2016) - configClasses does not account for inherited subclasses, use configProperties with isClass filter instead - $Code$ configProperties [_config, " isClass _x", true ];$/Code$ - - (May 28, 2017) - this will get a list of ALL locations on the currently loaded world - $Code$( "true" configClasses ( configFile "CfgWorlds" worldName "names" ) ) apply { - // change each config entry into a location - nearestLocation [ - getArray ( _x "position" ), - getText ( _x "type" ) - ] - };$/Code$ - Array + Nothing + - configFile + setPilotCameraRotation - Return root of config entries hierarchy. - See AllInOne Config for a full config extract as example. + Sets rotation (relative to the centered camera position) of the object airplane or helicopter pilotCamera. - https://community.bistudio.com/wiki/configFile + https://community.bistudio.com/wiki/setPilotCameraRotation - configFile + Object setPilotCameraRotation Array - configFile + object setPilotCameraRotation rotation - $Code$_isMyClassActive = isClass ( configFile / "CfgPatches" / "MyClass");$/Code$ + $Code$vehicle player setPilotCameraRotation [ rad 90, rad 45 ]$/Code$ - undefined / undefined + local / undefined - (Jul 19, 2014) - (ArmA3 1.24) It is recommended to use configClasses instead of BIS_fnc_getCfgSubClasses and BIS_fnc_uniqueClasses on subclasses collection or conditional selection. - $Code$ - _faces = " true " configClasses ( configFile "Cfgfaces"); - //same as: _faces = (configfile "CfgFaces") call BIS_fnc_getCfgSubClasses ; - $/Code$ - $Code$ - //Extract all animals: - animals = "(( configName _x) isKindOf 'animal')" configClasses ( configFile "CfgVehicles"); - /*same as: - aniamls = []; - [( configFile "CfgVehicles"),{ - if (( configName _this) isKindOf “animal”) then { - animals set [ count animals, _this] - } - } - ] call BIS_fnc_uniqueClasses ;*/ - $/Code$ - Return nested subclasses, currently still BIS_fnc_returnChildren - $Code$ - //Return all nested config classes. - [( configFile "CfgFaces"),1, true, true ] call BIS_fnc_returnChildren ; - $/Code$ - Config + Nothing + - configHierarchy + setPlayable - Returns hierarchy of the given config class. Just like with inheritsFrom, only complete config classes are supported + Create MP role for the unit. The roles created this way are used for Join In Progress and Team Switch. + NOTE: Currently in Arma 3 this command does nothing. + Doesn't work as intended - https://community.bistudio.com/wiki/configHierarchy + https://community.bistudio.com/wiki/setPlayable - configHierarchy Config + setPlayable Object - configHierarchy configClass + setPlayable unitName - $Code$_hierarchy = configHierarchy ( configFile "CfgVehicles" "Car"); - //[bin\config.bin,bin\config.bin/CfgVehicles,bin\config.bin/CfgVehicles/Car]$/Code$ + $Code$setPlayable _aPerson$/Code$ undefined / undefined + (december 19, 2009) + if you want to add a TeamSwitchable unit (at least in Arma2), better use addSwitchableUnit - Array + Nothing + - configName + teamSwitch - Returns name of config entry. + Invoke the Team Switch dialog (force it even when conditions are not met). There has to be at least one playable unit for team switch to work, and for this command to work in MP, respawn type in description.ext should be 5 (SIDE). + NOTE: When player switches and leaves behind AI unit, you need to enable "TeamSwitch" AI on it _unit enableAI "TeamSwitch" so that the unit continues with waypoints - https://community.bistudio.com/wiki/configName + https://community.bistudio.com/wiki/teamSwitch - configName Config + teamSwitch - configName config + teamSwitch - $Code$_name = configName ( configFile "CfgVehicles"); - // Result is "CfgVehicles"$/Code$ - + undefined / undefined - String + Nothing + - configNull + screenshot - A non-existing Config. - configNull == configNull ; // true - isNull configNull ; // true - configNull isEqualTo configNull ; // true + Captures a screenshot and stores it to given filename. PNG is the only available format and the file must have.png extension. + The file is saved into Screenshots folder in the Profile directory. The folder is by default limited to 250 MB to prevent abuse. + To increase the limit, add the following line at the end of the profile file: + $Code$maxScreenShotFolderSizeMB = 2000;$/Code$ + 2000 can be replaced by any value in MB. - https://community.bistudio.com/wiki/configNull + https://community.bistudio.com/wiki/screenshot - configNull + screenshot String - configNull + screenshot filename - $Code$_config = missionNamespace getVariable ["myConfig", configNull ];$/Code$ + $Code$screenshot "";$/Code$ - $Code$str configNull ; // ""$/Code$ + $Code$screenshot "testFile.png";$/Code$ + + $Code$// The following code will result in the screenshot being placed in \Documents\Arma 3\Screenshots\any\where\you\want.png + screenshot "any\where\you\want.png";$/Code$ undefined / undefined + (July 18, 2016) + This command only captures the rendered picture (including ppEffects). GUI nor the mouse are visible on the screenshot. (ArmA 3 1.62.137494) + + (December 3, 2017) + Change Sampling on Video Options to make bigger picture than your screen. + For example, 200% sampling on 1920x1080 screen and take screenshot via this command, it will generate a 3840x2160 picture. + + (March 20, 2018) + The command will silently fail if your profiles folder is configured to be somewhere else (-profiles parameter), or if your HDR setting is below 16 (configurable in arma3.cfg or medium and above in in-game settings) + For full reference on recommended settings consult Eden Editor: Configuring Asset Previews - Config + Nothing + - configProperties + attachedObjects - Returns an array of config entries which meet criteria in condition code. Command iterates through available classes and config properties for given config entry. If 3rd param is true the search also includes inherited properties. Current looked at config is stored in _x variable (similar to alternative count command implementation). Condition has to return true in order for the looked at property to be added to the resulting array. A bit slower than configClasses but allows to access inherited entires. - The condition code passed to configProperties should only be used for simple filter expressions and nothing more + Returns a list of attached objects. - https://community.bistudio.com/wiki/configProperties + https://community.bistudio.com/wiki/attachedObjects - configProperties Array + attachedObjects Object - configProperties [config, condition, inherit] + attachedObjects obj - $Code$_configs = configProperties [ configFile "CfgVehicles" "O_Truck_02_box_F"];$/Code$ - - $Code$_configs = configProperties [ configFile "RscText", " true ", true ];$/Code$ + $Code${ + detach _x; + } forEach attachedObjects player ;$/Code$ - $Code$// Get all hitpoints of a truck: - _hitPoints = []; - _hitPointsCfgs = configProperties [ - configFile "CfgVehicles" "O_Truck_02_box_F" "HitPoints", - " true ", - true - ]; - hint str _hitPointsCfgs;$/Code$ + $Code$if ( count attachedObjects player == 0) then { + hint "There are no objects attached to player"; + };$/Code$ undefined / undefined @@ -10847,145 +11714,232 @@ - Array + Array + - configSourceAddonList + animateSource - Returns an array of addons ( CfgPatches ) in which the given config class is defined. - - - https://community.bistudio.com/wiki/configSourceAddonList + Process an animation of the object. If animate uses class name from CfgModels Animations, animateSource uses name defined by source property. This allows to use just one command on a bunch of animations related to the same source simultaneously. Since Arma 3 v1.65.138459 speed of animation can be altered with coefficient. + A class with the same source name should also be present in main config in CfgVehicles AnimationSources and have to be bound to the "user" controller for the command to work. If in order to animate door in example below using animate command it would require 2 calls: + house animate ["Door_1_rot", 1]; + house animate ["Door_Handle_1_rot", 1]; + With animateSource this would require only 1 (provided everything is configured correctly): + house animateSource ["Door_1_sound_source", 1]; + // model.cfg + .... + class Animations + { + class Door_1_rot + { + type = rotation ; + source = Door_1_sound_source ; + selection = Door_1 ; + axis = Door_1_axis ; + memory = 1 ; + minValue = 0.1 ; + maxValue = 1 ; + angle0 = 0 ; + angle1 = ( rad 110 ); + }; + class Door_Handle_1_rot + { + type = rotation ; + source = Door_1_noSound_source ; + selection = Door_Handle_1 ; + axis = Door_Handle_1_axis ; + memory = 1 ; + minValue = 0 ; + maxValue = 0.1 ; + angle0 = 0 ; + angle1 = ( rad - 50 ); + }; + }; + ... + // config.cpp + ... + class AnimationSources + { + class Door_1_sound_source + { + source = "user" ; + initPhase = 0 ; + animPeriod = 1 ; + sound = "GenericDoorsSound" ; + soundPosition = "Door_1_trigger" ; + }; + }; + ... + If you don't know much about model config you can use this page createVehicle/vehicles for reference. Some of the AnimationSources are listed with the class names of the available assets in Arma 3. If it says "user", the chances are it could work with animateSource (see example 2). + It is recommended that animateSource command is used instead of animate whenever is possible, as it is more efficient and optimized for MP + Mixing animateSource command with animate command to animate the same part can lead to unexpected behavior + + + https://community.bistudio.com/wiki/animateSource - configSourceAddonList Config + Object animateSource Array - configSourceAddonList config + object animateSource [source, phase, speed] - $Code$_addons = configSourceAddonList ( configFile "CfgVehicles" "Man"); - hint str _addons; // ["A3_Data_F","A3_Characters_F","A3_Data_F_Curator","A3_Air_F_Heli"]$/Code$ + $Code$house animateSource ["Door_1_source", 1, true ];$/Code$ + + $Code$// Create UGV and manipulate its turret (Currently not possible to do with animate command. See createVehicle/vehicles for reference) + ugv = "B_UGV_01_F" createVehicle ( player getRelPos [5, 0]); + ugv addAction ["Show Turret", + { + ugv animateSource ["Turret", 0]; + ugv animateSource ["MainTurret", rad 0, true ]; + ugv animateSource ["MainGun", rad 0, true ]; + }]; + ugv addAction ["Hide Turret", {ugv animateSource ["Turret", 1]}]; + ugv addAction ["Turret Left", {ugv animateSource ["MainTurret", rad 90]}]; + ugv addAction ["Turret Right", {ugv animateSource ["MainTurret", - rad 90]}]; + ugv addAction ["Turret Up", {ugv animateSource ["MainGun", rad 30]}]; + ugv addAction ["Turret Down", {ugv animateSource ["MainGun", - rad 20]}];$/Code$ + + $Code$barGate animateSource ["Door_1_source",0]; //Close + barGate animateSource ["Door_1_source",1]; //Open$/Code$ - undefined / undefined + global / global - Array + Nothing + - configSourceMod + enableVehicleCargo - Returns modDir of the mod that given config class was loaded from. + Enable/disable option to transport other vehicles (if configured) or be transported. - https://community.bistudio.com/wiki/configSourceMod + https://community.bistudio.com/wiki/enableVehicleCargo - configSourceMod Config + Object enableVehicleCargo Boolean - configSourceMod config + vehicle enableVehicleCargo enable - $Code$configSourceMod ( configFile "CfgVehicles" "Heli_Transport_04_base_F"); //Returns "heli"$/Code$ - - $Code$configSourceMod ( configFile "CfgVehicles" "Car"); //Returns "A3"$/Code$ + $Code$vehicle enableVehicleCargo true ;$/Code$ undefined / undefined + (June 20, 2016) + Setting enableVehicleCargo to true does not mean a vehicle can now load vehicles as cargo. They are still required to be correctly setup as shown on the Vehicle in Vehicle Transport page. - String + Nothing + - configSourceModList + moveInCommander - Returns an array of mods (CfgMods) in which the given config class is defined. + Move soldier into vehicle commander position (Immediate, no animation). - https://community.bistudio.com/wiki/configSourceModList + https://community.bistudio.com/wiki/moveInCommander - configSourceModList Config + Object moveInCommander Object - configSourceModList config + unitName moveInCommander vehicle - $Code$_mods = configSourceModList ( configFile "CfgVehicles" "Man"); - hint str _mods; // ["A3","curator","heli"]$/Code$ + $Code$_soldierOne moveInCommander _tankOne$/Code$ - undefined / undefined + local / global + (August 4, 2006) + Notes from before the conversion: + MP Note Functions MoveInCommander can only be called for local soldiers. They will be ignored for remote soldiers. (see Locality in Multiplayer ) + + In OFP v1.96, the moveIn commands will not trigger an associated getIn event. To ensure the getIn event is fired, use the "getIn Commander" action command. - Array + Nothing + - confirmSensorTarget + switchMove - Sets for which Side the entity becomes a "confirmed hostile" target - a target that becomes highlighted red on the sensors display. + When used on a person, the given move is started immediately (there is no transition). Use switchmove "" to switch back to the default movement if there is no transition back, otherwise the person may be stuck. + List of moves in ArmA 2 + List of moves in Armed Assault + List of moves in Operation Flashpoint: Resistance - https://community.bistudio.com/wiki/confirmSensorTarget + https://community.bistudio.com/wiki/switchMove - Object confirmSensorTarget Array + Object switchMove String - vehicle confirmSensorTarget [side, isConfirmed] + person switchmove movename - $Code$( vehicle player ) confirmSensorTarget [ west, true ];$/Code$ + $Code$_loon1 switchMove "FXStandDip"$/Code$ - undefined / undefined + global / local + (March 25, 2007) + In some cases the movement won't stay. I.e. AI hostages that put their hands behind their heads (_hostage switchMove "AmovPercMstpSsurWnonDnon") won't hold their hands up, unless you first use disableAI "autoTarget" on them. They mostly put their hands down because they 'noticed' unknown objects. + + (August 03, 2008) + This command will not cause an AnimChanged or AnimDone event. However, playMove will. + + (November 12, 2016) + When using this command on the player unit outside unscheduled UI contexts, it will cause a minor camera glitch for a single frame. + For example, Draw3D and KeyDown are UI contexts and so are not affected by the glitch, but EachFrame and scheduled scripts are not UI contexts and are affected by the glitch. - Nothing + Nothing + - connectTerminalToUAV + removeVest - Connect person with UAV terminal to UAV unit. UAV Terminal item needs to be assigned to GPS slot. If UAV is already connected to another terminal, this new connection will fail. + Removes vest from unit. - https://community.bistudio.com/wiki/connectTerminalToUAV + https://community.bistudio.com/wiki/removeVest - Object connectTerminalToUAV Object + removeVest Object - person connectTerminalToUAV uav + removeVest unit - $Code$bool = player connectTerminalToUAV uav1;$/Code$ - - $Code$player connectTerminalToUAV objNull ; //disconnect$/Code$ + $Code$removeVest player ;$/Code$ global / global @@ -10993,32 +11947,28 @@ - Boolean + Nothing + - controlNull + forgetTarget - A non-existing Control. To compare non-existent objects use isNull or isEqualTo : - controlNull == controlNull ; // false - isNull controlNull ; // true - controlNull isEqualTo controlNull ; // true + Resets info group has about target - https://community.bistudio.com/wiki/controlNull + https://community.bistudio.com/wiki/forgetTarget - controlNull + Group/Object forgetTarget Object - controlNull + group forgetTarget target - $Code$! isNull controlNull ; // false$/Code$ - - $Code$str controlNull ; // No control$/Code$ + $Code$soldier1 forgetTarget soldier2;$/Code$ undefined / undefined @@ -11026,27 +11976,30 @@ - Control + Nothing + - controlsGroupCtrl + isEqualTypeAny - Returns a child control with specified idc from a controls group + Compares type of given value to every type in the given array and if match is found, true is returned. - https://community.bistudio.com/wiki/controlsGroupCtrl + https://community.bistudio.com/wiki/isEqualTypeAny - Control controlsGroupCtrl Number + Anything isEqualTypeAny Array - ctrlgrp controlsGroupCtrl idc + val isEqualTypeAny types - $Code$_control = _controlsGroup controlsGroupCtrl 101;$/Code$ + $Code$_var = [1,2,3]; + _var isEqualTypeAny [0,"", objNull ]; //false + _var isEqualTypeAny [0,"", objNull,[]]; //true$/Code$ undefined / undefined @@ -11054,28 +12007,32 @@ - Control + Boolean + - copyFromClipboard + currentThrowable - Return the content of the (text) clipboard. - Disabled in Multiplayer for security reasons + Returns currently selected throwable, which will be launched if user presses "G". + Please note: The weapon/magazine id system is W.I.P. and may change without notice. - https://community.bistudio.com/wiki/copyFromClipboard + https://community.bistudio.com/wiki/currentThrowable - copyFromClipboard + currentThrowable Object - copyFromClipboard + currentThrowable player - $Code$hint copyFromClipboard ;$/Code$ + $Code$currentThrowable player ; //["SmokeShellGreen","SmokeShellGreenMuzzle",[1.00002e+007,0]]$/Code$ + + $Code$_ct = currentThrowable player ; //["HandGrenade","HandGrenadeMuzzle",[1e+007,0]] + _id = (_ct select 2 select 0) - 10000000; //18$/Code$ undefined / undefined @@ -11083,66 +12040,65 @@ - String + Array + - copyToClipboard + lbSetColor - Copy text string to the clipboard. - In MP available only on the client that is server + Sets the color of the item (left) with the given index of the listbox or combobox with id idc of the topmost user dialog to color. + Colour is in format Color. - https://community.bistudio.com/wiki/copyToClipboard + https://community.bistudio.com/wiki/lbSetColor - copyToClipboard String + lbSetColor Array + + Control lbSetColor Array - copyToClipboard text + lbSetColor [idc, index, color] + + control lbSetColor [index, color] - $Code$copyToClipboard str _data;$/Code$ + $Code$lbSetColor [101, 0, [0, 1, 0, 0.5]];$/Code$ + + $Code$_control lbSetColor [0, [0, 1, 0, 0.5]];$/Code$ - undefined / undefined + local / local - (October 12, 2014) - To add a line break in output text do this: - $Code$_br = toString [13,10];//(carriage return & line feed) - _string = "Line 1" + _br + "Line 2"; - copyToClipboard _string; - $/Code$ - Paste into text editor of choice, you get: - $Code$Line 1 - Line 2$/Code$ - (A3 1.30 Stable executed inside.sqf via execVM ) + More information on the LB command family can be found here - Nothing + Nothing - Nothing + - copyWaypoints + setSimpleTaskTarget - Copy the chain of waypoints from source to target group. The target group will start to process waypoints from the first one. + Attach a target to the simple task. Overrides setSimpleTaskDestination. - https://community.bistudio.com/wiki/copyWaypoints + https://community.bistudio.com/wiki/setSimpleTaskTarget - Group copyWaypoints Group + Task setSimpleTaskTarget Array - groupTo copyWaypoints groupFrom + task setSimpleTaskTarget [target, precisePosition] - $Code$group1 copyWaypoints group2;$/Code$ + $Code$task setSimpleTaskTarget [targetVehicle, true];$/Code$ undefined / undefined @@ -11150,325 +12106,257 @@ - Nothing + Nothing + - cos + uniformItems - Cosine of a number, argument in degrees. + Get array with all items (of any kind, even weapons) from uniform. - https://community.bistudio.com/wiki/cos + https://community.bistudio.com/wiki/uniformItems - cos Number + uniformItems Object - cos x + uniformItems unit - $Code$cos 60;//returns 0.5$/Code$ + $Code$uniformItems player ;[ + "FirstAidKit", + "30Rnd_65x39_caseless_mag", + "30Rnd_65x39_caseless_mag", + "30Rnd_65x39_caseless_mag" + ]$/Code$ undefined / undefined - (August 8, 2006) - Be aware that there might be rounding errors in the results of this command. - cos 90 - for example doesn't return the expected '0', but '-4.37114e-008'. So, if you want to compare results of Cosinus, don't use the compare operator - (cos 90)==0 - but rather use less than. - (cos 90) 0.00001 - Number + Array + - countEnemy + visiblePosition - Count how many units in the array are considered enemy to the given unit. + Returns an object's rendered position (z value above surface underneath) in render time scope. Same as getPosVisual - https://community.bistudio.com/wiki/countEnemy + https://community.bistudio.com/wiki/visiblePosition - Object countEnemy Array + visiblePosition Object - unitName countEnemy arrayName + visiblePosition object - $Code$_num = player countEnemy list _triggerOne;$/Code$ + $Code$playerRenderedPos = visiblePosition player;$/Code$ - global / undefined + undefined / undefined - (August 3, 2006) - Notes from before the conversion: - The countEnemy command seem to count the number of units from the array that are considered to be of the given type by the whole side, not just the specified unit. - - (December 15, 2006) - The unit that's checking (left side of the command) needs a certain level of knowledge about the target (about.1) before the enemy units are actually counted. (OFP & ArmA) + (February 4, 2015) + Z (visiblePosition select 2) works but if unit/object is in a building, Z remains at ground level. If you need Z depending on building floors/stages, use getPosAtl select 2 instead. - Number + Array + - countFriendly + nearEntities - Count how many units in the array are considered friendly to the given unit. + Find entities in the sphere with given radius. If typeName(s) is (are) given, only entities of given type (or its subtype) are listed. + This command returns only alive entities. If you need to return dead entities as well use entities command. - https://community.bistudio.com/wiki/countFriendly + https://community.bistudio.com/wiki/nearEntities - Object countFriendly Array + Object/Array nearEntities Number + + Object/Array nearEntities Array - unitName countFriendly arrayName + position nearEntities radius + + position nearEntities [typeName, radius] - $Code$_num = player countFriendly list _triggerOne;$/Code$ + $Code$_list = player nearEntities 20; + _list = ( position player ) nearEntities 50; + _list = player nearEntities ["Man", 1000]; + _list = ( position player ) nearEntities ["LaserTarget", 3000]; + _list = player nearEntities [["Car", "Motorcycle", "Tank"], 50]; + _list = ( position player ) nearEntities [["Man", "Air", "Car", "Motorcycle", "Tank"], 200];$/Code$ global / undefined - (August 3, 2006) - Notes from before the conversion: - The countFriendly command seem to count the number of units from the array that are considered to be of the given type by the whole side, not just the specified unit. + (27 Mar, 2014) + According to Code Optimisation, this function is the fastest and should be used instead of nearestObjects when suitable. - Number + Array - Array + - countSide + setVehicleArmor - Count how many units in the given array belong to given side. If the object in passed array is a Group, the leader of the group will be counted. + Sets the armor (or health for men) state of the vehicle (a value from 0 to 1). + Works like setDamage only in reverse: player setVehicleArmor 1 is the same as player setDamage 0, and player setVehicleArmor 0 is the same as player setDamage 0.97 - https://community.bistudio.com/wiki/countSide + https://community.bistudio.com/wiki/setVehicleArmor - Side countSide Array + Object setVehicleArmor Number - side countSide arrayName + vehicleName setVehicleArmor value - $Code$_num = west countSide list _triggerOne;$/Code$ - - $Code$_numCivPlayable = civilian countSide playableUnits ;$/Code$ + $Code$player setVehicleArmor 0.5;$/Code$ - global / undefined + local / global - (July 4, 2014) - The countSide command will also accept an array of groups. Tested in ARMA 3 v1.22 - - (October 19, 2014) - This command considers captive units as civilians, regardless of their group's side. - Number + Nothing + - countType + sideFriendly - Count how many objects in the array are of given type. This command also works with parent classes like "Air", "Tank", and "Car". For a full class reference see Classes. + The Friendly side (used for captives). - https://community.bistudio.com/wiki/countType + https://community.bistudio.com/wiki/sideFriendly - String countType Array + sideFriendly - type countType objects + sideFriendly - $Code$_count = "Tank" countType list _triggerOne;$/Code$ - - $Code$_count = "B_medic_F" countType units player ;$/Code$ - + - global / undefined + undefined / undefined - (April 23, 2007) - This command can be used on the whole hierarchical class tree (i.e. when checking a HMMWV, one could test for "HMMWV50", "Car", "LandVehicle", etc.) - - (May 4, 2016) - To complement Kronzky's note, if one needs to count exact types, countType is not suitable for this, use count instead: - $Code$_count = { typeOf _x == "B_medic_F"} count units player ;$/Code$ - Number + Side + - countUnknown + disableUAVConnectability - Count how many units in the array are unknown to the given unit. + Disables unit's AV terminal(s) connecting to UAV. - https://community.bistudio.com/wiki/countUnknown + https://community.bistudio.com/wiki/disableUAVConnectability - Object countUnknown Array + Object disableUAVConnectability Array - unitName countUnknown arrayName + object disableUAVConnectability [uav, checkAllItems] - $Code$_num = player countUnknown list _triggerOne;$/Code$ + $Code$unit disableUAVConnectability [uav,true];$/Code$ - global / undefined + undefined / local - Number + Nothing + - count + curatorEditingAreaType - Can be used to count: - the number of elements in array - the number of elements in array with condition - the number of sub-entries in a config object - the number of characters in a string (since ["Arma 3","Arma3",127,126674,"Development"]) + Returns type of edit areas assigned to curator (blacklist/whitelist). - https://community.bistudio.com/wiki/count + https://community.bistudio.com/wiki/curatorEditingAreaType - count Array - - Code count Array - - count Config - - count String + curatorEditingAreaType Object - count array - - condition count array - - count configname - - count string + curatorEditingAreaType obj - $Code$_cnt = count [0,0,1,2]; // returns 4 - _cnt = count units group player ; // returns number of units in player group$/Code$ - - $Code$_cnt = { _x == 4} count [1,9,8,3,4,4,4,5,6]; // returns 3 - _cnt = { alive _x } count allUnits ; // returns the number of alive units$/Code$ - - $Code$_cnt = count ( configFile "CfgVehicles");$/Code$ - - $Code$hint str count "japa is the man!"; //16$/Code$ - + - local / undefined + undefined / undefined - (April 28, 2007) - This conditional count command only works if all the elements in the tested array are of the same type as the tested element. - For example, the following code will created an error, since the elements are of different types (object, number, string): - $Code$_arr = [ player,100,"one"]; {_x == "one"} count _arr;$/Code$ - Alternatively, to avoid the error use isEqualTo instead of ==. --KK - This one, on the other hand, where all elements are strings, just like the tested element, will return the correct result of 1: - $Code$_arr = ["one","two","three"]; {_x == "one"} count _arr;$/Code$ - - (August 3, 2006) - Notes from before the conversion: - Use this to calculate how many "M16" mags a soldier has left. - $Code${_x == "M16"} count magazines soldier1;$/Code$ - Take care when using count to determine how many units are left alive in a group: count units group player or count units groupname Will return the number of units the leader of the group thinks are alive. If some units have been killed out of sight of other members of the group then it may take sometime for this to be the actual numbers in the group. To determine exactly how many units are really alive in a group use: - $Code${ alive _x} count units group player ;$/Code$ - or - $Code${ alive _x} count units groupname;$/Code$ - - (December 15, 2014) - count can be (ab)used for a very fast and simple check if at least one element in an array fulfills a certain condition: - $Code$if({if( _x fulfills condition ) exitWith {1}; false} count _array isEqualTo 1) then - { - //do whatever here - };$/Code$ - This code will exit the count loop as soon as it finds an element fulfilling the condition, leaving the count with the value of 1, hence make the larger if-condition be true. - If no array element fulfills the condition, the count will be 0 and the if-condition will be false. - - (December 29, 2014) - Quit loop at first fulfilled condition (same as above but faster): - $Code$0 = { if (_x == 4) exitWith { - //do something when we reach 4 - }} count [1,2,3,4,5,6];$/Code$ - - (January 2, 2015) - Using exitWith inside a count loop will overwrite the default functionality and make count return whatever the exitWith returns: - $Code$_result = { - if(_x isEqualTo 3) exitWith {"Hello"} - } count [1,2,3,4,5]; - //_result = "Hello"$/Code$ - - (August 22, 2016) - With the alternative syntax each iteration should result in an interior return of bool or nothing. Example: - $Code$createDialog "RscFunctionsViewer"; - { lbAdd [292901,_x]; } count ["first","second","third"];$/Code$ - lbAdd returns a number, so this throws "Error Type Number, expected Bool". Tested in A2OA 1.63.131129 - Number - Number - Number - Number + Boolean + - create3DENComposition + drawPolygon - Create new Composition. To create individual entities, use create3DENEntity. + Draws given polygon on the given map control with given color. The polygon must consist of at least 3 points. Unlike with other draw shape commands and due to complexity, this command does not support filling of the polygon with color. Use drawTriangle command to construct and fill polygon shape as a workaround. - https://community.bistudio.com/wiki/create3DENComposition + https://community.bistudio.com/wiki/drawPolygon - create3DENComposition Array + Control drawPolygon Array - create3DENComposition [configPath, position] + map drawPolygon [polygon, color] - $Code$myComposition = create3DENComposition [ - configFile "CfgGroups" "West" "BLU_F" "Infantry" "BUS_InfSquad", - screenToWorld [0.5,0.5] - ];$/Code$ + $Code$test_polygon = []; + for "_i" from 1 to 12 do + { + test_polygon pushBack ( player getPos [10 + random 100, 360/_i]); + }; + findDisplay 12 displayCtrl 51 ctrlAddEventHandler ["Draw", + { + _this select 0 drawPolygon [test_polygon, [0,0,1,1]]; + }];$/Code$ undefined / undefined @@ -11476,384 +12364,328 @@ - Array + Nothing + - create3DENEntity + addCuratorEditableObjects - Create new Eden Entity. Used for creating individual entities; to create a composition (e.g., infantry squad), use create3DENComposition. - This is the only way how to add new editable entities to Eden Editor scenario. Other 'create' commands like createVehicle or createUnit will still work, but the resulting entity won't be editable. + Register objects which can be edited by a curator. - https://community.bistudio.com/wiki/create3DENEntity + https://community.bistudio.com/wiki/addCuratorEditableObjects - create3DENEntity Array - - Group create3DENEntity Array + Object addCuratorEditableObjects Array - create3DENEntity [mode, class, position, ] - - group create3DENEntity [mode, class, position, ] + curatorObj addCuratorEditableObjects [objects,addCrew] - $Code$dude1 = create3DENEntity ["Object","B_Soldier_F", screenToWorld [0.5,0.5]];$/Code$ - - $Code$dude2 = ( group dude1) create3DENEntity ["Object","B_Soldier_AR_F", screenToWorld [0.5,0.5]];$/Code$ - - $Code$myMarker = create3DENEntity ["Marker","mil_warning", position player ];$/Code$ - - $Code$mytrigger = create3DENEntity ["Trigger","EmptyDetectorArea10x10", position player ];$/Code$ + $Code$curatorModule addCuratorEditableObjects [[car], true ];$/Code$ undefined / undefined - (March 29, 2016) - The classnames for triggers can be found in the config class CfgNonAIVehicles - - (June 14, 2016) - Mode can also be "Logic". Not sure if it's a replacement for "System" or a it's a completely separate mode. + This scripting command must be executed on the server to work properly in multiplayer - EdenEntity - EdenEntity + Nothing + - createAgent + lightnings - Creates an (independent) agent (person) of the given type (type is a name of a subclass of CfgVehicles ). An agent does not have a group or leader or the standard soldier FSM associated with it -- for instance, an enemy soldier spawned as an agent has limited AI and will stand stupidly when fired upon -- which can be useful to limit the amount of AI processing being done in a mission with very large numbers of "AI". If the markers array contains several marker names, the position of a random one is used, otherwise, the given position is used. The unit is placed inside a circle with this position as its center and placement as its radius. - Players assigned to an agent using setPlayable will be able to control the agent, operate weapons and other actions, but will not be able to access their inventory using the gear screen. - Special properties can be: "NONE", "CAN_COLLIDE" and "FORM". + Return the current lightnings value. - https://community.bistudio.com/wiki/createAgent + https://community.bistudio.com/wiki/lightnings - createAgent Array + lightnings - createAgent [type, position, markers, placement, special] + lightnings - $Code$agent = createAgent ["SoldierWB", position player, [], 0, "FORM"];$/Code$ + $Code$// Get the current lightnings value: + _lightningsVal = lightnings ;$/Code$ undefined / undefined - (September 29, 2014) - In Arma 3, default FSM is calling BIS_fnc_animalBehaviour script upon agent creation, which takes on some animal behavioural logic. The problem here is that it is almost impossible to make animal do what is told. Until now. Since Arma 3 v1.31.127383 you can set BIS_fnc_animalBehaviour_disable variable on the agent at the moment of agent creation, to override the function. - $Code$tr = createTrigger ["EmptyDetector", player modelToWorld [0, 10, 0]]; - tr setTriggerArea [5, 5, 0, true ]; - tr setTriggerActivation ["CIV", "PRESENT", true]; - rabbits = []; - private "_r"; - for "_i" from 1 to 10 do { - _r = createAgent ["Rabbit_F", position tr, [], 0, "NONE"]; - _r setVariable ["BIS_fnc_animalBehaviour_disable", true ]; - rabbits pushBack _r; - }; - tr setTriggerStatements [ - " if (rabbits isEqualTo thisList) exitWith { - _r = thisList select floor random count thisList; - _r moveTo (_r modelToWorld [2.5 - random 5, 2.5 - random 5, 0]); - }; - _esc = rabbits - thisList; - doStop _esc; - {_x moveTo position thisTrigger} forEach _esc; - systemChat str [ time, _esc]; - false ", - "", - "" - ];$/Code$ - - (April 18, 2015) - Agents seem to use the same collision model that the player uses, unlike normal AI. Normal AI don't collide with objects, but agents are physically stopped by obstacles the same way players are. This also probably means agents cost more resources than normal AI. - Object + Number + - createCenter + setMarkerDirLocal - In a nutshell, this command creates game Side. Without side it is not possible to create Groups. So if center for particular side is undefined, no groups can be created for this side. A Unit needs a group to be able to spawn in. So if no center for particular side exists, no groups for this side can be created and therefore no units for this side can be spawned. In Arma 3, the centers for all sides are created for you. An attempt to create center for existing side is ignored. Center can only be created for: east, west, resistance, civilian and sideLogic. These are the only sides groups can be created for. - Old description : Creates a new AI HQ for the given side. An 'HQ ' is something each side needs to have to be able to communicate. By default, all centers for units which are present in the mission are created before the mission is started. This command can be used to initialize a side which has no units present in the Mission.sqm, so that you can spawn groups and units for it. - For the available sides see Side. + Sets the orientation of the marker. Angle is in degrees. - https://community.bistudio.com/wiki/createCenter + https://community.bistudio.com/wiki/setMarkerDirLocal - createCenter Side + String setMarkerDirLocal Number - createCenter side + markerName setMarkerDirLocal angle - $Code$_SideHQ = createCenter east$/Code$ + $Code$"Marker1" setMarkerDirLocal 90;$/Code$ - undefined / global + undefined / local - (17:15, 22 June 2007 (CEST)) - You need to set the new sides friendly status using the setFriend command, once you have created your Center. Otherwise the newly created AI will not engage you, if you're on the opposing side. - Side + Nothing + - createDialog + disableUserInput - Create a dialog which is defined either in the mission's description.ext, in the campaign's description.ext or in the global resource.cpp. The given name has to be the class name used in one of these files. If another dialog is already opened, the desired dialog is created as a child dialog of the one already opened. + Disable and enable the keyboard and mouse input, usually used during cutscenes. + Be careful with the usage of this command, always remember to enable the user input again, as once the user input is disabled, you can only shut down OFP but not exit the mission with escape. - https://community.bistudio.com/wiki/createDialog + https://community.bistudio.com/wiki/disableUserInput - createDialog String + disableUserInput Boolean - createDialog dialogName + disableUserInput state - $Code$_ok = createDialog "RscDisplayGame"; - if (!_ok) then { hint "Dialog couldn't be opened!"};$/Code$ + $Code$disableUserInput true + ; cutscene + disableUserInput false$/Code$ undefined / local - (July 29, 2017) - A user dialog created with createDisplay over mission display ( findDisplay 46) will stop display event handlers added to mission display from firing. However if it is created with createDialog then the event handlers continue to work. + (14 March 2014) + Sometimes, when disableUserInput true command is invoked while the user is holding a button, when disableUserInput false is called and the user is no longer holding the button, the input will resume as if the user is still holding the button. To reset this behaviour, disable and enable user input again in the same frame: + $Code$ disableUserInput true ; + //do something + disableUserInput false ; + disableUserInput true ; + disableUserInput false ;$/Code$ + Unfortunately, if the user is moving mouse when disableUserInput true command is invoked, the mouse input will get stuck for the whole duration of disabled user input but will reset as soon as disableUserInput false is called. I was unable to find workaround for this one. - Boolean + Nothing + - createDiaryLink + landAt - Create a link to the section of diary given by subject. Record is selected based on given object (diary record,task or unit). + Order an AI airplane to land at a given airport. ID is the number to identify which map airport you want the airplane to land at. Since Arma 3 v1.68 it is possible to also make the airplane land at a dynamic airport object (e.g. aircraft carrier, makeshift runway...). - https://community.bistudio.com/wiki/createDiaryLink + https://community.bistudio.com/wiki/landAt - createDiaryLink Array + Object landAt Number + + Object landAt Object - createDiaryLink [subject,object,text] + plane landAt id + + _plane1 landAt _dynamicAirport1 - $Code$_link = createDiarySubject ["Group", player,"Player"]$/Code$ - - $Code$diaryRec1 = player createDiaryRecord ["diary", ["Record 1", "We can't refer to next record (("]]; - diaryRec2 = player createDiaryRecord ["diary", ["Record 2", "Got to " + ( createDiaryLink ["Diary", diaryRec1, "record 1"])]]; - diaryRec3 = player createDiaryRecord ["diary", ["Record 3", "Got to " + ( createDiaryLink ["Diary", diaryRec2, "record 2"])]];$/Code$ + $Code$_plane1 landAt 1;$/Code$ - $Code$funcProcessDiaryLink = { - processDiaryLink createDiaryLink ["diary", _this, ""]; - }; - diaryRec1 = player createDiaryRecord ["diary", ["Record 1", - "In this example, we can go to any next record: go to execute expression='diaryRec2 call funcProcessDiaryLink' Record 2 /execute " - ]]; - diaryRec2 = player createDiaryRecord ["diary", ["Record 2", - "Go to execute expression='diaryRec3 call funcProcessDiaryLink' Record 3 /execute " - ]]; - diaryRec3 = player createDiaryRecord ["diary", ["Record 3", - "Go to execute expression='diaryRec1 call funcProcessDiaryLink' Record 1 /execute " - ]];$/Code$ + $Code$_dynamicAirport1 = "DynamicAirport_01_F" createVehicle position player ; + _plane1 landAt _dynamicAirport1;$/Code$ - undefined / undefined + local / global + ARMA 3: + Altis : + 0 = Airbase + 1 = AAC Airfield + 2 = Krya Nera Airstrip + 3 = Selakeno Airfield + 4 = Molos Airfield + 5 = Almyra Salt Lake Airstrip + Posted 17:56, 21 September 2010 (CEST) + + ARMA 2 OA: + Takistan : + 0 = Airport NorthWest + 1 = Airport SouthEast + Planes approach all airports from South West + ARMA 2: + Utes : + 0 = There is only one airport + Chernarus : + 0 = Airport NorthWest close to Grishno + 1 = Airport NorthEast close to Kranostav + 2 = Airport SouthWest close to Balota + 3 = Nearest Airport + Planes approach all airports from South East + ARMA: + Sahrani : + 0: - Paraiso + 1: - Rahmadi + 2: - Pita + 3: - Antigua + + (November 8, 2014) + In Arma 3 (1.34) landAt only works for fixed-wing aircraft. Rotary-wing craft ignore this command. + + (June 19, 2016) + ARMA 3 : Tanoa + 0 = Aeroport de Tanoa + 1 = Tuvanaka Airbase + 2 = Saint-George Airstrip + 3 = Bala Airstrip + 4 = La Rochelle Aerodome + ARMA 3 : Stratis + 0 = Stratis Airbase - String + Nothing - Nothing + - createDiaryRecord + waypointsEnabledUAV - creates a diary entry. - Supported tags and their parameters: - All - image : String - path to image. When present, any element with it will be displayed as image. - width : Number - image width in pixels. - height : Number - image height in pixels. - font - color : String - HTML color in format #aarrggbb or #rrggbb - size : Number - font height in pixels. - face : String - font type (class from CfgFontFamilies) - br - marker - name : String - marker name - execute - expression : String - executed code - executeClose - expression : String - executed code, diary is closed afterwards - log - subject : String - subject name. - record : String - record name (e.g. "Record6" or "Unit1059524") - gear - unit : Number - unit ID - teamSwitch - unit : Number - unit ID - kick - id : Number - player ID - ban - id : Number - player ID - mute - id : Number - player ID - currentTask - id : Number - task ID + Checks if the UAV has waypoints enabled. - https://community.bistudio.com/wiki/createDiaryRecord + https://community.bistudio.com/wiki/waypointsEnabledUAV - Object createDiaryRecord Array + waypointsEnabledUAV Object - unitName createDiaryRecord [subject, text, task, state] - - unitName createDiaryRecord [subject, [title, text], task, state] + waypointsEnabledUAV uav - $Code$player createDiaryRecord ["Diary", ["Intel", "Enemy base is on grid marker name='enemyBase' 161170 /marker "]]$/Code$ - - $Code$player createDiaryRecord ["Diary", "Information gathered. br / img image='wellDone_ca.paa' / "]$/Code$ + $Code$_uav enableUAVWaypoints false ; + hint str waypointsEnabledUAV _uav; // returns false$/Code$ - undefined / local + undefined / undefined - (14:54, 15 January 2011‎) - To insert a link into a diary record that executes code instead of jumping to a marker, use the tag - execute expression=" Code to execute " Text /execute - - (March 24, 2017) - When adding multiple diary records, be aware that they appear in reverse order. ie the first one you add will appear last and the last one you add will be first. - String + Boolean + - createDiarySubject + selectWeaponTurret - Create a new subject page in a log. + Selects the given weapon on specified turret. Use turret path [-1] for driver's turret. Since ver. 1.63.136864 this command supports both weapon name and muzzle name. - https://community.bistudio.com/wiki/createDiarySubject + https://community.bistudio.com/wiki/selectWeaponTurret - Object createDiarySubject Array + Object selectWeaponTurret Array - person createDiarySubject [subject, displayName, picture] + vehicle selectWeaponTurret [weapon, turretPath] - $Code$_index = player createDiarySubject ["myPage","My page"];$/Code$ + $Code$MBT_Kuma selectWeaponTurret ["LMG_coax",[0]];$/Code$ undefined / undefined + (February 13, 2017) + The command will treat weapon or muzzle param like a weapon first. If no such weapon is found then it will try to find muzzle with such name. For example AMV-7 Marshall APC has main gun "autocannon_40mm_CTWS" which has 2 muzzles "HE" and "AP". Default muzzle is "HE". So if you try to select weapon by the name "autocannon_40mm_CTWS" you will always get "HE" muzzle selected. However if you pass "AP" as param, it will correctly select "AP" muzzle, since no "AP" weapon exists on this turret it will continue searching for a muzzle with this name and will find it eventually. - Number + Nothing + - createDisplay + setLightFlareMaxDistance - Creates child display of given display and loads from "resourceName". The notable difference between createDisplay and createDialog is that with createDisplay the player would be able to move whilst having control of the mouse pointer. - Since Arma 3 v1.49.131653 createDisplay returns Display and will first look in description.ext for resourceName config, if not found, it will then look in main config. - Displays created with both createDisplay and createDialog will take control of the mouse pointer and will close when user presses Esc. - $Code$_emptyDisplay = findDisplay 46 createDisplay "RscDisplayEmpty";$/Code$ - If display is needed which exists independently, it can be created in IGUI layer with cutRsc command. - $Code$"someLayer" cutRsc ["RscTitleDisplayEmpty", "PLAIN"]; - _emptyDisplay = uiNamespace getVariable "RscTitleDisplayEmpty";$/Code$ - Such display can be closed with closeDisplay command or by overwriting the same cut layer with another output. Note that "Unload" EH for some reason does not work with such display. + Sets max distance where the flare is visible. - https://community.bistudio.com/wiki/createDisplay + https://community.bistudio.com/wiki/setLightFlareMaxDistance - Display createDisplay String + Object setLightFlareMaxDistance Number - parent createDisplay resourceName + light setLightFlareMaxDistance distance - $Code$findDisplay 46 createDisplay "RscCredits";$/Code$ + $Code$myLight setLightFlareMaxDistance 500;$/Code$ - undefined / undefined + local / local - (August 23, 2014) - Do not simply createDisplay from UI context code such as "ButtonDown" UI Event handler, as it will crash the game. Instead use spawn scope: - $Code$[] spawn { findDisplay 46 createDisplay "RscCredits"};$/Code$ - - (November 15, 2014) - Arma3 v1.34 - When using CreateDisplay instead of CreateDialog, all the commands for working with the controls of the display only work with the control version, not the IDC version. - EXAMPLE: - $Code$LbAdd [1234, "item"]; // does not work on displays, and won't error either - _ctrl LbAdd "item"; // does work with displays$/Code$ - So you have to use the control(DisplayCtrl) and not the IDC. - - (July 29, 2017) - A user dialog created with createDisplay over mission display ( findDisplay 46) will stop display event handlers added to mission display from firing. However if it is created with createDialog then the event handlers continue to work. - Nothing/Display + Nothing + - createGearDialog + allMines - Opens gear dialog for given unit. Alternatively use action command: - $Code$ player action ["Gear", player ];$/Code$ + Returns an array of all mines in the mission - https://community.bistudio.com/wiki/createGearDialog + https://community.bistudio.com/wiki/allMines - createGearDialog Array + allMines - createGearDialog [unit, resource] + allMines - $Code$createGearDialog [player];$/Code$ + $Code$allMines$/Code$ + + $Code$( allMines select 0) mineDetectedBy west ;$/Code$ undefined / undefined @@ -11861,77 +12693,62 @@ - Nothing + Array + - createGroup + ctrlAddEventHandler - Creates a new Group for the given Side. An HQ (center) for that side must already be in the Mission.sqm or have been initialized with createCenter. For the available sides see Side. - NOTES - The default limit of groups created per side was 144. Since Arma 3 v1.67 it is increased to 288. - Since Arma 3 v 1.67 it is possible to mark created group for automatic deletion when the group becomes empty (see Alt Syntax). When group is set to be automatically deleted when empty, when group becomes empty it may take up to a minute for it to get deleted. - In Arma 3 when last unit leaves its group, the group usually gets immediately auto deleted, regardless of whether or not if it was set for auto deletion manually + Add an event handler ( User Interface Event Handlers ) to the given control. Returns id of the handler or -1 when failed. + NOTE: Control EHs are processed in reversed order, i.e. last added: first, first added: last. So if you have an override it should be set up in the 1st added EH. - https://community.bistudio.com/wiki/createGroup + https://community.bistudio.com/wiki/ctrlAddEventHandler - createGroup Side - - createGroup Array + Control ctrlAddEventHandler Array - createGroup side - - createGroup [side, deleteWhenEmpty] + control ctrlAddEventHandler [handler,function] - $Code$_group = createGroup east$/Code$ + $Code$_map ctrlAddEventHandler ["draw","_this call BIS_fnc_strategicMapOpen_draw"];$/Code$ - $Code$_group = createGroup [ east, true ];$/Code$ + $Code$_map ctrlAddEventHandler ["draw",{ hintSilent str _this}];$/Code$ - undefined / global + undefined / undefined - (December 15, 2006) - The group limit is 144 groups groups per side. If you attempt to create a group, and there is no room for another, it simply doesn't create, and it doesn't error. - - (July 10,2007) - In Armed Assault, empty groups are not automatically deleted - if you created 144 groups, you will not be able to create new group even if all units in all those groups died, because all the 144 groups still exists - you will have to delete some groups manually. - - (January 04, 2011) - A group created with createGroup will get a waypoint at [0,0,0]. When you use createUnit to fill it with units, it will get an additional waypoint at the position the first unit is created. This new waypoint will also be set as currentWaypoint. However keep these two waypoints in mind when you do some scripting involving this groups' waypoints. + (October 30, 2013) + As of Arma 3 v1.05.111658 ctrlAddEventHandler and displayAddEventHandler support script Code in addition to String [1] - Group - Group + Number + - createGuardedPoint + saveGame - Adds a point guarded by the given side (scripted way of adding equivalent of "GUARDED BY" trigger in Editor ). A closest AI group in the given side with assigned "GUARD" waypoint will attempt to secure this guard point. The actual guarded position is determined via the following rules: - Given "position" is always considered. It could be Object, Group, Position2D or Position3D. In every case, z coordinate will be ignored and point will be placed on nearest surface. - If "objectMapID" is not negative, the position of the object with the given ID is used (Overrides "position"). -1 to ignore this argument. z of the object position will be intact. - If the given "vehicle" is valid, the position of the vehicle is extracted and guarded (Overrides both "position" and "objectMapID"). objNull to ignore. z of the vehicle position will be intact. - For use with "GUARD" waypoint. How does "GUARD" waypoint work: Waypoint:Guard + Autosave game (used for Retry). - https://community.bistudio.com/wiki/createGuardedPoint + https://community.bistudio.com/wiki/saveGame - createGuardedPoint Array + saveGame - createGuardedPoint [side, position, objectMapID, vehicle] + saveGame - $Code$createGuardedPoint [ east, [0,0], -1, vehicle player ];$/Code$ + $Code$saveGame ;$/Code$ undefined / undefined @@ -11939,227 +12756,224 @@ - Nothing + Nothing + - createLocation + compile - Creates a location of the specified class and dimensions at the specified position. Classes are defined in CfgLocationTypes. + Compile expression. - https://community.bistudio.com/wiki/createLocation + https://community.bistudio.com/wiki/compile - createLocation Array + compile String - createLocation [className, position, sizeX, sizeY] + compile expression - $Code$_location = createLocation [ "NameVillage", [4035,2151,10], 100, 100];$/Code$ + $Code$_string = "a = a + 1"; + _code = compile _string; + call _code;$/Code$ - $Code$_location = createLocation [ "NameVillage", [4035,2151,10], 30, 30]; - _location setText "Player town";$/Code$ + $Code$hint str compile "a = b"; + //Result: {a=b}$/Code$ - undefined / local + undefined / undefined - (12:25, 12 February 2010) - Possible location types, see: Location Types - For the actual name text of the location, use setText. - Location + Code + - createMPCampaignDisplay + getEditorObjectScope - Create a MP campaign display. The class name must be a mission collection declared in the configs; in example, configFile /"CfgMissions"/"MPMissions"/"Apex"/ - If the class doesn't exist or isn't a mission collection, the display will be created empty. + Returns the editor object scope of the specified editor object. + i + Some Old Editor Command - https://community.bistudio.com/wiki/createMPCampaignDisplay + https://community.bistudio.com/wiki/getEditorObjectScope - Display createMPCampaignDisplay String + Control getEditorObjectScope String - display createMPCampaignDisplay class + map getEditorObjectScope object - $Code$findDisplay 46 createMPCampaignDisplay "Apex";$/Code$ - + undefined / undefined - (July 14, 2016) - $Code$ findDisplay 46 createMPCampaignDisplay "123";$/Code$ - Nothing + String + - createMarker + tvSetTooltip - Creates a new marker at the given position. The marker name has to be unique. + Sets the tooltip text associated with the specified tree view path. - https://community.bistudio.com/wiki/createMarker + https://community.bistudio.com/wiki/tvSetTooltip - createMarker Array + tvSetTooltip Array + + Control tvSetTooltip Array - createMarker [name, position] + tvSetTooltip [idc, path, text] + + ctrl tvSetTooltip [path, text] - $Code$_marker1 = createMarker ["Marker1", position player ];$/Code$ + $Code$tvSetTooltip [101, [0,2], "This is a tooltip"];$/Code$ - $Code$_marker2 = createMarker ["Marker2", player ];$/Code$ + $Code$_tree tvSetTooltip [[0,2], "This is a tooltip"];$/Code$ - undefined / global + undefined / undefined - $Code$_markerstr = createMarker ["markername",[_Xpos,_Ypos]]; - _markerstr setMarkerShape "ICON"; - _markerstr setMarkerType "hd_dot";$/Code$ - - (September 19, 2015) - createMarker accepts an object as position parameter as well (A3 - 1.50.131969). You could try this with the following code (both SP/MP) - $Code$_markerstr = createMarker ["markername", player]; - _markerstr setMarkerShape "RECTANGLE"; - _markerstr setMarkerSize [100,100];$/Code$ - String + Nothing - Nothing + - createMarkerLocal + unitIsUAV - Creates a local marker at the given position. Marker exists only on PC that created it. The marker name has to be unique. - NOTE: Local markers have own set of local commands "XXXXLocal" to work with. If you use global marker command on a local marker, the local marker will become global marker. + Returns true if the unit type is UAV - coresponding to transport param "isUAV" - https://community.bistudio.com/wiki/createMarkerLocal + https://community.bistudio.com/wiki/unitIsUAV - createMarkerLocal Array + unitIsUAV Object - createMarkerLocal [name, position] + unitIsUAV unit - $Code$_marker = createMarkerLocal ["Marker1", position player ];$/Code$ + $Code$_isUAV = unitIsUAV veh;$/Code$ - undefined / local + undefined / undefined - To create a marker which is visible on the map you need to define at least the following three settings: - $Code$_markerstr = createMarkerLocal ["markername",[_Xpos,_Ypos]]; - _markerstr setMarkerShapeLocal "ICON"; - _markerstr setMarkerTypeLocal "DOT";$/Code$ - String + Boolean + - createMenu + currentWeapon - Creates a previously added menu. - i - Some Old Editor Command + Return the name of the currently selected weapon (on the primary turret for vehicles). - https://community.bistudio.com/wiki/createMenu + https://community.bistudio.com/wiki/currentWeapon - Control createMenu Number + currentWeapon Object - map createMenu index + currentWeapon vehicle - + $Code$_weaponClass = currentWeapon (vehicle player);//Example: "M16A2GL"$/Code$ + + $Code$_weaponClass = currentWeapon player;$/Code$ + undefined / undefined + (July 15, 2009) + You have to make a little delay (sleep 0.001; (not less)) to use this command, else you will be returned an empty string. + + (July 15, 2009) + It seems it's not working in 1.02 for other unit than player. + + (May 4, 2010) + This works for vehicles providing there is a gunner - Nothing + String + - createMine + queryMagazinePool - Creates a mine of the given type (type is the name of the subclass of CfgVehicles). If the markers array contains several marker names, the position of a random one is used, otherwise, the given position is used. The mine is placed inside a circle with this position as its center and placement as its radius. + Return number of magazines of type name in magazine pool (used in campaign to transfer magazines into next mission). - https://community.bistudio.com/wiki/createMine + https://community.bistudio.com/wiki/queryMagazinePool - createMine Array + queryMagazinePool String - createMine [type, position, markers, placement] + queryMagazinePool name - $Code$_mine = createMine ["MineMine", position player, [], 0];$/Code$ + $Code$_num = queryMagazinePool "M16";$/Code$ undefined / undefined - (June 5, 2017) - Note that this command uses AGL (very similar to ASL) positions, so if you want to use the moored or seabed mine, you'll have to find the appropriate negative z value that is underwater and convert that to ASL. - Also note that you can't adjust the positions of sea mines after they've been created. The command is either ignored or not propagated across the network to clients. - Object + Number + - createMissionDisplay + taskMarkerOffset - Create single missions display as a child of given display. The mission dialog will be set to the directory given as an argument "root". + Returns model space position for the task marker - https://community.bistudio.com/wiki/createMissionDisplay + https://community.bistudio.com/wiki/taskMarkerOffset - Display createMissionDisplay String + taskMarkerOffset Object - display createMissionDisplay string + taskMarkerOffset unit - $Code$_ChildDisplay = _Rootdisplay createMissionDisplay "Tutorial";$/Code$ - - $Code$// In Arma 3 this would create scenarios UI - findDisplay 46 createMissionDisplay "";$/Code$ + $Code$_offset = taskMarkerOffset player ;$/Code$ undefined / undefined @@ -12167,975 +12981,845 @@ - Display + Array + - createSimpleObject + is3DENMultiplayer - Create object with given shape defined as path to.p3d model. Supported LODs include Geometry, Fire Geometry, Roadway, View Geometry and ShadowVolume. Supported features include collision, texturing, animation, penetration, AI spotting occlusion, and surface specific sounds (like footsteps). Unsupported features include PhysX, damage, AI pathfinding (causes walking through walls), and built in lights. - Given the simulation limitations, global decorative objects can be created with very little network traffic. Objects that could be exclusively created with this command are: trees, bushes, rocks, bridges, roads, vehicle wrecks, custom models in mission, and other objects without a class in config. The height of the placement position might need to be adjusted experimentally. Some of the model examples could be found here: createSimpleObject/objects - Guide: https://community.bistudio.com/wiki/Arma_3_Simple_Objects - One cannot attach actions to a simple object via addAction. - NOTES : - Objects created with Syntax 1 cannot be textured. Some objects may also have inverted default direction. - Objects created with Syntax 2 can be textured. The default direction should match the direction of the object if it was created with createVehicle. - Since Arma 3 v1.67 simple objects support setVariable and getVariable + Returns true if the Eden Editor is in multiplayer mode. Returns true in the following cases: + Multiplayer Preview launched directly from 3DEN - true in preview and only for the creator + MP mission is chosen for editing when creating a server: Multiplayer - Server Browser - Host Server. When 3D EDITOR button is clicked for selected mission and 3DEN is launched, command returns true within the editor environment. (see also is3DEN ) - https://community.bistudio.com/wiki/createSimpleObject + https://community.bistudio.com/wiki/is3DENMultiplayer - createSimpleObject Array + is3DENMultiplayer - createSimpleObject [shapeName, positionWorld] - - createSimpleObject [className, positionASL] + is3DENMultiplayer - $Code$_pos = player getRelPos [10, 0]; - _tank = createSimpleObject ["a3\armor_f_beta\apc_tracked_01\apc_tracked_01_rcws_f.p3d", _pos]; - _tank setPos (_pos vectorAdd ( getPosWorld _tank vectorDiff (_tank modelToWorld [0,0,0]))); - _tank hideSelection ["zasleh", true ]; - _tank hideSelection ["zasleh2", true ]; - _tank hideSelection ["clan", true ]; - _tank animate ["Wheel_podkoloL3", 0.5, true ]; - _tank animate ["Wheel_podkoloL6", 0.5, true ];$/Code$ - - $Code$_pos = player getRelPos [10, 0]; - _tank = createSimpleObject ["B_APC_Tracked_01_CRV_F", AGLtoASL _pos]; - _tank setObjectTexture [0, "#(rgb,8,8,3)color(0,1,0,0.01)"]; - _tank hideSelection ["zasleh", true ]; - _tank hideSelection ["zasleh2", true ]; - _tank hideSelection ["clan", true ]; - _tank animate ["Wheel_podkoloL3", 0.5, true ]; - _tank animate ["Wheel_podkoloL6", 0.5, true ];$/Code$ + $Code$if is3DENMultiplayer then { systemChat "Your hosting a test server!"};$/Code$ - undefined / global + undefined / undefined - (April 18, 2016) - The easiest way to correctly place simple object is to create normal object of the same shape from class (if possible), then copy getPosWorld, vectorDir and vectorUp from it. Then create the simple object and apply copied values to it, this will position simple object exactly as normal object was positioned: - $Code$_heli = "B_Heli_Light_01_F" createVehicleLocal ( player getRelPos [10, 0]); - _position = getPosWorld _heli; - _vectorDirUp = [ vectorDir _heli, vectorUp _heli]; - _model = getModelInfo _heli select 1; - deleteVehicle _heli; - _simpleHeli = createSimpleObject [_model, _position]; - _simpleHeli setVectorDirAndUp _vectorDirUp;$/Code$ - - (April 28, 2016) - Models from within the mission file/folder can be created, but full system path is needed. Use: - $Code$( str missionConfigFile select [0, count str missionConfigFile - 15]) + "myModel.p3d" - //mission folder path code from: http://killzonekid.com/arma-scripting-tutorials-mission-root/ $/Code$ - - (May 11, 2016) - simulationEnabled returns false. - - (September 5, 2016) - There is a section in function library dedicated to simple object creation and interaction. It's purpose is to simplify the operations: - BIS_fnc_createSimpleObject - creates simple object according to the supplied data - you can supply p3d path, class name or data you get from scanning a non-simple object - BIS_fnc_simpleObjectData - gathers and returns data about the non-simple object - data can be then used to create simple object - BIS_fnc_replaceWithSimpleObject - replaces non-simple object with simple object on the scene - do not use it in large scale in MP missions as it is not network efficient - BIS_fnc_adjustSimpleObject - adjusts simple object to looks as close to the non-simple object as possible - function is internally called from the 'bis_fnc_createSimpleObject', you won't probably need to call this function directly - Check the function headers for more info about the input parameters and possibilities. - Object + Boolean + - createSimpleTask + removeAll3DENEventHandlers - Creates a new Task. The task effect is local, it will only exist on PC it was added. + Removes all Eden Editor event handlers of given type. + See the list of all Eden Editor Event Handlers. - https://community.bistudio.com/wiki/createSimpleTask + https://community.bistudio.com/wiki/removeAll3DENEventHandlers - Object createSimpleTask Array + removeAll3DENEventHandlers String - person createSimpleTask [name, parentTask ] + removeAll3DENEventHandlers type - $Code$_currentTask = player createSimpleTask ["NewTask"];$/Code$ - - $Code$_childTask = player createSimpleTask ["ChildTask", _currentTask];$/Code$ + $Code$removeAll3DENEventHandlers "onUndo";$/Code$ - global / local + undefined / undefined - (July 02, 2011) - Creating child will position the new task just under the parent task. - Creating another "normal" (parent) task will create a new line above the others. Think of it if you want ordered objectives. - Succeeding parent task will automatically succeed childs, whatever their taskState was set to. (I.E. If a task is set as a child to another, it will be completed when its parent is complete.. no matter if the child task really was or not). - This command has to be executed again for it to be applied for JIP players - no server sync - Full step by step code from beginning to end: - Step 1: create a new simpleTask - $Code$ - A_SIMPLE_TASK = player createSimpleTask [( localize "STR_aSimpleTask")]; - $/Code$ - You may create a task at any given point in time. You just need to be aware of the fact, that you've created the task for a single unit (the player). So if you make use of teamSwitch, respawn or similiar, you need to think about how to manage this, so all of these units will have up to date tasks assigned to them. - Second, it's a good practice to use a stringtable, even if you do not plan (yet) to offer translations. - Step 2: task destination - $Code$ - A_SIMPLE_TASK setSimpleTaskDestination _destination; - $/Code$ - variable/pointer-to-your-task setSimpleTaskDestination some-position. That's it. - Step 3: task description - $Code$ - A_SIMPLE_TASK setSimpleTaskDescription [ - ( localize "STR_aSimpleTaskLongText"), - ( localize "STR_aSimpleTask"), - ( localize "STR_aSimpleTaskWaypointLabel") - ]; - $/Code$ - Again, no magic involved here. You take your task, the command setSimpleTaskDescription an pass an array with three strings in it. The first string is the long description text, the second is the name/title of the task and the last one will show up on-screen on the waypoint in cadet mode. - Step 4: set and update task states - $Code$ - A_SIMPLE_TASK setTaskState "CREATED"; - $/Code$ - And that's it. Here a minimal working example: - $Code$ - A_SIMPLE_TASK = player createSimpleTask ["simple task title"]; - A_SIMPLE_TASK setSimpleTaskDestination ( position player ); - A_SIMPLE_TASK setSimpleTaskDescription [ - "simple task long description", - "simple task title", - "simple task waypoint label" - ]; - A_SIMPLE_TASK setTaskState "CREATED"; - $/Code$ - And then later in the mission: - $Code$ - A_SIMPLE_TASK setTaskState "SUCCEEDED"; - $/Code$ - If you want to keep the player in the loop about the status of tasks, you may always do this: - $Code$ - [ objNull, objNull, A_SIMPLE_TASK, "SUCCEEDED"] execVM "CA\Modules\MP\data\scriptCommands\taskHint.sqf"; - $/Code$ - Task + Nothing + - createSite + setEditorObjectScope - Create a new site. - This command is considered deprecated and is no longer supported + This command defines the level of access a user has to editor objects. + "objects" is an array of either Editor Objects (eg ["_unit_0"]) or actual Game Objects (eg [player]). If the array is empty then the command will automatically parse all editor objects. + "editorType" is the editor type to effect (eg "unit", "vehicle", "center") or "" for all types. + "condition" is an executable string that must evaluate to true or false. If true, the scope of the evaluated editor object will be modified. "_x" can be used in the string as reference to the ingame representation of the currently processed array member. + "scope" is one of "HIDE", "VIEW", "SELECT", "LINKTO", "LINKFROM", "ALLNODRAG", "ALLNOTREE", "ALLNOCOPY", "ALLNOSELECT" or "ALL". + "subordinatesAlso" is a boolean value. If true then subordinates in the editor will be assigned the same scope as the parent. + i + Some Old Editor Command - https://community.bistudio.com/wiki/createSite + https://community.bistudio.com/wiki/setEditorObjectScope - String createSite Position + Control setEditorObjectScope Array - type createSite pos + map setEditorObjectScope [objects, editorType, condition, scope, subordinatesAlso] - + $Code$_map setEditorObjectScope [ [],"vehicle", "side effectiveCommander _x != side player", "HIDE", false]$/Code$ + + $Code$((findDisplay 128) displayCtrl 51) setEditorObjectScope [ ["_unit_0"], "", "true", "ALLNODRAG", false]$/Code$ + undefined / undefined - (February 18, 2014) - "CreateSite is an obsolete command from the time in development when Sites were handled separately from other modules. Now they use the modules framework. - If you want a specific Site to be activated during the mission, place it in the editor and use the Condition line in its parameters (the last one)." - Jezuro [1] - Object + Nothing + - createSoundSource + diag_codePerformance - Creates a sound source of the given type (type is the name of the subclass of CfgVehicles which is pointing to the sound defined in CfgSFX ). If the markers array contains several marker names, the position of a random one is used, otherwise, the given position is used. The sound source is placed inside a circle with this position as its center and placement as its radius. Some of the vanilla classes pre-configured in Arma 3: - "Sound_Alarm" - "Sound_Alarm2" - "Sound_BattlefieldExplosions" - "Sound_BattlefieldFirefight" - "Sound_Fire" - "Sound_SmokeWreck1" - "Sound_SparklesWreck1" - "Sound_SparklesWreck2" - "Sound_Stream" - Since Arma 3 v1.69.141183 it is possible to define sounds for use with createSoundSource in mission config. As mentioned earlier, the sounds needed for this command should be defined inside CfgVehicles class, which itself references CfgSFX class. If given class searched in main config and is not found, the search will continue in description.ext. Here is an example of suitable mission config definition: - // description.ext - class CfgSFX - { - class MyOwl - { - sound0 [ ] = { "@A3\Sounds_F\environment\animals\birds\owl1", db - 10, 1.0, 1000, 0.2, 0, 15, 30 } ; // path to addon sound - sound1 [ ] = { "@A3\Sounds_F\environment\animals\birds\owl2", db - 10, 1.0, 1000, 0.2, 0, 15, 30 } ; // path to addon sound - sound2 [ ] = { "@A3\Sounds_F\environment\animals\birds\owl3", db - 10, 1.0, 1000, 0.2, 0, 15, 30 } ; // path to addon sound - sounds [ ] = { sound0, sound1, sound2 } ; - empty [ ] = { "", 0, 0, 0, 0, 0, 0, 0 } ; - } ; - } ; - class CfgVehicles - { - class MyOwlSound // class name to be used with createSoundSource - { - sound = "MyOwl" ; // reference to CfgSFX class - } ; - } ; - $Code$_owl = createSoundSource ["MyOwlSound", position player, [], 0];$/Code$ - Note that the sound created by createSoundSource will always be looping. Also when CfgSFX sound definition contains more than 1 sound, there is no guarantee that the sound played will be the same on every PC in Multiplayer. + Attempts to run given code with given arguments given number of cycles in unscheduled environment and returns average time it took to run the code as well as actual number of executions performed. The command will return as soon as possible if the tested code is slow and the duration of the command exceeds 1 second. Engine alternative to BIS_fnc_codePerformance + NOTE: For security purposes, this command will only run for 1 cycle in MP, unless in-game debug console is available via description.ext option or Eden attribute setting. - https://community.bistudio.com/wiki/createSoundSource + https://community.bistudio.com/wiki/diag_codePerformance - createSoundSource Array + diag_codePerformance Array - createSoundSource [type, position, markers, placement] + diag_codePerformance [code, arguments, cycles] - $Code$_soundSource = createSoundSource ["LittleDog", position player, [], 0]$/Code$ - - $Code$[] spawn - { - _alarm = createSoundSource ["Sound_Alarm", position player, [], 0]; //starts alarm - sleep 10; - deleteVehicle _alarm; //stops alarm - };$/Code$ + $Code$_result = diag_codePerformance [{ private _a = 123;}, 0, 10000];$/Code$ - global / global + undefined / undefined - Object + Array + - createTask + didJIP - Create a new AI task (subtask of parentTask). Type is name of registered task type. + Checks if the current client Joined In Progress. - https://community.bistudio.com/wiki/createTask + https://community.bistudio.com/wiki/didJIP - Team_Member createTask Array + didJIP - teamMember createTask [[type, parentTask], priority, name1, value1nameN, valueN] + didJIP - + $Code$clientDidJIP = didJIP ;$/Code$ + undefined / undefined + (February 23, 2016) + reports false in CfgFunctions with preInit = 1; even when the client joined in progress. - Task + Boolean + - createTeam + findDisplay - Create a team and name it. + Find display by its IDD (which is defined in the description.ext or config). + If the specified display can't be found displayNull ("No display") is returned, (which can be tested with the isNull command.) + The primary display uses IDD 46. (eg: findDisplay 46). This will return displayNull on a dedicated server (so be sure to check isDedicated if using this in a waitUntil condition). - https://community.bistudio.com/wiki/createTeam + https://community.bistudio.com/wiki/findDisplay - createTeam Array + findDisplay Number - createTeam [type, name] + findDisplay idd - $Code$_team = createTeam ["USMC_Team", "Fire Team Red"];$/Code$ + $Code$_display = findDisplay 1;$/Code$ undefined / undefined + (15 June 2008) + findDisplay does not find displays defined under RscTitles (even when they are visible). + To access those types of displays, either assign the resource to a global variable, or pass its this value to a script, during the onLoad event: + e.g. class RscTitles { + class MyRsc { + onLoad = "myDisplay = (_this select 0)"; // or + // onLoad = "_this execVM 'myDialog.sqf'"; + ... + You can then use the stored value as you would for regular dialogs: + $Code$(myDisplay displayCtrl 1111) ctrlSetText "hello there");$/Code$ + + (17 March 2010) + I posted a tutorial on finding and using displays here. + + (07 March 2014) + The Zeus Display uses IDD 312 + + (March 25, 2015) + Display 12 is map + + (June 25, 2017) + I have tested the behavior of this command and I found out that it [ findDisplay ] appears to only return the display AFTER any onLoad event handler of that display is done. So, using findDisplay inside an onLoad event handler is useless. + + (August 14, 2017) + There are some specific cases, where findDisplay will not be able to find an existing display. Here's the cases and how to act on them: + $Code$//Your display has IDD= -1. + class RscDisplayNew + { + idd=-1; + scriptName = "RscDisplayNew"; + ... + };$/Code$ + $Code$//Your display doesn't have IDD + class RscDisplayNew + { + scriptName = "RscDisplayNew"; + ... + };$/Code$ + $Code$//Your display doesn't have scriptname with IDD = -1 + class RscDisplayNew + { + idd=-1; + ... + };$/Code$ + $Code$//Your display doesn't have scriptname, neither IDD + class RscDisplayNew + { + ... + };$/Code$ + 1. + You actually can find a -1 display, but this means finding a display with this IDD might be a problem, when there are a few displays marked as -1. + So as you can see, theres an entry called scriptName. You can get a reference to this display by using uiNamespace : + $Code$(uiNamespace getVariable "RscDisplayNew")$/Code$ + NOTE : Variables are overwritten with a reference of the last declared display under the same scriptName entry. Take a look at case 3 for solution. + 2. + Displays without IDD's can actually exist. They can be manipulated only in a way described in the first case using uiNamespace. + 3. + You can really have this display seeking it manually in a allDisplays return. This is experimental, but working option. + 4. + You will have a problem finding this display, since this display doesn't exist even in allDisplays (?) return. Behaviour unknown. - Team_Member + Display + - createTrigger + setParticleParams - Creates a sensor ( trigger ) of the given type and at the given position. The type must be a class name in CfgNonAIVehicles or CfgVehicles with simulation = detector. An array containing all units that have activated the trigger is available via list triggerobj. Created triggers can be deleted using deleteVehicle. - NOTE1: Since Arma 3 v1.43.129935 triggers can be created locally on clients setting optional param makeGlobal to false - NOTE2: Since Arma 3 v1.53.132440 triggers can be disabled/enabled using enableSimulation command - Triggers are created with default params, which are: - a: 50.0 - b: 50.0 - c: -1 - angle: 0 - rectangular: false - activationBy: None - activationType: Present - repeating: false - timeoutMin: 0 - timeoutMid: 0 - timeoutMax: 0 - interruptable: true - type: None - text: "" - name: "" - expCond: "this" - expActiv: "" - expDesactiv: "" + Set parameters to particle source. Array is in format ParticleArray. + Since Arma 3 version 1.11.114706 you can use this command to overwrite many values set by setParticleClass, particularity those defined in ParticleArray. Correspondence between CfgCloudlets class param names and command array of params: + $Code$particleSource setParticleParams + [ + /* String or Array - If string then the name of the particleShape. And following default values are used: + particleFSNtieth = 1 + particleFSIndex = 0 + particleFSFrameCount = 1 + particleFSLoop = true + */ + [ + particleShape, /* String */ + particleFSNtieth, /* Number */ + particleFSIndex, /* Number */ + particleFSFrameCount, /* Number */ + particleFSLoop /*Optional - Boolean. Default: true */ + ], + animationName, /* String */ + particleType, /* String - Enum: Billboard, SpaceObject*/ + timerPeriod, /* Number */ + lifeTime, /* Number */ + position, /*3D Array of numbers as relative position to particleSource or (if object at index 18 is set) object. + Or (if object at index 18 is set) String as memoryPoint of object.*/ + moveVelocity, /*3D Array of numbers.*/ + rotationVelocity, /* Number */ + weight, /* Number */ + volume, /* Number */ + rubbing, /* Number */ + size, /* Array of Number */ + color, /* Array of Array of RGBA Numbers */ + animationSpeed, /* Array of Number */ + randomDirectionPeriod, /* Number */ + randomDirectionIntensity, /* Number */ + onTimerScript, /* String */ + beforeDestroyScript, /* String */ + this, /* Object */ + angle, /*Optional Number - Default: 0*/ + onSurface, /*Optional Boolean */ + bounceOnSurface, /*Optional Number */ + emissiveColor /*Optional Array of Array of RGBA Numbers */ + ];$/Code$ - https://community.bistudio.com/wiki/createTrigger + https://community.bistudio.com/wiki/setParticleParams - createTrigger Array + Object setParticleParams Array - createTrigger [type, position, makeGlobal] + particleSource setParticleParams array - $Code$_trg = createTrigger ["EmptyDetector", getPos player ]; - _trg setTriggerArea [5, 5, 0, false ]; - _trg setTriggerActivation ["CIV", "PRESENT", true ]; - _trg setTriggerStatements ["this", "hint 'Civilian near player'", "hint 'no civilian near'"];$/Code$ + $Code$see ParticleArray$/Code$ undefined / undefined - (March 6, 2013) - Calling list immediately after creating a trigger this way (and setting up activation, area, statements, timeout, etc..), will return null instead of an array. It seems the trigger needs about 1 second to initialise, after which it will behave as expected: returning an array of all the objects inside the trigger (the ones matching the criteria), or an empty array. - Object + Nothing + - createUnit + debugFSM - Create unit of a class that's defined in CfgVehicles. - The Group parameter MUST be an existing group or the unit won't be created. + Dump (something about FSM) to debugging output. This command is (assumed to be) non-functional in the retail version. + Non functional in retail - https://community.bistudio.com/wiki/createUnit + https://community.bistudio.com/wiki/debugFSM - Group createUnit Array - - String createUnit Array + Number debugFSM Boolean - group createUnit [type, position, markers, placement, special] - - type createUnit [position, group, init, skill, rank] + FSMhandle debugFSM true - $Code$_unit = group player createUnit ["SoldierWB", position player, [], 0, "FORM"];$/Code$ - - $Code$"SoldierWB" createUnit [ position player, group player ];$/Code$ - - $Code$"soldierWB" createUnit [ getMarkerPos "barracks", _groupAlpha];$/Code$ - - $Code$"soldierWB" createUnit [ getMarkerPos "marker_1", _groupAlpha, "loon1 = this; - this addWeapon 'BAF_L85A2_RIS_SUSAT'", 0.6, "corporal"];$/Code$ - + - undefined / global + undefined / undefined - (August 13, 2006) - To give a newly created unit a name, put "newUnit = this" in the init field. - - (18:41, 5 April 2007 (CEST)) - The eventhandlers added with addEventHandler in the init parameter will only fire locally on the machine where this creation command is called from. - - (December 24, 2007) - If you do not wish it to be in a group, you can create a gamelogic and group it to that. Note: The unit will deny to move away from the gamelogic. - - (August 27, 2015) - In order to solve the above problem you can simply group it to the game logic as stated, then group it to grpNull - e.g - $Code$myUnit join myGroupLogic; - myUnit join grpNull - $/Code$ - - (21 December 2006) - Although this command takes a group as an argument, you need to use the join command if you want the created units to perform actions such as move. For example: - $Code$ comment "Create a new soldier within 100m of the player and cause them to run towards the player" ; - _grp = createGroup west ; - unit = _grp createUnit ["SoldierWB", position player, [], 100, "FORM"] ; - [unit] join _grp ; - unit move position player ; - $/Code$ - However, some commands such as setUnitPos only work if run before the join. - - (11 March 2011) - Comment above about 'an additional join required' is no longer true for Operation Arrowhead. - - (27th Nov 2016) - (A3 v1.64)The side of created unit by this command fallows the fraction from its config and won’t be affected by the side of the passed group parameter which is created by createGroup on the fly without entities. - $Code$ - _grp = createGroup east ; // O Alpha 1-1 - _ap = _grp createUnit [ “C_man_p_beggar_F”, position player, [], 0, "FORM"]; - //the side of _ap is still CIV not EAST. - $/Code$ - We can use join command family or fill the _grp with entities in advance to set _ap to our desired side. - Object - Nothing + Nothing + - createVehicleCrew + distributionRegion - Creates crew to given empty vehicle. Crew members are default crew defined in config. Crew side will also correspond to vehicle's faction. This command does not addVehicle to the created crew in the same way this normally happens when crewed vehicle created in the editor. + Returns the numerical index for the distribution region of this copy of ArmA. + 1 - US + 2 - Rest of the world - https://community.bistudio.com/wiki/createVehicleCrew + https://community.bistudio.com/wiki/distributionRegion - createVehicleCrew Object + distributionRegion - createVehicleCrew vehicle + distributionRegion - $Code$// Spawn a flying UAV with crew. - myUAV = [ getPos player, 0, "B_UAV_02_F", west ] call BIS_fnc_spawnVehicle ; - createVehicleCrew (myUAV select 0);$/Code$ - - $Code$_veh = createVehicle ["O_MRAP_02_hmg_F", position player, [], 0, "NONE"]; - createVehicleCrew _veh; - { - diag_log [_x, faction _x, side _x, side group _x]; - } forEach crew _veh;[O Alpha 1-1:1,"OPF_F",EAST,EAST] - [O Alpha 1-1:2,"OPF_F",EAST,EAST]$/Code$ + $Code$distributionRegion == 1$/Code$ undefined / undefined - (August 20, 2014) - As of ARMA 3 v1.26 the command will work on non-empty vehicles. If any of the crew defined in config are missing they will be added. - - (November 8, 2014) - This command creates drivers/copilots, commanders and gunners where appropriate, but it never creates cargo crew. - So a gunship Huron will get a pilot and copilot plus 2 door gunners, but nobody in the back. - - (December 22, 2015) - createVehicleCrew does not work with Transport Unload waypoints for helicopters. You need to spawn the pilots separately and then get them into the helicopter in order to get Transport Unload waypoints to work. - - (July 2, 2017) - The particular seats to which units are added depend on the dontCreateAI property, the hasDriver property of the base class, and the hasGunner propery of turret classes. - For instance, the following snippet calculates how many seats will be occupied by the created crew: - $Code$private _vehCfg = configFile "CfgVehicles" typeOf _vehicle; - private _crewCount = {round getNumber (_x "dontCreateAI") 1 && - ((_x == _vehCfg && {round getNumber (_x "hasDriver") 0}) || - (_x != _vehCfg && {round getNumber (_x "hasGunner") 0}))} count ([_vehicle, configNull] call BIS_fnc_getTurrets); - $/Code$ - Also, I've written a function to create a UAV crew for a specific side: https://gist.github.com/AgentRev/cb25d30e464f2239b6cee51fa0110c78 - Nothing + Number + - createVehicleLocal + hintSilent - Creates an object of the given type. Created object is not transferred through network in MP games. netId of such vehicle in multiplayer will be "0:0". To disable local vehicle creation, use CfgDisabledCommands to blacklist this command + Same as hint, but without a sound. - https://community.bistudio.com/wiki/createVehicleLocal + https://community.bistudio.com/wiki/hintSilent - String createVehicleLocal Position + hintSilent String/Structured_Text - type createVehicleLocal position + hintSilent text - $Code$_lightsource = "#lightpoint" createVehicleLocal _pos;$/Code$ + $Code$hintSilent "You texte comes here !"$/Code$ undefined / local - (07:18, 5 June 2008 (CEST)) - If the object that is created is of the type ammo, then it will created on all clients ( tested only on VBS2 ). - - (18:04, 5 September 2013 (CEST)) - Indeed the type of Ammo is transfered to ALL clients, but apparently also the muzzle effects (firing sound, light, etc.); this includes muzzles from Horns (Truck or Car Horn, Bicycle bells, etc.) as well as any other weapon. Tested on Arma 1 - Arma 2 OA (latest patch). - Object + Nothing + - createVehicle + posWorldToScreen - Creates an empty object of given classname type (See Arma 3 Assets or createVehicle/vehicles ) - For a class reference from older games see Classes. - Some special 'Scripted' vehicle classes: - DemoCharge_Remote_Ammo_Scripted - same as DemoCharge_Remote_Ammo but will explode when destroyed or setDamage 1; - SatchelCharge_Remote_Ammo_Scripted - same as SatchelCharge_Remote_Ammo but will explode when destroyed or setDamage 1; - ClaymoreDirectionalMine_Remote_Ammo_Scripted - same as ClaymoreDirectionalMine_Remote_Ammo but will explode when destroyed or setDamage 1; - GroundWeaponHolder_Scripted - same as GroundWeaponHolder but will not be auto-deleted when empty - WeaponHolderSimulated_Scripted - same as WeaponHolderSimulated but will not be auto-deleted when empty - Randomization: - In Arma 3 many vehicles will get randomized in appearance by default in order to add some variety to the game. It is possible to override this default behavior by setting BIS_enableRandomization variable to false in the vehicle namespace: - $Code$_veh = "C_Offroad_01_F" createVehicle position player ; - _veh setVariable ["BIS_enableRandomization", false ];$/Code$ - or - $Code$this setVariable ["BIS_enableRandomization", false ];$/Code$ - if done in mission editor init field. + Convert world coordinates to screen coordinates in map. - https://community.bistudio.com/wiki/createVehicle + https://community.bistudio.com/wiki/posWorldToScreen - String createVehicle Position - - createVehicle Array + Control posWorldToScreen Array - type createVehicle position - - createVehicle [type, position, markers, placement, special] + map posWorldToScreen position - $Code$_jeep = "Jeep" createVehicle position player ;$/Code$ - - $Code$_heli = "AH1Z" createVehicle getMarkerPos "hspawn";$/Code$ - - $Code$_veh = createVehicle ["ah1w", position player, [], 0, "FLY"];$/Code$ - - $Code$_veh = createVehicle ["2S6M_Tunguska", getMarkerPos "marker1", ["marker2","marker3"], 0, "NONE"];$/Code$ - - $Code$// Objects such as - //test_EmptyObjectForBubbles - //test_EmptyObjectForFireBig - //test_EmptyObjectForSmoke - //create additional emitters, which are stored in "effects" variable on the object. Since Arma 3 v1.71 these emitters are automatically deleted when object is deleted - [] spawn - { - _fire = "test_EmptyObjectForFireBig" createVehicle position player ; - sleep 5; - deleteVehicle _fire; - };$/Code$ - - $Code$// The following explosives (with ending _Scripted) - //DemoCharge_Remote_Ammo_Scripted - //SatchelCharge_Remote_Ammo_Scripted - //ClaymoreDirectionalMine_Remote_Ammo_Scripted - //can be set off by applying setDamage 1 to them for ease of scripting: - _claymore = "ClaymoreDirectionalMine_Remote_Ammo_Scripted" createVehicle position player ; - 0 = _claymore spawn - { - uiSleep 5; - _this setDamage 1; - };$/Code$ - - $Code$// How to add inventory to objects without inventory: - _boxes = "Land_Pallet_MilBoxes_F" createVehicle position player ; - _cargo = "Supply500" createVehicle [0,0,0]; - _cargo attachTo [_boxes, [0,0,0.85]]; - // optional for objects that can take damage - _boxes addEventHandler ["Killed", - { - { - detach _x, - deleteVehicle _x; - } - forEach attachedObjects (_this select 0); - }];$/Code$ - - $Code$// Drop weapon: - _wh = "GroundWeaponHolder_Scripted" createVehicle position player ; - player action ["DropWeapon", _wh, currentWeapon player ];$/Code$ - + - undefined / global + undefined / undefined - (August 13, 2006) - Using main syntax of this command sets the created vehicle not exactly at the given position, you have to setPos it there, if accuracy counts. - - (Jan 20, 2006) - Using main syntax of this command sets the created vehicle in the nearest possible position. You can create a dozen of tanks with it - they will appear side by side. - - (December 13, 2006) - Observe that buildings with the default destrType will not work correctly in multiplayer in Armed Assault when created with this command. The Destruction effect will only be displayed where the building is local. - - (Oct 18, 2009) - As of Arma2, this command cannot be used to create game logics (source). Use createUnit instead. - - (January 14, 2011) - In multiplayer, only run this command on one machine. It will create a the vehicle on all machines every time it is called on any machine. - - (January 26 2014) - Using getPosATL should work, if otherwise you are struggling to get a the proper position coordinates. - - (September 12, 2014) - "vehclass" createVehicle pos is the same if not faster than createVehicle ["vehclass", pos, [], 0, "NONE"] - - (August 22, 2015) - GroundWeaponHolder class is automatically deleted when empty after 0.5 to 1 seconds in A3 1.48. The exact delay is random but never lower than 0.50 secs after creation. You can stop deletion by adding something (cargo) to it within 0.5 seconds. - - (December 1, 2015) - The short syntax creates vehicles at ground level ignoring the Z in pos - $Code$"vehclass" createVehicle pos$/Code$ This is equivalent to $Code$createVehicle ["vehclass", [pos select 0, pos select 1, 0], [], 0, "NONE"]$/Code$ - - (May 16, 2017) - For the alternative syntax, if the vehicle has canFloat = 1; in its config class (e.g. boats and wheeled APCs), the command expects PositionAGL, and otherwise always PositionATL. - Object - Object + Array + - crew + lbValue - Returns the crew (both dead and alive) of the given vehicle. + Returns the additional integer value in the item with the given index of the listbox or combobox with id idc of the topmost user dialog. - https://community.bistudio.com/wiki/crew + https://community.bistudio.com/wiki/lbValue - crew Object + lbValue Array + + Control lbValue Number - crew vehicleName + lbValue [idc, index] + + control lbValue index - $Code$player in ( crew _tank);$/Code$ + $Code$_value = lbValue [101, 0];$/Code$ + + $Code$_value = _control lbValue 0;$/Code$ - global / undefined + local / local - (3 February, 2010) - The crew command will return crew in order [driver,gunner,commander,turrets,cargo] - - (1 June, 2014) - The crew command will return an empty array if the object has no crew - this includes objects that can't hold crew. If used on a unit (man, module, etc.) it will return an array containing that unit. + More information on the LB command family can be found here - Array + Number - Number + - ctAddHeader + setVectorDir - Adds a header line of controls according to the HeaderTemplate class. It returns an array containing header index and array of created controls in a format [ headerIndex, [ control0, control1... control n ]]. - Note that rows and headers are indexed separately. + Set object's direction vector. Up vector will remain unchanged. - https://community.bistudio.com/wiki/ctAddHeader + https://community.bistudio.com/wiki/setVectorDir - ctAddHeader Control + Object setVectorDir Array - ctAddHeader Control + object setVectorDir [x,y,z] - $Code$_array = ctAddHeader _control;$/Code$ - + - local / local + local / global + (March 16, 2008) + Command can be also used to rotate camera in all three axis. + + (21:06, 3 March 2009 (CET)) + setVectorDir can only influence an object's pitch. It can not influence bank. Example: + $Code$player setVectorDir [0,0,1]$/Code$ + If the player is facing 0 degrees (north), then this will do NOTHING. + If the player is facing 90 degrees (east), then this will make him pitch 90 degrees up. + You can't directly pitch an object beyond 90 degrees, because this would change its facing direction. You must first flip it's direction using setDir, then you must bank the object 180 degrees, THEN you pitch the object appropriately. + + (August 17, 2015) + In Arma 3, setVectorDir does not control an object's pitch or bank, in fact, it is not possible to change either of those solely using setVectorDir. This command can only affect horizontal rotation along the x-plane, unless an object first has it's vectorUp changed to something other than [0,0,1]. Correct input to setVectorDir should be calculated using the trigonometric functions sin and cos. + examples: + $Code$ + 0 degrees (north) + player setVectorDir + [ + sin 0, //equals 0 + cos 0, //equals 1 + 1 + ]; + 45 degrees (north-east) + player setVectorDir + [ + sin 45, //equals 0.707 + cos 45, //equals 0.707 + 1 + ];$/Code$ + If you are doing trigonometric calculations, it may be better to use setVectorDir rather than setDir, since sine and cosine have already been calculated and will not need to be re-calculated + (also, setDir probably uses setVectorDir anyway.) - Array + Nothing + - ctAddRow + sideEnemy - Adds one row of controls according to the RowTemplate class. It returns an array containing row index and array of created controls in a format [ rowIndex, [ control0, control1... control n ]]. - Note that rows and headers are indexed separately. + The enemy side (used for renegades). Unit of this side is enemy to everyone. + To become one, you can attack members of your own side or use addRating. + When below a rating of -2000 units switch automatically to this side. - https://community.bistudio.com/wiki/ctAddRow + https://community.bistudio.com/wiki/sideEnemy - ctAddRow Control + sideEnemy - ctAddRow Control + sideEnemy - $Code$_array = ctAddRow _control;$/Code$ + $Code$if ( side player == sideEnemy ) then { + hint "We've got a renegade!"; + };$/Code$ - local / local + undefined / undefined - Array + Side + - ctClear + triggerActivation - Removes all the lines from the RscControlsTable. Returns Nothing. + Returns trigger activation in the form [by, type, repeating]. + Note: The trigger could be local or remote but the result returned by this command will be for the trigger condition set up locally on the client that executed the command. See createTrigger for more info. - https://community.bistudio.com/wiki/ctClear + https://community.bistudio.com/wiki/triggerActivation - ctClear Control + triggerActivation Object - ctClear Control + triggerActivation trigger - $Code$ctClear _control;$/Code$ - + - local / local + global / local - Nothing + Array + - ctCurSel + allPlayers - Returns index of the selected row. Will take only rows, but not headers into account. + Returns a list of all human players including dead players. The command also returns all connected headless clients. To filter headless clients out: + $Code$_justPlayers = allPlayers - entities "HeadlessClient_F";$/Code$ + NOTES: + In player hosted game, the complete array of allPlayers may get delayed at the start. Use BIS_fnc_listPlayers if you need it earlier + The order of players in the return array may differ from server to clients - https://community.bistudio.com/wiki/ctCurSel + https://community.bistudio.com/wiki/allPlayers - ctCurSel Control + allPlayers - ctCurSel Control + allPlayers - $Code$_curSel = ctCurSel _control;$/Code$ + $Code${ + systemChat format [ + "Player %1 is %2", + name _x, + ["dead", "alive"] select alive _x + ]; + } forEach allPlayers ;$/Code$ + + $Code$_bluNums = west countSide allPlayers ;$/Code$ + + $Code$// Find all human players if headless clients are used: + _allHCs = entities "HeadlessClient_F"; + _allHPs = allPlayers - _allHCs;$/Code$ - local / local + undefined / undefined - Number + Array + - ctData + markerColor - Returns metadata (string) associated with a particular row of RscControlsTable. + Returns marker color for given marker. See setMarkerColor. Note: This function is identical to getMarkerColor. - https://community.bistudio.com/wiki/ctData + https://community.bistudio.com/wiki/markerColor - ctData Control + markerColor String - ctData Control + markerColor markerName - $Code$ctData _control;$/Code$ + $Code$if ( markerColor "Marker1" == "ColorRed") then { hint "Marker1 is red!"}$/Code$ - local / local + undefined / undefined - String + String + - ctFindHeaderRows + removeCuratorEditingArea - Takes index of a header as a parameter. Returns array of indices of rows under this header. + Removes editing area for given curator. - https://community.bistudio.com/wiki/ctFindHeaderRows + https://community.bistudio.com/wiki/removeCuratorEditingArea - Control ctFindHeaderRows Number + Object removeCuratorEditingArea Number - Control ctFindHeaderRows Number + curatorObj removeCuratorEditingArea editAreaID - $Code$_array = _control ctFindHeaderRows 0;$/Code$ + $Code$myCurator removeCuratorEditingArea 3;$/Code$ - local / local + undefined / undefined - Array + Nothing + - ctFindRowHeader + createTrigger - Takes index of a row as a parameter. Returns index of the closest header above this row. + Creates a sensor ( trigger ) of the given type and at the given position. The type must be a class name in CfgNonAIVehicles or CfgVehicles with simulation = detector. An array containing all units that have activated the trigger is available via list triggerobj. Created triggers can be deleted using deleteVehicle. + NOTE1: Since Arma 3 v1.43.129935 triggers can be created locally on clients setting optional param makeGlobal to false + NOTE2: Since Arma 3 v1.53.132440 triggers can be disabled/enabled using enableSimulation command + Triggers are created with default params, which are: + a: 50.0 + b: 50.0 + c: -1 + angle: 0 + rectangular: false + activationBy: None + activationType: Present + repeating: false + timeoutMin: 0 + timeoutMid: 0 + timeoutMax: 0 + interruptable: true + type: None + text: "" + name: "" + expCond: "this" + expActiv: "" + expDesactiv: "" - https://community.bistudio.com/wiki/ctFindRowHeader + https://community.bistudio.com/wiki/createTrigger - Number ctFindRowHeader Number + createTrigger Array - Control ctFindRowHeader Number + createTrigger [type, position, makeGlobal] - $Code$_index = _control ctFindRowHeader 0;$/Code$ + $Code$_trg = createTrigger ["EmptyDetector", getPos player ]; + _trg setTriggerArea [5, 5, 0, false ]; + _trg setTriggerActivation ["CIV", "PRESENT", true ]; + _trg setTriggerStatements ["this", "hint 'Civilian near player'", "hint 'no civilian near'"];$/Code$ - local / local + undefined / undefined + (March 6, 2013) + Calling list immediately after creating a trigger this way (and setting up activation, area, statements, timeout, etc..), will return null instead of an array. It seems the trigger needs about 1 second to initialise, after which it will behave as expected: returning an array of all the objects inside the trigger (the ones matching the criteria), or an empty array. - Number + Object + - ctHeaderControls + is3DEN - Returns array of controls on the header with the given index. + Returns true if the Eden Editor is currently being used. true when inside editor environment, false during preview. (see also is3DENMultiplayer ) - https://community.bistudio.com/wiki/ctHeaderControls + https://community.bistudio.com/wiki/is3DEN - Control ctHeaderControls Number + is3DEN - Control ctHeaderControls Number + is3DEN - $Code$_array = _control ctHeaderControls 0;$/Code$ + $Code$if is3DEN then { systemChat "Welcome to Eden Editor!"};$/Code$ - local / local + undefined / undefined - Array + Boolean + - ctHeaderCount + lbSetSelected - Returns number of headers (rows not included) in the RscControlsTable. + Set the selection state of the given row of the given listbox of style LB_MULTI. For single selection listbox use lbSetCurSel instead. - https://community.bistudio.com/wiki/ctHeaderCount + https://community.bistudio.com/wiki/lbSetSelected - ctHeaderCount Control + Control lbSetSelected Array - ctHeaderCount Control + control lbSetSelected [index, selected] - $Code$ctHeaderCount _control;$/Code$ + $Code$_control lbSetSelected [0, true ];$/Code$ - local / local + undefined / undefined + (April 10, 2016) + This command works fine with listboxs of style LB_MULTI and should not be marked as obsolete as lbSetCurSel does not provide the same functionality. - Number + Nothing + - ctRemoveHeaders + tvSetPictureColor - Takes array of header indices as a parameter and removes headers with those indices. Indices of remaining headers will be recomputed. + Sets the colour of the picture (set via tvSetPicture ) under the specified tree view path. - https://community.bistudio.com/wiki/ctRemoveHeaders + https://community.bistudio.com/wiki/tvSetPictureColor - Control ctRemoveHeaders Array + tvSetPictureColor Array + + Control tvSetPictureColor Array - Control ctRemoveHeaders Array + tvSetPictureColor [idc, path, color] + + ctrl tvSetPictureColor [path, color] - $Code$_control ctRemoveHeaders [0, 1, 2];$/Code$ + $Code$tvSetPictureColor [101, [0,2], [1,0,1,1]];$/Code$ + + $Code$_tree tvSetPictureColor [[0,2], [1,0,1,1]];$/Code$ local / local @@ -13143,279 +13827,312 @@ - Nothing + Nothing - Nothing + - ctRemoveRows + getAmmoCargo - Takes array of row indices as a parameter and removes rows with those indices. Indices of remaining rows will be recomputed. + Returns the amount of ammo resources in the cargo space of a rearm vehicle. - https://community.bistudio.com/wiki/ctRemoveRows + https://community.bistudio.com/wiki/getAmmoCargo - Control ctRemoveRows Array + getAmmoCargo Object - Control ctRemoveRows Array + getAmmoCargo vehicle - $Code$_control ctRemoveRows [0, 1, 2];$/Code$ + $Code$value = getAmmoCargo myVehicleName;$/Code$ - local / local + global / undefined + (December 22, 2014) + If the vehicle is not alive, it always returns Nothing, which you should check for using isNil. + If the vehicle is unable to carry that type of cargo, it returns -1.#IND, which you should check for using finite. - Nothing + Number + - ctRowControls + diag_fpsMin - Returns array of controls on the row with the given index. + Returns minimal framerate. Calculated from the longest frame over last 16 frames. - https://community.bistudio.com/wiki/ctRowControls + https://community.bistudio.com/wiki/diag_fpsMin - Control ctRowControls Number + diag_fpsMin - Control ctRowControls Number + diag_fpsMin - $Code$_array = _control ctRowControls 0;$/Code$ + $Code$_minfps = diag_fpsMin ;$/Code$ - local / local + undefined / undefined - Array + Number + - ctRowCount + difficultyEnabledRTD - Returns number of rows (headers not included) in the RscControlsTable. + Returns true if rotorlib simulation is enabled. Forcing by mission is included - https://community.bistudio.com/wiki/ctRowCount + https://community.bistudio.com/wiki/difficultyEnabledRTD - ctRowCount Control + difficultyEnabledRTD - ctRowCount Control + difficultyEnabledRTD - $Code$ctRowCount _control;$/Code$ + $Code$_rtdOn = difficultyEnabledRTD$/Code$ - local / local + undefined / undefined - Number + Boolean + - ctSetCurSel + fadeSpeech - Selects the line with the given index. Will take only rows, but not headers into account. -1 deselects all. Returns Nothing. + Cause a smooth change in the master speech volume. The change duration is given by time, the target volume by volume. The default master is 1.0. - https://community.bistudio.com/wiki/ctSetCurSel + https://community.bistudio.com/wiki/fadeSpeech - Control ctSetCurSel Number + Number fadeSpeech Number - Control ctSetCurSel Number + time fadeSpeech volume - $Code$_control ctSetCurSel 0;$/Code$ + $Code$5 fadeSpeech 0.1;$/Code$ - local / local + undefined / local - Nothing + Nothing + - ctSetData + canAddItemToVest - Associates metadata (string) with the row determined by the index. Returns Nothing. + Checks if given object can be stored into soldier's vest. - https://community.bistudio.com/wiki/ctSetData + https://community.bistudio.com/wiki/canAddItemToVest - Control ctSetData Array + Object canAddItemToVest String + + Object canAddItemToVest Array - Control ctSetData [[[Number]], String ] + unit canAddItemToVest item + + unit canAddItemToVest [item, count] - $Code$_control ctSetData [0, "Test"];$/Code$ + $Code$_item = "HandGrenade"; + _fits = player canAddItemToVest _item; + if (_fits) then { + player addItemToVest _item; + } else { + hint "no room!"; + };$/Code$ - local / local + undefined / undefined - Nothing + Boolean - Boolean + - ctSetHeaderTemplate + setTriggerActivation - Takes config path to the new header template. Clears the whole RscControlsTable and sets the new header template. + Defines the trigger activation type. + See ArmA:Mission Editor - Triggers for a thorough overview of triggers and its fields for activation, effects, etc. Since Arma 3 v1.67, "ANYPLAYER" activation can be used to detect any player. - https://community.bistudio.com/wiki/ctSetHeaderTemplate + https://community.bistudio.com/wiki/setTriggerActivation - Control ctSetHeaderTemplate Config + Object setTriggerActivation Array - Control ctSetHeaderTemplate Config + trigger setTriggerActivation [by, type, repeating] - $Code$_control ctSetHeaderTemplate _configPath;$/Code$ + $Code$_trigger setTriggerActivation ["WEST", "EAST D", true ]$/Code$ - local / local + global / local - Nothing + Nothing + - ctSetRowTemplate + getEditorMode - Takes config path to the new row template. Clears the whole RscControlsTable and sets the new row template (Deleting all rows and headers is easier to implement than replacing the rows and filling them with new data. IDCs could overflow etc.). + Returns the current mode of the editor. + i + Some Old Editor Command - https://community.bistudio.com/wiki/ctSetRowTemplate + https://community.bistudio.com/wiki/getEditorMode - Control ctSetRowTemplate Config + getEditorMode Control - Control ctSetRowTemplate Config + getEditorMode map - $Code$_control ctSetRowTemplate _configPath;$/Code$ - + - local / local + undefined / undefined - Nothing + String + - ctSetValue + deleteIdentity - Associates metadata (number) with the row determined by the index. Returns Nothing. + Delete an identity (created with saveIdentity ) from the campaign's progress file. - https://community.bistudio.com/wiki/ctSetValue + https://community.bistudio.com/wiki/deleteIdentity - Control ctSetValue Number + deleteIdentity String - Control ctSetValue Number + deleteIdentity identityName - $Code$_control ctSetValue 0;$/Code$ + $Code$?deleteIdentity "playerIdentity":hint "Delete ok"$/Code$ - local / local + undefined / local - Nothing + Boolean + - ctValue + inflame - Returns metadata (number) associated with a particular row of RscControlsTable. + Control fireplace burning. Set inflame to true (on) or false (off). - https://community.bistudio.com/wiki/ctValue + https://community.bistudio.com/wiki/inflame - ctValue Control + Object inflame Boolean - ctValue Control + fireplace inflame burn - $Code$_number = ctValue _control;$/Code$ + $Code$_fireplaceOne inflame true ;$/Code$ - local / local + global / global - Number + Nothing + - ctrlActivate + endl - Launch actions attached to given (button based) control. + Creates a string containing a line break, similar to lineBreak for text. The name is inspired by c++ std::endl (line end). The command returns "\r\n", which contains control characters rather than printable characters: + hint str count "\r\n"; // 4 + hint str count endl ; // 2 + The line break works for diag_log and ctrlSetText. It doesn't work with the hint because hint interprets printable "\n" as line break instead. Alternatively one can use toString command to get other characters. - https://community.bistudio.com/wiki/ctrlActivate + https://community.bistudio.com/wiki/endl - ctrlActivate Control + endl - ctrlActivate controlName + endl - $Code$ctrlActivate _control$/Code$ + $Code$diag_log ("line1" + endl + "line2");$/Code$ + + $Code$_ctrl = findDisplay 46 ctrlCreate ["RscTextMulti", -1]; + _ctrl ctrlSetPosition [0,0,1,1]; + _ctrl ctrlCommit 0; + _ctrl ctrlSetText format ["line1%1line2%1line3", endl ];$/Code$ undefined / undefined @@ -13423,89 +14140,103 @@ - Nothing + String + - ctrlAddEventHandler + getObjectTextures - Add an event handler ( User Interface Event Handlers ) to the given control. Returns id of the handler or -1 when failed. - NOTE: Control EHs are processed in reversed order, i.e. last added: first, first added: last. So if you have an override it should be set up in the 1st added EH. + Gets all custom textures (hiddenSelectionsTextures) associated with the object. - https://community.bistudio.com/wiki/ctrlAddEventHandler + https://community.bistudio.com/wiki/getObjectTextures - Control ctrlAddEventHandler Array + getObjectTextures Object - control ctrlAddEventHandler [handler,function] + getObjectTextures obj - $Code$_map ctrlAddEventHandler ["draw","_this call BIS_fnc_strategicMapOpen_draw"];$/Code$ - - $Code$_map ctrlAddEventHandler ["draw",{ hintSilent str _this}];$/Code$ + $Code$_textures = getObjectTextures player ;$/Code$ - undefined / undefined + global / undefined - (October 30, 2013) - As of Arma 3 v1.05.111658 ctrlAddEventHandler and displayAddEventHandler support script Code in addition to String [1] - Number + Array + - ctrlAngle + addWeaponGlobal - Gets rotation info of an ST_PICTURE control. + Add a weapon to a unit. Infantry units can only carry weapons in their respective slots (primary, secondary and handgun), the addWeaponGlobal command will replace the weapon currently in a slot with the added weapon if it shares the same slot. + To make sure the added weapon is loaded and ready, add the magazine first. + This command is broken when used on dedicated server - https://community.bistudio.com/wiki/ctrlAngle + https://community.bistudio.com/wiki/addWeaponGlobal - ctrlAngle Control + Object addWeaponGlobal String - ctrlAngle control + unit addWeaponGlobal weapon - $Code$ctrlAngle _control;$/Code$ + $Code${ + _x addMagazineGlobal "Laserbatteries"; + _x addWeaponGlobal "Laserdesignator"; + } forEach allUnits ;$/Code$ + + $Code${ + if ( typeOf _x == "O_Heli_Attack_02_black_F") then { + _x addMagazineGlobal "38Rnd_80mm_rockets"; + _x addWeaponGlobal "rockets_Skyfire"; + }; + } forEach vehicles ;$/Code$ - undefined / undefined + global / global + (July 7, 2015) + If you do not remove weapon first, using this command from dedicated server will duplicate weapon. - Array + Nothing + - ctrlAutoScrollDelay + sideLogic - Returns number of seconds auto-scroll will wait before scroll and/or rewind. -2 if scrollbar not present. - Autorscroll is available for CT_LISTBOX and CT_CONTROLS_GROUP types of controls only. Autoscroll will wait ctrlAutoScrollDelay seconds (must be 0) and then will scroll the scroll bar down to the bottom. ctrlAutoScrollSpeed defines the speed with which scrollbar is scrolled. If ctrlAutoScrollRewind is true, the control will fade out, immediately rewind to the top, then fade in, wait ctrlAutoScrollDelay seconds and then repeat the scrolling in a loop. If user focuses on the control, autoscrolling is interrupted. + The Logic side. + Side of Game Logics and Modules. - https://community.bistudio.com/wiki/ctrlAutoScrollDelay + https://community.bistudio.com/wiki/sideLogic - ctrlAutoScrollDelay Control + sideLogic - ctrlAutoScrollDelay control + sideLogic - $Code$_ctrlDelay = ctrlAutoScrollDelay _ctrlGroup;$/Code$ + $Code$if ( side _obj == sideLogic ) then { + hint "It's a logic!"; + };$/Code$ undefined / undefined @@ -13513,159 +14244,163 @@ - Number + Side + - ctrlAutoScrollRewind + setCaptive - Returns true if auto-scroll should move back to start after it reaches the end. - Autorscroll is available for CT_LISTBOX and CT_CONTROLS_GROUP types of controls only. Autoscroll will wait ctrlAutoScrollDelay seconds (must be 0) and then will scroll the scroll bar down to the bottom. ctrlAutoScrollSpeed defines the speed with which scrollbar is scrolled. If ctrlAutoScrollRewind is true, the control will fade out, immediately rewind to the top, then fade in, wait ctrlAutoScrollDelay seconds and then repeat the scrolling in a loop. If user focuses on the control, autoscrolling is interrupted. + Mark a unit as captive. If unit is a vehicle, commander is marked. A captive is neutral to everyone (belong to civilian side ), and will not trigger "detected by" conditions for its original side. + Using a number (instead of a boolean) for the status has no further effect on the engine's behavior, but can be used by captiveNum to keep track of the captivity status at a finer resolution (e.g. handcuffed, grouped, etc.). The numbered status syntax was introduced in Arma 2. - https://community.bistudio.com/wiki/ctrlAutoScrollRewind + https://community.bistudio.com/wiki/setCaptive - ctrlAutoScrollRewind Control - + Object setCaptive Boolean + + Object setCaptive Number + - ctrlAutoScrollRewind control + unitName setCaptive status + + unitName setCaptive status - $Code$_ctrlRewind = ctrlAutoScrollRewind _ctrlGroup;$/Code$ + $Code$_soldier1 setCaptive true ;$/Code$ + + $Code$_soldier1 setCaptive 1;$/Code$ - undefined / undefined + local / global + (August 4, 2006) + This function does not remove unit's weapons. + If you make a unit captive, that unit will still fire on the enemy, but the enemy will not fire back. + + (January 1, 2011) + If you change a unit from captive to no longer captive (for example, to "reveal" an undercover unit), enemy units that already have prior knowledge of the unit as a captive will only partially engage, making it very easy for the undercover unit. This seems to be a bug. + However other enemy unit the unit later encounters will engage freely with full force. + + (November 19, 2017) + Talkingtoaj note doesn't apply to Arma 3 anymore (earlier than 1.76) + A captive unit will immediately be shot (after a normal "human" reaction time from the AI) - Boolean + Nothing - Nothing + - ctrlAutoScrollSpeed + camSetFovRange - Returns number of seconds to auto-scroll one line. -1 if auto-scroll is disabled. -2 if scrollbar not present. - Autorscroll is available for CT_LISTBOX and CT_CONTROLS_GROUP types of controls only. Autoscroll will wait ctrlAutoScrollDelay seconds (must be 0) and then will scroll the scroll bar down to the bottom. ctrlAutoScrollSpeed defines the speed with which scrollbar is scrolled. If ctrlAutoScrollRewind is true, the control will fade out, immediately rewind to the top, then fade in, wait ctrlAutoScrollDelay seconds and then repeat the scrolling in a loop. If user focuses on the control, autoscrolling is interrupted. + Set the zoom level ( F ield O f V iew) start and end values for automatical zooming. + The default zoom level is 0.7 where 0 is the nearest and 1 is the most far zoom value. + This command is non-functional ! - https://community.bistudio.com/wiki/ctrlAutoScrollSpeed + https://community.bistudio.com/wiki/camSetFovRange - ctrlAutoScrollSpeed Control + Object camSetFovRange Array - ctrlAutoScrollSpeed control + camera camSetFovRange fovRange - $Code$_ctrlSpeed = ctrlAutoScrollSpeed _ctrlGroup;$/Code$ + $Code$_cam camSetFovRange [0.1, 0.7];$/Code$ - undefined / undefined + local / local - Number + Nothing + - ctrlChecked + forEachMemberAgent - Returns the current state of given checkbox in checkboxes control (CT_CHECKBOXES, type = 7; ). Since Arma 3 v1.71.141591 it is possible to query multiple checkboxes by providing checkbox index. For more information see DialogControls-CheckBoxes. - Note: The "onCheckBoxesSelChanged" control EH returns the control, index of changed checkbox and its current checked state. The checked state however is not a Boolean but Number 0 or 1. To convert ctrlChecked command output into number as well, use parseNumber command. + Executes the given command recursively for each agent that is a member of the given team. For just teams use forEachMemberTeam. For both teams and agents use forEachMember. - https://community.bistudio.com/wiki/ctrlChecked + https://community.bistudio.com/wiki/forEachMemberAgent - ctrlChecked Control - - Control ctrlChecked Number + Code forEachMemberAgent Team_Member - ctrlChecked control - - control ctrlChecked index + command forEachMemberAgent team - $Code$ctrlChecked _control;$/Code$ - - $Code$_control ctrlChecked 3;$/Code$ - + undefined / undefined - Boolean - Boolean + Nothing + - ctrlClassName + isLaserOn - Returns the class name of a Control as it is defined in config. If you need config class of a game created Display, it is stored on display itself: - $Code$_className = findDisplay 12 getVariable ["BIS_fnc_initDisplay_configClass", ""]; // "RscDiary"$/Code$ + Returns true if the vehicle has its laser turned on. Not to be confused with isIRLaserOn which is for units - https://community.bistudio.com/wiki/ctrlClassName + https://community.bistudio.com/wiki/isLaserOn - ctrlClassName Control + isLaserOn Object - ctrlClassName control + isLaserOn vehicle - $Code$// List class names of all controls present on display 46: - _ctrls = ""; - for "_i" from -1 to 10000 do { - with uiNamespace do { - _ctrl = findDisplay 46 displayCtrl _i; - if (! isNull _ctrl) then { - _ctrls = _ctrls + format ["IDC: %1, Class Name: %2\n", _i, ctrlClassName _ctrl]; - }; - }; - }; - hint _ctrls;$/Code$ - + - undefined / undefined + local / global - String + Boolean + - ctrlCommitted + set3DENLayer - Check if the control animation is finished. + Set layer for Eden Entity. - https://community.bistudio.com/wiki/ctrlCommitted + https://community.bistudio.com/wiki/set3DENLayer - ctrlCommitted Control + EdenEntity set3DENLayer Number - ctrlCommitted controlName + entity set3DENLayer layerID - $Code$_done = ctrlCommitted _control$/Code$ + $Code$_myLayer = -1 add3DENLayer "CTRG"; + player set3DENLayer _myLayer;$/Code$ undefined / undefined @@ -13673,248 +14408,200 @@ - Boolean + Boolean + - ctrlCommit + getMissionConfigValue - Commit control animation. + Returns value of the given scenario attribute from the 1st tier. Since only config properties have values, the attribute should be config property. If it is not found or config class is given, the return is nil. If the attribute defined in multiple places, the command checks them in the following order: + External Description.ext file + Eden Editor scenario attribute + So if attribute exists in both places, attribute from description.ext is used. Previously, scenario attributes were extracted from Description.ext using missionConfigFile. That still works, but it ignores attributes set directly in the editor and it should not be used anymore. - https://community.bistudio.com/wiki/ctrlCommit + https://community.bistudio.com/wiki/getMissionConfigValue - Control ctrlCommit Number + getMissionConfigValue String + + getMissionConfigValue Array - controlName ctrlCommit time + getMissionConfigValue attribute + + getMissionConfigValue [attribute, defaultValue] - $Code$_control ctrlCommit 2$/Code$ + $Code$_respawnDelay = getMissionConfigValue ["respawnDelay",0] + // Returns respawn delay value. Replaces the previous approach which would scan only the external Description.ext file, but ignore the value set in the Eden Editor:_respawnDelay = getNumber ( missionConfigFile "respawnDelay"); // Old approach$/Code$ undefined / undefined - (April 11, 2015) - Use this command if you want to for example change the position or size of a control. - Nothing + Number/String/Array - Number/String/Array + - ctrlCreate + simulationEnabled - Creates new control in given display. Some of the common controls that can be used with this command: - RscText - simple text box - RscTextMulti - simple multiline text box - RscPicture - simple picture box - RscPictureKeepAspect - picture box that doesn't stretch picture - RscEdit - input box - RscEditMulti - multiline input box - RscTree - tree view control - RscTreeSearch - searchable tree view control (see Example 4) - RscVideo - picture control with autostart for video texture (see BIS_fnc_playVideo ) - RscVideoKeepAspect - picture control for video to keep original video aspect ratio - NOTE : Since Arma 3 v1.69.141213 ctrlCreate will also search for control class in mission config, if search in the main config failed. This means one can now define classes in mission config and use them with ctrlCreate + Check if the entity has enabled simulation. - https://community.bistudio.com/wiki/ctrlCreate + https://community.bistudio.com/wiki/simulationEnabled - Display ctrlCreate Array + simulationEnabled Object - display ctrlCreate [class, idc, controlsGroup] + simulationEnabled entity - $Code$_display ctrlCreate ["RscText", 1234];$/Code$ - - $Code$_map = findDisplay 46 ctrlCreate ["RscMapControl", -1]; - _multiLineText = findDisplay 46 ctrlCreate ["RscTextMulti", -1]; - _multiLineEdit = findDisplay 46 ctrlCreate ["RscEditMulti", -1];$/Code$ - - $Code$myControl = findDisplay 0 ctrlCreate ["RscText", 1234, findDisplay 0 displayCtrl 2300];$/Code$ - - $Code$// Create Tree View control with search. Available RscTreeSearch class is hardcoded to be used with RscEdit with idc 645. Example below demonstrates how to. After tree is generated, try typing something in the top box. - [] spawn - { - disableSerialization ; - _display = findDisplay 46 createDisplay "RscDisplayEmpty"; - _edit = _display ctrlCreate ["RscEdit", 645]; - _edit ctrlSetPosition [0,0,1,0.04]; - _edit ctrlSetBackgroundColor [0,0,0,1]; - _edit ctrlCommit 0; - _tv = _display ctrlCreate ["RscTreeSearch", -1]; - _tv ctrlSetFont "EtelkaMonospacePro"; - _tv ctrlSetFontHeight 0.03; - _tv ctrlSetPosition [0,0.06,1,0.94]; - _tv ctrlSetBackgroundColor [0,0,0,1]; - _tv ctrlCommit 0; - _classes = "true" configClasses ( configFile "CfgVehicles"); - for "_i" from 0 to 5 do - { - _tv tvAdd [[], configName selectRandom _classes]; - for "_j" from 0 to 5 do - { - _tv tvAdd [[_i], configName selectRandom _classes]; - for "_k" from 0 to 5 do - { - _tv tvAdd [[_i, _j], configName selectRandom _classes]; - for "_n" from 0 to 5 do - { - _tv tvAdd [[_i, _j, _k], configName selectRandom _classes]; - }; - }; - }; - }; - };$/Code$ - + undefined / undefined - (February 6, 2016) - Although you can only dynamically create controls using BIS's configs, there are many commands to change certain aspects of each created control. See GUI Control - - (May 29, 2017) - Since Arma 3 1.70 ListBoxes created thru ctrlCreate are no more encountering problems with max of 7 selections without scrolling the control. - Control + Boolean + - ctrlDelete + vectorDiff - Deletes given control. - Returns whether the deletion was successful. + Subtracts one 3D vector from another. (vector1 - vector2) - https://community.bistudio.com/wiki/ctrlDelete + https://community.bistudio.com/wiki/vectorDiff - ctrlDelete Control + Array vectorDiff Array - ctrlDelete control + vector1 vectorDiff vector2 - $Code$ctrlDelete (( findDisplay 20000) displayCtrl 20001);$/Code$ + $Code$hint str ( velocity car vectorDiff velocity bike);$/Code$ undefined / undefined - (April 18, 2015) - ctrlDelete can only delete controls created with ctrlCreate. Use ctrlShow false and ctrlEnable false to disable existing controls. + (28 Jun, 2014) + (ArmA3 1.22)Algorithm: + $Code$ + Vector1 = [x1,y1,z1]; Vector2 = [x2,y2,z2]; + Result = [x1 – x2,y1 – y2,z1 – z2;] + $/Code$ + It is recommended to use vectorDiff instead of BIS_fnc_vectorDiff. - Boolean + Array + - ctrlEnabled + evalObjectArgument - Returns if a control on the currently active user dialog is enabled. Disabled controls cannot be focused. - Read Dialog Control for more information about user dialogs and controls. + Return argument in mission editor of a given object. + i + Some Old Editor Command - https://community.bistudio.com/wiki/ctrlEnabled + https://community.bistudio.com/wiki/evalObjectArgument - ctrlEnabled Number - - ctrlEnabled Control + Control evalObjectArgument Array - ctrlEnabled idc - - ctrlEnabled controlName + map evalObjectArgument [object, argument] - $Code$if (!(ctrlEnabled 100)) then - { - ctrlEnable [100, true] - };$/Code$ - - $Code$_enabled = ctrlEnabled _control$/Code$ + $Code$// returns string "[1009.0351, 1319.4928]" + ( findDisplay 128 displayCtrl 51) getObjectArgument ["_unit_1", "POSITION"] + // returns array [1009.0351, 1319.4928] + ( findDisplay 128 displayCtrl 51) evalObjectArgument ["_unit_1", "POSITION"]$/Code$ - local / undefined + undefined / undefined - Boolean - Boolean + Any_Value + - ctrlEnable + clearBackpackCargoGlobal - Enable or disable a control of the currently active user dialog. Disabled controls cannot be clicked onto. - Read Dialog Control for more information about user dialogs and controls. + Removes all backpacks from the vehicle cargo space. MP synchronized. - https://community.bistudio.com/wiki/ctrlEnable + https://community.bistudio.com/wiki/clearBackpackCargoGlobal - ctrlEnable Array - - Control ctrlEnable Boolean + clearBackpackCargoGlobal Object - ctrlEnable [idc, enable] - - controlName ctrlEnable enable + clearBackpackCargoGlobal unit - $Code$ctrlEnable [100, false]$/Code$ - - $Code$_ctrl ctrlEnable false$/Code$ + $Code$clearBackpackCargoGlobal jeepOne;$/Code$ - local / local + global / global - (July 20, 2017) - Please do note that enabled controls can gain focus upon click. Therefore do not enable background controls or else they will cover any controls on top of them. - As a general rule of thumb, enabled controls should only be already on the top of the GUI. + (July 6, 2017) + This will remove not only backpacks, but vests and uniforms as well. - Nothing - Nothing + Nothing + - ctrlFade + pushBackUnique - Returns the current fade factor of control. + Adds element to the back of the given array but only if it is unique to the array. The index of the added element is returned upon success, otherwise -1. This command modifies the original array. - https://community.bistudio.com/wiki/ctrlFade + https://community.bistudio.com/wiki/pushBackUnique - ctrlFade Control + Array pushBackUnique Anything - ctrlFade controlName + array pushBackUnique element - $Code$_scale = ctrlFade _control$/Code$ + $Code$_arr = [1,2,3]; + _index = _arr pushBackUnique 3; + hint str [_index, _arr]; //[-1,[1,2,3]]$/Code$ + + $Code$_arr = [1,2,3]; + _index = _arr pushBackUnique 4; + hint str [_index, _arr]; //[3,[1,2,3,4]]$/Code$ undefined / undefined @@ -13922,338 +14609,299 @@ - Number + Number + - ctrlHTMLLoaded + isCollisionLightOn - Returns true when HTML content was successfully loaded. + Returns true if vehicle collision lights are on otherwise false. - https://community.bistudio.com/wiki/ctrlHTMLLoaded + https://community.bistudio.com/wiki/isCollisionLightOn - ctrlHTMLLoaded Control + isCollisionLightOn Object - ctrlHTMLLoaded control + isCollisionLightOn vehicle - $Code$_control htmlLoad "test.html"; - if (! ctrlHTMLLoaded _control) then { - hint "Loading test.html failed!"; - };$/Code$ + $Code$_collisionLightOn = isCollisionLightOn heli;$/Code$ - undefined / undefined + global / undefined + (April 6, 2015) + Bind Collision light action to UserAction 2 + $Code$this addAction ["", { + _this select 1 action [ + ["CollisionLightOn", "CollisionLightOff"] select isCollisionLightOn (_this select 0), + _this select 0 + ]; + }, "", -10, false, true, "User2", "_this == driver _target"];$/Code$ - Boolean + Boolean + - ctrlIDC + time - Returns control IDC. + Returns time elapsed since mission started (in seconds). The value is different on each client. If you need unified time, use serverTime. - https://community.bistudio.com/wiki/ctrlIDC + https://community.bistudio.com/wiki/time - ctrlIDC Control + time - ctrlIDC control + time - + $Code$_future = time + 30; + waitUntil { time = _future}; /* continue after 30 seconds... */$/Code$ + + $Code$// Wait until mission fully started: + waitUntil { time 0};$/Code$ + undefined / undefined + (August 4, 2006) + Notes from before the conversion: + Not to be confused with _time. Within a script, the reserved local variable _time returns the time elapsed since the script started running. Note that the value of time is not saved when the mission is saved and so will be reset to zero when a mission is restarted from a saved position. The value of _time is saved correctly and will resume from where it was. + _time has only special meaning in SQS scripts, in SQF script it is just another variable. -- Killzone_Kid + + (January 5, 2007) + Notes from before the conversion: + time works properly in sqf called with execVM command. In an other hand, _time does not works in sqf called with execVM command.(Arma v1.02.5103GER) + + (October 02, 2010) + On overloaded servers (below ~10 server FPS), time readings are unreliable. Seconds actually take longer. While the clients keep a steady tempo, server time lags behind, resulting in considerable offset between client and server time (easily 30 minutes for a 2 hour game). Client time is synchronised to server time during JIP, but other than that it runs independently. + + (30 Oct 2013) + Arma 3 JIP bug: + As of Arma 3 v1.02, for JIP clients 'time' value will start off counting from 0, not the real 'time' value. After about 2.5sec (on average), it will then jump to a high value and synchronise with the real 'time' value, which could be 900, for example. + Therefore, do not use 'time' for any start of mission init timeouts; it's unreliable. (It's odd that it doesn't synchronise at the same time as public variables.) + + (September 1, 2016) + In MP : Since per-client time and server time is unconsistant I strongly recommend execution of time-critical tasks from server-side scripts and with remoteExec or remoteExecCall ( Since only A3 1.50 alternative may be publicVariableClient with pre-defined handler) as this will eliminate any time calculation lags and make it reliable. - Number + Number + - ctrlIDD + ctrlShow - Returns display IDD. + Set if a control of the currently active user dialog is shown or not. + Read Dialog Control for more information about user dialogs and controls. - https://community.bistudio.com/wiki/ctrlIDD + https://community.bistudio.com/wiki/ctrlShow - ctrlIDD Display + ctrlShow Array + + Control ctrlShow Boolean - ctrlIDD display + ctrlShow [idc, show] + + controlName ctrlShow show - $Code$ctrlIDD findDisplay 46; //46$/Code$ + $Code$ctrlShow [100, false ];$/Code$ + + $Code$_control ctrlShow false ;$/Code$ - undefined / undefined + local / local - Number + Nothing - Nothing + - ctrlMapAnimAdd + synchronizedTriggers - Adds the next frame to the map animation. + Returns the list of triggers synchronized with a given waypoint. - https://community.bistudio.com/wiki/ctrlMapAnimAdd + https://community.bistudio.com/wiki/synchronizedTriggers - Control ctrlMapAnimAdd Array + synchronizedTriggers Waypoint - map ctrlMapAnimAdd [time, zoom, position] + synchronizedTriggers waypoint - $Code$_map ctrlMapAnimAdd [1, 0.1, getMarkerPos "anim1"]; - ctrlMapAnimCommit _map;$/Code$ - - $Code$// Center map on player: - _ctrl ctrlMapAnimAdd [0, 0.05, player ]; - ctrlMapAnimCommit _ctrl;$/Code$ - + - local / local + undefined / undefined - (17:11, 9 March 2010) - Besides Position2D, both Objects and Position3D work. - Nothing + Array + - ctrlMapAnimClear + lockDriver - Clears the map animation. + Lock the driver position of the vehicle. This command must be executed where vehicle is local. - https://community.bistudio.com/wiki/ctrlMapAnimClear + https://community.bistudio.com/wiki/lockDriver - ctrlMapAnimClear Control + Object lockDriver Boolean - ctrlMapAnimClear controlName + vehicle lockDriver lock - + $Code$vehicleName lockDriver true ;$/Code$ + - local / local + local / global - Nothing + Nothing + - ctrlMapAnimCommit + nearestLocation - Plays the map animation. + Return the closest location of specified class to a given position. Checked range is unlimited (i.e. covers the whole map). - https://community.bistudio.com/wiki/ctrlMapAnimCommit + https://community.bistudio.com/wiki/nearestLocation - ctrlMapAnimCommit Control + nearestLocation Array - ctrlMapAnimCommit controlName + nearestLocation [position, locationClass] - $Code$// Center map on player: - _ctrl ctrlMapAnimAdd [0, 0.05, player ]; - ctrlMapAnimCommit _ctrl;$/Code$ + $Code$_nearestCity = nearestLocation [ getPos player, "nameCity"];$/Code$ + + $Code$_anyNearestLocation = nearestLocation [ player, ""];$/Code$ - local / local + undefined / undefined - Nothing + Location + - ctrlMapAnimDone + briefingName - Checks whether the map animation has finished. + Returns the name of the current briefing/scenario name. - https://community.bistudio.com/wiki/ctrlMapAnimDone + https://community.bistudio.com/wiki/briefingName - ctrlMapAnimDone Control + briefingName - ctrlMapAnimDone controlName + briefingName - + $Code$_name = briefingName ;$/Code$ + - local / local + undefined / undefined - Boolean + String + - ctrlMapCursor + setLeader - Changes the default cursor that appears when interacting with a map control to a custom one. Use an empty string to restore the default cursor. If the specified cursor does not exist, the default is used and no error is produced. ( NOT in case of ArmA 3. Using an empty string will result in an error: "No entry 'bin\config.bin/CfgWrapperUI/Cursors.' ). The cursor is the name of a config entry from CfgWrapperUI / Cursors. This command has the following specifics: - When used on Main Map ( findDisplay 12 displayCtrl 51) it is possible to override multiple default cursors. For example, while leaving default "Arrow" intact, it is possible to just override "Scroll" with lets say "Wait" (Example 3) - When used on a custom map, for example user made Mini Map, there is only one single cursor "" for everything, therefore only this cursor can be overridden (see Example 4 on how to override it) - Some possible class names (for the whole list see ctrlMapCursor/cursors ): - Arrow - Track - Move - Scroll - Rotate - Track3D - Move3D - Rotate3D - Raise3D - Wait - HC_move - HC_overFriendly - HC_overEnemy - HC_overMission - HC_unsel - NOTE1 : Cursor names are case sensitive. + Set the leader of given team. Effect is local, unless both leader unit and team are local to PC on which command is executed, then effect is global. - https://community.bistudio.com/wiki/ctrlMapCursor + https://community.bistudio.com/wiki/setLeader - Control ctrlMapCursor Array + Team_Member setLeader Team_Member - control ctrlMapCursor [defaultCursor, newCursor] + team setLeader leader - $Code$_map ctrlMapCursor ["Track", "Arrow"];$/Code$ - - $Code$uiNamespace setVariable ["_map", findDisplay 12 displayCtrl 51]; - ( uiNamespace getVariable "_map") ctrlMapCursor ["Track","HC_overFriendly"];$/Code$ - - $Code$findDisplay 12 displayCtrl 51 ctrlMapCursor ["Scroll", "Wait"];$/Code$ - - $Code$// Cycle through all available cursors over custom map: - 0 = [] spawn - { - disableSerialization ; - _map = findDisplay 46 createDisplay "RscCredits" ctrlCreate ["RscMapControl", -1]; - _map ctrlSetPosition [0,0,1,1]; - _map ctrlCommit 0; - { - _map ctrlMapCursor ["", configName _x]; // -- the actual usage - hint format ["Current cursor: %1", configName _x]; - sleep 1; - } - forEach ("true" configClasses ( configFile "CfgWrapperUI" "Cursors")); - };$/Code$ - + - undefined / undefined + local / local - (February 8, 2016) - When using this command, the cursor will change for the whole display, resulting in visual glitches. Adding the onMouseMoving event handler can help solve this problem: - $Code$ - _control ctrlAddEventHandler ["MouseMoving",{ - _this params [ - ["_mapCtrl", controlNull,[[[controlNull]]]], - ["_xPos",-1,[0]], - ["_yPos",-1,[0]], - ["_mouseIn", false,[[[true]]]] - ]; - if (_mouseIn) then { - // Mouse is in control area - _mapCtrl ctrlMapCursor ["","Track"]; - } else { - // Mouse is out of control area, goes back to arrow - _mapCtrl ctrlMapCursor ["","Arrow"]; - }; - }]; - $/Code$ - Nothing + Nothing + - ctrlMapMouseOver + isKeyActive - Returns description of map sign mouse cursor is over. Works with in-game map as well as 2D editor map in edit mode. + Checks whether the given key is active in the current user profile. + See keys, keysLimit and doneKeys in the description.ext file of the missions. - https://community.bistudio.com/wiki/ctrlMapMouseOver + https://community.bistudio.com/wiki/isKeyActive - ctrlMapMouseOver Control + isKeyActive String - ctrlMapMouseOver control + isKeyActive keyName - $Code$( uiNamespace getVariable "_map") ctrlMapCursor ["Track","HC_overFriendly"]; - _mouseover = if ( count ( ctrlMapMouseOver (uiNamespace getVariable "_map")) 0) then - { - ctrlMapMouseOver ( uiNamespace getVariable "_map") - } - else - { - [""] - }; - if (_mouseover select 0 == "task" && str (_logic getVariable "onTaskAssigned") != str {}) then - { - //--- Task - ( uiNamespace getVariable "_map") ctrlMapCursor ["Track","HC_overMission"]; - } - else - { - //--- Waypoint - ( uiNamespace getVariable "_map") ctrlMapCursor ["Track","HC_move"]; - };$/Code$ - - $Code$onEachFrame { hintSilent str ctrlMapMouseOver ( findDisplay 12 displayCtrl 51)};$/Code$ + $Code$_ok = isKeyActive "Mission04Key"$/Code$ undefined / undefined @@ -14261,300 +14909,346 @@ - Array + Boolean + - ctrlMapScale + tvCollapse - Returns the current scale of given map control. + Collapses tree item pointed to by the path. IDC means id of parent Tree View. - https://community.bistudio.com/wiki/ctrlMapScale + https://community.bistudio.com/wiki/tvCollapse - ctrlMapScale Control + tvCollapse Array + + Control tvCollapse Array - ctrlMapScale ctrl + tvCollapse [idc, path] + + control tvCollapse path - $Code$_control = ( findDisplay 12) displayCtrl 51; //Arma 3 - _scale = ctrlMapScale _control; //returns number from 1 to 0.001$/Code$ + $Code$tvCollapse [101, [0]];$/Code$ + + $Code$_ctrl tvCollapse [0];$/Code$ - undefined / undefined + local / local + (Sep 11 2014) + (A3 1.28)tv command family overview + $Code$ + //tv command family available for CT_TREE (type 12) + private ["_count","_current","_data","_text","_value","_pic"]; + _CT_TREE tvAdd [ [],"Parent_A"]; + _CT_TREE tvAdd [ [0],"Child_A"]; + _CT_TREE tvAdd [ [0,0],"Grandchild_A"]; + _CT_TREE tvAdd [ [],"Parent_B"]; + _CT_TREE tvAdd [ [1],"Child_B"]; + _count = _CT_TREE tvCount []; //return 2 + _CT_TREE tvSetCurSel [0,0,0]; //select grandchild_A + _current = tvCurSel _CT_TREE; //return [0,0,0] + _CT_TREE tvSetData [_current,"I'm grandchild_A"]; + _data = _CT_TREE tvData _current; // "I'm grandchild_A" + _text = _CT_TREE tvText _current; //"Grandchild_A" + _CT_TREE tvSetValue [_current,14]; + _value = _CT_TREE tvValue _current; // 14 + _CT_TREE tvSetPicture [_current, getText ( configFile "CfgWeapons" "optic_NVS" "picture")]; + _pic = _CT_TREE tvPicture _current; + _CT_TREE tvExpand [1]; + _CT_TREE tvSort [[], false ]; + _CT_TREE tvSortByValue [[], false ]; + _CT_TREE tvDelete [0,0]; //remove child_b + tvClear 12; + _CT_TREE tvCollapse []; + $/Code$ - Number + Nothing - Nothing + - ctrlMapScreenToWorld + setMarkerBrush - Convert screen coordinates in map to world coordinates. + Selects the fill texture for the marker ("RECTANGLE" or "ELLIPSE"). Brush is the name of the subclass in CfgMarkerBrushes. + brush can be: + "Solid" + "SolidFull" (A3 only) + "Horizontal" + "Vertical" + "Grid" + "FDiagonal" + "BDiagonal" + "DiagGrid" + "Cross" + "Border" + "SolidBorder" - https://community.bistudio.com/wiki/ctrlMapScreenToWorld + https://community.bistudio.com/wiki/setMarkerBrush - Control ctrlMapScreenToWorld Array + String setMarkerBrush String - map ctrlMapScreenToWorld [x, y] + markerName setMarkerBrush brush - $Code$_WorldCoord = _Control ctrlMapScreenToWorld _ScreenCoord$/Code$ - - $Code$_WorldCoord = _Control ctrlMapScreenToWorld [_x,_y]$/Code$ + $Code$"Marker1" setMarkerBrush "DIAGGRID";$/Code$ - undefined / undefined + undefined / global - (April 6, 2007) - Notes: - You can get the screen coordinates by the UI Event Handlers onMouseButtonDown, onMouseButtonUp, onMouseButtonClick, onMouseButtonDblClick. - The return Array is in 2-D, you can use it with all set-position commands. - _x = returnArray select 0; - _y = returnArray select 1; - - (December 2, 2009) - Notes: - In VBS2 1.23 this command does not seem to work properly. Therefore when defining UI Event Handlers onMouseButtonClick and onMouseButtonDblClick the functions onMapSingleClick and onDoubleClick (VBS2) can be used instead, these already provide access to the world coordinates of the click event. - - The command parameters are screen position coordinates, which may not equate to to the map control's coordinates. A map control's screen coordinates and size can be found use the ctrlPosition command. This is an issue when using the Arma 3 in-game map, which is not fullscreen (all previous titles used full screen map controls, so map control coords did equate to screen coords). - Array + Nothing + - ctrlMapWorldToScreen + AGLToASL - Transfers a map control world position to screen coordinates. + Converts position from PositionAGL to PositionASL - https://community.bistudio.com/wiki/ctrlMapWorldToScreen + https://community.bistudio.com/wiki/AGLToASL - Control ctrlMapWorldToScreen Position + AGLToASL PositionAGL - control ctrlMapWorldToScreen position + AGLToASL posAGL - $Code$_screenCoord = _control ctrlMapWorldToScreen _worldCoord;$/Code$ + $Code$_playerPosASL = AGLToASL ( player modelToWorld [0,0,0]);$/Code$ - $Code$_screenCoord = _control ctrlMapWorldToScreen position player ;$/Code$ + $Code$_camPosASL = AGLToASL positionCameraToWorld [0,0,0];$/Code$ undefined / undefined - (June 16, 2010) - Notes: - It returns a 2d array with the position on the active map display. Say the return [0.5.0.5] would mean that your input 3d world position, like [500,1000], is currently at the center of the active map display. - In other words you can make the actual world position (of an object for example), relative to your active map display. - Array + PositionASL + - ctrlModelDirAndUp + triggerActivated - Returns vectorDir and vectorUp of the model used in 3D Dialog Control. + Returns true if the trigger has been activated. + Note: The trigger could be local or remote but the result returned by this command will be for the trigger condition set up locally on the client that executed the command. See createTrigger for more info. - https://community.bistudio.com/wiki/ctrlModelDirAndUp + https://community.bistudio.com/wiki/triggerActivated - ctrlModelDirAndUp Control + triggerActivated Object - ctrlModelDirAndUp control + triggerActivated trigger - $Code$_vectorDirAndUp = ctrlModelDirAndUp _control3D;$/Code$ + $Code$if ( triggerActivated trg1) then { + // Code + };$/Code$ - undefined / undefined + global / local + If trigger already activated at least once, triggerActivated will only return false if trigger is set to activate Repeatedly. + In other words, a trigger set to activate Once will always return true once activated at least once (even if trigger is no longer activated). - Array + Boolean + - ctrlModelScale + getHideFrom - Returns 3D control model scale + Returns the Position where object believes the enemy to be. If there is no direct line of sight between the object and the enemy, this position is extrapolated based on the last known position and speed of the enemy. A returned position of [0,0,0] implies that object does not knowAbout enemy. If enemy is null it is some position in front of the object or enemy position. - https://community.bistudio.com/wiki/ctrlModelScale + https://community.bistudio.com/wiki/getHideFrom - ctrlModelScale Control + Object getHideFrom Object - ctrlModelScale control + object getHideFrom enemy - $Code$_currentScale = ctrlModelScale _ctrl3D;$/Code$ - + undefined / undefined + (April 25, 2015) + This command is definatlely not broken, at least not in A3 1.42. It functions exactly as the description says it does. The reason why the Z value is elevated is because it represents the units torso. When the unit is prone and spotted, the Z value is much less. Here you can see a perfectly working example of this command Talk:getHideFrom#Operation Script Sample - Number + Array + - ctrlModel + setParticleClass - Returns model used in 3D Dialog Control. + Set parameters from existing config class. ClassName is name of the class from CfgCloudlets. + Since version 1.11.114706 you can use setParticleParams to overwrite many values set by config class, particularity those defined in ParticleArray. - https://community.bistudio.com/wiki/ctrlModel + https://community.bistudio.com/wiki/setParticleClass - ctrlModel Control + Object setParticleClass String - ctrlModel control + source setParticleClass className - $Code$_model = ctrlModel _control3D;$/Code$ + $Code$_source01 = "#particlesource" createVehicleLocal _pos01; + _source01 setParticleClass "ObjectDestructionFire1Smallx"; + _source01 attachTo [_object,[0,0,0]];$/Code$ undefined / undefined + (June 28, 2015) + This can be very useful for getting features that can't normally be added with commands, such as AI view blocking and particles that can only be above/underwater. - String + Nothing + - ctrlParentControlsGroup + waypointAttachVehicle - Returns the parent control of a given child control + Attaches a Unit to the given Waypoint. - https://community.bistudio.com/wiki/ctrlParentControlsGroup + https://community.bistudio.com/wiki/waypointAttachVehicle - ctrlParentControlsGroup Control + Array waypointAttachVehicle Object - ctrlParentControlsGroup ctrl + waypoint waypointAttachVehicle vehicleName - $Code$_ctrlCombo = _ctrl controlsGroupCtrl 100;//Control - ctrlParentControlsGroup _ctrlCombo;//Parent control group (_ctrl)$/Code$ + $Code$[_grp, 2] waypointAttachVehicle vehicle player$/Code$ + + $Code$[_grp, 2] waypointAttachVehicle _soldier1$/Code$ undefined / undefined + (June 19, 2010) + You can attach waypoint only to vehicle inserted from classic editor. Trying to attach it to dynamically spawned ( createUnit, createVehicle ) won't work. Engine will then try to find suitable target by itself, affecting game performance. - Control + Nothing + - ctrlParent + synchronizedWaypoints - Returns container of the given control. + Returns the list of waypoints synchronized with a given trigger or waypoint. - https://community.bistudio.com/wiki/ctrlParent + https://community.bistudio.com/wiki/synchronizedWaypoints - ctrlParent Control + synchronizedWaypoints Object/Waypoint - ctrlParent controlName + synchronizedWaypoints obj - $Code$_display = ctrlParent _control$/Code$ - + undefined / undefined - Display + Array + - ctrlPosition + curatorCamera - Returns the current position of 2D control as [x, y, w, h] array. For 3D control it returns relative [x,y,z]. + Returns curator camera object. - https://community.bistudio.com/wiki/ctrlPosition + https://community.bistudio.com/wiki/curatorCamera - ctrlPosition Control + curatorCamera - ctrlPosition controlName + curatorCamera - $Code$_pos = ctrlPosition _control;$/Code$ - + undefined / undefined - (May 22, 2017) - If the ctrl is part of a CtrlGroup the returned position is relative to the ctrlGroups position. - Array + Object + - ctrlRemoveAllEventHandlers + setRainbow - Remove all event handlers from the given control. + Changes the rainbow value smoothly during the given time (in seconds). A time of zero means there will be an immediate change. - https://community.bistudio.com/wiki/ctrlRemoveAllEventHandlers + https://community.bistudio.com/wiki/setRainbow - Control ctrlRemoveAllEventHandlers String + Number setRainbow Number - control ctrlRemoveAllEventHandlers handlerName + time setRainbow value @@ -14562,218 +15256,266 @@ undefined / undefined + (April 24, 2015) + It should be known that this command does not create a rainbow in all conditions. As in real life, the rainbow can only appear after rainfall and opposite of the sun when it is low on the horizon. - Nothing + Nothing + - ctrlRemoveEventHandler + squadParams - Remove a given event handler from the given control. + Returns data about squad of given unit loaded from squad.xml. + All items in returned array are String. - https://community.bistudio.com/wiki/ctrlRemoveEventHandler + https://community.bistudio.com/wiki/squadParams - Control ctrlRemoveEventHandler Array + squadParams Object - control ctrlRemoveEventHandler [handler name,id] + squadParams unit - $Code$_map ctrlRemoveEventHandler ["Draw", _id];$/Code$ + $Code$_info = squadParams player ;$/Code$ - undefined / undefined + global / undefined + (July 19, 2015) + Returns an empty array in singleplayer. - Nothing + Array + - ctrlScale + engineOn - Returns the current scale of the control. + Activates and deactivates the engine of a vehicle. This command has to be executed where vehicle is local. + NOTE: Executed on a remote vehicle this command may turn the engine on but then it will get turned off by itself after a short while. - https://community.bistudio.com/wiki/ctrlScale + https://community.bistudio.com/wiki/engineOn - ctrlScale Control + Object engineOn Boolean - ctrlScale controlName + vehicle engineOn state - $Code$_scale = ctrlScale _control$/Code$ + $Code$if (! isEngineOn _jeep) then { _jeep engineOn true ; };$/Code$ + + $Code$waitUntil { player == driver _jeep; }; + vehicle player engineOn true ;$/Code$ - undefined / undefined + local / global + (August 25, 2014) + To switch engine off can also use setFuel and fuel : + $Code$ private "_gas"; + _gas = fuel heli; + heli setFuel 0; + sleep 0.01; + heli setFuel _gas;$/Code$ + Also sets helicopter fuel back to original quantity. Works on every other vehicle. - Number + Nothing + - ctrlSetActiveColor + lbSetPictureColorSelected - Sets text color of given control when control is selected. + Sets the selected color of item's picture (left) with the given index of the listbox with id idc of the topmost user dialog to the given color. Color is in format Color. Color which consists from only zeros means disable this override. - https://community.bistudio.com/wiki/ctrlSetActiveColor + https://community.bistudio.com/wiki/lbSetPictureColorSelected - Control ctrlSetActiveColor Array + lbSetPictureColorSelected Array + + Control lbSetPictureColorSelected Array - display ctrlSetActiveColor color + lbSetPictureColorSelected [idc, index, color] + + control lbSetPictureColorSelected [index, color] - $Code$_control ctrlSetActiveColor [1, 0, 0, 1]$/Code$ + $Code$lbSetPictureColorSelected [101, 0, [0, 1, 0, 0.5]];$/Code$ + + $Code$_ctrl lbSetPictureColorSelected [0, [1, 1, 1, 1]];$/Code$ undefined / undefined + More information on the LB command family can be found here - Nothing + Nothing - Nothing + - ctrlSetAngle + actionKeysNamesArray - Sets the rotation of an ST_PICTURE control. Rotation will be done within the control boundaries, so if the X and Y are given off center, the picture may get clipped by the control boundaries. Doesn't require ctrlCommit. Procedural textures filled controls do not rotate. + Returns a list of button names assigned to the given user action. You can find the action names in config class ControllerSchemes or user action names. - https://community.bistudio.com/wiki/ctrlSetAngle + https://community.bistudio.com/wiki/actionKeysNamesArray - Control ctrlSetAngle Array + actionKeysNamesArray String + + actionKeysNamesArray Array - control ctrlSetAngle [angle, centerX, centerY] + actionKeysNamesArray userAction + + actionKeysNamesArray [userAction, maxKeys] + + actionKeysNamesArray [userAction, maxKeys, inputDevicePriority] - $Code$_control ctrlSetAngle [25, 0.5, 0.5];$/Code$ + $Code$list = actionKeysNamesArray "ReloadMagazine";$/Code$ - $Code$with uiNamespace do - { - ctrl = findDisplay 46 ctrlCreate ["RscPictureKeepAspect", -1]; - ctrl ctrlSetPosition [0,0,1,1]; - ctrl ctrlSetText "A3\Missions_F_Exp\data\Img\lobby\ui_campaign_lobby_background_tablet_radial_left_ca.paa"; - ctrl ctrlCommit 0; - angle = 0; - onEachFrame - { - with uiNamespace do - { - if (angle 359) then {angle = 0}; - ctrl ctrlSetAngle [angle, 0.5, 0.5]; - angle = angle + 1; - }; - }; - };$/Code$ + $Code$list = actionKeysNamesArray ["ReloadMagazine", 1];$/Code$ undefined / undefined + (October 26, 2014) + inputDevicePriority 'Controler' is not a spelling mistake in description. - Nothing + Array - Array + - ctrlSetAutoScrollDelay + allowCrewInImmobile - Sets number of second before auto-scroll starts/rewinds. Setter for ctrlAutoScrollDelay. - Autorscroll is available for CT_LISTBOX and CT_CONTROLS_GROUP types of controls only. Autoscroll will wait ctrlAutoScrollDelay seconds (must be 0) and then will scroll the scroll bar down to the bottom. ctrlAutoScrollSpeed defines the speed with which scrollbar is scrolled. If ctrlAutoScrollRewind is true, the control will fade out, immediately rewind to the top, then fade in, wait ctrlAutoScrollDelay seconds and then repeat the scrolling in a loop. If user focuses on the control, autoscrolling is interrupted. + If true, units can be in a vehicle with broken tracks/wheels. - https://community.bistudio.com/wiki/ctrlSetAutoScrollDelay + https://community.bistudio.com/wiki/allowCrewInImmobile - Control ctrlSetAutoScrollDelay Number + Object allowCrewInImmobile Boolean - control ctrlSetAutoScrollDelay delay + vehicle allowCrewInImmobile bool - $Code$_ctrlGroup ctrlSetAutoScrollDelay 5;$/Code$ + $Code$_vehicle allowCrewInImmobile true ;$/Code$ undefined / undefined + (April 27, 2015) + This will stop AI disembarking when immobile + $Code$KK_fnc_allowCrewInImmobile = { + _this allowCrewInImmobile true; + { + _x disableAI "FSM"; + _x setBehaviour "CARELESS"; + } forEach crew _this; + }; + //example + car call KK_fnc_allowCrewInImmobile;$/Code$ - Nothing + Nothing + - ctrlSetAutoScrollRewind + fullCrew - Defines if scroll should rewind when auto-scroll reach end. Setter for ctrlAutoScrollRewind. - Autorscroll is available for CT_LISTBOX and CT_CONTROLS_GROUP types of controls only. Autoscroll will wait ctrlAutoScrollDelay seconds (must be 0) and then will scroll the scroll bar down to the bottom. ctrlAutoScrollSpeed defines the speed with which scrollbar is scrolled. If ctrlAutoScrollRewind is true, the control will fade out, immediately rewind to the top, then fade in, wait ctrlAutoScrollDelay seconds and then repeat the scrolling in a loop. If user focuses on the control, autoscrolling is interrupted. + Returns array with all crew inside given vehicle. Since Arma 3 v1.55.133810 it is possible to return empty seats as well. + NOTE that with introduction of person turrets, the cargo indexes listed in the return are true for moveInCargo command but incompatible with actions such as "GetInCargo" and "MoveToCargo". To find out seats compatible with cargo action commands, execute command with "cargo" filter: + $Code$ fullCrew [heli, "cargo", true ];$/Code$ + The return array is ordered according to cargo index compatible with action cargo commands, i.e. 1st element has index 0, second - index 1, etc. For example armed WY-55 Hellcat reports: + [[ NULL-object,"cargo",2,[],false],[ NULL-object,"cargo",3,[],false],[ NULL-object,"cargo",4,[],false],[ NULL-object,"cargo",5,[],false]] + for cargo positions. The following commands will put player in the same seat: + $Code$ player moveInCargo [heli, 2]; + player action ["GetInCargo", heli, 0];$/Code$ - https://community.bistudio.com/wiki/ctrlSetAutoScrollRewind + https://community.bistudio.com/wiki/fullCrew - Control ctrlSetAutoScrollRewind Boolean + fullCrew Object + + fullCrew Array - control ctrlSetAutoScrollRewind set + fullCrew vehicle + + fullCrew [vehicle, type, includeEmpty] - $Code$_ctrlGroup ctrlSetAutoScrollRewind true ;$/Code$ + $Code$_list = fullCrew vehicle player ;$/Code$ + + $Code$_list = fullCrew [ vehicle player, "turret"];$/Code$ - undefined / undefined + global / undefined + (December 13, 2014) + Be aware that the returned role may or may not be in lowercase. E.g. it's "driver" for the driver, but "Turret" for turret units. + As of Arma 3 version 1.36, the alternative syntax of this command returns all crew members if the filter is anything except "driver", "commander", "gunner", "turret" or "cargo" + The filter is not case sensitive. - Nothing + Array - Array + - ctrlSetAutoScrollSpeed + priority - Sets number of second required to scroll to next line. If speed 0, auto-scroll is disabled. Setter for ctrlAutoScrollSpeed. - Autorscroll is available for CT_LISTBOX and CT_CONTROLS_GROUP types of controls only. Autoscroll will wait ctrlAutoScrollDelay seconds (must be 0) and then will scroll the scroll bar down to the bottom. ctrlAutoScrollSpeed defines the speed with which scrollbar is scrolled. If ctrlAutoScrollRewind is true, the control will fade out, immediately rewind to the top, then fade in, wait ctrlAutoScrollDelay seconds and then repeat the scrolling in a loop. If user focuses on the control, autoscrolling is interrupted. + Return the priority of the task. - https://community.bistudio.com/wiki/ctrlSetAutoScrollSpeed + https://community.bistudio.com/wiki/priority - Control ctrlSetAutoScrollSpeed Number + priority Task - control ctrlSetAutoScrollSpeed speed + priority task - $Code$_ctrlGroup ctrlSetAutoScrollSpeed 0.1;$/Code$ + $Code$_prioTsk01 = priority task01$/Code$ undefined / undefined @@ -14781,65 +15523,62 @@ - Nothing + Number + - ctrlSetBackgroundColor + camPrepareFovRange - Sets background color of given control. + Prepares the camera field of view range for auto zooming. + This command is non-functional ! - https://community.bistudio.com/wiki/ctrlSetBackgroundColor + https://community.bistudio.com/wiki/camPrepareFovRange - Control ctrlSetBackgroundColor Array + Object camPrepareFovRange Array - control ctrlSetBackgroundColor color + camera camPrepareFovRange fovRange - $Code$_control ctrlSetBackgroundColor [1, 0, 0, 1]$/Code$ + $Code$_camera camPrepareFovRange [0.1, 0.5]$/Code$ undefined / undefined - (May 10, 2017) - According to https://feedback.bistudio.com/T78904 - This definetly doesn't work with RscButton's. \br - According to ( https://resources.bisimulations.com/wiki/ctrlSetBackgroundColor ) this "Only affects Comboboxes, Static Text, Structured Text or Maps. " - Nothing + Nothing + - ctrlSetChecked + onCommandModeChanged - Sets checked state of a checkbox in checkboxes control (CT_CHECKBOXES, type = 7; ). Since Arma 3 v1.71.141591 it is possible to check checkbox with given index in multiple checkboxes set-up. For more information see DialogControls-CheckBoxes. + Defines code performed when hc command mode changes either because of (Left Ctrl + Space) shortcut or hcShowBar scripting command. Groups hc mode must contain at least one group for this command to work (see High Command ). Attached code receives _isHighCommand boolean. + i + Since Arma 3 v1.57 a stackable version of this EH is available: CommandModeChanged - https://community.bistudio.com/wiki/ctrlSetChecked + https://community.bistudio.com/wiki/onCommandModeChanged - Control ctrlSetChecked Boolean - - Control ctrlSetChecked Array + onCommandModeChanged Code/String - control ctrlSetChecked checked - - control ctrlSetChecked [index, checked] + onCommandModeChanged code - $Code$_control ctrlSetChecked true ;$/Code$ - - $Code$_control ctrlSetChecked [3, true ];$/Code$ + $Code$//Examples in-use can be found in: + //ca\modules\HC\data\scripts\HC_GUI.sqf + //A3\modules_f\HC\data\scripts\HC_GUI.sqf$/Code$ undefined / undefined @@ -14847,159 +15586,173 @@ - Nothing - Nothing + Nothing + - ctrlSetEventHandler + animateBay - Sets given event handler of given control. - The provided function should return true/false indicating that the event has handled this event fully or not and whether the engine should execute it's default code or not afterwards. - See User Interface Event Handlers for the full list of handler names. - If applicable, see DIK_KeyCodes for a list of key code constants, which are relevant to key related user interface events like: KeyDown & KeyUp. + Force animation of bay to given state, -1 for reset to engine handling, can cause weapon inoperative, because weapon is released when bay state =1. - https://community.bistudio.com/wiki/ctrlSetEventHandler + https://community.bistudio.com/wiki/animateBay - Control ctrlSetEventHandler Array + Object animateBay Array - controlName ctrlSetEventHandler [handlerName, function] + vehicle animateBay [pylon nameindex, anim phase] - $Code$_control [[ctrlSetEventHandler]] ["KeyDown", ""]$/Code$ - - $Code$(_display displayCtrl 108) [[ctrlSetEventHandler]] ["LBSelChanged","['ListChange',_this] call FireEvents"];$/Code$ + $Code$( vehicle player ) animateBay ["pylonLeft1", 0.5];$/Code$ undefined / undefined - The article User Interface Event Handlers contains a list of event handler names. - Be aware though, that the preceding "on" in the listed names must be eliminated when used with the ctrlSetEventHandler command. - e.g. instead of $Code$ _control ctrlSetEventHandler [" OnLBSelChanged ", ""]; // WRONG $/Code$ - use - $Code$ _control ctrlSetEventHandler [" LBSelChanged ", ""]; // RIGHT $/Code$ - Nothing + Nothing + - ctrlSetFade + flagTexture - Sets wanted transparency for control animation. Requires ctrlCommit to commit changes. + Returns texture of the local instance of the flag. A getter for setFlagTexture. It will not return flag textures applied using forceFlagTexture, use getForcedFlagTexture for that. - https://community.bistudio.com/wiki/ctrlSetFade + https://community.bistudio.com/wiki/flagTexture - Control ctrlSetFade Number + flagTexture Object - controlName ctrlSetFade fade + flagTexture flagCarrier - $Code$_control ctrlSetFade 1; - _control ctrlCommit 5;$/Code$ + $Code$_flagTexture = flagTexture _flag1;$/Code$ - undefined / undefined + global / local - (March 10, 2015) - This command sets the amount of fade. For example: - $Code$ - _ctrl ctrlSetFade 1; // hides the control - _ctrl ctrlSetFade 0.5; // control is 50% visible - _ctrl ctrlSetFade 0; // control is fully visible - $/Code$ - Nothing + String + - ctrlSetFocus + setVehicleAmmo - Set the input focus on given control. + Sets how much ammunition (compared to a full state defined by the vehicle type) the vehicle has. Note that the ammo will be added only to local turrets. To check locality of turret use turretLocal. + The value ranges from 0 to 1. - https://community.bistudio.com/wiki/ctrlSetFocus + https://community.bistudio.com/wiki/setVehicleAmmo - ctrlSetFocus Control + Object setVehicleAmmo Number - ctrlSetFocus controlName + vehicleName setVehicleAmmo value - $Code$ctrlSetFocus _control$/Code$ + $Code$player setVehicleAmmo 0;$/Code$ + + $Code$_vehicle setVehicleAmmo 1;$/Code$ - undefined / undefined + local / global - (June 30, 2017) - This command seems to only work on controls that accept any input from keyboard or mouse. - - - Nothing - - - + This command does not add magazines to vehicle weapons that normally start with more than one magazine. It can however, remove these magazines. + + A2:OA v1.59 - Magazines of vehicle turrets are also refilled by this command. + + If you 'unit/vehicle setVehicleAmmo 0;' an unit/vehicle first, you cannot refill it with 'unit/vehicle setVehicleAmmo 1;'. + You need to execute where the unit is local. + You need to execute on the effectiveCommander of a vehicle. + + In ArmA 3, using this command seems correctly rearm the vehicle and its turrets in all situations (tested with beta 0.72). + + In ArmA 3, when using this on a player, this command can only reduce the number of magazine in relation to the current ammo quantity of the unit. For example if player has 8 magazines, player setVehicleAmmo 0.5; will leave unit with 4 mags. Executing player setVehicleAmmo 0.5; again will leave unit with 2 mags. player setVehicleAmmo 0.5; again - 1 mag. player setVehicleAmmo 0; will remove all mags. If player had 10 mags with 30 bullets in each, player setVehicleAmmo 0.01; will leave player with loaded mag with 3 bullets in it (300 x 0.01 = 3) + + (December 20, 2014) + This command does not operate compared to a full state defined by the vehicle type, but rather relative to a vehicle's current magazine loadout. To get the former behaviour use setVehicleAmmoDef, which utilizes the vehicles default magazine loadout (i.e. its CfgVehicles magazines[] values). + + + Nothing + + + + - ctrlSetFontH1B + disableConversation - Sets H1 bold font of given HTML control. + Disable the ability to talk to other people. - https://community.bistudio.com/wiki/ctrlSetFontH1B + https://community.bistudio.com/wiki/disableConversation - Control ctrlSetFontH1B String + Object disableConversation Boolean - controlName ctrlSetFontH1B fontName + unitName disableConversation disable - $Code$_control ctrlSetFontH1B "TahomaB"$/Code$ + $Code$player disableConversation true$/Code$ + + $Code$soldier1 disableConversation true$/Code$ undefined / undefined + (July 10, 2009) + Note that this will also prevent you from using group radio. + If you just want player unable to speak to others (or one particular soldier), + use $Code$player setVariable ["BIS_noCoreConversations", true];$/Code$ + or, for the other soldier, + $Code$unitName setVariable ["BIS_noCoreConversations", true];$/Code$ + + (August 18, 2010) + My previous note is incorrect now, you can use disableConversation and still use the group radio, at least in A2:OA ! - Nothing + Nothing + - ctrlSetFontH1 + enginesTorqueRTD - Sets H1 font of given HTML control. + Torque produced by engines in N·m (Newton*meter) - https://community.bistudio.com/wiki/ctrlSetFontH1 + https://community.bistudio.com/wiki/enginesTorqueRTD - Control ctrlSetFontH1 String + enginesTorqueRTD Object - controlName ctrlSetFontH1 fontName + enginesTorqueRTD RTD_helicopter - $Code$_control ctrlSetFontH1 "TahomaB"$/Code$ + $Code$_UH80_E1 = ( enginesTorqueRTD _UH80) select 0;//engine 1 Torque + _UH80_E2 = ( enginesTorqueRTD _UH80) select 1;//engine 2 Torque$/Code$ undefined / undefined @@ -15007,195 +15760,248 @@ - Nothing + Array + - ctrlSetFontH2B + clientOwner - Sets H2 bold font of given HTML control. + Returns the client's owner id - https://community.bistudio.com/wiki/ctrlSetFontH2B + https://community.bistudio.com/wiki/clientOwner - Control ctrlSetFontH2B String + clientOwner - controlName ctrlSetFontH2B fontName + clientOwner - $Code$_control ctrlSetFontH2B "TahomaB"$/Code$ + $Code$_id = clientOwner ;$/Code$ undefined / undefined + (February 17, 2016) + On hosted server there could be some inconsistency between clientOwner, owner and object creator id, especially in missions started from save. On the dedicated server this command however works reliably. - Nothing + Number + - ctrlSetFontH2 + setFlagOwner - Sets H2 font of given HTML control + Sets flag owner. When owner is set to objNull or any object other than a unit of class man or logic, flag is returned to the flagpole. A flag owned by a logic has no visual representation. - https://community.bistudio.com/wiki/ctrlSetFontH2 + https://community.bistudio.com/wiki/setFlagOwner - Control ctrlSetFontH2 String + Object setFlagOwner Object - controlName ctrlSetFontH2 fontName + flag setFlagOwner owner - $Code$_control ctrlSetFontH2 "TahomaB"$/Code$ + $Code$_flag1 setFlagOwner _soldier1;$/Code$ + + $Code$// To return the flag back to the flag pole: + //Method 1: (set owner null) + flag _flagCarrier setFlagOwner objNull ; + //Method 2: (set the flag mast as the owner) + flag _flagCarrier setFlagOwner flag _flagCarrier;$/Code$ - undefined / undefined + global / global + Since flags can not be owned by vehicles, use "flag setFlagOwner driver tank1" or "flag1 setFlagOwner tank1D" to assign the flag to the vehicle's driver. The second method will only work if tank1 is the name of a unit, not a variable refering to it. True for OFP&Arma - Nothing + Nothing + - ctrlSetFontH3B + getGroupIcon - Sets H3 bold font of given HTML control. + Get group icon properties. - https://community.bistudio.com/wiki/ctrlSetFontH3B + https://community.bistudio.com/wiki/getGroupIcon - Control ctrlSetFontH3B String + Group getGroupIcon Number - controlName ctrlSetFontH3B fontName + group getGroupIcon ID - $Code$_control ctrlSetFontH3B "TahomaB"$/Code$ + $Code$_grpIconId = _group getVariable "BIS_MARTA_ICON_TYPE"; + _grpIcon = _group getGroupIcon _grpIconId;$/Code$ - undefined / undefined + global / undefined - Nothing + Array + - ctrlSetFontH3 + playerSide - Sets H3 font of given HTML control. + Returns the player's side. This is valid even when the player controlled person is dead (a difference from side player ). - https://community.bistudio.com/wiki/ctrlSetFontH3 + https://community.bistudio.com/wiki/playerSide - Control ctrlSetFontH3 String + playerSide - controlName ctrlSetFontH3 fontName + playerSide - $Code$_control ctrlSetFontH3 "TahomaB"$/Code$ + $Code$if ( side man1 == playerSide ) then { + hint "man1 is on your side!"; + };$/Code$ + + $Code$switch ( playerSide ) do { + case west : { + hint "You are BLUFOR"; + }; + case east : { + hint "You are OPFOR"; + }; + };$/Code$ undefined / undefined + (27 Jan, 2008) + playerSide defaults to west for JIP players early on during initialization regardless of their side. + So if you are a JIP player on another side (like east ), you will need to cater for this for any early initializations. + + (13 Oct, 2008) + playerSide also shows your starting side, even if your side changes to enemy due to a bad rating. In that case, playerSide != side player. - Nothing + Side + - ctrlSetFontH4B + log - Sets H4 bold font of given HTML control. + Base-10 logarithm of x. - https://community.bistudio.com/wiki/ctrlSetFontH4B + https://community.bistudio.com/wiki/log - Control ctrlSetFontH4B String + log Number - controlName ctrlSetFontH4B fontName + log x - $Code$_control ctrlSetFontH4B "TahomaB"$/Code$ + $Code$_log = log 10; // 1$/Code$ undefined / undefined + (23:14, 16 Jun 2014) + (A3 1.20) To clarify: + $Code$y = 10 ^ x // x = log y$/Code$ + People use logarithm at the purpose of simplifying multiplication via exponents plus years before. + $Code$23456*45634 = 1.07039e+009 + log 23456 = 4.37025; log 45634 = 4.65929; ( log 23456) + ( log 45634) = 9.02954 + 10^(( log 23456) + ( log 45634)) = 10 ^ 9.02954 // same as 23456*45634 + $/Code$ + As modern usage, for instance, to evaluate another exponent when multiple is known (Which magnitude is 4 times stronger than 8.3 earthquake?): + $Code$//_Unknown = log x; 8.3 = log y + // x = 10 ^_Unknown; y = 10 ^8.3 + //x/y = (10 ^_Unknown)/(10 ^8.3) = log 4 + // x/y = _Unknown – 8.3 = 0.6 + //_result = 8.9 magnitude + _result = ( log 4) + 8.3 + $/Code$ - Nothing + Number + - ctrlSetFontH4 + isMultiplayerSolo - Sets H4 font of given HTML control. + Returns true when playing a game in solo multiplayer (for example Apex coop campaign PLAY SOLO option). - https://community.bistudio.com/wiki/ctrlSetFontH4 + https://community.bistudio.com/wiki/isMultiplayerSolo - Control ctrlSetFontH4 String + isMultiplayerSolo - controlName ctrlSetFontH4 fontName + isMultiplayerSolo - $Code$_control ctrlSetFontH4 "TahomaB"$/Code$ - + undefined / undefined - Nothing + Boolean + - ctrlSetFontH5B + set3DENMissionAttribute - Sets H5 bold font of given HTML control. + Set scenario attribute. + An attribute is identified by its property ( data when it's engine-drive attribute) value in config. For the list of all attributes with their properties, see Setting Attributes. + ! + Attributes are available only within the Eden Editor workspace. You cannot access them in scenario preview or exported scenario! - https://community.bistudio.com/wiki/ctrlSetFontH5B + https://community.bistudio.com/wiki/set3DENMissionAttribute - Control ctrlSetFontH5B String + String set3DENMissionAttribute Array - controlName ctrlSetFontH5B fontName + section set3DENMissionAttribute [ class, value ] - $Code$_control ctrlSetFontH5B "TahomaB"$/Code$ + $Code$"Multiplayer" set3DENMissionAttribute ["respawn",3]; + // Set respawn type to 3$/Code$ undefined / undefined @@ -15203,111 +16009,132 @@ - Nothing + Boolean + - ctrlSetFontH5 + unlockAchievement - Sets H5 font of given HTML control. + Unlock the given achievement. - https://community.bistudio.com/wiki/ctrlSetFontH5 + https://community.bistudio.com/wiki/unlockAchievement - Control ctrlSetFontH5 String + unlockAchievement String - controlName ctrlSetFontH5 fontName + unlockAchievement name - $Code$_control ctrlSetFontH5 "TahomaB"$/Code$ - + undefined / undefined + (February 10, 2016) + This is an obsolete command used in the experimental Arma 2 Xbox 360 version. + https://forums.bistudio.com/topic/187873-unlockachievment-command/ - Nothing + Boolean + - ctrlSetFontH6B + formation - Sets H6 bold font of given HTML control. + Returns the current formation of a group. - https://community.bistudio.com/wiki/ctrlSetFontH6B + https://community.bistudio.com/wiki/formation - Control ctrlSetFontH6B String + formation Object/Group - controlName ctrlSetFontH6B fontName + formation grp - $Code$_control ctrlSetFontH6B "TahomaB"$/Code$ + $Code$formation group player$/Code$ - undefined / undefined + global / undefined + (January 9, 2007) + Additional ARMA Formations: "File" - Column Compact. "DIAMOND" - Delta. - Nothing + String + - ctrlSetFontH6 + handgunMagazine - Sets H6 font of given HTML control. + Returns either single element array, containing class name of currently loaded in the handgun magazine, or an empty array if unit has no handgun or handgun is not loaded. This command is used for infantry weapons only. - https://community.bistudio.com/wiki/ctrlSetFontH6 + https://community.bistudio.com/wiki/handgunMagazine - Control ctrlSetFontH6 String + handgunMagazine Object - controlName ctrlSetFontH6 fontName + handgunMagazine unit - $Code$_control ctrlSetFontH6 "TahomaB"$/Code$ + $Code$hint handgunMagazine player ; //["16Rnd_9x21_Mag"]$/Code$ + + $Code$_array = handgunMagazine player ; + if ( count _array 0) then { + hint ("Handgun is loaded with " + (_array select 0) + "!"); + } else { + if ( handgunWeapon player != "") then { + hint "Handgun is not loaded!"; + } else { + hint "Player doesn't have a handgun!"; + }; + };$/Code$ - undefined / undefined + global / undefined - Nothing + Array + - ctrlSetFontHeightH1 + findNearestEnemy - Sets H1 font size of given HTML control. + Finds the nearest enemy to the specified position. Returns a null object if the object's group does not know about any enemies. This command will return nearest object that is known to the unit and is considered enemy. An empty vehicle that is part of enemy group assets (see addVehicle ) can be returned as valid nearest target. - https://community.bistudio.com/wiki/ctrlSetFontHeightH1 + https://community.bistudio.com/wiki/findNearestEnemy - Control ctrlSetFontHeightH1 Number + Object findNearestEnemy Object/Array - controlName ctrlSetFontHeightH1 height + object findNearestEnemy position - $Code$_control ctrlSetFontHeightH1 0.05$/Code$ + $Code$_myNearestEnemy = ( units _myGroup select 0) findNearestEnemy player ;$/Code$ + + $Code$_myNearestEnemy = player findNearestEnemy player ;$/Code$ undefined / undefined @@ -15315,27 +16142,28 @@ - Nothing + Object + - ctrlSetFontHeightH2 + showPad - Sets H2 font size of given HTML control. + Shows or hides the notebook on the map screen, if enabled for the mission. (default true ). It is no longer relevant to Arma 2. - https://community.bistudio.com/wiki/ctrlSetFontHeightH2 + https://community.bistudio.com/wiki/showPad - Control ctrlSetFontHeightH2 Number + showPad Boolean - controlName ctrlSetFontHeightH2 height + showPad show - $Code$_control ctrlSetFontHeightH2 0.05$/Code$ + $Code$showPad false$/Code$ undefined / undefined @@ -15343,55 +16171,78 @@ - Nothing + Nothing + - ctrlSetFontHeightH3 + onEachFrame - Sets H3 font size of given HTML control. + Runs given statement every frame. + i + Since Arma 3 v1.57 a stackable version of this EH is available: EachFrame + In order to keep compatibility between official and community content the functions BIS_fnc_addStackedEventHandler and BIS_fnc_removeStackedEventHandler should be used instead. - https://community.bistudio.com/wiki/ctrlSetFontHeightH3 + https://community.bistudio.com/wiki/onEachFrame - Control ctrlSetFontHeightH3 Number + onEachFrame String/Code - controlName ctrlSetFontHeightH3 height + onEachFrame statement - $Code$_control ctrlSetFontHeightH3 0.05$/Code$ + $Code$onEachFrame { hintSilent str position player }; //Hints position every frame$/Code$ + + $Code$// Private variables defined outside of onEachFrame scope are not inherited: + _myvar = "bob"; + myvar = "bill"; + onEachFrame { hintSilent str [_myvar, myvar]}; + //Result: [any,"bill"]$/Code$ + + $Code$// Only one onEachFrame loop can exist at any time: + onEachFrame { player sideChat "first"}; + onEachFrame { player sideChat "second"}; + //Result: "second","second","second"..."second" + // Note how "first" never gets shown even though it precedes "second". This is because script thread is executing within the same frame and first onEachFrame is overwritten before it has a chance to execute its statement.$/Code$ + + $Code$// Script suspension is not permitted within onEachFrame scope: + onEachFrame { sleep 1}; + //ERROR!!!$/Code$ undefined / undefined + (21 Dec, 2012) + $Code$ onEachFrame {}; //Reset event$/Code$ - Nothing + Nothing + - ctrlSetFontHeightH4 + freeLook - Sets H3 font size of given HTML control. + Returns true if freelook is active. - https://community.bistudio.com/wiki/ctrlSetFontHeightH4 + https://community.bistudio.com/wiki/freeLook - Control ctrlSetFontHeightH4 Number + freeLook - controlName ctrlSetFontHeightH4 height + freeLook - $Code$_control ctrlSetFontHeightH4 0.05$/Code$ + $Code$systemChat (if freeLook then {"Quit looking around player!"} else {""});$/Code$ undefined / undefined @@ -15399,111 +16250,123 @@ - Nothing + Boolean + - ctrlSetFontHeightH5 + moveToCompleted - Sets H5 font size of given HTML control. + Check if latest low level moveTo command is finished. - https://community.bistudio.com/wiki/ctrlSetFontHeightH5 + https://community.bistudio.com/wiki/moveToCompleted - Control ctrlSetFontHeightH5 Number + moveToCompleted Object - controlName ctrlSetFontHeightH5 height + moveToCompleted person - $Code$_control ctrlSetFontHeightH5 0.05$/Code$ - + undefined / undefined - Nothing + Boolean + - ctrlSetFontHeightH6 + setMarkerDir - Sets H6 font size of given HTML control. + Sets the orientation of the marker. Angle is in degrees. - https://community.bistudio.com/wiki/ctrlSetFontHeightH6 + https://community.bistudio.com/wiki/setMarkerDir - Control ctrlSetFontHeightH6 Number + String setMarkerDir Number - controlName ctrlSetFontHeightH6 height + markerName setMarkerDir angle - $Code$_control ctrlSetFontHeightH6 0.05$/Code$ + $Code$"Marker1" setMarkerDir 90;$/Code$ - undefined / undefined + undefined / global - Nothing + Nothing + - ctrlSetFontHeightSecondary + nearRoads - Sets the font size of the secondary text of given control. + Find the road segments within the circle of given radius. - https://community.bistudio.com/wiki/ctrlSetFontHeightSecondary + https://community.bistudio.com/wiki/nearRoads - Control ctrlSetFontHeightSecondary Number + Object/Array nearRoads Number - ctrl ctrlSetFontHeightSecondary value + pos nearRoads radius - $Code$_control ctrlSetFontHeightSecondary 0.05;$/Code$ + $Code$_list = player nearRoads 50;$/Code$ + + $Code$_list = ( position _unit) nearRoads 50;$/Code$ + + $Code$_list = [1800,5700] nearRoads 50;$/Code$ undefined / undefined + (26 Mar, 2011) + NearRoads always gets data in the same order. In a 300 meter radius around Feruz Abad, for example, the first one is in the south-west corner and the last one is in the north-east. + Click below for picture. + [1] - Nothing + Array + - ctrlSetFontHeight + isArray - Sets the font size of given control. + Check if config entry represents array. - https://community.bistudio.com/wiki/ctrlSetFontHeight + https://community.bistudio.com/wiki/isArray - Control ctrlSetFontHeight Number + isArray Config - controlName ctrlSetFontHeight height + isArray config - $Code$_control ctrlSetFontHeight 0.05$/Code$ + $Code$_ok = isArray (configFile "CfgVehicles") + // Result is false$/Code$ undefined / undefined @@ -15511,85 +16374,91 @@ - Nothing + Boolean + - ctrlSetFontP + forceAddUniform - Sets P font of given HTML control or its size. + Create a new uniform and hard link it into slot (without any restrictions). - https://community.bistudio.com/wiki/ctrlSetFontP + https://community.bistudio.com/wiki/forceAddUniform - Control ctrlSetFontP String/Number + Object forceAddUniform String - control ctrlSetFontP fontOrSize + unit forceAddUniform type - $Code$_control ctrlSetFontP "TahomaB"$/Code$ - - $Code$_control ctrlSetFontP 0.05$/Code$ + $Code$_unit forceAddUniform "U_B_CombatUniform_mcam";$/Code$ - undefined / undefined + global / global - Nothing + Nothing + - ctrlSetFontPB + createMPCampaignDisplay - Sets P bold font of given HTML control. + Create a MP campaign display. The class name must be a mission collection declared in the configs; in example, configFile /"CfgMissions"/"MPMissions"/"Apex"/ + If the class doesn't exist or isn't a mission collection, the display will be created empty. - https://community.bistudio.com/wiki/ctrlSetFontPB + https://community.bistudio.com/wiki/createMPCampaignDisplay - Control ctrlSetFontPB String + Display createMPCampaignDisplay String - controlName ctrlSetFontPB fontName + display createMPCampaignDisplay class - $Code$_control ctrlSetFontPB "TahomaB"$/Code$ + $Code$findDisplay 46 createMPCampaignDisplay "Apex";$/Code$ undefined / undefined + (July 14, 2016) + $Code$ findDisplay 46 createMPCampaignDisplay "123";$/Code$ - Nothing + Nothing + - ctrlSetFontSecondary + commitOverlay - Sets the font size of the secondary text of given control. + Commit the current overlay. + i + Some Old Editor Command - https://community.bistudio.com/wiki/ctrlSetFontSecondary + https://community.bistudio.com/wiki/commitOverlay - Control ctrlSetFontSecondary String + commitOverlay Control - ctrl ctrlSetFontSecondary fontClass + commitOverlay map - $Code$_control ctrlSetFontSecondary "TahomaB";$/Code$ + $Code$commitOverlay _map,$/Code$ undefined / undefined @@ -15597,69 +16466,58 @@ - Nothing + Nothing + - ctrlSetFont + clearMagazineCargoGlobal - Sets the font for given control (see Fonts ) - Available Arma 3 fonts - "EtelkaMonospacePro" - "EtelkaMonospaceProBold" - "EtelkaNarrowMediumPro" - "LCD14" - "LucidaConsoleB" - "PuristaBold" - "PuristaLight" - "PuristaMedium" - "PuristaSemibold" - "RobotoCondensed" - "RobotoCondensedBold" - "RobotoCondensedLight" - "TahomaB" + Removes all magazines from the vehicle cargo space. MP synchronized. - https://community.bistudio.com/wiki/ctrlSetFont + https://community.bistudio.com/wiki/clearMagazineCargoGlobal - Control ctrlSetFont String + clearMagazineCargoGlobal Object - control ctrlSetFont fontName + clearMagazineCargoGlobal unit - $Code$_control ctrlSetFont "TahomaB"$/Code$ + $Code$clearMagazineCargoGlobal jeepOne;$/Code$ - undefined / undefined + global / global - Nothing + Nothing + - ctrlSetForegroundColor + enableCamShake - Sets foreground color of given control. Color is in format Color. + Allows camera shake effects via addCamShake. If set to false, then a currently active shake effect will stop immediately. + By default, shake effects are enabled, but once they have been disabled by this command, they will have to be enabled first, in order to be visible. - https://community.bistudio.com/wiki/ctrlSetForegroundColor + https://community.bistudio.com/wiki/enableCamShake - Control ctrlSetForegroundColor Array + enableCamShake Boolean - control ctrlSetForegroundColor color + enableCamShake value - $Code$_control ctrlSetForegroundColor [1, 0, 0, 1]$/Code$ + $Code$enableCamShake false ;$/Code$ undefined / undefined @@ -15667,27 +16525,29 @@ - Nothing + Nothing + - ctrlSetModel + vehicleCargoEnabled - Sets model for 3D Dialog Control. + Check if the vehicle has enabled transporting other vehicles or not. - https://community.bistudio.com/wiki/ctrlSetModel + https://community.bistudio.com/wiki/vehicleCargoEnabled - Control ctrlSetModel String + vehicleCargoEnabled Object - control ctrlSetModel model + vehicleCargoEnabled vehicle - $Code$_control3D ctrlSetModel "\a3\Ui_f\objects\Compass.p3d";$/Code$ + $Code$// Blackfish (Vehicle Transport) with given variable name blackfish + _canTransportVehicles = vehicleCargoEnabled blackfish; //returns true$/Code$ undefined / undefined @@ -15695,55 +16555,56 @@ - Nothing + Boolean + - ctrlSetModelDirAndUp + kbReact - Sets orientation of 3D control model. It is similar to setVectorDirAndUp command for an object. + Pass a non-verbal communication to the receiver. See Conversations for more details. - https://community.bistudio.com/wiki/ctrlSetModelDirAndUp + https://community.bistudio.com/wiki/kbReact - Control ctrlSetModelDirAndUp Array + Object kbReact Array - control ctrlSetModelDirAndUp [dir, up] + person kbReact [receiver, topic, sentenceID, [argumentName, argumentValue, argumentText, argumentSpeech], ] - $Code$_ctrl3D ctrlSetModelDirAndUp [[0,1,0],[0,0,1]]; //default orientation$/Code$ - + undefined / undefined - Nothing + Nothing + - ctrlSetModelScale + safeZoneXAbs - Sets 3D control model scale + Returns SafeZone left border (of all monitors, in case there's more than one) - https://community.bistudio.com/wiki/ctrlSetModelScale + https://community.bistudio.com/wiki/safeZoneXAbs - Control ctrlSetModelScale Number + safeZoneXAbs - control ctrlSetModelScale scale + safeZoneXAbs - $Code$_ctrl3D ctrlSetModelScale 1.5;$/Code$ + $Code$_szX = safeZoneXAbs;$/Code$ undefined / undefined @@ -15751,77 +16612,61 @@ - Nothing + Number + - ctrlSetPosition + setDefaultCamera - Sets wanted position and size for 2D control animation. Width and height are optional. ctrlCommit is required to complete the operation. For 3D control, param is relative [x,y,z] and no ctrlCommit is required as it cannot be animated. + Sets the position and direction for the camera used after camera is set on no object (log out view when leaving MP game for example) - https://community.bistudio.com/wiki/ctrlSetPosition + https://community.bistudio.com/wiki/setDefaultCamera - Control ctrlSetPosition Array + setDefaultCamera Array - controlName ctrlSetPosition [x, y] - - controlName ctrlSetPosition [x, y, w, h] - - controlName ctrlSetPosition [x, y, z] + setDefaultCamera [position, direction] - $Code$// Move control: - _control2D ctrlSetPosition [0, 0]; - _control2D ctrlCommit 0;$/Code$ - - $Code$// Move control and resize: - _control2D ctrlSetPosition [0, 0, 1, 1]; - _control2D ctrlCommit 0;$/Code$ + $Code$setDefaultCamera [[5000,5000,200],[1,1,-1]];$/Code$ - $Code$_control3D ctrlSetPosition [0.5, 1, 0.5]; //centered and 1m away from screen$/Code$ + $Code$// Lift camera 100m up above current player position and point downwards: + setDefaultCamera [ ATLtoASL ( player modelToWorld [0,0,100]),[0,0,-1]];$/Code$ undefined / undefined - (January 27, 2007) - IMPORTANT - You have to use ctrlCommit command to apply this effect(Arma v1.02.5103GER) - - (May 22, 2017) - If the target ctrl is part of a ctrlGroup, the position needs to be relative to the ctrlGroup position. - - (July 20, 2017) - If the target control is a controls' group, all the child controls of that group will be moved automatically (as their position is relative to the control group rather than the display) - Nothing + Nothing + - ctrlSetScale + toUpper - Sets wanted scale for control animation. Top left corner remains same. This command requires ctrlCommit. + Converts the supplied string to all uppercase characters. - https://community.bistudio.com/wiki/ctrlSetScale + https://community.bistudio.com/wiki/toUpper - Control ctrlSetScale Number + toUpper String - control ctrlSetScale scale + toUpper string - $Code$_control ctrlSetScale 0.5; - _control ctrlCommit 0;$/Code$ + $Code$hint toUpper("AaBb1") + // returns "AABB1"$/Code$ undefined / undefined @@ -15829,190 +16674,206 @@ - Nothing + String + - ctrlSetStructuredText + removeItemFromUniform - Set the structured text which will be displayed in structured text control. + Removes item from soldier's uniform. Can be used with magazines and weapons too. - https://community.bistudio.com/wiki/ctrlSetStructuredText + https://community.bistudio.com/wiki/removeItemFromUniform - Control ctrlSetStructuredText Structured_Text + Object removeItemFromUniform String - control ctrlSetStructuredText structuredText + unit removeItemFromUniform item - $Code$_control ctrlSetStructuredText parseText "First line img image=data\isniper.paa / br / Second line"$/Code$ - - $Code$// To center text vertically, add extra line above with blank space ( ) and set its size to adjust: - with uiNamespace do { - button = findDisplay 46 ctrlCreate ["RscShortcutButton", -1]; - button ctrlSetPosition [0,0,0.3,0.1]; - button ctrlCommit 0; - button ctrlSetStructuredText parseText - " t size='0.5' /t br/ t size='1' align='center' Button Text /t "; - };$/Code$ - + - undefined / undefined + global / global - Nothing + Nothing + - ctrlSetTextColor + displaySetEventHandler - Sets text color of given control. Color is in format Color. As of Arma 3 v1.40 this command could also be used to change fill colour or the DialogControls-ProgressBar. + Sets given event handler of given display. + The return code of the provided function should indicate whether this event was handled correctly. This implies telling the engine whether it's default code should be executed. + See User Interface Event Handlers for the full list of handler names. + If applicable, see DIK_KeyCodes for a list of key code constants, which are relevant to key related user interface events like: KeyDown & KeyUp. - https://community.bistudio.com/wiki/ctrlSetTextColor + https://community.bistudio.com/wiki/displaySetEventHandler - Control ctrlSetTextColor Array + Display displaySetEventHandler Array - display ctrlSetTextColor color + display displaySetEventHandler [handlerName, function] - $Code$_control ctrlSetTextColor [1, 0, 0, 1]$/Code$ + $Code$_control displaySetEventHandler ["KeyDown", ""]$/Code$ + + $Code$init.sqf + keyspressed = compile preprocessFile "keyspressed.sqf"; + _display = findDisplay 46; + _display displaySetEventHandler ["KeyDown","_this call keyspressed"]; + keyspressed.sqf + private['_handled']; + _handled = false; + switch (_this select 1) do + { + //F key + case 33: + { + // code here + _handled = true; + }; + }; + _handled;$/Code$ undefined / undefined - (April 10, 2015) - When used on a RscProgress control, remove the configured "texture" first. The two will affect each other. - Arma 3 v1.42 + (Nov 25, 2009) + Always use displayAddEventHandler instead, as DSetEH overwrites other (peoples') DEH. - Nothing + Nothing + - ctrlSetText + setDrawIcon - Set the text of a control of the currently active user dialog or display. This command can be used for: static texts, buttons, edit lines and active texts as well as for images, where you can use it to set the image path. - Read Dialog Control for more information about user dialogs and controls. + Set the icon to be shown in 2D editor for the specified editor object. If maintain size is false,icon will not scale depending on the scale,of the map. If maintain size is a number,the icon will maintain size,if map scale is below that number. is3D,show line and priority are,optional. + i + Some Old Editor Command - https://community.bistudio.com/wiki/ctrlSetText + https://community.bistudio.com/wiki/setDrawIcon - ctrlSetText Array - - Control ctrlSetText String + Control setDrawIcon Array - ctrlSetText [idc, text] - - controlName ctrlSetText text + map setDrawIcon [object,texture,color,offset,width,height,maintain size,angle,string identifier,shadow,is3D,draw line,priority] - $Code$ctrlSetText [100, "Hello world"];//for Dialogs$/Code$ - - $Code$_control ctrlSetText "Hello world.";// for Displays$/Code$ - + - local / local + undefined / undefined - (16 Nov, 2011) - For ArmA2 textured "shortcut" buttons (type = 16), you must use the alternative syntax. - - (October 16, 2016) - When using ctrlSetText with picture control, the path to the texture is cached, so that if the new texture is from the same file as old one, the precious CPU cycles would not be wasted on reloading it. - Nothing - Nothing + Nothing + - ctrlSetTooltipColorBox + setAperture - Sets tooltip border color of given control. Color is in format Color. + Sets custom camera aperture (-1 to do it automatically). - https://community.bistudio.com/wiki/ctrlSetTooltipColorBox + https://community.bistudio.com/wiki/setAperture - Control ctrlSetTooltipColorBox Array + setAperture Number - control ctrlSetTooltipColorBox color + setAperture aperture - $Code$_control ctrlSetTooltipColorBox [1, 0, 0, 1];$/Code$ + $Code$setAperture 0.3;$/Code$ - undefined / undefined + undefined / local + The aperture value to simulate typical daylight (outdoor) conditions is 50. The aperture value to simulate typical daylight (indoor) conditions is 30. Setting the value to less than 20 will result in a very bright scene, suitable for night conditions. The closer the number is to 0, the more light will be let into the lens, to carry on the aperture metaphor. Different lighting/weather conditions can change the actual indoor and outdoor aperture values. Experiment and test to be sure. - Nothing + Nothing + - ctrlSetTooltipColorShade + menuSetPicture - Sets tooltip background color of given control. Color is in format Color. + Sets new picture into menu entry on given path. - https://community.bistudio.com/wiki/ctrlSetTooltipColorShade + https://community.bistudio.com/wiki/menuSetPicture - Control ctrlSetTooltipColorShade Array + menuSetPicture Array + + Control menuSetPicture Array - control ctrlSetTooltipColorShade color + menuSetPicture [idc, path, picture] + + control menuSetPicture [path, picture] - $Code$_control ctrlSetTooltipColorShade [1, 0, 0, 1];$/Code$ - + undefined / undefined - Nothing + Nothing - Nothing + - ctrlSetTooltipColorText + reverse - Sets tooltip text color of given control. Color is in format Color. + Reverses given array by reference (modifies the original array, just like resize ). - https://community.bistudio.com/wiki/ctrlSetTooltipColorText + https://community.bistudio.com/wiki/reverse - Control ctrlSetTooltipColorText Array + reverse Array - display ctrlSetTooltipColorText color + reverse array - $Code$_control ctrlSetTooltipColorText [1, 0, 0, 1]$/Code$ + $Code$_arr = [1,2,3]; + reverse _arr; + hint str _arr; //[3,2,1]$/Code$ + + $Code$_wordArr = toArray "gateman"; + reverse _wordArr; + hint toString _wordArr; //nametag$/Code$ undefined / undefined @@ -16020,38 +16881,28 @@ - Nothing + Nothing + - ctrlSetTooltip + backpackSpaceFor - Sets tooltip text of given control. + Returns how much space is in backpack for given weapon or magazine - https://community.bistudio.com/wiki/ctrlSetTooltip + https://community.bistudio.com/wiki/backpackSpaceFor - Control ctrlSetTooltip String + Object backpackSpaceFor String - control ctrlSetTooltip text + backpack backpackSpaceFor weaponName - $Code$_control ctrlSetTooltip "tooltip";$/Code$ - - $Code$findDisplay 10000 displayCtrl 10001 ctrlSetTooltip "ThisIsAGoodTip";$/Code$ - - $Code$with uiNamespace do - { - bar = findDisplay 46 createDisplay "RscDisplayEmpty" ctrlCreate ["RscProgress", -1]; - bar ctrlSetPosition [0,0,1,0.01]; - bar ctrlCommit 0; - bar progressSetPosition 0.75; - bar ctrlSetTooltip "lalalalalalalala"; - };$/Code$ + $Code$( backpack player ) backpackSpaceFor "m16"; // [weapons, magazines]$/Code$ undefined / undefined @@ -16059,158 +16910,173 @@ - Nothing + Array + - ctrlShown + switchGesture - Returns whether given control is shown. + When used on a person,the given move is started immediately (there is no transition). - https://community.bistudio.com/wiki/ctrlShown + https://community.bistudio.com/wiki/switchGesture - ctrlShown Control + Object switchGesture String - ctrlShown controlName + soldier switchGesture moveName - $Code$_bool = ctrlShown _ctrl;$/Code$ + $Code$soldierOne switchGesture "Wave";$/Code$ undefined / undefined + (August 31, 2010) + Rpt says "Not implemented" as of OA 1.54. - Boolean + Nothing + - ctrlShow + ctrlSetFont - Set if a control of the currently active user dialog is shown or not. - Read Dialog Control for more information about user dialogs and controls. + Sets the font for given control (see Fonts ) + Available Arma 3 fonts + "EtelkaMonospacePro" + "EtelkaMonospaceProBold" + "EtelkaNarrowMediumPro" + "LCD14" + "LucidaConsoleB" + "PuristaBold" + "PuristaLight" + "PuristaMedium" + "PuristaSemibold" + "RobotoCondensed" + "RobotoCondensedBold" + "RobotoCondensedLight" + "TahomaB" - https://community.bistudio.com/wiki/ctrlShow + https://community.bistudio.com/wiki/ctrlSetFont - ctrlShow Array - - Control ctrlShow Boolean + Control ctrlSetFont String - ctrlShow [idc, show] - - controlName ctrlShow show + control ctrlSetFont fontName - $Code$ctrlShow [100, false ];$/Code$ - - $Code$_control ctrlShow false ;$/Code$ + $Code$_control ctrlSetFont "TahomaB"$/Code$ - local / local + undefined / undefined - Nothing - Nothing + Nothing + - ctrlTextHeight + isLocalized - Returns the control text height. Supported control types are: - CT_STATIC 0 - CT_EDIT 2 ( Since Arma 3 v1.57.135040 ) - CT_STRUCTURED_TEXT 13 + Checks whether given string name is localized. - https://community.bistudio.com/wiki/ctrlTextHeight + https://community.bistudio.com/wiki/isLocalized - ctrlTextHeight Control + isLocalized String - ctrlTextHeight control + isLocalized stringName - $Code$_h = ctrlTextHeight _ctrl;$/Code$ + $Code$if ( isLocalized "STR_DN_SNAKE") then { + hint localize "STR_DN_SNAKE"; + } else { + hint "STR_DN_SNAKE"; + diag_log "ToDo: STR_DN_SNAKE is not localized"; + };$/Code$ undefined / undefined - (May 24, 2017) - in ArmA 3 v.1.70.141764, this command always returns 0 if the control has no width. - Number + Boolean + - ctrlText + canMove - Returns the text of a control of the currently active user dialog. This command can be used on static texts, buttons, edit lines and active texts as well as for images, where it returns the image path. - Read Dialog Control for more information about user dialogs and controls. + Returns if the given vehicle is still able to move. This command checks only the damage value, not the amount of fuel! - https://community.bistudio.com/wiki/ctrlText + https://community.bistudio.com/wiki/canMove - ctrlText Number - - ctrlText Control + canMove Object - ctrlText idc - - ctrlText controlName + canMove unitName - $Code$_text = ctrlText 100$/Code$ + $Code$// SQS : + ?!( canMove _tank) : player sideChat "He's nailed on the ground! Now hurry!"$/Code$ - $Code$_text = ctrlText _control$/Code$ + $Code$if (! canMove _tank) then + { + player sideChat "He's nailed on the ground! Now hurry!"; + };$/Code$ - local / undefined + global / undefined + (08:17, 22 Juil 2016 (UTC)) + This command will return true for a car or a tank out of fuel, but false for an helicopter or a plane for the same condition. - String - String + Boolean + - ctrlType + leaderboardsRequestUploadScore - Returns number representing the type of control, which is also defined by type property in config. For more information see Dialog Control + Starts async. operation to upload score to board with given name, value always overwrite the current value in the board. The details array is optional. The board has to be initialized before the call. - https://community.bistudio.com/wiki/ctrlType + https://community.bistudio.com/wiki/leaderboardsRequestUploadScore - ctrlType Control + leaderboardsRequestUploadScore Array - ctrlType control + leaderboardsRequestUploadScore [boardName, score, [details]] - $Code$_type = ctrlType _rscEdit; // 2$/Code$ + $Code$leaderboardsRequestUploadScore ["TT01", 1234, [5,6,7,8]]$/Code$ undefined / undefined @@ -16218,166 +17084,171 @@ - Number + Boolean + - ctrlVisible + menuEnable - Returns if a control of the currently active user dialog is shown or not. Read Dialog Control for more information about user dialogs and controls. + Enables disabled menu entry on given path. - https://community.bistudio.com/wiki/ctrlVisible + https://community.bistudio.com/wiki/menuEnable - ctrlVisible Number + menuEnable Array - ctrlVisible idc + menuEnable [idc, path] - $Code$_bool = ctrlVisible 100;$/Code$ - + - local / undefined + undefined / undefined - Boolean + Nothing + - curatorAddons + displayRemoveAllEventHandlers - Returns list of addons allowed to given curator. + Remove all event handlers from the given display. - https://community.bistudio.com/wiki/curatorAddons + https://community.bistudio.com/wiki/displayRemoveAllEventHandlers - curatorAddons Object + Display displayRemoveAllEventHandlers String - curatorAddons curatorObj + display displayRemoveAllEventHandlers handlerName - $Code$_addons = curatorAddons myCurator;$/Code$ - + undefined / undefined - Array + Nothing + - curatorCameraAreaCeiling + serverName - Returns ceiling height for curator camera. + Returns name of the hosting server in MP, "" in SP. - https://community.bistudio.com/wiki/curatorCameraAreaCeiling + https://community.bistudio.com/wiki/serverName - curatorCameraAreaCeiling Object + serverName - curatorCameraAreaCeiling curatorObj + serverName - $Code$curatorCameraAreCeiling BIS_curatorUnit;$/Code$ - + undefined / undefined - Number + String + - curatorCameraArea + disableRemoteSensors - Returns all curator camera areas. + This command will halt raycasting calculations (on the local machine only) for all groups which don't contain any local entities. If a group contains a single local entity then calculations will still be performed for the entire group. + These raycasts are used to determine what other entities an entity can see, and they take a lot of CPU time. This is of course a bit of a trick, because rather than a true optimization, it disables part of the simulation. However, there are certainly types of scenarios where these raycasts are not needed. An example is a fully Player-versus-Player scenario, where the visibility between every combination of player entity is not needed. So why not disable this by default? There are cases where you do require these raycasts, for example in stealth scenarios. Without them, commands like knowsAbout, nearTargets and targetKnowledge will only function for local units! The commands themselves are local, can be used on servers and clients, and the state is reset when the scenario ends. So, carefully consider whether your scenario can benefit from this method. - https://community.bistudio.com/wiki/curatorCameraArea + https://community.bistudio.com/wiki/disableRemoteSensors - curatorCameraArea Object + disableRemoteSensors Boolean - curatorCameraArea curatorObj + disableRemoteSensors state - $Code$_camArea = curatorCameraArea myCurator;$/Code$ + $Code$disableRemoteSensors false;$/Code$ - undefined / undefined + undefined / local - Array + Nothing + - curatorCamera + displayParent - Returns curator camera object. + Returns parent display of the given display. - https://community.bistudio.com/wiki/curatorCamera + https://community.bistudio.com/wiki/displayParent - curatorCamera + displayParent Display - curatorCamera + displayParent display - + $Code$_display = displayParent findDisplay 49; // Display #46$/Code$ + undefined / undefined - Object + Display + - curatorCoef + hcShownBar - Returns current coeficient setting. + Return true if the high command bar is shown/active. - https://community.bistudio.com/wiki/curatorCoef + https://community.bistudio.com/wiki/hcShownBar - Object curatorCoef String + hcShownBar - curatorObj curatorCoef action + hcShownBar - $Code$curatorModule curatorCoef "Place"$/Code$ + $Code$if ( hcShownBar ) then { hint "HC bar is active";};$/Code$ undefined / undefined @@ -16385,117 +17256,130 @@ - Number + Boolean + - curatorEditableObjects + camPreparePos - Returns all editable objects which belong to a curator. + Prepares the camera position (format Position ). - https://community.bistudio.com/wiki/curatorEditableObjects + https://community.bistudio.com/wiki/camPreparePos - curatorEditableObjects Object + Object camPreparePos Array - curatorEditableObjects curatorObj + camera camPreparePos position - $Code$_objects = curatorEditableObjects myCurator;$/Code$ + $Code$_camera camPreparePos getPos player$/Code$ - global / undefined + undefined / undefined - Array + Nothing + - curatorEditingAreaType + enableRadio - Returns type of edit areas assigned to curator (blacklist/whitelist). + Enable and disable radio messages to be heard and shown in the left lower corner of the screen. This command can be helpful during cutscenes. - https://community.bistudio.com/wiki/curatorEditingAreaType + https://community.bistudio.com/wiki/enableRadio - curatorEditingAreaType Object + enableRadio Boolean - curatorEditingAreaType obj + enableRadio state - + $Code$enableRadio false$/Code$ + - undefined / undefined + undefined / local + (7 August, 2008) + This command doesn't disable text-chat in multiplayer. + + (11 September, 2008) + Does not affect VON. - Boolean + Nothing + - curatorEditingArea + enableEndDialog - Returns all curator editing areas. + Enables the execution of a custom camera sequence after the players death, coded in the script onPlayerKilled.sqs. - https://community.bistudio.com/wiki/curatorEditingArea + https://community.bistudio.com/wiki/enableEndDialog - curatorEditingArea Object + enableEndDialog - curatorEditingArea curatorObj + enableEndDialog - $Code$_editingArea = curatorEditingArea myCurator;$/Code$ - + - undefined / undefined + undefined / local - Array + Nothing + - curatorMouseOver + canVehicleCargo - Returns Curator Editable Object under curator mouse pointer in form of array: - [] - when not in curator mode - [""] - if no curator editable object under the pointer in curator mode - [ typeName, Curator Editable Object ] - if there is curator editable object under the pointer in curator mode + Returns bool array if it is possible to load cargo inside vehicle and if possible to load cargo into empty vehicle - https://community.bistudio.com/wiki/curatorMouseOver + https://community.bistudio.com/wiki/canVehicleCargo - curatorMouseOver + Object canVehicleCargo Object - curatorMouseOver + vehicle canVehicleCargo cargo - $Code$_mouseOver = curatorMouseOver ; - // possible return value:[ - "OBJECT", - 3594ab00# 164218: apc_wheeled_01_cannon_f.p3d - ]$/Code$ + $Code$// Blackfish with no vehicle cargo loaded + _result = blackfish canVehicleCargo offroad; //[true, true]$/Code$ + + $Code$// Blackfish with one vehicle cargo called offroad already loaded + _result = blackfish canVehicleCargo offroad; //[false, false] + + // Even if the Blackfish was empty offroad can't be loaded because it's already in a cargo space$/Code$ + + $Code$// Blackfish with one vehicle cargo called offroad already loaded + _result = blackfish canVehicleCargo offroad2; //[false, true] + + // offroad2 can't be loaded because there isn't enough space in the Blackfish, but if there was space offroad2 could be loaded into the Blackfish$/Code$ undefined / undefined @@ -16503,82 +17387,97 @@ - Array + Array + - curatorPoints + addWeaponCargoGlobal - Returns number of points that curator have. Points can be only in range from 0 to 1. + Add weapons to the cargo space of vehicles, which can be taken out by infantry units. + MP Synchronized - https://community.bistudio.com/wiki/curatorPoints + https://community.bistudio.com/wiki/addWeaponCargoGlobal - curatorPoints Object + Object addWeaponCargoGlobal Array - curatorPoints curatorObj + vehicleName addWeaponCargoGlobal [weaponName, count] - $Code$_points = curatorPoints myCurator;$/Code$ + $Code$_truck addWeaponCargoGlobal["M16",5];$/Code$ - undefined / undefined + global / global + (November 7, 2011) + Synchronized to JIP as well. - Number + Nothing + - curatorRegisteredObjects + closeDisplay - Returns array with all objects that has curator registered and their settings. + Close given display with exit code. Most common exit codes are: + $Code$#define IDC_OK 1 //emulate "Ok" button$/Code$ + $Code$#define IDC_CANCEL 2 //emulate "Cancel" button$/Code$ - https://community.bistudio.com/wiki/curatorRegisteredObjects + https://community.bistudio.com/wiki/closeDisplay - curatorRegisteredObjects Object + Display closeDisplay Number - curatorRegisteredObjects curatorObj + display closeDisplay exitcode - + $Code$_display closeDisplay 1;$/Code$ + + $Code$#define IDC_OK 1 + _display closeDisplay IDC_OK;$/Code$ + undefined / undefined + (November 18, 2015) + closeDisplay does not instantly close the display but does it on next display simulation cycle (when display becomes active) - Array + Nothing + - curatorSelected + diag_recordTurretLimits - Returns list of all curator selected items. + Start recording tool for creating turret aiming limits. + Command is only available when using Arma 3 Diagnostics Exe on Dev-Branch. - https://community.bistudio.com/wiki/curatorSelected + https://community.bistudio.com/wiki/diag_recordTurretLimits - curatorSelected + diag_recordTurretLimits Boolean - curatorSelected + diag_recordTurretLimits section - $Code$selectedItems = curatorSelected ;$/Code$ + $Code$diag_recordTurretLimits true;$/Code$ undefined / undefined @@ -16586,54 +17485,65 @@ - Array + Nothing + - curatorWaypointCost + markerPos - Return current price for placing waypoints (curator specific). + Get marker Position. Note: This function is identical to getMarkerPos. - https://community.bistudio.com/wiki/curatorWaypointCost + https://community.bistudio.com/wiki/markerPos - curatorWaypointCost Object + markerPos String - curatorWaypointCost curatorObj + markerPos markerName - + $Code$_mPos = markerPos "markerOne";$/Code$ + - undefined / undefined + global / undefined + (March 17, 2014) + Position's Z coordinate will always be 0." - Number + Array + - current3DENOperation + uniformContainer - Returns the currently performed editing operation in Eden Editor. + Returns a cargo container of a unit's uniform. - https://community.bistudio.com/wiki/current3DENOperation + https://community.bistudio.com/wiki/uniformContainer - current3DENOperation + uniformContainer Object - current3DENOperation + uniformContainer unit - $Code$if ( current3DENOperation == "Move") then { hint "Moving";};$/Code$ + $Code$hint str uniformContainer player ; //2df7dd00# 163941: dummyweapon.p3d$/Code$ + + $Code$hint str getMagazineCargo uniformContainer player ; + // [ + //["30Rnd_65x39_caseless_mag"], + //[3] + //]$/Code$ undefined / undefined @@ -16641,90 +17551,106 @@ - String + Object + - currentChannel + enableWeaponDisassembly - Returns currently selected user chat channel on the UI (selected with and in MP). Correspondence between channel and number: - 0 = Global - 1 = Side - 2 = Command - 3 = Group - 4 = Vehicle - 5 = Direct - 6-15 = Custom Radio (see radioChannelCreate ) + Enables or disables disassembly of static weapons. Could be applied to local player, to another unit or to static weapon directly. - https://community.bistudio.com/wiki/currentChannel + https://community.bistudio.com/wiki/enableWeaponDisassembly - currentChannel + enableWeaponDisassembly Boolean + + Object enableWeaponDisassembly Boolean - currentChannel + enableWeaponDisassembly enable + + entity enableWeaponDisassembly enable - $Code$_selected = currentChannel ; // 3 - for example for the Group$/Code$ + $Code$enableWeaponDisassembly false ;$/Code$ + + $Code$soldier1 enableWeaponDisassembly false ;$/Code$ + + $Code$mortar1 enableWeaponDisassembly false ;$/Code$ - undefined / undefined + global / global - Number + Nothing - Nothing + - currentCommand + commander - Return the current command type (empty string when no command) for the commander of given vehicle (or for a given soldier). Value returned can be one of: - "WAIT", "ATTACK", "HIDE", "MOVE", "HEAL", "REPAIR", "REFUEL", "REARM", "SUPPORT", "JOIN", "GET IN", "FIRE", "GET OUT", "STOP", "EXPECT", "ACTION", "ATTACKFIRE", + In OFP it returns the commander of a vehicle. Since ArmA and VBS2 it returns the primary observer. The commander of a vehicle can be found with effectiveCommander. - https://community.bistudio.com/wiki/currentCommand + https://community.bistudio.com/wiki/commander - currentCommand Object + commander Object - currentCommand vehicleName + commander vehicleName - + $Code$moveOut commander _tank;$/Code$ + + $Code$// Detect if player is in commander turret of a vehicle: + _isVehicleCommander = player isEqualTo commander objectParent player ;$/Code$ + - undefined / undefined + global / undefined + (August 3, 2006) + Notes from before the conversion: + It is also possible to find the commander of a vehicle by placing a C after the name of the vehicle so Tank1C and commander Tank1 both refer to the same unit, providing the original commander has not got out of the tank. + The difference between the two is Tank1C is always the unit that was commander of the tank when the mission started, whilst commander Tank1 is the commander which is now there. + + (August 3, 2006) + WARNING about Hardrock note: + Take very care about this : if you give a vehiculeVarName to one crew, so his referent will not be Tank1x anymore ! Also, if in the mission editor, you put something in the name field, when this soldier will getin a vehicle, it will not be a Tank1x too. So do not take consideration about Hardrock note, if you don't want to have bad surprise. It Is better to force names by using setVehicleVarName command. + $Code$(( crew tank) select 0) setVehicleVarName "Tankcrew0"$/Code$ - String + Object + - currentMagazineDetailTurret + taskAlwaysVisible - Returns the class name of currently used magazine on specified turret. Use turret path [-1] for driver's turret. Note that a turret is not loaded until unit enters it, so this command will return "". + Returns true if the task is flagged to be always visible or false if not. - https://community.bistudio.com/wiki/currentMagazineDetailTurret + https://community.bistudio.com/wiki/taskAlwaysVisible - Object currentMagazineDetailTurret Array + taskAlwaysVisible Task - vehicle currentMagazineDetailTurret [turret path] + taskAlwaysVisible task - $Code$_magazineDetail = MBT_Kuma currentMagazineDetailTurret [0];$/Code$ + $Code$_isAlwaysVisible = taskAlwaysVisible ( currentTask player );$/Code$ undefined / undefined @@ -16732,60 +17658,63 @@ - String + Boolean + - currentMagazineDetail + triggerTimeout - Returns description of vehicle's currently loaded magazine, its ammo count (current/default) and its id. + Returns trigger timeout in the form [min, mid, max, interruptable]. + Note: The trigger could be local or remote but the result returned by this command will be for the trigger condition set up locally on the client that executed the command. See createTrigger for more info. - https://community.bistudio.com/wiki/currentMagazineDetail + https://community.bistudio.com/wiki/triggerTimeout - currentMagazineDetail Object + triggerTimeout Object - currentMagazineDetail vehicle + triggerTimeout trigger - $Code$_currentMagazineDetail = currentMagazineDetail player ; //"6.5mm 30Rnd STANAG Mag(30/30)[id:0]"$/Code$ - - $Code$_currentMagazineDetail = currentMagazineDetail Mi_48; //"30mm HE Shells(250/250)[id:21]"$/Code$ - - $Code$_cmd = currentMagazineDetail player ; //"9mm 16Rnd Mag(13/16)[id/cr:10000011/0]" - _cmd splitString "([ ]/:)"; //["9mm","16Rnd","Mag","13","16","id","cr","10000011","0"]$/Code$ - + - undefined / undefined + global / local - String + Array + - currentMagazineTurret + getFSMVariable - Returns the name of the type of the currently using magazine on specified turret. Use turret path [-1] for driver's turret. Note that a turret is not loaded until unit enters it, so this command will return "". + Return the value of variable in the variable space of given FSM. The FSM handle is the number returned by the execFSM command. - https://community.bistudio.com/wiki/currentMagazineTurret + https://community.bistudio.com/wiki/getFSMVariable - Object currentMagazineTurret Array + Number getFSMVariable String + + Number getFSMVariable Array - vehicle currentMagazineTurret [turret path] + FSMhandle getFSMVariable name + + FSMhandle getFSMVariable [name, defaultValue] - $Code$_magazine = MBT_Kuma currentMagazineTurret [0];$/Code$ + $Code$_handle getFSMVariable "_foo";$/Code$ + + $Code$_handle getFSMVariable ["_foo", 123];$/Code$ undefined / undefined @@ -16793,60 +17722,61 @@ - String + Anything - Anything + - currentMagazine + group - Returns class name of currently loaded vehicle's magazine. + Returns the group a unit is assigned to. - https://community.bistudio.com/wiki/currentMagazine + https://community.bistudio.com/wiki/group - currentMagazine Object + group Object - currentMagazine vehicle + group object - $Code$_magazineClass = currentMagazine player ;//Example: "30Rnd_545x39_AK"$/Code$ + $Code$_playerGrp = group player$/Code$ - undefined / undefined + global / undefined - (October 4, 2010) - See notes of currentWeapon. + (August 19, 2006) + Few rules about group in OFP:R. + 1) When last man in group die or is moved to other group, group will be destroyed, and it can't be used anymore. + 2) 1st man joined to empty group will be group leader. - String + Group + - currentMuzzle + deleteMarker - Returns current muzzle of unit's weapon. - This command will return 0 Number if given object is a vehicle instead of a person. + Destroys the given marker. - https://community.bistudio.com/wiki/currentMuzzle + https://community.bistudio.com/wiki/deleteMarker - currentMuzzle Object + deleteMarker String - currentMuzzle gunner + deleteMarker name - $Code$_muzzle = currentMuzzle player ;$/Code$ - - $Code$_muzzle = currentMuzzle ( gunner ( vehicle player ));$/Code$ + $Code$deleteMarker "Marker1"$/Code$ undefined / undefined @@ -16854,27 +17784,28 @@ - String + Nothing + - currentNamespace + addWeaponPool - Returns current global namespace the script runs in. + Add weapons to the weapon pool, of which the player may choose in the following mission. Available in campaigns only. - https://community.bistudio.com/wiki/currentNamespace + https://community.bistudio.com/wiki/addWeaponPool - currentNamespace + addWeaponPool Array - currentNamespace + addWeaponPool [weaponName, count] - $Code$if ( currentNamespace isEqualTo uiNamespace ) then { hint "This is uiNamespace"};$/Code$ + $Code$addWeaponPool ["M16",5];$/Code$ undefined / undefined @@ -16882,288 +17813,310 @@ - Namespace + Nothing + - currentTasks + getAllHitPointsDamage - List all uncompleted tasks. + Returns 3 arrays for easy cross reference: 1st - array of hit point names, 2nd - array of hit selection names, 3rd - array of damage values. All values in all arrays are ordered accordingly to hit part index for convenience and for use in setHitIndex and getHitIndex. Levels of damage are: + 0: no damage + 1: full damage - https://community.bistudio.com/wiki/currentTasks + https://community.bistudio.com/wiki/getAllHitPointsDamage - currentTasks Team_Member + getAllHitPointsDamage Object - currentTasks member + getAllHitPointsDamage entity - $Code$_playerTasks = currentTasks teamMember player$/Code$ + $Code$getAllHitPointsDamage player ; + //[ + //["HitFace","HitNeck","HitHead","HitPelvis","HitAbdomen","HitDiaphragm","HitChest","HitBody","HitArms","HitHands","HitLegs"], + //["","neck","head","pelvis","spine1","spine2","spine3","body","","hands","legs"], + //[0,0.0939002,0.0319932,0.0858595,0.174491,1,1,0.168495,1,0.5,0.195907] + //]$/Code$ - undefined / undefined + global / undefined - Array + Array + - currentTask + enableGunLights - Return current task of given person. + Force the AI to use gun lights - https://community.bistudio.com/wiki/currentTask + https://community.bistudio.com/wiki/enableGunLights - currentTask Object + Object/Group enableGunLights Boolean - currentTask person + thing enableGunLights value - + $Code$_grp enableGunLights true$/Code$ + + $Code$_unit enableGunLights true$/Code$ + - undefined / undefined + local / global + (27 July, 2011) + This command can be used to force lights on, but not to force lights off. ( Source ) + + (17 April, 2013) + In order for this command to work in ARMA 3 you should use groupname enableGunLights "AUTO" or soldierOne enableGunLights "AUTO". Other options are "forceOn" or "forceOff". ( Source ) - Task + Nothing + - currentThrowable + initAmbientLife - Returns currently selected throwable, which will be launched if user presses "G". - Please note: The weapon/magazine id system is W.I.P. and may change without notice. + Initialize the ambient life. - https://community.bistudio.com/wiki/currentThrowable + https://community.bistudio.com/wiki/initAmbientLife - currentThrowable Object + initAmbientLife - currentThrowable player + initAmbientLife - $Code$currentThrowable player ; //["SmokeShellGreen","SmokeShellGreenMuzzle",[1.00002e+007,0]]$/Code$ - - $Code$_ct = currentThrowable player ; //["HandGrenade","HandGrenadeMuzzle",[1e+007,0]] - _id = (_ct select 2 select 0) - 10000000; //18$/Code$ - + undefined / undefined - Array + Nothing + - currentVisionMode + format - Returns current vision mode of unit's weapon. - 0 - daytime - 1 - night vision - 2 - thermal vision + Composes a string containing other variables or other variable types. Converts any variable type to a string. If you want to convert a string back to a number, use parseNumber. NOTE that output of this command is limited to ~8Kb. joinString on the other hand doesn't have such limit. - https://community.bistudio.com/wiki/currentVisionMode + https://community.bistudio.com/wiki/format - currentVisionMode Object + format Array - currentVisionMode unit + format [formatString, var1, var2] - $Code$_currMode = currentVisionMode gunner _tank$/Code$ + $Code$format ["Player:%1, player's side:%2", player, side player ]; + // returns "Player:WEST 1-1-A:1 (Username), player's side:WEST"$/Code$ - $Code$if ( currentVisionMode player == 1) then - { - hint "nightvision active"; - };$/Code$ + $Code$player addEventHandler ["HandleDamage", { + hint format ["You just sustained %1%2 damage!", ceil (( _this select 2) * 100), "%"]; + }]; + // hints "You just sustained 20% damage!"$/Code$ - global / undefined + undefined / undefined - (April 29, 2016) - The return value is somewhat erratic for UAVs. For example, if you are connected to a UAV, with the turret set to thermal vision and PIP feed enabled, "currentVisionMode gunner _uav" returns 2 when controlling the turret, but returns 0 after releasing control, even thought the PIP feed is still in thermal mode. WIth nightvision, it will return 1 whether or not you are controlling the turret, but if you switch from 1st to 3rd person before releasing control, then it returns 0 afterwards... + The maximum number of characters returned by the format command seems to depend on the total byte count. For plain ASCII strings the limit is 2048 characters. + + In Arma 3 the max length of String returned by format command seems to be 8191 characters. formatText doesn't seem to have this limitation. + + (March 28, 2015) + In addition to the note above, formatTexted strings are Structured Text, hence cannot be used like formatted strings (with most scripting commands). A workaround to get strings of type String with more than 8191 characters is: $Code$ str formatText ["%1", _string]$/Code$ + + (January 2, 2016) + In addition to the note above, you may consider using joinString instead of format or formatText workaround. joinString is a fraction faster than format and it has no limit on the length of the string (apart from global String limit obviously) - Number + String + - currentWaypoint + editObject - Return the index of the current waypoint. - To determine the validity of the index, compare it to the waypoints count. - If all waypoints are 'completed', then the index is 1 greater than the last valid index. - If there are no waypoints, then the index is 0. - By default, a group has 1 waypoint at their starting position, which is considered completed and so the currentWaypoint is 1. + Show the edit object dialog for the given object. + i + Some Old Editor Command - https://community.bistudio.com/wiki/currentWaypoint + https://community.bistudio.com/wiki/editObject - currentWaypoint Group + Control editObject String - currentWaypoint groupName + map editObject object - $Code$_index = currentWaypoint group player ;$/Code$ - + undefined / undefined - Number + Any_Value + - currentWeaponMode + addBackpack - Returns current weapon mode of unit's weapon. Result can be: "Single", "Burst", "FullAuto", "manual", "player" - This command will return 0 Number if given object is a vehicle instead of a person. + Adds a backpack for a unit. If a unit already has a backpack, the old backpack will be placed on the ground under the unit. + Classname list of available backpacks : + Arma 2 OA backpacks + Arma 3 backpacks - objects starting with "B_", starts with " B_AssaultPack_khk " - https://community.bistudio.com/wiki/currentWeaponMode + https://community.bistudio.com/wiki/addBackpack - currentWeaponMode Object + Object addBackpack String - currentWeaponMode gunner + unit addBackpack packClassName - $Code$_weaponMode = currentWeaponMode player ;$/Code$ + $Code$this addBackpack "TK_RPG_Backpack_EP1";$/Code$ - $Code$_weaponMode = currentWeaponMode gunner vehicle player ;$/Code$ + $Code$_mySoldierDude addBackpack "US_Patrol_Pack_EP1";$/Code$ - undefined / undefined + local / global - (September 27, 2014) - - Be careful using this in script. This function returns these strings but also: - - 0 if unit is in a vehicle (pax), - - absolutely nothing if AH-99 helo driver or all weapons removed, - - "truckhorn2" if Hunter driver... - Absolutely nothing means: if you use a hint to display the returned value, you obtain absolutely no text,no black box, no error! Hint isn't displayed and there is no error in rpt file with compile preprocessFileLineNumbers. - On the other hand, returned value 0 when unit is pax of a vehicle, could lead to a variable error type if your script is waiting for a string. - String + Nothing + - currentWeaponTurret + playMusic - Returns the name of the currently selected weapon on specified turret. Use turret path [-1] for driver's turret. + Plays music defined in Description.ext#CfgMusic or config.cpp. To stop the music execute playMusic "" or give the start time which is beyond the music duration playMusic ["SomeMusic", 1000]; + For Arma 3 music, see Arma 3 CfgMusic. Since Arma 3 v1.67 one can use Jukebox Utility to preview in-game music. - https://community.bistudio.com/wiki/currentWeaponTurret + https://community.bistudio.com/wiki/playMusic - Object currentWeaponTurret Array + playMusic String + + playMusic Array - vehicle currentWeaponTurret [turret path] + playMusic name + + playMusic [name, start] - $Code$_weapon = MBT_Kuma currentWeaponTurret [0];$/Code$ + $Code$playMusic "RadioAmbient1";$/Code$ + + $Code$playMusic ["RadioAmbient3", 3]; //start from 00:00:03$/Code$ + + $Code$// Play from 00:00:01 to 00:00:05 + 0 = [] spawn { + playMusic ["RadioAmbient5", 1]; + sleep 4; + playMusic ""; + };$/Code$ - undefined / undefined + undefined / local + You can get all Music Types from Arma:_cfgMusic + http://community.bistudio.com/wiki/Arma_2:_Music#top - String + Nothing - Nothing + - currentWeapon + setWaypointPosition - Return the name of the currently selected weapon (on the primary turret for vehicles). + Moves the waypoint to a random position in a circle with the given center and radius. - https://community.bistudio.com/wiki/currentWeapon + https://community.bistudio.com/wiki/setWaypointPosition - currentWeapon Object + Array setWaypointPosition Array - currentWeapon vehicle + waypoint setWaypointPosition [center, radius] - $Code$_weaponClass = currentWeapon (vehicle player);//Example: "M16A2GL"$/Code$ - - $Code$_weaponClass = currentWeapon player;$/Code$ + $Code$[_grp, 2] setWaypointPosition [ position player, 0];$/Code$ undefined / undefined - (July 15, 2009) - You have to make a little delay (sleep 0.001; (not less)) to use this command, else you will be returned an empty string. - - (July 15, 2009) - It seems it's not working in 1.02 for other unit than player. - - (May 4, 2010) - This works for vehicles providing there is a gunner - String + Nothing + - currentZeroing + actionName - Returns zeroing of unit's weapon. + Returns localized name of action. - https://community.bistudio.com/wiki/currentZeroing + https://community.bistudio.com/wiki/actionName - currentZeroing Object + actionName String - currentZeroing gunner + actionName action - $Code$_zeroing = currentZeroing player ;$/Code$ + $Code$actionName "ReloadMagazine"$/Code$ undefined / undefined @@ -17171,402 +18124,299 @@ - Number + String + - cursorObject + ctSetData - Returns the object under cursor. This command is quite different from cursorTarget as it is more precise in determining the boundaries of the pointed at object and can detect a larger variety of objects including map objects and trees. + Associates metadata (string) with the row determined by the index. Returns Nothing. - https://community.bistudio.com/wiki/cursorObject + https://community.bistudio.com/wiki/ctSetData - cursorObject + Control ctSetData Array - cursorObject + ctrl ctSetData [index, data] - $Code$hint str [ getModelInfo cursorObject, typeOf cursorObject ];$/Code$ + $Code$_control ctSetData [0, "Test"];$/Code$ - undefined / undefined + local / local - (March 23, 2015) - If you point at the primary weapon of an infantry unit, cursorObject will return the p3d of the weapon instead of the unit itself (B Alpha 1-2:1.. or its variable name ). That doesn't occur for anything else (backpack or headgear). - Object + Nothing + - cursorTarget + hideBody - Returns the target pointed at by the player (usually with cross-hairs). The target has to be known to the player to some degree ( knowsAbout 0). If target is completely unknown, command returns objNull. - A valid target could belong to an enemy or a friendly side. Buildings are normally known to player and so are valid targets. Try nearTargets to see what else is considered a target. While friendly targets are usually known to the player, enemy targets can be totally unknown, especially if "auto-spotting" (or sometimes called "auto-reporting") is switched off. To check if auto-spotting is enabled: difficultyEnabled "autospot" - cursorTarget also returns locked target for the duration of the lock even if there is another target under the cursor. As soon as missile is fired, cursorTarget switches to current known target under cursor or objNull. Targeting (currently "T" in Arma 3) works regardless of the state of "auto-spotting". - Adding a target to the known list could be done with reveal command. When auto-spotting is enabled, zooming on the enemy target with cross-hairs usually reveals the target. As friendly targets are always known, zooming on friendly target could improve knowsAbout value. - Side relations can also influence target knowledge. For example east target is unknown target for civilian, but making them friends with setFriend instantly improves civilian knowledge of the east. + Hides dead body of the given unit. After a short delay, the body slowly sinks into the ground. After awhile, when group of the unit becomes grpNull, the body gets deleted and becomes objNull. If applied to alive unit, nothing happens until unit dies, then the unit's body gets hidden. If a dead unit is human player, the body is hidden but not deleted until player respawns. - https://community.bistudio.com/wiki/cursorTarget + https://community.bistudio.com/wiki/hideBody - cursorTarget + hideBody Object - cursorTarget + hideBody unit - $Code$alive cursorTarget ;$/Code$ + $Code$hideBody player1;$/Code$ - undefined / undefined + local / global - (01:25, 18 February 2011 (CET)) - If the player is in a vehicle and a lockable weapon is selected and a target is locked, the locked target will be returned, regardless if it's in sight or not. - - (11 March 2011) - Addition to Myke's note: - It also works for infantry with launchers that canLock, like Javelin or AA. - Only the lock cursor must be visible on the target - not a full lock necessarily. - - (13:09, 11 July 2009 (CEST)) - Player must knows about what he is pointing to for this command to return something other than NULL-OBJECT - This command doesn't work through building windows - This recognition doesn't work with every object : soldiers, vehicles, big houses are ok, but not trees, plants, road signs or others little things - - (22:11, 23 August 2013 (CEST)) - To add to Lou Montana's note, use reveal command on the object you want to be detected with cursorTarget when pointing at it. Without it, distant units are most likely to return objNull even if you shoot and hit them. Units that have been previously subjected to enableSimulation false; or enableSimulationGlobal false; may stay unrecognised for a long time even after simulation was re-enabled, returning objNull as cursorTarget. Force revealing units with reveal command usually solves the problem. For example: $Code${ player reveal _x} forEach allUnits ;$/Code$ - - (December 3, 2014) - cursorTarget seems to change when your cursor enters an object's boundingBox. Because of this, if the player is inside the boundingBox, the object will always be the current cursorTarget if the player is not looking at another object, although sometimes the object will remain the cursorTarget even if the player does. - - (April 21, 2015) - Cursortarget will not return enemy units, even very close, if "autoreport" is disabled in game difficulty settings, and if player is alone. - However, when enemy units open fire on player, the cursortarget becomes functional on these units. If player is in a group, cursortarget is also functional (report by other units). - - (February 5, 2016) - CursorTarget will return a Null_Object for all of thus which have a disabled simulation (_object enableSimulation false). - Object + Nothing + - customChat + rainbow - Sends the chat message to the custom radio channel. The radio channel needs to be created on the server before hand, with radioChannelCreate command. + Returns the current rainbow intensity. - https://community.bistudio.com/wiki/customChat + https://community.bistudio.com/wiki/rainbow - Object customChat Array + rainbow - unit customChat [channel, message] + rainbow - $Code$_unit customChat [1, "Hi, I am a custom chat message"];$/Code$ - - $Code$driver vehicle player sideChat "sideChat"; - driver vehicle player globalChat "globalChat"; - driver vehicle player groupChat "groupChat"; - vehicle player vehicleChat "vehicleChat"; - driver vehicle player commandChat "commandChat"; - driver vehicle player customChat [1, "customChat"]; - systemChat "systemChat";$/Code$ - + - global / local + undefined / undefined - Nothing + Number + - customRadio + setName - Sends the message to the custom radio channel. The message is defined in the description.ext file or radio protocol. + Sets the name of a location or a person. In Arma 3 this can be used to set name of a person but only in single player. - https://community.bistudio.com/wiki/customRadio + https://community.bistudio.com/wiki/setName - Object customRadio Array + Object setName String + + Object setName Array + + Location setName String - unit customRadio [channel, message] + object setName name + + unit setName [name, firstName, lastName] + + location setName name - $Code$_soldierOne customRadio [1, "WordEnemy"];$/Code$ + $Code$myLocation setName "My Location Name";$/Code$ + + $Code$player setName "New Name";$/Code$ + + $Code$player setName ["Ben Kerry","Ben","Kerry"];$/Code$ - global / local + undefined / local - (December 3, 2016) - To transmit user custom sounds (see Multiplayer_Custom_Sounds_Tutorial ), prefix the full filename including file extension with #. For example if there is a custom user sound file called MySound.ogg, to play it on the radio use: - $Code$ player customRadio [1, "#MySound.ogg"];$/Code$ + (July 9, 2010‎) + Appears to be only for the 3d editor. + + (September 19, 2013‎) + Support of a person as the first parameter from Arma 3 v. 1.02. + + (April 12, 2014) + Seems to have no effect on players in Multiplayer. (ArmA 3 v1.00) + + (August 18, 2014) + Only last name will appear in command bar i.e. this setname _mynameArray will display _mynameArray select 2. If setname is used with a string : this setname "blah", nothing occurs in command bar and default randomized name is displayed. + Dealing with the units' names in a script, _x (in a foreach units group, for example) will return the "object" as B ALFA 4-1:2 or the name written in ai unit name field in editor (if exists). This context is rather a "variable name" for each object (ai) than an "identity name" as given via setname function. - Nothing + Nothing - Nothing - Nothing + - cutFadeOut + setDirection - Terminates the effect in the given layer by fading it out according to the given duration. If named layer used and it doesn't exist, it will be allocated. - For greater efficiency and ease of modability it is recommended to use named layers available with alternative syntax since Arma 3 v1.57.134673 + Set's the orientation of a location. It's area and map icon (if it's type uses an icon) will be rotated to this orientation. - https://community.bistudio.com/wiki/cutFadeOut + https://community.bistudio.com/wiki/setDirection - Number cutFadeOut Number - - String cutFadeOut Number + Location setDirection Number - layer cutFadeOut duration - - layerName cutFadeOut duration + location setDirection direction - $Code$0 cutFadeOut 2;$/Code$ - - $Code$_layer = "layer1" cutFadeOut 2;$/Code$ + $Code$location1 = createLocation ["VegetationPalm", getPos player, 200, 200]; + location1 setText "Benargee's Palm Tree"; + location1 setDirection 45;$/Code$ undefined / undefined - (July 9, 2016) - (ArmA v1.60) - The actual fadeout-duration can be dependent on the duration for the fadein (e.g. specified by cutText ). If the fadein-duration is set to a value less than 1 the fadeout-duration will be the given number multiplied by the fadein-duration. - "test" cutText ["", "BLACK", 0.5, true]; // fadein is 0 - "test" cutFadeout 2; // The actual fadeout-time is 2 * 0.5 = 1 - Nothing - Number + Nothing + - cutObj + deleteTeam - Displays an object defined in the global config in CfgTitles. - For greater efficiency and ease of modability it is recommended to use named layers available with alternative syntax since Arma 3 v1.57.134673 + Destroy given team. - https://community.bistudio.com/wiki/cutObj + https://community.bistudio.com/wiki/deleteTeam - cutObj Array - - Number cutObj Array - - String cutObj Array + deleteTeam Team_Member - cutObj [class, type, speed, showInMap] - - layer cutObj [class, type, speed, showInMap] - - layerName cutObj [class, type, speed, showInMap] + deleteTeam team - $Code$cutObj ["TVSet", "PLAIN"]; - cutObj ["TVSet", "PLAIN", 2]$/Code$ - - $Code$2 cutObj ["Sphere", "PLAIN"];$/Code$ - - $Code$_layer = "layer1" cutObj ["BISLogo", "PLAIN"];$/Code$ + $Code$deleteTeam _team;$/Code$ - undefined / local + undefined / undefined - Nothing - Nothing - Number + Nothing + - cutRsc + exportJIPMessages - Display a resource defined in RscTitles of the mission's Description.ext, the campaign's description.ext or the global config. - For greater efficiency and ease of modability it is recommended to use named layers available with alternative syntax since Arma 3 v1.57.134673 + Export list of JIP to a file. Special: BattlEye's RCON variant of this command is #exportJIPqueue (see also Multiplayer_Server_Commands ) - https://community.bistudio.com/wiki/cutRsc + https://community.bistudio.com/wiki/exportJIPMessages - cutRsc Array - - Number cutRsc Array - - String cutRsc Array + exportJIPMessages String - cutRsc [class, type, speed, showInMap] - - layer cutRsc [class, type, speed, showInMap] - - layerName cutRsc [class, type, speed, showInMap] + exportJIPMessages fileName - $Code$cutRsc ["binocular", "PLAIN"]; - cutRsc ["binocular", "PLAIN", 2]; - cutRsc ["binocular", "PLAIN", 2, false ];$/Code$ - - $Code$2 cutRsc ["binocular", "PLAIN", 2];$/Code$ - - $Code$_layer = "layer1" cutRsc ["binocular", "PLAIN", 2];$/Code$ - - $Code$// Create IGUI display: - "someLayer" cutRsc ["RscTitleDisplayEmpty", "PLAIN"]; - _display = uiNamespace getVariable "RscTitleDisplayEmpty";$/Code$ + $Code$exportJIPMessages "myFileNameWithoutExtension";$/Code$ - undefined / local + undefined / undefined - (30 Jun, 2008) - Using cutRsc (instead of titleRsc ) for a HUD has the benefits of: - having the HUD automatically hide itself when you access the map and redisplay itself after closing the map. - using the 'Direct communication' chat channel messages will not interfere with the HUD by hiding it. - - (17 Oct, 2013) - Regarding removing current resource with cutRsc ["Default", "PLAIN"]. If it does't work and it gives you error message that "Default" is not found, add it by yourself to RscTitles in description.ext so it looks like this: - class RscTitles - { - class Default - { - idd = - 1 ; - fadein = 0 ; - fadeout = 0 ; - duration = 0 ; - } ; - } ; - Alternatively, you can use cutText, yes cutText command to cancel your resources. As Karel Moricky explains: "All 'cut' commands are in the same layer, the same as all 'title' commands are in another one." So to remove cutRsc resource execute cutText on the same layer: - $Code$ cutRsc ["myRsc", "PLAIN"]; //show - cutText ["", "PLAIN"]; //remove$/Code$ - $Code$10 cutRsc ["myRsc", "PLAIN"]; //show - 10 cutText ["", "PLAIN"]; //remove$/Code$ - Also if you use layers would be a good idea to register them with BIS_fnc_rscLayer to avoid possible clashes with other layers: - $Code$("myLayerName" call BIS_fnc_rscLayer ) cutRsc ["myRsc","PLAIN"]; //show - ("myLayerName" call BIS_fnc_rscLayer ) cutText ["","PLAIN"]; //remove$/Code$ - You can also immediately remove resource with cutFadeOut command: $Code$123 cutFadeOut 0;$/Code$ - Nothing - Nothing - Number + Nothing + - cutText + showGPS - Displays a text message in the center of the screen. The text can be displayed on multiple lines by using "\n" new line characters: cutText ["line1\nline2\nline3", "PLAIN"];. Since Arma 3 v1.73.142260 this command supports Structured Text formatting. - For greater efficiency and ease of modability it is recommended to use named layers available with alternative syntax since Arma 3 v1.57.134673 + Shows or hides the GPS receiver on the map screen, if enabled for the mission and you possess the item. (default false ) - https://community.bistudio.com/wiki/cutText + https://community.bistudio.com/wiki/showGPS - cutText Array - - Number cutText Array - - String cutText Array + showGPS Boolean - cutText [text, type, speed, showInMap, isStructuredText] - - layer cutText [text, type, speed, showInMap, isStructuredText] - - layerName cutText [text, type, speed, showInMap, isStructuredText] + showGPS show - $Code$cutText ["","BLACK OUT"]; - cutText ["Hello World!","PLAIN",2];$/Code$ - - $Code$2 cutText ["Hello World!","PLAIN",2];$/Code$ - - $Code$_layer1 = "normal" cutText ["In The Centre","PLAIN"]; - _layer2 = "down" cutText ["At The Bottom","PLAIN DOWN"];$/Code$ - - $Code$// Since Arma 3 v1.73.142260: - cutText [" t color='#ff0000' size='5' RED ALERT! /t br/ ***********", "PLAIN", -1, true, true ];$/Code$ + $Code$showGPS true ;$/Code$ - undefined / local + undefined / undefined - (September 20, 2013) - In Arma 3 "PLAIN" param will display your text where the crosshair is, "PLAIN DOWN" will push the text further down, closer to the bottom of the screen. + (16 Aug, 2009) + In Arma 2, the GPS is now an inventory item. Class path is CfgWeapons- ItemGPS. Use the commands addWeapon and removeWeapon to add or remove it from a unit's inventory. (example: player addweapon "ItemGPS") - (July 6, 2016) - The value for speed has to be greater 0. If 0 is used as speed the default value (1) will be used. - If you want to create an "instant" effect you can use a really small value (e.g. 0.001) + (14 Jun, 2010) + In Arma 2 GPS is also an item, so will not be removed by removeAllWeapons, even though it can be removed by removeWeapon and added by addWeapon. To remove all items use the removeAllItems command (though this will also remove basic items such as map and compass). - Nothing - Nothing - Number + Nothing + - damage + ctrlSetTooltipColorBox - Return the damage value of an object. + Sets tooltip border color of given control. Color is in format Color. - https://community.bistudio.com/wiki/damage + https://community.bistudio.com/wiki/ctrlSetTooltipColorBox - damage Object + Control ctrlSetTooltipColorBox Array - damage object + control ctrlSetTooltipColorBox color - $Code$? (( damage player ) 0.1) : player groupChat "I'm hurt! Medic!"$/Code$ - - $Code$if (( damage player ) 0.1) then { - player groupChat "I'm hurt! Medic!"; - };$/Code$ + $Code$_control ctrlSetTooltipColorBox [1, 0, 0, 1];$/Code$ - global / undefined + undefined / undefined - (February 13, 2015) - The returned value depends on the couple target/ammo fired. This value has no correlation with the sum of all hitpoints damage status and the effective status of the object. Firing bullets on cars often lead to weird results. For example: damage returns zero while a Hunter is fired at will with an.50 HMG! Hunter can be almost destroyed with zero damage for this function. If you script, use instead the getHitPointDamage function. - Number + Nothing + @@ -17614,101 +18464,57 @@ - Number - - - - - date - - - Return the actual mission date and time as an array [ year, month, day, hour, minute ]$/Code$. Month is a full number between 1 and 12, day is between 1 and 31, hour is between 0 and 23 and minute is between 0 and 59. - - - https://community.bistudio.com/wiki/date - - - date - - - date - - - $Code$_now = date ; // _now = [2014,10,30,2,30] (Oct. 30th, 2:30am) - _hour = _now select 3; - _min = _now select 4;$/Code$ - - $Code$if ( date select 3 = 19) then { // 7pm - hintSilent "ah, Arma sunset"; //...cue bad guys - };$/Code$ - - - undefined / undefined - - - - - Array + Number + - daytime + setPylonsPriority - Returns the current ingame time in hours. + Overrides default pylons priorities - https://community.bistudio.com/wiki/daytime + https://community.bistudio.com/wiki/setPylonsPriority - daytime + Object setPylonsPriority Array - daytime + vehicle setPylonsPriority [priority pylon1, priority pylon2,] - $Code$; assumme it is 16:30 - _daytime = daytime - returns 16.5$/Code$ + $Code$( vehicle player ) setPylonsPriority [0,1,2,3,4,5,5,4,3,2,1,0];$/Code$ undefined / undefined - (September 23, 2014) - To change daytime To 24 hour format with hours, minutes, and seconds use this: - $Code$// daytime = 1.66046 - _hour = floor daytime ; - _minute = floor (( daytime - _hour) * 60); - _second = floor ((((( daytime ) - (_hour))*60) - _minute)*60); - _time24 = text format ["%1:%2:%3",_hour,_minute,_second]; - //_time24 = 1:39:37$/Code$ - Note: Not perfect method, "12:03:06" will display as "12:3:6", more script needed to remove this. Other methods might exist for basic functionality. - Number + Nothing + - deActivateKey + getSoundController - Deactivates the given keyname for the current user profile. The keys are used to unlock missions or campaigns. - See keys, keysLimit and doneKeys in the description.ext file of the missions. + Returns value of the given sound controller. - https://community.bistudio.com/wiki/deActivateKey + https://community.bistudio.com/wiki/getSoundController - deActivateKey String + Object getSoundController String - deActivateKey keyname + vehicle getSoundController controller - $Code$deActivateKey "Mission04Key"$/Code$ + $Code$vehicle player getSoundController "rpm"; //600$/Code$ undefined / undefined @@ -17716,27 +18522,28 @@ - Nothing + Number + - debriefingText + allowCuratorLogicIgnoreAreas - Returns debriefing text. + Allows curator placing and working with modules outside of edit areas. - https://community.bistudio.com/wiki/debriefingText + https://community.bistudio.com/wiki/allowCuratorLogicIgnoreAreas - debriefingText String + Object allowCuratorLogicIgnoreAreas Boolean - debriefingText end + curatorObj allowCuratorLogicIgnoreAreas allow - $Code$_deathText = debriefingText "endDeath";$/Code$ + $Code$curatorModule allowCuratorLogicIgnoreAreas true$/Code$ undefined / undefined @@ -17744,146 +18551,266 @@ - String + Nothing + - debugFSM + lineIntersectsObjs - Dump (something about FSM) to debugging output. This command is (assumed to be) non-functional in the retail version. - Non functional in retail + Returns list of objects intersected by given line from begPos to endPos. - https://community.bistudio.com/wiki/debugFSM + https://community.bistudio.com/wiki/lineIntersectsObjs - Number debugFSM Boolean + lineIntersectsObjs Array - FSMhandle debugFSM true + lineIntersectsObjs [begPos, endPos, withObj, ignoreObj, sortByDistance, flags] - undefined / undefined + global / undefined + (Mar 27, 2014) + Example (in ArmA3 ver 1.14) display objects' array in the middle of the screen sorted by 6 flags: + $Code$ + Sto = []; + Fn = { + { + Sto set [_foreachindex, lineIntersectsObjs [( eyePos player ),( ATLtoASL screenToWorld [0.5,0.5]), objNull, objNull, false,_x]]; + } forEach [1,2,4,8,16,32]; + hintSilent format [" + ONLY_WATER: %1, + NEAREST_CONTACT: %2, + ONLY_STATIC: %3, + ONLY_DYNAMIC: %4, + FIRST_CONTACT: %5, + ALL_OBJECTS: %6", + Sto select 0,Sto select 1,Sto select 2,Sto select 3,Sto select 4,Sto select 5]; + }; + ["sample_id","onEachFrame","Fn"] call BIS_fnc_addStackedEventHandler ; + $/Code$ + + (March 29, 2016) + Distance sorting is relative to object model center, and not intersect position. - Nothing + Array + - debugLog + deleteAt - Dump argument type and value to debugging output. - This command is non-functional in the retail version + Removes array element at the given index and returns removed element (modifies the original array, just like resize or set ). Will not issue error when -1 index is passed making it ideal for using with find command (see Example 2) - https://community.bistudio.com/wiki/debugLog + https://community.bistudio.com/wiki/deleteAt - debugLog Any_Value + Array deleteAt Number - debugLog anything + array deleteAt index - $Code$debugLog player$/Code$ + $Code$_arr = [1,2,3]; + _rem = _arr deleteAt 1; + hint str [_rem, _arr]; //[2,[1,3]]$/Code$ + + $Code$_arr = [1,2,3]; + _arr deleteAt (_arr find 0); // non existent item + hint str _arr; // [1,2,3] + _arr deleteAt (_arr find 2); // existent item + hint str _arr; // [1,3]$/Code$ undefined / undefined + (October 15, 2014) + $Code$_array deleteAt 0$/Code$ is almost 60x faster than $Code$_array = _array - [_array select 0]$/Code$ (Tested with an array of 10.000 strings, iterating through it using a for-from-to-do loop) + + (March 4, 2016) + Deleting from an array with foreach and _foreachIndex variable is tricky. The array is being altered, the _foreachIndex won't keep up and other elements in the array will be skipped and in worst case not being deleted. + If you delete elements from an array in descending order (using while or for) it will work. + + (February 9, 2017) + To expand on Highheads comment above - this is because forEach implements iterators to traverse a collection, which are read only by definition. + The variable _x is an iterator that points to the current item in the collection. Trying to alter _x will have no effect. + $Code$ARRAY = [1,2,3,4,5,6,7,8]; + { _x = 2; } forEach ARRAY + // ARRAY is still [1,2,3,4,5,6,7,8]$/Code$ + When trying to use deleteAt inside forEach, the behaviour would be undefined as you are invalidating the iterator reference, and it will not know how to traverse to the next element. + In short, only use forEach when reading data from an array. + For more info about iterators, see C++ Iterators. - Nothing + Anything + - default + moveInGunner - See switch do. + Move soldier into vehicle gunner position (Immediate, no animation). - https://community.bistudio.com/wiki/default + https://community.bistudio.com/wiki/moveInGunner - default Code + Object moveInGunner Object - default a + unitName moveInGunner vehicle - $Code$switch (_condition) do { - case 1: { hint "1" }; - case 2: { hint "2" }; - default { hint "default" }; - };$/Code$ + $Code$soldierOne moveInGunner tankOne$/Code$ - undefined / undefined + local / global + (August 4, 2006) + Notes from before the conversion: + MP Note Functions MoveInGunner can only be called for local soldiers. They will be ignored for remote soldiers. (see Locality in Multiplayer ) + + In OFP v1.96, the moveIn commands will not trigger an associated getIn event. To ensure the getIn event is fired, use the "getIn Gunner" action command. - Nothing + Nothing + - deg + lineIntersectsSurfaces - Convert a number from Radians to Degrees. + Returns list of intersections with surfaces from begPosASL to endPosASL. If there is ground intersection, it is also included. Works on units. Works underwater. Doesn't return intersection with sea surface. Hardcoded max distance: 5000m. By default, for speed purposes, command will return only 1st intersection with unique objects. Since Arma 3 v1.69.140138, this could be tweaked with an optional param. NOTE: if begPosASL is under the ground and endPosASL is above it, the command will only return intersection with the ground, this is engine limitation and none of the intersectXXX commands will work when initiated from under the ground. + Since Arma v1.51.131920 it is possible to indicate primary and secondary LOD to look for intersection. Available options are: + "FIRE" + "VIEW" + "GEOM" + "IFIRE" - ("I" stands for Indirect, almost the same as FIRE) + "NONE" + Default LODs are "VIEW" and "FIRE" - https://community.bistudio.com/wiki/deg + https://community.bistudio.com/wiki/lineIntersectsSurfaces - deg Number + lineIntersectsSurfaces Array - deg x + lineIntersectsSurfaces [begPosASL, endPosASL, ignoreObj1, ignoreObj2, sortMode, maxResults, LOD1, LOD2, returnUnique] - $Code$_degrees= deg 1 - returns 57.295$/Code$ + $Code$_intersections = lineIntersectsSurfaces [ eyePos player, aimPos chopper, player, chopper, true, -1];$/Code$ + + $Code$arrow = "Sign_Arrow_F" createVehicle [0,0,0]; + onEachFrame { + _ins = lineIntersectsSurfaces [ + AGLToASL positionCameraToWorld [0,0,0], + AGLToASL positionCameraToWorld [0,0,1000], + player + ]; + if ( count _ins == 0) exitWith {arrow setPosASL [0,0,0]}; + arrow setPosASL (_ins select 0 select 0); + arrow setVectorUp (_ins select 0 select 1); + hintSilent str _ins; + };$/Code$ + + $Code$// This should detect glass windows and wire fences (since Arma v1.51.131920): + wirefence = "Land_New_WiredFence_5m_F" createVehicle position player ; + arrow = "Sign_Arrow_F" createVehicle [0,0,0]; + onEachFrame { + _ins = lineIntersectsSurfaces [ + AGLToASL positionCameraToWorld [0,0,0], + AGLToASL positionCameraToWorld [0,0,1000], + player, + objNull, + true, + 1, + "GEOM", + "NONE" + ]; + if ( count _ins == 0) exitWith {arrow setPosASL [0,0,0]}; + arrow setPosASL (_ins select 0 select 0); + arrow setVectorUp (_ins select 0 select 1); + hintSilent str _ins; + };$/Code$ - undefined / undefined + global / undefined + (August 27, 2015) + Fast check if object is in a house: $Code$KK_fnc_inHouse = { + lineIntersectsSurfaces [ + getPosWorld _this, + getPosWorld _this vectorAdd [0, 0, 50], + _this, objNull, true, 1, "GEOM", "NONE" + ] select 0 params ["","","","_house"]; + if (_house isKindOf "House") exitWith { true }; + false + }; + onEachFrame { hintSilent str ( player call KK_fnc_inHouse)};$/Code$ + + (January 30, 2016) + This command is useful to place weaponholder (and then spawned weapons) on floor of houses, correcting the spawn position (can_collide) to intersect with floor: + $Code$ + MGI_fnc_setPosAGLS = { + params ["_obj", "_pos"]; + _wh_pos = getPosASL _obj; + _pos set [2, ( ATLtoASL _pos select 2)-10]; + _ins = lineIntersectsSurfaces [_wh_pos, _pos,_obj, objNull, true,1,"VIEW","FIRE"]; + _surface_distance = if ( count _ins 0) then [{(_ins select 0 select 0) distance _wh_pos},{0}]; + _wh_pos set [2, ( getPosASL _obj select 2) - (_surface_distance)]; + _weaponholder setPosASL _wh_pos; + }; + $/Code$ + After the position (_pos) obtained in BIS_fnc_buidingPositions array: + $Code$ + _weaponholder = createVehicle ["groundWeaponHolder", _pos, [], 0, "CAN_COLLIDE"]; + [_weaponholder,_pos] call MGI_fnc_setPosAGLS; + Then fill your weapon holder. + $/Code$ - Number + Array + - delete3DENEntities + setCamShakeParams - Delete given entities in Eden Editor, including anything that can be placed in editor. + Set camera shake parameters. + Will not have any effect until shake is started via addCamShake. - https://community.bistudio.com/wiki/delete3DENEntities + https://community.bistudio.com/wiki/setCamShakeParams - delete3DENEntities Array + setCamShakeParams Array - delete3DENEntities entities + setCamShakeParams [posCoef, vertCoef, horzCoef, bankCoef, interpolation] - $Code$delete3DENEntities ( all3DENEntities select 0); - // removes all objects$/Code$ + $Code$setCamShakeParams [0.1, 1, 1, 1, true];$/Code$ undefined / undefined @@ -17891,321 +18818,393 @@ - Nothing + Nothing + - deleteAt + remoteExec - Removes array element at the given index and returns removed element (modifies the original array, just like resize or set ). Will not issue error when -1 index is passed making it ideal for using with find command (see Example 2) + Asks server to execute given scripted function or script command on given target PC. The environment chosen for the execution is as follows: + Scripted function - scheduled environment ( suspension is allowed, i.e. spawn, execVM ). + Script command - unscheduled environment ( suspension is NOT allowed). + remoteExec can also be used in SP (the same restrictions apply both to SP and MP). For more information about the usage, security features and advanced jip techniques check the remote execution dedicated section. - https://community.bistudio.com/wiki/deleteAt + https://community.bistudio.com/wiki/remoteExec - Array deleteAt Number + Anything remoteExec Array + + remoteExec Array - array deleteAt index + params remoteExec [functionName, targets, JIP] + + remoteExec [functionName, targets, JIP] - $Code$_arr = [1,2,3]; - _rem = _arr deleteAt 1; - hint str [_rem, _arr]; //[2,[1,3]]$/Code$ + $Code$// runs hint "hello" on each connected client + "hello" remoteExec [" hint "];$/Code$ - $Code$_arr = [1,2,3]; - _arr deleteAt (_arr find 0); // non existent item - hint str _arr; // [1,2,3] - _arr deleteAt (_arr find 2); // existent item - hint str _arr; // [1,3]$/Code$ + $Code$// runs hint "hello" on first connected client + "hello" remoteExec [" hint ", 3];$/Code$ + + $Code$// runs hint "hello" everywhere but server + "hello" remoteExec [" hint ", -2];$/Code$ + + $Code$// runs hint "hello" everywhere but server, JIPs the message + // and returns e.g. "3_1" as a unique JIP id + myJipID = "hello" remoteExec [" hint ", -2, true ];$/Code$ + + $Code$// runs hint "hello" everywhere but server, JIPs the message under ID "some_JIP_ID" + // replacing any previous message with this ID in the JIP queue. + "hello" remoteExec [" hint ", -2, "some_JIP_ID"];$/Code$ + + $Code$// runs "someFuncWithNoArgs" on each connected client + remoteExec ["someFuncWithNoArgs"];$/Code$ + + $Code$// removes a message identified by "IamUnique" from the JIP queue + remoteExec ["", "IamUnique"];$/Code$ + + $Code$// all clients will have their ammo set to 1 for their current weapon + { player setAmmo [ primaryWeapon player, 1];} remoteExec [" bis_fnc_call ", 0];$/Code$ + + $Code$// Object obj will have its ammo set to 1 where it is local + [obj,[ primaryWeapon obj, 1]] remoteExec [" setAmmo ", obj];$/Code$ + + $Code$myJipID = "hello" remoteExec ["", 0]; + if ( isNil "myJipID") then { hint "empty function name is not allowed"; };$/Code$ undefined / undefined - (October 15, 2014) - $Code$_array deleteAt 0$/Code$ is almost 60x faster than $Code$_array = _array - [_array select 0]$/Code$ (Tested with an array of 10.000 strings, iterating through it using a for-from-to-do loop) - - (March 4, 2016) - Deleting from an array with foreach and _foreachIndex variable is tricky. The array is being altered, the _foreachIndex won't keep up and other elements in the array will be skipped and in worst case not being deleted. - If you delete elements from an array in descending order (using while or for) it will work. + (June 30, 2015) + While it is true that this function executes the desired scripted command/function by calling it, it does not mean remoteExecCall itself will be executed right away. Therefore, calling remoteExecCall is by no means a replacement for calling scripted commands/functions directly. + Example: + remoteExecCall ["func1"]; call func2; // func2 can be executed sooner than func1 + call func1; call func2; // func2 will always execute after func1. - (February 9, 2017) - To expand on Highheads comment above - this is because forEach implements iterators to traverse a collection, which are read only by definition. - The variable _x is an iterator that points to the current item in the collection. Trying to alter _x will have no effect. - $Code$ARRAY = [1,2,3,4,5,6,7,8]; - { _x = 2; } forEach ARRAY - // ARRAY is still [1,2,3,4,5,6,7,8]$/Code$ - When trying to use deleteAt inside forEach, the behaviour would be undefined as you are invalidating the iterator reference, and it will not know how to traverse to the next element. - In short, only use forEach when reading data from an array. - For more info about iterators, see C++ Iterators. + (December 29, 2015) + remoteExec and remoteExecCall are currently filtered by BattlEye's remoteexec.txt, the string analyzed by BE is formatted the same way as the following example's output: + $Code$ format ["%1 %2", functionName, str params]$/Code$ + If CfgRemoteExec class Functions is set to mode = 1;, the following remoteexec.txt exclusion can be used to safely allow all whitelisted *_fnc_* functions taking an array as parameter to go through: + $Code$!="\w+?_fnc_\w+? \[.*\]"$/Code$ + Any attempt to exploit this exclusion using other RE methods like createUnit will run into "Error Missing ;" without any malicious code being executed. Mod makers should refrain from remote-executing raw commands from clients, as they require individual exclusions, and instead use *_fnc_* functions taking an array as parameter, which are covered by the above exclusion. + + (January 15, 2016) + Executing commands/functions via remoteExec is more faster than using BIS_fnc_MP. Tested with BIS_fnc_codePerformance in ArmA 3 1.52. + $Code$['"string" remoteExec ["hint",player];',[],100] call BIS_fnc_codePerformance ; //Result ~0.1ms$/Code$ + $Code$['["string","hint", player ] call BIS_fnc_MP ;',[],100] call BIS_fnc_codePerformance ; //Result ~0.6ms$/Code$ + + (March 24, 2016) + The INCORRECT way to call reveal command on a certain object for every player: + $Code$[ player, _desired_object] remoteExec ["reveal", 0];$/Code$ + In this case player object will be the object obtained on the computer where remoteExec is initiated. If it is dedicated server, player will be objNull, if it is client, player would be player object on this client. In any case this will not reveal _desired_object for all connected players. + The CORRECT way: + $Code$[_desired_object, { player reveal _this}] remoteExec ["call", 0];$/Code$ + The _desired_object will be identical on every client, this is what we want, but player will refer to individual player on each client, so _desired_object will be revealed to all connected players. + + (May 25, 2016) + When adapting mission from dedicated server for SP, if target used in remoteExec is -2 (execute on every client but not server), in SP this will not execute since client is server in SP. To work around, the target could be set using isMultiplayer condition like this: + $Code$"123" remoteExec ["hint", [0, -2] select isMultiplayer ];$/Code$ + This will execute hint on every client in MP on dedicated server (target -2) and will also execute it in SP (target 0). + + (May 28, 2016) + While KK's solution works fine in sp missions and on dedicated servers, it will not work properly for hosted missions. + Solution: + $Code$[0,0.5] remoteExec [' fadeRadio ',[0,-2] select isDedicated, true ];$/Code$ + Singleplayer: isDedicated returns false - code is executed everywhere (0) + Hosted: isDedicated returns false - code is executed everywhere including host (0) + Dedicated: isDedicated returns true - code is executed everywhere excluding server (-2) + + (Jan 30, 2017) + $Code$[some params] remoteExec ['some command',2,true];$/Code$ + will fail, as you can't use JIP and remoteExec on server only + $Code$[some params] remoteExec ['some command',2]; // works$/Code$ + + (May 10, 2017) + To remoteExec : + $Code$ titleText ["Test Message", "PLAIN", 1];$/Code$ + Use + $Code$[["Test Message", "PLAIN", 1]] remoteExec ["titleText"];$/Code$ - Anything + Anything - Anything + - deleteCenter + east - In a nutshell, this command removes gaming Side (see createCenter ). If a side has 0 Groups it cannot be deleted. Center can only be created for: east, west, resistance, civilian and sideLogic, therefore only centers from the mentioned sides can be deleted. - Old description: Destroys the AI center of the given side. + Pre-defined variable for the eastern side. - https://community.bistudio.com/wiki/deleteCenter + https://community.bistudio.com/wiki/east - deleteCenter Side + east - deleteCenter side + east - $Code$deleteCenter east$/Code$ + $Code$// SQS: + ?((side _unit) == east ) : hint "This is a eastern unit!"$/Code$ + + $Code$// SQF: + if (( side _unit) == east ) then { + hint "This is a eastern unit!"; + };$/Code$ - undefined / global + undefined / undefined + (April 17, 2007) + In ArmA terms OPFOR, BLUFOR, Independents and Civilians are used in the front end UI. - Nothing + Side + - deleteCollection + loadGame - Delete a collection. As example, used with a soldier, it'll hide the ingame model. - When targetting ArmA 2 1.06 or newer, use hideObject instead. This function is a relic from dynamic building destruction development. It is left only for compatibility with scripts created before ArmA 2 1.06, and its functionality may be changed or removed in the future. + Load a game from the autosave. If failed, restart the mission. - https://community.bistudio.com/wiki/deleteCollection + https://community.bistudio.com/wiki/loadGame - deleteCollection Object + loadGame - deleteCollection object + loadGame - $Code$deleteCollection unitName;$/Code$ + $Code$loadGame ;$/Code$ undefined / undefined - (August 20, 2014) - In Arma 3 deleteCollection is alias for hideObject - Nothing + Nothing + - deleteEditorObject + getRelDir - Delete the editor object. Requires all editor object links to be removed prior. - i - Some Old Editor Command + Returns direction, which is relative to object's current direction, from given object to another object or position in the range from 0 to 360, the equivalent of BIS_fnc_relativeDirTo. - https://community.bistudio.com/wiki/deleteEditorObject + https://community.bistudio.com/wiki/getRelDir - Control deleteEditorObject String + Object getRelDir Object/Position2D/Position3D - map deleteEditorObject object + object getRelDir position - + $Code$_reldir = player getRelDir tank;$/Code$ + - undefined / undefined + global / undefined - Any_Value + Number + - deleteGroupWhenEmpty + distance2D - Marks given group for auto-deletion when group is empty. true will mark the group for auto-deletion, however false will only unmark the group that was marked previously. There are other engine group auto-deletion mechanisms in place, which are not affected by this. - NOTE: It might take up to a minute for the groups marked for auto-deletion when empty to get deleted when they become empty. + Returns a 2D distance ( distance projected to X,Y plane) in meters between two Objects or two Positions or Object and Position. - https://community.bistudio.com/wiki/deleteGroupWhenEmpty + https://community.bistudio.com/wiki/distance2D - Group deleteGroupWhenEmpty Boolean + Object/Array distance2D Object/Array - group deleteGroupWhenEmpty delete + param1 distance2D param2 - $Code$_group deleteGroupWhenEmpty true ;$/Code$ + $Code$_meters = player distance2D heli;$/Code$ - global / global + global / undefined - Nothing + Number + - deleteGroup + removeAllMissionEventHandlers - Destroys the given group. Group must be empty and local to the machine executing command. - NOTE: In Arma 3 you can find out locality of the group with local command, unlike with previous games. However owner and setOwner dont work with groups anywhere. The group will always be local to the client that created it, until the client disconnects, then the group becomes local to the server. - In Arma 3 when last unit leaves a group, the group gets auto deleted. Manually deleting all units from a group however, does not auto delete the empty group. To force the group to get auto-deleted when empty use deleteGroupWhenEmpty + Removes all mission event handlers of the given type which were added by addMissionEventHandler. - https://community.bistudio.com/wiki/deleteGroup + https://community.bistudio.com/wiki/removeAllMissionEventHandlers - deleteGroup Group + removeAllMissionEventHandlers String - deleteGroup group + removeAllMissionEventHandlers type - $Code$deleteGroup _groupname$/Code$ + $Code$removeAllMissionEventHandlers "Loaded";$/Code$ - local / global + undefined / undefined - (December 17, 2006) - The deleteGroup Command does not work when there are living members of in the group. It doesn't error, it simply doesn't do anything. - - (07:50, 10 July 2007 (CEST)) - Living or not doesn't matter - you can't delete the group while it contains any units - even dead ones. It takes few seconds until a dead unit is automatically removed from its group. - - (September 12, 2013) - deleteGroup will only delete local groups even if called by server. Say we have a situation where client creates a group and puts a unit there and later unit dies\gets deleted, server will not be able to delete that empty group until client leaves the game and group ownership switches to server - Nothing + Nothing + - deleteIdentity + addItemToVest - Delete an identity (created with saveIdentity ) from the campaign's progress file. + Create new item and store it to soldier's vest. The item can also be a weapon or a magazine. - https://community.bistudio.com/wiki/deleteIdentity + https://community.bistudio.com/wiki/addItemToVest - deleteIdentity String + Object addItemToVest String - deleteIdentity identityName + unit addItemToVest item - $Code$?deleteIdentity "playerIdentity":hint "Delete ok"$/Code$ + $Code$player addItemToVest "itemGPS";$/Code$ + + $Code$player addItemToVest "hgun_Rook40_F";$/Code$ - undefined / local + global / global - Boolean + Nothing + - deleteLocation + synchronizeObjectsAdd - Delete a location. + Add given objects to the unit's list of synchronized objects. - https://community.bistudio.com/wiki/deleteLocation + https://community.bistudio.com/wiki/synchronizeObjectsAdd - deleteLocation Location + Object synchronizeObjectsAdd Array - deleteLocation location + unit synchronizeObjectsAdd [objects] - $Code$deleteLocation myLocation$/Code$ + $Code$_acm = _groupLogic createUnit ["AmbientCombatManager",position player,[],0,"NONE"]; + _acm synchronizeObjectsAdd [player];$/Code$ - undefined / undefined + global / global - Nothing + Nothing + - deleteMarkerLocal + setFlagSide - Destroys the given marker. + Sets flag Side. A flag may be taken by any unit that is enemy to the side that owns the flag. Just like with setFlagTexture, if the command executed where unit is local effect of the command will be global and JIP compatible. - https://community.bistudio.com/wiki/deleteMarkerLocal + https://community.bistudio.com/wiki/setFlagSide - deleteMarkerLocal String + Object setFlagSide Side - deleteMarkerLocal markerName + flag setFlagSide side - $Code$deleteMarkerLocal "Marker1"$/Code$ + $Code$_flag1 setFlagSide east ;$/Code$ + + $Code$// Capturable OPFOR flag: + private _flag = "FlagPole_F" createVehicle position player ; + _flag setFlagTexture "\A3\Data_F\Flags\Flag_CSAT_CO.paa"; + _flag setFlagSide east ;$/Code$ - undefined / local + local / global - (7 January, 2012) - Unproven: I believe that if you use this command on a globally-created marker, and subsequently another machine executes a global command on the same marker (e.g. setMarkerPos), then the marker will be re-created on the machine it was previously deleted on. Can result in confusing marker behaviour. - Nothing + Nothing + - deleteMarker + kbAddTopic - Destroys the given marker. + Register conversation topic to given person. See Conversations for more details. - https://community.bistudio.com/wiki/deleteMarker + https://community.bistudio.com/wiki/kbAddTopic - deleteMarker String + Object kbAddTopic Array - deleteMarker name + person kbAddTopic [topicName, conversationFile, fsmFile, eventHandler] - $Code$deleteMarker "Marker1"$/Code$ + $Code$player kbAddTopic ["myTest", "myTest.bikb", "myTest.fsm", compile preprocessFileLineNumbers "myTest.sqf"];$/Code$ + + $Code$player kbAddTopic ["itsGettingWarm", "weatherTalk.bikb"];$/Code$ undefined / undefined @@ -18213,29 +19212,28 @@ - Nothing + Nothing + - deleteRange + curatorPoints - Removes a range of array elements from the given array (modifies the original array, just like resize or set ). + Returns number of points that curator have. Points can be only in range from 0 to 1. - https://community.bistudio.com/wiki/deleteRange + https://community.bistudio.com/wiki/curatorPoints - Array deleteRange Array + curatorPoints Object - array deleteRange [from, count] + curatorPoints curatorObj - $Code$_arr = [1,2,3,4,5,6]; - _arr deleteRange [1,4]; - hint str _arr; //[1,6]$/Code$ + $Code$_points = curatorPoints myCurator;$/Code$ undefined / undefined @@ -18243,111 +19241,145 @@ - Nothing + Number + - deleteResources + objNull - Delete (unregister) resources of the team member. Resources are deleted in the order they were added. Case insensitive. + A non-existent Object. To compare non-existent objects use isNull or isEqualTo : + objNull == objNull ; // false + isNull objNull ; // true + objNull isEqualTo objNull ; // true - https://community.bistudio.com/wiki/deleteResources + https://community.bistudio.com/wiki/objNull - Team_Member deleteResources Array + objNull - teamMember deleteResources [resource1, resource2,] + objNull - $Code$teamMember _agent deleteResources ["Legs"];$/Code$ + $Code$player == player ; // false if player is null$/Code$ + + $Code$isNull player ; // true if player is null$/Code$ + + $Code$str objNull // NULL-object$/Code$ + + $Code$position objNull // [0,0,0]$/Code$ - global / local + undefined / undefined - Nothing + Object + - deleteSite + setViewDistance - Removes the site. - This command is considered deprecated and is no longer supported + Set rendering distance, in metres. Default is 900m (in OFP) or 1,200m (in ArmA), accepted range is 500m to 5,000m (in OFP) or 10,000m (in ArmA). Setting view distance to = 0 resets the value to the one set in Options- Video- General- Visibility- Overall - https://community.bistudio.com/wiki/deleteSite + https://community.bistudio.com/wiki/setViewDistance - deleteSite Object + setViewDistance Number - deleteSite site + setViewDistance distance - + $Code$setViewDistance 2250;$/Code$ + + $Code$//reset view distance in Arma 3 + setViewDistance -1;$/Code$ + - undefined / undefined + undefined / local + In OFP v1.96, view distance also defines the maximum distance between a unit and any other unit they can know about. Higher view distance will involve more AI simulation cycles for every unit, which causes low performance. + + I tested the above and it seems to apply in Arma 2 as well. AI at a bit above 500m would stop engaging when I lowered the view distance down to 500m and re-engaged when I increased it back. + + In ArmA 2 viewDistance can be set up to 15 km with this command ( while from interface only 10 km ) + + (October 15, 2014) + In Arma 3, Values below 200 have no visible effect. + + (November 20, 2014) + To clarify Bernagee's post, values under 200 have no effect. Tested by setViewDistance below 200, then hint viewDistance. It will not go below 200. Also, as object view distance can only be, at a maximum, the view distance, object view distance will also be reset to 200. + + (June 8, 2015) + Client-side max view distance is limited by the server's view distance. + Tested in Arma 3. - Nothing + Nothing + - deleteStatus + createSite - Delete a status (created with saveStatus ) from the campaign's progress file. + Create a new site. + This command is considered deprecated and is no longer supported - https://community.bistudio.com/wiki/deleteStatus + https://community.bistudio.com/wiki/createSite - deleteStatus String + String createSite Position - deleteStatus statusName + type createSite pos - $Code$? deleteStatus "playerStatus" : "saved status gone from campaign"$/Code$ - + - undefined / global + undefined / undefined + (February 18, 2014) + "CreateSite is an obsolete command from the time in development when Sites were handled separately from other modules. Now they use the modules framework. + If you want a specific Site to be activated during the mission, place it in the editor and use the Condition line in its parameters (the last one)." - Jezuro [1] - Boolean + Object + - deleteTeam + curatorSelected - Destroy given team. + Returns list of all curator selected items. - https://community.bistudio.com/wiki/deleteTeam + https://community.bistudio.com/wiki/curatorSelected - deleteTeam Team_Member + curatorSelected - deleteTeam team + curatorSelected - $Code$deleteTeam _team;$/Code$ + $Code$selectedItems = curatorSelected ;$/Code$ undefined / undefined @@ -18355,197 +19387,149 @@ - Nothing + Array + - deleteVehicleCrew + incapacitatedState - Deletes a member of the crew of a vehicle. Human players cannot be deleted. + Returns the incapacitated state of the given unit. - https://community.bistudio.com/wiki/deleteVehicleCrew + https://community.bistudio.com/wiki/incapacitatedState - Object deleteVehicleCrew Object + incapacitatedState Object - vehicle deleteVehicleCrew unit + incapacitatedState person - $Code$heli deleteVehicleCrew driver heli;$/Code$ + $Code$_result = incapacitatedState player;$/Code$ - global / global + undefined / undefined - (August 31, 2014) - Not quite sure of the exact use of this command. You can delete AI pilot for example with $Code$ deleteVehicle driver heli;$/Code$ but co-pilot will then jump out. If you use $Code$heli deleteVehicleCrew driver heli;$/Code$ co-pilot stays. - - (April 10, 2015) - Using the following code will remove ALL crew from the given vehicle. - $Code${_myvehicle deleteVehicleCrew _x} forEach crew _myvehicle;$/Code$ - Nothing + String + - deleteVehicle + velocity - Deletes an object. Only units inserted in the mission editor and units created during the game's progress can be deleted by this command. Island objects and player units cannot be removed. Deleting a vehicle, which is still being accessed by a running script, can result in a CTD. - NOTE : Actual object deletion, when object becomes objNull, happens on the next frame after command execution, but there are some object modifications that happen immediately. For example if the object is unit in a group, it immediately becomes groupless isNull group _unit; //true + Return velocity (speed vector) of Unit as an array with format [x, y, z]. Units are in metres per second. - https://community.bistudio.com/wiki/deleteVehicle + https://community.bistudio.com/wiki/velocity - deleteVehicle Object + velocity Object - deleteVehicle object + velocity vehicleName - $Code$deleteVehicle _house1;$/Code$ - - $Code${ - _x action ["Eject", car]; - } forEach crew car; - deleteVehicle car;$/Code$ + $Code$_vector = velocity jeep;$/Code$ - $Code$// Objects such as - //test_EmptyObjectForBubbles - //test_EmptyObjectForFireBig - //test_EmptyObjectForSmoke - //create additional emitters that needs to be deleted first before deleting the object itself: - ///--- function to delete test object (MP compatible) - fnc_deleteTestObj = { - _this addMPEventHandler ["MPKilled", { - _this = _this select 0; - { - deleteVehicle _x; - } forEach (_this getVariable ["effects", []]); - if ( isServer ) then { - deleteVehicle _this; - }; - }]; - _this setDamage 1; - }; - ///--- example - [] spawn { - _fire = "test_EmptyObjectForFireBig" createVehicle position player ; - sleep 5; - _fire call fnc_deleteTestObj; - };$/Code$ + $Code$if ( velocity _plane1 select 2 50) then { hint "Aircraft is climbing up too fast!"};$/Code$ - global / global + undefined / undefined - Nothing + Array + - deleteWaypoint + ctrlPosition - Removes the specified waypoint. + Returns the current position of 2D control as [x, y, w, h] array. For 3D control it returns relative [x,y,z]. - https://community.bistudio.com/wiki/deleteWaypoint + https://community.bistudio.com/wiki/ctrlPosition - deleteWaypoint Array + ctrlPosition Control - deleteWaypoint [group, index] + ctrlPosition controlName - $Code$deleteWaypoint [_grp, 2]$/Code$ + $Code$_pos = ctrlPosition _control;$/Code$ - global / global + undefined / undefined - (1 Feb, 2008) - In order to change the behavior of a unit currently following a string of waypoints, it is not enough to use deleteWaypoint. The path of the unit is calculated by the waypoints present at start, and the unit will continue according to the original waypoints even if you delete them by using this command. - To achieve the wanted effect, you should rather use setWPPos to the units current position (thereby stopping the unit), and (after a small delay) use deleteWaypoint to remove the waypoints. - - (15 Nov, 2008) - Another (more foolproof) method to avoid the problem of non-deleteable waypoints is to introduce another group (createGroup) and join all units of the present group. A new group will start without any preset waypoints so you can start setting new WPs all over again. - Old group is "_combatGroup", new group is "_combatGroup2" - $Code$_combatGroup2 = createGroup EAST; - {[_x] joinSilent _combatGroup2} forEach ( units _combatGroup); - _combatGroup2 addWaypoint [ getPos player, 25];$/Code$ - - (January 04, 2011) - When you want to remove all waypoints, do NOT iterate over waypoints _group while trying to delete them (an array is by reference!). Instead use an approach like this: - $Code$ - while {( count ( waypoints _group)) 0} do - { - deleteWaypoint (( waypoints _group) select 0); - };$/Code$ + (May 22, 2017) + If the ctrl is part of a CtrlGroup the returned position is relative to the ctrlGroups position. - Nothing + Array + - detach + show3DIcons - Detaches previously attached with attachTo object. + Toggle the drawing of 3D icons. + i + Some Old Editor Command - https://community.bistudio.com/wiki/detach + https://community.bistudio.com/wiki/show3DIcons - detach Object + Control show3DIcons Boolean - detach object + map show3DIcons bool - $Code$obj1 attachTo [player]; - detach obj1;$/Code$ - + - global / global + undefined / undefined - Nothing + Nothing + - detectedMines + setGroupIconsSelectable - Returns an array of all mines detected by a given side + Sets if group icons raises onclick and onover events. - https://community.bistudio.com/wiki/detectedMines + https://community.bistudio.com/wiki/setGroupIconsSelectable - detectedMines Side + setGroupIconsSelectable Boolean - detectedMines side + setGroupIconsSelectable bool - $Code$detectedMines west ;$/Code$ - - $Code$detectedMines side player ;$/Code$ + $Code$setGroupIconsSelectable true ;$/Code$ undefined / undefined @@ -18553,91 +19537,101 @@ - Array + Object + - diag_activeMissionFSMs + unassignVehicle - Returns array with active Mission FSMs. + Unassigns individual unit from a vehicle, i.e removes assignedVehicleRole of the unit. If the unit is currently in that vehicle, the group leader will issue an order to disembark. - https://community.bistudio.com/wiki/diag_activeMissionFSMs + https://community.bistudio.com/wiki/unassignVehicle - diag_activeMissionFSMs + unassignVehicle Object - diag_activeMissionFSMs + unassignVehicle unitName - $Code${ systemChat str _x} forEach diag_activeMissionFSMs ;$/Code$ + $Code$unassignVehicle player ;$/Code$ + + $Code${ unassignVehicle _x } forEach crew _vehiclename; + // Will make all the occupants of a vehicle disembark$/Code$ - undefined / undefined + local / global + (August 4, 2006) + Notes from before the conversion: + Even though: + {unassignVehicle _x} forEach crew vehiclename + will make all the occupants of a vehicle disembark, if they are the original crew of the vehicle then they will just get back in again. + To prevent this happening also use allowGetIn as in the example below: + {unassignVehicle _x} forEach crew vehiclename; crew vehiclename allowGetIn false - Array + Nothing + - diag_activeSQFScripts + setAccTime - Returns an array with active SQFs. + Set time acceleration coefficient. May be also used to slow time in cutscenes. This command does NOT work in multiplayer. accFactor is clamped to [1/128; 4]. - https://community.bistudio.com/wiki/diag_activeSQFScripts + https://community.bistudio.com/wiki/setAccTime - diag_activeSQFScripts + setAccTime Number - diag_activeSQFScripts + setAccTime accFactor - $Code${ systemChat str _x} forEach diag_activeSQFScripts ;$/Code$ - - $Code$[] spawn { - hint str diag_activeSQFScripts ; //[[" spawn ","",true,1]] - }; - [] spawn { - scriptName "myScript"; - hint str diag_activeSQFScripts ; //[["myScript","",true,1]] - };$/Code$ + $Code$setAccTime 0.1$/Code$ undefined / undefined + (August 4, 2006) + Notes from before the conversion: + A good habit to get into is setting the accTime to 1 at the start of all cutscenes, in case the player is running at 4x speed when the scene starts. - Array + Nothing + - diag_activeSQSScripts + toArray - Returns array with active SQSs. + Converts the supplied String into an Array of Numbers. + The numbers in the created array are the decimal Unicode representations of characters. - https://community.bistudio.com/wiki/diag_activeSQSScripts + https://community.bistudio.com/wiki/toArray - diag_activeSQSScripts + toArray String - diag_activeSQSScripts + toArray string - $Code${ systemChat str _x} forEach diag_activeSQSScripts ;$/Code$ + $Code$hint format["%1",toArray("AaŒ")] + // returns "[65,97,338]"$/Code$ undefined / undefined @@ -18645,94 +19639,95 @@ - Array + Array + - diag_activeScripts + lnbPicture - Returns 4 element array with numbers of currently running scripts in format: [ spawn -ed, execVM -ed, exec -ed, execFSM -ed] + Returns the picture name or path of the item with the given position of the 2D listbox. - https://community.bistudio.com/wiki/diag_activeScripts + https://community.bistudio.com/wiki/lnbPicture - diag_activeScripts + lnbPicture Array + + Control lnbPicture Array - diag_activeScripts + lnbPicture [IDC, [row, column]] + + control lnbPicture [row, column] - $Code$hint str diag_activeScripts ; //[0,0,0,1]$/Code$ + $Code$lnbPicture [200, [1, 1]];$/Code$ + + $Code$_control lnbPicture [1, 1]; //"a3\ui_f\data\gui\cfg\ranks\corporal_gs.paa"$/Code$ - undefined / undefined + local / local - Array + String - String + - diag_captureFrame + setTimeMultiplier - This command starts counting frames from the moment it is executed and when the count reaches the number passed as param, the current frame is captured and captured data UI dialog appears, similar to diag_captureSlowFrame. - This can also be executed on a dedicated Server and because a Server has no UI it will behave like diag_captureFrameToFile. - Special: BattlEye's RCON variant of this command is #captureFrame - Note : Only available in specific builds. See Performance Profiling for details. + Sets a time multiplier for in-game time. The command range is now capped at 0.1 - 120 to avoid performance problems. - https://community.bistudio.com/wiki/diag_captureFrame + https://community.bistudio.com/wiki/setTimeMultiplier - diag_captureFrame Number + setTimeMultiplier Number - diag_captureFrame frame + setTimeMultiplier value - $Code$diag_captureFrame 1; //capture the first frame after command execution$/Code$ + $Code$setTimeMultiplier 60;$/Code$ - $Code$diag_captureFrame 24; //capture 24th frame after command execution$/Code$ + $Code$setTimeMultiplier 0.5;$/Code$ - undefined / undefined + undefined / global + This scripting command must be executed on the server to work properly in multiplayer - Nothing + Nothing + - diag_captureFrameToFile + dynamicSimulationDistance - This command starts counting frames from the moment it is executed and when the count reaches the number passed as param, the current frame is captured and - written to a log file in the same directory as the.rpt file. - The full Path to the log file is logged to simultaneously. - The data in the log file can be copied and pasted into the diag_captureFrame UI dialog to get a visualisation later on. - Note : Only available in specific builds. See Performance Profiling for details. + A getter for setDynamicSimulationDistance - https://community.bistudio.com/wiki/diag_captureFrameToFile + https://community.bistudio.com/wiki/dynamicSimulationDistance - diag_captureFrameToFile Number + dynamicSimulationDistance String - diag_captureFrameToFile frame + dynamicSimulationDistance category - $Code$diag_captureFrameToFile 1; //capture the first frame after command execution$/Code$ - - $Code$diag_captureFrameToFile 24; //capture 24th frame after command execution$/Code$ + $Code$hint str dynamicSimulationDistance "Prop";$/Code$ undefined / undefined @@ -18740,39 +19735,28 @@ - Nothing + Number + - diag_captureSlowFrame + triggerDynamicSimulation - Opens "capture frame" dialog if current frame exceeds set threshold in seconds. One can indicate to either capture duration of a specific profiling selection or the total duration of the frame. The selection names can be obtained by expanding the profiling tree. Clicking on a tree item will highlight the item on the graph and vice versa. The GUI also provides method of copying of the displayed data to clipboard. Some of the selections: - Render - - bgD3D - Main Thread - - total - - memAl - Visualize - - visul - Mjob - - Mjob - Note : Only available in specific builds. See Performance Profiling for details. + Controls ability of given unit to activate entities with disabled Arma_3_Dynamic_Simulation. If false dynamically disabled entities will not be activated by unit presence - https://community.bistudio.com/wiki/diag_captureSlowFrame + https://community.bistudio.com/wiki/triggerDynamicSimulation - diag_captureSlowFrame Array + Object triggerDynamicSimulation Boolean - diag_captureSlowFrame [section, threshold] + unit triggerDynamicSimulation trigger - $Code$diag_captureSlowFrame ['total',0.003];$/Code$ - - $Code$diag_captureSlowFrame ['memAl', 0.0001];$/Code$ + $Code$player triggerDynamicSimulation false ;$/Code$ undefined / undefined @@ -18780,119 +19764,139 @@ - Nothing + Nothing + - diag_codePerformance + hmd - Attempts to run given code with given arguments given number of cycles in unscheduled environment and returns average time it took to run the code as well as actual number of executions performed. The command will return as soon as possible if the tested code is slow and the duration of the command exceeds 1 second. Engine alternative to BIS_fnc_codePerformance - NOTE: For security purposes, this command will only run for 1 cycle in MP, unless in-game debug console is available via description.ext option or Eden attribute setting. + Returns class name of currently used Head Mounted Display. Returns an empty string if the slot is empty. - https://community.bistudio.com/wiki/diag_codePerformance + https://community.bistudio.com/wiki/hmd - diag_codePerformance Array + hmd Object - diag_codePerformance [code, arguments, cycles] + hmd unit - $Code$_result = diag_codePerformance [{ private _a = 123;}, 0, 10000];$/Code$ + $Code$_nvgs = hmd player ; //NVGoggles$/Code$ - undefined / undefined + global / undefined - Array + String + - diag_drawMode + set3DENMissionAttributes - Activates specific debug visualization. - Command is only available when using Arma 3 Diagnostics Exe on Dev-Branch. + Set scenario attributes. + An attribute is identified by its property ( data when it's engine-drive attribute) value in config. For the list of all attributes with their properties, see Setting Attributes. + ! + Attributes are available only within the Eden Editor workspace. You cannot access them in scenario preview or exported scenario! - https://community.bistudio.com/wiki/diag_drawMode + https://community.bistudio.com/wiki/set3DENMissionAttributes - diag_drawMode String + set3DENMissionAttributes Array - diag_drawMode type + set3DENMissionAttributes [[ section, class1, value1 ],, [ section, classN, valueN ]] - $Code$diag_drawMode "normal"$/Code$ + $Code$set3DENMissionAttributes [["Multiplayer","respawn",3],["Multiplayer","respawnDelay",10]]; + // Set respawn type to 3 and respawn delay to 10 seconds$/Code$ undefined / undefined - (September 6, 2016) - Currently A3 dev branch, diag.exe, version 1.65.138249 has no drawModes available: - $Code$diag_list "drawMode" - []$/Code$ - Nothing + Boolean + - diag_enabled + isNull - Checks whether specific diagnostic mode is activated. - Only available in the Arma 3 Diagnostic exe + Checks whether the tested item is Null. + Which null type the item has to be equal to depends on the type of game entity tested: + Objects - objNull + Controls - controlNull + Displays - displayNull + Groups - grpNull + Locations - locationNull (since ARMA 2) + Tasks - taskNull (since ARMA 2) + Scripts - scriptNull (since Arma 3 1.29.127075) + Configs - configNull (since Arma 3 1.53.133130) + Note: A test via == does not work, because, for example, objNull is not equal to anything, not even to itself. Use isEqualTo. - https://community.bistudio.com/wiki/diag_enabled + https://community.bistudio.com/wiki/isNull - diag_enabled String + isNull Object/Control/Display/Group - diag_enabled diag_mode + isNull entity - $Code$"Animation" diag_enable true ; - diag_enabled "Animation";//returns true$/Code$ + $Code$if ( isNull obj) then { hint "doesn't exist";};$/Code$ - undefined / undefined + global / undefined + (December 9, 2015) + isNull does not work with the TEAM_MEMBER type. + Use this instead: + $Code$_tmember isEqualTo teamMemberNull$/Code$ + + (December 9, 2015) + The note in the description does not apply to the CONFIG type, probably due to backwards compatibility. + $Code$configNull == configNull + - true + $/Code$ - Boolean + Boolean + - diag_enable + attachObject - Used to enable/disabled various diagnostics. - Only available in the Arma 3 Diagnostic exe + Attaches a location to the specified object. To detach a location, attach it to objNull. - https://community.bistudio.com/wiki/diag_enable + https://community.bistudio.com/wiki/attachObject - String diag_enable Boolean + Location attachObject Object - diag_mode diag_enable state + location attachObject object - $Code$"All" diag_enable true$/Code$ + $Code$myLocation attachObject player ;$/Code$ undefined / undefined @@ -18900,27 +19904,29 @@ - Nothing + Nothing + - diag_fpsMin + deg - Returns minimal framerate. Calculated from the longest frame over last 16 frames. + Convert a number from Radians to Degrees. - https://community.bistudio.com/wiki/diag_fpsMin + https://community.bistudio.com/wiki/deg - diag_fpsMin + deg Number - diag_fpsMin + deg x - $Code$_minfps = diag_fpsMin ;$/Code$ + $Code$_degrees= deg 1 + returns 57.295$/Code$ undefined / undefined @@ -18928,902 +19934,940 @@ - Number + Number + - diag_fps + ammoOnPylon - Returns average framerate calculated over last 16 frames. + Returns ammo count on given pylon. + Returns false ( Bool ) on failure. - https://community.bistudio.com/wiki/diag_fps + https://community.bistudio.com/wiki/ammoOnPylon - diag_fps + Object ammoOnPylon String/Number - diag_fps + vehicle ammoOnPylon pylon - $Code$diag_log diag_fps;$/Code$ + $Code$_ammoCount = ( vehicle player ) ammoOnPylon "pylon1";$/Code$ + + $Code$hint str (( vehicle player ) ammoOnPylon "pylonCenter");$/Code$ undefined / undefined - (November 19, 2014) - The engine will always calculate the last 16 frames without caring if they are frames in which the loading screen was drawn, or actual mission frames. + (August 18, 2017) + The pylon indices start at 1 and not at 0. - Number + Number/Boolean + - diag_frameNo + flyInHeight - Returns number of frame currently displayed. + Sets the flying altitude for aircraft relatively to the ground surface. Avoid too low altitudes, as helicopters and planes won't evade trees and obstacles on the ground. The default flying altitude is 100 meters. - https://community.bistudio.com/wiki/diag_frameNo + https://community.bistudio.com/wiki/flyInHeight - diag_frameNo + Object flyInHeight Number - diag_frameNo + aircraft flyInHeight altitude - $Code$_currFrameNo = diag_frameNo ;$/Code$ + $Code$_helicopter flyInHeight 40$/Code$ - undefined / undefined + local / global - (November 19, 2014) - Avoid using hard-coded frame-specific events, the total amount of drawn frames is persistent across all missions. It does not get reset until the game is closed. + (August 4, 2006) + Notes from before the conversion: + From version 1.80+ - flyInHeight now affects not only helicopters, but also planes. + + (August 4, 2006) + A planes flyInHeight, is restricted to a minimum of 20 meters. + + (December 15, 2008) + A flyInHeight of 0 will keep the chopper pinned to the ground, even when the engines have been started. + + (00:53, 11 April 2009 (CEST)) + If a helo has no waypoints, it will assume a low hover without regard to this setting. - Number + Nothing + - diag_list + vestMagazines - Returns an array of all diag modes available in the game. - Command is only available when using Arma 3 Diagnostics Exe on Dev-Branch. + Get array with all magazines from vest of the given unit. - https://community.bistudio.com/wiki/diag_list + https://community.bistudio.com/wiki/vestMagazines - diag_list String + vestMagazines Object - diag_list name + vestMagazines unit - $Code$diag_list "toggle";$/Code$ - - $Code$diag_list "drawMode"$/Code$ + $Code$vestMagazines player ;[ + "6.5mm 30Rnd STANAG Mag(30/30)[id/cr:4/0](2x)", + "9mm 16Rnd Mag(16/16)[id/cr:7/0](2x)", + "RGO Frag Grenade(1/1)[id/cr:10/0](2x)", + "Smoke Grenade (White)(1/1)[id/cr:12/0](1x)", + "Smoke Grenade (Green)(1/1)[id/cr:13/0](1x)", + "Chemlight (Green)(1/1)[id/cr:14/0](2x)" + ]$/Code$ undefined / undefined - (October 7, 2016) - Arma 3 Version 1.65.138660 - $Code$ diag_list "toggle";$/Code$ returns: - ["Force","Animation","Mines","HitPoints","AnimSrcUnit","AnimSrcTarget","Suspension", - "EPEForce","EPEVehicle","ParticleNames","Particles","SurfaceUnder","AISkill","AIDriving", - "AIAiming","AIBrain","AIDynamicError","AISuppression"] - Array + Array + - diag_logSlowFrame + setMass - Log all frames, where section takes longer than the threshold (in seconds). - Note : Only available in specific builds. See Performance Profiling for details. + Changes the mass of an object smoothly during the given time (in seconds). A time of zero (or using the alternative syntax) means an immediate change. - https://community.bistudio.com/wiki/diag_logSlowFrame + https://community.bistudio.com/wiki/setMass - diag_logSlowFrame Array + Object setMass Array + + Object setMass Number - diag_logSlowFrame [section, threshold] + myObject setMass [mass, time] + + myObject setMass mass - $Code$diag_logSlowFrame ['total',0.3]$/Code$ + $Code$myObject setMass [10,0.5];$/Code$ + + $Code$myObject setMass 10;$/Code$ - undefined / undefined + local / global + (20 Jun, 2014) + (ArmA3 1.22) A quick reference: + category + setMass + setCenterOfMass + unit + The larger the mass is, the easier a unit will physically fatigued + N/A + aircraft + The larger the mass is, the more sensitive an aircraft will react to joystick, vice versa (Except when AFM is enabled). + Aircraft slant due to center change accordingly, and the position of the camera view will be altered relatively at the same time. (3rd person view) + vehicle + The larger the mass is, the slower a vehicle drives (Ships will sink), vice versa. (Land vehicle performs like a bouncing ball while ships accelerated pretty speedy.) + Vehicle slant due to center change accordingly. + + (March 26, 2015) + If you intend to use setMass in conjunction with ropeCreate in MP i highly recommend to first ropeCreate then setMass (on clientside). + RopeCreate in MP will set the mass of the attached object to the server value upon execution. - Nothing + Nothing - Nothing + - diag_log + diag_captureSlowFrame - Dumps the argument's value to the report file. Each call creates a new line in the file. + Opens "capture frame" dialog if current frame exceeds set threshold in seconds. One can indicate to either capture duration of a specific profiling selection or the total duration of the frame. The selection names can be obtained by expanding the profiling tree. Clicking on a tree item will highlight the item on the graph and vice versa. The GUI also provides method of copying of the displayed data to clipboard. Some of the selections: + Render + - bgD3D + Main Thread + - total + - memAl + Visualize + - visul + Mjob + - Mjob + Note : Only available in specific builds. See Performance Profiling for details. - https://community.bistudio.com/wiki/diag_log + https://community.bistudio.com/wiki/diag_captureSlowFrame - diag_log Anything + diag_captureSlowFrame Array - diag_log anything + diag_captureSlowFrame [section, threshold] - $Code$diag_log time ;$/Code$ - - $Code$diag_log format ["%1, %2", player, time ];$/Code$ - - $Code$_arr = [1, "foo", player, "bar"]; - { - diag_log _x ; - } forEach _arr; // Creates 4 entries on 4 lines$/Code$ + $Code$diag_captureSlowFrame ['total',0.003];$/Code$ - $Code$_arr = [1, "foo", player, "bar"]; - diag_log _arr; - // Creates one entry of e.g. [1,"foo",B Alpha 1-1:1 (Player Name),"bar"]$/Code$ + $Code$diag_captureSlowFrame ['memAl', 0.0001];$/Code$ undefined / undefined - To dump a string without "" use text. - Posted 23:35, 19 April 2011 - - in patch 1.59 there is a limit of 1044 characters to be printed, no error or crash but diag_log line will simply end at character number 1044. - Nothing + Nothing + - diag_mergeConfigFile + uiNamespace - Adjust configs on-the-fly without the need of restarting the game (by merging the given config file into the main config in memory). Location is relative to the Userdir (default) or mission directory depending on the the value of UserDir [FileName,UserDir]. - Doesn't work with cfgAmmo & few other classes. (Since 1.69, cfgAmmo should be mergeable!) Merging config file means also that you can't delete parameters through diag_mergeConfigFile. Changes applied by diag_mergeConfigFile are applied to all new entities so restart of mission is not necessarily required - spawning vehicle again or changing back forth weapon should usually do the trick. - Command is only available when using Arma 3 Diagnostics Exe on Dev-Branch. + Returns the global namespace attached to user interface. - https://community.bistudio.com/wiki/diag_mergeConfigFile + https://community.bistudio.com/wiki/uiNamespace - diag_mergeConfigFile Array + uiNamespace - diag_mergeConfigFile [PathToConfigOnDrive] + uiNamespace - $Code$diag_mergeConfigFile ["O:\Arma3\A3\Stuff_F\config.cpp"]$/Code$ + $Code$uiNamespace setVariable ["LIB_interruptDisplay", _display];$/Code$ + + $Code$uiNamespace setVariable ["myVar", 46]; + with uiNamespace do { + hint str myVar; //46 + };$/Code$ undefined / undefined + variables in uiNamespace are not lost between mission changes, they are carried over. Also take note that the server can make use of uiNamespace. + + (29 September, 2014) + ^The same can be said with parsingNamespace. - Nothing + Namespace + - diag_recordTurretLimits + ppEffectAdjust - Start recording tool for creating turret aiming limits. - Command is only available when using Arma 3 Diagnostics Exe on Dev-Branch. + Set post process effect parameters. NOTE: The two syntaxes differ in what format of the params they accept. The syntax with PP name expects colors to be packed into arrays within main array, while the syntax with PP handle can handle both flat and packed array. Therefore it is recommended to use the universal packed format, such as shown in the examples. - https://community.bistudio.com/wiki/diag_recordTurretLimits + https://community.bistudio.com/wiki/ppEffectAdjust - diag_recordTurretLimits Boolean + String ppEffectAdjust Array + + Number ppEffectAdjust Array - diag_recordTurretLimits section + effect ppEffectAdjust settings + + effect ppEffectAdjust settings - $Code$diag_recordTurretLimits true;$/Code$ + $Code$"colorCorrections" ppEffectAdjust [1, 1, -0.01, [0, 0, 0, 0], [1.5, 1, 1.2, 0.6], [0.199, 0.587, 0.114, 0]];$/Code$ + + $Code$// Black&White: + _colorCorrectionsEffHandle ppEffectAdjust [1, 0.4, 0, [0, 0, 0, 0], [1, 1, 1, 0], [1, 1, 1, 0]];$/Code$ - undefined / undefined + undefined / local - Nothing + Nothing - Nothing + - diag_resetShapes + forceWalk - Reload models on-the-fly without the need of restarting the game. Changes applied by diag_resetShapes are applied to all new entities so restart of mission is not necessarily required - spawning vehicle again or changing back forth weapon should usually do the trick. It works only with "-FilePatching" in combination with local data. Command will reload only models present in local data. - Limitation - you can't reload cfgSkeletons (Which is inside model.cfg) - Command is only available when using Arma 3 Diagnostics Exe on Dev-Branch. + Forces unit to walk even if run or sprint is selected. - https://community.bistudio.com/wiki/diag_resetShapes + https://community.bistudio.com/wiki/forceWalk - diag_resetShapes + Object forceWalk Boolean - diag_resetShapes + unit forceWalk value - $Code$diag_resetShapes$/Code$ + $Code$player forceWalk true ;$/Code$ - undefined / undefined + local / undefined - Nothing + Nothing + - diag_tickTime + nearTargets - Real time spent from the start of the game. Expressed in fractions of second. Resolution of 1 tick is 1 ms. + Returns a list of targets within the defined range. "Targets" are not restricted to enemy units. - https://community.bistudio.com/wiki/diag_tickTime + https://community.bistudio.com/wiki/nearTargets - diag_tickTime + Object nearTargets Number - diag_tickTime + unit nearTargets range - $Code$_start = diag_tickTime ; - //code - _stop = diag_tickTime ; - diag_log format ["%1",_stop - _start];$/Code$ + $Code$player nearTargets 100; + // could return something like this: + //[[[2555.33,2535.33,1.32708],"SoldierEB",EAST,214222,EAST 1-1-A:1],[[2550.39,2482.5,1.32696],"SoldierWB",WEST,0,WEST 1-1-A:2]]$/Code$ undefined / undefined - (8 Sept, 2010) - In Arma 2 Operation Arrowhead 1.54.0.72888 this returns the time in seconds since the game was started. + (Febuary 17, 2011) + A subjective cost greater than 0 does not necessarily mean the target is an enemy unit. Any unit, that have yet to be identified by the unit, have a small positive cost in the range 0 to 1. - (25 Jan, 2014) - This command will return time since last client restart as float. However because of Number format used in Arma, the more time has past since restart the less precise the returned value will be. + (January 15, 2012) + The quality/detail level of the info depends on the knowsAbout value of the sourceUnit about the targetUnit: + For infantry: + ] 0, 1.5 [ - side unknown, some position offset, identified as SoldierWB + [ 1.5, 1.6 [ - side identified, subjective cost set + [ 1.6, 2 [ - type identified better (USMC_Soldier_Base) + [ 2, 3.6 [ - type identified precisely (USMC_Soldier) + [ 3.6, 4 ] - position identified precisely + The values seems closely linked to the accuracy value of the given targetUnit class and its parents up in the config tree: + 0class CAManBase: Man + 1.6class SoldierWB: CAManBase + 2class USMC_Soldier_Base: SoldierWB + 3.9class USMC_Soldier: USMC_Soldier_Base + For tanks: + ] 0, 0.03 [ - side unknown, some position offset, identified as LandVehicle + [ 0.03, 0.13 [ - type identified better (Tank) + [ 0.13, 0.3 [ - type identified better (M1A1) + [ 0.3, 1.5 [ - side identified, subjective cost set + [ 1.5, 3.6 [ - side identified precisely (CIV), subjective cost adjusted + [ 3.6, 4 ] - position identified precisely + The values seems closely linked to the accuracy value of the given targetUnit class and its parents up in the config tree: + 0class All + class AllVehicles: All + 0.0005class Land: AllVehicles + 0.02class LandVehicle: Land + 0.12class Tank: LandVehicle + 0.25class M1A1: Tank + + (January 17, 2012) + When an unit dies, it's nearTargets array gets emptied after some seconds. + When an unit dies, its reference will get removed from other units nearTargets' arrays immediately. + A target will be removed from the array after about 360 seconds without contact. + + (January 21, 2012) + Position accuracy seems to be a radius in meters from the perceived position. - Number + Array + - diag_toggle + ctData - Used to enable/disabled various diagnostics. - Only available in the Arma 3 Diagnostic exe + Returns metadata (string) associated with a particular row of RscControlsTable. - https://community.bistudio.com/wiki/diag_toggle + https://community.bistudio.com/wiki/ctData - diag_toggle String + Control ctData Number - diag_toggle diag_mode + ctrl ctData row - $Code$diag_toggle "Animation";//enable - diag_toggle "Animation";//disable$/Code$ + $Code$ctData _control;$/Code$ - undefined / undefined + local / local - Nothing + String + - dialog + difficultyOption - Tests whether any user dialog is open. + Checks specific difficulty settings of the current user. Difficulty flag names can be found in the CfgDifficultyPresets config class or in + ArmA profile file under class DifficultyPresets/xxx/Options (xxx being Recruit, Regular or Veteran). + This command replaces difficultyEnabled. - https://community.bistudio.com/wiki/dialog + https://community.bistudio.com/wiki/difficultyOption - dialog + difficultyOption String - dialog + difficultyOption optionName - $Code$if (! dialog ) then { createDialog "Dialog1";};$/Code$ + $Code$hint str ( difficultyOption "friendlyTags");$/Code$ undefined / undefined + (March 23, 2016) + Arma 3 options: + reducedDamage + groupIndicators + friendlyTags + enemyTags + detectedMines + commands + waypoints + weaponInfo + stanceIndicator + staminaBar + weaponCrosshair + visionAid + thirdPersonView + cameraShake + scoreTable + deathMessages + vonID + mapContent + autoReport + multipleSaves - Boolean + Number + - diarySubjectExists + lbSetPictureRight - Checks whether given subject is present in the diary of given person. + Sets the second (right aligned) picture in the item with the given index of the listbox or combobox with id idc of the topmost user dialog. Name is the picture name. The picture is searched for in the mission directory, the dtaExt subdirectory of the campaign directory and the dtaExt directory and the data bank (or directory). + In Arma 3 it might be necessary to set the color of the picture as well with lbSetPictureRightColor as default [0,0,0,0] color makes picture invisible. - https://community.bistudio.com/wiki/diarySubjectExists + https://community.bistudio.com/wiki/lbSetPictureRight - Object diarySubjectExists String + lbSetPictureRight Array + + Control lbSetPictureRight Array - person diarySubjectExists name + lbSetPictureRight [idc, index, name] + + control lbSetPictureRight [index, name] - - - undefined / undefined - + $Code$lbSetPictureRight [101, 0, "iskoda"];$/Code$ + + $Code$_control lbSetPictureRight [0, "iskoda"];$/Code$ + + + local / local + + More information on the LB command family can be found here - Boolean + Nothing - Nothing + - didJIP + execVM - Checks if the current client Joined In Progress. + Compiles and adds SQF Script to the scheduler queue and returns script handle. The script is first searched for in the mission folder, then in the campaign scripts folder and finally in the global scripts folder. The script does not execute immediately upon running execVM command, but with some delay. How much delay is unknown as it largely depends on how many other scripts there are in the queue and how busy is VM. The optional argument is passed to the script in private variable _this. In Arma 3 the script handle is also passed to the script in _thisScript variable. + In order to understand execVM consider the following comparison: + $Code$ private _handle = _args execVM "someFile.sqf"; + // is practically identical to + private _handle = _args spawn compile preprocessFileLineNumbers "someFile.sqf";$/Code$ + So if you need multiple execution of the same file, you might want to store it in a function ( Functions Library ), otherwise, for a single execution, execVM is a good choice. - https://community.bistudio.com/wiki/didJIP + https://community.bistudio.com/wiki/execVM - didJIP + Anything execVM String + + execVM String - didJIP + arguments execVM filename + + execVM filename - $Code$clientDidJIP = didJIP ;$/Code$ + $Code$_handle = execVM "test.sqf";$/Code$ + + $Code$_handle = player execVM "test.sqf"; + waitUntil { scriptDone _handle};$/Code$ + + $Code$// In Arma 3 this is also possible: + _handle = execVM "123.sqf"; + waitUntil { isNull _handle};$/Code$ + + $Code$[4] execVM "showDamage.sqf"; + // showDamage.sqf + _damage = _this select 0; + hint format ["%1", _damage];$/Code$ undefined / undefined - (February 23, 2016) - reports false in CfgFunctions with preInit = 1; even when the client joined in progress. + (November 23, 2010) + Passing variables to the script file + To pass multiple variables to the script file, use an array e.g: + null = [myunit,1234] execVM "test.sqf"; + Now within test.sqf to access the elements, use the following: + _myunit = _this select 0; + _myvar = _this select 1; - Boolean + Script_Handle - Script_Handle + - didJIPOwner + allDead - Checks if the current owner of supplied Object Joined In Progress. Server execution only. On clients returns false. + Return a list of all dead units including agents and destroyed vehicles. Dead units may be in vehicles. - https://community.bistudio.com/wiki/didJIPOwner + https://community.bistudio.com/wiki/allDead - didJIPOwner Object + allDead - didJIPOwner object + allDead - $Code$ownerDidJip = didJIPOwner tank;$/Code$ + $Code${ deleteVehicle _x } forEach allDead ;$/Code$ + + $Code$// allAlive: + _all = allUnits + vehicles ; + { + _all pushBack agent _x; + } forEach ( agents - [ teamMemberNull ]); + allAlive = _all - allDead ;$/Code$ undefined / undefined - This scripting command must be executed on the server to work properly in multiplayer + (April 6, 2017) + This also returns bodies hidden with hideBody until they are deleted. Tested in A2OA 1.63.131129 - Boolean + Array + - difficultyEnabledRTD + setUnitRecoilCoefficient - Returns true if rotorlib simulation is enabled. Forcing by mission is included + Proportionaly increase/decrease unit's recoil. Drives muzzle up with every shot when supplied positive number and down when negative. 0 cancels recoil. - https://community.bistudio.com/wiki/difficultyEnabledRTD + https://community.bistudio.com/wiki/setUnitRecoilCoefficient - difficultyEnabledRTD + Object setUnitRecoilCoefficient Number - difficultyEnabledRTD + unitName setUnitRecoilCoefficient coefficient - $Code$_rtdOn = difficultyEnabledRTD$/Code$ + $Code$player setUnitRecoilCoefficient 10$/Code$ undefined / undefined + (March 28, 2015) + Doesnt seem to work on AI or remote controlled units. Setting the value too high, positive or negative produces some interesting recoil animations. - Boolean + Nothing + - difficultyEnabled + detectedMines - This command is deprecated since Arma 3 1.58. Since this version it always returns false. Use difficultyOption instead. See Arma 3 Difficulty Overhaul for further details. - Former functionality: - Checks specific difficulty settings of the current user. Difficulty flag names can be found in the ArmA profile file under class Difficulties/xxx/Flags (xxx being regular or veteran). - Note: stress damage for some reason is a separate difficulty so difficultyEnabled "stressDamageEnabled" might not return correct set value. There are however 2 dedicated commands for it: - enableStressDamage - isStressDamageEnabled - Note: auto trim is also for some reason a separate difficulty so difficultyEnabled "autoTrimEnabled" might not return correct set value. There are also 2 dedicated commands for it: - enableAutoTrimRTD - isAutoTrimOnRTD + Returns an array of all mines detected by a given side - https://community.bistudio.com/wiki/difficultyEnabled + https://community.bistudio.com/wiki/detectedMines - difficultyEnabled String + detectedMines Side - difficultyEnabled flagName + detectedMines side - $Code$hint str ( difficultyEnabled "armor");$/Code$ + $Code$detectedMines west ;$/Code$ - $Code$// List current difficulty settings: - call { - private ["_diff", "_cfg", "_flags", "_res"]; - _diff = []; - _cfg = configFile "CfgDifficulties"; - { - _flags = _cfg configName _x "Flags"; - for "_i" from 0 to count _flags - 1 do { - _diff pushBack configName (_flags select _i); - }; - } forEach ("true" configClasses _cfg); - _diff = _diff arrayIntersect _diff; - _diff sort true ; - _res = text ""; - { - _res = composeText [_res, parseText format [ - " t align='left' %1 - %2 /t ", - _x, - [0, 1] select difficultyEnabled _x - ], lineBreak ]; - } forEach _diff; - hint _res; - };$/Code$ + $Code$detectedMines side player ;$/Code$ undefined / undefined - (June 29, 2015) - Arma 3 Flags: - 3rdPersonView - armor - autoAim - autoGuideAT - autoSpot - autoTrimEnabled - cameraShake - clockIndicator - deathMessages - enemyTag - extendetInfoType - friendlyTag - hud - hudGroupInfo - hudPerm - hudWp - hudWpPerm - map - mineTag - netStats - roughLanding - stanceIndicator - stressDamageEnabled - unlimitedSaves - vonID - weaponCursor - windEnabled - - Possible Values for Arma 2: - 3rdPersonView - armor - autoSpot - autoGuideAT - autoAim - allowSeagull - clockIndicator - deathMessages - enemyTag - friendlyTag - hud - hudPerm - hudWp - hudWpPerm - map - netStats - suppressPlayer - tracers - realisticFatigue - ultraAI - unlimitedSaves - weaponCursor - Boolean + Array + - difficultyOption + ctrlSetModelScale - Checks specific difficulty settings of the current user. Difficulty flag names can be found in the CfgDifficultyPresets config class or in - ArmA profile file under class DifficultyPresets/xxx/Options (xxx being Recruit, Regular or Veteran). - This command replaces difficultyEnabled. + Sets 3D control model scale - https://community.bistudio.com/wiki/difficultyOption + https://community.bistudio.com/wiki/ctrlSetModelScale - difficultyOption String + Control ctrlSetModelScale Number - difficultyOption optionName + control ctrlSetModelScale scale - $Code$hint str ( difficultyOption "friendlyTags");$/Code$ + $Code$_ctrl3D ctrlSetModelScale 1.5;$/Code$ undefined / undefined - (March 23, 2016) - Arma 3 options: - reducedDamage - groupIndicators - friendlyTags - enemyTags - detectedMines - commands - waypoints - weaponInfo - stanceIndicator - staminaBar - weaponCrosshair - visionAid - thirdPersonView - cameraShake - scoreTable - deathMessages - vonID - mapContent - autoReport - multipleSaves - Number + Nothing + - difficulty + != - Returns high-level selected difficulty mode. - Returned value will be: 0 (Recruit), 1 (Regular), 2 (Veteran) or 3 (Elite) + Returns whether one value is not equal to another. Both values have need be of the same type. - https://community.bistudio.com/wiki/difficulty + https://community.bistudio.com/wiki/a_!%3D_b - difficulty + Anything != Anything - difficulty - + - $Code$value = difficulty ;$/Code$ - - $Code$// The command returns the index of selected difficulty as they appear in CfgDifficulties - hint str difficulty ; //Result: 4$/Code$ - + undefined / undefined - Number + Boolean + - directSay + unassignItem - Sends given audio message to the direct channel. Command operates just like xxxxRadio commands, but the sound is played over direct channel and is independent of fadeRadio. The message is defined in CfgRadio in the description.ext file or config radio protocol or a kbAddTopic. The transmission will play only on the PC where command was executed. If you need the transmission to play on all computers, you have to execute it globally (see remoteExec ). - Note: When transmitting unit gets killed, transmission will be interrupted, however when receiving unit gets killed, the transmission continues to play. + Unassigns existing item and tries to put it into inventory. If there is no space in inventory the item simply disappears. - https://community.bistudio.com/wiki/directSay + https://community.bistudio.com/wiki/unassignItem - Object directSay String + Object unassignItem String - unit directSay radioName + unit unassignItem item - $Code$player directSay configName selectRandom ("true" configClasses ( configFile "CfgRadio"));$/Code$ + $Code$bluforUnit unassignItem "NVGoggles"; + bluforUnit removeItem "NVGoggles"; + opforUnit unassignItem "NVGoggles_OPFOR"; + opforUnit removeItem "NVGoggles_OPFOR"; + independentUnit unassignItem "NVGoggles_INDEP"; + independentUnit removeItem "NVGoggles_INDEP";$/Code$ - global / local + global / global - (December 3, 2016) - To transmit user custom sounds (see Multiplayer_Custom_Sounds_Tutorial ), prefix the full filename including file extension with #. For example if there is a custom user sound file called MySound.ogg, to play it on the radio use: - $Code$ player directSay "#MySound.ogg";$/Code$ - Nothing + Nothing + - direction + tvAdd - Returns the direction an object or a location is facing (differs from getDir in that this also works with locations). + Adds an item with given text to Tree View control. The position on Tree View where to add the item and the actual path to this item once added are different. If item is added to existing item, then parent item path is used. If no parent exists, empty array [] is used. See Tree View Path for more information. - https://community.bistudio.com/wiki/direction + https://community.bistudio.com/wiki/tvAdd - direction Object/Location + tvAdd Array + + Control tvAdd Array - direction object + tvAdd [idc, pathParent, text] + + control tvAdd [pathParent, text] - $Code$player setDir 90; - _d = direction player ;//returns 90$/Code$ + $Code$_index = _ctrl tvAdd [[], "Parent Item"];$/Code$ + + $Code$_index = tvAdd [101, [0], "First item"];$/Code$ - global / undefined + undefined / undefined + (Sep 11 2014) + (A3 1.28)tv command family overview + $Code$ + //tv command family available for CT_TREE (type 12) + private ["_count","_current","_data","_text","_value","_pic"]; + _CT_TREE tvAdd [ [],"Parent_A"]; + _CT_TREE tvAdd [ [0],"Child_A"]; + _CT_TREE tvAdd [ [0,0],"Grandchild_A"]; + _CT_TREE tvAdd [ [],"Parent_B"]; + _CT_TREE tvAdd [ [1],"Child_B"]; + _count = _CT_TREE tvCount []; //return 2 + _CT_TREE tvSetCurSel [0,0,0]; //select grandchild_A + _current = tvCurSel _CT_TREE; //return [0,0,0] + _CT_TREE tvSetData [_current,"I'm grandchild_A"]; + _data = _CT_TREE tvData _current; // "I'm grandchild_A" + _text = _CT_TREE tvText _current; //"Grandchild_A" + _CT_TREE tvSetValue [_current,14]; + _value = _CT_TREE tvValue _current; // 14 + _CT_TREE tvSetPicture [_current, getText ( configFile "CfgWeapons" "optic_NVS" "picture")]; + _pic = _CT_TREE tvPicture _current; + _CT_TREE tvExpand [1]; + _CT_TREE tvSort [[], false ]; + _CT_TREE tvSortByValue [[], false ]; + _CT_TREE tvDelete [0,0]; //remove child_b + tvClear 12; + _CT_TREE tvCollapse []; + $/Code$ - Number + Number - Number + - disableAI + secondaryWeaponMagazine - Disable parts of the AI behaviour to get a better control over the actions of a unit. Must be executed where AI unit is local. If unit changes locality, it might need to be executed again at the new locality to maintain effect. - Possible values are: - "TARGET" - stop the unit to watch the assigned target / group commander may not assign targets - "AUTOTARGET" - prevent the unit from assigning a target independently and watching unknown objects / no automatic target selection - "MOVE" - disable the AI's movement / do not move - "ANIM" - disable ability of AI to change animation. Available only since ArmA: Cold War Assault (OFP 1.99). - "TEAMSWITCH" - AI disabled because of Team Switch - "FSM" - disable the execution of AI behavior scripts. Available only since Operation Arrowhead v1.60. - "WEAPONAIM" - no weapon aiming - "AIMINGERROR" - prevents AI's aiming from being distracted by its shooting, moving, turning, reloading, hit, injury, fatigue, suppression or concealed/lost target Available only since Arma 3 v1.42. - "SUPPRESSION" - prevents AI from being suppressed Available only since Arma 3 v1.42. - "CHECKVISIBLE" - disables visibility raycasts Available only since Arma 3 v1.54. - "COVER" - disables usage of cover positions by the AI Available only since Arma 3 v1.56. - "AUTOCOMBAT" - disables autonomous switching to COMBAT when in danger Available only since Arma 3 v1.56. - "PATH" - stops the AI’s movement but not the target alignment Available only since Arma 3 v1.61. - "MINEDETECTION" - disable Ai mine detection. - "ALL" - all of the above Available since Arma 3 v1.65 - Note: In OFP is no way to undo this command. + Returns either single element array, containing class name of currently loaded in the secondary weapon magazine, or an empty array if unit has no secondary weapon or secondary weapon is not loaded. This command is used for infantry weapons only. - https://community.bistudio.com/wiki/disableAI + https://community.bistudio.com/wiki/secondaryWeaponMagazine - Object disableAI String + secondaryWeaponMagazine Object - unitName disableAI section + secondaryWeaponMagazine unit - $Code$_soldier1 disableAI "AUTOTARGET";$/Code$ + $Code$hint secondaryWeaponMagazine player ; //["NLAW_F"]$/Code$ + + $Code$_array = secondaryWeaponMagazine player ; + if ( count _array 0) then { + hint ("Secondary weapon is loaded with " + (_array select 0) + "!"); + } else { + if ( secondaryWeapon player != "") then { + hint "Secondary weapon is not loaded!"; + } else { + hint "Player doesn't have a secondary weapon!"; + }; + };$/Code$ - local / global + undefined / undefined - (26.9.2013) - After substantial testing in ArmA3 1.01, the AI sections are as follows: - MOVE: disabling this will stop units from turning and moving. Units will still change stance and fire at the enemy if the enemy happens to walk right in front of the barrel. Unit will watch enemies that are in their line of sight, but won't turn their bodies to face the enemy, only their head. Works for grouped units as well. Good for staging units and holding them completely still. Movement can't be controlled by a script either, you have to re-enable movement for that. Unit will still be able to aim within his cone of fire. - AUTOTARGET: Essentially makes single units without a group, "deaf". The unit still goes prone and combat ready if he hears gunfire. They won't turn around when gunfire comes from the behind, but if an enemy walks in front they will target the enemy and fire as normal. WON'T WORK FOR GROUPED UNITS WITH A LEADER, the leader will assign targets to the units and effectively enables the AI back on. - TARGET: Will prevent units from engaging the target. Units still move around for cover etc...but won't hunt down the player. Works in groups as well. Excellent for keeping units inside bases or other areas without having them flank or engage anyone. They will still seek good cover if something is close by. - ANIM: completely freezes the unit, including breathing. Won't even blink. No move command works until the unit is unfrozen. - FSM: Essentially makes the enemy "dumber". Enemies react slower to enemy fire and the enemy stops using hand signals. Disabling FSM, can give the impression of untrained units as they react slower and are more disorganized than when FSM is enabled. Good for rebel fighters and when enabled better for professional armies. - - (August 3, 2006) - Notes from before the conversion: - The "TARGET" section of the AI is likely different than what you would think. Normally, when an AI group is standing still and sees an enemy, the group will break formation and start moving towards the enemy. If you disable the "TARGET" AI, then the AI units will stay where they are at. Even if you disable the "MOVE" AI, the units will still move out to attack the enemy, unless you disable the "TARGET" AI. Disabling both these AI sections is useful when placing units in defensive positions. This way, you can have them stay behind their cover, and not run out into the open. - This command has also a bug: after mission save or load the effect will be no longer active and you must set it again. It's also good way to detect number of saves and loads (loads can be recognized using time command). - - (Feb 7, 2009) - Multiplayer Use as of ArmA v1.14: - Contrary to the post above, using this command WILL disable A.I. movement ability if used with the "MOVE" parameter. Works even when the A.I. is grouped with other units. I use this command to set up stationary targets at objectives all the time. Works on a dedicated server. - - (September 19, 2015) - Beware that disabling "TARGET" AI to units in the player's group will disable the ability to execute engage orders issued by the player. - - (August 24, 2016) - As of version 1.65 dev., disableAI "MOVE" will also stop vehicles driven by AI. - - (September 26, 2016) - Command is buggy in version 1.64.138497 as it disables the ability to drive vehicles for players. Tested with $Code$player disableAI "move"$/Code$. Entering a vehicle is possible, but not starting the engine. $Code$player enableAI "move"$/Code$ enables the player to drive again. - Already in the feedback tracker: https://feedback.bistudio.com/T120346 - Nothing + Array + - disableCollisionWith + vectorUpVisual - Disable collision between vehicles. This commmand doesn't disable collision between PhysX objects. - ! - Command has to be executed where objects are local, and as long as they don't change locality, the effect of this command will be global. - If the 2 objects are not local to the same computer, then it has to be executed on both computers to achieve the desired effect. - If one or both objects change locality, the command needs to be executed again on the new owner 's machine(s) to maintain the effect. + Return object's up vector in world Position coordinates ( [x, y, z] ) in render time scope. - https://community.bistudio.com/wiki/disableCollisionWith + https://community.bistudio.com/wiki/vectorUpVisual - Object disableCollisionWith Object + vectorUpVisual Object - vehicle disableCollisionWith vehicle + vectorUpVisual objectName - + $Code$_vUp = vectorUpVisual vehicle player ;$/Code$ + - local / global + global / undefined - (April 4, 2015) - disableCollisionWith is basically a script that when you apply it to an object, and your unit can go through it like a ghost. However, if you wish the object to be solid again, you may wish to use the enableCollisionWith. - An example for this is: - $Code$//name of unit in editor such as player1 - //name of object in editor such as barrel1 - barrel1 disableCollisionWith player1; - //to make the barrel solid again, do this as vice versa if you know what your doing! - barrel1 enableCollisionWith player1 $/Code$ - On a side note: this can come in handy a lot if you want a unit to sit on the back of a car or on top of a container - Nothing + Array + - disableConversation + lockTurret - Disable the ability to talk to other people. + Lock the gunner position of the vehicle turret. This command must be executed where vehicle is local. - https://community.bistudio.com/wiki/disableConversation + https://community.bistudio.com/wiki/lockTurret - Object disableConversation Boolean + Object lockTurret Array - unitName disableConversation disable + vehicle lockTurret [turret path,lock] - $Code$player disableConversation true$/Code$ + $Code$vehicleName lockTurret [[0,0], true ];$/Code$ - $Code$soldier1 disableConversation true$/Code$ + $Code$vehicle player lockTurret [[0], true ];$/Code$ - undefined / undefined + local / global - (July 10, 2009) - Note that this will also prevent you from using group radio. - If you just want player unable to speak to others (or one particular soldier), - use $Code$player setVariable ["BIS_noCoreConversations", true];$/Code$ - or, for the other soldier, - $Code$unitName setVariable ["BIS_noCoreConversations", true];$/Code$ - - (August 18, 2010) - My previous note is incorrect now, you can use disableConversation and still use the group radio, at least in A2:OA ! - Nothing + Nothing + - disableDebriefingStats + curatorMouseOver - Disable debriefing score table. - This command is broken. + Returns Curator Editable Object under curator mouse pointer in form of array: + [] - when not in curator mode + [""] - if no curator editable object under the pointer in curator mode + [ typeName, Curator Editable Object ] - if there is curator editable object under the pointer in curator mode - https://community.bistudio.com/wiki/disableDebriefingStats + https://community.bistudio.com/wiki/curatorMouseOver - disableDebriefingStats + curatorMouseOver - disableDebriefingStats + curatorMouseOver - $Code$disableDebriefingStats ;$/Code$ + $Code$_mouseOver = curatorMouseOver ; + // possible return value:[ + "OBJECT", + 3594ab00# 164218: apc_wheeled_01_cannon_f.p3d + ]$/Code$ undefined / undefined @@ -19831,165 +20875,149 @@ - Nothing + Array + - disableNVGEquipment + isUAVConnectable - Enables or disables transport NV (Night Vision). To disable TI (Thermal Imaging) use disableTIEquipment. + Returns true if UAV is connectable by AV terminal(s). - https://community.bistudio.com/wiki/disableNVGEquipment + https://community.bistudio.com/wiki/isUAVConnectable - Object disableNVGEquipment Boolean + Object isUAVConnectable Array - vehicle disableNVGEquipment state + object isUAVConnectable [uav, checkAllItems] - $Code$myTank disableNVGEquipment true ;$/Code$ + $Code$connectable = unit isUAVConnectable [uav,true];$/Code$ - global / global + undefined / undefined - Nothing + Boolean + - disableRemoteSensors + getElevationOffset - This command will halt raycasting calculations (on the local machine only) for all groups which don't contain any local entities. If a group contains a single local entity then calculations will still be performed for the entire group. - These raycasts are used to determine what other entities an entity can see, and they take a lot of CPU time. This is of course a bit of a trick, because rather than a true optimization, it disables part of the simulation. However, there are certainly types of scenarios where these raycasts are not needed. An example is a fully Player-versus-Player scenario, where the visibility between every combination of player entity is not needed. So why not disable this by default? There are cases where you do require these raycasts, for example in stealth scenarios. Without them, commands like knowsAbout, nearTargets and targetKnowledge will only function for local units! The commands themselves are local, can be used on servers and clients, and the state is reset when the scenario ends. So, carefully consider whether your scenario can benefit from this method. + Returns the map elevation offset from [map]/config.cpp. + Returns 0 if there's no elevationOffset defined in the config of the current world. - https://community.bistudio.com/wiki/disableRemoteSensors + https://community.bistudio.com/wiki/getElevationOffset - disableRemoteSensors Boolean + getElevationOffset - disableRemoteSensors state + getElevationOffset - $Code$disableRemoteSensors false;$/Code$ + $Code$_offset = getElevationOffset ;$/Code$ - undefined / local + undefined / undefined - Nothing + Number + - disableSerialization + openYoutubeVideo - Disable saving of script containing this command. After this, the script can work with data types which do not support serialization (UI types). - NOTE : When using spawn command, if the argument passed to it is Display or Control, an error will show asking to consider to disable serialization because of use of _this variable. What's more neither disableSerialization no use of uiNamespace will solve this. Passing Display or Control as part of an array however, will do the job: - $Code$ findDisplay 46 spawn { hint str _this}; // serialization error - [ findDisplay 46] spawn { hint str (_this select 0)}; // OK $/Code$ + Opens Steam overlay with given YT video. Video URL is the end part of the YT URL, starting with watch?v=.... If the user has Steam overlay disabled, the command will display appropriate message to the user and return false. - https://community.bistudio.com/wiki/disableSerialization + https://community.bistudio.com/wiki/openYoutubeVideo - disableSerialization + openYoutubeVideo String - disableSerialization + openYoutubeVideo youTubeUrl - $Code$disableSerialization ; - _display = findDisplay 46;$/Code$ + $Code$//Open http://www.youtube.com/watch?v=UBIAbm7Rt78 + _isOpened = openYoutubeVideo "watch?v=UBIAbm7Rt78";$/Code$ undefined / undefined - (19 June, 2010) - Can be used to detecting load. Scope with disabled serialization is discontinued after load, even if there's endless loop inside. - _loaded = [] spawn { disableSerialization ; waitUntil { false };}; - waitUntil { scriptDone _loaded;}; - hint "Game was loaded!" - Works for all possible load types - loading user save, loading autosave and resuming mission from main menu. - Use with caution, as it handles two threads in memory, having impact at overall scripting time. - - (23 October, 2013) - If you do not store UI elements ( Display, Control ) in variables, you do not need disableSerialization ; UI elements are usually returned by scripting commands such as findDisplay or passed as params in UI event handler scripts ( displayAddEventHandler, ctrlAddEventHandler ). - This code will require disableSerialization : $Code$ disableSerialization ; - _display = findDisplay 123; - _ctrl = _display displayCtrl -1; - _ctrl ctrlSetText "LOL";$/Code$ - This code will not: $Code$ findDisplay 123 displayCtrl -1 ctrlSetText "LOL";$/Code$ - - (July 25, 2017) - In ArmA 3 1.72.142223, a scripted FSM does somehow not work with disableSerialization. As a workaround, store a display inside an array. - Example: $Code$_d = [ findDisplay idd ];$/Code$ - Nothing + Boolean + - disableTIEquipment + inRangeOfArtillery - Disables TI (Thermal Imaging) equipment for given vehicle. In older versions of Arma this command would also disable NV (Night Vision), but since Arma 3 v1.52.132676 this command disables only TI. Use disableNVGEquipment to disable NV. + Returns true if all given units are able to fire at given position with given magazineType. - https://community.bistudio.com/wiki/disableTIEquipment + https://community.bistudio.com/wiki/inRangeOfArtillery - Object disableTIEquipment Boolean + Position inRangeOfArtillery Array - vehicle disableTIEquipment state + pos inRangeOfArtillery [[unit], magazineType] - $Code$vehicle player disableTIEquipment true ;$/Code$ - - $Code$_tank disableTIEquipment true ;$/Code$ + $Code$_isInRange = getMarkerPos "myTarget" inRangeOfArtillery [[myArty], "32Rnd_155mm_Mo_shells"]$/Code$ - global / global + global / undefined + (July 10, 2015) + Using an empty artillery vehicle will return false. - Nothing + Boolean + - disableUAVConnectability + set3DENIconsVisible - Disables unit's AV terminal(s) connecting to UAV. + Toggle visibility of Eden Editor icons. - https://community.bistudio.com/wiki/disableUAVConnectability + https://community.bistudio.com/wiki/set3DENIconsVisible - Object disableUAVConnectability Array + set3DENIconsVisible Array - object disableUAVConnectability [uav, checkAllItems] + set3DENIconsVisible [showMap, showScene] - $Code$unit disableUAVConnectability [uav,true];$/Code$ + $Code$set3DENIconsVisible [ false, false ]; + // Hide all icons$/Code$ undefined / undefined @@ -19997,152 +21025,118 @@ - Nothing + Nothing + - disableUserInput + removeMenuItem - Disable and enable the keyboard and mouse input, usually used during cutscenes. - Be careful with the usage of this command, always remember to enable the user input again, as once the user input is disabled, you can only shut down OFP but not exit the mission with escape. + Removes a previously added menu item. + i + Some Old Editor Command - https://community.bistudio.com/wiki/disableUserInput + https://community.bistudio.com/wiki/removeMenuItem - disableUserInput Boolean + Control removeMenuItem Number - disableUserInput state + map removeMenuItem index - $Code$disableUserInput true - ; cutscene - disableUserInput false$/Code$ - + - undefined / local + undefined / undefined - (14 March 2014) - Sometimes, when disableUserInput true command is invoked while the user is holding a button, when disableUserInput false is called and the user is no longer holding the button, the input will resume as if the user is still holding the button. To reset this behaviour, disable and enable user input again in the same frame: - $Code$ disableUserInput true ; - //do something - disableUserInput false ; - disableUserInput true ; - disableUserInput false ;$/Code$ - Unfortunately, if the user is moving mouse when disableUserInput true command is invoked, the mouse input will get stuck for the whole duration of disabled user input but will reset as soon as disableUserInput false is called. I was unable to find workaround for this one. - Nothing + Nothing + - displayAddEventHandler + debriefingText - Adds an event handler to the given display. Returns the ID of the event handler, or -1 when failed. - Returning true in EH code will override default engine handling for keyboard events. - See User Interface Event Handlers for the full list of event names. - If applicable, see DIK_KeyCodes for a list of key code constants, which are relevant to key related user interface events like: KeyDown & KeyUp. - NOTE: Display EHs are processed in reversed order, i.e. last added: first, first added: last. So if you have an override it should be set up in the 1st added EH. + Returns debriefing text. - https://community.bistudio.com/wiki/displayAddEventHandler + https://community.bistudio.com/wiki/debriefingText - Display displayAddEventHandler Array + debriefingText String - display displayAddEventHandler [eventName, code] + debriefingText end - $Code$moduleName_keyDownEHId = ( findDisplay 46) displayAddEventHandler ["KeyDown", " hint str _this;"];$/Code$ - - $Code$moduleName_keyDownEHId = findDisplay 46 displayAddEventHandler ["KeyDown", { hint str _this}];$/Code$ + $Code$_deathText = debriefingText "endDeath";$/Code$ undefined / undefined - (October 30, 2013) - As of Arma 3 v1.05.111658 ctrlAddEventHandler and displayAddEventHandler support script Code in addition to String [1] - - (March 10, 2014) - From within an Addon, you must assign the events from a spawned script. eg $Code$[] spawn { (findDisplay 46) displayAddEventHandler["KeyDown","_this call my_KeyDownFunctionhandler"]; };$/Code$ - - (January 22, 2016) - Be sure to wait until the main display is initialized before using this command by using: $Code$waituntil {!isnull (finddisplay 46)};$/Code$ - - (May 28, 2017) - use #define if you want the displayEventHandler to use data that is defined in the same file in which the command is executed. - However, that does not work if you use STRING as 'code'. In case of STRING, use the format command around it. - - (August 7, 2017) - Using KeyUp you can't override default engine action by returning true ( A3 1.72.142342 ) - Number + String + - displayCtrl + gearSlotAmmoCount - Return child control with specified idc. + Returns ammo count of assigned magazine. - https://community.bistudio.com/wiki/displayCtrl + https://community.bistudio.com/wiki/gearSlotAmmoCount - Display displayCtrl Number + gearSlotAmmoCount Control - display displayCtrl idc + gearSlotAmmoCount control - $Code$_ChildControl = _ParentDisplay displayCtrl 101;$/Code$ + $Code$ammo = gearSlotAmmoCount _control;$/Code$ undefined / undefined - (May 1, 2017) - Since Arma 3 1.42 you can also return a control inside a controls group using controlsGroupCtrl (created with ctrlCreate or inside a controls[] of a control config). Example: - $Code$((uiNamespace getVariable "RscUnitInfo") displayCtrl 2303) controlsGroupCtrl 154; // Display - Controls Group - Control$/Code$ - Note that control inside controls group having -1 IDC currently cannot be returned in any way. - Control + Number + - displayNull + preloadCamera - A non-existing Display. To compare non-existent displays use isNull or isEqualTo : - displayNull == displayNull ; // false - isNull displayNull ; // true - displayNull isEqualTo displayNull ; // true + Preload all textures and models around given Position to avoid visual artifacts after camera is moved. + Should be used before any abrupt camera change/cut. + Returns true once all data is ready. - https://community.bistudio.com/wiki/displayNull + https://community.bistudio.com/wiki/preloadCamera - displayNull + preloadCamera Array - displayNull + preloadCamera position - $Code$! isNull displayNull ; // false$/Code$ - - $Code$str displayNull ; // No display$/Code$ + $Code$waitUntil { preloadCamera markerPos "cam_location_2"};$/Code$ undefined / undefined @@ -20150,27 +21144,28 @@ - Display + Boolean + - displayParent + isInstructorFigureEnabled - Returns parent display of the given display. + Returns the status of INSTRUCTOR FIGURE setting in UI (OPTIONS GAME GENERAL INSTRUCTOR FIGURE). - https://community.bistudio.com/wiki/displayParent + https://community.bistudio.com/wiki/isInstructorFigureEnabled - displayParent Display + isInstructorFigureEnabled - displayParent display + isInstructorFigureEnabled - $Code$_display = displayParent findDisplay 49; // Display #46$/Code$ + $Code$hint str isInstructorFigureEnabled ;$/Code$ undefined / undefined @@ -20178,24 +21173,25 @@ - Display + Boolean + - displayRemoveAllEventHandlers + missionName - Remove all event handlers from the given display. + Return currently loaded mission file (path to mission.pbo, relative to game exe). - https://community.bistudio.com/wiki/displayRemoveAllEventHandlers + https://community.bistudio.com/wiki/missionName - Display displayRemoveAllEventHandlers String + missionName - display displayRemoveAllEventHandlers handlerName + missionName @@ -20203,260 +21199,214 @@ undefined / undefined + (2nd August, 2010) + Only works in SP and on the MP Host/DS. It returns the mission pboprefix if available, otherwise the pboname. For clients it returns '__cur_mp'. + + (September 25, 2014) + In OFP (up to v1.96) it returns the mission filename. In CWA (since v1.99), it returns the briefing name instead when in multiplayer. The string displayed is that set in the Intel section of the mission editor. - Nothing + String + - displayRemoveEventHandler + camPrepareRelPos - Remove a given event handler from the given display. + Prepares the camera position relative to the current position of the currect target (see camPrepareTarget ). - https://community.bistudio.com/wiki/displayRemoveEventHandler + https://community.bistudio.com/wiki/camPrepareRelPos - Display displayRemoveEventHandler Array + Object camPrepareRelPos Array - display displayRemoveEventHandler [handler name,id] + camera camPrepareRelPos position - + $Code$_camera camPrepareRelPos [10,5,-2]$/Code$ + undefined / undefined - (April 19, 2015) - If you for example used this code to add the eventHandler: - $Code$_myEH = (findDisplay 46) displayAddEventHandler ["KeyDown", "hint str _this"];$/Code$ - Then this would be the correct code to remove that eventHandler again: - $Code$(findDisplay 46) displayRemoveEventHandler ["KeyDown", _myEH];$/Code$ - Nothing + Nothing + - displaySetEventHandler + findEditorObject - Sets given event handler of given display. - The return code of the provided function should indicate whether this event was handled correctly. This implies telling the engine whether it's default code should be executed. - See User Interface Event Handlers for the full list of handler names. - If applicable, see DIK_KeyCodes for a list of key code constants, which are relevant to key related user interface events like: KeyDown & KeyUp. + Return object that matches the provided reference. + i + Some Old Editor Command - https://community.bistudio.com/wiki/displaySetEventHandler + https://community.bistudio.com/wiki/findEditorObject - Display displaySetEventHandler Array + Control findEditorObject Any_Value - display displaySetEventHandler [handlerName, function] + map findEditorObject value - $Code$_control displaySetEventHandler ["KeyDown", ""]$/Code$ - - $Code$init.sqf - keyspressed = compile preprocessFile "keyspressed.sqf"; - _display = findDisplay 46; - _display displaySetEventHandler ["KeyDown","_this call keyspressed"]; - keyspressed.sqf - private['_handled']; - _handled = false; - switch (_this select 1) do - { - //F key - case 33: - { - // code here - _handled = true; - }; - }; - _handled;$/Code$ - + undefined / undefined - (Nov 25, 2009) - Always use displayAddEventHandler instead, as DSetEH overwrites other (peoples') DEH. - Nothing + String + - dissolveTeam + ctrlScale - Dissolves the given team. All members become members of the main team. Possible team values are: "RED", "GREEN", "BLUE" or "YELLOW". + Returns the current scale of the control. - https://community.bistudio.com/wiki/dissolveTeam + https://community.bistudio.com/wiki/ctrlScale - dissolveTeam String + ctrlScale Control - dissolveTeam teamColor + ctrlScale controlName - $Code$dissolveTeam "RED"$/Code$ + $Code$_scale = ctrlScale _control$/Code$ - local / undefined + undefined / undefined - Nothing + Number + - distance2D + visibleCompass - Returns a 2D distance ( distance projected to X,Y plane) in meters between two Objects or two Positions or Object and Position. + Checks if the player has compass opened and visible - https://community.bistudio.com/wiki/distance2D + https://community.bistudio.com/wiki/visibleCompass - Object/Array distance2D Object/Array + visibleCompass - param1 distance2D param2 + visibleCompass - $Code$_meters = player distance2D heli;$/Code$ + $Code$if ( visibleCompass ) then { hint "Compass is visible"};$/Code$ - global / undefined + undefined / undefined - Number + Boolean + - distanceSqr + enableRopeAttach - Computes the squared distance between two objects or positions. + Enable/disable ability to attach or be attached to ropes for given vehicle - https://community.bistudio.com/wiki/distanceSqr + https://community.bistudio.com/wiki/enableRopeAttach - Object/Position distanceSqr Object/Position + Object enableRopeAttach Boolean - var1 distanceSqr var2 + vehicle enableRopeAttach enable - $Code$player distanceSqr ( leader player )$/Code$ - - $Code$_distance = sqrt ((x2 - x1) ^ 2 + (y2 - y1) ^ 2 + (z2 - z1) ^ 2); - _distanceSqr = (x2 - x1) ^ 2 + (y2 - y1) ^ 2 + (z2 - z1) ^ 2; - _distance = [x1, y1, z1] distance [x2, y2, z2]; - _distanceSqr = [x1, y1, z1] distanceSqr [x2, y2, z2]; - _distance = sqrt ([x1, y1, z1] distanceSqr [x2, y2, z2]); - _distanceSqr = ([x1, y1, z1] distance [x2, y2, z2]) ^ 2;$/Code$ + $Code$( vehicle player ) enableRopeAttach false ;$/Code$ undefined / undefined + (05 April, 2014) + Attachable nearby vehicles may not update on Sling Load Assistant until re-opened. - Number + Nothing + - distance + removeWeaponTurret - Returns a distance in meters between Objects, Positions or Locations. - NOTE: If positions are supplied as arguments, the coordinates are treated as PositionATL if over the land and as PositionASLW if over the sea. If 2D position is supplied, z is assumed 0. + Removes weapon from the turret. Use turret path [-1] for driver's turret. - https://community.bistudio.com/wiki/distance + https://community.bistudio.com/wiki/removeWeaponTurret - Object/Array distance Object/Array - - Location/Array distance Location/Array + Object removeWeaponTurret Array - param1 distance param2 - - location1 distance location2 + vehicle removeWeaponTurret [weaponName, turretPath] - $Code$_meters = player distance _object;$/Code$ - - $Code$_meters = player distance [1,2,3];$/Code$ - - $Code$_meters = [1,2,3] distance [4,5,6];$/Code$ + $Code$_tank removeWeaponTurret ["LMG_M200",[0,0]];$/Code$ - $Code$_meters = position player distance nearestLocation [ position player, "hill"];$/Code$ + $Code$vehicle player removeWeaponTurret ["SportCarHorn",[-1]];$/Code$ - global / undefined + local / global - (Feb 14, 2007) - distance to position3D (array) doesnt work with OFP, only objects - Armed Assault: - position3D (array) and object works - - (Mar 10, 2010) - This returns the map distance, not the vector distance, [0,0,0] distance [0,0,1] can be 1 or 1, not exactly 1; unlike the vector math. - - (Aug 03, 2012) - If a position in format [x, y, z] is provided for both arguments, distance also checks the z dimension as well. Ie: - player distance [0,0,200] - will return 200, if the player is at this position at ground/sea level. - - (March 22, 2014) - When objects are supplied as arguments, distance is calculated from their model center (object modelToWorld [0,0,0]), and not the position returned by getPos/ATL/ASL. - However, this is not relevant for units, as their model center matches their world position. - Number - Number + Nothing + - distributionRegion + sideEmpty - Returns the numerical index for the distribution region of this copy of ArmA. - 1 - US - 2 - Rest of the world + Returns empty side, for example static buildings in Eden Editor. - https://community.bistudio.com/wiki/distributionRegion + https://community.bistudio.com/wiki/sideEmpty - distributionRegion + sideEmpty - distributionRegion + sideEmpty - $Code$distributionRegion == 1$/Code$ + $Code$_sideEmpty = sideEmpty ;$/Code$ undefined / undefined @@ -20464,63 +21414,72 @@ - Number + Side + - do + addWaypoint - Executes code. Used as part of construct, such as while, with, for and switch. The code is always executed in missionNamespace unless do is used with with as an argument. + Adds (or inserts when index is given) a new waypoint to a group. + The waypoint is placed randomly within a circle with the given center and radius. + The function returns a waypoint with format [group, index]. - https://community.bistudio.com/wiki/do + https://community.bistudio.com/wiki/addWaypoint - While_Type/With_Type/For_Type/Switch_Type do Code + Group addWaypoint Array - construct do code + groupName addWaypoint [center, radius, index, name] - $Code$while {b a} do {a = a + 1};$/Code$ - - $Code$// A practical example: Repair all members of a group to such a level that they are able to stand up: - { - while {! canStand _x && alive _x } do { - _x setDamage ( damage _x - 0.01); - }; - } forEach units group unitname;$/Code$ + $Code$_wp =_grp addWaypoint [ position player, 0];$/Code$ - undefined / undefined + global / global + (November 26, 2009) + In game versions prior to Arma 3 v1.22: + If you add a waypoint to your group and then want them to start moving to that waypoint, make sure to call setWaypointType "MOVE" on your waypoint. + + (18:23, 28 April 2011 (CEST)) + In VBS2 1.30, the randomization of addWaypoint doesn't seem to work correctly all of the time. + The alternative syntax of addWaypoint with a specified index doesn't seem to work correctly. + + (June 21, 2014) + if you want to create a waypoint of type "MOVE" and set it as actual waypoint, you can use the move command that does everything for you with only one line of code ! Be aware that move command intercepts multiple waypoints and it will not line up in waypoints queue. In other word it is a quick solution if you want your group to get only one waypoint, but for several waypoints you'll have to use addwaypoint and all setwaypointXXXXXX commands around. see move command. + + (August 4, 2014) + The waypoint may not be created exactly at the center position even if radius is zero. The position will be moved away if there are e.g. rocks at the center position or if it is placed at the edge of water on a shore. - Anything + Array + - do3DENAction + leaderboardGetRows - Performs given Eden Editor action. - See the list of all actions. + Returns an array with values for the given leaderboard, the array is in format: [[player1Name, score, rank], [player2Name, score, rank], [player3Name, score, rank]... ]; This can be called after the one of the row request function has been called and successfully finished! - https://community.bistudio.com/wiki/do3DENAction + https://community.bistudio.com/wiki/leaderboardGetRows - do3DENAction String + leaderboardGetRows String - do3DENAction action + leaderboardGetRows boardName - $Code$do3DENAction "MissionSave";// saves the scenario$/Code$ + $Code$leaderboardGetRows "TT01"$/Code$ undefined / undefined @@ -20528,807 +21487,772 @@ - Nothing + Array + - doArtilleryFire + visibleMap - Orders a unit to reload defined magazine commence fire burst on the given position (silently). + Return true if the main map is shown (active). - https://community.bistudio.com/wiki/doArtilleryFire + https://community.bistudio.com/wiki/visibleMap - Object doArtilleryFire Array + visibleMap - unit doArtilleryFire [position, type, rounds] + visibleMap - $Code$mortar1 doArtilleryFire [[3000, 120, 1000], "8Rnd_82mm_Mo_shells", 3];$/Code$ + $Code$if (visibleMap) then {hint "You're showing the map !"}$/Code$ undefined / undefined + (13 November 2017) + visibleMap does not work in all cases where a map might be part of a dialog like in a uav terminal or in a artillery computer dialog. Some of these cases can be covered with an addMissionEventHandler of type "Map". Just use the two magic variables 'mapIsOpened' and 'mapIsForced'. Skeleton might look something like + // update marker as long as map is open (works for uav stations as well) + J_myGPSEH = addMissionEventHandler ["Map", { + params ["_mapIsOpened", "_mapIsForced"]; + if (_mapIsOpened) then { + systemChat "GPS aktiv"; + J_var_GPSOn = true; + // no sheduled environment - create one + /* Triggered when map is opened or closed either by user action or script command openMap. */ + [] spawn { + waitUntil{ + ... // do something as long as map is open; + not J_var_GPSOn + }; + }; + } else { + J_var_GPSOn = false; + systemChat "GPS inaktiv"; + }; + }]; - Nothing + Boolean + - doFSM + allowFileOperations - Orders a unit to process command defined by FSM file (silently). - Unlike with execFSM where _this is passed to the FSM, the following parameters are passed when using doFSM/commandFSM: - _leader - leader of subgroup with this command - _destination - command destination/position - _target - command target - _units - list of all persons in subgroup + Allow/dissallow file ops (load/save etc). + i + Some Old Editor Command - https://community.bistudio.com/wiki/doFSM + https://community.bistudio.com/wiki/allowFileOperations - Object/Array doFSM Array + Control allowFileOperations Boolean - unit doFSM [fsmName, position, target] + map allowFileOperations bool - $Code$_soldierOne doFSM ["move.fsm", position player, player ];$/Code$ - + undefined / undefined - (August 4, 2010) - Do not doStop a unit in a FSM called with doFSM or commandFSM. Doing so nevertheless will halt your FSM, since no links are followed anymore (doing so in an end state should be fine though). Also this may crash your game in certain mysterious circumstances. - You may design your FSM so that they may be called with doFSM/commandFSM and execFSM likewise by checking if _units or _this is nil and then init the variables accordingly. Just remember that you should use the low level moveTo (together with moveToCompleted, moveToFailed ) if do-/commandFSM'd, and doMove or commandMove (together with unitReady ) if execFSM'd. A moveTo in an FSM started with execFSM won't do anything, likewise doMove in a FSM started with doFSM or commandFSM wont work either. Think about it for a minute and you will see why. (hint: a unit running a FSM called with doFSM or commandFSM will _never_ return true for (unitReady _unit) ) - Anyway, if you want to be able to call your FSM either way, a "ready" condition might look light this: (moveToCompleted _unit) || (moveToFailed _unit) || (unitReady _unit), assuming you have a moveTo or a doMove (depending on how the fsm is called) in the prior state. - - (February 14, 2015) - Adding to Rübe's note, doFSM can be checked if it has finished by unitReady as of 2015 and it will return true when your FSM has completed. - Nothing + Nothing + - doFire + assignToAirport - Order the given unit(s) to fire on the given target (without radio messages). - The target is set with doTarget or commandTarget. - The target can be a unit or a vehicle, but not an object. + Not correctly implemented yet, currently it does the same as landAt. As the implementation may get fixed sometime, please do not use this command until then. - https://community.bistudio.com/wiki/doFire + https://community.bistudio.com/wiki/assignToAirport - Object/Array doFire Object + Object assignToAirport Number + + Object assignToAirport Object - unitName doFire target + plane assignToAirport id + + plane assignToAirport target - $Code$_ESoldier1 doFire _WSoldier1;$/Code$ + $Code$plane1 assignToAirport 0$/Code$ - local / global + undefined / undefined - (August 3, 2006) - Notes from before the conversion: - It is often helpful to use doTarget first. - - (March 25, 2007) - A unit will not execute this command when his behaviour is set to "careless". - - (Feb 18, 2012) - Board dofire not working in arma2 1.11. an entity he throws he shoots not only. - - (June 7, 2012) - Unitname dofire objnull does not work like it does in commandfire. Target var has to be real (Arma2 AO) might be different in other versions. - Nothing + Nothing - Nothing + - doFollow + setSimpleTaskAlwaysVisible - Order the given unit(s) to follow the given other unit or vehicle eg (without radio messages). Also is used to resume unit formation after doStop, just doFollow leader even if it is the leader himself you want to resume (see Example 2). + Makes the given task allways visible or not. - https://community.bistudio.com/wiki/doFollow + https://community.bistudio.com/wiki/setSimpleTaskAlwaysVisible - Object/Array doFollow Object + Task setSimpleTaskAlwaysVisible Boolean - unitName doFollow unitName2 + taskID setSimpleTaskAlwaysVisible state - $Code$_soldier1 doFollow _soldier2$/Code$ - - $Code$units _group doFollow leader _group;$/Code$ + $Code$getWarka setSimpleTaskAlwaysVisible true ;$/Code$ - local / global + undefined / undefined - These commands ( doFollow or commandFollow ) work only if the two units are in the same group. - - (August 29, 2016) - The name of this command is a bit misleading, it is used to make a unit return to the formation of its group or subformation. - Nothing + Nothing + - doGetOut + enginesRpmRTD - Orders a unit or units to get out from the vehicle (silently). + Returns all engines RPM - https://community.bistudio.com/wiki/doGetOut + https://community.bistudio.com/wiki/enginesRpmRTD - doGetOut Object/Array + enginesRpmRTD Object - doGetOut unit + enginesRpmRTD RTD_helicopter - $Code$doGetOut _unitOne$/Code$ + $Code$_UH80_E1 = ( enginesRpmRTD _UH80) select 0;//engine 1 RPM + _UH80_E2 = ( enginesRpmRTD _UH80) select 1;//engine 2 RPM$/Code$ - local / global + undefined / undefined - Nothing + Array + - doMove + isRemoteExecutedJIP - Order the given unit(s) to move to the given position (without radio messages). After reaching his destination, the unit will immediately return to formation (if in a group); or order his group to form around his new position (if a group leader). Use doStop to stop units returning to formation. + Returns true if the code context is being remote executed from the JIP queue by remoteExec or remoteExecCall (when JIP param was set). It is a subset of isRemoteExecuted : + Normal remote execution: + isRemoteExecuted - true + isRemoteExecutedJIP - false + Remote execution from JIP queue: + isRemoteExecuted - true + isRemoteExecutedJIP - true + In SP always returns false. - https://community.bistudio.com/wiki/doMove + https://community.bistudio.com/wiki/isRemoteExecutedJIP - Object/Array doMove Array + isRemoteExecutedJIP - unit doMove position + isRemoteExecutedJIP - $Code$_soldier1 doMove ( position _officer);$/Code$ - - $Code$this doMove ( getMarkerPos "Marker1");$/Code$ + $Code$_remoteExecutedJIP = isRemoteExecutedJIP ;$/Code$ - local / global + undefined / undefined - (February 9, 2008) - If doMove is to be used in conjunction with waypoint behavior commands (e.g. setSpeedMode ), then those have to be issued after the move command to have an effect. Otherwise the move will be done with the default settings. - - (February 3, 2009) - If a unit is part of a group, and is not the leader, the unit will fall back into formation soon after the domove is completed. This does not happen for units that are in a group alone (because they are their own leader). - There is no single command to get a unit to move to a position and stay there. The best way to do this is to issue a domove, then wait for the unit to reach his destination, then disable his movement AI. VBS2 users can use the fn_vbs_doMoveEx function. - Nothing + Boolean + - doStop + createSimpleTask - Order the given unit(s) to stop (without radio messages). The units stopped in this way will leave the groups formation. It will prevent them from moving around with their group (or formation leader), while still being able to turn around and even move to a new position if they see fit. The units will still respond to orders from their group leader (like engage, rearm, board a vehicle), but all of their actions will be separate from the group formation. To resume group default behaviour, use doFollow command. For example: units _group doFollow leader _group; + Creates a new Task. The task effect is local, it will only exist on PC it was added. - https://community.bistudio.com/wiki/doStop + https://community.bistudio.com/wiki/createSimpleTask - doStop Object/Array + Object createSimpleTask Array - doStop unit + person createSimpleTask [name, parentTask ] - $Code$doStop _soldier1;$/Code$ - - $Code$doStop [_soldier1, _soldier2];$/Code$ + $Code$_currentTask = player createSimpleTask ["NewTask"];$/Code$ - $Code$doStop ( units player );$/Code$ + $Code$_childTask = player createSimpleTask ["ChildTask", _currentTask];$/Code$ - global / global + global / local - (August 3, 2006) - Notes from before the conversion: - This command will make the unit stop where he is until the unit's group engages the enemy. At that time, the unit will move and fight the enemy. One good use for this is to place a bunch of units in the same group around a campfire or in some other place "for looks", and make them sit down or have their weapon on their back. When the enemy is spotted, they will get up and attack. Note that you cannot do something like place somebody behind sandbags and keep him there during a fight with this command. For that you will need disableAI "move". - - In ArmA 1.14, this command will not stop a unit that has been given a move order by selecting the unit, then clicking on the in game map (or ground). - - doStop'ed units WILL return to formation if their leader's behaviour isn't set to "COMBAT". The squad leader will also order everyone to return to formation if there are no enemies nearby in a set period of time, overwriting the doStop command. doStop can be best used to simply stop the unit from doing whatever he is currently doing without radio messages. - - (December 23, 2016) - When a unit reaches position given with doMove, unitReady becomes true. If doStop command is not executed, unit will start wondering on its own soon after, especially if unit is under fire. doStop will keep unit at the given position, but watch out for unitReady as it will become false since unit is holding position indefinitely. - - (December 27, 2016) - Although it is possible to resume group default behaviour by joining units into own group like this units _group joinSilent _group there is a risk that the leader will change. Instead use doFollow command as explained in the description. + (July 02, 2011) + Creating child will position the new task just under the parent task. + Creating another "normal" (parent) task will create a new line above the others. Think of it if you want ordered objectives. + Succeeding parent task will automatically succeed childs, whatever their taskState was set to. (I.E. If a task is set as a child to another, it will be completed when its parent is complete.. no matter if the child task really was or not). + This command has to be executed again for it to be applied for JIP players - no server sync + Full step by step code from beginning to end: + Step 1: create a new simpleTask + $Code$ + A_SIMPLE_TASK = player createSimpleTask [( localize "STR_aSimpleTask")]; + $/Code$ + You may create a task at any given point in time. You just need to be aware of the fact, that you've created the task for a single unit (the player). So if you make use of teamSwitch, respawn or similiar, you need to think about how to manage this, so all of these units will have up to date tasks assigned to them. + Second, it's a good practice to use a stringtable, even if you do not plan (yet) to offer translations. + Step 2: task destination + $Code$ + A_SIMPLE_TASK setSimpleTaskDestination _destination; + $/Code$ + variable/pointer-to-your-task setSimpleTaskDestination some-position. That's it. + Step 3: task description + $Code$ + A_SIMPLE_TASK setSimpleTaskDescription [ + ( localize "STR_aSimpleTaskLongText"), + ( localize "STR_aSimpleTask"), + ( localize "STR_aSimpleTaskWaypointLabel") + ]; + $/Code$ + Again, no magic involved here. You take your task, the command setSimpleTaskDescription an pass an array with three strings in it. The first string is the long description text, the second is the name/title of the task and the last one will show up on-screen on the waypoint in cadet mode. + Step 4: set and update task states + $Code$ + A_SIMPLE_TASK setTaskState "CREATED"; + $/Code$ + And that's it. Here a minimal working example: + $Code$ + A_SIMPLE_TASK = player createSimpleTask ["simple task title"]; + A_SIMPLE_TASK setSimpleTaskDestination ( position player ); + A_SIMPLE_TASK setSimpleTaskDescription [ + "simple task long description", + "simple task title", + "simple task waypoint label" + ]; + A_SIMPLE_TASK setTaskState "CREATED"; + $/Code$ + And then later in the mission: + $Code$ + A_SIMPLE_TASK setTaskState "SUCCEEDED"; + $/Code$ + If you want to keep the player in the loop about the status of tasks, you may always do this: + $Code$ + [ objNull, objNull, A_SIMPLE_TASK, "SUCCEEDED"] execVM "CA\Modules\MP\data\scriptCommands\taskHint.sqf"; + $/Code$ - Nothing + Task + - doSuppressiveFire + getDirVisual - Order the given unit to suppress a given position or target (without radio messages). + Returns object's heading in the range from 0 to 360 in render time scope. - https://community.bistudio.com/wiki/doSuppressiveFire + https://community.bistudio.com/wiki/getDirVisual - Object/Array doSuppressiveFire Object/Array + getDirVisual Object - unitName doSuppressiveFire target + getDirVisual object - $Code$_soldier doSuppressiveFire [1869.508,5760.962,0.000]$/Code$ - - $Code$_soldier doSuppressiveFire cursorTarget$/Code$ + $Code$_dir = getDirVisual player ;$/Code$ - local / local + global / undefined - (October 8, 2016) - Command expects position as second argument in format ASL in A3 1.64.138497. - Nothing + Number + - doTarget + joinString - Order the given unit(s) to target the given target (without radio messages). + Joins array into String with provided separator. Array can be of mixed types, all elements will be converted to String prior to joining, but the fastest operation is on the array of Strings. - https://community.bistudio.com/wiki/doTarget + https://community.bistudio.com/wiki/joinString - Object/Array doTarget Object + Array joinString String - unit doTarget target + array joinString separator - $Code$_ESoldier1 doTarget _WSoldier1;$/Code$ + $Code$_str = "- This, is a sample string." splitString "-,. "; // ["This","is","a","sample","string"] + _str joinString " "; // "This is a sample string"$/Code$ + + $Code$["This","is","sparta"] joinString " ~ "; // "This ~ is ~ sparta"$/Code$ + + $Code$["1",2, text "3"] joinString ""; // "123"$/Code$ + + $Code$["test","test"] joinString toString [12345] splitString toString [12345]; // ["test","test"]$/Code$ + + $Code$"Japa is the best!" splitString "" joinString " "; // "J a p a i s t h e b e s t !"$/Code$ + + $Code$// Remove all \r\n from file: + loadFile "somefile.txt" splitString toString [13,10] joinString " "$/Code$ - local / global + undefined / undefined - It appears doTarget objNull can not be used to stop a unit targeting a previously assigned target. Using doWatch objNull will achieve the desired result. (ArmA v1.12Beta) - - (July 2, 2015) - To expand on ceeeb's note, commandWatch objNull will also unassign target; - - (March 28, 2017) - Targeting may not work as expected when trying to target a unit on the same side (friendly). - Nothing + String + - doWatch + setLightDayLight - Order the given unit(s) to watch the given position or target (without radio messages). Use objNull as the target to order a unit to stop watching a position/target. + Sets if light can be used during the day. - https://community.bistudio.com/wiki/doWatch + https://community.bistudio.com/wiki/setLightDayLight - Object/Array doWatch Array - - Object/Array doWatch Object + Object setLightDayLight Boolean - unit doWatch position - - unit doWatch target + light setLightDayLight bool - $Code$_soldierOne doWatch markerPos "MarkerMoveOne" - // The unit named "soldierOne" will watch the position where the marker "MarkerMoveOne" is placed.$/Code$ - - $Code$_soldierOne doWatch _eastSoldier - // The unit named "soldierOne" will watch the unit named "eastSoldier".$/Code$ + $Code$myLight setLightDayLight true;$/Code$ - local / global + local / local - (April 18, 2015) - Also controls where a vehicle gunner aims. - Nothing - Nothing + Nothing + - doorPhase + vectorDirVisual - Return animation phase of door on vehicle. + Return object's normalized direction vector in world space ( [x,y,z] ) in render time scope. + A unit facing North would return [0,1,0] + A unit facing East would return [1,0,0] + A unit facing South would return [0,-1,0] + A unit facing West would return [-1,0,0] - https://community.bistudio.com/wiki/doorPhase + https://community.bistudio.com/wiki/vectorDirVisual - Object doorPhase String + vectorDirVisual Object - object doorPhase door + vectorDirVisual objectName - $Code$_phase = heli doorPhase "door_L";$/Code$ + $Code$_dirVector = vectorDirVisual _unit;$/Code$ - undefined / undefined + global / undefined - Number + Array + - drawArrow + setAirportSide - Draws a single line arrow on the map. To draw a color filled arrow of custom shape see BIS_fnc_drawArrow + Set owning side of the airport. ID is the number to identify which airport on the island you want to check. - https://community.bistudio.com/wiki/drawArrow + https://community.bistudio.com/wiki/setAirportSide - Control drawArrow Array + Number setAirportSide Side + + Object setAirportSide Side - map drawArrow [from, to, color] + id setAirportSide side + + target setAirportSide side - $Code$findDisplay 12 displayCtrl 51 ctrlAddEventHandler ["Draw", - { - _this select 0 drawArrow [ - player, player getRelPos [100, 0], [1,0,0,1] - ]; - }];$/Code$ + $Code$0 setAirportSide east$/Code$ undefined / undefined - (July 7, 2015) - Be careful when using this command. Unlike map markers, the draw commands can decrease your framerate. - Nothing + Nothing - Nothing + - drawEllipse + isPlayer - Draws an ellipse on the map. Just like with marker or trigger area, negative a and b will result in hexagon. + Checks if given person is player. Returns true for headless clients as well. + In some cases, the identity of certain player units might fail to propagate to other clients and the server, which causes isPlayer and getPlayerUID to incorrectly return false and "", respectively, where the affected units are not local. [1] Therefore, beware of false negatives. - https://community.bistudio.com/wiki/drawEllipse + https://community.bistudio.com/wiki/isPlayer - Control drawEllipse Array + isPlayer Object - map drawEllipse [c, a, b, angle, color, fill] + isPlayer person - $Code$findDisplay 12 displayCtrl 51 ctrlAddEventHandler ["Draw", - { - _this select 0 drawEllipse [ - player, 10, 10, 0, [1, 0, 0, 1], "" - ]; - _this select 0 drawEllipse [ - player, -10, -10, 0, [1, 1, 1, 1], "#(rgb,8,8,3)color(1,0.6,0,1)" - ]; - _this select 0 drawEllipse [ - player, -10, -10, 90, [0, 0, 1, 1], "" - ]; - }];$/Code$ + $Code$if ( isPlayer _Soldier1) then { + _Soldier1 setDamage 1; + };$/Code$ + + $Code$_playerCount = { isPlayer _x} count playableUnits ;$/Code$ - undefined / undefined + global / undefined - (July 7, 2015) - Be careful when using this command. Unlike map markers, the draw commands can decrease your framerate. + (1 August, 2006) + This is not the same as testing object == player, because in MP it tests for any player, not only for the local one. If object is a vehicle, the test is done for the vehicle commander. - Nothing + Boolean + - drawIcon3D + linearConversion - Draws an ingame icon at a given position. Command has to be executed each frame. Use onEachFrame or addMissionEventHandler "Draw3D" + Converts given value from given "from" range to wanted "to" range. If clipping is set to true, the resulting value is guaranteed to be within "to" range no matter what. Say given range is 0 to 1 and wanted range is 0 to 100 (percent calculation). Given value 0.55 then will be linearConversion [0,1,0.55,0,100]; //55 but if given value is 1.1 linearConversion [0,1,1.1,0,100, false ]; //110 or if clipping is true linearConversion [0,1,1.1,0,100, true ]; //100 - https://community.bistudio.com/wiki/drawIcon3D + https://community.bistudio.com/wiki/linearConversion - drawIcon3D Array + linearConversion Array - drawIcon3D [texture, color, pos, width, height, angle, text, shadow, textSize, font, textAlign, drawSideArrows] + linearConversion [minFrom, maxFrom, value, minTo, maxTo, clip] - $Code$// Icon and text: - onEachFrame { - drawIcon3D ["targetIcon.paa", [1,1,1,1], getPos cursorTarget, 1, 1, 45, "Target", 1, 0.05, "TahomaB"]; - };$/Code$ + $Code$linearConversion [4, 8, 5, 0, 1, false ];$/Code$ - $Code$// Just text: - addMissionEventHandler ["Draw3D", { - drawIcon3D ["", [1,0,0,1], position cursorTarget, 0, 0, 0, "Target", 1, 0.05, "PuristaMedium"]; - }];$/Code$ + $Code$// Calculate days from 1/1/1970: + fnc_daysFromEpoc = + { + private _year = param [0]; + private _days = 0; + for "_i" from 1970 to _year - 1 do + { + _days = _days + round linearConversion [0, 1, dateToNumber [_i, 12, 31, 23, 59], 0, 365, false ]; + }; + _days + linearConversion [0, 1, dateToNumber _this, 0, 365, false ]; + }; + hint str ( date call fnc_daysFromEpoc);$/Code$ undefined / undefined - (August 31, 2013) - As command syntax indicates, this command expects icon position in format PositionAGL meaning that over the land it expects PositionATL and over the sea PositionASLW. Use additional ASLToAGL if needed. - To draw smooth moving icon for a moving object use visiblePosition and visiblePositionASL accordingly. - - (September 23, 2013) - This command works well with addon textures, however getting it to display mission textures is a bit tricky. Follow this guide : - - (April 19, 2014) - Just a little precision to KK's first comment, this command expects PositionASLW over the sea, not regular ASL. Luckily, modelToWorld returns ATL over land and ASLW over sea, so if you want the icon to stay the the same place, you should use this snippet to find the correct position: - $Code$_pos = visiblePositionASL _object; - _pos set [2, (_object modelToWorld [0,0,0]) select 2];$/Code$ - - (October 23, 2014) - drawIcon3D and BIS_fnc_addStackedEventHandler work well together. - Using formatting commands with drawIcon3D will not work, instead, they will be added to the string. - $Code$["uniqueID", "onEachFrame", - { - drawIcon3D["myIcon.jpg", [1,1,1,0.5], getPos player, 1, 1, 0, format["%1\n%2", "Dreaded", "Entity"]]; - }] call BIS_fnc_addStackedEventHandler;$/Code$ - Shown text will be Dreaded\nEntity. (A3 1.32.127785) - The "text" parameter must be a string. You cannot use Structured_Text. - $Code$["uniqueID", "onEachFrame", - { - drawIcon3D - [ - "myIcon.jpg", - [1,1,1,0.5], - getPos player, - 1, - 1, - 0, - parseText format[" t size='1.25' font='PuristaLight' color='#ff0000' %1%2 /t ", Dreaded, Entity] - ]; - }] call BIS_fnc_addStackedEventHandler;$/Code$ - (A3 1.32.127785) - - (November 13 (2014)) - Here's a practical example combining both drawLine3D and drawIcon3D. Note: You may want to use visiblePosition instead of getPos for moving objects. - $Code$DEADPILOTS = []; - { - if (getText (configfile "CfgVehicles" typeOf _x "textSingular") == "pilot") then { - DEADPILOTS pushBack _x; - }; - } forEach allDeadMen; - addMissionEventHandler ["Draw3D", { - if ( - { - player distance _x = 15 - } count DEADPILOTS 0 - ) then { - { - _corpsePos = getPos _x; - if (player distance _corpsePos = 15) then { - _line1_start = _corpsePos; - _line1_end = [(_line1_start select 0), (_line1_start select 1), 0.5]; - _line2_start = [(_line1_end select 0), (_line1_end select 1) + 0.5, (_line1_end select 2)]; - drawLine3D [_line1_start, _line1_end, [0,0,0,0.5]]; - drawLine3D [_line1_end, _line2_start, [0,0,0,0.5]]; - drawIcon3D ["\a3\ui_f\data\gui\cfg\hints\BasicLook_ca.paa", [0,0,0,0.5], _line2_start, 0.75, 0.75, 0]; - }; - } forEach DEADPILOTS; - }; - }]; + (Mar 29, 2014) + (A3 0.50) It is recommended to use linearConversion instead of BIS_fnc_linearConversion : + $Code$ linearConversion [0,100,50,0,50, true ]; //same as [[0,100],50,[0,50]] call BIS_fnc_linearConversion $/Code$ + As for clamp, true will disable new value out of its range while false won't: + $Code$ linearConversion [0,100,150,0,50, true ]; //return 50 + linearConversion [0,100,150,0,50, false ]; //return 75 $/Code$ - - (April 11, 2015) - Doesn't work when showHUD false, textAlign is broken, drawSideArrows will turn if angle is not 0 [1] - - (February 11, 2016) - You can also use getPosWorld, which works splendid in script performance. Here is an example: - $Code$addMissionEventHandler ["Draw3D", { _pos = getPosWorld player; drawIcon3D ["a3\ui_f\data\gui\Rsc\RscDisplayArsenal\radio_ca.paa", [1,1,1,1], [(_pos select 0),(_pos select 1), 1], 0.8, 0.8, 0, (name player), 1, 0.0315, "EtelkaMonospacePro"]; }];$/Code$ - Nothing + Number + - drawIcon + setLightUseFlare - Draw an icon on the map. The command needs to be called every frame, preferably with "Draw" control event handler ctrlAddEventHandler. + Sets if light has flare. - https://community.bistudio.com/wiki/drawIcon + https://community.bistudio.com/wiki/setLightUseFlare - Control drawIcon Array + Object setLightUseFlare Boolean - map drawIcon [texture, color, position, width, height, angle, text, shadow, textSize, font, align] + light setLightUseFlare bool - $Code$findDisplay 12 displayCtrl 51 ctrlAddEventHandler ["Draw", " - _this select 0 drawIcon [ - 'iconStaticMG', - [1,0,0,1], - getPos player, - 24, - 24, - getDir player, - 'Player Vehicle', - 1, - 0.03, - 'TahomaB', - 'right' - ] - "];$/Code$ + $Code$myLight setLightUseFlare true ;$/Code$ - undefined / undefined + local / local - (July 03, 2013) - Support of paremeters textSize, font and align is in the game since Arma 3 version 0.72. - - (March 22, 2014) - icon will always remain the same width and height, if you want an icon scaled to the map, use: $Code$( sizeInMeters * 0.15) * 10^(abs log (ctrlMapScale _ctrl))$/Code$ for width and height (guessimated). - - (July 20, 2014) - If you want only text with no icon, you can use "#(argb,8,8,3)color(0,0,0,0)" as texture. - - (July 7, 2015) - Be careful when using this command. Unlike map markers, the draw commands can decrease your framerate. - - (January 4, 2016) - Arma 3 1.54 - This command doesn't seem to play nice with onEachFrame. It seems to draw on the main screen while maintaing position relative to the map position - Example: - $Code$ onEachFrame { - findDisplay 12 displayCtrl 51 drawIcon ['iconStaticMG',[1,0,0,1], getPos player,24,24, getDir player,'Player Vehicle',1,0.03,'TahomaB','right']; - };$/Code$ - - (October 13, 2016) - If you unPBO the following addon: - $Code$@ui_f_data.pbo $/Code$ - You can find the possible icons inside this folder: - $Code$ui_f_data\map\vehicleicons$/Code$ - For example: - If you want to use "iconman_ca.paa" you will write "iconman" on the texture string. + (Mar 25, 2014) + 1. In ArmA3 ver 1.14 flare color can be changed via setLightColor. + 2. Flare won't have visual presentation in daytime. + 3. setLightUseFlare needs to be used together with setLightFlareSize and setLightFlareMaxDistance so that a flare can be seen. - Nothing + Nothing + - drawLine3D + lineBreak - Draws a line of a given color between two 3D positions. Command has to be executed each frame. Use onEachFrame or addMissionEventHandler "Draw3D". + Creates a structured text containing a line break. - https://community.bistudio.com/wiki/drawLine3D + https://community.bistudio.com/wiki/lineBreak - drawLine3D Array + lineBreak - drawLine3D [start, end, color] + lineBreak - $Code$onEachFrame { - drawLine3D [ getPos player, getPos cursorTarget, [1,1,1,1]]; - };$/Code$ + $Code$_txt = composeText ["First line", lineBreak, "Second line"];$/Code$ undefined / undefined - (August 31, 2013) - As command syntax indicates, this command expects starting and ending position in format PositionAGL meaning that over the land it expects PositionATL and over the sea PositionASLW. Use additional ASLToAGL and AGLToASL commands wherever is necessary. - $Code$ addMissionEventHandler ["Draw3D", { - drawLine3D [ ASLToAGL eyePos soldier1, ASLToAGL eyePos soldier2, [1,0,0,1]]; - }];$/Code$ - - (February 18, 2015) - Visible through fog and past draw distance. - Nothing + Structured_Text + - drawLine + addUniform - Draw a line on the map. + Create a new uniform and try to link it into uniform slot (given uniform has to be supported by allowedUniforms list of target soldier). To check if uniform is allowed use isUniformAllowed and to force add incompatible uniform use forceAddUniform - https://community.bistudio.com/wiki/drawLine + https://community.bistudio.com/wiki/addUniform - Control drawLine Array + Object addUniform String - map drawLine [position1, position2, color] + unit addUniform type - + $Code$_unit addUniform "U_B_CombatUniform_mcam";$/Code$ + - undefined / undefined + global / global - (March 22, 2014) - Map example: $Code$( findDisplay 12 displayCtrl 51) ctrlAddEventHandler ["Draw"," - ( _this select 0) drawLine [ - getPos player, - [0,0,0], - [0,0,1,1] - ]; - "];$/Code$ - Be careful when using this command. Unlike map markers, the draw commands can decrease your framerate. - Nothing + Nothing + - drawLink + ctrlSetFade - The editor will draw a line between the two specified editor objects. Line type can be LINE or ARROW. - i - Some Old Editor Command + Sets wanted transparency for control animation. Requires ctrlCommit to commit changes. - https://community.bistudio.com/wiki/drawLink + https://community.bistudio.com/wiki/ctrlSetFade - Control drawLink Array + Control ctrlSetFade Number - map drawLink [from,to,param type,line type,color] + controlName ctrlSetFade fade - + $Code$_control ctrlSetFade 1; + _control ctrlCommit 5;$/Code$ + undefined / undefined + (March 10, 2015) + This command sets the amount of fade. For example: + $Code$ + _ctrl ctrlSetFade 1; // hides the control + _ctrl ctrlSetFade 0.5; // control is 50% visible + _ctrl ctrlSetFade 0; // control is fully visible + $/Code$ + + (August 28, 2017) + The resulting fade speed seems like is not exactly what ctrlCommit commands it to be, as is dependant on your current framerate. Example: + $Code$_ctrl ctrlSetFade 0.5; + _ctrl ctrlCommit 1; + $/Code$ + Will actually result in: + $Code$ [60 FPS and higher] = ~1.0 seconds + [30 FPS and around] = ~1.2 seconds + [10 FPS and anything lower] = ~5-10 seconds + $/Code$ + This phenomenon probably occurs because of engine time simulation disruption caused by performance damage. - Nothing + Nothing + - drawLocation + tvCount - Unknown effect. + Returns childrens count of item on given path. IDC means id of parent Tree View. - https://community.bistudio.com/wiki/drawLocation + https://community.bistudio.com/wiki/tvCount - Control drawLocation Location + tvCount Array + + Control tvCount Array - control drawLocation location + tvCount [idc, [path]] + + _ctrl tvCount [path] - + $Code$tvCount [101, [0]];$/Code$ + + $Code$_ctrl tvCount [1,0];$/Code$ + - undefined / undefined + local / local + (Sep 11 2014) + (A3 1.28)tv command family overview + $Code$ + //tv command family available for CT_TREE (type 12) + private ["_count","_current","_data","_text","_value","_pic"]; + _CT_TREE tvAdd [ [],"Parent_A"]; + _CT_TREE tvAdd [ [0],"Child_A"]; + _CT_TREE tvAdd [ [0,0],"Grandchild_A"]; + _CT_TREE tvAdd [ [],"Parent_B"]; + _CT_TREE tvAdd [ [1],"Child_B"]; + _count = _CT_TREE tvCount []; //return 2 + _CT_TREE tvSetCurSel [0,0,0]; //select grandchild_A + _current = tvCurSel _CT_TREE; //return [0,0,0] + _CT_TREE tvSetData [_current,"I'm grandchild_A"]; + _data = _CT_TREE tvData _current; // "I'm grandchild_A" + _text = _CT_TREE tvText _current; //"Grandchild_A" + _CT_TREE tvSetValue [_current,14]; + _value = _CT_TREE tvValue _current; // 14 + _CT_TREE tvSetPicture [_current, getText ( configFile "CfgWeapons" "optic_NVS" "picture")]; + _pic = _CT_TREE tvPicture _current; + _CT_TREE tvExpand [1]; + _CT_TREE tvSort [[], false ]; + _CT_TREE tvSortByValue [[], false ]; + _CT_TREE tvDelete [0,0]; //remove child_b + tvClear 12; + _CT_TREE tvCollapse []; + $/Code$ - Unknown + Number - Number + - drawPolygon + get3DENAttribute - Draws given polygon on the given map control with given color. The polygon must consist of at least 3 points. Unlike with other draw shape commands and due to complexity, this command does not support filling of the polygon with color. Use drawTriangle command to construct and fill polygon shape as a workaround. + Returns value of a given entity's attribute in Eden Editor. + An attribute is identified by its property ( data when it's engine-drive attribute) value in config. For the list of all attributes with their properties, see Setting Attributes. + ! + Attributes are available only within the Eden Editor workspace. You cannot access them in scenario preview or exported scenario! - https://community.bistudio.com/wiki/drawPolygon + https://community.bistudio.com/wiki/get3DENAttribute - Control drawPolygon Array + EdenEntity get3DENAttribute String - map drawPolygon [polygon, color] + entity get3DENAttribute attribute - $Code$test_polygon = []; - for "_i" from 1 to 12 do - { - test_polygon pushBack ( player getPos [10 + random 100, 360/_i]); - }; - findDisplay 12 displayCtrl 51 ctrlAddEventHandler ["Draw", - { - _this select 0 drawPolygon [test_polygon, [0,0,1,1]]; - }];$/Code$ + $Code$systemChat str (( get3DENMouseOver select 1) get3DENAttribute "name"); + // returns variable name of object under cursor$/Code$ undefined / undefined @@ -21336,281 +22260,284 @@ - Nothing + Array + - drawRectangle + getMissionLayerEntities - Draws a rectangle on the map. + Returns all entities within specific Eden Editor layer. To be used when the scenario is running, not in the editor workspace. + Useful for disabling / enabling whole parts of the scenario which you add to specific layer while editing. - https://community.bistudio.com/wiki/drawRectangle + https://community.bistudio.com/wiki/getMissionLayerEntities - Control drawRectangle Array + getMissionLayerEntities String - map drawRectangle [c, a, b, angle, color, fill] + getMissionLayerEntities layerName - $Code$_ctrl drawRectangle [ - getPos player, - 20, - 20, - getDir player, - [0,0,1,1], - "" - ];$/Code$ + $Code$_base = getMissionLayerEntities "Base";$/Code$ - $Code$_ctrl drawRectangle [ - player, - 10, - 20, - getDir player, - [1,1,1,1], - "#(rgb,8,8,3)color(1,0,0,1)" - ];$/Code$ + $Code$waitUntil {( player distance _someObject) 800}; + { + deleteVehicle _x ; + } forEach (( getMissionLayerEntities "Simple Objects") select 0);//Deletes all objects within that layer after the player is over 800m away from _someObject$/Code$ undefined / undefined - (March 22, 2014) - Map example: $Code$( findDisplay 12 displayCtrl 51) ctrlAddEventHandler ["Draw",{ - (_this select 0) drawRectangle [ - getPos player, - 20, - 20, - getDir player, - [0,0,1,1], - "" - ]; - }];$/Code$ - Be careful when using this command. Unlike map markers, the draw commands can decrease your framerate. + (October 26, 2016) + After an object was deleted from a layer, getMissionLayerEntities will return NULL-object for the deleted object. + Version: 1.65 + Build: 139010 - Nothing + Array + - drawTriangle + unassignCurator - Draws a single triangle or multiple triangles on the map. Triangle is defined by 3 positions of its verticies: p0, p1, p2 in a single array [ p0, p1, p2 ]. Next 3 positions in the same array [p0, p1, p2, p0, p1, p2 ] will be used to draw second triangle, another 3 positions [p0, p1, p2, p0, p1, p2, p0, p1, p2 ] to draw 3rd and so on. - NOTE : when fill param is absent or is an empty string "", the triangle is drawn with lines of the color set in color param. In order to draw color filled triangle of the same color as color param, set fill param to opaque white procedural texture "#(rgb,1,1,1)color(1,1,1,1)". + Unassign curator (will destroy both sides of connection). - https://community.bistudio.com/wiki/drawTriangle + https://community.bistudio.com/wiki/unassignCurator - Control drawTriangle Array + unassignCurator Object - map drawTriangle [vertices, color, fill] + unassignCurator curatorObj - $Code$findDisplay 12 displayCtrl 51 ctrlAddEventHandler ["Draw", - { - _this select 0 drawTriangle - [ - [ - player getRelPos [100, 0], - player getRelPos [100, -135], - player getRelPos [100, 135] - ], - [1,0,0,0.5], - "#(rgb,1,1,1)color(1,1,1,1)" - ]; - }];$/Code$ + $Code$unassignCurator myCurator;$/Code$ undefined / undefined - (July 16, 2017) - Example youtube video: [1] $Code$_ctrl = findDisplay 12 displayCtrl 51; - _ctrl setVariable ["data", [1, "#(rgb,1,1,1)color(1,1,1,1)", 1000, position player, - { - params ["_p", "_r", "_a", "_sr", "_ba"]; - _sr = _r * 0.382; - _pb = _p getPos [_sr, _a + 180]; - [ - _p getPos [_r, _a], _p getPos [_sr, _a + 36], _p getPos [_sr, _a - 36], - _pb, _p getPos [_r, _a - 72], _p getPos [_r, _a + 72], - _p getPos [_r, _a - 144], _p getPos [_sr, _a - 108], _pb, - _p getPos [_r, _a + 144], _p getPos [_sr, _a + 108], _pb - ] - }]]; - _ctrl ctrlRemoveAllEventHandlers "Draw"; - _ctrl ctrlAddEventHandler ["Draw", - { - _map = _this select 0; - _data = _map getVariable "data"; - _data params ["_i", "_fill", "_dist", "_pos", "_fn"]; - _data set [0, _i + 1]; - _size = _i % _dist; - if (_size == 0) then - { - _data set [0, 1]; - _data set [1, ["#(rgb,1,1,1)color(1,1,1,1)", ""] select (random 1 0.3)]; - _data set [2, 250 + round random 750]; - }; - _alpha = linearConversion [_dist, 0, _dist - _size, 1, 0]; - _map drawEllipse [_pos, _size * 2, _size * 2, 0, [0,0,1,_alpha], _fill]; - _map drawTriangle [[_pos getPos [_size, -_size], _size, _size] call _fn, [1,0,0,_alpha], _fill]; - _map drawTriangle [[_pos getPos [_size, -_size + 120], _size, _size] call _fn, [0,1,0,_alpha], _fill]; - _map drawTriangle [[_pos getPos [_size, -_size - 120], _size, _size] call _fn, [1,1,0,_alpha], _fill]; - }]; - openMap true;$/Code$ + This scripting command must be executed on the server to work properly in multiplayer - Nothing + Nothing + - driver + tvCurSel - Returns the driver of a vehicle. + Returns path to currently selected item. IDC means id of parent Tree View. - https://community.bistudio.com/wiki/driver + https://community.bistudio.com/wiki/tvCurSel - driver Object + tvCurSel Number + + tvCurSel Control - driver vehicle + tvCurSel idc + + tvCurSel control - $Code$( driver _tank) action ["getout", _tank];$/Code$ + $Code$tvCurSel 101;$/Code$ + + $Code$tvCurSel _ctrl;$/Code$ - global / undefined + local / local - (August 3, 2006) - Notes from before the conversion: - It is also possible to find the driver of a vehicle by placing a D after the name of the vehicle so Tank1D and driver Tank1 both refer to the same unit, providing the original driver has not got out of the tank. - The difference between the two is Tank1D is always the unit that was driver of the tank when the mission started, whilst driver Tank1 is the driver which is now there. + (Sep 11 2014) + (A3 1.28)tv command fmily overview + $Code$ + //tv command family available for CT_TREE (type 12) + private ["_count","_current","_data","_text","_value","_pic"]; + _CT_TREE tvAdd [ [],"Parent_A"]; + _CT_TREE tvAdd [ [0],"Child_A"]; + _CT_TREE tvAdd [ [0,0],"Grandchild_A"]; + _CT_TREE tvAdd [ [],"Parent_B"]; + _CT_TREE tvAdd [ [1],"Child_B"]; + _count = _CT_TREE tvCount []; //return 2 + _CT_TREE tvSetCurSel [0,0,0]; //select grandchild_A + _current = tvCurSel _CT_TREE; //return [0,0,0] + _CT_TREE tvSetData [_current,"I'm grandchild_A"]; + _data = _CT_TREE tvData _current; // "I'm grandchild_A" + _text = _CT_TREE tvText _current; //"Grandchild_A" + _CT_TREE tvSetValue [_current,14]; + _value = _CT_TREE tvValue _current; // 14 + _CT_TREE tvSetPicture [_current, getText ( configFile "CfgWeapons" "optic_NVS" "picture")]; + _pic = _CT_TREE tvPicture _current; + _CT_TREE tvExpand [1]; + _CT_TREE tvSort [[], false ]; + _CT_TREE tvSortByValue [[], false ]; + _CT_TREE tvDelete [0,0]; //remove child_b + tvClear 12; + _CT_TREE tvCollapse []; + $/Code$ - Object + Array - Array + - drop + ctrlVisible - Creates a particle effect. - This command is used to create smoke, fire and similar effects. - The particles are single polygons with single textures that always face the player. - They can be set to dynamically change their position, size, direction, can be set to different weights and more or less dependant on the wind. + Returns if a control of the currently active user dialog is shown or not. Read Dialog Control for more information about user dialogs and controls. - https://community.bistudio.com/wiki/drop + https://community.bistudio.com/wiki/ctrlVisible - drop Array + ctrlVisible Number - drop array + ctrlVisible idc - $Code$drop ["cl_basic", "", "Billboard", 1, 1, [-3.5*( sin ( direction xural)), - -3.5*( cos ( direction xural)),0], [ random 0.1, random 0.1, random 0.5], 1, 0.005, 0.0042, - 0.7, [0.3,3], [[0.5,0.5,0.5,0],[0.7,0.7,0.7,0.5],[0.9,0.9,0.9,0]], [0,1,0,1,0,1], - 0.2, 0.2, "", "", xural]$/Code$ + $Code$_bool = ctrlVisible 100;$/Code$ - undefined / local + local / undefined - Nothing + Boolean + - dynamicSimulationDistanceCoef + turretLocal - A getter for setDynamicSimulationDistanceCoef + Checks if a turret is local. + Some info on turrets: A vehicle turret will change locality when player gunner gets in it, just like vehicle changes locality when player driver gets in it. Many commands for turrets work only where turret is local. When gunner leaves turret it is supposed to change locality to the locality of the vehicle. - https://community.bistudio.com/wiki/dynamicSimulationDistanceCoef + https://community.bistudio.com/wiki/turretLocal - dynamicSimulationDistanceCoef String + Object turretLocal Array - dynamicSimulationDistanceCoef class + vehicle turretLocal turretPath - $Code$hint str dynamicSimulationDistanceCoef "IsMoving";$/Code$ + $Code$_isLocal = vehicle player turretLocal [0];$/Code$ + + $Code$if (heli turretLocal [1]) then {heli setVehicleAmmo 1};$/Code$ + + $Code$if ( isNil {heli turretLocal [5]}) then { hint "Turret 5 is non-existent"};$/Code$ - undefined / undefined + global / undefined - Number + Boolean/Nothing + - dynamicSimulationDistance + eyeDirection - A getter for setDynamicSimulationDistance + Returns the direction object is watching (eyes, or a vehicle primary observer). - https://community.bistudio.com/wiki/dynamicSimulationDistance + https://community.bistudio.com/wiki/eyeDirection - dynamicSimulationDistance String + eyeDirection Object - dynamicSimulationDistance category + eyeDirection unit - $Code$hint str dynamicSimulationDistance "Prop";$/Code$ + $Code$can = "Land_Can_V3_F" createVehicle position player ; + onEachFrame { + can setPosASL [ + ( eyePos player select 0) + ( eyeDirection player select 0), + ( eyePos player select 1) + ( eyeDirection player select 1), + ( eyePos player select 2) + ( eyeDirection player select 2) + ] + }$/Code$ + + $Code$// Draw AI eye direction (green) and weapon direction (red) in 3D: + bob = createGroup east createUnit ["O_Soldier_F", [0,0,0], [], 0, "NONE"]; + bob setVehiclePosition [ player modelToWorld [0,100,0], [], 0, "NONE"]; + onEachFrame + { + _beg = ASLToAGL eyePos bob; + _endE = (_beg vectorAdd ( eyeDirection bob vectorMultiply 100)); + drawLine3D [ _beg, _endE, [0,1,0,1]]; + _endW = (_beg vectorAdd (bob weaponDirection currentWeapon bob vectorMultiply 100)); + drawLine3D [_beg, _endW, [1,0,0,1]]; + };$/Code$ - undefined / undefined + global / undefined + (May 26, 2014) + This command should have really been named headDirection instead of eyeDirection as one could mistakenly think that eyes direction of your avatar correspond to the direction of the centre of your screen. Play with the script in example 1 to find out limitations. If you need centre of screen direction, use positionCameraToWorld instead. - Number + Array + - dynamicSimulationEnabled + objectParent - A getter for enableDynamicSimulation + Returns parent of an object if the object is proxy, otherwise objNull. In case of backpack, the parent is a weaponholder or a cargo space of a vehicle or the unit carrying it. Unit in a vehicle will return the vehicle as parent. + Another good use of objectParent is when a static weapon is known and one needs to check if it is assembled or not. objectParent _staticWeapon will return objNull if weapon is unpacked, or backpack object if packed. - https://community.bistudio.com/wiki/dynamicSimulationEnabled + https://community.bistudio.com/wiki/objectParent - dynamicSimulationEnabled Object/Group + objectParent Object - dynamicSimulationEnabled object + objectParent object - $Code$hint str dynamicSimulationEnabled _myObject;$/Code$ + $Code$_weaponholder = objectParent _mybackpack;$/Code$ + + $Code$// Create and place created backpack in front of player: + _backpackContainer = "B_TacticalPack_rgr" createVehicle [0,0,0]; + _weaponHolder = objectParent _backpackContainer; + _weaponHolder setPos ( player modelToWorld [0,5,0]);$/Code$ + + $Code$// Check if player is on foot: + _isOnFoot = isNull objectParent player ;$/Code$ + + $Code$// Detect if player is in commander turret of a vehicle: + _isVehicleCommander = player isEqualTo commander objectParent player ;$/Code$ undefined / undefined @@ -21618,298 +22545,442 @@ - Boolean + Object + - dynamicSimulationSystemEnabled + count - A getter for enableDynamicSimulationSystem + Can be used to count: + the number of elements in array + the number of elements in array with condition + the number of sub-entries in a config object + the number of characters in a string (since ["Arma 3","Arma3",127,126674,"Development"]) - https://community.bistudio.com/wiki/dynamicSimulationSystemEnabled + https://community.bistudio.com/wiki/count - dynamicSimulationSystemEnabled + count Array + + Code count Array + + count Config + + count String - dynamicSimulationSystemEnabled + count array + + condition count array + + count configname + + count string - $Code$hint str dynamicSimulationSystemEnabled ;$/Code$ + $Code$_cnt = count [0,0,1,2]; // returns 4 + _cnt = count units group player ; // returns number of units in player group$/Code$ + + $Code$_cnt = { _x == 4} count [1,9,8,3,4,4,4,5,6]; // returns 3 + _cnt = { alive _x } count allUnits ; // returns the number of alive units$/Code$ + + $Code$_cnt = count ( configFile "CfgVehicles");$/Code$ + + $Code$hint str count "japa is the man!"; //16$/Code$ - undefined / undefined + local / undefined + (April 28, 2007) + This conditional count command only works if all the elements in the tested array are of the same type as the tested element. + For example, the following code will created an error, since the elements are of different types (object, number, string): + $Code$_arr = [ player,100,"one"]; {_x == "one"} count _arr;$/Code$ + Alternatively, to avoid the error use isEqualTo instead of ==. --KK + This one, on the other hand, where all elements are strings, just like the tested element, will return the correct result of 1: + $Code$_arr = ["one","two","three"]; {_x == "one"} count _arr;$/Code$ + + (August 3, 2006) + Notes from before the conversion: + Use this to calculate how many "M16" mags a soldier has left. + $Code${_x == "M16"} count magazines soldier1;$/Code$ + Take care when using count to determine how many units are left alive in a group: count units group player or count units groupname Will return the number of units the leader of the group thinks are alive. If some units have been killed out of sight of other members of the group then it may take sometime for this to be the actual numbers in the group. To determine exactly how many units are really alive in a group use: + $Code${ alive _x} count units group player ;$/Code$ + or + $Code${ alive _x} count units groupname;$/Code$ + + (December 15, 2014) + count can be (ab)used for a very fast and simple check if at least one element in an array fulfills a certain condition: + $Code$if({if( _x fulfills condition ) exitWith {1}; false} count _array isEqualTo 1) then + { + //do whatever here + };$/Code$ + This code will exit the count loop as soon as it finds an element fulfilling the condition, leaving the count with the value of 1, hence make the larger if-condition be true. + If no array element fulfills the condition, the count will be 0 and the if-condition will be false. + + (December 29, 2014) + Quit loop at first fulfilled condition (same as above but faster): + $Code$0 = { if (_x == 4) exitWith { + //do something when we reach 4 + }} count [1,2,3,4,5,6];$/Code$ + + (January 2, 2015) + Using exitWith inside a count loop will overwrite the default functionality and make count return whatever the exitWith returns: + $Code$_result = { + if(_x isEqualTo 3) exitWith {"Hello"} + } count [1,2,3,4,5]; + //_result = "Hello"$/Code$ + + (August 22, 2016) + With the alternative syntax each iteration should result in an interior return of bool or nothing. Example: + $Code$createDialog "RscFunctionsViewer"; + { lbAdd [292901,_x]; } count ["first","second","third"];$/Code$ + lbAdd returns a number, so this throws "Error Type Number, expected Bool". Tested in A2OA 1.63.131129 - Boolean + Number - Number - Number - Number + - east + buildingExit - Pre-defined variable for the eastern side. + Returns the given indexed exit in a building. The returned value is in format Position. - https://community.bistudio.com/wiki/east + https://community.bistudio.com/wiki/buildingExit - east + Object buildingExit Number - east + building buildingExit index - $Code$// SQS: - ?((side _unit) == east ) : hint "This is a eastern unit!"$/Code$ - - $Code$// SQF: - if (( side _unit) == east ) then { - hint "This is a eastern unit!"; - };$/Code$ + $Code$_building buildingExit 0$/Code$ undefined / undefined - (April 17, 2007) - In ArmA terms OPFOR, BLUFOR, Independents and Civilians are used in the front end UI. - Side + Array + - echo + updateMenuItem - Sends any text into the debugger console or the logfile. Present in internal version only, not working in the retail version. + Sets the text and command for the menu item. index is index as returned from addMenuItem command. command is optional. + i + Some Old Editor Command - https://community.bistudio.com/wiki/echo + https://community.bistudio.com/wiki/updateMenuItem - echo String + Control updateMenuItem Array - echo text + map updateMenuItem [menu item index,text,command] - $Code$echo "Text in logfile"$/Code$ - + undefined / undefined - Nothing + Nothing + - edit3DENMissionAttributes + currentWeaponMode - Open a window with scenario attribute in given section. + Returns current weapon mode of unit's weapon. Result can be: "Single", "Burst", "FullAuto", "manual", "player" + This command will return 0 Number if given object is a vehicle instead of a person. - https://community.bistudio.com/wiki/edit3DENMissionAttributes + https://community.bistudio.com/wiki/currentWeaponMode - edit3DENMissionAttributes String + currentWeaponMode Object - edit3DENMissionAttributes section + currentWeaponMode gunner - $Code$edit3DENMissionAttributes "Multiplayer";$/Code$ + $Code$_weaponMode = currentWeaponMode player ;$/Code$ + + $Code$_weaponMode = currentWeaponMode gunner vehicle player ;$/Code$ undefined / undefined + (September 27, 2014) + - Be careful using this in script. This function returns these strings but also: + - 0 if unit is in a vehicle (pax), + - absolutely nothing if AH-99 helo driver or all weapons removed, + - "truckhorn2" if Hunter driver... + Absolutely nothing means: if you use a hint to display the returned value, you obtain absolutely no text,no black box, no error! Hint isn't displayed and there is no error in rpt file with compile preprocessFileLineNumbers. + On the other hand, returned value 0 when unit is pax of a vehicle, could lead to a variable error type if your script is waiting for a string. - Nothing + String + - editObject + enableAimPrecision - Show the edit object dialog for the given object. - i - Some Old Editor Command + Set whether animation's aim precision affects weapon sway. - https://community.bistudio.com/wiki/editObject + https://community.bistudio.com/wiki/enableAimPrecision - Control editObject String + Object enableAimPrecision Boolean - map editObject object + unit enableAimPrecision enable - + $Code$player enableAimPrecision false ;$/Code$ + undefined / undefined - Any_Value + Nothing + - editorSetEventHandler + hideObject - Sets given event handler of given editor. - i - Some Old Editor Command + Hide entity. Can be used on soldiers and vehicles, also on static objects. - https://community.bistudio.com/wiki/editorSetEventHandler + https://community.bistudio.com/wiki/hideObject - Control editorSetEventHandler Array + hideObject Object + + Object hideObject Boolean - map editorSetEventHandler [handler name,function] + hideObject object + + object hideObject hidden - $Code$_map editorSetEventHandler ["SelectObject",""]$/Code$ + $Code$hideObject unitName;$/Code$ + + $Code$objectName hideObject true;$/Code$ - undefined / undefined + global / local + (July 15, 2010) + This command will hide a unit, but he will still shoot enemies. Unit will be invisible, but weapon muzzle are visible. + + Use MP framework to activate this comand on all players from server or any other maschine + $Code$_nic = [nil, mantohide, "per", rHideObject, true ] call RE; //In A3 use hideObjectGlobal instead.$/Code$ + + you can use code as in example 2, where true = ON and false = OFF, if using it like in example 1, you can only turn it ON + + using this locally causes the player/object disappear only locally; has to be executed serverside if used in MP. Hidden Vehicles still emit smoke/rotor blade dust and (probably) still emit engine sounds. Usefull for creating objects the map-creator doesn't want to be seen, like Units that protect a certain Area (like a safe-zone) against teamkillers or enemy units. + + The above comment is partially incorrect, if the effects of the command are local then it must be executed in every machine so it has global effect. If it is run only on the server machine, it will only be hidden on the server, while clients still see it. + + (March 5, 2014) + As of today this now finally has a Global counterpart, just released on the Stable branch. Added it's link under See also. + + (October 30, 2014) + When used on player, it only has an effect on third person mode. First person LOD is still visible. (A3 Dev 1.33) + + (June 27, 2015) + hideObject and hideObjectGlobal disable object collision in addition to rendering. A3 1.45.131175 + (tested by hiding buildings and running through, driving through, flying through, and shooting through where the building used to be) + + (January 26, 2016) + Sometimes it´s easier to teleport the object about 100m under the ground (also JiP Support): + $Code$_obj setPosATL [getPosATL _obj select 0, getPosATL _obj select 1, (getPosATL _obj select 2)-100];$/Code$ + And to unhide: + $Code$_obj setPosATL [getPosATL _obj select 0, getPosATL _obj select 1, (getPosATL _obj select 2)+100];$/Code$ - Nothing + Nothing - Nothing + - effectiveCommander + displayAddEventHandler - Returns the effective commander of the vehicle. Effective commander is the player whom driver AI will listen to. So if in a tank there is a gunner and a commander and AI driver, if the effectiveCommander is gunner, then gunner pressing WASD will give AI orders to move. If gunner jumps out and then enters tank again, the effectiveCommander role most likely has changed to commander that remained in tank. Also the assignment seems to work on first come first served basis. + Adds an event handler to the given display. Returns the ID of the event handler, or -1 when failed. + Returning true in EH code will override default engine handling for keyboard events. + See User Interface Event Handlers for the full list of event names. + If applicable, see DIK_KeyCodes for a list of key code constants, which are relevant to key related user interface events like: KeyDown & KeyUp. + NOTE: Display EHs are processed in reversed order, i.e. last added: first, first added: last. So if you have an override it should be set up in the 1st added EH. - https://community.bistudio.com/wiki/effectiveCommander + https://community.bistudio.com/wiki/displayAddEventHandler - effectiveCommander Object + Display displayAddEventHandler Array - effectiveCommander vehicle + display displayAddEventHandler [eventName, code] - $Code$_commander = effectiveCommander tank;$/Code$ + $Code$moduleName_keyDownEHId = ( findDisplay 46) displayAddEventHandler ["KeyDown", " hint str _this;"];$/Code$ + + $Code$moduleName_keyDownEHId = findDisplay 46 displayAddEventHandler ["KeyDown", { hint str _this}];$/Code$ undefined / undefined - - - Object - - - - - else - - - Executes else code when if condition returns false - + (October 30, 2013) + As of Arma 3 v1.05.111658 ctrlAddEventHandler and displayAddEventHandler support script Code in addition to String [1] + + (March 10, 2014) + From within an Addon, you must assign the events from a spawned script. eg $Code$[] spawn { (findDisplay 46) displayAddEventHandler["KeyDown","_this call my_KeyDownFunctionhandler"]; };$/Code$ + + (January 22, 2016) + Be sure to wait until the main display is initialized before using this command by using: $Code$waituntil {!isnull (finddisplay 46)};$/Code$ + + (May 28, 2017) + use #define if you want the displayEventHandler to use data that is defined in the same file in which the command is executed. + However, that does not work if you use STRING as 'code'. In case of STRING, use the format command around it. + + (August 7, 2017) + Using KeyUp you can't override default engine action by returning true ( A3 1.72.142342 ) + + + Number + + + + + + setDynamicSimulationDistance + + + Sets activation distance of Arma_3_Dynamic_Simulation for given category + - https://community.bistudio.com/wiki/else + https://community.bistudio.com/wiki/setDynamicSimulationDistance - Code else Code + String setDynamicSimulationDistance Number - ifCode else elseCode + category setDynamicSimulationDistance distance - $Code$if (a b) then { c = 0 } else { c = 1 };$/Code$ - - $Code$if (a b) then { - hint "B is greater than A"; - } else { - hint "A is greater than B"; - };$/Code$ + $Code$"Group" setDynamicSimulationDistance 1000;$/Code$ undefined / undefined + (March 19, 2017) + Desired distances for "Group" and "Vehicle" must be based on viewDistance and fog to exclude any rendering problems with frequently moving objects. Example: + $Code$"Group" setDynamicSimulationDistance (( viewDistance * 0.8) - ( viewDistance * fog)) + // 80% of maximum rendering and fog distance$/Code$ + But that might impair objects simulations if you are using long-scope optics, so there's a even better solution using cameraView with it: + $Code$[] spawn { + while { true } do { + if ( cameraView isEqualTo "GUNNER") then { + "Group" setDynamicSimulationDistance ( viewDistance - ( viewDistance * fog )); + // Scoped + } else { + "Group" setDynamicSimulationDistance (( viewDistance * 0.8) - ( viewDistance * fog )); + // Not scoped + }; + uiSleep 0.25; + }; + }; + $/Code$ - Array + Nothing + - emptyPositions + unitPos - Returns the number of given positions in the vehicle. - Positions can be "Commander", "Driver", "Gunner" or "Cargo" + Return the unit position rules. + The return value is always "Auto" unless the unit has gotten a setUnitPos command. In that case the value is the last stance the unit was ordered to. + Available modes are listed at setUnitPos. - https://community.bistudio.com/wiki/emptyPositions + https://community.bistudio.com/wiki/unitPos - Object emptyPositions String + unitPos Object - vehicle emptyPositions position + unitPos unit - $Code$_freeCargoPositions = vehicle player emptyPositions "cargo";$/Code$ + $Code$hint str unitPos _unit;$/Code$ - undefined / undefined + global / undefined - Number + String + - enableAIFeature + enableSatNormalOnDetail - Enable/disable given AI feature. Feature may be one of: - "AwareFormationSoft", "CombatFormationSoft". + Enables/Disables satellite normal map od detail maps. - https://community.bistudio.com/wiki/enableAIFeature + https://community.bistudio.com/wiki/enableSatNormalOnDetail - String enableAIFeature Boolean + enableSatNormalOnDetail Boolean - feature enableAIFeature enabled + enableSatNormalOnDetail state - $Code$"AwareFormationSoft" enableAIFeature true$/Code$ + $Code$enableSatNormalOnDetail true;$/Code$ undefined / undefined @@ -21917,56 +22988,55 @@ - Nothing + Nothing + - enableAI + && - Enables parts of the AI behavior that was disabled by disableAI. - NOTE: When player switches and leaves behind AI unit, you need to enable "TeamSwitch" AI on it _unit enableAI "TeamSwitch" so that the unit continues with waypoints + Returns true only if both conditions are true. In case of the alternative syntax (code as right argument), lazy evaluation is used (if left operand is false, evaluation of the right side is skipped completely). Identical to: a and b - https://community.bistudio.com/wiki/enableAI + https://community.bistudio.com/wiki/a_%26%26_b - Object enableAI String + Boolean && Boolean/Code - unit enableAI skilltype - + - $Code$_soldierOne enableAI "Move";$/Code$ - + - local / global + undefined / undefined - Nothing + Boolean + - enableAimPrecision + profileNameSteam - Set whether animation's aim precision affects weapon sway. + Returns name of the current Steam profile. - https://community.bistudio.com/wiki/enableAimPrecision + https://community.bistudio.com/wiki/profileNameSteam - Object enableAimPrecision Boolean + profileNameSteam - unit enableAimPrecision enable + profileNameSteam - $Code$player enableAimPrecision false ;$/Code$ + $Code$_mySteamProfileName = profileNameSteam ;$/Code$ undefined / undefined @@ -21974,55 +23044,66 @@ - Nothing + String + - enableAttack + ctrlSetModelDirAndUp - Set if leader can issue attack commands to the soldiers in his group. + Sets orientation of 3D control model. It is similar to setVectorDirAndUp command for an object. - https://community.bistudio.com/wiki/enableAttack + https://community.bistudio.com/wiki/ctrlSetModelDirAndUp - Object/Group enableAttack Boolean + Control ctrlSetModelDirAndUp Array - group enableAttack enable + control ctrlSetModelDirAndUp [dir, up] - $Code$_group1 enableAttack true$/Code$ + $Code$_ctrl3D ctrlSetModelDirAndUp [[0,1,0],[0,0,1]]; //default orientation$/Code$ - local / global + undefined / undefined - Nothing + Nothing + - enableAudioFeature + teamMemberNull - Enable/disable an audio feature, features are: "lowpass", "building_interior". Return previous state + A non-existent Team Member. To compare non-existent team members use isNull or isEqualTo : + teamMemberNull == teamMemberNull ; // false + isNull teamMemberNull ; // true + teamMemberNull isEqualTo teamMemberNull ; // true - https://community.bistudio.com/wiki/enableAudioFeature + https://community.bistudio.com/wiki/teamMemberNull - enableAudioFeature Array + teamMemberNull - enableAudioFeature [feature, enable] + teamMemberNull - $Code$prevState = enableAudioFeature ["lowpass", true ];$/Code$ + $Code$! isNull teamMemberNull ; // false$/Code$ + + $Code$str teamMemberNull ; // NULL - team member$/Code$ + + $Code$if (_teamMember isEqualTo teamMemberNull ) then { + hint "is null member"; + };$/Code$ undefined / undefined @@ -22030,28 +23111,28 @@ - Boolean + Team_Member + - enableCamShake + importance - Allows camera shake effects via addCamShake. If set to false, then a currently active shake effect will stop immediately. - By default, shake effects are enabled, but once they have been disabled by this command, they will have to be enabled first, in order to be visible. + Returns a location's importance value. - https://community.bistudio.com/wiki/enableCamShake + https://community.bistudio.com/wiki/importance - enableCamShake Boolean + importance Location - enableCamShake value + importance location - $Code$enableCamShake false ;$/Code$ + $Code$_locationImportance = importance myLocation$/Code$ undefined / undefined @@ -22059,204 +23140,229 @@ - Nothing + Number + - enableCaustics + removeCuratorAddons - Enable/disable caustics drawing. + Restrict curator use of given addons. - https://community.bistudio.com/wiki/enableCaustics + https://community.bistudio.com/wiki/removeCuratorAddons - enableCaustics Boolean + Object removeCuratorAddons Array - enableCaustics bool + curatorObj removeCuratorAddons addons - + $Code$curatorModule removeCuratorAddons [addon1,addon2]$/Code$ + undefined / undefined + This scripting command must be executed on the server to work properly in multiplayer - Nothing + Nothing + - enableChannel + tvExpand - Enables/disables UI functionality which is responsible for sending text or voice chat to the given chat channel. If the channel was disabled in description.ext, it can be enabled with this command, however the UI functionality changes will be local to the PC executing this command. What this command cannot do: - It cannot disable incoming text or voice - It cannot interrupt own client's transmission in progress - It cannot affect any Custom Radio channels, only channels 0-5 - It cannot persist, so if user is logged out, the changes are reset - It has no effect on chat related scripting commands, such as vehicleChat, globalChat, globalRadio, sideRadio, etc. - So in short, just like with getPlayerChannel, this command provides a nice ability to hack into chat UI with some limitations. And the reason why it is possible to disable entire channels (except Group) in description.ext, is because no one can talk or text, therefore no transmission is happening. NOTE: Group channel cannot be disabled, neither with enableChannel, nor with description.ext param. Channel / Number correspondence: - 0 = Global - 1 = Side - 2 = Command - 3 = Group - 4 = Vehicle - 5 = Direct - 6-15 = Custom Radio (Is not supported by enableChannel ) + Expands tree item pointed to by the path. IDC means id of parent Tree View. - https://community.bistudio.com/wiki/enableChannel + https://community.bistudio.com/wiki/tvExpand - Number enableChannel Boolean + tvExpand Array - Number enableChannel Array + Control tvExpand Array - channel enableChannel enable + tvExpand [idc, path] - channel enableChannel [chat, VoN] + control tvExpand path - $Code$0 enableChannel false ; // Disable user ability to send voice and text on global channel$/Code$ + $Code$tvExpand [101, [0]];$/Code$ - $Code$0 enableChannel [ true, false ]; // Enable user ability to send text but disable voice on global channel$/Code$ + $Code$_ctrl tvExpand [1];$/Code$ - undefined / local + local / local - (June 17, 2016) - If the user is admin, global channel is fully enabled, regardless of this command. - - (July 30, 2016) - Alternative Syntax supports Custom Radio Channels + (Sep 11 2014) + (A3 1.28)tv command family overview + $Code$ + //tv command family available for CT_TREE (type 12) + private ["_count","_current","_data","_text","_value","_pic"]; + _CT_TREE tvAdd [ [],"Parent_A"]; + _CT_TREE tvAdd [ [0],"Child_A"]; + _CT_TREE tvAdd [ [0,0],"Grandchild_A"]; + _CT_TREE tvAdd [ [],"Parent_B"]; + _CT_TREE tvAdd [ [1],"Child_B"]; + _count = _CT_TREE tvCount []; //return 2 + _CT_TREE tvSetCurSel [0,0,0]; //select grandchild_A + _current = tvCurSel _CT_TREE; //return [0,0,0] + _CT_TREE tvSetData [_current,"I'm grandchild_A"]; + _data = _CT_TREE tvData _current; // "I'm grandchild_A" + _text = _CT_TREE tvText _current; //"Grandchild_A" + _CT_TREE tvSetValue [_current,14]; + _value = _CT_TREE tvValue _current; // 14 + _CT_TREE tvSetPicture [_current, getText ( configFile "CfgWeapons" "optic_NVS" "picture")]; + _pic = _CT_TREE tvPicture _current; + _CT_TREE tvExpand [1]; + _CT_TREE tvSort [[], false ]; + _CT_TREE tvSortByValue [[], false ]; + _CT_TREE tvDelete [0,0]; //remove child_b + tvClear 12; + _CT_TREE tvCollapse []; + $/Code$ - Nothing - Nothing + Nothing - Nothing + - enableCollisionWith + animationNames - Enable collision between vehicles. + Returns Array of Strings where elements are the names of model animations, which should theoretically be available for use with animate command. However in practice this depends on whether animation is also made available for use in scripts via config. - https://community.bistudio.com/wiki/enableCollisionWith + https://community.bistudio.com/wiki/animationNames - Object enableCollisionWith Object + animationNames Object - vehicle enableCollisionWith vehicle + animationNames object - + $Code$_names = animationNames static_AT; + // Returns: ["MainTurret", "MainGun", "MainTurret_destructX", "MainTurret_destructY", "MainTurret_destructZ", "MainGun_destructX", "MainGun_destructY", "MainGun_destructZ", "magazine_destruct", "ammo_belt_destruct", "bolt_destruct", "charging_handle_destruct", "damagehideVez_destruct", "damagehideHlaven_destruct", "damagehideRecoil_destruct", "Turret_shake", "Turret_shake_aside", "Magazine_hide", "Ammo_belt_hide", "muzzleFlash", "AddAutonomous_unhide", "bullet001_reload_hide", "bullet002_reload_hide", "bullet003_reload_hide", "bullet004_reload_hide", "bullet005_reload_hide", "bullet006_reload_hide", "bullet007_reload_hide", "bullet008_reload_hide"]$/Code$ + - local / global + undefined / undefined - (April 5, 2015) - enableCollisionWith is a script that when you apply it to an object, it will be solid and the player will not be able to go through it. However, if you want your unit to go through it, you may want to use the disableCollisionWith command. An example for this is: - $Code$//name of unit in editor such as player1 - //name of object in editor such as car1 - car1 enableCollisionWith player1; - //to make your unit go through the car, use the below and make sure you know what your doing! - car1 disableCollisionWith player1; - $/Code$ - Both commands enableCollisionWith and disableCollisionWith, are very handy codes and could be used for example: map testing, mission editing and even animation cutscenes. - Nothing + Array + - enableCopilot + getDammage - Enables copilot actions. + Returns the object damage in the range from 0 to 1. Alias of damage. - https://community.bistudio.com/wiki/enableCopilot + https://community.bistudio.com/wiki/getDammage - Object enableCopilot Boolean + getDammage Object - vehicle enableCopilot enable + getDammage object - $Code$if (! isCopilotEnabled myHeli) then { - myHeli enableCopilot true ; - };$/Code$ + $Code$_damage = getDammage player ;$/Code$ - local / global + undefined / undefined - (February 17, 2014) - Only enables the user actions, not who is in control - pilot can lock or unlock co-pilot controls in multiplayer while still true. - Actions: LockVehicleControl, UnlockVehicleControl, SuspendVehicleControl and TakeVehicleControl - You can use the Arma 3 Event Handler - ControlsShifted to detect Take and Release actions + (, May 9, 2011) + getDammage and damage works fine when used on damaged vehicles after a repair from a repairtruck when used in A2 CO patch 1.59. + + Vehicles repaired in game with the Repair trucks e.t.c never get completely repaired. After being repaired, rather than returning 0 when the damage command is called. They return a value equal to or less than 0.09. + Consequently any vehicle flagged as immobile (as indicated by the canMove command), remains so. At least as far as the AI are concerned. The AI will refuse to board an immobile vehicle or eject straight after boarding. Players remain unaffected and can drive the vehicle as normal. To circumvent this, use setDamage 0 on the vehicle in question, to allow the AI to board. + + In OFP 1.96, it is possible for a unit to be dead and still return a getDammage value well below 1. Use ! alive to check if a unit is dead. - Nothing + Number + - enableDebriefingStats + setCuratorCoef - enable debrifing score table. + Sets coef for some action (coef have to be bigger than -1 000 000, anything lower is considered as disabled action). - https://community.bistudio.com/wiki/enableDebriefingStats + https://community.bistudio.com/wiki/setCuratorCoef - enableDebriefingStats Array + Object setCuratorCoef Array - enableDebriefingStats [left, top, width, height] + curatorObj setCuratorCoef [action,coef] - $Code$enableDebriefingStats [0.1, 0.1, 0.8, 0.8];$/Code$ + $Code$curatorModule setCuratorCoef ["Place", 1]$/Code$ + + $Code$curatorModule setCuratorCoef ["Delete", -1e10]$/Code$ undefined / undefined + This scripting command must be executed on the server to work properly in multiplayer + + (March 25, 2015) + Possible actions are: + place + edit + delete + destroy + group + synchronize - Nothing + Nothing + - enableDiagLegend + surfaceNormal - Enable or disable the legend for diagnostics. Internal dev only + Returns surface normal on given position. - https://community.bistudio.com/wiki/enableDiagLegend + https://community.bistudio.com/wiki/surfaceNormal - enableDiagLegend Boolean + surfaceNormal Array - enableDiagLegend Bool + surfaceNormal position - $Code$enableDiagLegend false$/Code$ + $Code$_normal = surfaceNormal [300, 500];$/Code$ + + $Code$_normal = surfaceNormal position player ;$/Code$ undefined / undefined @@ -22264,27 +23370,29 @@ - Nothing + Array + - enableDynamicSimulation + load - Enables or disables Arma_3_Dynamic_Simulation for given non AI object + Returns current sum of mass from items stored in all unit's containers. Load is calculated by the following formula: + $Code$_loadPlayer = loadAbs player / getNumber ( configFile "CfgInventoryGlobalVariable" "maxSoldierLoad");$/Code$ - https://community.bistudio.com/wiki/enableDynamicSimulation + https://community.bistudio.com/wiki/load - Object/Group enableDynamicSimulation Boolean + load Object - object enableDynamicSimulation enable + load unit - $Code$_myObject enableDynamicSimulation true ;$/Code$ + $Code$load player ;$/Code$ undefined / undefined @@ -22292,336 +23400,419 @@ - Nothing + Number + - enableDynamicSimulationSystem + drawLocation - Enables or disables the whole Arma_3_Dynamic_Simulation system + Unknown effect. - https://community.bistudio.com/wiki/enableDynamicSimulationSystem + https://community.bistudio.com/wiki/drawLocation - enableDynamicSimulationSystem Boolean + Control drawLocation Location - enableDynamicSimulationSystem enable + control drawLocation location - $Code$enableDynamicSimulationSystem true ;$/Code$ - + undefined / undefined - Nothing + Unknown + - enableEndDialog + closeOverlay - Enables the execution of a custom camera sequence after the players death, coded in the script onPlayerKilled.sqs. + Closes the current overlay without committing. + i + Some Old Editor Command - https://community.bistudio.com/wiki/enableEndDialog + https://community.bistudio.com/wiki/closeOverlay - enableEndDialog + closeOverlay Control - enableEndDialog + closeOverlay map - undefined / local + undefined / undefined - Nothing + Nothing + - enableEngineArtillery + setObjectMaterial - Enable/disable the artillery engine. This allows the user to use the artillery computer on mortar/artillery, and for AI to use it for indirect fire. + Sets material of object selection. The selection number is defined through the hiddenselection []={} array in the vehicle's config (starting with 0). - https://community.bistudio.com/wiki/enableEngineArtillery + https://community.bistudio.com/wiki/setObjectMaterial - enableEngineArtillery Boolean + Object setObjectMaterial Array - enableEngineArtillery enabled + obj setObjectMaterial [selectionNumber, material] - $Code$enableEngineArtillery false;$/Code$ + $Code$car setObjectMaterial [0,"A3\Structures_F\Data\Windows\window_set.rvmat"]; + car setObjectMaterial [1,"A3\Structures_F\Data\Windows\window_set.rvmat"];$/Code$ - undefined / local + global / local - Nothing + Nothing + - enableEnvironment + waypointForceBehaviour - Enable/disable environmental effects: ambient life and/or ambient sound. + Returns true if the waypoint behavior is forced. - https://community.bistudio.com/wiki/enableEnvironment + https://community.bistudio.com/wiki/waypointForceBehaviour - enableEnvironment Boolean - - enableEnvironment Array + waypointForceBehaviour Waypoint - enableEnvironment enabled - - enableEnvironment [ambientLife, ambientSound] + waypointForceBehaviour waypoint - $Code$enableEnvironment false ;$/Code$ - - $Code$enableEnvironment [ false, true ];$/Code$ + $Code$_isForced = waypointForceBehaviour [groupOne, 1];$/Code$ undefined / undefined - (28 October, 2013) - This command has to be executed after mission start to have an effect. So if you add this command in init.sqf make sure you wait until mission is running: - $Code$//init.sqf - waitUntil { time 0}; - enableEnvironment false ;$/Code$ - Nothing - Nothing + Boolean + - enableFatigue + htmlLoad - Enables/Disables the person's fatigue. + Load HTML-Files from file or Uri using given control. + File path is relative to current mission dir or an absolute path (with drive letter etc.). + The command is subject to restrictions, imposed by CfgCommands class. - https://community.bistudio.com/wiki/enableFatigue + https://community.bistudio.com/wiki/htmlLoad - Object enableFatigue Boolean + Control htmlLoad String - unit enableFatigue enable + control htmlLoad filename - $Code$player enableFatigue false ;$/Code$ + $Code$_control htmlLoad "briefing.html";$/Code$ - $Code${ _x enableFatigue false ; } forEach ( units group player );$/Code$ + $Code$_control htmlLoad "http://www.bistudio.com/newsfeed/arma3_news.php?build=main // [1]$/Code$ + + $Code$// Display news item: + 0 = 0 spawn { + disableSerialization ; + _html = findDisplay 46 createDisplay "RscCredits" ctrlCreate ["RscHTML", -1]; + _html ctrlSetBackgroundColor [0,0,0,0.8]; + _html ctrlSetPosition [ safeZoneX, safeZoneY, safeZoneW, safeZoneH ]; + _html ctrlCommit 0; + _html htmlLoad "http://www.bistudio.com/newsfeed/arma3_news.php?build=main + };$/Code$ - local / global + undefined / undefined - (March 24, 2015) - When the player dies enableFatigue is set to true after the respawn + (September 7, 2014) + htmlLoad works with URL's as well as html files. - (January 27, 2016) - To precise the note of Harmdhast, this command is not persistent (after respawn). So, in MP, you'll have to enableFatigue false, also in onPlayerRespawn.sqf or through the MP eventHandler MPRespawn. + (September 7, 2014) + While surprisingly htmlLoad does work with URLs as pointed above, the operation is blocking, meaning the whole game will freeze until the operation is complete. Therefore it is not recommended to use this command in such way. + + (April 21, 2015) + Example use of URL can be found in BIS_fnc_GUInewsfeed with the function browser. + + (October 7, 2015) + (Arma 3) In order to use URLs, they must be included in CfgCommands - allowedHTMLLoadURIs. In order to use URIs with params a wildcard * character is supported + Script Example : + $Code$_newsOnline = "http://alivemod.com/alive_news.php?map=" + _map + "&mission=" + _mission + "&player=" + _player; + _ctrlHTML htmlLoad _newsOnline;$/Code$ + Config Example: + $Code$class CfgCommands { + allowedHTMLLoadURIs[] += { + "http://alivemod.com/alive_news.php*" + }; + };$/Code$ - Nothing + Nothing + - enableGunLights + isText - Force the AI to use gun lights + Check if config entry represents text. - https://community.bistudio.com/wiki/enableGunLights + https://community.bistudio.com/wiki/isText - Object/Group enableGunLights Boolean + isText Config - thing enableGunLights value + isText config - $Code$_grp enableGunLights true$/Code$ - - $Code$_unit enableGunLights true$/Code$ + $Code$_ok = isText (configFile "CfgVehicles") + // Result is false$/Code$ - local / global + undefined / undefined - (27 July, 2011) - This command can be used to force lights on, but not to force lights off. ( Source ) - - (17 April, 2013) - In order for this command to work in ARMA 3 you should use groupname enableGunLights "AUTO" or soldierOne enableGunLights "AUTO". Other options are "forceOn" or "forceOff". ( Source ) - Nothing + Boolean + - enableIRLasers + onPlayerDisconnected - Allows the AI to use IR lasers + This command will execute attached code whenever a player is leaving an MP session. The code will receive a number of special variables: + _id : Number - is the unique DirectPlay ID. Quite useless as the number is too big for in-built string representation and gets rounded. It is also the same id used for user placed markers. + _uid : String - is getPlayerUID of the leaving player. In Arma 3 it is also the same as Steam ID. + _name : String - is profileName of the leaving player. + _jip : ( since Arma 3 v1.49 ) Boolean - is a flag that indicated whether or not the player joined after the mission has started ( J oined I n P rogress). true - if the player was JIP, otherwise false. + _owner : ( since Arma 3 v1.49 ) Number - is owner id of the leaving player. Can be used for kick or ban purposes or just for publicVariableClient. + i + Since Arma 3 v1.57 a stackable version of this EH is available: PlayerDisconnected + In order to keep compatibility between official and community content the functions BIS_fnc_addStackedEventHandler and BIS_fnc_removeStackedEventHandler should be used instead. - https://community.bistudio.com/wiki/enableIRLasers + https://community.bistudio.com/wiki/onPlayerDisconnected - Object/Group enableIRLasers Boolean + onPlayerDisconnected String/Code - thing enableIRLasers value + onPlayerDisconnected code - $Code$(units group player) enableIRLasers true$/Code$ + $Code$onPlayerDisconnected " diag_log [_id, _uid, _name]";$/Code$ + + $Code$onPlayerDisconnected { + if ( count allPlayers == 0) then { + endMission "END1"; + }; + };$/Code$ - local / global + undefined / undefined - - - Nothing - + This scripting command must be executed on the server to work properly in multiplayer + + (January 14, 2015) + For Arma 3 v1.32 and onward, one might want to consider using instead the HandleDisconnect mission event handler for greater flexibility. + + + Nothing + + - enableMimics + owner - Enables/disables mimics on a given unit. + On server machine, returns the ID of the client where the object is local. Otherwise returns 0. For use on clients clientOwner command is available. To find out the owner of a Group, use groupOwner. - https://community.bistudio.com/wiki/enableMimics + https://community.bistudio.com/wiki/owner - Object enableMimics Boolean + owner Object - unit enableMimics enabled + owner object - $Code$cursorTarget enableMimics false ;$/Code$ + $Code$_clientID = owner _someobject;$/Code$ - undefined / undefined + global / undefined + This scripting command must be executed on the server to work properly in multiplayer - Nothing + Number + - enablePersonTurret + cutObj - Enables or disables firing from a vehicle cargo position. To get the turret path use assignedVehicleRole or getCargoIndex command. + Displays an object defined in the global config in CfgTitles. + For greater efficiency and ease of modability it is recommended to use named layers available with alternative syntax since Arma 3 v1.57.134673 - https://community.bistudio.com/wiki/enablePersonTurret + https://community.bistudio.com/wiki/cutObj - Object enablePersonTurret Array + cutObj Array + + Number cutObj Array + + String cutObj Array - vehicle enablePersonTurret [turretPath, enable] + cutObj [class, type, speed, showInMap] + + layer cutObj [class, type, speed, showInMap] + + layerName cutObj [class, type, speed, showInMap] - $Code$heli enablePersonTurret [[1], true ];$/Code$ + $Code$cutObj ["TVSet", "PLAIN"]; + cutObj ["TVSet", "PLAIN", 2]$/Code$ + + $Code$2 cutObj ["Sphere", "PLAIN"];$/Code$ + + $Code$_layer = "layer1" cutObj ["BISLogo", "PLAIN"];$/Code$ - undefined / undefined + undefined / local - Nothing + Nothing - Nothing - Number + - enableRadio + setVariable - Enable and disable radio messages to be heard and shown in the left lower corner of the screen. This command can be helpful during cutscenes. + Set variable to given value in the variable space of given element. + To remove a variable, set it to nil (e.g. player setVariable ["varname", nil ];$/Code$ ). + When variable is set on Task, it is not actually set on task itself, but on FSM attached to the task. So if there is no FSM setVariable will not work. + All available variable spaces which support setVariable : + Namespace setVariable Array + Object setVariable Array + Group setVariable Array + Team_Member setVariable Array + Task setVariable Array + Location setVariable Array + Control setVariable Array (since Arma 3 v1.55.133553) + Display setVariable Array (since Arma 3 v1.55.133553) + In Arma 3 it is possible to broadcast nil value - https://community.bistudio.com/wiki/enableRadio + https://community.bistudio.com/wiki/setVariable - enableRadio Boolean + Namespace/Object/Group/Team_Member/Task/Location/Control/Display setVariable Array + + Namespace/Object/Group setVariable Array - enableRadio state + varspace setVariable [name, value] + + varspace setVariable [name, value, public] - $Code$enableRadio false$/Code$ + $Code$_myTruck setVariable ["myPublicVariable", 123, true ];$/Code$ + + $Code$_myTruck setVariable ["myLocalVariable", ["321", _var], false ];$/Code$ + + $Code$missionNamespace setVariable ["myName", "KK"]; + hint myName; //KK$/Code$ + + $Code$// Get current value of a variable and if it is undefined, define it and get the defined value: + private _var = missionNamespace getVariable "varName"; + if ( isNil "_var") then + { + missionNamespace setVariable ["varName", 123]; + _var = 123; + }; + // _var here will contain current value of the variable varName$/Code$ - undefined / local + global / local - (7 August, 2008) - This command doesn't disable text-chat in multiplayer. - - (11 September, 2008) - Does not affect VON. + (December 9, 2015) + This command does not work with CfgAmmo or CfgNonAIVehicles objects, like bullets, mines or butterflies (probably because they are local objects Killzone Kid ( talk ) 11:25, 9 July 2017 (CEST)). - Nothing + Nothing - Nothing + - enableReload + tvSetPictureRightColorDisabled - Enable / disable reload when magazine is empty. + Sets the color of the right picture of a tree item defined by path when item is disabled - https://community.bistudio.com/wiki/enableReload + https://community.bistudio.com/wiki/tvSetPictureRightColorDisabled - Object enableReload Boolean + Control tvSetPictureRightColorDisabled Array - object enableReload enable + control tvSetPictureRightColorDisabled [path, color] - $Code$_vehicle enableReload false ;$/Code$ + $Code$_control tvSetPictureRightColorDisabled [[0], [1,0,1,1]]$/Code$ undefined / undefined @@ -22629,57 +23820,59 @@ - Nothing + Nothing + - enableRopeAttach + getPosATLVisual - Enable/disable ability to attach or be attached to ropes for given vehicle + Returns an object's rendered 3D position ATL (z value above ground) in render time scope. - https://community.bistudio.com/wiki/enableRopeAttach + https://community.bistudio.com/wiki/getPosATLVisual - Object enableRopeAttach Boolean + getPosATLVisual Object - vehicle enableRopeAttach enable + getPosATLVisual object - $Code$( vehicle player ) enableRopeAttach false ;$/Code$ + $Code$_playerRenderedPosATL = getPosATLVisual player ;$/Code$ - undefined / undefined + global / undefined - (05 April, 2014) - Attachable nearby vehicles may not update on Sling Load Assistant until re-opened. - Nothing + Array + - enableSatNormalOnDetail + getModelInfo - Enables/Disables satellite normal map od detail maps. + Returns object's model info in format [modelName, modelPath, hasSkeleton]. Model path is suitable for use with createSimpleObject command. - https://community.bistudio.com/wiki/enableSatNormalOnDetail + https://community.bistudio.com/wiki/getModelInfo - enableSatNormalOnDetail Boolean + getModelInfo Object - enableSatNormalOnDetail state + getModelInfo object - $Code$enableSatNormalOnDetail true;$/Code$ + $Code$_modelInfo = getModelInfo player ;$/Code$ + + $Code$_modelInfo = getModelInfo cursorObject ;$/Code$ undefined / undefined @@ -22687,248 +23880,239 @@ - Nothing + Array + - enableSaving + vectorMultiply - Enable / disable saving of the game. - When disabled, the autosave is created (if not forbidden by save == false). + Multiplies 3D vector by a scalar. - https://community.bistudio.com/wiki/enableSaving + https://community.bistudio.com/wiki/vectorMultiply - enableSaving Boolean - - enableSaving Array + Array vectorMultiply Number - enableSaving enable - - enableSaving [enable, save] + vector vectorMultiply scalar - $Code$enableSaving false ; // Saving disabled and make autosave. - enableSaving true ; // Saving enabled without autosave. - enableSaving [ false, false ]; // Saving disabled without autosave. - enableSaving [ false, true ]; // Saving disabled and make autosave. - enableSaving [ true, false ]; // Saving enabled without autosave. - enableSaving [ true, true ]; // Saving enabled and make autosave.$/Code$ + $Code$_newVector = [1,2,3] vectorMultiply 3; //[3,6,9]$/Code$ undefined / undefined + (28 Jun, 2014) + (ArmA3 1.22)Algorithm: + $Code$ + Vector = [x,y,z]; scalar = a; + Result = [(x * a),(y * a),(z * a)]; + $/Code$ + It is recommended to use vectorMultiply instead of BIS_fnc_vectorMultiply. This is a very useful function, as it can be used with the velocity command to move an object from one position to another. (ie vector1 to vector2 ) - ensure both positions are found using getPosASL. + $Code$ + _obj setVelocity ((( getPosASL _target) vectorDiff ( getPosASL _obj)) vectorMultiply 2); + $/Code$ - Nothing - Nothing + Array + - enableSentences + createTeam - Enables radio transmissions to be heard and seen on screen. It does not affect KBTell conversations. + Create a team and name it. - https://community.bistudio.com/wiki/enableSentences + https://community.bistudio.com/wiki/createTeam - enableSentences Boolean + createTeam Array - enableSentences enable + createTeam [type, name] - $Code$enableSentences false;$/Code$ + $Code$_team = createTeam ["USMC_Team", "Fire Team Red"];$/Code$ - undefined / local + undefined / undefined - Nothing + Team_Member + - enableSimulationGlobal + faction - MP command. Enable or disable simulation for given entity, globally. Call this only from the server. Has the same effect as enableSimulation when used in SP. + Gets unit faction. Factions are defined under CfgFactionClasses. If the given faction is not defined, the command returns empty string. Standard Factions include: + West: "USMC", "CDF" + East: "RU", "INS" + Guer: "GUE" + Civ: "CIV", "CIV_RU" + West: "BIS_US", "BIS_CZ", "BIS_GER" + East: "BIS_TK", "BIS_TK_INS" + Guer: "BIS_TK_GUE", "BIS_UN" + Civ: "BIS_TK_CIV", "BIS_CIV_special" + British Armed Forces DLC + West: "BIS_BAF" + Private Military Company DLC + Guer: "PMC_BAF" + West: "BLU_F" (NATO), "BLU_G_F" (FIA) + East: "OPF_F" (CSAT), "OPF_G_F" (FIA) + Guer: "IND_F" (AAF), "IND_G_F" (FIA) + Civ: "CIV_F" (Civilians) + Arma 3 - APEX + West: "BLU_T_F" (Pacific NATO), "BLU_CTRG_F" (Pacific CTRG), "BLU_GEN_F" (Gendarmerie) + East: "OPF_T_F" + Guer: "IND_C_F" (Syndikat) + "CIV_IDAP_F" - https://community.bistudio.com/wiki/enableSimulationGlobal + https://community.bistudio.com/wiki/faction - Object enableSimulationGlobal Boolean + faction Object - entity enableSimulationGlobal enable + faction unitName - $Code$_myObject enableSimulationGlobal false;$/Code$ + $Code$_playersFaction = faction player ;$/Code$ - global / global + global / undefined - This scripting command must be executed on the server to work properly in multiplayer - - (October 21, 2014) - Units that have been previously subjected to enableSimulation false; or enableSimulationGlobal false; may stay unrecognised for a long time even after simulation was re-enabled, returning objNull as cursorTarget. Force revealing units with reveal command usually solves the problem. For example: $Code${ player reveal _x} forEach allUnits ;$/Code$ + Faction behaves slightly differently to side. Side can refer to the pilot or commander of a vehicle, but faction never changes. It always returns the 'country of manufacture'. - Nothing + String + - enableSimulation + fogParams - Enable / disable simulation for given entity. + A getter for setFog (Alt Syntax). Returns extended params for the fog - https://community.bistudio.com/wiki/enableSimulation + https://community.bistudio.com/wiki/fogParams - Object enableSimulation Boolean + fogParams - entity enableSimulation state + fogParams - $Code$player enableSimulation false;$/Code$ + $Code$_fog = fogParams$/Code$ - global / local + undefined / undefined - (15 July, 2009) - enableSimulation will "freeze" the unit, including animations, eye blinking, etc ; you cannot switchMove or playMove. - the unit can still take damages and report status and enemies by radio. - - (19 July, 2011) - Nou/Jaynus have discovered something quite important about the Arma2 engine: - Orient yourself to the enableSimulation command in ARMA 2: - If simulation is disabled on objects (this enablesimulation false), they do not send updates across the network, drastically reducing traffic across the network by an order of magnitude. What this means in practicality is that it is possible to have huge mission maker created cities with no or negligible impact on mission performance. Mission placed objects is the most common cause of performance woes - so this is huge news, and was previously undocumented, both on the BIS wiki and elsewhere. - There are some quirks. - While an object which has enableSimulation false set on it will take damage, it will not display any animations or damage states until enableSimulation is enabled back onto it. If you want to disable simulation on a unit and then show it as dieing once it is hit or damaged, add an eventhandler onto it which enables simulation on the object when it is hit or killed. Hit handler for best visual, killed handler for best performance. - This discovery will be the basis of a new unit caching script by Jaynus. - This also has importance in a technical sense: bandwith is the most significant factor in mission performance. The lower the server bandwith, the better the performance. - - (9 Sept, 2011) - Objects with disabled simulation are not calculated for lightsources beyond the global light (moon/sun), so any light sources you create will not light them. - - (12 Nov, 2011) - Contrary to Krause's suggestions above, using "this enableSimulation False" on static objects has no effect on a dedicated server's bandwidth usage or FPS (as per current 1.59 Release version). - - (8 May, 2012) - re: Homer. - Yep. That's because this functionality is now part of the basic arma netcode. Pretty nice :) - - (October 3, 2014) - Units with disabled simulation will not be affected by gravity. - - (October 21, 2014) - Units that have been previously subjected to enableSimulation false; or enableSimulationGlobal false; may stay unrecognised for a long time even after simulation was re-enabled, returning objNull as cursorTarget. Force revealing units with reveal command usually solves the problem. For example: $Code${ player reveal _x} forEach allUnits ;$/Code$ - - (May 23, 2015) - After using enableSimulation false or enableSimulationGlobal false on an object, setPos will still update its position across the network in MP. - - (December 2, 2015) - After using enableSimulation false or enableSimulationGlobal false on a vehicle (car, helo), don't forget to re-enable simulation on this vehicle before a player jumps into it. Otherwise, he will be stick in it, with a black screen and no way to escape! - - (February 5, 2016) - cursorTarget returns a null_object for objects with disabled simulation. But you can find them with other commands such nearEntities. - - (September 1, 2016) - Since Arma 3 1.56 the object can also be returned with cursorObject even if the simulation is not enabled - Nothing + Array + - enableStamina + resize - Enable/disable stamina system + Changes the size of the given array. The command does not return new array, it resizes the source array to the desired number of elements. If the new size is bigger than the current size, the new places are filled with nils. - https://community.bistudio.com/wiki/enableStamina + https://community.bistudio.com/wiki/resize - Object enableStamina Boolean + Array resize Number - unit enableStamina enabled + array resize count - $Code$player enableStamina true;$/Code$ + $Code$_arrayNum = [0,1,2,3,4]; + _arrayNum resize 2; // _arrayNum is now [0,1]$/Code$ undefined / undefined + (November 13, 2014) + Use this number to resize the array to the number of elements desired, not the desired index of the final element. + resize cannot be used to create a new array. - Nothing + Nothing + - enableTeamSwitch + asin - Enable / disable Team Switch. The default setting is enabled. + Arcsine of a number, result in Degrees. - https://community.bistudio.com/wiki/enableTeamSwitch + https://community.bistudio.com/wiki/asin - enableTeamSwitch Boolean + asin Number - enableTeamSwitch enable + asin x - + $Code$_degrees=asin 0.5 + returns 30$/Code$ + undefined / undefined - Nothing + Number + - enableUAVConnectability + isIRLaserOn - Enables unit's AV terminal(s) connecting to UAV. + Returns true if there is a linked and enabled IR on the given weapon. - https://community.bistudio.com/wiki/enableUAVConnectability + https://community.bistudio.com/wiki/isIRLaserOn - Object enableUAVConnectability Array + Object isIRLaserOn String - object enableUAVConnectability [uav, checkAllItems] + unit isIRLaserOn weapon - $Code$unit enableUAVConnectability [uav,true];$/Code$ + $Code$player isIRLaserOn currentWeapon player ;$/Code$ undefined / undefined @@ -22936,86 +24120,225 @@ - Nothing + Boolean + - enableUAVWaypoints + addPublicVariableEventHandler - Enables/disables the option for player to set waypoints for UAV in AV terminal. + This event handler will detect if a missionNamespace variable (it is attached to) has been broadcast over network with publicVariable, publicVariableClient or publicVariableServer commands and will execute EH code upon detection. Arguments passed to the code in _this array are: + _this select 0: String - broadcast variable name (same variable name EH is attached to) + _this select 1: Anything - broadcast variable value + _this select 2: Object, Group - target the variable got set on with setVariable (see: alternative syntax) + Please note: + * EH works only in Multiplayer environment. + * EH will not fire on the machine that executed broadcast command, only on the machines that receive the broadcast. + * The value of broadcast variable can be exactly the same, it is the actual broadcast that triggers EH not the change in variable. + Alt syntax of this command doesn't work as intended - https://community.bistudio.com/wiki/enableUAVWaypoints + https://community.bistudio.com/wiki/addPublicVariableEventHandler - Object enableUAVWaypoints Boolean + String addPublicVariableEventHandler Code + + String addPublicVariableEventHandler Array - uav enableUAVWaypoints enable + varName addPublicVariableEventHandler code + + varName addPublicVariableEventHandler [target, code] - $Code$_uav enableUAVWaypoints false ; - hint str waypointsEnabledUAV _uav; // returns false$/Code$ + $Code$"publicThis" addPublicVariableEventHandler { + hint format [ + "%1 has been updated to: %2", + _this select 0, + _this select 1 + ] + };$/Code$ + + $Code$// Client: + "'^:)123BURP,+=lol" addPublicVariableEventHandler { hint ("NUTS are " + (_this select 1))}; + // Server: missionNamespace setVariable ["'^:)123BURP,+=lol", "craZZZZy"]; + publicVariable "'^:)123BURP,+=lol";$/Code$ - undefined / undefined + global / local + (22 Dec, 2007) + Please note that varName indicates which variable you want to monitor with this eventhandler. + As a result, the example eventhandler on this page will only fire when the variable publicThis has been changed, + but not if any other variable was changed by any other client via the publicVariable command. + + (27 Feb, 2014 00:57) + Note on using addPublicVariableEventHandler during initialization: If you need a function to call addPublicVariableEventHandler during initialization, you must use postInit. addPublicVariableEventHandler does not work during preInit. + + (27 Feb, 2014 08:40) + MulleDK13 note above needs some clarification. You don't "must" use postInit and you absolutely can use preInit function to initialise addPublicVariableEventHandler if you start scheduled script from it. + $Code$//script with preInit = 1; in CfgFunctions + 0 = 0 spawn { + "someVar" addPublicVariableEventHandler { + //yourcode + }; + };$/Code$ + + (November 23, 2015) + While it is true that the event handler will only fire on the machine receiving the broadcast value. Please note that this machine can actually be the same machine broadcasting it in the cases of publicVariableClient and publicVariableServer. + Examples: $Code$if ( isServer ) then { + "OnServer" addPublicVariableEventHandler { hint "This event handler still fired!"; }; + publicVariableServer "OnServer"; + };$/Code$ + $Code$// This example assumes the client knows their own client ID + // It does also work on the server (when the server ID is used) irrespective of the command name + "OnClient" addPublicVariableEventHandler { hint "This event handler still fired!"; }; + client ID publicVariableClient "OnClient"; + $/Code$ - Nothing + Nothing - Nothing + - enableVehicleCargo + append - Enable/disable option to transport other vehicles (if configured) or be transported. + Appends array2 to the back of array1 modifying array1. + NOTE: append does not return array, it modifies existing array. If you need to return a copy, use "+": + $Code$array3 = array1 + array2;$/Code$ - https://community.bistudio.com/wiki/enableVehicleCargo + https://community.bistudio.com/wiki/append - Object enableVehicleCargo Boolean + Array append Array - vehicle enableVehicleCargo enable + array1 append array2 - $Code$vehicle enableVehicleCargo true ;$/Code$ + $Code$_arr = [1,2,3]; + _arr append [4,5,6]; + hint str _arr; //[1,2,3,4,5,6]$/Code$ undefined / undefined - (June 20, 2016) - Setting enableVehicleCargo to true does not mean a vehicle can now load vehicles as cargo. They are still required to be correctly setup as shown on the Vehicle in Vehicle Transport page. + (March 9, 2015) + $Code$_array1 append _array2$/Code$ is roughly 1.2x faster (depending on array size) than $Code$_array1 = _array1 + _array2$/Code$ (Averaged over 10.000 iterations with two identical arrays containing the numbers 0 through 9) + The larger the arrays to append, the faster append is as it does not create a new array, which happens with array addition. + + (May 21, 2015) + Array "unshift" implementation using append, a faster alternative to BIS_fnc_arrayUnShift : + $Code$KK_fnc_unshift = { + private ["_arr", "_tmp"]; + _arr = _this select 0; + _tmp = [_this select 1]; + _tmp append _arr; + _arr resize 0; + _arr append _tmp; + _arr + }; + // Example + arr = [1,2,3]; + [arr, 0] call KK_fnc_unshift; //both arr and return of function are [0,1,2,3] + $/Code$ + + (May 21, 2015) + Array "insert" implementation using append, much faster alternative to BIS_fnc_arrayInsert : + $Code$KK_fnc_insert = { + private ["_arr", "_i", "_res"]; + _arr = _this select 0; + _i = _this select 2; + _res = []; + _res append (_arr select [0, _i]); + _res append (_this select 1); + _res append (_arr select [_i, count _arr - _i]); + _res + }; + // Example + arr = [1,2,3,4]; + [arr, ["a","b"], 2] call KK_fnc_insert; //[1,2,"a","b",3,4]$/Code$ + + (May 21, 2015) + A faster alternative to BIS_fnc_arrayPushStack using append : + $Code$KK_fnc_pushStack = { + _this select 0 append (_this select 1); + _this select 0 + }; + // Example + arr = [1,2,3]; + [arr,[4,5,6]] call KK_fnc_pushStack; //both arr and function return are [1,2,3,4,5,6]$/Code$ - Nothing + Nothing + - enableVehicleSensor + getCompatiblePylonMagazines - Enable/disable given sensor + Get array of compatible pylon magazines - https://community.bistudio.com/wiki/enableVehicleSensor + https://community.bistudio.com/wiki/getCompatiblePylonMagazines - Object enableVehicleSensor Array + Object getCompatiblePylonMagazines Number + + String getCompatiblePylonMagazines Number - vehicle enableVehicleSensor [componentName, state] + vehicle getCompatiblePylonMagazines pylon + + vehicleClass getCompatiblePylonMagazines pylon - $Code$vehicle player enableVehicleSensor ["PassiveRadarSensorComponent",false]; // disables passive radar$/Code$ + $Code$vehicle player getCompatiblePylonMagazines 0; // returns array of arrays containing all compatible magazines$/Code$ + + $Code$"Plane_Fighter_01_Base_F" getCompatiblePylonMagazines 3; // returns array of compatible magazines for the 3rd pylon$/Code$ + + $Code$jet1 getCompatiblePylonMagazines "pylon1"; // returns array of compatible magazines for the 1st pylon$/Code$ + + $Code$// Get all pylon names for "Plane_Fighter_01_Base_F" + private _allPylons = "true" configClasses ( + configFile + + "CfgVehicles" + + "Plane_Fighter_01_Base_F" + + "Components" + + "TransportPylonsComponent" + + "pylons" + ) apply { configName _x}; + hint str _allPylons; + /* return: + [ + "pylon1", + "pylon2", + "pylon3", + "pylon4", + "pylonBayRight1", + "pylonBayLeft1", + "pylonBayCenter1", + "pylonBayCenter2", + "pylonBayCenter3", + "pylonBayCenter4", + "pylonBayCenter5", + "pylonBayCenter6" + ]*/$/Code$ undefined / undefined @@ -23023,71 +24346,59 @@ - Nothing + Array - Array + - enableWeaponDisassembly + markerType - Enables or disables disassembly of static weapons. Could be applied to local player, to another unit or to static weapon directly. + Get type of marker. Note: This function is identical to getMarkerType. See cfgMarkers for a list of standard markers. - https://community.bistudio.com/wiki/enableWeaponDisassembly + https://community.bistudio.com/wiki/markerType - enableWeaponDisassembly Boolean - - Object enableWeaponDisassembly Boolean + markerType String - enableWeaponDisassembly enable - - entity enableWeaponDisassembly enable + markerType markerName - $Code$enableWeaponDisassembly false ;$/Code$ - - $Code$soldier1 enableWeaponDisassembly false ;$/Code$ - - $Code$mortar1 enableWeaponDisassembly false ;$/Code$ + $Code$if ( markerType "Marker1" == "Empty") then { hint "Marker1 is not an icon!"}$/Code$ - global / global + global / undefined + (March 17, 2014) + Using markerType is a good method to determine if a string is a valid marker name, unless the marker type isn't set. $Code$if (markerType "mark1" != "") then {hint "valid marker"}$/Code$ - Nothing - Nothing + String + - endLoadingScreen + lockedTurret - Finishes loading screen started by startLoadingScreen. + Check whether gunner position of the vehicle turret is locked. - https://community.bistudio.com/wiki/endLoadingScreen + https://community.bistudio.com/wiki/lockedTurret - endLoadingScreen + Object lockedTurret Array - endLoadingScreen + vehicle lockedTurret turretPath - $Code$startLoadingScreen ["Loading My Mission"]; - //Batch of code - //Batch of code - //Batch of code - progressLoadingScreen 0.5; - //Batch of code - //Batch of code - //Batch of code - endLoadingScreen ;$/Code$ + $Code$_locked = tank lockedTurret [0];$/Code$ undefined / undefined @@ -23095,75 +24406,62 @@ - Nothing + Boolean + - endMission + createGuardedPoint - Finish the mission. - The end type can be: - "CONTINUE" - "KILLED" - "LOSER" - "END1" - "END2" - "END3" - "END4" - "END5" - "END6" - Mission saves are deleted. Use failMission if they should not. - To maintain Arma 3 visual style, it's recommended to use BIS_fnc_endMission instead. + Adds a point guarded by the given side (scripted way of adding equivalent of "GUARDED BY" trigger in Editor ). A closest AI group in the given side with assigned "GUARD" waypoint will attempt to secure this guard point. The actual guarded position is determined via the following rules: + Given "position" is always considered. It could be Object, Group, Position2D or Position3D. In every case, z coordinate will be ignored and point will be placed on nearest surface. + If "objectMapID" is not negative, the position of the object with the given ID is used (Overrides "position"). -1 to ignore this argument. z of the object position will be intact. + If the given "vehicle" is valid, the position of the vehicle is extracted and guarded (Overrides both "position" and "objectMapID"). objNull to ignore. z of the vehicle position will be intact. + For use with "GUARD" waypoint. How does "GUARD" waypoint work: Waypoint:Guard - https://community.bistudio.com/wiki/endMission + https://community.bistudio.com/wiki/createGuardedPoint - endMission String + createGuardedPoint Array - endMission endType + createGuardedPoint [side, position, objectMapID, vehicle] - $Code$endMission "END1";$/Code$ + $Code$createGuardedPoint [ east, [0,0], -1, vehicle player ];$/Code$ - local / local + undefined / undefined - Nothing + Nothing + - endl + set3DENLinesVisible - Creates a string containing a line break, similar to lineBreak for text. The name is inspired by c++ std::endl (line end). The command returns "\r\n", which contains control characters rather than printable characters: - hint str count "\r\n"; // 4 - hint str count endl ; // 2 - The line break works for diag_log and ctrlSetText. It doesn't work with the hint because hint interprets printable "\n" as line break instead. Alternatively one can use toString command to get other characters. + Toggle visibility of Eden Editor lines. - https://community.bistudio.com/wiki/endl + https://community.bistudio.com/wiki/set3DENLinesVisible - endl + set3DENLinesVisible Array - endl + set3DENLinesVisible [showMap, showScene] - $Code$diag_log ("line1" + endl + "line2");$/Code$ - - $Code$_ctrl = findDisplay 46 ctrlCreate ["RscTextMulti", -1]; - _ctrl ctrlSetPosition [0,0,1,1]; - _ctrl ctrlCommit 0; - _ctrl ctrlSetText format ["line1%1line2%1line3", endl ];$/Code$ + $Code$set3DENLinesVisible [ false, false ]; + // Hide all lines$/Code$ undefined / undefined @@ -23171,99 +24469,93 @@ - String + Nothing + - engineOn + waypointSpeed - Activates and deactivates the engine of a vehicle. This command has to be executed where vehicle is local. - NOTE: Executed on a remote vehicle this command may turn the engine on but then it will get turned off by itself after a short while. + Gets the waypoint speed. + Possible values are: + "UNCHANGED" + "LIMITED" + "NORMAL" + "FULL" - https://community.bistudio.com/wiki/engineOn + https://community.bistudio.com/wiki/waypointSpeed - Object engineOn Boolean + waypointSpeed Array - vehicle engineOn state + waypointSpeed waypoint - $Code$if (! isEngineOn _jeep) then {_jeep engineOn true };$/Code$ - - $Code$if ( local vehicle player ) then { - vehicle player engineOn true ; - } else { - hint "Get in the driver seat, soldier!"; - };$/Code$ + $Code$_speed = waypointSpeed [groupOne,1];$/Code$ - local / global + undefined / undefined - (August 25, 2014) - To switch engine off can also use setFuel and fuel : - $Code$ private "_gas"; - _gas = fuel heli; - heli setFuel 0; - sleep 0.01; - heli setFuel _gas;$/Code$ - Also sets helicopter fuel back to original quantity. Works on every other vehicle. - Nothing + String + - enginesIsOnRTD + setTriggerText - Returns which engines are producing some work. + Sets the text label attached to the trigger object. This is used for example as a radio slot label for radio activated triggers. - https://community.bistudio.com/wiki/enginesIsOnRTD + https://community.bistudio.com/wiki/setTriggerText - enginesIsOnRTD Object + Object setTriggerText String - enginesIsOnRTD RTD_helicopter + trigger setTriggerText text - $Code$_enginesTaru = enginesIsOnRTD _taru// Returns [true,true]$/Code$ + $Code$trigger setTriggerText "Call for support"$/Code$ - undefined / undefined + global / local - Array + Nothing + - enginesRpmRTD + editorSetEventHandler - Returns all engines RPM + Sets given event handler of given editor. + i + Some Old Editor Command - https://community.bistudio.com/wiki/enginesRpmRTD + https://community.bistudio.com/wiki/editorSetEventHandler - enginesRpmRTD Object + Control editorSetEventHandler Array - enginesRpmRTD RTD_helicopter + map editorSetEventHandler [handler name,function] - $Code$_UH80_E1 = ( enginesRpmRTD _UH80) select 0;//engine 1 RPM - _UH80_E2 = ( enginesRpmRTD _UH80) select 1;//engine 2 RPM$/Code$ + $Code$_map editorSetEventHandler ["SelectObject",""]$/Code$ undefined / undefined @@ -23271,28 +24563,53 @@ - Array + Nothing + - enginesTorqueRTD + scriptNull - Torque produced by engines in N·m (Newton*meter) + A non-existing Script or script that has finished ( scriptDone ). To compare non-existent scripts use isNull or isEqualTo : + scriptNull == scriptNull ; // ERROR! == cannot be used with script object + isNull scriptNull ; // true + scriptNull isEqualTo scriptNull ; // true - https://community.bistudio.com/wiki/enginesTorqueRTD + https://community.bistudio.com/wiki/scriptNull - enginesTorqueRTD Object + scriptNull - enginesTorqueRTD RTD_helicopter + scriptNull - $Code$_UH80_E1 = ( enginesTorqueRTD _UH80) select 0;//engine 1 Torque - _UH80_E2 = ( enginesTorqueRTD _UH80) select 1;//engine 2 Torque$/Code$ + $Code$// Wait until previous script is finished before starting a new one: + [] spawn + { + _script = scriptNull ; + for "_i" from 1 to 10 do { + waitUntil { isNull _script}; + _script = _i spawn { + hint format ["script %1 started", _this]; + sleep 1; + hint format ["script %1 finished", _this]; + sleep 0.2; + }; + }; + };$/Code$ + + $Code$if ( scriptDone (_obj getVariable ["objScript", scriptNull ])) then { + _obj setVariable ["objScript", _obj spawn { + waitUntil { damage _this 0.9}; + hint "Critical Damage!"; + }]; + };$/Code$ + + $Code$str scriptNull ; // NULL-script$/Code$ undefined / undefined @@ -23300,107 +24617,129 @@ - Array + Script_Handle + - entities + saveIdentity - Returns a list of all alive and dead entities of the given type or deriving from the given type. Units in vehicles are ignored. When empty string "" is passed for the type, all entity types are returned. - Alternative syntax introduced in Arma 3 v1.65.138685 allows to filter entities by type and alive status as well as to return entities currently in vehicles. Optimisation tip : Keep number of types in both includeTypes and excludeTypes arrays to a minimum by possibly using parent/base classes. If you have to use several types, arrange them in order so that the more common types go at the beginning of the array. + Saves person's identity to Objects.sav file in campaign directory as entry name. - https://community.bistudio.com/wiki/entities + https://community.bistudio.com/wiki/saveIdentity - entities String - - entities Array + Object saveIdentity String - entities type - - entities [typesInclude, typesExclude, includeCrews, excludeDead] + unitName saveIdentity name - $Code$_allcars = entities "Car";$/Code$ - - $Code$// Return all alive entities on the map: - _allalive = entities [[], [], true, true ];$/Code$ - - $Code$// Return dead and alive entities but logic: - _notlogic = entities [[], ["Logic"], true ];$/Code$ - - $Code$// Return all alive west soldiers on foot: - _footsoldiers = entities [["SoldierWB"], [], false, true ];$/Code$ + $Code$player saveIdentity "playerid"$/Code$ undefined / undefined - (Mar 27, 2014) - In ArmA3 ver 1.14 type (string) can be any children class under configfile "CfgVehicles". e.g. $Code$ entities "All"; //or entities "CAManBase"; etc.$/Code$ - - (July 12, 2016) - In A3 1.62 $Code$entities "CAManBase"$/Code$ does not include entities inside vehicles (crew). - - (May 2, 2017) - You can have multiple classnames in both the include and exclude arrays. - $Code$entities [["SoldierWB", "SoldierEB"],[]] $/Code$ + (August 12, 2006) + Can be also used in singleplayer missions to save player status before cutscenes and load it to player's double. - Array - Array + Boolean + - environmentEnabled + orderGetIn - Returns status of enableEnvironment command + Force all units in the array to get in or out of their assigned vehicles. Units must be assigned to a vehicle before this command will do anything. - https://community.bistudio.com/wiki/environmentEnabled + https://community.bistudio.com/wiki/orderGetIn - environmentEnabled + Array orderGetIn Boolean - environmentEnabled + unitArray orderGetIn order - $Code$_enabled = environmentEnabled ;$/Code$ + $Code$[_unitOne, _unitTwo] orderGetIn true$/Code$ + + $Code$[_unitOne, _unitTwo] orderGetIn false$/Code$ - undefined / undefined + local / global + (8 May, 2014) + (ArmA3 ver 1.18), here's a quick reference to unit's embarkation and disembarkation. + Command + Remote Control + Behavior + Role Unassigning + orderGetIn + false + orderGetIn won't take effect on player controlled AI units, and which needs to be used together with assaignAs command family. Generally speaking, orderGetIn is a Role Excuator. + When orderGetIn was disabled it won't automatically unassign unit's vehicle role but will force the unit get out of the vehicle and stop him re-entering until it was enabled again. orderGetIn false won't stop a unit when he is embarking a vehicle in the half way but unassignVehicle will do. orderGetIn false will wait to fire until the unit enter a vehicle. + allowGetIn + false + allowGetIn won't take effect on player controlled AI units. Different from orderGetIn, this command is a Role Holder, it can control the unit's movement in the half way set by orderGetIn but not by setWaypointType, unit will be forced to get out from a vehicle by allowGetIn false and won't automatically re-enter the vehicle until allowGetIn true + allowGetIn won't do anything with unit's vehicle role + doGetOut + true + Works on player controlled ai silently, unit will automatically get back to the vehicle after disembarkation. (Unit won't get out until vehicle is stopped or landed) + false + commandGetOut + true + Same as doGetOut with radio message. (Unit won't get out until vehicle is stopped or landed) + false + leaveVehicle + false + leaveVehicle can't force a player controlled AI disembark + true + action ["GetOut",_veh] + true + Eject immediately without parachute + false + action ["Eject",_veh] + true + Eject immediately with parachute if needed + false + setWaypointType "GETIN" + false + Waypoint won't be affected by orderGetIn false or allowGetIn false until the unit is on the vehicle. + N/A - Array + Nothing + - estimatedEndServerTime + sendUDPMessage - Estimated end of MP game in seconds converted to serverTime. + Send message to given address using UDP protocol. Returns false if the message has not been delivered + Note: Not implemented (see talk page for more info). - https://community.bistudio.com/wiki/estimatedEndServerTime + https://community.bistudio.com/wiki/sendUDPMessage - estimatedEndServerTime + sendUDPMessage Array - estimatedEndServerTime + sendUDPMessage [ip, port, message] - $Code$// Estimated minutes left: - _min = ( ceil ( estimatedEndServerTime - serverTime ) / 60);$/Code$ + $Code$_bool = sendUDPMessage ["192.168.0.1", 2302, "Here goes you message..."];$/Code$ undefined / undefined @@ -23408,236 +24747,239 @@ - Number + Boolean + - estimatedTimeLeft + action - Sets the estimated time left in the game. Using this function the designer can provide a "time left" estimate that is shown in the "Game in progress" screen or in the master browser. This command works in MP only and must be executed on the server only. NOTE that since Arma 3 v1.69 the max value that can be set is 10 hours (36000 seconds) + Make a unit to perform an action. Use the List of Actions for reference about the available actions and their syntax. + NOTES: + While this command should be executed where unit is local, it is not always the case. Actions such as "Eject", "GetOut", "GetInXXXX", "MoveToXXXX", etc can be executed on remote units. + In SP, when user Alt+Tabs the simulation is paused and so the action will also halt until user returns to the game. For example, player action ["GetInDriver", car] executed while user is Alt+Tabbed will result in user seeing the action happening when he returns to the game screen. This doesn't happen in MP. - https://community.bistudio.com/wiki/estimatedTimeLeft + https://community.bistudio.com/wiki/action - estimatedTimeLeft Number + Object action Array - estimatedTimeLeft seconds + unit action actionArray - $Code$estimatedTimeLeft 600; //10 min$/Code$ + $Code$player action ["SitDown", player ];$/Code$ - $Code$// For missions with a hard set limit adjusted via Param1, the following example can be used in the init.sqs file: - estimatedTimeLeft Param1;$/Code$ + $Code$_soldier action ["Eject", vehicle _soldier];$/Code$ - undefined / global + local / global - This scripting command must be executed on the server to work properly in multiplayer + (28 Aug, 2009) + In ArmA 2, you can place a unique unit (for example a boat, far of all combats) and use it for all command lines with action. + + (March 27, 2015) + This command has no effect when a dead unit is used as input. + + (June 27, 2017) + $Code$player action ["SWITCHWEAPON",player,player,-1]$/Code$ + Switching weapon to the back. + + (July 20, 2017) + Some of the actions (such as "DropWeapon") do not always execute, and there should be a set of conditions for them to run. + The unit must be able to perform the dropping animation in order for the action to properly execute. + So, if for example we spawn a unit at [0,0,0] and make it perform a "DropWeapon" action - it won't work if [0,0,0] is water (which it is, if the current map is an island) because the unit will be swimming. + Also, you cannot stack up actions right after the other. If you run a "DropWeapon" action when the current action animation is still going - it will not perform. + There are a few more conditions for an action to perform, but relying on a hundred percent success of the action is not a good practice. - Nothing + Nothing + - evalObjectArgument + lock - Return argument in mission editor of a given object. - i - Some Old Editor Command + Lock vehicle (disable mounting / dismounting) for player. Similar to setVehicleLock when number is used as param. - https://community.bistudio.com/wiki/evalObjectArgument + https://community.bistudio.com/wiki/lock - Control evalObjectArgument Array + Object lock Boolean + + Object lock Number - map evalObjectArgument [object, argument] + vehicleName lock locked + + vehicleName lock lockstate - $Code$// returns string "[1009.0351, 1319.4928]" - ( findDisplay 128 displayCtrl 51) getObjectArgument ["_unit_1", "POSITION"] - // returns array [1009.0351, 1319.4928] - ( findDisplay 128 displayCtrl 51) evalObjectArgument ["_unit_1", "POSITION"]$/Code$ + $Code$_jeepOne lock true ;$/Code$ + + $Code$heli lock true ; + locked heli; //2 + heli lock false ; + locked heli; //0 + heli lock 1; + locked heli; //1$/Code$ - undefined / undefined + local / global + (January 9, 2010) + Lock prevents AI persons mounting or dismounting vehicles when ordered to do so and players are prevented from doing both too, but AI will dismount when a vehicle is damaged. + + (September 22, 2010) + If an AI group (eg Mechanized Infantry) has its vehicule locked with its crew in it, it will mount or dismount it anyway. But a player in this group won't be able to enter the vehicle. + + (April 2, 2013) + From Arma 3 version 0.50 can be used Number as lock parameter : + 0 - Unlocked + 1 - Default + 2 - Locked + 3 - Locked for player + + (March 4, 2015) + 1 - is DEFAULT lock for vehicle placed in editor. Player that is not the leader in a group of AIs will not be able to enter this vehicle. - Any_Value + Nothing - Nothing + - everyBackpack + pitch - Returns array of backpacks stored in given crate or vehicle. Used for accessing backpack content of a backpack on ground. + Returns the pitch of a persons voice. - https://community.bistudio.com/wiki/everyBackpack + https://community.bistudio.com/wiki/pitch - everyBackpack Object + pitch Object - everyBackpack box + pitch person - $Code$everyBackpack cursorTarget ;$/Code$ - - $Code$_vehicleBackpacks = everyBackpack vehicle player ;$/Code$ + $Code$pitch player$/Code$ undefined / undefined - (Apr 29, 2014) - (ArmA3 ver 1.16), here's a quick reference to backpack command family. - Command - Operand type - Return - Example - firstBackpack - Object (WeaponHolder, AmmoCrate, VehicleCrate) - Object (eg 2bba9d00# 163957: backpack_compact.p3d) - firstBackpack ( getPos player nearestObject "weaponholder") - backpackContainer - Unit( Object ) - Object (eg 2bba9d00# 163957: backpack_compact.p3d) - backpackContainer player //Currently same as unitBackpack - unitBackpack - Unit( Object ) - Object (eg 2bba9d00# 163957: backpack_compact.p3d) - unitBackpack player //Currently same as backpackContainer - backpack - Unit( Object ) - String (eg 2bba9d00# 163957: backpack_compact.p3d) - backpack player //See also ( typeOf backpackContainer player ) or ( typeOf unitBackpack player ) - backpackCargo - Object (WeaponHolder, AmmoCrate, VehicleCrate) - Array of String (eg ["Backpack0","Backpack1"]) - backpackCargo _AmmoCrate - getBackpackCargo - Object (WeaponHolder, AmmoCrate, VehicleCrate) - Array of Array (eg [["Backpack0","Backpack1"],[1,1]]) - getBackpackCargo _AmmoCrate - everyBackpack - Object (WeaponHolder, AmmoCrate, VehicleCrate) - Array of Object (eg [22504f00# 163960: backpack_fast.p3d...]) - everyBackpack _AmmoCrate - Array + Number + - everyContainer + text - Returns array of all containers (uniforms, vests, backpacks) stored in given crate or vehicle. Used for accessing containers content stored in ammo box or ground holder. + Creates a structured text containing the given plain text if argument is String or returns location's text value if argument is Location (see Alt Syntax) - https://community.bistudio.com/wiki/everyContainer + https://community.bistudio.com/wiki/text - everyContainer Object + text String + + text Location - everyContainer box + text string + + text location - $Code$everyContainer cursorTarget ; - // [ - //["V_PlateCarrier1_rgr",2bc06b00# 163955: dummyweapon.p3d], - //["U_B_CombatUniform_mcam",2bc07900# 163954: dummyweapon.p3d] - //]$/Code$ + $Code$_stxt2 = text "Hello world.";$/Code$ + + $Code$_townName = text myTownLocation;$/Code$ + + $Code$_loc = text nearestLocation [ position player, "NameMarine"]; //"Marina Bay"$/Code$ undefined / undefined - (July 20, 2017) - The returned array is in the following format: - $Code$[ - [containerClassname1, containerObject1], - [containerClassname2, containerObject2], - .... - [containerClassnameN, containerObjectN] - ] - $/Code$ - Please do note that typeOf containerObjectN does not return containerClassnameN but rather the containerClass configured in config (usually "supplyN") - Array + Structured_Text - String + - execEditorScript + say2D - Execute an editor script for the specified object. - i - Some Old Editor Command + Plays given sound in 2D - https://community.bistudio.com/wiki/execEditorScript + https://community.bistudio.com/wiki/say2D - Control execEditorScript Array + Object say2D String + + Object say2D Array + + Array say2D String + + Array say2D Array - map execEditorScript [object,script] + from say2D sound + + from say2D [sound, maxTitlesDistance, speed] + + [from, to] say2D sound + + [from, to] say2D [sound, maxTitlesDistance, speed] - $Code$_map execEditorScript ["_team_1","create"]$/Code$ - + - undefined / undefined + global / local - Any_Value + Nothing - Nothing - Nothing - Nothing + - execFSM + assignedDriver - Executes scripted FSM and returns the FSM handle or 0 when failed. The FSM file is first searched in the mission folder, then in the campaign scripts folder and finally in the global scripts folder. Argument (if any) are available in _this variable inside FSM. In Arma 3 FSM handle is also available in _thisFSM variable. + Returns the soldier assigned to the given vehicle as a driver. - https://community.bistudio.com/wiki/execFSM + https://community.bistudio.com/wiki/assignedDriver - Anything execFSM String - - execFSM String + assignedDriver Object - arguments execFSM filename - - execFSM filename + assignedDriver vehicle - $Code$_id = player execFSM "test.fsm";$/Code$ - - $Code$_handle = [_a, _b, _c] execFSM "test.fsm";$/Code$ - - $Code$_handle = execFSM "test.fsm";$/Code$ + $Code$_driver= assignedDriver vehicleName$/Code$ undefined / undefined @@ -23645,383 +24987,369 @@ - Number - Number + Object + - execVM + getAllOwnedMines - Compiles and adds SQF Script to the scheduler queue and returns script handle. The script is first searched for in the mission folder, then in the campaign scripts folder and finally in the global scripts folder. The script does not execute immediately upon running execVM command, but with some delay. How much delay is unknown as it largely depends on how many other scripts there are in the queue and how busy is VM. The optional argument is passed to the script in private variable _this. In Arma 3 the script handle is also passed to the script in _thisScript variable. - In order to understand execVM consider the following comparison: - $Code$ private _handle = _args execVM "someFile.sqf"; - // is practically identical to - private _handle = _args spawn compile preprocessFileLineNumbers "someFile.sqf";$/Code$ - So if you need multiple execution of the same file, you might want to store it in a function ( Functions Library ), otherwise, for a single execution, execVM is a good choice. + Gets all mine objects this unit has ownership over. - https://community.bistudio.com/wiki/execVM + https://community.bistudio.com/wiki/getAllOwnedMines - Anything execVM String - - execVM String + getAllOwnedMines Object - arguments execVM filename - - execVM filename + getAllOwnedMines unit - $Code$_handle = execVM "test.sqf";$/Code$ - - $Code$_handle = player execVM "test.sqf"; - waitUntil { scriptDone _handle};$/Code$ - - $Code$// In Arma 3 this is also possible: - _handle = execVM "123.sqf"; - waitUntil { isNull _handle};$/Code$ - - $Code$[4] execVM "showDamage.sqf"; - // showDamage.sqf - _damage = _this select 0; - hint format ["%1", _damage];$/Code$ + $Code$_mines = getAllOwnedMines player ;$/Code$ undefined / undefined - (November 23, 2010) - Passing variables to the script file - To pass multiple variables to the script file, use an array e.g: - null = [myunit,1234] execVM "test.sqf"; - Now within test.sqf to access the elements, use the following: - _myunit = _this select 0; - _myvar = _this select 1; - Script_Handle - Script_Handle + Array + - exec + cutText - Execute a script using (the deprecated but still available).sqs syntax. The argument is passed to the script in the "_this" variable, and magic variable "_time" within the script contains the time in seconds that the script has been running. - Alternatively use execVM command in combination with.sqf syntax. - Learn more about scripts under Scripts. + Displays a text message in the center of the screen. The text can be displayed on multiple lines by using "\n" new line characters: cutText ["line1\nline2\nline3", "PLAIN"];. Since Arma 3 v1.73.142260 this command supports Structured Text formatting. + For greater efficiency and ease of modability it is recommended to use named layers available with alternative syntax since Arma 3 v1.57.134673 - https://community.bistudio.com/wiki/exec + https://community.bistudio.com/wiki/cutText - Any_Value exec String + cutText Array + + Number cutText Array + + String cutText Array - argument exec script + cutText [text, type, speed, showInMap, isStructuredText] + + layer cutText [text, type, speed, showInMap, isStructuredText] + + layerName cutText [text, type, speed, showInMap, isStructuredText] - $Code$[player, _jeep] exec "getin.sqs"$/Code$ + $Code$cutText ["","BLACK OUT"]; + cutText ["Hello World!","PLAIN",2];$/Code$ + + $Code$2 cutText ["Hello World!","PLAIN",2];$/Code$ + + $Code$_layer1 = "normal" cutText ["In The Centre","PLAIN"]; + _layer2 = "down" cutText ["At The Bottom","PLAIN DOWN"];$/Code$ + + $Code$// Since Arma 3 v1.73.142260: + cutText [" t color='#ff0000' size='5' RED ALERT! /t br/ ***********", "PLAIN", -1, true, true ];$/Code$ - undefined / undefined + undefined / local + (September 20, 2013) + In Arma 3 "PLAIN" param will display your text where the crosshair is, "PLAIN DOWN" will push the text further down, closer to the bottom of the screen. + + (July 6, 2016) + The value for speed has to be greater 0. If 0 is used as speed the default value (1) will be used. + If you want to create an "instant" effect you can use a really small value (e.g. 0.001) - Nothing + Nothing - Nothing - Number + - exitWith + forceMap - Exits current scope {...} it is executed from if condition evaluates true, creates new scope {...code...} and executes the given code in it. Often used for exiting do, for, count or forEach. Simply exiting waitUntil or onEachFrame scopes with exitWith will have no effect as these scopes are called repeatedly by the engine and require different handling to terminate (see Example 3). + Opens non-interactive main map in background that overrides user screen. The user is able to fire but cannot see the world just the map. To force open interactive map use openMap command. - https://community.bistudio.com/wiki/exitWith + https://community.bistudio.com/wiki/forceMap - If_Type exitWith Code + forceMap Boolean - ifType exitWith code + forceMap show - $Code$if (_x 5) exitWith { echo "_x is too big"; _x} - // When _x is greater than 5, outputs message and terminates code in current level with value of _x.$/Code$ - - $Code$for "_j" from 1 to 10 do - { - player sideChat format ["%1",_j]; - if (_j==5) exitWith { player sideChat "5 is enough"}; - }; - player sideChat "Complete"; - // Only the "for" loop will exit when the exitWith condition has been fulfilled (not the whole script). Execution will continue after the end of the loop (player sideChat "Complete").$/Code$ - - $Code$// Most loops will also terminate when their scope exited. To exit and terminate scopes which are called every frame such as onEachFrame and waitUntil use the following examples: - onEachFrame { - if (! alive player ) exitWith { - onEachFrame {} - } - } - _time = time + 10; - waitUntil { - if ( time _time) exitWith { - true - } - }$/Code$ + $Code$forceMap true$/Code$ - undefined / undefined + undefined / local - (May 28, 2010) - Since ArmA2 uses Blocks in FSM as any ordinary Handle like while, for etc. in Scripts, ExitWith also only closes the Block in the FSM. - - (August 04, 2013) - The command will exit the current scope - no ifs no buts. If the current scope is a loop, it will exit the loop. If the current scope is the main body of a script, it will exit the script. For more understanding of scopes and exitWith have a look at this resource. - - (January 06, 2014) - To further explain Killzone_Kid 's above statement, exitWith does not work as described within any subsequent inner scopes of a loop - it will only simply exit the current scope. For example, this code will not exit the while loop: - $Code$ while { true } do { // 'while' scope - if ( player == ( leader player )) then { // 'if-then' scope - if ( time (5 * 60)) exitWith {}; // This will only exit the 'if-then' scope - }; - sleep 1; - }; - hint "Mission Started"; // This code will never execute$/Code$ - - (March 10, 2016) - exitWith cannot be used in event handlers with override ability to simply exit with override value. The following is incorrect: - $Code$// INCORRECT USAGE - onMapSingleClick { if (! isServer ) exitWith { true }};$/Code$ - The override value must be returned in the main scope of EH, but since it is exited with exitWith, it never happens. The correct way in this case would be: - $Code$// CORRECT USAGE - onMapSingleClick { call { if (! isServer ) exitWith { true }}};$/Code$ - exitWith will exit current call scope only and override value therefore will appear in the main scope of the EH, right where we want it. + In OFP v1.96, the mapAnim series of commands, together with forceMap can only be used in the intro and mission, as it is not possible to access the map from the outro. (not checked, sourced from an old copy of the OFPEC comref) - (October 12, 2016) - exitWith does not use standard "if-then" syntax, but a unique "if-exitWith" structure. + Manually opening the map afterwards won't close the map. Actually it will open the "real" map on top of the forced map, and closing the (top) map with the m -key again will still show the forcefully opened map. (ArmA 1.05) - Anything + Nothing + - exit + mineDetectedBy - Stops the execution of a SQS script. - It's ignored in SQF Scripts. + Returns true if mine has been detected by a given side - https://community.bistudio.com/wiki/exit + https://community.bistudio.com/wiki/mineDetectedBy - exit + Object mineDetectedBy Side - exit + mine mineDetectedBy faction - $Code$exit$/Code$ + $Code$( allMines select 0) mineDetectedBy west ;$/Code$ - undefined / local + undefined / undefined - Nothing + Boolean + - expectedDestination + lbSetText - Return expected destination of unit as an array with format: [ Position, planningMode, forceReplan]. + Sets the text on the left side of the item with the given index of the listbox or combobox with id idc of the topmost user dialog. - https://community.bistudio.com/wiki/expectedDestination + https://community.bistudio.com/wiki/lbSetText - expectedDestination Object + lbSetText Array + + Control lbSetText Array - expectedDestination person + lbSetText [idc, index, name] + + control lbSetText [index, name] - + $Code$lbSetText [101, 0, "iskoda"];$/Code$ + + $Code$_control lbSetText [0, "iskoda"];$/Code$ + - local / undefined + local / local - (16:24, 3 March 2007 (CET)) - For AI units I have found the following values: planningMode is "LEADER PLANNED" when the unit is ordered by the group leader to go somewhere or if the unit is the group leader and it follows a waypoint. Otherwise planningMode it is "DoNotPlan". Units moving in formation have "DoNotPlan" as long as they don't receive orders by the group leader. Units also have "DoNotPlan" when they don't move. Units executing special formation tasks like engaging or return to formation have "FORMATION PLANNED" as long they haven't fulfilled the task. + More information on the LB command family can be found here - Array + Nothing - Nothing + - exportJIPMessages + camSetDive - Export list of JIP to a file. Special: BattlEye's RCON variant of this command is #exportJIPqueue (see also Multiplayer_Server_Commands ) + Sets camera dive angle. Does not commit changes. + This command is non-functional ! - https://community.bistudio.com/wiki/exportJIPMessages + https://community.bistudio.com/wiki/camSetDive - exportJIPMessages String + Object camSetDive Number - exportJIPMessages fileName + camera camSetDive dive - $Code$exportJIPMessages "myFileNameWithoutExtension";$/Code$ + $Code$_camera camSetDive -0.1$/Code$ undefined / undefined + (Apr 15, 2010) + Command is non-functional. Instead, use fn vbs setPitchBank in VBS2, or setVectorUp or this user function in Arma. - Nothing + Nothing + - exp + createDiaryRecord - Let x be a number, then exp (x) is equal to e to the power of x (or e^x) + creates a diary entry. + Supported tags and their parameters: + All + image : String - path to image. When present, any element with it will be displayed as image. + width : Number - image width in pixels. + height : Number - image height in pixels. + font + color : String - HTML color in format #aarrggbb or #rrggbb + size : Number - font height in pixels. + face : String - font type (class from CfgFontFamilies) + br + marker + name : String - marker name + execute + expression : String - executed code + executeClose + expression : String - executed code, diary is closed afterwards + log + subject : String - subject name. + record : String - record name (e.g. "Record6" or "Unit1059524") + gear + unit : Number - unit ID + teamSwitch + unit : Number - unit ID + kick + id : Number - player ID + ban + id : Number - player ID + mute + id : Number - player ID + currentTask + id : Number - task ID - https://community.bistudio.com/wiki/exp + https://community.bistudio.com/wiki/createDiaryRecord - exp Number + Object createDiaryRecord Array - exp x + unitName createDiaryRecord [subject, text, task, state] + + unitName createDiaryRecord [subject, [title, text], task, state] - $Code$_result = exp 1 - // returns 2.7182$/Code$ + $Code$player createDiaryRecord ["Diary", ["Intel", "Enemy base is on grid marker name='enemyBase' 161170 /marker "]]$/Code$ + + $Code$player createDiaryRecord ["Diary", "Information gathered. br / img image='wellDone_ca.paa' / "]$/Code$ - undefined / undefined + undefined / local - Note that you cannot exponent a value greater than 88.72283554077147726999 (999 repeating), as this is beyond what the game can calculate. + (14:54, 15 January 2011‎) + To insert a link into a diary record that executes code instead of jumping to a marker, use the tag + execute expression=" Code to execute " Text /execute + + (March 24, 2017) + When adding multiple diary records, be aware that they appear in reverse order. ie the first one you add will appear last and the last one you add will be first. - Number + String + - eyeDirection + addBackpackGlobal - Returns the direction object is watching (eyes, or a vehicle primary observer). + Adds a backpack to a unit (even non-local) - https://community.bistudio.com/wiki/eyeDirection + https://community.bistudio.com/wiki/addBackpackGlobal - eyeDirection Object + Object addBackpackGlobal String - eyeDirection unit + unit addBackpackGlobal backpack - $Code$can = "Land_Can_V3_F" createVehicle position player ; - onEachFrame { - can setPosASL [ - ( eyePos player select 0) + ( eyeDirection player select 0), - ( eyePos player select 1) + ( eyeDirection player select 1), - ( eyePos player select 2) + ( eyeDirection player select 2) - ] - }$/Code$ - - $Code$// Draw AI eye direction (green) and weapon direction (red) in 3D: - bob = createGroup east createUnit ["O_Soldier_F", [0,0,0], [], 0, "NONE"]; - bob setVehiclePosition [ player modelToWorld [0,100,0], [], 0, "NONE"]; - onEachFrame - { - _beg = ASLToAGL eyePos bob; - _endE = (_beg vectorAdd ( eyeDirection bob vectorMultiply 100)); - drawLine3D [ _beg, _endE, [0,1,0,1]]; - _endW = (_beg vectorAdd (bob weaponDirection currentWeapon bob vectorMultiply 100)); - drawLine3D [_beg, _endW, [1,0,0,1]]; - };$/Code$ + $Code$player addBackpackGlobal "B_AssaultPack_khk";$/Code$ - global / undefined + global / global - (May 26, 2014) - This command should have really been named headDirection instead of eyeDirection as one could mistakenly think that eyes direction of your avatar correspond to the direction of the centre of your screen. Play with the script in example 1 to find out limitations. If you need centre of screen direction, use positionCameraToWorld instead. - Array + Nothing + - eyePos + cancelSimpleTaskDestination - Returns the object's eyes / main turret position. + Cancels a simple task destination. - https://community.bistudio.com/wiki/eyePos + https://community.bistudio.com/wiki/cancelSimpleTaskDestination - eyePos Object + cancelSimpleTaskDestination Task - eyePos object + cancelSimpleTaskDestination task - $Code$eyePos player$/Code$ + $Code$cancelSimpleTaskDestination myTask;$/Code$ - global / undefined + undefined / undefined - Array + Nothing + - face + needReload - Returns the face of a person. + Return how much vehicle wants to reload its weapons. - https://community.bistudio.com/wiki/face + https://community.bistudio.com/wiki/needReload - face Object + needReload Object - face person + needReload vehicle - $Code$face player$/Code$ + $Code$_seriousness = needReload _vehicle;$/Code$ + + $Code$if ( needReload player == 1) then { reload player };$/Code$ undefined / undefined @@ -24029,236 +25357,246 @@ - String + Number + - faction + ctrlHTMLLoaded - Gets unit faction. Factions are defined under CfgFactionClasses. If the given faction is not defined, the command returns empty string. Standard Factions include: - Arma 2 : - West: "USMC", "CDF" - East: "RU", "INS" - Guer: "GUE" - Civ: "CIV", "CIV_RU" - Arma 2: Operation Arrowhead : - West: "BIS_US", "BIS_CZ", "BIS_GER" - East: "BIS_TK", "BIS_TK_INS" - Guer: "BIS_TK_GUE", "BIS_UN" - Civ: "BIS_TK_CIV", "BIS_CIV_special" - DLC Factions - Arma 2: British Armed Forces : - West: "BIS_BAF" - Arma 2: Private Military Company : - Guer: "PMC_BAF" - Arma 3 : - West: "BLU_F" (NATO), "BLU_G_F" (FIA) - East: "OPF_F" (CSAT), "OPF_G_F" (FIA) - Guer: "IND_F" (AAF), "IND_G_F" (FIA) - Civ: "CIV_F" (Civilians) + Returns true when HTML content was successfully loaded. - https://community.bistudio.com/wiki/faction + https://community.bistudio.com/wiki/ctrlHTMLLoaded - faction Object + ctrlHTMLLoaded Control - faction unitName + ctrlHTMLLoaded control - $Code$_faction = faction _object;$/Code$ + $Code$_control htmlLoad "test.html"; + if (! ctrlHTMLLoaded _control) then { + hint "Loading test.html failed!"; + };$/Code$ - global / undefined + undefined / undefined - Faction behaves slightly differently to side. Side can refer to the pilot or commander of a vehicle, but faction never changes. It always returns the 'country of manufacture'. - String + Boolean + - fadeMusic + ctrlEnabled - Changes the music volume smoothly within the given time. + Returns if a control on the currently active user dialog is enabled. Disabled controls cannot be focused. + Read Dialog Control for more information about user dialogs and controls. - https://community.bistudio.com/wiki/fadeMusic + https://community.bistudio.com/wiki/ctrlEnabled - Number fadeMusic Number + ctrlEnabled Number + + ctrlEnabled Control - time fadeMusic volume + ctrlEnabled idc + + ctrlEnabled controlName - $Code$5 fadeMusic 0$/Code$ + $Code$if (!(ctrlEnabled 100)) then + { + ctrlEnable [100, true] + };$/Code$ + + $Code$_enabled = ctrlEnabled _control$/Code$ - undefined / local + local / undefined - Nothing + Boolean - Boolean + - fadeRadio + showLegend - Causes a smooth change in the radio volume. The change duration is given by time, the target volume by volume. The default radio volume is 1.0. + Show/hide map legend. + i + Some Old Editor Command - https://community.bistudio.com/wiki/fadeRadio + https://community.bistudio.com/wiki/showLegend - Number fadeRadio Number + Control showLegend Boolean - time fadeRadio volume + map showLegend bool - $Code$5 fadeRadio 0.1$/Code$ - + - undefined / local + undefined / undefined - (September 11, 2008) - Does not affect VON - - (September 13, 2016) - Also influences audibility of the missile warning in helicopters. - Nothing + Nothing + - fadeSound + canTriggerDynamicSimulation - Changes the sound volume smoothly within the given time. + A getter for triggerDynamicSimulation - https://community.bistudio.com/wiki/fadeSound + https://community.bistudio.com/wiki/canTriggerDynamicSimulation - Number fadeSound Number + canTriggerDynamicSimulation Object - time fadeSound volume + canTriggerDynamicSimulation unit - $Code$5 fadeSound 0$/Code$ + $Code$hint str canTriggerDynamicSimulation player ;$/Code$ - undefined / local + undefined / undefined - (January 19, 2010) - This command doesn't work, in Arma 2 1.05. - Nothing + Boolean + - fadeSpeech + addSwitchableUnit - Cause a smooth change in the master speech volume. The change duration is given by time, the target volume by volume. The default master is 1.0. + Adds a unit into the list of units available for Team Switch. Units marked as playable in editor are automatically switchable. This command allows to add non-playable unit into array of switchableUnits and make them available for teamSwitch. SP only. - https://community.bistudio.com/wiki/fadeSpeech + https://community.bistudio.com/wiki/addSwitchableUnit - Number fadeSpeech Number + addSwitchableUnit Object - time fadeSpeech volume + addSwitchableUnit unitName - $Code$5 fadeSpeech 0.1;$/Code$ + $Code$addSwitchableUnit bob$/Code$ - undefined / local + undefined / undefined - Nothing + Nothing + - failMission + say3D - Finish the mission. If the server is set to run persistent mission, failMission will not end the mission when last player gets kicked to the lobby. Use endMission to end the mission. - The end type can be: - "CONTINUE" - "KILLED" - "LOSER" - "END1" - "END2" - "END3" - "END4" - "END5" - "END6" - Mission saves won't be deleted. - To maintain Arma 3 visual style, it's recommended to use BIS_fnc_endMission instead. + Unit or object will say given sound in 3D Space. This allows broadcasting of positional music or sound from a source, without having to script a fade sound or music command. Compare this with say2D which will always play a sound at the location of the player after he has been in the vicinity of a broadcasting sound. Sound is defined in "CfgSounds" of the Description.ext or main config. + NOTE : You can stop say3D sound currently playing in 2 ways: delete the source of the sound (from) with deleteVehicle or kill the source with setDamage for example. - https://community.bistudio.com/wiki/failMission + https://community.bistudio.com/wiki/say3D - failMission String + Object say3D String + + Object say3D Array + + Array say3D String + + Array say3D Array - failMission endtype + from say3D sound + + from say3D [sound, maxDistance, pitch] + + [from, to] say3D sound + + [from, to] say3D [sound, maxDistance, pitch] - $Code$failMission "LOSER";$/Code$ + $Code$helicopter1 say3D "Fortunateson"$/Code$ - undefined / undefined + global / local + (7 March 2013) + The only difference with this command and say is during cutscenes (when some camera effect is active). In cutscenes, say3D is 3D, say is not. + + (July 19, 2015) + In Arma 2 1.63, the object this command is assigned to must be alive for the sound to broadcast. If the object is killed while the sound is still playing, the sound will stop immediately. + Here is a link to the forum to get around this issue: [1] + I have not tested this in Arma 3 yet. + + (October 13, 2016) + This command is local. + + (March 11, 2017) + This command creates sound object "#soundonvehicle" which can be detected with allMissionObjects : + $Code$ onEachFrame { hintSilent str allMissionObjects "#soundonvehicle"}; + [] spawn { sleep 1; player say3D "Alarm"};$/Code$ - Nothing + Nothing - Nothing - Nothing - Nothing + - false + diag_enabled - Always false. + Checks whether specific diagnostic mode is activated. + Only available in the Arma 3 Diagnostic exe - https://community.bistudio.com/wiki/false + https://community.bistudio.com/wiki/diag_enabled - false + diag_enabled String - false + diag_enabled diag_mode - $Code$_var = false ; - systemChat str _var; //false$/Code$ + $Code$"Animation" diag_enable true ; + diag_enabled "Animation";//returns true$/Code$ undefined / undefined @@ -24266,53 +25604,53 @@ - Boolean + Boolean + - fillWeaponsFromPool + set3DENModelsVisible - Adds magazines from the campaign pool to the given unit, depending on his weapons. + Enables or disables lines visibility in 3DEN - https://community.bistudio.com/wiki/fillWeaponsFromPool + https://community.bistudio.com/wiki/set3DENModelsVisible - fillWeaponsFromPool Object + set3DENModelsVisible Array - fillWeaponsFromPool unitName + set3DENModelsVisible [map, scene] - $Code$fillWeaponsFromPool _soldier$/Code$ - + undefined / undefined - Nothing + Nothing + - findCover + forEachMemberTeam - Returns the object around where the unit finds cover. The minDist, visibilityPosition and ignoreObject parameters are optional. Command is not functional since Arma 2. - This command is not implemented + Executes the given command recursively for each team that is a member of the given team. For just agents use forEachMemberAgent. For both teams and agents use forEachMember. - https://community.bistudio.com/wiki/findCover + https://community.bistudio.com/wiki/forEachMemberTeam - Object findCover Array + Code forEachMemberTeam Team_Member - object findCover [position, hidePosition, maxDist, minDist, visibilityPosition, ignoreObject] + command forEachMemberTeam team @@ -24320,241 +25658,168 @@ undefined / undefined - (17 Oct, 2009) - Arma 2: v1.04: Usage creates report log message: " MicroAI: Command findCover not implemented ( unit id ) " - - (07 Jan, 2011) - OA: v1.57: Still non functional. - - (12 July, 2011) - CO: v1.59: Still non functional. - - (13 February, 2014) - Arma 3: Still non functional. - - (July 4, 2015) - An alternative function in ArmA 3 might be BIS_fnc_findSafePos - Object + Nothing + - findDisplay + netId - Find display by its IDD (which is defined in the description.ext or config). - If the specified display can't be found displayNull ("No display") is returned, (which can be tested with the isNull command.) - The primary display uses IDD 46. (eg: findDisplay 46). This will return displayNull on a dedicated server (so be sure to check isDedicated if using this in a waitUntil condition). + Unique ID of object or group. As this command is MP only, you can use BIS_fnc_netId, which extends the use to SP as well. See also: BIS_fnc_objectVar - https://community.bistudio.com/wiki/findDisplay + https://community.bistudio.com/wiki/netId - findDisplay Number + netId Object/Group - findDisplay idd + netId var - $Code$_display = findDisplay 1;$/Code$ + $Code$_playerNetId = netId player ;$/Code$ undefined / undefined - (15 June 2008) - findDisplay does not find displays defined under RscTitles (even when they are visible). - To access those types of displays, either assign the resource to a global variable, or pass its this value to a script, during the onLoad event: - e.g. class RscTitles { - class MyRsc { - onLoad = "myDisplay = (_this select 0)"; // or - // onLoad = "_this execVM 'myDialog.sqf'"; - ... - You can then use the stored value as you would for regular dialogs: - $Code$(myDisplay displayCtrl 1111) ctrlSetText "hello there");$/Code$ - - (17 March 2010) - I posted a tutorial on finding and using displays here. - - (07 March 2014) - The Zeus Display uses IDD 312 - - (March 25, 2015) - Display 12 is map - - (June 25, 2017) - I have tested the behavior of this command and I found out that it [ findDisplay ] appears to only return the display AFTER any onLoad event handler of that display is done. So, using findDisplay inside an onLoad event handler is useless. - - (August 14, 2017) - There are some specific cases, where findDisplay will not be able to find an existing display. Here's the cases and how to act on them: - $Code$//Your display has IDD= -1. - class RscDisplayNew - { - idd=-1; - scriptName = "RscDisplayNew"; - ... - };$/Code$ - $Code$//Your display doesn't have IDD - class RscDisplayNew - { - scriptName = "RscDisplayNew"; - ... - };$/Code$ - $Code$//Your display doesn't have scriptname with IDD = -1 - class RscDisplayNew - { - idd=-1; - ... - };$/Code$ - $Code$//Your display doesn't have scriptname, neither IDD - class RscDisplayNew - { - ... - };$/Code$ - 1. - You actually can find a -1 display, but this means finding a display with this IDD might be a problem, when there are a few displays marked as -1. - So as you can see, theres an entry called scriptName. You can get a reference to this display by using uiNamespace : - $Code$(uiNamespace getVariable "RscDisplayNew")$/Code$ - NOTE : Variables are overwritten with a reference of the last declared display under the same scriptName entry. Take a look at case 3 for solution. - 2. - Displays without IDD's can actually exist. They can be manipulated only in a way described in the first case using uiNamespace. - 3. - You can really have this display seeking it manually in a allDisplays return. This is experimental, but working option. - 4. - You will have a problem finding this display, since this display doesn't exist even in allDisplays (?) return. Behaviour unknown. - Display + String + - findEditorObject + supportInfo - Return object that matches the provided reference. - i - Some Old Editor Command + Creates a list of supported operators and type. Each field of array has the format: "x:name" Where x can be: + 't' - type + 'n' - null operator + 'u' - unary operator + 'b' - binary operator. + 'name' is the operator or type name (in case operator, type of input operands is included). + mask parameter can be an empty string, or one of field. In this case, function returns empty array, if operator is not included in the list. Limited wildcard support is available. Type x may be replaced with *, meaning all types. For the mask partial match may be used, like abc*, meaning any operators starting with 'abc' are reported, for example: *:name, t:*, t:name* or *:*. - https://community.bistudio.com/wiki/findEditorObject + https://community.bistudio.com/wiki/supportInfo - Control findEditorObject Any_Value + supportInfo String - map findEditorObject value + supportInfo mask - + $Code$supportInfo "b:select*"; //Returns ["b:ARRAY select SCALAR","b:ARRAY select BOOL","b:CONFIG select SCALAR"]$/Code$ + + $Code$// Return all available commands: + _commands = supportInfo "";$/Code$ + undefined / undefined + (July 22nd, 2012) + With CBA one can create a list of all available SQF commands in the RPT + [supportInfo ""] call cba_fnc_debug; + One can get CBA here. + + (September 24, 2014) + To get the list of all supported commands in Arma 3 one can simply: + $Code${ diag_log _x} forEach supportInfo "";$/Code$ - String + Array + - findEmptyPositionReady + targets - Check if findEmptyPosition command can be called without waiting for files. + Retrives list of given unit targets matching specified filter. If the filter is not specified, all targets are returned. - https://community.bistudio.com/wiki/findEmptyPositionReady + https://community.bistudio.com/wiki/targets - Array findEmptyPositionReady Array + Object targets Array - center findEmptyPositionReady [radius,maxDistance] + unit targets [enemyOnly, maxDistance, sides, maxAge, alternateCenter] - + $Code$_targets = _unit targets [false, 300, [east,sideEnemy]]; //all targets of east or renegade side in 300m$/Code$ + + $Code$_targets = _unit targets [true, 300]; //enemy targets in 300m$/Code$ + + $Code$_targets = _unit targets []; //all targets$/Code$ + - undefined / undefined + global / undefined - Boolean + Array + - findEmptyPosition + diag_lightNewLoad - Searches for an empty position around specified position. The search starts looking for an empty position at a minimum distance of [minDistance] from the [center] and looks as far away as [maxDistance]. If a [vehicleType] parameter is specified, then the search will look for an empty positions that is big enough to hold that vehicle type. If an empty position isn't found, an empty array is returned. - This command ignores moving objects present within search area. + Allows loading of lightning config during the gameplay (effectively changing the current scene lightning). Filename path can be either absolute or relative. The file must contain only the class LightningNew, which should contain lightning configuration. + Command is only available when using Arma 3 Diagnostics Exe on Dev-Branch. - https://community.bistudio.com/wiki/findEmptyPosition + https://community.bistudio.com/wiki/diag_lightNewLoad - Array findEmptyPosition Array + diag_lightNewLoad String - center findEmptyPosition [minDistance, maxDistance, vehicleType] + diag_lightNewLoad path - $Code$_position = ( getPosATL player ) findEmptyPosition [0,100];$/Code$ - - $Code$_position = _center findEmptyPosition [10,100,"UH60M_EP1"];$/Code$ - - $Code$// Check if exact position is empty: - _position = _center findEmptyPosition [0,0,"B_Boat_Armed_01_minigun_F"];$/Code$ + $Code$diag_lightNewLoad "o:\lighting.txt"$/Code$ undefined / undefined - (November 6, 2013) - Keep search radius short and sweet, under 50 metres maybe. Searching big area takes long time and will result in your game stop responding until the search is over. isFlatEmpty is probably more suitable for a larger area search. - - (March 6, 2012) - I think the radius parameter should be treated as a 'minimum distance' from the centre position. I found that the parameter name radius wasn't very clear. Also, if radius is greater than max distance then the function will always return an empty array. - Here is an snippet of code I use to find a safe landing zone for an extraction helicopter. It may be useful for someone. - $Code$_centre = [ getMarkerPos "marker", random 150, random 360 ] call BIS_fnc_relPos; - _extraction_point = []; - _max_distance = 100; - while{ count _extraction_point 1 } do - { - _extraction_point = _centre findEmptyPosition[ 30, _max_distance, "UH60M_EP1" ]; - _max_distance = _max_distance + 50; - }; - $/Code$ - In the above example, make sure that "_max_distance" is greater than 30, otherwise the while loop will go forever. - Array + Nothing + - findNearestEnemy + getGroupIconParams - Finds the nearest enemy to the specified position. Returns a null object if the object's group does not know about any enemies. This command will return nearest object that is known to the unit and is considered enemy. An empty vehicle that is part of enemy group assets (see addVehicle ) can be returned as valid nearest target. + Returns group icons params used for command bar drawing such as color, text, scale, visibility, waypoint visibility, waypoint color. - https://community.bistudio.com/wiki/findNearestEnemy + https://community.bistudio.com/wiki/getGroupIconParams - Object findNearestEnemy Object/Array + getGroupIconParams Group - object findNearestEnemy position + getGroupIconParams group - $Code$_myNearestEnemy = ( units _myGroup select 0) findNearestEnemy player ;$/Code$ - - $Code$_myNearestEnemy = player findNearestEnemy player ;$/Code$ + $Code$_iconParams = getGroupIconParams group player ;$/Code$ undefined / undefined @@ -24562,340 +25827,184 @@ - Object + Array + - find + setLightFlareSize - Searches for an array element within array or a string within a string. Returns the 0 based index on success or -1 if not found. Test is cASe-seNsItiVE + Sets relative size of the flare for the light. - https://community.bistudio.com/wiki/find + https://community.bistudio.com/wiki/setLightFlareSize - Array find Anything - - String find String + Object setLightFlareSize Number - array find x - - string find x + light setLightFlareSize size - $Code$["Apples","Oranges","Pears"] find "Oranges"; //result is 1 - [1,[2],[[3]]] find [[3]]; //result is 2$/Code$ - - $Code$if ( magazines player find "Strela" = 0) then { hint "You've got Strela!"};$/Code$ - - $Code$hint str ("japa is the man!" find "the man!"); //8$/Code$ + $Code$myLight setLightFlareSize 5;$/Code$ - undefined / undefined + local / local - (January 4, 2015) - Using nil on either side of find will make the whole statement return Nothing : - $Code$_array = [1,2, nil,4,5]; - _result = _array find nil; - hintSilent str ( isNil "_result"); //true - _result = nil find 1; - hintSilent str ( isNil "_result"); //true$/Code$ - - (April 10, 2015) - Find doesn't work with multidimensional arrays in OFP/CWA. It will always returns -1. - - (May 17, 2016) - This command is unreliable/broken when it comes to some non-ASCII characters (as of Arma 3 1.58): - $Code$"abcßdef" find "c" - - 2 - "abcßdef" find "ß" - - 3 - "abcßdef" find "d" - - 5$/Code$ - - (July 7, 2016 10:56 (UTC)) - Not quite unreliable, just unexpected! Strings are tracked in terms of bytes rather than in actual character positions; all strings are stored in UTF-8 format. In other words, the eszett character is in Unicode, which takes up two bytes rather than one as it is within the 128-255 range of Unicode. (Similar results would be expected for the division symbol, the umlaut, accented e's, etc.) Symbols that are particularly high in the Unicode range may take up three bytes, or even four for the truly exceptional characters, although Arma 3's default fonts are unlikely to render them. This definitely complicates any script which assumes any printable character is a single byte, however, and unfortunately I'm not skilled enough with internationalisation to recommend any robust fix. - Number - Number + Nothing + - finishMissionInit + scopeName - Finish world initialization before mission is launched. + Defines name of current scope. Name is visible in debugger, and name is also used as reference in some commands like breakOut and breakTo. Scope name should be defined only once per scope. Trying to set a different name on the scope that has already defined scope name will result in error. - https://community.bistudio.com/wiki/finishMissionInit + https://community.bistudio.com/wiki/scopeName - finishMissionInit + scopeName String - finishMissionInit + scopeName name - + $Code$scopeName "main"; + while {true} do { + scopeName "loop1"; + while {true} do { + scopeName "loop2"; + ... + }; + };$/Code$ + undefined / undefined - Nothing + Nothing + - finite + removeMagazineTurret - True, if number is finite (not infinite and a valid number) + Removes the magazine from the turret. Use turret path [-1] for driver's turret. + Note: you may create invalid combinations by using this function. When doing so, application behaviour is undefined. - https://community.bistudio.com/wiki/finite + https://community.bistudio.com/wiki/removeMagazineTurret - finite Number + Object removeMagazineTurret Array - finite x + vehicle removeMagazineTurret [magazineName, turretPath] - $Code$?!finite 10/0 : hint "Infinite"$/Code$ + $Code$vehicle player removeMagazineTurret ["60rnd_cmflaremagazine",[-1]]$/Code$ + + $Code$_tank removeMagazineTurret ["20Rnd_120mmSABOT_M1A2",[0]]$/Code$ - undefined / undefined + local / global - (27 Sep, 2013) - Don't get high hopes with this command thinking what a great way of catching divisions by zero, the command is pretty useless in this respect: - $Code$//ArmA 2 - hint str finite (10/0); //true... O_o Huh???? - hint str (10/0); //0... Weird, but that explains it. - //ArmA 3 - hint str finite (10/0); // Error Zero Divisor - hint str finite 10; //true - hint str finite 1000000000000000000000000000000000000000; //false$/Code$ - Boolean + Nothing + - fireAtTarget + enableTeamSwitch - Remotely forces a unit to fire the given weapon. See also: BIS_fnc_fire + Enable / disable Team Switch. The default setting is enabled. - https://community.bistudio.com/wiki/fireAtTarget + https://community.bistudio.com/wiki/enableTeamSwitch - Object fireAtTarget Array + enableTeamSwitch Boolean - sourceVehicle fireAtTarget [targetVehicle, weaponMuzzleName] + enableTeamSwitch enable - $Code$_handle = this fireAtTarget [groundtarget1,"HellfireLauncher"];$/Code$ - - $Code$_handle = Igla_AA_pod_TK_EP1 fireAtTarget [_helicopter, currentWeapon Igla_AA_pod_TK_EP1];$/Code$ - - $Code$_handle = Igla_AA_pod_TK_EP1 fireAtTarget [helicopter];$/Code$ - + undefined / undefined - (Sep 16, 2010) - Most likely only for missiles and for interaction with player only. - - (Apr 8, 2014) - (A3 1.14) Source vehicle is only limited to manned vehicle while any other types won’t be able to active fireAtTarget handle, e.g. - $Code$ - _handle = _InfantryUnit fireAtTarget [_Infnatrytarget,( weapons _Infantryunit select 0)]; - //false & no bullet shoot - $/Code$ - Target has no limitation and can be any object: - $Code$ - _handle = ( vehicle _veh) fireAtTarget [ObjNull,( weapons ( vehicle _veh) select 0)]; - //true & a bullet shoot - $/Code$ - Handle returns false if weapon class name is inaccurate, e.g. - $Code$ - _Handle = ( vehicle _veh) fireAtTarget [ObjNull,”UnknownWeapon”]; - //false & no bullet shoot. - $/Code$ - Handle still returns true even though the vehicle is unavailable to shoot any bullet: - $Code$ - _weapon = weapons ( vehicle _veh) select 0; - ( vehicle _veh) setAmmo [_weapon,0]; - _Handle = ( vehicle _veh) fireAtTarget [ObjNull,_weapon]; - //true & no bullet shoot - $/Code$ - difference - command - Source - Target - Behavior - Workaround templets - fire - Either Unit or manned vehicle - N/A - Fired aiming at air for infantry rifle - Together with selectWeapon, - suggested to work with "throw","put" weapon type - for infantry, or vehicle entity indeed. - fireAtTarget - Manned vehicle only - Any object - Normal shoot, won’t aim at target automatically - _veh doWatch _target; - waitUntil {_veh aimedAtTarget [_target] 0}; - _veh fireAtTarget [_target]; - forceWeaponFire - Either Unit or manned aircraft (weapon operator) - N/A - Normal shoot, can change fire mode - //E.g. unit won't shoot until he is facing the target. - _unit doWatch _tar; - waitUntil { - _dir = direction _unit; - _relative = [_unit,_tar] call BIS_fnc_relativeDirTo ; - if (_dir == _relative) exitWith { - _unit forceWeaponFire [ currentWeapon _unit,"single"]; - }; - false - }; - doFire - Unit only - Either unit or vehicle - automatic aiming and shooting - No special example. - commandFire - Unit only - Either unit or vehicle - automatic aiming and shooting - No special example. - action ["UseWeapon"] - Either unit or manned vehicle - N/A - unexpected behavior - N/A - Boolean + Nothing + - fire + terrainIntersectAtASL - Forces a unit to fire the given weapon. - NOTE: Just like with forceWeaponFire it is possible to pass remote unit as argument, but this could be unreliable. Considering this command might need to be used in combination with selectWeapon, which takes only local arguments, it would make sense to execute fire command where unit is also local. See also: BIS_fnc_fire + Checks for intersection of terrain between two ASL positions. Same as terrainIntersectASL, only returns intersect position instead of Boolean - https://community.bistudio.com/wiki/fire + https://community.bistudio.com/wiki/terrainIntersectAtASL - Object fire String - - Object fire Array + terrainIntersectAtASL Array - unit fire muzzle - - unit fire [muzzle, mode, magazine] + terrainIntersectAtASL [pos1, pos2] - $Code$_soldier fire "M16";$/Code$ - - $Code$_soldier fire "SmokeShellMuzzle";$/Code$ - - $Code$_soldier fire ["SmokeShellMuzzle","SmokeShellMuzzle","SmokeShell"];$/Code$ - - $Code$player playActionNow "PutDown"; - player selectWeapon "DemoChargeMuzzle"; - player fire ["DemoChargeMuzzle", "DemoChargeMuzzle", "DemoCharge_Remote_Mag"]; - player setWeaponReloadingTime [ player, "DemoChargeMuzzle", 0];$/Code$ + $Code$_posASL = terrainIntersectAtASL [ eyePos player, getPosASL chopper];$/Code$ - local / global + undefined / undefined - (August 17, 2006) - Sometimes AI won't shoot when you use this command. It can be fixed by placing selectWeapon command before it. - - (February 2, 2007) - In OFP v1.96, when a man class unit is given this command, he will aim up in the air before firing his weapon. This makes it rather useless if you want to make him shoot a target. It does work with vehicles, when the vehicle is first given a doWatch or doTarget command. - - (January 20, 2007) - In ArmA v1.02, this command is not working with weapons in the secondary turrets (like "DSHKM" in t72) - - (Jan 15, 2008) - To place a satchel (pipebomb) the syntax is: - OFP : unitname Fire ["put", "pipebomb"] - ArmA : unitname Fire ["pipebombmuzzle", "pipebombmuzzle", "pipebomb"]; - The triggering is done via a " TOUCHOFF " action. - - (March 18, 2010) - In Arma2 AI will automatically shoot straight up. Command seems to be broken. - - (November 24, 2010) - Command is broken - confirmed. Use action "USEWEAPON" instead. - Place a game logic in the editor. Name it MyGameLogic. - Use this code to make unit1 fire his primaryweapon: - MyGameLogic action ["useWeapon",primaryWeapon unit1,unit1,0]; - - (Feburary 25, 2011) - Command works just fine in A2/OA. Make sure to execute it on local AI. - - (April 06, 2012) - If it did work at one time, it does no longer. The AI (or player) is forced to look upwards or reacts to a massive recoil force before getting his shot off. - - (Feburary 16, 2013) - Command did not work with ACR 1.62. Used fireAtTarget instead. - - (June 4, 2014) - In Arma 3 in order for AI to place Claymore, for example, it is necessary to execute 3 statements - an animation, weapon select and the actual fire command. Animation is most likely for forcing unit to leave rest state, weapon select and fire kinda both go together anyway: $Code$_unit playActionNow "PutDown"; - _unit selectWeapon "DirectionalMineRemoteMuzzle"; - _unit fire [ - "DirectionalMineRemoteMuzzle", - "DirectionalMineRemoteMuzzle", - "ClaymoreDirectionalMine_Remote_Mag" - ];$/Code$ - Nothing - Nothing + Array + - firstBackpack + setHUDMovementLevels - Returns the first stored backpack. + Set min/max movement borders displayed in HUD gauges. Use -1 to skip some value. - https://community.bistudio.com/wiki/firstBackpack + https://community.bistudio.com/wiki/setHUDMovementLevels - firstBackpack Object + setHUDMovementLevels Array - firstBackpack box + setHUDMovementLevels [minSpeed, maxSpeed, minAlt, maxAlt, minDir, maxDir, targetOrPosition] - $Code$myVariable = firstBackpack myBox;$/Code$ + $Code$setHUDMovementLevels [20,30,-1,-1,0.23,2.1,[0,0,0]]$/Code$ + + $Code$setHUDMovementLevels [20,30,-1,-1,0.23,2.1,player]$/Code$ undefined / undefined @@ -24903,199 +26012,273 @@ - Object + Nothing + - flagAnimationPhase + addWeaponCargo - Returns flag position on the flag pole in range of 0..1, where 0 is bottom of the flag pole, 1 is the top of the flag pole. The result is local to the PC on which command is executed + Add weapons to the cargo space of vehicles, which can be taken out by infantry units. Ignores available cargo space. + In Arma 3, arguments for this command must be local ( ). For global variant see addWeaponCargoGlobal - https://community.bistudio.com/wiki/flagAnimationPhase + https://community.bistudio.com/wiki/addWeaponCargo - flagAnimationPhase Object + Object addWeaponCargo Array - flagAnimationPhase flag + vehicleName addWeaponCargo [weaponName, count] - $Code$flagAnimationPhase _flag1; //0.5$/Code$ + $Code$_truck addWeaponCargo ["M16",5]$/Code$ - global / undefined + global / local + (October 24, 2009) + Only works on clients. + + (July 10, 2010) + When players add/remove gear directly via the gear menu that gear is synchronized across the network. Since this command is local only, using it during a mission can cause all sorts of weird issues. To get proper synchronization use this command in the object's init line or in a script called from its init line with a call compile preprocessFile command (and not execVM ). - Number + Nothing + - flagOwner + getPilotCameraPosition - Returns the global owner of a flag. A getter for setFlagOwner. Note that owner of a flag is Object rather than Number, as how it is usually with other owner commands + Returns model space coordinates of the object airplane or helicopter pilotCamera. - https://community.bistudio.com/wiki/flagOwner + https://community.bistudio.com/wiki/getPilotCameraPosition - flagOwner Object + getPilotCameraPosition Object - flagOwner flag + getPilotCameraPosition object - $Code$_person = flagOwner _flagOne;$/Code$ + $Code$_pilotCamPos = getPilotCameraPosition vehicle player$/Code$ - global / global + global / undefined - Object + Array + - flagSide + doFSM - Returns Side of the local instance of the flag. A getter for setFlagSide. + Orders a unit to process command defined by FSM file (silently). + Unlike with execFSM where _this is passed to the FSM, the following parameters are passed when using doFSM/commandFSM: + _leader + leader of subgroup with this command + _destination + command destination/position + _target + command target + _units + list of all persons in subgroup - https://community.bistudio.com/wiki/flagSide + https://community.bistudio.com/wiki/doFSM - flagSide Object + Object/Array doFSM Array - flagSide flag + unit doFSM [fsmName, position, target] - $Code$_flagSide = flagSide flag;$/Code$ + $Code$_soldierOne doFSM ["move.fsm", position player, player ];$/Code$ - global / local + undefined / undefined + (August 4, 2010) + Do not doStop a unit in a FSM called with doFSM or commandFSM. Doing so nevertheless will halt your FSM, since no links are followed anymore (doing so in an end state should be fine though). Also this may crash your game in certain mysterious circumstances. + You may design your FSM so that they may be called with doFSM/commandFSM and execFSM likewise by checking if _units or _this is nil and then init the variables accordingly. Just remember that you should use the low level moveTo (together with moveToCompleted, moveToFailed ) if do-/commandFSM'd, and doMove or commandMove (together with unitReady ) if execFSM'd. A moveTo in an FSM started with execFSM won't do anything, likewise doMove in a FSM started with doFSM or commandFSM wont work either. Think about it for a minute and you will see why. (hint: a unit running a FSM called with doFSM or commandFSM will _never_ return true for (unitReady _unit) ) + Anyway, if you want to be able to call your FSM either way, a "ready" condition might look light this: (moveToCompleted _unit) || (moveToFailed _unit) || (unitReady _unit), assuming you have a moveTo or a doMove (depending on how the fsm is called) in the prior state. + + (February 14, 2015) + Adding to Rübe's note, doFSM can be checked if it has finished by unitReady as of 2015 and it will return true when your FSM has completed. - Side + Nothing + - flagTexture + sideUnknown - Returns texture of the local instance of the flag. A getter for setFlagTexture. It will not return flag textures applied using forceFlagTexture, use getForcedFlagTexture for that. + The unknown side. + Used when the side of a unit is unknown, e.g. for spotted targets with insufficient information. - https://community.bistudio.com/wiki/flagTexture + https://community.bistudio.com/wiki/sideUnknown - flagTexture Object + sideUnknown - flagTexture flagCarrier + sideUnknown - $Code$_flagTexture = flagTexture _flag1;$/Code$ + $Code$//soldier1 and soldier2 of different sides and out of sight + soldier1 reveal soldier2; + hint str (soldier1 nearTargets 1000); + //returns: [[[1557.96,5047.4,1.32402],"SoldierWB",UNKNOWN,0.0155183,soldier2,5]] + soldier1 reveal [soldier2,1.5]; + //returns: [[[1556.52,5050.08,1.32402],"SoldierWB",WEST,0.0211193,soldier2,5]]$/Code$ - global / local + undefined / undefined - String + Side + - flag + isHidden - Returns the original flag pole of the flag the unit is carrying. + Return whether the person is hidden (reached the hiding position). For command that tests general visibility of an object use isObjectHidden - https://community.bistudio.com/wiki/flag + https://community.bistudio.com/wiki/isHidden - flag Object + isHidden Object - flag unit + isHidden person - $Code$_flag = flag _soldier;$/Code$ - + global / undefined + (January 1, 2017) + Tested in 1.67 DEV, seems to always return false - Object + Boolean + - fleeing + magazinesAmmoFull - Checks if a unit is fleeing. + Returns array of arrays of all vehicle's magazines with extended information about them. + Output format : + [[magazine1],[magazine2],[magazine3]...[magazineN]] + Magazine format : + 0: Magazine class name + 1: Magazine current ammo count + 2: Magazine state (true - loaded, false - not loaded) + 3: Magazine type (-1 - n/a, 0 - grenade, 1 - primary weapon mag, 2 - handgun mag, 4 - secondary weapon mag, 65536 - vehicle mag) + 4: Magazine location ("Vest", "Uniform", "Backpack", "") or corresponding currentMuzzle - https://community.bistudio.com/wiki/fleeing + https://community.bistudio.com/wiki/magazinesAmmoFull - fleeing Object + magazinesAmmoFull Object - fleeing unitName + magazinesAmmoFull vehicle - $Code$? (fleeing _east_unit) : player sideChat "We have won!"$/Code$ + $Code$_magazinesAmmoFull = magazinesAmmoFull player ; + /* + [ + ["30Rnd_65x39_caseless_mag",30,false,-1,"Uniform"], + ["30Rnd_65x39_caseless_mag",30,false,-1,"Vest"], + ["16Rnd_9x21_Mag",16,false,-1,"Vest"], + ["SmokeShellGreen",1,true,0,"SmokeShellGreenMuzzle"], + ["Chemlight_green",1,true,0,"ChemlightGreenMuzzle"], + ["HandGrenade",1,true,0,"HandGrenadeMuzzle"], + ["30Rnd_65x39_caseless_mag",30,true,1,"arifle_MX_ACO_pointer_F"], + ["16Rnd_9x21_Mag",16,true,2,"hgun_P07_F"] + ] + */$/Code$ + + $Code$_magazinesAmmoFull = magazinesAmmoFull Mi_48; + /* + [ + ["250Rnd_30mm_APDS_shells",250,false,-1,""], + ["250Rnd_30mm_HE_shells",250,true,65536,"gatling_30mm"], + ["8Rnd_LG_scalpel",8,true,65536,"missiles_SCALPEL"], + ["38Rnd_80mm_rockets",38,true,65536,"rockets_Skyfire"] + ] + */$/Code$ - global / undefined + undefined / undefined + (December 20, 2014) + When used on vehicles this will only return all magazines associated with a single turretPath (which one depends on the actual armament of the vehicle, usually the first armed turretPath or alternatively turretPath [-1]). + If you want to get all turrets' magazines, use allTurrets and magazinesTurret. + -- Actium ( talk ) 15:40, 20 December 2014 (CET) + + (February 10, 2015) + As Actium said, this function seems to extract data from: + configfile "CfgVehicles" _the_vehicle_you_want "Turrets" "MainTurret" "magazines". + Some vehicles return an empty field {} because magazines are in straight in: + configfile "CfgVehicles" _the_vehicle_you_want "magazines" (often dedicated to flares only). + This is the case of WY-55 Hellcat. This function returns an empty array. - Boolean + Array + - floor + max - Returns the next lowest integer in relation to x. + The greater of a,b - https://community.bistudio.com/wiki/floor + https://community.bistudio.com/wiki/max - floor Number + Number max Number - floor x + a max b - $Code$floor 5.25 - Result is 5$/Code$ - - $Code$floor -5.25 - Result is -6$/Code$ + $Code$3 max 2 + // Result is 3$/Code$ undefined / undefined @@ -25103,230 +26286,257 @@ - Number + Number + - flyInHeightASL + assignAsGunner - Sets the minimal ASL height. Final height is max(flyInHeight, flyInHeightASL). + Assign a unit as gunner of a vehicle. Used together with orderGetIn to order subordinate units to get in as gunner of a specific vehicle. Before usage of this command a subordinate unit hasn't got the option to get into the gunner place of the vehicle. - https://community.bistudio.com/wiki/flyInHeightASL + https://community.bistudio.com/wiki/assignAsGunner - Object flyInHeightASL Array + Object assignAsGunner Object - aircraft flyInHeightASL params + unitName assignAsGunner vehicleName - $Code$cobraOne flyInHeightASL [200, 100, 400];$/Code$ + $Code$_soldier1 assignAsGunner _tank + [_soldier1] orderGetIn true$/Code$ - undefined / undefined + global / global - Nothing + Nothing + - flyInHeight + lineIntersects - Sets the flying altitude for aircraft relatively to the ground surface. Avoid too low altitudes, as helicopters and planes won't evade trees and obstacles on the ground. The default flying altitude is 100 meters. + Checks for object intersection with a virtual line between two positions. Returns true if intersects with an object. + NOTE: Doesn't work under water. Max harcoded distance is 1000m. - https://community.bistudio.com/wiki/flyInHeight + https://community.bistudio.com/wiki/lineIntersects - Object flyInHeight Number + lineIntersects Array - aircraft flyInHeight altitude + lineIntersects [begPos, endPos, objIgnore1, objIgnore2] - $Code$_helicopter flyInHeight 40$/Code$ + $Code$lineIntersects [ eyePos player, aimPos chopper, player, chopper]$/Code$ - local / global + global / undefined - (August 4, 2006) - Notes from before the conversion: - From version 1.80+ - flyInHeight now affects not only helicopters, but also planes. - - (August 4, 2006) - A planes flyInHeight, is restricted to a minimum of 20 meters. - - (December 15, 2008) - A flyInHeight of 0 will keep the chopper pinned to the ground, even when the engines have been started. - - (00:53, 11 April 2009 (CEST)) - If a helo has no waypoints, it will assume a low hover without regard to this setting. + (may 31, 2012) + Please note the difference : + terrainIntersect + terrainIntersectASL + lineIntersects + lineIntersectsWith + lineIntersectsObjs + intersect - Nothing + Boolean + - fogForecast + unitAddons - Returns the forecast fog value. A value of 0 means no fog, 1 means maximum fog. + Returns list with addons the unit belongs to. - https://community.bistudio.com/wiki/fogForecast + https://community.bistudio.com/wiki/unitAddons - fogForecast + unitAddons String - fogForecast + unitAddons className - $Code$_level = fogForecast ;$/Code$ + $Code$hint str unitAddons typeOf player ; //["A3_Characters_F_BLUFOR"]$/Code$ undefined / undefined + (Mar 31, 2014) + 1. (A3 1.14) Old BIS function BIS_fnc_unitAddon has been deprecated, please always use unitAddons instead. + $Code$ hint str ([player] call BIS_fnc_unitAddon ) // same as unitAddons ( typeOf player )$/Code$ + 2. To return the addon that a weapon belongs to, use BIS_fnc_weaponAddon instead. E.g. + $Code$ + (( primaryWeapon player ) call BIS_fnc_weaponAddon ); //return: "A3_Weapons_F_Rifles_Khaybar" + $/Code$ - Number + Array + - fogParams + ctrlCommit - A getter for setFog (Alt Syntax). Returns extended params for the fog + Commit control animation. - https://community.bistudio.com/wiki/fogParams + https://community.bistudio.com/wiki/ctrlCommit - fogParams + Control ctrlCommit Number - fogParams + controlName ctrlCommit time - $Code$_fog = fogParams$/Code$ + $Code$_control ctrlCommit 2$/Code$ undefined / undefined + (April 11, 2015) + Use this command if you want to for example change the position or size of a control. - Array + Nothing + - fog + commandMove - A getter for setFog. Returns the current value of the fog in range 0...1. + Order the given unit(s) to move to the given location (via the radio). Exactly the same as doMove, except this command displays a radio message. - https://community.bistudio.com/wiki/fog + https://community.bistudio.com/wiki/commandMove - fog + Object/Array commandMove Array - fog + unitName commandMove position - $Code$_foglevel = fog ;$/Code$ + $Code$_soldier1 commandMove ( getMarkerPos "Marker1")$/Code$ - undefined / undefined + local / global - Number + Nothing + - forEachMemberAgent + agents - Executes the given command recursively for each agent that is a member of the given team. For just teams use forEachMemberTeam. For both teams and agents use forEachMember. + Return a list of agents in the current mission. - https://community.bistudio.com/wiki/forEachMemberAgent + https://community.bistudio.com/wiki/agents - Code forEachMemberAgent Team_Member + agents - command forEachMemberAgent team + agents - + $Code${ agent _x moveTo position player } forEach agents ;$/Code$ + undefined / undefined + (April 4, 2012) + Note that agents returns a reference to the agent itself, not the object. For example: {alive _x} count agents; would return an error. But you can assign the agent a reference using setVariable, and then reference it, for example: {alive (_x getVariable ["agentObject",objNull]) count agents; would return the number of agents still alive - BUT you would need to define "agentObject" after you create the agent, for example: + _agent = createAgent [_type, _position, [], _radius, "NONE"];_agent setVariable["agentObject",_agent,true]; + + (August 1, 2013) + Alternatively, to get object from agent reference use agent command. - Nothing + Array + - forEachMemberTeam + hasWeapon - Executes the given command recursively for each team that is a member of the given team. For just agents use forEachMemberAgent. For both teams and agents use forEachMember. + Checks if a unit has the given weapon. - https://community.bistudio.com/wiki/forEachMemberTeam + https://community.bistudio.com/wiki/hasWeapon - Code forEachMemberTeam Team_Member + Object hasWeapon String - command forEachMemberTeam team + unitName hasWeapon weaponName - + $Code$?!( player hasWeapon "M16") : player addWeapon "M16"$/Code$ + - undefined / undefined + global / undefined + (September 11, 2014) + This command doesn't work for Items in Arma 3, use this instead. + $Code$" ItemGPS " in ( items player + assignedItems player ) OR ' ItemGPS ' in ( items player + assignedItems player ) $/Code$ + Returns true if unit has gps in inventory, assigned or not. - Nothing + Boolean + - forEachMember + menuDelete - Executes the given command recursively for both teams and agents that are members of the given team. For teams only use forEachMemberTeam. For agents only use forEachMemberAgent. + Deletes menu entry on given path. - https://community.bistudio.com/wiki/forEachMember + https://community.bistudio.com/wiki/menuDelete - Code forEachMember Team_Member + menuDelete Array - command forEachMember team + menuDelete [idc, path, text] @@ -25336,395 +26546,436 @@ - Nothing + Number + - forEach + distanceSqr - Executes the given command(s) on every item of an array. - The array items are represented by the magic variable _x. The array indices are represented by _forEachIndex. - In ArmA2 & VBS2, the variable _x is always local to the forEach block so it is safe to nest them. + Computes the squared distance between two objects or positions. - https://community.bistudio.com/wiki/forEach + https://community.bistudio.com/wiki/distanceSqr - String/Code forEach Array + Object/Position distanceSqr Object/Position - script forEach array + var1 distanceSqr var2 - $Code${ _x setDammage 1; } forEach units group player ;$/Code$ - - $Code$// This command can also easily be used to execute a single command multiple times without respect to the array items. - { player addMagazine "M16"; } forEach [1, 2, 3, 4];$/Code$ + $Code$player distanceSqr ( leader player )$/Code$ - $Code$// You can also use multiple commands in the same block. - { - _x setCaptive true ; - removeAllWeapons _x ; - doStop _x ; - } forEach units group this ;$/Code$ + $Code$_distance = sqrt ((x2 - x1) ^ 2 + (y2 - y1) ^ 2 + (z2 - z1) ^ 2); + _distanceSqr = (x2 - x1) ^ 2 + (y2 - y1) ^ 2 + (z2 - z1) ^ 2; + _distance = [x1, y1, z1] distance [x2, y2, z2]; + _distanceSqr = [x1, y1, z1] distanceSqr [x2, y2, z2]; + _distance = sqrt ([x1, y1, z1] distanceSqr [x2, y2, z2]); + _distanceSqr = ([x1, y1, z1] distance [x2, y2, z2]) ^ 2;$/Code$ + + + undefined / undefined + + + + + Number + + + + + + breakOut + + + Breaks the code execution out of scope {} named name. nil is returned. Scope name can be assigned using scopeName command. + Since Arma 3 v1.47, breakOut can be used to return a value. It is the closest SQF comes to having "return" like operation. + + + https://community.bistudio.com/wiki/breakOut + + + breakOut String + + Anything breakOut String + + + breakOut name + + value breakOut name + + + $Code$scopeName "main"; + while { true } do { + scopeName "loop1"; + while { true } do { + scopeName "loop2"; + if (condition1) then { breakTo "main"}; // Breaks all scopes and return to "main" + if (condition2) then { breakOut "loop2"}; // Breaks scope named "loop2" + sleep 1; + }; + sleep 1; + };$/Code$ - $Code$// To get the index of a forEach loop, use _forEachIndex. - { systemChat format ["%1", _forEachIndex];} forEach [1,2,3]; - // Will return: "0", "1", "2" in systemChat messages.$/Code$ + $Code$call { + scopeName "main"; + call { + 123 breakOut "main" + }; + 345 + }; // call returns 123$/Code$ undefined / undefined - (July 20, 2010) - If arrays are used in forEach loops, _x uses them by reference, so any changes to _x will be applied to the original: - $Code$_arr1 = [1,2,3]; - _arr2 = [6,7,8]; - {_x set [1,"x"]} forEach [_arr1,_arr2];$/Code$ - will change _arr1 to [1,"x",3], and _arr2 to [6,"x",8]. - - (August 29, 2014) - forEach returns any (the last passed value will be the return value or just Nothing, depends on the function called). - $Code$ - _var = {_x} forEach [ nil,"s", objNull, configFile ]; // return bin\config.bin - _var = {_x setCaptive true } forEach allUnits ; // return nothing + (19 Aug, 2008) + When "name" is nil, the command is ignored. + When "name" is an undefined scope name or "", the script quits current scope. + $Code$if (true) then { + hint "1"; + breakOut nil; + hint "2"; + }; //result "2" + if (true) then { + hint "1"; + breakOut ""; + hint "2"; + }; //result "1" + if (true) then { + hint "1"; + breakOut "dskfhdsklfh"; + hint "2"; + }; //result "1" $/Code$ - (September 20, 2014) - Using the foreach loop, since there are no variable for the index like say the for-do loop, there is a variable that you can use to check the index of the foreach loop. - $Code${ - if ( _forEachIndex == 1) then { - // Copilot - _x addUniform "U_B_Soldier_VR"; - } else { - // Adams - [_x, "B_Soldier_TL_F"] call BIS_fnc_loadInventory ; - _x addUniform "U_B_Soldier_VR"; - _x setIdentity "Bootcamp_B_Adams"; + (August 27, 2015) + breakOut can still be used if multiple scopes share identical names. It will simply break out of the nearest scope that matches the name parameter you've used. For example: + $Code$call { + scopeName "Main"; //Parent Main + call { + scopeName "Main"; //Child Main + "String" breakOut "Main"; //Will break out of child main and return "String" to parent main + }; }; - } forEach _crew; - $/Code$ - So when the array is past from _crew to the loop, index 1 (which is the second element) is the copilot of the "B_Heli_Light_01_F" and he will get "U_B_Soldier_VR" as a uniform. While the pilot which is index 0 (first element), will get the same uniform but will get the loadout of "B_Soldier_TL_F" and the identity of "Bootcamp_B_Adams". - - (January 2, 2015) - Using exitWith inside a forEach loop will make forEach actually return something, namely whatever the exitWith returns: - $Code$_result = { - if(_x isEqualTo 3) exitWith {"Hello"} - } forEach [1,2,3,4,5]; - //_result = "Hello"$/Code$ - - (June 17, 2016) - To be more precise, _forEachIndex represents NOT the index of the current array element, but the number of the loop iteration. If array is modified by reference while it is iterated through with forEach loop, _forEachIndex will NOT change to reflect that. For example: - $Code$_array = ["1","2","3","4","5","6","7","8","9"]; - { - systemChat str [_x, _forEachIndex, _array]; - _array deleteAt _forEachIndex; - } - forEach _array; - /*result: - [_x, _forEachIndex, _array] - ["1",0,["1","2","3","4","5","6","7","8","9"]] - ["3",1,["2","3","4","5","6","7","8","9"]] - ["5",2,["2","4","5","6","7","8","9"]] - ["7",3,["2","4","6","7","8","9"]] - ["9",4,["2","4","6","8","9"]]*/ $/Code$ + Therefore you are able to consistently reuse scope names such as "Main", "Child", "Primary", "Secondary", etc throughout functions without worrying about having to ensure you create unique names for each scope. - Anything + Nothing - Anything + - forceAddUniform + entities - Create a new uniform and hard link it into slot (without any restrictions). + Returns a list of all alive and dead entities of the given type or deriving from the given type. Units in vehicles are ignored. When empty string "" is passed for the type, all entity types are returned. + Alternative syntax introduced in Arma 3 v1.65.138685 allows to filter entities by type and alive status as well as to return entities currently in vehicles. Optimisation tip : Keep number of types in both includeTypes and excludeTypes arrays to a minimum by possibly using parent/base classes. If you have to use several types, arrange them in order so that the more common types go at the beginning of the array. - https://community.bistudio.com/wiki/forceAddUniform + https://community.bistudio.com/wiki/entities - Object forceAddUniform String + entities String + + entities Array - unit forceAddUniform type + entities type + + entities [typesInclude, typesExclude, includeCrews, excludeDead] - $Code$_unit forceAddUniform "U_B_CombatUniform_mcam";$/Code$ + $Code$_allcars = entities "Car";$/Code$ + + $Code$// Return all alive entities on the map: + _allalive = entities [[], [], true, true ];$/Code$ + + $Code$// Return dead and alive entities but logic: + _notlogic = entities [[], ["Logic"], true ];$/Code$ + + $Code$// Return all alive west soldiers on foot: + _footsoldiers = entities [["SoldierWB"], [], false, true ];$/Code$ - global / global + undefined / undefined + (Mar 27, 2014) + In ArmA3 ver 1.14 type (string) can be any children class under configfile "CfgVehicles". e.g. $Code$ entities "All"; //or entities "CAManBase"; etc.$/Code$ + + (July 12, 2016) + In A3 1.62 $Code$entities "CAManBase"$/Code$ does not include entities inside vehicles (crew). - Nothing + Array - Array + - forceEnd + resetSubgroupDirection - Sets the flag which tells engine that the mission end was forced. Might need additional endMission execution. Can be used in an "END" trigger to force end conditions in the editor. + Resets direction of subgroup. - https://community.bistudio.com/wiki/forceEnd + https://community.bistudio.com/wiki/resetSubgroupDirection - forceEnd + resetSubgroupDirection Object - forceEnd + resetSubgroupDirection unit - $Code$if (_TerritoryLost) then { forceEnd }$/Code$ + $Code$resetSubgroupDirection myUnit;$/Code$ - undefined / local + undefined / undefined - Nothing + Nothing + - forceFlagTexture + setFlagTexture - Forces a flag texture onto a flag carrier (unit, vehicle or flag pole). No flag holder is required. If "" is used as texture, the texture is removed. This will override regularly owned flags. This type of flag texture cannot be retrieved using flagTexture. - Note : Forced flag texture is an additional flag texture, which visually overrides original flag texture and therefore is very expensive to simulate, so please use the functionality sparingly. + Sets flag texture. + If texture is "", flag is not drawn. + Custom texture can be used, as long as it is in *.jpg format, and has dimensions of 200px*200px. + The page Flag Textures shows which textures are available in each game. + NOTE : In MP this command has to be executed where Flag Pole is local. If you add Flag Pole in the editor, it will be local to the server, so executing setFlagTexture on the server will change flag texture on all clients. The command is also persistent and is synchronised for JIP clients. - https://community.bistudio.com/wiki/forceFlagTexture + https://community.bistudio.com/wiki/setFlagTexture - Object forceFlagTexture String + Object setFlagTexture String - object forceFlagTexture texture + flag setFlagTexture texture - $Code$player forceFlagTexture "\A3\Data_F\Flags\Flag_red_CO.paa";$/Code$ + $Code$_flagE setFlagTexture "\ca\misc\data\sever_vlajka.paa";$/Code$ + + $Code$_flagW setFlagTexture "\ca\misc\data\usa_vlajka.paa";$/Code$ + + $Code$flag1 setFlagTexture "\A3\Data_F\Flags\Flag_red_CO.paa";$/Code$ + + $Code$flagARMA3 setFlagTexture "\a3\ui_f\data\Logos\arma3_expansion_ca.paa";$/Code$ + + $Code$// Capturable OPFOR flag: + private _flag = "FlagPole_F" createVehicle position player ; + _flag setFlagTexture "\A3\Data_F\Flags\Flag_CSAT_CO.paa"; + _flag setFlagSide east ;$/Code$ - global / global + local / global - Nothing + Nothing + - forceMap + enableSentences - Opens non-interactive main map in background that overrides user screen. The user is able to fire but cannot see the world just the map. To force open interactive map use openMap command. + Enables radio transmissions to be heard and seen on screen. It does not affect KBTell conversations. - https://community.bistudio.com/wiki/forceMap + https://community.bistudio.com/wiki/enableSentences - forceMap Boolean + enableSentences Boolean - forceMap show + enableSentences enable - $Code$forceMap true$/Code$ + $Code$enableSentences false;$/Code$ undefined / local - In OFP v1.96, the mapAnim series of commands, together with forceMap can only be used in the intro and mission, as it is not possible to access the map from the outro. (not checked, sourced from an old copy of the OFPEC comref) - - Manually opening the map afterwards won't close the map. Actually it will open the "real" map on top of the forced map, and closing the (top) map with the m -key again will still show the forcefully opened map. (ArmA 1.05) - Nothing + Nothing + - forceRespawn + hcRemoveGroup - Forces unit to respawn. The effect as if the player pressed RESPAWN button in the game pause menu, the unit is killed only there is no "so and so was killed" message and no score adjustment. + Removes group from unit's high command bar. - https://community.bistudio.com/wiki/forceRespawn + https://community.bistudio.com/wiki/hcRemoveGroup - forceRespawn Object + Object hcRemoveGroup Group - forceRespawn unit + unit hcRemoveGroup group - $Code$forceRespawn player ;$/Code$ - + - local / global + undefined / undefined - Nothing + Nothing + - forceWalk + add3DENLayer - Forces unit to walk even if run or sprint is selected. + Add an editing layer in Eden Editor. - https://community.bistudio.com/wiki/forceWalk + https://community.bistudio.com/wiki/add3DENLayer - Object forceWalk Boolean + Number add3DENLayer String - unit forceWalk value + parentLayerID add3DENLayer name - $Code$player forceWalk true ;$/Code$ + $Code$_myLayer = -1 add3DENLayer "Enemy Base"; + _myLayerFort = _myLayer add3DENLayer "Fortifications"; + _myLayerPatrol = _myLayer add3DENLayer "Patrols";$/Code$ - local / undefined + undefined / undefined - Nothing + Number + - forceWeaponFire + hcShowBar - The unit will be forced to fire weapon from the given muzzle. The weapon will not fire if firemode passed as parameter is not supported by the given muzzle. The muzzle could belong to a vehicle weapon and unit in this case will be the unit operating this weapon. Doesnt't seem to work for units in FFV positions. See also: BIS_fnc_fire + Shows or hides high command bar. + There must be some groups under HC command to show HC bar. - https://community.bistudio.com/wiki/forceWeaponFire + https://community.bistudio.com/wiki/hcShowBar - Object forceWeaponFire Array + hcShowBar Boolean - unit forceWeaponFire [muzzle, firemode] + hcShowBar bool - $Code$soldierOne forceWeaponFire ["arifle_MX_F", "Single"];$/Code$ - - $Code$player forceWeaponFire ["hgun_ACPC2_F", "hgun_ACPC2_F"];$/Code$ - - $Code$_unit forceWeaponFire ["HandGrenadeMuzzle","HandGrenadeMuzzle"]; - _unit forceWeaponFire ["MiniGrenadeMuzzle","MiniGrenadeMuzzle"]; - _unit forceWeaponFire ["HandGrenade_Stone","HandGrenade_Stone"]; - _unit forceWeaponFire ["SmokeShellMuzzle","SmokeShellMuzzle"]; - _unit forceWeaponFire ["ChemlightGreenMuzzle","ChemlightGreenMuzzle"]; - _unit forceWeaponFire ["IRGrenade","IRGrenade"]; - _unit forceWeaponFire ["Laserdesignator","Laserdesignator"];$/Code$ + $Code$hcShowBar true ;$/Code$ - $Code$gunner blackfoot forceWeaponFire ["gatling_20mm", "close"];$/Code$ + $Code$hcShowBar false ;$/Code$ - local / global + undefined / undefined - (August 25, 2013) - Here is a neat workaround trick for firemode change from a script: - $Code$_weapon = currentWeapon player ; - _ammo = player ammo _weapon; - player setAmmo [_weapon, 0]; - player forceWeaponFire [_weapon, "FullAuto"]; - player setAmmo [_weapon, _ammo];$/Code$ - - (April 14, 2014) - (A3 1.16) forceWeaponFire is no longer only limited to units, but can remote aircrafts weapon firing as well. Passed source unit should be the correct one who controls the weapon, if passed mode is "this", use the weapon name instead: - $Code$ - _weapon = ( weapons _veh) select 3; - _mode = ( getArray ( configFile "cfgweapons" _weapon "modes")) select 0; - if (_mode == "this") then {_mode = _weapon;}; - ( driver _veh) forceWeaponFire [_weapon, _mode]; - //Force a CAS fire a rocket. - $/Code$ - Currently this command is not available for land vehicle remote fire. - - (September 02, 2014) - Similar to Killzone Kid's note, This fires the units current weapon in its current firemode. - $Code$_unit forceWeaponFire [ weaponState _unit select 1, weaponState _unit select 2];$/Code$ - - (January 3, 2015) - fireAtTarget command can be used to force fire gunner weapon in vehicles. A gunner must be present. $Code$_veh fireAtTarget [ objNull ];$/Code$ Will fire one shot even if player is gunner. - fire command can also be used to fire vehicle weapon, like smoke launcher for example: $Code$ vehicle player fire "SmokeLauncher";$/Code$ And if this doesn't work, it is possible to force fire via action $Code$tank action ["UseWeapon", tank, commander tank, 0];$/Code$ - Nothing + Nothing + - forceWeatherChange + setParticleRandom - Forces saved wanted settings for weather to be actual (BEWARE: Will cause lag). - NOTE The engine has own idea about the weather and will interfere with your scripted weather at every opportunity it gets. So don't give it the opportunity. In the editor's Intel there are Manual Override setting for many aspects of the weather. Select them to disable engine interference. Some commands such as setWaves and setLightnings will not even work until their respective settings are set to manual. + Sets randomization of particle source parameters. Correspondence between CfgCloudlets class param names and command array of params: + $Code$particleSource setParticleRandom + [ + lifeTimeVar, + positionVar, + moveVelocityVar, + rotationVelocityVar, + sizeVar, + colorVar, + randomDirectionPeriodVar, + randomDirectionIntensityVar, + angleVar, + bounceOnSurfaceVar + ];$/Code$ - https://community.bistudio.com/wiki/forceWeatherChange + https://community.bistudio.com/wiki/setParticleRandom - forceWeatherChange + Object setParticleRandom Array - forceWeatherChange + particleSource setParticleRandom [lifeTime, position, moveVelocity, rotationVelocity, size, color, randomDirectionPeriod, randomDirectionIntensity, angle, bounceOnSurface] - $Code$240 setOvercast 1; - 360 setRain 1; - forceWeatherChange ; comment "force immediate change overriding smooth transition";$/Code$ + $Code$_PS setParticleRandom [0, [0.1, 0.1, 0.1], [0, 0, 0.5], 0, 0.1, [0, 0, 0, 0], 0, 0];$/Code$ undefined / undefined - This scripting command must be executed on the server to work properly in multiplayer + (July 03, 2013) + Support of parameter bounceOnSurface ( Number - 0-1) is in the game since Arma 3 version 0.74. It's variability in speed's loosing in collision with ground. Requires collisions with ground enabled by script command setParticleParams. - Nothing + Nothing + - forcedMap + worldToModel - Returns if map was forced by using forceMap command or openMap command with force option + Converts position from world space to object model space. - https://community.bistudio.com/wiki/forcedMap + https://community.bistudio.com/wiki/worldToModel - forcedMap + Object worldToModel Array - forcedMap + model worldToModel position - $Code$_forceMapForced = forcedMap select 0; - _openMapForced = forcedMap select 1;$/Code$ + $Code$_relPos = myObject worldToModel [0,0,0];$/Code$ + + $Code$_relPos = player worldToModel position car;$/Code$ + + $Code$_relPos = car worldToModel [12000,5000];$/Code$ undefined / undefined @@ -25732,27 +26983,28 @@ - Array + Array + - forgetTarget + waypointStatements - Resets info group has about target + Gets the waypoint statements. - https://community.bistudio.com/wiki/forgetTarget + https://community.bistudio.com/wiki/waypointStatements - Group/Object forgetTarget Object + waypointStatements Array - group forgetTarget target + waypointStatements waypoint - $Code$soldier1 forgetTarget soldier2;$/Code$ + $Code$waypointStatements [groupOne,1]$/Code$ undefined / undefined @@ -25760,527 +27012,640 @@ - Nothing + Array + - for + simpleTasks - This operator creates a For Type which is used in the for-constructs (There is the for forspec and the for var syntax available for this construct) + Return all simple tasks assigned to given person. - https://community.bistudio.com/wiki/for + https://community.bistudio.com/wiki/simpleTasks - for String/Array + simpleTasks Object - for arg + simpleTasks person - $Code$for "_i" from 1 to 10 do { debugLog _i;};$/Code$ - - $Code$for "_i" from 9 to 1 step -2 do { debugLog _i;};$/Code$ - - $Code$for [{_i=0}, {_i 10}, {_i = _i + 1}] do {hint str _i};$/Code$ - + undefined / undefined - For_Type + Array + - forceSpeed + ctrlAngle - Force the speed limit on given object (object will never attempt to move faster than given by forceSpeed). Use negative value to return to default behaviour. Used unit is m/s. + Gets rotation info of an ST_PICTURE control. - https://community.bistudio.com/wiki/forceSpeed + https://community.bistudio.com/wiki/ctrlAngle - Object forceSpeed Number + ctrlAngle Control - object forceSpeed speed + ctrlAngle control - $Code$_helicopter forceSpeed 150;$/Code$ + $Code$ctrlAngle _control;$/Code$ undefined / undefined - (17:02, 2 March 2007 (CET)) - - (9 February 2008) - Does not seem to do anything at the current time (V1.08.5163) - - (14 December 2011) - If a unit (man) has forceSpeed set to anything under jogging (walking only) the unit will refuse to get into vehicles. He will automatically be unassigned from a vehicle everytime he is ordered to get in (via scripts or direct action) - Nothing + Array + - formLeader + find - Returns the formation leader of a given unit. This is often the same as the group leader, but not always, for example in cases when a unit is ordered to follow another unit. + Searches for an array element within array or a string within a string. Returns the 0 based index on success or -1 if not found. Search is cASe-seNsItiVE - https://community.bistudio.com/wiki/formLeader + https://community.bistudio.com/wiki/find - formLeader Object + Array find Anything + + String find String - formLeader unitName + array find x + + string find x - $Code$? (formLeader player != leader player) : - hint "The formation leader is different to the group leader!" - returns X$/Code$ + $Code$["Apples","Oranges","Pears"] find "Oranges"; //result is 1 + [1,[2],[[3]]] find [[3]]; //result is 2$/Code$ + + $Code$if ( magazines player find "Strela" = 0) then { hint "You've got Strela!"};$/Code$ + + $Code$hint str ("japa is the man!" find "the man!"); //8$/Code$ - global / undefined + undefined / undefined + (January 4, 2015) + Using nil on either side of find will make the whole statement return Nothing : + $Code$_array = [1,2, nil,4,5]; + _result = _array find nil; + hintSilent str ( isNil "_result"); //true + _result = nil find 1; + hintSilent str ( isNil "_result"); //true$/Code$ + + (April 10, 2015) + Find doesn't work with multidimensional arrays in OFP/CWA. It will always returns -1. + + (May 17, 2016) + This command is unreliable/broken when it comes to some non-ASCII characters (as of Arma 3 1.58): + $Code$"abcßdef" find "c" + - 2 + "abcßdef" find "ß" + - 3 + "abcßdef" find "d" + - 5$/Code$ + + (July 7, 2016 10:56 (UTC)) + Not quite unreliable, just unexpected! Strings are tracked in terms of bytes rather than in actual character positions; all strings are stored in UTF-8 format. In other words, the eszett character is in Unicode, which takes up two bytes rather than one as it is within the 128-255 range of Unicode. (Similar results would be expected for the division symbol, the umlaut, accented e's, etc.) Symbols that are particularly high in the Unicode range may take up three bytes, or even four for the truly exceptional characters, although Arma 3's default fonts are unlikely to render them. This definitely complicates any script which assumes any printable character is a single byte, however, and unfortunately I'm not skilled enough with internationalisation to recommend any robust fix. - Object + Number - Number + - formation + sliderSetPosition - Returns the current formation of a group. + Set current thumb position of slider idc of topmost user dialog. - https://community.bistudio.com/wiki/formation + https://community.bistudio.com/wiki/sliderSetPosition - formation Object/Group + sliderSetPosition Array + + Control sliderSetPosition Number - formation grp + sliderSetPosition [idc, pos] + + control sliderSetPosition pos - $Code$formation group player$/Code$ + $Code$sliderSetPosition [101, 50];$/Code$ - global / undefined + undefined / undefined - (January 9, 2007) - Additional ARMA Formations: "File" - Column Compact. "DIAMOND" - Delta. - String + Nothing - Nothing + - format + ctRowControls - Composes a string containing other variables or other variable types. Converts any variable type to a string. If you want to convert a string back to a number, use parseNumber. NOTE that output of this command is limited to ~8Kb. joinString on the other hand doesn't have such limit. + Returns array of controls on the row with the given index. - https://community.bistudio.com/wiki/format + https://community.bistudio.com/wiki/ctRowControls - format Array + Control ctRowControls Number - format [formatString, var1, var2] + Control ctRowControls Number - $Code$format ["Player:%1, player's side:%2", player, side player ]; - // returns "Player:WEST 1-1-A:1 (Username), player's side:WEST"$/Code$ - - $Code$player addEventHandler ["HandleDamage", { - hint format ["You just sustained %1%2 damage!", ceil (( _this select 2) * 100), "%"]; - }]; - // hints "You just sustained 20% damage!"$/Code$ + $Code$_array = _control ctRowControls 0;$/Code$ - undefined / undefined + local / local - The maximum number of characters returned by the format command seems to depend on the total byte count. For plain ASCII strings the limit is 2048 characters. - - In Arma 3 the max length of String returned by format command seems to be 8191 characters. formatText doesn't seem to have this limitation. - - (March 28, 2015) - In addition to the note above, formatTexted strings are Structured Text, hence cannot be used like formatted strings (with most scripting commands). A workaround to get strings of type String with more than 8191 characters is: $Code$ str formatText ["%1", _string]$/Code$ - - (January 2, 2016) - In addition to the note above, you may consider using joinString instead of format or formatText workaround. joinString is a fraction faster than format and it has no limit on the length of the string (apart from global String limit obviously) - String + Array + - formatText + setUnitTrait - Creates a structured text by replacing %1, %2, etc. in format with plain or structured texts given as arguments. + Enables or disables a trait or alters a trait of the given unit. Custom trait can only be a bool. + Default traits are: + audibleCoef (scalar) + camouflageCoef (scalar) + engineer (bool) - Ability to repair vehicles and defuse mines using toolkit + explosiveSpecialist (bool) - Ability to defuse mines using toolkit + loadCoef (scalar) - Equipment weight multiplier affecting fatigue and stamina + medic (bool) - Ability to use medikit on self and others + UAVHacker (bool) - https://community.bistudio.com/wiki/formatText + https://community.bistudio.com/wiki/setUnitTrait - formatText Array + Object setUnitTrait Array - formatText [format, arg1, arg2,] + unit setUnitTrait [skill_name, value, isCustom] - $Code$_text = formatText ["Image: %1", image "data\isniper.paa"];$/Code$ + $Code$player setUnitTrait ["Medic", true ];$/Code$ - undefined / undefined + local / global + (April 27, 2016) + The higher the value for the loadCoef the less stamina a unit has. Negative values will dramatically increase the stamina actually to a point where it extends the stamina bar. + + (October 20, 2017) + explosive specialists can defuse mines (ie satchel charges), whilst engineers cannot. - Structured_Text + Nothing + - formationDirection + clearBackpackCargo - Return the direction in degrees of the 'unit' watching in formation. + Removes all backpacks from ammo box (or any general weapon holder container). - https://community.bistudio.com/wiki/formationDirection + https://community.bistudio.com/wiki/clearBackpackCargo - formationDirection Object + clearBackpackCargo Object - formationDirection unitName + clearBackpackCargo box - $Code$_degrees = FormationDirection _unit$/Code$ + $Code$clearBackpackCargo myBox;$/Code$ - local / undefined + undefined / undefined + (July 6, 2017) + This will remove not only backpacks, but vests and uniforms as well. - Number + Nothing + - formationLeader + setWaypointLoiterRadius - Return leader of the formation. + Assignes loiter radius to waypoint - https://community.bistudio.com/wiki/formationLeader + https://community.bistudio.com/wiki/setWaypointLoiterRadius - formationLeader Object + Waypoint setWaypointLoiterRadius Number - formationLeader unitName + waypoint setWaypointLoiterRadius radius - $Code$? (formationLeader player != leader player) : - hint "Formation leader is not the group leader."$/Code$ + $Code$[_grp, 2] setWaypointLoiterRadius 200;$/Code$ undefined / undefined - (December 2, 2006) - Return value is NULL-OBJECT if no group members exist. - Object + Nothing + - formationMembers + sort - Return list of units (drivers) in the formation. + Attempts to sort given array either in ascending ( true ) or descending ( false ) order. All array elements should be one of the following types: + String - array of strings (["a","b","c"...]) + Number - array of numbers ([1,2,3...]) + Array - array of subarrays ([["a",1,2],["b",3,4],["c",5,6]...]). Subarrays should be of the same structure. Subarray elements other than String or Number will be ignored during sorting. + Mixed arrays (["a",1,[true]...]) are not supported and results are undefined. - https://community.bistudio.com/wiki/formationMembers + https://community.bistudio.com/wiki/sort - formationMembers Object + Array sort Boolean - formationMembers person + array sort order - $Code$_drivers=FormationMembers _person$/Code$ + $Code$_arr = [5.21725,1.30859,4,5.03028,1]; + _arr sort true ; + hint str _arr; //[1,1.30859,4,5.03028,5.21725]$/Code$ + + $Code$_dev = ["ja","pa","pa","tram","tara"]; + _dev sort false ; + hint str _dev; //["tram","tara","pa","pa","ja"]$/Code$ + + $Code$#define ASC true + #define DESC false + _scores = [[123,"bob",15],[123,"bill",20],[200,"dave",21],[200,"steve",11]]; + _scores sort DESC; + hint str _scores; //[[200,"steve",11],[200,"dave",21],[123,"bob",15],[123,"bill",20]]$/Code$ + + $Code$// Sort buildings by distance and return position of the most distant building: + _buildings = player nearObjects ["Land_Cargo_Patrol_V1_F", 500]; + _buildings = _buildings apply { [_x distance player, _x] }; + _buildings sort false ; + hint format [ + "Most distant building is at %1, distance %2 m", + getPos (_buildings select 0 select 1), + round (_buildings select 0 select 0) + ];$/Code$ undefined / undefined + (April 16, 2015) + The algorithm for sorting subarrays: compare 1st element, if equal compare 2nd, if equal compare 3rd...etc. - Array + Nothing + - formationPosition + enableChannel - Return position of unit in the formation + Enables/disables UI functionality which is responsible for sending text or voice chat to the given chat channel. If the channel was disabled in description.ext, it can be enabled with this command, however the UI functionality changes will be local to the PC executing this command. What this command cannot do: + It cannot disable incoming text or voice + It cannot interrupt own client's transmission in progress + It cannot affect any Custom Radio channels, only channels 0-5 + It cannot persist, so if user is logged out, the changes are reset + It has no effect on chat related scripting commands, such as vehicleChat, globalChat, globalRadio, sideRadio, etc. + So in short, just like with getPlayerChannel, this command provides a nice ability to hack into chat UI with some limitations. And the reason why it is possible to disable entire channels (except Group) in description.ext, is because no one can talk or text, therefore no transmission is happening. NOTE: Group channel cannot be disabled, neither with enableChannel, nor with description.ext param. Channel / Number correspondence: + 0 = Global + 1 = Side + 2 = Command + 3 = Group + 4 = Vehicle + 5 = Direct + 6-15 = Custom Radio (Is not supported by enableChannel ) - https://community.bistudio.com/wiki/formationPosition + https://community.bistudio.com/wiki/enableChannel - formationPosition Object + Number enableChannel Boolean + + Number enableChannel Array - formationPosition person + channel enableChannel enable + + channel enableChannel [chat, VoN] - $Code$_pos=FormationPosition _person$/Code$ + $Code$0 enableChannel false ; // Disable user ability to send voice and text on global channel$/Code$ + + $Code$0 enableChannel [ true, false ]; // Enable user ability to send text but disable voice on global channel$/Code$ - undefined / undefined + undefined / local + (June 17, 2016) + If the user is admin, global channel is fully enabled, regardless of this command. + + (July 30, 2016) + Alternative Syntax supports Custom Radio Channels - Array + Nothing - Nothing + - formationTask + lineIntersectsWith - Return the current task of the unit in the formation. - You can't use it in ArmA 2, it will always returns "NOTHING" + Returns objects intersecting with the virtual line from begPos to endPos. By default resulting array of intersecting objects is unsorted. To sort by distance set sortByDistance param to true. NOTE: Doesn't work under water. Max hardcoded distance is 1000m. - https://community.bistudio.com/wiki/formationTask + https://community.bistudio.com/wiki/lineIntersectsWith - formationTask Object + lineIntersectsWith Array - formationTask person + lineIntersectsWith [begPos, endPos, objIgnore1, objIgnore2, sortByDistance] - $Code$_CurrentTask = FormationTask _person$/Code$ + $Code$_objects = lineIntersectsWith [ eyePos player, AGLtoASL screenToWorld [0.5,0.5]];$/Code$ + + $Code$// Sort by distance: + _objects = lineIntersectsWith [ eyePos player, AGLtoASL screenToWorld [0.5,0.5], objNull, objNull, true ];$/Code$ + + $Code$// Ignore objects: + _objects = lineIntersectsWith [ eyePos player, aimPos chopper, player, chopper];$/Code$ - undefined / undefined + global / undefined + (may 31, 2012) + Please note the difference : + terrainIntersect + terrainIntersectASL + lineIntersect s + lineIntersect s With + lineIntersect s Objs + intersect - String + Array + - freeLook + lbColor - Returns true if freelook is active. + Returns the text color of the item with the given index of the listbox or combobox with id idc of the topmost user dialog. + The color is returned in format Color. - https://community.bistudio.com/wiki/freeLook + https://community.bistudio.com/wiki/lbColor - freeLook + lbColor Array + + Control lbColor Number - freeLook + lbColor [idc, index] + + control lbColor index - $Code$systemChat (if freeLook then {"Quit looking around player!"} else {""});$/Code$ + $Code$_colour = lbColor [101, 0];$/Code$ + + $Code$_color = _control lbColor 0;$/Code$ - undefined / undefined + local / local + More information on the LB command family can be found here - Boolean + Array - Array + - fromEditor + allDeadMen - Return if given team was inserted directly from mission editor. + Return a list of dead units including agents. Dead unit might be inside vehicle. - https://community.bistudio.com/wiki/fromEditor + https://community.bistudio.com/wiki/allDeadMen - fromEditor Team_Member + allDeadMen - fromEditor teamMember + allDeadMen - $Code$_fromEditor = fromEditor _member$/Code$ + $Code${ deleteVehicle _x } forEach allDeadMen;$/Code$ undefined / undefined + (17 Oct, 2009) + As dead men are civilian side, don't try to count them with {side _x isEqualTo EAST} count allDeadMen; result will always be 0. + Use the configfile "side" instead: + 0 = [] spawn {while {true} do {sleep 0.1; _westScore = {getNumber (configfile "CfgVehicles" typeOf _x "side") == 0} count allDeadMen; hintSilent format ["East killed: %1",_westScore]};}; - Boolean + Array + - from + doFire - Continue sequence of for var construct. It sets the start value of the index variable. + Order the given unit(s) to fire on the given target (without radio messages). + The target is set with doTarget or commandTarget. + The target can be a unit or a vehicle, but not an object. - https://community.bistudio.com/wiki/from + https://community.bistudio.com/wiki/doFire - For_Type from Number + Object/Array doFire Object - for from b + unitName doFire target - $Code$for "_x" from 10 to 20 do {..code..}$/Code$ + $Code$_ESoldier1 doFire _WSoldier1;$/Code$ - undefined / undefined + local / global + (August 3, 2006) + Notes from before the conversion: + It is often helpful to use doTarget first. + + (March 25, 2007) + A unit will not execute this command when his behaviour is set to "careless". + + (Feb 18, 2012) + Board dofire not working in arma2 1.11. an entity he throws he shoots not only. + + (June 7, 2012) + Unitname dofire objnull does not work like it does in commandfire. Target var has to be real (Arma2 AO) might be different in other versions. - For_Type + Nothing + - fuel + markerSize - Checks how much fuel is left in the gas tank of a vehicle. + Returns marker size. This command is identical to getMarkerSize. - https://community.bistudio.com/wiki/fuel + https://community.bistudio.com/wiki/markerSize - fuel Object + markerSize String - fuel vehicle + markerSize markerName - $Code$if ( fuel vehicle player == 0) then { hint "The vehicle is out of fuel!"};$/Code$ + $Code$_mSize = markerSize "Marker1";$/Code$ global / undefined - Vehicles refuelled in game with the Fuel trucks e.t.c never get completely refuelled. After refuelling, rather than returning a value of 1 when the fuel command is called. They return a value greater than 0.98 and less than 1. - Number + Array + - fullCrew + ctrlChecked - Returns array with all crew inside given vehicle. Since Arma 3 v1.55.133810 it is possible to return empty seats as well. - NOTE that with introduction of person turrets, the cargo indexes listed in the return are true for moveInCargo command but incompatible with actions such as "GetInCargo" and "MoveToCargo". To find out seats compatible with cargo action commands, execute command with "cargo" filter: - $Code$ fullCrew [heli, "cargo", true ];$/Code$ - The return array is ordered according to cargo index compatible with action cargo commands, i.e. 1st element has index 0, second - index 1, etc. For example armed WY-55 Hellcat reports: - [[ NULL-object,"cargo",2,[],false],[ NULL-object,"cargo",3,[],false],[ NULL-object,"cargo",4,[],false],[ NULL-object,"cargo",5,[],false]] - for cargo positions. The following commands will put player in the same seat: - $Code$ player moveInCargo [heli, 2]; - player action ["GetInCargo", heli, 0];$/Code$ + Returns the current state of given checkbox in checkboxes control (CT_CHECKBOXES, type = 7; ). Since Arma 3 v1.71.141591 it is possible to query multiple checkboxes by providing checkbox index. For more information see DialogControls-CheckBoxes. + Note: The "onCheckBoxesSelChanged" control EH returns the control, index of changed checkbox and its current checked state. The checked state however is not a Boolean but Number 0 or 1. To convert ctrlChecked command output into number as well, use parseNumber command. - https://community.bistudio.com/wiki/fullCrew + https://community.bistudio.com/wiki/ctrlChecked - fullCrew Object + ctrlChecked Control - fullCrew Array + Control ctrlChecked Number - fullCrew vehicle + ctrlChecked control - fullCrew [vehicle, type, includeEmpty] + control ctrlChecked index - $Code$_list = fullCrew vehicle player ;$/Code$ + $Code$ctrlChecked _control;$/Code$ - $Code$_list = fullCrew [ vehicle player, "turret"];$/Code$ + $Code$_control ctrlChecked 3;$/Code$ - global / undefined + undefined / undefined - (December 13, 2014) - Be aware that the returned role may or may not be in lowercase. E.g. it's "driver" for the driver, but "Turret" for turret units. - As of Arma 3 version 1.36, the alternative syntax of this command returns all crew members if the filter is anything except "driver", "commander", "gunner", "turret" or "cargo" - The filter is not case sensitive. - Array - Array + Boolean - Boolean + - gearIDCAmmoCount + dynamicSimulationDistanceCoef - Returns ammo count of assigned magazine. + A getter for setDynamicSimulationDistanceCoef - https://community.bistudio.com/wiki/gearIDCAmmoCount + https://community.bistudio.com/wiki/dynamicSimulationDistanceCoef - gearIDCAmmoCount Number + dynamicSimulationDistanceCoef String - gearIDCAmmoCount idc + dynamicSimulationDistanceCoef class - $Code$ammo = gearIDCAmmoCount _control;$/Code$ + $Code$hint str dynamicSimulationDistanceCoef "IsMoving";$/Code$ undefined / undefined @@ -26288,27 +27653,28 @@ - Number + Number + - gearSlotAmmoCount + isTurnedOut - Returns ammo count of assigned magazine. + Returns true if given unit is turned out, otherwise false. The output changes to true after unit finished turning out, however will change to false almost immediately after unit is ordered to turn in. - https://community.bistudio.com/wiki/gearSlotAmmoCount + https://community.bistudio.com/wiki/isTurnedOut - gearSlotAmmoCount Control + isTurnedOut Object - gearSlotAmmoCount control + isTurnedOut unit - $Code$ammo = gearSlotAmmoCount _control;$/Code$ + $Code$_commanderOut = isTurnedOut (tank turretUnit [0,0]);$/Code$ undefined / undefined @@ -26316,53 +27682,29 @@ - Number + Boolean + - gearSlotData + true - Returns gear slot item name. + Always true - https://community.bistudio.com/wiki/gearSlotData + https://community.bistudio.com/wiki/true - gearSlotData Control + true - gearSlotData control + true - $Code$Open any ammobox and click by any gear slots - private "_dspl"; - disableSerialization; - waitUntil { - _dspl = findDisplay 106; - ! isNull _dspl; - }; - uiNamespace setVariable ["/VDMJ/RscDisplayGear/SlotDataEH", { - _self = _this select 0; - _weaponName = gearSlotData _self; - _conf = configFile _confSection _weaponName; - _name = getText(_conf "displayName"); - _desc = getText(_conf "Library" "libTextDesc"); - _image = getText(_conf "picture"); - hint parseText format[ - ' t size="1.3" align="center" shadow="true" shadowColor="#000000" %1 /t br / img image="%2" size="6" align="center" / br / %3 br / %4', - _name, _image, _desc - ]; - }]; - for "_i" from 107 to 145 do { - _dspl displayCtrl _i ctrlAddEventHandler ["ButtonClick", - format [ - '_confSection = "%1"; _this call (uiNamespace getVariable "/VDMJ/RscDisplayGear/SlotDataEH");', - if( _i = 109 && _i = 129 ) then { "CfgMagazines" } else { "CfgWeapons" } - ] - ]; - };$/Code$ + $Code$_var = true ; + systemChat str _var; //true$/Code$ undefined / undefined @@ -26370,60 +27712,59 @@ - String + Boolean + - get3DENActionState + weaponLowered - Returns state of given action in the Eden Editor. - See the list of all actions. + True if given soldier's weapon is lowered. - https://community.bistudio.com/wiki/get3DENActionState + https://community.bistudio.com/wiki/weaponLowered - get3DENActionState String + weaponLowered Object - get3DENActionState action + weaponLowered unit - $Code$if ( get3DENActionState "ToggleMap" == 1) then { systemChat "Editor map is open!"};$/Code$ + $Code$isWeaponLowered = weaponLowered player;$/Code$ undefined / undefined + (November 11, 2016) + This command seems to work for player only, not for AI. - Number + Boolean + - get3DENAttribute + position - Returns value of a given entity's attribute in Eden Editor. - An attribute is identified by its property ( data when it's engine-drive attribute) value in config. For the list of all attributes with their properties, see Setting Attributes. - ! - Attributes are available only within the Eden Editor workspace. You cannot access them in scenario preview or exported scenario! + Synonym for getPos. - https://community.bistudio.com/wiki/get3DENAttribute + https://community.bistudio.com/wiki/position - EdenEntity get3DENAttribute String + position Object/Location - entity get3DENAttribute attribute + position object - $Code$systemChat str (( get3DENMouseOver select 1) get3DENAttribute "name"); - // returns variable name of object under cursor$/Code$ + $Code$_pos = position player ;$/Code$ undefined / undefined @@ -26431,126 +27772,125 @@ - Array + Array + - get3DENCamera + setWaypointSpeed - Returns the camera Object used by the Eden Editor. + Switches the group speed mode when the waypoint becomes active. + Possible values are: + "UNCHANGED" + "LIMITED" + "NORMAL" + "FULL" - https://community.bistudio.com/wiki/get3DENCamera + https://community.bistudio.com/wiki/setWaypointSpeed - get3DENCamera + Array setWaypointSpeed String - get3DENCamera + waypoint setWaypointSpeed mode - $Code$// set exact yaw, pitch, and roll - _y = 45; _p = -80; _r = 0; - get3DENCamera setVectorDirAndUp [ - [ sin _y * cos _p, cos _y * cos _p, sin _p], - [ [ sin _r,- sin _p, cos _r * cos _p],-_y] call BIS_fnc_rotateVector2D - ];$/Code$ - - $Code$//Look at player - _a = positionCameraToWorld [0,0,0] vectorFromTo ( getPosATL player ); - _y = asin (_a select 0); - _b = [_a,_y] call BIS_fnc_rotateVector2D ; - _z = _b select 2; - _p = asin (_z / sqrt ((_b select 1)^2 + _z^2)); - get3DENCamera setVectorDirAndUp [ - _a, - [ [0,- sin _p, cos _p],-_y] call BIS_fnc_rotateVector2D - ];$/Code$ + $Code$[_grp, 2] setWaypointSpeed "FULL";$/Code$ - undefined / undefined + undefined / global + This scripting command must be executed on the server to work properly in multiplayer - Object + Nothing + - get3DENConnections + waypointLoiterType - Return all connections currently present on an entity. + Gets the waypoint loiter type. Waypoint uses format Waypoint. - https://community.bistudio.com/wiki/get3DENConnections + https://community.bistudio.com/wiki/waypointLoiterType - get3DENConnections EdenEntity + waypointLoiterType Waypoint - get3DENConnections entity + waypointLoiterType Waypoint - + $Code$_type = waypointLoiterType [groupOne, 1]$/Code$ + undefined / undefined - Array + String + - get3DENEntity + cadetMode - Returns Eden Entity based on its unique ID. If the ID points to a layer, the ID will be returned instead. + Returns if the player is currently playing in cadet or veteran mode. - https://community.bistudio.com/wiki/get3DENEntity + https://community.bistudio.com/wiki/cadetMode - get3DENEntity Number + cadetMode - get3DENEntity id + cadetMode - $Code$myEntity = get3DENEntity 1$/Code$ + $Code$? ( cadetMode ) : _AIsoldier setSkill 0.1 //sqs$/Code$ + + $Code$if ( cadetMode ) then {_AIsoldier setSkill 0.1}; //sqf$/Code$ undefined / undefined + (December 1, 2009) + In ArmA II, this command will return true if the difficulty level is set to "Recruit" or "Regular". It returns false for the "Veteran" and "Expert" difficulty levels. - EdenEntity + Boolean + - get3DENEntityID + diag_activeScripts - Returns unique index of an Eden Entity. This number remains the same even after saving and loading the scenario. + Returns 4 element array with numbers of currently running scripts in format: [ spawn -ed, execVM -ed, exec -ed, execFSM -ed] - https://community.bistudio.com/wiki/get3DENEntityID + https://community.bistudio.com/wiki/diag_activeScripts - get3DENEntityID EdenEntity + diag_activeScripts - get3DENEntityID entity + diag_activeScripts - $Code$myID = get3DENEntityID player$/Code$ + $Code$hint str diag_activeScripts ; //[0,0,0,1]$/Code$ undefined / undefined @@ -26558,59 +27898,71 @@ - Number + Array + - get3DENGrid + removeMPEventHandler - Returns the grid increment for the given transformation type. - Transformation types: - Rotation - "r" - Translation - "t" - Scale - "s" + Removes MP event handler added by addMPEventHandler. Format of handler is [type,index]. Index is returned by addMPEventHandler. When any handler is removed, all handler indices highter than the deleted one should decremented - https://community.bistudio.com/wiki/get3DENGrid + https://community.bistudio.com/wiki/removeMPEventHandler - get3DENGrid String + Object removeMPEventHandler Array - get3DENGrid type + unitName removeMPEventHandler [event, index] - $Code$currentMovementIncrement = get3DENGrid "t";// returns 1$/Code$ + $Code$player removeMPEventHandler ["killed", 0];$/Code$ - undefined / undefined + global / global + (25 July, 2011) + At least for MPKilled it needs to be executed where the target unit is local. The effect (the removal) is global. - Number + Nothing + - get3DENIconsVisible + setTitleEffect - Get visibility state of Eden Editor icons. + Defines the title effect via [Type, Effect, Text] where + 'Type' can be + "NONE", + "OBJECT", + 'Text' defines the shown object, a subclass of CfgTitles. + "RES" + 'Text' defines a resource class, a subclass of RscTitles. + "TEXT" + The 'Text' is shown as text itself. 'Effect' defines a subtype: "PLAIN", "PLAIN DOWN", "BLACK", "BLACK FADED", "BLACK OUT", "BLACK IN", "WHITE OUT" or "WHITE IN". - https://community.bistudio.com/wiki/get3DENIconsVisible + https://community.bistudio.com/wiki/setTitleEffect - get3DENIconsVisible + Object setTitleEffect Array + + Array setTitleEffect Array - get3DENIconsVisible + trigger setTitleEffect [type, effect, text] + + waypoint setTitleEffect [type, effect, text] - $Code$if ( get3DENIconsVisible select 0) then { hint "Icons are visible in the map.";};$/Code$ + $Code$_trigger setTitleEffect ["TEXT", "PLAIN DOWN", "Hello world."]$/Code$ undefined / undefined @@ -26618,57 +27970,96 @@ - Array + Nothing - Nothing + - get3DENLayerEntities + ctrlMapScreenToWorld - Return all entities and sub-layer in Eden Entity layer. + Convert screen coordinates in map to world coordinates. - https://community.bistudio.com/wiki/get3DENLayerEntities + https://community.bistudio.com/wiki/ctrlMapScreenToWorld - get3DENLayerEntities Number + Control ctrlMapScreenToWorld Array - get3DENLayerEntities layerID + map ctrlMapScreenToWorld [x, y] - $Code$_myLayer = -1 add3DENLayer "CTRG"; - player set3DENLayer _myLayer; - _entities = get3DENLayerEntities _myLayer;$/Code$ + $Code$_WorldCoord = _Control ctrlMapScreenToWorld _ScreenCoord$/Code$ + + $Code$_WorldCoord = _Control ctrlMapScreenToWorld [_x,_y]$/Code$ + + $Code$_WorldCoord = (findDisplay 12 displayCtrl 51) ctrlMapScreenToWorld [_x,_y]$/Code$ undefined / undefined + (April 6, 2007) + Notes: + You can get the screen coordinates by the UI Event Handlers onMouseButtonDown, onMouseButtonUp, onMouseButtonClick, onMouseButtonDblClick. + The return Array is in 2-D, you can use it with all set-position commands. + _x = returnArray select 0; + _y = returnArray select 1; + + (December 2, 2009) + Notes: + In VBS2 1.23 this command does not seem to work properly. Therefore when defining UI Event Handlers onMouseButtonClick and onMouseButtonDblClick the functions onMapSingleClick and onDoubleClick (VBS2) can be used instead, these already provide access to the world coordinates of the click event. + + The command parameters are screen position coordinates, which may not equate to to the map control's coordinates. A map control's screen coordinates and size can be found use the ctrlPosition command. This is an issue when using the Arma 3 in-game map, which is not fullscreen (all previous titles used full screen map controls, so map control coords did equate to screen coords). + + (August 28, 2017) + This example creates a RscMapControl and hints you the [x,y] position where you clicked. + $Code$0 spawn { + disableSerialization; + _map = findDisplay 46 createDisplay "RscCredits" ctrlCreate ["RscMapControl", -1]; + _map ctrlSetPosition [0,0,1,1]; + _map ctrlCommit 0; + _map ctrlAddEventHandler ["mouseButtonDown", { + _ctrl = _this select 0; + _x = _this select 2; + _y = _this select 3; + _pos = _ctrl ctrlMapScreenToWorld [_x, _y]; + hint format ["pos: %1", _pos]; + }]; + };$/Code$ - Array + Array + - get3DENLinesVisible + isEqualTypeArray - Get visibility state of Eden Editor lines. + Compares types of all elements of one array to types of all elements of another array. - https://community.bistudio.com/wiki/get3DENLinesVisible + https://community.bistudio.com/wiki/isEqualTypeArray - get3DENLinesVisible + Array isEqualTypeArray Array - get3DENLinesVisible + arr1 isEqualTypeArray arr2 - $Code$if ( get3DENLinesVisible select 0) then { hint "Lines are visible in the map.";};$/Code$ + $Code$_arr = [1,true,"three"]; + _arr isEqualTypeArray [0,objNull,""]; // false + _arr isEqualTypeArray [0,false,""]; // true$/Code$ + + $Code$_arr = [1,2]; + _arr isEqualTypeArray [0]; // false + _arr isEqualTypeArray [0,0]; // true + _arr isEqualTypeArray [0,0,0]; // false$/Code$ undefined / undefined @@ -26676,398 +28067,450 @@ - Array + Boolean + - get3DENMissionAttribute + isRemoteExecuted - Return value of scenario attribute. - ! - Attributes are available only within the Eden Editor workspace. You cannot access them in scenario preview or exported scenario! + Returns true if the code context is being remote executed by remoteExec or remoteExecCall. In SP always returns false. See also isRemoteExecutedJIP - https://community.bistudio.com/wiki/get3DENMissionAttribute + https://community.bistudio.com/wiki/isRemoteExecuted - String get3DENMissionAttribute String + isRemoteExecuted - section get3DENMissionAttribute class + isRemoteExecuted - $Code$systemChat str ("Multiplayer" get3DENMissionAttribute "respawn");$/Code$ + $Code$_remoteExecuted = isRemoteExecuted ;$/Code$ undefined / undefined - (February 26, 2016) - The class names of the vanilla sections are: - General - Scenario - Environment - Intel - Multiplayer - Multiplayer - Garbage Collection - GarbageCollection - Preferences - Preferences + (September 11, 2017) + NOTE : When remoteExec / remoteExecCall is called from a headless client to client, this will always return as false. + This effect also occurs with remoteExecutedOwner - it will return always return 0 from a headless client.. - Anything + Boolean + - get3DENMouseOver + everyContainer - Returns the Eden Entity the mouse is hovering over in Eden Editor. + Returns array of all containers (uniforms, vests, backpacks) stored in given crate or vehicle. Used for accessing containers content stored in ammo box or ground holder. - https://community.bistudio.com/wiki/get3DENMouseOver + https://community.bistudio.com/wiki/everyContainer - get3DENMouseOver + everyContainer Object - get3DENMouseOver + everyContainer box - $Code$systemChat str get3DENMouseOver ;// returns: ["Object",B Alpha 1-1:1]$/Code$ + $Code$everyContainer cursorTarget ; + // [ + //["V_PlateCarrier1_rgr",2bc06b00# 163955: dummyweapon.p3d], + //["U_B_CombatUniform_mcam",2bc07900# 163954: dummyweapon.p3d] + //]$/Code$ undefined / undefined + (July 20, 2017) + The returned array is in the following format: + $Code$[ + [containerClassname1, containerObject1], + [containerClassname2, containerObject2], + .... + [containerClassnameN, containerObjectN] + ] + $/Code$ + Please do note that typeOf containerObjectN does not return containerClassnameN but rather the containerClass configured in config (usually "supplyN") - Array + Array + - get3DENSelected + forEach - Returns an array of all selected Eden Editor Entities, including groups, waypoints, and markers. + Executes the given command(s) on every item of an array. + The array items are represented by the magic variable _x. The array indices are represented by _forEachIndex. + In ArmA2 & VBS2, the variable _x is always local to the forEach block so it is safe to nest them. - https://community.bistudio.com/wiki/get3DENSelected + https://community.bistudio.com/wiki/forEach - get3DENSelected String + String/Code forEach Array - get3DENSelected type + script forEach array - $Code$systemChat str ( get3DENSelected ""); - /* outputs: [ - [B Alpha 2-1:1],//objects - [B Alpha 2-1],//groups - [164494: no shape ],//triggers - [ No center Charlie 1-2:4],//logic - [ [B Alpha 2-1,0] ],//waypoints - ["Hotel_Whiskey"]//markers - ]*/$/Code$ + $Code${ _x setDammage 1; } forEach units group player ;$/Code$ - $Code$systemChat str ( get3DENSelected "object"); - // outputs: [B Alpha 2-1:1]$/Code$ + $Code$// This command can also easily be used to execute a single command multiple times without respect to the array items. + { player addMagazine "M16"; } forEach [1, 2, 3, 4];$/Code$ + + $Code$// You can also use multiple commands in the same block. + { + _x setCaptive true ; + removeAllWeapons _x ; + doStop _x ; + } forEach units group this ;$/Code$ + + $Code$// To get the index of a forEach loop, use _forEachIndex. + { systemChat format ["%1", _forEachIndex];} forEach [1,2,3]; + // Will return: "0", "1", "2" in systemChat messages.$/Code$ undefined / undefined + (July 20, 2010) + If arrays are used in forEach loops, _x uses them by reference, so any changes to _x will be applied to the original: + $Code$_arr1 = [1,2,3]; + _arr2 = [6,7,8]; + {_x set [1,"x"]} forEach [_arr1,_arr2];$/Code$ + will change _arr1 to [1,"x",3], and _arr2 to [6,"x",8]. + + (August 29, 2014) + forEach returns any (the last passed value will be the return value or just Nothing, depends on the function called). + $Code$ + _var = {_x} forEach [ nil,"s", objNull, configFile ]; // return bin\config.bin + _var = {_x setCaptive true } forEach allUnits ; // return nothing + $/Code$ + + (September 20, 2014) + Using the foreach loop, since there are no variable for the index like say the for-do loop, there is a variable that you can use to check the index of the foreach loop. + $Code${ + if ( _forEachIndex == 1) then { + // Copilot + _x addUniform "U_B_Soldier_VR"; + } else { + // Adams + [_x, "B_Soldier_TL_F"] call BIS_fnc_loadInventory ; + _x addUniform "U_B_Soldier_VR"; + _x setIdentity "Bootcamp_B_Adams"; + }; + } forEach _crew; + $/Code$ + So when the array is past from _crew to the loop, index 1 (which is the second element) is the copilot of the "B_Heli_Light_01_F" and he will get "U_B_Soldier_VR" as a uniform. While the pilot which is index 0 (first element), will get the same uniform but will get the loadout of "B_Soldier_TL_F" and the identity of "Bootcamp_B_Adams". + + (January 2, 2015) + Using exitWith inside a forEach loop will make forEach actually return something, namely whatever the exitWith returns: + $Code$_result = { + if(_x isEqualTo 3) exitWith {"Hello"} + } forEach [1,2,3,4,5]; + //_result = "Hello"$/Code$ + + (November 28, 2017) + Be careful when deleting ( deleteAt ) elements from an Array while you iterate over it. + _forEachIndex will not move to reflect your change. + The forEach code is doing the same as + $Code$ + _forEachIndex = 0; + while {_forEachIndex count _array} do { + (_array select _forEachIndex) call code; + _forEachIndex = _forEachIndex + 1; + } + $/Code$ + So if you delete your current element from the array the other elements will shift forward. Meaning you skip one element. + Example: + $Code$_array = [1,2,3,4,5,6]; + {_array deleteAt _forEachIndex} forEach _array; + $/Code$ + After the first iteration your Array will be [2,3,4,5,6] and the _forEachIndex will be 1. + So on next iteration you get the element at index 1 which will be 3. So you've just skipped the 2. + So in the end you will only iterate over 1,3 and 6 - Array + Anything + - getAimingCoef + menuExpand - Get current aiming coefficient (higher ~ less precise, default is 1) + Expands given menu entry on given path and all its parents so entry is visible. - https://community.bistudio.com/wiki/getAimingCoef + https://community.bistudio.com/wiki/menuExpand - getAimingCoef Object + menuExpand Array - getAimingCoef unit + menuExpand [idc, path] - $Code$_coef = getAimingCoef player$/Code$ - + undefined / undefined - Number + Nothing + - getAllHitPointsDamage + clearItemCargo - Returns 3 arrays for easy cross reference: 1st - array of hit point names, 2nd - array of hit selection names, 3rd - array of damage values. All values in all arrays are ordered accordingly to hit part index for convenience and for use in setHitIndex and getHitIndex. Levels of damage are: - 0: no damage - 1: full damage + Removes all items from ammo box (or any general weapon holder container). - https://community.bistudio.com/wiki/getAllHitPointsDamage + https://community.bistudio.com/wiki/clearItemCargo - getAllHitPointsDamage Object + clearItemCargo Object - getAllHitPointsDamage entity + clearItemCargo box - $Code$getAllHitPointsDamage player ; - //[ - //["HitFace","HitNeck","HitHead","HitPelvis","HitAbdomen","HitDiaphragm","HitChest","HitBody","HitArms","HitHands","HitLegs"], - //["","neck","head","pelvis","spine1","spine2","spine3","body","","hands","legs"], - //[0,0.0939002,0.0319932,0.0858595,0.174491,1,1,0.168495,1,0.5,0.195907] - //]$/Code$ + $Code$clearItemCargo myBox;$/Code$ - global / undefined + undefined / undefined - Array + Nothing + - getAllOwnedMines + magazinesTurret - Gets all mine objects this unit has ownership over. + Returns all magazines of given turret. Use turret path [-1] for driver's turret. Alternatively, use magazinesAllTurrets - https://community.bistudio.com/wiki/getAllOwnedMines + https://community.bistudio.com/wiki/magazinesTurret - getAllOwnedMines Object + Object magazinesTurret Array - getAllOwnedMines unit + vehicle magazinesTurret turretPath - $Code$_mines = getAllOwnedMines player ;$/Code$ + $Code$_mags = vehicle player magazinesTurret [0, 0];$/Code$ + + $Code$_mags = _tank magazinesTurret [0];$/Code$ - undefined / undefined + global / undefined - Array + Array + - getAmmoCargo + setDriveOnPath - Returns the amount of ammo resources in the cargo space of a rearm vehicle. + Sets the path to follow for AI driver - https://community.bistudio.com/wiki/getAmmoCargo + https://community.bistudio.com/wiki/setDriveOnPath - getAmmoCargo Object + Object setDriveOnPath Array - getAmmoCargo vehicle + vehicleName setDriveOnPath [points] - $Code$value = getAmmoCargo myVehicleName;$/Code$ + $Code$myVehicle setDriveOnPath [[1000,10,1000],[1100,10,1000]]$/Code$ - global / undefined + undefined / undefined - (December 22, 2014) - If the vehicle is not alive, it always returns Nothing, which you should check for using isNil. - If the vehicle is unable to carry that type of cargo, it returns -1.#IND, which you should check for using finite. - Number + Nothing + - getAnimAimPrecision + lbIsSelected - Returns aim precision for current animation + Check whether given row of the given listbox is selected. - https://community.bistudio.com/wiki/getAnimAimPrecision + https://community.bistudio.com/wiki/lbIsSelected - getAnimAimPrecision Object + Control lbIsSelected Number - getAnimAimPrecision unit + control lbIsSelected index - $Code$getAnimAimPrecision player;$/Code$ + $Code$_selected = _control lbIsSelected 0;$/Code$ - undefined / undefined + local / local + More information on the LB command family can be found here - Number + Boolean + - getAnimSpeedCoef + magazines - Get coefficient for animation speed. + Returns array of type names of all vehicle's magazines. + When applied to a unit (soldier), the command behaves differently and will omit magazines already loaded into unit's weapons. Use currentMagazine to get this information for a currently loaded magazine. - https://community.bistudio.com/wiki/getAnimSpeedCoef + https://community.bistudio.com/wiki/magazines - getAnimSpeedCoef Object + magazines Object - getAnimSpeedCoef unit + magazines vehicle - $Code$getAnimSpeedCoef player ;$/Code$ + $Code$_mags = magazines player$/Code$ undefined / undefined + In OFP v1.96, if a weapon is loaded with an empty magazine, that magazine will still be counted by this command. The ammo command can be used to check if a unit has any ammunition into it's last magazine. + + (25 November 2011) + This command does not include non-turret weapon magazines, such as smoke, flare or chaff magazines which are usually declared in the root of the vehicle's class, rather than in the Turrets hierarchy. - Number + Array + - getArray + triggerAttachVehicle - Extract array from config entry. + Specifies the entity which will activate the selected trigger. + If [] is given, the trigger is decoupled from the assigned vehicle (example 2). + If the activation source is "VEHICLE", "GROUP", "LEADER" or "MEMBER", it's changed to "NONE". + If [vehicle] is given, the trigger is coupled to the vehicle or its group. + When the source is "GROUP", "LEADER" or "MEMBER", it's coupled to the group, otherwise it's coupled to the vehicle and the source is changed to "VEHICLE". - https://community.bistudio.com/wiki/getArray + https://community.bistudio.com/wiki/triggerAttachVehicle - getArray Config + Object triggerAttachVehicle Array - getArray config + triggerName triggerAttachVehicle objects - $Code$_array = getArray (configFile "CfgVehicles" "Thing" "threat")$/Code$ + $Code$trigger triggerAttachVehicle [ player ];$/Code$ + + $Code$trigger triggerAttachVehicle [];$/Code$ - undefined / undefined + global / local - (Mar 28, 2014) - (ArmA3 1.14) It's recommended to use BIS_fnc_GetCfgData or BIS_fnc_returnConfigEntry to get variable cfg data rather than conditioning via isNumber, isText, isArray, getNumber, getText and getArray combination. - Traditional workaround: - $Code$ - _cfg = configFile "CfgVehicles" _SomeAddonClassName "DestructionEffects" "Smoke1" "type" - switch ( true ) do - { - case ( isNumber _cfg): { getNumber _cfg}; - case ( isText _cfg): { getText _cfg}; - case ( isArray _cfg): { getArray _cfg;}; - default { nil }; - }; - $/Code$ - Recommended workaround: - $Code$ - ( configFile "CfgVehicles" _SomeAddonClassName "DestructionEffects" "Smoke1" "type") call BIS_fnc_GetCfgData ; - $/Code$ - To return default value once entry was not found, we can use BIS_fnc_returnConfigEntry instead of BIS_fnc_GetCfgData. - $Code$ - [( configFile "CannonFire" "LightExp"),"lifeTime",0] call BIS_fnc_returnConfigEntry ;//0.5 - $/Code$ - Array + Nothing + - getArtilleryAmmo + loadAbs - Get list of all available magazines of artillery units on the list. Command returns only unique magazine types and doesn't contain any information about which unit has which magazine. + Returns current sum of mass from items stored in all unit's containers, linked items and weapons. - https://community.bistudio.com/wiki/getArtilleryAmmo + https://community.bistudio.com/wiki/loadAbs - getArtilleryAmmo Array + loadAbs Object - getArtilleryAmmo [unit1, unit2, unit3] + loadAbs unit - $Code$if ("8Rnd_82mm_Mo_Flare_white" in getArtilleryAmmo [ - _mortar1, - _mortar2, - _mortar3, - _mortar4 - ]) then { - hint "Sir, we have white flares, sir!"; - };$/Code$ + $Code$// Player weight: + _weight = loadAbs player;$/Code$ - global / undefined + undefined / undefined - Array + Number + - getArtilleryComputerSettings + setAutonomous - Returns settings from artillery computer currently opened by player. + Sets UAV autonomous mode. - https://community.bistudio.com/wiki/getArtilleryComputerSettings + https://community.bistudio.com/wiki/setAutonomous - getArtilleryComputerSettings + Object setAutonomous Boolean - getArtilleryComputerSettings + uav setAutonomous bool - $Code$hint str getArtilleryComputerSettings ; //["Semi (medium)","HE Mortar Shells",0]$/Code$ + $Code$uav setAutonomous true ;$/Code$ undefined / undefined @@ -27075,150 +28518,168 @@ - Array + Nothing + - getArtilleryETA + camSetRelPos - Returns ETA to the target in seconds for given artillery unit based on target position and used magazine, -1 if target can't be hit. + Sets the position of the given camera relative to its target, set with camSetTarget. Needs a call to camCommit to be conducted. Note, that since it sets relative position to the target, the camSetTarget command should be executed already, before camSetRelPos. - https://community.bistudio.com/wiki/getArtilleryETA + https://community.bistudio.com/wiki/camSetRelPos - Object getArtilleryETA Array + Object camSetRelPos Array - unit getArtilleryETA [targetPosition, magazineType] + camera camSetRelPos position - $Code$_mortar getArtilleryETA [ getPos _target, getArtilleryAmmo [_mortar] select 0];$/Code$ - - $Code$_mortar getArtilleryETA [ position _target, currentMagazine _mortar];$/Code$ + $Code$_cam camSetTarget _car; + _cam camSetRelPos [0,10,8];$/Code$ - global / undefined + local / local - (August 26, 2013) - To avoid wrong ETA readings, position of the target should only be obtained via position or getPos + The location of the camera will depend on the direction the target object is facing. + The camera does not bank with the target (bug?). - Number + Nothing + - getAssignedCuratorLogic + armoryPoints - Returns curator logic to which given player has access. + Returns, stored in [USERNAME].ArmaXProfile, value of armoryPoints entry. If the entry doesn't exist, it returns 0. - https://community.bistudio.com/wiki/getAssignedCuratorLogic + https://community.bistudio.com/wiki/armoryPoints - getAssignedCuratorLogic Object + armoryPoints - getAssignedCuratorLogic player + armoryPoints - $Code$( getAssignedCuratorLogic player ) removeCuratorEditableObjects [ allDead, true ];$/Code$ + $Code$_points = armoryPoints ;$/Code$ undefined / undefined - (August 17, 2014) - This command will return objNull if used immediately after the curator logic is assigned to the unit in question (this includes at mission time 0). To avoid problems use the following beforehand: $Code$ waitUntil {! isNull ( getAssignedCuratorLogic unit)};$/Code$ - Object + Number + - getAssignedCuratorUnit + tvSetPictureRightColorSelected - Returns unit assigned to curator logic. + Sets the color of the right picture of a tree item defined by path when item is selected - https://community.bistudio.com/wiki/getAssignedCuratorUnit + https://community.bistudio.com/wiki/tvSetPictureRightColorSelected - getAssignedCuratorUnit Object + Control tvSetPictureRightColorSelected Array - getAssignedCuratorUnit curatorObj + control tvSetPictureRightColorSelected [path, color] - $Code$_curatorUnit = getAssignedCuratorUnit ( allCurators select 0); - _curatorUnit joinAs [ createGroup civilian, 0];$/Code$ + $Code$_control tvSetPictureRightColorSelected [[0], [1,0,1,1]]$/Code$ undefined / undefined - (August 17, 2014) - This command will return objNull if used immediately after the curator unit is assigned to the logic in question (this includes at mission time 0). To avoid problems use the following beforehand: $Code$ waitUntil {! isNull ( getAssignedCuratorUnit logic)};$/Code$ - Object + Nothing + - getBackpackCargo + setVehiclePosition - Returns all backpack types and count from the cargo space + Moves the object to a given position (same as createVehicle placement algorithm). Uses either the position that's defined by the position param, or one of the marker positions from the markers array. The object is placed inside a circle with position as its center and placement as its radius. The type of placement could also be controlled with special. + If position is in water and vehicle can float, it is placed on water surface, otherwise it is placed on the ground, even if ground is under water. If roof surfaces support walking, units will be placed on roofs if such position is given. - https://community.bistudio.com/wiki/getBackpackCargo + https://community.bistudio.com/wiki/setVehiclePosition - getBackpackCargo Object + Object setVehiclePosition Array - getBackpackCargo object + object setVehiclePosition [position, markers, placement, special] - $Code$_content = getBackpackCargo carName;$/Code$ + $Code$player setVehiclePosition [[1000,2000], ["Pos1","Pos2","Pos3"], 0, "CAN_COLLIDE"]; + // Will place the player at either [1000,2000], or one of the three markers positions.$/Code$ - $Code$_content = getBackpackCargo ammoBoxName;$/Code$ + $Code$heli setVehiclePosition [ player, [], 0, "FLY"];$/Code$ + + $Code$_cam = "camera" camCreate [0,0,0]; + _cam setDir random 360; + _cam setVehiclePosition [[5000,5000], [], 1000, "NONE"]; + _cam setPosWorld ( getPosWorld _cam vectorAdd [0,0,1.8]); + _cam cameraEffect ["Internal", "Back"];$/Code$ + + $Code$private _tablePos = player getRelPos [3, 0]; + private _table = "Land_CampingTable_F" createVehicle [0,0,0]; + private _laptop = "Land_Laptop_unfolded_F" createVehicle [0,0,0]; + _table setPos _tablePos; + _laptop setVehiclePosition [_tablePos vectorAdd [0.5, 0.2, 10], [], 0, "CAN_COLLIDE"]; + _laptop attachTo [_table];$/Code$ - undefined / undefined + global / global + (June 24, 2015) + If you need to set direction as well, set it before using setVehiclePosition. The command will use existing dir of the object for its calculations. + $Code$ player setDir random 360; + player setVehiclePosition [ player, [], 100, "none"];$/Code$ - Array + Boolean + - getBleedingRemaining + removeCuratorCameraArea - Returns how many seconds injured unit will continue leaving blood trail. If unit damage is 0.1, the return value is 0 and unit doesn't leave any blood trail. Use setBleedingRemaining to set different remaining time. + Removes curator camera area. - https://community.bistudio.com/wiki/getBleedingRemaining + https://community.bistudio.com/wiki/removeCuratorCameraArea - getBleedingRemaining Object + Object removeCuratorCameraArea Number - getBleedingRemaining unit + curatorObj removeCuratorCameraArea cameraAreaID - $Code$_bleedingRemaining = getBleedingRemaining _unit;$/Code$ + $Code$myCurator removeCuratorCameraArea 3;$/Code$ undefined / undefined @@ -27226,332 +28687,270 @@ - Number + Nothing + - getBurningValue + modelToWorldWorld - Returns amount of damage from fire. + Converts position from object model space to world space (usable by setPosWorld for example). - https://community.bistudio.com/wiki/getBurningValue + https://community.bistudio.com/wiki/modelToWorldWorld - getBurningValue Object + Object modelToWorldWorld Array - getBurningValue unit + obj modelToWorldWorld modelPos - + $Code$( getPos player ) modelToWorldWorld [0,1,0]$/Code$ + undefined / undefined + (May 28, 2017) + This command produces identical result to modelToWorld command used in conjunction with AGLToASL + $Code$obj modelToWorldWorld [1,2,3] isEqualTo AGLToASL (obj modelToWorld [1,2,3]); // true$/Code$ - Number + Array + - getCameraViewDirection + ropeAttachTo - Returns the direction unit is looking in render time scope. While for AI the origin for the view direction vector can be taken from eyePos unit, for human player the origin should be taken from player camera position positionCameraToWorld [0,0,0] + Attach vehicle to rope with optional offset - https://community.bistudio.com/wiki/getCameraViewDirection + https://community.bistudio.com/wiki/ropeAttachTo - getCameraViewDirection Object + Array ropeAttachTo Object - getCameraViewDirection unit + [veh, toPoint, ropeEndDownDir] ropeAttachTo rope - $Code$// Draw AI eye direction (green), weapon direction (red) and camera direction (blue) in 3D: - bob = createGroup east createUnit ["O_Soldier_F", [0,0,0], [], 0, "NONE"]; - bob setVehiclePosition [ player modelToWorld [0,100,0], [], 0, "NONE"]; - onEachFrame - { - _beg = ASLToAGL eyePos bob; - _endE = (_beg vectorAdd ( eyeDirection bob vectorMultiply 100)); - drawLine3D [ _beg, _endE, [0,1,0,1]]; - _endW = (_beg vectorAdd (bob weaponDirection currentWeapon bob vectorMultiply 100)); - drawLine3D [_beg, _endW, [1,0,0,1]]; - _endV = (_beg vectorAdd ( getCameraViewDirection bob vectorMultiply 100)); - drawLine3D [_beg, _endV, [0,0,1,1]]; - };$/Code$ + $Code$[veh1,[0,0,0],[0,0,-1]] ropeAttachTo ( ropes heli1 select 0);$/Code$ - global / undefined + undefined / undefined - Array + Nothing + - getCargoIndex + saveJoysticks - Returns index of the unit in cargo. 0,1,2... or -1 if not in cargo. + Saves joysticks key mappings into the joysticks.cfg file. Engine add these joysticks to the Joystick Scheme mapping dialog in options controls section. - https://community.bistudio.com/wiki/getCargoIndex + https://community.bistudio.com/wiki/saveJoysticks - Object getCargoIndex Object + saveJoysticks - vehicle getCargoIndex unit + saveJoysticks - $Code$player moveInCargo heli; - hint str (heli getCargoIndex player );$/Code$ - + - global / undefined + undefined / undefined - Number + Nothing + - getCenterOfMass + lbSort - Returns center of mass of an object. + Sorts listbox entries alphabetically ascending by their lbText - https://community.bistudio.com/wiki/getCenterOfMass + https://community.bistudio.com/wiki/lbSort - getCenterOfMass Object + lbSort Control + + lbSort Array + + lbSort Number - getCenterOfMass object + lbSort control + + lbSort [control, sortOrder] + + lbSort idc + + lbSort [idc, sortOrder] - $Code$_com = getCenterOfMass _myCar;$/Code$ + $Code$lbSort _myControl;$/Code$ + + $Code$lbSort [_myControl, "DESC"];$/Code$ + + $Code$lbSort 101;$/Code$ + + $Code$lbSort [101, "DESC"];$/Code$ - global / undefined + undefined / undefined + More information on the LB command family can be found here - Array + Nothing - Nothing - Nothing + - getClientStateNumber + spawn - Returns client state in network game. Works on both, client and dedicated server. The following states are possible: - getClientStateNumber - getClientState - 0 - "NONE" - No client (or singleplayer) - 1 - "CREATED" - Client is created - 2 - "CONNECTED" - Client is connected to server, message formats are registered - 3 - "LOGGED IN" - Identity is created - 4 - "MISSION SELECTED" - Mission is selected - 5 - "MISSION ASKED" - Server was asked to send / not send mission - 6 - "ROLE ASSIGNED" - Role was assigned (and confirmed) - 7 - "MISSION RECEIVED" - Mission received - 8 - "GAME LOADED" - Island loaded, vehicles received - 9 - "BRIEFING SHOWN" - Briefing was displayed - 10 - "BRIEFING READ" - Ready to play mission - 11 - "GAME FINISHED" - Game was finished - 12 - "DEBRIEFING READ" - Debriefing read, ready to continue with next mission + Adds given code to the scheduler. Exactly when the code will be executed is unknown, it depends on how busy is the engine and how filled up is the scheduler. Therefore spawn does not wait for the supplied code to finish, instead, spawn returns a Script handle to the scheduler task. scriptDone command can be used to check the code completion. Additional arguments are passed to the code in local variable _this. Since Arma 3 v1.55 the script handle also exists inside the code in _thisScript variable. - https://community.bistudio.com/wiki/getClientStateNumber + https://community.bistudio.com/wiki/spawn - getClientStateNumber + Any_Value spawn Code - getClientStateNumber + arguments spawn code - $Code$_state = getClientStateNumber ;$/Code$ + $Code$_handle = [] spawn { player globalChat "Hello world!"};$/Code$ - $Code$_inGame = getClientStateNumber 8;$/Code$ + $Code$// There is no guarantee that spawned scripts will be executed in the same order they spawned: + for "_i" from 0 to 100 do + { + _null = _i spawn + { + diag_log _this; + }; + }; + // // Result: 51,1,2...49,50,0,52,53...100$/Code$ undefined / undefined + (5 March, 2009) + spawn cannot call other local functions on the same scope as itself. + It can, however, call other global functions: + $Code$_addOne = {TST=TST+1}; + TST_addOne = {TST=TST+1}; + _add = { + TST=TST+1; + player sideChat format ["added: %1",TST]; + [] call _addOne; + player sideChat format ["called local: %1",TST]; + [] call TST_addOne; + player sideChat format ["called global: %1",TST]; + }; + TST=0; + [] call _add; + [] spawn _add;$/Code$ + The call of _addOne from the spawned function does not do anything. + + (October 21, 2014) + spawn requires a script handle when used in the 2D editor. (A3) + In scripts and in the debug console, it is not required, but very useful for keeping track of running scripts. Having a script handle also makes it easy to terminate scripts at any time. + Since spawn creates a new scheduled environment, having an excess of open threads can make the scheduler queue extremely long, significantly increasing the execution time of each thread. (it takes an extremely large amount of threads, though) + + (August 25, 2015) + If you want to call a local function which has NOT been created inside a spawned function, then do this: + $Code$_fncOne = { systemChat"This is _fncOne" }; _fncTwo = { call (_this select 0) }; [_fncOne] spawn _fncTwo;$/Code$ - Number + Script_Handle + - getClientState + groupChat - Returns client state in network game. Works on both, client and dedicated server. The following states are possible: - getClientStateNumber - getClientState - 0 - "NONE" - No client (or singleplayer) - 1 - "CREATED" - Client is created - 2 - "CONNECTED" - Client is connected to server, message formats are registered - 3 - "LOGGED IN" - Identity is created - 4 - "MISSION SELECTED" - Mission is selected - 5 - "MISSION ASKED" - Server was asked to send / not send mission - 6 - "ROLE ASSIGNED" - Role was assigned (and confirmed) - 7 - "MISSION RECEIVED" - Mission received - 8 - "GAME LOADED" - Island loaded, vehicles received - 9 - "BRIEFING SHOWN" - Briefing was displayed - 10 - "BRIEFING READ" - Ready to play mission - 11 - "GAME FINISHED" - Game was finished - 12 - "DEBRIEFING READ" - Debriefing read, ready to continue with next mission + Types text to the group radio channel. Must have assigned "ItemRadio" to see or transmit the messages. The text will be visible only on the PC where command was executed. If you need the message to show on all computers, you have to execute it globally (see remoteExec ) - https://community.bistudio.com/wiki/getClientState + https://community.bistudio.com/wiki/groupChat - getClientState + Object groupChat String - getClientState + unitName groupChat chatText - $Code$_state = getClientState ;$/Code$ + $Code$_soldierOne groupChat "Show this text";$/Code$ - $Code$if ( getClientState == "BRIEFING READ") then { hint "Let the show begin!"};$/Code$ + $Code$driver vehicle player sideChat "sideChat"; + driver vehicle player globalChat "globalChat"; + driver vehicle player groupChat "groupChat"; + vehicle player vehicleChat "vehicleChat"; + driver vehicle player commandChat "commandChat"; + driver vehicle player customChat [1, "customChat"]; + systemChat "systemChat";$/Code$ - undefined / undefined + global / local - String + Nothing + - getCompatiblePylonMagazines + boundingBoxReal - Get array of compatible pylon magazines + Returns a bounding box of given object in model coordinates space. This command is similar to boundingBox but gives more precise measurements. - https://community.bistudio.com/wiki/getCompatiblePylonMagazines + https://community.bistudio.com/wiki/boundingBoxReal - Object getCompatiblePylonMagazines Number - - String getCompatiblePylonMagazines Number + boundingBoxReal Object - vehicle getCompatiblePylonMagazines pylon - - vehicleClass getCompatiblePylonMagazines pylon + boundingBoxReal obj - $Code$vehicle player getCompatiblePylonMagazines 0; // returns array of arrays containing all compatible magazines$/Code$ - - $Code$"Plane_Fighter_01_Base_F" getCompatiblePylonMagazines 3; // returns array of compatible magazines for the 3rd pylon$/Code$ - - $Code$jet1 getCompatiblePylonMagazines "pylon1"; // returns array of compatible magazines for the 1st pylon$/Code$ - - $Code$// Get all pylon names for "Plane_Fighter_01_Base_F" - private _allPylons = "true" configClasses ( - configFile - - "CfgVehicles" - - "Plane_Fighter_01_Base_F" - - "Components" - - "TransportPylonsComponent" - - "pylons" - ) apply { configName _x}; - hint str _allPylons; - /* return: - [ - "pylon1", - "pylon2", - "pylon3", - "pylon4", - "pylonBayRight1", - "pylonBayLeft1", - "pylonBayCenter1", - "pylonBayCenter2", - "pylonBayCenter3", - "pylonBayCenter4", - "pylonBayCenter5", - "pylonBayCenter6" - ]*/$/Code$ + $Code$_bbr = boundingBoxReal vehicle player ; + _p1 = _bbr select 0; + _p2 = _bbr select 1; + _maxWidth = abs ((_p2 select 0) - (_p1 select 0)); + _maxLength = abs ((_p2 select 1) - (_p1 select 1)); + _maxHeight = abs ((_p2 select 2) - (_p1 select 2));$/Code$ undefined / undefined @@ -27559,56 +28958,59 @@ - Array - Array + Array + - getConnectedUAV + diag_frameNo - Returns UAV if unit has connection to some UAV. + Returns number of frame currently displayed. - https://community.bistudio.com/wiki/getConnectedUAV + https://community.bistudio.com/wiki/diag_frameNo - getConnectedUAV Object + diag_frameNo - getConnectedUAV unit + diag_frameNo - + $Code$_currFrameNo = diag_frameNo ;$/Code$ + undefined / undefined + (November 19, 2014) + Avoid using hard-coded frame-specific events, the total amount of drawn frames is persistent across all missions. It does not get reset until the game is closed. - Object + Number + - getContainerMaxLoad + backpack - Returns max load value of given container. Currently works only with uniform, vest and backpack classes. + Returns a class of a backpack. - https://community.bistudio.com/wiki/getContainerMaxLoad + https://community.bistudio.com/wiki/backpack - getContainerMaxLoad String + backpack Object - getContainerMaxLoad containerClass + backpack unit - $Code$_maxLoadUniform = getContainerMaxLoad uniform player ; - _maxLoadVest = getContainerMaxLoad vest player ; - _maxLoadBackpack = getContainerMaxLoad backpack player ;$/Code$ + $Code$_classname = backpack player ;$/Code$ undefined / undefined @@ -27616,170 +29018,158 @@ - Number + String + - getCursorObjectParams + addScore - Returns object and named selections under cursor and distance to object's surface (to the point cursor points at). If object surface is further away then 50 meters, selections are always an empty array and distance is 1e10 (10^10). + Add a number to the score of a unit. This score is shown in multiplayer in the "I" ("P" in Arma 3) screen. Negative values will remove from the score. Server execution only. + See also: Arma_3:_Event_Handlers#HandleScore - https://community.bistudio.com/wiki/getCursorObjectParams + https://community.bistudio.com/wiki/addScore - getCursorObjectParams + Object addScore Number - getCursorObjectParams + unit addScore score - $Code$hint str getCursorObjectParams ;$/Code$ + $Code$unit addScore 10;$/Code$ - undefined / undefined + global / global + This scripting command must be executed on the server to work properly in multiplayer - Array + Nothing + - getCustomAimCoef + expectedDestination - Returns aimPrecision from animation state with custom value that will directly affects weapon sway size and speed. + Return expected destination of unit as an array with format: [ Position, planningMode, forceReplan]. - https://community.bistudio.com/wiki/getCustomAimCoef + https://community.bistudio.com/wiki/expectedDestination - getCustomAimCoef Object + expectedDestination Object - getCustomAimCoef unit + expectedDestination person - $Code$_coef = getCustomAimCoef player$/Code$ - + - global / undefined + local / undefined + (16:24, 3 March 2007 (CET)) + For AI units I have found the following values: planningMode is "LEADER PLANNED" when the unit is ordered by the group leader to go somewhere or if the unit is the group leader and it follows a waypoint. Otherwise planningMode it is "DoNotPlan". Units moving in formation have "DoNotPlan" as long as they don't receive orders by the group leader. Units also have "DoNotPlan" when they don't move. Units executing special formation tasks like engaging or return to formation have "FORMATION PLANNED" as long they haven't fulfilled the task. - Number + Array + - getDLCs + drawLine - Returns array of appIDs of DLCs. Use filter param to get specific type of DLCs: - 0 - all - 1 - owned - 2 - not owned + Draw a line on the map. - https://community.bistudio.com/wiki/getDLCs + https://community.bistudio.com/wiki/drawLine - getDLCs Number + Control drawLine Array - getDLCs filter + map drawLine [position1, position2, color] - $Code$_ownedDLCs = getDLCs 1;$/Code$ - - $Code$// Is the Karts DLC owned by this client? - hintSilent str (288520 in ( getDLCs 1));$/Code$ - + undefined / undefined - (May 30, 2014) - Current list of IDs that correspond to the available DLCs: - 275700 - Arma 3 Zeus - 249860 - Arma 3 Soundtrack - 304400 - Arma 3 DLC Bundle - 249861 - Arma 3 Maps - 249862 - Arma 3 Tactical Guide - 288520 - Arma 3 Karts - 304380 - Arma 3 Helicopters - 332350 - Arma 3 Marksmen - - (April 7, 2015) - To add to the note above, app ID can be found in CfgMods. Here is an example path from zeus using the Splendid Config Viewer: - $Code$ configFile "CfgMods" "Curator" "appId"$/Code$ - This method can be used to find app IDs without having to find a list like the one above. - I am also pretty sure you are able to define your own app ID for your own mods using this method. - - (July 1, 2016) - The required DLC-IDs equal to the Steam App-IDs of each obtainable DLC. - To extend Sniperwolfs list: - 395180 - Arma 3 Apex + (March 22, 2014) + Map example: $Code$( findDisplay 12 displayCtrl 51) ctrlAddEventHandler ["Draw"," + ( _this select 0) drawLine [ + getPos player, + [0,0,0], + [0,0,1,1] + ]; + "];$/Code$ + Be careful when using this command. Unlike map markers, the draw commands can decrease your framerate. - Array + Nothing + - getDammage + addTorque - Returns the object damage in the range from 0 to 1. Alias of damage. + Applies torque (rotation momentum) to the center of mass of the given object. Torque force is defined as vector [x, y, z] applied in world space. If you need to define torque in model space, convert the torque vector first by vectorModelToWorld or vectorModelToWorldVisual command. The torque applied as impulse. Diagram below explain which way the object would rotate. For more information see NVIDIA docs - https://community.bistudio.com/wiki/getDammage + https://community.bistudio.com/wiki/addTorque - getDammage Object + Object addTorque Array - getDammage object + object addTorque torque - $Code$_damage = getDammage player ;$/Code$ + $Code$// Apply torque [1000,0,0] to object not factoring object positioning: + _wheel addTorque [1000,0,0];$/Code$ + + $Code$// Apply torque [1000,0,0] relative to object: + _wheel addTorque (_wheel vectorModelToWorld [1000,0,0]);$/Code$ - undefined / undefined + global / global - (, May 9, 2011) - getDammage and damage works fine when used on damaged vehicles after a repair from a repairtruck when used in A2 CO patch 1.59. - - Vehicles repaired in game with the Repair trucks e.t.c never get completely repaired. After being repaired, rather than returning 0 when the damage command is called. They return a value equal to or less than 0.09. - Consequently any vehicle flagged as immobile (as indicated by the canMove command), remains so. At least as far as the AI are concerned. The AI will refuse to board an immobile vehicle or eject straight after boarding. Players remain unaffected and can drive the vehicle as normal. To circumvent this, use setDamage 0 on the vehicle in question, to allow the AI to board. - - In OFP 1.96, it is possible for a unit to be dead and still return a getDammage value well below 1. Use ! alive to check if a unit is dead. - Number + Nothing + - getDescription + drawLink - Returns the string representation of unit as an four slots array. + The editor will draw a line between the two specified editor objects. Line type can be LINE or ARROW. + i + Some Old Editor Command - https://community.bistudio.com/wiki/getDescription + https://community.bistudio.com/wiki/drawLink - getDescription Object + Control drawLink Array - getDescription unit + map drawLink [from,to,param type,line type,color] @@ -27787,371 +29177,478 @@ undefined / undefined - Return value fixed in revision 0.51.103185. - - (September 21, 2014) - Pretty useless command tbh, return is something like this: - ["B_Soldier_F","Combat Fatigues (MTP)","Carrier Lite (Green)",""] or ["ERROR","ERROR","ERROR","ERROR"] - Array + Nothing + - getDirVisual + setCameraInterest - Returns object's heading in the range from 0 to 360 in render time scope. + Set camera interest for given entity. Camera interest is by default 0. Any unit which is speaking has its camera interest raised to 50. Camera interest is used to focus camera to control depth of field in cutscenes. Combination of camera interest, unit position of the screen, unit movement, unit type, and some other properties is used to determine which unit to focus at. Higher camera interest increases the chance of the unit being focused. - https://community.bistudio.com/wiki/getDirVisual + https://community.bistudio.com/wiki/setCameraInterest - getDirVisual Object + Object setCameraInterest Number - getDirVisual object + entity setCameraInterest interest - $Code$_dir = getDirVisual player ;$/Code$ + $Code$_soldier setCameraInterest 50;$/Code$ - global / undefined + undefined / undefined - Number + Nothing + - getDir + selectionPosition - Returns the object heading in the range from 0 to 360. - Since Arma 3 v1.55.133361, an alternative syntax is added that allows to get heading from one object or position to another object or position, the equivalent of BIS_fnc_dirTo + Search for selection in the object model (first in the memory level, then in geometry LODs). + Returns position in model space. In A1 it returns the initial position of the selection, in A2/3 position of the selection (e.g. when it is animated) in render time scope. If a selection does not exist [0,0,0] is returned. - https://community.bistudio.com/wiki/getDir + https://community.bistudio.com/wiki/selectionPosition - getDir Object + Object selectionPosition String - Object/Position2D/Position3D getDir Object/Position2D/Position3D + Object selectionPosition Array - getDir object + object selectionPosition selectionName - pos1 getDir pos2 + object selectionPosition [selectionName, LODName] - $Code$_azimuth = getDir player ;$/Code$ + $Code$_inModelPosition = player selectionPosition "head_hit";$/Code$ - $Code$_azimuth = player getDir tank;$/Code$ + $Code$_inModelPosition = player selectionPosition "pelvis";$/Code$ + + $Code$_inModelPosition = player selectionPosition "head";$/Code$ + + $Code$_inModelPosition = player selectionPosition "camera";$/Code$ global / undefined - (October 23, 2013) - Be careful when using this command in conjunction with BIS_fnc_rotateVector2D ; the latter rotates vectors counterclockwise (mathematically correct), while getDir returns a clockwise angle. - To counter this, simply negate the output of getDir: - $Code$[[0,1,0], -( getDir _object ) ] call BIS_fnc_rotateVector2D ;$/Code$ + (January 5, 2007) + To know more selections simply create an eventHandler damage on an object. + + (July 29, 2015) + Since 1.49.131660, you can use an alternative syntax: + object selectionPosition [selectionName, lodName] + lodName: "Memory", "Geometry", "FireGeometry", "LandContact", "HitPoints" + If the given selectionName is not found in the given lod, [0,0,0] is returned. + + (June 25, 2017) + Do use the filter that comes with Alt Syntax to suit your needs. For example player has 3 selections called "head" and their selectionPositions are quite different from each other: + $Code$ player selectionPosition ["head", "Memory"]; // [0.173798,0.330415,1.37783] + player selectionPosition ["head", "FireGeometry"]; // [0.14375,0.206039,1.44689] + player selectionPosition ["head", "HitPoints"]; // [0.144257,0.306769,1.53471]$/Code$ - Number - Number + Array - Array + - getEditorCamera + joinAsSilent - Fetches a reference to the mission editor camera. - i - Some Old Editor Command + Joins the unit to the given group, if position id is available, this one is used. Avoid any radio communication related to joining. - https://community.bistudio.com/wiki/getEditorCamera + https://community.bistudio.com/wiki/joinAsSilent - getEditorCamera Control + Object joinAsSilent Array - getEditorCamera map + unit joinAsSilent [group, id] - + $Code$player joinAsSilent [_group, 4];$/Code$ + + $Code$// To get the position id: + getUnitPositionId = { + private ["_vvn", "_str"]; + _vvn = vehicleVarName _this; + _this setVehicleVarName ""; + _str = str _this; + _this setVehicleVarName _vvn; + parseNumber (_str select [(_str find ":") + 1]) + }; + player joinAsSilent [ createGroup west, 5]; + _id = player call getUnitPositionId; + hint str _id; //5$/Code$ + - undefined / undefined + global / global + I haven't done a thorough test but this function doesn't seem to work for Civilians, use joinSilent instead. - Object + Nothing + - getEditorMode + showMap - Returns the current mode of the editor. - i - Some Old Editor Command + Enable Map (default true ) - https://community.bistudio.com/wiki/getEditorMode + https://community.bistudio.com/wiki/showMap - getEditorMode Control + showMap Boolean - getEditorMode map + showMap show - + $Code$showMap false$/Code$ + undefined / undefined + In ArmA 2 - This command no longer works. The map is now an inventory item. It is kept under the weapon class name "itemmap". + Example: $Code$unitname removeweapon "itemmap"$/Code$ To add again use $Code$unitname addweapon "itemmap"$/Code$. - String + Nothing + - getEditorObjectScope + allUnits - Returns the editor object scope of the specified editor object. - i - Some Old Editor Command + Return a list of all units (all persons except agents) created on the following sides east, west, resistance / independent and civilian only. Does not contain units of sideLogic. Dead units and units awaiting for respawn are also excluded. - https://community.bistudio.com/wiki/getEditorObjectScope + https://community.bistudio.com/wiki/allUnits - Control getEditorObjectScope String + allUnits - map getEditorObjectScope object + allUnits - + $Code${_x setDamage 0.5; _x groupChat "Braaains"} forEach allUnits ;$/Code$ + undefined / undefined + (July 15, 2011) + It returns infantry outside and inside vehicles. - String + Array + - getElevationOffset + parseNumber - Returns the map elevation offset from [map]/config.cpp. - Returns 0 if there's no elevationOffset defined in the config of the current world. + An SQF equivalent of C++ atof function. Parses the string, interpreting its content as a floating point number. + The command first discards as many whitespace characters as necessary until the first non-whitespace character is found. Then, starting from this character, takes as many characters as possible that are valid following a syntax resembling that of floating point literals, and interprets them as a numerical value. The rest of the string after the last valid character is ignored and has no effect on the behavior of this command. + If the first sequence of non-whitespace characters in string does not form a valid floating-point number, or if no such sequence exists because either string is empty or contains only whitespace characters, no conversion is performed and the command returns 0. - https://community.bistudio.com/wiki/getElevationOffset + https://community.bistudio.com/wiki/parseNumber - getElevationOffset + parseNumber String + + parseNumber Boolean - getElevationOffset + parseNumber string + + parseNumber boolean - $Code$_offset = getElevationOffset ;$/Code$ + $Code$_number = parseNumber "0.125"; //0.125$/Code$ + + $Code$_number = parseNumber "2 abc"; //2$/Code$ + + $Code$_number = parseNumber true ; //1$/Code$ undefined / undefined + (Aug 28, 2014) + (A3 1.26)It only detects the first occurrence of a number in the string, return 0 by default. + $Code$ parseNumber "2s4f"; // 2 + parseNumber "s2f4"; // 0$/Code$ + parse config or code, currently BIS_fnc_parseNumber, occurrence is only limited with number, return -1 by default. + $Code${s3s4f} call BIS_fnc_parseNumber ; // -1$/Code$ - Number + Number - Number + - getFSMVariable + createVehicleLocal - Return the value of variable in the variable space of given FSM. The FSM handle is the number returned by the execFSM command. + Creates an object of the given type. Created object is not transferred through network in MP games. netId of such vehicle in multiplayer will be "0:0". To disable local vehicle creation, use CfgDisabledCommands to blacklist this command - https://community.bistudio.com/wiki/getFSMVariable + https://community.bistudio.com/wiki/createVehicleLocal - Number getFSMVariable String - - Number getFSMVariable Array + String createVehicleLocal Position - FSMhandle getFSMVariable name - - FSMhandle getFSMVariable [name, defaultValue] + type createVehicleLocal position - $Code$_handle getFSMVariable "_foo";$/Code$ - - $Code$_handle getFSMVariable ["_foo", 123];$/Code$ + $Code$_lightsource = "#lightpoint" createVehicleLocal _pos;$/Code$ - undefined / undefined + undefined / local + (07:18, 5 June 2008 (CEST)) + If the object that is created is of the type ammo, then it will created on all clients ( tested only on VBS2 ). + + (18:04, 5 September 2013 (CEST)) + Indeed the type of Ammo is transfered to ALL clients, but apparently also the muzzle effects (firing sound, light, etc.); this includes muzzles from Horns (Truck or Car Horn, Bicycle bells, etc.) as well as any other weapon. Tested on Arma 1 - Arma 2 OA (latest patch). - Anything - Anything + Object + - getFatigue + captiveNum - Returns fatigue of given unit. + Checks whether the unit is a captive. If the unit is a vehicle, its commander is checked instead. + If a unit's captivity level was set as a Boolean, then the returned number is either 0 (for false ) or 1 (for true ). - https://community.bistudio.com/wiki/getFatigue + https://community.bistudio.com/wiki/captiveNum - getFatigue Object + captiveNum Object - getFatigue unit + captiveNum unit - $Code$value = getFatigue player ;$/Code$ + $Code$_captivity = captiveNum _unit;$/Code$ - $Code$if ( getFatigue player 0.5) then { player sideChat "I'm good to go!" };$/Code$ + $Code$_unit setCaptive 1024; + hint str captive _unit; //true + hint str captiveNum _unit; //1024$/Code$ global / undefined - getFatigue can be applied to remote unit however it will not read the changes made to unit's fatigue with setFatigue command. Only natural changes resulting from unit moving will be counted. When applied to local unit, it will read resulting value of natural fatigue combined with artificial changes added locally by setFatigue. In short, the server wouldn't know the correct value of remote unit's fatigue if you used setFatigue on the unit prior. - Number + Number + - getForcedFlagTexture + onBriefingNotes - A getter for forceFlagTexture. Forced texture is different from your normal flag texture, which can be retrieved with flagTexture + Select a sound declared in the Description.ext of the mission to be played the first time the Notes tab is selected in the briefing. - https://community.bistudio.com/wiki/getForcedFlagTexture + https://community.bistudio.com/wiki/onBriefingNotes - getForcedFlagTexture Object + onBriefingNotes String - getForcedFlagTexture object + onBriefingNotes soundName - $Code$getForcedFlagTexture player ;$/Code$ + $Code$onBriefingNotes "NotesVoiceOver";$/Code$ undefined / undefined + (8 Feb, 2007) + In OFP it works only with the sound files defined in the mission's description.ext - String + Nothing + - getFriend + fire - Returns if sides are friendly or hostile. For a value smaller than 0.6 it results in being enemy, otherwise it's friendly. See also Side relations. + Forces a unit to fire the given weapon. + NOTE: Just like with forceWeaponFire it is possible to pass remote unit as argument, but this could be unreliable. Considering this command might need to be used in combination with selectWeapon, which takes only local arguments, it would make sense to execute fire command where unit is also local. See also: BIS_fnc_fire - https://community.bistudio.com/wiki/getFriend + https://community.bistudio.com/wiki/fire - Side getFriend Side + Object fire String + + Object fire Array - side1 getFriend side2 + unit fire muzzle + + unit fire [muzzle, mode, magazine] - $Code$value = west getFriend east ;$/Code$ + $Code$_soldier fire "M16";$/Code$ - $Code$_isEnemy = side _killer getFriend side _victim 0.6;$/Code$ + $Code$_soldier fire "SmokeShellMuzzle";$/Code$ + + $Code$_soldier fire ["SmokeShellMuzzle","SmokeShellMuzzle","SmokeShell"];$/Code$ + + $Code$player playActionNow "PutDown"; + player selectWeapon "DemoChargeMuzzle"; + player fire ["DemoChargeMuzzle", "DemoChargeMuzzle", "DemoCharge_Remote_Mag"]; + player setWeaponReloadingTime [ player, "DemoChargeMuzzle", 0];$/Code$ - global / undefined + local / global + (August 17, 2006) + Sometimes AI won't shoot when you use this command. It can be fixed by placing selectWeapon command before it. + + (February 2, 2007) + In OFP v1.96, when a man class unit is given this command, he will aim up in the air before firing his weapon. This makes it rather useless if you want to make him shoot a target. It does work with vehicles, when the vehicle is first given a doWatch or doTarget command. + + (January 20, 2007) + In ArmA v1.02, this command is not working with weapons in the secondary turrets (like "DSHKM" in t72) + + (Jan 15, 2008) + To place a satchel (pipebomb) the syntax is: + OFP : unitname Fire ["put", "pipebomb"] + ArmA : unitname Fire ["pipebombmuzzle", "pipebombmuzzle", "pipebomb"]; + The triggering is done via a " TOUCHOFF " action. + + (March 18, 2010) + In Arma2 AI will automatically shoot straight up. Command seems to be broken. + + (November 24, 2010) + Command is broken - confirmed. Use action "USEWEAPON" instead. + Place a game logic in the editor. Name it MyGameLogic. + Use this code to make unit1 fire his primaryweapon: + MyGameLogic action ["useWeapon",primaryWeapon unit1,unit1,0]; + + (Feburary 25, 2011) + Command works just fine in A2/OA. Make sure to execute it on local AI. + + (April 06, 2012) + If it did work at one time, it does no longer. The AI (or player) is forced to look upwards or reacts to a massive recoil force before getting his shot off. + + (Feburary 16, 2013) + Command did not work with ACR 1.62. Used fireAtTarget instead. + + (June 4, 2014) + In Arma 3 in order for AI to place Claymore, for example, it is necessary to execute 3 statements - an animation, weapon select and the actual fire command. Animation is most likely for forcing unit to leave rest state, weapon select and fire kinda both go together anyway: $Code$_unit playActionNow "PutDown"; + _unit selectWeapon "DirectionalMineRemoteMuzzle"; + _unit fire [ + "DirectionalMineRemoteMuzzle", + "DirectionalMineRemoteMuzzle", + "ClaymoreDirectionalMine_Remote_Mag" + ];$/Code$ + + (November 25th, 2017) + In ArmA 3, as of version 1.76, examples 2 and 3 in the section above for smoke grenades are no longer working. As a workaround (throwing green smoke grenades for example), you can use: $Code$[_soldier, "SmokeShellGreenMuzzle"] call BIS_fnc_fire;$/Code$ - Number + Nothing - Nothing + - getFuelCargo + moonIntensity - Returns the fuel amount (between 0 and 1) in the cargo space of a refuelling vehicle. + Returns the intensity of the moon's brightness in range 0...1. - https://community.bistudio.com/wiki/getFuelCargo + https://community.bistudio.com/wiki/moonIntensity - getFuelCargo Object + moonIntensity - getFuelCargo vehicle + moonIntensity - $Code$value = getFuelCargo myVehicleName;$/Code$ + $Code$_intensity = moonIntensity ;$/Code$ - global / undefined + undefined / undefined - (December 22, 2014) - If the vehicle is not alive, it always returns Nothing, which you should check for using isNil. - If the vehicle is unable to carry that type of cargo, it returns -1.#IND, which you should check for using finite. - Number + Number + - getGroupIconParams + ctrlModel - Returns group icons params used for command bar drawing such as color, text, scale, visibility, waypoint visibility, waypoint color. + Returns model used in 3D Dialog Control. - https://community.bistudio.com/wiki/getGroupIconParams + https://community.bistudio.com/wiki/ctrlModel - getGroupIconParams Group + ctrlModel Control - getGroupIconParams group + ctrlModel control - $Code$_iconParams = getGroupIconParams group player ;$/Code$ + $Code$_model = ctrlModel _control3D;$/Code$ undefined / undefined @@ -28159,899 +29656,991 @@ - Array + String + - getGroupIcons + doSuppressiveFire - Returns all group icons. [id,icon,[offsetx,offsety],[..],..] + Order the given unit to suppress a given position or target (without radio messages). - https://community.bistudio.com/wiki/getGroupIcons + https://community.bistudio.com/wiki/doSuppressiveFire - getGroupIcons Group + Object/Array doSuppressiveFire Object/Array - getGroupIcons group + unitName doSuppressiveFire target - + $Code$_soldier doSuppressiveFire [1869.508,5760.962,0.000]$/Code$ + + $Code$_soldier doSuppressiveFire cursorTarget$/Code$ + - global / undefined + local / local + (October 8, 2016) + Command expects position as second argument in format ASL in A3 1.64.138497. - Array + Nothing + - getGroupIcon + getAssignedCuratorUnit - Get group icon properties. + Returns unit assigned to curator logic. - https://community.bistudio.com/wiki/getGroupIcon + https://community.bistudio.com/wiki/getAssignedCuratorUnit - Group getGroupIcon Number + getAssignedCuratorUnit Object - group getGroupIcon ID + getAssignedCuratorUnit curatorObj - $Code$_grpIconId = _group getVariable "BIS_MARTA_ICON_TYPE"; - _grpIcon = _group getGroupIcon _grpIconId;$/Code$ + $Code$_curatorUnit = getAssignedCuratorUnit ( allCurators select 0); + _curatorUnit joinAs [ createGroup civilian, 0];$/Code$ - global / undefined + undefined / undefined + (August 17, 2014) + This command will return objNull if used immediately after the curator unit is assigned to the logic in question (this includes at mission time 0). To avoid problems use the following beforehand: $Code$ waitUntil {! isNull ( getAssignedCuratorUnit logic)};$/Code$ - Array + Object + - getHideFrom + onGroupIconOverEnter - Returns the Position where object believes the enemy to be. If there is no direct line of sight between the object and the enemy, this position is extrapolated based on the last known position and speed of the enemy. A returned position of [0,0,0] implies that object does not knowAbout enemy. If enemy is null it is some position in front of the object or enemy position. + Defines an action performed when player moves pointer over group marker (3D or in a map). The code will execute continuously while pointer is over icon. + i + Since Arma 3 v1.57 a stackable version of this EH is available: GroupIconOverEnter - https://community.bistudio.com/wiki/getHideFrom + https://community.bistudio.com/wiki/onGroupIconOverEnter - Object getHideFrom Object + onGroupIconOverEnter String/Code - object getHideFrom enemy + onGroupIconOverEnter command - + $Code$onGroupIconOverEnter + { + // Passed values for _this are: + _is3D = _this select 0; + _group = _this select 1; + _wpID = _this select 2; + _posx = _this select 3; + _posy = _this select 4; + _shift = _this select 5; + _ctrl = _this select 6; + _alt = _this select 7; + _message = format ["____ Info ____"]; + {_message = _message + format ["\n %1",_x]} forEach _this; + hint _message; + }$/Code$ + undefined / undefined - (April 25, 2015) - This command is definatlely not broken, at least not in A3 1.42. It functions exactly as the description says it does. The reason why the Z value is elevated is because it represents the units torso. When the unit is prone and spotted, the Z value is much less. Here you can see a perfectly working example of this command Talk:getHideFrom#Operation Script Sample - Array + Nothing + - getHitIndex + configFile - Return current level of damage for a specific Hit Point (specified by its hit part index). All hit points can be obtained with getAllHitPointsDamage command. - 0: no damage - 1: full damage + Return root of config entries hierarchy. + See AllInOne Config for a full config extract as example. - https://community.bistudio.com/wiki/getHitIndex + https://community.bistudio.com/wiki/configFile - Object getHitIndex Number + configFile - vehicle getHitIndex hitPartIndex + configFile - $Code$vehicle player getHitIndex 3;$/Code$ + $Code$_isMyClassActive = isClass ( configFile / "CfgPatches" / "MyClass");$/Code$ - global / undefined + undefined / undefined + (Jul 19, 2014) + (ArmA3 1.24) It is recommended to use configClasses instead of BIS_fnc_getCfgSubClasses and BIS_fnc_uniqueClasses on subclasses collection or conditional selection. + $Code$ + _faces = " true " configClasses ( configFile "Cfgfaces"); + //same as: _faces = (configfile "CfgFaces") call BIS_fnc_getCfgSubClasses ; + $/Code$ + $Code$ + //Extract all animals: + animals = "(( configName _x) isKindOf 'animal')" configClasses ( configFile "CfgVehicles"); + /*same as: + aniamls = []; + [( configFile "CfgVehicles"),{ + if (( configName _this) isKindOf “animal”) then { + animals set [ count animals, _this] + } + } + ] call BIS_fnc_uniqueClasses ;*/ + $/Code$ + Return nested subclasses, currently still BIS_fnc_returnChildren + $Code$ + //Return all nested config classes. + [( configFile "CfgFaces"),1, true, true ] call BIS_fnc_returnChildren ; + $/Code$ - Number/Nothing + Config + - getHit + setWaypointForceBehaviour - Returns selection damage. Same as getHitPointDamage only argument is selection part instead of hit point. Note: Some part names are in Czech; see translation table. + Forces the behavior of waypoint, disables AUTOCOMBAT. - https://community.bistudio.com/wiki/getHit + https://community.bistudio.com/wiki/setWaypointForceBehaviour - Object getHit String + Waypoint setWaypointForceBehaviour Boolean - vehicle getHit selection + waypoint setWaypointForceBehaviour state - $Code$player getHit "head";$/Code$ - - $Code$_car getHit "motor";$/Code$ + $Code$[grp, 2] setWaypointForceBehaviour true ;$/Code$ - global / undefined + undefined / undefined - Number/Nothing + Nothing + - getHitPointDamage + shownCompass - Return current level of damage for a specific Hit Point (specified by its config class). If you need to get damage of a selection instead of hit point, use getHit. - 0: no damage - 1: full damage + Checks if client has Compass enabled in description.ext ( showCompass param) or force enabled with showCompass command. - https://community.bistudio.com/wiki/getHitPointDamage + https://community.bistudio.com/wiki/shownCompass - Object getHitPointDamage String + shownCompass - vehicle getHitPointDamage hitPointName + shownCompass - $Code$(vehicle player) getHitPointDamage "hitEngine";$/Code$ + $Code$if ( shownCompass ) then { hint "You have Compass enabled"};$/Code$ - global / undefined + undefined / undefined - Common ObjectRTD TKOH Hit Points: - HitEngine (engine #1) - HitEngine2 (engine #2) - HitEngine3 (engine #3) - HitHRotor (main rotor) - HitVRotor (tail rotor) - HitBatteries (electrical systems) - HitLight (landing light) - HitHydraulics (entire hydraulics system) - HitTransmission (engine transmission) - HitGear (landing gear) - HitFuel (all fuel tanks) - HitHStabilizerL1 (first left horizontal stabilizer) - HitHStabilizerR1 (first right horizontal stabilizer) - HitVStabilizer1 (first vertical stabilizer) - HitTail (tail boom) - HitPitotTube (all pitot tubes) - HitStaticPort (all static ports) - HitStarter1 (starter for engine #1) - HitStarter2 (starter for engine #2) - HitStarter3 (starter for engine #3) - HitAvionics - HitHull - HitMissiles - HitRGlass - HitLGlass - HitGlass1 - HitGlass2 - HitGlass3 - HitGlass4 - HitGlass5 - HitGlass6 - - (March 4, 2017) - Note that vehicles with multiple turrets have multiple HitTurret and HitGun classes that can't be distinguished based on the Hitpoint class name. They can only be distinguished by their selection names. The selection names do not necessarily correspond to a common nomenclature, especially for mod vehicles. There can also be multiple empty Hitpoint Class names on a vehicle or infantry unit. They can be hitpoints for vehicle headlights or be the result of a bad config/model, as hitpoints that have an undefined named selection in their config class or are missing their named selection in the model will result in an empty HitPoint class name. - Number/Nothing + Boolean + - getItemCargo + configSourceModList - Returns all items names and count from ammo box (or any general weapon holder container). + Returns an array of mods (CfgMods) in which the given config class is defined. - https://community.bistudio.com/wiki/getItemCargo + https://community.bistudio.com/wiki/configSourceModList - getItemCargo Object + configSourceModList Config - getItemCargo box + configSourceModList config - $Code$hint str getItemCargo cursorTarget ;$/Code$ + $Code$_mods = configSourceModList ( configFile "CfgVehicles" "Man"); + hint str _mods; // ["A3","curator","heli"]$/Code$ - global / undefined + undefined / undefined - Array + Array + - getMagazineCargo + ctrlSetAutoScrollSpeed - Returns all magazines types and count from the cargo space + Sets number of second required to scroll to next line. If speed 0, auto-scroll is disabled. Setter for ctrlAutoScrollSpeed. + Autorscroll is available for CT_LISTBOX and CT_CONTROLS_GROUP types of controls only. Autoscroll will wait ctrlAutoScrollDelay seconds (must be 0) and then will scroll the scroll bar down to the bottom. ctrlAutoScrollSpeed defines the speed with which scrollbar is scrolled. If ctrlAutoScrollRewind is true, the control will fade out, immediately rewind to the top, then fade in, wait ctrlAutoScrollDelay seconds and then repeat the scrolling in a loop. If user focuses on the control, autoscrolling is interrupted. - https://community.bistudio.com/wiki/getMagazineCargo + https://community.bistudio.com/wiki/ctrlSetAutoScrollSpeed - getMagazineCargo Object + Control ctrlSetAutoScrollSpeed Number - getMagazineCargo object + control ctrlSetAutoScrollSpeed speed - $Code$_content = getMagazineCargo carName;$/Code$ - - $Code$_content = getMagazineCargo ammoBoxName;$/Code$ - - $Code$hint str getMagazineCargo unitBackpack cursorTarget ;$/Code$ + $Code$_ctrlGroup ctrlSetAutoScrollSpeed 0.1;$/Code$ - global / undefined + undefined / undefined - Array + Nothing + - getMarkerColor + allMapMarkers - Returns marker color for given marker. See setMarkerColor. Note: This function is identical to markerColor. + Return all markers in map including user placed markers (_USER_DEFINED #). + Since Arma 3 v1.57.134377 User defined markers have the following name format: _USER_DEFINED # PlayerID / MarkerID / ChannelID where: + PlayerID - unique network id of the player (same as _id in onPlayerConnected ) + MarkerID - a marker counter id + ChannelID - id of the chat channel on which marker was placed (see currentChannel ) - https://community.bistudio.com/wiki/getMarkerColor + https://community.bistudio.com/wiki/allMapMarkers - getMarkerColor String + allMapMarkers - getMarkerColor markerName + allMapMarkers - $Code$"MarkerOne" setMarkerColor "ColorBlack"; - _color = getMarkerColor "MarkerOne"; //returns "ColorBlack"$/Code$ + $Code$_markers = allMapMarkers ; + // returns: ["marker1","_USER_DEFINED #2/0"]$/Code$ + + $Code${ + private "_a"; + _a = toArray _x; + _a resize 15; + if ( toString _a == "_USER_DEFINED #") then { + deleteMarker _x; + } + } forEach allMapMarkers ;$/Code$ + + $Code$if (_someString in allMapMarkers ) then { + hint (_someString + " is a valid marker name"); + };$/Code$ - global / undefined + undefined / undefined + (March 17, 2014) + A3 1.12 : Markers placed in editor will be in the array as a string of their name. Markers placed by the player will begin with "_USER_DEFINED #." + + (March 17, 2014) + To expand on the comment above. In Multiplayer, user created marker will appear in allMapMarkers as _USER_DEFINED #ID/Number, where ID is unique id related to _id param from onPlayerConnected and Number is sequential integer incremented by 1 with each marker placement by the IDed user. - String + Array + - getMarkerPos + currentZeroing - Returns the position of a given marker in format [x,y,0]. Array element 3 (height above ground) is always zero. If a non-existing marker is referenced the values returned are [0,0,0]. + Returns zeroing of unit's weapon. - https://community.bistudio.com/wiki/getMarkerPos + https://community.bistudio.com/wiki/currentZeroing - getMarkerPos String + currentZeroing Object - getMarkerPos markerName + currentZeroing gunner - $Code$"MarkerOne" setMarkerPos [200,100]; - _pos = getMarkerPos "MarkerOne" - // _pos is [200,100,0]$/Code$ + $Code$_zeroing = currentZeroing player ;$/Code$ undefined / undefined - (September 1, 2016) - To acomplish getting the altitude of a marker you can do workaround using setMarkerDir as it accepts any number (above 360 or below -360): - $Code$"Marker" setMarkerPos [200,200]; - "Marker" setMarkerDir 1640; - $/Code$ - After, setting player position as an example: - $Code$player setPosASL [(getMarkerPos "Marker") select 0, (getMarkerPos "Marker") select 1,(markerDir "Marker")]$/Code$ - Array + Number + - getMarkerSize + clearGroupIcons - Returns the size of the given marker. A getter for setMarkerSize and an alias of markerSize. + Removes all icon from group. - https://community.bistudio.com/wiki/getMarkerSize + https://community.bistudio.com/wiki/clearGroupIcons - getMarkerSize String + clearGroupIcons Group - getMarkerSize markerName + clearGroupIcons group - $Code$"MarkerOne" setMarkerSize [100,200]; - _size = getMarkerSize "MarkerOne"; //returns [100,200]$/Code$ - + - global / undefined + undefined / undefined - Array + Nothing + - getMarkerType + lbSetColorRight - Returns the type of a given marker. See cfgMarkers for a list of standard markers. + Sets the color of the item (right) with the given index of the listbox or combobox with id idc of the topmost user dialog to color. + Colour is in format Color. - https://community.bistudio.com/wiki/getMarkerType + https://community.bistudio.com/wiki/lbSetColorRight - getMarkerType String + lbSetColorRight Array + + Control lbSetColorRight Array - getMarkerType markerName + lbSetColorRight [idc, index, color] + + control lbSetColorRight [index, color] - $Code$"MarkerOne" setMarkerType "Destroy" - _type = getMarkerType "MarkerOne" - returns "Destroy"$/Code$ + $Code$lbSetColorRight [101, 0, [0, 1, 0, 0.5]];$/Code$ + + $Code$_control lbSetColorRight [0, [0, 1, 0, 0.5]];$/Code$ - global / undefined + local / local + More information on the LB command family can be found here - String + Nothing - Nothing + - getMass + setRandomLip - Returns mass of a PhysX object. + Enables/Disables random lip. When enabled, the unit continuously moves its lips as if it's talking. - https://community.bistudio.com/wiki/getMass + https://community.bistudio.com/wiki/setRandomLip - getMass Object + Object setRandomLip Boolean - getMass object + unit setRandomLip bool - $Code$_mass = getMass _myCar$/Code$ + $Code$player setRandomLip true ;$/Code$ - global / undefined + undefined / undefined - (April 15, 2015) - This function will return 0 for infantry AI units. That means a manned Blufor Hunter has the same mass than an empty one (8306.63). - Crates return their initial mass, but if you empty them or load items, magazines and weapons, the mass remains the same. In fact, none of these (non-physx) objects has a mass. - Number + Nothing + - getMissionConfig + ctCurSel - Returns Config entry for the given scenario attribute from the 1st tier. The attribute can be config class or config property. If it is defined in multiple places, the command checks them in the following order: - External Description.ext file - Eden Editor scenario attribute - So if attribute exists in both places, attribute from description.ext is used. Previously, scenario attributes were extracted from Description.ext using missionConfigFile. That still works, but it ignores attributes set directly in the editor and it should not be used anymore. + Returns index of the selected row. Will take only rows, but not headers into account. - https://community.bistudio.com/wiki/getMissionConfig + https://community.bistudio.com/wiki/ctCurSel - getMissionConfig String + ctCurSel Control - getMissionConfig attribute + ctCurSel ctrl - $Code$_header = getMissionConfig "Header" - // Returns scenario header config. Replaces the previous approach which would scan only the external Description.ext file, but ignore the value set in the Eden Editor:_header = missionConfigFile "Header"; // Old approach$/Code$ + $Code$_curSel = ctCurSel _control;$/Code$ - undefined / undefined + local / local - Config + Number + - getMissionConfigValue + gunner - Returns value of the given scenario attribute from the 1st tier. Since only config properties have values, the attribute should be config property. If it is not found or config class is given, the return is nil. If the attribute defined in multiple places, the command checks them in the following order: - External Description.ext file - Eden Editor scenario attribute - So if attribute exists in both places, attribute from description.ext is used. Previously, scenario attributes were extracted from Description.ext using missionConfigFile. That still works, but it ignores attributes set directly in the editor and it should not be used anymore. + Returns the gunner of a vehicle. - https://community.bistudio.com/wiki/getMissionConfigValue + https://community.bistudio.com/wiki/gunner - getMissionConfigValue String - - getMissionConfigValue Array + gunner Object - getMissionConfigValue attribute - - getMissionConfigValue [attribute, defaultValue] + gunner vehicle - $Code$_respawnDelay = getMissionConfigValue ["respawnDelay",0] - // Returns respawn delay value. Replaces the previous approach which would scan only the external Description.ext file, but ignore the value set in the Eden Editor:_respawnDelay = getNumber ( missionConfigFile "respawnDelay"); // Old approach$/Code$ + $Code$(gunner _tank1) action ["getout",_tank1]$/Code$ - undefined / undefined + global / undefined + (2 January, 2007) + The gunner command will only return a single gunner. If the vehicle has occupied, multiple turrets. See this discussion on the official forums, for an alternative: + Need an array with a vehicle's cargo units - Number/String/Array - Number/String/Array + Object + - getMissionDLCs + reloadEnabled - Returns list of DLCs that are used in the mission. List is created only from units listed in mission.sqm and doesn't detect units created by scripts! + Check whether magazine is reloaded whenever emptied. - https://community.bistudio.com/wiki/getMissionDLCs + https://community.bistudio.com/wiki/reloadEnabled - getMissionDLCs + reloadEnabled Object - getMissionDLCs + reloadEnabled unitName - $Code$_list = getMissionDLCs$/Code$ - + undefined / undefined - Array + Boolean + - getMissionLayerEntities + lnbAddRow - Returns all entities within specific Eden Editor layer. To be used when the scenario is running, not in the editor workspace. - Useful for disabling / enabling whole parts of the scenario which you add to specific layer while editing. + Adds a row of strings. - https://community.bistudio.com/wiki/getMissionLayerEntities + https://community.bistudio.com/wiki/lnbAddRow - getMissionLayerEntities String + lnbAddRow Array + + Control lnbAddRow Array - getMissionLayerEntities layerName + lnbAddRow [IDC,[ String, String ]] + + _ctrl lnbAddRow [ String, String ] - $Code$_base = getMissionLayerEntities "Base";$/Code$ + $Code$lnbAddRow [1,["COL1","COL2"]];$/Code$ - $Code$waitUntil {( player distance _someObject) 800}; - { - deleteVehicle _x ; - } forEach (( getMissionLayerEntities "Simple Objects") select 0);//Deletes all objects within that layer after the player is over 800m away from _someObject$/Code$ + $Code$_ctrl lnbAddRow ["COL1","COL2"];$/Code$ - undefined / undefined + local / local - (October 26, 2016) - After an object was deleted from a layer, getMissionLayerEntities will return NULL-object for the deleted object. - Version: 1.65 - Build: 139010 + (Sep 9 2014) + (A3 1.28)As for invisible data processing, lnbAddArray, lnbAddColumn, lnbData, lnbGetColumnsPosition, lnbSetColumnsPos, lnbSetData, lnbSetText, lnbSetValue, lnbText and lnbValue store data types into exact position of the listNbox with different spaces. Accessing data with coordinate command at nearly the same syntax: + $Code$ + //Set same value to one position of a Control + _ctrl lnbSetData [ [0,0],"#1"]; + lnbSetColumnsPos [102, [0,1], 1]; + _ctrl lnbSetText [ [0,1], "#1"]; + _ctrl lnbSetValue [ [0,0],1]; + //Accessing the value disregard affecting one another. + _ctrl lnbData [0,0]; //"#1" + lnbGetColumnsPosition _ctrl //[1]; + _ctrl lnbText [0,0];//"#1" + _ctrl lnbValue [0,0];//1 + $/Code$ + For a direct visible control over CT_LISTNBOX: + $Code$ + 0 = [_CT_LISTNBOX] spawn { + private ["_CT_LISTNBOX","_color","_current","_pic"]; + disableSerialization ; + _CT_LISTNBOX = _this select 0; + { + _CT_LISTNBOX lnbAddRow [ getText (_x "displayNameShort"), getText (_x "displayName")]; + _CT_LISTNBOX lnbSetPicture [ [_foreachIndex,0], getText (_x "texture")]; + } forEach (" isClass _x" configClasses ( configFile "CfgRanks")); + _CT_LISTNBOX lnbSetCurSelRow 0; + _current = lnbCurSelRow _CT_LISTNBOX; + _color = _CT_LISTNBOX lnbColor [_current,0]; + _CT_LISTNBOX lnbSetColor [ [_current,1], [(_color select 0)/2,0,0,1] ]; + _CT_LISTNBOX lnbDeleteColumn 0; + _CT_LISTNBOX lnbDeleteRow 1; + sleep 1; + lnbClear _CT_LISTNBOX;//Clear all items but control still remains just invisible. + }; + $/Code$ + A combined use of both invisible and visible data processing commands alive the Control. - Array + Number - Number + - getModelInfo + unitReady - Returns object's model info in format [modelName, modelPath, hasSkeleton]. Model path is suitable for use with createSimpleObject command. + Check if the unit is ready. Unit is busy when it is given some command like move, until the command is finished. - https://community.bistudio.com/wiki/getModelInfo + https://community.bistudio.com/wiki/unitReady - getModelInfo Object + unitReady Object - getModelInfo object + unitReady unitName - $Code$_modelInfo = getModelInfo player ;$/Code$ - - $Code$_modelInfo = getModelInfo cursorObject ;$/Code$ + $Code$_it = unitReady _soldierOne;$/Code$ undefined / undefined + (August 26, 2010) + Keep in mind that a) dead units are unitReady and b) that it takes a while until it get's known to group members that a unit is not alive anymore, which leads to c) the current leader of a group might be actually dead (until another group member takes command). + Why this is important? I'll give you an example: if you're using unitReady as a condition inside one of your fsm to advance whatever the fsm/group is doing, you really might wanna check that this unit is actually still alive. Otherwise you might end up with really fast and nasty loops in your fsm, eventually accompanied by a stream of radio commands that will last until finally a living leader is in command again.. and that could take a while... nasty, I tell you :) + + Regarding vehicles, there is only one single unit (from the vehicle crew) whose unitReady-status is affected by giving that vehicle (or that unit) commands. While it's the driver unit for a truck, it is the gunner unit for a mg-jeep or the commander for a tank. Generally it's always the unit "in control" of the vehicle. (because it's only that unit, that is seen as "full unit" to the "outside world". Only he can be adressed with commands.) + In consequence you can't just send vehicles around and check if they've arrived with something like: + waitUntil{(unitReady (driver _vehicle))}; // don't do this! + Because it's not guaranteed, that the driver is in command of the vehicle and only that unit will have it's unitReady status affected. + So in conclusion, if you need to check if a vehicle is ready, try something like this: _vehicleReady = { + private ["_veh", "_ready"]; + _veh = _this; + _ready = true; + { + if (!(isNull _x)) then + { + _ready = _ready && (unitReady _x); + }; + } forEach [ + (commander _veh), + (gunner _veh), + (driver _veh) + ]; + _ready + }; + + (November 21, 2015) + To check readiness of a vehicle, don't check it's crew, driver, gunner, commander, etc., but the vehicle itself, e.g.: + $Code$unitReady (vehicle driver _YourVehicle);$/Code$ + Only tested 11/21/2015 by me with A2 1.63.131129 and A3 1.52.132676 but possibly true since 1964. :P - Array + Boolean + - getMousePosition + playableUnits - Returns mouse position in UI coordinates. + Returns a list of playable units in a multiplayer game (occupied by both AI or players), created on the following sides east, west, resistance / independent and civilian only. Does not contain units of sideLogic. This does not include dead players awaiting for respawn. - https://community.bistudio.com/wiki/getMousePosition + https://community.bistudio.com/wiki/playableUnits - getMousePosition + playableUnits - getMousePosition + playableUnits - $Code$_pos = getMousePosition ;$/Code$ + $Code${_x groupChat "I'm a playable unit.";} forEach playableUnits ;$/Code$ + + $Code$// All playable units in a group: + _playableInGroup = units group player arrayIntersect playableUnits ;$/Code$ + + $Code$// All non-playable units in a group: + _playableInGroup = units group player - playableUnits ;$/Code$ undefined / undefined + (July 13, 2009) + In single-player missions, this command will return an empty array. + + (December 23, 2014) + To get a list of all player-controlled units: + $Code$_allPlayers = []; + { + if ( isPlayer _x) then + { + _allPlayers pushBack _x; + }; + } forEach playableUnits ;$/Code$ + + (April 15, 2015) + Quote: $Code$ Killswitch + In single-player missions, this command will return an empty array.$/Code$ + Use the switchableUnits command instead + + (August 16, 2015) + playableUnits will not return dead players, use allPlayers instead. + + (February 14, 2017) + Using the Editor (multiplayer attributes) for unchecking "enable AI", or disabling AI(s) in lobby, will make playableUnits as a public variable, updated by each JIP on disabled slot. So, if all slots are diabled AI, playableunits is same as allPlayers + Furthermore, in this case, non-played slot (playable and disabled AI) units simply don't exist! i.e. If you name 8 playable units: u1..to u8, then 2 players in game: u3 & u6 + playableUnits will return [u3,u6], and true for isNil "u1", isNil "u2"... until another player takes the slot. - Array + Array + - getNumber + enableUAVConnectability - Extract number from config entry. + Enables unit's AV terminal(s) connecting to UAV. - https://community.bistudio.com/wiki/getNumber + https://community.bistudio.com/wiki/enableUAVConnectability - getNumber Config + Object enableUAVConnectability Array - getNumber config + object enableUAVConnectability [uav, checkAllItems] - $Code$_value = getNumber ( configFile "CfgVehicles" "Thing" "maxSpeed");$/Code$ + $Code$unit enableUAVConnectability [uav,true];$/Code$ - undefined / undefined + undefined / local - (04:45, 3 March 2007 (CET)) - Use getNumber to get boolean values from a config file. 1 equals true, 0 equals false and if no value is found (when a valid variable is undefined) 0.67 is returned. - - (13 September 2011) - With an not existing entry, getNumber returns 0. - - (Mar 28, 2014) - (ArmA3 1.14), It's recommended to use BIS_fnc_getCfgData or BIS_fnc_returnConfigEntry to get variable cfg data rather than conditioning via isNumber, isText, isArray, getNumber, getText and getArray combination. - Traditional workaround: - $Code$ - _cfg = configFile "CfgVehicles" _SomeAddonClassName "DestructionEffects" "Smoke1" "type" - switch ( true ) do - { - case ( isNumber _cfg): { getNumber _cfg}; - case ( isText _cfg): { getText _cfg}; - case ( isArray _cfg): { getArray _cfg;}; - default {nil}; - }; - $/Code$ - Recommended workaround: - $Code$ - ( configFile "CfgVehicles" _SomeAddonClassName "DestructionEffects" "Smoke1" "type") call BIS_fnc_getCfgData ; - $/Code$ - To return default value once entry was not found, we can use BIS_fnc_returnConfigEntry instead of BIS_fnc_getCfgData. - $Code$ - [( configFile "CannonFire" "LightExp"),"lifeTime",0] call BIS_fnc_returnConfigEntry ;//0.5 - $/Code$ - To compose collected Number into Array, use BIS_fnc_getCfgDataArray instead. - $Code$ - ( configFile "CfgVehicles" _SomeAddonClassName "DestructionEffects" "Smoke1" "type") call BIS_fnc_getCfgDataArray ; - $/Code$ - To retype collected Number into Boolean, use BIS_fnc_getCfgDataBool. Anything bigger than 0 is true, otherwise false. - $Code$ - ( configFile "CfgVehicles" _SomeAddonClassName "DestructionEffects" "Smoke1" "type") call BIS_fnc_getCfgDataBool ; - $/Code$ - Number + Nothing + - getObjectArgument + endMission - Return name of object argument in mission editor. - i - Some Old Editor Command + Finish the mission. + The end type can be: + "CONTINUE" + "KILLED" + "LOSER" + "END1" + "END2" + "END3" + "END4" + "END5" + "END6" + Mission saves are deleted. Use failMission if they should not. + To maintain Arma 3 visual style, it's recommended to use BIS_fnc_endMission instead. - https://community.bistudio.com/wiki/getObjectArgument + https://community.bistudio.com/wiki/endMission - Control getObjectArgument Array + endMission String - map getObjectArgument [object, argument] + endMission endType - $Code$// returns string "[1009.0351, 1319.4928]" - ( findDisplay 128 displayCtrl 51) getObjectArgument ["_unit_1", "POSITION"] - // returns array [1009.0351, 1319.4928] - ( findDisplay 128 displayCtrl 51) evalObjectArgument ["_unit_1", "POSITION"]$/Code$ + $Code$endMission "END1";$/Code$ - undefined / undefined + local / local - String + Nothing + - getObjectChildren + markerDir - Return a list of all the children of the specified object. - i - Some Old Editor Command + Get marker direction. - https://community.bistudio.com/wiki/getObjectChildren + https://community.bistudio.com/wiki/markerDir - Control getObjectChildren String + markerDir String - map getObjectChildren object + markerDir markerName - + $Code$_mPos = markerDir "markerOne"$/Code$ + - undefined / undefined + global / undefined + (April 18, 2010) + The direction of the marker is the same as displayed in the editor, so it can both be negative, and be 360 degrees or greater. - Array + Number + - getObjectDLC + assignAsCargo - Returns appID of the DLC the object belongs to or nil if object is vanilla. + Assign a unit as cargo of a vehicle. Used together with orderGetIn to order a unit to get in as cargo into a specific vehicle. Before usage of this command a subordinate unit hasn't got the option to get into the cargo space of the vehicle. - https://community.bistudio.com/wiki/getObjectDLC + https://community.bistudio.com/wiki/assignAsCargo - getObjectDLC Object + Object assignAsCargo Object - getObjectDLC obj + unitName assignAsCargo vehicleName - $Code$_appID = getObjectDLC cursorTarget ; - if (! isNil "_appID") then { - hint format ["This object belongs to DLC with id: %1", _appID]; - } else { - hint "This object is vanilla"; - };$/Code$ + $Code$_soldier1 assignAsCargo _truck + [_soldier1] orderGetIn true$/Code$ - global / undefined + global / global - Number/Nothing + Nothing + - getObjectMaterials + setEffectCondition - Gets all custom materials associated with the object. + The statement is executed when the trigger or waypoint is activated and the effects are launched depending on the result. + If the result is a boolean and true, the effect is launched. + If the result is an object, the effect is launched if the result is the player or the player vehicle. + If the result is an array, the effect is launched if the result contains the player or the player vehicle. - https://community.bistudio.com/wiki/getObjectMaterials + https://community.bistudio.com/wiki/setEffectCondition - getObjectMaterials Object + Object setEffectCondition String + + Waypoint setEffectCondition String - getObjectMaterials obj + trigger setEffectCondition statement + + waypoint setEffectCondition statement - $Code$_materials = getObjectMaterials car;$/Code$ + $Code$_triggerObj setEffectCondition "thisList";$/Code$ - global / undefined + undefined / undefined - Array + Nothing - Nothing + - getObjectProxy + nearSupplies - Return the proxy object associated with the given editor object. - i - Some Old Editor Command + Find supplies (weapon holders, ammo crates, fuel feeds, other units) in the sphere with given radius. - https://community.bistudio.com/wiki/getObjectProxy + https://community.bistudio.com/wiki/nearSupplies - Control getObjectProxy String + Object/Array nearSupplies Number - map getObjectProxy object + origin nearSupplies radius - $Code$( findDisplay 128 displayCtrl 51) getObjectProxy "_unit_1" - // returns the object 'B 1-1-A:1 (Sean Johnson)'$/Code$ + $Code$_list = player nearSupplies 50;$/Code$ undefined / undefined - classWorks in BIS RTE only? - Object + Array + - getObjectTextures + firstBackpack - Gets all custom textures (hiddenSelectionsTextures) associated with the object. + Returns the first stored backpack. - https://community.bistudio.com/wiki/getObjectTextures + https://community.bistudio.com/wiki/firstBackpack - getObjectTextures Object + firstBackpack Object - getObjectTextures obj + firstBackpack box - $Code$_textures = getObjectTextures player ;$/Code$ + $Code$myVariable = firstBackpack myBox;$/Code$ - global / undefined + undefined / undefined - Array + Object + - getObjectType + configNull - Returns object type as a number: - 1 - Primary - Normal object placed in Visitor, part of landscape - 2 - Network - Road placed in Visitor, part of landscape - 4 - Temporary - Temporary object (like tracks) - 8 - TypeVehicle - Some entity added by game - 16 - TypeTempVehicle - Temporary entity - 32 - LandDecal - Land decal + A non-existing Config. + configNull == configNull ; // true + isNull configNull ; // true + configNull isEqualTo configNull ; // true - https://community.bistudio.com/wiki/getObjectType + https://community.bistudio.com/wiki/configNull - getObjectType Object + configNull - getObjectType object + configNull - $Code$_objType = getObjectType player ;$/Code$ + $Code$_config = missionNamespace getVariable ["myConfig", configNull ];$/Code$ - $Code$_objType = getObjectType cursorObject ;$/Code$ + $Code$str configNull ; // ""$/Code$ undefined / undefined @@ -29059,27 +30648,28 @@ - Number + Config + - getObjectViewDistance + getPlateNumber - Gets the values of rendering distances of objects and shadows. + Get the license plates from any vehicle which has plates configured. - https://community.bistudio.com/wiki/getObjectViewDistance + https://community.bistudio.com/wiki/getPlateNumber - getObjectViewDistance + getPlateNumber Object - getObjectViewDistance + getPlateNumber vehicle - $Code$_arr = getObjectViewDistance ;$/Code$ + $Code$getPlateNumber vehicle player$/Code$ undefined / undefined @@ -29087,783 +30677,989 @@ - Array + String + - getOxygenRemaining + moveInDriver - Returns amount of remaining oxygen. + Move soldier into vehicle driver position (Immediate, no animation). - https://community.bistudio.com/wiki/getOxygenRemaining + https://community.bistudio.com/wiki/moveInDriver - getOxygenRemaining Object + Object moveInDriver Object - getOxygenRemaining unit + unitName moveInDriver vehicle - $Code$_oxygen = getOxygenRemaining player;$/Code$ + $Code$_soldierOne moveInDriver _tankOne$/Code$ - undefined / undefined + local / global - (October 24, 2014) - Unit will die instantly at 0 oxygen unlike some other games that permit a certain amount of time after oxygen is depleted. + (August 4, 2006) + Notes from before the conversion: + MP Note Functions MoveInDriver can only be called for local soldiers. They will be ignored for remote soldiers. (see Locality in Multiplayer ) + + In OFP v1.96, the moveIn commands will not trigger an associated getIn event. To ensure the getIn event is fired, use the "getIn Driver" action command. - Number + Nothing + - getPersonUsedDLCs + setVehicleReportOwnPosition - Returns a list of all DLCs objects the unit is currently using. For example if a unit is inside a vehicle from DLC, it will return the code of that DLC. - This command is broken and doesnt work on dedicated server + Sets that the vehicle will share its own position via datalink to the Side center. - https://community.bistudio.com/wiki/getPersonUsedDLCs + https://community.bistudio.com/wiki/setVehicleReportOwnPosition - getPersonUsedDLCs Object + Object setVehicleReportOwnPosition Boolean - getPersonUsedDLCs unit + vehicle setVehicleReportOwnPosition report - $Code$_objects = getPersonUsedDLCs player ;$/Code$ + $Code$( vehicle player ) setVehicleReportOwnPosition true;$/Code$ - global / undefined + undefined / undefined - Array + Nothing + - getPilotCameraDirection + toFixed - Returns model space vector of the object airplane or helicopter pilotCamera. + Converts a number into a string, keeping the specified number of decimals. If the desired number of decimals is higher than the actual number, nulls are added to create the desired decimal length. This command is almost identical in behaviour to JavaScript toFixed() + NOTE: Converted number is never presented in scientific notation unlike with other number to string commands. Also Arma's default string conversion limits numbers to 6 significant figures, whereas with this command it is possible to preserve some extra precision. + $Code$ str ( pi /100000); //"3.14159e-005" - scientific notation + ( pi /100000) toFixed 10; //"0.0000314159" - no scientific notation + str pi ; //"3.14159" - 6 significant figures (default) + pi toFixed 6; //"3.141593" - forced to 7 significant figures + pi toFixed 7; //"3.1415927" - forced to 8 significant figures$/Code$ + Since Arma 3 v1.71.141859 an alternative syntax is added, which takes no number and returns Nothing. Instead it acts as keyword and switches engine Number to String global conversion into desired format, from the moment it is applied until the end of script. To reset output back to default at any time, use toFixed -1. For example: + $Code$ systemChat str position player ; + call + { + toFixed 6; + systemChat str position player ; + }; + systemChat str position player ; + toFixed -1; + systemChat str position player ;$/Code$ + The result is: + [11580.3,11797.7,0.00146675] + [11580.341797,11797.737305,0.001467] + [11580.341797,11797.737305,0.001467] + [11580.3,11797.7,0.00146675] + Ideal to be used when saving data to a database when more precise positioning is required. - https://community.bistudio.com/wiki/getPilotCameraDirection + https://community.bistudio.com/wiki/toFixed - getPilotCameraDirection Object + Number toFixed Number + + toFixed Number - getPilotCameraDirection object + number toFixed decimals + + toFixed decimals - $Code$_pilotCamVector = getPilotCameraDirection vehicle player$/Code$ + $Code$123 toFixed 2; //"123.00"$/Code$ + + $Code$2.34 toFixed 1; //"2.3" + 2.35 toFixed 1; //"2.4"$/Code$ + + $Code$// Convert position to string preserving position precision: + fn_posToString = + { + format [ + "[%1,%2,%3]", + _this select 0 toFixed 8, + _this select 1 toFixed 8, + _this select 2 toFixed 8 + ] + }; + str getPos player ; // "[3231.05,171.802,0.00143862]" + getPos player call fn_posToString; // "[3231.04882813,171.80192566,0.00143862]"$/Code$ + + $Code$// Same as Example 3 only using new alternative syntax: + str getPos player ; // "[3231.05,171.802,0.00143862]" + toFixed 8; + str getPos player ; // "[3231.04882813,171.80192566,0.00143862]"$/Code$ - local / undefined + undefined / undefined + (September 2, 2016) + parseNumber (3.56346 toFixed 4); //0.0026 ms (10000 cycles) + [3.5634,4] call BIS_fnc_cutDecimals ; //0.0111 ms (10000 cycles) - Array + String - Nothing + - getPilotCameraPosition + createCenter - Returns model space coordinates of the object airplane or helicopter pilotCamera. + In a nutshell, this command creates game Side. Without side it is not possible to create Groups. So if center for particular side is undefined, no groups can be created for this side. A Unit needs a group to be able to spawn in. So if no center for particular side exists, no groups for this side can be created and therefore no units for this side can be spawned. In Arma 3, the centers for all sides are created for you. An attempt to create center for existing side is ignored. Center can only be created for: east, west, resistance, civilian and sideLogic. These are the only sides groups can be created for. + Old description : Creates a new AI HQ for the given side. An 'HQ ' is something each side needs to have to be able to communicate. By default, all centers for units which are present in the mission are created before the mission is started. This command can be used to initialize a side which has no units present in the Mission.sqm, so that you can spawn groups and units for it. + For the available sides see Side. - https://community.bistudio.com/wiki/getPilotCameraPosition + https://community.bistudio.com/wiki/createCenter - getPilotCameraPosition Object + createCenter Side - getPilotCameraPosition object + createCenter side - $Code$_pilotCamPos = getPilotCameraPosition vehicle player$/Code$ + $Code$_SideHQ = createCenter east$/Code$ - global / undefined + undefined / global + (17:15, 22 June 2007 (CEST)) + You need to set the new sides friendly status using the setFriend command, once you have created your Center. Otherwise the newly created AI will not engage you, if you're on the opposing side. - Array + Side + - getPilotCameraRotation + min - Returns rotation (relative to the centered camera position) of the object airplane or helicopter pilotCamera. + The smaller of a,b - https://community.bistudio.com/wiki/getPilotCameraRotation + https://community.bistudio.com/wiki/min - getPilotCameraRotation Object + Number min Number - getPilotCameraRotation object + a min b - $Code$_pilotCamRot = getPilotCameraRotation vehicle player$/Code$ + $Code$3 min 2 + // Result is 2$/Code$ - local / undefined + undefined / undefined - Array + Number + - getPilotCameraTarget + rankId - Returns the target of the object airplane or helicopter pilotCamera tracking. + Return the rank of the given unit for comparison. + Value may be : + 0 - Private + 1 - Corporal + 2 - Sergeant + 3 - Lieutenant + 4 - Captain + 5 - Major + 6 - Colonel - https://community.bistudio.com/wiki/getPilotCameraTarget + https://community.bistudio.com/wiki/rankId - getPilotCameraTarget Object + rankId Object - getPilotCameraTarget object + rankId unit - $Code$_pilotCamTrack = ( getPilotCameraTarget vehicle player ) select 0; - _pilotCamTargetPos = ( getPilotCameraTarget vehicle player ) select 1; - _pilotCamTarget = ( getPilotCameraTarget vehicle player ) select 2;$/Code$ + $Code$_myIdRank = rankId player;$/Code$ - local / undefined + undefined / undefined - Array + Number + - getPlayerChannel + getVariable - Returns channel number for given player, provided that player is speaking, otherwise -1. Having mic on is not enough, player has to make a sound. There are several limitations to this command: - It does not work on dedicated server, the return is always -1, only client can detect other client talking. - It does not detect when someone talks on direct chat at all anywhere. - The client on which command is executed has to able to receive transmission before the transmission channel can be detected. For example if a player is not in the same group as a speaker and the speaker speaks on Group Channel, the player cannot hear the speaker and therefore cannot detect what channel the speaker is on. - In short, this command mimics the speaking icon from the UI. Correspondence between channel and number: - 0 = Global - 1 = Side - 2 = Command - 3 = Group - 4 = Vehicle - 5 = Direct (Is not detected by getPlayerChannel ) - 6-15 = Custom Radio (see radioChannelCreate ) + Return the value of variable in the variable space assigned to various data types. In case of Alt Syntax usage in Arma 3, the default value will be returned if: + Requested variable is either undefined or nil + Variable namespace is null ( objNull, grpNull, etc.) + All available data types combinations: + Namespace getVariable String + Namespace getVariable Array (since Arma 2 1.60) + Object getVariable String + Object getVariable Array + Group getVariable String + Group getVariable Array + Team_Member getVariable String + Team_Member getVariable Array + Task getVariable String + Task getVariable Array (Since Arma 3 v1.67) + Location getVariable String + Location getVariable Array (Since Arma 3 v1.67) + Control getVariable String (since Arma 3 v1.55.133553) + Control getVariable Array (since Arma 3 v1.55.133553) + Display getVariable String (since Arma 3 v1.55.133553) + Display getVariable Array (since Arma 3 v1.55.133553) + When variable is set on Task, it is not actually set on task itself, but on FSM attached to the task. So if there is no FSM getVariable will not work. - https://community.bistudio.com/wiki/getPlayerChannel + https://community.bistudio.com/wiki/getVariable - getPlayerChannel Object + Namespace/Object/Display/Control/Group/Location/Task/Team_Member getVariable String + + Namespace/Object/Display/Control/Group/Location/Task/Team_Member getVariable Array - getPlayerChannel player + varspace getVariable name + + varspace getVariable [name, defaultValue] - $Code$_channel = getPlayerChannel player ;$/Code$ + $Code$_thePublicVariable = _myTruck getVariable "myPublicVariable";$/Code$ + + $Code$_aLocalVariable = _myTruck getVariable ["myLocalVariable", ["Not set", _var]] select 1;$/Code$ + + $Code$for "_i" from 0 to 5 do { + _car = missionNamespace getVariable ("car" + str _i); + _car setDamage 0; + }; + // Sets damage of car0, car1,..., car5 to 0.$/Code$ + + $Code$myMissionVar = 2015; + missionNamespace getVariable "myMissionVar";//Returns 2015$/Code$ + + $Code$// WARNING when using dynamic default value: + missionNamespace getVariable ["var", 123 call fnc_abc]; + /// fnc_abc is always called even when var is defined$/Code$ + + $Code$// Get current value of a variable and if it is undefined, define it and get the defined value: + private _var = missionNamespace getVariable "varName"; + if ( isNil "_var") then + { + missionNamespace setVariable ["varName", 123]; + _var = 123; + }; + // _var here will contain current value of the variable varName$/Code$ global / undefined + (August 13, 2016) + NOTE: Arma 2 ONLY! In Arma 3 this will return default value. + Warning: the alternative syntax returns undefined when the varspace is an object and that object is null. Example: + $Code$_test = objNull getVariable ["test","0"]; + systemChat _test;$/Code$ + Errors because _test is undefined. Tested in A2OA 1.63.131129 + + (August 31, 2017) + You can do typechecking using param : + $Code$private _myVar = [player getVariable "myVar"] param [0,"",[""]];$/Code$ + and params : + $Code$[player getVariable "myVar"] params [["_myVar","",[""]]];$/Code$ - Number + Anything/Nothing - Anything + - getPlayerScores + modelToWorld - In MP: returns the unit's table of scores (infantry kills, soft vehicle kills, armor kills, air kills, deaths, total score). In SP: empty array [] + Translates relative position from object model space into world position. This command will take into account vectorUp of the object when calculating relative coordinates. For ASL version see modelToWorldWorld - https://community.bistudio.com/wiki/getPlayerScores + https://community.bistudio.com/wiki/modelToWorld - getPlayerScores Object + Object modelToWorld Array - getPlayerScores unitName + model modelToWorld position - $Code$getPlayerScores BIS_player1;$/Code$ + $Code$_aboveAndBehindPlayer = player modelToWorld [0,-1,3];$/Code$ undefined / undefined + (16 Feb, 2007) + The worldPos parameter appears to be a relative offset to the position of object, so it can often simply be [0,0,0]. + Example: to position an object _obj relative to the position of another object _RelObj with on offset of _Offset, try: + _Offset = [_x,_y,_z]; + _worldPos = _RelObj modelToWorld _Offset; + _obj setPos _worldPos; + + (16 Feb, 2007) + The object model space has got its Z-Axis along the object's vectorUp, its Y-Axis along the object's vectorDir, while its X-Axis goes along vectorDir x VectorUp (meaning as the X-Axis in a right-handed cartesian coordiante system ). + + (8 May, 2008) + If your object requires a new direction, ensure you call setDir prior to setPos when using modelToWorld. Calling setDir afterwards will skew its position otherwise. + _ladder setDir _angle; + _ladder setPos (_building modelToWorld [_x, _y, _z]); + + (6 Feb, 2011) + The z height returned changes dynamically with the height of waves beneath the object, if the object is located over sea. The z height returned by getPosATL and getPosASL does not change like this. This was tested by continuously retrieving the position of a static object, like the cross in the empty/corpses category, placed over sea or land. + modelToWorld behaves similar to + getPos _obj + but it does not give the same result, therefore + (_obj modelToWorld [0.0, 0.0, 0.0]) is not the same as (getPos _obj). - Array + Array + - getPlayerUID + remove3DENEventHandler - Return an uniqueID of the given unit as string if it's player and empty value if it's AI. The unique ID may be up to 100 characters long and may contain numbers, uppercase letters and underscores (the value can be used to construct a valid variable name by appending to another valid variable name). - Note: while for ArmA 2 or ArmA 2: Operation Arrowhead until version 1.60 the result always contains a number, it should be always handled as an opaque string. Converting it to a Number can cause precision problems, as Number cannot accurately represent integers above 16777216 (2^24). Moreover, game versions since ArmA 2: Operation Arrowhead 1.61 provide a non-numeric value as a result. + Removes Eden Editor event handler of given type and ID. + See the list of all Eden Editor Event Handlers. - https://community.bistudio.com/wiki/getPlayerUID + https://community.bistudio.com/wiki/remove3DENEventHandler - getPlayerUID Object + remove3DENEventHandler Array - getPlayerUID unit + remove3DENEventHandler [type,id] - $Code$_uid = getPlayerUID player ;$/Code$ + $Code$eh = add3DENEventHandler ["onUndo",{ systemChat "Zip..."}]; + remove3DENEventHandler ["onUndo",eh];$/Code$ undefined / undefined - (April 17, 2014) - In Arma 3 the returned string is the steamID64 of the player. $Code$ _steamProfileUrl = "http://steamcommunity.com/profiles/" + ( getPlayerUID player );$/Code$ - String + Nothing + - getPosASLVisual + ropeCut - Returns an object's rendered 3D position ASL (z value above sea level) in render time scope. Alias of visiblePositionASL. + Cut rope and detach rope from vehicle - https://community.bistudio.com/wiki/getPosASLVisual + https://community.bistudio.com/wiki/ropeCut - getPosASLVisual Object + ropeCut Array - getPosASLVisual object + ropeCut [rope, distance] - $Code$_playerRenderedPosASL = getPosASLVisual player ;$/Code$ + $Code$ropeCut [ ropes heli1 select 0, 5];$/Code$ - global / undefined + undefined / undefined - Array + Nothing + - getPosASLW + curatorCoef - Returns the object position height above sea surface (waves included). + Returns current coeficient setting. - https://community.bistudio.com/wiki/getPosASLW + https://community.bistudio.com/wiki/curatorCoef - getPosASLW Object + Object curatorCoef String - getPosASLW obj + curatorObj curatorCoef action - $Code$_pos = getPosASLW _diver;$/Code$ + $Code$curatorModule curatorCoef "Place"$/Code$ - global / undefined + undefined / undefined - Array + Number + - getPosASL + curatorEditingArea - Returns the object position height above sea level. + Returns all curator editing areas. - https://community.bistudio.com/wiki/getPosASL + https://community.bistudio.com/wiki/curatorEditingArea - getPosASL Object + curatorEditingArea Object - getPosASL object + curatorEditingArea curatorObj - $Code$_AslPos = getPosASL player ;$/Code$ - - $Code$hint format ["position above sea level: %1", ( getPosASL player ) select 2];$/Code$ + $Code$_editingArea = curatorEditingArea myCurator;$/Code$ - global / undefined + undefined / undefined - (23 Feb, 2007) - $Code$ getPosASL _obj select 2;$/Code$ - might sometimes return the vertical position above sea level, but over land for stacked objects, it returns the vertical position above the object beneath it or at least affected by this offset. The same problem exists for getPos. There was a discussion thread in the BIS forums which suggested the use of the command modelToWorld instead to get around this issue where an absolute vertical position is required. ArmA Ver 1.02. - - (27 Mar, 2014) - According to Code Optimisation, this function is the fastest (2x) and should be used instead of getPos, getPosATL and position. - Conversion keep this speed ratio and is structured like: $Code$ ASLtoATL getPosASL Object ;$/Code$ - Array + Array + - getPosATLVisual + findEmptyPosition - Returns an object's rendered 3D position ATL (z value above ground) in render time scope. + Searches for an empty position around specified position. The search starts looking for an empty position at a minimum distance of [minDistance] from the [center] and looks as far away as [maxDistance]. If a [vehicleType] parameter is specified, then the search will look for an empty positions that is big enough to hold that vehicle type. If an empty position isn't found, an empty array is returned. + This command ignores moving objects present within search area. - https://community.bistudio.com/wiki/getPosATLVisual + https://community.bistudio.com/wiki/findEmptyPosition - getPosATLVisual Object + Array findEmptyPosition Array - getPosATLVisual object + center findEmptyPosition [minDistance, maxDistance, vehicleType] - $Code$_playerRenderedPosATL = getPosATLVisual player ;$/Code$ + $Code$_position = ( getPosATL player ) findEmptyPosition [0,100];$/Code$ + + $Code$_position = _center findEmptyPosition [10,100,"UH60M_EP1"];$/Code$ + + $Code$// Check if exact position is empty: + _position = _center findEmptyPosition [0,0,"B_Boat_Armed_01_minigun_F"];$/Code$ - global / undefined + undefined / undefined + (November 6, 2013) + Keep search radius short and sweet, under 50 metres maybe. Searching big area takes long time and will result in your game stop responding until the search is over. isFlatEmpty is probably more suitable for a larger area search. + + (March 6, 2012) + I think the radius parameter should be treated as a 'minimum distance' from the centre position. I found that the parameter name radius wasn't very clear. Also, if radius is greater than max distance then the function will always return an empty array. + Here is an snippet of code I use to find a safe landing zone for an extraction helicopter. It may be useful for someone. + $Code$_centre = [ getMarkerPos "marker", random 150, random 360 ] call BIS_fnc_relPos; + _extraction_point = []; + _max_distance = 100; + while{ count _extraction_point 1 } do + { + _extraction_point = _centre findEmptyPosition[ 30, _max_distance, "UH60M_EP1" ]; + _max_distance = _max_distance + 50; + }; + $/Code$ + In the above example, make sure that "_max_distance" is greater than 30, otherwise the while loop will go forever. - Array + Array + - getPosATL + removeUniform - Returns the position of an object relative to the terrain. + Removes uniform from unit. - https://community.bistudio.com/wiki/getPosATL + https://community.bistudio.com/wiki/removeUniform - getPosATL Object + removeUniform Object - getPosATL object + removeUniform unit - $Code$_objPosition = getPosATL player$/Code$ + $Code$removeUniform player ;$/Code$ - global / undefined + global / global - (December 18, 2015) - If one desires to retrieve an object from an array of object, be sure to wrap your array information in parenthesis. e.g. getPosATL ( myArray select 0 ) ; - Array + Nothing + - getPosVisual + remoteControl - Returns an object's rendered 3D position (z value above sea when over sea, or above ground when over land) in render time scope. Alias of visiblePosition. + Switches on remote control of the unit. Command needs to be executed locally to the player. If driver is remote it will get transferred to players PC. - https://community.bistudio.com/wiki/getPosVisual + https://community.bistudio.com/wiki/remoteControl - getPosVisual Object + Object remoteControl Object - getPosVisual object + who remoteControl whom - $Code$_playerRenderedPos = getPosVisual player ;$/Code$ + $Code$// Set player remote control of driver: + player remoteControl driver UAV; + driver UAV switchCamera "Internal"; //switchCamera required + //sometimes switchCamera is not needed + player remoteControl driver UAV;$/Code$ + + $Code$// Return control to player: + objNull remoteControl driver UAV;$/Code$ - global / undefined + local / global + You must use switchCamera in order to remote control the unit and. + You can only remoteControl characters, e.g. if yo want to remote control a car, you have + to add a driver and use + "player remoteControl driver someVehicle". + + (Jan 25, 2010) + Arma 1.05 : + You can remoteControl multiple units at the same time. + It is not needed to switchCamera to the unit to be able to control it - it is needed to be able to fire with. + The switchCamera is fixed : the player can't change internal/external/optics view. + Do not think about it like a selectPlayer : it is used to give the control to the vehicle role the unit is in. + SwitchCamera to the vehicle the unit is in ; the camera will go depending the role you are remoteControlling. + The AI driver won't follow your vehicle move orders. + If the player dies, the death screen will appear, not automatically turning back to the player. + If you want to stop the remote control, use objNull as remote controller. + Example : + player remoteControl driver jeep1; // will remoteControl it, you still will have full control of the player + jeep1 switchCamera "internal"; // fix the camera to the ''vehicle'' and not to (driver jeep1) ! + waitUntil { !(alive jeep1) || !(alive player) }; + objNull remoteControl driver jeep1; // removes the remoteControlling + player switchCamera "internal"; // returns to the player - Array + Nothing + - getPosWorld + configClasses - Returns PositionWorld, which is PositionASL of the model centre [0,0,0] of an object, rather than transformed boundingCenter or LandContact vertices. + Returns an array of config entries which meet criteria in condition code. Command iterates through all available config sub classes of the given config class. Current looked at config is stored in _x variable (similar to alternative count command implementation). Condition has to return true in order for the looked at config to be added to the resulting array. Slightly faster than configProperties, but doesn't account for config properties or inherited entries. + The condition code passed to configClasses should only be used for simple filter expressions and nothing more - https://community.bistudio.com/wiki/getPosWorld + https://community.bistudio.com/wiki/configClasses - getPosWorld Object + String configClasses Config - getPosWorld object + condition configClasses config - $Code$_obj setPosWorld getPosWorld _obj;$/Code$ + $Code$// collect all CfgVehicles configs: + _configs = " true " configClasses ( configFile "CfgVehicles");$/Code$ - $Code$ATLToASL (_groundObj modelToWorld [0,0,0]) isEqualTo getPosWorld _groundObj; //true$/Code$ + $Code$// Return all classes that can transport 10 and more soldiers: + _transporters = " getNumber (_x 'transportSoldier') = 10" configClasses ( configFile "CfgVehicles");$/Code$ - $Code$// Wave height under a boat: - _h = ((boat modelToWorld [0,0,0]) vectorDiff getPosWorld boat) select 2;$/Code$ + $Code$// Return all classes that inherit from 'RscText': + hint str (" inheritsFrom _x == ( configFile 'RscText')" configClasses configFile );$/Code$ - global / undefined + undefined / undefined + (oct 19, 2014) + A fantastic way to filter stuff. eg; Create an array of west vehicles and spawn then in front of the player in rows of 5 + $Code$ + private ["_cfgArray","_xPos","_yPos","_veh"]; + _cfgArray = "( + (getNumber (_x 'scope') = 2) && + {getNumber (_x 'side') == 1 && + {getText (_x 'vehicleClass') in ['Armored', 'Car', 'Air'] + } + } + )" configClasses (configFile "CfgVehicles"); + _xPos = 0; + _yPos = 0; + { + _yPos = _yPos + 20; + _veh = createVehicle [ ( configName _x ), player modelToWorld [_xPos, _yPos, 0], [], 0, "None"]; + if (_yPos = 100) then { + _yPos = 0; + _xPos = _xPos + 20; + }; + } forEach _cfgArray; + $/Code$ + + (May 28, 2016) + configClasses does not account for inherited subclasses, use configProperties with isClass filter instead + $Code$ configProperties [_config, " isClass _x", true ];$/Code$ + + (May 28, 2017) + this will get a list of ALL locations on the currently loaded world + $Code$( "true" configClasses ( configFile "CfgWorlds" worldName "names" ) ) apply { + // change each config entry into a location + nearestLocation [ + getArray ( _x "position" ), + getText ( _x "type" ) + ] + };$/Code$ - Array + Array + - getPos + isStaminaEnabled - Returns the object position in format PositionAGLS. Z value is height over the surface underneath. - Since Arma 3 v1.55.133361, an alternative syntax is added that allows to get position given distance and heading away from original object or position, the equivalent of BIS_fnc_relPos + Check if stamina depletion is enabled - https://community.bistudio.com/wiki/getPos + https://community.bistudio.com/wiki/isStaminaEnabled - getPos Object/Location - - Object/Position2D/Position3D getPos Array + isStaminaEnabled Object - getPos object - - origin getPos [distance, heading] + isStaminaEnabled unit - $Code$hintSilent str getPos player ;$/Code$ - - $Code$// getPos vs. other methods (over sea) - diag_log getPos ship; // [2412.01, 6036.33, -0.839965] - diag_log getPosATL ship; // [2412.01, 6036.33, 19.4266] - diag_log getPosASL ship; // [2412.01, 6036.33, -0.920066] - diag_log getPosASLW ship; // [2412.01, 6036.33, -0.865981] - diag_log visiblePosition ship; // [2412.02, 6036.33, -0.837952] - diag_log visiblePositionASL ship; // [2412.02, 6036.33, -0.91798] - diag_log position ship; // [2412.01, 6036.33, -0.839965]$/Code$ - - $Code$// getPos vs. other methods (over land) - diag_log getPos car; // [2508.64, 5681.47, 0.0609589] - diag_log getPosATL car; // [2508.64, 5681.47, 0.0356369] - diag_log getPosASL car; // [2508.64, 5681.47, 71.718] - diag_log getPosASLW car; // [2508.64, 5681.47, 71.718] - diag_log visiblePosition car; // [2508.64, 5681.47, 0.0609512] - diag_log visiblePositionASL car; // [2508.64, 5681.47, 71.718] - diag_log position car; // [2508.64, 5681.47, 0.0609589]$/Code$ - - $Code$// Find position 100 metres and 45 degrees from player position: - player getPos [100,45];$/Code$ + $Code$isStaminaEnabled player;$/Code$ global / undefined - (16 Feb, 2007) - getPos obj select 2 - might return the vertical position above ground level, but for a stacked object, it returns the vertical position above the object beneath it. The same problem exists for getPosASL. There was a discussion thread in the BIS forums which suggested the use of the command modelToWorld instead to get around this issue where an absolute vertical position is required. ArmA Ver 1.02. - - (6 Feb, 2011) - The z height returned changes dynamically with the height of waves beneath the object, if the object is located over sea. The z height returned by getPosATL and getPosASL does not change like this. This was tested by continuously retrieving the position of a static object, like the cross in the empty/corpses category, placed over sea or land. - getPos behaves similar to - _obj modelToWorld [0.0, 0.0, 0.0] - but it does not give the same result, therefore - (_obj modelToWorld [0.0, 0.0, 0.0]) is not the same as (getPos _obj). - - (23 Nov, 2011) - You can use getPos and setPos on triggers. - Array - Array + Boolean + - getPylonMagazines + tvPicture - Return array of magazines on pylons + Returns name of picture from item pointed to by path. IDC means id of parent Tree View. - https://community.bistudio.com/wiki/getPylonMagazines + https://community.bistudio.com/wiki/tvPicture - getPylonMagazines Object + tvPicture Array + + Control tvPicture Array - getPylonMagazines vehicle + tvPicture [idc, [path]] + + _ctrl tvPicture [path] - $Code$getPylonMagazines ( vehicle player )$/Code$ + $Code$tvPicture [101, [0]];$/Code$ + + $Code$_ctrl tvPicture [0,0,0];$/Code$ - undefined / undefined + local / local - (May 12, 2017) - The indexes of the returned array's elements are relative to the pylon IDs, such that element 0 is pylon 1, element 1 is pylon 2, etc. + (Sep 11 2014) + (A3 1.28)tv command family overview + $Code$ + //tv command family available for CT_TREE (type 12) + private ["_count","_current","_data","_text","_value","_pic"]; + _CT_TREE tvAdd [ [],"Parent_A"]; + _CT_TREE tvAdd [ [0],"Child_A"]; + _CT_TREE tvAdd [ [0,0],"Grandchild_A"]; + _CT_TREE tvAdd [ [],"Parent_B"]; + _CT_TREE tvAdd [ [1],"Child_B"]; + _count = _CT_TREE tvCount []; //return 2 + _CT_TREE tvSetCurSel [0,0,0]; //select grandchild_A + _current = tvCurSel _CT_TREE; //return [0,0,0] + _CT_TREE tvSetData [_current,"I'm grandchild_A"]; + _data = _CT_TREE tvData _current; // "I'm grandchild_A" + _text = _CT_TREE tvText _current; //"Grandchild_A" + _CT_TREE tvSetValue [_current,14]; + _value = _CT_TREE tvValue _current; // 14 + _CT_TREE tvSetPicture [_current, getText ( configFile "CfgWeapons" "optic_NVS" "picture")]; + _pic = _CT_TREE tvPicture _current; + _CT_TREE tvExpand [1]; + _CT_TREE tvSort [[], false ]; + _CT_TREE tvSortByValue [[], false ]; + _CT_TREE tvDelete [0,0]; //remove child_b + tvClear 12; + _CT_TREE tvCollapse []; + $/Code$ - Array + String - String + - getRelDir + setDropInterval - Returns direction, which is relative to object's current direction, from given object to another object or position in the range from 0 to 360, the equivalent of BIS_fnc_relativeDirTo. + Set interval of emitting particles from particle source. In Arma 3 hardcoded limit of how many particles can exist at the same time is 18000. Correspondence between CfgCloudlets class param name and command param: + $Code$particleSource setDropInterval interval;$/Code$ - https://community.bistudio.com/wiki/getRelDir + https://community.bistudio.com/wiki/setDropInterval - Object getRelDir Object/Position2D/Position3D + Object setDropInterval Number - object getRelDir position + particleSource setDropInterval interval - $Code$_reldir = player getRelDir tank;$/Code$ + $Code$_source setDropInterval 0.05;$/Code$ - global / undefined + undefined / undefined - Number + Nothing + - getRelPos + get3DENActionState - Returns position, which is given distance and relative direction away from original object. + Returns state of given action in the Eden Editor. + See the list of all actions. - https://community.bistudio.com/wiki/getRelPos + https://community.bistudio.com/wiki/get3DENActionState - Object getRelPos Array + get3DENActionState String - object getRelPos [distance, direction] + get3DENActionState action - $Code$// Find position 100 metres away at player's 3 o'clock: - _relpos = player getRelPos [100, 90];$/Code$ + $Code$if ( get3DENActionState "ToggleMap" == 1) then { systemChat "Editor map is open!"};$/Code$ - global / undefined + undefined / undefined - getPos vs getRelPos: getRelPos operates similarly to getPos except in getRelPos the direction is calculated 'relative' to the current object direction whereas getPos's direction is from North. Thus while getPos can take a position array as it's starting point, getRelPos requires an object with its own azithmus heading. - - (3 March, 2016) - Array + Number + - getRemoteSensorsDisabled + selectDiarySubject - Get status of disabled raycasts for remote entities. See disableRemoteSensors for detailed description. + Select the subject page in a log. - https://community.bistudio.com/wiki/getRemoteSensorsDisabled + https://community.bistudio.com/wiki/selectDiarySubject - getRemoteSensorsDisabled + Object selectDiarySubject String - getRemoteSensorsDisabled + person selectDiarySubject subject - $Code$_status = getRemoteSensorsDisabled ;$/Code$ - + undefined / undefined - Boolean + Nothing + - getRepairCargo + openMap - Returns the amount of repair resources from empty (0) to full (1) in the cargo space of a repair vehicle. + Shows in-game map. If forced, cannot be closed. - https://community.bistudio.com/wiki/getRepairCargo + https://community.bistudio.com/wiki/openMap - getRepairCargo Object + openMap Boolean + + openMap Array - getRepairCargo vehicle + openMap show + + openMap [show, forced] - $Code$value = getRepairCargo vehicleName;$/Code$ + $Code$openMap true ;$/Code$ + + $Code$openMap [ true, true ];$/Code$ - global / undefined + undefined / local - (December 22, 2014) - If the vehicle is not alive, it always returns Nothing, which you should check for using isNil. - If the vehicle is unable to carry that type of cargo, it returns -1.#IND, which you should check for using finite. - Number + Boolean - Boolean + - getResolution + setPilotCameraTarget - Returns an array containing all information about resolution. - The returned Array is as follow: [width, height, 2D viewport width, 2D viewport height, aspect ratio, UI scale] - Note: aspect ratio and UI scale are returned as coefficients and not 16:9 for example. + Sets an area or target to be tracked by the object airplane or helicopter pilotCamera. + To track an object the vehicle has to have appropriate sensors ( scanners ) that can detect the given target type. + Using objNull will unlock the camera - https://community.bistudio.com/wiki/getResolution + https://community.bistudio.com/wiki/setPilotCameraTarget - getResolution + Object setPilotCameraTarget Object/Array - getResolution + object setPilotCameraTarget target - $Code$_res = getResolution ; //some single monitor setup[ - 1360,//width - 768,//height - 867,//2D viewport width - 653,//2D viewport height - 1.77778,//aspect ratio - 0.85//UI scale - ]$/Code$ - - $Code$_res = getResolution ; //dedicated server[ - 160,//width - 120,//height - 136,//2D viewport width - 102,//2D viewport height - 1.33333,//aspect ratio - 0.85//UI scale - ]$/Code$ + $Code$_pilotCamTrack = vehicle player setPilotCameraTarget [2100,4200,4.2];$/Code$ - $Code$_res = getResolution ; //some triple monitor setup[ - 5760,//width - 1080,//height - 792,//2D viewport width - 594,//2D viewport height - 5.33333,//aspect ratio - 0.55//UI scale - ]$/Code$ + $Code$_pilotCamTrack = vehicle player setPilotCameraTarget BIS_Edita;$/Code$ - undefined / undefined + local / undefined - (05:38, 20 December 2010) - This command can be usefull to play a video (see this function BIS_fnc_playVideo ) in the given format if you've compiled it for different UI scale. - Array + Boolean + - getShadowDistance + selectMin - Gets the shadows rendering distance. + Returns the array element with minimum numerical value. Engine solution to BIS_fnc_lowestNum and BIS_fnc_findExtreme. Therefore it is expected that supplied array consists of Numbers only. Booleans however are also supported and will be evaluated as Numbers : true - 1, false - 0. nil value treated as 0. Other non Number elements (not recommended) will be evaluated as 0 and Bad conversion: scalar message will be logged into. rpt. - https://community.bistudio.com/wiki/getShadowDistance + https://community.bistudio.com/wiki/selectMin - getShadowDistance + selectMin Array - getShadowDistance + selectMin array - $Code$_value = getShadowDistance;$/Code$ + $Code$_min = selectMin [1,2,3,4,5]; //1$/Code$ + + $Code$// Same as, for example: + _min = _a min _b min _c min _d; + // Only faster: + _min = selectMin [_a,_b,_c,_d];$/Code$ undefined / undefined @@ -29871,120 +31667,127 @@ - Number + Anything + - getShotParents + setWaypointVisible - Returns shot information Array for the given projectile in format [vehicle, instigator], where vehicle is the vehicle the shot was fired from, and the instigator is the person who pulled the trigger. If shot was fired by a soldier on foot or in FFV position in vehicle, the soldier is returned for the vehicle. + Sets the visibility of the waypoint. - https://community.bistudio.com/wiki/getShotParents + https://community.bistudio.com/wiki/setWaypointVisible - getShotParents Object + Array setWaypointVisible Boolean - getShotParents projectile + waypoint setWaypointVisible visible - $Code$_shotParents = getShotParents myProjectile;$/Code$ + $Code$[grp, 2] setWaypointVisible false ;$/Code$ - $Code$tank addEventHandler ["Fired", { systemChat str getShotParents (_this select 6)}];$/Code$ + $Code$[ group player, currentWaypoint ( group player )] setWaypointVisible false ;$/Code$ - undefined / undefined + undefined / global + (September 23, 2015) + This does not apply to Zeus/Curator view... so this command won't hide the Waypoint lines and icons from your view as a Zeus when units are in your EditableAddons list. - Array + Nothing + - getSlingLoad + addPrimaryWeaponItem - Return object which is sling loaded by vehicle + Adds weapon item to the weapon cargo space. This is used for infantry weapons. + As of Arma 3 DEV 1.37, this command also supports weapon magazines. - https://community.bistudio.com/wiki/getSlingLoad + https://community.bistudio.com/wiki/addPrimaryWeaponItem - getSlingLoad Object + Object addPrimaryWeaponItem String - getSlingLoad vehicle + unit addPrimaryWeaponItem item - $Code$_cargo = getSlingLoad heli1;$/Code$ + $Code$player addPrimaryWeaponItem "muzzle_snds_H";$/Code$ - undefined / undefined + local / global - (05 April, 2014) - Returns objNull when nothing is sling loaded. + (June 22, 2014) + If the item being added is not supported by the unit's weapon then the command will simply fail silently. The item is also not added to the unit's inventory in such a case. - Object + Nothing + - getSpeed + face - Get the speed for the given speed mode. - SpeedMode can be: - "AUTO" - "SLOW" - "NORMAL" - "FAST" + Returns the face of a person. - https://community.bistudio.com/wiki/getSpeed + https://community.bistudio.com/wiki/face - Object getSpeed String + face Object - object getSpeed speedMode + face person - $Code$_spd = player getSpeed "FAST";$/Code$ + $Code$face player$/Code$ - global / undefined + undefined / undefined - Number + String + - getStamina + diag_captureFrame - Get current stamina (~ seconds until depletion) + This command starts counting frames from the moment it is executed and when the count reaches the number passed as param, the current frame is captured and captured data UI dialog appears, similar to diag_captureSlowFrame. + This can also be executed on a dedicated Server and because a Server has no UI it will behave like diag_captureFrameToFile. + Special: BattlEye's RCON variant of this command is #captureFrame + Note : Only available in specific builds. See Performance Profiling for details. - https://community.bistudio.com/wiki/getStamina + https://community.bistudio.com/wiki/diag_captureFrame - getStamina Object + diag_captureFrame Number - getStamina unit + diag_captureFrame frame - $Code$getStamina player;$/Code$ + $Code$diag_captureFrame 1; //capture the first frame after command execution$/Code$ + + $Code$diag_captureFrame 24; //capture 24th frame after command execution$/Code$ undefined / undefined @@ -29992,27 +31795,28 @@ - Number + Nothing + - getStatValue + ctrlFade - Returns value of the given stat. + Returns the current fade factor of control. - https://community.bistudio.com/wiki/getStatValue + https://community.bistudio.com/wiki/ctrlFade - getStatValue String + ctrlFade Control - getStatValue name + ctrlFade controlName - $Code$getStatValue "ExpWarlockDown"; //Checks if the "Warlock Down" Achivement was already aquired$/Code$ + $Code$_scale = ctrlFade _control$/Code$ undefined / undefined @@ -30020,152 +31824,115 @@ - Number + Number + - getSuppression + ctRemoveHeaders - Gets the suppression value of given unit. Returns SCALAR between 0 and 1. Suppression is not calculated for player entities. + Takes array of header indices as a parameter and removes headers with those indices. Indices of remaining headers will be recomputed. - https://community.bistudio.com/wiki/getSuppression + https://community.bistudio.com/wiki/ctRemoveHeaders - getSuppression Object + Control ctRemoveHeaders Array - getSuppression unit + ctrl ctRemoveHeaders indices - $Code$getSuppression AI_unit_1;$/Code$ + $Code$_control ctRemoveHeaders [0, 1, 2];$/Code$ - local / undefined + local / local - Number + Nothing + - getTerrainHeightASL + ctrlMapScale - Returns the terrain height above the sea for the given position. + Returns the current scale of given map control. - https://community.bistudio.com/wiki/getTerrainHeightASL + https://community.bistudio.com/wiki/ctrlMapScale - getTerrainHeightASL Position2D/Position3D + ctrlMapScale Control - getTerrainHeightASL position + ctrlMapScale ctrl - $Code$_height = getTerrainHeightASL ( position player );$/Code$ - - $Code$_height = getTerrainHeightASL [5213,3245];$/Code$ - - $Code$_seadepth = abs ( getTerrainHeightASL getPos player ); // sea depth at players position;$/Code$ + $Code$_control = ( findDisplay 12) displayCtrl 51; //Arma 3 + _scale = ctrlMapScale _control; //returns number from 1 to 0.001$/Code$ undefined / undefined - (June 6, 2017) - This command can usefully return the depth of water at the given position when in water. Note that the number it returns is the depth, albiet expressed as a negative number. Use abs to always return a positive number. See example 3 - Number + Number + - getText + agent - Extract text from config entry. + Return a person for a given agent. - https://community.bistudio.com/wiki/getText + https://community.bistudio.com/wiki/agent - getText Config + agent Team_Member - getText config + agent teamMember - $Code$_text = getText ( configFile "CfgVehicles" "Thing" "icon");$/Code$ - + undefined / undefined - (Mar 28, 2014) - (ArmA3 1.14) It's recommended to use BIS_fnc_GetCfgData or BIS_fnc_returnConfigEntry to get variable cfg data rather than conditioning via isNumber, isText, isArray, getNumber, getText and getArray combination. - Traditional workaround: - $Code$ - _cfg = configFile "CfgVehicles" _SomeAddonClassName "DestructionEffects" "Smoke1" "type" - switch ( true ) do - { - case ( isNumber _cfg): { getNumber _cfg}; - case ( isText _cfg): { getText _cfg}; - case ( isArray _cfg): { getArray _cfg;}; - default { nil }; - }; - $/Code$ - Recommended workaround: - $Code$ - ( configFile "CfgVehicles" _SomeAddonClassName "DestructionEffects" "Smoke1" "type") call BIS_fnc_GetCfgData ; - $/Code$ - To return default value once entry was not found, we can use BIS_fnc_returnConfigEntry instead of BIS_fnc_GetCfgData. e.g. - $Code$ - [( configFile "CannonFire" "LightExp"),"lifeTime",0] call BIS_fnc_returnConfigEntry ;//0.5 - $/Code$ - To compose collected String into Array, use BIS_fnc_getCfgDataArray instead. E.g. - $Code$ - ( configFile "CfgVehicles" _SomeAddonClassName "DestructionEffects" "Smoke1" "type") call BIS_fnc_getCfgDataArray ; - $/Code$ - String + Object + - getUnitLoadout + safeZoneWAbs - Returns an array with all assigned items, weapons, containers and their stored items. - Detailed explanation of the returned array: Talk:getUnitLoadout - This command is not final and might be changed in a near future. + Returns SafeZone width (of all monitors, in case there's more than one) - https://community.bistudio.com/wiki/getUnitLoadout + https://community.bistudio.com/wiki/safeZoneWAbs - getUnitLoadout Object - - getUnitLoadout String/Config + safeZoneWAbs - getUnitLoadout unit - - getUnitLoadout class + safeZoneWAbs - $Code$getUnitLoadout player ;$/Code$ - - $Code$getUnitLoadout "B_Soldier_F";$/Code$ - - $Code$getUnitLoadout ( configFile "CfgVehicles" "B_Soldier_F");$/Code$ + $Code$_szW = safeZoneWAbs;$/Code$ undefined / undefined @@ -30173,238 +31940,179 @@ - Array - Array + Number + - getUnitTrait + deActivateKey - Gets the current value of a trait of the given unit. - Default traits are: - audibleCoef (scalar) - camouflageCoef (scalar) - engineer (bool) - explosiveSpecialist (bool) - loadCoef (scalar) - medic (bool) - UAVHacker (bool) + Deactivates the given keyname for the current user profile. The keys are used to unlock missions or campaigns. + See keys, keysLimit and doneKeys in the description.ext file of the missions. - https://community.bistudio.com/wiki/getUnitTrait + https://community.bistudio.com/wiki/deActivateKey - Object getUnitTrait String + deActivateKey String - unit getUnitTrait skill_name + deActivateKey keyname - $Code$player getUnitTrait "Medic";$/Code$ + $Code$deActivateKey "Mission04Key"$/Code$ - global / undefined + undefined / undefined - Boolean/Number + Nothing + - getVariable + flagSide - Return the value of variable in the variable space assigned to various data types. In case of Alt Syntax usage in Arma 3, the default value will be returned if: - Requested variable is either undefined or nil - Variable namespace is null ( objNull, grpNull, etc.) - All available data types combinations: - Namespace getVariable String - Namespace getVariable Array (since Arma 2 1.60) - Object getVariable String - Object getVariable Array - Group getVariable String - Group getVariable Array - Team_Member getVariable String - Team_Member getVariable Array - Task getVariable String - Task getVariable Array (Since Arma 3 v1.67) - Location getVariable String - Location getVariable Array (Since Arma 3 v1.67) - Control getVariable String (since Arma 3 v1.55.133553) - Control getVariable Array (since Arma 3 v1.55.133553) - Display getVariable String (since Arma 3 v1.55.133553) - Display getVariable Array (since Arma 3 v1.55.133553) - When variable is set on Task, it is not actually set on task itself, but on FSM attached to the task. So if there is no FSM getVariable will not work. + Returns Side of the local instance of the flag. A getter for setFlagSide. - https://community.bistudio.com/wiki/getVariable + https://community.bistudio.com/wiki/flagSide - Namespace/Object/Display/Control/Group/Location/Task/Team_Member getVariable String - - Namespace/Object/Display/Control/Group/Location/Task/Team_Member getVariable Array + flagSide Object - varspace getVariable name - - varspace getVariable [name, defaultValue] + flagSide flag - $Code$_thePublicVariable = _myTruck getVariable "myPublicVariable";$/Code$ - - $Code$_aLocalVariable = _myTruck getVariable ["myLocalVariable", ["Not set", _var]] select 1;$/Code$ - - $Code$for "_i" from 0 to 5 do { - _car = missionNamespace getVariable ("car" + str _i); - _car setDamage 0; - }; - // Sets damage of car0, car1,..., car5 to 0.$/Code$ - - $Code$myMissionVar = 2015; - missionNamespace getVariable "myMissionVar";//Returns 2015$/Code$ - - $Code$// WARNING when using dynamic default value: - missionNamespace getVariable ["var", 123 call fnc_abc]; - /// fnc_abc is always called even when var is defined$/Code$ - - $Code$// Get current value of a variable and if it is undefined, define it and get the defined value: - private _var = missionNamespace getVariable "varName"; - if ( isNil "_var") then - { - missionNamespace setVariable ["varName", 123]; - _var = 123; - }; - // _var here will contain current value of the variable varName$/Code$ + $Code$_flagSide = flagSide flag;$/Code$ - global / undefined + global / local - (August 13, 2016) - NOTE: Arma 2 ONLY! In Arma 3 this will return default value. - Warning: the alternative syntax returns undefined when the varspace is an object and that object is null. Example: - $Code$_test = objNull getVariable ["test","0"]; - systemChat _test;$/Code$ - Errors because _test is undefined. Tested in A2OA 1.63.131129 - Anything/Nothing - Anything + Side + - getVehicleCargo + ctrlSetFocus - Gets a list of vehicles loaded as cargo inside this vehicle. The returned array is in the order the cargo vehicles were added to containing vehicle. + Set the input focus on given control. - https://community.bistudio.com/wiki/getVehicleCargo + https://community.bistudio.com/wiki/ctrlSetFocus - getVehicleCargo Object + ctrlSetFocus Control - getVehicleCargo vehicle + ctrlSetFocus controlName - $Code$// Blackfish with no cargo vehicles - _vehicleCargo = getVehicleCargo blackfish; //returns []$/Code$ - - $Code$// Blackfish with cargo vehicles loaded in the order quad_3, quad_1, quad_2 - _vehicleCargo = getVehicleCargo blackfish; //returns [quad_3, quad_1, quad_2]$/Code$ + $Code$ctrlSetFocus _control$/Code$ undefined / undefined + (June 30, 2017) + This command seems to only work on controls that accept any input from keyboard or mouse. - Array + Nothing + - getWPPos + ctrlAutoScrollSpeed - Returns the position of a selected waypoint of a given group. Waypoints include only those which were placed in the mission editor. + Returns number of seconds to auto-scroll one line. -1 if auto-scroll is disabled. -2 if scrollbar not present. + Autorscroll is available for CT_LISTBOX and CT_CONTROLS_GROUP types of controls only. Autoscroll will wait ctrlAutoScrollDelay seconds (must be 0) and then will scroll the scroll bar down to the bottom. ctrlAutoScrollSpeed defines the speed with which scrollbar is scrolled. If ctrlAutoScrollRewind is true, the control will fade out, immediately rewind to the top, then fade in, wait ctrlAutoScrollDelay seconds and then repeat the scrolling in a loop. If user focuses on the control, autoscrolling is interrupted. - https://community.bistudio.com/wiki/getWPPos + https://community.bistudio.com/wiki/ctrlAutoScrollSpeed - getWPPos Array + ctrlAutoScrollSpeed Control - getWPPos [group, index] + ctrlAutoScrollSpeed control - $Code$[_group1,1] setWPPos [200,600,0]; _pos = getWPPos [_group1,1]; - // returns [200,600,0]$/Code$ + $Code$_ctrlSpeed = ctrlAutoScrollSpeed _ctrlGroup;$/Code$ - global / undefined + undefined / undefined - Array + Number + - getWeaponCargo + lbSelection - Returns all weapons types and count from the cargo space + Returns Array of selected rows indices in the given listbox of style LB_MULTI (multi-selection). For single selection listbox use lbCurSel instead. - https://community.bistudio.com/wiki/getWeaponCargo + https://community.bistudio.com/wiki/lbSelection - getWeaponCargo Object + lbSelection Control - getWeaponCargo object + lbSelection control - $Code$_content = getWeaponCargo carName;$/Code$ - - $Code$_content = getWeaponCargo ammoBoxName; - // Sample result returns: - [["arifle_Katiba_F","launch_B_Titan_short_F"],[2,1]]$/Code$ + $Code$_indices = lbSelection _control;$/Code$ - global / undefined + undefined / undefined + (April 10, 2016) + This command works fine with listboxs of style LB_MULTI and should not be marked as obsolete as lbCurSel does not provide the same functionality. - Array + Array + - getWeaponSway + effectiveCommander - Returns current size of weapon sway of a given unit, in radians + Returns the effective commander of the vehicle. Effective commander is the player whom driver AI will listen to. So if in a tank there is a gunner and a commander and AI driver, if the effectiveCommander is gunner, then gunner pressing WASD will give AI orders to move. If gunner jumps out and then enters tank again, the effectiveCommander role most likely has changed to commander that remained in tank. Also the assignment seems to work on first come first served basis. - https://community.bistudio.com/wiki/getWeaponSway + https://community.bistudio.com/wiki/effectiveCommander - getWeaponSway Object + effectiveCommander Object - getWeaponSway unit + effectiveCommander vehicle - $Code$_sway = getWeaponSway player ;$/Code$ + $Code$_commander = effectiveCommander tank;$/Code$ undefined / undefined @@ -30412,300 +32120,284 @@ - Number + Object + - glanceAt + setBehaviour - Control what the unit is glancing at (target or Position ). - How frequently the unit is glancing there depends on behaviour. + Sets group behaviour mode. If a unit is given as argument, behaviour is set for the unit's group. Behaviour is one of: + "CARELESS" + "SAFE" + "AWARE" + "COMBAT" + "STEALTH". + See AIBehaviour for details of the effect of this command on AI units. For Arma 3 see Arma 3 AI Behavior. - https://community.bistudio.com/wiki/glanceAt + https://community.bistudio.com/wiki/setBehaviour - Object/Array glanceAt Object/Array + Group/Object setBehaviour String - unit glanceAt position + groupName setBehaviour behaviour - $Code$_someSoldier glanceAt _otherSoldier$/Code$ - - $Code$_otherSoldier glanceAt markerPos "markerOne"$/Code$ + $Code$_group1 setBehaviour "SAFE";$/Code$ - undefined / undefined + local / global + Warning! Since ArmA v.1.14 the command setBehaviour "COMBAT" do not work correctly any loger. + Units ( Groups ) which are using this behaviour and then get a move order, will not move to the given position. + + Although setBehaviour can be called on an individual unit, the entire group will be affected. + + If setting a behaviour on an individual unit is required, it can be achieved by creating a temporary group, use joinSilent to make the individual unit belong to that group, then change his behaviour, use joinSilent into the original group, then delete the temporary group. - Nothing + Nothing + - globalChat + formationMembers - Types text to the global radio channel. The text will be visible only on the PC where command was executed. If you need the message to show on all computers, you have to execute it globally (see remoteExec ) + Return list of units (drivers) in the formation. - https://community.bistudio.com/wiki/globalChat + https://community.bistudio.com/wiki/formationMembers - Object globalChat String + formationMembers Object - unitName globalChat chatText + formationMembers person - $Code$_soldierOne globalChat "Show this text";$/Code$ - - $Code$driver vehicle player sideChat "sideChat"; - driver vehicle player globalChat "globalChat"; - driver vehicle player groupChat "groupChat"; - vehicle player vehicleChat "vehicleChat"; - driver vehicle player commandChat "commandChat"; - driver vehicle player customChat [1, "customChat"]; - systemChat "systemChat";$/Code$ + $Code$_drivers=FormationMembers _person$/Code$ - global / local + undefined / undefined - In OFP 1.96, this command can be used by a Game_Logic unit, which will result in the text being displayed on screen without any indication of the side of radio source, or quotation marks. For example : gamelogic1 globalchat "hello world" will create the text hello world in the radio log. - Nothing + Array + - globalRadio + setFormationTask - Sends the audio message to the global radio channel. The message is defined in CfgRadio in the description.ext file or config radio protocol. The transmission will play only on the PC where command was executed. If you need the transmission to play on all computers, you have to execute it globally (see remoteExec ). - Note: When transmitting unit gets killed, transmission will be interrupted, however when receiving unit gets killed, the transmission continues to play. + Set the current task of the formation member. - https://community.bistudio.com/wiki/globalRadio + https://community.bistudio.com/wiki/setFormationTask - Object globalRadio String + Object setFormationTask String - unit globalRadio radioName + object setFormationTask task - $Code$_soldierOne globalRadio "messageOne";$/Code$ - - $Code$player globalRadio configName selectRandom ("true" configClasses ( configFile "CfgRadio"));$/Code$ - + - global / local + undefined / undefined - (December 3, 2016) - To transmit user custom sounds (see Multiplayer_Custom_Sounds_Tutorial ), prefix the full filename including file extension with #. For example if there is a custom user sound file called MySound.ogg, to play it on the radio use: - $Code$ player globalRadio "#MySound.ogg";$/Code$ + (16:57, 2 March 2007 (CET)) + The argument for task can be any String value. This can effectively be used to store a property in String format an retrieve it with formationTask in FSM scripts. By using it outside of FSM scripts you're risking to get it overwritten by other running FSM scripts. - Nothing + Nothing + - goggles + dynamicSimulationEnabled - Returns name of currently used goggles (for NVGoggles use hmd ). + A getter for enableDynamicSimulation - https://community.bistudio.com/wiki/goggles + https://community.bistudio.com/wiki/dynamicSimulationEnabled - goggles Object + dynamicSimulationEnabled Object/Group - goggles unit + dynamicSimulationEnabled object - $Code$_goggles = goggles assaultDiver; //G_Diving$/Code$ - - $Code$_goggles = goggles reconTeamLeader; //G_Shades_Black$/Code$ + $Code$hint str dynamicSimulationEnabled _myObject;$/Code$ - global / undefined + undefined / undefined - String + Boolean + - goto + setWindDir - In SQS scripts only: Go to given label. - String argument is used here. - Be sure to use double quotes around label name in goto. Define the label with #. Note that Labels are not case sensitive and that labels are searched for from the top of the script, so multiple occurrences of a label will only result in the top most one ever being found. + Changes the wind direction smoothly during the given time (in seconds). A time of zero means there will be an immediate change. + NOTE : Effect is global only when executed on the server. On clients wind direction will sync to server value in a while. - https://community.bistudio.com/wiki/goto + https://community.bistudio.com/wiki/setWindDir - goto String + Number setWindDir Number - goto label + time setWindDir value - + $Code$60 setWindDir 180$/Code$ + - undefined / undefined + undefined / global - (August 4, 2006) - Notes from before the conversion: - This function works only inside of SQS script. - The search for labels always begins at the top of the script so that if there are multiple occurrences of a label the first occurrence will always be the one found. - Because of the searching order, it is faster to place loops which are executed often at the top of a script. - Labels are not case sensitive. - Loops which look something like the example below should be avoided as many of them could cause the mission to slow down: - #wait - if (condition) then { goto "wait"} - It is better to use the @ command to wait for a condition to be true, or put a small delay into the wait loop. - Example - While it is not required to include a delay in a loop, such a loop without a delay can cause the script to slow the game down, as the loop will be executed many times before the game engine interrupts the script. - Unless you really want the loop to execute multiple times during a frame, you should include a small delay. - You would need to have many scripts running for this to be a significant issue. - Deciding whether to use a script with a loop or a trigger or even a @ statement to detect a condition is a complicated matter and should be subject to experimentation. - - (August 4, 2006) - A goto command called within a forEach loop, will only execute a single jump to goto, once the forEach loop has finished: - { goto "wait"} forEach [0,1,2,3,4] + (April 12, 2014) + Seems to make wind [0,0] in MP. (ArmA 3 1.00) - Nothing + Nothing + - groupChat + setMarkerTypeLocal - Types text to the group radio channel. Must have assigned "ItemRadio" to see or transmit the messages. The text will be visible only on the PC where command was executed. If you need the message to show on all computers, you have to execute it globally (see remoteExec ) + Set marker type. See cfgMarkers for a list of standard markers. - https://community.bistudio.com/wiki/groupChat + https://community.bistudio.com/wiki/setMarkerTypeLocal - Object groupChat String + String setMarkerTypeLocal String - unitName groupChat chatText + markerName setMarkerTypeLocal type - $Code$_soldierOne groupChat "Show this text";$/Code$ - - $Code$driver vehicle player sideChat "sideChat"; - driver vehicle player globalChat "globalChat"; - driver vehicle player groupChat "groupChat"; - vehicle player vehicleChat "vehicleChat"; - driver vehicle player commandChat "commandChat"; - driver vehicle player customChat [1, "customChat"]; - systemChat "systemChat";$/Code$ + $Code$"MarkerOne" setMarkerTypeLocal "Warning";$/Code$ - global / local + undefined / local - Nothing + Nothing + - groupFromNetId + doTarget - Get group with given unique ID. For objects use objectFromNetId. As this command is MP only, you can use BIS_fnc_groupFromNetId, which extends the use to SP as well. + Order the given unit(s) to target the given target (without radio messages). - https://community.bistudio.com/wiki/groupFromNetId + https://community.bistudio.com/wiki/doTarget - groupFromNetId String + Object/Array doTarget Object - groupFromNetId id + unit doTarget target - $Code$_group = groupFromNetId "4:45";$/Code$ + $Code$_ESoldier1 doTarget _WSoldier1;$/Code$ - undefined / undefined + local / global + It appears doTarget objNull can not be used to stop a unit targeting a previously assigned target. Using doWatch objNull will achieve the desired result. (ArmA v1.12Beta) + + (July 2, 2015) + To expand on ceeeb's note, commandWatch objNull will also unassign target; + + (March 28, 2017) + Targeting may not work as expected when trying to target a unit on the same side (friendly). - Group + Nothing + - groupIconSelectable + setMarkerShapeLocal - Return if groups icon raises onClick and onOver events. + Selects the shape (type) of the marker. + Shape can be "ICON", "RECTANGLE" or "ELLIPSE". - https://community.bistudio.com/wiki/groupIconSelectable + https://community.bistudio.com/wiki/setMarkerShapeLocal - groupIconSelectable + String setMarkerShapeLocal String - groupIconSelectable + markerName setMarkerShapeLocal shape - + $Code$"Marker1" setMarkerShapeLocal "RECTANGLE";$/Code$ + - undefined / undefined + undefined / local - Boolean + Nothing + - groupIconsVisible + ASLToATL - Return group icons are visible. + Converts a position from PositionASL to PositionATL - https://community.bistudio.com/wiki/groupIconsVisible + https://community.bistudio.com/wiki/ASLToATL - groupIconsVisible + ASLToATL PositionASL - groupIconsVisible + ASLToATL pos - $Code$// HC bar active - if (isNil "BIS_HC_visible") then {BIS_HC_visible = groupIconsVisible}; - setGroupIconsVisible [true,true];$/Code$ + $Code$ASLToATL ( getPosASL player ) isEqualTo getPosATL player$/Code$ undefined / undefined @@ -30713,281 +32405,300 @@ - Array + PositionATL + - groupId + setGroupIcon - Returns group name. + Set group icons properties. - https://community.bistudio.com/wiki/groupId + https://community.bistudio.com/wiki/setGroupIcon - groupId Group + Group setGroupIcon Array - groupId group + group setGroupIcon [id, icon, offset] - $Code$_name = groupId ( group player );$/Code$ + $Code$_target setGroupIcon [_icon,"hc_selectedEnemy"]; + _target setGroupIcon [_icon,"flag"]; + _grp setGroupIcon [_iconsize,_iconsizeclass,_offset]; + _grp setGroupIcon [_newid,_icon,_offset]; + _grp setGroupIcon [_icon,_iconclass];$/Code$ - global / undefined + undefined / undefined - String + Nothing + - groupOwner + enableCopilot - Returns ID of client to which the group is local. Can be run only from server. When called from client, it always returns 0 + Enables copilot actions. - https://community.bistudio.com/wiki/groupOwner + https://community.bistudio.com/wiki/enableCopilot - groupOwner Group + Object enableCopilot Boolean - groupOwner group + vehicle enableCopilot enable - $Code$_clientID = groupOwner _someGroup;$/Code$ + $Code$if (! isCopilotEnabled myHeli) then { + myHeli enableCopilot true ; + };$/Code$ - global / undefined + local / global - This scripting command must be executed on the server to work properly in multiplayer + (February 17, 2014) + Only enables the user actions, not who is in control - pilot can lock or unlock co-pilot controls in multiplayer while still true. + Actions: LockVehicleControl, UnlockVehicleControl, SuspendVehicleControl and TakeVehicleControl + You can use the Arma 3 Event Handler - ControlsShifted to detect Take and Release actions - Number + Nothing + - groupRadio + pixelGridBase - Sends the audio message to the group radio channel. Must have assigned "ItemRadio" to send or receive the transmission. The message is defined in CfgRadio in the description.ext file or config radio protocol. The transmission will play only on the PC where command was executed. If you need the transmission to play on all computers, you have to execute it globally (see remoteExec ). - Note: When transmitting unit gets killed, transmission will be interrupted, however when receiving unit gets killed, the transmission continues to play. + Returns grid size based on screen resolution. - https://community.bistudio.com/wiki/groupRadio + https://community.bistudio.com/wiki/pixelGridBase - Object groupRadio String + pixelGridBase - unit groupRadio radioName + pixelGridBase - $Code$_soldierOne groupRadio "messageOne";$/Code$ - - $Code$player groupRadio configName selectRandom ("true" configClasses ( configFile "CfgRadio"));$/Code$ + $Code$_gridBaseHeight = pixelH * pixelGridBase ;$/Code$ - global / local + undefined / undefined - (December 3, 2016) - To transmit user custom sounds (see Multiplayer_Custom_Sounds_Tutorial ), prefix the full filename including file extension with #. For example if there is a custom user sound file called MySound.ogg, to play it on the radio use: - $Code$ player groupRadio "#MySound.ogg";$/Code$ - Nothing + Number + - groupSelectUnit + createDialog - Selects a unit from player's group. If player is the leader, the effect of this command is similar to player pressing F1, F2, F3... buttons to highlight units in his squad, after which the unit command menu is shown. If leader is AI, player will get usual communication menu to interact with the leader. + Create a dialog which is defined either in the mission's description.ext, in the campaign's description.ext or in the global resource.cpp. The given name has to be the class name used in one of these files. If another dialog is already opened, the desired dialog is created as a child dialog of the one already opened. - https://community.bistudio.com/wiki/groupSelectUnit + https://community.bistudio.com/wiki/createDialog - Object groupSelectUnit Array + createDialog String - player groupSelectUnit [unit, select] + createDialog dialogName - $Code$// After leaving menu, deselect all units (command menu is not opened - no selection) - { - player groupSelectUnit [_x, false ]; - } forEach ( groupSelectedUnits player );$/Code$ - - $Code$// Select all units when player is the leader: - { - player groupSelectUnit [_x, true ]; - } forEach units player ;$/Code$ - - $Code$// Open communication with group leader: - player groupSelectUnit [ leader player, true ];$/Code$ + $Code$_ok = createDialog "RscDisplayGame"; + if (!_ok) then { hint "Dialog couldn't be opened!"};$/Code$ - undefined / undefined + undefined / local + (July 29, 2017) + A user dialog created with createDisplay over mission display ( findDisplay 46) will stop display event handlers added to mission display from firing. However if it is created with createDialog then the event handlers continue to work. - Nothing + Boolean + - groupSelectedUnits + fadeRadio - Returns selected units in source group for normal commanding mode (individual units). For the High Command equivalent, see hcSelected. + Causes a smooth change in the radio volume. The change duration is given by time, the target volume by volume. The default radio volume is 1.0. - https://community.bistudio.com/wiki/groupSelectedUnits + https://community.bistudio.com/wiki/fadeRadio - groupSelectedUnits Object + Number fadeRadio Number - groupSelectedUnits unit + time fadeRadio volume - $Code$_selectedUnits = groupSelectedUnits player ;$/Code$ + $Code$5 fadeRadio 0.1$/Code$ - undefined / undefined + undefined / local + (September 11, 2008) + Does not affect VON + + (September 13, 2016) + Also influences audibility of the missile warning in helicopters. - Array + Nothing + - group + setParticleCircle - Returns the group a unit is assigned to. + Updates particle source, creates particles in circle with given radius. Velocity is transformed and added to total velocity. Correspondence between CfgCloudlets class param names and command array of params: + $Code$particleSource setParticleCircle + [ + circleRadius, + circleVelocity + ];$/Code$ - https://community.bistudio.com/wiki/group + https://community.bistudio.com/wiki/setParticleCircle - group Object + Object setParticleCircle Array - group object + particleSource setParticleCircle [radius, velocity] - $Code$_playerGrp = group player$/Code$ - + - global / undefined + undefined / undefined - (August 19, 2006) - Few rules about group in OFP:R. - 1) When last man in group die or is moved to other group, group will be destroyed, and it can't be used anymore. - 2) 1st man joined to empty group will be group leader. - Group + Nothing + - grpNull + itemsWithMagazines - A non-existing Group. To compare non-existent groups use isNull or isEqualTo : - grpNull == grpNull ; // false - isNull grpNull ; // true - grpNull isEqualTo grpNull ; // true + Returns combined array including all unit's items and all unit's magazines. Loaded magazines such as currentMagazine, primaryWeaponMagazine, secondaryWeaponMagazine, handgunMagazine as well as assignedItems are excluded. - https://community.bistudio.com/wiki/grpNull + https://community.bistudio.com/wiki/itemsWithMagazines - grpNull + itemsWithMagazines Object - grpNull + itemsWithMagazines unit - $Code$! isNull grpNull ; // false$/Code$ - - $Code$str grpNull ; // NULL-group$/Code$ + $Code$itemsWithMagazines player + //is essentially the same as + items player + magazines player [ + "FirstAidKit",//item + "30Rnd_65x39_caseless_mag",//magazine + "16Rnd_9x21_Mag",//magazine + "Chemlight_green",//magazine + "HandGrenade",//magazine + "ToolKit",//item + "MineDetector"//item + ]$/Code$ - undefined / undefined + global / undefined - Group + Array + - gunner + goggles - Returns the gunner of a vehicle. + Returns name of currently used goggles (for NVGoggles use hmd ). - https://community.bistudio.com/wiki/gunner + https://community.bistudio.com/wiki/goggles - gunner Object + goggles Object - gunner vehicle + goggles unit - $Code$(gunner _tank1) action ["getout",_tank1]$/Code$ + $Code$_goggles = goggles assaultDiver; //G_Diving$/Code$ + + $Code$_goggles = goggles reconTeamLeader; //G_Shades_Black$/Code$ global / undefined - (2 January, 2007) - The gunner command will only return a single gunner. If the vehicle has occupied, multiple turrets. See this discussion on the official forums, for an alternative: - Need an array with a vehicle's cargo units - Object + String + - gusts + worldToModelVisual - Return the current gusts value. Scale is 0 to 1. + Converts position from world space to object model space in render time scope. - https://community.bistudio.com/wiki/gusts + https://community.bistudio.com/wiki/worldToModelVisual - gusts + Object worldToModelVisual Array - gusts + object worldToModelVisual worldPosition - $Code$_gustsval = gusts ;$/Code$ + $Code$_relPos = myObject worldToModelVisual [0,0,0];$/Code$ + + $Code$_relPos = player worldToModelVisual position car;$/Code$ + + $Code$_relPos = car worldToModelVisual [12000,5000];$/Code$ + + $Code$_relPos = unit worldToModelVisual position tank;$/Code$ undefined / undefined @@ -30995,27 +32706,28 @@ - Number + Array + - HUDMovementLevels + ppEffectEnabled - Returns movement borders for HUD [min speed, max speed, min alt, max alt, min dir, max dir, position[x,y,z] or target] + Checks whether given post process effect is enabled - https://community.bistudio.com/wiki/HUDMovementLevels + https://community.bistudio.com/wiki/ppEffectEnabled - HUDMovementLevels + ppEffectEnabled Number - HUDMovementLevels + ppEffectEnabled effect - $Code$HUDMovementLevels;//[0,0,0,0,0,0,[0,0,0]]$/Code$ + $Code$_enabled = ppEffectEnabled _hndl;$/Code$ undefined / undefined @@ -31023,323 +32735,474 @@ - Array + Boolean + - halt + useAISteeringComponent - Stops the program into a debugger. In retail version using halt results in error. + Enable the new AI driving, used to test the old and new AI driving. - https://community.bistudio.com/wiki/halt + https://community.bistudio.com/wiki/useAISteeringComponent - halt + useAISteeringComponent Boolean - halt + useAISteeringComponent state - $Code$? _DbugWanted :halt$/Code$ + $Code$useAISteeringComponent true$/Code$ - undefined / undefined + undefined / global - Nothing + Nothing + - handgunItems + setCombatMode - Returns array with all items assigned to the handgun. This command is used for infantry weapons only. + Set group combat mode (engagement rules). + Mode may be one of: + "BLUE" = Never fire + "GREEN" = Hold fire - defend only + "WHITE" = Hold fire, engage at will + "YELLOW" = Fire at will + "RED" = Fire at will, engage at will + See Arma AI Engagement rules for more informations on combat modes. - https://community.bistudio.com/wiki/handgunItems + https://community.bistudio.com/wiki/setCombatMode - handgunItems Object + Object/Group setCombatMode String - handgunItems unit + groupName setCombatMode mode - $Code$handgunItems player ; - /* - [ - "muzzle_snds_L",//silencer - "",//laser - "",//optics - ""//bipod - ] - */$/Code$ + $Code$_group1 setCombatMode "BLUE";$/Code$ - global / undefined + local / global - Array + Nothing + - handgunMagazine + knowsAbout - Returns either single element array, containing class name of currently loaded in the handgun magazine, or an empty array if unit has no handgun or handgun is not loaded. This command is used for infantry weapons only. + Checks if a group or a side knows about target. If who is a unit, unit's group is considered, if who is a vehicle, commander's group is considered. - https://community.bistudio.com/wiki/handgunMagazine + https://community.bistudio.com/wiki/knowsAbout - handgunMagazine Object + Object/Group knowsAbout Object + + Side knowsAbout Object - handgunMagazine unit + who knowsAbout target + + side knowsAbout target - $Code$hint handgunMagazine player ; //["16Rnd_9x21_Mag"]$/Code$ + $Code$_kv = _soldierOne knowsAbout _jeepOne;$/Code$ - $Code$_array = handgunMagazine player ; - if ( count _array 0) then { - hint ("Handgun is loaded with " + (_array select 0) + "!"); - } else { - if ( handgunWeapon player != "") then { - hint "Handgun is not loaded!"; - } else { - hint "Player doesn't have a handgun!"; - }; - };$/Code$ + $Code$_kv = ( side player ) knowsAbout _target;$/Code$ global / undefined + (August 4, 2006) + Notes from before the conversion: + With Resistance (1.91) : No matter what class of unit the target is and no matter what the skill/class of the enemy AI, the magic 'knowsAbout' number is 0.105. + With CWC (1.46) : No matter what class of unit the target is and no matter what the skill/class of the enemy AI, the magic 'knowsAbout' number is 0.7. + What this means is, the AI will not fire on an enemy soldier until his 'knowsAbout' level of that enemy has reached the 'magic number' or higher. + This suggests that the knowsabout level must reach the magic threshold before a unit knows if another unit is an enemy or a friendly unit. + Triggers and knowsabout level: "Detected by xxx" triggers also follow the above rules. For a detected trigger to be set off, the knowsAbout level must reach the magic number. + Also... As soon as An AI unit gets hit with a bullet his knowsAbout level for the unit that shot him will instantly jump to 1.5, even if the shooter is 1000m away. Vice versa is also true. If An AI soldier's knowsAbout level for an enemy is 0.7 and the soldier fires and hits the enemy, his knowsAbout level about the enemy will instantly jump to 1.5. Some editors have found, whilst using this command over the years, that the following characteristics have cropped up: + AI enemies have a very limited amount of peripheral vision, it's not nearly as good as a human player's. A target must be in front of the unit for him to be noticed, so if you sprint right behind an enemy, this value doesn't increase. + Depending on the units skill level, it can take a little time for the unit to notice a target. So if you run right past a unit, this value might not increase. + Bushes between the unit and the target seem to have little effect on this value, and trees definitely have no affect. You may be in a forest, and can't see the unit, but he can see you. + MP Note knowsAbout returns a viable result only if left-hand parameter unit is local. + + (January 15, 2007) + In OFP v1.96, KnowsAbout return values range from 0 to 4. + All units in a group have equal knowsAbout for any given target. All units in a group always return knowsAbout 4 about each other. This suggests groups share a single knowledge base. + Without any contact with the target, the knowsAbout value decays at a linear rate so that it halves over 120 seconds. After this time is up knowsAbout drops instantly to 0. + If the distance between the all of unit's group and the target exceeds the viewdistance setting, knowsAbout instantly drops to 0. This is not changed by fog or daylight. + Note that in OFP unit see all the targets that his group members see. The data is processed between teammembers freely. + + the magic 'knowsAbout' number is 0.105. It's not that simple.Maybe true for infantry but not all vehicles. "Reveal" command sets knowsAbout to 1, but planes still won't fire at soldiers on the ground. There's only one known way to pass through this - designate target with another fake infantry unit near the target. As soon as this fake unit see the target knowsAbout lifts up to 2.5-4 and even single enemy soldiers are attacked rom the air (of course if plane has suitable munition :)) + + (July 05, 2009) + In ArmA (other not tested), KnowsAbout value will stay at its highest value during approximately 2-3 min and then reinitialized. + + (January 14, 2012) + Notes are for OA 1.60 : + The KnowsAbout value drops immediately back to zero, if the distance between both units is larger than the local viewDistance value. + After 110 seconds without (visible?) contact, the KnowsAbout value drops to zero again. While it seemed to take longer the higher the KnowsAbout value is (at least for a value of 4 it took almost six minutes at one point), I was unable to reproduce/confirm that. It is 110 seconds no matter how high the KnowsAbout value it seems. + + (June 13, 2012) + By Suma ( source ): + All friendly units within a view distance to each unit [are revealed (to the player? or each friendly?)] on the mission start. The code is half broken, as it does not make the units known, it only sets the "accuracy" value for them. Note: This is not affecting enemy units at all. + + (March 27, 2013) + Arma-II OA (1.62.101.480 @ACE), tests with infantry: + It is still true, that the command returns values between 0 (lowest) and 4 (most). Freshly Spotted units will have at least 1.5, slowly decreasing when the target disappeared. + The following Table shows my test results on a clear day at Takistan using the Vector. Please note that the returned values vary considerably depending on weather and time. Moonlight however seems to not have any considerable effect. + 12:00, sunlight, clear sky + Distance + knowsAbout + 1530 + 1.5 + 1370 + 1.5 + 1250 + 1.5 + 1135 + 1.5 + 1055 + 1.52 + 1022 + 1.64 + 990 + 1.74 + 833 + 2.5 + 720 + 3.37 + 600 + 3.81 + 505 + 3.86 + 400 + 3.92 + 380 + 4 + 365 + 4 + 21:00, bright half moon, clear sky + Distance + knowsAbout + 285 + 1.5 + 120 + 1.5 + 88 + 1.89 + 75 + 2.3 + 61 + 3.9 + 23:00, pitch black, clear sky, NVG on + Distance + knowsAbout + 600 + 1.5 + 487 + 1.5 + 390 + 1.5 + 289 + 2.22 + 278 + 2.4 + + (May 31, 2014) + Can also use SIDE in place of UNIT. For example: + $Code$EAST knowsAbout player ;$/Code$ - Array + Number - Number + - handgunWeapon + titleFadeOut - Returns the name of a unit's handgun (an empty string if there is none). + Terminate the title effect and set duration of the fade out phase to the given time. - https://community.bistudio.com/wiki/handgunWeapon + https://community.bistudio.com/wiki/titleFadeOut - handgunWeapon Object + titleFadeOut Number - handgunWeapon unit + titleFadeOut duration - $Code$hint handgunWeapon player ; //"hgun_P07_F"$/Code$ + $Code$titleText ["Hi", "plain"]; titleFadeOut 2$/Code$ - global / undefined + undefined / undefined - String + Nothing + - handsHit + magazineTurretAmmo - Checks if a soldier's hands are hit, which results in inaccurate aiming. + Returns ammo count of given type from given turret + Broken when vehicle has multiple magazines of the same type - https://community.bistudio.com/wiki/handsHit + https://community.bistudio.com/wiki/magazineTurretAmmo - handsHit Object + Object magazineTurretAmmo Array - handsHit unitName + vehicle magazineTurretAmmo [magazineClass, turretPath] - $Code$? (handsHit player == 1) : player globalChat "Ouch! Don't shoot at my hands dammit!"$/Code$ + $Code$vehicle player magazineTurretAmmo ["cls", [0]]$/Code$ - global / undefined + undefined / undefined - Number + Number + - hasInterface + actionKeysNames - Returns true if the computer has an interface (a real player). False for a dedicated server or for a headless client. + Returns a list of button names assigned to the given user action. You can find the action names in config class ControllerSchemes or user action names. - https://community.bistudio.com/wiki/hasInterface + https://community.bistudio.com/wiki/actionKeysNames - hasInterface + actionKeysNames String + + actionKeysNames Array - hasInterface + actionKeysNames userAction + + actionKeysNames [userAction, maxKeys] + + actionKeysNames [userAction, maxKeys, inputDevicePriority] - $Code$headless = !( hasInterface || isDedicated );$/Code$ - - $Code$_isHC = ! hasInterface && ! isDedicated ;$/Code$ + $Code$_list = actionKeysNames "ReloadMagazine"; //"R"$/Code$ undefined / undefined - (December 21, 2014) - $Code$ if ( isDedicated ) then { - //run on dedicated server only - }; - if ( isServer ) then { - //run on dedicated server or player host - }; - if ( hasInterface ) then { - //run on all player clients incl. player host - }; - if (! isDedicated ) then { - //run on all player clients incl. player host and headless clients - }; - if (! isServer ) then { - //run on all player clients incl. headless clients but not player host - }; - if (! hasInterface ) then { - //run on headless clients and dedicated server - }; - if (! hasInterface && ! isDedicated ) then { - //run on headless clients only - };$/Code$ + (20:14, 20 January 2010 (CET)) + The return type is a stacked string. A string inside a string. To compare use first single and inside double quotes: + if ((actionKeysNames "User1") == '"W"') then... + + (October 26, 2014) + inputDevicePriority 'Controler' is not a spelling mistake in description. - Boolean + String - String + - hasPilotCamera + admin - Returns true if the object airplane or helicopter has a pilotCamera. + This is dedicated server command, which queries the admin state of any client on the network by their client ( owner ) id. Possible results are: + 1 - client is admin that is voted in + 2 - client is admin that is logged in + In all other cases it returns 0. To self check the admin state of a local client, use BIS_fnc_admin. - https://community.bistudio.com/wiki/hasPilotCamera + https://community.bistudio.com/wiki/admin - hasPilotCamera Object + admin Number - hasPilotCamera object + admin ownerID - $Code$hasPilotCamera vehicle player$/Code$ + $Code$_isLoggedInAdmin = admin 3 == 2;$/Code$ + + $Code$_adminState = admin owner unit1;$/Code$ - global / undefined + undefined / undefined + This scripting command must be executed on the server to work properly in multiplayer - Boolean + Number + - hasWeapon + setObjectTexture - Checks if a unit has the given weapon. + Textures object selection with texture named in array. + Array has the form [selectionNumber, "Texture"]. + The selection number is defined through the hiddenselection []={} array in the vehicle's config (starting with 0). + NOTES : + Not all objects could be textured this way. To find out, run getObjectTextures command on an object. Empty array [] usually indicates it cannot be textured. + All textures must have resolution 2^x / 2^y (e.g. 16 / 16, 16 / 32, 64 / 256, 512 / 512, etc). The largest texture size commonly supported by graphics cards and RV engine is 4096x4096 + Supported formats:.pac,.paa,.jpg,.jpeg,.ogg,.ogv - https://community.bistudio.com/wiki/hasWeapon + https://community.bistudio.com/wiki/setObjectTexture - Object hasWeapon String + Object setObjectTexture Array - unitName hasWeapon weaponName + object setObjectTexture [selectionNumber,texture] - $Code$?!( player hasWeapon "M16") : player addWeapon "M16"$/Code$ + $Code$_objectname setObjectTexture [0, "\pboname\texture.paa"]; + _objectname setObjectTexture [1, "\pboname\texture2.paa"];$/Code$ + + $Code$_obj setObjectTexture [0, "#(rgb,8,8,3)color(1,0,0,1)"];$/Code$ + + $Code$_obj setObjectTexture [0, "#(argb,512,512,1)r2t(rendersurface,1.333)"];$/Code$ + + $Code$// When applying custom texture in Editor on vehicles that have randomization enabled ( Arma 3 Assets ), disable randomization first: + this setVariable ["BIS_enableRandomization", false ]; + this setObjectTexture [0,"#(rgb,8,8,3)color(1,0,0,1)"];$/Code$ - global / undefined + global / local - (September 11, 2014) - This command doesn't work for Items in Arma 3, use this instead. - $Code$" ItemGPS " in ( items player + assignedItems player ) OR ' ItemGPS ' in ( items player + assignedItems player ) $/Code$ - Returns true if unit has gps in inventory, assigned or not. + (Aug 4, 2006) + In MP this command has only local effect. If you want to change a texture on all clients, you have to execute this command on each client (or setObjectTextureGlobal ). This command has also a bug: when a saved game is loaded the texture you have set will disappear and needs to be reset. + + (December 19, 2009) + Instead of bitmaps, procedural textures can be used. + The syntax for those is #(argb,8,8,3)color(R,G,B,A), where R,G,B stands for Red, Green, Blue, and A stands for Alpha, all values can be anything between 0 and 1 (including decimals). e.g. + $Code$_obj setObjectTexture [0,'#(argb,8,8,3)color(0,1,0,1)']$/Code$ + would color myObj in flat green. See Procedural Textures for more details. + + (August 25, 2014) + Also works with absolute path and.jpg files. + $Code$_obj setObjectTexture [0, "C:\Folder\Folder\Texture.paa"]; + _obj setObjectTexture [0, "C:\Folder\Folder\Texture.jpg"];$/Code$ + Texture can also be blank: + $Code$_obj setObjectTexture [2,""];$/Code$ + This will make the texture selection invisible on certain units without an error message. In some cases this is a desirable effect + + (March 18, 2015) + It is also possible to apply texture to unit's backpack, as it also has hidden selection (unfortunately does not work for vests) + $Code$(backpackContainer player) setObjectTexture [0,'#(argb,8,8,3)color(0,0,0,1)']$/Code$ + Also keep in mind that player's custom texture is being reset when you open BIS Arsenal (even without changing any gear) + + (May 13, 2015) + You can also use the gameinternal skins: List of MH9 Skins $Code$_obj setObjectTexture [0, "\a3\air_f\heli_light_01\data\skins\heli_light_01_ext_digital_co.paa"];$/Code$ + + (October 24, 2016) + Sometimes it could be necessary to set default material on an object for the texture to take effect: + $Code$_block = createVehicle ["Land_VR_Block_02_F", player getPos [20, getDir player ], [], 0, "CAN_COLLIDE"]; + _block setObjectMaterial [0, "\a3\data_f\default.rvmat"]; + _block setObjectTexture [0, "#(rgb,8,8,3)color(1,0,0,1)"];$/Code$ + Courtesy of Larrow - Boolean + Nothing + - hcAllGroups + ctrlEnable - Returns selected groups in high command. + Enable or disable a control of the currently active user dialog. Disabled controls cannot be clicked onto. + Read Dialog Control for more information about user dialogs and controls. - https://community.bistudio.com/wiki/hcAllGroups + https://community.bistudio.com/wiki/ctrlEnable - hcAllGroups Object + ctrlEnable Array + + Control ctrlEnable Boolean - hcAllGroups unit + ctrlEnable [idc, enable] + + controlName ctrlEnable enable - + $Code$ctrlEnable [100, false]$/Code$ + + $Code$_ctrl ctrlEnable false$/Code$ + - undefined / undefined + local / local + (July 20, 2017) + Please do note that enabled controls can gain focus upon click. Therefore do not enable background controls or else they will cover any controls on top of them. + As a general rule of thumb, enabled controls should only be already on the top of the GUI. - Array + Nothing - Nothing + - hcGroupParams + teamSwitchEnabled - Returns parameters describing group in high command bar. - Return value is [string, float[4]] + Check if Team Switch is currently enabled. + Team Switch is enabled by default. - https://community.bistudio.com/wiki/hcGroupParams + https://community.bistudio.com/wiki/teamSwitchEnabled - Object hcGroupParams Group + teamSwitchEnabled - unit hcGroupParams group + teamSwitchEnabled @@ -31349,201 +33212,210 @@ - Array + Boolean + - hcLeader + setGroupIconParams - Returns group's high command commander. + Set group icons parameters. [color,string,float,bool] - https://community.bistudio.com/wiki/hcLeader + https://community.bistudio.com/wiki/setGroupIconParams - hcLeader Group + Group setGroupIconParams Array - hcLeader group + group setGroupIconParams properties - $Code$_leader = hcLeader groupName;$/Code$ + $Code$_grp setGroupIconParams [_color,_text,_scale,_visible]; + _grp setGroupIconParams [[0,0,0,0],"",1,false];$/Code$ undefined / undefined - (September 2, 2009) - hcLeader returns 'NULL_OBJECT' if you use it on your HC commander's group in a HC setup with subordinates. It seems to work as expected if you don't use subordinates. - Object + Nothing + - hcRemoveAllGroups + tvSetPictureColorDisabled - Remove all groups from unit's high command bar. + Sets the color of left picture of a tree item defined by path when item is disabled - https://community.bistudio.com/wiki/hcRemoveAllGroups + https://community.bistudio.com/wiki/tvSetPictureColorDisabled - hcRemoveAllGroups Object + Control tvSetPictureColorDisabled Array - hcRemoveAllGroups unit + control tvSetPictureColorDisabled [path, color] - + $Code$_control tvSetPictureColorDisabled [[0], [1,0,1,1]]$/Code$ + undefined / undefined - Nothing + Nothing + - hcRemoveGroup + waypoints - Removes group from unit's high command bar. + Returns an array of waypoints for the specified unit/group. - https://community.bistudio.com/wiki/hcRemoveGroup + https://community.bistudio.com/wiki/waypoints - Object hcRemoveGroup Group + waypoints Group - unit hcRemoveGroup group + waypoints groupName - + $Code$waypoints player ;$/Code$ + + $Code$_wPosArray = waypoints group10; + // could return [[EAST 1-1-A,0],[EAST 1-1-A,1],[EAST 1-1-A,2]]$/Code$ + - undefined / undefined + global / undefined - Nothing + Array + - hcSelectGroup + speed - Select given group in high command bar. + Object speed (in km/h). Returns relative speed of given object along Y axis. An equivalent to: 3.6 * ( velocityModelSpace _obj select 1) - https://community.bistudio.com/wiki/hcSelectGroup + https://community.bistudio.com/wiki/speed - Object hcSelectGroup Array + speed Object - unit hcSelectGroup array + speed object - + $Code$if ( speed _truck1 = 100) then { hint "You're going too fast!"};$/Code$ + undefined / undefined - Nothing + Number + - hcSelected + turretOwner - Returns selected groups in high command. + Returns id of the owner of the turret. Server only. Returns 0 on non-server and SP. + Some info on turrets: A vehicle turret will change locality when player gunner gets in it, just like vehicle changes locality when player driver gets in it. Many commands for turrets work only where turret is local. When gunner leaves turret it is supposed to change locality to the locality of the vehicle. A vehicle can have one owner while turrets have different owners. - https://community.bistudio.com/wiki/hcSelected + https://community.bistudio.com/wiki/turretOwner - hcSelected Object + Object turretOwner Array - hcSelected unit + vehicle turretOwner turretPath - $Code$array = hcSelected unit;$/Code$ + $Code$_ownerId = vehicle player turretOwner [0];$/Code$ - undefined / undefined + global / undefined + This scripting command must be executed on the server to work properly in multiplayer - Array + Number + - hcSetGroup + setPosASL - Add group to unit's high command bar. - Array parameters are group, group-name and team (teammain, teamred, teamgreen, teamblue, teamyellow). - Group is the only necessary parameter. + Sets the object position above sea level. The pos array uses the PositionASL format. - https://community.bistudio.com/wiki/hcSetGroup + https://community.bistudio.com/wiki/setPosASL - Object hcSetGroup Array + Object setPosASL Array - unit hcSetGroup array + object setPosASL pos - $Code$unit hcSetGroup [group, "HQ", teamred];$/Code$ + $Code$player setPosASL [ getPosASL player select 0, ( getPosASL player select 1) + 10, getPosASL player select 2];$/Code$ - $Code$player hcSetGroup [group];$/Code$ + $Code$this setPosASL [ position this select 0, position this select 1, 9]; //[ X, Y, Z]$/Code$ - undefined / undefined + global / global - Nothing + Nothing + - hcShowBar + setText - Shows or hides high command bar. - There must be some groups under HC command to show HC bar. + Sets the text associated with a location. This text will be displayed on the game map at the location's position. - https://community.bistudio.com/wiki/hcShowBar + https://community.bistudio.com/wiki/setText - hcShowBar Boolean + Location setText String - hcShowBar bool + location setText text - $Code$hcShowBar true ;$/Code$ - - $Code$hcShowBar false ;$/Code$ + $Code$myLocation setText "Rahmadi Village"$/Code$ undefined / undefined @@ -31551,749 +33423,653 @@ - Nothing + Nothing + - hcShownBar + setVelocity - Return true if the high command bar is shown/active. + Set velocity (speed vector) of a vehicle. Units are in metres per second. - https://community.bistudio.com/wiki/hcShownBar + https://community.bistudio.com/wiki/setVelocity - hcShownBar + Object setVelocity Array - hcShownBar + vehicleName setVelocity [x, y, z] - $Code$if ( hcShownBar ) then { hint "HC bar is active";};$/Code$ + $Code$_truck1 setVelocity [20, 0, 0];$/Code$ + + $Code$// Advanced method used for relative acceleration: + _vel = velocity _vehicle; + _dir = direction _vehicle; + _speed = 10; comment "Added speed"; + _vehicle setVelocity [ + (_vel select 0) + ( sin _dir * _speed), + (_vel select 1) + ( cos _dir * _speed), + (_vel select 2) + ];$/Code$ - undefined / undefined + local / global + (20 Jun, 2014) + (ArmA3 1.22) setVelocity will be affected by setDir and setVectorDirAndUp. So use it after them. - Boolean + Nothing + - headgear + setOwner - Returns headgear of unit. + From server machine, change the ownership of an object to a given client. Returns true if locality was changed. + Since Arma 3 v1.40, this command should not be used to transfer ownership of units with AI ( agents are an exception to this rule). + Using command in an unintended way will display an on-screen warning and log a message to.rpt file. + To transfer ownership of all AI units in a group properly, use setGroupOwner instead. - https://community.bistudio.com/wiki/headgear + https://community.bistudio.com/wiki/setOwner - headgear Object + Object setOwner Number - headgear unit + object setOwner clientID - $Code$hint headgear player ; //H_HelmetB$/Code$ + $Code$_someObject setOwner 12;$/Code$ + + $Code$_someObject setOwner ( owner _playerObject);$/Code$ - global / undefined + undefined / undefined + This scripting command must be executed on the server to work properly in multiplayer + + (January 7, 2015) + The ownership can only be given from server to client. For some reason the server cannot return ownership back with this command. This is fixed in Arma 3 1.40 + + (August 22, 2017) + NOTE : There are some interesting behaviour about the specific owner digits like 0 -2 and 2 : + 1. Any mission objects (generated from SQM) initially have 0 owner state, but it is not local to ANYONE (0) like it is expected to be, but actually only to a SERVER (2). You can't make any object owner to be 0 once it was changed. + 2. Trying to change ownership to any negative digit will always result in attempt to transfer ownership to SERVER (2). Once it is unit (non-agent) it will fail and revert* to initial ownership. + 3. *Changing ownership of a unit (non-agent) actually gives a result for a brief time after this action is performed. What actually happens next - ownership is getting reverted with a message to RPT of a server. This can be seen by reading results of (owner _object) in really fast cycle. - String + Boolean + - hideBody + lnbDeleteRow - Hides dead body of the given unit. After a short delay, the body slowly sinks into the ground. After awhile, when group of the unit becomes grpNull, the body gets deleted and becomes objNull. If applied to alive unit, nothing happens until unit dies, then the unit's body gets hidden. If a dead unit is human player, the body is hidden but not deleted until player respawns. + Removes row with the given index from the given listbox or combobox. - https://community.bistudio.com/wiki/hideBody + https://community.bistudio.com/wiki/lnbDeleteRow - hideBody Object + Control lnbDeleteRow Number - hideBody unit + _ctrl lnbDeleteRow row - $Code$hideBody player1;$/Code$ + $Code$_ctrl lnbDeleteRow 1;$/Code$ - local / global + undefined / undefined + (Sep 9 2014) + (A3 1.28)As for invisible data processing, lnbAddArray, lnbAddColumn, lnbData, lnbGetColumnsPosition, lnbSetColumnsPos, lnbSetData, lnbSetText, lnbSetValue, lnbText and lnbValue store data types into exact position of the listNbox with different spaces. Accessing data with coordinate command at nearly the same syntax: + $Code$ + //Set same value to one position of a Control + _ctrl lnbSetData [ [0,0],"#1"]; + lnbSetColumnsPos [102, [0,1], 1]; + _ctrl lnbSetText [ [0,1], "#1"]; + _ctrl lnbSetValue [ [0,0],1]; + //Accessing the value disregard affecting one another. + _ctrl lnbData [0,0]; //"#1" + lnbGetColumnsPosition _ctrl //[1]; + _ctrl lnbText [0,0];//"#1" + _ctrl lnbValue [0,0];//1 + $/Code$ + For a direct visible control over CT_LISTNBOX: + $Code$ + 0 = [_CT_LISTNBOX] spawn { + private ["_CT_LISTNBOX","_color","_current","_pic"]; + disableSerialization ; + _CT_LISTNBOX = _this select 0; + { + _CT_LISTNBOX lnbAddRow [ getText (_x "displayNameShort"), getText (_x "displayName")]; + _CT_LISTNBOX lnbSetPicture [ [_foreachIndex,0], getText (_x "texture")]; + } forEach (" isClass _x" configClasses ( configFile "CfgRanks")); + _CT_LISTNBOX lnbSetCurSelRow 0; + _current = lnbCurSelRow _CT_LISTNBOX; + _color = _CT_LISTNBOX lnbColor [_current,0]; + _CT_LISTNBOX lnbSetColor [ [_current,1], [(_color select 0)/2,0,0,1] ]; + _CT_LISTNBOX lnbDeleteColumn 0; + _CT_LISTNBOX lnbDeleteRow 1; + sleep 1; + lnbClear _CT_LISTNBOX;//Clear all items but control still remains just invisible. + }; + $/Code$ + A combined use of both invisible and visible data processing commands alive the Control. - Nothing + Nothing + - hideObjectGlobal + enableAttack - This command is designed for MP. Hides object on all connected clients as well as JIP. Call on the server only. Can be used on all objects with class names, i.e. ( typeOf object != ""). In SP this command behaves just like hideObject. + Set if leader can issue attack commands to the soldiers in his group. - https://community.bistudio.com/wiki/hideObjectGlobal + https://community.bistudio.com/wiki/enableAttack - hideObjectGlobal Object - - Object hideObjectGlobal Boolean + Object/Group enableAttack Boolean - hideObjectGlobal object - - object hideObjectGlobal hidden + group enableAttack enable - $Code$hideObjectGlobal nearestBuilding [2500,2500,0];$/Code$ - - $Code$objectname hideObjectGlobal true;$/Code$ + $Code$_group1 enableAttack true$/Code$ - global / global + local / global - This scripting command must be executed on the server to work properly in multiplayer - - (June 27, 2015) - hideObject and hideObjectGlobal disable object collision in addition to rendering. A3 1.45.131175 - (tested by hiding buildings and running through, driving through, flying through, and shooting through where the building used to be) - - (September 1, 2016) - As of A3 1,62.134494 running hideObjectGlobal in big loop may cause some objects not to be hidden for a players already connected or passed JIP. To avoid players rendering desync consider running that in preInit schedule of a server. - - (August 7, 2017) - In A3 1.72.142342 when you hide object via hideObjectGlobal, model sounds still be audible. - For e.g. if you delete apex house from map, you still hear a conditioner sound at this spot - Nothing - Nothing + Nothing + - hideObject + soundVolume - Hide entity. Can be used on soldiers and vehicles, also on static objects. + Check current sound volume (set by fadeSound ). - https://community.bistudio.com/wiki/hideObject + https://community.bistudio.com/wiki/soundVolume - hideObject Object - - Object hideObject Boolean + soundVolume - hideObject object - - object hideObject hidden + soundVolume - $Code$hideObject unitName;$/Code$ - - $Code$objectName hideObject true;$/Code$ + $Code$_vol = soundVolume$/Code$ - global / local + undefined / undefined - (July 15, 2010) - This command will hide a unit, but he will still shoot enemies. Unit will be invisible, but weapon muzzle are visible. - - Use MP framework to activate this comand on all players from server or any other maschine - $Code$_nic = [nil, mantohide, "per", rHideObject, true ] call RE; //In A3 use hideObjectGlobal instead.$/Code$ - - you can use code as in example 2, where true = ON and false = OFF, if using it like in example 1, you can only turn it ON - - using this locally causes the player/object disappear only locally; has to be executed serverside if used in MP. Hidden Vehicles still emit smoke/rotor blade dust and (probably) still emit engine sounds. Usefull for creating objects the map-creator doesn't want to be seen, like Units that protect a certain Area (like a safe-zone) against teamkillers or enemy units. - - The above comment is partially incorrect, if the effects of the command are local then it must be executed in every machine so it has global effect. If it is run only on the server machine, it will only be hidden on the server, while clients still see it. - - (March 5, 2014) - As of today this now finally has a Global counterpart, just released on the Stable branch. Added it's link under See also. - - (October 30, 2014) - When used on player, it only has an effect on third person mode. First person LOD is still visible. (A3 Dev 1.33) - - (June 27, 2015) - hideObject and hideObjectGlobal disable object collision in addition to rendering. A3 1.45.131175 - (tested by hiding buildings and running through, driving through, flying through, and shooting through where the building used to be) - - (January 26, 2016) - Sometimes it´s easier to teleport the object about 100m under the ground (also JiP Support): - $Code$_obj setPosATL [getPosATL _obj select 0, getPosATL _obj select 1, (getPosATL _obj select 2)-100];$/Code$ - And to unhide: - $Code$_obj setPosATL [getPosATL _obj select 0, getPosATL _obj select 1, (getPosATL _obj select 2)+100];$/Code$ - Nothing - Nothing + Number + - hideSelection + showWaypoint - Hides or enables the given selection for the object + Sets the condition determining when the waypoint is shown. + Possible values are: + "NEVER" - never show it + "EASY" - show only in cadet mode + "ALWAYS" - always show it - https://community.bistudio.com/wiki/hideSelection + https://community.bistudio.com/wiki/showWaypoint - object hideSelection Array + Array showWaypoint String - object hideSelection [selection, hidden] + waypoint showWaypoint show - + $Code$[_grp, 2] showWaypoint "ALWAYS";$/Code$ + - local / global + undefined / undefined - (April 28, 2016) - Only seems to work for objects created with createSimpleObject, and will only work for certain selections. - Nothing + Nothing + - hintCadet + getPersonUsedDLCs - Shows a text hint only when in cadetMode. - The text can contain several lines. \n is used to indicate the end of a line. + Returns a list of all DLCs objects the unit is currently using. For example if a unit is inside a vehicle from DLC, it will return the code of that DLC. + This command is broken and doesnt work on dedicated server - https://community.bistudio.com/wiki/hintCadet + https://community.bistudio.com/wiki/getPersonUsedDLCs - hintCadet String + getPersonUsedDLCs Object - hintCadet text + getPersonUsedDLCs unit - $Code$hintCadet "Press W to move forward";$/Code$ + $Code$_objects = getPersonUsedDLCs player ;$/Code$ - undefined / local + global / undefined - hintCadet can be used with formatting like this: - $Code$ hintCadet format ["Hello %1", player ]$/Code$ - Nothing + Array + - hintC + apply - Displays attractive hint in the center of the screen. Player control is taken away until user presses "Continue". After user confirmation, the content of the hintC is repeated again in a normal hint. This type of hint can also have a title. It is also possible to drag this type of hint around the screen. + Applies given code to each element of the array and returns resulting array. The value of the current array element, to which the code will be applied, is stored in variable _x. - https://community.bistudio.com/wiki/hintC + https://community.bistudio.com/wiki/apply - hintC String - - String hintC Array - - String hintC Structured_Text - - String hintC String + Array apply Code - hintC content - - title hintC [content1, content2,] - - title hintC content - - title hintC content + array apply code - $Code$hintC "Press W to move forward";$/Code$ - - $Code$// Same as the above in Arma3 but without second hint displayed: - hintC "Press W to move forward"; - hintC_EH = findDisplay 57 displayAddEventHandler ["unload", { - 0 = _this spawn { - _this select 0 displayRemoveEventHandler ["unload", hintC_EH]; - hintSilent ""; - }; - }];$/Code$ - - $Code$"Instructions" hintC [ - "Press W to move forward.", - "Press S to move backwards.", - "Use the mouse to turn right or left.", - "Press V for weapon sights." - ];$/Code$ + $Code$_arr = [1,2,3,4,5,6,7,8,9,0] apply {[1,0] select (_x % 2 == 0)}; //[1,0,1,0,1,0,1,0,1,0]$/Code$ - $Code$// Same as the above in Arma3 but without second hint displayed: - "Instructions" hintC [ - "Press W to move forward.", - "Press S to move backwards.", - "Use the mouse to turn right or left.", - "Press V for weapon sights." - ]; - hintC_arr_EH = findDisplay 72 displayAddEventHandler ["unload", { - 0 = _this spawn { - _this select 0 displayRemoveEventHandler ["unload", hintC_arr_EH]; - hintSilent ""; - }; - }];$/Code$ + $Code$_arr = [1,2,3,4,5,6,7,8,9,0] apply {_x ^ _x}; //[1,4,27,256,3125,46656,823543,16777216,387420480,1]$/Code$ - $Code$_separator1 = parseText " br / ------------------------ br / "; - _image = "\ca\ui\textures\aus_flag.paa"; - _txt = composeText [ image _image, "Heading Text", _separator1, "Content"]; - "" hintC _txt;$/Code$ + $Code$_arr1 = []; + _arr1 resize 20; + _arr2 = _arr1 apply {0}; //[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]$/Code$ - undefined / local + undefined / undefined - This command must be executed after mission start. If you place it into init.sqs or init field of some unit, it will not work. Just add a little delay (~0.001) and the place the command. - - To display multiple messages after another you have to add a small delay in between. Otherwise only the first message will be displayed. hintC "foo"; sleep 0.1; hintC "bar"; Without a sleep statement hintC will not suspend the script it has been called from. - - HintC can be used with formatting like this: HintC format["Hello %1",player]. + (February 18, 2016) + (to anyone else wondering, I took a minute to get it): This is Array.map() is JavaScript - (March 19, 2015) - "Titled" hintC all use display #72 while "untitled" one uses display #57. If you are trying examples in Arma 3 debug console, add little delay like this: $Code$[] spawn {sleep 0.5;....your example code goes here...};$/Code$ or no hintC will be displayed. + (February 11, 2018) + if performance really is an issue, apply seems to be (very) slightly faster than forEach (by more or less one percent, 0.7-1.5% in my tests to be precise). - Nothing - Nothing - Nothing - Nothing + Array + - hintSilent + addMagazineTurret - Same as hint, but without a sound. + Adds a magazine to the turret. Use turret path [-1] for driver's turret. + Note: you may create invalid combinations by using this function, for example by adding 20 grenades. When doing so, application behaviour is undefined. Since Arma 3 v1.55.133817 it is possible to set custom ammo count in added magazine. - https://community.bistudio.com/wiki/hintSilent + https://community.bistudio.com/wiki/addMagazineTurret - hintSilent String/Structured_Text + Object addMagazineTurret Array - hintSilent text + vehicle addMagazineTurret [magazineName, turretPath, ammoCount] - $Code$hintSilent "You texte comes here !"$/Code$ + $Code$_tank addMagazineTurret ["SmokeLauncherMag",[0,0]];$/Code$ + + $Code$_tank addMagazineTurret ["20Rnd_120mmSABOT_M1A2",[0]];$/Code$ - undefined / local + local / global - Nothing + Nothing + - hint + addVest - Outputs a multi-line hint message in the left upper corner of the screen (in the right upper corner in Arma). This version of hint is supposed to play a sound when hint is shown, but this varies between games and versions. Use hintSilent for soundless hint. - The effect of this command is local, i.e. the hint will only show on the computer command was executed. + Create a new vest and try to link it into vest slot. - https://community.bistudio.com/wiki/hint + https://community.bistudio.com/wiki/addVest - hint String/Structured_Text + Object addVest String - hint text + unit addVest type - $Code$hint "Press W to move forward. \nPress S to move backwards." - outputs the following message: - Press W to move forward. - Press S to move backwards. - Known Problems: Avoid hint messages that exceed the screen, as this may lead to crashes.$/Code$ + $Code$player addVest "V_TacVest_blk_POLICE";$/Code$ - undefined / local + undefined / undefined - Hint can be used with formatting like this: - $Code$ hint format ["Hello %1", player ]$/Code$ - - To remove the hint box from the screen, pass a null string ( "" ) to the command. - $Code$ hint ""$/Code$ - - hint happily accepts structured text : - $Code$_starL = " img image='\ca\ui\data\debr_star.paa' align='left'/ "; - _starL = _starL + _starL + _starL; - _starR = " img image='\ca\ui\data\debr_star.paa' align='right'/ "; - _starR = _starR + _starR + _starR; - _title = " t color='#ff0000' size='1.2' shadow='1' shadowColor='#000000' align='center' TITLE /t "; - _text = "Bla bla bla bla bla..."; - hint parseText (_starL + _starR + _title + _text); - $/Code$ - (Tested with 1.14, 1.15 beta and 1.16 beta) - - (October 20, 2014) - Be careful when using hints to visualize the effects of commands using the Debug Console. Hint can accept an undefined variable and neither the error nor the hint is shown, the command simply fails. Also notice how the hint command should be "hint str _o;" - $Code$for "_i" from 0 to 50 do - { - hint _o; - };$/Code$ - tested in A3 1.32.127785 In a script, an "undefined variable" error will be shown as expected. - - (October 21, 2014) - Contrary to what's written under "Examples", Arma 3 will happily display hints that far exceed screen space. However, as hints get longer, FPS suffers tremendously. - (tested in Debug Console, A3 1.32.127785, using: - $Code$hint str (( nearestObjects [player, ["BUILDING"], 100]) - [player]); [] spawn { sleep 5; systemChat str diag_fps;}; - hint str (( nearestObjects [player, ["BUILDING"], 1000]) - [player]); [] spawn { sleep 5; systemChat str diag_fps;};$/Code$ - Results were: 59.7015 and 5.17297, respectively. Drawing a hint even longer than this, such as nearestObjects with a radius of 10,000 or 100,000 reduces your FPS so much Arma 3 appears to crash, though it doesn't. - Unrelated: Hints will stay on screen for 30 seconds, then fade away over the course of 5 seconds. Tested with: (A3 1.32.127785) - $Code$hint "a";[] spawn{_counter = 0;while {true} do{sleep 1;_counter = _counter + 1;systemChat str _counter;};};$/Code$ - - (February 17, 2015) - An open dialog will pause the 30-second hint fade timer. - (A3 1.38.128937) - - (March 25, 2017) - The hint sound is audible only when you have the music volume turned up above 0 in the audio settings. Otherwise, it seems to act the same as hintSilent. - This is important because if you are running a hint that fires at 30 fps or more, the hint will slow down machines that have the music volume turned up but won't slow down machines that have the music volume turned off. - Best practice is to use hint for an alert to the player and use hintSilent for a makeshift display of data to the player that is updated fairly often. - Nothing + Nothing + - hmd + createMine - Returns class name of currently used Head Mounted Display. Returns an empty string if the slot is empty. + Creates a mine of the given type (type is the name of the subclass of CfgVehicles). If the markers array contains several marker names, the position of a random one is used, otherwise, the given position is used. The mine is placed inside a circle with this position as its center and placement as its radius. - https://community.bistudio.com/wiki/hmd + https://community.bistudio.com/wiki/createMine - hmd Object + createMine Array - hmd unit + createMine [type, position, markers, placement] - $Code$_nvgs = hmd player ; //NVGoggles$/Code$ + $Code$_mine = createMine ["MineMine", position player, [], 0];$/Code$ - global / undefined + undefined / undefined + (June 5, 2017) + Note that this command uses AGL (very similar to ASL) positions, so if you want to use the moored or seabed mine, you'll have to find the appropriate negative z value that is underwater and convert that to ASL. + Also note that you can't adjust the positions of sea mines after they've been created. The command is either ignored or not propagated across the network to clients. - String + Object + - hostMission + showCuratorCompass - Host the mp mission described by config class. Should be called as reaction to some UI action in some dialog. - For example you can start a MP scenario from a button. It creates a host and takes you to the lobby with the scenario loaded. - You need to provide the display which is active when the hostMission command is called. + Hides or shows compass in curator interface. - https://community.bistudio.com/wiki/hostMission + https://community.bistudio.com/wiki/showCuratorCompass - hostMission Array + showCuratorCompass Boolean - hostMission [pConfig, pDisplay] + showCuratorCompass bool - $Code$hostMission [configMissionName, display];$/Code$ - - $Code$hostMission [ configFile /"CfgMissions"/"MPMissions"/_scenarioClassName, _currentlyActiveDisplay];$/Code$ - - $Code$// Launch host mission dialog in Arma 3 from a client on dedicated server - hostMission [ - configFile "CfgMissions" "MPmissions" "MP_COOP_m01", - findDisplay 46 - ];$/Code$ + $Code$showCuratorCompass true;$/Code$ undefined / undefined - (January 03, 2011) - The command must be called in the main menu or something similar menu it seems. - Nothing + Nothing + - htmlLoad + lbColorRight - Load HTML from file to given control. File path is relative to current mission dir or an absolute path (with drive letter etc.). The command is subject to restrictions, imposed by CfgCommands class. + Returns the text color of the item (right) with the given index of the listbox or combobox with id idc of the topmost user dialog. + The color is returned in format Color. - https://community.bistudio.com/wiki/htmlLoad + https://community.bistudio.com/wiki/lbColorRight - Control htmlLoad String + lbColorRight Array + + Control lbColorRight Number - control htmlLoad filename + lbColorRight [idc, index] + + control lbColorRight index - $Code$_control htmlLoad "briefing.html";$/Code$ - - $Code$_control htmlLoad "http://www.bistudio.com/newsfeed/arma3_news.php?build=main // [1]$/Code$ + $Code$_colour = lbColorRight [101, 0];$/Code$ - $Code$// Display news item: - 0 = 0 spawn { - disableSerialization ; - _html = findDisplay 46 createDisplay "RscCredits" ctrlCreate ["RscHTML", -1]; - _html ctrlSetBackgroundColor [0,0,0,0.8]; - _html ctrlSetPosition [ safeZoneX, safeZoneY, safeZoneW, safeZoneH ]; - _html ctrlCommit 0; - _html htmlLoad "http://www.bistudio.com/newsfeed/arma3_news.php?build=main - };$/Code$ + $Code$_color = _control lbColorRight 0;$/Code$ - undefined / undefined + local / local - (September 7, 2014) - htmlLoad works with URL's as well as html files. - - (September 7, 2014) - While surprisingly htmlLoad does work with URLs as pointed above, the operation is blocking, meaning the whole game will freeze until the operation is complete. Therefore it is not recommended to use this command in such way. - - (April 21, 2015) - Example use of URL can be found in BIS_fnc_GUInewsfeed with the function browser. - - (October 7, 2015) - (Arma 3) In order to use URLs, they must be included in CfgCommands - allowedHTMLLoadURIs. In order to use URIs with params a wildcard * character is supported - Script Example : - $Code$_newsOnline = "http://alivemod.com/alive_news.php?map=" + _map + "&mission=" + _mission + "&player=" + _player; - _ctrlHTML htmlLoad _newsOnline;$/Code$ - Config Example: - $Code$class CfgCommands { - allowedHTMLLoadURIs[] += { - "http://alivemod.com/alive_news.php*" - }; - };$/Code$ + More information on the LB command family can be found here - Nothing + Array - Array + - humidity + setFriend - Returns the current humidity value. 0 is no humidity and 1 is 100% humidity. Humidity value quickly changes from 0 to 1 when rain starts, then slowly changes from 1 to 0 when rain stops. + Sets how friendly side1 is with side2. For a value smaller than 0.6 it results in being enemy, otherwise it's friendly. + Intended to be used on mission start. Changing value during mission can cause unexpected errors in AI behavior. See also Side relations. - https://community.bistudio.com/wiki/humidity + https://community.bistudio.com/wiki/setFriend - humidity + Side setFriend Array - humidity + side1 setFriend [side2, value] - $Code$currentHumidity = humidity ;$/Code$ - - $Code$skipTime -24; - 86400 setOvercast 1; - skipTime 24; - [] spawn { - 10 setRain 1; - sleep 10; - 10 setRain 0; - }; - onEachFrame { - hintSilent str [ round ( rain * 10) / 10, round ( humidity * 10) / 10]; - };$/Code$ + $Code$west setFriend [ resistance, 0];$/Code$ - undefined / undefined + undefined / global + This scripting command must be executed on the server to work properly in multiplayer + + (18:49, 28 December 2006) + This command might be buggy in ArmA (or the description regarding enemy status is wrong). See this discussion. + + (11:25, 30 November 2007) + Setting the civilian side to be the enemy of any other side will result in the other side attacking inanimate mission editor placed objects such as empty vehicles and static objects, since these objects belong to the civilian side. + + (15:57, 27 February 2008) + Be aware that this command only sets the friendliness of one side. If you want to have both sides attacking each other, you have to set both: $Code$Resistance setFriend [East, 0]; + East setFriend [Resistance, 0];$/Code$ + + (October 11, 2014) + (Arma 3 1.30 stable) It is possible to make a side hostile towards itself. + $Code$ west setFriend [ west, 0]; $/Code$ + It is only possible to do so with west / blufor, east / opfor, independent / resistance and civilian. This essentially creates a free for all deathmatch. Affects AI behaviour too. - Number + Nothing + - if + comment - This operator creates a If Type which is used in the if-construct as described here. + Define a comment. + Mainly used in SQF Syntax, as you're able to introduce comment lines with semicolons in a SQS script. - https://community.bistudio.com/wiki/if + https://community.bistudio.com/wiki/comment - if Boolean + comment String - if condition + comment commentMsg - $Code$_retVal = if (1 0) then { "It's true" } else { "It's false" }; - hint str _retVal$/Code$ + $Code$// script.sqs + comment "This is a commented line"$/Code$ - $Code$_val = if ( true ) then [ { "true" }, { "false" } ]; - hint _val;$/Code$ + $Code$// function.sqf + comment "This is a commented line";$/Code$ undefined / undefined - (Jan 31, 2007) - Any _local variables you declare within the body of an if / then statement (ie between the curly braces) are local to that 'if' statement, and are destroyed at the end of the statement. If you know you want to use the variable outside the 'if' statement, make sure your declare it before the 'if' statement. + (September 12, 2009) + Like ArmA, you can't use brackets to make a multi-lines comment. But, in a sqf file, you can make a comment as follow : + $Code$ comment " + first line + seconde line";$/Code$ - (Jan 17, 2010) - (A2 1.05) If the condition is nil then neither the "then" nor the "else" section get executed, but the script will proceed with no error messages. - Example code: - $Code$ - hint "script started"; //will get executed - if (nil) then - { - hint "true"; // will never get executed - } - else - { - hint "false"; // will never get executed - }; - sleep 3; - hint "script ended"; //will get executed$/Code$ + (November 4, 2016) + If a file is loaded with preprocessFile, execVM or spawn (but not loadFile), you may also define C-like comments using //... and /*...*/. - (June 5, 2015) - If you only need to choose between 2 raw values, it is possible to use the following trick to avoid using code blocks, as required by the if command, which results in greater atomicity and faster execution: - $Code$_result = [falseValue, trueValue] select condition;$/Code$ - The select command treats "false" as 0 and "true" as 1, therefore you can feed it a condition determining the array index of the value to be returned. Here is another example: - $Code$_result = [1,-1] select (_this 0); // If _this is less than 0, _result will be equal to -1, otherwise it will be 1$/Code$ - This feature was added in Arma 3. + (November 4, 2016) + comment can also be used to create comments inside trigger activation fields where // or */...*/ does not work. - If_Type + Nothing + - image + step - Creates a structured text containing the given image. + Optionally can set step. If you want to count down, step must be specified, and set negative. Default value is 1. - https://community.bistudio.com/wiki/image + https://community.bistudio.com/wiki/step - image String + For_Type step Number - image filename + for step stepSize - $Code$_txt1 = image "data\isniper.paa";$/Code$ + $Code$for "_x" from 20 to 10 step -2 do {..code..}$/Code$ undefined / undefined - (March 21, 2009) - Although there is a dedicated image command, parseText gives more options: - $Code$_imageText = parseText " img size='5' color='#ff0000' image='fish.paa'/ "$/Code$ - Structured_Text + For_Type + - importAllGroups + setPosATL - Imports all groups into the RTE. - i - Some Old Editor Command + Sets the position of an object relative to the terrain. - https://community.bistudio.com/wiki/importAllGroups + https://community.bistudio.com/wiki/setPosATL - importAllGroups Control + Object setPosATL Array - importAllGroups map + object setPosATL pos - + $Code$player setPosATL [ getPosATL player select 0, ( getPosATL player select 1) - 10, getPosATL player select 2];$/Code$ + - undefined / undefined + global / global + (Feb 26, 2012) + Please Note : this command demands PositionATL format ; one does not simply give 2D position, as this function won't do anything. + + (November 11, 2014) + If you plan on creating bases through script, setPosATL and getPosATL will be your friends. Other commands like getPos or getPosASL will return the position relative to any objects that are underneath. I wrote a base building helper script and through multiple tests, I have found that getPosATL is the absolute best way to get position for objects that are over land. - Nothing + Nothing + - importance + preloadTitleObj - Returns a location's importance value. + Object title - Preload data the object can be defined in the Description.ext file. - https://community.bistudio.com/wiki/importance + https://community.bistudio.com/wiki/preloadTitleObj - importance Location + preloadTitleObj Array - importance location + preloadTitleObj [name, type] + + preloadTitleObj [name, type, speed, showInMap] - $Code$_locationImportance = importance myLocation$/Code$ + $Code$_ok=preloadTitleObj ["BISLogo","plain"]$/Code$ undefined / undefined @@ -32301,265 +34077,202 @@ - Number + Boolean + - inAreaArray + ctSetRowTemplate - Filters given list of Objects and/or Positions in relation to the given area, defined by a trigger, marker, location or array. Returns array of Objects and/or Positions from the list that are inside the area + Takes config path to the new row template. Clears the whole RscControlsTable and sets the new row template (Deleting all rows and headers is easier to implement than replacing the rows and filling them with new data. IDCs could overflow etc.). - https://community.bistudio.com/wiki/inAreaArray + https://community.bistudio.com/wiki/ctSetRowTemplate - Array inAreaArray Object - - Array inAreaArray String - - Array inAreaArray Location - - Array inAreaArray Array + Control ctSetRowTemplate Config - positions inAreaArray trigger - - positions inAreaArray marker - - positions inAreaArray location - - positions inAreaArray [center, a, b, angle, isRectangle, c] + Control ctSetRowTemplate Config - $Code$vehicles inAreaArray trigger_1;$/Code$ - - $Code$allUnits inAreaArray marker_1;$/Code$ - - $Code$allPlayers inAreaArray location_1;$/Code$ - - $Code$allDead inAreaArray [[100, 100, 0], 20, 30, 45, false, 10];$/Code$ + $Code$_control ctSetRowTemplate _configPath;$/Code$ - undefined / undefined + local / local - (June 11, 2017) - The array you send the command can be filtered. For example: - $Code$ vehicles inAreaArray "mymarker" select {_x isKindOf "StaticWeapon"}$/Code$ - Will return only the statics inside the given marker - Array - Array - Array - Array + Nothing + - inArea + setFormDir - Checks whether given position is inside given area. The area is usually a rectangle or an ellipse defined similar to triggerArea format. Hence argument for this command could be a trigger, a marker, a location or an array in format [center, a, b, angle, isRectangle, c]. This command also supports hexagon area which can be created from ellipse when both a and b are negative. Hexagon ellipses are also supported by both marker creation and drawEllipse. - Alternatively, use inAreaArray to check multiple positions/objects within area. + Set group formation heading. Accepted heading range is 0 to 360. Formation is facing this direction unless enemy is seen. When group is moving, this value is overriden by movement direction. - https://community.bistudio.com/wiki/inArea + https://community.bistudio.com/wiki/setFormDir - Array/Object inArea Object - - Array/Object inArea String - - Array/Object inArea Location - - Array/Object inArea Array + Object/Group setFormDir Number - position inArea trigger - - position inArea marker - - position inArea location - - position inArea [center, a, b, angle, isRectangle, c] + group setFormDir heading - $Code$_playerIsInside = player inArea _myTrigger;$/Code$ + $Code$_group1 setFormDir 180;$/Code$ - $Code$_positionIsInside = _myPosition inArea [[100, 100, 0], 20, 30, 45, false ];$/Code$ + $Code$_unit1 setFormDir random 360;$/Code$ + + $Code$//center the main turret + ( group BIS_Crew1) setFormDir ( getDir BIS_Armor);$/Code$ - undefined / undefined + local / global + (November 22, 2014) + When applied to AI, setFormDir will set unit formation direction, which in turn will force unit to change direction to match formation direction, however unit will stop turning as soon as unit direction is +/- 30 degrees of the formation direction. To precisely match formation direction, additional setDir is required: + $Code$_unit setFormDir 45; + _unit setDir 45; + hint str direction _unit; //45$/Code$ - Boolean - Boolean - Boolean - Boolean + Nothing + - inGameUISetEventHandler + mod - Sets given event handler of in-game UI. If EH function returns true, performed action is overridden. Event handlers available are: - "PrevAction" - mouse scroll up - "Action" - action key press - "NextAction" - mouse scroll down - This is "set" type EH, which means it will replace previously set EH of the same type. So to remove EH, set another one with empty string "" for the function. - Since Arma 3 v1.49.131743 this EH returns array of params for selected/activated action in _this variable: - 0: Object - target object to which action is attached - 1: Object - caller object, basically player - 2: Number - index of the action in action menu (0 - top most) - 3: String - engine based action name ("User" for user added actions) - 4: String - localized action plain text as seen by the caller - 5: Number - action priority value - 6: Boolean - action showWindow value - 7: Boolean - action hideOnUse value - 8: String - action shortcut name or "" - 9: Boolean - action menu visibility (on first scroll or action press the menu is still invisible, so no action is performed, only menu is shown) - 10: String - EH event name + Remainder of a divided by b. - https://community.bistudio.com/wiki/inGameUISetEventHandler + https://community.bistudio.com/wiki/mod - inGameUISetEventHandler Array + Number mod Number - inGameUISetEventHandler [handlerName, function] + a mod b - $Code$inGameUISetEventHandler ["Action","hint 'Lights, Camera, Action!'; true "];$/Code$ - - $Code$inGameUISetEventHandler ["PrevAction", " hint str _this; false "]; - inGameUISetEventHandler ["NextAction", " hint str _this; false "]; - inGameUISetEventHandler ["Action", " hint str _this; false "];$/Code$ - - $Code$// Deny any weapon disassembly: - inGameUISetEventHandler ["Action", " - if (_this select 3 == 'DisAssemble') then { - hint 'You are not allowed to do this'; - true - } - "];$/Code$ - - $Code$// Detect explosive/mine placement: - onMagazineUse = ' - params ["_target", "", "", "_action", "", "", "", "", "", "", "_event"]; - if (_action == "UseMagazine") then { - if (_event == "Action") then { - 0 = _target spawn { - waitUntil {!(all_magazines isEqualTo magazines _this)}; - { - 0 = all_magazines deleteAt (all_magazines find _x); - } count magazines _this; - hint format ["Magazine Used: %1", all_magazines select 0]; - } - } else { - all_magazines = magazines _target; - }; - }; - false - '; - inGameUISetEventHandler ["PrevAction", onMagazineUse]; - inGameUISetEventHandler ["NextAction", onMagazineUse]; - inGameUISetEventHandler ["Action", onMagazineUse];$/Code$ + $Code$_rem = 3 mod 2; + // Result is 1$/Code$ - undefined / local + undefined / undefined - (May 12, 2016) - In case of the "Action" event, (param 6 || param 9) also denotes if the action is performed or not. For example, if the action menu is closed or fading off, pressing Spacebar will bring it up and trigger an "Action" event; in that case, param 9 (action menu visibility) is false. But if the action menu is open, and Spacebar is pressed to perform the selected action, then param 9 will be true. If param 6 (showWindow) is true, then it means the action was performed, regardless of param 9. - - (February 08, 2017) - This powerful command can override the actions (previous/next/action), depending on true/false return. But, the command overrides itself, no matter of the returned value. That means, if two mods or scripts are using the same command parameter, say 'action', the last inGameUISetEventHandler 'action' will override the first one. Example: trigger1 : - $Code$inGameUISetEventHandler ["Action","hint 'action for mod 1';true "];// true or false doesn't matter here$/Code$ - trigger2 (delayed): - $Code$inGameUISetEventHandler ["Action","false "];// true or false doesn't matter here$/Code$ - trigger2 will run after trigger1, then, you'll never see the hint, what ever the trigger2 action code could be. What ever could be the last code, it will override all previous ones. You have to group these codes in a same event handler. But, beyond this, inGameUISetEventHandler is not stackable and implies a competition between scripts (or mods) using it. + (01:34, 16 April 2006) + Remainder is calculated in real domain. + mod is identical to a % b + You can use mod to round a decimal number down to the nearest whole number. For example: If you wanted to use the command random to generate a whole number between 0 and 5, you could put this in a script: + $Code$_rand = random 6; + _num = _rand - (_rand mod 1); + $/Code$ + In A1, the new commands round, floor or ceil would be the easier way to round. - Nothing + Number + - inPolygon + setAnimSpeedCoef - Checks whether position is inside given polygon + Sets a coefficient for animation speed - https://community.bistudio.com/wiki/inPolygon + https://community.bistudio.com/wiki/setAnimSpeedCoef - Array inPolygon Array + Object setAnimSpeedCoef Number - position inPolygon polygon + unit setAnimSpeedCoef coef - $Code$_isInside = [100,100,0] inPolygon [[0,0,0],[1000,1000,0],[1000,0,0]];$/Code$ + $Code$player setAnimSpeedCoef 0.75;$/Code$ undefined / undefined + (November 14, 2016) + Increasing animation speed of a unit also increases its run/walk speed (thanks to Killzone Kid ) + + (November 27, 2016) + Setting negative values with this makes animations act in reverse or make you stuck sliding in unknown directions. - Boolean + Nothing + - inRangeOfArtillery + profileNamespace - Returns true if all given units are able to fire at given position with given magazineType. + Returns the global namespace attached to the active user profile. Use setVariable and getVariable to save and load data to and from this Namespace. A variable can be deleted by setting its value to nil. By default the variables set in this namespace will exist while the game is running. In order to make variables save permanently, use saveProfileNamespace before the game is over. + The variables are stored next to the user profile in a file named myUsername.vars.GAMENAME (e.g. in the My Documents\Take On Helicopters folder). - https://community.bistudio.com/wiki/inRangeOfArtillery + https://community.bistudio.com/wiki/profileNamespace - Position inRangeOfArtillery Array + profileNamespace - pos inRangeOfArtillery [[unit], magazineType] + profileNamespace - $Code$_isInRange = getMarkerPos "myTarget" inRangeOfArtillery [[myArty], "32Rnd_155mm_Mo_shells"]$/Code$ + $Code$_namespace = profileNamespace ;$/Code$ + + $Code$profileNamespace setVariable ["var_kills",10000]; + _playerKills = profileNamespace getVariable "var_kills";$/Code$ - global / undefined + undefined / undefined - (July 10, 2015) - Using an empty artillery vehicle will return false. + The variables are loaded when the user profile is loaded or changed. - Boolean + Namespace + - incapacitatedState + tvSetPictureColorSelected - Returns the incapacitated state of the given unit. + Sets the color of the left picture of a tree item defined by path when item is selected - https://community.bistudio.com/wiki/incapacitatedState + https://community.bistudio.com/wiki/tvSetPictureColorSelected - incapacitatedState Object + Control tvSetPictureColorSelected Array - incapacitatedState person + control tvSetPictureColorSelected [path, color] - $Code$_result = incapacitatedState player;$/Code$ + $Code$_control tvSetPictureColorSelected [[0], [1,0,1,1]]$/Code$ undefined / undefined @@ -32567,312 +34280,453 @@ - String + Nothing + - independent + switchCamera - Pre-defined variable for the independent side. - Alias for resistance. + Switch camera to given vehicle / camera. Mode is one of: + "INTERNAL" : 1st person + "GUNNER" : optics / sights + "EXTERNAL" : 3rd person + "GROUP" : group + "CARGO" : same as "INTERNAL" + If you switch to a unit in a vehicle, this command uses the correct turret. Control over the unit is not given to the player. Use selectPlayer or a combination of switchCamera and remoteControl to achieve this. - https://community.bistudio.com/wiki/independent + https://community.bistudio.com/wiki/switchCamera - independent + Object switchCamera String + + switchCamera Object - independent + target switchCamera mode + + switchCamera target - $Code$// SQF: - if (( side _unit) == independent ) then { - hint "This is a independent unit!"; - };$/Code$ + $Code$player switchCamera "Gunner";$/Code$ + + $Code$vehicle player switchCamera "External";$/Code$ undefined / undefined + (May 16, 2015) + Force top down view: $Code$cam = "Land_HandyCam_F" createVehicleLocal [0,0,0]; + cam hideObject true ; + cam attachTo [ player, [0,0,10]]; + cam setVectorUp [0,0.99,0.01]; + cam switchCamera "Internal"; + findDisplay 46 displayAddEventHandler ["MouseButtonDown", { + if (_this select 1 == 0) then { + player forceWeaponFire [ currentMuzzle player, currentWeaponMode player ]; + }; + false + }]; + findDisplay 46 displayAddEventHandler ["KeyDown", { + if (_this select 1 in actionKeys "ReloadMagazine") then { + reload player ; + }; + false + }];$/Code$ - Side + Nothing - Nothing + - in + drawLine3D - Checks whether value is in array, unit in vehicle or position inside location. In case of value in array check, String values will be compared on CaSEseNsiTIve basis (see Example 2). Note: In Arma 2 you can not test for arrays within arrays using this command. + Draws a line of a given color between two 3D positions. Command has to be executed each frame. Use onEachFrame or addMissionEventHandler "Draw3D". - https://community.bistudio.com/wiki/in + https://community.bistudio.com/wiki/drawLine3D - Anything in Array - - Object in Object - - Array in Location + drawLine3D Array - value in array - - unit in vehicle - - position in location + drawLine3D [start, end, color] - $Code$1 in [0,1,2]; //true$/Code$ - - $Code$"lol" in ["Lol", "LOL", "loL"]; //false - "loL" in ["Lol", "LOL", "loL"]; //true$/Code$ - - $Code$// Arma 3: - [1,2,3] in [[1,2,3],[4,5,6]]; //true$/Code$ - - $Code$_isInCar = player in car;$/Code$ - - $Code$_isInside = [1000,2000,0] in myLocation;$/Code$ + $Code$onEachFrame { + drawLine3D [ getPos player, getPos cursorTarget, [1,1,1,1]]; + };$/Code$ undefined / undefined - (15:58, 18 January 2007 (CET)) - For a case- insensitive test use count : - $Code${_x == "lol"} count ["Lol", "LOL", "loL"]; //returns 3.$/Code$ - Checking if an array (for example a position) is in another array doesn't produce an error, but it will always return false. e.g. - $Code$[0,0,0] in [[0,0,0],[1,4,3],[5,3,1]]; //returns: false.$/Code$ + (August 31, 2013) + As command syntax indicates, this command expects starting and ending position in format PositionAGL meaning that over the land it expects PositionATL and over the sea PositionASLW. Use additional ASLToAGL and AGLToASL commands wherever is necessary. + $Code$ addMissionEventHandler ["Draw3D", { + drawLine3D [ ASLToAGL eyePos soldier1, ASLToAGL eyePos soldier2, [1,0,0,1]]; + }];$/Code$ - (August 23, 2014) - As of Arma 3 1.26: - $Code$[0,0,0] in [[0,0,0],[1,4,3],[5,3,1]]; //returns true - [1,2,3] in [[1,2,3],[4,5,6]]; //returns true - $/Code$ - Assuming it is now using comparison as found in isEqualTo + (February 18, 2015) + Visible through fog and past draw distance. - Boolean - Boolean - Boolean + Nothing + - inflamed + ctrlText - Checks if fireplace is inflamed (burning) or not. To check if a unit is receiving damage from fire, use isBurning command. + Returns the text of a control of the currently active user dialog. This command can be used on static texts, buttons, edit lines and active texts as well as for images, where it returns the image path. + Read Dialog Control for more information about user dialogs and controls. - https://community.bistudio.com/wiki/inflamed + https://community.bistudio.com/wiki/ctrlText - inflamed Object + ctrlText Number + + ctrlText Control - inflamed fireplace + ctrlText idc + + ctrlText controlName - $Code$_inflamed = inflamed _fireplaceOne;$/Code$ + $Code$_text = ctrlText 100$/Code$ + + $Code$_text = ctrlText _control$/Code$ - global / undefined + local / undefined - Boolean + String - String + - inflame + nearestObjects - Control fireplace burning. Set inflame to true (on) or false (off). + Returns a list of nearest objects of the given types to the given position or object, within the specified distance. If more than one object is found they will be ordered by proximity, the closest one will be first in the array. Alternatively, you use nearObjects command, which doesn't sort results. + position can use the format: + [[x,y,z], ["ClassName",...], radius] + or + [object, ["ClassName",...], radius] + To use it without any ClassName filter: + [object or position, [], radius]. + A list of ClassName types (Tanks eg) can be found in CfgVehicles + Since Arma 3 v1.65.138818 it is possible to switch search and sorting mode between 2D and 3D - https://community.bistudio.com/wiki/inflame + https://community.bistudio.com/wiki/nearestObjects - Object inflame Boolean + nearestObjects Array - fireplace inflame burn + nearestObjects [position, types, radius, 2Dmode] - $Code$_fireplaceOne inflame true ;$/Code$ + $Code$nearestObjects [ player, ["Car","Tank"], 200];$/Code$ + + $Code$nearestObjects [ player, ["house"], 200];$/Code$ + + $Code$nearestObjects [[2716,2949,0], ["Car","Truck"], 100];$/Code$ + + $Code$// Return every object in 50 metres radius around player: + nearestObjects [ player, [], 50]$/Code$ - global / global + undefined / undefined + (unknown) + To get a list with alive targets for various situations use this construct: + $Code$_nearestTargets = nearestObjects [_submunScanPos, ["VBS2_TANK","TANK"], _scanArea]; + _validNearestTargets = []; + { if ( alive _x) then {_validNearestTargets set [( count _validNearestTargets),_x];};} forEach _nearestTargets; + $/Code$ + results in _validNearestTargets being filled with targets == alive.. (you could use other conditions there, of course!) + -- Vigilante + + (10. Aug. 2010) + Passing an empty array to define the types will also return objects with no class at all (such as trees, bushes, stones,...). + Example: + $Code$_objects = nearestObjects [_position, [], _radius];$/Code$ + Passing the array ["All"] is not the same and will only return objects that have some sort of class. + + (11.09.2013) + If you want to detect nearby grenades for the position of a unit, for example, using 'nearestObjects' won't work. You have to use + 'nearObjects' instead. + $Code$ count ( nearestObjects [_unit, ["GrenadeHand"], 30]) // WON'T WORK$/Code$ + Won't ever return anything but 0. + $Code$ count (_unit nearObjects ["GrenadeHand", 30]) // WORKS!$/Code$ + Will work. + + (March 22, 2014) + The distance from which an object is determined to be inside the radius is calculated from its model center (object modelToWorld [0,0,0]), and not the position returned by getPos/ATL/ASL. If an object is used as the origin from which to scan, distance is calculated from its model center as well. + + (October 26, 2014) + Return all trees in 100m radius around player: + $Code$trees = []; + { + if ( str _x find ": t_" -1) then { + trees pushBack _x; + }; + } forEach nearestObjects [ player, [], 100];$/Code$ + + (August 27, 2015) + If you use "Man" as the class to look for, it will only find dismounted men. IE, men in vehicles will NOT be found. + + (January 8, 2016) + The first call to this command can take significantly longer then consecutive calls. But even after the objects in given radius were cached, the sorting this command performs could be quite expensive. For example to sort ~7000 object it might take up to 100ms. For performance reasons you can use nearObjects instead, which is basically the same command but without added sorting. + + (March 2, 2016) + In Arma 3, nearestObjects is partially broken and is unable to return nearby placed explosive charges or mines when searching by classnames. Use nearObjects, nearestObject or allMines instead. + Example of non-functional code: + $Code$//always returns nothing, even if there are objects that should be returned + nearestObjects [position player, ["APERSMine_Range_Ammo", "SatchelCharge_Remote_Ammo"], 10]$/Code$ + + (October 31, 2016) + Since Arma 3 v1.65.138818 the default sorting is done according to 3D distance not distance2D as before. This is an attempt to correct some very old bug in implementation. - Nothing + Array + - inheritsFrom + removePrimaryWeaponItem - Returns base entry of config entry. + Removes given weapon item from the primary weapon cargo space. + As of Arma 3 DEV 1.37, this command also supports weapon magazines. - https://community.bistudio.com/wiki/inheritsFrom + https://community.bistudio.com/wiki/removePrimaryWeaponItem - inheritsFrom Config + Object removePrimaryWeaponItem String - inheritsFrom config + unit removePrimaryWeaponItem item - $Code$_base = inheritsFrom ( configFile "CfgVehicles" "Car"); - // Result is Config entry for class "LandVehicle"$/Code$ - - $Code$// Print parent tree of given config class: - fnc_printParents = - { - disableSerialization ; - if (! isClass _this) exitWith { hint "Argument is not a config Class"}; - private _parents = []; - while {! isNull _this} do - { - _parents pushBack configName _this; - _this = inheritsFrom _this; - }; - reverse _parents; - private _tv = findDisplay 46 createDisplay "RscDisplayEmpty" ctrlCreate ["RscTree", -1]; - _tv ctrlSetPosition [0,0,1,1]; - _tv ctrlSetBackgroundColor [0,0,0,0.5]; - _tv ctrlCommit 0; - private _path = []; - { - _tv tvAdd [_path, _x]; - _path pushBack 0; - } - forEach _parents; - tvExpandAll _tv; - }; - // Example: - ( configFile "CfgVehicles" typeOf player ) call fnc_printParents;$/Code$ + $Code$player removePrimaryWeaponItem "acc_flashlight";$/Code$ - undefined / undefined + local / global - (Apr 2, 2014) - (A3 1.14)Use BIS_fnc_returnParents if a parents' collection of the given entry is needed. - $Code$ - [( configFile "CfgVehicles" "Land_Atm_02_F"), true ] call BIS_fnc_returnParents ; - //return: ["Land_Atm_02_F","House_Small_F","House_F","House","HouseBase","NonStrategic","Building","Static","All"] - $/Code$ - Not all entries have parent, and please differ parents from path. - $Code$ - inheritsFrom ( configFile "CfgUIColors" "IGUI" "Presets" "PresetA1" "Variables"); - //return: Nothing - $/Code$ - Config + Nothing + - initAmbientLife + setHitIndex - Initialize the ambient life. + Set the current level of damage for a specific Hit Point (specified by its hit part index). All hit points can be obtained with getAllHitPointsDamage command. + 0: no damage + 1: full damage - https://community.bistudio.com/wiki/initAmbientLife + https://community.bistudio.com/wiki/setHitIndex - initAmbientLife + Object setHitIndex Array - initAmbientLife + vehicle setHitIndex [hitPartIndex, damage, useEffects] - + $Code$vehicle player setHitIndex [1, 1];$/Code$ + + $Code$player setHitIndex [7, 0.5];$/Code$ + - undefined / undefined + local / global - Nothing + Nothing + - inputAction + currentNamespace - Return the state of input devices mapped to given input action. - For Arma 3 inputActions see: inputAction/actions. - For Arma 3 inputActions bindings see: inputAction/actions/bindings. - For earlier Arma editions see Category:Key Actions. + Returns current global namespace the script runs in. - https://community.bistudio.com/wiki/inputAction + https://community.bistudio.com/wiki/currentNamespace - inputAction String + currentNamespace - inputAction name + currentNamespace - $Code$inputAction "leanLeft" - // Returns 1 if the button mapped to "leanLeft" is pressed currently else 0.$/Code$ - - $Code$[] spawn { - waitUntil { inputAction "reloadMagazine" 0}; - hint "Reload Key Pressed"; - };$/Code$ + $Code$if ( currentNamespace isEqualTo uiNamespace ) then { hint "This is uiNamespace"};$/Code$ undefined / undefined - (07:38, 15 October 2010 (CEST)) - This command also returns values other than 0 and 1 (like 0.02 or 1.3). Any value greater than zero usually signals that the key or button is pressed. inputAction does not work reliably when used in RscDisplayMission's onKeyDown event handler (the same is probably true for other input related event handlers). + + + Namespace + + + + + + setSpeaker + + + Sets the speaker of a person. In order to setSpeaker dynamically in MP, the command needs to run on every computer with exactly the same params otherwise the speaking unit could appear silent on other PCs. Run this on server: + [bob, "Male02GRE"] remoteExecCall ["setSpeaker", 0]; + + + https://community.bistudio.com/wiki/setSpeaker + + + Object setSpeaker String + + + person setSpeaker speaker + + + $Code$unit1 setSpeaker "Male02GRE";$/Code$ + + + local / local + + + (September 19, 2013) + speaker can be any of the following: + Male01ENG + Male01ENGB + Male01GRE + Male01PER + Male02ENG + Male02ENGB + Male02GRE + Male02PER + Male03ENG + Male03ENGB + Male03GRE + Male03PER + Male04ENG + Male04ENGB + Male04GRE + Male05ENG + Male06ENG + Male07ENG + Male08ENG + Male09ENG - (May 8, 2014) - inputAction does not return the actual state of the queried key when a dialog screen is open. Instead, it will always return 0. + (January 12, 2014) + speakers available in Arma 3 (v1.08) : + Gender + Profile setting + US English (B) for EN-GB available + Greek + Persian + Male + Male01_F + Male01ENG(B) + Male01GRE + Male01PER + Male02_F + Male02ENG(B) + Male02GRE + Male02PER + Male03_F + Male03ENG(B) + Male03GRE + Male03PER + Male04_F + Male04ENG(B) + Male04GRE + Male01PER + Male05_F + Male05ENG + Male05GRE + Male02PER + Male06_F + Male06ENG + Male02GRE + Male03PER + Male07_F + Male07ENG + Male03GRE + Male01PER + Male08_F + Male08ENG + Male04GRE + Male02PER + Male09_F + Male09ENG + Male01GRE + Male03PER + Female + - + - + - + - - (July 31, 2015) - inputAction is capable of returning the state of analog inputs. This includes mouse, joystick, and even TrackIR. A joystick axis will return a value from 0 to 1, while mouse movement returns the rate of change, which can be 1. - Right mouse click is currently not supported, but right mouse hold is. http://feedback.arma3.com/view.php?id=25015 + (November 10, 2014) + In order to stop a unit from talking you can use: + $Code$_unit setSpeaker "NoVoice"$/Code$ + This will have no negative effect on the ability to command the unit. - Number + Nothing + - insertEditorObject + deleteEditorObject - Insert an object to the editor and assign arguments. Create script is,not called. Returns the ID of the new EditorObject. Subtype class is,optional. + Delete the editor object. Requires all editor object links to be removed prior. i Some Old Editor Command - https://community.bistudio.com/wiki/insertEditorObject + https://community.bistudio.com/wiki/deleteEditorObject - Control insertEditorObject Array + Control deleteEditorObject String - map insertEditorObject [type,value,[name1,value1,],subtype class] + map deleteEditorObject object @@ -32880,102 +34734,63 @@ undefined / undefined - (May 7, 2015) - "This works only in the old 3D editor" - KM - String + Any_Value + - intersect + menuURL - Finds named selections in object which are in specified LOD, intersected by given section of a line. Return value is in the form of [selection, distance]. Multiple returned arrays are nested within a single array. No intersection returns []. lodName could be one of the following: - "FIRE" - "VIEW" - "GEOM" - "IFIRE" - ("I" stands for Indirect, almost the same as FIRE) + Returns current URL set in entry on given path. - https://community.bistudio.com/wiki/intersect + https://community.bistudio.com/wiki/menuURL - Array intersect Array + menuURL Array - [object, lodName] intersect [begPos, endPos] + menuURL [idc, path] - $Code$[_tank, "VIEW"] intersect [[1500, 1500, 2], [1550, 1500, 2]];$/Code$ - - $Code$sphere = "Sign_Sphere10cm_F" createVehicle [0,0,0]; - onEachFrame { - _begPos = positionCameraToWorld [0,0,0]; - _begPosASL = AGLToASL _begPos; - _endPos = positionCameraToWorld [0,0,1000]; - _endPosASL = AGLToASL _endPos; - _ins = lineIntersectsSurfaces [_begPosASL, _endPosASL, player, objNull, true, 1, "FIRE", "NONE"]; - if (_ins isEqualTo []) exitWith {sphere setPosASL [0,0,0]}; - _ins select 0 params ["_pos", "_norm", "_obj", "_parent"]; - if !( getModelInfo _parent select 2) exitWith {sphere setPosASL [0,0,0]}; - _ins2 = [_parent, "FIRE"] intersect [_begPos, _endPos]; - if (_ins2 isEqualTo []) exitWith {sphere setPosASL [0,0,0]}; - _ins2 select 0 params ["_name", "_dist"]; - _posASL = _begPosASL vectorAdd ((_begPosASL vectorFromTo _endPosASL) vectorMultiply _dist); - drawIcon3D ["", [1,1,1,1], ASLToAGL _posASL, 0, 0, 0, _name, 1, 0.03, "PuristaMedium"]; - sphere setPosASL _posASL; - };$/Code$ - + - global / undefined + undefined / undefined - (Jul 25, 2007) - The most common LOD is " FIRE ", which identifies the most detailled hitbox used for ammunition. - - (Mar 27, 2014) - Example (In ArmA3 ver 1.14) display returned arrays on cursor entities: - $Code$ - Sto = []; - Fn = { - { - Sto set [_foreachindex,[cursortarget,_x] intersect [(asltoagl (eyepos player)),(screentoworld [0.5,0.5])]]; - } foreach ["FIRE","VIEW","GEOM","IFIRE"]; - hintsilent format ["FIRE: %1, VIEW: %2, GEOM: %3, IFIRE: %4",Sto select 0,Sto select 1,Sto select 2,Sto select 3]; - }; - ["sample_id","onEachFrame","Fn"] call BIS_fnc_addStackedEventHandler; - $/Code$ - Return FIRE: [something], VIEW: [something], GEOM: [something], IFIRE: [something]. - - (August 20, 2015) - intersect will spam.rpt if passed to it object has no skeleton. Use getModelInfo to filter out those objects. - Array + String + - is3DENMultiplayer + taskNull - Returns true if the Eden Editor is in multiplayer mode. Returns true in the following cases: - Multiplayer Preview launched directly from 3DEN - true in preview and only for the creator - MP mission is chosen for editing when creating a server: Multiplayer - Server Browser - Host Server. When 3D EDITOR button is clicked for selected mission and 3DEN is launched, command returns true within the editor environment. (see also is3DEN ) + A non-existing Task. To compare non-existent tasks use isNull or isEqualTo : + taskNull == taskNull ; // false + isNull taskNull ; // true + taskNull isEqualTo taskNull ; // true - https://community.bistudio.com/wiki/is3DENMultiplayer + https://community.bistudio.com/wiki/taskNull - is3DENMultiplayer + taskNull - is3DENMultiplayer + taskNull - $Code$if is3DENMultiplayer then { systemChat "Your hosting a test server!"};$/Code$ + $Code$! isNull taskNull ; // false$/Code$ + + $Code$str taskNull ; // No task$/Code$ undefined / undefined @@ -32983,27 +34798,28 @@ - Boolean + Task + - is3DEN + setVehicleReportRemoteTargets - Returns true if the Eden Editor is currently being used. true when inside editor environment, false during preview. (see also is3DENMultiplayer ) + Sets that the vehicle will share targets that were acquired by its own sensors via datalink to the Side center. - https://community.bistudio.com/wiki/is3DEN + https://community.bistudio.com/wiki/setVehicleReportRemoteTargets - is3DEN + Object setVehicleReportRemoteTargets Boolean - is3DEN + vehicle setVehicleReportRemoteTargets bool - $Code$if is3DEN then { systemChat "Welcome to Eden Editor!"};$/Code$ + $Code$( vehicle player ) setVehicleReportRemoteTargets true;$/Code$ undefined / undefined @@ -33011,113 +34827,142 @@ - Boolean + Nothing + - isAbleToBreathe + setWindForce - If unit is diving and doesn't have a re-breather, it returns false. Diving means the unit's head is underwater. If unit is underwater and has a re-breather, the command returns true. + Set max. wind overall wind changes in time. A time of zero means there will be an immediate change. A wind level of zero is minimal changes and a wind level of one means that wind can change rapidly. - https://community.bistudio.com/wiki/isAbleToBreathe + https://community.bistudio.com/wiki/setWindForce - isAbleToBreathe Object + Number setWindForce Number - isAbleToBreathe unit + time setWindForce wind - + $Code$1800 setWindForce 0.5$/Code$ + undefined / undefined - Boolean + Nothing + - isAgent + setFog - Check if team member is an agent. + Changes the fog smoothly over the the given TransitionTime (in seconds). A time of zero means there will be an immediate change. A fog intensity of zero is minimum fog and a fog level of one is maximum fog. + NOTE : Since Arma 3 this command is MP synchronised, if executed on server, the changes will propagate globally. If executed on client effect is temporary as it will soon change to the server setting. + A little information about how Alt Syntax works. The fogValue is normal fog value that could be set independently with original setFog command. fogBase is the ASL altitude at which the fog will start. 0 is the sea level. fogDecay is how defined the fog start is. The more defined, the denser is the fog. 1 (or -1) are the max values. If it is positive the fog will be generated below fogBase line, if negative, above it. If fogDecay is small, the fog will transition more smoothly from no fog to full fog, and because of that it will cross fogBase line by quite a lot, depending on how small is fogDecay value. Current values of fogDecay and fogBase can be retrieved with fogParams - https://community.bistudio.com/wiki/isAgent + https://community.bistudio.com/wiki/setFog - isAgent Team_Member + Number setFog Number + + Number setFog Array - isAgent teamMember + time setFog fog + + time setFog [fogValue, fogDecay, fogBase] - + $Code$15 setFog 0.5;$/Code$ + + $Code$// Force no fog: + 0 setFog 0; + forceWeatherChange ; + 999999 setFog 0;$/Code$ + + $Code$0 setFog [1, 0.01, 0];$/Code$ + + $Code$// Mountain fog, starts from 70m ASL and thickens more the higher you climb: + 0 setFog [1, -1, 70];$/Code$ + + $Code$// Valley fog, starts from 60m ASL and thickens more the lower you descend: + 0 setFog [1, 1, 60];$/Code$ + + $Code$// Fooooog on the waaaater: + 0 setFog [1, 1, 0];$/Code$ + - undefined / undefined + undefined / global - (May 19, 2017) - One can check if a unit is an agent via - $Code$ isAgent teamMember _unit$/Code$ + This scripting command must be executed on the server to work properly in multiplayer + + Only one script command induced weather change (either setOvercast or setFog) can be happening at a time. Starting a new weather change will immediately halt the current weather change. SetRain changes are independent and can occur simultaneously to a weather change. + + (December 15, 2015) + setTimeMultiplier DOES affect transition time. - Boolean + Nothing - Nothing + - isArray + setAirplaneThrottle - Check if config entry represents array. + Sets a wanted throttle position, works only on player's vehicle. - https://community.bistudio.com/wiki/isArray + https://community.bistudio.com/wiki/setAirplaneThrottle - isArray Config + Object setAirplaneThrottle Number - isArray config + airplane setAirplaneThrottle value - $Code$_ok = isArray (configFile "CfgVehicles") - // Result is false$/Code$ - + undefined / undefined - Boolean + Nothing + - isAutoHoverOn + addMagazinePool - Return true if vehicle has enabled auto hover. (always returns false if the vehicle can't set auto hover) + Add magazines to the magazine pool, of which the player may choose in the following mission. Available in campaigns only. - https://community.bistudio.com/wiki/isAutoHoverOn + https://community.bistudio.com/wiki/addMagazinePool - isAutoHoverOn Object + addMagazinePool Array - isAutoHoverOn vehicle + addMagazinePool [magazineName, count] - $Code$status = isAutoHoverOn vehicle player;$/Code$ + $Code$addMagazinePool ["M16", 20];$/Code$ undefined / undefined @@ -33125,493 +34970,443 @@ - Boolean + Nothing + - isAutonomous + waypointBehaviour - Returns true if UAV is in autonomous mode. + Gets the waypoint behavior. - https://community.bistudio.com/wiki/isAutonomous + https://community.bistudio.com/wiki/waypointBehaviour - isAutonomous Object + waypointBehaviour Array - isAutonomous uav + waypointBehaviour waypoint - $Code$bool = isAutonomous uav;$/Code$ + $Code$waypointBehaviour [groupOne,1]$/Code$ - global / undefined + undefined / undefined - Boolean + String + - isAutotest + saveVar - Returns true if game was started with autotest parameter + Save variable value into the campaign space. This variable is available to all following missions in the campaign. - https://community.bistudio.com/wiki/isAutotest + https://community.bistudio.com/wiki/saveVar - isAutotest + saveVar String - isAutotest + saveVar varname - $Code$_bool = isAutotest$/Code$ + $Code$saveVar "varOne"$/Code$ undefined / undefined + (January 28, 2009) + If you try to saveVar a vehicle saved in your variable (SavedVars = [Car1]; saveVar "SavedVars"), then Car1 will not be properly "saved", refering to ObjNull if you try to use it in subsequent missions, even if a vehicle with the same vehicle varname exists. To get around this, save the vehicle's varname as a string (SavedVars = [str(Car1)]) and then when you need it just use call compile to "unstring" the varname (_car = call compile (SavedVars select 0);). - Boolean + Nothing + - isBleeding + removeDrawLinks - Returns whether the unit is bleeding. + Remove all drawn links for the given editor object for the given editor,object type. Pass an empty string as param type to remove all draw,links for an object. + i + Some Old Editor Command - https://community.bistudio.com/wiki/isBleeding + https://community.bistudio.com/wiki/removeDrawLinks - isBleeding Object + Control removeDrawLinks Array - isBleeding unit + map removeDrawLinks [from,param type] - $Code$if ( isBleeding player ) then { player groupChat "I'm bleeding!!"; }$/Code$ - + undefined / undefined - Boolean + Nothing + - isBurning + benchmark - Returns whether the unit is burning. - This returns true only if unit is damaged by nearby fire, it does not check whether a fireplace is burning, use inflamed command for that. + Returns the value of "3D Performance" in OFP Preferences (flashpoint.cfg). This can be used to estimate the computer performance to adapt CPU and GPU demanding settings like view distance dynamically in missions. - https://community.bistudio.com/wiki/isBurning + https://community.bistudio.com/wiki/benchmark - isBurning Object + benchmark - isBurning unit + benchmark - $Code$if ( isBurning player ) then { player groupChat "I'm burning!!"; }$/Code$ + $Code$? (benchmark 2000) : setViewDistance 2000$/Code$ undefined / undefined + (14 March 2014) + The command is obsolete, it was used in OFP to measure PC performance. In A3 it returns 2000. - Boolean + Number + - isClass + resistance - Check if config entry represents config class. + Resistance side. + When used in a format statement ( hint format ["%1",resistance] ), the string returned is "GUER". - https://community.bistudio.com/wiki/isClass + https://community.bistudio.com/wiki/resistance - isClass Config + resistance - isClass config + resistance - $Code$_ok = isClass ( configFile "CfgVehicles"); - // Result is true.$/Code$ + $Code$// SQS: + ?((side _unit) == resistance ) : hint "This is a resistance unit!"$/Code$ + + $Code$// SQF: + if (( side _unit) == resistance ) then { + hint "This is a resistance unit!"; + };$/Code$ undefined / undefined - (March 2, 2007) - This command allows you to check for the presence of an addon. - isClass (configFile "cfgVehicles" "MyCustomCar") - will return true if the addon "MyCustomCar" is installed, and false if it is not installed. - You will have to know under which class the addon is categorized (in this case "cfgVehicles") to be able to use the right config path. - - (Mar 31, 2014) - (ArmA3 ver 1.14) According to BI Dev Karel Mořický, BIS_fnc_getCfgIsClass provides a comfortable workaround with custom config under description.ext compared with isClass. (But as a function created specifically for A3 campaign, it is in no way intended as a replacement for isClass. So it is not suggested to use it for configFile classes. But isClass instead.) - E.g. - $Code$["Something1","Something2","Something3"] call bis_fnc_getCfgIsClass //Same as isClass (missionconfigfile "Something1" "Something2" "Something3")$/Code$ - Boolean + Side + - isCollisionLightOn + clearOverlay - Returns true if vehicle collision lights are on otherwise false. + Clear the current overlay. + i + Some Old Editor Command - https://community.bistudio.com/wiki/isCollisionLightOn + https://community.bistudio.com/wiki/clearOverlay - isCollisionLightOn Object + clearOverlay Control - isCollisionLightOn vehicle + clearOverlay map - $Code$_collisionLightOn = isCollisionLightOn heli;$/Code$ + $Code$clearOverlay _map,$/Code$ - global / undefined + undefined / undefined - (April 6, 2015) - Bind Collision light action to UserAction 2 - $Code$this addAction ["", { - _this select 1 action [ - ["CollisionLightOn", "CollisionLightOff"] select isCollisionLightOn (_this select 0), - _this select 0 - ]; - }, "", -10, false, true, "User2", "_this == driver _target"];$/Code$ - Boolean + Nothing + - isCopilotEnabled + playMoveNow - Returns true if copilots actions are enabled. + When used on a person,a smooth transition to the given move will be initiated, but all previous playMove are discarded. + List of moves in ArmA 2 List of moves in Armed Assault List of moves in Operation Flashpoint: Resistance + The difference between playMove and playMoveNow is that playMove adds another move to the move queue, while playMoveNow replaces the whole move queue with new move: + $Code$ player switchMove "amovpercmstpsraswrfldnon"; + [] spawn + { + sleep 0.5; + player playMove "amovppnemstpsraswrfldnon"; // player goes prone + player playMove "amovpknlmstpsraswrfldnon"; // player gets up on one knee + };$/Code$ + Compared to: + $Code$ player switchMove "amovpercmstpsraswrfldnon"; + [] spawn + { + sleep 0.5; + player playMove "amovppnemstpsraswrfldnon"; // player never goes prone + player playMoveNow "amovpknlmstpsraswrfldnon"; // player goes down on one knee straight away + };$/Code$ - https://community.bistudio.com/wiki/isCopilotEnabled + https://community.bistudio.com/wiki/playMoveNow - isCopilotEnabled Object + Object playMoveNow String - isCopilotEnabled vehicle + soldier playMoveNow moveName - $Code$if (! isCopilotEnabled myHeli) then { - myHeli enableCopilot true ; - };$/Code$ + $Code$player playMoveNow "AmovPercMevaSlowWrflDf"$/Code$ - global / undefined + local / global - (February 17, 2014) - Only returns whether or not the actions are enabled and shown to the pilot and co-pilot. This will still return TRUE if the pilot uses the 'Lock Controls' action to disable co-pilot controls. - You can use the Arma 3 Event Handler - Controls Shifted to detect 'Take Controls' or 'Release Controls' actions - Boolean + Nothing + - isDLCAvailable + isBurning - Returns true if the DLC is marked as available. (Steam) + Returns whether the unit is burning. + This returns true only if unit is damaged by nearby fire, it does not check whether a fireplace is burning, use inflamed command for that. - https://community.bistudio.com/wiki/isDLCAvailable + https://community.bistudio.com/wiki/isBurning - isDLCAvailable Number + isBurning Object - isDLCAvailable appid + isBurning unit - $Code$_Karts = 288520; - isDLCAvailable _Karts;//Returns true$/Code$ + $Code$if ( isBurning player ) then { player groupChat "I'm burning!!"; }$/Code$ undefined / undefined - (October 19, 2014) - appid can be taken from Steam DLC url. - Karts url is http://store.steampowered.com/app/ 288520 / - Zeus url is http://store.steampowered.com/app/ 275700 / - DLC bundle url is http://store.steampowered.com/app/ 304400 / - Boolean + Boolean + - isDamageAllowed + playAction - A getter for allowDamage command. The command indicates if damage is allowed at current locality, hence local effect of the command. A complete solution for being able to tell whether or not an object can be damaged at current locality looks like this: - $Code$_canBeDamaged = local _obj && isDamageAllowed _obj;$/Code$ + When used on a person, a smooth transition to the given action will be initiated. + For Arma 3 actions see: playAction/actions. - https://community.bistudio.com/wiki/isDamageAllowed + https://community.bistudio.com/wiki/playAction - isDamageAllowed Object + Object playAction String - isDamageAllowed object + soldier playAction action - $Code$_isGod = ! isDamageAllowed player ;$/Code$ + $Code$soldierOne playAction "SitDown"$/Code$ - global / local + local / global - Boolean + Nothing + - isDedicated + terminate - Return true if the machine (executing the command) is a dedicated multiplayer server. In single player returns false. + Terminate (abort) spawned or execVM 'd script. Note : The given script will not terminate immediately upon terminate command execution, it will do so the next time the script is processed by the scheduler. - https://community.bistudio.com/wiki/isDedicated + https://community.bistudio.com/wiki/terminate - isDedicated + terminate Script_Handle - isDedicated + terminate scriptHandle - $Code$if ( isDedicated ) then { diag_log "Dedicated Server on the run !";};$/Code$ + $Code$_script = [] execVM "script.sqf"; + sleep 5; + terminate _script; + hint "'script.sqf' has been terminated after 5 seconds";$/Code$ undefined / undefined - (December 21, 2014) - $Code$ if ( isDedicated ) then { - //run on dedicated server only - }; - if ( isServer ) then { - //run on dedicated server or player host - }; - if ( hasInterface ) then { - //run on all player clients incl. player host - }; - if (! isDedicated ) then { - //run on all player clients incl. player host and headless clients - }; - if (! isServer ) then { - //run on all player clients incl. headless clients but not player host - }; - if (! hasInterface ) then { - //run on headless clients and dedicated server - }; - if (! hasInterface && ! isDedicated ) then { - //run on headless clients only - };$/Code$ - Boolean + Nothing + - isEngineOn + currentMuzzle - Returns true if engine is on, false if it is off. + Returns current muzzle of unit's weapon. + This command will return 0 Number if given object is a unit that is in a vehicle. - https://community.bistudio.com/wiki/isEngineOn + https://community.bistudio.com/wiki/currentMuzzle - isEngineOn Object + currentMuzzle Object - isEngineOn vehicle + currentMuzzle gunner - $Code$_OnOff = isEngineOn _carOne$/Code$ + $Code$_muzzle = currentMuzzle player ;$/Code$ + + $Code$_muzzle = currentMuzzle ( gunner ( vehicle player ));$/Code$ - global / undefined + undefined / undefined - (March 20, 2015) - isEngineOn returns true for static objects without an engine - - (April 6, 2015) - Bind Engine action to User Action 1 - $Code$this addAction ["", - { - _this select 1 action - [ - ["EngineOn", "EngineOff"] select isEngineOn (_this select 0), - _this select 0 - ]; - }, "", -10, false, true, "User1", "_this == driver _target"];$/Code$ - Boolean + String + - isEqualTo + getShadowDistance - Performs strict comparison between var1 and var2 and returns true if equal, otherwise false. Strict means that it would check that both arguments are of the same data type and then compare the values. - Some differences between isEqualTo and == : - It performs case sensitive comparison on Strings - It doesn't throw error when comparing different types, i.e. ("eleven" isEqualTo 11) - It can compare Arrays, Scripts and Booleans ( alive player isEqualTo true ) - It can compare non-existent game objects ( grpNull isEqualTo grpNull ) - It can compare Namespaces ( As of Arma 3 v1.47 ) - It is slightly faster than ==, especially when comparing Strings + Gets the shadows rendering distance. - https://community.bistudio.com/wiki/isEqualTo + https://community.bistudio.com/wiki/getShadowDistance - Anything isEqualTo Anything + getShadowDistance - val1 isEqualTo val2 + getShadowDistance - $Code$_arr1 = [1,[2,[3]]]; - _arr2 = [1,[2,[3]]]; - if (_arr1 isEqualTo _arr2) then { hint "Arrays match!"}$/Code$ - - $Code$if (a isEqualTo b) then { hint "a is equal to b"}; - if !(a isEqualTo b) then { hint "a is not equal to b"};$/Code$ + $Code$_value = getShadowDistance;$/Code$ undefined / undefined - (July 19, 2014) - The behavior of "var1 isEqualTo var2" is pretty much equivalent to "var1 in [var2]", plus the ability to compare arrays, and slightly better performance. - - (December 3, 2014) - Simply put, "isEqualTo" is a binary comparison. Therefor it is very fast but only accepts 100% identical matches. In some other languages this is known as "===" instead of "==". - - (November 3, 2016) - When comparing with nil result is Nothing. - "nil isEqualTo player" returns "Nothing" instead of expected "false" - $Code$diag_log [nil isEqualTo player];$/Code$ - Will print "[bool]" - $Code$diag_log (str (nil isEqualTo player)) + "test";$/Code$ - Will throw Generic error in expression - "+: Type Nothing, expected Number,Array,String,Not a Number" - Boolean + Number + - isEqualTypeAll + clearItemCargoGlobal - Compares types of all elements of an array to the type of a single value. + Removes all items from ammo box (or any general weapon holder container). - https://community.bistudio.com/wiki/isEqualTypeAll + https://community.bistudio.com/wiki/clearItemCargoGlobal - Array isEqualTypeAll Anything + clearItemCargoGlobal Object - arr isEqualTypeAll val + clearItemCargoGlobal box - $Code$_arr = [1,2,3,4,5,6,7,8,9,0]; - _arr isEqualTypeAll ""; //false - _arr isEqualTypeAll 0; //true$/Code$ - + - undefined / undefined + global / global - (November 25, 2015) - This command will return false if the array on the left side is empty ([]) regardless of the sample value. - $Code$[] isEqualTypeAll "" - - false - $/Code$ - Boolean + Nothing + - isEqualTypeAny + modelToWorldVisual - Compares type of given value to every type in the given array and if match is found, true is returned. + Converts position from object model space to world space in render time scope. For ASL version see modelToWorldVisualWorld. - https://community.bistudio.com/wiki/isEqualTypeAny + https://community.bistudio.com/wiki/modelToWorldVisual - Anything isEqualTypeAny Array + Object modelToWorldVisual Array - val isEqualTypeAny types + object modelToWorldVisual modelPos - $Code$_var = [1,2,3]; - _var isEqualTypeAny [0,"", objNull ]; //false - _var isEqualTypeAny [0,"", objNull,[]]; //true$/Code$ + $Code$_aboveAndBehindPlayer = player modelToWorldVisual [0,-1,3];$/Code$ undefined / undefined @@ -33619,65 +35414,63 @@ - Boolean + Array + - isEqualTypeArray + camDestroy - Compares types of all elements of one array to types of all elements of another array. + Destroy an object created with camCreate. camDestroy is conducted immediately, the command doesn't wait for camCommit. + NOTE: Destroying camera object does not terminate camera effect automatically. - https://community.bistudio.com/wiki/isEqualTypeArray + https://community.bistudio.com/wiki/camDestroy - Array isEqualTypeArray Array + camDestroy Object - arr1 isEqualTypeArray arr2 + camDestroy object - $Code$_arr = [1,true,"three"]; - _arr isEqualTypeArray [0,objNull,""]; //false - _arr isEqualTypeArray [0,false,""]; //true$/Code$ + $Code$camDestroy _cam;$/Code$ + + $Code$_cam cameraEffect ["terminate","back"]; + camDestroy _cam;$/Code$ - undefined / undefined + local / local - Boolean + Nothing + - isEqualTypeParams + kbHasTopic - Compares types of all elements of input array to types of all elements of template array. Similar to isEqualTypeArray however this command is designed for fast validation of functions params, so there are differences: - Input can be anything but will be expected to be an Array, otherwise false is returned - Input array can be longer but not shorter than template array, will return false if shorter - nil could be used in template type array as a wild card to allow any type match + Check if conversation topic was registered to given person. See Conversations for more details. - https://community.bistudio.com/wiki/isEqualTypeParams + https://community.bistudio.com/wiki/kbHasTopic - Anything isEqualTypeParams Array + Object kbHasTopic String - input isEqualTypeParams template + person kbHasTopic topicName - $Code$[1,2, player,"10"] isEqualTypeParams [0,0, objNull,""]; //true - 123 isEqualTypeParams [0,0, objNull,""]; //false - [] isEqualTypeParams [0,0, objNull,""]; //false - [1,2, player ] isEqualTypeParams [0,0, objNull,""]; //false - [1,2, player,"10", true ] isEqualTypeParams [0,0, nil,""]; //true - [1,2, getPos player,"10", true ] isEqualTypeParams [0,0, nil,""]; //true$/Code$ + $Code$_obiHasTopic = player kbHasTopic "helloThereGeneralK";$/Code$ + + $Code$if ( player kbHasTopic "dontShoot") then { player kbRemoveTopic "dontShoot"; };$/Code$ undefined / undefined @@ -33685,29 +35478,28 @@ - Boolean + Boolean + - isEqualType + isAutotest - Compares 2 values by their type. A much faster alternative to typeName a == typeName b. + Returns true if game was started with autotest parameter - https://community.bistudio.com/wiki/isEqualType + https://community.bistudio.com/wiki/isAutotest - Anything isEqualType Anything + isAutotest - val1 isEqualType val2 + isAutotest - $Code$_var = [1,2,3]; - _var isEqualType 0; //false - _var isEqualType []; //true$/Code$ + $Code$_bool = isAutotest$/Code$ undefined / undefined @@ -33715,164 +35507,148 @@ - Boolean + Boolean + - isFilePatchingEnabled + ctrlMapAnimCommit - Returns true if file patching is enabled otherwise false + Plays the map animation. - https://community.bistudio.com/wiki/isFilePatchingEnabled + https://community.bistudio.com/wiki/ctrlMapAnimCommit - isFilePatchingEnabled + ctrlMapAnimCommit Control - isFilePatchingEnabled + ctrlMapAnimCommit controlName - + $Code$// Center map on player: + _ctrl ctrlMapAnimAdd [0, 0.05, player ]; + ctrlMapAnimCommit _ctrl;$/Code$ + - undefined / undefined + local / local - Boolean + Nothing + - isFlashlightOn + lbSetCurSel - Returns true if there is a linked and enabled flashlight on a given weapon. + Selects the item with the given index of the listbox or combobox with id idc of the topmost user dialog. + To deselect all, use -1: _ctrl lbSetCurSel -1; For listbox of style LB_MULTI use lbSetSelected instead. - https://community.bistudio.com/wiki/isFlashlightOn + https://community.bistudio.com/wiki/lbSetCurSel - Object isFlashlightOn String + lbSetCurSel Array + + Control lbSetCurSel Number - unit isFlashlightOn weapon + lbSetCurSel [idc, index] + + control lbSetCurSel index - $Code$player isFlashlightOn ( currentWeapon player );$/Code$ + $Code$lbSetCurSel [101, 0];$/Code$ + + $Code$_control lbSetCurSel 0;$/Code$ undefined / undefined + More information on the LB command family can be found here + + (November 29, 2014) + lbSetCurSel -1 has no effect while the listbox is populated. You should use lbClear first, then lbSetCurSel -1, then re-populate the listbox. + + (March 1, 2015) + Keep in mind that running this command against control will fire attached 'onLBSelChanged' event handler. - Boolean + Nothing - Nothing + - isFlatEmpty + selectMax - Checks given position against given filter params. Filter includes checks for: - If there are any objects closer than given distance from given position (in 2D) - If the area around position is flat enough to match given gradient - If the given position is over water or land - If the given position is over shore line - The gradient seems to correlate with general hill steepness: 0.1 (10%) ~6 o, 0.5 (50%) ~27 o, 1.0 (100%) ~45 o, etc.There are also some oddities about this command that need to be noted: - Objects accounted for proximity check seem to be static objects. Nearby vehicles and units do not seem to affect the output - Given position will be magically transferred into given position + getTerrainHeightASL value - The second element must be -1 ( = 0 really) at all times, otherwise command becomes unusable - The command might be a bit heavy on computations so avoid frequent and large area checks - See also: BIS_fnc_findSafePos + Returns the array element with maximum numerical value. Engine solution to BIS_fnc_greatestNum and BIS_fnc_findExtreme. Therefore it is expected that supplied array consists of Numbers only. Booleans however are also supported and will be evaluated as Numbers : true - 1, false - 0. nil value treated as 0. Other non Number elements (not recommended) will be evaluated as 0 and Bad conversion: scalar message will be logged into. rpt. - https://community.bistudio.com/wiki/isFlatEmpty + https://community.bistudio.com/wiki/selectMax - Array isFlatEmpty Array + selectMax Array - position isFlatEmpty [minDistance, mode, maxGradient, maxGradientRadius, overLandOrWater, shoreLine, ignoreObject] + selectMax array - $Code$// Check if player position is over land: - _overLand = !( position player isFlatEmpty [-1, -1, -1, -1, 0, false ] isEqualTo []);$/Code$ - - $Code$// Check if player position is over shore line: - _overShore = !( position player isFlatEmpty [-1, -1, -1, -1, 0, true ] isEqualTo []);$/Code$ - - $Code$// Check if player position is over water: - _overWater = !( position player isFlatEmpty [-1, -1, -1, -1, 2, false ] isEqualTo []);$/Code$ - - $Code$// Check if no object is closer than 5m to player position: - _isEmpty = !( position player isFlatEmpty [5, -1, -1, -1, -1, false, player ] isEqualTo []);$/Code$ - - $Code$// Check if area 10m around player position is relatively flat: - _isFlat = !( position player isFlatEmpty [-1, -1, 0.3, 10, -1] isEqualTo []);$/Code$ + $Code$_max = selectMax [1,2,3,4,5]; //5$/Code$ - $Code$// Check if area 15m around player position is very flat and empty: - _isFlatEmpty = !( position player isFlatEmpty [15, -1, 0.1, 15, -1, false, player ] isEqualTo []);$/Code$ + $Code$// Same as, for example: + _max = _a max _b max _c max _d; + // Only faster: + _max = selectMax [_a,_b,_c,_d];$/Code$ undefined / undefined - (April 24, 2016) - When this command is instructed to check if area at given position is empty it takes into account the radius of the bounding sphere of surrounding objects. Because of this, the high voltage columns such as "Land_HighVoltageColumnWire_F" and such objects may appear extremely large to the calculations and the position will be rejected even if visually it doesn't look too bad. To avoid this, use findEmptyPosition command first to find guaranteed empty position, then pass the result to isFlatEmpty making sure you switched off proximity check by setting 1st param to -1. For example: - $Code$// Check if given position is flat and empty within 1m radius - [4274.66,12113,0.00139618] isFlatEmpty [1, -1, 0.1, 1, -1, false, objNull ]; //[]$/Code$ - The result suggests it is not flat and empty. - $Code$// Check if given position is flat within 1m radius - [4274.66,12113,0.00139618] isFlatEmpty [-1, -1, 0.1, 1, -1, false, objNull ]; //[4274.66,12113,48.3209]$/Code$ - The result suggests it is. - $Code$// Check if given position is empty within 1m radius - [4274.66,12113,0.00139618] isFlatEmpty [1, -1, -1, -1, -1, false, objNull ]; //[]$/Code$ - The result suggests it is not empty. But the position is in the middle of a road and there is nothing within 1m but there is "Land_HighVoltageColumnWire_F" not far. - $Code$// Check if given position is empty within 1m radius ignoring nearest "Land_HighVoltageColumnWire_F" - [4274.66,12113,0.00139618] isFlatEmpty [1, -1, -1, 1, -1, false, nearestObject [[4274.66,12113,0.00139618], "Land_HighVoltageColumnWire_F"]]; //[4274.66,12113,48.3209]$/Code$ - The result now suggests it is empty. So instead of relying on internal proximity check we can combine both commands: - $Code$fnc_isFlatEmpty = - { - params ["_pos", "_params"]; - _pos = _pos findEmptyPosition [0, _params select 0]; - if (_pos isEqualTo []) exitWith {[]}; - _params =+ _params; - _params set [0, -1]; - _pos = _pos isFlatEmpty _params; - if (_pos isEqualTo []) exitWith {[]}; - _pos - }; - // Test - [[4274.66,12113,0.00139618], [1, -1, 0.1, 1, -1, false, objNull ]] call fnc_isFlatEmpty; //[4274.53,12113,48.3175] + (December 19, 2016) + Returns either number or boolean value, in case max value in array 0, command will return either 0 or false, which ever comes first. + Same for 1 and true values. + $Code$selectMax [false,0] // returns false + selectMax [0,false] // returns 0 + selectMax [true,1] // returns true + selectMax [1,true] // returns 1 $/Code$ + in case all values are equal or less than zero, command may also return other type of values + $Code$selectMax ["",false,0,-1] // returns "" + $/Code$ + if nil value appears in array, other values are equal or less than zero, command returns nil - Array + Anything + - isForcedWalk + uniform - Returns true if player is forced to walk with forceWalk. + Returns name of uniform. - https://community.bistudio.com/wiki/isForcedWalk + https://community.bistudio.com/wiki/uniform - isForcedWalk Object + uniform Object - isForcedWalk unitName + uniform unit - $Code$_bool = isForcedWalk player ;$/Code$ + $Code$_uniform = uniform _unit$/Code$ undefined / undefined @@ -33880,168 +35656,281 @@ - Boolean + String + - isFormationLeader + setShadowDistance - Returns true if the specified unit is subgroup leader. + Sets the shadows rendering distance. - https://community.bistudio.com/wiki/isFormationLeader + https://community.bistudio.com/wiki/setShadowDistance - isFormationLeader Object + setShadowDistance Number - isFormationLeader unit + setShadowDistance value - $Code$_isLeader = isFormationLeader player ;$/Code$ + $Code$setShadowDistance 1000$/Code$ - undefined / undefined + undefined / local - Boolean + Nothing + - isGroupDeletedWhenEmpty + tvCollapseAll - Checks if the given group marked for auto-deletion when empty. See deleteGroupWhenEmpty. + Collapses all tree items for the given Tree View. - https://community.bistudio.com/wiki/isGroupDeletedWhenEmpty + https://community.bistudio.com/wiki/tvCollapseAll - isGroupDeletedWhenEmpty Group + tvCollapseAll Number + + tvCollapseAll Control - isGroupDeletedWhenEmpty group + tvCollapseAll idc + + tvCollapseAll control - $Code$_isMarked = isGroupDeletedWhenEmpty _group;$/Code$ + $Code$tvCollapseAll 101;$/Code$ + + $Code$tvCollapseAll _ctrl;$/Code$ - undefined / undefined + local / local - Boolean + Nothing - Nothing + - isHidden + cutRsc - Return whether the person is hidden (reached the hiding position). For command that tests general visibility of an object use isObjectHidden + Display a resource defined in RscTitles of the mission's Description.ext, the campaign's description.ext or the global config. + For greater efficiency and ease of modability it is recommended to use named layers available with alternative syntax since Arma 3 v1.57.134673 - https://community.bistudio.com/wiki/isHidden + https://community.bistudio.com/wiki/cutRsc - isHidden Object + cutRsc Array + + Number cutRsc Array + + String cutRsc Array - isHidden person + cutRsc [class, type, speed, showInMap] + + layer cutRsc [class, type, speed, showInMap] + + layerName cutRsc [class, type, speed, showInMap] - + $Code$cutRsc ["binocular", "PLAIN"]; + cutRsc ["binocular", "PLAIN", 2]; + cutRsc ["binocular", "PLAIN", 2, false ];$/Code$ + + $Code$2 cutRsc ["binocular", "PLAIN", 2];$/Code$ + + $Code$_layer = "layer1" cutRsc ["binocular", "PLAIN", 2];$/Code$ + + $Code$// Create IGUI display: + "someLayer" cutRsc ["RscTitleDisplayEmpty", "PLAIN"]; + _display = uiNamespace getVariable "RscTitleDisplayEmpty";$/Code$ + - global / undefined + undefined / local - (January 1, 2017) - Tested in 1.67 DEV, seems to always return false + (30 Jun, 2008) + Using cutRsc (instead of titleRsc ) for a HUD has the benefits of: + having the HUD automatically hide itself when you access the map and redisplay itself after closing the map. + using the 'Direct communication' chat channel messages will not interfere with the HUD by hiding it. + + (17 Oct, 2013) + Regarding removing current resource with cutRsc ["Default", "PLAIN"]. If it does't work and it gives you error message that "Default" is not found, add it by yourself to RscTitles in description.ext so it looks like this: + class RscTitles + { + class Default + { + idd = - 1 ; + fadein = 0 ; + fadeout = 0 ; + duration = 0 ; + }; + }; + Alternatively, you can use cutText, yes cutText command to cancel your resources. As Karel Moricky explains: "All 'cut' commands are in the same layer, the same as all 'title' commands are in another one." So to remove cutRsc resource execute cutText on the same layer: + $Code$ cutRsc ["myRsc", "PLAIN"]; //show + cutText ["", "PLAIN"]; //remove$/Code$ + $Code$10 cutRsc ["myRsc", "PLAIN"]; //show + 10 cutText ["", "PLAIN"]; //remove$/Code$ + Also if you use layers would be a good idea to register them with BIS_fnc_rscLayer to avoid possible clashes with other layers: + $Code$("myLayerName" call BIS_fnc_rscLayer ) cutRsc ["myRsc","PLAIN"]; //show + ("myLayerName" call BIS_fnc_rscLayer ) cutText ["","PLAIN"]; //remove$/Code$ + You can also immediately remove resource with cutFadeOut command: $Code$123 cutFadeOut 0;$/Code$ - Boolean + Nothing - Nothing - Number + - isIRLaserOn + hintC - Returns true if there is a linked and enabled IR on the given weapon. + Displays attractive hint in the center of the screen. Player control is taken away until user presses "Continue". After user confirmation, the content of the hintC is repeated again in a normal hint. This type of hint can also have a title. It is also possible to drag this type of hint around the screen. - https://community.bistudio.com/wiki/isIRLaserOn + https://community.bistudio.com/wiki/hintC - Object isIRLaserOn String + hintC String + + String hintC Array + + String hintC Structured_Text + + String hintC String - unit isIRLaserOn weapon + hintC content + + title hintC [content1, content2,] + + title hintC content + + title hintC content - $Code$player isIRLaserOn currentWeapon player ;$/Code$ + $Code$hintC "Press W to move forward";$/Code$ + + $Code$// Same as the above in Arma3 but without second hint displayed: + hintC "Press W to move forward"; + hintC_EH = findDisplay 57 displayAddEventHandler ["unload", { + 0 = _this spawn { + _this select 0 displayRemoveEventHandler ["unload", hintC_EH]; + hintSilent ""; + }; + }];$/Code$ + + $Code$"Instructions" hintC [ + "Press W to move forward.", + "Press S to move backwards.", + "Use the mouse to turn right or left.", + "Press V for weapon sights." + ];$/Code$ + + $Code$// Same as the above in Arma3 but without second hint displayed: + "Instructions" hintC [ + "Press W to move forward.", + "Press S to move backwards.", + "Use the mouse to turn right or left.", + "Press V for weapon sights." + ]; + hintC_arr_EH = findDisplay 72 displayAddEventHandler ["unload", { + 0 = _this spawn { + _this select 0 displayRemoveEventHandler ["unload", hintC_arr_EH]; + hintSilent ""; + }; + }];$/Code$ + + $Code$_separator1 = parseText " br / ------------------------ br / "; + _image = "\ca\ui\textures\aus_flag.paa"; + _txt = composeText [ image _image, "Heading Text", _separator1, "Content"]; + "" hintC _txt;$/Code$ - undefined / undefined + undefined / local + This command must be executed after mission start. If you place it into init.sqs or init field of some unit, it will not work. Just add a little delay (~0.001) and the place the command. + + To display multiple messages after another you have to add a small delay in between. Otherwise only the first message will be displayed. hintC "foo"; sleep 0.1; hintC "bar"; Without a sleep statement hintC will not suspend the script it has been called from. + + HintC can be used with formatting like this: HintC format["Hello %1",player]. + + (March 19, 2015) + "Titled" hintC all use display #72 while "untitled" one uses display #57. If you are trying examples in Arma 3 debug console, add little delay like this: $Code$[] spawn {sleep 0.5;....your example code goes here...};$/Code$ or no hintC will be displayed. - Boolean + Nothing - Nothing - Nothing - Nothing + - isInRemainsCollector + setGroupIconsVisible - Checks if unit or vehicle is queued for disposal after death. + Sets if group icons are visible. - https://community.bistudio.com/wiki/isInRemainsCollector + https://community.bistudio.com/wiki/setGroupIconsVisible - isInRemainsCollector Object + setGroupIconsVisible Array - isInRemainsCollector remain + setGroupIconsVisible array - $Code$if ( isInRemainsCollector unit1) then { hint "unit1 is queued for disposal"};$/Code$ + $Code$setGroupIconsVisible [true,true];//[show markers on map, show markers on player hud] + setGroupIconsVisible [true,false]; //Show only 2D + setGroupIconsVisible [false,false];$/Code$ - global / undefined + undefined / undefined - Boolean + Nothing + - isInstructorFigureEnabled + progressPosition - Returns the status of INSTRUCTOR FIGURE setting in UI (OPTIONS GAME GENERAL INSTRUCTOR FIGURE). + Returns the current position in the progress bar. - https://community.bistudio.com/wiki/isInstructorFigureEnabled + https://community.bistudio.com/wiki/progressPosition - isInstructorFigureEnabled + progressPosition Control - isInstructorFigureEnabled + progressPosition control - $Code$hint str isInstructorFigureEnabled ;$/Code$ + $Code$_pos = progressPosition _control;$/Code$ undefined / undefined @@ -34049,28 +35938,28 @@ - Boolean + Number + - isKeyActive + enableReload - Checks whether the given key is active in the current user profile. - See keys, keysLimit and doneKeys in the description.ext file of the missions. + Enable / disable reload when magazine is empty. - https://community.bistudio.com/wiki/isKeyActive + https://community.bistudio.com/wiki/enableReload - isKeyActive String + Object enableReload Boolean - isKeyActive keyName + object enableReload enable - $Code$_ok = isKeyActive "Mission04Key"$/Code$ + $Code$_vehicle enableReload false ;$/Code$ undefined / undefined @@ -34078,568 +35967,587 @@ - Boolean + Nothing + - isKindOf + setUnitPos - Checks whether the object is (a subtype) of the given type. While main syntax and alt syntax support only CfgVehicles, CfgAmmo and CfgNonAIVehicles, alt syntax 2 allows to specify any config, including mission config. - - - https://community.bistudio.com/wiki/isKindOf + Set unit position rules. Mode may be one of: + "DOWN" - unit goes prone and stays prone. + "UP" - unit stands and stays standing. + "MIDDLE" - Kneel Position. ArmA version 1.04 (Unit will not kneel if it is unarmed ) + "AUTO" - unit chooses mode according to circumstances. + This command will not change the stance of the human player, even though it will change the output of unitPos command. To change player stance use playAction or playActionNow : + $Code$ player playAction "PlayerProne"; // DOWN + player playAction "PlayerStand"; // UP + player playAction "PlayerCrouch"; // MIDDLE$/Code$ + + + https://community.bistudio.com/wiki/setUnitPos - Object isKindOf String - - String isKindOf String - - String isKindOf Array + Object setUnitPos String - object isKindOf typeName - - typeName1 isKindOf typeName2 - - typeName1 isKindOf [typeName2, targetConfig] + unit setUnitPos mode - $Code$vehicle player isKindOf "Tank";$/Code$ - - $Code$"BMP2" isKindOf "Tank";$/Code$ - - $Code$currentWeapon player isKindOf ["Rifle", configFile "CfgWeapons"];$/Code$ + $Code$_soldier setUnitPos "UP";$/Code$ - undefined / undefined + local / global - (April 23, 2007) - This command can be used on the whole hierarchical class tree (i.e. when checking a HMMWV, one could test for "HMMWV50", "Car", "LandVehicle", etc., all of which would return true.) - - (16 Apr, 2008) - It appears isKindOf is limited to the CfgVehicles branch of the class hierachy. - So CfgWeapons, CfgMagazines, etc will return false for checks like: - ("M9" isKindOf "Pistol") returns false - - (8 Nov, 2009) - In a2 isKindOf also works for CfgAmmo in addition to CfgVehicles: ("M_9M311_AA" isKindOf "MissileBase") returns true. NOT for CfgWeapons, CfgMagazines and others.. + (18 September 2008‎) + Command most likely only works if run before join into group after createUnit. - (June 16, 2015) - In case you cannot use isKindOf because of the reasons stated, just use BIS fnc returnParents with class names as return value: - $Code$ _isKindOf = "Rifle" in [( configFile "CfgWeapons" "BWA3_G36K"), true ] call BIS_fnc_returnParents ; // is true$/Code$ + (11 March 2011) + The above comment by Dwarden about 'an additional join required' is no longer true for Operation Arrowhead. - (September 6, 2015) - In A3 isKindOf works well with CfgWeapons and CfgMagazines using the syntax from example 3. - It should be prefered to James' solution as it performs more than 25x faster. Tested in debug console with the following code snippets: - $Code$bool = "CA_Magazine" in ([( configFile "CfgMagazines" "HandGrenade"),true] call BIS_fnc_returnParents ); -- 0.12111ms$/Code$ - $Code$bool = "HandGrenade" isKindOf ["CA_Magazine", configFile "CfgMagazines"]; -- 0.00439453ms$/Code$ - When checking in CfgVehicles the syntax from example 2 performs a little faster. + (26 September 2013‎) + A unit might not always go prone when ordered to setUnitPos "DOWN", if the unit doesn't agree with the command. To force the unit to go prone, stop the unit from firing by setCombatMode "BLUE" and then order the unit to prone. - Boolean - Boolean - Boolean + Nothing + - isLightOn + removeAllAssignedItems - Returns true if vehicle headlights are on otherwise false. + Unassigns and deletes all linked items from inventory. The commands operates on assignedItems array, which doesnt include goggles or headgear. Use removeGoggles and removeHeadgear for those. - https://community.bistudio.com/wiki/isLightOn + https://community.bistudio.com/wiki/removeAllAssignedItems - isLightOn Object + removeAllAssignedItems Object - isLightOn vehicle + removeAllAssignedItems unit - $Code$_lightsOn = isLightOn vehicle player ;$/Code$ - - $Code$_pilotLightOn = isLightOn heli;$/Code$ + $Code$removeAllAssignedItems player ;$/Code$ - global / undefined + local / global - Boolean + Nothing + - isLocalized + setVectorUp - Checks whether given string name is localized. + Set object's up vector. Direction of the object remain unchanged. Default object's vectorUp is [0,0,1]. + In Multiplayer, setVectorUp must be executed on the machine where the object it applied to is local. - https://community.bistudio.com/wiki/isLocalized + https://community.bistudio.com/wiki/setVectorUp - isLocalized String + Object setVectorUp Array - isLocalized stringName + object setVectorUp [x, y, z] - $Code$if ( isLocalized "STR_DN_SNAKE") then { - hint localize "STR_DN_SNAKE"; - } else { - hint "STR_DN_SNAKE"; - diag_log "ToDo: STR_DN_SNAKE is not localized"; - };$/Code$ + $Code$// Turn object upside down: + _obj setVectorUp [0,0,-1];$/Code$ + + $Code$// Align object with the terrain underneath: + _obj setVectorUp surfaceNormal position _obj;$/Code$ - undefined / undefined + local / global + setVectorUp can only influence an object's bank. It can not influence pitch. Example: + player setVectorUp [0,1,0] + If the player is facing 0 degrees (north), then this will do NOTHING. + If the player is facing 90 degrees (east), then this will make him bank 90 degrees to his left. + + (March 22, 2007) + An in-depth discussion on the concept of vectors is available here. + + (March 16, 2008) + Command can be also used to rotate camera in all three axis (which also mean it's possible to set camera bank). + + (October 3, 2013) + It is possible to change both pitch and bank of an object ( surfaceNormal application for instance). Assuming an ammo box in the following example is facing North (default direction is 0): $Code$_ammobox setVectorUp [0,1,0]; //box is pitched 90 degrees forward + _ammobox setVectorUp [1,0,0]; //box is banked 90 degrees to the right$/Code$ + However the above will stop working as soon as you attach the box to something. The following trick however will work in this case: + $Code$_ammobox attachTo [ player, [0,2,1]]; + _ammobox setVectorUp [0,0.99,0.01]; //box is pitched ~90 degrees forward + _ammobox setVectorUp [0.99,0,0.01]; //box is banked ~90 degrees to the right$/Code$ - Boolean + Nothing + - isManualFire + magazinesAllTurrets - Returns true if manual fire is on. Manual fire could either be selected in vehicle action menu (if available) or with action "ManualFire" and "ManualFireCancel". Always returns false for a soldier. + Returns all magazines (including empty) from all vehicle turrets (including driver turret [-1]) and their ammo counts. - https://community.bistudio.com/wiki/isManualFire + https://community.bistudio.com/wiki/magazinesAllTurrets - isManualFire Object + magazinesAllTurrets Object - isManualFire vehicleName + magazinesAllTurrets vehicle - $Code$_bool = isManualFire vehicle player ;$/Code$ + $Code$_mags = magazinesAllTurrets vehicle player ;$/Code$ global / undefined - (February 5, 2017) - Manual fire means the effectiveCommander of the vehicle controls firing (but not aiming) of the gunner turret weapons (usually path [0]), while unable to fire his own weapons. - Boolean + Array + - isMarkedForCollection + gusts - Checks whether the object is marked for weapons collection. + Return the current gusts value. Scale is 0 to 1. - https://community.bistudio.com/wiki/isMarkedForCollection + https://community.bistudio.com/wiki/gusts - isMarkedForCollection Object + gusts - isMarkedForCollection object + gusts - $Code$_marked = isMarkedForCollection _truck$/Code$ + $Code$_gustsval = gusts ;$/Code$ - global / undefined + undefined / undefined - Boolean + Number + - isMultiplayerSolo + camSetFov - Returns true when playing a game in solo multiplayer (for example Apex coop campaign PLAY SOLO option). + Set the zoom level ( F ield O f V iew) of the given camera. + The zoom level is from 0.01 for the nearest and 8.5 for the furthest zoom value, with a default zoom level of 0.75 + The angle of the field of view is atan(FOV)*2 radians when in 4:3 aspect ratio. - https://community.bistudio.com/wiki/isMultiplayerSolo + https://community.bistudio.com/wiki/camSetFov - isMultiplayerSolo + Object camSetFov Number - isMultiplayerSolo + camera camSetFov level - + $Code$_cam camSetFov 0.75;$/Code$ + - undefined / undefined + local / local - Boolean + Nothing + - isMultiplayer + drawTriangle - Return true if multiPlayer. + Draws a single triangle or multiple triangles on the map. Triangle is defined by 3 positions of its verticies: p0, p1, p2 in a single array [ p0, p1, p2 ]. Next 3 positions in the same array [p0, p1, p2, p0, p1, p2 ] will be used to draw second triangle, another 3 positions [p0, p1, p2, p0, p1, p2, p0, p1, p2 ] to draw 3rd and so on. + NOTE : when fill param is absent or is an empty string "", the triangle is drawn with lines of the color set in color param. In order to draw color filled triangle of the same color as color param, set fill param to opaque white procedural texture "#(rgb,1,1,1)color(1,1,1,1)". - https://community.bistudio.com/wiki/isMultiplayer + https://community.bistudio.com/wiki/drawTriangle - isMultiplayer + Control drawTriangle Array - isMultiplayer + map drawTriangle [vertices, color, fill] - $Code$if (isMultiplayer) then { - //...block - }$/Code$ + $Code$findDisplay 12 displayCtrl 51 ctrlAddEventHandler ["Draw", + { + _this select 0 drawTriangle + [ + [ + player getRelPos [100, 0], + player getRelPos [100, -135], + player getRelPos [100, 135] + ], + [1,0,0,0.5], + "#(rgb,1,1,1)color(1,1,1,1)" + ]; + }];$/Code$ undefined / undefined + (July 16, 2017) + Example youtube video: [1] $Code$_ctrl = findDisplay 12 displayCtrl 51; + _ctrl setVariable ["data", [1, "#(rgb,1,1,1)color(1,1,1,1)", 1000, position player, + { + params ["_p", "_r", "_a", "_sr", "_ba"]; + _sr = _r * 0.382; + _pb = _p getPos [_sr, _a + 180]; + [ + _p getPos [_r, _a], _p getPos [_sr, _a + 36], _p getPos [_sr, _a - 36], + _pb, _p getPos [_r, _a - 72], _p getPos [_r, _a + 72], + _p getPos [_r, _a - 144], _p getPos [_sr, _a - 108], _pb, + _p getPos [_r, _a + 144], _p getPos [_sr, _a + 108], _pb + ] + }]]; + _ctrl ctrlRemoveAllEventHandlers "Draw"; + _ctrl ctrlAddEventHandler ["Draw", + { + _map = _this select 0; + _data = _map getVariable "data"; + _data params ["_i", "_fill", "_dist", "_pos", "_fn"]; + _data set [0, _i + 1]; + _size = _i % _dist; + if (_size == 0) then + { + _data set [0, 1]; + _data set [1, ["#(rgb,1,1,1)color(1,1,1,1)", ""] select (random 1 0.3)]; + _data set [2, 250 + round random 750]; + }; + _alpha = linearConversion [_dist, 0, _dist - _size, 1, 0]; + _map drawEllipse [_pos, _size * 2, _size * 2, 0, [0,0,1,_alpha], _fill]; + _map drawTriangle [[_pos getPos [_size, -_size], _size, _size] call _fn, [1,0,0,_alpha], _fill]; + _map drawTriangle [[_pos getPos [_size, -_size + 120], _size, _size] call _fn, [0,1,0,_alpha], _fill]; + _map drawTriangle [[_pos getPos [_size, -_size - 120], _size, _size] call _fn, [1,1,0,_alpha], _fill]; + }]; + openMap true;$/Code$ - Boolean + Nothing + - isNil + nearObjects - Tests whether the variable defined by the String argument is undefined, or whether an expression result passed as Code is undefined. - The command returns true if the variable or the expression result is undefined (i.e. the expression result is Void ), and false in all other cases. + Find objects in a sphere with given radius. The first object in the returned array is not necessarily the closest one. If you need returned objects to be sorted by distance, use nearestObjects. If typeName is given, only objects of given type (or its subtype) are listed. - https://community.bistudio.com/wiki/isNil + https://community.bistudio.com/wiki/nearObjects - isNil String + Position/Position2D/Object nearObjects Number - isNil Code + PositionAGL/Position2D/Object nearObjects Array - isNil variableName + position nearObjects radius - isNil code + position nearObjects [typeName, radius] - $Code$if ( isNil "_pokus") then {_pokus = 0};$/Code$ + $Code$_list = position player nearObjects 50;$/Code$ - $Code$isNil { player getVariable "someVar"};$/Code$ + $Code$_list = [_xpos,_ypos] nearObjects ["House", 20];$/Code$ + + $Code$_list = player nearObjects 20;$/Code$ undefined / undefined - I recently had a strange experience with this command. I forgot to wrap the name of the variable with quotes, and it returned the opposite of the true null status of the variable. Just something to watch out for. - - ^ If you don't wrap the name of the variable in quotes, then it will instead read the value of the variable itself. If that variable is a string or code, then the command will use that string or code held by the variable. Example: - _myvar = "_hisvar"; - isnil _myvar; - //will return true if _hisvar is null - _myvar = {tank1}; - sleep (random 50); - isnil _myvar; - //will return if tank1 is nil, at the time the isnil command is checked (not at the time _myvar is established) - -- General Barron 10:37, 30 December 2009 (CET) - - isNil is also able to check if an expression is undefined. As such, an alternative way to check variables would be: - isNil {variable} - you can use this method to also check if variables defined using setVariable exist as well: - isNil {player getVariable "Something"} - As well as testing if a function returns a value - func_ChangeVehicleName = - { - _this setVehicleVarName "newName"; - }; - if (isNil {player call func_ChangeVehicleName}) // returns true, because this function does not return anything - - (September 25, 2014) - While isNil isn't available in OFP/CWA you can easily emulate it with something like this: - _nil = format["%1",_nilstring]; - ?(format["%1",foo]==_nil): foo = "Hello World!" + (June 30, 2007) + Units in vehicles are not detected via this command. - (October 25, 2014) - You can also use isNil to check if an array element exists or if a setVariable variable exists - $Code$_array = [0,1,2,3]; - if (isNil {_array select 4}) then {hint "Element does not exist";};$/Code$ - $Code$if ( isNil { missionNamespace getVariable "MY_VARIABLE"})$/Code$ - When trying to test array elements, you can only test elements that are 1 element out of range. Testing elements 2 or more elements out of range will result in a script error. + (December 15, 2011) + In the second example, you can't omit the typeName parameter. It's required and you'll get an error if you don't supply it. Use "All" as an alternative to leaving it out. (CO 1.59) - (June 25, 2017) - isNil in combination with code will execute that code so be aware. + (January 3, 2013) + If you use the first example, it will return objects many more objects such as pollen, honeybees and crucially, triggers. Triggers will show in the returned array as "no shape" but you can use typeOf to get the classname, which will give "EmptyDetector". This will not return objects that don't have classnames such as plants, stones and some map objects like vehicle wrecks. nearestObjects will find objects without classnames. - (July 18, 2017) - isNil CODE will execute the code in unscheduled environment + (August 8, 2017) + The example 2 means that the command will include all types which inherit from the given type. As an example, when using "Helipad_Base_F", the command will detect all types of helipads (Land_HelipadSquare_F, Land_HelipadCircle_F, Land_HelipadEmpty_F, etc) in the given radius. - Boolean - Boolean + Array - Array + - isNull + copyWaypoints - Checks whether the tested item is Null. - Which null type the item has to be equal to depends on the type of game entity tested: - Objects - objNull - Controls - controlNull - Displays - displayNull - Groups - grpNull - Locations - locationNull (since ARMA 2) - Tasks - taskNull (since ARMA 2) - Scripts - scriptNull (since Arma 3 1.29.127075) - Configs - configNull (since Arma 3 1.53.133130) - Note: A test via == does not work, because, for example, objNull is not equal to anything, not even to itself. Use isEqualTo. + Copy the chain of waypoints from source to target group. The target group will start to process waypoints from the first one. - https://community.bistudio.com/wiki/isNull + https://community.bistudio.com/wiki/copyWaypoints - isNull Object/Control/Display/Group + Group copyWaypoints Group - isNull entity + groupTo copyWaypoints groupFrom - $Code$if ( isNull obj) then { hint "doesn't exist";};$/Code$ + $Code$group1 copyWaypoints group2;$/Code$ - global / undefined + undefined / undefined - (December 9, 2015) - isNull does not work with the TEAM_MEMBER type. - Use this instead: - $Code$_tmember isEqualTo teamMemberNull$/Code$ - - (December 9, 2015) - The note in the description does not apply to the CONFIG type, probably due to backwards compatibility. - $Code$configNull == configNull - - true - $/Code$ - Boolean + Nothing + - isNumber + getCustomAimCoef - Check if config entry represents number. + Returns aimPrecision from animation state with custom value that will directly affects weapon sway size and speed. - https://community.bistudio.com/wiki/isNumber + https://community.bistudio.com/wiki/getCustomAimCoef - isNumber Config + getCustomAimCoef Object - isNumber config + getCustomAimCoef unit - $Code$_ok = isNumber (configFile "CfgVehicles") - // Result is false$/Code$ + $Code$_coef = getCustomAimCoef player$/Code$ - undefined / undefined + global / undefined - Boolean + Number + - isObjectHidden + addMPEventHandler - Checks visibility of a given object on the local machine. + Adds MP event handler (EH) to the given object and returns EH handle. MP event handlers are added globally to every client on network in multiplayer and will fire on every client too upon event. If EH has some data to return upon event (e.g. the "MPKilled" EH will return an array with 2 elements: the killed unit, and the killer), it is passed in _this variable. Since Arma 3 v.1.63.137807 the EH handle is also stored in _thisEventHandler variable and is available during EH code execution. For more information see: Arma_3:_Event_Handlers#addMPEventHandler - https://community.bistudio.com/wiki/isObjectHidden + https://community.bistudio.com/wiki/addMPEventHandler - isObjectHidden Object + Object addMPEventHandler Array - isObjectHidden object + object addMPEventHandler [type, expression] - $Code$_bobIsHidden = isObjectHidden bob;$/Code$ + $Code$_index = player addMPEventHandler ["mpkilled", {Null = _this execVM "playerkilled.sqf";}];$/Code$ - global / local + global / global + (May 8, 2015) + MP EHs are added on every PC and execute on every PC, apart from MPRespawn, that only executes at the locality where unit respawns. - Boolean + Number + - isObjectRTD + ropeCreate - Returns true if RTD model is loaded + Create a rope (PhysX rope in Arma 3). - https://community.bistudio.com/wiki/isObjectRTD + https://community.bistudio.com/wiki/ropeCreate - isObjectRTD Object + ropeCreate Array - isObjectRTD helicopter + ropeCreate [fromObject, fromPoint, toObject, toPoint, segments, length] + + ropeCreate [fromObject, fromPoint, length, segments, unroll] - $Code$_heliRTD = isObjectRTD vehicle player ;$/Code$ + $Code$myRope = ropeCreate [ vehicle player, "slingload0", myCargo, [0, 0, 0], 10]; //A3 example$/Code$ + + $Code$myRope = ropeCreate [ vehicle player, "fastrope0", 10, 10, true ]; //TakeOn example$/Code$ + + $Code$myRope = ropeCreate [veh1, [0,0,-2], veh2, [0,0,0], 10] //A3 1.34$/Code$ undefined / undefined + (November 8, 2014) + Doesn't work well for towing vehicles on the ground. + Their wheels don't turn freely and have a LOT of friction. You'll most likely end up flipping the vehicle over if you try to tow it. + Also note that ropes can be destroyed/cut by shooting at them. + + (January 4, 2015) + Pay special attention to what is your fromObject and what is your toObject as this will have an impact on the physics of the rope. + For example: If you want to tow an Assault CRRC from a heavier Speedboat Minigun, attach two boats together with a rope. If you drive the Speedboat Minigun and set the CRRC as the fromObject, the rope will have almost no elasticity and the CRRC will yank around as you tow it. However, if you set the CRRC as the toObject, the rope will have more elasticity and will be a little friendlier for the CRRC when you are towing it. + + (July 9, 2015) + Parameters segments and unroll are not supported in Arma 3. Segments are set automatically according the length of a rope. - Boolean + Object + - isOnRoad + showWarrant - Checks if given position is on road. Same as roadAt, only return is boolean instead of road object. + Enable ID card (default false ). Obsolete command. - https://community.bistudio.com/wiki/isOnRoad + https://community.bistudio.com/wiki/showWarrant - isOnRoad Object/Array + showWarrant Boolean - isOnRoad position + showWarrant show - $Code$_objOnRoad = isOnRoad player ;$/Code$ - - $Code$_posOnRoad = isOnRoad ASLToAGL getPosASL player ;$/Code$ - + - global / undefined + undefined / undefined - Boolean + Nothing + - isPipEnabled + className - Returns true if Picture in Picture (Render to Texture) is enabled. + Returns short name of location. - https://community.bistudio.com/wiki/isPipEnabled + https://community.bistudio.com/wiki/className - isPipEnabled + className Location - isPipEnabled + className loc - $Code$PIPon = isPipEnabled;$/Code$ - + undefined / undefined - Boolean + String + - isPlayer + getBurningValue - Checks if given person is player. Returns true for headless clients as well. + Returns amount of damage from fire. - https://community.bistudio.com/wiki/isPlayer + https://community.bistudio.com/wiki/getBurningValue - isPlayer Object + getBurningValue Object - isPlayer person + getBurningValue unit - $Code$if ( isPlayer _Soldier1) then { - _Soldier1 setDamage 1; - };$/Code$ - - $Code$_playerCount = { isPlayer _x} count playableUnits ;$/Code$ - + - global / undefined + undefined / undefined - (1 August, 2006) - This is not the same as testing object == player, because in MP it tests for any player, not only for the local one. If object is a vehicle, the test is done for the vehicle commander. - Boolean + Number + - isRealTime + leaderboardDeInit - Returns true if the mission editor is operating in real time mode. - i - Some Old Editor Command + Deletes internal class for the leaderboard with given name. Returns true if the board has been found and deinitialized. - https://community.bistudio.com/wiki/isRealTime + https://community.bistudio.com/wiki/leaderboardDeInit - isRealTime Control + leaderboardDeInit String - isRealTime map + leaderboardDeInit boardName - $Code$_isRealTime = isRealTime _map$/Code$ + $Code$leaderboardDeInit "TT01"$/Code$ undefined / undefined @@ -34647,62 +36555,61 @@ - Boolean + Boolean + - isRemoteExecutedJIP + getArtilleryETA - Returns true if the code context is being remote executed from the JIP queue by remoteExec or remoteExecCall (when JIP param was set). It is a subset of isRemoteExecuted : - Normal remote execution: - isRemoteExecuted - true - isRemoteExecutedJIP - false - Remote execution from JIP queue: - isRemoteExecuted - true - isRemoteExecutedJIP - true - In SP always returns false. + Returns ETA to the target in seconds for given artillery unit based on target position and used magazine, -1 if target can't be hit. - https://community.bistudio.com/wiki/isRemoteExecutedJIP + https://community.bistudio.com/wiki/getArtilleryETA - isRemoteExecutedJIP + Object getArtilleryETA Array - isRemoteExecutedJIP + unit getArtilleryETA [targetPosition, magazineType] - $Code$_remoteExecutedJIP = isRemoteExecutedJIP ;$/Code$ + $Code$_mortar getArtilleryETA [ getPos _target, getArtilleryAmmo [_mortar] select 0];$/Code$ + + $Code$_mortar getArtilleryETA [ position _target, currentMagazine _mortar];$/Code$ - undefined / undefined + global / undefined + (August 26, 2013) + To avoid wrong ETA readings, position of the target should only be obtained via position or getPos - Boolean + Number + - isRemoteExecuted + groupSelectedUnits - Returns true if the code context is being remote executed by remoteExec or remoteExecCall. In SP always returns false. See also isRemoteExecutedJIP + Returns selected units in source group for normal commanding mode (individual units). For the High Command equivalent, see hcSelected. - https://community.bistudio.com/wiki/isRemoteExecuted + https://community.bistudio.com/wiki/groupSelectedUnits - isRemoteExecuted + groupSelectedUnits Object - isRemoteExecuted + groupSelectedUnits unit - $Code$_remoteExecuted = isRemoteExecuted ;$/Code$ + $Code$_selectedUnits = groupSelectedUnits player ;$/Code$ undefined / undefined @@ -34710,109 +36617,97 @@ - Boolean + Array + - isServer + <= - Returns true if the machine (executing the command) is the server in a multiplayer game or is running single player. isServer will return true for both, dedicated server and player hosted. Dedicated server could be detected with isDedicated command. Hosted by player server can be detected by presense of UI: isServer && hasInterface + Checks if the left number is smaller than or equal to the right one - https://community.bistudio.com/wiki/isServer + https://community.bistudio.com/wiki/a_less%3D_b - isServer + Number <= Number - isServer - + - $Code$if (! isServer ) exitWith {};$/Code$ - + undefined / undefined - (April 8, 2011) - You can use isServer inside the condition of a trigger to have the trigger activate only for the server. All other conditions for the trigger will be checked across all machines, but it will only activate the trigger created on the server. For example: $Code$this && isServer $/Code$ - - (December 21, 2014) - $Code$ if ( isDedicated ) then { - //run on dedicated server only - }; - if ( isServer ) then { - //run on dedicated server or player host - }; - if ( hasInterface ) then { - //run on all player clients incl. player host - }; - if (! isDedicated ) then { - //run on all player clients incl. player host and headless clients - }; - if (! isServer ) then { - //run on all player clients incl. headless clients but not player host - }; - if (! hasInterface ) then { - //run on headless clients and dedicated server - }; - if (! hasInterface && ! isDedicated ) then { - //run on headless clients only - };$/Code$ - Boolean + Boolean + - isShowing3DIcons + camSetTarget - Returns true if the editor is set to draw 3D icons. - i - Some Old Editor Command + Set the target object or position where the given camera should point at. Needs the call of camCommit to be conducted. - https://community.bistudio.com/wiki/isShowing3DIcons + https://community.bistudio.com/wiki/camSetTarget - isShowing3DIcons Control + Object camSetTarget Object + + Object camSetTarget Array - isShowing3DIcons map + camera camSetTarget target + + camera camSetTarget position - + $Code$_camera camSetTarget player ;$/Code$ + + $Code$_camera camSetTarget [2540,1503,26];$/Code$ + + $Code$_cam = "camera" camCreate ( player modelToWorld [0,100,10]); + _cam camSetTarget player ; + _cam camSetRelPos [0, 0.5, 1.5]; + _cam cameraEffect ["internal", "back"]; + _cam camCommit 1; + player setRandomLip true ;$/Code$ + - undefined / undefined + local / local - Boolean + Nothing - Nothing + - isSimpleObject + createDiarySubject - Returns true if given object is simple object + Create a new subject page in a log. - https://community.bistudio.com/wiki/isSimpleObject + https://community.bistudio.com/wiki/createDiarySubject - isSimpleObject Object + Object createDiarySubject Array - isSimpleObject object + person createDiarySubject [subject, displayName, picture] - $Code$_isSimple = isSimpleObject _obj1;$/Code$ + $Code$_index = player createDiarySubject ["myPage","My page"];$/Code$ undefined / undefined @@ -34820,55 +36715,58 @@ - Boolean + Number + - isSprintAllowed + enableCaustics - Returns true if player is allowed to sprint + Enable/disable caustics drawing. - https://community.bistudio.com/wiki/isSprintAllowed + https://community.bistudio.com/wiki/enableCaustics - isSprintAllowed Object + enableCaustics Boolean - isSprintAllowed unit + enableCaustics bool - $Code$isSprintAllowed player;$/Code$ - + undefined / undefined + (October 23, 2017) + Setting this to false will disable a light refraction on "liquid" objects like sea water. This has no effect on solid (static) objects. - Boolean + Nothing + - isStaminaEnabled + getObjectViewDistance - Check if stamina depletion is enabled + Gets the values of rendering distances of objects and shadows. - https://community.bistudio.com/wiki/isStaminaEnabled + https://community.bistudio.com/wiki/getObjectViewDistance - isStaminaEnabled Object + getObjectViewDistance - isStaminaEnabled unit + getObjectViewDistance - $Code$isStaminaEnabled player;$/Code$ + $Code$_arr = getObjectViewDistance ;$/Code$ undefined / undefined @@ -34876,34 +36774,28 @@ - Boolean + Array + - isSteamMission + atan - Returns true if the current mission is a Steam Workshop mission. + ArcTangent of a number, result in Degrees. - https://community.bistudio.com/wiki/isSteamMission + https://community.bistudio.com/wiki/atan - isSteamMission + atan Number - isSteamMission + atan x - $Code$if ( isSteamMission ) then - { - hint "Thank you for subscribing to my mission on Steam!"; - } - else - { - hint "Thank you for downloading my mission off the Internet!"; - };$/Code$ + $Code$_degrees = atan 1; //45$/Code$ undefined / undefined @@ -34911,27 +36803,28 @@ - Boolean + Number + - isStreamFriendlyUIEnabled + teamType - Returns the status of STREAM FRIENDLY UI setting in UI (OPTIONS GAME GENERAL STREAM FRIENDLY UI). + Returns a type of given team. - https://community.bistudio.com/wiki/isStreamFriendlyUIEnabled + https://community.bistudio.com/wiki/teamType - isStreamFriendlyUIEnabled + teamType Team_Member - isStreamFriendlyUIEnabled + teamType team - $Code$hint str isStreamFriendlyUIEnabled ;$/Code$ + $Code$_type = teamType _team;$/Code$ undefined / undefined @@ -34939,127 +36832,145 @@ - Boolean + String + - isText + unitsBelowHeight - Check if config entry represents text. + Returns units in group/array below given height Above The Land (ATL). Current unit height ATL could be found with + _height = ( getPosATL _unit) select 2; - https://community.bistudio.com/wiki/isText + https://community.bistudio.com/wiki/unitsBelowHeight - isText Config + Group/Array unitsBelowHeight Number - isText config + units unitsBelowHeight height - $Code$_ok = isText (configFile "CfgVehicles") - // Result is false$/Code$ + $Code$_allOnGroudUnits = group player unitsBelowHeight 10;$/Code$ + + $Code$_units = allUnits unitsBelowHeight 30;$/Code$ - undefined / undefined + global / undefined + (Nov 12, 2009) + the height is calculated above terrain level (ATL), not water level or building level. - Boolean + Array + - isTouchingGround + ctrlSetTextColor - Returns true if object is touching the ground. + Sets text color of given control. Color is in format Color. As of Arma 3 v1.40 this command could also be used to change fill colour or the DialogControls-ProgressBar. - https://community.bistudio.com/wiki/isTouchingGround + https://community.bistudio.com/wiki/ctrlSetTextColor - isTouchingGround Object + Control ctrlSetTextColor Array - isTouchingGround object + display ctrlSetTextColor color - $Code$if ( isTouchingGround player ) then { hint "Terraferma!";};$/Code$ + $Code$_control ctrlSetTextColor [1, 0, 0, 1]$/Code$ - global / undefined + undefined / undefined - (June 1, 2014) - If you are using this command as a validation method, it should not be the sole thing you are checking for, as the result is often inaccurate. For example, it returns false for some helicopters when landed on the roof of certain buildings, and it always returns false for boats, even if they are beached. - - (September 29, 2016) - In addition to previous statement: That behaviour is true, simply because isTouchingGround applied to a player unit (or any unit) is frozen to a last state when unit enters vehicle. - To get proper return from this command you should go for units vehicle : - $Code$_var = isTouchingGround player // Unreliable - _var = isTouchingGround (vehicle player) // Pretty reliable - $/Code$ - - (November 10, 2016) - This command returns always true if the falling object is attached to some other object with the command attachTo, like for vehicle air drop with parachute. + (April 10, 2015) + When used on a RscProgress control, remove the configured "texture" first. The two will affect each other. - Arma 3 v1.42 - (April 26, 2017) - Be aware: it's not reliable on remote objects. + (March 4, 2018) + This command can be used to change the color of the light that is illuminating a texture in a display. By default, textures are lit with white light at 100% [1,1,1,1]; - Boolean + Nothing + - isTurnedOut + compileFinal - Returns true if given unit is turned out, otherwise false. The output changes to true after unit finished turning out, however will change to false almost immediately after unit is ordered to turn in. + Compile expression and makes it final, preventing it from: + repeated compile or compileFinal + removal by nil + remote rewrite using publicVariable, publicVariableClient and publicVariableServer - https://community.bistudio.com/wiki/isTurnedOut + https://community.bistudio.com/wiki/compileFinal - isTurnedOut Object + compileFinal String - isTurnedOut unit + compileFinal expression - $Code$_commanderOut = isTurnedOut (tank turretUnit [0,0]);$/Code$ + $Code$myCode = compileFinal "a = a + 1"; + call myCode; + //--- Repeated compile won't have any effect + myCode = compileFinal "a = a + 2"; + //--- Duplicate code will be final as well + myDuplicateCode = myCode;$/Code$ - undefined / undefined + undefined / local + (August 14, 2013) + When broadcasting a compileFinal'ed variable using publicVariable or its variants, the variable also becomes final on the other client(s) and/or the server. + Also, compileFinal does not prevent event handlers from being removed or overwritten. + + (May 27, 2017) + in ArmA 3 1.70.141838, compileFinal also works for profileNamespace and uiNamespace. But be careful with that. - Boolean + Code + - isTutHintsEnabled + tvTooltip - Returns the status of TUTORIAL HINTS setting in UI (OPTIONS GAME GENERAL TUTORIAL HINTS). + Gets the tooltip text associated with the specified tree view path. - https://community.bistudio.com/wiki/isTutHintsEnabled + https://community.bistudio.com/wiki/tvTooltip - isTutHintsEnabled + tvTooltip Array + + Control tvTooltip Array - isTutHintsEnabled + tvTooltip [idc, path] + + ctrl tvTooltip path - $Code$hint str isTutHintsEnabled ;$/Code$ + $Code$_text = tvTooltip [101, [0,2]];$/Code$ + + $Code$_text = _treeCtrl tvTooltip [0,2];$/Code$ undefined / undefined @@ -35067,27 +36978,28 @@ - Boolean + String - String + - isUAVConnectable + from - Returns true if UAV is connectable by AV terminal(s). + Continue sequence of for var construct. It sets the start value of the index variable. - https://community.bistudio.com/wiki/isUAVConnectable + https://community.bistudio.com/wiki/from - Object isUAVConnectable Array + For_Type from Number - object isUAVConnectable [uav, checkAllItems] + for from b - $Code$connectable = unit isUAVConnectable [uav,true];$/Code$ + $Code$for "_x" from 10 to 20 do {..code..}$/Code$ undefined / undefined @@ -35095,614 +37007,704 @@ - Boolean + For_Type + - isUAVConnected + lnbSetText - Returns true if UAV is connected to some terminal. + Sets the additional text (invisible) in the item with the given position of the 2D listbox. - https://community.bistudio.com/wiki/isUAVConnected + https://community.bistudio.com/wiki/lnbSetText - isUAVConnected Object + lnbSetText Array + + Control lnbSetText Array - isUAVConnected uav + lnbSetText [idc,[row,column],data] + + _ctrl lnbSetText [ [row,column],data] - $Code$bool = isUAVConnected cursorTarget ;$/Code$ + $Code$lnbSetText [101, [0,1], "#1"];$/Code$ + + $Code$_ctrl lnbSetText [ [0,1], "#1"];$/Code$ - undefined / undefined + local / local + (Sep 9 2014) + (A3 1.28)As for invisible data processing, lnbAddArray, lnbAddColumn, lnbData, lnbGetColumnsPosition, lnbSetColumnsPos, lnbSetData, lnbSetText, lnbSetValue, lnbText and lnbValue store data types into exact position of the listNbox with different spaces. Accessing data with coordinate command at nearly the same syntax: + $Code$ + //Set same value to one position of a Control + _ctrl lnbSetData [ [0,0],"#1"]; + lnbSetColumnsPos [102, [0,1], 1]; + _ctrl lnbSetText [ [0,1], "#1"]; + _ctrl lnbSetValue [ [0,0],1]; + //Accessing the value disregard affecting one another. + _ctrl lnbData [0,0]; //"#1" + lnbGetColumnsPosition _ctrl //[1]; + _ctrl lnbText [0,0];//"#1" + _ctrl lnbValue [0,0];//1 + $/Code$ + For a direct visible control over CT_LISTNBOX: + $Code$ + 0 = [_CT_LISTNBOX] spawn { + private ["_CT_LISTNBOX","_color","_current","_pic"]; + disableSerialization ; + _CT_LISTNBOX = _this select 0; + { + _CT_LISTNBOX lnbAddRow [ getText (_x "displayNameShort"), getText (_x "displayName")]; + _CT_LISTNBOX lnbSetPicture [ [_foreachIndex,0], getText (_x "texture")]; + } forEach (" isClass _x" configClasses ( configFile "CfgRanks")); + _CT_LISTNBOX lnbSetCurSelRow 0; + _current = lnbCurSelRow _CT_LISTNBOX; + _color = _CT_LISTNBOX lnbColor [_current,0]; + _CT_LISTNBOX lnbSetColor [ [_current,1], [(_color select 0)/2,0,0,1] ]; + _CT_LISTNBOX lnbDeleteColumn 0; + _CT_LISTNBOX lnbDeleteRow 1; + sleep 1; + lnbClear _CT_LISTNBOX;//Clear all items but control still remains just invisible. + }; + $/Code$ + A combined use of both invisible and visible data processing commands alive the Control. - Boolean + Nothing - Nothing + - isUIContext + onBriefingPlan - Returns true if the script originated from some UI control event, for example from "onButtonDown" EH. Exists within parent scope and immediate child scopes. + Select a sound declared in the Description.ext of the mission to be played the first time the Plan tab is selected in the briefing. - https://community.bistudio.com/wiki/isUIContext + https://community.bistudio.com/wiki/onBriefingPlan - isUIContext + onBriefingPlan String - isUIContext + onBriefingPlan soundName - $Code$if ( isUIContext ) then { hint "UI control event"};$/Code$ + $Code$onBriefingPlan "PlanVoiceOver"$/Code$ undefined / undefined + (January 20, 2007) + In OFP 1.96 only sound files defined in the mission description can be played in this way. - Boolean + Nothing + - isUniformAllowed + setFuelCargo - Check whether given uniform can be dressed by target soldier. + Sets fuel amount in cargo space of refuel vehicle from empty (0) to full (1) + Note, the carrying capacity of each side's refuel trucks differ. - https://community.bistudio.com/wiki/isUniformAllowed + https://community.bistudio.com/wiki/setFuelCargo - Object isUniformAllowed String + Object setFuelCargo Number - unit isUniformAllowed type + vehicle setFuelCargo amount - $Code$_canUse = _unit isUniformAllowed "U_B_CombatUniform_mcam";$/Code$ + $Code$_refuelTruckOne setFuelCargo 0;$/Code$ - global / undefined + local / global + (July 10, 2015) + (ArmA 3 1.44) setFuelCargo will have no effect if the vehicle doesn't support getFuelCargo. - Boolean + Nothing + - isVehicleCargo + removeAllItems - Return transporting vehicle if vehicle is loaded in one. + Removes all special items from the unit. - https://community.bistudio.com/wiki/isVehicleCargo + https://community.bistudio.com/wiki/removeAllItems - isVehicleCargo Object + removeAllItems Object - isVehicleCargo vehicle + removeAllItems unit - $Code$// Blackfish with given variable name blackfish, with a vehicle inside called quad - _transportingVehicle = isVehicleCargo quad; //returns blackfish - //Vehicle called quad that is not being transported as cargo - _transportingVehicle = getVehicleCargo quad; //returns objNull$/Code$ + $Code$removeAllItems unitName;$/Code$ - undefined / undefined + local / global + (June 18, 2013) + Arma 3, version 0.70 - removes only items listed by command items. - Object + Nothing + - isVehicleRadarOn + deleteGroupWhenEmpty - Returns true if vehicle has active sensors on + Marks given group for auto-deletion when group is empty. true will mark the group for auto-deletion, however false will only unmark the group that was marked previously. There are other engine group auto-deletion mechanisms in place, which are not affected by this. + NOTE: It might take up to a minute for the groups marked for auto-deletion when empty to get deleted when they become empty. - https://community.bistudio.com/wiki/isVehicleRadarOn + https://community.bistudio.com/wiki/deleteGroupWhenEmpty - isVehicleRadarOn Object + Group deleteGroupWhenEmpty Boolean - isVehicleRadarOn vehicle + group deleteGroupWhenEmpty delete - $Code$isVehicleRadarOn vehicle player ; // returns true if radar is turned on$/Code$ + $Code$_group deleteGroupWhenEmpty true ;$/Code$ - undefined / undefined + global / global + (February 8, 2018) + It seems, that the argument has to be local (like for deleteGroup). + So if you run it on a server and the group isn't local to the server this wouldn't work: + $Code$_group deleteGroupWhenEmpty true;$/Code$ + But this would work: + $Code$if (local _group) then { + _group deleteGroupWhenEmpty true; + } else { + [_group, true] remoteExec ["deleteGroupWhenEmpty", groupOwner _group]; + };$/Code$ - Boolean + Nothing + - isVehicleSensorEnabled + removeDrawIcon - Returns class name (to identify list based on component name) and info if given sensor is enabled + Removes an icon for an editor object. + i + Some Old Editor Command - https://community.bistudio.com/wiki/isVehicleSensorEnabled + https://community.bistudio.com/wiki/removeDrawIcon - Object isVehicleSensorEnabled String + Control removeDrawIcon Array - vehicle isVehicleSensorEnabled componentName + map removeDrawIcon [object,string identifier] - $Code$vehicle player isVehicleSensorEnabled "PassiveRadarSensorComponent"; // [ ["PassiveRadarSensorComponent",true] ]$/Code$ - + undefined / undefined - Array + Nothing + - isWalking + assignedVehicleRole - Returns true if walk is toggled (W+S in Arma 3). + Return the role a unit is assigned to within its assigned vehicle. + The array which is returned contains: + [] - Not assigned to any vehicle + ["Driver"] - Assigned as driver + ["Cargo"] (or ["Cargo", [turret path]] since Arma 3 1.31.127272) - Assigned as cargo + ["Turret", [turret path]] - Assigned to a turret + If no vehicle role is assigned, an empty array is returned. - https://community.bistudio.com/wiki/isWalking + https://community.bistudio.com/wiki/assignedVehicleRole - isWalking Object + assignedVehicleRole Object - isWalking unitName + assignedVehicleRole unitName - $Code$_bool = isWalking player ;$/Code$ + $Code$_RoleArray = assignedVehicleRole player ;$/Code$ + + $Code$// Get weapons available to player at player occupied turret: + _weaponsTurret = vehicle player weaponsTurret ( assignedVehicleRole player select 1);$/Code$ global / undefined - (March 8, 2015) - To expand on the limited description, this command doesn't necessarily say whether or not the unit is currently walking. All it says is that walking is toggled on or off. This command can still return true when the unit is sprinting. When walking is toggled on, the unit will return to walking pace when not sprinting. When walking is toggled off, the unit will return to jogging pace when not sprinting. This command is not intended to gauge a units current movement speed. + (August 31, 2013) + When unit with unassigned vehicle role enters a vehicle, it gets assigned vehicle role automatically. The unit then will hold on to its assigned role after exiting the vehicle. To add, when player is in the group of AIs and is not the leader, assignedVehicleRole of the player could be unpredictable and absolutely not related to the position player occupies. In short, forget about this command, it is unreliable and has been broken too many times in the past. + + (November 15, 2014) + In multiplayer (tested in v1.34), this only works reliably on the server. + Behaviour is as follows: + On a client, the command will return empty arrays for every unit that is not local. + On the server, the command correctly returns the position, regardless of the units locality. - Boolean + Array + - isWeaponDeployed + == - Returns true if weapon is currently deployed. + Check if one value is equal to another. Both values need to be of the same type. - https://community.bistudio.com/wiki/isWeaponDeployed + https://community.bistudio.com/wiki/a_%3D%3D_b - isWeaponDeployed Object + Anything == Anything - isWeaponDeployed unit - + - $Code$_dep = isWeaponDeployed player ;$/Code$ - + - global / undefined + undefined / undefined - (July 1, 2015) - You can force a unit out of bipod or resting with: - $Code$_unit playMove "";$/Code$ - - (March 4, 2017) - playMove, as well as switchMove, appear to not work when forcing a player out of being deployed. A more reliable method is: $Code$_player setPos (_player modelToWorld [0,0,0]);$/Code$ - Boolean + Boolean + - isWeaponRested + ppEffectDestroy - Returns true if weapon is currently rested. + Destroy Post process effects given by handle or array of handles. - https://community.bistudio.com/wiki/isWeaponRested + https://community.bistudio.com/wiki/ppEffectDestroy - isWeaponRested Object + ppEffectDestroy Number + + ppEffectDestroy Array - isWeaponRested unit + ppEffectDestroy effect + + ppEffectDestroy [effect1,] - $Code$_rest = isWeaponRested player ;$/Code$ + $Code$ppEffectDestroy _hndl;$/Code$ + + $Code$ppEffectDestroy [_hndl0, _hndl1, _hndl2];$/Code$ - local / undefined + undefined / undefined - (July 1, 2015) - You can force a unit out of bipod or resting with: - $Code$_unit playMove "";$/Code$ - - (July 12, 2015) - As of 1.49 $Code$ isWeaponRested player $/Code$ is the only current use of this command. You cannot detect remote player and you cannot detect local unit that is not a player. Might as well be a nullar command without argument. - Boolean + Nothing - Nothing + - itemCargo + camPrepareTarget - Get array with items from ammo box (or any general weapon holder container). + Prepares the camera target to a position or to a target. - https://community.bistudio.com/wiki/itemCargo + https://community.bistudio.com/wiki/camPrepareTarget - itemCargo Object + Object camPrepareTarget Array + + Object camPrepareTarget Object - itemCargo box + camera camPrepareTarget position + + camera camPrepareTarget target - $Code$hint str itemCargo vestContainer player ;$/Code$ + $Code$_camera camPrepareTarget getPos player$/Code$ + + $Code$_camera camPrepareTarget player$/Code$ - global / undefined + undefined / undefined - Array + Nothing - Nothing + - itemsWithMagazines + combatMode - Returns combined array including all unit's items and all unit's magazines. Loaded magazines such as currentMagazine, primaryWeaponMagazine, secondaryWeaponMagazine, handgunMagazine as well as assignedItems are excluded. + Returns the combat mode of the given unit. See setCombatMode for more information about combat modes. - https://community.bistudio.com/wiki/itemsWithMagazines + https://community.bistudio.com/wiki/combatMode - itemsWithMagazines Object + combatMode Object/Group - itemsWithMagazines unit + combatMode grp - $Code$itemsWithMagazines player - //is essentially the same as - items player + magazines player [ - "FirstAidKit",//item - "30Rnd_65x39_caseless_mag",//magazine - "16Rnd_9x21_Mag",//magazine - "Chemlight_green",//magazine - "HandGrenade",//magazine - "ToolKit",//item - "MineDetector"//item - ]$/Code$ + $Code$if (( combatMode _grp1) == "BLUE") then {_grp1 setCombatMode "GREEN"};$/Code$ global / undefined + (August 3, 2006) + Notes from before the conversion: + Use setCombatMode to set the combat mode. The definitions of the colours are given under that command. + + In OFP v1.96, combatMode return value does not change when unit's combat mode is set with radio commands, ie troops under the player's command. - Array + String + - items + flyInHeightASL - Returns an array of names of all special items of a vehicle or a soldier. + Sets the minimal ASL height. Final height is max(flyInHeight, flyInHeightASL). - https://community.bistudio.com/wiki/items + https://community.bistudio.com/wiki/flyInHeightASL - items Object + Object flyInHeightASL Array - items unit + aircraft flyInHeightASL params - $Code$_itemsplayer = items player ;$/Code$ - - $Code$player sideChat format ["%1", items player ];$/Code$ + $Code$cobraOne flyInHeightASL [200, 100, 400];$/Code$ - global / undefined + undefined / undefined - (June 18, 2013) - Arma 3, version 0.70 - magazines, explosives, grenades and all items currently linked on the unit are not returned now. - Array + Nothing + - joinAsSilent + objStatus - Joins the unit to the given group, if position id is available, this one is used. Avoid any radio communication related to joining. + Sets the status of an objective that was defined in briefing.html. + Status may be one of: + "ACTIVE" + "FAILED" + "DONE" + "HIDDEN" + To refer to an objective that is named "OBJ_1", for example, use only the index number in this command (i.e. "1" objStatus "HIDDEN"). - https://community.bistudio.com/wiki/joinAsSilent + https://community.bistudio.com/wiki/objStatus - Object joinAsSilent Array + String objStatus String - unit joinAsSilent [group, id] + objectivenumber objStatus status - $Code$player joinAsSilent [_group, 4];$/Code$ - - $Code$// To get the position id: - getUnitPositionId = { - private ["_vvn", "_str"]; - _vvn = vehicleVarName _this; - _this setVehicleVarName ""; - _str = str _this; - _this setVehicleVarName _vvn; - parseNumber (_str select [(_str find ":") + 1]) - }; - player joinAsSilent [ createGroup west, 5]; - _id = player call getUnitPositionId; - hint str _id; //5$/Code$ + $Code$"1" objStatus "DONE" + Marks the objective named "OBJ_1" as completed.$/Code$ - global / global + undefined / undefined - I haven't done a thorough test but this function doesn't seem to work for Civilians, use joinSilent instead. - Nothing + Nothing + - joinAs + taskCustomData - Joins the unit to the given group, if position id is available, this one is used. + Returns custom data attached to the local task or an empty array if there are no custom data attached. - https://community.bistudio.com/wiki/joinAs + https://community.bistudio.com/wiki/taskCustomData - Object joinAs Array + taskCustomData Task - unit joinAs [group, id] + taskCustomData task - $Code$player joinAs [_group, 4];$/Code$ - - $Code$// To get the position id: - getUnitPositionId = { - private ["_vvn", "_str"]; - _vvn = vehicleVarName _this; - _this setVehicleVarName ""; - _str = str _this; - _this setVehicleVarName _vvn; - parseNumber (_str select [(_str find ":") + 1]) - }; - player joinAs [ createGroup west, 5]; - _id = player call getUnitPositionId; - hint str _id; //5$/Code$ - + - global / global + undefined / undefined - Nothing + Array + - joinSilent + setWaypointType - Join all units in the array to given group silently (without radio message). To have a group member leave a group, join him with the grpNull group (e.g. [guy1] joinSilent grpNull ), but beware, as brand new group is created for the leaving unit and this could result in the number of groups in a mission growing out of control. + Changes the waypoint type. + Type can be: + "MOVE" + "DESTROY" + "GETIN" + "SAD" + "JOIN" + "LEADER" + "GETOUT" + "CYCLE" + "LOAD" + "UNLOAD" + "TR UNLOAD" + "HOLD" + "SENTRY" + "GUARD" (for use with GUARDED BY trigger or createGuardedPoint ) + "TALK" + "SCRIPTED" + "SUPPORT" + "GETIN NEAREST" + "DISMISS" + "LOITER" (new in Arma 3) + "AND" (only for game logics) + "OR" (only for game logics) + More details at Waypoint types. - https://community.bistudio.com/wiki/joinSilent + https://community.bistudio.com/wiki/setWaypointType - Array joinSilent Object/Group + Array setWaypointType String - unitArray joinSilent group + waypoint setWaypointType type - $Code$[_unitOne, _unitTwo] joinSilent ( group player );$/Code$ - - $Code$[_unitOne, _unitTwo] joinSilent player ;$/Code$ + $Code$[_grp, 2] setWaypointType "HOLD";$/Code$ - global / global + undefined / undefined - (August 4, 2014) - If all units of a group are joined to another group then the first group will be NULL-group afterward. + (07:44, 23 November 2007) + For waypoint types description look at + ArmA: Mission_Editor + OFP: Mission_Editor + Using Move With a game logic group will move the logic to the set location just like setpos. In the editor only AND and OR type of waypoints are available for GAME LOGICS but you can use CYCLE type as well in setWaypointType. + $Code$_wp = group logic1 addWaypoint [ getPos player, 1]; + [ group logic1, 1] setWPPos getPos player ; + [ group logic1, 1] setWaypointType "move";$/Code$ + + (23:07, 18 October 2013 (CEST)) + To clear up any confusion regarding the syntax, follow this example where grp01 is the name of a group of AI units: + $Code$_wp = grp01 addWaypoint [[25295,21919,85], 0]; + _wp setWaypointType "MOVE"; + _wp1 = grp01 addWaypoint [[25381,21882,70], 0]; + _wp1 setWaypointType "MOVE"; + _wp2 = grp01 addWaypoint [[ 25332,21782,78], 0]; + _wp2 setWaypointType "CYCLE"; //Use the variable (_wp2), not [grp01, 0]$/Code$ + + (December 22, 2015) + To spawn a helicopter with troops inside and make them land and unload. + + (May 6, 2017) + To use the LAND function in a waypoint, you must set "A3\functions_f\waypoints\fn_wpLand.sqf" as the script for that waypoint. + + (May 30, 2017) + In ArmA3 1.70.141838, if you add a MOVE waypoint very soon after a LOITER waypoint, ( assuming that the index of the MOVE waypoint is HIGHER than the index of the LOITER waypoint ) + then the LOITER waypoint will be considered as a MOVE waypoint. + And, if you add another waypoint after ( for example ) more than 1 second after adding the LOITER waypoint, + then the LOITER waypoint will NOT complete even when its condition has been met. + There are two ways to quit an existing LOITER waypoint that was added more than about 1 second ago; use the setCurrentWaypoint command OR add a waypoint that has the same ID as the LOITER waypoint. + The difference between those two methods is that the lather prevents the LOITER waypoint from executing its statement. - Nothing + Nothing + - joinString + removeAction - Joins array into String with provided separator. Array can be of mixed types, all elements will be converted to String prior to joining, but the fastest operation is on the array of Strings. + Removes user added action with given id index. This only removes actions added with the addAction command. You cannot remove default game actions, such as reload. + This command has local effect. The action will only be removed on the computer that executes the command. - https://community.bistudio.com/wiki/joinString + https://community.bistudio.com/wiki/removeAction - Array joinString String + Object removeAction Number - array joinString separator + unit removeAction index - $Code$_str = "- This, is a sample string." splitString "-,. "; // ["This","is","a","sample","string"] - _str joinString " "; // "This is a sample string"$/Code$ - - $Code$["This","is","sparta"] joinString " ~ "; // "This ~ is ~ sparta"$/Code$ - - $Code$["1",2, text "3"] joinString ""; // "123"$/Code$ - - $Code$["test","test"] joinString toString [12345] splitString toString [12345]; // ["test","test"]$/Code$ - - $Code$"Japa is the best!" splitString "" joinString " "; // "J a p a i s t h e b e s t !"$/Code$ - - $Code$// Remove all \r\n from file: - loadFile "somefile.txt" splitString toString [13,10] joinString " "$/Code$ + $Code$player removeAction 0;$/Code$ - undefined / undefined + global / local - String + Nothing + - join + setHorizonParallaxCoef - Join all units in the array to given group. - Maximum number of group members is: - OFP: 12 - Arma: ? - Arma 2: ? - Arma 3: "unlimited" (3000+) - VBS 2: "unlimited" (260+) - To have a group member leave a group, join him with the grpNull group (e.g. [guy1] join grpNull ), but beware, as brand new group is created for the leaving unit and this could result in the number of groups in a mission growing out of control. + Sets coef used to shift horizon position based on camera height (use 0 to disable shifting). - https://community.bistudio.com/wiki/join + https://community.bistudio.com/wiki/setHorizonParallaxCoef - Array join Group/Object + setHorizonParallaxCoef Number - unitArray join group + setHorizonParallaxCoef coef - $Code$[_unitOne, _unitTwo] join player ;$/Code$ - - $Code$[_unitOne, _unitTwo] join ( group player );$/Code$ + $Code$setHorizonParallaxCoef 1;$/Code$ - global / global + undefined / undefined - Nothing + Nothing + - kbAddDatabaseTargets + setGusts - Register target list knowledge base database to given person. + Changes the gusts value smoothly during the given time (in seconds). A time of zero means there will be an immediate change. Value is 0 to 1. - https://community.bistudio.com/wiki/kbAddDatabaseTargets + https://community.bistudio.com/wiki/setGusts - Object kbAddDatabaseTargets String + Number setGusts Number - person kbAddDatabaseTargets filename + time setGusts value - $Code$_unit kbAddDatabase "chat.txt"$/Code$ + $Code$60 setGusts 0.75;$/Code$ - undefined / undefined + undefined / local - Boolean + Nothing + - kbAddDatabase + speaker - Register knowledge base database to given person. + Returns the speaker of a person. - https://community.bistudio.com/wiki/kbAddDatabase + https://community.bistudio.com/wiki/speaker - Object kbAddDatabase String + speaker Object - person kbAddDatabase filename + speaker person - $Code$_unit kbAddDatabase "chat.txt"$/Code$ + $Code$speaker player$/Code$ undefined / undefined @@ -35710,110 +37712,112 @@ - Boolean + String + - kbAddTopic + addToRemainsCollector - Register conversation topic to given person. + Adds an array of vehicles/units to disposal manager for automatic wreck/body removal. The disposal manager follows wreck/body removal values set in description.ext - https://community.bistudio.com/wiki/kbAddTopic + https://community.bistudio.com/wiki/addToRemainsCollector - Object kbAddTopic Array + addToRemainsCollector Array - person kbAddTopic [TopicName, filenamebikb, filenamefsm, event_handler] + addToRemainsCollector remains - $Code$player kbAddtopic["myTest", "myTest.bikb", "myTest.fsm", {call compile preprocessFileLineNumbers "myTest.sqf"}];$/Code$ + $Code$addToRemainsCollector [unit1, unit2, vehicle1];$/Code$ - undefined / undefined + global / global - .bikb extension is by convention only. It can be anything. - There is no default extension. - Even tho bikb's are standard class text they cannot be raPified. - Nothing + Nothing + - kbHasTopic + commandArtilleryFire - Check if conversation topic was registered to given person. + Orders a unit to reload defined magazine commence fire burst on the given position (via the radio). - https://community.bistudio.com/wiki/kbHasTopic + https://community.bistudio.com/wiki/commandArtilleryFire - Object kbHasTopic String + Object commandArtilleryFire Array - person kbHasTopic TopicName + unit commandArtilleryFire [position, type, rounds] - + $Code$mortar1 commandArtilleryFire [[3000, 120, 1000], "8Rnd_82mm_Mo_shells", 3];$/Code$ + undefined / undefined - Boolean + Nothing + - kbReact + removeGoggles - Pass a non-verbal communication to the receiver. + Removes goggles from unit (diver goggles for example). This command does not remove NVGoggles. Use unassignItem and removeItem or just unlinkItem for latter. - https://community.bistudio.com/wiki/kbReact + https://community.bistudio.com/wiki/removeGoggles - Object kbReact Array + removeGoggles Object - person kbReact [receiver,topic,sentenceID,[argumentName,argumentValue,argumentText,argumentSpeech],] + removeGoggles unit - + $Code$removeGoggles assaultDiver;$/Code$ + - undefined / undefined + global / global - Nothing + Nothing + - kbRemoveTopic + >= - Unregister conversation topic from given person. + Checks if the left number is greater than or equal to the right one - https://community.bistudio.com/wiki/kbRemoveTopic + https://community.bistudio.com/wiki/a_greater%3D_b - Object kbRemoveTopic String + Number >= Number - person kbRemoveTopic TopicName - + @@ -35822,94 +37826,56 @@ - Nothing + Boolean + - kbTell + >> - Make the person tell to the receiver the sentence. + Returns subentry of config entry with given name. Identical to config/name. - https://community.bistudio.com/wiki/kbTell + https://community.bistudio.com/wiki/config_greater_greater_name - Object kbTell Array + Config >> String - person kbTell [receiver, TopicName, SentenceClass, [argumentName, argumentValue, argumentText, argumentSpeech],,forceRadio] - + undefined / undefined - // In Config file - class CfgIdentities - { - class SSMHQ - { - name = $STR_DN_WARFARE_HQ_BASE_UNFOLDED; - face = "Face97"; - glasses = "None"; - speaker = "MaleA0EN"; - pitch = 1.0; - }; - }; - // IN BIKB - class Sentences - { - class AirstrikeRequest - { - text = "%team requesting close air support at grid %location "; - speech[]={%Team,RequestingCloseAirSupportAtGrid,%Location}; - class Arguments - { - class Team {type = "simple";}; - class Location {type = "simple";}; - }; - }; - }; - class Arguments{}; - class Special {}; - startWithVocal[] = {}; - startWithConsonant[] = {}; - // In Script file - BIS_SSM_HQWEST = (createGroup west) createUnit ["Logic", [10,10,1000], [], 0, "NONE"]; - BIS_SSM_HQWEST setGroupId ["Headquaters", "SIX"]; - BIS_SSM_HQWEST setIdentity "SSMHQ_EN"; - player kbAddtopic["Airstrike", BIKB]; - BIS_SSM_HQWEST kbAddtopic["Airstrike", BIKB]; - player kbTell [BIS_SSM_HQWEST,"Airstrike","AirstrikeRequest", ["Team",{},"Anvil",["Anvil"]],["Location",{},"Strelka",["Strelka"]],true]; - - (may 02, 2010) - Jezuro help on BIforum : [1] - Nothing + Config + - kbWasSaid + move3DENCamera - Check if given item was said by person to someone. + Moves Eden Editor camera to given position, with or without offset. + Default camera offset: [0,-25,25] - https://community.bistudio.com/wiki/kbWasSaid + https://community.bistudio.com/wiki/move3DENCamera - Object kbWasSaid Array + move3DENCamera Array - person kbWasSaid [receiver, topic, sentenceID, maxAge] + move3DENCamera [position,useOffset] - $Code$myPlayer kbWasSaid [myReceiver, "myTopic", "mySentenceID", 3];$/Code$ + $Code$move3DENCamera [ getPos player,true];$/Code$ undefined / undefined @@ -35917,27 +37883,33 @@ - Boolean + Nothing + - keyImage + currentMagazineDetail - Returns a structured text, containing an image or name (if no image is found) of the button, on the keyboard, mouse or joystick, with the given code. + Returns description of vehicle's currently loaded magazine, its ammo count (current/default) and its id. - https://community.bistudio.com/wiki/keyImage + https://community.bistudio.com/wiki/currentMagazineDetail - keyImage Number + currentMagazineDetail Object - keyImage dikCode + currentMagazineDetail vehicle - $Code$_name = keyImage 28; //result is "Enter"$/Code$ + $Code$_currentMagazineDetail = currentMagazineDetail player ; //"6.5mm 30Rnd STANAG Mag(30/30)[id:0]"$/Code$ + + $Code$_currentMagazineDetail = currentMagazineDetail Mi_48; //"30mm HE Shells(250/250)[id:21]"$/Code$ + + $Code$_cmd = currentMagazineDetail player ; //"9mm 16Rnd Mag(13/16)[id/cr:10000011/0]" + _cmd splitString "([ ]/:)"; //["9mm","16Rnd","Mag","13","16","id","cr","10000011","0"]$/Code$ undefined / undefined @@ -35945,27 +37917,28 @@ - Structured_Text + String + - keyName + nameSound - Returns the name of a button (on the keyboard, mouse or joystick) with the given code. + Returns the nameSound of a person. - https://community.bistudio.com/wiki/keyName + https://community.bistudio.com/wiki/nameSound - keyName Number + nameSound Object - keyName dikCode + nameSound person - $Code$_name = keyName 28; //result is "Enter"$/Code$ + $Code$nameSound player$/Code$ undefined / undefined @@ -35973,1521 +37946,1421 @@ - String + String + - knowsAbout + sunOrMoon - Checks if a group or a side knows about target. If who is a unit, unit's group is considered, if who is a vehicle, commander's group is considered. + Returns the sun to moon transition state in range 0...1 - https://community.bistudio.com/wiki/knowsAbout + https://community.bistudio.com/wiki/sunOrMoon - Object/Group knowsAbout Object - - Side knowsAbout Object + sunOrMoon - who knowsAbout target - - side knowsAbout target + sunOrMoon - $Code$_kv = _soldierOne knowsAbout _jeepOne;$/Code$ - - $Code$_kv = ( side player ) knowsAbout _target;$/Code$ + $Code$_transitionState = sunOrMoon ;$/Code$ - global / undefined + undefined / undefined - (August 4, 2006) - Notes from before the conversion: - With Resistance (1.91) : No matter what class of unit the target is and no matter what the skill/class of the enemy AI, the magic 'knowsAbout' number is 0.105. - With CWC (1.46) : No matter what class of unit the target is and no matter what the skill/class of the enemy AI, the magic 'knowsAbout' number is 0.7. - What this means is, the AI will not fire on an enemy soldier until his 'knowsAbout' level of that enemy has reached the 'magic number' or higher. - This suggests that the knowsabout level must reach the magic threshold before a unit knows if another unit is an enemy or a friendly unit. - Triggers and knowsabout level: "Detected by xxx" triggers also follow the above rules. For a detected trigger to be set off, the knowsAbout level must reach the magic number. - Also... As soon as An AI unit gets hit with a bullet his knowsAbout level for the unit that shot him will instantly jump to 1.5, even if the shooter is 1000m away. Vice versa is also true. If An AI soldier's knowsAbout level for an enemy is 0.7 and the soldier fires and hits the enemy, his knowsAbout level about the enemy will instantly jump to 1.5. Some editors have found, whilst using this command over the years, that the following characteristics have cropped up: - AI enemies have a very limited amount of peripheral vision, it's not nearly as good as a human player's. A target must be in front of the unit for him to be noticed, so if you sprint right behind an enemy, this value doesn't increase. - Depending on the units skill level, it can take a little time for the unit to notice a target. So if you run right past a unit, this value might not increase. - Bushes between the unit and the target seem to have little effect on this value, and trees definitely have no affect. You may be in a forest, and can't see the unit, but he can see you. - MP Note knowsAbout returns a viable result only if left-hand parameter unit is local. - - (January 15, 2007) - In OFP v1.96, KnowsAbout return values range from 0 to 4. - All units in a group have equal knowsAbout for any given target. All units in a group always return knowsAbout 4 about each other. This suggests groups share a single knowledge base. - Without any contact with the target, the knowsAbout value decays at a linear rate so that it halves over 120 seconds. After this time is up knowsAbout drops instantly to 0. - If the distance between the all of unit's group and the target exceeds the viewdistance setting, knowsAbout instantly drops to 0. This is not changed by fog or daylight. - Note that in OFP unit see all the targets that his group members see. The data is processed between teammembers freely. - - the magic 'knowsAbout' number is 0.105. It's not that simple.Maybe true for infantry but not all vehicles. "Reveal" command sets knowsAbout to 1, but planes still won't fire at soldiers on the ground. There's only one known way to pass through this - designate target with another fake infantry unit near the target. As soon as this fake unit see the target knowsAbout lifts up to 2.5-4 and even single enemy soldiers are attacked rom the air (of course if plane has suitable munition :)) - - (July 05, 2009) - In ArmA (other not tested), KnowsAbout value will stay at its highest value during approximately 2-3 min and then reinitialized. - - (January 14, 2012) - Notes are for OA 1.60 : - The KnowsAbout value drops immediately back to zero, if the distance between both units is larger than the local viewDistance value. - After 110 seconds without (visible?) contact, the KnowsAbout value drops to zero again. While it seemed to take longer the higher the KnowsAbout value is (at least for a value of 4 it took almost six minutes at one point), I was unable to reproduce/confirm that. It is 110 seconds no matter how high the KnowsAbout value it seems. - - (June 13, 2012) - By Suma ( source ): - All friendly units within a view distance to each unit [are revealed (to the player? or each friendly?)] on the mission start. The code is half broken, as it does not make the units known, it only sets the "accuracy" value for them. Note: This is not affecting enemy units at all. - - (March 27, 2013) - Arma-II OA (1.62.101.480 @ACE), tests with infantry: - It is still true, that the command returns values between 0 (lowest) and 4 (most). Freshly Spotted units will have at least 1.5, slowly decreasing when the target disappeared. - The following Table shows my test results on a clear day at Takistan using the Vector. Please note that the returned values vary considerably depending on weather and time. Moonlight however seems to not have any considerable effect. - 12:00, sunlight, clear sky - Distance - knowsAbout - 1530 - 1.5 - 1370 - 1.5 - 1250 - 1.5 - 1135 - 1.5 - 1055 - 1.52 - 1022 - 1.64 - 990 - 1.74 - 833 - 2.5 - 720 - 3.37 - 600 - 3.81 - 505 - 3.86 - 400 - 3.92 - 380 - 4 - 365 - 4 - 21:00, bright half moon, clear sky - Distance - knowsAbout - 285 - 1.5 - 120 - 1.5 - 88 - 1.89 - 75 - 2.3 - 61 - 3.9 - 23:00, pitch black, clear sky, NVG on - Distance - knowsAbout - 600 - 1.5 - 487 - 1.5 - 390 - 1.5 - 289 - 2.22 - 278 - 2.4 + (September 21, 2014) + Note that at a 0.99 value, the twilight is still quite dark. + Can be tested with : + $Code$//test + onEachFrame + { + systemchat format ["%1",sunOrMoon]; + };$/Code$ - (May 31, 2014) - Can also use SIDE in place of UNIT. For example: - $Code$EAST knowsAbout player ;$/Code$ + (May 18, 2017) + As of Arma 3 1.7, this returns either 1 for sun or 0 for moon. Nothing in between. - Number - Number + Number + - landAt + forceWeaponFire - Order an AI airplane to land at a given airport. ID is the number to identify which airport on the island you want. Since Arma 3 v1.68 it is possible to order a helicopter to land on designated helipad. + The unit will be forced to fire weapon from the given muzzle. The weapon will not fire if firemode passed as parameter is not supported by the given muzzle. The muzzle could belong to a vehicle weapon and unit in this case will be the unit operating this weapon. Doesnt't seem to work for units in FFV positions. Works on player. See also: BIS_fnc_fire - https://community.bistudio.com/wiki/landAt + https://community.bistudio.com/wiki/forceWeaponFire - Object landAt Number - - Object landAt Object + Object forceWeaponFire Array - plane landAt id - - heli landAt helipad + unit forceWeaponFire [muzzle, firemode] - $Code$_plane1 landAt 1;$/Code$ + $Code$_unit forceWeaponFire ["arifle_MX_F", "Single"]; + _unit forceWeaponFire ["hgun_ACPC2_F", "hgun_ACPC2_F"]; + _unit forceWeaponFire ["HandGrenadeMuzzle","HandGrenadeMuzzle"]; + _unit forceWeaponFire ["MiniGrenadeMuzzle","MiniGrenadeMuzzle"]; + _unit forceWeaponFire ["HandGrenade_Stone","HandGrenade_Stone"]; + _unit forceWeaponFire ["SmokeShellMuzzle","SmokeShellMuzzle"]; + _unit forceWeaponFire ["ChemlightGreenMuzzle","ChemlightGreenMuzzle"]; + _unit forceWeaponFire ["IRGrenade","IRGrenade"]; + _unit forceWeaponFire ["Laserdesignator","Laserdesignator"];$/Code$ - $Code$_heli1 land "LAND"; - _heli1 landAt _helipad;$/Code$ + $Code$gunner blackfoot forceWeaponFire ["gatling_20mm", "close"];$/Code$ local / global - ARMA 3: - Altis : - 0 = Airbase - 1 = AAC Airfield - 2 = Krya Nera Airstrip - 3 = Selakeno Airfield - 4 = Molos Airfield - 5 = Almyra Salt Lake Airstrip - Posted 17:56, 21 September 2010 (CEST) + (August 25, 2013) + Here is a neat workaround trick for firemode change from a script: + $Code$_weapon = currentWeapon player ; + _ammo = player ammo _weapon; + player setAmmo [_weapon, 0]; + player forceWeaponFire [_weapon, "FullAuto"]; + player setAmmo [_weapon, _ammo];$/Code$ - ARMA 2 OA: - Takistan : - 0 = Airport NorthWest - 1 = Airport SouthEast - Planes approach all airports from South West - ARMA 2: - Utes : - 0 = There is only one airport - Chernarus : - 0 = Airport NorthWest close to Grishno - 1 = Airport NorthEast close to Kranostav - 2 = Airport SouthWest close to Balota - 3 = Nearest Airport - Planes approach all airports from South East - ARMA: - Sahrani : - 0: - Paraiso - 1: - Rahmadi - 2: - Pita - 3: - Antigua + (April 14, 2014) + (A3 1.16) forceWeaponFire is no longer only limited to units, but can remote aircrafts weapon firing as well. Passed source unit should be the correct one who controls the weapon, if passed mode is "this", use the weapon name instead: + $Code$_weapon = ( weapons _veh) select 3; + _mode = ( getArray ( configFile "cfgweapons" _weapon "modes")) select 0; + if (_mode == "this") then {_mode = _weapon;}; + ( driver _veh) forceWeaponFire [_weapon, _mode]; + //Force a CAS fire a rocket. + $/Code$ + Currently this command is not available for land vehicle remote fire. - (November 8, 2014) - In Arma 3 (1.34) landAt only works for fixed-wing aircraft. Rotary-wing craft ignore this command. + (September 02, 2014) + Similar to Killzone Kid's note, This fires the units current weapon in its current firemode. + $Code$_unit forceWeaponFire [ weaponState _unit select 1, weaponState _unit select 2];$/Code$ - (June 19, 2016) - ARMA 3 : Tanoa - 0 = Aeroport de Tanoa - 1 = Tuvanaka Airbase - 2 = Saint-George Airstrip - 3 = Bala Airstrip - 4 = La Rochelle Aerodome - ARMA 3 : Stratis - 0 = Stratis Airbase + (January 3, 2015) + fireAtTarget command can be used to force fire gunner weapon in vehicles. A gunner must be present. $Code$_veh fireAtTarget [ objNull ];$/Code$ Will fire one shot even if player is gunner. + fire command can also be used to fire vehicle weapon, like smoke launcher for example: $Code$ vehicle player fire "SmokeLauncher";$/Code$ And if this doesn't work, it is possible to force fire via action $Code$tank action ["UseWeapon", tank, commander tank, 0];$/Code$ - Nothing - Nothing + Nothing + - landResult + ctrlRemoveEventHandler - Return the result of helicopter landing position searching (performed, after land command). The value can be "Found" (position found),"NotFound" (position not found), "NotReady" (position searching is,still in progress) or empty string when wrong argument given. + Remove a given event handler from the given control. - https://community.bistudio.com/wiki/landResult + https://community.bistudio.com/wiki/ctrlRemoveEventHandler - landResult Object + Control ctrlRemoveEventHandler Array - landResult helicopter + control ctrlRemoveEventHandler [handler name,id] - + $Code$_map ctrlRemoveEventHandler ["Draw", _id];$/Code$ + undefined / undefined - String + Nothing + - land + shownWarrant - Force helicopter landing. Landing mode may be: - "LAND" (complete stop) - "GET IN" (hovering very low, for another unit to get in) - "GET OUT" (hovering low,for another unit to get out) - "NONE" (cancel a landing) Available since ArmA 2 57463 build. + Check if player has ID card enabled. Obsolete command. - https://community.bistudio.com/wiki/land + https://community.bistudio.com/wiki/shownWarrant - Object land String + shownWarrant - helicopter land mode + shownWarrant - $Code$_cobraOne land "LAND"$/Code$ - + - local / global + undefined / undefined - (August 4, 2006) - Notes from before the conversion: - Helos will land at the nearest "H" or "Invisible H", if there is one around (within 500m in ArmA). - - To make a helicopter LAND correctly and not hovering over the landing position use unitReady to check if the helicopter already has reached his destination. - You can fix a landing bug by using a short delay bevore checking the unitReady command. - _helicopter move (getPos _destination); - sleep 3; - while { ( (alive _helicopter) && !(unitReady _helicopter) ) } do - { - sleep 1; - }; - if (alive _helicopter) then - { - _helicopter land "LAND"; - }; - Nothing + Boolean + - language + moveTime - Returns current game language. + Returns the current time of the most important RTM animation currently being played on the soldier. - https://community.bistudio.com/wiki/language + https://community.bistudio.com/wiki/moveTime - language + moveTime Object - language + moveTime soldier - + $Code$moveTime player ;$/Code$ + undefined / undefined - String + Number + - laserTarget + missionStart - Returns laser target object created by given unit (gunner in vehicle or on foot) when using "Laserdesignator" or another laser targeting device. Laser target object is global and can be retrieved from any PC. + Returns date and time when mission started in format [year, month, day, hour, minute, second]. + Works only in multiplayer, in singleplayer all values are equal to zero → [0,0,0,0,0,0] + NOTE : Because missionStart contains the time of the actual start of the mission, it might not be available in pre-init or init, but is guaranteed to be available in post-init when time 0. - https://community.bistudio.com/wiki/laserTarget + https://community.bistudio.com/wiki/missionStart - laserTarget Object + missionStart - laserTarget unitName + missionStart - $Code$_target = laserTarget gunner heli;$/Code$ + $Code$setDate ( missionStart select [0,5]);$/Code$ - $Code$_designatedPos = position laserTarget player;$/Code$ + $Code$// Set real date: + //postInit = 1; + if ( isServer ) then { + waitUntil { time 0}; + setDate ( missionStart select [0,5]); + };$/Code$ - global / undefined + undefined / undefined - (December 15, 2010) - Need to be try with a soldier and laser designator + (September 25, 2014) + Returns array with date indicating when the mission has started (after briefing screen). In OFP this command is bugged – it works only in multiplayer on a player‐hosted machine and on a client. In single player it would return [0,0,0,0,0,0] and on a dedicated server – [1970,1,1,0,0,0]. In CWA this command is fixed. - (December 19, 2010) - Works with either infantry or vehicles. Returns objNull if no target is present + (December 30, 2014) + In arma 3 this command returns [0,0,0,0,0,0] in SP, [1970,1,1,0,0,0] on dedicated server and [1970,1,1,0,0,0] initially and then server real time on local headless client. On player clients it shows client's local date and time. Since Arma 3 v1.49 the dedicated server also returns correct mission start date. + + (August 27, 2015) + ArmA 3 1.50: This command now returns the correct values on dedicated server. - Object + Array + - lbAdd + disableMapIndicators - Adds an item with the given text to the listbox or combobox with id idc of the topmost user dialog. - It returns the index of the newly added item. + Command allows suppressing visualization of FRIENDLY, ENEMY, MINES and/or PING map indicators from difficulty setting EXTENDED MAP CONTENT. - https://community.bistudio.com/wiki/lbAdd + https://community.bistudio.com/wiki/disableMapIndicators - lbAdd Array - - Control lbAdd String + disableMapIndicators Array - lbAdd [idc, text] - - control lbAdd text + disableMapIndicators [disableFriendly,disableEnemy,disableMines,disablePing] - $Code$_index = lbAdd [101, "First item"];$/Code$ - - $Code$_index = _control lbAdd "First item";$/Code$ + $Code$// Disable visualization of friendly and enemy units: + disableMapIndicators [true,true,false,false];$/Code$ - local / local + undefined / local - More information on the LB command family can be found here - - (April 12, 2015) - This command can be very very frustrating to use because it does not output any errors if unable to function. - Often, the 2nd provided syntax needs to be used like this: - $Code$_giveYourControlAname = (findDisplay 7) displayCtrl 9; - _addThisToListBox = "Option"; - _giveYourControlAname lbAdd _addThisToListBox;$/Code$ - Where "7" is the "idd" of the dialog you made in your ".hpp" file and where "9" is the "idc" of the RscListBox or RscComboBox. - The code above will add an option named "Option" to the ListBox or ComboBox. - Number - Number + Nothing + - lbClear + sideRadio - Clear all items in listbox or combobox with id idc of topmost user dialog. + Sends the audio message to the side radio channel. Must have assigned "ItemRadio" to send or receive the transmission. The message is defined in CfgRadio in the description.ext file or config radio protocol. The transmission will play only on the PC where command was executed. If you need the transmission to play on all computers, you have to execute it globally (see remoteExec ). + Note: When transmitting unit gets killed, transmission will be interrupted, however when receiving unit gets killed, the transmission continues to play. - https://community.bistudio.com/wiki/lbClear + https://community.bistudio.com/wiki/sideRadio - lbClear Number + Object sideRadio String - lbClear Control + Array sideRadio String - lbClear idc + unit sideRadio radioName - lbClear control + [side, identity] sideRadio radioName - $Code$lbClear 101;$/Code$ + $Code$_soldierOne sideRadio "messageOne";$/Code$ - $Code$lbClear _ctrl;$/Code$ + $Code$player sideRadio configName selectRandom ("true" configClasses ( configFile "CfgRadio"));$/Code$ + + $Code$[ west, "Base"] sideRadio configName selectRandom ("true" configClasses ( configFile "CfgRadio"));$/Code$ - local / local + global / local - More information on the LB command family can be found here + (03:47, 12 February 2007) + In OFP v1.96, sideRadio messages can be sent from 2 abstract sources: "Papa_Bear" and "Base FireFly". Use sideRadio on an array in the form [SIDE,"base"],[SIDE,"HQ"],[SIDE,"Papa_bear"] or [SIDE,"airbase"], where SIDE is the side broadcasting. "HQ", "base" and "Papa_bear" seem to be the same object. The callsign strings can be re-defined using a stringTable.csv file, using STR_CFG_PAPABEAR and STR_CFG_FIREFLYBASE. Example : [EAST,"base"] sideRadio "returnToBase". + + (December 3, 2016) + To transmit user custom sounds (see Multiplayer_Custom_Sounds_Tutorial ), prefix the full filename including file extension with #. For example if there is a custom user sound file called MySound.ogg, to play it on the radio use: + $Code$ player sideRadio "#MySound.ogg";$/Code$ - Nothing - Nothing + Nothing - Nothing + - lbColor + vehicleReportRemoteTargets - Returns the text color of the item with the given index of the listbox or combobox with id idc of the topmost user dialog. - The color is returned in format Color. + Gets whether the vehicle shares acquired targets via datalink with the Side center. - https://community.bistudio.com/wiki/lbColor + https://community.bistudio.com/wiki/vehicleReportRemoteTargets - lbColor Array - - Control lbColor Number + vehicleReportRemoteTargets Object - lbColor [idc, index] - - control lbColor index + vehicleReportRemoteTargets vehicle - $Code$_colour = lbColor [101, 0];$/Code$ - - $Code$_color = _control lbColor 0;$/Code$ + $Code$vehicleReportRemoteTargets ( vehicle player );$/Code$ - local / local + undefined / undefined - More information on the LB command family can be found here - Array - Array + Boolean + - lbCurSel + deleteVehicle - Returns the index of the selected item of the listbox or combobox with id idc of the topmost user dialog. For listbox LB_MULTI (multi-selection) use lbSelection. + Deletes an object. Only units inserted in the mission editor and units created during the game's progress can be deleted by this command. Island objects and player units cannot be removed. Deleting a vehicle, which is still being accessed by a running script, can result in a CTD. + NOTE : Actual object deletion, when object becomes objNull, happens on the next frame after command execution, but there are some object modifications that happen immediately. For example if the object is unit in a group, it immediately becomes groupless isNull group _unit; //true - https://community.bistudio.com/wiki/lbCurSel + https://community.bistudio.com/wiki/deleteVehicle - lbCurSel Number - - lbCurSel Control + deleteVehicle Object - lbCurSel idc - - lbCurSel control + deleteVehicle object - $Code$_index = lbCurSel 101;$/Code$ + $Code$deleteVehicle _house1;$/Code$ - $Code$lbCurSel _ctrl;$/Code$ + $Code${ + _x action ["Eject", car]; + } forEach crew car; + deleteVehicle car;$/Code$ + + $Code$// Objects such as + //test_EmptyObjectForBubbles + //test_EmptyObjectForFireBig + //test_EmptyObjectForSmoke + //create additional emitters that needs to be deleted first before deleting the object itself: + ///--- function to delete test object (MP compatible) + fnc_deleteTestObj = { + _this addMPEventHandler ["MPKilled", { + _this = _this select 0; + { + deleteVehicle _x; + } forEach (_this getVariable ["effects", []]); + if ( isServer ) then { + deleteVehicle _this; + }; + }]; + _this setDamage 1; + }; + ///--- example + [] spawn { + _fire = "test_EmptyObjectForFireBig" createVehicle position player ; + sleep 5; + _fire call fnc_deleteTestObj; + };$/Code$ - undefined / undefined + global / global - More information on the LB command family can be found here - - (July 11, 2014) - If nothing is selected this command returns -1 - Number - Number + Nothing + - lbData + shownCuratorCompass - Returns the additional text (invisible) in an item with the given index of the listbox or combobox with id idc of the topmost user dialog. + Returns true if compass is shown. - https://community.bistudio.com/wiki/lbData + https://community.bistudio.com/wiki/shownCuratorCompass - lbData Array - - Control lbData Number + shownCuratorCompass - lbData [idc, index] - - control lbData index + shownCuratorCompass - $Code$_data = lbData [101, 0];$/Code$ - - $Code$_data = _control lbData 0;$/Code$ - + - local / local + undefined / undefined - More information on the LB command family can be found here - String - String + Boolean + - lbDelete + allCurators - Removes the item with the given index from the listbox or combobox with id idc of the topmost user dialog. + Returns list of all curators. - https://community.bistudio.com/wiki/lbDelete + https://community.bistudio.com/wiki/allCurators - lbDelete Array - - Control lbDelete Number + allCurators - lbDelete [idc, index] - - control lbDelete index + allCurators - $Code$lbDelete [101, 0];$/Code$ - - $Code$_control lbDelete 0;$/Code$ + $Code$_myVariable = allCurators;$/Code$ - local / local + undefined / undefined - More information on the LB command family can be found here + (June 20, 2015) + This returns all curator logic units, not the units assigned to the logic. - Nothing - Nothing + Array + - lbIsSelected + suppressFor - Check whether given row of the given listbox is selected. + Force suppressive fire from the unit. - https://community.bistudio.com/wiki/lbIsSelected + https://community.bistudio.com/wiki/suppressFor - Control lbIsSelected Number + Object suppressFor Number - control lbIsSelected index + unit suppressFor duration - $Code$_selected = _control lbIsSelected 0;$/Code$ + $Code$_soldier1 suppressFor 10 + // Will force soldier1 to do suppressive fire to known enemies during 10 seconds$/Code$ - local / local + undefined / undefined - More information on the LB command family can be found here - Boolean + Nothing + - lbPicture + isFlashlightOn - Returns the picture name of the item with the given index of the listbox or combobox with id idc of the topmost user dialog. + Returns true if there is a linked and enabled flashlight on a given weapon. - https://community.bistudio.com/wiki/lbPicture + https://community.bistudio.com/wiki/isFlashlightOn - lbPicture Array - - Control lbPicture Number + Object isFlashlightOn String - lbPicture [idc, index] - - control lbPicture index + unit isFlashlightOn weapon - $Code$_picture = lbPicture [101, 0];$/Code$ - - $Code$_picture = _control lbPicture 0;$/Code$ + $Code$player isFlashlightOn ( currentWeapon player );$/Code$ undefined / undefined - More information on the LB command family can be found here - String - String + Boolean + - lbSelection + showHUD - Returns Array of selected rows indices in the given listbox of style LB_MULTI (multi-selection). For single selection listbox use lbCurSel instead. + Enable / disable showing of HUD. Defines visibility of weapon crosshair and any informational tags that appear when pointing the weapon at an object as well as availability of the default action menu. Unfortunately, it also hides icons drawn with drawIcon3D. + Appearance of HUD can also be controlled with showHUD param in description.ext. NOTE: As of Arma 3 v1.49.131879 there is a showHUD[] array param, that is identical in format to the extended showHUD command. When showHUD[] array param is present in description.ext, it will disable showHUD command entirely, allowing mission makers to permanently alter visibility of some HUD elements. - https://community.bistudio.com/wiki/lbSelection + https://community.bistudio.com/wiki/showHUD - lbSelection Control + showHUD Boolean + + showHUD Array - lbSelection control + showHUD enable + + showHUD [hud, info, radar, compass, direction, menu, group, cursors, panels] - $Code$_indices = lbSelection _control;$/Code$ + $Code$showHUD false ;$/Code$ + + $Code$// Hide vehicle radar and compass: + showHUD [ true, true, false, false, true, true, true, true ];$/Code$ + + $Code$// Check if HUD visibility is hardcoded in mission config and showHUD command is overriden: + _disabledShowHUD = isArray ( missionConfigFile "showHUD");$/Code$ - undefined / undefined + undefined / local - (April 10, 2016) - This command works fine with listboxs of style LB_MULTI and should not be marked as obsolete as lbCurSel does not provide the same functionality. + (August 17, 2015) + Last param, "cursors" controls visibility of the action menu as well as weapon cursors. However if 1st param "hud" hides and disables action menu, last param "cursors" only hides it. So you get invisible action menu that is fully operational. inGameUISetEventHandler will still fire on interaction, giving the information about selected item on the action menu even if you cannot see it. Unfortunately it also hides icons drawn with drawIcon3D. - Array + Nothing - Nothing + - lbSetColor + showCompass - Sets the color of the item with the given index of the listbox or combobox with id idc of the topmost user dialog to color. - Colour is in format Color. + Shows or hides the compass on the map screen, if enabled for the mission and you possess the item. (default true ) - https://community.bistudio.com/wiki/lbSetColor + https://community.bistudio.com/wiki/showCompass - lbSetColor Array - - Control lbSetColor Array + showCompass Boolean - lbSetColor [idc, index, color] - - control lbSetColor [index, color] + showCompass show - $Code$lbSetColor [101, 0, [0, 1, 0, 0.5]];$/Code$ - - $Code$_control lbSetColor [0, [0, 1, 0, 0.5]];$/Code$ + $Code$showCompass false ;$/Code$ - local / local + undefined / undefined - More information on the LB command family can be found here + (16 Aug, 2009) + In Arma 2, the Compass is now an inventory item. Class path is CfgWeapons- ItemCompass. Use the commands addWeapon and removeWeapon to add or remove it from a unit's inventory. (example: player addweapon "ItemCompass") - Nothing - Nothing + Nothing + - lbSetCurSel + setFeatureType - Selects the item with the given index of the listbox or combobox with id idc of the topmost user dialog. - To deselect all, use -1: _ctrl lbSetCurSel -1; For listbox of style LB_MULTI use lbSetSelected instead. + Enable/disable object as a feature/landmark. Possible feature types: + 0 - Feature disabled + 1 - Object is always visible within object view distance + 2 - Object is always visible within terrain view distance + The limit is 500 map/static objects and 200 dynamic objects including config features and auto features (flying helicopters, airplanes). When limit is reached, function returns false. - https://community.bistudio.com/wiki/lbSetCurSel + https://community.bistudio.com/wiki/setFeatureType - lbSetCurSel Array - - Control lbSetCurSel Number + Object setFeatureType Number - lbSetCurSel [idc, index] - - control lbSetCurSel index + object setFeatureType type - $Code$lbSetCurSel [101, 0];$/Code$ - - $Code$_control lbSetCurSel 0;$/Code$ + $Code$// Set a building to be always rendered: + building setFeatureType 2;$/Code$ - undefined / undefined + global / local - More information on the LB command family can be found here - - (November 29, 2014) - lbSetCurSel -1 has no effect while the listbox is populated. You should use lbClear first, then lbSetCurSel -1, then re-populate the listbox. - - (March 1, 2015) - Keep in mind that running this command against control will fire attached 'onLBSelChanged' event handler. + (October 10, 2017) + For world objects, command effect persists after mission restart. Map must be reloaded to automatically revert setting. - Nothing - Nothing + Boolean + - lbSetData + setFace - Sets the additional text (invisible) in the item with the given index of the listbox or combobox with id idc of the topmost user dialog to the given data. + Set person's face. For a list of available faces, check Category:CfgIdentities. - https://community.bistudio.com/wiki/lbSetData + https://community.bistudio.com/wiki/setFace - lbSetData Array - - Control lbSetData Array + Object setFace String - lbSetData [idc, index, data] - - control lbSetData [index, data] + person setFace face - $Code$lbSetData [101, 1, "#1"];$/Code$ + $Code$soldier1 setFace "WhiteHead_02"$/Code$ - $Code$_control lbSetData [1, "#1"];$/Code$ + $Code$// Set persistent face for a unit in MP + if ( isServer ) then {[_unit, "AsianHead_A3_02"] remoteExec ["setFace", 0, _unit]};$/Code$ - undefined / undefined + global / local - More information on the LB command family can be found here + (September 19, 2013) + For ArmA 3 face can be any of the following: + AfricanHead_01 + AfricanHead_02 + AfricanHead_03 + AsianHead_A3_01 + AsianHead_A3_02 + AsianHead_A3_03 + GreekHead_A3_01 + GreekHead_A3_02 + GreekHead_A3_03 + GreekHead_A3_04 + GreekHead_A3_05 + GreekHead_A3_06 + GreekHead_A3_07 + GreekHead_A3_08 + GreekHead_A3_09 + PersianHead_A3_01 + PersianHead_A3_02 + PersianHead_A3_03 + NATOHead_01 + WhiteHead_02 + WhiteHead_03 + WhiteHead_04 + WhiteHead_05 + WhiteHead_06 + WhiteHead_07 + WhiteHead_08 + WhiteHead_09 + WhiteHead_10 + WhiteHead_11 + WhiteHead_12 + WhiteHead_13 + WhiteHead_14 + WhiteHead_15 + + (unknown) + For ArmA 2 the face value is a string from Face01 to Face107. Camo faces are available as well, 6 per face. For example the full set of class names for face value 77 would be: + Face77, Face77_camo1, Face77_camo2, Face77_camo3, Face77_camo4, Face77_camo5 and Face77_camo6 + All Armed Assault 1.08 faces plus tutorial, + Online gallery of 1.08 Armed Assault faces + a full list of Arma 2 faces - Nothing - Nothing + Nothing + - lbSetPictureColorDisabled + resources - Sets the disabled color of item's picture (left) with the given index of the listbox with id idc of the topmost user dialog to the given color. Color is in format Color. Color which consists from only zeros means disable this override. + Returns the resources of a team member. Results are local to the PC on which command was executed. - https://community.bistudio.com/wiki/lbSetPictureColorDisabled + https://community.bistudio.com/wiki/resources - lbSetPictureColorDisabled Array - - Control lbSetPictureColorDisabled Array + resources Team_Member - lbSetPictureColorDisabled [idc, index, color] - - control lbSetPictureColorDisabled [index, color] + resources member - $Code$lbSetPictureColorDisabled [101, 0, [1, 1, 1, 0.25]];$/Code$ - - $Code$_ctrl lbSetPictureColorDisabled [0, [1, 1, 1, 0.25]];$/Code$ - + - undefined / undefined + global / local - More information on the LB command family can be found here - Nothing - Nothing + Array + - lbSetPictureColorSelected + windDir - Sets the selected color of item's picture (left) with the given index of the listbox with id idc of the topmost user dialog to the given color. Color is in format Color. Color which consists from only zeros means disable this override. + Returns the current wind azimuth. - https://community.bistudio.com/wiki/lbSetPictureColorSelected + https://community.bistudio.com/wiki/windDir - lbSetPictureColorSelected Array - - Control lbSetPictureColorSelected Array + windDir - lbSetPictureColorSelected [idc, index, color] - - control lbSetPictureColorSelected [index, color] + windDir - $Code$lbSetPictureColorSelected [101, 0, [0, 1, 0, 0.5]];$/Code$ - - $Code$_ctrl lbSetPictureColorSelected [0, [1, 1, 1, 1]];$/Code$ + $Code$if ( windDir 45 || windDir 315) then { + hint "I feel a northern wind"; + };$/Code$ undefined / undefined - More information on the LB command family can be found here - Nothing - Nothing + Number + - lbSetPictureColor + locationPosition - Sets the color of item's picture (left) with the given index of the listbox with id idc of the topmost user dialog to the given color. Color is in format Color. Color which consists from only zeros means disable this override. + Returns the position of a location. If the location is attached to an object, that object's position is returned. - https://community.bistudio.com/wiki/lbSetPictureColor + https://community.bistudio.com/wiki/locationPosition - lbSetPictureColor Array - - Control lbSetPictureColor Array + locationPosition Location - lbSetPictureColor [idc, index, color] - - control lbSetPictureColor [index, color] + locationPosition location - $Code$lbSetPictureColor [101, 0, [0, 1, 0, 0.5]];$/Code$ + $Code$_locationPos = locationPosition myLocation;$/Code$ - $Code$_ctrl lbSetPictureColor [0, [1, 1, 1, 1]];$/Code$ - + $Code$_location = nearestLocation [ getPos player, "nameCity"]; + _locationPos = locationPosition _location;$/Code$ + undefined / undefined - More information on the LB command family can be found here - - (August 18, 2015) - (ArmA 3 1.48) To give an image on the right side of a listbox item: - $Code$_ctrl lbSetPictureRightColor [_index, [1,1,1,0.7]];$/Code$ + (October 24, 2015) + locationPosition returns a position that is altitude zero ASL. - Nothing - Nothing + Array + - lbSetPictureRightColorDisabled + closeDialog - Sets the disabled color of second (right aligned) picture of the item with the given index of the listbox with id idc of the topmost user dialog to the given color. Color is in format Color. Color which consists from only zeros means disable this override. + Close the currently active user dialog with exit code. Most common exit codes are: + $Code$#define IDC_OK 1 //emulate "Ok" button$/Code$ + $Code$#define IDC_CANCEL 2 //emulate "Cancel" button$/Code$ - https://community.bistudio.com/wiki/lbSetPictureRightColorDisabled + https://community.bistudio.com/wiki/closeDialog - lbSetPictureRightColorDisabled Array - - Control lbSetPictureRightColorDisabled Array + closeDialog Number - lbSetPictureRightColorDisabled [idc, index, color] - - control lbSetPictureRightColorDisabled [index, color] + closeDialog exitcode - $Code$lbSetPictureRightColorDisabled [101, 0, [1, 1, 1, 0.25]];$/Code$ + $Code$closeDialog 2;$/Code$ - $Code$_ctrl lbSetPictureRightColorDisabled [0, [1, 1, 1, 0.25]];$/Code$ + $Code$#define IDC_CANCEL 2 + closeDialog IDC_CANCEL;$/Code$ - undefined / undefined + local / local - More information on the LB command family can be found here - Nothing - Nothing + Nothing + - lbSetPictureRightColorSelected + lockedCargo - Sets the selected color of the second (right aligned) picture of the item with the given index of the listbox with id idc of the topmost user dialog to the given color. Color is in format Color. Color which consists from only zeros means disable this override. + Check whether cargo position of the vehicle is locked. - https://community.bistudio.com/wiki/lbSetPictureRightColorSelected + https://community.bistudio.com/wiki/lockedCargo - lbSetPictureRightColorSelected Array - - Control lbSetPictureRightColorSelected Array + Object lockedCargo Number - lbSetPictureRightColorSelected [idc, index, color] - - control lbSetPictureRightColorSelected [index, color] + vehicle lockedCargo cargoIndex - $Code$lbSetPictureRightColorSelected [101, 0, [0, 1, 0, 0.5]];$/Code$ - - $Code$_ctrl lbSetPictureRightColorSelected [0, [1, 1, 1, 1]];$/Code$ + $Code$_result = vehicleName lockedCargo 0;$/Code$ undefined / undefined - More information on the LB command family can be found here + (May 4, 2016) + For some vehicles, the command returns nothing if the cargo index is invalid (i.e. -1) - Nothing - Nothing + Boolean + - lbSetPictureRightColor + verifySignature - Sets the color of the second (right aligned) picture of the given index of the listbox with id idc of the topmost user dialog to the given color. Color is in format Color. Color which consists from only zeros means disable this override. + Check if file is signed by any key present in game keys folders. Note: On client, it does not check against the keys accepted by server. - https://community.bistudio.com/wiki/lbSetPictureRightColor + https://community.bistudio.com/wiki/verifySignature - lbSetPictureRightColor Array - - Control lbSetPictureRightColor Array + verifySignature String - lbSetPictureRightColor [idc, index, color] - - control lbSetPictureRightColor [index, color] + verifySignature filename - $Code$lbSetPictureRightColor [101, 0, [0, 1, 0, 0.5]];$/Code$ + $Code$verifySignature "@MyAddon\Addons\SomeAddon.pbo";$/Code$ - $Code$_ctrl lbSetPictureRightColor [0, [1, 1, 1, 1]];$/Code$ + $Code$verifySignature "@MyAddon\Somefnc.dll";$/Code$ undefined / undefined - More information on the LB command family can be found here - Nothing - Nothing + Boolean + - lbSetPictureRight + round - Sets the second (right aligned) picture in the item with the given index of the listbox or combobox with id idc of the topmost user dialog. Name is the picture name. The picture is searched for in the mission directory, the dtaExt subdirectory of the campaign directory and the dtaExt directory and the data bank (or directory). - In Arma 3 it might be necessary to set the color of the picture as well with lbSetPictureRightColor as default [0,0,0,0] color makes picture invisible. + Rounds up or down to the closest integer. - https://community.bistudio.com/wiki/lbSetPictureRight + https://community.bistudio.com/wiki/round - lbSetPictureRight Array - - Control lbSetPictureRight Array + round Number - lbSetPictureRight [idc, index, name] - - control lbSetPictureRight [index, name] + round x - $Code$lbSetPictureRight [101, 0, "iskoda"];$/Code$ + $Code$_val= round 5.25, result is 5$/Code$ - $Code$_control lbSetPictureRight [0, "iskoda"];$/Code$ + $Code$_val= round 5.55, result is 6$/Code$ - local / local + undefined / undefined - More information on the LB command family can be found here + (February 23, 2018) + If you want to round to a specific place past the decimal point, use toFixed and parseNumber together. For example: + $Code$ parseNumber (3.16666 toFixed 1); // 3.2$/Code$ + + (April 3, 2018) + Before toFixed ( round (( getDir player ) * 100)) / 100 - Nothing - Nothing + Number + - lbSetPicture + createSimpleObject - Sets the picture in the item (left) with the given index of the listbox or combobox with id idc of the topmost user dialog. Name is the picture name. The picture is searched for in the mission directory, the dtaExt subdirectory of the campaign directory and the dtaExt directory and the data bank (or directory). - In Arma 3 it might be necessary to set the color of the picture as well with lbSetPictureColor as default [0,0,0,0] color makes picture invisible. + Create object with given shape defined as path to.p3d model. Supported LODs include Geometry, Fire Geometry, Roadway, View Geometry and ShadowVolume. Supported features include collision, texturing, animation, penetration, AI spotting occlusion, and surface specific sounds (like footsteps). Unsupported features include PhysX, damage, AI pathfinding (causes walking through walls), and built in lights. + Given the simulation limitations, global decorative objects can be created with very little network traffic. Objects that could be exclusively created with this command are: trees, bushes, rocks, bridges, roads, vehicle wrecks, custom models in mission, and other objects without a class in config. The height of the placement position might need to be adjusted experimentally. Some of the model examples could be found here: createSimpleObject/objects + Guide: Arma 3 Simple Objects + One cannot attach actions to a simple object via addAction. + NOTES : + Objects created with Syntax 1 cannot be textured. Some objects may also have inverted default direction. + Objects created with Syntax 2 can be textured. The default direction should match the direction of the object if it was created with createVehicle. + Since Arma 3 v1.67 simple objects support setVariable and getVariable - https://community.bistudio.com/wiki/lbSetPicture + https://community.bistudio.com/wiki/createSimpleObject - lbSetPicture Array - - Control lbSetPicture Array + createSimpleObject Array - lbSetPicture [idc, index, name] + createSimpleObject [shapeName, positionWorld] - control lbSetPicture [index, name] + createSimpleObject [className, positionASL] - $Code$lbSetPicture [101, 0, "iskoda"];$/Code$ + $Code$_pos = player getRelPos [10, 0]; + _tank = createSimpleObject ["a3\armor_f_beta\apc_tracked_01\apc_tracked_01_rcws_f.p3d", _pos]; + _tank setPos (_pos vectorAdd ( getPosWorld _tank vectorDiff (_tank modelToWorld [0,0,0]))); + _tank hideSelection ["zasleh", true ]; + _tank hideSelection ["zasleh2", true ]; + _tank hideSelection ["clan", true ]; + _tank animate ["Wheel_podkoloL3", 0.5, true ]; + _tank animate ["Wheel_podkoloL6", 0.5, true ];$/Code$ - $Code$_control lbSetPicture [0, "iskoda"];$/Code$ + $Code$_pos = player getRelPos [10, 0]; + _tank = createSimpleObject ["B_APC_Tracked_01_CRV_F", AGLtoASL _pos]; + _tank setObjectTexture [0, "#(rgb,8,8,3)color(0,1,0,0.01)"]; + _tank hideSelection ["zasleh", true ]; + _tank hideSelection ["zasleh2", true ]; + _tank hideSelection ["clan", true ]; + _tank animate ["Wheel_podkoloL3", 0.5, true ]; + _tank animate ["Wheel_podkoloL6", 0.5, true ];$/Code$ - local / local + undefined / global - More information on the LB command family can be found here + (April 18, 2016) + The easiest way to correctly place simple object is to create normal object of the same shape from class (if possible), then copy getPosWorld, vectorDir and vectorUp from it. Then create the simple object and apply copied values to it, this will position simple object exactly as normal object was positioned: + $Code$_heli = "B_Heli_Light_01_F" createVehicleLocal ( player getRelPos [10, 0]); + _position = getPosWorld _heli; + _vectorDirUp = [ vectorDir _heli, vectorUp _heli]; + _model = getModelInfo _heli select 1; + deleteVehicle _heli; + _simpleHeli = createSimpleObject [_model, _position]; + _simpleHeli setVectorDirAndUp _vectorDirUp;$/Code$ - (August 18, 2015) - (ArmA 3) To place an image on the right end of the listItem: $Code$_ctrl lbSetPictureRight [_index, "A3\path\to\image.paa"];$/Code$ + (April 28, 2016) + Models from within the mission file/folder can be created, but full system path is needed. Use: + $Code$( str missionConfigFile select [0, count str missionConfigFile - 15]) + "myModel.p3d" + //mission folder path code from: http://killzonekid.com/arma-scripting-tutorials-mission-root/ $/Code$ + + (May 11, 2016) + simulationEnabled returns false. + + (September 5, 2016) + There is a section in function library dedicated to simple object creation and interaction. It's purpose is to simplify the operations: + BIS_fnc_createSimpleObject + creates simple object according to the supplied data + you can supply p3d path, class name or data you get from scanning a non-simple object + BIS_fnc_simpleObjectData + gathers and returns data about the non-simple object + data can be then used to create simple object + BIS_fnc_replaceWithSimpleObject + replaces non-simple object with simple object on the scene + do not use it in large scale in MP missions as it is not network efficient + BIS_fnc_adjustSimpleObject + adjusts simple object to looks as close to the non-simple object as possible + function is internally called from the 'bis_fnc_createSimpleObject', you won't probably need to call this function directly + Check the function headers for more info about the input parameters and possibilities. - Nothing - Nothing + Object + - lbSetSelectColorRight + queryWeaponPool - Sets the select color of the of the secondary text (right aligned) of the item with the given index of the listbox or combobox with id idc of the topmost user dialog to color. - Colour is in format Color. + Return number of weapons of type name in weapon pool (used in campaign to transfer weapons into next mission). - https://community.bistudio.com/wiki/lbSetSelectColorRight + https://community.bistudio.com/wiki/queryWeaponPool - lbSetSelectColorRight Array - - Control lbSetSelectColorRight Array + queryWeaponPool String - lbSetSelectColorRight [idc, index, color] - - control lbSetSelectColorRight [index, color] + queryWeaponPool name - $Code$lbSetSelectColorRight [101, 0, [0, 1, 0, 0.5]];$/Code$ - - $Code$_control lbSetSelectColorRight [0, [0, 1, 0, 0.5]];$/Code$ + $Code$_num=queryWeaponPool "M16"$/Code$ undefined / undefined - More information on the LB command family can be found here - Nothing - Nothing + Number + - lbSetSelectColor + detach - Sets the select color of the item with the given index of the listbox or combobox with id idc of the topmost user dialog to color. - Colour is in format Color. + Detaches previously attached with attachTo object. - https://community.bistudio.com/wiki/lbSetSelectColor + https://community.bistudio.com/wiki/detach - lbSetSelectColor Array - - Control lbSetSelectColor Array + detach Object - lbSetSelectColor [idc, index, color] - - control lbSetSelectColor [index, color] + detach object - $Code$lbSetSelectColor [101, 0, [0, 1, 0, 0.5]];$/Code$ - - $Code$_control lbSetSelectColor [0, [0, 1, 0, 0.5]];$/Code$ + $Code$obj1 attachTo [player]; + detach obj1;$/Code$ - undefined / undefined + global / global - More information on the LB command family can be found here - Nothing - Nothing + Nothing + - lbSetSelected + fleeing - Set the selection state of the given row of the given listbox of style LB_MULTI. For single selection listbox use lbSetCurSel instead. + Checks if a unit is fleeing. - https://community.bistudio.com/wiki/lbSetSelected + https://community.bistudio.com/wiki/fleeing - Control lbSetSelected Array + fleeing Object - control lbSetSelected [index, selected] + fleeing unitName - $Code$_control lbSetSelected [0, true ];$/Code$ + $Code$? (fleeing _east_unit) : player sideChat "We have won!"$/Code$ - undefined / undefined + global / undefined - (April 10, 2016) - This command works fine with listboxs of style LB_MULTI and should not be marked as obsolete as lbSetCurSel does not provide the same functionality. - Nothing + Boolean + - lbSetTooltip + tvSortByValue - Sets tooltip for item with given index of the listbox or combobox with id idc of the topmost user dialog to the given data. + Sorts children of given item by tvValue from highest to lowest by default. IDC means id of parent Tree View. - https://community.bistudio.com/wiki/lbSetTooltip + https://community.bistudio.com/wiki/tvSortByValue - lbSetTooltip Array + Control tvSortByValue Array - Control lbSetTooltip Array + tvSortByValue Array - lbSetTooltip [idc, index, tooltip] + control tvSortByValue [path, reversed] - control lbSetTooltip [index, tooltip] + tvSortByValue [idc, path, reversed] - $Code$lbSetTooltip [101, 1, "tooltip"];$/Code$ + $Code$control tvSortByValue [[0], false ];$/Code$ - $Code$_control lbSetTooltip [0, "another tooltip"];$/Code$ + $Code$tvSortByValue [102, [0], false ];$/Code$ - local / local + undefined / undefined - More information on the LB command family can be found here - - (August 9, 2017) - [ ArmA 3 v1.75.142535 ] if you want to put linebreaks into a tooltip, use this method: - $Code$format [ "%1,%2%3", "hi", parseText "\n", "my name is Will" ]$/Code$ - Nothing - Nothing + Nothing - Nothing + - lbSetValue + doStop - Sets the additional integer value in the item with the given index of the listbox or combobox with id idc of the topmost user dialog to the given value. + Order the given unit(s) to stop (without radio messages). The units stopped in this way will leave the groups formation. It will prevent them from moving around with their group (or formation leader), while still being able to turn around and even move to a new position if they see fit. The units will still respond to orders from their group leader (like engage, rearm, board a vehicle), but all of their actions will be separate from the group formation. To resume group default behaviour, use doFollow command. For example: units _group doFollow leader _group; - https://community.bistudio.com/wiki/lbSetValue + https://community.bistudio.com/wiki/doStop - lbSetValue Array - - Control lbSetValue Array + doStop Object/Array - lbSetValue [idc, index, value] - - control lbSetValue [index, value] + doStop unit - $Code$lbSetValue [101, 0, 1];$/Code$ + $Code$doStop _soldier1;$/Code$ - $Code$_control lbSetValue [0, 1];$/Code$ + $Code$doStop [_soldier1, _soldier2];$/Code$ + + $Code$doStop ( units player );$/Code$ - undefined / undefined + global / global - More information on the LB command family can be found here + (August 3, 2006) + Notes from before the conversion: + This command will make the unit stop where he is until the unit's group engages the enemy. At that time, the unit will move and fight the enemy. One good use for this is to place a bunch of units in the same group around a campfire or in some other place "for looks", and make them sit down or have their weapon on their back. When the enemy is spotted, they will get up and attack. Note that you cannot do something like place somebody behind sandbags and keep him there during a fight with this command. For that you will need disableAI "move". - (September 21, 2014) - lbSetValue only accepts integer, no decimal number. - Example: - CONTROL lbSetValue [index,10]; // value will be 10 - CONTROL lbSetValue [index,3.1]; // value will be 3 + In ArmA 1.14, this command will not stop a unit that has been given a move order by selecting the unit, then clicking on the in game map (or ground). + + doStop'ed units WILL return to formation if their leader's behaviour isn't set to "COMBAT". The squad leader will also order everyone to return to formation if there are no enemies nearby in a set period of time, overwriting the doStop command. doStop can be best used to simply stop the unit from doing whatever he is currently doing without radio messages. + + (December 23, 2016) + When a unit reaches position given with doMove, unitReady becomes true. If doStop command is not executed, unit will start wondering on its own soon after, especially if unit is under fire. doStop will keep unit at the given position, but watch out for unitReady as it will become false since unit is holding position indefinitely. + + (December 27, 2016) + Although it is possible to resume group default behaviour by joining units into own group like this units _group joinSilent _group there is a risk that the leader will change. Instead use doFollow command as explained in the description. - Nothing - Nothing + Nothing + - lbSize + curatorCameraAreaCeiling - Return number of items of listbox or combobox with id idc of topmost user dialog. + Returns ceiling height for curator camera. - https://community.bistudio.com/wiki/lbSize + https://community.bistudio.com/wiki/curatorCameraAreaCeiling - lbSize Number - - lbSize Control + curatorCameraAreaCeiling Object - lbSize idc - - lbSize control + curatorCameraAreaCeiling curatorObj - $Code$_size = lbSize 101;$/Code$ - - $Code$_size = lbSize _control;$/Code$ + $Code$curatorCameraAreCeiling BIS_curatorUnit;$/Code$ - local / local + undefined / undefined - More information on the LB command family can be found here - Number - Number + Number + - lbSortByValue + addHandgunItem - Sorts the ListBox entries by lbValue. The entries are sorted in ascending order. Also note that this command will mix up the entries randomly if multiple entries have the same value. + Adds weapon item to the weapon cargo space. This is used for infantry weapons. + As of Arma 3 DEV 1.37, this command also supports weapon magazines. - https://community.bistudio.com/wiki/lbSortByValue + https://community.bistudio.com/wiki/addHandgunItem - lbSortByValue Control - - lbSortByValue Number + Object addHandgunItem String - lbSortByValue control - - lbSortByValue idc + unit addHandgunItem item - $Code$lbSortByValue _control;$/Code$ - - $Code$lbSortByValue 101;$/Code$ + $Code$player addHandgunItem "muzzle_snds_L";$/Code$ - undefined / undefined + local / global - A good way to avoid that this Command will mix your Listbox up is, to assign your Value summed up with the Index ID returned by lbAdd to your Listbox Entries. - Posted: Sep 10 2014 - - More information on the LB command family can be found here - Nothing - Nothing + Nothing + - lbSort + addGoggles - Sorts listbox entries alphabetically ascending by their lbText + Create a new item and try to link it into goggles slot. This command doesn't add NVGoggles. Use addItem and assignItem or just linkItem for latter. - https://community.bistudio.com/wiki/lbSort + https://community.bistudio.com/wiki/addGoggles - lbSort Control - - lbSort Array - - lbSort Number + Object addGoggles String - lbSort control - - lbSort [control, sortOrder] - - lbSort idc - - lbSort [idc, sortOrder] + unit addGoggles type - $Code$lbSort _myControl;$/Code$ - - $Code$lbSort [_myControl, "DESC"];$/Code$ - - $Code$lbSort 101;$/Code$ + $Code$player addGoggles "G_Tactical_Clear";$/Code$ - $Code$lbSort [101, "DESC"];$/Code$ + $Code$diver addGoggles "G_Diving";$/Code$ undefined / undefined - More information on the LB command family can be found here - Nothing - Nothing - Nothing + Nothing + - lbText + menuSetCheck - Returns the shown text in the item with the given index of the listbox or combobox with id idc of the topmost user dialog. + Sets item on given path to be checked or not. - https://community.bistudio.com/wiki/lbText + https://community.bistudio.com/wiki/menuSetCheck - lbText Array - - Control lbText Number + menuSetCheck Array - lbText [idc, index] - - control lbText index + menuSetCheck [idc, path, checkedl] - $Code$_text = lbText [101, 0];$/Code$ - - $Code$_text = _control lbText 0;$/Code$ - + - local / local + undefined / undefined - More information on the LB command family can be found here - String - String + Nothing + - lbValue + setPosASL2 - Returns the additional integer value in the item with the given index of the listbox or combobox with id idc of the topmost user dialog. + Sets the object position. The pos array uses the PositionASL format. The version of the command does not offset based on object center. + Appears to be broken - https://community.bistudio.com/wiki/lbValue + https://community.bistudio.com/wiki/setPosASL2 - lbValue Array - - Control lbValue Number + Object setPosASL2 Array - lbValue [idc, index] - - control lbValue index + obj setPosASL2 pos - $Code$_value = lbValue [101, 0];$/Code$ - - $Code$_value = _control lbValue 0;$/Code$ + $Code$player setPosASL2 [ getPosASL player select 0, ( getPosASL player select 1) + 10, getPosASL player select 2]$/Code$ - local / local + undefined / undefined - More information on the LB command family can be found here + (21 Aug, 2013) + This command appears to do nothing in both Arma 2 and Arma 3. Tested on 21-08-2013. - Number - Number + Nothing + - leaderboardDeInit + worldToScreen - Deletes internal class for the leaderboard with given name. Returns true if the board has been found and deinitialized. + Converts position in world space into screen (UI) space. If a specified position is not within the current screen view, an empty array is returned. - https://community.bistudio.com/wiki/leaderboardDeInit + https://community.bistudio.com/wiki/worldToScreen - leaderboardDeInit String + worldToScreen Array - leaderboardDeInit boardName + worldToScreen position - $Code$leaderboardDeInit "TT01"$/Code$ + $Code$_screenPos = worldToScreen getPos soldier1;$/Code$ + + $Code$_screenPos = worldToScreen ( player modelToWorld [0,10,0]);$/Code$ undefined / undefined + (august 19th, 2012) + please take safezones in consideration : the returned result can be out of the [0,0]..[1,1] range and can also be a filled array even if the position is not displayed on your monitor - this command thinks of triplescreens configurations as well. [] returned = not rendered - Boolean + Array + - leaderboardGetRows + taskResult - Returns an array with values for the given leaderboard, the array is in format: [[player1Name, score, rank], [player2Name, score, rank], [player3Name, score, rank]... ]; This can be called after the one of the row request function has been called and successfully finished! + Send a result of the task to the task sender. - https://community.bistudio.com/wiki/leaderboardGetRows + https://community.bistudio.com/wiki/taskResult - leaderboardGetRows String + taskResult Task - leaderboardGetRows boardName + taskResult task - $Code$leaderboardGetRows "TT01"$/Code$ - + undefined / undefined - Array + Array + - leaderboardInit + getCursorObjectParams - Initialize the leaderboard structure for board with given name. Returns true if board is already initialized. + Returns object and named selections under cursor and distance to object's surface (to the point cursor points at). If object surface is further away than 50 meters, selections are always an empty array and distance is 1e10 (10^10). - https://community.bistudio.com/wiki/leaderboardInit + https://community.bistudio.com/wiki/getCursorObjectParams - leaderboardInit String + getCursorObjectParams - leaderboardInit boardName + getCursorObjectParams - $Code$leaderboardInit "TT01"$/Code$ + $Code$hint str getCursorObjectParams ;$/Code$ undefined / undefined @@ -37495,27 +39368,28 @@ - Boolean + Array + - leaderboardState + score - returns state of the board with given name. 0: Busy (async. operation in progress); 1: Async. operation ended with success; 2: Async. operation ended with error; 3: Invalid board (bad board name, not initialized etc.). + Returns the person's score in MP. - https://community.bistudio.com/wiki/leaderboardState + https://community.bistudio.com/wiki/score - leaderboardState String + score Object - leaderboardState boardname + score unit - $Code$leaderboardState ["TT01", 1234, [5,6,7,8]]$/Code$ + $Code$_pScore = score player ;$/Code$ undefined / undefined @@ -37523,27 +39397,29 @@ - Number + Number + - leaderboardsRequestUploadScoreKeepBest + rad - Starts async. operation to upload score to board with given name, value is only stored to board if it's better than one already in the board. The details array is optional. The board has to be initialized before the call. + Convert x from Degrees to Radians. 360 degrees is equal to 2 multiplied with pi. - https://community.bistudio.com/wiki/leaderboardsRequestUploadScoreKeepBest + https://community.bistudio.com/wiki/rad - leaderboardsRequestUploadScoreKeepBest Array + rad Number - leaderboardsRequestUploadScoreKeepBest [boardName, score, [details]] + rad x - $Code$leaderboardsRequestUploadScoreKeepBest ["TT01", 1234, [5,6,7,8]]$/Code$ + $Code$_radians = rad 180 + // Result is 3.1415 (eg pi$/Code$ undefined / undefined @@ -37551,27 +39427,28 @@ - Boolean + Number + - leaderboardsRequestUploadScore + enablePersonTurret - Starts async. operation to upload score to board with given name, value always overwrite the current value in the board. The details array is optional. The board has to be initialized before the call. + Enables or disables firing from a vehicle cargo position. To get the turret path use assignedVehicleRole or getCargoIndex command. - https://community.bistudio.com/wiki/leaderboardsRequestUploadScore + https://community.bistudio.com/wiki/enablePersonTurret - leaderboardsRequestUploadScore Array + Object enablePersonTurret Array - leaderboardsRequestUploadScore [boardName, score, [details]] + vehicle enablePersonTurret [turretPath, enable] - $Code$leaderboardsRequestUploadScore ["TT01", 1234, [5,6,7,8]]$/Code$ + $Code$heli enablePersonTurret [[1], true ];$/Code$ undefined / undefined @@ -37579,362 +39456,312 @@ - Boolean + Nothing + - leader + removeAllCuratorEditingAreas - Returns the group leader for the given unit or group. For dead units, objNull is returned. + Delete all curator edit areas. - https://community.bistudio.com/wiki/leader + https://community.bistudio.com/wiki/removeAllCuratorEditingAreas - leader Object/Group + removeAllCuratorEditingAreas Object - leader unitName + removeAllCuratorEditingAreas curatorObj - $Code$leader group player == leader player$/Code$ - - $Code$_GroupLeader = leader ( group ( vehicle player ))$/Code$ - - $Code$_UnitLeader = leader player$/Code$ + $Code$removeAllCuratorEditingAreas myCurator;$/Code$ - global / undefined + undefined / undefined - Object + Nothing + - leaveVehicle + assignedCargo - Ceases the using of the vehicle by a group and unassigns vehicle from the group. If the argument is a single unit, the vehicle will be unassigned from unit's group. After vehicle is unassigned from the group, each individual crew member then unassigned from the vehicle. - In short the command could be hypothetically presented as: - leaveVehicle = un- addVehicle + unassignVehicle forEach crew - However, to make it more reliable, it is best to move unit out of the vehicle manually with moveOut command and force unassign the vehicle with unassignVehicle + Returns the list of soldiers assigned to the given vehicle as a cargo. - https://community.bistudio.com/wiki/leaveVehicle + https://community.bistudio.com/wiki/assignedCargo - Group/Object leaveVehicle Object + assignedCargo Object - group leaveVehicle vehicle + assignedCargo vehicle - $Code$_unit leaveVehicle _vehicle$/Code$ - - $Code$_grp leaveVehicle _vehicle$/Code$ + $Code$_list = assignedCargo _vehicleName$/Code$ - local / local + undefined / undefined - (August 31, 2013) - In ArmA 3 this command will not force a player to exit from a vehicle. It will unassign vehicle role for this player. AI crew however will also disembark. - Nothing + Array + - libraryCredits + isDedicated - Returns the credits for the libraries used by the game. + Return true if the machine (executing the command) is a dedicated multiplayer server. In single player returns false. - https://community.bistudio.com/wiki/libraryCredits + https://community.bistudio.com/wiki/isDedicated - libraryCredits + isDedicated - libraryCredits + isDedicated - $Code$hint str libraryCredits ; // as in Arma2 OA 1.62.95208 - /* - [ - [ - "Botan", - "1999-2012 Jack Lloyd, 2001 Peter J Jones, 2004-2007 Justin Karneges, 2004 Vaclav Ovsik, 2005 Matthew Gregan, 2005-2006 Matt Johnston, 2006 Luca Piccarreta, 2007 Yves Jerschow, 2007-2008 FlexSecure GmbH, 2007-2008 Technische Universitat Darmstadt, 2007-2008 Falko Strenzke, 2007-2008 Martin Doering, 2007 Manuel Hartl, 2007 Christoph Ludwig, 2007 Patrick Sona, 2010 Olivier de Gaalon" - ], - [ - "rapidjson", - "2011 Milo Yip" - ], - [ - "libcurl", - "Copyright (c) 1996 - 2012, Daniel Stenberg" - ], - [ - "GameSpy", - "2009 GameSpy Industries, Inc." - ], - [ - "Theora", - "2002-2009 by the Xiph.Org Foundation http://www.xiph.org/" - ], - [ - "OggVorbis", - "1994-2002 by the Xiph.Org Foundation http://www.xiph.org/" - ], - [ - "Intel JPEG Library", - "1998 Intel Corporation" - ], - [ - "Matrix Template Library", - "2001-2005 The Trustees of Indiana University" - ], - [ - "Matrix Template Library", - "1998-2001 University of Notre Dame" - ], - [ - "Speex", - "2002-2006 Jean-Marc Valin" - ], - [ - "LZO Professional", - "1996-2011 Markus Franz Xaver Johannes Oberhumer" - ], - [ - "NVIDIA FXAA by TIMOTHY LOTTES", - "2010, 2011 NVIDIA CORPORATION" - ], - [ - "Jimenez's MLAA", - "2012 2011 by Jorge Jimenez, Belen Masia, Jose I. Echevarria, Fernando Navarro and Diego Gutierrez" - ] - ] - */$/Code$ + $Code$if ( isDedicated ) then { diag_log "Dedicated Server on the run !";};$/Code$ undefined / undefined + (December 21, 2014) + $Code$ if ( isDedicated ) then { + //run on dedicated server only + }; + if ( isServer ) then { + //run on dedicated server or player host + }; + if ( hasInterface ) then { + //run on all player clients incl. player host + }; + if (! isDedicated ) then { + //run on all player clients incl. player host and headless clients + }; + if (! isServer ) then { + //run on all player clients incl. headless clients but not player host + }; + if (! hasInterface ) then { + //run on headless clients and dedicated server + }; + if (! hasInterface && ! isDedicated ) then { + //run on headless clients only + };$/Code$ - Array + Boolean + - libraryDisclaimers + deleteResources - Returns the library disclaimers. + Delete (unregister) resources of the team member. Resources are deleted in the order they were added. Case insensitive. - https://community.bistudio.com/wiki/libraryDisclaimers + https://community.bistudio.com/wiki/deleteResources - libraryDisclaimers + Team_Member deleteResources Array - libraryDisclaimers + teamMember deleteResources [resource1, resource2,] - $Code$hint str libraryDisclaimers ; // as in Arma2 OA 1.62.95208 - // ["THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 'AS IS' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."]$/Code$ + $Code$teamMember _agent deleteResources ["Legs"];$/Code$ - undefined / undefined + global / local - Array + Nothing + - lifeState + nearestObject - Returns the life state of the given unit. Can be one of: - (Pre-Arma 3) - "ALIVE" - "DEAD" - "DEAD-RESPAWN" - "DEAD-SWITCHING" - "ASLEEP" - "UNCONSCIOUS" - (Arma 3) - "HEALTHY" - "DEAD" - "DEAD-RESPAWN" - "DEAD-SWITCHING" - "INCAPACITATED" - "INJURED" - In Arma 3 lifeState seems to change to "INJURED" when damage aliveUnit = 0.1 (0.1 seems to be the value defined in config under "InjuredTreshold"). + Returns the nearest object of given type to given position within a sphere. Hardcoded radius is 50 meters. Unlike with nearestObjects, where distance is measured in 2D space, nearestObject will be closest object in 3D space. + If object class type is used, any object derived from the type is found as well (In OFP however, only objects with exactly the type given are found). If object ID passed as an argument (as in example 2) the search range is unlimited. - https://community.bistudio.com/wiki/lifeState + https://community.bistudio.com/wiki/nearestObject - lifeState Object + nearestObject Array + + nearestObject Position3D/Position2D/Object + + Position3D/Position2D nearestObject String + + Position3D/Position2D nearestObject Number - lifeState unit + nearestObject [position, type] + + nearestObject position + + position nearestObject type + + position nearestObject id - $Code$_ls = lifeState loon;$/Code$ + $Code$_nObject = nearestObject [2345,6789]; + _nObject = nearestObject [ player, "StreetLamp"];$/Code$ + + $Code$// Return the object with ID 123456: + _nObject = [0,0,0] nearestObject 123456;$/Code$ + + $Code$_nObject = getPos player nearestObject "StreetLamp";$/Code$ + + $Code$// Return the nearest object with ( typeOf _nObject == "#XXXX") - #mark, #slop, etc. Unlimited search range: + _nObject = _position nearestObject -1; + // Return the nearest object with ( typeOf _nObject != ""). Search range is 50m:_nObject = nearestObject _position;$/Code$ + + $Code$// (See also allMissionObjects ): + _blood = nearestObject [ player, "#slop"]; + _step = nearestObject [ player, "#mark"]; + _track = nearestObject [ player, "#track"]; + _crater = nearestObject [ player, "#crater"];$/Code$ - global / undefined + undefined / undefined - String + Object - Object - Object - Object + - lightAttachObject + moveObjectToEnd - Attach light to given object at given position on object. + Shifts an editor object to the end of the objects array. This means,that the object will be drawn last (after all other objects). + i + Some Old Editor Command - https://community.bistudio.com/wiki/lightAttachObject + https://community.bistudio.com/wiki/moveObjectToEnd - Object lightAttachObject Array + Control moveObjectToEnd String - light lightAttachObject [object, position] + map moveObjectToEnd object - $Code$myLight lightAttachObject [myVehicle, [-0.5,-0.25,1]];$/Code$ - + - global / local + undefined / undefined - (Dec 1, 2006) - Light can be created with command createVehicleLocal with special vehicle class "#lightpoint" - for example: - $Code$_light = "#lightpoint" createVehicleLocal pos; - _light setLightBrightness 1.0; - _light setLightAmbient [0.0, 1.0, 0.0]; - _light setLightColor [0.0, 1.0, 0.0]; - _light lightAttachObject [_object, [0,0,0]]; - $/Code$ - - (March 31, 2015) - When attached, movement is slow to update (jumpy). Use attachTo when attaching a light to moving objects. - Nothing + Nothing + - lightDetachObject + missionDifficulty - Detach light from object. + Return difficulty that has been forced for this mission, returns -1 if difficulty is not forced and it's used one from player's options. - https://community.bistudio.com/wiki/lightDetachObject + https://community.bistudio.com/wiki/missionDifficulty - lightDetachObject Object + missionDifficulty - lightDetachObject light + missionDifficulty - $Code$LightDetachObject _light$/Code$ - + undefined / undefined - Nothing + Number + - lightIsOn + isAutoHoverOn - Check if lampost is on (shining). For working with CfgNonAIVehicles class "StreetLamp" only. Possible values are: - "ON" - "OFF" - "AUTO" (auto is only on during the night). - "ERROR" + Return true if vehicle has enabled auto hover. (always returns false if the vehicle can't set auto hover) - https://community.bistudio.com/wiki/lightIsOn + https://community.bistudio.com/wiki/isAutoHoverOn - lightIsOn Object + isAutoHoverOn Object - lightIsOn lamppost + isAutoHoverOn vehicle - $Code$? lightIsOn nearestObject [ player, "StreetLamp"] == "ON" :hint "nightime"$/Code$ - - $Code$_it = lightIsOn object 159582$/Code$ - - $Code$if ( count allMissionObjects "StreetLamp" == 0) then { - hint "Objects compatible with 'lightIsOn' are not found."; - } else { - hint "'lightIsOn' compatible objects are found!"; - };$/Code$ + $Code$status = isAutoHoverOn vehicle player;$/Code$ undefined / undefined - (August 4, 2006) - Notes from before the conversion: - Use switchLight to turn lamposts on and off. - String + Boolean + - lightnings + ctrlSetAutoScrollRewind - Return the current lightnings value. + Defines if scroll should rewind when auto-scroll reach end. Setter for ctrlAutoScrollRewind. + Autorscroll is available for CT_LISTBOX and CT_CONTROLS_GROUP types of controls only. Autoscroll will wait ctrlAutoScrollDelay seconds (must be 0) and then will scroll the scroll bar down to the bottom. ctrlAutoScrollSpeed defines the speed with which scrollbar is scrolled. If ctrlAutoScrollRewind is true, the control will fade out, immediately rewind to the top, then fade in, wait ctrlAutoScrollDelay seconds and then repeat the scrolling in a loop. If user focuses on the control, autoscrolling is interrupted. - https://community.bistudio.com/wiki/lightnings + https://community.bistudio.com/wiki/ctrlSetAutoScrollRewind - lightnings + Control ctrlSetAutoScrollRewind Boolean - lightnings + control ctrlSetAutoScrollRewind set - $Code$// Get the current lightnings value: - _lightningsVal = lightnings ;$/Code$ + $Code$_ctrlGroup ctrlSetAutoScrollRewind true ;$/Code$ undefined / undefined @@ -37942,462 +39769,375 @@ - Number + Nothing + - limitSpeed + synchronizeWaypoint - Limit speed of given vehicle or person to given value (in km/h). + Synchronizes the waypoint with other waypoints. Each waypoint is given as an array [group, index]. - https://community.bistudio.com/wiki/limitSpeed + https://community.bistudio.com/wiki/synchronizeWaypoint - Object limitSpeed Number + Array synchronizeWaypoint Array - objectName limitSpeed speed + waypoint synchronizeWaypoint [waypoint1, waypoint2,] - $Code$// Adjust "speedLimit" variable to change limited speed. (A3 1.24 we don't need loop for a continus effect, limitSpeed alone is enough.) - _this setVariable ["speedLimit", 200]; - _nul = _this spawn { - while { canMove _this} do { - _this limitSpeed (_this getVariable "speedLimit"); - sleep 0.1; - }; - };$/Code$ - - $Code$["SpeedObserver","onEachFrame",{ hintSilent format ["%1", speed vehicle MyVehicle]},[]] call BIS_fnc_addStackedEventHandler ; - sleep 10; - MyVehicle limitSpeed 5; //Watch the effect of this command.$/Code$ + $Code$[_group1, 2] synchronizeWaypoint [ [_group2, 3] ];$/Code$ undefined / undefined - (9 February 2008) - (A1 1.08.5163)Has only an temporary effect on the vehicle specified (i.e. vehicle goes back to its previous speed right away). So, in order for this command to have a real, noticeable effect, it would have to be issued continuously (e.g. via a script loop, but in A3 1.24 it's unnecessary). - - (29 July 2014) - (A3 1.24)To clarify, limitSpeed only do effect on non-player controlled AI units, it has continuous effect and AI won’t break through the speed limitation until one is contacted, engaged or regrouped. + (March 31, 2008) + To 'unsynchronize' a waypoint use: Waypoint synchronizeWaypoint [] - Nothing + Nothing + - lineBreak + setPosWorld - Creates a structured text containing a line break. + Sets position of an object based on PositionWorld, which is PositionASL of the model centre [0,0,0]. - https://community.bistudio.com/wiki/lineBreak + https://community.bistudio.com/wiki/setPosWorld - lineBreak + Object setPosWorld PositionWorld - lineBreak + object setPosWorld position - $Code$_txt = composeText ["First line", lineBreak, "Second line"];$/Code$ + $Code$_obj setPosWorld getPosWorld _obj;$/Code$ - undefined / undefined + global / global - Structured_Text + Nothing + - lineIntersects + waitUntil - Checks for object intersection with a virtual line between two positions. Returns true if intersects with an object. - NOTE: Doesn't work under water. Max harcoded distance is 1000m. + Suspends execution of function or SQF based script until given condition is satisfied. This command will loop and call the code inside {} mostly every frame (depends on complexity of condition and overall engine load) until the code returns true. The execution of the rest of the script therefore will be suspended until waitUntil completes. + If the very first execution of the code returns true the command will exit immediately, therefore it will not produce any "Suspending not allowed in this context" error when used inside non-scheduled script. For all other uses it must be executed in environment that allows suspension ( canSuspend ), such as spawned or execVMed code. - https://community.bistudio.com/wiki/lineIntersects + https://community.bistudio.com/wiki/waitUntil - lineIntersects Array + waitUntil Code - lineIntersects [begPos, endPos, objIgnore1, objIgnore2] + waitUntil condition - $Code$lineIntersects [ eyePos player, aimPos chopper, player, chopper]$/Code$ + $Code$waitUntil { not alive player };$/Code$ + + $Code$_i = 0; waitUntil { _i = _i + 1; _i = 100 };$/Code$ + + $Code$waitUntil { sleep 0.1; not alive player };$/Code$ + + $Code$// An on-the-fly custom event handler : + _myEH = ["ZoomIn"] spawn { + while { true } do { + waitUntil { + inputAction ( _this select 0) == 1; + }; + diag_log format ["%1 @ %2", _this select 0, diag_tickTime ]; + }; + }; + // Although perhaps better to use onEachFrame, depending on the application.$/Code$ - global / undefined + undefined / undefined - (may 31, 2012) - Please note the difference : - terrainIntersect - terrainIntersectASL - lineIntersects - lineIntersectsWith - lineIntersectsObjs - intersect + (September 20, 2013) + In case you have more complex code inside waitUntil loop, to be on the safe side always return boolean at the end of the scope: + $Code$ player addEventHandler ["Fired", { + _null = (_this select 6) spawn { + _p = [0,0,0]; + waitUntil { + if ( isNull _this) exitWith { true }; + _p = getPos _this; + false // -- boolean at the end of the scope + }; + hint str _p; + }; + }];$/Code$ + + (December 20, 2006) + waitUntil suspends both SQF functions and SQF scripts. In functions, the calling script is still in suspension due to waiting for a return from the call command. The game engine will continue, however. See Function for more detail. + + (April 2, 2010) + If WaitUntil uses an undefined call code, WaitUntil won't release, even when this code is separated from other conditions through or. Be warned that this won't cause an error message. + + (Jan 07, 2011) + By default the cycle time for the condition check is per frame. Look at the example 3, how to set it at a lower rate yourself. + Often times one does not need per frame checking. Saves a lot CPU checks; especially when the condition is complex to compute. + + (December 13, 2014) + If you want to use waitUntil together with exitWith, remember that the loop only exits if the code block returns true. + It should look like this: + $Code$ + waitUntil { + // exit loop if the unit gets deleted + if (isNull _unit) exitWith {true}; // has to return true to continue + !alive _unit; + }; + $/Code$ - Boolean + Nothing + - lineIntersectsObjs + campaignConfigFile - Returns list of objects intersected by given line from begPos to endPos. + Return root of campaign description.ext entries hierarchy. - https://community.bistudio.com/wiki/lineIntersectsObjs + https://community.bistudio.com/wiki/campaignConfigFile - lineIntersectsObjs Array + campaignConfigFile - lineIntersectsObjs [begPos, endPos, withObj, ignoreObj, sortByDistance, flags] + campaignConfigFile - global / undefined + undefined / undefined - (Mar 27, 2014) - Example (in ArmA3 ver 1.14) display objects' array in the middle of the screen sorted by 6 flags: - $Code$ - Sto = []; - Fn = { - { - Sto set [_foreachindex, lineIntersectsObjs [( eyePos player ),( ATLtoASL screenToWorld [0.5,0.5]), objNull, objNull, false,_x]]; - } forEach [1,2,4,8,16,32]; - hintSilent format [" - ONLY_WATER: %1, - NEAREST_CONTACT: %2, - ONLY_STATIC: %3, - ONLY_DYNAMIC: %4, - FIRST_CONTACT: %5, - ALL_OBJECTS: %6", - Sto select 0,Sto select 1,Sto select 2,Sto select 3,Sto select 4,Sto select 5]; - }; - ["sample_id","onEachFrame","Fn"] call BIS_fnc_addStackedEventHandler ; - $/Code$ - - (March 29, 2016) - Distance sorting is relative to object model center, and not intersect position. - Array + Config + - lineIntersectsSurfaces + waypointName - Returns list of intersections with surfaces from begPosASL to endPosASL. If there is ground intersection, it is also included. Works on units. Works underwater. Doesn't return intersection with sea surface. Hardcoded max distance: 5000m. By default, for speed purposes, command will return only 1st intersection with unique objects. Since Arma 3 v1.69.140138, this could be tweaked with an optional param. NOTE: if begPosASL is under the ground and endPosASL is above it, the command will only return intersection with the ground, this is engine limitation and none of the intersectXXX commands will work when initiated from under the ground. - Since Arma v1.51.131920 it is possible to indicate primary and secondary LOD to look for intersection. Available options are: - "FIRE" - "VIEW" - "GEOM" - "IFIRE" - ("I" stands for Indirect, almost the same as FIRE) - "NONE" - Default LODs are "VIEW" and "FIRE" + Gets the waypoint name. - https://community.bistudio.com/wiki/lineIntersectsSurfaces + https://community.bistudio.com/wiki/waypointName - lineIntersectsSurfaces Array + waypointName Waypoint - lineIntersectsSurfaces [begPosASL, endPosASL, ignoreObj1, ignoreObj2, sortMode, maxResults, LOD1, LOD2, returnUnique] + waypointName waypoint - $Code$_intersections = lineIntersectsSurfaces [ eyePos player, aimPos chopper, player, chopper, true, -1];$/Code$ - - $Code$arrow = "Sign_Arrow_F" createVehicle [0,0,0]; - onEachFrame { - _ins = lineIntersectsSurfaces [ - AGLToASL positionCameraToWorld [0,0,0], - AGLToASL positionCameraToWorld [0,0,1000], - player - ]; - if ( count _ins == 0) exitWith {arrow setPosASL [0,0,0]}; - arrow setPosASL (_ins select 0 select 0); - arrow setVectorUp (_ins select 0 select 1); - hintSilent str _ins; - };$/Code$ - - $Code$// This should detect glass windows and wire fences (since Arma v1.51.131920): - wirefence = "Land_New_WiredFence_5m_F" createVehicle position player ; - arrow = "Sign_Arrow_F" createVehicle [0,0,0]; - onEachFrame { - _ins = lineIntersectsSurfaces [ - AGLToASL positionCameraToWorld [0,0,0], - AGLToASL positionCameraToWorld [0,0,1000], - player, - objNull, - true, - 1, - "GEOM", - "NONE" - ]; - if ( count _ins == 0) exitWith {arrow setPosASL [0,0,0]}; - arrow setPosASL (_ins select 0 select 0); - arrow setVectorUp (_ins select 0 select 1); - hintSilent str _ins; - };$/Code$ + $Code$_wpName = waypointName [_grp,2];$/Code$ - global / undefined + undefined / undefined - (August 27, 2015) - Fast check if object is in a house: $Code$KK_fnc_inHouse = { - lineIntersectsSurfaces [ - getPosWorld _this, - getPosWorld _this vectorAdd [0, 0, 50], - _this, objNull, true, 1, "GEOM", "NONE" - ] select 0 params ["","","","_house"]; - if (_house isKindOf "House") exitWith { true }; - false - }; - onEachFrame { hintSilent str ( player call KK_fnc_inHouse)};$/Code$ - - (January 30, 2016) - This command is useful to place weaponholder (and then spawned weapons) on floor of houses, correcting the spawn position (can_collide) to intersect with floor: - $Code$ - MGI_fnc_setPosAGLS = { - params ["_obj", "_pos"]; - _wh_pos = getPosASL _obj; - _pos set [2, ( ATLtoASL _pos select 2)-10]; - _ins = lineIntersectsSurfaces [_wh_pos, _pos,_obj, objNull, true,1,"VIEW","FIRE"]; - _surface_distance = if ( count _ins 0) then [{(_ins select 0 select 0) distance _wh_pos},{0}]; - _wh_pos set [2, ( getPosASL _obj select 2) - (_surface_distance)]; - _weaponholder setPosASL _wh_pos; - }; - $/Code$ - After the position (_pos) obtained in BIS_fnc_buidingPositions array: - $Code$ - _weaponholder = createVehicle ["groundWeaponHolder", _pos, [], 0, "CAN_COLLIDE"]; - [_weaponholder,_pos] call MGI_fnc_setPosAGLS; - Then fill your weapon holder. - $/Code$ - Array + String + - lineIntersectsWith + enableSimulationGlobal - Returns objects intersecting with the virtual line from begPos to endPos. By default resulting array of intersecting objects is unsorted. To sort by distance set sortByDistance param to true. NOTE: Doesn't work under water. Max hardcoded distance is 1000m. + MP command. Enable or disable simulation for given entity, globally. Call this only from the server. Has the same effect as enableSimulation when used in SP. - https://community.bistudio.com/wiki/lineIntersectsWith + https://community.bistudio.com/wiki/enableSimulationGlobal - lineIntersectsWith Array + Object enableSimulationGlobal Boolean - lineIntersectsWith [begPos, endPos, objIgnore1, objIgnore2, sortByDistance] + entity enableSimulationGlobal enable - $Code$_objects = lineIntersectsWith [ eyePos player, ATLtoASL screenToWorld [0.5,0.5]];$/Code$ - - $Code$// Sort by distance: - _objects = lineIntersectsWith [ eyePos player, ATLtoASL screenToWorld [0.5,0.5], objNull, objNull, true ];$/Code$ - - $Code$// Ignore objects: - _objects = lineIntersectsWith [ eyePos player, aimPos chopper, player, chopper];$/Code$ + $Code$_myObject enableSimulationGlobal false;$/Code$ - global / undefined + global / global - (may 31, 2012) - Please note the difference : - terrainIntersect - terrainIntersectASL - lineIntersect s - lineIntersect s With - lineIntersect s Objs - intersect + This scripting command must be executed on the server to work properly in multiplayer + + (October 21, 2014) + Units that have been previously subjected to enableSimulation false; or enableSimulationGlobal false; may stay unrecognised for a long time even after simulation was re-enabled, returning objNull as cursorTarget. Force revealing units with reveal command usually solves the problem. For example: $Code${ player reveal _x} forEach allUnits ;$/Code$ - Array + Nothing + - linearConversion + objectCurators - Converts given value from given "from" range to wanted "to" range. If clipping is set to true, the resulting value is guaranteed to be within "to" range no matter what. Say given range is 0 to 1 and wanted range is 0 to 100 (percent calculation). Given value 0.55 then will be linearConversion [0,1,0.55,0,100]; //55 but if given value is 1.1 linearConversion [0,1,1.1,0,100, false ]; //110 or if clipping is true linearConversion [0,1,1.1,0,100, true ]; //100 + Returns array with all curators which can edit given object. - https://community.bistudio.com/wiki/linearConversion + https://community.bistudio.com/wiki/objectCurators - linearConversion Array + objectCurators Object - linearConversion [minFrom, maxFrom, value, minTo, maxTo, clip] + objectCurators obj - $Code$linearConversion [4, 8, 5, 0, 1, false ];$/Code$ - - $Code$// Calculate days from 1/1/1970: - fnc_daysFromEpoc = - { - private _year = param [0]; - private _days = 0; - for "_i" from 1970 to _year - 1 do - { - _days = _days + round linearConversion [0, 1, dateToNumber [_i, 12, 31, 23, 59], 0, 365, false ]; - }; - _days + linearConversion [0, 1, dateToNumber _this, 0, 365, false ]; - }; - hint str ( date call fnc_daysFromEpoc);$/Code$ - + undefined / undefined - (Mar 29, 2014) - (A3 0.50) It is recommended to use linearConversion instead of BIS_fnc_linearConversion : - $Code$ linearConversion [0,100,50,0,50, true ]; //same as [[0,100],50,[0,50]] call BIS_fnc_linearConversion $/Code$ - As for clamp, true will disable new value out of its range while false won't: - $Code$ linearConversion [0,100,150,0,50, true ]; //return 50 - linearConversion [0,100,150,0,50, false ]; //return 75 - $/Code$ - Number + Array + - linkItem + stop - Create and assign item to the correct slot. If there is an item in the targeted slot, it gets replaced. + Stop AI unit. Stopped unit will not be able to move, fire, or change its orientation to follow a watched object. It may still change the stance if deemed appropriate (e.g. under fire). Use disableAI to disable specific AI capabilities. - https://community.bistudio.com/wiki/linkItem + https://community.bistudio.com/wiki/stop - Object linkItem String + Object stop Boolean - unit linkItem item + unitName stop toggle - $Code$bluforUnit linkItem "NVGoggles"; - opforUnit linkItem "NVGoggles_OPFOR"; - independentUnit linkItem "NVGoggles_INDEP";$/Code$ + $Code$loon1 stop true$/Code$ - global / global + local / global + (January 6, 2011) + This command appears to be local only. - Nothing + Nothing + - listObjects + diag_activeMissionFSMs - Return the list of all objects of given type. - i - Some Old Editor Command + Returns array with active Mission FSMs. - https://community.bistudio.com/wiki/listObjects + https://community.bistudio.com/wiki/diag_activeMissionFSMs - Control listObjects String + diag_activeMissionFSMs - map listObjects type + diag_activeMissionFSMs - + $Code${ systemChat str _x} forEach diag_activeMissionFSMs ;$/Code$ + undefined / undefined - Array + Array + - listRemoteTargets + commandGetOut - Return list of datalink targets and time for which they will be/were known + Orders the unit to get out from the vehicle (via the radio). - https://community.bistudio.com/wiki/listRemoteTargets + https://community.bistudio.com/wiki/commandGetOut - listRemoteTargets Side + commandGetOut Object/Array - listRemoteTargets side + commandGetOut unitName - $Code$listRemoteTargets east;$/Code$ + $Code$commandGetOut _unitOne$/Code$ - undefined / undefined + local / global - Array + Nothing + - listVehicleSensors + addMissionEventHandler - Returns an array of the sensors in the given vehicle's config (configfile CfgVehicles vehicle Components SensorsManagerComponent Components). + Adds event handler (EH) attached to the current mission and returns EH handle. If EH has some data to return upon event, it is passed in _this variable. Since Arma 3 v.1.63.137807 the EH handle is also stored in _thisEventHandler variable and is available during EH code execution. For the list of available mission event handlers see: Arma_3:_Event_Handlers/addMissionEventHandler - https://community.bistudio.com/wiki/listVehicleSensors + https://community.bistudio.com/wiki/addMissionEventHandler - listVehicleSensors Object + addMissionEventHandler Array - listVehicleSensors vehicle + addMissionEventHandler [type, command] - $Code$_sensors listVehicleSensors ( vehicle player ); - hint str _sensors;$/Code$ + $Code$// A script could be executed to stop custom scripts graciously, or save progress & stats, for example: + _id = addMissionEventHandler ["Ended",{ _this execVM "missionEnded.sqf" }];$/Code$ undefined / undefined @@ -38405,1170 +40145,690 @@ - Array + Number + - list + waypointShow - List of units that would activate given Trigger. - It returns nothing before the simulation started, i.e. in (undelayed) init.sqf files. Returns a pointer to the trigger's list after the simulation started. Since this is just a reference this means that the value in your local variable will change as the content of the trigger area changes. To permanently copy the returned list to a different variable, use _mylist = +(list triggerOne). - The second example can be used inside the trigger (in that case, no need to name your trigger). - The list returned for trigger of type "Not present" is the same as that returned for type "present". - NOTE: While the command can query any trigger, local or remote, the result will be only for the trigger condition set on the local client. See createTrigger for more info. + Gets the waypoint show/hide status. + Possible values are: + "NEVER" - never show it + "EASY" - show only in cadet mode + "ALWAYS" - always show it + "ERROR" - when set to any different string - https://community.bistudio.com/wiki/list + https://community.bistudio.com/wiki/waypointShow - list Object + waypointShow Array - list trigger + waypointShow waypoint - $Code$_tlist = list _triggerOne;$/Code$ - - $Code$hint format ["%1", thislist ];$/Code$ + $Code$_wpShow = waypointShow [groupOne,1];$/Code$ - global / local + undefined / undefined - (March 6, 2013) - Calling list immediately after creating a trigger via createTrigger (and setting up activation, area, statements, timeout, etc..), will return null instead of an array. It seems the trigger needs about 1 second to initialise, after which it will behave as expected: returning an array of all the objects inside the trigger (the ones matching the criteria), or an empty array. - Array/Nothing + String + - lnbAddArray + setPosASLW - Adds list of rows of strings. + Sets the object position above sea surface. The pos array uses the PositionASLW format. - https://community.bistudio.com/wiki/lnbAddArray + https://community.bistudio.com/wiki/setPosASLW - lnbAddArray Array + Object setPosASLW Array - lnbAddArray [idc, [[[text,text],[value,],[data,]],[[text,text],[value,],[data,]],]] + obj setPosASLW pos - $Code$lnbAddArray [102,[[["#1"],[1],["#1"]]]];$/Code$ + $Code$_diver setPosASLW [( position _diver) select 0, ( position _diver) select 1, -10];$/Code$ - local / local + global / global - Number + Nothing + - lnbAddColumn + vehicleRadio - Adds an column at given position. It returns the index of the newly added column. + Sends the audio message to the vehicle radio channel. The message is defined in CfgRadio in the description.ext file or config radio protocol. The transmission will play only on the PC where command was executed. If you need the transmission to play on all computers, you have to execute it globally (see remoteExec ). + Note: When transmitting unit gets killed, transmission will be interrupted, however when receiving unit gets killed, the transmission continues to play. - https://community.bistudio.com/wiki/lnbAddColumn + https://community.bistudio.com/wiki/vehicleRadio - Control lnbAddColumn Number - - lnbAddColumn Array + Object vehicleRadio String - _ctrl lnbAddColumn position - - lnbAddColumn [idc or Control,position] + unit vehicleRadio radioName - $Code$_ctrl lnbAddColumn 0.8;$/Code$ + $Code$_soldierOne vehicleRadio "messageOne";$/Code$ - $Code$lnbAddColumn [105,0.8];$/Code$ + $Code$player vehicleRadio configName selectRandom ("true" configClasses ( configFile "CfgRadio"));$/Code$ - local / local + global / local - (A3 1.28) Horizontal coordinates of columns were added relative to list width, in range from 0 to 1. + (December 3, 2016) + To transmit user custom sounds (see Multiplayer_Custom_Sounds_Tutorial ), prefix the full filename including file extension with #. For example if there is a custom user sound file called MySound.ogg, to play it on the radio use: + $Code$ player vehicleRadio "#MySound.ogg";$/Code$ - Number/Void - Number/Void + Nothing + - lnbAddRow + groupSelectUnit - Adds a row of strings. + Selects a unit from player's group. If player is the leader, the effect of this command is similar to player pressing F1, F2, F3... buttons to highlight units in his squad, after which the unit command menu is shown. If leader is AI, player will get usual communication menu to interact with the leader. - https://community.bistudio.com/wiki/lnbAddRow + https://community.bistudio.com/wiki/groupSelectUnit - lnbAddRow Array - - Control lnbAddRow Array + Object groupSelectUnit Array - lnbAddRow [IDC,[ String, String ]] - - _ctrl lnbAddRow [ String, String ] + player groupSelectUnit [unit, select] - $Code$lnbAddRow [1,["COL1","COL2"]];$/Code$ + $Code$// After leaving menu, deselect all units (command menu is not opened - no selection) + { + player groupSelectUnit [_x, false ]; + } forEach ( groupSelectedUnits player );$/Code$ - $Code$_ctrl lnbAddRow ["COL1","COL2"];$/Code$ + $Code$// Select all units when player is the leader: + { + player groupSelectUnit [_x, true ]; + } forEach units player ;$/Code$ + + $Code$// Open communication with group leader: + player groupSelectUnit [ leader player, true ];$/Code$ - local / local + undefined / undefined - (Sep 9 2014) - (A3 1.28)As for invisible data processing, lnbAddArray, lnbAddColumn, lnbData, lnbGetColumnsPosition, lnbSetColumnsPos, lnbSetData, lnbSetText, lnbSetValue, lnbText and lnbValue store data types into exact position of the listNbox with different spaces. Accessing data with coordinate command at nearly the same syntax: - $Code$ - //Set same value to one position of a Control - _ctrl lnbSetData [ [0,0],"#1"]; - lnbSetColumnsPos [102, [0,1], 1]; - _ctrl lnbSetText [ [0,1], "#1"]; - _ctrl lnbSetValue [ [0,0],1]; - //Accessing the value disregard affecting one another. - _ctrl lnbData [0,0]; //"#1" - lnbGetColumnsPosition _ctrl //[1]; - _ctrl lnbText [0,0];//"#1" - _ctrl lnbValue [0,0];//1 - $/Code$ - For a direct visible control over CT_LISTNBOX: - $Code$ - 0 = [_CT_LISTNBOX] spawn { - private ["_CT_LISTNBOX","_color","_current","_pic"]; - disableSerialization ; - _CT_LISTNBOX = _this select 0; - { - _CT_LISTNBOX lnbAddRow [ getText (_x "displayNameShort"), getText (_x "displayName")]; - _CT_LISTNBOX lnbSetPicture [ [_foreachIndex,0], getText (_x "texture")]; - } forEach (" isClass _x" configClasses ( configFile "CfgRanks")); - _CT_LISTNBOX lnbSetCurSelRow 0; - _current = lnbCurSelRow _CT_LISTNBOX; - _color = _CT_LISTNBOX lnbColor [_current,0]; - _CT_LISTNBOX lnbSetColor [ [_current,1], [(_color select 0)/2,0,0,1] ]; - _CT_LISTNBOX lnbDeleteColumn 0; - _CT_LISTNBOX lnbDeleteRow 1; - sleep 1; - lnbClear _CT_LISTNBOX;//Clear all items but control still remains just invisible. - }; - $/Code$ - A combined use of both invisible and visible data processing commands alive the Control. - Number - Number + Nothing + - lnbClear + gearIDCAmmoCount - Clears all items in the given listbox or combobox. + Returns ammo count of assigned magazine. - https://community.bistudio.com/wiki/lnbClear + https://community.bistudio.com/wiki/gearIDCAmmoCount - lnbClear Number - - lnbClear Control + gearIDCAmmoCount Number - lnbClear idc - - lnbClear ctrl + gearIDCAmmoCount idc - $Code$lnbClear _ctrl;$/Code$ + $Code$ammo = gearIDCAmmoCount _control;$/Code$ undefined / undefined - (Sep 9 2014) - (A3 1.28)As for invisible data processing, lnbAddArray, lnbAddColumn, lnbData, lnbGetColumnsPosition, lnbSetColumnsPos, lnbSetData, lnbSetText, lnbSetValue, lnbText and lnbValue store data types into exact position of the listNbox with different spaces. Accessing data with coordinate command at nearly the same syntax: - $Code$ - //Set same value to one position of a Control - _ctrl lnbSetData [ [0,0],"#1"]; - lnbSetColumnsPos [102, [0,1], 1]; - _ctrl lnbSetText [ [0,1], "#1"]; - _ctrl lnbSetValue [ [0,0],1]; - //Accessing the value disregard affecting one another. - _ctrl lnbData [0,0]; //"#1" - lnbGetColumnsPosition _ctrl //[1]; - _ctrl lnbText [0,0];//"#1" - _ctrl lnbValue [0,0];//1 - $/Code$ - For a direct visible control over CT_LISTNBOX: - $Code$ - 0 = [_CT_LISTNBOX] spawn { - private ["_CT_LISTNBOX","_color","_current","_pic"]; - disableSerialization ; - _CT_LISTNBOX = _this select 0; - { - _CT_LISTNBOX lnbAddRow [ getText (_x "displayNameShort"), getText (_x "displayName")]; - _CT_LISTNBOX lnbSetPicture [ [_foreachIndex,0], getText (_x "texture")]; - } forEach (" isClass _x" configClasses ( configFile "CfgRanks")); - _CT_LISTNBOX lnbSetCurSelRow 0; - _current = lnbCurSelRow _CT_LISTNBOX; - _color = _CT_LISTNBOX lnbColor [_current,0]; - _CT_LISTNBOX lnbSetColor [ [_current,1], [(_color select 0)/2,0,0,1] ]; - _CT_LISTNBOX lnbDeleteColumn 0; - _CT_LISTNBOX lnbDeleteRow 1; - sleep 1; - lnbClear _CT_LISTNBOX;//Clear all items but control still remains just invisible. - }; - $/Code$ - A combined use of both invisible and visible data processing commands alive the Control. - Nothing - Nothing + Number + - lnbColor + setMarkerType - Returns the text color of the item with the given position of the 2D listbox. The color is returned in format Color. + Set marker type. See cfgMarkers for a list of standard markers. - https://community.bistudio.com/wiki/lnbColor + https://community.bistudio.com/wiki/setMarkerType - lnbColor Array - - Control lnbColor Array + String setMarkerType String - lnbColor [idc, [row, column]] - - control lnbColor [row, column] + markerName setMarkerType type - $Code$_ctrl lnbColor [0,0];$/Code$ + $Code$"MarkerOne" setMarkerType "Warning";$/Code$ - undefined / undefined + undefined / global - (Sep 9 2014) - (A3 1.28)As for invisible data processing, lnbAddArray, lnbAddColumn, lnbData, lnbGetColumnsPosition, lnbSetColumnsPos, lnbSetData, lnbSetText, lnbSetValue, lnbText and lnbValue store data types into exact position of the listNbox with different spaces. Accessing data with coordinate command at nearly the same syntax: - $Code$ - //Set same value to one position of a Control - _ctrl lnbSetData [ [0,0],"#1"]; - lnbSetColumnsPos [102, [0,1], 1]; - _ctrl lnbSetText [ [0,1], "#1"]; - _ctrl lnbSetValue [ [0,0],1]; - //Accessing the value disregard affecting one another. - _ctrl lnbData [0,0]; //"#1" - lnbGetColumnsPosition _ctrl //[1]; - _ctrl lnbText [0,0];//"#1" - _ctrl lnbValue [0,0];//1 - $/Code$ - For a direct visible control over CT_LISTNBOX: - $Code$ - 0 = [_CT_LISTNBOX] spawn { - private ["_CT_LISTNBOX","_color","_current","_pic"]; - disableSerialization ; - _CT_LISTNBOX = _this select 0; - { - _CT_LISTNBOX lnbAddRow [ getText (_x "displayNameShort"), getText (_x "displayName")]; - _CT_LISTNBOX lnbSetPicture [ [_foreachIndex,0], getText (_x "texture")]; - } forEach (" isClass _x" configClasses ( configFile "CfgRanks")); - _CT_LISTNBOX lnbSetCurSelRow 0; - _current = lnbCurSelRow _CT_LISTNBOX; - _color = _CT_LISTNBOX lnbColor [_current,0]; - _CT_LISTNBOX lnbSetColor [ [_current,1], [(_color select 0)/2,0,0,1] ]; - _CT_LISTNBOX lnbDeleteColumn 0; - _CT_LISTNBOX lnbDeleteRow 1; - sleep 1; - lnbClear _CT_LISTNBOX;//Clear all items but control still remains just invisible. - }; - $/Code$ - A combined use of both invisible and visible data processing commands alive the Control. - Array - Array + Nothing + - lnbCurSelRow + addBackpackCargoGlobal - Returns the index of the selected row id 2D listbox. + Add backpack(s) to the cargo space of vehicle. MP synchronized. Classname list of available backpacks is here - https://community.bistudio.com/wiki/lnbCurSelRow + https://community.bistudio.com/wiki/addBackpackCargoGlobal - lnbCurSelRow Number - - lnbCurSelRow Control + Object addBackpackCargoGlobal Array - lnbCurSelRow idc - - lnbCurSelRow ctrl + vehicle addBackpackCargoGlobal [packClassName, count] - $Code$lnbCurSelRow _ctrl;$/Code$ + $Code$this addBackpackCargoGlobal ["TK_RPG_Backpack_EP1",2];$/Code$ + + $Code$_apc addBackpackCargoGlobal ["US_Patrol_Pack_EP1",4];$/Code$ - undefined / undefined + global / global - (Sep 9 2014) - (A3 1.28)As for invisible data processing, lnbAddArray, lnbAddColumn, lnbData, lnbGetColumnsPosition, lnbSetColumnsPos, lnbSetData, lnbSetText, lnbSetValue, lnbText and lnbValue store data types into exact position of the listNbox with different spaces. Accessing data with coordinate command at nearly the same syntax: - $Code$ - //Set same value to one position of a Control - _ctrl lnbSetData [ [0,0],"#1"]; - lnbSetColumnsPos [102, [0,1], 1]; - _ctrl lnbSetText [ [0,1], "#1"]; - _ctrl lnbSetValue [ [0,0],1]; - //Accessing the value disregard affecting one another. - _ctrl lnbData [0,0]; //"#1" - lnbGetColumnsPosition _ctrl //[1]; - _ctrl lnbText [0,0];//"#1" - _ctrl lnbValue [0,0];//1 - $/Code$ - For a direct visible control over CT_LISTNBOX: - $Code$ - 0 = [_CT_LISTNBOX] spawn { - private ["_CT_LISTNBOX","_color","_current","_pic"]; - disableSerialization ; - _CT_LISTNBOX = _this select 0; - { - _CT_LISTNBOX lnbAddRow [ getText (_x "displayNameShort"), getText (_x "displayName")]; - _CT_LISTNBOX lnbSetPicture [ [_foreachIndex,0], getText (_x "texture")]; - } forEach (" isClass _x" configClasses ( configFile "CfgRanks")); - _CT_LISTNBOX lnbSetCurSelRow 0; - _current = lnbCurSelRow _CT_LISTNBOX; - _color = _CT_LISTNBOX lnbColor [_current,0]; - _CT_LISTNBOX lnbSetColor [ [_current,1], [(_color select 0)/2,0,0,1] ]; - _CT_LISTNBOX lnbDeleteColumn 0; - _CT_LISTNBOX lnbDeleteRow 1; - sleep 1; - lnbClear _CT_LISTNBOX;//Clear all items but control still remains just invisible. - }; - $/Code$ - A combined use of both invisible and visible data processing commands alive the Control. - Number - Number + Nothing + - lnbData + handgunItems - Returns the additional text (invisible) in an item with the given position of the 2D listbox. + Returns array with all items assigned to the handgun. This command is used for infantry weapons only. - https://community.bistudio.com/wiki/lnbData + https://community.bistudio.com/wiki/handgunItems - lnbData Array - - Control lnbData Array + handgunItems Object - lnbData [idc, [row, column]] - - ctrl lnbData [row, column] + handgunItems unit - $Code$_ctrl lnbData [ lnbCurSelRow _ctrl,0]; //"#1"$/Code$ + $Code$handgunItems player ; + /* + [ + "muzzle_snds_L",//silencer + "",//laser + "",//optics + ""//bipod + ] + */$/Code$ - local / local + global / undefined - (Sep 9 2014) - (A3 1.28)As for invisible data processing, lnbAddArray, lnbAddColumn, lnbData, lnbGetColumnsPosition, lnbSetColumnsPos, lnbSetData, lnbSetText, lnbSetValue, lnbText and lnbValue store data types into exact position of the listNbox with different spaces. Accessing data with coordinate command at nearly the same syntax: - $Code$ - //Set same value to one position of a Control - _ctrl lnbSetData [ [0,0],"#1"]; - lnbSetColumnsPos [102, [0,1], 1]; - _ctrl lnbSetText [ [0,1], "#1"]; - _ctrl lnbSetValue [ [0,0],1]; - //Accessing the value disregard affecting one another. - _ctrl lnbData [0,0]; //"#1" - lnbGetColumnsPosition _ctrl //[1]; - _ctrl lnbText [0,0];//"#1" - _ctrl lnbValue [0,0];//1 - $/Code$ - For a direct visible control over CT_LISTNBOX: - $Code$ - 0 = [_CT_LISTNBOX] spawn { - private ["_CT_LISTNBOX","_color","_current","_pic"]; - disableSerialization ; - _CT_LISTNBOX = _this select 0; - { - _CT_LISTNBOX lnbAddRow [ getText (_x "displayNameShort"), getText (_x "displayName")]; - _CT_LISTNBOX lnbSetPicture [ [_foreachIndex,0], getText (_x "texture")]; - } forEach (" isClass _x" configClasses ( configFile "CfgRanks")); - _CT_LISTNBOX lnbSetCurSelRow 0; - _current = lnbCurSelRow _CT_LISTNBOX; - _color = _CT_LISTNBOX lnbColor [_current,0]; - _CT_LISTNBOX lnbSetColor [ [_current,1], [(_color select 0)/2,0,0,1] ]; - _CT_LISTNBOX lnbDeleteColumn 0; - _CT_LISTNBOX lnbDeleteRow 1; - sleep 1; - lnbClear _CT_LISTNBOX;//Clear all items but control still remains just invisible. - }; - $/Code$ - A combined use of both invisible and visible data processing commands alive the Control. - String - String + Array + - lnbDeleteColumn + ctrlShown - Removes column with given index from ListNBox control. + Returns whether given control is shown. - https://community.bistudio.com/wiki/lnbDeleteColumn + https://community.bistudio.com/wiki/ctrlShown - lnbDeleteColumn Array - - Control lnbDeleteColumn Number + ctrlShown Control - lnbDeleteColumn [idc,index] - - ctrl lnbDeleteColumn index + ctrlShown controlName - $Code$_ctrl lnbDeleteColumn 1;$/Code$ + $Code$_bool = ctrlShown _ctrl;$/Code$ - local / local + undefined / undefined - (Sep 9 2014) - (A3 1.28)As for invisible data processing, lnbAddArray, lnbAddColumn, lnbData, lnbGetColumnsPosition, lnbSetColumnsPos, lnbSetData, lnbSetText, lnbSetValue, lnbText and lnbValue store data types into exact position of the listNbox with different spaces. Accessing data with coordinate command at nearly the same syntax: - $Code$ - //Set same value to one position of a Control - _ctrl lnbSetData [ [0,0],"#1"]; - lnbSetColumnsPos [102, [0,1], 1]; - _ctrl lnbSetText [ [0,1], "#1"]; - _ctrl lnbSetValue [ [0,0],1]; - //Accessing the value disregard affecting one another. - _ctrl lnbData [0,0]; //"#1" - lnbGetColumnsPosition _ctrl //[1]; - _ctrl lnbText [0,0];//"#1" - _ctrl lnbValue [0,0];//1 - $/Code$ - For a direct visible control over CT_LISTNBOX: - $Code$ - 0 = [_CT_LISTNBOX] spawn { - private ["_CT_LISTNBOX","_color","_current","_pic"]; - disableSerialization ; - _CT_LISTNBOX = _this select 0; - { - _CT_LISTNBOX lnbAddRow [ getText (_x "displayNameShort"), getText (_x "displayName")]; - _CT_LISTNBOX lnbSetPicture [ [_foreachIndex,0], getText (_x "texture")]; - } forEach (" isClass _x" configClasses ( configFile "CfgRanks")); - _CT_LISTNBOX lnbSetCurSelRow 0; - _current = lnbCurSelRow _CT_LISTNBOX; - _color = _CT_LISTNBOX lnbColor [_current,0]; - _CT_LISTNBOX lnbSetColor [ [_current,1], [(_color select 0)/2,0,0,1] ]; - _CT_LISTNBOX lnbDeleteColumn 0; - _CT_LISTNBOX lnbDeleteRow 1; - sleep 1; - lnbClear _CT_LISTNBOX;//Clear all items but control still remains just invisible. - }; - $/Code$ - A combined use of both invisible and visible data processing commands alive the Control. - Nothing - Nothing + Boolean + - lnbDeleteRow + sleep - Removes row with the given index from the given listbox or combobox. + Suspends code execution for given time in seconds. The sleep precision is given by a framerate, the delay given is the minimal delay expected. Must be called inside of a context which is interruptible, i.e. a script executed by execVM or spawn. - https://community.bistudio.com/wiki/lnbDeleteRow + https://community.bistudio.com/wiki/sleep - Control lnbDeleteRow Number + sleep Number - _ctrl lnbDeleteRow row + sleep delay - $Code$_ctrl lnbDeleteRow 1;$/Code$ + $Code$[] spawn { sleep 5; hint "after 5 sec..."};$/Code$ undefined / undefined - (Sep 9 2014) - (A3 1.28)As for invisible data processing, lnbAddArray, lnbAddColumn, lnbData, lnbGetColumnsPosition, lnbSetColumnsPos, lnbSetData, lnbSetText, lnbSetValue, lnbText and lnbValue store data types into exact position of the listNbox with different spaces. Accessing data with coordinate command at nearly the same syntax: - $Code$ - //Set same value to one position of a Control - _ctrl lnbSetData [ [0,0],"#1"]; - lnbSetColumnsPos [102, [0,1], 1]; - _ctrl lnbSetText [ [0,1], "#1"]; - _ctrl lnbSetValue [ [0,0],1]; - //Accessing the value disregard affecting one another. - _ctrl lnbData [0,0]; //"#1" - lnbGetColumnsPosition _ctrl //[1]; - _ctrl lnbText [0,0];//"#1" - _ctrl lnbValue [0,0];//1 - $/Code$ - For a direct visible control over CT_LISTNBOX: - $Code$ - 0 = [_CT_LISTNBOX] spawn { - private ["_CT_LISTNBOX","_color","_current","_pic"]; - disableSerialization ; - _CT_LISTNBOX = _this select 0; - { - _CT_LISTNBOX lnbAddRow [ getText (_x "displayNameShort"), getText (_x "displayName")]; - _CT_LISTNBOX lnbSetPicture [ [_foreachIndex,0], getText (_x "texture")]; - } forEach (" isClass _x" configClasses ( configFile "CfgRanks")); - _CT_LISTNBOX lnbSetCurSelRow 0; - _current = lnbCurSelRow _CT_LISTNBOX; - _color = _CT_LISTNBOX lnbColor [_current,0]; - _CT_LISTNBOX lnbSetColor [ [_current,1], [(_color select 0)/2,0,0,1] ]; - _CT_LISTNBOX lnbDeleteColumn 0; - _CT_LISTNBOX lnbDeleteRow 1; - sleep 1; - lnbClear _CT_LISTNBOX;//Clear all items but control still remains just invisible. - }; - $/Code$ - A combined use of both invisible and visible data processing commands alive the Control. + this command will suspend the script indefinitely if game simulation is paused in SP. To avoid this, use uiSleep. + + (December 20, 2006) + Sleep suspends both SQF functions and SQF scripts. In functions, the calling script is still in suspension due to waiting for a return from the call command. The game engine will continue, however. See Function for more detail. + + (February 12, 2007) + Sleep durations between.0005 and.02 will cause the same delay (roughly.02 seconds). Delays of.0005 and less have no effect (ie, the sleep call will return immediately). + + The comment above is a little misleading. The game engine appears to work by processing frames and then checking to see whether scripts are available to execute. Sleep causes the script/function to be suspended until at least the specified time has elapsed. To wait for the next frame, or give other scripts a chance to run, use Sleep 0.001. + + (July 16, 2007) + For scripts called by the Init Event Handler the first sleep command will suspend the script at the briefing screen at the start of a mission. The script will continue after the briefing screen, when actually "in game". + + (July 12, 2014) + Sleep will treat negative values as if they were 0. (Tested in Arma 3 v1.22) + + (October 18, 2014) + For server scripts, if you are creating "while true" timers, it is best to use uiSleep instead, as the sleep from that command is not slowed down by simulation / server lag, so the timers will execute at intervals that are much closer to real time, even under heavy lag. - Nothing + Nothing + - lnbGetColumnsPosition + ctrlSetFontHeight - Returns relative screen X of ListNBox control columns position [0.1,0.3,0.6...]. Use lnbSetColumnsPos to set positions. + Sets the font size of given control. - https://community.bistudio.com/wiki/lnbGetColumnsPosition + https://community.bistudio.com/wiki/ctrlSetFontHeight - lnbGetColumnsPosition Control + Control ctrlSetFontHeight Number - lnbGetColumnsPosition _ctrl + controlName ctrlSetFontHeight height - $Code$lnbGetColumnsPosition _ctrl;$/Code$ + $Code$_control ctrlSetFontHeight 0.05$/Code$ - local / local + undefined / undefined - (Sep 9 2014) - (A3 1.28)As for invisible data processing, lnbAddArray, lnbAddColumn, lnbData, lnbGetColumnsPosition, lnbSetColumnsPos, lnbSetData, lnbSetText, lnbSetValue, lnbText and lnbValue store data types into exact position of the listNbox with different spaces. Accessing data with coordinate command at nearly the same syntax: - $Code$ - //Set same value to one position of a Control - _ctrl lnbSetData [ [0,0],"#1"]; - lnbSetColumnsPos [102, [0,1], 1]; - _ctrl lnbSetText [ [0,1], "#1"]; - _ctrl lnbSetValue [ [0,0],1]; - //Accessing the value disregard affecting one another. - _ctrl lnbData [0,0]; //"#1" - lnbGetColumnsPosition _ctrl //[1]; - _ctrl lnbText [0,0];//"#1" - _ctrl lnbValue [0,0];//1 - $/Code$ - For a direct visible control over CT_LISTNBOX: - $Code$ - 0 = [_CT_LISTNBOX] spawn { - private ["_CT_LISTNBOX","_color","_current","_pic"]; - disableSerialization ; - _CT_LISTNBOX = _this select 0; - { - _CT_LISTNBOX lnbAddRow [ getText (_x "displayNameShort"), getText (_x "displayName")]; - _CT_LISTNBOX lnbSetPicture [ [_foreachIndex,0], getText (_x "texture")]; - } forEach (" isClass _x" configClasses ( configFile "CfgRanks")); - _CT_LISTNBOX lnbSetCurSelRow 0; - _current = lnbCurSelRow _CT_LISTNBOX; - _color = _CT_LISTNBOX lnbColor [_current,0]; - _CT_LISTNBOX lnbSetColor [ [_current,1], [(_color select 0)/2,0,0,1] ]; - _CT_LISTNBOX lnbDeleteColumn 0; - _CT_LISTNBOX lnbDeleteRow 1; - sleep 1; - lnbClear _CT_LISTNBOX;//Clear all items but control still remains just invisible. - }; - $/Code$ - A combined use of both invisible and visible data processing commands alive the Control. - Array + Nothing + - lnbPicture + lbSetSelectColor - Returns the picture name or path of the item with the given position of the 2D listbox. + Sets the select color of the item with the given index of the listbox or combobox with id idc of the topmost user dialog to color. + Colour is in format Color. - https://community.bistudio.com/wiki/lnbPicture + https://community.bistudio.com/wiki/lbSetSelectColor - lnbPicture Array + lbSetSelectColor Array - Control lnbPicture Array + Control lbSetSelectColor Array - lnbPicture [IDC, [row, column]] + lbSetSelectColor [idc, index, color] - control lnbPicture [row, column] + control lbSetSelectColor [index, color] - $Code$lnbPicture [200, [1, 1]];$/Code$ + $Code$lbSetSelectColor [101, 0, [0, 1, 0, 0.5]];$/Code$ - $Code$_control lnbPicture [1, 1]; //"a3\ui_f\data\gui\cfg\ranks\corporal_gs.paa"$/Code$ + $Code$_control lbSetSelectColor [0, [0, 1, 0, 0.5]];$/Code$ - local / local + undefined / undefined + More information on the LB command family can be found here - String - String + Nothing - Nothing + - lnbSetColor + deleteRange - Sets the color of the item with the given position of the 2D listbox. Color is in format Color. + Removes a range of array elements from the given array (modifies the original array, just like resize or set ). - https://community.bistudio.com/wiki/lnbSetColor + https://community.bistudio.com/wiki/deleteRange - lnbSetColor Array - - Control lnbSetColor Array + Array deleteRange Array - lnbSetColor [idc,[row,column],color] - - _ctrl lnbSetColor [ [row,column],color] + array deleteRange [from, count] - $Code$_ctrl lnbSetColor [ [0,0], [1,0,0,1] ];$/Code$ + $Code$_arr = [1,2,3,4,5,6]; + _arr deleteRange [1,4]; + hint str _arr; //[1,6]$/Code$ - local / local + undefined / undefined - (Sep 9 2014) - (A3 1.28)As for invisible data processing, lnbAddArray, lnbAddColumn, lnbData, lnbGetColumnsPosition, lnbSetColumnsPos, lnbSetData, lnbSetText, lnbSetValue, lnbText and lnbValue store data types into exact position of the listNbox with different spaces. Accessing data with coordinate command at nearly the same syntax: - $Code$ - //Set same value to one position of a Control - _ctrl lnbSetData [ [0,0],"#1"]; - lnbSetColumnsPos [102, [0,1], 1]; - _ctrl lnbSetText [ [0,1], "#1"]; - _ctrl lnbSetValue [ [0,0],1]; - //Accessing the value disregard affecting one another. - _ctrl lnbData [0,0]; //"#1" - lnbGetColumnsPosition _ctrl //[1]; - _ctrl lnbText [0,0];//"#1" - _ctrl lnbValue [0,0];//1 - $/Code$ - For a direct visible control over CT_LISTNBOX: - $Code$ - 0 = [_CT_LISTNBOX] spawn { - private ["_CT_LISTNBOX","_color","_current","_pic"]; - disableSerialization ; - _CT_LISTNBOX = _this select 0; - { - _CT_LISTNBOX lnbAddRow [ getText (_x "displayNameShort"), getText (_x "displayName")]; - _CT_LISTNBOX lnbSetPicture [ [_foreachIndex,0], getText (_x "texture")]; - } forEach (" isClass _x" configClasses ( configFile "CfgRanks")); - _CT_LISTNBOX lnbSetCurSelRow 0; - _current = lnbCurSelRow _CT_LISTNBOX; - _color = _CT_LISTNBOX lnbColor [_current,0]; - _CT_LISTNBOX lnbSetColor [ [_current,1], [(_color select 0)/2,0,0,1] ]; - _CT_LISTNBOX lnbDeleteColumn 0; - _CT_LISTNBOX lnbDeleteRow 1; - sleep 1; - lnbClear _CT_LISTNBOX;//Clear all items but control still remains just invisible. - }; - $/Code$ - A combined use of both invisible and visible data processing commands alive the Control. - Nothing - Nothing + Nothing + - lnbSetColumnsPos + addForce - Sets relative screen X for ListNBox control columns positions. Setter for lnbGetColumnsPosition + Applies force to given object at given position. Force is defined as vector [x, y, z] in world space, position is vector [x, y, z] in model space. If you need to define force in model space, use vectorModelToWorld or vectorModelToWorldVisual commands first. The force applied as impulse. For more information see NVIDIA docs - https://community.bistudio.com/wiki/lnbSetColumnsPos + https://community.bistudio.com/wiki/addForce - lnbSetColumnsPos Array - - Control lnbSetColumnsPos Array + Object addForce Array - lnbSetColumnsPos [idc, positions] - - ctrl lnbSetColumnsPos positions + object addForce [force, position] - $Code$lnbSetColumnsPos [101, [0.1,0.5,0.7]];$/Code$ + $Code$// Apply force [0,1000,0] defined in world space (not factoring object actual positioning) to object position [1,0,0]: + _object addForce [[0,1000,0],[1,0,0]];$/Code$ - $Code$_ctrl lnbSetColumnsPos [0.1,0.5,0.7];$/Code$ + $Code$// Apply force [0,1000,0] defined in model space (relative to object) to object position [1,0,0]: + _object addForce [_object vectorModelToWorld [0,1000,0],[1,0,0]];$/Code$ - undefined / undefined + global / global - (Sep 9 2014) - See: List Box#LISTNBOX - Nothing - Nothing + Nothing + - lnbSetCurSelRow + diag_drawMode - Selects the row with the given index of the 2D listbox. + Activates specific debug visualization. + Command is only available when using Arma 3 Diagnostics Exe on Dev-Branch. - https://community.bistudio.com/wiki/lnbSetCurSelRow + https://community.bistudio.com/wiki/diag_drawMode - lnbSetCurSelRow Array - - Control lnbSetCurSelRow Number + diag_drawMode String - lnbSetCurSelRow [idc, index] - - ctrl lnbSetCurSelRow index + diag_drawMode type - $Code$disableSerialization ; - _ctrl = ( findDisplay 300) displayCtrl 304; - _ctrl lnbSetCurSelRow 1;$/Code$ + $Code$diag_drawMode "normal"$/Code$ undefined / undefined - (Sep 9 2014) - (A3 1.28)As for invisible data processing, lnbAddArray, lnbAddColumn, lnbData, lnbGetColumnsPosition, lnbSetColumnsPos, lnbSetData, lnbSetText, lnbSetValue, lnbText and lnbValue store data types into exact position of the listNbox with different spaces. Accessing data with coordinate command at nearly the same syntax: - $Code$ - //Set same value to one position of a Control - _ctrl lnbSetData [ [0,0],"#1"]; - lnbSetColumnsPos [102, [0,1], 1]; - _ctrl lnbSetText [ [0,1], "#1"]; - _ctrl lnbSetValue [ [0,0],1]; - //Accessing the value disregard affecting one another. - _ctrl lnbData [0,0]; //"#1" - lnbGetColumnsPosition _ctrl //[1]; - _ctrl lnbText [0,0];//"#1" - _ctrl lnbValue [0,0];//1 - $/Code$ - For a direct visible control over CT_LISTNBOX: - $Code$ - 0 = [_CT_LISTNBOX] spawn { - private ["_CT_LISTNBOX","_color","_current","_pic"]; - disableSerialization ; - _CT_LISTNBOX = _this select 0; - { - _CT_LISTNBOX lnbAddRow [ getText (_x "displayNameShort"), getText (_x "displayName")]; - _CT_LISTNBOX lnbSetPicture [ [_foreachIndex,0], getText (_x "texture")]; - } forEach (" isClass _x" configClasses ( configFile "CfgRanks")); - _CT_LISTNBOX lnbSetCurSelRow 0; - _current = lnbCurSelRow _CT_LISTNBOX; - _color = _CT_LISTNBOX lnbColor [_current,0]; - _CT_LISTNBOX lnbSetColor [ [_current,1], [(_color select 0)/2,0,0,1] ]; - _CT_LISTNBOX lnbDeleteColumn 0; - _CT_LISTNBOX lnbDeleteRow 1; - sleep 1; - lnbClear _CT_LISTNBOX;//Clear all items but control still remains just invisible. - }; - $/Code$ - A combined use of both invisible and visible data processing commands alive the Control. + (September 6, 2016) + Currently A3 dev branch, diag.exe, version 1.65.138249 has no drawModes available: + $Code$diag_list "drawMode" - []$/Code$ - Nothing - Nothing + Nothing + - lnbSetData + addOwnedMine - Sets the additional text (invisible) in the item with the given position of the 2D listbox. + Sets ownership over a remotely detonatable mine to the unit. - https://community.bistudio.com/wiki/lnbSetData + https://community.bistudio.com/wiki/addOwnedMine - lnbSetData Array - - Control lnbSetData Array + Object addOwnedMine Object - lnbSetData [idc, [row, column], data] - - ctrl lnbSetData [[row, column], data] + Unit addOwnedMine mine - $Code$_ctrl lnbSetData [ [0,0],"#1"];$/Code$ + $Code$player addOwnedMine SuperMine;$/Code$ - local / local + undefined / undefined - (Sep 9 2014) - (A3 1.28)As for invisible data processing, lnbAddArray, lnbAddColumn, lnbData, lnbGetColumnsPosition, lnbSetColumnsPos, lnbSetData, lnbSetText, lnbSetValue, lnbText and lnbValue store data types into exact position of the listNbox with different spaces. Accessing data with coordinate command at nearly the same syntax: - $Code$ - //Set same value to one position of a Control - _ctrl lnbSetData [ [0,0],"#1"]; - lnbSetColumnsPos [102, [0,1], 1]; - _ctrl lnbSetText [ [0,1], "#1"]; - _ctrl lnbSetValue [ [0,0],1]; - //Accessing the value disregard affecting one another. - _ctrl lnbData [0,0]; //"#1" - lnbGetColumnsPosition _ctrl //[1]; - _ctrl lnbText [0,0];//"#1" - _ctrl lnbValue [0,0];//1 - $/Code$ - For a direct visible control over CT_LISTNBOX: - $Code$ - 0 = [_CT_LISTNBOX] spawn { - private ["_CT_LISTNBOX","_color","_current","_pic"]; - disableSerialization ; - _CT_LISTNBOX = _this select 0; - { - _CT_LISTNBOX lnbAddRow [ getText (_x "displayNameShort"), getText (_x "displayName")]; - _CT_LISTNBOX lnbSetPicture [ [_foreachIndex,0], getText (_x "texture")]; - } forEach (" isClass _x" configClasses ( configFile "CfgRanks")); - _CT_LISTNBOX lnbSetCurSelRow 0; - _current = lnbCurSelRow _CT_LISTNBOX; - _color = _CT_LISTNBOX lnbColor [_current,0]; - _CT_LISTNBOX lnbSetColor [ [_current,1], [(_color select 0)/2,0,0,1] ]; - _CT_LISTNBOX lnbDeleteColumn 0; - _CT_LISTNBOX lnbDeleteRow 1; - sleep 1; - lnbClear _CT_LISTNBOX;//Clear all items but control still remains just invisible. - }; - $/Code$ - A combined use of both invisible and visible data processing commands alive the Control. - Nothing - Nothing + Nothing + - lnbSetPicture + titleRsc - Sets the picture in the item with the given position of the 2D listbox. - Name is the picture name. - The picture is searched in the mission, directory, the dtaExt subdirectory of the campaign directory, and the dtaExt directory and the data bank (or directory). + Display a resource defined in RscTitles. Also see cutRsc, with these two commands you can show two different resources at once. - https://community.bistudio.com/wiki/lnbSetPicture + https://community.bistudio.com/wiki/titleRsc - lnbSetPicture Array - - Control lnbSetPicture Array + titleRsc Array - lnbSetPicture [IDC, [Row, Column], PicturePathOrPictureName] - - _ctrl lnbSetPicture [ [Row, Column], PicturePathOrPictureName] + titleRsc [text, type, speed, showInMap] - $Code$lnbSetPicture [1, [0, 0], "Picture"];$/Code$ - - $Code$_ctrl lnbSetPicture [ [0, 0], "\A3\Ui_f\data\GUI\Cfg\Ranks\lieutenant_gs.paa"];$/Code$ + $Code$titleRsc ["BIS", "PLAIN"]$/Code$ - local / local + undefined / undefined - (Sep 9 2014) - (A3 1.28)As for invisible data processing, lnbAddArray, lnbAddColumn, lnbData, lnbGetColumnsPosition, lnbSetColumnsPos, lnbSetData, lnbSetText, lnbSetValue, lnbText and lnbValue store data types into exact position of the listNbox with different spaces. Accessing data with coordinate command at nearly the same syntax: - $Code$ - //Set same value to one position of a Control - _ctrl lnbSetData [ [0,0],"#1"]; - lnbSetColumnsPos [102, [0,1], 1]; - _ctrl lnbSetText [ [0,1], "#1"]; - _ctrl lnbSetValue [ [0,0],1]; - //Accessing the value disregard affecting one another. - _ctrl lnbData [0,0]; //"#1" - lnbGetColumnsPosition _ctrl //[1]; - _ctrl lnbText [0,0];//"#1" - _ctrl lnbValue [0,0];//1 - $/Code$ - For a direct visible control over CT_LISTNBOX: - $Code$ - 0 = [_CT_LISTNBOX] spawn { - private ["_CT_LISTNBOX","_color","_current","_pic"]; - disableSerialization ; - _CT_LISTNBOX = _this select 0; - { - _CT_LISTNBOX lnbAddRow [ getText (_x "displayNameShort"), getText (_x "displayName")]; - _CT_LISTNBOX lnbSetPicture [ [_foreachIndex,0], getText (_x "texture")]; - } forEach (" isClass _x" configClasses ( configFile "CfgRanks")); - _CT_LISTNBOX lnbSetCurSelRow 0; - _current = lnbCurSelRow _CT_LISTNBOX; - _color = _CT_LISTNBOX lnbColor [_current,0]; - _CT_LISTNBOX lnbSetColor [ [_current,1], [(_color select 0)/2,0,0,1] ]; - _CT_LISTNBOX lnbDeleteColumn 0; - _CT_LISTNBOX lnbDeleteRow 1; - sleep 1; - lnbClear _CT_LISTNBOX;//Clear all items but control still remains just invisible. - }; - $/Code$ - A combined use of both invisible and visible data processing commands alive the Control. + (30 Jun, 2008) + Using titleRsc (unlike cutRsc ) for a HUD will mean: + the HUD will remain visible when you access the map and overlay it. + using the 'Direct communication' chat channel messages will interfere with the HUD by hiding it, since it appears to use the same 'resource layer'. + + (September 25, 2014) + In OFP/CWA any x Rsc will hide all the elements of the HUD, including the map. - Nothing - Nothing + Nothing + - lnbSetText + allowSprint - Sets the additional text (invisible) in the item with the given position of the 2D listbox. + Force player to run/jog if set to false. - https://community.bistudio.com/wiki/lnbSetText + https://community.bistudio.com/wiki/allowSprint - lnbSetText Array - - Control lnbSetText Array + Object allowSprint Boolean - lnbSetText [idc,[row,column],data] - - _ctrl lnbSetText [ [row,column],data] + unit allowSprint state - $Code$lnbSetText [101, [0,1], "#1"];$/Code$ - - $Code$_ctrl lnbSetText [ [0,1], "#1"];$/Code$ + $Code$player allowSprint false$/Code$ - local / local + undefined / undefined - (Sep 9 2014) - (A3 1.28)As for invisible data processing, lnbAddArray, lnbAddColumn, lnbData, lnbGetColumnsPosition, lnbSetColumnsPos, lnbSetData, lnbSetText, lnbSetValue, lnbText and lnbValue store data types into exact position of the listNbox with different spaces. Accessing data with coordinate command at nearly the same syntax: - $Code$ - //Set same value to one position of a Control - _ctrl lnbSetData [ [0,0],"#1"]; - lnbSetColumnsPos [102, [0,1], 1]; - _ctrl lnbSetText [ [0,1], "#1"]; - _ctrl lnbSetValue [ [0,0],1]; - //Accessing the value disregard affecting one another. - _ctrl lnbData [0,0]; //"#1" - lnbGetColumnsPosition _ctrl //[1]; - _ctrl lnbText [0,0];//"#1" - _ctrl lnbValue [0,0];//1 - $/Code$ - For a direct visible control over CT_LISTNBOX: - $Code$ - 0 = [_CT_LISTNBOX] spawn { - private ["_CT_LISTNBOX","_color","_current","_pic"]; - disableSerialization ; - _CT_LISTNBOX = _this select 0; - { - _CT_LISTNBOX lnbAddRow [ getText (_x "displayNameShort"), getText (_x "displayName")]; - _CT_LISTNBOX lnbSetPicture [ [_foreachIndex,0], getText (_x "texture")]; - } forEach (" isClass _x" configClasses ( configFile "CfgRanks")); - _CT_LISTNBOX lnbSetCurSelRow 0; - _current = lnbCurSelRow _CT_LISTNBOX; - _color = _CT_LISTNBOX lnbColor [_current,0]; - _CT_LISTNBOX lnbSetColor [ [_current,1], [(_color select 0)/2,0,0,1] ]; - _CT_LISTNBOX lnbDeleteColumn 0; - _CT_LISTNBOX lnbDeleteRow 1; - sleep 1; - lnbClear _CT_LISTNBOX;//Clear all items but control still remains just invisible. - }; - $/Code$ - A combined use of both invisible and visible data processing commands alive the Control. - Nothing - Nothing + Nothing + - lnbSetValue + set3DENSelected - Sets the additional integer value in the item with the position index of the 2D listbox. + Changes selection in 3den to what is inside entities array. - https://community.bistudio.com/wiki/lnbSetValue + https://community.bistudio.com/wiki/set3DENSelected - lnbSetValue Array - - Control lnbSetValue Array + set3DENSelected Array - lnbSetValue [idc, [row, column], value] - - control lnbSetValue [[row, column], value] + set3DENSelected entities - $Code$_ctrl lnbSetValue [[0,0],1];$/Code$ - + undefined / undefined - (Sep 9 2014) - (A3 1.28)As for invisible data processing, lnbAddArray, lnbAddColumn, lnbData, lnbGetColumnsPosition, lnbSetColumnsPos, lnbSetData, lnbSetText, lnbSetValue, lnbText and lnbValue store data types into exact position of the listNbox with different spaces. Accessing data with coordinate command at nearly the same syntax: - $Code$ - //Set same value to one position of a Control - _ctrl lnbSetData [ [0,0],"#1"]; - lnbSetColumnsPos [102, [0,1], 1]; - _ctrl lnbSetText [ [0,1], "#1"]; - _ctrl lnbSetValue [ [0,0],1]; - //Accessing the value disregard affecting one another. - _ctrl lnbData [0,0]; //"#1" - lnbGetColumnsPosition _ctrl //[1]; - _ctrl lnbText [0,0];//"#1" - _ctrl lnbValue [0,0];//1 - $/Code$ - For a direct visible control over CT_LISTNBOX: - $Code$ - 0 = [_CT_LISTNBOX] spawn { - private ["_CT_LISTNBOX","_color","_current","_pic"]; - disableSerialization ; - _CT_LISTNBOX = _this select 0; - { - _CT_LISTNBOX lnbAddRow [ getText (_x "displayNameShort"), getText (_x "displayName")]; - _CT_LISTNBOX lnbSetPicture [ [_foreachIndex,0], getText (_x "texture")]; - } forEach (" isClass _x" configClasses ( configFile "CfgRanks")); - _CT_LISTNBOX lnbSetCurSelRow 0; - _current = lnbCurSelRow _CT_LISTNBOX; - _color = _CT_LISTNBOX lnbColor [_current,0]; - _CT_LISTNBOX lnbSetColor [ [_current,1], [(_color select 0)/2,0,0,1] ]; - _CT_LISTNBOX lnbDeleteColumn 0; - _CT_LISTNBOX lnbDeleteRow 1; - sleep 1; - lnbClear _CT_LISTNBOX;//Clear all items but control still remains just invisible. - }; - $/Code$ - A combined use of both invisible and visible data processing commands alive the Control. - Nothing - Nothing + Nothing + - lnbSize + buttonAction - Returns size of 2D listbox or combobox as [rows, columns]. + Return the action assigned to a control of the currently active user dialog. Can be used for buttons and active texts. Read Dialog Control for more information about user dialogs and controls. - https://community.bistudio.com/wiki/lnbSize + https://community.bistudio.com/wiki/buttonAction - lnbSize Control + buttonAction Number + + buttonAction Control - lnbSize control - + buttonAction idc + + buttonAction control + - $Code$lnbSize _ctrl;//[8,2]$/Code$ + $Code$buttonSetAction [100, {player exec "reply.sqs"}] + _action = buttonAction 100 + returns {player exec "reply.sqs"}$/Code$ - local / local + local / undefined - Array + String - String + - lnbSortByValue + getContainerMaxLoad - Sorts given multicolumn listbox by lnbValue in given column in ascending or descending order. + Returns max load value of given container. Currently works only with uniform, vest and backpack classes. - https://community.bistudio.com/wiki/lnbSortByValue + https://community.bistudio.com/wiki/getContainerMaxLoad - lnbSortByValue Array - - control lnbSortByValue Array + getContainerMaxLoad String - lnbSortByValue [idc, column, reversed] - - control lnbSortByValue [column, reversed] + getContainerMaxLoad containerClass - $Code$lnbSortByValue [1800, 1, false ];$/Code$ - - $Code$_ctl lnbSortByValue [1, true ]$/Code$ + $Code$_maxLoadUniform = getContainerMaxLoad uniform player ; + _maxLoadVest = getContainerMaxLoad vest player ; + _maxLoadBackpack = getContainerMaxLoad backpack player ;$/Code$ undefined / undefined @@ -39576,318 +40836,317 @@ - Nothing - Nothing + Number + - lnbSort + getWPPos - Sorts given multicolumn listbox by lnbText in given column in ascending or descending order. + Returns the position of a selected waypoint of a given group. Waypoints include only those which were placed in the mission editor. - https://community.bistudio.com/wiki/lnbSort + https://community.bistudio.com/wiki/getWPPos - lnbSort Array - - control lnbSort Array + getWPPos Array - lnbSort [idc, column, reversed] - - control lnbSort [column, reversed] + getWPPos [group, index] - $Code$lnbSort [1800, 1, false ];$/Code$ - - $Code$_ctl lnbSort [1, true ]$/Code$ + $Code$[_group1,1] setWPPos [200,600,0]; _pos = getWPPos [_group1,1]; + // returns [200,600,0]$/Code$ - undefined / undefined + global / undefined - Nothing - Nothing + Array + - lnbText + publicVariable - Returns the shown text in the item with the given position of the given 2D listbox. + Broadcasts missionNamespace variable and its value to all computers. The data is sent consequently and reliably to all clients. Using publicVariable too frequently in a given period of time can cause other parts of the game to experience bandwidth problems. + Variables broadcast with publicVariable during a mission stay persistent for JIP (Join In Progress) clients. Such persistent variables are synced to the JIP client before the first batch of client side Event Scripts are ran. + The following Types of data are supported: + Number + Since OFP version 1.34 : + Boolean + Object + Group + Since ArmA version 1.00: + String + Text + Since ArmA version 1.09 : + Array + Code + Since Arma 3 version 1.26 : + Nothing ( nil ) + Limitations : Cannot use reserved names, such as " player " or " west " or " side ", etc. It is also not possible to transfer references to entities which are local, like scripts, displays, or local objects. Team Member is also not supported. - https://community.bistudio.com/wiki/lnbText + https://community.bistudio.com/wiki/publicVariable - Control lnbText Array + publicVariable String - control lnbText [row,column] + publicVariable varName - $Code$_ctrl lnbText [0,0];$/Code$ + $Code$publicVariable "CTFscoreOne";$/Code$ + + $Code$myPubVar = [123, "456", true ]; + publicVariable "myPubVar";$/Code$ - local / local + local / global - (Sep 9 2014) - (A3 1.28)As for invisible data processing, lnbAddArray, lnbAddColumn, lnbData, lnbGetColumnsPosition, lnbSetColumnsPos, lnbSetData, lnbSetText, lnbSetValue, lnbText and lnbValue store data types into exact position of the listNbox with different spaces. Accessing data with coordinate command at nearly the same syntax: - $Code$ - //Set same value to one position of a Control - _ctrl lnbSetData [ [0,0],"#1"]; - lnbSetColumnsPos [102, [0,1], 1]; - _ctrl lnbSetText [ [0,1], "#1"]; - _ctrl lnbSetValue [ [0,0],1]; - //Accessing the value disregard affecting one another. - _ctrl lnbData [0,0]; //"#1" - lnbGetColumnsPosition _ctrl //[1]; - _ctrl lnbText [0,0];//"#1" - _ctrl lnbValue [0,0];//1 - $/Code$ - For a direct visible control over CT_LISTNBOX: - $Code$ - 0 = [_CT_LISTNBOX] spawn { - private ["_CT_LISTNBOX","_color","_current","_pic"]; - disableSerialization ; - _CT_LISTNBOX = _this select 0; + (3 Aug, 2006 23:03) + This command broadcasts a variable to all clients, but as soon as you change the variable again, you have to use publicVariable again, as it does not automatically synchronise it. + + (12 April, 2008) + Be sure to place your variable name in quotation marks. This may sound awfully simple, but many times I have forgotten to do this, and it has resulted in no end of headaches for me. + + (2 Feb, 2008) + When initialising a public variable to handle JIP, you will usually first want to check if the public variable has already been (broadcast, received and) set locally. Otherwise you may inadvertantly overwrite the broadcast value with your default value. + To perform this check, use code similar to the following to first check that the variable is nil: + if ( isNil "PV_abc") then { - _CT_LISTNBOX lnbAddRow [ getText (_x "displayNameShort"), getText (_x "displayName")]; - _CT_LISTNBOX lnbSetPicture [ [_foreachIndex,0], getText (_x "texture")]; - } forEach (" isClass _x" configClasses ( configFile "CfgRanks")); - _CT_LISTNBOX lnbSetCurSelRow 0; - _current = lnbCurSelRow _CT_LISTNBOX; - _color = _CT_LISTNBOX lnbColor [_current,0]; - _CT_LISTNBOX lnbSetColor [ [_current,1], [(_color select 0)/2,0,0,1] ]; - _CT_LISTNBOX lnbDeleteColumn 0; - _CT_LISTNBOX lnbDeleteRow 1; - sleep 1; - lnbClear _CT_LISTNBOX;//Clear all items but control still remains just invisible. + // set the nil variable with a default value for server and both JIP & 'join at mission start' + PV_abc = [7, 8, 9]; }; - $/Code$ - A combined use of both invisible and visible data processing commands alive the Control. + // else public variable has already been set due to a public variable broadcast. + + (14 July, 2011) + To make Dr_Eyeball's note even more clear: + For JIP players pV'ed variables are received and set BEFORE the init.sqf. + So to avoid the received variables getting overwritten by variable initialization normally done in the init.sqf, you HAVE TO to use the 'if ( isNil "PV_abc")' pattern. + It says literally: "Only initialize value it has not yet been set. And in a JIP this may already been the cause due to publicVariable use". + + (21 September, 2013) + To make Dr_Eyeball's and kju's notes even more clear, public variable is persistent. Once it has been broadcast it will be delivered to all clients, present and future. Therefore it is wise to check if the variable already exists on a client due to it being persistent before initialising its value. + + (23 February, 2014) + Just to clarify, when players JIP, they get the value of the variable from the last call to publicVariable, not the current value of the variable. Eg. with + $Code$SomeVar = 5; publicVariable "SomeVar"; SomeVar = 10;$/Code$ + Connecting players will receive 5, not the current value of 10. + + (October 19, 2014) + I'm pretty far down the notes list so I hope this doesn't get buried. + For clarity, after a variable has been publicVariable'd, scripts in all clients can use it as if it had been defined locally. + Variables that have been publicVariable'd do not need to be pre-defined on receiving clients. In fact, this could cause issues with JIP players overwriting a publicVariable value, as mentioned above. (tested in A3 1.32.127785) + Local variables cannot be publicVariable'd. (tested in A3 1.32.127785) (tested by having dedicated server publicVariable a local variable, then trying to hint it on client. Error was "Undefined variable in expression") - String + Nothing + - lnbValue + ctrlActivate - Returns the additional integer value in the item with the given position of the 2D listbox. + Launch actions attached to given (button based) control. - https://community.bistudio.com/wiki/lnbValue + https://community.bistudio.com/wiki/ctrlActivate - lnbValue Array - - Control lnbValue Array + ctrlActivate Control - lnbValue [idc,[row, column]] - - ctrl lnbValue [row, column] + ctrlActivate controlName - $Code$_ctrl lnbValue [0,0];//1, default is 0 if value is String set by lnbSetValue$/Code$ + $Code$ctrlActivate _control$/Code$ undefined / undefined - (Sep 9 2014) - (A3 1.28)As for invisible data processing, lnbAddArray, lnbAddColumn, lnbData, lnbGetColumnsPosition, lnbSetColumnsPos, lnbSetData, lnbSetText, lnbSetValue, lnbText and lnbValue store data types into exact position of the listNbox with different spaces. Accessing data with coordinate command at nearly the same syntax: - $Code$ - //Set same value to one position of a Control - _ctrl lnbSetData [ [0,0],"#1"]; - lnbSetColumnsPos [102, [0,1], 1]; - _ctrl lnbSetText [ [0,1], "#1"]; - _ctrl lnbSetValue [ [0,0],1]; - //Accessing the value disregard affecting one another. - _ctrl lnbData [0,0]; //"#1" - lnbGetColumnsPosition _ctrl //[1]; - _ctrl lnbText [0,0];//"#1" - _ctrl lnbValue [0,0];//1 - $/Code$ - For a direct visible control over CT_LISTNBOX: - $Code$ - 0 = [_CT_LISTNBOX] spawn { - private ["_CT_LISTNBOX","_color","_current","_pic"]; - disableSerialization ; - _CT_LISTNBOX = _this select 0; - { - _CT_LISTNBOX lnbAddRow [ getText (_x "displayNameShort"), getText (_x "displayName")]; - _CT_LISTNBOX lnbSetPicture [ [_foreachIndex,0], getText (_x "texture")]; - } forEach (" isClass _x" configClasses ( configFile "CfgRanks")); - _CT_LISTNBOX lnbSetCurSelRow 0; - _current = lnbCurSelRow _CT_LISTNBOX; - _color = _CT_LISTNBOX lnbColor [_current,0]; - _CT_LISTNBOX lnbSetColor [ [_current,1], [(_color select 0)/2,0,0,1] ]; - _CT_LISTNBOX lnbDeleteColumn 0; - _CT_LISTNBOX lnbDeleteRow 1; - sleep 1; - lnbClear _CT_LISTNBOX;//Clear all items but control still remains just invisible. - }; - $/Code$ - A combined use of both invisible and visible data processing commands alive the Control. - Number - Number + Nothing + - ln + lnbAddColumn - Natural logarithm of x. + Adds an column at given position. It returns the index of the newly added column. - https://community.bistudio.com/wiki/ln + https://community.bistudio.com/wiki/lnbAddColumn - ln Number + Control lnbAddColumn Number + + lnbAddColumn Array - ln x + _ctrl lnbAddColumn position + + lnbAddColumn [idc or Control,position] - $Code$_nlog = ln 10 - // Result is 2.302$/Code$ + $Code$_ctrl lnbAddColumn 0.8;$/Code$ + + $Code$lnbAddColumn [105,0.8];$/Code$ - undefined / undefined + local / local + (A3 1.28) Horizontal coordinates of columns were added relative to list width, in range from 0 to 1. - Number + Number/Void - Number/Void + - loadAbs + abs - Returns current sum of mass from items stored in all unit's containers, linked items and weapons. + Absolute value of a real number - https://community.bistudio.com/wiki/loadAbs + https://community.bistudio.com/wiki/abs - loadAbs Object + abs Number - loadAbs unit + abs n - $Code$// Player weight: - _weight = loadAbs player;$/Code$ + $Code$_n = abs -3; + // Returns 3$/Code$ - undefined / undefined + local / undefined - Number + Number + - loadBackpack + selectPlayer - Returns current sum of mass from items stored in a backpack. + Moves player into given unit. In Arma 3 it is now not possible to selectPlayer into unit occupied by another player. Also avoid selecting player into editor placed units in multiplayer, as it may, on occasion, lead to some undefined behaviour. If you need to selectPlayer into another unit, consider creatingUnit dynamically. - https://community.bistudio.com/wiki/loadBackpack + https://community.bistudio.com/wiki/selectPlayer - loadBackpack Object + selectPlayer Object - loadBackpack unit + selectPlayer unitName - $Code$myVariable = loadBackpack myUnit;$/Code$ + $Code$selectPlayer bob;$/Code$ - undefined / undefined + local / global + This command has significant effects on locality + Notes on locality issues with selectPlayer in multiplayer environments: + 1) If you switch to a unit that's not local, control over movement will not be given to you immediately. For example, if you switch to an AI unit whose leader is a player, you will not be able to control the movement of your new avatar, as its control remains with the leader unit. You will however be able to look around while the unit walks automatically. + 2) The identity of units are not transferred properly: If your old unit dies, this will count for your stats. Your old unit might remain identifiable as you (if you aim at the unit you see your own name). Your new unit will keep it's name, face and voice (face can be set dynamically, but name, voice and glasses have to be defined before mission start in the description.ext). When chatting, not the name of your original identity, but the identity of the transferred to person will show. + Those 2 Points were for ArmA I, I am currently analyzing the behaviour in ArmA II with version 1.08 + OA 1.57 + So with ArmA II, you still have to keep an eye on locality (otherwise the AI will controll the unit you are), but there are cool possibilities now: if you do a "selectPlayer unitVarName",the unit takes your identity (with name, voice, face and glasses) - and your identity is also visible on other clients! + But you have to remember that your old unit will stay with your Identity. Dies the old unit, the stats count it. An other thing you have to pay attention is the Death for your new unit - you have to register an EventHandler, otherwise you will stay in your dead unit, and also the MenuOption Respawn won't help you out! 3.Jan. 2011 + 3) If you do a selectPlayer call, join,joinSilent,joinAs,joinAsSilent wont work anymore correctly. Means: Your unit joins the other group AND your unit will be local to the other group. so at the moment you can use selectPlayer only as a single human player in a group. In the later day I will try what happens if both human players are units by selectPlayer, and both join the same group (till yet tried with one selectPlayer unit and one originUnit) + 14.May 2011 + Tried to create ingame a group with a selectPlayer Unit (on both clients), and joint the new squad. The result was, the group was local to the client who created the group, so after that, all other units that join that Group are - as you may think already, local to that single client. 18.May 2011 + + 3) After switching to a unit that's not local, the unit will remain local to you after switching back. For example, if we have units A and B, and a client starts as unit A and unit B is AI under server control. If you switch to unit B, it will take some time, but eventually you can control the movement of unit B (see (1) above). Now if you switch back to unit A, unit B will remain local to you, the player. Any server-side scripts which try to execute local arguments -- such as doMove -- will fail. + + A working implementation can be found at A&S ProMode dev-heaven repo, acc guest, pw guest or at pastebin. + Be careful to learn all the pitfalls and things you need to take into consideration to have this working in MP. + + (09 March 2014) + Arma 3 (v1.13): In MP the Identity and the name carries over to the new Unit but not in SP. Use setName to set the name in SP. + + (June 24, 2015) + Most of the notes above do not apply to Arma 3 anymore. - Number + Nothing + - loadFile + getBackpackCargo - Return content of given filename. + Returns all backpack types and count from the cargo space - https://community.bistudio.com/wiki/loadFile + https://community.bistudio.com/wiki/getBackpackCargo - loadFile String + getBackpackCargo Object - loadFile filename + getBackpackCargo object - $Code$_contents = loadFile "myFunction.sqf";$/Code$ + $Code$_content = getBackpackCargo carName;$/Code$ + + $Code$_content = getBackpackCargo ammoBoxName;$/Code$ - undefined / local + undefined / undefined - (28 November 2006) - In Armed Assault, the 'loadfile' command must be preceded by the 'compile' command to work. - Ex OFP 1.96: _falarmEvent = loadfile ("syswarn\falarmEvent.sqf") - Ex ArmA 1.0: _falarmEvent = compile loadfile ("syswarn\falarmEvent.sqf") - - (11 July 2007) - The note by Pennywise is not entirely accurate. loadFile only needs to be preceded with compile when loading code (for example, a function contained in an.sqf file ). Using loadFile without compile will return a string, which, in some cases, is exactly what you want. - - (02 December 2012) - Please note that any comment you have within the file you load will be included, to get around that use preprocessFile instead. - - (25 January 2016) - Notice that you will have to activate file patching via -filePatching [ [1] ]. Otherwise, execVM and loadFile will *not* load any files outside your mission folder (like the global scripts). For more info see CMA:DevelopmentSetup (since Arma 3 1.49+). - String + Array + - loadIdentity + magazineCargo - Loads person's identity from Objects.sav file in campaign directory (from entry name). + Get array with magazines from ammo box (or any general weapon holder container). - https://community.bistudio.com/wiki/loadIdentity + https://community.bistudio.com/wiki/magazineCargo - Object loadIdentity String + magazineCargo Object - person loadIdentity name + magazineCargo box - $Code$_ok = player loadIdentity "playerIdentity"$/Code$ + $Code$hint str magazineCargo uniformContainer cursorTarget ;$/Code$ undefined / undefined @@ -39895,82 +41154,107 @@ - Boolean + Array + - loadUniform + setTriggerStatements - Returns current sum of mass from items stored in a uniform. + Defines trigger condition, activation and deactivation statements. Trigger condition has to return Boolean. true will activate the trigger, false will deactivate it (only if activation is set to repeat). thisList returns the same result as list command, which includes all entities in the trigger area that are capable of activating the trigger. Dead entities are excluded as well as crew in vehicles, vehicles themselves are included. - https://community.bistudio.com/wiki/loadUniform + https://community.bistudio.com/wiki/setTriggerStatements - loadUniform Object + Object setTriggerStatements Array - loadUniform unit + trigger setTriggerStatements [condition, activation, deactivation] - + $Code$_trg setTriggerStatements ["this", " hint 'trigger on'", " hint 'trigger off'"]$/Code$ + - undefined / undefined + global / local + (Mar 14, 2011) + An array with three arguments is mandatory for this function. + + (September 16, 2014) + Magic variable thisList does not contain dead units. - Number + Nothing + - loadVest + synchronizeObjectsRemove - Returns current sum of mass from items stored in a vest. + Remove given objects from the unit's list of synchronized objects. - https://community.bistudio.com/wiki/loadVest + https://community.bistudio.com/wiki/synchronizeObjectsRemove - loadVest Object + Object synchronizeObjectsRemove Array - loadVest unit + unit synchronizeObjectsRemove [objects] - undefined / undefined + global / global - Number + Nothing + - load + setCamUseTI - Returns current sum of mass from items stored in all unit's containers. Load is calculated by the following formula: - $Code$_loadPlayer = loadAbs player / getNumber ( configFile "CfgInventoryGlobalVariable" "maxSoldierLoad");$/Code$ + Activates thermal vision. Mode index defines what sort of thermal vision it is: + 0 - White Hot + 1 - Black Hot + 2 - Light Green Hot / Darker Green cold + 3 - Black Hot / Darker Green cold + 4 - Light Red Hot /Darker Red Cold + 5 - Black Hot / Darker Red Cold + 6 - White Hot. Darker Red Cold + 7 - Thermal (Shade of Red and Green, Bodies are white) + This command only works with camCreate created camera that is currently the main camera for the player (see example). - https://community.bistudio.com/wiki/load + https://community.bistudio.com/wiki/setCamUseTI - load Object + Boolean setCamUseTI Number - load unit + Bool setCamUseTI modeIndex - $Code$load player ;$/Code$ + $Code$true setCamUseTI 1;$/Code$ + + $Code$// "Preditor" vision: + _cam = "camera" camCreate [0,0,0]; + _cam camSetTarget player ; + _cam camSetRelPos [0,1,1.5]; + _cam cameraEffect ["Internal","Back"]; + _cam camCommit 0; + true setCamUseTI 7;$/Code$ undefined / undefined @@ -39978,27 +41262,28 @@ - Number + Nothing + - loadGame + nearObjectsReady - Load a game from the autosave. If failed, restart the mission. + Check whether all data are loaded to nearObjects will return in reasonable time. - https://community.bistudio.com/wiki/loadGame + https://community.bistudio.com/wiki/nearObjectsReady - loadGame + Object/Array nearObjectsReady Number - loadGame + position nearObjectsReady radius - $Code$loadGame ;$/Code$ + $Code$_twnpos nearObjectsReady 500;//from ALICE$/Code$ undefined / undefined @@ -40006,28 +41291,29 @@ - Nothing + Boolean + - loadMagazine + completedFSM - Initiates the loading action on given weapon of the turret of a transport. So the new magazine is not available instantly, yet according to the reloadTime. - The turret has to be manned. One can also change the magazine if its respective weapon is not selected. + Check whether the given FSM completes. + The FSM handle is the number returned by the execFSM command. - https://community.bistudio.com/wiki/loadMagazine + https://community.bistudio.com/wiki/completedFSM - Object loadMagazine Array + completedFSM Number - transport loadMagazine [turretPath, weaponName, magazineName] + completedFSM fsmHandle - $Code$vehicle player loadMagazine [[0],"m256","20Rnd_120mmHE_M1A2"];$/Code$ + $Code$_completed = completedFSM _fsmHandle;$/Code$ undefined / undefined @@ -40035,177 +41321,158 @@ - Nothing + Boolean + - loadOverlay + getSuppression - Creates the load overlay dialog for the specified type of overlay. - i - Some Old Editor Command + Gets the suppression value of given unit. Returns SCALAR between 0 and 1. Suppression is not calculated for player entities. - https://community.bistudio.com/wiki/loadOverlay + https://community.bistudio.com/wiki/getSuppression - Control loadOverlay Config + getSuppression Object - map loadOverlay config + getSuppression unit - + $Code$getSuppression AI_unit_1;$/Code$ + - undefined / undefined + local / undefined - Nothing + Number + - loadStatus + assignAsDriver - Loads object's properties from Objects.sav file in campaign directory (from entry name). + Assign a unit as driver of a vehicle. Used together with orderGetIn to order subordinate units to get in as driver of a specific vehicle. Before usage of this command a subordinate unit hasn't got the option to get into the driver place of the vehicle. - https://community.bistudio.com/wiki/loadStatus + https://community.bistudio.com/wiki/assignAsDriver - Object loadStatus String + Object assignAsDriver Object - obj loadStatus entryName + unitName assignAsDriver vehicleName - $Code$_ok = player loadStatus "playerState";$/Code$ + $Code$_soldier1 assignAsDriver _tank + [_soldier1] orderGetIn true$/Code$ - undefined / undefined + global / global - Boolean + Nothing + - localize + camConstuctionSetParams - Used to internationalise text messages. A string is returned from Stringtable.csv (or Stringtable.xml ) which corresponds to the stringName. + Sets construction camera parameters. To work with "camconstruct" object. - https://community.bistudio.com/wiki/localize + https://community.bistudio.com/wiki/camConstuctionSetParams - localize String + Object camConstuctionSetParams Array - localize stringName + camera camConstuctionSetParams [[x,y,z], radius, maxAboveLand] - $Code$hint localize "STR_WEST"; // - "BLUFOR" (in Arma2)$/Code$ - - $Code$hint format ["Go %1", localize "STR_Q_NORTH"]; // - "Go North"$/Code$ - - $Code$hint format [ localize "STR_ACTION_DROP_WEAPON", localize "STR_SN_RIFLE"]; // - "Drop Rifle" - // STR_ACTION_DROP_WEAPON contains "Drop %1", STR_SN_RIFLE contains "Rifle"$/Code$ + $Code$_camera camConstuctionSetParams [ getPos player, 50, 20];$/Code$ - undefined / local + undefined / undefined - (September 12, 2014) - The command localize will strip all HTML tags from your stringtable.xml entries, however there is a way to trick it by substituting tags with HTML code instead: - ?xml version = "1.0" encoding = "utf-8" ? - Key ID = "STR_TEST_KK" - Original ![CDATA[ t color='#ff0000' This doesn't work /t ]] /Original - /Key - Key ID = "STR_TEST_KK2" - Original t color='#ff0000' This works /t /Original - /Key - $Code$ hint parseText localize "str_test_kk"; //no change of colour$/Code$ - $Code$ hint parseText localize "str_test_kk2"; //hint content is in red$/Code$ - String + Nothing + - local + ctrlClassName - Check if given unit is local on the computer in Multiplayer games (see Locality in Multiplayer for general concepts). - This can be used when some activation fields or scripts need to be performed only on one computer. In Single player all objects are local. - Note1: Map created objects (those placed in Visitor ) are local everywhere. - Note2: Since Arma 3 v1.53.132932 keyword local has been renamed to private for consistency and to avoid any confusion. However, this just makes the third example obsolete. It's core functionality still remains. + Returns the class name of a Control as it is defined in config. If you need config class of a game created Display, it is stored on display itself: + $Code$_className = findDisplay 12 getVariable ["BIS_fnc_initDisplay_configClass", ""]; // "RscDiary"$/Code$ - https://community.bistudio.com/wiki/local + https://community.bistudio.com/wiki/ctrlClassName - local Object/Group + ctrlClassName Control - local object + ctrlClassName control - $Code$// SQS: - ?! local _unitName : hint "remote"$/Code$ - - $Code$// SQF: - if (! local _unitName) then { - hint "remote"; - };$/Code$ - - $Code$_isLocalGroup = local group _unit;$/Code$ + $Code$// List class names of all controls present on display 46: + _ctrls = ""; + for "_i" from -1 to 10000 do { + with uiNamespace do { + _ctrl = findDisplay 46 displayCtrl _i; + if (! isNull _ctrl) then { + _ctrls = _ctrls + format ["IDC: %1, Class Name: %2\n", _i, ctrlClassName _ctrl]; + }; + }; + }; + hint _ctrls;$/Code$ - global / undefined + undefined / undefined - (August 4, 2006) - Notes from before the conversion: - In multiplayer, a game logic will always be local to the host computer. This works on both dedicated and player-hosted servers. - Boolean + String + - locationNull + ropeEndPosition - A non-existing Location. To compare non-existent locations use isNull or isEqualTo : - locationNull == locationNull ; // false - isNull locationNull ; // true - locationNull isEqualTo locationNull ; // true + Return rope end positions in Position3D format - https://community.bistudio.com/wiki/locationNull + https://community.bistudio.com/wiki/ropeEndPosition - locationNull + ropeEndPosition Object - locationNull + ropeEndPosition rope - $Code$! isNull locationNull ; // false$/Code$ - - $Code$str locationNull ; // No location$/Code$ - - $Code$position locationNull ; // [0,0,0]$/Code$ + $Code$_ends = ropeEndPosition ( ropes heli1 select 0); + _end1 = _ends select 0; + _end2 = _ends select 1;$/Code$ undefined / undefined @@ -40213,353 +41480,358 @@ - Location + Array + - locationPosition + removeMissionEventHandler - Returns the position of a location. If the location is attached to an object, that object's position is returned. + Removes mission event handler added by addMissionEventHandler. + When any handler is removed, all handler indices higher that the deleted one should be decremented. - https://community.bistudio.com/wiki/locationPosition + https://community.bistudio.com/wiki/removeMissionEventHandler - locationPosition Location + removeMissionEventHandler Array - locationPosition location + removeMissionEventHandler [type, index] - $Code$_locationPos = locationPosition myLocation;$/Code$ - - $Code$_location = nearestLocation [ getPos player, "nameCity"]; - _locationPos = locationPosition _location;$/Code$ + $Code$for "_i" from 0 to 4 do { + missionNamespace setVariable [ format ["handler%1",_i], addMissionEventHandler ["Loaded","hint ""_i"";"]]; + }; + removeMissionEventHandler ["Loaded",handler2]; //Remove the third index under type "Loaded"$/Code$ undefined / undefined - (October 24, 2015) - locationPosition returns a position that is altitude zero ASL. + (August 6, 2015) + As of Arma 3 version 1.38 you can safely remove mission event handlers without worrying about decrementing higher indices. - Array + Nothing + - lockCameraTo + getAssignedCuratorLogic - Lock/Unlock stabilized camera (in vanilla used currently only for UAVs) to target. + Returns curator logic to which given player has access. - https://community.bistudio.com/wiki/lockCameraTo + https://community.bistudio.com/wiki/getAssignedCuratorLogic - Object lockCameraTo Array + getAssignedCuratorLogic Object - vehicle lockCameraTo [target, turretPath] + getAssignedCuratorLogic player - $Code$uav lockCameraTo [vehicle, [0,0]];$/Code$ + $Code$( getAssignedCuratorLogic player ) removeCuratorEditableObjects [ allDead, true ];$/Code$ undefined / undefined - (April 10, 2015) - The command also accepts a position (ASL) instead of an object. The vehicle has to have a stabilized optic for this command to work. + (August 17, 2014) + This command will return objNull if used immediately after the curator logic is assigned to the unit in question (this includes at mission time 0). To avoid problems use the following beforehand: $Code$ waitUntil {! isNull ( getAssignedCuratorLogic unit)};$/Code$ - Nothing + Object + - lockCargo + taskDescription - Lock all cargo positions of a vehicle or lock by index. This command must be executed where vehicle is local. + Returns the sub-parts of the task description. The returned Array is in format [Task description, Task title, Task waypoint description]. - https://community.bistudio.com/wiki/lockCargo + https://community.bistudio.com/wiki/taskDescription - Object lockCargo Boolean - - Object lockCargo Array + taskDescription Task - vehicle lockCargo lock - - vehicle lockCargo [index, lock] + taskDescription task - $Code$vehicleName lockCargo true ;$/Code$ - - $Code$vehicleName lockCargo [0, true ];$/Code$ + $Code$_taskDescArray = taskDescription _task;$/Code$ - local / global + undefined / undefined + (November 14, 2014) + Be careful if you want to use this to retrieve the title of a task. + If the task has no description set, then "taskDescription" will only return an array of empty Strings. + Therefor always use setSimpleTaskDescription directly after creating a new task, even if you set the Description to "". - Nothing - Nothing + Array + - lock + aimedAtTarget - Lock vehicle (disable mounting / dismounting) for player. Similar to setVehicleLock when number is used as param. + Returns how good the weapon of the vehicle is aimed at the target. - https://community.bistudio.com/wiki/lock + https://community.bistudio.com/wiki/aimedAtTarget - Object lock Boolean - - Object lock Number + Object aimedAtTarget Array - vehicleName lock locked - - vehicleName lock lockstate + vehicle aimedAtTarget [target, weapon] - $Code$_jeepOne lock true ;$/Code$ + $Code$_aimingQuality = heli aimedAtTarget [target];$/Code$ - $Code$heli lock true ; - locked heli; //2 - heli lock false ; - locked heli; //0 - heli lock 1; - locked heli; //1$/Code$ + $Code$_aimingQuality = heli aimedAtTarget [target,"M197"];$/Code$ - local / global + undefined / undefined - (January 9, 2010) - Lock prevents AI persons mounting or dismounting vehicles when ordered to do so and players are prevented from doing both too, but AI will dismount when a vehicle is damaged. - - (September 22, 2010) - If an AI group (eg Mechanized Infantry) has its vehicule locked with its crew in it, it will mount or dismount it anyway. But a player in this group won't be able to enter the vehicle. - - (April 2, 2013) - From Arma 3 version 0.50 can be used Number as lock parameter : - 0 - Unlocked - 1 - Default - 2 - Locked - 3 - Locked for player - - (March 4, 2015) - 1 - is DEFAULT lock for vehicle placed in editor. Player that is not the leader in a group of AIs will not be able to enter this vehicle. + (November 19, 2013) + The command doesn't work with soldier weapons, only vehicle weapons (in Arma 3 at least). The return value is either 1 or 0, very rarely the value falls in between. 1 doesn't mean you are going to hit the target, while 0 means you're definitely off. - Nothing - Nothing + Number + - lockDriver + ctrlAutoScrollDelay - Lock the driver position of the vehicle. This command must be executed where vehicle is local. + Returns number of seconds auto-scroll will wait before scroll and/or rewind. -2 if scrollbar not present. + Autorscroll is available for CT_LISTBOX and CT_CONTROLS_GROUP types of controls only. Autoscroll will wait ctrlAutoScrollDelay seconds (must be 0) and then will scroll the scroll bar down to the bottom. ctrlAutoScrollSpeed defines the speed with which scrollbar is scrolled. If ctrlAutoScrollRewind is true, the control will fade out, immediately rewind to the top, then fade in, wait ctrlAutoScrollDelay seconds and then repeat the scrolling in a loop. If user focuses on the control, autoscrolling is interrupted. - https://community.bistudio.com/wiki/lockDriver + https://community.bistudio.com/wiki/ctrlAutoScrollDelay - Object lockDriver Boolean + ctrlAutoScrollDelay Control - vehicle lockDriver lock + ctrlAutoScrollDelay control - $Code$vehicleName lockDriver true ;$/Code$ + $Code$_ctrlDelay = ctrlAutoScrollDelay _ctrlGroup;$/Code$ - local / global + undefined / undefined - Nothing + Number + - lockIdentity + removeMagazine - Locks the identity of a person. This will disable default identity. + Remove magazine from the unit. + Note: You may create invalid combinations with this function. When doing so, application behaviour is undefined. - https://community.bistudio.com/wiki/lockIdentity + https://community.bistudio.com/wiki/removeMagazine - lockIdentity Object + Object removeMagazine String - lockIdentity unit + unitName removeMagazine magazineName - $Code$_success = lockIdentity player;$/Code$ + $Code$player removeMagazine "M16"$/Code$ - undefined / undefined + local / undefined - Boolean + Nothing + - lockTurret + setGroupIdGlobal - Lock the gunner position of the vehicle turret. This command must be executed where vehicle is local. + A global equivalent of setGroupId - https://community.bistudio.com/wiki/lockTurret + https://community.bistudio.com/wiki/setGroupIdGlobal - Object lockTurret Array + Object/Group setGroupIdGlobal Array - vehicle lockTurret [turret path,lock] + group setGroupIdGlobal [nameFormat, nameParam1,, nameParamN] - $Code$vehicleName lockTurret [[0,0], true ];$/Code$ - - $Code$vehicle player lockTurret [[0], true ];$/Code$ - + - local / global + global / global - Nothing + Nothing + - lockWP + moveInCargo - Disable switching to next waypoint (current waypoint will never complete while lockwp is used). Sometimes used during cut-scenes. + Move soldier into vehicle cargo position (Immediate, no animation). - https://community.bistudio.com/wiki/lockWP + https://community.bistudio.com/wiki/moveInCargo - Object/Group lockWP Boolean + Object moveInCargo Object + + Object moveInCargo Array - groupName lockWP lock + unitName moveInCargo vehicle + + unitName moveInCargo [vehicle, CargoIndex] - $Code$_groupOne lockWP true ;$/Code$ - - $Code$_Soldier lockWP true ;$/Code$ + $Code$_soldierOne moveInCargo _jeepOne;$/Code$ - $Code$_MyTank lockWP false ;$/Code$ + $Code$_soldierOne moveInCargo [_jeepOne, 1];$/Code$ - local / local + local / global + (August 4, 2006) + Notes from before the conversion + If you place a soldier in a vehicle with the moveInCargo command, he wont "know" he's in the vehicle, and thus he won't disembark properly when the vehicle reaches a Transport Unload waypoint. Therefore you have to use the assignAsCargo command, in order for the AI to catch on. Something like this: moveInCargo helo1 this assignAsCargo helo1 + MP Note Functions MoveInCargo can only be called for local soldiers. They will be ignored for remote soldiers. (see Locality in Multiplayer ) + + In OFP v1.96, the moveIn commands will not trigger an associated getIn event. To ensure the getIn event is fired, use the "getIn Cargo" action command. + + In Arma 3 when using the alternative syntax of moveInCargo, it is necessary to call assignAsCargoIndex because it is not called automatically. + $Code$unit1 moveInCargo [heli, 3]; + unit1 assignAsCargoIndex [heli, 3];$/Code$ + Alternatively avoid this broken syntax all together and use: + $Code$unit1 assignAsCargoIndex [heli, 3]; + unit1 moveInCargo heli; + $/Code$ - Nothing + Nothing - Nothing + - lockedCargo + setMarkerSizeLocal - Check whether cargo position of the vehicle is locked. + Set marker size. + Size is in format [a-axis, b-axis]. - https://community.bistudio.com/wiki/lockedCargo + https://community.bistudio.com/wiki/setMarkerSizeLocal - Object lockedCargo Number + String setMarkerSizeLocal Array - vehicle lockedCargo cargoIndex + markerName setMarkerSizeLocal [a-axis, b-axis] - $Code$_result = vehicleName lockedCargo 0;$/Code$ + $Code$"MarkerOne" setMarkerSizeLocal [100, 200];$/Code$ - undefined / undefined + undefined / local - (May 4, 2016) - For some vehicles, the command returns nothing if the cargo index is invalid (i.e. -1) - Boolean + Nothing + - lockedDriver + camPrepareDive - Check whether driver position of the vehicle turret is locked. + Prepares the camera dive angle. + This command is non-functional ! - https://community.bistudio.com/wiki/lockedDriver + https://community.bistudio.com/wiki/camPrepareDive - lockedDriver Object + Object camPrepareDive Number - lockedDriver vehicle + camera camPrepareDive dive - + $Code$_camera camPrepareDive -0.1$/Code$ + undefined / undefined - Boolean + Nothing + - lockedTurret + libraryDisclaimers - Check whether gunner position of the vehicle turret is locked. + Returns the library disclaimers. - https://community.bistudio.com/wiki/lockedTurret + https://community.bistudio.com/wiki/libraryDisclaimers - Object lockedTurret Array + libraryDisclaimers - vehicle lockedTurret turretPath + libraryDisclaimers - $Code$_locked = tank lockedTurret [0];$/Code$ + $Code$hint str libraryDisclaimers ; // as in Arma2 OA 1.62.95208 + // ["THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 'AS IS' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."]$/Code$ undefined / undefined @@ -40567,280 +41839,240 @@ - Boolean + Array + - locked + edit3DENMissionAttributes - Check if vehicle is locked for Persons. If it is locked, Persons cannot mount / dismount without order. + Open a window with scenario attribute in given section. - https://community.bistudio.com/wiki/locked + https://community.bistudio.com/wiki/edit3DENMissionAttributes - locked Object + edit3DENMissionAttributes String - locked vehicle + edit3DENMissionAttributes section - $Code$_locked = locked _jeepOne;$/Code$ + $Code$edit3DENMissionAttributes "Multiplayer";$/Code$ - global / undefined + undefined / undefined - (March 4, 2013) - From Arma 3 version 0.50 is return value Number : - -1 - Object is null - 0 - Unlocked - 1 - Default - 2 - Locked - 3 - Locked for player - Number + Nothing + - logEntities + curatorAddons - Creates a log file containing the list of all game entities in scene. - File is created in the same directory as.rpt file. - Special: BattlEye's RCON variant of this command is #logEntities (see also Multiplayer_Server_Commands ) + Returns list of addons allowed to given curator. - https://community.bistudio.com/wiki/logEntities + https://community.bistudio.com/wiki/curatorAddons - logEntities + curatorAddons Object - logEntities + curatorAddons curatorObj - $Code$logEntities ;$/Code$ + $Code$_addons = curatorAddons myCurator;$/Code$ undefined / undefined - File name example: - logEntities_4688_12-04-2014_12-19-39.log - File content example: - ====================== Vehicles ======================= - Loc:1, ForDel:0, Dstr:0, DmgDstr:0, DmgDead:0, Sim:1, Inv: 0, AnyPl:1, Out: 0, NetID:2:3, Pos: [2476.243896][73.782043], N:B_Soldier_F - Loc:1, ForDel:0, Dstr:0, DmgDstr:0, DmgDead:0, Sim:1, Inv: 0, AnyPl:0, Out: 0, NetID:0:0, Pos: [2471.500977][62.477680], N:Snake_random_F - Loc:1, ForDel:0, Dstr:0, DmgDstr:0, DmgDead:0, Sim:1, Inv: 0, AnyPl:0, Out: 0, NetID:0:0, Pos: [2489.192383][73.935181], N:Snake_random_F - Loc:1, ForDel:0, Dstr:0, DmgDstr:0, DmgDead:0, Sim:1, Inv: 0, AnyPl:0, Out: 0, NetID:0:0, Pos: [2487.953857][73.828362], N:Snake_random_F - Loc:1, ForDel:0, Dstr:0, DmgDstr:0, DmgDead:0, Sim:1, Inv: 0, AnyPl:0, Out: 0, NetID:0:0, Pos: [2800.174805][96.234093], N:Rabbit_F - Loc:1, ForDel:0, Dstr:0, DmgDstr:0, DmgDead:0, Sim:1, Inv: 0, AnyPl:0, Out: 0, NetID:0:0, Pos: [2825.378418][2.068635], N:Rabbit_F - Loc:1, ForDel:0, Dstr:0, DmgDstr:0, DmgDead:0, Sim:1, Inv: 0, AnyPl:0, Out: 0, NetID:0:0, Pos: [2888.919434][6.837101], N:Rabbit_F - Loc:1, ForDel:0, Dstr:0, DmgDstr:0, DmgDead:0, Sim:1, Inv: 0, AnyPl:0, Out: 0, NetID:0:0, Pos: [2910.756104][16.089361], N:Rabbit_F - Loc:0, ForDel:0, Dstr:0, DmgDstr:0, DmgDead:0, Sim:1, Inv: 1, AnyPl:0, Out: 0, NetID:2:0, Pos: [9.000000][9.000000], N:Logic - Total objects: 9 - Statistics objects: 9 - IsLocal: 8 - IsMarkedToDelete: 0 - IsDestroyed: 0 - IsDamageDestroyed: 0 - IsDamageDead: 0 - IsNotSimulated: 9 - IsVisible: 1 - IsAnyPlayer: 1 - IsOutsideMap: 0 - =================== Slow vehicles ===================== - Total objects: 214 - Statistics objects: 0 - Static objects are accounted in total object count but not included in statistics - IsLocal: 0 - IsMarkedToDelete: 0 - IsDestroyed: 0 - IsDamageDestroyed: 0 - IsDamageDead: 0 - IsNotSimulated: 0 - IsVisible: 0 - IsAnyPlayer: 0 - IsOutsideMap: 0 - =================== Out vehicles ==================== - Loc:1, ForDel:0, Dstr:0, DmgDstr:0, DmgDead:0, Sim:1, Inv: 0, AnyPl:0, Out: 0, NetID:2:1, Pos: [2476.243896][73.782043], N:Supply40 - Loc:1, ForDel:0, Dstr:0, DmgDstr:0, DmgDead:0, Sim:1, Inv: 0, AnyPl:0, Out: 0, NetID:2:2, Pos: [2476.243896][73.782043], N:Supply140 - Total objects: 2 - Statistics objects: 2 - IsLocal: 2 - IsMarkedToDelete: 0 - IsDestroyed: 0 - IsDamageDestroyed: 0 - IsDamageDead: 0 - IsNotSimulated: 2 - IsVisible: 0 - IsAnyPlayer: 0 - IsOutsideMap: 0 - Nothing + Array + - logNetwork + waypointCompletionRadius - Registers new log file recording a network traffic and returns handle of the log. + Gets the radius around the waypoint where the waypoint is completed. - https://community.bistudio.com/wiki/logNetwork + https://community.bistudio.com/wiki/waypointCompletionRadius - logNetwork String + waypointCompletionRadius Array - logNetwork logFile + waypointCompletionRadius waypoint - $Code$_handle = logNetwork "myLog.txt";$/Code$ + $Code$_radius = waypointCompletionRadius [groupOne, 1];$/Code$ undefined / undefined - (March 15, 2016) - With his syntax i get an error... - logNetwork "networkLog.txt"; - $Code$ 5:37:06 Error in expression logNetwork "networkLog.txt"; - 5:37:06 Error position: logNetwork "networkLog.txt"; - 5:37:06 Error lognetwork: Typ Zeichenfolge(STRING), erwartet(except) Array - $/Code$ - Number + Number + - logNetworkTerminate + finite - Terminates a network log file started with logNetwork with the given handle + True, if number is finite (not infinite and a valid number) - https://community.bistudio.com/wiki/logNetworkTerminate + https://community.bistudio.com/wiki/finite - logNetworkTerminate Number + finite Number - logNetworkTerminate handle + finite x - + $Code$?!finite 10/0 : hint "Infinite"$/Code$ + undefined / undefined + (27 Sep, 2013) + Don't get high hopes with this command thinking what a great way of catching divisions by zero, the command is pretty useless in this respect: + $Code$//ArmA 2 + hint str finite (10/0); //true... O_o Huh???? + hint str (10/0); //0... Weird, but that explains it. + //ArmA 3 + hint str finite (10/0); // Error Zero Divisor + hint str finite 10; //true + hint str finite 1000000000000000000000000000000000000000; //false$/Code$ - Nothing + Boolean + - log + soldierMagazines - Base-10 logarithm of x. + Get array with all magazines of the given unit. - https://community.bistudio.com/wiki/log + https://community.bistudio.com/wiki/soldierMagazines - log Number + soldierMagazines Object - log x + soldierMagazines unit - $Code$_log = log 10; // 1$/Code$ + $Code$soldierMagazines player ;[ + "6.5mm 30Rnd STANAG Mag(30/30)[id/cr:1/0](5x)", + "9mm 16Rnd Mag(16/16)[id/cr:7/0](2x)", + "RGO Frag Grenade(1/1)[id/cr:10/0](2x)", + "Smoke Grenade (White)(1/1)[id/cr:12/0](1x)", + "Smoke Grenade (Green)(1/1)[id/cr:13/0](1x)", + "Chemlight (Green)(1/1)[id/cr:14/0](2x)", + "Titan AT Missile(1/1)[id/cr:16/0](2x)" + ]$/Code$ undefined / undefined - (23:14, 16 Jun 2014) - (A3 1.20) To clarify: - $Code$y = 10 ^ x // x = log y$/Code$ - People use logarithm at the purpose of simplifying multiplication via exponents plus years before. - $Code$23456*45634 = 1.07039e+009 - log 23456 = 4.37025; log 45634 = 4.65929; ( log 23456) + ( log 45634) = 9.02954 - 10^(( log 23456) + ( log 45634)) = 10 ^ 9.02954 // same as 23456*45634 - $/Code$ - As modern usage, for instance, to evaluate another exponent when multiple is known (Which magnitude is 4 times stronger than 8.3 earthquake?): - $Code$//_Unknown = log x; 8.3 = log y - // x = 10 ^_Unknown; y = 10 ^8.3 - //x/y = (10 ^_Unknown)/(10 ^8.3) = log 4 - // x/y = _Unknown – 8.3 = 0.6 - //_result = 8.9 magnitude - _result = ( log 4) + 8.3 - $/Code$ - Number + Array + - lookAtPos + buildingPos - Center the map on,and point the camera at,the position. - i - Some Old Editor Command + Returns PositionAGL of a given indexed position in a building. The index is 0-based (i.e. the first possible position would be 0. So if a building has 5 positions listed in the editor, 4 would be the highest position index usable with this command). Command will return [0,0,0] if buildingPos with given index is non-existent. + Since Arma 3 v.155.133934 if index -1 is supplied, the command will return array with all available positions. - https://community.bistudio.com/wiki/lookAtPos + https://community.bistudio.com/wiki/buildingPos - Control lookAtPos Array + Object buildingPos Number - map lookAtPos position + building buildingPos index - $Code$(findDisplay 12) lookAtPos [0,0,0];$/Code$ + $Code$_soldier setPosATL (_house1 buildingPos 2);$/Code$ + + $Code$_allpositions = nearestBuilding player buildingPos -1;$/Code$ - undefined / undefined + global / undefined + (August 2, 2006) + Notes from before the conversion: + These examples will move a unit to the 1st position specified in a buildings model, in the second example - bunker1. + $Code$this move (building buildingPos 1); + this move (bunker1 buildingPos 1);$/Code$ + In the default game buildings, the buildingPos is usually right behind a window. This can make it easy to place units in the windows of buildings, by putting the unit near a building and putting this in its init field: + $Code$this setPosATL (( nearestBuilding this) buildingPos 1);$/Code$ + The location returned by buildingPos is not reliable after the player has exited and then resumed the mission. For code that is executed immediately after the mission starts there is no problem. + If buildingPos locations are to be accessed during the mission when the player may have exited and then resumed, save the locations you require at the start of the mission and use these saved locations in your subsequent scripts. + + (January 26, 2007) + The highest index is not necessarily the highest position in a building! Check the z-value to find out the absolute height of a position. + + (February 16, 2007) + (building buildingPos 1) will return [0,0,0] if buildingPos with this index does not exist. + + (January 08, 2011) + Almost all buildings loose their building positions when they get (visually) damaged or destroyed. Some debris do still have building positions though. So it is no technical limitation. Just most damaged/destructed buildings models do not (yet?) have building positions. Keep in mind that a damaged or destroyed building is a different object instance (and model). - Nothing + Array + - lookAt + commandFSM - Control what the unit(s) is/are looking at (target or position). + Orders a unit to process command defined by FSM file (via the radio). - https://community.bistudio.com/wiki/lookAt + https://community.bistudio.com/wiki/commandFSM - Object/Array lookAt Object/Array + Object/Array commandFSM Array - unit lookAt position + unitName commandFSM [fsm name, position, target] - $Code$_someSoldier lookAt _otherSoldier$/Code$ - - $Code$[_someSoldier, _otherSoldier] lookAt markerPos "markerOne"$/Code$ + $Code$_soldierOne commandFSM ["move.fsm", position player, player]$/Code$ undefined / undefined @@ -40848,272 +42080,266 @@ - Nothing + Nothing + - magazineCargo + getPosVisual - Get array with magazines from ammo box (or any general weapon holder container). + Returns an object's rendered 3D position (z value above sea when over sea, or above ground when over land) in render time scope. Alias of visiblePosition. - https://community.bistudio.com/wiki/magazineCargo + https://community.bistudio.com/wiki/getPosVisual - magazineCargo Object + getPosVisual Object - magazineCargo box + getPosVisual object - $Code$hint str magazineCargo uniformContainer cursorTarget ;$/Code$ + $Code$_playerRenderedPos = getPosVisual player ;$/Code$ - undefined / undefined + global / undefined - Array + Array + - magazineTurretAmmo + canAdd - Returns ammo count of given type from given turret - Broken when vehicle has multiple magazines of the same type + Checks if given object can be stored in inventory of given object or any inventory container ( uniform, vest, backpack ) of given unit. - https://community.bistudio.com/wiki/magazineTurretAmmo + https://community.bistudio.com/wiki/canAdd - Object magazineTurretAmmo Array + Object canAdd String + + Object canAdd Array - vehicle magazineTurretAmmo [magazineClass, turretPath] + object canAdd item + + object canAdd [item, count] - $Code$vehicle player magazineTurretAmmo ["cls", [0]]$/Code$ + $Code$if ( player canAdd "FirstAidKit") then { + player addItem "FirstAidKit"; + } else { + hint "Not enough space"; + };$/Code$ + + $Code$if (_box canAdd "FirstAidKit") then { + _box addWeaponCargo ["FirstAidKit", 1]; + } else { + hint "Not enough space"; + };$/Code$ + + $Code$car canAdd [ currentWeapon player, 50];$/Code$ undefined / undefined + (November 29, 2015) + Can also be used on any object that has inventory, not only player inventory containers. + Where _box is B_supplyCrate_F : + $Code$// Empty + _box canAdd "FirstAidKit"; + - true + // Full + _box canAdd "FirstAidKit"; + - false + $/Code$ + + (February 11, 2017) + This can also be used as alternative to canAddItemToBackpack, canAddItemToUniform, canAddItemToVest where container might not be strictly defined.In some cases it might be a good optimisation for your code, where you also don't need to perform checks on which type of player container this is. Example: + $Code$_i = [(uniformContainer player),(vestContainer player),(backpackContainer player)] call BIS_fnc_selectRandom; + if (_i canAdd "Rangefinder") then { + _i addItemCargoGlobal ["Rangefinder",1]; + }; + $/Code$ - Number + Boolean - Boolean + - magazinesAllTurrets + clearWeaponCargo - Returns all magazines (including empty) from all vehicle turrets (including driver turret [-1]) and their ammo counts. + Remove all weapons from the given vehicle's weapon cargo space. - https://community.bistudio.com/wiki/magazinesAllTurrets + https://community.bistudio.com/wiki/clearWeaponCargo - magazinesAllTurrets Object + clearWeaponCargo Object - magazinesAllTurrets vehicle - - - $Code$_mags = magazinesAllTurrets vehicle player ;$/Code$ - - - global / undefined - - - - - Array - - - - - magazinesAmmoCargo - - - Returns an array of subarrays with the type names and ammo left of all the vehicle's cargo or container magazines. - - - https://community.bistudio.com/wiki/magazinesAmmoCargo - - - magazinesAmmoCargo Object - - - magazinesAmmoCargo vehicle + clearWeaponCargo vehicleName - $Code$magazinesAmmoCargo vehicle player ;$/Code$ - - $Code$magazinesAmmoCargo uniformContainer player ;[ - ["30Rnd_65x39_caseless_mag",30], - ["30Rnd_65x39_caseless_mag",30], - ["Chemlight_green",1] - ]$/Code$ + $Code$clearWeaponCargo _truck$/Code$ - undefined / undefined + global / local + (October 24, 2009) + Only works on clients. - Array + Nothing + - magazinesAmmo + actionKeysImages - Returns array of arrays of all vehicle's magazines and their ammo count (also works on supply boxes). When applied to a unit (soldier), the command behaves differently and will omit magazines already loaded into unit's weapons. Use magazinesAmmoFull to return all magazines. - Output format : - [[magazine1],[magazine2],[magazine3]...[magazineN]] - Magazine format : - 0: Magazine class name - 1: Magazine current ammo count + Returns a list of button images or names assigned to the given user action. A maximum of maxKeys keys is listed. You can find the action names in config class ControllerSchemes or user action names. - https://community.bistudio.com/wiki/magazinesAmmo + https://community.bistudio.com/wiki/actionKeysImages - magazinesAmmo Object + actionKeysImages String + + actionKeysImages Array - magazinesAmmo vehicle + actionKeysImages userAction + + actionKeysImages [userAction, maxKeys] - $Code$_magazinesAmmo = magazinesAmmo player ; - /* - [ - ["30Rnd_65x39_caseless_mag",30], - ["30Rnd_65x39_caseless_mag",30], - ["16Rnd_9x21_Mag",16], - ["SmokeShellGreen",1], - ["Chemlight_green",1], - ["HandGrenade",1] - ] - */$/Code$ + $Code$_text = actionKeysImages "ReloadMagazine"$/Code$ - $Code$_magazinesAmmo = magazinesAmmo Mi_48; - /* - [ - ["250Rnd_30mm_APDS_shells",250], - ["250Rnd_30mm_HE_shells",250], - ["8Rnd_LG_scalpel",8], - ["38Rnd_80mm_rockets",38] - ] - */$/Code$ + $Code$_reload = actionKeysImages ["ReloadMagazine",1] will return "R" (incl. the quotation marks!)$/Code$ undefined / undefined - (December 20, 2014) - When used on vehicles this will only return all magazines associated with a single turretPath (which one depends on the actual armament of the vehicle, usually the first armed turretPath or alternatively turretPath [-1]). - If you want to get all turrets' magazines, use allTurrets and magazinesTurret. - -- Actium ( talk ) 15:41, 20 December 2014 (CET) - Array + Structured_Text - Structured_Text + - magazinesAmmoFull + moveInTurret - Returns array of arrays of all vehicle's magazines with extended information about them. - Output format : - [[magazine1],[magazine2],[magazine3]...[magazineN]] - Magazine format : - 0: Magazine class name - 1: Magazine current ammo count - 2: Magazine state (true - loaded, false - not loaded) - 3: Magazine type (-1 - n/a, 0 - grenade, 1 - primary weapon mag, 2 - handgun mag, 4 - secondary weapon mag, 65536 - vehicle mag) - 4: Magazine location ("Vest", "Uniform", "Backpack", "") or corresponding currentMuzzle + Moves the soldier into the vehicle's turret. (Immediately, without animation). turret path is an array of positions inside a turret, or positions inside a turret of a turret. + [0] means first turret. + [0,0] means first turret of first turret. + [0,1] means second turret of first turret. + [1] means second turret. + [1,0] means first turret of the second turret. + [2,0] means first turret of third turret. + And so on... - https://community.bistudio.com/wiki/magazinesAmmoFull + https://community.bistudio.com/wiki/moveInTurret - magazinesAmmoFull Object + Object moveInTurret Array - magazinesAmmoFull vehicle + unitName moveInTurret [vehicle, turretPath] - $Code$_magazinesAmmoFull = magazinesAmmoFull player ; - /* - [ - ["30Rnd_65x39_caseless_mag",30,false,-1,"Uniform"], - ["30Rnd_65x39_caseless_mag",30,false,-1,"Vest"], - ["16Rnd_9x21_Mag",16,false,-1,"Vest"], - ["SmokeShellGreen",1,true,0,"SmokeShellGreenMuzzle"], - ["Chemlight_green",1,true,0,"ChemlightGreenMuzzle"], - ["HandGrenade",1,true,0,"HandGrenadeMuzzle"], - ["30Rnd_65x39_caseless_mag",30,true,1,"arifle_MX_ACO_pointer_F"], - ["16Rnd_9x21_Mag",16,true,2,"hgun_P07_F"] - ] - */$/Code$ - - $Code$_magazinesAmmoFull = magazinesAmmoFull Mi_48; - /* - [ - ["250Rnd_30mm_APDS_shells",250,false,-1,""], - ["250Rnd_30mm_HE_shells",250,true,65536,"gatling_30mm"], - ["8Rnd_LG_scalpel",8,true,65536,"missiles_SCALPEL"], - ["38Rnd_80mm_rockets",38,true,65536,"rockets_Skyfire"] - ] - */$/Code$ + $Code$_soldierOne moveInTurret [_tank, [0, 0]]$/Code$ - undefined / undefined + local / global - (December 20, 2014) - When used on vehicles this will only return all magazines associated with a single turretPath (which one depends on the actual armament of the vehicle, usually the first armed turretPath or alternatively turretPath [-1]). - If you want to get all turrets' magazines, use allTurrets and magazinesTurret. - -- Actium ( talk ) 15:40, 20 December 2014 (CET) + (March 6, 2008) + To find out which turrets are available on a vehicle, and what the syntax is, you can use this little script. - (February 10, 2015) - As Actium said, this function seems to extract data from: - configfile "CfgVehicles" _the_vehicle_you_want "Turrets" "MainTurret" "magazines". - Some vehicles return an empty field {} because magazines are in straight in: - configfile "CfgVehicles" _the_vehicle_you_want "magazines" (often dedicated to flares only). - This is the case of WY-55 Hellcat. This function returns an empty array. + (February 13, 2014) + Examples for nested turrets: + MainTurret = $Code$_soldierOne moveInTurret [_tank, [0]] $/Code$ + CommanderTurret = $Code$_soldierOne moveInTurret [_tank, [0, 0]] $/Code$ + ... where: + MainTurret is the standard BIS MainTurret... e.g: + $Code$class Turrets + { + class MainTurret {}; + };$/Code$ + CommanderTurret is the standard BIS CommanderTurret located on the MainTurret... e.g: + $Code$class Turrets + { + class MainTurret + { + class Turrets + { + class CommanderTurret {}; + }; + }; + };$/Code$ + + (March 18, 2014) + Here is a small function to find available turret paths for a given vehicle. It will only search 2 levels deep, hence called commonTurrets : + $Code$KK_fnc_commonTurrets = { + private ["_arr","_trts"]; + _arr = []; + _trts = configFile / "CfgVehicles" / typeOf _this / "Turrets"; + for "_i" from 0 to count _trts - 1 do { + _arr set [ count _arr, [_i]]; + for "_j" from 0 to count ( + _trts / configName (_trts select _i) / "Turrets" + ) - 1 do { + _arr set [ count _arr, [_i, _j]]; + }; + }; + _arr + };$/Code$ + Example call: + $Code$ hint str ( vehicle player call KK_fnc_commonTurrets); //[[0],[0,0]]$/Code$ + See also allTurrets - Array + Nothing + - magazinesDetailBackpack + shownChat - Returns an array with the type names of all the unit's backpack magazines. + Returns true if chat window is enabled. Chat window can be disabled with showChat command. - https://community.bistudio.com/wiki/magazinesDetailBackpack + https://community.bistudio.com/wiki/shownChat - magazinesDetailBackpack Object + shownChat - magazinesDetailBackpack unit + shownChat - $Code$magazinesDetailBackpack player$/Code$ + $Code$_bool = shownChat ;$/Code$ undefined / undefined @@ -41121,27 +42347,30 @@ - Array + Boolean + - magazinesDetailUniform + groupIconsVisible - Returns an array with the type names of all the unit's uniform magazines. + Return group icons are visible. - https://community.bistudio.com/wiki/magazinesDetailUniform + https://community.bistudio.com/wiki/groupIconsVisible - magazinesDetailUniform Object + groupIconsVisible - magazinesDetailUniform unit + groupIconsVisible - $Code$magazinesDetailUniform player$/Code$ + $Code$// HC bar active + if (isNil "BIS_HC_visible") then {BIS_HC_visible = groupIconsVisible}; + setGroupIconsVisible [true,true];$/Code$ undefined / undefined @@ -41149,291 +42378,319 @@ - Array + Array + - magazinesDetailVest + setPos - Returns an array with the type names of all the unit's vest magazines. + Sets object position. - https://community.bistudio.com/wiki/magazinesDetailVest + https://community.bistudio.com/wiki/setPos - magazinesDetailVest Object + Object setPos Array - magazinesDetailVest unit + object setPos pos - $Code$magazinesDetailVest player$/Code$ + $Code$player setPos [ getPos player select 0, getPos player select 1, ( getPos player select 2) +10]; + //the same as above using modelToWorld : + player setPos ( player modelToWorld [0,0,10]); + //the same as above using vectorAdd : + player setPos ( getPos player vectorAdd [0,0,10]);$/Code$ + + $Code$_obj setPos [ getPos _obj select 0, getPos _obj select 1, -5];$/Code$ + + $Code$player setPos ( getPos _obj);$/Code$ - undefined / undefined + global / global + (6 Feb, 2011) + Calling setPos on an object can cause the object's orientation to change. This depends on the terrain and/or objects below the object. This was tested by calling setPos on a test object with the position of a helicopter ( modelToWorld with some offset). When flying over land the orientation of the test object would rapidly change depending on the slope of the ground and objects beneath it. + Comment applicable to Ver 1.96 and earlier : + obj1 setPos [x,y,z] + Will place most objects z metres above ground level (negative numbers for underground). But if obj1 is a trigger then it will be placed z metres above sea level. This can be very useful if you want to check a unit's height above sea level but it can be a problem if you want to move a trigger to create an explosion or a sound. To move a trigger to a location at ground level: + $Code$triggername setPos [x,y,0]; + triggername setPos [x,y, abs ( getPos triggername select 2)];$/Code$ + Note for Armed Assault: Using setPos for a trigger will work in exactly the same way that setPos works for other objects - namely that setPos [x,y,z] will place the trigger z metres above ground level. + SetPos for static objects like a ammo crate do not work in MP. + + (23 Nov, 2011) + You can use getPos and setPos on triggers. - Array + Nothing + - magazinesDetail + get3DENMissionAttribute - Returns an array of strings with description of all vehicle's magazines, their ammo count (current/default) and their ids. - When applied to a unit (soldier), the command behaves differently and will omit magazines already loaded into unit's weapons. Use currentMagazineDetail to get this information for a currently loaded magazine. + Return value of scenario attribute. + ! + Attributes are available only within the Eden Editor workspace. You cannot access them in scenario preview or exported scenario! - https://community.bistudio.com/wiki/magazinesDetail + https://community.bistudio.com/wiki/get3DENMissionAttribute - magazinesDetail Object + String get3DENMissionAttribute String - magazinesDetail vehicle + section get3DENMissionAttribute class - $Code$_magazinesDetail = magazinesDetail player ; - /* - [ - "6.5mm 30Rnd STANAG Mag(30/30)[id:3]", - "6.5mm 30Rnd STANAG Mag(30/30)[id:9]", - "9mm 16Rnd Mag(16/16)[id:12]", - "Smoke Grenade (Green)(1/1)[id:14]", - "Chemlight (Green)(1/1)[id:16]", - "RGO Frag Grenade(1/1)[id:18]" - ] - */$/Code$ - - $Code$_magazinesDetail = magazinesDetail Mi_48; - /* - [ - "30mm APDS shells(250/250)[id:20]", - "30mm HE Shells(250/250)[id:21]", - "Scalpel E2(8/8)[id:22]", - "Skyfire(38/38)[id:23]" - ] - */$/Code$ + $Code$systemChat str ("Multiplayer" get3DENMissionAttribute "respawn");$/Code$ undefined / undefined + (February 26, 2016) + The class names of the vanilla sections are: + General + Scenario + Environment + Intel + Multiplayer + Multiplayer + Garbage Collection + GarbageCollection + Preferences + Preferences - Array + Anything + - magazinesTurret + UAVControl - Returns all magazines of given turret. Use turret path [-1] for driver's turret. Alternatively, use magazinesAllTurrets + Returns array with current operator of UAV and his vehicle role in UAV. - https://community.bistudio.com/wiki/magazinesTurret + https://community.bistudio.com/wiki/UAVControl - Object magazinesTurret Array + UAVControl Object - vehicle magazinesTurret turretPath + UAVControl uav - $Code$_mags = vehicle player magazinesTurret [0, 0];$/Code$ - - $Code$_mags = _tank magazinesTurret [0];$/Code$ + $Code$UAVControl uav;$/Code$ - global / undefined + undefined / undefined - Array + Array + - magazines + getAllSoundControllers - Returns array of type names of all vehicle's magazines. - When applied to a unit (soldier), the command behaves differently and will omit magazines already loaded into unit's weapons. Use currentMagazine to get this information for a currently loaded magazine. + Returns an array containing names and values of the sound controllers that can be used in simple expressions when configuring sounds. - https://community.bistudio.com/wiki/magazines + https://community.bistudio.com/wiki/getAllSoundControllers - magazines Object + getAllSoundControllers Object - magazines vehicle + getAllSoundControllers vehicle - $Code$_mags = magazines player$/Code$ + $Code$getAllSoundControllers vehicle player ; + // Result: [["rpm",0],["randomizer",0.874332],["speed",0],["thrust",0],...]]$/Code$ undefined / undefined - In OFP v1.96, if a weapon is loaded with an empty magazine, that magazine will still be counted by this command. The ammo command can be used to check if a unit has any ammunition into it's last magazine. - - (25 November 2011) - This command does not include non-turret weapon magazines, such as smoke, flare or chaff magazines which are usually declared in the root of the vehicle's class, rather than in the Turrets hierarchy. - Array + Array + - mapAnimAdd + setLightColor - Add next frame to map animation. + Set diffuse color of light. Illuminates surfaces that are facing the light. - https://community.bistudio.com/wiki/mapAnimAdd + https://community.bistudio.com/wiki/setLightColor - mapAnimAdd Array + Object setLightColor Array - mapAnimAdd [time, zoom, position] + light setLightColor [r, g, b] - $Code$mapAnimAdd [1, 0.1, markerPos "anim1"]; - mapAnimCommit ;$/Code$ - - $Code$mapAnimAdd [3, 0.01, player ]; - mapAnimCommit ;$/Code$ + $Code$myLight setLightColor [0.5,0,0]; //produces red$/Code$ local / local - (05:26, 2 February 2007) - In OFP v1.96, the mapAnim series of commands, together with forceMap can only be used in the intro and mission, as it is not possible to access the map from the outro. (not checked, sourced from an old copy of the OFPEC comref) + (Dec 1, 2006) + Light can be created with command createVehicleLocal with special vehicle class "#lightpoint" + for example: + $Code$_light = "#lightpoint" createVehicleLocal pos; + _light setLightBrightness 1.0; + _light setLightAmbient [0.0, 1.0, 0.0]; + _light setLightColor [0.0, 1.0, 0.0]; + _light lightAttachObject [_object, [0,0,0]]; + $/Code$ + + (Aug 17, 2007) + To clarify: + setLightAmbient - Terrain and surrounding objects are bathed in this colour. + setLightColor - Controls the "haze" seen around the lightsource (ex flares). + + (Mar 24, 2014) + 1. In ArmA3 ver 1.14 setLightColor will also change the color of the flare when setLightUseFlare, setLightFlareSize and setLightFlareMaxDistance were used on the same light source. For example: + $Code$ + _light setLightUseFlare true; + _light setLightFlareSize 2; + _light setLightFlareMaxDistance 60; + _light setLightColor [1, 1, 1]; + $/Code$ + 2. When both setLightAmbient and setLightColor were [0,0,0], there won’t be any visual presentation on the light source. - Nothing + Nothing + - mapAnimClear + debugLog - Clear map animation. + Dump argument type and value to debugging output. + This command is non-functional in the retail version - https://community.bistudio.com/wiki/mapAnimClear + https://community.bistudio.com/wiki/debugLog - mapAnimClear + debugLog Any_Value - mapAnimClear + debugLog anything - + $Code$debugLog player$/Code$ + - local / local + undefined / undefined - In OFP v1.96, the mapAnim series of commands, together with forceMap can only be used in the intro and mission, as it is not possible to access the map from the outro. (not checked, sourced from an old copy of the OFPEC comref) - Nothing + Nothing + - mapAnimCommit + menuEnabled - Play map animation. + Returns if menu entry on given path is enabled or not. - https://community.bistudio.com/wiki/mapAnimCommit + https://community.bistudio.com/wiki/menuEnabled - mapAnimCommit + menuEnabled Array - mapAnimCommit + menuEnabled [idc, path] - local / local + undefined / undefined - In OFP v1.96, the mapAnim series of commands, together with forceMap can only be used in the intro and mission, as it is not possible to access the map from the outro. (not checked, sourced from an old copy of the OFPEC comref) - Nothing + Boolean + - mapAnimDone + countUnknown - Check if map animation is finished. + Count how many units in the array are unknown to the given unit. - https://community.bistudio.com/wiki/mapAnimDone + https://community.bistudio.com/wiki/countUnknown - mapAnimDone + Object countUnknown Array - mapAnimDone + unitName countUnknown arrayName - + $Code$_num = player countUnknown list _triggerOne;$/Code$ + - local / local + global / undefined - In OFP v1.96, the mapAnim series of commands, together with forceMap can only be used in the intro and mission, as it is not possible to access the map from the outro. (not checked, sourced from an old copy of the OFPEC comref) - Boolean + Number + - mapCenterOnCamera + visibleWatch - control mapCenterOnCamera boolean syntax enables/disables continuous centering of the main map type control on the camera position. Needs to be executed once. - mapCenterOnCamera control syntax centers mini map type control on camera. The command returns world position of the camera. Needs to be executed each frame (preferably inside onDraw EH). + Checks if the player has watch opened and visible - https://community.bistudio.com/wiki/mapCenterOnCamera + https://community.bistudio.com/wiki/visibleWatch - Control mapCenterOnCamera Boolean - - mapCenterOnCamera Control + visibleWatch - mainmap mapCenterOnCamera enable - - mapCenterOnCamera minimap + visibleWatch - $Code$//--- Minimap update - (( uiNamespace getVariable "BIS_UAV_DISPLAY") displayCtrl 112410) mapCenterOnCamera true ;$/Code$ + $Code$if ( visibleWatch ) then { hint "Watch is visible"};$/Code$ undefined / undefined @@ -41441,29 +42698,30 @@ - Nothing - Array + Boolean + - mapGridPosition + exec - Returns the map grid position of an object or position. The format is determined by the Grid format specified in the CfgWorlds for the current world. Eg: "024577" or "De82" or similar. + Execute a script using (the deprecated but still available).sqs syntax. The argument is passed to the script in the "_this" variable, and magic variable "_time" within the script contains the time in seconds that the script has been running. + Alternatively use execVM command in combination with.sqf syntax. + Learn more about scripts under Scripts. - https://community.bistudio.com/wiki/mapGridPosition + https://community.bistudio.com/wiki/exec - mapGridPosition Object/Position + Any_Value exec String - mapGridPosition param + argument exec script - $Code$_gridPos = mapGridPosition player$/Code$ - - $Code$_gridPos = mapGridPosition getPos player$/Code$ + $Code$[player, _jeep] exec "getin.sqs"$/Code$ undefined / undefined @@ -41471,28 +42729,28 @@ - String + Nothing + - markAsFinishedOnSteam + getWeaponSway - Marks current mission as finished on Steam. Returns true if Steam query is successfully started or false otherwise. + Returns current size of weapon sway of a given unit, in radians - https://community.bistudio.com/wiki/markAsFinishedOnSteam + https://community.bistudio.com/wiki/getWeaponSway - markAsFinishedOnSteam + getWeaponSway Object - markAsFinishedOnSteam + getWeaponSway unit - $Code$markAsFinishedOnSteam ; - endMission "END1";$/Code$ + $Code$_sway = getWeaponSway player ;$/Code$ undefined / undefined @@ -41500,55 +42758,166 @@ - Boolean + Number + - markerAlpha + private - Gets the marker alpha. See setMarkerAlpha. + Sets a variable to the innermost scope as demonstrated in Example 3. One other command that is capable of creating private variables is params. + Since Arma 3 v1.53.132932 private can be used as keyword as shown in Example 4. - https://community.bistudio.com/wiki/markerAlpha + https://community.bistudio.com/wiki/private - markerAlpha String + private String + + private Array - markerAlpha markerName + private variableName + + private variableNameList - $Code$AlphaMarker = markerAlpha "myMarker;$/Code$ + $Code$private "_varname";$/Code$ + + $Code$private ["_varname1", "_varname2"];$/Code$ + + $Code$_myvar = 123; + systemChat str [_myvar]; // -- [123] + call { + systemChat str [_myvar]; // -- [123] + private "_myvar"; + systemChat str [_myvar]; // -- [any] + _myvar = 345; + systemChat str [_myvar]; // -- [345] + }; + systemChat str [_myvar]; // -- [123]$/Code$ + + $Code$// Usage of private as keyword: + private _myvar = 123; + //is the same as + private "_myvar"; + _myvar = 123;$/Code$ + + $Code$_lol = 123; call { hint str [_lol]}; // [123] + _lol = 123; call { private "_lol"; hint str [_lol]}; // [any]$/Code$ - global / undefined + undefined / undefined - - - Number - - - - - markerBrush - - - Gets the marker brush. See setMarkerBrush. - - - https://community.bistudio.com/wiki/markerBrush + (Sep 24, 2009 15:04) + The example provided is fairly worthless without a context. + Using the private command allows you to declare a variable in the current scope, without regards to variables in a higher scope with the same name. Note that if you try to declare a variable without an underscore (meaning it's global) with the private command, it will cause an error. Specifically: "Error Local variable in global space". + Here's a code example with output for your benefit. + $Code$ + _foo = 10; + if (true) then + { + private ["_foo"]; + _foo = 5; + player sideChat format ["%1", _foo]; + }; + player sideChat format ["%1", _foo]; + $/Code$ + In this example, the first sidechat (innermost) returns 5 while the second sidechat (outermost) returns 10. + $Code$ + if (true) then + { + private ["_bar"]; + _bar = 5; + player sideChat format ["%1", _bar]; + }; + $/Code$ + In this example, the private command does nothing and is simply a waste of code, assuming there is no higher level code to interfere with the if statement. + + (August 4, 2010) + The higher scope is also the script from which the function has been called. + If you've got in the script: + $Code$ + _a = 1; + call compile loadFile "function.sqf"; + hint format ["%1", _a]; + $/Code$ + And in the function.sqf : + $Code$ + _a = 2; + $/Code$ + Game will display 2. + Inserting private "_a" in the function prevents the change and so number 1 will be displayed on the screen. + + (February 25, 2015) + Recursive loops require the use of private. Without it, your variables will be overwritten. + + (January 31, 2018) + More examples! + $Code$ if ( true ) then { //new scope + _localVar = "some string"; + systemChat _localVar; // = "some string" + }; + systemChat _localVar; // = ERROR _localVar doesn't exist in the outer Scope + $/Code$ + $Code$_localVar = "bla"; + if ( true ) then { //new scope + _localVar = "some string"; + systemChat _localVar; // = "some string" + }; + systemChat _localVar; // = "some string" + $/Code$ + $Code$_localVar = "bla"; + if ( true ) then { + private _localVar = "some string"; + systemChat _localVar; // = "some string" + }; + systemChat _localVar; // = "bla" + $/Code$ + $Code$_localVar = "bla"; + if ( true ) then { //new scope + private _localVar = "some string"; + if ( true ) then { //new scope + private _localVar = "some other string"; + systemChat _localVar; // = "some other string" + }; + systemChat _localVar; // = "some string" + }; + systemChat _localVar; // = "bla" + $/Code$ + + (January 31, 2018) + This command has the same functionality as javascript's let keyword. + https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/let + + + Nothing - Nothing + + + + + + savingEnabled + + + Check if saving the game is enabled. + + + https://community.bistudio.com/wiki/savingEnabled - markerBrush String + savingEnabled - markerBrush name + savingEnabled - $Code$if ( markerBrush "Marker1" == "Solid") then { hint "Marker1 is solid!"}$/Code$ + $Code$if ( savingEnabled ) then { + hint "Saving is enabled!"; + };$/Code$ undefined / undefined @@ -41556,232 +42925,276 @@ - String + Boolean + - markerColor + lnbSetColumnsPos - Returns marker color for given marker. See setMarkerColor. Note: This function is identical to getMarkerColor. + Sets relative screen X for ListNBox control columns positions. Setter for lnbGetColumnsPosition - https://community.bistudio.com/wiki/markerColor + https://community.bistudio.com/wiki/lnbSetColumnsPos - markerColor String + lnbSetColumnsPos Array + + Control lnbSetColumnsPos Array - markerColor markerName + lnbSetColumnsPos [idc, positions] + + ctrl lnbSetColumnsPos positions - $Code$if ( markerColor "Marker1" == "ColorRed") then { hint "Marker1 is red!"}$/Code$ + $Code$lnbSetColumnsPos [101, [0.1,0.5,0.7]];$/Code$ + + $Code$_ctrl lnbSetColumnsPos [0.1,0.5,0.7];$/Code$ undefined / undefined + (Sep 9 2014) + See: List Box#LISTNBOX - String + Nothing - Nothing + - markerDir + isEqualTo - Get marker direction. + Performs strict comparison between var1 and var2 and returns true if equal, otherwise false. Strict means that it would check that both arguments are of the same data type and then compare the values. + Some differences between isEqualTo and == : + It performs case sensitive comparison on Strings + It doesn't throw error when comparing different types, i.e. ("eleven" isEqualTo 11) + It can compare Arrays, Scripts and Booleans ( alive player isEqualTo true ) + It can compare non-existent game objects ( grpNull isEqualTo grpNull ) + It can compare Namespaces ( As of Arma 3 v1.47 ) + It is slightly faster than ==, especially when comparing Strings - https://community.bistudio.com/wiki/markerDir + https://community.bistudio.com/wiki/isEqualTo - markerDir String + Anything isEqualTo Anything - markerDir markerName + val1 isEqualTo val2 - $Code$_mPos = markerDir "markerOne"$/Code$ + $Code$_arr1 = [1,[2,[3]]]; + _arr2 = [1,[2,[3]]]; + if (_arr1 isEqualTo _arr2) then { hint "Arrays match!"}$/Code$ + + $Code$if (a isEqualTo b) then { hint "a is equal to b"}; + if !(a isEqualTo b) then { hint "a is not equal to b"};$/Code$ - global / undefined + undefined / undefined - (April 18, 2010) - The direction of the marker is the same as displayed in the editor, so it can both be negative, and be 360 degrees or greater. + (July 19, 2014) + The behavior of "var1 isEqualTo var2" is pretty much equivalent to "var1 in [var2]", plus the ability to compare arrays, and slightly better performance. + + (December 3, 2014) + Simply put, "isEqualTo" is a binary comparison. Therefor it is very fast but only accepts 100% identical matches. In some other languages this is known as "===" instead of "==". + + (November 3, 2016) + When comparing with nil result is Nothing. + "nil isEqualTo player" returns "Nothing" instead of expected "false" + $Code$diag_log [nil isEqualTo player];$/Code$ + Will print "[bool]" + $Code$diag_log (str (nil isEqualTo player)) + "test";$/Code$ + Will throw Generic error in expression + "+: Type Nothing, expected Number,Array,String,Not a Number" - Number + Boolean + - markerPos + setWaypointDescription - Get marker Position. Note: This function is identical to getMarkerPos. + Sets the description shown in the HUD while the waypoint is active. - https://community.bistudio.com/wiki/markerPos + https://community.bistudio.com/wiki/setWaypointDescription - markerPos String + Array setWaypointDescription String - markerPos markerName + waypoint setWaypointDescription text - $Code$_mPos = markerPos "markerOne";$/Code$ + $Code$[_grp, 2] setWaypointDescription "Move here.";$/Code$ - global / undefined + undefined / undefined - (March 17, 2014) - Position's Z coordinate will always be 0." - Array + Nothing + - markerShape + secondaryWeaponItems - Gets the marker shape. See setMarkerShape for a list of strings that can be returned. + Returns array with all items assigned to the secondary weapon. This command is used for infantry weapons only. - https://community.bistudio.com/wiki/markerShape + https://community.bistudio.com/wiki/secondaryWeaponItems - markerShape String + secondaryWeaponItems Object - markerShape name + secondaryWeaponItems unit - $Code$if ( markerShape "Marker1" == "RECTANGLE") then { hint "Marker1 is a rectangle!"}$/Code$ + $Code$secondaryWeaponItems player ; //["","","",""]$/Code$ - global / undefined + undefined / undefined - (May 30, 2016) - Free hand drawn markers return "POLYLINE" - String + Array + - markerSize + timeMultiplier - Returns marker size. This command is identical to getMarkerSize. + Returns the value set with setTimeMultiplier. - https://community.bistudio.com/wiki/markerSize + https://community.bistudio.com/wiki/timeMultiplier - markerSize String + timeMultiplier - markerSize markerName + timeMultiplier - $Code$_mSize = markerSize "Marker1";$/Code$ + $Code$_multiplier = timeMultiplier ;$/Code$ - global / undefined + undefined / undefined - Array + Number + - markerText + vectorAdd - Get marker text. + Adds two 3D vectors. - https://community.bistudio.com/wiki/markerText + https://community.bistudio.com/wiki/vectorAdd - markerText String + Array vectorAdd Array - markerText markerName + vector1 vectorAdd vector2 - $Code$hint format ["Marker Text: %1", markerText "Marker1"];$/Code$ + $Code$hint str ( velocity unit1 vectorAdd velocity unit2);$/Code$ + + $Code$[5,10,5] vectorAdd [5,5,10]; //returns [10,15,15]$/Code$ - global / undefined + undefined / undefined + (28 Jun, 2014) + (ArmA3 1.22)Algorithm: + $Code$ + Vector1 = [x1,y1,z1]; Vector2 = [x2,y2,z2]; + Result = [x1 + x2,y1 + y2,z1 + z2;] + $/Code$ + It is recommended to use vectorAdd instead of BIS_fnc_vectorAdd. - String + Array + - markerType + ASLToAGL - Get type of marker. Note: This function is identical to getMarkerType. See cfgMarkers for a list of standard markers. + Converts position from PositionASL to PositionAGL - https://community.bistudio.com/wiki/markerType + https://community.bistudio.com/wiki/ASLToAGL - markerType String + ASLToAGL PositionASL - markerType markerName + ASLToAGL posASL - $Code$if ( markerType "Marker1" == "Empty") then { hint "Marker1 is not an icon!"}$/Code$ + $Code$_playerPosAGL = ASLToAGL getPosASL player ;$/Code$ - global / undefined + undefined / undefined - (March 17, 2014) - Using markerType is a good method to determine if a string is a valid marker name, unless the marker type isn't set. $Code$if (markerType "mark1" != "") then {hint "valid marker"}$/Code$ - String + PositionAGL + - max + kbAddDatabaseTargets - The greater of a,b + Register target list knowledge base database to given person. See Conversations for more details. + This function is no longer available in ArmA 2. + This function is no longer available in Arma 3. - https://community.bistudio.com/wiki/max + https://community.bistudio.com/wiki/kbAddDatabaseTargets - Number max Number + Object kbAddDatabaseTargets String - a max b + person kbAddDatabaseTargets fileName - $Code$3 max 2 - // Result is 3$/Code$ + $Code$_hasBeenAdded = _unit kbAddDatabaseTargets "chat.txt"$/Code$ undefined / undefined @@ -41789,322 +43202,390 @@ - Number + Boolean + - members + setWaves - Return a list of members in given team. + Changes the waves value smoothly during the given time (in seconds). A time of zero means there will be an immediate change. + NOTE : This command will have no effect (even though the value of waves changes) unless Manual Override option is selected in the editor in the Intel, which is normally off. - https://community.bistudio.com/wiki/members + https://community.bistudio.com/wiki/setWaves - members Team_Member + Number setWaves Number - members team + time setWaves value - $Code$_members = members _team$/Code$ + $Code$180 setWaves.5;$/Code$ + + $Code$0 setWaves 1;$/Code$ - undefined / undefined + undefined / local - Array + Nothing + - menuAction + preloadSound - Returns action stored in item on given path. + Makes sure that a sound can start playing without any delay once it is needed. Command works in Arma 3, but might not be implemented in earlier Arma installments. - https://community.bistudio.com/wiki/menuAction + https://community.bistudio.com/wiki/preloadSound - menuAction Array + preloadSound String - menuAction [idc, path] + preloadSound soundName - + $Code${ + waitUntil { preloadSound _x}; + } forEach getArray ( missionConfigFile "CfgSounds" "sounds");$/Code$ + undefined / undefined - String + Boolean + - menuAdd + setRadioMsg - Adds new submenu entry into item on given path. + Sets radio trigger menu title text (0 - 0 - map radio). Use "NULL" to disable radio slot. Use "" to restore default title - https://community.bistudio.com/wiki/menuAdd + https://community.bistudio.com/wiki/setRadioMsg - menuAdd Array + Number setRadioMsg String - menuAdd [idc, path, text] + index setRadioMsg text - + $Code$1 setRadioMsg "Click meeeeeeeeee"; //changes title of radio Alpha$/Code$ + - undefined / undefined + undefined / local - Number + Nothing + - menuChecked + saveOverlay - Returns if item on given path is checked or not. + Save the current overlay. + i + Some Old Editor Command - https://community.bistudio.com/wiki/menuChecked + https://community.bistudio.com/wiki/saveOverlay - menuChecked Array + saveOverlay Control - menuChecked [idc, path] + saveOverlay map - + $Code$saveOverlay _map$/Code$ + undefined / undefined - Boolean + Nothing + - menuClear + systemOfUnits - Removes all entries from given menu strip. + Returns the currently selected system of units. + 0: Metric + 1: Mixed (ground vehicles use Metric / air vehicles use Imperial) + 2: Imperial - https://community.bistudio.com/wiki/menuClear + https://community.bistudio.com/wiki/systemOfUnits - menuClear Number + systemOfUnits - menuClear idc + systemOfUnits - + $Code$_system = systemOfUnits;$/Code$ + undefined / undefined - Nothing + Number + - menuCollapse + weaponDirection - Collapses item on given path and all its childs. + Returns the direction that the vehicle weapon is aiming in. + For addons the weapon name must be an entry in CfgWeapons. + Returns an array in format [x, y, z] - https://community.bistudio.com/wiki/menuCollapse + https://community.bistudio.com/wiki/weaponDirection - menuCollapse Array + Object weaponDirection String - menuCollapse [idc, path] + vehicleName weaponDirection weaponName - + $Code$_weaponVectorDir = player weaponDirection currentWeapon player ;$/Code$ + + $Code$// Draw AI eye direction (green) and weapon direction (red) in 3D: + bob = createGroup east createUnit ["O_Soldier_F", [0,0,0], [], 0, "NONE"]; + bob setVehiclePosition [ player modelToWorld [0,100,0], [], 0, "NONE"]; + onEachFrame + { + _beg = ASLToAGL eyePos bob; + _endE = (_beg vectorAdd ( eyeDirection bob vectorMultiply 100)); + drawLine3D [ _beg, _endE, [0,1,0,1]]; + _endW = (_beg vectorAdd (bob weaponDirection currentWeapon bob vectorMultiply 100)); + drawLine3D [_beg, _endW, [1,0,0,1]]; + };$/Code$ + - undefined / undefined + global / undefined + (August 18, 2007) + Works great in multiplayer. + The numbers are representing offset as follows : [X axis,Y axis,Z axis] + The return array can be processed-converted into degrees as follows: + $Code$_array = _this weaponDirection "weapon class" ; + _dir_degrees = (_array select 0) atan2 (_array select 1);$/Code$ + + (November 11, 2007) + WeaponClass can only be the primary turret of the vehicle. For example it is not possible to get direction of commander's M2 on M1Abrams. + + (November 13, 2007) + For an alternative to the weaponDirection command, see the following post on the offical forums. On how to obtain the direction of multiple turrets on vehicles. + Turret Animations - new forum + + (December 9, 2014) + The suggestion above using atan2 and weaponDirection get the direction the barrel of a weapon is pointing, but this is not the same as the direction a shell will be fired (verify this by getting in an M4 Scorcher, parking it on a slope, elevating the barrel "across" the slope and watching the shell come out in third person). - Nothing + Array + - menuData + markAsFinishedOnSteam - Returns data stored in menu entry on given path. + Marks current mission as finished on Steam. Returns true if Steam query is successfully started or false otherwise. - https://community.bistudio.com/wiki/menuData + https://community.bistudio.com/wiki/markAsFinishedOnSteam - menuData Array + markAsFinishedOnSteam - menuData [idc, path] + markAsFinishedOnSteam - + $Code$markAsFinishedOnSteam ; + endMission "END1";$/Code$ + undefined / undefined - String + Boolean + - menuDelete + getFuelCargo - Deletes menu entry on given path. + Returns the fuel amount (between 0 and 1) in the cargo space of a refuelling vehicle. - https://community.bistudio.com/wiki/menuDelete + https://community.bistudio.com/wiki/getFuelCargo - menuDelete Array + getFuelCargo Object - menuDelete [idc, path, text] + getFuelCargo vehicle - + $Code$value = getFuelCargo myVehicleName;$/Code$ + - undefined / undefined + global / undefined + (December 22, 2014) + If the vehicle is not alive, it always returns Nothing, which you should check for using isNil. + If the vehicle is unable to carry that type of cargo, it returns -1.#IND, which you should check for using finite. - Number + Number + - menuEnabled + morale - Returns if menu entry on given path is enabled or not. + Checks a current morale level of the unit (-1..+1). - https://community.bistudio.com/wiki/menuEnabled + https://community.bistudio.com/wiki/morale - menuEnabled Array + morale Object - menuEnabled [idc, path] + morale unit - + $Code$morale ( leader player );//result is 0.5$/Code$ + undefined / undefined - Boolean + Number + - menuEnable + ctClear - Enables disabled menu entry on given path. + Removes all the lines from the RscControlsTable. Returns Nothing. - https://community.bistudio.com/wiki/menuEnable + https://community.bistudio.com/wiki/ctClear - menuEnable Array + ctClear Control - menuEnable [idc, path] + ctClear ctrl - + $Code$ctClear _control;$/Code$ + - undefined / undefined + local / local - Nothing + Nothing + - menuExpand + formationTask - Expands given menu entry on given path and all its parents so entry is visible. + Return the current task of the unit in the formation. + You can't use it in ArmA 2, it will always returns "NOTHING" - https://community.bistudio.com/wiki/menuExpand + https://community.bistudio.com/wiki/formationTask - menuExpand Array + formationTask Object - menuExpand [idc, path] + formationTask person - + $Code$_CurrentTask = FormationTask _person$/Code$ + undefined / undefined - Nothing + String + - menuHover + textLogFormat - Returns path to menu entry mouse is currently hovering over. + Debugging output. + This command is non-functional in the retail version - https://community.bistudio.com/wiki/menuHover + https://community.bistudio.com/wiki/textLogFormat - menuHover Number + textLogFormat Array - menuHover idc + textLogFormat [format, arg1, arg2,] @@ -42114,439 +43595,595 @@ - Array + Nothing + - menuPicture + magazinesDetail - Returns picture set into item on given path + Returns an array of strings with description of all vehicle's magazines, their ammo count (current/default) and their ids. + When applied to a unit (soldier), the command behaves differently and will omit magazines already loaded into unit's weapons. Use currentMagazineDetail to get this information for a currently loaded magazine. - https://community.bistudio.com/wiki/menuPicture + https://community.bistudio.com/wiki/magazinesDetail - menuPicture Array + magazinesDetail Object - menuPicture [idc, path] + magazinesDetail vehicle - + $Code$_magazinesDetail = magazinesDetail player ; + /* + [ + "6.5mm 30Rnd STANAG Mag(30/30)[id:3]", + "6.5mm 30Rnd STANAG Mag(30/30)[id:9]", + "9mm 16Rnd Mag(16/16)[id:12]", + "Smoke Grenade (Green)(1/1)[id:14]", + "Chemlight (Green)(1/1)[id:16]", + "RGO Frag Grenade(1/1)[id:18]" + ] + */$/Code$ + + $Code$_magazinesDetail = magazinesDetail Mi_48; + /* + [ + "30mm APDS shells(250/250)[id:20]", + "30mm HE Shells(250/250)[id:21]", + "Scalpel E2(8/8)[id:22]", + "Skyfire(38/38)[id:23]" + ] + */$/Code$ + undefined / undefined - String + Array + - menuSetAction + ctrlSetTooltipColorShade - Sets new action into menu entry on given path. + Sets tooltip background color of given control. Color is in format Color. - https://community.bistudio.com/wiki/menuSetAction + https://community.bistudio.com/wiki/ctrlSetTooltipColorShade - menuSetAction Array + Control ctrlSetTooltipColorShade Array - menuSetAction [idc, path, action] + control ctrlSetTooltipColorShade color - + $Code$_control ctrlSetTooltipColorShade [1, 0, 0, 1];$/Code$ + undefined / undefined - Number + Nothing + - menuSetCheck + lbSetSelectColorRight - Sets item on given path to be checked or not. + Sets the select color of the of the secondary text (right aligned) of the item with the given index of the listbox or combobox with id idc of the topmost user dialog to color. + Colour is in format Color. - https://community.bistudio.com/wiki/menuSetCheck + https://community.bistudio.com/wiki/lbSetSelectColorRight - menuSetCheck Array + lbSetSelectColorRight Array + + Control lbSetSelectColorRight Array - menuSetCheck [idc, path, checkedl] + lbSetSelectColorRight [idc, index, color] + + control lbSetSelectColorRight [index, color] - + $Code$lbSetSelectColorRight [101, 0, [0, 1, 0, 0.5]];$/Code$ + + $Code$_control lbSetSelectColorRight [0, [0, 1, 0, 0.5]];$/Code$ + undefined / undefined + More information on the LB command family can be found here - Nothing + Nothing - Nothing + - menuSetData + setTriggerArea - Sets new data into item on given path. + Defines the area monitored by the given trigger. The area could be either rectangular or elliptical. Since Arma 3 v1.59.135137 it is possible to define 3 dimensional area to monitor by specifying extra param for the area height (see pic). + Just like with a and b dimensions, c dimension will alter area in opposite directions from the trigger position along z axis. Therefore if the trigger position is on the surface, half of the trigger area will be above the surface and half below. To place the whole area above the surface, adjust trigger position (move it up c meters). If c is not specified or = 0, the trigger area considered infinitely tall, like in old triggers. - https://community.bistudio.com/wiki/menuSetData + https://community.bistudio.com/wiki/setTriggerArea - menuSetData Array + Object setTriggerArea Array - menuSetData [idc, path, data] + trigger setTriggerArea [a, b, angle, isRectangle, c] - + $Code$_trigger setTriggerArea [100, 50, 45, false ];$/Code$ + + $Code$// Possible since Arma 3 v1.59.135137: + _trigger setTriggerArea [100, 50, 45, false, 100];$/Code$ + - undefined / undefined + global / local - Nothing + Nothing + - menuSetPicture + intersect - Sets new picture into menu entry on given path. + Finds named selections in object which are in specified LOD, intersected by given section of a line. Return value is in the form of [selection, distance]. Multiple returned arrays are nested within a single array. No intersection returns []. lodName could be one of the following: + "FIRE" + "VIEW" + "GEOM" + "IFIRE" - ("I" stands for Indirect, almost the same as FIRE) - https://community.bistudio.com/wiki/menuSetPicture + https://community.bistudio.com/wiki/intersect - menuSetPicture Array - - Control menuSetPicture Array + Array intersect Array - menuSetPicture [idc, path, picture] - - control menuSetPicture [path, picture] + [object, lodName] intersect [begPos, endPos] - + $Code$[_tank, "VIEW"] intersect [[1500, 1500, 2], [1550, 1500, 2]];$/Code$ + + $Code$sphere = "Sign_Sphere10cm_F" createVehicle [0,0,0]; + onEachFrame { + _begPos = positionCameraToWorld [0,0,0]; + _begPosASL = AGLToASL _begPos; + _endPos = positionCameraToWorld [0,0,1000]; + _endPosASL = AGLToASL _endPos; + _ins = lineIntersectsSurfaces [_begPosASL, _endPosASL, player, objNull, true, 1, "FIRE", "NONE"]; + if (_ins isEqualTo []) exitWith {sphere setPosASL [0,0,0]}; + _ins select 0 params ["_pos", "_norm", "_obj", "_parent"]; + if !( getModelInfo _parent select 2) exitWith {sphere setPosASL [0,0,0]}; + _ins2 = [_parent, "FIRE"] intersect [_begPos, _endPos]; + if (_ins2 isEqualTo []) exitWith {sphere setPosASL [0,0,0]}; + _ins2 select 0 params ["_name", "_dist"]; + _posASL = _begPosASL vectorAdd ((_begPosASL vectorFromTo _endPosASL) vectorMultiply _dist); + drawIcon3D ["", [1,1,1,1], ASLToAGL _posASL, 0, 0, 0, _name, 1, 0.03, "PuristaMedium"]; + sphere setPosASL _posASL; + };$/Code$ + - undefined / undefined + global / undefined + (Jul 25, 2007) + The most common LOD is " FIRE ", which identifies the most detailled hitbox used for ammunition. + + (Mar 27, 2014) + Example (In ArmA3 ver 1.14) display returned arrays on cursor entities: + $Code$ + Sto = []; + Fn = { + { + Sto set [_foreachindex,[cursortarget,_x] intersect [(asltoagl (eyepos player)),(screentoworld [0.5,0.5])]]; + } foreach ["FIRE","VIEW","GEOM","IFIRE"]; + hintsilent format ["FIRE: %1, VIEW: %2, GEOM: %3, IFIRE: %4",Sto select 0,Sto select 1,Sto select 2,Sto select 3]; + }; + ["sample_id","onEachFrame","Fn"] call BIS_fnc_addStackedEventHandler; + $/Code$ + Return FIRE: [something], VIEW: [something], GEOM: [something], IFIRE: [something]. + + (August 20, 2015) + intersect will spam.rpt if passed to it object has no skeleton. Use getModelInfo to filter out those objects. - Nothing - Nothing + Array + - menuSetValue + deleteCenter - Sets new value into menu entry on given path. + In a nutshell, this command removes gaming Side (see createCenter ). If a side has 0 Groups it cannot be deleted. Center can only be created for: east, west, resistance, civilian and sideLogic, therefore only centers from the mentioned sides can be deleted. + Old description: Destroys the AI center of the given side. - https://community.bistudio.com/wiki/menuSetValue + https://community.bistudio.com/wiki/deleteCenter - menuSetValue Array + deleteCenter Side - menuSetValue [idc, path, value] + deleteCenter side - + $Code$deleteCenter east$/Code$ + - undefined / undefined + undefined / global - Nothing + Nothing + - menuShortcut + channelEnabled - Returns shortcut related to menu entry on given path. + Returns true or false depending on whether the given channel is enabled or disabled. For more information about enabling/disabling of chat channels see enableChannel. Channel / Number correspondence: + 0 = Global + 1 = Side + 2 = Command + 3 = Group + 4 = Vehicle + 5 = Direct + 6-15 = Custom Radio (Is not supported by channelEnabled ) + Please note that since Arma 3 v1.59.135661 the output of this command was changed from Boolean to Array in format [ Boolean, Boolean ] - https://community.bistudio.com/wiki/menuShortcut + https://community.bistudio.com/wiki/channelEnabled - menuShortcut Array + channelEnabled Number - menuShortcut [idc, path] + channelEnabled channel - + $Code$_isGlobalChatEnabled = ( channelEnabled 0) select 0; // Check if user can use text on global channel$/Code$ + + $Code$_isGlobalVoiceEnabled = ( channelEnabled 0) select 1; // Check if user can use the VoN on global channel$/Code$ + undefined / undefined - Number + Array + - menuShortcutText + setCamShakeDefParams - Returns a string containing shortcut text for menu item on the given path. + Sets camera shake default params, the default camshake when, for example, you freelook at your character shooting a 12.7mm sniper rifle or firing tank cannon. Would also work in 1st person. - https://community.bistudio.com/wiki/menuShortcutText + https://community.bistudio.com/wiki/setCamShakeDefParams - menuShortcutText Array + setCamShakeDefParams Array - menuShortcutText [idc, path] + setCamShakeDefParams [power, duration, frequency, minSpeed, minMass, caliberCoefHit, vehicleCoef] - + $Code$setCamShakeDefParams [1, 2, 3, 4, 5,.5,.5];$/Code$ + + $Code$setCamShakeDefParams [100, 10, 10, 4, 5, 1, 1];$/Code$ + undefined / undefined + (December 1, 2014) + Doesn't appear to have any effect in ArmA 3. - String + Nothing + - menuSize + camPrepareFov - Returns how many sub entries is in item on given path. + Prepares the camera field of view (zoom). The default zoom level is 0.75, 0.01 is the nearest and 2 the furthest zoom value. The angle of the field of view is atan(FOV)*2 radians when in 4:3 aspect ratio. Needs the call of camCommitPrepared to be conducted. - https://community.bistudio.com/wiki/menuSize + https://community.bistudio.com/wiki/camPrepareFov - menuSize Array + Object camPrepareFov Number - menuSize [idc, path] + camera camPrepareFov fieldOfView - + $Code$_camera camPrepareFov 0.1$/Code$ + undefined / undefined - Number + Nothing + - menuSort + onPreloadFinished - Sorts subentries of item on given path by their text. + Defines an action performed after the preload screen finished. Preload event occurs after briefing screen on mission start. + i + Since Arma 3 v1.57 a stackable version of this EH is available: PreloadFinished + In order to keep compatibility between official and community content the functions BIS_fnc_addStackedEventHandler and BIS_fnc_removeStackedEventHandler should be used instead. - https://community.bistudio.com/wiki/menuSort + https://community.bistudio.com/wiki/onPreloadFinished - menuSort Array + onPreloadFinished String/Code - menuSort [idc, path, reversed] + onPreloadFinished command - + $Code$onPreloadFinished {TAG_ReceivingScreenDone = true };$/Code$ + + $Code$//removes the event immediately after the first run again + onPreloadFinished {TAG_ReceivingScreenDone = true ; onPreloadFinished ""};$/Code$ + undefined / undefined + (July 24, 2009) + There is a bug in Arma2 that will make this command execute every time the screen with "Receiving..." has been displayed. + If this code is put in the Init.sqf it will run the startcam.sqf script when the loading screen has disappeared + onPreloadFinished '[fire1] execVM "scripts\startcam.sqf"'; + It will however also run every time a player change graphics settings, alt-tab or do anything else that will trigger the loading screen. + You will have to script around it with if statements to get it to run only in the beginning of the mission. - Nothing + Nothing + - menuText + roadsConnectedTo - Returns current text set in menu entry on given path. + Find the road segments connected to the given road segment. - https://community.bistudio.com/wiki/menuText + https://community.bistudio.com/wiki/roadsConnectedTo - menuText Array + roadsConnectedTo Object - menuText [idc, path] + roadsConnectedTo roadSegment - + $Code$_road = ( player nearRoads 50) select 0; + _connectedRoads = roadsConnectedTo _road;$/Code$ + undefined / undefined - String + Array + - menuURL + isWeaponRested - Returns current URL set in entry on given path. + Returns true if weapon is currently rested. - https://community.bistudio.com/wiki/menuURL + https://community.bistudio.com/wiki/isWeaponRested - menuURL Array + isWeaponRested Object - menuURL [idc, path] + isWeaponRested unit - + $Code$_rest = isWeaponRested player ;$/Code$ + - undefined / undefined + local / undefined + (July 1, 2015) + You can force a unit out of bipod or resting with: + $Code$_unit playMove "";$/Code$ + + (July 12, 2015) + As of 1.49 $Code$ isWeaponRested player $/Code$ is the only current use of this command. You cannot detect remote player and you cannot detect local unit that is not a player. Might as well be a nullar command without argument. - String + Boolean + - menuValue + radioChannelSetCallSign - Returns current value set in menu entry on given path. + Set the custom radio channel's call sign. + Available special parameters: + $KEY (reference to a localized text) + %CHANNEL_LABEL + %UNIT_SIDE + %UNIT_NAME + %UNIT_RANK + %UNIT_ID + %UNIT_REF + %UNIT_GRP_NAME + %UNIT_GRP_LEADER + %UNIT_VEH_NAME + %UNIT_VEH_POSITION - https://community.bistudio.com/wiki/menuValue + https://community.bistudio.com/wiki/radioChannelSetCallSign - menuValue Array + Number radioChannelSetCallSign String - menuValue [idc, path] + index radioChannelSetCallSign callSign - + $Code$4 radioChannelSetCallSign "%UNIT_NAME";$/Code$ + undefined / undefined - Number + Nothing + - mineActive + getDir - Checks if the given mine is active. + Returns the object heading in the range from 0 to 360. + Since Arma 3 v1.55.133361, an alternative syntax is added that allows to get heading from one object or position to another object or position, the equivalent of BIS_fnc_dirTo - https://community.bistudio.com/wiki/mineActive + https://community.bistudio.com/wiki/getDir - mineActive Object + getDir Object + + Object/Position2D/Position3D getDir Object/Position2D/Position3D - mineActive obj + getDir object + + pos1 getDir pos2 - $Code$if ( mineActive _mine) then { hint "BOOM!"};$/Code$ + $Code$_azimuth = getDir player ;$/Code$ + + $Code$_azimuth = player getDir tank;$/Code$ global / undefined + (October 23, 2013) + Be careful when using this command in conjunction with BIS_fnc_rotateVector2D ; the latter rotates vectors counterclockwise (mathematically correct), while getDir returns a clockwise angle. + To counter this, simply negate the output of getDir: + $Code$[[0,1,0], -( getDir _object ) ] call BIS_fnc_rotateVector2D ;$/Code$ - Boolean + Number - Number + - mineDetectedBy + setMarkerSize - Returns true if mine has been detected by a given side + Set marker size. + Size is in format [a-axis, b-axis]. - https://community.bistudio.com/wiki/mineDetectedBy + https://community.bistudio.com/wiki/setMarkerSize - Object mineDetectedBy Side + String setMarkerSize Array - mine mineDetectedBy faction + markerName setMarkerSize [a-axis, b-axis] - $Code$( allMines select 0) mineDetectedBy west ;$/Code$ + $Code$"MarkerOne" setMarkerSize [100, 200];$/Code$ - undefined / undefined + undefined / global - Boolean + Nothing + - min + radioChannelRemove - The smaller of a,b + Remove the units from the custom radio channel. - https://community.bistudio.com/wiki/min + https://community.bistudio.com/wiki/radioChannelRemove - Number min Number + Number radioChannelRemove Array - a min b + index radioChannelRemove units - $Code$3 min 2 - // Result is 2$/Code$ + $Code$3 radioChannelRemove [blufor_unit_1, blufor_unit_2];$/Code$ undefined / undefined @@ -42554,477 +44191,448 @@ - Number + Nothing + - missionConfigFile + mineActive - Return root of mission Description.ext entries hierarchy. - ! - Since introduction of the Eden Editor, scenario attributes can be configured in the editor itself, not only in the external Description.ext file. To access desired value independently on where it's stored, use the following commands instead: - getMissionConfigValue - getMissionConfig + Checks if the given mine is active. - https://community.bistudio.com/wiki/missionConfigFile + https://community.bistudio.com/wiki/mineActive - missionConfigFile + mineActive Object - missionConfigFile + mineActive obj - $Code$for "_i" from (0) to (( count paramsArray ) - 1) do { - missionNamespace setVariable [ configName (( missionConfigFile /"Params") select _i), paramsArray select _i]; - };$/Code$ - - $Code$// To define custom values in description.ext : - class myMissionConfig - { - class mySetup - { - myNumber = 3; - myArray[] = { 1, 2, 3 }; - myText = "LOL"; - }; - }; - // To read defined custom values from a script:_myNumber = getNumber ( missionConfigFile "myMissionConfig" "mySetup" "myNumber"); - _myArray = getArray ( missionConfigFile "myMissionConfig" "mySetup" "myArray"); - _myText = getText ( missionConfigFile "myMissionConfig" "mySetup" "myText");$/Code$ - - $Code$// To get file path with description.ext to play sound via playSound3D : - _filePath = [( str missionConfigFile ), 0, -15] call BIS_fnc_trimString ;$/Code$ - - $Code$// Obtaining mission root using A3 substring functionality - MISSION_ROOT = str missionConfigFile select [0, count str missionConfigFile - 15];$/Code$ + $Code$if ( mineActive _mine) then { hint "BOOM!"};$/Code$ - undefined / undefined + global / undefined - (February 17, 2015) - missionConfigFile can be used to parse mission.sqm file data as well if it is included into description.ext : - class MissionSQM - { - #include "mission.sqm" - }; - Then mission.sqm data can be accessed like this: - $Code$ getNumber ( missionConfigFile "MissionSQM" "version"); //12 - version param in mission.sqm $/Code$ - (courtesy of Master85 ) - Config + Boolean + - missionDifficulty + saveProfileNamespace - Return difficulty that has been forced for this mission, returns -1 if difficulty is not forced and it's used one from player's options. + Saves the variables stored in profileNamespace to the persistent active user profile. + Warning : this is a file operation, which makes it expensive! It is not recommended to do this at a high frequency in a loop for example. It is however also recommended not to change a large amount of variables and wait long before saving, because certain game crashes may cause a loss of data. + Warning : saving a lot of data can quickly increase the size of the profile variables file, so keep an eye on this. + Warning : TKOH's Heliport status (used in the Career mode for example) is stored in this file, so be mindful of working with this technology to avoid losing data and progress. - https://community.bistudio.com/wiki/missionDifficulty + https://community.bistudio.com/wiki/saveProfileNamespace - missionDifficulty + saveProfileNamespace - missionDifficulty + saveProfileNamespace - + $Code$saveProfileNamespace;$/Code$ + undefined / undefined + Variables are also saved when the game is quit. - Number + Nothing + - missionNamespace + setLightBrightness - Returns the global namespace attached to mission. + Set brightness of light. - https://community.bistudio.com/wiki/missionNamespace + https://community.bistudio.com/wiki/setLightBrightness - missionNamespace + Object setLightBrightness Number - missionNamespace + light setLightBrightness brightness - $Code$missionNamespace setVariable ["YourString",3];//Same as: YourString = 3; - _yourString = missionNamespace getVariable "YourString";$/Code$ + $Code$myLight setLightBrightness 2;$/Code$ - undefined / undefined + local / local + (Dec 1, 2006) + Light can be created with command createVehicleLocal with special vehicle class "#lightpoint" + for example: + $Code$_light = "#lightpoint" createVehicleLocal pos; + _light setLightBrightness 1.0; + _light setLightAmbient [0.0, 1.0, 0.0]; + _light setLightColor [0.0, 1.0, 0.0]; + _light lightAttachObject [_object, [0,0,0]]; + $/Code$ + + (Mar 24, 2014) + In ArmA3 ver1.14 setLightBrightness will overwrite the previous effect processed by setLightIntensity on the same light source, vice versa. And both of them currently play the same role on brightness, for example: $Code$_light setLightBrightness 1;// same as _light setLightIntensity 3000;$/Code$ - Namespace + Nothing + - missionName + addMagazineCargoGlobal - Return currently loaded mission file (path to mission.pbo, relative to game exe). + Add magazines to the cargo space of vehicles, which can be taken out by infantry units. + MP Synchronized - https://community.bistudio.com/wiki/missionName + https://community.bistudio.com/wiki/addMagazineCargoGlobal - missionName + Object addMagazineCargoGlobal Array - missionName + vehicleName addMagazineCargoGlobal [magazineName, count] - + $Code$_truck addMagazineCargoGlobal ["M16", 5];$/Code$ + - undefined / undefined + global / global - (2nd August, 2010) - Only works in SP and on the MP Host/DS. It returns the mission pboprefix if available, otherwise the pboname. For clients it returns '__cur_mp'. - - (September 25, 2014) - In OFP (up to v1.96) it returns the mission filename. In CWA (since v1.99), it returns the briefing name instead when in multiplayer. The string displayed is that set in the Intel section of the mission editor. + (November 7, 2011) + Synchronized to JIP as well. - String + Nothing + - missionStart + currentTasks - Returns date and time when mission started in format [year, month, day, hour, minute, second]. - Works only in multiplayer, in singleplayer all values are equal to zero → [0,0,0,0,0,0] - NOTE : Because missionStart contains the time of the actual start of the mission, it might not be available in pre-init or init, but is guaranteed to be available in post-init when time 0. + List all uncompleted tasks. - https://community.bistudio.com/wiki/missionStart + https://community.bistudio.com/wiki/currentTasks - missionStart + currentTasks Team_Member - missionStart + currentTasks member - $Code$setDate ( missionStart select [0,5]);$/Code$ - - $Code$// Set real date: - //postInit = 1; - if ( isServer ) then { - waitUntil { time 0}; - setDate ( missionStart select [0,5]); - };$/Code$ + $Code$_playerTasks = currentTasks teamMember player$/Code$ undefined / undefined - (September 25, 2014) - Returns array with date indicating when the mission has started (after briefing screen). In OFP this command is bugged – it works only in multiplayer on a player‐hosted machine and on a client. In single player it would return [0,0,0,0,0,0] and on a dedicated server – [1970,1,1,0,0,0]. In CWA this command is fixed. - - (December 30, 2014) - In arma 3 this command returns [0,0,0,0,0,0] in SP, [1970,1,1,0,0,0] on dedicated server and [1970,1,1,0,0,0] initially and then server real time on local headless client. On player clients it shows client's local date and time. Since Arma 3 v1.49 the dedicated server also returns correct mission start date. - - (August 27, 2015) - ArmA 3 1.50: This command now returns the correct values on dedicated server. http://feedback.arma3.com/view.php?id=23373 - Array + Array + - missionVersion + ctHeaderControls - Returns the version of the current mission. - Mission from the 2D Editor : 12 - Mission from the Eden Editor : 15 and higher (for example current version for Eden Editor mission in Arma 3 v1.57 is 51) + Returns array of controls on the header with the given index. - https://community.bistudio.com/wiki/missionVersion + https://community.bistudio.com/wiki/ctHeaderControls - missionVersion + Control ctHeaderControls Number - missionVersion + ctrl ctHeaderControls index - $Code$_version = missionVersion ;$/Code$ + $Code$_array = _control ctHeaderControls 0;$/Code$ - undefined / undefined + local / local - Number + Array + - modParams + forceSpeed - Returns list of mod parameters according to given options, values are in same order as the given options. Available options: - "name" : String - name to be shown (Arma 3 instead of A3, etc.) - "picture" : String - picture shown in Mod Launcher - "logo" : String - logo to be shown in Main Menu - "logoOver" : String - logo to be shown in Main Menu when mouse is over - "logoSmall" : String - small version of logo, prepared for drawing small icons - "tooltip" : String - tooltip to be shown on mouse over - "tooltipOwned" : String - tooltip to be shown on mouse over the icon when DLC is owned by player - "action" : String - url to be triggered when mod button is clicked - "actionName" : String - what to put on Action Button - "overview" : String - overview text visible in expansion menu - "hidePicture" : Boolean - do not show mod picture icon in the main menu mod list - "hideName" : Boolean - do not show mod name in the main menu mod list - "defaultMod" : Boolean - default mods cannot be moved or disabled by Mod Launcher - "serverOnly" : Boolean - mod doesn't have to be installed on client in order to play on server with this mod running - "active" : Boolean - active mod (activated through command line or stored in profile by mod launcher) - NOTE that "active" does not actually tell you if a mod ( is running / pretends to be running ) + Force the speed limit on given object (object will never attempt to move faster than given by forceSpeed). Use negative value to return to default behaviour. Used unit is m/s. - https://community.bistudio.com/wiki/modParams + https://community.bistudio.com/wiki/forceSpeed - modParams Array + Object forceSpeed Number - modParams [modClass, options] + object forceSpeed speed - $Code$_data = modParams ["Kart", ["name", "logo", "picture"]];$/Code$ + $Code$_helicopter forceSpeed 150;$/Code$ undefined / undefined - (April 24, 2017) - This command used to spam. rpt when queried mod didn't exist, making it little awkward to use for testing if mod is active. For example: - $Code$_superDuperModEnabled = modParams ["super_duper", ["active"]] param [0, false];$/Code$ - Since v1.69 the command would fail silently if mod doesn't exist. + (17:02, 2 March 2007 (CET)) + Setting forceSpeed to -1 will make the unit move according to the group speed mode (often specified by the waypoint) again. Setting forceSpeed to 0 will halt the unit ignoring waypoints or orders. + + (9 February 2008) + Does not seem to do anything at the current time (V1.08.5163) + + (14 December 2011) + If a unit (man) has forceSpeed set to anything under jogging (walking only) the unit will refuse to get into vehicles. He will automatically be unassigned from a vehicle everytime he is ordered to get in (via scripts or direct action) - Array + Nothing + - modelToWorldVisualWorld + removeAllPrimaryWeaponItems - Converts position from object model space to world space in render time. + Removes all items from weapon except magazine. - https://community.bistudio.com/wiki/modelToWorldVisualWorld + https://community.bistudio.com/wiki/removeAllPrimaryWeaponItems - Object modelToWorldVisualWorld Array + removeAllPrimaryWeaponItems Object - obj modelToWorldVisualWorld modelPos + removeAllPrimaryWeaponItems unit - $Code$player modelToWorldVisualWorld [0,1,0]$/Code$ - + - undefined / undefined + local / global - (May 28, 2017) - This command produces identical result to modelToWorldVisual command used in conjunction with AGLToASL - $Code$obj modelToWorldVisualWorld [1,2,3] isEqualTo AGLToASL (obj modelToWorldVisual [1,2,3]); // true$/Code$ - Array + Nothing + - modelToWorldVisual + secondaryWeapon - Converts position from object model space to world space in render time scope. For ASL version see modelToWorldVisualWorld. + Returns name of a unit's secondary weapon (empty string if none). - https://community.bistudio.com/wiki/modelToWorldVisual + https://community.bistudio.com/wiki/secondaryWeapon - Object modelToWorldVisual Array + secondaryWeapon Object - object modelToWorldVisual modelPos + secondaryWeapon unit - $Code$_aboveAndBehindPlayer = player modelToWorldVisual [0,-1,3];$/Code$ + $Code$_sWeap = secondaryWeapon player ;$/Code$ + + $Code$hint secondaryWeapon player ; //"launch_NLAW_F"$/Code$ undefined / undefined - - - Array + (August 4, 2006) + Notes from before the conversion: + secondaryWeapon tells you what weapon the unit has irrespective of the status of the weapon. For example a unit that has a LAWLauncher on his back will still report a LAWLauncher as its secondary weapon. Use currentWeapon to detect the active weapon. + + + String + - modelToWorldWorld + get3DENEntity - Converts position from object model space to world space (usable by setPosWorld for example). + Returns Eden Entity based on its unique ID. If the ID points to a layer, the ID will be returned instead. - https://community.bistudio.com/wiki/modelToWorldWorld + https://community.bistudio.com/wiki/get3DENEntity - Object modelToWorldWorld Array + get3DENEntity Number - obj modelToWorldWorld modelPos + get3DENEntity id - $Code$( getPos player ) modelToWorldWorld [0,1,0]$/Code$ + $Code$myEntity = get3DENEntity 1$/Code$ undefined / undefined - (May 28, 2017) - This command produces identical result to modelToWorld command used in conjunction with AGLToASL - $Code$obj modelToWorldWorld [1,2,3] isEqualTo AGLToASL (obj modelToWorld [1,2,3]); // true$/Code$ - Array + EdenEntity + - modelToWorld + atan2 - Translates relative position from object model space into world position. This command will take into account vectorUp of the object when calculating relative coordinates. For ASL version see modelToWorldWorld + ArcTangent of x/y. Used to determine the angle of a vector [x,y]. Result in Degrees between -180 and 180. + Note that this command can handle y being 0, unlike when using atan, and will return 90 - https://community.bistudio.com/wiki/modelToWorld + https://community.bistudio.com/wiki/atan2 - Object modelToWorld Array + Number atan2 Number - model modelToWorld position + x atan2 y - $Code$_aboveAndBehindPlayer = player modelToWorld [0,-1,3];$/Code$ + $Code$_xy = [5,3]; + _degrees = (_xy select 0) atan2 (_xy select 1); //59.0362$/Code$ + + $Code$// Get direction from _obj1 to _obj2: + _vd = getPosASL _obj2 vectorDiff getPosASL _obj1; + _dir = (_vd select 0) atan2 (_vd select 1); //_dir range from -180 to +180 + if (_dir 0) then {_dir = 360 + _dir}; //_dir range from 0 to 360$/Code$ + + $Code$// Get relative direction from _obj1 to _obj2: + _xy = _obj1 worldToModel getPosASL _obj2; + _dir = (_xy select 0) atan2 (_xy select 1); //_dir range from -180 to +180 + if (_dir 0) then {_dir = 360 + _dir}; //_dir range from 0 to 360$/Code$ undefined / undefined - (16 Feb, 2007) - The worldPos parameter appears to be a relative offset to the position of object, so it can often simply be [0,0,0]. - Example: to position an object _obj relative to the position of another object _RelObj with on offset of _Offset, try: - _Offset = [_x,_y,_z]; - _worldPos = _RelObj modelToWorld _Offset; - _obj setPos _worldPos; - - (16 Feb, 2007) - The object model space has got its Z-Axis along the object's vectorUp, its Y-Axis along the object's vectorDir, while its X-Axis goes along vectorDir x VectorUp (meaning as the X-Axis in a right-handed cartesian coordiante system ). - - (8 May, 2008) - If your object requires a new direction, ensure you call setDir prior to setPos when using modelToWorld. Calling setDir afterwards will skew its position otherwise. - _ladder setDir _angle; - _ladder setPos (_building modelToWorld [_x, _y, _z]); - - (6 Feb, 2011) - The z height returned changes dynamically with the height of waves beneath the object, if the object is located over sea. The z height returned by getPosATL and getPosASL does not change like this. This was tested by continuously retrieving the position of a static object, like the cross in the empty/corpses category, placed over sea or land. - modelToWorld behaves similar to - getPos _obj - but it does not give the same result, therefore - (_obj modelToWorld [0.0, 0.0, 0.0]) is not the same as (getPos _obj). + (08:00, 18 November 2009) + To get the direction of an object from the player: + $Code$ + _dir = (( getPos _obj select 0) - ( getPos player select 0)) atan2 (( getPos _obj select 1) - ( getPos player select 1)); + //_dir will be from -180 to 180. + $/Code$ + If positive values are needed then use: + $Code$ + if (_dir 0) then {_dir = _dir + 360}; + $/Code$ + Or just use BIS_fnc_dirTo directly. - Array + Number + - mod + deleteWaypoint - Remainder of a divided by b. + Removes the specified waypoint. - https://community.bistudio.com/wiki/mod + https://community.bistudio.com/wiki/deleteWaypoint - Number mod Number + deleteWaypoint Array - a mod b + deleteWaypoint [group, index] - $Code$_rem = 3 mod 2; - // Result is 1$/Code$ + $Code$deleteWaypoint [_grp, 2]$/Code$ - undefined / undefined + global / global - (01:34, 16 April 2006) - Remainder is calculated in real domain. - mod is identical to a % b - You can use mod to round a decimal number down to the nearest whole number. For example: If you wanted to use the command random to generate a whole number between 0 and 5, you could put this in a script: - $Code$_rand = random 6; - _num = _rand - (_rand mod 1); - $/Code$ - In A1, the new commands round, floor or ceil would be the easier way to round. + (1 Feb, 2008) + In order to change the behavior of a unit currently following a string of waypoints, it is not enough to use deleteWaypoint. The path of the unit is calculated by the waypoints present at start, and the unit will continue according to the original waypoints even if you delete them by using this command. + To achieve the wanted effect, you should rather use setWPPos to the units current position (thereby stopping the unit), and (after a small delay) use deleteWaypoint to remove the waypoints. + + (15 Nov, 2008) + Another (more foolproof) method to avoid the problem of non-deleteable waypoints is to introduce another group (createGroup) and join all units of the present group. A new group will start without any preset waypoints so you can start setting new WPs all over again. + Old group is "_combatGroup", new group is "_combatGroup2" + $Code$_combatGroup2 = createGroup EAST; + {[_x] joinSilent _combatGroup2} forEach ( units _combatGroup); + _combatGroup2 addWaypoint [ getPos player, 25];$/Code$ + + (January 04, 2011) + When you want to remove all waypoints, do NOT iterate over waypoints _group while trying to delete them (an array is by reference!). Instead use an approach like this: + $Code$ + while {( count ( waypoints _group)) 0} do + { + deleteWaypoint (( waypoints _group) select 0); + };$/Code$ - Number + Nothing + - moonIntensity + radioChannelAdd - Returns the intensity of the moon's brightness in range 0...1. + Add the units to the custom radio channel. - https://community.bistudio.com/wiki/moonIntensity + https://community.bistudio.com/wiki/radioChannelAdd - moonIntensity + Number radioChannelAdd Array - moonIntensity + index radioChannelAdd units - $Code$_intensity = moonIntensity ;$/Code$ + $Code$2 radioChannelAdd [player, unit1];$/Code$ undefined / undefined @@ -43032,116 +44640,85 @@ - Number + Nothing + - moonPhase + setCollisionLight - Returns the phase of the in-game Moon on the given date in range 0...1, where 0 - new Moon, 1 - full Moon. According to this command the fullest Moon in Arma 3 at midnight is on setDate [4804,7,13,0,0]; Use Moon Phase Utility to find out date for a mission with desired moon. + Switches collision lights of a vehicle on/off. Note that the vehicle has to be local. - https://community.bistudio.com/wiki/moonPhase + https://community.bistudio.com/wiki/setCollisionLight - moonPhase Array + Object setCollisionLight Boolean - moonPhase date + vehicle setCollisionLight set - $Code$_currentMoonPhase = moonPhase date ;$/Code$ - - $Code$// Returns array of dates for given year when moon is at its fullest - fnc_fullMoonDates = - { - private _year = param [0, 2035]; - private ["_date", "_phase", "_fullMoonDate"]; - private _fullMoonPhase = 1; - private _waxing = false ; - private _fullMoonDates = []; - for "_i" from dateToNumber [_year, 1, 1, 0, 0] to dateToNumber [_year, 12, 31, 23, 59] step 1 / 365 do - { - _date = numberToDate [_year, _i]; - _phase = moonPhase _date; - call - { - if (_phase _fullMoonPhase) exitWith - { - _waxing = true ; - _fullMoonDate = _date; - }; - if (_waxing) exitWith - { - _waxing = false ; - _fullMoonDates pushBack _fullMoonDate; - }; - }; - _fullMoonPhase = _phase; - }; - _fullMoonDates - }; - //set random full moon date in year 1970 - setDate selectRandom (1970 call fnc_fullMoonDates);$/Code$ + $Code$heli setCollisionLight true ;$/Code$ - undefined / undefined + local / global - Number + Nothing + - morale + ctrlIDC - Checks a current morale level of the unit (-1..+1). + Returns control IDC. - https://community.bistudio.com/wiki/morale + https://community.bistudio.com/wiki/ctrlIDC - morale Object + ctrlIDC Control - morale unit + ctrlIDC control - $Code$morale ( leader player );//result is 0.5$/Code$ - + undefined / undefined - Number + Number + - move3DENCamera + ctrlIDD - Moves Eden Editor camera to given position, with or without offset. - Default camera offset: [0,-25,25] + Returns display IDD. - https://community.bistudio.com/wiki/move3DENCamera + https://community.bistudio.com/wiki/ctrlIDD - move3DENCamera Array + ctrlIDD Display - move3DENCamera [position,useOffset] + ctrlIDD display - $Code$move3DENCamera [ getPos player,true];$/Code$ + $Code$ctrlIDD findDisplay 46; //46$/Code$ undefined / undefined @@ -43149,357 +44726,299 @@ - Nothing + Number + - moveInAny + ceil - Moves unit to the first available seat in a vehicle. The order of priorities is the same order used in squad command when you order subordinates to get in vehicle to any position and is the same order used in Zeus when you drag units to a vehicle. Seat assignment seems to use the following priority logic: - driver ( moveInDriver ) - commander turret ( moveInCommander ) - gunner turret ( moveInGunner ) - remaining turrets ( moveInTurret ) - cargo ( moveInCargo ). - NOTE : This command will move player into the locked vehicle or seat just as well. + The ceil value of x. - https://community.bistudio.com/wiki/moveInAny + https://community.bistudio.com/wiki/ceil - Object moveInAny Object + ceil Number - unit moveInAny vehicle + ceil x - $Code$player moveInAny tank;$/Code$ + $Code$ceil 5.25 + Result is 6$/Code$ + + $Code$ceil -5.25 + Result is -5$/Code$ - local / global + undefined / undefined - Boolean + Number + - moveInCargo + createTask - Move soldier into vehicle cargo position (Immediate, no animation). + Create a new AI task (subtask of parentTask). Type is name of registered task type. - https://community.bistudio.com/wiki/moveInCargo + https://community.bistudio.com/wiki/createTask - Object moveInCargo Object - - Object moveInCargo Array + Team_Member createTask Array - unitName moveInCargo vehicle - - unitName moveInCargo [vehicle, CargoIndex] + teamMember createTask [[type, parentTask], priority, name1, value1nameN, valueN] - $Code$_soldierOne moveInCargo _jeepOne;$/Code$ - - $Code$_soldierOne moveInCargo [_jeepOne, 1];$/Code$ - + - local / global + undefined / undefined - (August 4, 2006) - Notes from before the conversion - If you place a soldier in a vehicle with the moveInCargo command, he wont "know" he's in the vehicle, and thus he won't disembark properly when the vehicle reaches a Transport Unload waypoint. Therefore you have to use the assignAsCargo command, in order for the AI to catch on. Something like this: moveInCargo helo1 this assignAsCargo helo1 - MP Note Functions MoveInCargo can only be called for local soldiers. They will be ignored for remote soldiers. (see Locality in Multiplayer ) - - In OFP v1.96, the moveIn commands will not trigger an associated getIn event. To ensure the getIn event is fired, use the "getIn Cargo" action command. - - In Arma 3 when using the alternative syntax of moveInCargo, it is necessary to call assignAsCargoIndex because it is not called automatically. - $Code$unit1 moveInCargo [heli, 3]; - unit1 assignAsCargoIndex [heli, 3];$/Code$ - Alternatively avoid this broken syntax all together and use: - $Code$unit1 assignAsCargoIndex [heli, 3]; - unit1 moveInCargo heli; - $/Code$ - Nothing - Nothing + Task + - moveInCommander + exit - Move soldier into vehicle commander position (Immediate, no animation). + Stops the execution of a SQS script. + It's ignored in SQF Scripts. - https://community.bistudio.com/wiki/moveInCommander + https://community.bistudio.com/wiki/exit - Object moveInCommander Object + exit - unitName moveInCommander vehicle + exit - $Code$_soldierOne moveInCommander _tankOne$/Code$ + $Code$exit$/Code$ - local / global + undefined / local - (August 4, 2006) - Notes from before the conversion: - MP Note Functions MoveInCommander can only be called for local soldiers. They will be ignored for remote soldiers. (see Locality in Multiplayer ) - - In OFP v1.96, the moveIn commands will not trigger an associated getIn event. To ensure the getIn event is fired, use the "getIn Commander" action command. - Nothing + Nothing + - moveInDriver + setBleedingRemaining - Move soldier into vehicle driver position (Immediate, no animation). + Sets for how many seconds injured unit leaves blood trail. The unit damage must be = 0.1 for this command to have an effect, otherwise, the getBleedingRemaining will return 0 and no blood trail is left behind. - https://community.bistudio.com/wiki/moveInDriver + https://community.bistudio.com/wiki/setBleedingRemaining - Object moveInDriver Object + Object setBleedingRemaining Number - unitName moveInDriver vehicle + unit setBleedingRemaining time - $Code$_soldierOne moveInDriver _tankOne$/Code$ + $Code$_unit setBleedingRemaining 60;$/Code$ + + $Code$player setDamage 0.25; + player setBleedingRemaining 120;$/Code$ - local / global + undefined / undefined - (August 4, 2006) - Notes from before the conversion: - MP Note Functions MoveInDriver can only be called for local soldiers. They will be ignored for remote soldiers. (see Locality in Multiplayer ) - - In OFP v1.96, the moveIn commands will not trigger an associated getIn event. To ensure the getIn event is fired, use the "getIn Driver" action command. - Nothing + Nothing + - moveInGunner + isRealTime - Move soldier into vehicle gunner position (Immediate, no animation). + Returns true if the mission editor is operating in real time mode. + i + Some Old Editor Command - https://community.bistudio.com/wiki/moveInGunner + https://community.bistudio.com/wiki/isRealTime - Object moveInGunner Object + isRealTime Control - unitName moveInGunner vehicle + isRealTime map - $Code$soldierOne moveInGunner tankOne$/Code$ + $Code$_isRealTime = isRealTime _map$/Code$ - local / global + undefined / undefined - (August 4, 2006) - Notes from before the conversion: - MP Note Functions MoveInGunner can only be called for local soldiers. They will be ignored for remote soldiers. (see Locality in Multiplayer ) - - In OFP v1.96, the moveIn commands will not trigger an associated getIn event. To ensure the getIn event is fired, use the "getIn Gunner" action command. - Nothing + Boolean + - moveInTurret + driver - Moves the soldier into the vehicle's turret. (Immediately, without animation). turret path is an array of positions inside a turret, or positions inside a turret of a turret. - [0] means first turret. - [0,0] means first turret of first turret. - [0,1] means second turret of first turret. - [1] means second turret. - [1,0] means first turret of the second turret. - [2,0] means first turret of third turret. - And so on... + Returns the driver of a vehicle. - https://community.bistudio.com/wiki/moveInTurret + https://community.bistudio.com/wiki/driver - Object moveInTurret Array + driver Object - unitName moveInTurret [vehicle, turretPath] + driver vehicle - $Code$_soldierOne moveInTurret [_tank, [0, 0]]$/Code$ + $Code$( driver _tank) action ["getout", _tank];$/Code$ + + $Code$( driver ( vehicle player )) isEqualTo player //check if player is driver of current vehicle$/Code$ - local / global + global / undefined - (March 6, 2008) - To find out which turrets are available on a vehicle, and what the syntax is, you can use this little script. - - (February 13, 2014) - Examples for nested turrets: - MainTurret = $Code$_soldierOne moveInTurret [_tank, [0]] $/Code$ - CommanderTurret = $Code$_soldierOne moveInTurret [_tank, [0, 0]] $/Code$ - ... where: - MainTurret is the standard BIS MainTurret... e.g: - $Code$class Turrets - { - class MainTurret {}; - };$/Code$ - CommanderTurret is the standard BIS CommanderTurret located on the MainTurret... e.g: - $Code$class Turrets - { - class MainTurret - { - class Turrets - { - class CommanderTurret {}; - }; - }; - };$/Code$ - - (March 18, 2014) - Here is a small function to find available turret paths for a given vehicle. It will only search 2 levels deep, hence called commonTurrets : - $Code$KK_fnc_commonTurrets = { - private ["_arr","_trts"]; - _arr = []; - _trts = configFile / "CfgVehicles" / typeOf _this / "Turrets"; - for "_i" from 0 to count _trts - 1 do { - _arr set [ count _arr, [_i]]; - for "_j" from 0 to count ( - _trts / configName (_trts select _i) / "Turrets" - ) - 1 do { - _arr set [ count _arr, [_i, _j]]; - }; - }; - _arr - };$/Code$ - Example call: - $Code$ hint str ( vehicle player call KK_fnc_commonTurrets); //[[0],[0,0]]$/Code$ - See also allTurrets + (August 3, 2006) + Notes from before the conversion: + It is also possible to find the driver of a vehicle by placing a D after the name of the vehicle so Tank1D and driver Tank1 both refer to the same unit, providing the original driver has not got out of the tank. + The difference between the two is Tank1D is always the unit that was driver of the tank when the mission started, whilst driver Tank1 is the driver which is now there. - Nothing + Object + - moveObjectToEnd + doWatch - Shifts an editor object to the end of the objects array. This means,that the object will be drawn last (after all other objects). - i - Some Old Editor Command + Order the given unit(s) to watch the given position or target (without radio messages). Use objNull as the target to order a unit to stop watching a position/target. - https://community.bistudio.com/wiki/moveObjectToEnd + https://community.bistudio.com/wiki/doWatch - Control moveObjectToEnd String + Object/Array doWatch Array + + Object/Array doWatch Object - map moveObjectToEnd object + unit doWatch position + + unit doWatch target - + $Code$_soldierOne doWatch markerPos "MarkerMoveOne" + // The unit named "soldierOne" will watch the position where the marker "MarkerMoveOne" is placed.$/Code$ + + $Code$_soldierOne doWatch _eastSoldier + // The unit named "soldierOne" will watch the unit named "eastSoldier".$/Code$ + - undefined / undefined + local / global + (April 18, 2015) + Also controls where a vehicle gunner aims. - Nothing + Nothing - Nothing + - moveOut + ctrlMapWorldToScreen - Moves the soldier out of vehicle, immediately, without animation. + Transfers a map control world position to screen coordinates. - https://community.bistudio.com/wiki/moveOut + https://community.bistudio.com/wiki/ctrlMapWorldToScreen - moveOut Object + Control ctrlMapWorldToScreen Position - moveOut soldier + control ctrlMapWorldToScreen position - $Code${ if ( lifeState _x == "UNCONSCIOUS") then { moveOut _x}} forEach crew cursorTarget ;$/Code$ + $Code$_screenCoord = _control ctrlMapWorldToScreen _worldCoord;$/Code$ - $Code$// Move out player just before he dies: - player addEventHandler [ - "HandleDamage", - format [ - ' if ( switch (_this select 1) do { - case "": {_this select 2 = 1}; - case "head": {_this select 2 = %1}; - case "body": {_this select 2 = %2}; - default { false }; - }) then { moveOut player }', - getNumber ( configFile "CfgFirstAid" "CriticalHeadHit"), - getNumber ( configFile "CfgFirstAid" "CriticalBodyHit") - ] - ];$/Code$ + $Code$_screenCoord = _control ctrlMapWorldToScreen position player ;$/Code$ - global / global + undefined / undefined - (September 12, 2010) - Seems to work only for unconscious - NOT for dead bodies. setPos /ATL/ASL seems to the only working for dead bodies. + (June 16, 2010) + Notes: + It returns a 2d array with the position on the active map display. Say the return [0.5.0.5] would mean that your input 3d world position, like [500,1000], is currently at the center of the active map display. + In other words you can make the actual world position (of an object for example), relative to your active map display. - Nothing + Array + - moveTime + ppEffectCommitted - Returns the current time of the most important RTM animation currently being played on the soldier. + Check whether given post process effect is committed - https://community.bistudio.com/wiki/moveTime + https://community.bistudio.com/wiki/ppEffectCommitted - moveTime Object + ppEffectCommitted String + + ppEffectCommitted Number - moveTime soldier + ppEffectCommitted effect + + ppEffectCommitted effect - $Code$moveTime player ;$/Code$ + $Code$ppEffectCommitted "colorCorrection";$/Code$ + + $Code$ppEffectCommitted _hndl;$/Code$ + + $Code$if ( ppEffectCommitted "colorCorrection") then { hint "alteration done !"};$/Code$ undefined / undefined @@ -43507,135 +45026,144 @@ - Number + Boolean - Boolean + - moveToCompleted + setLightnings - Check if latest low level moveTo command is finished. + Changes the lightnings value smoothly during the given time (in seconds). A time of zero means there will be an immediate change. + NOTE : This command will have no effect (even though the value of lightnings changes) unless Manual Override option is selected in the editor in the Intel, which is normally off. - https://community.bistudio.com/wiki/moveToCompleted + https://community.bistudio.com/wiki/setLightnings - moveToCompleted Object + Number setLightnings Number - moveToCompleted person + time setLightnings value - + $Code$1800 setLightnings 0.7;$/Code$ + undefined / undefined - Boolean + Nothing + - moveToFailed + linkItem - Check if latest low level moveTo command failed. + Create and assign item to the correct slot. If there is an item in the targeted slot, it gets replaced. - https://community.bistudio.com/wiki/moveToFailed + https://community.bistudio.com/wiki/linkItem - moveToFailed Object + Object linkItem String - moveToFailed person + unit linkItem item - + $Code$bluforUnit linkItem "NVGoggles"; + opforUnit linkItem "NVGoggles_OPFOR"; + independentUnit linkItem "NVGoggles_INDEP";$/Code$ + - undefined / undefined + global / global - Boolean + Nothing + - moveTo + fadeMusic - Low level command to person to move to given position. + Changes the music volume smoothly within the given time. - https://community.bistudio.com/wiki/moveTo + https://community.bistudio.com/wiki/fadeMusic - Object moveTo PositionATL + Number fadeMusic Number - person moveTo position + time fadeMusic volume - + $Code$5 fadeMusic 0$/Code$ + - local / global + undefined / local - (August 14, 2010) - moveTo is a low-level command used in FSM called with doFSM or commandFSM. See doFSM for more information about this. Use doMove everywhere else - even in FSM executed with execFSM. - Nothing + Nothing + - move + ctrlType - Let group move to given position (format Position or Position2D ) without waypoint. Active waypoints will be ignored when command is used. + Returns number representing the type of control, which is also defined by type property in config. For more information see Dialog Control - https://community.bistudio.com/wiki/move + https://community.bistudio.com/wiki/ctrlType - Object/Group move Array + ctrlType Control - group move position + ctrlType control - $Code$_groupOne move position player ;$/Code$ + $Code$_type = ctrlType _rscEdit; // 2$/Code$ - local / global + undefined / undefined - Nothing + Number + - musicVolume + forEachMember - Checks the current music volume (set by fadeMusic ) + Executes the given command recursively for both teams and agents that are members of the given team. For teams only use forEachMemberTeam. For agents only use forEachMemberAgent. - https://community.bistudio.com/wiki/musicVolume + https://community.bistudio.com/wiki/forEachMember - musicVolume + Code forEachMember Team_Member - musicVolume + command forEachMember team @@ -43645,292 +45173,277 @@ - Number + Nothing + - nMenuItems + weapons - Returns the total number of user-added menu items belonging to the given menu. - i - Some Old Editor Command + Returns array of names of all Unit 's weapons. - https://community.bistudio.com/wiki/nMenuItems + https://community.bistudio.com/wiki/weapons - Control nMenuItems String - - Control nMenuItems Number + weapons Object - map nMenuItems menuName - - map nMenuItems index + weapons vehicleName - + $Code$_wArray = weapons player ;$/Code$ + undefined / undefined + (12:07, 20 January 2007) + (A1 1.02) this command returns only weapons defined for the primary turret of the vehicle. + for ex. only ["D81", "PKT"] for t72, not ["D81", "PKT","DSHKM"] + + (06:01, 3 March 2007 (CET)) + weapons never returns the weapon "Throw" which all soldier units have have to throw handgrenades. You'd have to use hasWeapon to verfy it. Also handgrenades are not listed since they are magazines. Use magazines for that. + + (11 March 2011) + Use weaponsTurret to determine the weapons of a non gunner/turret position. + + (25 November 2011) + This command does not include non-turret weapons, such as smoke, flare or chaff launchers which are usually declared in the root of the vehicle's class, rather than in the Turrets hierarchy. (Unsure whether it excludes it because it is not in the turret or because these are not considered true weapons via some property.) + + (18 June 2013) + Lists also weapons in inventory from Arma 3 ver. 0.70. - Number - Number + Array + - nameSound + setApertureNew - Returns the nameSound of a person. + Sets custom camera aperture ([-1] to do it automatically). - https://community.bistudio.com/wiki/nameSound + https://community.bistudio.com/wiki/setApertureNew - nameSound Object + setApertureNew Array - nameSound person + setApertureNew [min, std, max, stdLum] - $Code$nameSound player$/Code$ + $Code$setApertureNew [0.3, 0.2, 0.1, 1];$/Code$ + + $Code$// Simulate eye adjustment at night: + setDate [2016, 8, 10, 4, 0]; + setApertureNew [2, 8, 14,.9];$/Code$ + + $Code$// Narrower range for a subtler effect: + setDate [2016, 8, 10, 4, 0]; + setApertureNew [2, 5, 9,.8];$/Code$ - undefined / undefined + undefined / local + (October 30, 2016) + Some notes on example 2 - try it outdoors on a piece of ground with high contrasting areas. I suggest the end of a runway, standing among the white painted triangles. + Look up about 60 degrees above the horizon and toggle between setApertureNew [2, 8, 14,.9]; and the default setting of setAperture -1;. There should be little change -- at least on the date in the example. + Reset again to setApertureNew [2, 8, 14,.9]; and then pan slowly down until you're basically looking at your feet. The less sky (the main outdoor light source) you see, the 'wider' (toward the 'min' number) the aperture will become. Looking at the ground on a runway, for example, you should be able to easily distinguish the painted white triangles from the unpainted pavement. Again, toggle back to the default aperture. The view should get much darker. + This setting allows for some natural adjustment based on the amount of visible light in the scene, and is highly encouraged over the default fixed aperature for night missions. When you're standing in the beam of a lighthouse, for example (try near the 'Spartan' on Stratis), you will be basically unable to see anything not illuminated by the beam. Once the beam passes and your vision returns to normal, your immediate surroundings will be dimmer, of course, but you'll be able to see further out. - String + Nothing + - name + setDamage - When argument is Object, the command returns the name given to a unit using the setIdentity instruction or selected randomly by the game engine if setIdentity has not been used on the unit. If used on vehicle, name of first crew member (in order commander, driver, gunner). If used on an object, "Error: No unit" is being returned. - When argument is Location, the location's name is returned. To return the textual value of a location use text command instead. - NOTE: In Arma 3 setName can be used on a person to set name. However in multiplayer name always returns profileName. + Damage / repair object. Damage 0 means fully functional, damage 1 means completely destroyed / dead. (This function is an alias of setDammage and was introduced to fix the obvious spelling error in the original function name) + Since Arma 3 v1.67 there is an alternative syntax to this command allowing to switch off destruction effects. - https://community.bistudio.com/wiki/name + https://community.bistudio.com/wiki/setDamage - name Object + Object setDamage Number - name Location + Object setDamage Array - name object + object setDamage damage - name location + object setDamage [damage, useEffects] - $Code$_name = name player ;$/Code$ - - $Code$_locationName = name myLocation;$/Code$ + $Code$_soldier1 setDamage 1;$/Code$ - $Code$name nearestLocation [ position player, "Hill"]; //"" - text nearestLocation [ position player, "Hill"]; //"Lesnoy Khrebet"$/Code$ + $Code$_house1 setDamage [1, false ];$/Code$ - undefined / undefined + global / global - Location variant appears to be only for the 3d editor. - - (August 4, 2006) - Notes from before the conversion: - Name will return an error for units that have been dead for more than a few seconds. - - (December 15, 2006) - To return the name of the unit that was given in the editor's "name" field, call up the unit's object in a format statement: - hint format["Unit's name: %1",_unitobject] + In OFP, setting a unit's damage to a negative value will set it's health to full, but impair their aim. - (April 14, 2009) - Will return - Error: No vehicle - for JIP players in init.sqf, if no sleep were performed + (May 29, 2015) + Using this possible overrides individual hit damages such as setHitPointDamage ["HitHead", _value]; if you're having issues try setting hitdamage after setdamage - String - String + Nothing - Nothing + - nearEntities + showNewEditorObject - Find entities in the sphere with given radius. If typeName(s) is (are) given, only entities of given type (or its subtype) are listed. - This command returns only alive entities. If you need to return dead entities as well use entities command. + Show the add editor object dialog,type is editor object type,class is,class definition to automatically select,side filters by a certain,side,pos is position to create the object. + i + Some Old Editor Command - https://community.bistudio.com/wiki/nearEntities + https://community.bistudio.com/wiki/showNewEditorObject - Object/Array nearEntities Number - - Object/Array nearEntities Array + Control showNewEditorObject Array - position nearEntities radius - - position nearEntities [typeName, radius] + map showNewEditorObject [type,class,side,position] - $Code$_list = player nearEntities 20; - _list = ( position player ) nearEntities 50; - _list = player nearEntities ["Man", 1000]; - _list = ( position player ) nearEntities ["LaserTarget", 3000]; - _list = player nearEntities [["Car", "Motorcycle", "Tank"], 50]; - _list = ( position player ) nearEntities [["Man", "Air", "Car", "Motorcycle", "Tank"], 200];$/Code$ - + - global / undefined + undefined / undefined - (27 Mar, 2014) - According to Code Optimisation, this function is the fastest and should be used instead of nearestObjects when suitable. - Array - Array + Any_Value + - nearObjectsReady + updateDrawIcon - Check whether all data are loaded to nearObjects will return in reasonable time. + Updates the icon to be shown in 2D editor for the specified editor,object. If maintain size is false,icon will not scale depending on the,scale of the map. If maintain size is a number,the icon will maintain,size if map scale is below that number. + i + Some Old Editor Command - https://community.bistudio.com/wiki/nearObjectsReady + https://community.bistudio.com/wiki/updateDrawIcon - Object/Array nearObjectsReady Number + Control updateDrawIcon Array - position nearObjectsReady radius + map updateDrawIcon [object,string identifier,color,offset,width,height,maintain size,angle,shadow] - $Code$_twnpos nearObjectsReady 500;//from ALICE$/Code$ - + undefined / undefined - Boolean + Nothing + - nearObjects + setMarkerAlpha - Find objects in a sphere with given radius. The first object in the returned array is not necessarily the closest one. If you need returned objects to be sorted by distance, use nearestObjects. If typeName is given, only objects of given type (or its subtype) are listed. + Sets the marker alpha. The marker is modified on all computers in a network session. + When alpha equals 1, the marker is visible, but if alpha equals 0, then the marker is invisible. + Alpha can be numbers and fractions. - https://community.bistudio.com/wiki/nearObjects + https://community.bistudio.com/wiki/setMarkerAlpha - Position/Position2D/Object nearObjects Number - - PositionAGL/Position2D/Object nearObjects Array + String setMarkerAlpha Number - position nearObjects radius - - position nearObjects [typeName, radius] + marker setMarkerAlpha alpha - $Code$_list = position player nearObjects 50;$/Code$ - - $Code$_list = [_xpos,_ypos] nearObjects ["House", 20];$/Code$ + $Code$"my_marker" setMarkerAlpha 0.5;$/Code$ - $Code$_list = player nearObjects 20;$/Code$ + $Code$"enemy_convoy_marker" setMarkerAlpha 0;$/Code$ - undefined / undefined + undefined / global - (June 30, 2007) - Units in vehicles are not detected via this command. - - (December 15, 2011) - In the second example, you can't omit the typeName parameter. It's required and you'll get an error if you don't supply it. Use "All" as an alternative to leaving it out. (CO 1.59) - - (January 3, 2013) - If you use the first example, it will return objects many more objects such as pollen, honeybees and crucially, triggers. Triggers will show in the returned array as "no shape" but you can use typeOf to get the classname, which will give "EmptyDetector". This will not return objects that don't have classnames such as plants, stones and some map objects like vehicle wrecks. nearestObjects will find objects without classnames. - - (August 8, 2017) - The example 2 means that the command will include all types which inherit from the given type. As an example, when using "Helipad_Base_F", the command will detect all types of helipads (Land_HelipadSquare_F, Land_HelipadCircle_F, Land_HelipadEmpty_F, etc) in the given radius. - Array - Array + Nothing + - nearRoads + menuValue - Find the road segments within the circle of given radius. + Returns current value set in menu entry on given path. - https://community.bistudio.com/wiki/nearRoads + https://community.bistudio.com/wiki/menuValue - Object/Array nearRoads Number + menuValue Array - pos nearRoads radius + menuValue [idc, path] - $Code$_list = player nearRoads 50;$/Code$ - - $Code$_list = ( position _unit) nearRoads 50;$/Code$ - - $Code$_list = [1800,5700] nearRoads 50;$/Code$ - + undefined / undefined - (26 Mar, 2011) - NearRoads always gets data in the same order. In a 300 meter radius around Feruz Abad, for example, the first one is in the south-west corner and the last one is in the north-east. - Click below for picture. - [1] - Array + Number + - nearSupplies + diag_mergeConfigFile - Find supplies (weapon holders, ammo crates, fuel feeds, other units) in the sphere with given radius. + Adjust configs on-the-fly without the need of restarting the game (by merging the given config file into the main config in memory). Location is relative to the Userdir (default) or mission directory depending on the the value of UserDir [FileName,UserDir]. + Doesn't work with cfgAmmo & few other classes. (Since 1.69, cfgAmmo should be mergeable!) Merging config file means also that you can't delete parameters through diag_mergeConfigFile. Changes applied by diag_mergeConfigFile are applied to all new entities so restart of mission is not necessarily required - spawning vehicle again or changing back forth weapon should usually do the trick. + Command is only available when using Arma 3 Diagnostics Exe on Dev-Branch. - https://community.bistudio.com/wiki/nearSupplies + https://community.bistudio.com/wiki/diag_mergeConfigFile - Object/Array nearSupplies Number + diag_mergeConfigFile Array - origin nearSupplies radius + diag_mergeConfigFile path - $Code$_list = player nearSupplies 50;$/Code$ + $Code$diag_mergeConfigFile ["O:\Arma3\A3\Stuff_F\config.cpp"]$/Code$ undefined / undefined @@ -43938,157 +45451,135 @@ - Array + Nothing + - nearTargets + enableEnvironment - Returns a list of targets within the defined range. "Targets" are not restricted to enemy units. + Enable/disable environmental effects: ambient life and/or ambient sound. - https://community.bistudio.com/wiki/nearTargets + https://community.bistudio.com/wiki/enableEnvironment - Object nearTargets Number + enableEnvironment Boolean + + enableEnvironment Array - unit nearTargets range + enableEnvironment enabled + + enableEnvironment [ambientLife, ambientSound] - $Code$player nearTargets 100; - // could return something like this: - //[[[2555.33,2535.33,1.32708],"SoldierEB",EAST,214222,EAST 1-1-A:1],[[2550.39,2482.5,1.32696],"SoldierWB",WEST,0,WEST 1-1-A:2]]$/Code$ + $Code$enableEnvironment false ;$/Code$ + + $Code$enableEnvironment [ false, true ];$/Code$ undefined / undefined - (Febuary 17, 2011) - A subjective cost greater than 0 does not necessarily mean the target is an enemy unit. Any unit, that have yet to be identified by the unit, have a small positive cost in the range 0 to 1. - - (January 15, 2012) - The quality/detail level of the info depends on the knowsAbout value of the sourceUnit about the targetUnit: - For infantry: - ] 0, 1.5 [ - side unknown, some position offset, identified as SoldierWB - [ 1.5, 1.6 [ - side identified, subjective cost set - [ 1.6, 2 [ - type identified better (USMC_Soldier_Base) - [ 2, 3.6 [ - type identified precisely (USMC_Soldier) - [ 3.6, 4 ] - position identified precisely - The values seems closely linked to the accuracy value of the given targetUnit class and its parents up in the config tree: - 0class CAManBase: Man - 1.6class SoldierWB: CAManBase - 2class USMC_Soldier_Base: SoldierWB - 3.9class USMC_Soldier: USMC_Soldier_Base - For tanks: - ] 0, 0.03 [ - side unknown, some position offset, identified as LandVehicle - [ 0.03, 0.13 [ - type identified better (Tank) - [ 0.13, 0.3 [ - type identified better (M1A1) - [ 0.3, 1.5 [ - side identified, subjective cost set - [ 1.5, 3.6 [ - side identified precisely (CIV), subjective cost adjusted - [ 3.6, 4 ] - position identified precisely - The values seems closely linked to the accuracy value of the given targetUnit class and its parents up in the config tree: - 0class All - class AllVehicles: All - 0.0005class Land: AllVehicles - 0.02class LandVehicle: Land - 0.12class Tank: LandVehicle - 0.25class M1A1: Tank - - (January 17, 2012) - When an unit dies, it's nearTargets array gets emptied after some seconds. - When an unit dies, its reference will get removed from other units nearTargets' arrays immediately. - A target will be removed from the array after about 360 seconds without contact. + (28 October, 2013) + This command has to be executed after mission start to have an effect. So if you add this command in init.sqf make sure you wait until mission is running: + $Code$//init.sqf + waitUntil { time 0}; + enableEnvironment false ;$/Code$ - (January 21, 2012) - Position accuracy seems to be a radius in meters from the perceived position. + (October 23, 2017) + NOTE: Disabling ambient life will remove generation of anything that is coming from AmbientA3 map class (see Ambient System ). That means removing not only bees and cicadas around a player, but rabbits, snakes, seagulls and all the fish in the sea. - Array + Nothing - Nothing + - nearestBuilding + allSimpleObjects - Finds the nearest building to a given object or position. A "building" is defined as an object that is of class "House" and contains a path LOD. + Returns array of all simple objects that belong to the listed class names. If the array of types is empty [], all simple objects are returned including those without class name. NOTE : There is no inheritance in simple objects, so only exact class match is allowed. className is not case sensitive. - https://community.bistudio.com/wiki/nearestBuilding + https://community.bistudio.com/wiki/allSimpleObjects - nearestBuilding Object/Array + allSimpleObjects Array - nearestBuilding position + allSimpleObjects [className1, className2,classNameN] - $Code$_nBuilding = nearestBuilding player ;$/Code$ + $Code$allSimpleObjects ["Box_NATO_Equip_F", "Land_CampingChair_V2_F"];$/Code$ - $Code$_nBuilding = nearestBuilding position player ;$/Code$ + $Code$_allSimpleObjects = allSimpleObjects [];$/Code$ undefined / undefined - (February 18, 2016) - This command doesn't return any house or building placed in editor (with createVehicle ). Use nearestObjects instead: - $Code$ nearestObjects [ player, ["House", "Building"], 50] select 0$/Code$ - Object + Array + - nearestLocationWithDubbing + mapGridPosition - Find the nearest location (to the given position) having it speech non-empty. + Returns the map grid position of an object or position. The format is determined by the Grid format specified in the CfgWorlds for the current world. Eg: "024577" or "De82" or similar. - https://community.bistudio.com/wiki/nearestLocationWithDubbing + https://community.bistudio.com/wiki/mapGridPosition - nearestLocationWithDubbing Object/Array + mapGridPosition Object/Position - nearestLocationWithDubbing position + mapGridPosition param - + $Code$_gridPos = mapGridPosition player$/Code$ + + $Code$_gridPos = mapGridPosition getPos player$/Code$ + undefined / undefined - Location + String + - nearestLocation + setObjectProxy - Return the closest location of specified class to a given position. Checked range is unlimited (i.e. covers the whole map). + Set the proxy object associated with the given editor object. + i + Some Old Editor Command - https://community.bistudio.com/wiki/nearestLocation + https://community.bistudio.com/wiki/setObjectProxy - nearestLocation Array + Control setObjectProxy Array - nearestLocation [position, locationClass] + map setObjectProxy [object,proxy object] - $Code$_nearestCity = nearestLocation [ getPos player, "nameCity"];$/Code$ - - $Code$_anyNearestLocation = nearestLocation [ player, ""];$/Code$ + $Code$_map setObjectProxy ["_group_0", vehicle (leader _group)];$/Code$ undefined / undefined @@ -44096,318 +45587,200 @@ - Location + Nothing + - nearestLocations + local - Returns an array of locations of chosen type(s) within the given radius of the given position, sorted from nearest to farthest. + Check if given unit is local on the computer in Multiplayer games (see Locality in Multiplayer for general concepts). + This can be used when some activation fields or scripts need to be performed only on one computer. In Single player all objects are local. + Note1: Map created objects (those placed in Visitor ) are local everywhere. + Note2: Since Arma 3 v1.53.132932 keyword local has been renamed to private for consistency and to avoid any confusion. However, this just makes the third example obsolete. It's core functionality still remains. - https://community.bistudio.com/wiki/nearestLocations + https://community.bistudio.com/wiki/local - nearestLocations Array + local Object/Group - nearestLocations [position, [locationType,], radius, sortPosition] + local object - $Code$_nearbyLocations = nearestLocations [ position player, ["RockArea","VegetationFir"], 100];$/Code$ + $Code$// SQS: + ?! local _unitName : hint "remote"$/Code$ - $Code$// Find any of nearest locations: - allLocationTypes = []; - "allLocationTypes pushBack configName _x" configClasses ( - configFile "CfgLocationTypes" - ); - { - systemChat format [ - "%1 (%2) - %3m", - _x, - text _x, - position player distance _x - ]; - } forEach nearestLocations [ player, allLocationTypes, 500];$/Code$ + $Code$// SQF: + if (! local _unitName) then { + hint "remote"; + };$/Code$ + + $Code$_isLocalGroup = local group _unit;$/Code$ - undefined / undefined + global / undefined + (August 4, 2006) + Notes from before the conversion: + In multiplayer, a game logic will always be local to the host computer. This works on both dedicated and player-hosted servers. - Array + Boolean + - nearestObjects + crew - Returns a list of nearest objects of the given types to the given position or object, within the specified distance. If more than one object is found they will be ordered by proximity, the closest one will be first in the array. Alternatively, you use nearObjects command, which doesn't sort results. - position can use the format: - [[x,y,z], ["ClassName",...], radius] - or - [object, ["ClassName",...], radius] - To use it without any ClassName filter: - [object or position, [], radius]. - A list of ClassName types (Tanks eg) can be found in CfgVehicles - Since Arma 3 v1.65.138818 it is possible to switch search and sorting mode between 2D and 3D + Returns the crew (both dead and alive) of the given vehicle. - https://community.bistudio.com/wiki/nearestObjects + https://community.bistudio.com/wiki/crew - nearestObjects Array + crew Object - nearestObjects [position, types, radius, 2Dmode] + crew vehicleName - $Code$nearestObjects [ player, ["Car","Tank"], 200];$/Code$ - - $Code$nearestObjects [ player, ["house"], 200];$/Code$ - - $Code$nearestObjects [[2716,2949,0], ["Car","Truck"], 100];$/Code$ - - $Code$// Return every object in 50 metres radius around player: - nearestObjects [ player, [], 50]$/Code$ + $Code$player in ( crew _tank);$/Code$ - undefined / undefined + global / undefined - (unknown) - To get a list with alive targets for various situations use this construct: - $Code$_nearestTargets = nearestObjects [_submunScanPos, ["VBS2_TANK","TANK"], _scanArea]; - _validNearestTargets = []; - { if ( alive _x) then {_validNearestTargets set [( count _validNearestTargets),_x];};} forEach _nearestTargets; - $/Code$ - results in _validNearestTargets being filled with targets == alive.. (you could use other conditions there, of course!) - -- Vigilante - - (10. Aug. 2010) - Passing an empty array to define the types will also return objects with no class at all (such as trees, bushes, stones,...). - Example: - $Code$_objects = nearestObjects [_position, [], _radius];$/Code$ - Passing the array ["All"] is not the same and will only return objects that have some sort of class. - - (11.09.2013) - If you want to detect nearby grenades for the position of a unit, for example, using 'nearestObjects' won't work. You have to use - 'nearObjects' instead. - $Code$ count ( nearestObjects [_unit, ["GrenadeHand"], 30]) // WON'T WORK$/Code$ - Won't ever return anything but 0. - $Code$ count (_unit nearObjects ["GrenadeHand", 30]) // WORKS!$/Code$ - Will work. - - (March 22, 2014) - The distance from which an object is determined to be inside the radius is calculated from its model center (object modelToWorld [0,0,0]), and not the position returned by getPos/ATL/ASL. If an object is used as the origin from which to scan, distance is calculated from its model center as well. - - (October 26, 2014) - Return all trees in 100m radius around player: - $Code$trees = []; - { - if ( str _x find ": t_" -1) then { - trees pushBack _x; - }; - } forEach nearestObjects [ player, [], 100];$/Code$ - - (August 27, 2015) - If you use "Man" as the class to look for, it will only find dismounted men. IE, men in vehicles will NOT be found. - - (January 8, 2016) - The first call to this command can take significantly longer then consecutive calls. But even after the objects in given radius were cached, the sorting this command performs could be quite expensive. For example to sort ~7000 object it might take up to 100ms. For performance reasons you can use nearObjects instead, which is basically the same command but without added sorting. - - (March 2, 2016) - In Arma 3, nearestObjects is partially broken and is unable to return nearby placed explosive charges or mines when searching by classnames. Use nearObjects, nearestObject or allMines instead. - Example of non-functional code: - $Code$//always returns nothing, even if there are objects that should be returned - nearestObjects [position player, ["APERSMine_Range_Ammo", "SatchelCharge_Remote_Ammo"], 10]$/Code$ + (3 February, 2010) + The crew command will return crew in order [driver,gunner,commander,turrets,cargo] - (October 31, 2016) - Since Arma 3 v1.65.138818 the default sorting is done according to 3D distance not distance2D as before. This is an attempt to correct some very old bug in implementation. + (1 June, 2014) + The crew command will return an empty array if the object has no crew - this includes objects that can't hold crew. If used on a unit (man, module, etc.) it will return an array containing that unit. - Array + Array + - nearestObject + ctRemoveRows - Returns the nearest object of given type to given position within a sphere. Hardcoded radius is 50 meters. Unlike with nearestObjects, where distance is measured in 2D space, nearestObject will be closest object in 3D space. - If object class type is used, any object derived from the type is found as well (In OFP however, only objects with exactly the type given are found). If object ID passed as an argument (as in example 2) the search range is unlimited. + Takes array of row indices as a parameter and removes rows with those indices. Indices of remaining rows will be recomputed. - https://community.bistudio.com/wiki/nearestObject + https://community.bistudio.com/wiki/ctRemoveRows - nearestObject Array - - nearestObject Position3D/Position2D/Object - - Position3D/Position2D nearestObject String - - Position3D/Position2D nearestObject Number + Control ctRemoveRows Number - nearestObject [position, type] - - nearestObject position - - position nearestObject type - - position nearestObject id + ctrl ctRemoveRows indices - $Code$_nObject = nearestObject [2345,6789]; - _nObject = nearestObject [ player, "StreetLamp"];$/Code$ - - $Code$// Return the object with ID 123456: - _nObject = [0,0,0] nearestObject 123456;$/Code$ - - $Code$_nObject = getPos player nearestObject "StreetLamp";$/Code$ - - $Code$// Return the nearest object with ( typeOf _nObject == "#XXXX") - #mark, #slop, etc. Unlimited search range: - _nObject = _position nearestObject -1; - // Return the nearest object with ( typeOf _nObject != ""). Search range is 50m:_nObject = nearestObject _position;$/Code$ - - $Code$// (See also allMissionObjects ): - _blood = nearestObject [ player, "#slop"]; - _step = nearestObject [ player, "#mark"]; - _track = nearestObject [ player, "#track"]; - _crater = nearestObject [ player, "#crater"];$/Code$ + $Code$_control ctRemoveRows [0, 1, 2];$/Code$ - undefined / undefined + local / local - Object - Object - Object - Object + Nothing + - nearestTerrainObjects + getWeaponCargo - Returns a list of nearest terrain objects of the given types to the given position or object, within the specified distance. If more than one object is found they will be ordered according to 3D distance to the object (i.e. the closest one will be first in the array). - In contrast to nearestObjects this command returns terrain placed objects like trees, rocks and buildings which don't necessarily need an associated config class. - position can use the format: - [[x,y,z], ["Type",...], radius] - or - [object, ["Type",...], radius] - To use it without any type filter: - [object or position, [], radius] - Possible type names: "TREE", "SMALL TREE", "BUSH", "BUILDING", "HOUSE", "FOREST BORDER", "FOREST TRIANGLE", "FOREST SQUARE", "CHURCH", "CHAPEL", "CROSS", "BUNKER", "FORTRESS", "FOUNTAIN", "VIEW-TOWER", "LIGHTHOUSE", "QUAY", "FUELSTATION", "HOSPITAL", "FENCE", "WALL", "HIDE", "BUSSTOP", "ROAD", "FOREST", "TRANSMITTER", "STACK", "RUIN", "TOURISM", "WATERTOWER", "TRACK", "MAIN ROAD", "ROCK", "ROCKS", "POWER LINES", "RAILWAY", "POWERSOLAR", "POWERWAVE", "POWERWIND", "SHIPWRECK", "TRAIL" - Since Arma 3 v1.61.136035 it is possible to switch the sorting algorithm off by providing optional param, which significantly increases the performance of this command, especially if the search is performed with large radius. - Since Arma 3 v1.65.138818 it is possible to switch search and sorting mode between 2D and 3D + Returns all weapons types and count from the cargo space - https://community.bistudio.com/wiki/nearestTerrainObjects + https://community.bistudio.com/wiki/getWeaponCargo - nearestTerrainObjects Array + getWeaponCargo Object - nearestTerrainObjects [position, types, radius, sort, 2Dmode] + getWeaponCargo object - $Code$nearestTerrainObjects [ player, ["Tree","Bush"], 200];$/Code$ - - $Code$nearestTerrainObjects [ player, ["House"], 200];$/Code$ - - $Code$nearestTerrainObjects [[2716,2949,0], ["Chapel","Fuelstation"], 100];$/Code$ - - $Code$// Return every terrain object in 50 metres radius around player sorted, closest first: - nearestTerrainObjects [ player, [], 50]$/Code$ - - $Code$// Return every terrain object in 50 metres radius around player unsorted: - nearestTerrainObjects [ player, [], 50, false ]$/Code$ + $Code$_content = getWeaponCargo carName;$/Code$ - $Code$// Hide all terrain objects command could find: - if ( isServer ) then - { - { - _x hideObjectGlobal true ; - } - forEach nearestTerrainObjects - [ - [ worldSize /2, worldSize /2], - [], - worldSize, - false - ]; - };$/Code$ + $Code$_content = getWeaponCargo ammoBoxName; + // Sample result returns: + [["arifle_Katiba_F","launch_B_Titan_short_F"],[2,1]]$/Code$ - undefined / undefined + global / undefined - (October 31, 2016) - Since Arma 3 v1.65.138818 the default sorting is done according to 3D distance not distance2D as before. This is an attempt to correct some very old bug in implementation. - - (December 28, 2016) - Be aware that some terrain objects types might be tricky to be found, such as terrain rocks and boulders which are not considered to be "ROCKS" or "ROCK", but "HIDE". Example: - $Code$nearestTerrainObjects [player, ["HIDE"], 20]; // [939688: bluntstone_01.p3d,939691: garbagebags_f.p3d,939671: wreck_car_f.p3d,939692: junkpile_f.p3d] - $/Code$ - Array + Array + - needReload + isOnRoad - Return how much vehicle wants to reload its weapons. + Checks if given position is on road. Same as roadAt, only return is boolean instead of road object. - https://community.bistudio.com/wiki/needReload + https://community.bistudio.com/wiki/isOnRoad - needReload Object + isOnRoad Object/Array - needReload vehicle + isOnRoad position - $Code$_seriousness = needReload _vehicle;$/Code$ + $Code$_objOnRoad = isOnRoad player ;$/Code$ - $Code$if ( needReload player == 1) then { reload player };$/Code$ + $Code$_posOnRoad = isOnRoad ASLToAGL getPosASL player ;$/Code$ - undefined / undefined + global / undefined + (November 24, 2017) + Some roadobjects will return false when using this command. invisibleroadway_square_f.p3d is found by the nearRoads command, yet will return false for isOnRoad. - Number + Boolean + - netId + camPreload - Unique ID of object or group. As this command is MP only, you can use BIS_fnc_netId, which extends the use to SP as well. See also: BIS_fnc_objectVar + Preload the scene for the prepared camera. Time gives timeout, zero means no (infinite) timeout. - https://community.bistudio.com/wiki/netId + https://community.bistudio.com/wiki/camPreload - netId Object/Group + Object camPreload Number - netId var + camera camPreload time - $Code$_playerNetId = netId player ;$/Code$ + $Code$_camera camPreload 5$/Code$ undefined / undefined @@ -44415,29 +45788,28 @@ - String + Nothing + - netObjNull + attachedObject - A non existing network object. Not used in scripting anywhere in game. + Returns the object a location is attached to. If the location is unattached, then objNull is returned. - https://community.bistudio.com/wiki/netObjNull + https://community.bistudio.com/wiki/attachedObject - netObjNull + attachedObject Location - netObjNull + attachedObject location - $Code$netObjNull == netObjNull // Returns false$/Code$ - - $Code$netObjNull isEqualTo netObjNull // Returns true$/Code$ + $Code$_locAttachedObj = attachedObject myLocation;$/Code$ undefined / undefined @@ -44445,86 +45817,106 @@ - NetObject + Object + - newOverlay + joinSilent - Creates the new overlay dialog for the specified type of overlay. - i - Some Old Editor Command + Join all units in the array to given group silently (without radio message). To have a group member leave a group, join him with the grpNull group (e.g. [guy1] joinSilent grpNull ), but beware, as brand new group is created for the leaving unit and this could result in the number of groups in a mission growing out of control. - https://community.bistudio.com/wiki/newOverlay + https://community.bistudio.com/wiki/joinSilent - Control newOverlay Config + Array joinSilent Object/Group - map newOverlay config + unitArray joinSilent group - + $Code$[_unitOne, _unitTwo] joinSilent ( group player );$/Code$ + + $Code$[_unitOne, _unitTwo] joinSilent player ;$/Code$ + - undefined / undefined + global / global + (August 4, 2014) + If all units of a group are joined to another group then the first group will be NULL-group afterward. - Nothing + Nothing + - nextMenuItemIndex + loadFile - Returns the next available menu item index. - i - Some Old Editor Command + Return content of given filename as string. If you plan to compile said string, be aware that the file shouldn't contain comments or compile will throw an error. If there are comments, use preprocessFile / preprocessFileLineNumbers instead. - https://community.bistudio.com/wiki/nextMenuItemIndex + https://community.bistudio.com/wiki/loadFile - nextMenuItemIndex Control + loadFile String - nextMenuItemIndex map + loadFile fileName - + $Code$_contents = loadFile "wantedString.txt";$/Code$ + + $Code$_contents = compile loadFile "myFunction.sqf"; // will compile string into code$/Code$ + undefined / undefined + (25 January 2016) + Notice that you will have to activate file patching via -filePatching. Otherwise, execVM and loadFile will *not* load any files outside your mission folder (like the global scripts). - Number + String + - nextWeatherChange + failMission - Return the remaining time (in seconds) over which the current weather change will occur. - When a weather change finishes, the game engine will automatically generate a new random weather change over a realistic time period (minimum of 90 minutes). + Finish the mission. If the server is set to run persistent mission, failMission will not end the mission when last player gets kicked to the lobby. Use endMission to end the mission. + The end type can be: + "CONTINUE" + "KILLED" + "LOSER" + "END1" + "END2" + "END3" + "END4" + "END5" + "END6" + Mission saves won't be deleted. + To maintain Arma 3 visual style, it's recommended to use BIS_fnc_endMission instead. - https://community.bistudio.com/wiki/nextWeatherChange + https://community.bistudio.com/wiki/failMission - nextWeatherChange + failMission String - nextWeatherChange + failMission endtype - $Code$_seconds = nextWeatherChange ;$/Code$ + $Code$failMission "LOSER";$/Code$ undefined / undefined @@ -44532,99 +45924,101 @@ - Number + Nothing + - nil + enginesIsOnRTD - Nil value. This value can be used to undefine existing variables. + Returns which engines are producing some work. - https://community.bistudio.com/wiki/nil + https://community.bistudio.com/wiki/enginesIsOnRTD - nil + enginesIsOnRTD Object - nil + enginesIsOnRTD RTD_helicopter - $Code$variableToDestroy = nil ;$/Code$ + $Code$_enginesTaru = enginesIsOnRTD _taru// Returns [true,true]$/Code$ undefined / undefined - Note that ArrayName = nil destroys the arrayNAME not the array content. - Array content is 'destroyed' when no more ArrayName s refer to the content. - - Never ever assign a value to nil ! - Doing so creates a global variable with the same name that overrides the "command" nil : - foo = "foo"; - nil = "bar"; - foo = nil; - hint foo; // displays "bar" - - (September 25, 2014) - While isNil isn't available in OFP/CWA you can easily emulate it with something like this: - _nil = format["%1",_nilstring]; - ?(format["%1",foo]==_nil): foo = "Hello World!" - Void + Array + - not + ppEffectCreate - not a. - Exactly the same as ! a + Creates Post process effects specified by effect name and priority. Supported effects are: + "RadialBlur" + "ChromAberration" + "WetDistortion" + "ColorCorrections" + "DynamicBlur" + "FilmGrain" + "ColorInversion" - https://community.bistudio.com/wiki/not + https://community.bistudio.com/wiki/ppEffectCreate - not Number + ppEffectCreate Array - not a + ppEffectCreate [name, priority] + + ppEffectCreate [[name1, priority1],] - $Code$not false - // Result is true.$/Code$ + $Code$_ppGrain = ppEffectCreate ["filmGrain", 2005];$/Code$ undefined / undefined + (July 24, 2015) + "wetDistortion" only works if handle is used. Arma 3 (1.48.131561) - Boolean + Number + - numberToDate + sliderRange - Convert float number to a date. + Return limits, as an Array [min, max] of slider idc of topmost user dialog. - https://community.bistudio.com/wiki/numberToDate + https://community.bistudio.com/wiki/sliderRange - numberToDate Array + sliderRange Number + + sliderRange Control - numberToDate [year,time] + sliderRange idc + + sliderRange control - $Code$_date = numberToDate [2008,0.5324]; //[2008,7,13,7,49]$/Code$ + $Code$_slidelimits1 = sliderRange 105;$/Code$ undefined / undefined @@ -44632,71 +46026,89 @@ - Array + Array - Array + - objNull + vectorDistanceSqr - A non-existent Object. To compare non-existent objects use isNull or isEqualTo : - objNull == objNull ; // false - isNull objNull ; // true - objNull isEqualTo objNull ; // true + Squared distance between two 3D vectors. - https://community.bistudio.com/wiki/objNull + https://community.bistudio.com/wiki/vectorDistanceSqr - objNull + Array vectorDistanceSqr Array - objNull + vector1 vectorDistanceSqr vector2 - $Code$player == player ; // false if player is null$/Code$ - - $Code$isNull player ; // true if player is null$/Code$ - - $Code$str objNull // NULL-object$/Code$ - - $Code$position objNull // [0,0,0]$/Code$ + $Code$_distSqr = getPos player vectorDistanceSqr [0,0,2];$/Code$ undefined / undefined + (28 Jun, 2014) + (ArmA3 1.22)Algorithm: + $Code$ + Vector1 = [x1,y1,z1]; Vector2 = [x2,y2,z2]; + Result = (x2 - x1) ^ 2 + (y2 - y1) ^ 2 + (z2 - z1) ^ 2; + $/Code$ - Object + Number + - objStatus + gearSlotData - Sets the status of an objective that was defined in briefing.html. - Status may be one of: - "ACTIVE" - "FAILED" - "DONE" - "HIDDEN" - To refer to an objective that is named "OBJ_1", for example, use only the index number in this command (i.e. "1" objStatus "HIDDEN"). + Returns gear slot item name. - https://community.bistudio.com/wiki/objStatus + https://community.bistudio.com/wiki/gearSlotData - String objStatus String + gearSlotData Control - objectivenumber objStatus status + gearSlotData control - $Code$"1" objStatus "DONE" - Marks the objective named "OBJ_1" as completed.$/Code$ + $Code$Open any ammobox and click by any gear slots + private "_dspl"; + disableSerialization; + waitUntil { + _dspl = findDisplay 106; + ! isNull _dspl; + }; + uiNamespace setVariable ["/VDMJ/RscDisplayGear/SlotDataEH", { + _self = _this select 0; + _weaponName = gearSlotData _self; + _conf = configFile _confSection _weaponName; + _name = getText(_conf "displayName"); + _desc = getText(_conf "Library" "libTextDesc"); + _image = getText(_conf "picture"); + hint parseText format[ + ' t size="1.3" align="center" shadow="true" shadowColor="#000000" %1 /t br / img image="%2" size="6" align="center" / br / %3 br / %4', + _name, _image, _desc + ]; + }]; + for "_i" from 107 to 145 do { + _dspl displayCtrl _i ctrlAddEventHandler ["ButtonClick", + format [ + '_confSection = "%1"; _this call (uiNamespace getVariable "/VDMJ/RscDisplayGear/SlotDataEH");', + if( _i = 109 && _i = 129 ) then { "CfgMagazines" } else { "CfgWeapons" } + ] + ]; + };$/Code$ undefined / undefined @@ -44704,54 +46116,74 @@ - Nothing + String + - objectCurators + lbAdd - Returns array with all curators which can edit given object. + Adds an item with the given text to the listbox or combobox with id idc of the topmost user dialog. + It returns the index of the newly added item. - https://community.bistudio.com/wiki/objectCurators + https://community.bistudio.com/wiki/lbAdd - objectCurators Object + lbAdd Array + + Control lbAdd String - objectCurators obj + lbAdd [idc, text] + + control lbAdd text - + $Code$_index = lbAdd [101, "First item"];$/Code$ + + $Code$_index = _control lbAdd "First item";$/Code$ + - undefined / undefined + local / local + More information on the LB command family can be found here + + (April 12, 2015) + This command can be very very frustrating to use because it does not output any errors if unable to function. + Often, the 2nd provided syntax needs to be used like this: + $Code$_giveYourControlAname = (findDisplay 7) displayCtrl 9; + _addThisToListBox = "Option"; + _giveYourControlAname lbAdd _addThisToListBox;$/Code$ + Where "7" is the "idd" of the dialog you made in your ".hpp" file and where "9" is the "idc" of the RscListBox or RscComboBox. + The code above will add an option named "Option" to the ListBox or ComboBox. - Array + Number - Number + - objectFromNetId + waypointCombatMode - Get object with given unique ID. If object is a group use groupFromNetId. As this command is MP only, you can use BIS_fnc_objectFromNetId, which extends the use to SP as well. + Gets the waypoint combat mode. - https://community.bistudio.com/wiki/objectFromNetId + https://community.bistudio.com/wiki/waypointCombatMode - objectFromNetId String + waypointCombatMode Array - objectFromNetId id + waypointCombatMode waypoint - $Code$objectFromNetId "2:3"$/Code$ + $Code$waypointCombatMode [groupOne,1]$/Code$ undefined / undefined @@ -44759,39 +46191,28 @@ - Object + String + - objectParent + deleteLocation - Returns parent of an object if the object is proxy, otherwise objNull. In case of backpack, the parent is a weaponholder or a cargo space of a vehicle or the unit carrying it. Unit in a vehicle will return the vehicle as parent. - Another good use of objectParent is when a static weapon is known and one needs to check if it is assembled or not. objectParent _staticWeapon will return objNull if weapon is unpacked, or backpack object if packed. + Delete a location. - https://community.bistudio.com/wiki/objectParent + https://community.bistudio.com/wiki/deleteLocation - objectParent Object + deleteLocation Location - objectParent object + deleteLocation location - $Code$_weaponholder = objectParent _mybackpack;$/Code$ - - $Code$// Create and place created backpack in front of player: - _backpackContainer = "B_TacticalPack_rgr" createVehicle [0,0,0]; - _weaponHolder = objectParent _backpackContainer; - _weaponHolder setPos ( player modelToWorld [0,5,0]);$/Code$ - - $Code$// Check if player is on foot: - _isOnFoot = isNull objectParent player ;$/Code$ - - $Code$// Detect if player is in commander turret of a vehicle: - _isVehicleCommander = player isEqualTo commander objectParent player ;$/Code$ + $Code$deleteLocation myLocation$/Code$ undefined / undefined @@ -44799,27 +46220,44 @@ - Object + Nothing + - onBriefingGroup + onHCGroupSelectionChanged - Select a sound declared in the Description.ext of the mission to be played the first time the Group tab is selected in the briefing. + Defines an action performed when high command group selection has been changed. + Command receives 2 variables: + _group: Group - last selected/deselected group + _isSelected: Boolean - new selection state of the specific group + The code is executed on every hc group selection change until it is + removed via $Code$ onHCGroupSelectionChanged "";$/Code$ or $Code$ onHCGroupSelectionChanged {};$/Code$ + or replaced by $Code$ onHCGroupSelectionChanged "SomeOtherCommand(s)";$/Code$ or $Code$ onHCGroupSelectionChanged {SomeOtherCommand(s)};$/Code$ + i + Since Arma 3 v1.57 a stackable version of this EH is available: HCGroupSelectionChanged - https://community.bistudio.com/wiki/onBriefingGroup + https://community.bistudio.com/wiki/onHCGroupSelectionChanged - onBriefingGroup String + onHCGroupSelectionChanged String/Code - onBriefingGroup soundName + onHCGroupSelectionChanged command - $Code$onBriefingGroup "GroupVoiceOver"$/Code$ + $Code$onHCGroupSelectionChanged { + if (_isSelected) then { + hint format ["Group %1 has been selected.", _group]; + } else { + hint format ["Group %1 has been deselected.", _group]; + }; + };$/Code$ + + $Code$onHCGroupSelectionChanged " player globalChat 'HC group selection has been changed.';";$/Code$ undefined / undefined @@ -44827,119 +46265,118 @@ - Nothing + Nothing + - onBriefingNotes + getItemCargo - Select a sound declared in the Description.ext of the mission to be played the first time the Notes tab is selected in the briefing. + Returns all items names and count from ammo box (or any general weapon holder container). - https://community.bistudio.com/wiki/onBriefingNotes + https://community.bistudio.com/wiki/getItemCargo - onBriefingNotes String + getItemCargo Object - onBriefingNotes soundName + getItemCargo box - $Code$onBriefingNotes "NotesVoiceOver";$/Code$ + $Code$hint str getItemCargo cursorTarget ;$/Code$ - undefined / undefined + global / undefined - (8 Feb, 2007) - In OFP it works only with the sound files defined in the mission's description.ext - Nothing + Array + - onBriefingPlan + lookAtPos - Select a sound declared in the Description.ext of the mission to be played the first time the Plan tab is selected in the briefing. + Center the map on,and point the camera at,the position. + i + Some Old Editor Command - https://community.bistudio.com/wiki/onBriefingPlan + https://community.bistudio.com/wiki/lookAtPos - onBriefingPlan String + Control lookAtPos Array - onBriefingPlan soundName + map lookAtPos position - $Code$onBriefingPlan "PlanVoiceOver"$/Code$ + $Code$(findDisplay 12) lookAtPos [0,0,0];$/Code$ undefined / undefined - (January 20, 2007) - In OFP 1.96 only sound files defined in the mission description can be played in this way. - Nothing + Nothing + - onBriefingTeamSwitch + assignCurator - Select a sound declared in the Description.ext of the mission to be played the first time the TeamSwitch tab is selected in the briefing. + Assign player as curator. Two players cannot act as one curator. - https://community.bistudio.com/wiki/onBriefingTeamSwitch + https://community.bistudio.com/wiki/assignCurator - onBriefingTeamSwitch String + Object assignCurator Object - onBriefingTeamSwitch soundName + player assignCurator curatorObj - $Code$onBriefingTeamSwitch "TeamSwitchVoiceOver"$/Code$ + $Code$player assignCurator myCurator;$/Code$ undefined / undefined + This scripting command must be executed on the server to work properly in multiplayer - Nothing + Nothing + - onCommandModeChanged + removeGroupIcon - Defines code performed when hc command mode changes either because of (Left Ctrl + Space) shortcut or hcShowBar scripting command. Groups hc mode must contain at least one group for this command to work (see High Command ). Attached code receives _isHighCommand boolean. - i - Since Arma 3 v1.57 a stackable version of this EH is available: CommandModeChanged + Remove icon with given ID from group. - https://community.bistudio.com/wiki/onCommandModeChanged + https://community.bistudio.com/wiki/removeGroupIcon - onCommandModeChanged Code/String + Group removeGroupIcon Number - onCommandModeChanged code + group removeGroupIcon iconID - $Code$//Examples in-use can be found in: - //ca\modules\HC\data\scripts\HC_GUI.sqf - //A3\modules_f\HC\data\scripts\HC_GUI.sqf$/Code$ + $Code$_target removeGroupIcon (_target getvariable "hc_attackicon");$/Code$ undefined / undefined @@ -44947,548 +46384,469 @@ - Nothing + Nothing + - onDoubleClick + setOxygenRemaining - Defines an action performed when the user double clicks on the map. Command receives:,_pos array position,_units array selected units,_shift,_alt bool key state - i - Some Old Editor Command + Sets oxygen remaining. It has no effect when soldier is not diving. Oxygen remaining is a number between 0 and 1. - https://community.bistudio.com/wiki/onDoubleClick + https://community.bistudio.com/wiki/setOxygenRemaining - Control onDoubleClick String + Object setOxygenRemaining Number - map onDoubleClick command + unit setOxygenRemaining value - + $Code$player setOxygenRemaining 0; // Drowns player$/Code$ + undefined / undefined - Nothing + Nothing + - onEachFrame + drawIcon - Runs given statement every frame. - i - Since Arma 3 v1.57 a stackable version of this EH is available: EachFrame - In order to keep compatibility between official and community content the functions BIS_fnc_addStackedEventHandler and BIS_fnc_removeStackedEventHandler should be used instead. + Draw an icon on the map. The command needs to be called every frame, preferably with "Draw" control event handler ctrlAddEventHandler. - https://community.bistudio.com/wiki/onEachFrame + https://community.bistudio.com/wiki/drawIcon - onEachFrame String/Code + Control drawIcon Array - onEachFrame statement + map drawIcon [texture, color, position, width, height, angle, text, shadow, textSize, font, align] - $Code$onEachFrame { hintSilent str position player }; //Hints position every frame$/Code$ - - $Code$// Private variables defined outside of onEachFrame scope are not inherited: - _myvar = "bob"; - myvar = "bill"; - onEachFrame { hintSilent str [_myvar, myvar]}; - //Result: [any,"bill"]$/Code$ - - $Code$// Only one onEachFrame loop can exist at any time: - onEachFrame { player sideChat "first"}; - onEachFrame { player sideChat "second"}; - //Result: "second","second","second"..."second" - // Note how "first" never gets shown even though it precedes "second". This is because script thread is executing within the same frame and first onEachFrame is overwritten before it has a chance to execute its statement.$/Code$ - - $Code$// Script suspension is not permitted within onEachFrame scope: - onEachFrame { sleep 1}; - //ERROR!!!$/Code$ - - - undefined / undefined - - - (21 Dec, 2012) - $Code$ onEachFrame {}; //Reset event$/Code$ + $Code$findDisplay 12 displayCtrl 51 ctrlAddEventHandler ["Draw", " + _this select 0 drawIcon [ + 'iconStaticMG', + [1,0,0,1], + getPos player, + 24, + 24, + getDir player, + 'Player Vehicle', + 1, + 0.03, + 'TahomaB', + 'right' + ] + "];$/Code$ + + + undefined / undefined + + + (July 03, 2013) + Support of paremeters textSize, font and align is in the game since Arma 3 version 0.72. + + (March 22, 2014) + icon will always remain the same width and height, if you want an icon scaled to the map, use: $Code$( sizeInMeters * 0.15) * 10^(abs log (ctrlMapScale _ctrl))$/Code$ for width and height (guessimated). + + (July 20, 2014) + If you want only text with no icon, you can use "#(argb,8,8,3)color(0,0,0,0)" as texture. + + (July 7, 2015) + Be careful when using this command. Unlike map markers, the draw commands can decrease your framerate. + + (January 4, 2016) + Arma 3 1.54 + This command doesn't seem to play nice with onEachFrame. It seems to draw on the main screen while maintaing position relative to the map position + Example: + $Code$ onEachFrame { + findDisplay 12 displayCtrl 51 drawIcon ['iconStaticMG',[1,0,0,1], getPos player,24,24, getDir player,'Player Vehicle',1,0.03,'TahomaB','right']; + };$/Code$ + + (October 13, 2016) + If you unPBO the following addon: + $Code$@ui_f_data.pbo $/Code$ + You can find the possible icons inside this folder: + $Code$ui_f_data\map\vehicleicons$/Code$ + For example: + If you want to use "iconman_ca.paa" you will write "iconman" on the texture string. - Nothing + Nothing + - onGroupIconClick + hcAllGroups - Defines an action performed when player clicked on group marker (3D or in a map). The code executed once. This EH, unlike onGroupIconOverEnter and onGroupIconOverLeave, has one more param which returns 1 if RMB was pressed, 0 otherwise. - i - Since Arma 3 v1.57 a stackable version of this EH is available: GroupIconClick + Returns selected groups in high command. - https://community.bistudio.com/wiki/onGroupIconClick + https://community.bistudio.com/wiki/hcAllGroups - onGroupIconClick String/Code + hcAllGroups Object - onGroupIconClick command + hcAllGroups unit - $Code$onGroupIconClick - { - // Passed values for _this are: - _is3D = _this select 0; - _group = _this select 1; - _wpID = _this select 2; - _RMB = _this select 3; - _posx = _this select 4; - _posy = _this select 5; - _shift = _this select 6; - _ctrl = _this select 7; - _alt = _this select 8; - _message = format ["____ Info ____"]; - {_message = _message + format ["\n %1",_x]} forEach _this; - hint _message; - }$/Code$ - + undefined / undefined - Nothing + Array + - onGroupIconOverEnter + lnbValue - Defines an action performed when player moves pointer over group marker (3D or in a map). The code will execute continuously while pointer is over icon. - i - Since Arma 3 v1.57 a stackable version of this EH is available: GroupIconOverEnter + Returns the additional integer value in the item with the given position of the 2D listbox. - https://community.bistudio.com/wiki/onGroupIconOverEnter + https://community.bistudio.com/wiki/lnbValue - onGroupIconOverEnter String/Code + lnbValue Array + + Control lnbValue Array - onGroupIconOverEnter command + lnbValue [idc,[row, column]] + + ctrl lnbValue [row, column] - $Code$onGroupIconOverEnter - { - // Passed values for _this are: - _is3D = _this select 0; - _group = _this select 1; - _wpID = _this select 2; - _posx = _this select 3; - _posy = _this select 4; - _shift = _this select 5; - _ctrl = _this select 6; - _alt = _this select 7; - _message = format ["____ Info ____"]; - {_message = _message + format ["\n %1",_x]} forEach _this; - hint _message; - }$/Code$ + $Code$_ctrl lnbValue [0,0];//1, default is 0 if value is String set by lnbSetValue$/Code$ undefined / undefined + (Sep 9 2014) + (A3 1.28)As for invisible data processing, lnbAddArray, lnbAddColumn, lnbData, lnbGetColumnsPosition, lnbSetColumnsPos, lnbSetData, lnbSetText, lnbSetValue, lnbText and lnbValue store data types into exact position of the listNbox with different spaces. Accessing data with coordinate command at nearly the same syntax: + $Code$ + //Set same value to one position of a Control + _ctrl lnbSetData [ [0,0],"#1"]; + lnbSetColumnsPos [102, [0,1], 1]; + _ctrl lnbSetText [ [0,1], "#1"]; + _ctrl lnbSetValue [ [0,0],1]; + //Accessing the value disregard affecting one another. + _ctrl lnbData [0,0]; //"#1" + lnbGetColumnsPosition _ctrl //[1]; + _ctrl lnbText [0,0];//"#1" + _ctrl lnbValue [0,0];//1 + $/Code$ + For a direct visible control over CT_LISTNBOX: + $Code$ + 0 = [_CT_LISTNBOX] spawn { + private ["_CT_LISTNBOX","_color","_current","_pic"]; + disableSerialization ; + _CT_LISTNBOX = _this select 0; + { + _CT_LISTNBOX lnbAddRow [ getText (_x "displayNameShort"), getText (_x "displayName")]; + _CT_LISTNBOX lnbSetPicture [ [_foreachIndex,0], getText (_x "texture")]; + } forEach (" isClass _x" configClasses ( configFile "CfgRanks")); + _CT_LISTNBOX lnbSetCurSelRow 0; + _current = lnbCurSelRow _CT_LISTNBOX; + _color = _CT_LISTNBOX lnbColor [_current,0]; + _CT_LISTNBOX lnbSetColor [ [_current,1], [(_color select 0)/2,0,0,1] ]; + _CT_LISTNBOX lnbDeleteColumn 0; + _CT_LISTNBOX lnbDeleteRow 1; + sleep 1; + lnbClear _CT_LISTNBOX;//Clear all items but control still remains just invisible. + }; + $/Code$ + A combined use of both invisible and visible data processing commands alive the Control. - Nothing + Number - Number + - onGroupIconOverLeave + setAmmoOnPylon - Defines an action performed when pointer, previously positioned over icon, is moved away from it (3D or in a map). The code is executed once. - i - Since Arma 3 v1.57 a stackable version of this EH is available: GroupIconOverLeave + Set count of ammo in magazine on pylon - https://community.bistudio.com/wiki/onGroupIconOverLeave + https://community.bistudio.com/wiki/setAmmoOnPylon - onGroupIconOverLeave String/Code + Object setAmmoOnPylon Array - onGroupIconOverLeave command + vehicle setAmmoOnPylon [pylon nameindex, ammo count] - $Code$onGroupIconOverLeave - { - // Passed values for _this are: - _is3D = _this select 0; - _group = _this select 1; - _wpID = _this select 2; - _posx = _this select 3; - _posy = _this select 4; - _shift = _this select 5; - _ctrl = _this select 6; - _alt = _this select 7; - _message = format ["____ Info ____"]; - {_message = _message + format ["\n %1",_x]} forEach _this; - hint _message; - }$/Code$ + $Code$( vehicle player ) setAmmoOnPylon [1, 12];$/Code$ undefined / undefined + (August 18, 2017) + The pylon indices start at 1 and not at 0. - Nothing + Nothing + - onHCGroupSelectionChanged + setMarkerShape - Defines an action performed when high command group selection has been changed. - Command receives 2 variables: - _group: Group - last selected/deselected group - _isSelected: Boolean - new selection state of the specific group - The code is executed on every hc group selection change until it is - removed via $Code$ onHCGroupSelectionChanged "";$/Code$ or $Code$ onHCGroupSelectionChanged {};$/Code$ - or replaced by $Code$ onHCGroupSelectionChanged "SomeOtherCommand(s)";$/Code$ or $Code$ onHCGroupSelectionChanged {SomeOtherCommand(s)};$/Code$ - i - Since Arma 3 v1.57 a stackable version of this EH is available: HCGroupSelectionChanged + Selects the shape (type) of the marker. + Shape can be "ICON", "RECTANGLE", "ELLIPSE" or "POLYLINE". - https://community.bistudio.com/wiki/onHCGroupSelectionChanged + https://community.bistudio.com/wiki/setMarkerShape - onHCGroupSelectionChanged String/Code + String setMarkerShape String - onHCGroupSelectionChanged command + markerName setMarkerShape shape - $Code$onHCGroupSelectionChanged { - if (_isSelected) then { - hint format ["Group %1 has been selected.", _group]; - } else { - hint format ["Group %1 has been deselected.", _group]; - }; - };$/Code$ - - $Code$onHCGroupSelectionChanged " player globalChat 'HC group selection has been changed.';";$/Code$ + $Code$"Marker1" setMarkerShape "RECTANGLE";$/Code$ - undefined / undefined + undefined / global - Nothing + Nothing + - onMapSingleClick + commandWatch - Define action performed when user clicks in map by executing command string. - the string receives 5 (localised in scope) variables: - _this: Anything - Params passed to onMapSingleClick - _pos: Array - Clicked position - _units: Array - Units which were selected (via function keys) before opening the map ( may be non-functional in Arma ) - _shift: Boolean - Whether Shift was pressed when clicking on the map - _alt: Boolean - Whether Alt was pressed when clicking on the map - In Arma 3 the code should return true only if you wish to override default engine handling of the mouse click on map (see example #4) For older games, when click is processed, code should ultimately return true back to the engine. If false is returned, default processing by the game engine is done. Return value of any other type (including Nothing ) is an error. In such case default processing by the game engine is done, and error message may be displayed. - The code is executed on every click, until the Command is - removed via onMapSingleClick "", or - replaced by onMapSingleClick "SomeOtherCommand(s)" - i - Since Arma 3 v1.57 a stackable version of this EH is available: MapSingleClick - In order to keep compatibility between official and community content the functions BIS_fnc_addStackedEventHandler and BIS_fnc_removeStackedEventHandler should be used instead. + Orders the unit(s) to watch the given position or target (via the radio). Use objNull as the target to order a unit to stop watching a position/target - https://community.bistudio.com/wiki/onMapSingleClick + https://community.bistudio.com/wiki/commandWatch - onMapSingleClick String/Code + Object/Array commandWatch Array - Anything onMapSingleClick String/Code + Object/Array commandWatch Object - onMapSingleClick command + unitName commandWatch position - params onMapSingleClick command + unitName commandWatch target - $Code$onMapSingleClick "'SoldierWB' createUnit [_pos, group player ]; true"; - // ArmA: Creates a soldier unit at the position clicked.$/Code$ - - $Code$onMapSingleClick "grp1 move _pos; onMapSingleClick ''; true "; - // ArmA: Orders "grp1" to move to position clicked. Disables further map-click actions.$/Code$ - - $Code$onMapSingleClick "'SoldierWB' createUnit [_pos, group player ]; true "; - // OFP: In OFP single quotes cannot be used for string definition, so two double-quotes have to be used instead.$/Code$ - - $Code$//The following code will disable Shift+click waypoint marker creation - onMapSingleClick {_shift};$/Code$ - - $Code$//Pass params to onMapSingleClick code - player onMapSingleClick { hint ("Hello " + name _this)}; //Hello KK$/Code$ + $Code$_soldierOne commandWatch markerPos "MarkerMoveOne"$/Code$ - $Code$//Pass params to onMapSingleClick code and disable Shift+click waypoint marker creation - player onMapSingleClick " hint (""Hello "" + name _this ); _shift"; //Hello KK$/Code$ + $Code$[s1,s2] commandWatch player$/Code$ - undefined / undefined + local / global - (8 July, 2009) - See my Multiple OnMapSingleClick script to allow you to add multiple events to the onMapSingleClick event. Some minor editing of the scripts would be required to use them in Arma. - - (April 1, 2016) - _units param is supposed to return what groupSelectedUnits returns. Player must be leader and some units in the group must be selected on the group bar. However selected units are connected with group orders menu, which interferes with map click. In other words, when you click on the main map, the map gets focus and group orders menu closes, deselecting any selected unit, so _units is [] pretty much all the time. - Nothing - Nothing + Nothing - Nothing + - onPlayerConnected + precision - This command will execute attached code whenever a player is connected to a MP session. The code will receive a number of special variables: - _id : Number - is the unique DirectPlay ID. Quite useless as the number is too big for in-built string representation and gets rounded. It is also the same id used for user placed markers. - _uid : String - is getPlayerUID of the joining player. In Arma 3 it is also the same as Steam ID. - _name : String - is profileName of the joining player. - _jip : ( since Arma 3 v1.49 ) Boolean - is a flag that indicates whether or not the player joined after the mission has started ( J oined I n P rogress). true - when the player is JIP, otherwise false. - _owner : ( since Arma 3 v1.49 ) Number - is owner id of the joining player. Can be used for kick or ban purposes or just for publicVariableClient. - i - Since Arma 3 v1.57 a stackable version of this EH is available: PlayerConnected - In order to keep compatibility between official and community content the functions BIS_fnc_addStackedEventHandler and BIS_fnc_removeStackedEventHandler should be used instead. + Return the precision of the given entity, how is the entity able to be precise when moving to given target. - https://community.bistudio.com/wiki/onPlayerConnected + https://community.bistudio.com/wiki/precision - onPlayerConnected String/Code + precision Object - onPlayerConnected code + precision entity - $Code$onPlayerConnected "[_id, _name] execVM ""PlayerConnected.sqf""";$/Code$ - - $Code$onPlayerConnected { diag_log [_id, _uid, _name]};$/Code$ - - $Code$// From Arma 3 v1.49: - onPlayerConnected { - somevar = random 123; - _owner publicVariableClient "somevar"; - //this will set somevar on - //joining player PC to a random value - };$/Code$ - - $Code$// From Arma 3 v1.49: - onPlayerConnected {isJip = _jip; _owner publicVariableClient "isJip"}; - //Each player will now have variable isJip containing individual JIP info$/Code$ + $Code$if ( position _this distance _dangerPos = precision _this) then {...}; + //used in formationCDanger.fsm$/Code$ undefined / undefined - This scripting command must be executed on the server to work properly in multiplayer - Nothing + Number + - onPlayerDisconnected + getPilotCameraDirection - This command will execute attached code whenever a player is leaving an MP session. The code will receive a number of special variables: - _id : Number - is the unique DirectPlay ID. Quite useless as the number is too big for in-built string representation and gets rounded. It is also the same id used for user placed markers. - _uid : String - is getPlayerUID of the leaving player. In Arma 3 it is also the same as Steam ID. - _name : String - is profileName of the leaving player. - _jip : ( since Arma 3 v1.49 ) Boolean - is a flag that indicated whether or not the player joined after the mission has started ( J oined I n P rogress). true - if the player was JIP, otherwise false. - _owner : ( since Arma 3 v1.49 ) Number - is owner id of the leaving player. Can be used for kick or ban purposes or just for publicVariableClient. - i - Since Arma 3 v1.57 a stackable version of this EH is available: PlayerDisconnected - In order to keep compatibility between official and community content the functions BIS_fnc_addStackedEventHandler and BIS_fnc_removeStackedEventHandler should be used instead. + Returns model space vector of the object airplane or helicopter pilotCamera. - https://community.bistudio.com/wiki/onPlayerDisconnected + https://community.bistudio.com/wiki/getPilotCameraDirection - onPlayerDisconnected String/Code + getPilotCameraDirection Object - onPlayerDisconnected code + getPilotCameraDirection object - $Code$onPlayerDisconnected " diag_log [_id, _uid, _name]";$/Code$ - - $Code$onPlayerDisconnected { - if ( count allPlayers == 0) then { - endMission "END1"; - }; - };$/Code$ + $Code$_pilotCamVector = getPilotCameraDirection vehicle player$/Code$ - undefined / undefined + local / undefined - This scripting command must be executed on the server to work properly in multiplayer - - (January 14, 2015) - For Arma 3 v1.32 and onward, one might want to consider using instead the HandleDisconnect mission event handler for greater flexibility. - Nothing + Array + - onPreloadFinished + getMissionDLCs - Defines an action performed after the preload screen finished. Preload event occurs after briefing screen on mission start. - i - Since Arma 3 v1.57 a stackable version of this EH is available: PreloadFinished - In order to keep compatibility between official and community content the functions BIS_fnc_addStackedEventHandler and BIS_fnc_removeStackedEventHandler should be used instead. + Returns list of DLCs that are used in the mission. List is created only from units listed in mission.sqm and doesn't detect units created by scripts! - https://community.bistudio.com/wiki/onPreloadFinished + https://community.bistudio.com/wiki/getMissionDLCs - onPreloadFinished String/Code + getMissionDLCs - onPreloadFinished command + getMissionDLCs - $Code$onPreloadFinished {TAG_ReceivingScreenDone = true };$/Code$ - - $Code$//removes the event immediately after the first run again - onPreloadFinished {TAG_ReceivingScreenDone = true ; onPreloadFinished ""};$/Code$ + $Code$_list = getMissionDLCs$/Code$ undefined / undefined - (July 24, 2009) - There is a bug in Arma2 that will make this command execute every time the screen with "Receiving..." has been displayed. - If this code is put in the Init.sqf it will run the startcam.sqf script when the loading screen has disappeared - onPreloadFinished '[fire1] execVM "scripts\startcam.sqf"'; - It will however also run every time a player change graphics settings, alt-tab or do anything else that will trigger the loading screen. - You will have to script around it with if statements to get it to run only in the beginning of the mission. - Nothing + Array + - onPreloadStarted + rating - Defines an action performed just before the preload screen started. Preload event occurs after briefing screen on mission start. - i - Since Arma 3 v1.57 a stackable version of this EH is available: PreloadStarted - In order to keep compatibility between official and community content the functions BIS_fnc_addStackedEventHandler and BIS_fnc_removeStackedEventHandler should be used instead. + Check unit rating. Rating is increased for killing enemies, decreased for killing friendlies (see Rating Values ). Can be changed via addRating by the mission designer. + The rating of the player is displayed as the "score" at the end of the mission. Via Description.ext one can define how many points it takes to get a perfect score, as well as the number of stars. - https://community.bistudio.com/wiki/onPreloadStarted + https://community.bistudio.com/wiki/rating - onPreloadStarted String/Code + rating Object - onPreloadStarted command + rating unitName - $Code$onPreloadStarted { diag_log "preload started"};$/Code$ + $Code$_score = rating player$/Code$ - undefined / undefined + global / undefined + In ArmA 1.18 rating does only return rating levels for units that are local. - Nothing + Number + - onShowNewObject + lookAt - Defines an action performed when the user right clicks on the map and,selects New Object. Set to empty for default behavior. Command receives:,_pos array position, - i - Some Old Editor Command + Control what the unit(s) is/are looking at (target or position). - https://community.bistudio.com/wiki/onShowNewObject + https://community.bistudio.com/wiki/lookAt - Control onShowNewObject String + Object/Array lookAt Object/Array - map onShowNewObject command + unit lookAt position - + $Code$_someSoldier lookAt _otherSoldier$/Code$ + + $Code$[_someSoldier, _otherSoldier] lookAt markerPos "markerOne"$/Code$ + undefined / undefined - Any_Value + Nothing + - onTeamSwitch + waypointHousePosition - Defines an action performed when the team switch is finished. Commandset receives the following special variables: _from object previous unit, _to object current unit. Consecutive use of onTeamSwitch command will overwrite previously set commandset. - i - Since Arma 3 v1.57 a stackable version of this EH is available: TeamSwitch - NOTE: When player switches and leaves behind AI unit, you need to enable "TeamSwitch" AI on it onTeamSwitch {_from enableAI "TeamSwitch"}; so that the unit continues with waypoints + Gets the house position assigned to the waypoint. - https://community.bistudio.com/wiki/onTeamSwitch + https://community.bistudio.com/wiki/waypointHousePosition - onTeamSwitch String/Code + waypointHousePosition Array - onTeamSwitch commandset + waypointHousePosition waypoint - $Code$onTeamSwitch {[_from, _to] execVM "myTeamSwitchScript.sqf";};$/Code$ + $Code$waypointHousePosition [groupOne,1]$/Code$ undefined / undefined @@ -45496,39 +46854,29 @@ - Nothing + Number + - openCuratorInterface + textLog - Force opens curator interface. + Dump argument value to debugging output. + This command is non-functional in the retail version - https://community.bistudio.com/wiki/openCuratorInterface + https://community.bistudio.com/wiki/textLog - openCuratorInterface + textLog Any_Value - openCuratorInterface + textLog anything - $Code$// Open interface: - openCuratorInterface ;$/Code$ - - $Code$// Close interface: - findDisplay 312 closeDisplay 2;$/Code$ - - $Code$// Detect if user used "Zeus" key to open curator interface in the absence of event handler for it: - findDisplay 46 displayAddEventHandler ["KeyDown", { - if ( inputAction "CuratorInterface" 0) then { - hint "Curator interface is open"; - }; - false - }];$/Code$ + $Code$textLog player$/Code$ undefined / undefined @@ -45536,27 +46884,31 @@ - Nothing + Nothing + - openDLCPage + setStatValue - Opens a Steam page of the app with given appId. Only works for known appId (game + linked DLCs) + Sets a value to a given stat. + A list of possible StatNames can be found here: StatNames + Its important to note that most Stats are restricted to scripts in certain paths. + For example "ExpWarlockDown" is restricted to scripts in any subdirectory of "a3\Missions_F_Exp\Campaign\Missions\" - https://community.bistudio.com/wiki/openDLCPage + https://community.bistudio.com/wiki/setStatValue - openDLCPage Number + setStatValue Array - openDLCPage dlcID + setStatValue [name, value] - $Code$openDLCPage 288520$/Code$ + $Code$setStatValue ["ExpWarlockDown", 1]; //Unlocks the "Warlock Down" Steam achivement$/Code$ undefined / undefined @@ -45564,723 +46916,476 @@ - Boolean + Boolean + - openMap + nextMenuItemIndex - Shows in-game map. If forced, cannot be closed. + Returns the next available menu item index. + i + Some Old Editor Command - https://community.bistudio.com/wiki/openMap + https://community.bistudio.com/wiki/nextMenuItemIndex - openMap Boolean - - openMap Array + nextMenuItemIndex Control - openMap show - - openMap [show, forced] + nextMenuItemIndex map - $Code$openMap true ;$/Code$ - - $Code$openMap [ true, true ];$/Code$ - + undefined / undefined - Boolean - Boolean + Number + - openYoutubeVideo + camSetPos - Opens Steam overlay with given YT video. Video URL is the end part of the YT URL, starting with watch?v=.... If the user has Steam overlay disabled, the command will display appropriate message to the user and return false. + Sets the position of the given camera or seagull (see camCreate ). It is worth mentioning that camera position can also be set with setPos, in which case it would be instant. With camSetPos it is possible to make smooth position transition in time, defined with camCommit, which is required in this case. - https://community.bistudio.com/wiki/openYoutubeVideo + https://community.bistudio.com/wiki/camSetPos - openYoutubeVideo String + Object camSetPos Array - openYoutubeVideo youTubeUrl + camera camSetPos position - $Code$//Open http://www.youtube.com/watch?v=UBIAbm7Rt78 - _isOpened = openYoutubeVideo "watch?v=UBIAbm7Rt78";$/Code$ + $Code$_cam camSetPos [2300,1000,130]; + _cam camCommit 10;$/Code$ - undefined / undefined + local / local - Boolean + Nothing + - opfor + triggerText - Pre-defined variable for the opfor side. - Alias for east. + Returns trigger text. + Note: The trigger could be local or remote but the result returned by this command will be for the trigger condition set up locally on the client that executed the command. See createTrigger for more info. - https://community.bistudio.com/wiki/opfor + https://community.bistudio.com/wiki/triggerText - opfor + triggerText Object - opfor + triggerText trigger - $Code$if ( side player == opfor ) then { - hint "OPFOR"; - };$/Code$ + $Code$result = triggerText triggerName;$/Code$ - undefined / undefined + global / local - Side + String + - orderGetIn + setWaypointLoiterType - Force all units in the array to get in or out of their assigned vehicles. Units must be assigned to a vehicle before this command will do anything. + Sets the waypoint loiter type. - https://community.bistudio.com/wiki/orderGetIn + https://community.bistudio.com/wiki/setWaypointLoiterType - Array orderGetIn Boolean + Waypoint setWaypointLoiterType String - unitArray orderGetIn order + waypoint setWaypointLoiterType type - $Code$[_unitOne, _unitTwo] orderGetIn true$/Code$ + $Code$[_grp, 2] setWaypointLoiterType "CIRCLE";$/Code$ - $Code$[_unitOne, _unitTwo] orderGetIn false$/Code$ + $Code$[_grp, 2] setWaypointLoiterType "CIRCLE_L";$/Code$ - local / global + undefined / undefined - (8 May, 2014) - (ArmA3 ver 1.18), here's a quick reference to unit's embarkation and disembarkation. - Command - Remote Control - Behavior - Role Unassigning - orderGetIn - false - orderGetIn won't take effect on player controlled AI units, and which needs to be used together with assaignAs command family. Generally speaking, orderGetIn is a Role Excuator. - When orderGetIn was disabled it won't automatically unassign unit's vehicle role but will force the unit get out of the vehicle and stop him re-entering until it was enabled again. orderGetIn false won't stop a unit when he is embarking a vehicle in the half way but unassignVehicle will do. orderGetIn false will wait to fire until the unit enter a vehicle. - allowGetIn - false - allowGetIn won't take effect on player controlled AI units. Different from orderGetIn, this command is a Role Holder, it can control the unit's movement in the half way set by orderGetIn but not by setWaypointType, unit will be forced to get out from a vehicle by allowGetIn false and won't automatically re-enter the vehicle until allowGetIn true - allowGetIn won't do anything with unit's vehicle role - doGetOut - true - Works on player controlled ai silently, unit will automatically get back to the vehicle after disembarkation. (Unit won't get out until vehicle is stopped or landed) - false - commandGetOut - true - Same as doGetOut with radio message. (Unit won't get out until vehicle is stopped or landed) - false - leaveVehicle - false - leaveVehicle can't force a player controlled AI disembark - true - action ["GetOut",_veh] - true - Eject immediately without parachute - false - action ["Eject",_veh] - true - Eject immediately with parachute if needed - false - setWaypointType "GETIN" - false - Waypoint won't be affected by orderGetIn false or allowGetIn false until the unit is on the vehicle. - N/A - Nothing + Nothing + - or + getObjectDLC - Returns true only if one or both conditions are true. In case of the alternative syntax, lazy evaluation is used (if left operand is true, evaluation of the right side is skipped completely). - Identical to: a || b + Returns appID of the DLC the object belongs to or nil if object is vanilla. - https://community.bistudio.com/wiki/or + https://community.bistudio.com/wiki/getObjectDLC - Boolean or Boolean - - Boolean or Code + getObjectDLC Object - a or b - - a or b + getObjectDLC obj - $Code$if ((OBJ1) or (_enemycount == 0)) then { hint "you win !"}$/Code$ - - $Code$if (( count _array == 0) or {(_array select 0) != player }) then { hint "It works! Without lazy evaluation it would throw an error if array was empty."}$/Code$ + $Code$_appID = getObjectDLC cursorTarget ; + if (! isNil "_appID") then { + hint format ["This object belongs to DLC with id: %1", _appID]; + } else { + hint "This object is vanilla"; + };$/Code$ - undefined / undefined + global / undefined - (March 29, 2015) - The examples suggest that you can only use two conditions with or. You can use more if you want. - It is not recommended to use a lot of conditions because the check will take longer to complete. - Boolean - Boolean + Number/Nothing + - overcastForecast + ctFindHeaderRows - Return the overcast forecast. + Takes index of a header as a parameter. Returns array of indices of rows under this header. - https://community.bistudio.com/wiki/overcastForecast + https://community.bistudio.com/wiki/ctFindHeaderRows - overcastForecast + Control ctFindHeaderRows Number - overcastForecast + ctrl ctFindHeaderRows index - + $Code$_array = _control ctFindHeaderRows 0;$/Code$ + - undefined / undefined + local / local - Number + Array + - overcast + newOverlay - Return the current overcast level. Zero is clear skies, one is maximum cloud cover. + Creates the new overlay dialog for the specified type of overlay. + i + Some Old Editor Command - https://community.bistudio.com/wiki/overcast + https://community.bistudio.com/wiki/newOverlay - overcast + Control newOverlay Config - overcast + map newOverlay config - $Code$_cloudLevel = overcast$/Code$ - + undefined / undefined - Number + Nothing + - owner + drawArrow - On server machine, returns the ID of the client where the object is local. Otherwise returns 0. For use on clients clientOwner command is available. To find out the owner of a Group, use groupOwner. + Draws a single line arrow on the map. To draw a color filled arrow of custom shape see BIS_fnc_drawArrow - https://community.bistudio.com/wiki/owner + https://community.bistudio.com/wiki/drawArrow - owner Object + Control drawArrow Array - owner object + map drawArrow [from, to, color] - $Code$_clientID = owner _someobject;$/Code$ + $Code$findDisplay 12 displayCtrl 51 ctrlAddEventHandler ["Draw", + { + _this select 0 drawArrow [ + player, player getRelPos [100, 0], [1,0,0,1] + ]; + }];$/Code$ - global / undefined + undefined / undefined - This scripting command must be executed on the server to work properly in multiplayer + (July 7, 2015) + Be careful when using this command. Unlike map markers, the draw commands can decrease your framerate. - Number + Nothing + - param + vectorFromTo - Extracts a single value with given index from input argument, similar to BIS_fnc_param. When used without argument, as shown in main syntax, internal variable _this, which is usually available inside functions and event handlers, is used as argument. If input argument is not an array, it will be converted to 1 element array. - If extracted item of input with given index is undefined, of the wrong type or of the wrong length (if the item is an array), default value is used instead. Since Arma 3 v1.53.132691, onscreen errors are displayed for when the input is of the wrong type or size. + Unit vector, equal to direction from vector1 to vector2. In other words this command produces vectorNormalized between given 2 points. To get a normal vector use vectorDiff. - https://community.bistudio.com/wiki/param + https://community.bistudio.com/wiki/vectorFromTo - param Array - - Anything param Array + Array vectorFromTo Array - param [index, defaultValue, expectedDataTypes, expectedArrayCount] - - argument param [index, defaultValue, expectedDataTypes, expectedArrayCount] + vector1 vectorFromTo vector2 - $Code$[1, 2, 3] call - { - private _one = param [0, 1]; - private _two = param [1, 2]; - private _three = param [2, 3]; - //..... - };$/Code$ - - $Code$[123] call - { - private _val = param [0]; - }; - // Below would produce the same result as above - 123 call - { - private _val = param [0]; - };$/Code$ - - $Code$_z = position player param [2, 0]; - if (_z 10) then - { - hint "YOU ARE FLYING!"; - };$/Code$ - - $Code$fnc = - { - private _pos = param [0, [0,0,0], [ objNull, []], [2,3]]; - private _rad = param [1, 0, [0]]; - _pos nearObjects _rad; - }; - [ position player, 25] call fnc; //ok - [ player, 25] call fnc; //ok - [25, player ] call fnc; //default values are used$/Code$ + $Code$[1,2,3] vectorFromTo [4,5,6]; //[0.57735,0.57735,0.57735] + //is the same as + vectorNormalized ([4,5,6] vectorDiff [1,2,3]); //[0.57735,0.57735,0.57735]$/Code$ undefined / undefined - (November 8, 2016) - You can also use param in a complex with another commands. For example call, compile and format : - $Code$["var = 2"] call { - call compile format ["%1", param [0,"",[""]]]; // compiled param string value - hint str (var); // 2 - }; + (19 Jul, 2014) + (ArmA3 1.26) Algorithm: + $Code$ + Vector1 = [x1,y1,z1]; Vector2 = [x2,y2,z2]; + Result = [(x1 – x2)/( sqrt ((x1 – x2) ^ 2 + (y1 – y2) ^ 2 + (z1 – z2) ^ 2)), + (y1 – y2)/( sqrt ((x1 – x2) ^ 2 + (y1 – y2) ^ 2 + (z1 – z2) ^ 2)), + (z1 – z2)/( sqrt ((x1 – x2) ^ 2 + (y1 – y2) ^ 2 + (z1 – z2) ^ 2))]; $/Code$ - Anything - Anything + Array + - params + assignedItems - Parses input argument into array of private variables. When used without argument, as shown in main syntax, internal variable _this, which is usually available inside functions and event handlers, is used as argument. - In addition to simple parsing directly into variables, input can be tested in case it is undefined, of the wrong type or of the wrong size (if array) and substituted if necessary with default values. Since Arma 3 v1.53.132691, onscreen errors are displayed for when the input is of the wrong type or size. + Get array with all assigned items. + The resulting Array is sorted like: [ Map, Compass, Watch, Radio, GPS, NVG, Binoculars ]. + But if something is missing it get's omitted so you can not be sure that some element is at a constant index. - https://community.bistudio.com/wiki/params + https://community.bistudio.com/wiki/assignedItems - params Array - - Anything params Array + assignedItems Object - params [element1, element2,elementN] - - argument params [element1, element2,elementN] + assignedItems unit - $Code$[1, 2, 3] call { - private ["_one", "_two", "_three"]; - _one = _this select 0; - _two = _this select 1; - _three = _this select 2; - //..... - }; - // Same as above, only using params - [1, 2, 3] call { - params ["_one", "_two", "_three"]; - //..... - };$/Code$ - - $Code$[123] call { - params ["_myvar"]; - }; - // Below would produce the same result as above - 123 call { - params ["_myvar"]; - };$/Code$ - - $Code$position player params ["", "", "_z"]; - if (_z 10) then { - hint "YOU ARE FLYING!"; - };$/Code$ - - $Code$[1, nil, 2] params ["_var1", "_var2", "_var3"]; - // All 3 variables are made private but only _var1 and _var3 are defined - [1, nil, 2] params ["_var1", ["_var2", 23], "_var3"]; - // All 3 variables are private and defined$/Code$ - - $Code$[1, 2] call { - if (! params ["_var1", "_var2", ["_var3", true, [ true ]]]) exitWith { - hint str [_var1, _var2, _var3]; - }; - }; - // The hint shows [1,2,true] - //Script exits, default value was used due to missing value - [1, 2, 3] call { - if (! params ["_var1", "_var2", ["_var3", true, [ true ]]]) exitWith { - hint str [_var1, _var2, _var3]; - }; - }; - // The hint shows [1,2,true] - //Script exits, default value was used due incorrect value type$/Code$ - - $Code$[1, "ok", [1, 2, 3]] call { - if (! params [ - ["_var1", 0, [0]], - ["_var2", "", [""]], - ["_var3", [0,0,0], [[], objNull, 0], [2,3]] - ]) exitWith {}; - hint "ok"; - }; - // Passes validation - [1, 2, [3, 4, 5]] call { - if (! params ["_var1", "_var2", ["_var3", [], [[], objNull, 0], 0]]) exitWith {}; - hint "ok"; - }; - // Fails, because passed array is expected to be of 0 length, i.e. empty$/Code$ - - $Code$position player params ["_x", "_y"]; - player setPos [_x, _y, 100];$/Code$ - - $Code$[1, 2, 3, [4, 5, 6]] call { - params ["_one", "_two", "_three"]; - _this select 3 params ["_four", "_five", "_six"]; - };$/Code$ - - $Code${ - _x params ["_group", "_index"]; - //..... - } forEach waypoints group player ; - fn_someFnc = { - params ["_position", ["_direction", 0], ["_name", ""]]; - // Extract the x, y, and z from "_position" array: - _position params ["_x", "_y", "_z"]; - //..... - }; - [ position player, direction player, name player ] call fn_someFnc;$/Code$ - - $Code$targ addEventHandler ["HitPart", { - _this select 0 params ["_target", "_shooter", "_projectile"]; - }];$/Code$ + $Code$hint str assignedItems player ;$/Code$ undefined / undefined - (August 30, 2015) - Because params doubles as private, instead of: - $Code$[1, 2, 3] params ["_one", "_two", "_three"]; - private "_four"; - _four = 4;$/Code$ - You can just: - $Code$[1, 2, 3] params ["_one", "_two", "_three", "_four"]; - _four = 4;$/Code$ + (June 18, 2013) + Arma 3, version 0.70 - headgear and goggles are not present in returned array now. - (November 3, 2016) - With a function only taking one Parameter, it doesn't matter whether the parameter is in an array or not: - Example: - $Code$1 call { - params [ ["_number",0, [0]] ]; - }; - or - [1] call { - params [ ["_number",0, [0]] ]; - };$/Code$ - But when the one Parameter is an array that parameter has to be inside of an array when the function is called - Example: - $Code$[1,2] call { - params [ ["_array", [], [[]], 2] ]; - };//Fails - [[1,2]] call { - params [ ["_array", [], [[]], 2] ]; - };//Succeeds$/Code$ + (August 22, 2013) + For head gear use headgear, addHeadgear and removeHeadgear. For goggles use goggles, addGoggles and removeGoggles - Boolean - Boolean + Array + - parseNumber + setVelocityModelSpace - An SQF equivalent of C++ atof function. Parses the string, interpreting its content as a floating point number. - The command first discards as many whitespace characters as necessary until the first non-whitespace character is found. Then, starting from this character, takes as many characters as possible that are valid following a syntax resembling that of floating point literals, and interprets them as a numerical value. The rest of the string after the last valid character is ignored and has no effect on the behavior of this command. - If the first sequence of non-whitespace characters in string does not form a valid floating-point number, or if no such sequence exists because either string is empty or contains only whitespace characters, no conversion is performed and the command returns 0. + Sets the velocity (speed vector) of the given vehicle relative to its model. - https://community.bistudio.com/wiki/parseNumber + https://community.bistudio.com/wiki/setVelocityModelSpace - parseNumber String - - parseNumber Boolean + Object setVelocityModelSpace Array - parseNumber string - - parseNumber boolean + vehicle setVelocityModelSpace [x, y, z] - $Code$_number = parseNumber "0.125"; //0.125$/Code$ - - $Code$_number = parseNumber "2 abc"; //2$/Code$ - - $Code$_number = parseNumber true ; //1$/Code$ + $Code$car setVelocityModelSpace [0, 10, 0]; //pushes car forward$/Code$ - undefined / undefined + local / global - (Aug 28, 2014) - (A3 1.26)It only detects the first occurrence of a number in the string, return 0 by default. - $Code$ parseNumber "2s4f"; // 2 - parseNumber "s2f4"; // 0$/Code$ - parse config or code, currently BIS_fnc_parseNumber, occurrence is only limited with number, return -1 by default. - $Code${s3s4f} call BIS_fnc_parseNumber ; // -1$/Code$ - Number - Number + Nothing + - parseSimpleArray + forceEnd - Converts given, formatted as simple array, String into a valid Array. Simple array is array consisting of Numbers, Strings, Booleans and Arrays of all of the above. For example: [1,"2",true,[4,"five",false]]. The string representation of this array compatible with parseSimpleArray will be "[1,""2"",true,[4,""five"",false]]" accordingly. - This command is built for speed and security and because of this has several limitations. There is limited error reporting about format errors as the command expects well formatted array as argument. To be able to see exact format expected, you can just copy output result of str command applied to an array for reference: copyToClipboard str str [1,"2",true,[4,"five",false]] (notice the use of double str with copyToClipboard ). - In any case here are the explicit rules: - no spaces are permitted between array elements: [1,2,3] - correct, [1, 2, 3] - incorrect! - only double quotes " supported for Strings : ["hello"] - correct, ['hello'] - incorrect! - use " to escape ", for example ["hello"] converted to string should look like this: "[""hello""]" - no spaces should exist before or after array brackets: "[1,2,3]" - correct, "[1,2,3] " - incorrect! - To simplify, your constructed array format should be the same as Arma array converted to string with str : - $Code$_arr1 = getUnitLoadout player ; - _arr2 = parseSimpleArray str _arr1; - hint str (_arr1 isEqualTo _arr2); //true - $/Code$ - Because of this strictness the command is on average 3x faster than similar call compile string array method. And because call compile is not required, it is also more secure and primarily intended for use with callExtension to parse the String output into Array. + Sets the flag which tells engine that the mission end was forced. Might need additional endMission execution. Can be used in an "END" trigger to force end conditions in the editor. - https://community.bistudio.com/wiki/parseSimpleArray + https://community.bistudio.com/wiki/forceEnd - parseSimpleArray String + forceEnd - parseSimpleArray stringArray + forceEnd - $Code$_arr = parseSimpleArray "[1,2,3]";$/Code$ - - $Code$_bool = true ; - _num = 123.45; - _str = "ok"; - _arr = [1,false,"cool"]; - _res = parseSimpleArray format ["[%1,%2,%3,%4]", _bool, _num, str _str, str _arr]; - // Note how _bool and _num do not need str, however if used anyway, the result in this case would be identical - hint str _res; // [true,123.45,"ok",[1,false,"cool"]]$/Code$ + $Code$if (_TerritoryLost) then { forceEnd }$/Code$ - undefined / undefined + undefined / local - Array + Nothing + - parseText + getWingsPositionRTD - Creates a structured text by parsing the given XML description. Do not use parseText when displaying a localized text from stringtable.xml (see notes below). + Returns position of stabilizers. - https://community.bistudio.com/wiki/parseText + https://community.bistudio.com/wiki/getWingsPositionRTD - parseText String + getWingsPositionRTD Object - parseText text + getWingsPositionRTD RTD_helicopter - $Code$_Stxt = parseText "First line img image='data\isniper.paa'/ br/ Second line";$/Code$ - - $Code$hintSilent parseText format [" t size='1.25' font='Zeppelin33' color='#ff0000' %1 lives remaining. /t ", 12];$/Code$ - - $Code$_clickableLink = parseText " a href='http://arma3.com' A3 /a ";$/Code$ + $Code$_position = getWingsPositionRTD myHelicopter;$/Code$ undefined / undefined - (22:07, 11 May 2007 (CEST)) - You can also colorate your text. You just have to use following tag: - t color='#ffff00' Your yellow text! /t - To change the size of your text, use this command: - t size='2.2' Your bigger text! /t - To change text font, use: - t font='Zeppelin33' Bold Text /t - To change horizontal alignment, use (parameter can be 'left', 'center', 'right'): - t align='center' Centered Text /t - To change vertical alignment within a line, use (parameter can be 'top', 'middle', 'bottom'): - t valign='bottom' Text at Line Bottom /t - To underline text, use: - t underline='true' Underlined Text /t - To put shadow under text, use: - t shadow='true' t shadowColor='#ff0000' Text with Red Shadow /t /t - Following statements are valid too: - t underline='1' Underlined Text /t - t shadow='1'shadowColor='#ff0000' Green shadow text /t - Following fonts are valid (got from config): - t font='Zeppelin32' Zeppelin32 (normal text) /t - t font='Zeppelin33' Zeppelin33 (bold text) /t - t font='Zeppelin33Italic' Zeppelin33Italic (bold italic text) /t - t font='Bitstream' Bitstream (same as Zeppelin32) /t - t font='TahomaB' TahomaB (same as Zeppelin32) /t - t font='LucidaConsoleB' LucidaConsoleB (like Courier) /t - - (21 March 2009) - Although there is a dedicated image command, parseText gives more options: - img size='5' color='#ff0000' image='fish.paa'/ - - (1 September 2016) - To convert a structured text back to a string type, just use: - _str = str parseText _structuredText; - Structured_Text + Number + - parsingNamespace + groupRadio - Returns the global namespace attached to config parser. + Sends the audio message to the group radio channel. Must have assigned "ItemRadio" to send or receive the transmission. The message is defined in CfgRadio in the description.ext file or config radio protocol. The transmission will play only on the PC where command was executed. If you need the transmission to play on all computers, you have to execute it globally (see remoteExec ). + Note: When transmitting unit gets killed, transmission will be interrupted, however when receiving unit gets killed, the transmission continues to play. - https://community.bistudio.com/wiki/parsingNamespace + https://community.bistudio.com/wiki/groupRadio - parsingNamespace + Object groupRadio String - parsingNamespace + unit groupRadio radioName - $Code$parsingNamespace setVariable ["var1",101.23124]; - _profVar1 = parsingNamespace getVariable "var1";$/Code$ + $Code$_soldierOne groupRadio "messageOne";$/Code$ + + $Code$player groupRadio configName selectRandom ("true" configClasses ( configFile "CfgRadio"));$/Code$ - undefined / undefined + global / local - (January 27, 2015) - Any global variable defined in a config using __EXEC() will be stored in this namespace. - For example in the description.ext: - $Code$__EXEC(testVar = 1);$/Code$ - The variable "testVar" can be accessed during mission run time using getVariable - $Code$ hint str ( parsingNamespace getVariable ["testVar", 0]);$/Code$ - The above example would print 1. - This example however: - $Code$__EXEC(_testVar = 1);$/Code$ - Would print 0, because adding an underscore will make the variable local to the config in the same way that it would make it local to a script. - See PreProcessor Commands for more details on __EXEC() + (December 3, 2016) + To transmit user custom sounds (see Multiplayer_Custom_Sounds_Tutorial ), prefix the full filename including file extension with #. For example if there is a custom user sound file called MySound.ogg, to play it on the radio use: + $Code$ player groupRadio "#MySound.ogg";$/Code$ - Namespace + Nothing + - particlesQuality + acos - Returns current settings for particles quality (configure- video- general- particles). 0-low, 1-normal, 2-high + ArcCosine of a number, result in Degrees - https://community.bistudio.com/wiki/particlesQuality + https://community.bistudio.com/wiki/acos - particlesQuality + acos Number - particlesQuality + acos x - $Code$_currentQuality = particlesQuality ;$/Code$ + $Code$_degrees = acos 0.5 + // returns 60$/Code$ undefined / undefined @@ -46288,195 +47393,243 @@ - Number + Number + - pickWeaponPool + lbSetPictureRightColor - Transfer weapons and magazines from cargo of object into weapon pool (used in campaign to transfer weapons into next mission). + Sets the color of the second (right aligned) picture of the given index of the listbox with id idc of the topmost user dialog to the given color. Color is in format Color. Color which consists from only zeros means disable this override. - https://community.bistudio.com/wiki/pickWeaponPool + https://community.bistudio.com/wiki/lbSetPictureRightColor - pickWeaponPool Object + lbSetPictureRightColor Array + + Control lbSetPictureRightColor Array - pickWeaponPool object + lbSetPictureRightColor [idc, index, color] + + control lbSetPictureRightColor [index, color] - + $Code$lbSetPictureRightColor [101, 0, [0, 1, 0, 0.5]];$/Code$ + + $Code$_ctrl lbSetPictureRightColor [0, [1, 1, 1, 1]];$/Code$ + undefined / undefined + More information on the LB command family can be found here - Nothing + Nothing - Nothing + - pitch + primaryWeaponItems - Returns the pitch of a persons voice. + Returns array with all items assigned to the primary weapon. This command is used for infantry weapons only. - https://community.bistudio.com/wiki/pitch + https://community.bistudio.com/wiki/primaryWeaponItems - pitch Object + primaryWeaponItems Object - pitch person + primaryWeaponItems unit - $Code$pitch player$/Code$ + $Code$primaryWeaponItems player ; + /* + [ + "muzzle_snds_H",//silencer + "acc_pointer_IR",//laser + "optic_Aco",//optics + "bipod_01_F_blk"//bipod + ] + */$/Code$ undefined / undefined + (March 16, 2015) + Since revision 129742, this command also returns an attached bipod. - Number + Array + - pixelGridBase + getOxygenRemaining - Returns grid size based on screen resolution. + Returns amount of remaining oxygen. - https://community.bistudio.com/wiki/pixelGridBase + https://community.bistudio.com/wiki/getOxygenRemaining - pixelGridBase + getOxygenRemaining Object - pixelGridBase + getOxygenRemaining unit - $Code$_gridBaseHeight = pixelH * pixelGridBase ;$/Code$ + $Code$_oxygen = getOxygenRemaining player;$/Code$ undefined / undefined + (October 24, 2014) + Unit will die instantly at 0 oxygen unlike some other games that permit a certain amount of time after oxygen is depleted. - Number + Number + - pixelGridNoUIScale + roleDescription - Returns grid size based on screen resolution and configs: uiScaleFactor, uiScaleMaxGrids - As mentioned in the name of this command, the user interface scale is ignored. + Returns unit description set in Editor and visible on role selection screen in MP. Works in MP and SP. - https://community.bistudio.com/wiki/pixelGridNoUIScale + https://community.bistudio.com/wiki/roleDescription - pixelGridNoUIScale + roleDescription Object - pixelGridNoUIScale + roleDescription unit - $Code$_gridHeightNoUIScale = pixelH * pixelGridNoUIScale ;$/Code$ + $Code$_playerRole = roleDescription player ;$/Code$ undefined / undefined + (June 29, 2015) + One thing you should know about roles. When switching to units placed in editor on the fly in MP, it could mess up the role of the player. Could be bug, could be intended, but I would not recommend doing this. Create new unit dynamically if you need to switch to. Anyway, if role of the unit is messed up so is roleDescription. + + (May 26, 2017) + roleDescription works for playableUnits only. That means not on AI disabled in lobby and not in SP (even for player). - Number + String + - pixelGrid + setCuratorEditingAreaType - Returns grid size based on screen resolution, UI size and configs: uiScaleFactor, uiScaleMaxGrids. + Set whether curator can edit in all editing areas (true) or outside of them (false). - https://community.bistudio.com/wiki/pixelGrid + https://community.bistudio.com/wiki/setCuratorEditingAreaType - pixelGrid + Object setCuratorEditingAreaType Boolean - pixelGrid + curatorObj setCuratorEditingAreaType bool - $Code$_gridHeight = pixelH * pixelGrid ;$/Code$ + $Code$curatorModule setCuratorEditingAreaType true$/Code$ undefined / undefined + This scripting command must be executed on the server to work properly in multiplayer - Number + Nothing + - pixelH + limitSpeed - Returns the height of one pixel for current resolution. + Limit speed of given vehicle or person to given value (in km/h). - https://community.bistudio.com/wiki/pixelH + https://community.bistudio.com/wiki/limitSpeed - pixelH + Object limitSpeed Number - pixelH + objectName limitSpeed speed - $Code$_pixelHeight = pixelH ;$/Code$ + $Code$// Adjust "speedLimit" variable to change limited speed. (A3 1.24 we don't need loop for a continus effect, limitSpeed alone is enough.) + _this setVariable ["speedLimit", 200]; + _nul = _this spawn { + while { canMove _this} do { + _this limitSpeed (_this getVariable "speedLimit"); + sleep 0.1; + }; + };$/Code$ + + $Code$["SpeedObserver","onEachFrame",{ hintSilent format ["%1", speed vehicle MyVehicle]},[]] call BIS_fnc_addStackedEventHandler ; + sleep 10; + MyVehicle limitSpeed 5; //Watch the effect of this command.$/Code$ undefined / undefined + (9 February 2008) + (A1 1.08.5163)Has only an temporary effect on the vehicle specified (i.e. vehicle goes back to its previous speed right away). So, in order for this command to have a real, noticeable effect, it would have to be issued continuously (e.g. via a script loop, but in A3 1.24 it's unnecessary). + + (29 July 2014) + (A3 1.24)To clarify, limitSpeed only do effect on non-player controlled AI units, it has continuous effect and AI won’t break through the speed limitation until one is contacted, engaged or regrouped. - Number + Nothing + - pixelW + sideAmbientLife - Returns width of one pixel for current resolution. + Returns side of ambient life, for example ambient life placed in Eden Editor. - https://community.bistudio.com/wiki/pixelW + https://community.bistudio.com/wiki/sideAmbientLife - pixelW + sideAmbientLife - pixelW + sideAmbientLife - $Code$_pixelWidth = pixelW ;$/Code$ + $Code$_sideAmbientLife = sideAmbientLife ;$/Code$ undefined / undefined @@ -46484,28 +47637,34 @@ - Number + Side + - pi + lbPictureRight - pi (180 degrees converted to Radians ). + Returns the right picture name of the item with the given index of the listbox or combobox with id idc of the topmost user dialog. - https://community.bistudio.com/wiki/pi + https://community.bistudio.com/wiki/lbPictureRight - pi + lbPictureRight Array + + Control lbPictureRight Number - pi + lbPictureRight [idc, index] + + control lbPictureRight index - $Code$_radians = 2*pi - // Result is 6.2830$/Code$ + $Code$_picture = lbPictureRight [101, 0];$/Code$ + + $Code$_picture = _control lbPictureRight 0;$/Code$ undefined / undefined @@ -46513,136 +47672,156 @@ - Number + String - String + - playActionNow + ctrlSetTooltip - When used on a person, a smooth transition to the given action will be initiated, but all previous playAction are discarded. - For Arma 3 actions see: playAction/actions. + Sets tooltip text of given control. - https://community.bistudio.com/wiki/playActionNow + https://community.bistudio.com/wiki/ctrlSetTooltip - Object playActionNow String + Control ctrlSetTooltip String - soldier playActionNow action + control ctrlSetTooltip text - $Code$soldierOne playActionNow "SitDown";$/Code$ + $Code$_control ctrlSetTooltip "tooltip";$/Code$ - $Code$rabbitTwo playActionNow "WalkF";$/Code$ + $Code$findDisplay 10000 displayCtrl 10001 ctrlSetTooltip "ThisIsAGoodTip";$/Code$ + + $Code$with uiNamespace do + { + bar = findDisplay 46 createDisplay "RscDisplayEmpty" ctrlCreate ["RscProgress", -1]; + bar ctrlSetPosition [0,0,1,0.01]; + bar ctrlCommit 0; + bar progressSetPosition 0.75; + bar ctrlSetTooltip "lalalalalalalala"; + };$/Code$ - local / global + undefined / undefined - (October 12, 2010) - Some other possible playactions: - "walkf" - walk forward - "walkb" - walk backwards - "walkr" - strafe right - "walkl" - strafe left - "grabdrag" - initiate First Aid dragging animation - "stopdrag" - stops First Aid dragging animation - "reloadMagazine" - reloads the current magazine - "gestureFreeze" - hand signal "Freeze" - "GestureGo" - "GestureCover" - "GestureAttack" - "GestureCeaseFire" - "GestureFollow" - "GestureUp" - "GestureAdvance" - "GesturePoint" - Note that playAction works regardless of stance (rifle up, down, crouched, prone). + (September 26, 2017) + NOTE : If you want to recieve a multi-line tooltip, you can simply input newline escape symbol in your text: + $Code$_ctrl ctrlSetTooltip "Your text\nYour text on next line";$/Code$ + Localization files (stringtable.xml) also supports that. - Nothing + Nothing + - playAction + setVehicleLock - When used on a person, a smooth transition to the given action will be initiated. - For Arma 3 actions see: playAction/actions. + Sets vehicle lock. Possible values: + "UNLOCKED" + "DEFAULT" + "LOCKED" + "LOCKEDPLAYER" - https://community.bistudio.com/wiki/playAction + https://community.bistudio.com/wiki/setVehicleLock - Object playAction String + Object setVehicleLock String - soldier playAction action + vehicleName setVehicleLock lockState - $Code$soldierOne playAction "SitDown"$/Code$ + $Code$_veh1 setVehicleLock "LOCKED";$/Code$ local / global + (October 22, 2014) + In Arma 3: + setVehicleLock "UNLOCKED" = same as " lock 0" + setVehicleLock "DEFAULT" = same as " lock 1" + setVehicleLock "LOCKED" = same as " lock 2" + setVehicleLock "LOCKEDPLAYER" = same as " lock 3" + + (March 4, 2015) + DEFAULT lock is default vehicle lock when vehicle placed in editor. If player is in a group of AIs and not the leader, he will not be able to enter this vehicle as he will not have GetIn action for this vehicle. - Nothing + Nothing + - playGesture + setMarkerBrushLocal - When used on a person,a smooth transition to the given move will be initiated. Command doesn't seem to be functional + Selects the fill texture for the marker ("RECTANGLE" or "ELLIPSE"). Brush is the name of the subclass in CfgMarkerBrushes. + brush can be: + "Solid" + "SolidFull" (A3 only) + "Horizontal" + "Vertical" + "Grid" + "FDiagonal" + "BDiagonal" + "DiagGrid" + "Cross" + "Border" (A2/A3 only) + "SolidBorder" (OA/A3 only) - https://community.bistudio.com/wiki/playGesture + https://community.bistudio.com/wiki/setMarkerBrushLocal - Object playGesture String + String setMarkerBrushLocal String - soldier playGesture moveName + markerName setMarkerBrushLocal brush - $Code$soldierOne playGesture "Wave"$/Code$ + $Code$"Marker1" setMarkerBrushLocal "DiagGrid";$/Code$ - undefined / undefined + undefined / local - (August 31, 2010) - Rpt says "Not implemented" as of OA 1.54. - Nothing + Nothing + - playMission + disableDebriefingStats - The mission is launched (from the main menu). Both campaign and mission are given as their directory name. If the campaign is empty, a single mission is launched. If skipBriefing is true, the intro and briefing are skipped. + Disable debriefing score table. + This command is broken. - https://community.bistudio.com/wiki/playMission + https://community.bistudio.com/wiki/disableDebriefingStats - playMission Array + disableDebriefingStats - playMission [campaign, mission, skipBriefing] + disableDebriefingStats - $Code$playMission ["XOutrage","x05Negotiator.Noe"]$/Code$ + $Code$disableDebriefingStats ;$/Code$ undefined / undefined @@ -46650,342 +47829,229 @@ - Nothing + Nothing + - playMoveNow + camCommit - When used on a person,a smooth transition to the given move will be initiated, but all previous playMove are discarded. - List of moves in ArmA 2 List of moves in Armed Assault List of moves in Operation Flashpoint: Resistance - The difference between playMove and playMoveNow is that playMove adds another move to the move queue, while playMoveNow replaces the whole move queue with new move: - $Code$ player switchMove "amovpercmstpsraswrfldnon"; - [] spawn - { - sleep 0.5; - player playMove "amovppnemstpsraswrfldnon"; // player goes prone - player playMove "amovpknlmstpsraswrfldnon"; // player gets up on one knee - };$/Code$ - Compared to: - $Code$ player switchMove "amovpercmstpsraswrfldnon"; - [] spawn - { - sleep 0.5; - player playMove "amovppnemstpsraswrfldnon"; // player never goes prone - player playMoveNow "amovpknlmstpsraswrfldnon"; // player goes down on one knee straight away - };$/Code$ + Smoothly conduct the changes that were assigned to a camera within the given time. If the time is set to zero, the changes are done immediately. - https://community.bistudio.com/wiki/playMoveNow + https://community.bistudio.com/wiki/camCommit - Object playMoveNow String + Object camCommit Number - soldier playMoveNow moveName + camera camCommit time - $Code$player playMoveNow "AmovPercMevaSlowWrflDf"$/Code$ + $Code$// SQS + ; create a camera object + _cam = "camera" camCreate [5600,4800,10] + _cam camSetTarget player + _cam cameraEffect ["internal", "BACK"] + _cam camCommit 0 + ; smoothly move the camera to its new position in 6 seconds + _cam camSetPos [5680,4720,20] + _cam camCommit 6 + @ camCommitted _cam + ; proceed$/Code$ + + $Code$// SQF + private "_cam"; + comment "create a camera object"; + _cam = "camera" camCreate [ position player select 0, position player select 1, 2]; + _cam camSetTarget player ; + _cam cameraEffect ["internal", "BACK"]; + _cam camCommit 0; + comment "smoothly move the camera to its new position in 6 seconds"; + _cam camSetPos [ position player select 0, ( position player select 1) + 10, 20]; + _cam camCommit 6; + waitUntil { camCommitted _cam; };$/Code$ - local / global + local / local - Nothing + Nothing + - playMove + switchableUnits - When used on person, smooth transition to given move will be done. - List of moves in ArmA 2 List of moves in Armed Assault List of moves in Operation Flashpoint: Resistance - The difference between playMove and playMoveNow is that playMove adds another move to the move queue, while playMoveNow replaces the whole move queue with new move: - $Code$ player switchMove "amovpercmstpsraswrfldnon"; - [] spawn - { - sleep 0.5; - player playMove "amovppnemstpsraswrfldnon"; // player goes prone - player playMove "amovpknlmstpsraswrfldnon"; // player gets up on one knee - };$/Code$ - Compared to: - $Code$ player switchMove "amovpercmstpsraswrfldnon"; - [] spawn - { - sleep 0.5; - player playMove "amovppnemstpsraswrfldnon"; // player never goes prone - player playMoveNow "amovpknlmstpsraswrfldnon"; // player goes down on one knee straight away - };$/Code$ + Returns a list of playable units available for switching to. Command is relative to the client on which it is executed and will only show playable units for the same side as player 's group + player himself. The playableUnits command on the other hand will show all playable units regardless of the side. Exception is SP, where playable units from all sides will be accessible via this command. Dead units are automatically removed from the resulting array. Playable units that are already occupied by other human players will also not show in the results. + NOTE that in Multiplayer, switchableUnits are only available when respawn type is set to SIDE or GROUP. In all other cases it is an empty array []. - https://community.bistudio.com/wiki/playMove + https://community.bistudio.com/wiki/switchableUnits - Object playMove String + switchableUnits - unitName playMove moveName + switchableUnits - $Code$soldierOne playMove "Stand"$/Code$ - + - local / global + undefined / local - For an immediate transition use switchMove. This command must be executed after mission start. If you place it into init.sqs / init.sqf or in the Init field of some unit, it will not work. Just add a little delay (~0.001) and then place the command. + (July 06, 2011) + On dedicated server this command returns empty array. - Nothing + Array + - playMusic + ropeUnwound - Plays music defined in Description.ext#CfgMusic or config.cpp. To stop the music execute playMusic "" or give the start time which is beyond the music duration playMusic ["SomeMusic", 1000]; - For Arma 3 music, see Arma 3 CfgMusic. Since Arma 3 v1.67 one can use Jukebox Utility to preview in-game music. + False if unwinding in progress, otherwise true - https://community.bistudio.com/wiki/playMusic + https://community.bistudio.com/wiki/ropeUnwound - playMusic String - - playMusic Array + ropeUnwound Object - playMusic name - - playMusic [name, start] + ropeUnwound rope - $Code$playMusic "RadioAmbient1";$/Code$ - - $Code$playMusic ["RadioAmbient3", 3]; //start from 00:00:03$/Code$ - - $Code$// Play from 00:00:01 to 00:00:05 - 0 = [] spawn { - playMusic ["RadioAmbient5", 1]; - sleep 4; - playMusic ""; - };$/Code$ + $Code$_isUnwound = ropeUnwound ( ropes heli1 select 0);$/Code$ - undefined / local + undefined / undefined - You can get all Music Types from Arma:_cfgMusic - http://community.bistudio.com/wiki/Arma_2:_Music#top - Nothing - Nothing + Boolean + - playScriptedMission + addCamShake - Load the given world, launch an empty mission and execute the given, expression. Config (optional) can reference to the config entry, replacing description.ext for this mission. + Creates the camera shaking effect, like when you are near an explosion - https://community.bistudio.com/wiki/playScriptedMission + https://community.bistudio.com/wiki/addCamShake - playScriptedMission Array + addCamShake Array - playScriptedMission [world,expression,config,ignoreChildWindow] + addCamShake [power, duration, frequency] - $Code$playScriptedMission - [ - "desert_e", - { - private["_handle"]; - _handle = execVM "\ca\missions_e\data\scenes\credits1\init.sqf"; - }, - configFile/"CfgMissions"/"Cutscenes"/"Credits" - ];$/Code$ + $Code$addCamShake [10, 1, 25];$/Code$ + + $Code$enableCamShake true ; + addCamShake [5, 5, 25];$/Code$ - undefined / undefined + undefined / local - (December 31, 2015) - For this command to work, you will need to - call command with ignoreChildWindow param set to true (in VBS docs its called fromMission) - close any opened display (not sure about this part, but closing every display (but #0) seems to work): - If mission is run from 2D editor, you can just close RscDisplayArcadeMap display (idd 26) (because this was done from 2D editor, so RscDisplayArcadeMap is still active in background -- benargee ) - If mission is run from single mission browser, you can just close RscDisplaySingleMission (idd 2) - end mission - Debriefing will show and player will be moved to new mission after clicking on Continue. - Command is a bit bugged: - Third (config) param doesn't seem to work - If you run this command in mission loaded from pbo, said pbo won't be writable until you close the game (you can't update it) - Following code will change change island to Stratis and spawns player as basic soldier at [0,0,0] coordinates. - $Code$disableSerialization; - playScriptedMission ['Stratis',{ - createCenter west; - _grp = createGroup west; - _player = _grp createUnit ["B_Soldier_F",[0,0,0],[],0,"NONE"]; - selectPlayer _player; - },missionConfigFile, true]; - //Close all displays that could be the background display... this is essentialy forceEnd command - //Closing #0 will cause game to fail - _zero = findDisplay(0); - { - if (_x != _zero) then { - _x closeDisplay 1; - }; - } foreach allDisplays; - failMission "END1";$/Code$ - (tested in Arma 3 1.54.133741) - Nothing + Nothing + - playSound3D + doGetOut - Plays positional sound with given filename on every computer on network. At least 2 parameters must be specified. + Orders a unit or units to get out from the vehicle (silently). - https://community.bistudio.com/wiki/playSound3D + https://community.bistudio.com/wiki/doGetOut - playSound3D Array + doGetOut Object/Array - playSound3D [filename, soundSource, isInside, soundPosition, volume, soundPitch, distance] + doGetOut unit - $Code$playSound3D ["A3\Sounds_F\sfx\blip1.wav", player ]$/Code$ - - $Code$playSound3D ["A3\Sounds_F\sfx\blip1.wav", player, false, getPosASL player, 1, 1, 0]$/Code$ - - $Code$// Sound file extension must be specified even if a config entry has none: - playSound3D ["A3\Sounds_F\sfx\alarm_independent", player ]; //no sound - playSound3D ["A3\Sounds_F\sfx\alarm_independent.wss", player ]; //alarm$/Code$ + $Code$doGetOut _unitOne$/Code$ - global / global + local / global - (September 23, 2013) - This command works well with addon sounds, however getting it to play mission sound files is a bit tricky. Follow this guide - - (September 26, 2014) - Currently, playSound3D is not JIP compatible, so joining players will not hear the sound if is started before and is still playing when player joins. - - (October 16, 2013) - You need to get the correct path for custom mission sounds. Use missionConfigFile with BIS_fnc_trimString (to trim off " description.ext "), then add your mission's sound directory and sound file: - $Code$_soundPath = [( str missionConfigFile ), 0, -15] call BIS_fnc_trimString; - _soundToPlay = _soundPath + "sounds\some_sound_file.ogg"; - playSound3D [_soundToPlay, _sourceObject, false, getPos _sourceObject, 10, 1, 50]; - //Volume db+10, volume drops off to 0 at 50 meters from _sourceObject$/Code$ - - (November 8, 2014) - When object is supplied but not a position, the position is taken from object, otherwise the position is taken from supplied position. That doesn't mean that when position is taken from object it is going to follow object when it changes position. The sound is generated at object position and it stays there. - Nothing + Nothing + - playSound + getAimingCoef - Selects sound from Description.ext#CfgSounds or config.cpp. + Get current aiming coefficient (higher ~ less precise, default is 1) - https://community.bistudio.com/wiki/playSound + https://community.bistudio.com/wiki/getAimingCoef - playSound String - - playSound Array + getAimingCoef Object - playSound soundName - - playSound [soundName, isSpeech] + getAimingCoef unit - $Code$playSound "soundname"$/Code$ - - $Code$// Start a sound and then stop it after 1.2 second: - playSound "AlarmCar"; - [] spawn - { - _sound = ASLToAGL [0,0,0] nearestObject "#soundonvehicle"; - sleep 1.2; - deleteVehicle _sound; - };$/Code$ - - $Code$// Start a sound and wait until it is finished: - playSound "Alarm"; - hint "Started!"; - [] spawn - { - _sound = ASLToAGL [0,0,0] nearestObject "#soundonvehicle"; - waitUntil { isNull _sound}; - hint "Finished!"; - };$/Code$ + $Code$_coef = getAimingCoef player$/Code$ - undefined / local + undefined / undefined - (August 4, 2006) - Notes from before the conversion: - For dialogue involving living units it is better to use say, playSound will play a sound at the location of the player, say will play a sound at the location of the unit that is speaking, and it will only play that sound if the unit is alive. - - (December 28, 2014) - As you may have noticed, the parameter for playsound/say3d that deals with the "volume" of the sound played has little to do with the effective loudness heard in game. What it is alters is the drop off for fading the sound at a distance. A higher decibel or integer value will increase the distance before any sort of fading will take place. The actual volume of the sound file played will factor in to this, as it does throughout the playing action. - Amplifying the Sound - Modifying the effective volume of sounds played by the engine is possible by "spamming" the sounds. By quickly playing the sounds overtop of one another, you can effectively amplify the volume - This example, - $Code$ - playSound "soundname"; - playSound "soundname"; - $/Code$ - Will effectively amplify the sound by a sensed 2x. The volume of the sound file itself will still affect the sound volume as it appears as though the arma engine has no normalization for sound files added to it. - This technique may cause issues in sound quality in large multiplayer servers. I observed multiple instances when a triggered sound amplified with this method was out of sync with each other. Timing of the individual commands sent over the network is probably the issue. Recommend you compile your amplification code into a single finished function for better syncing for clients not activating the action/far away from the activation position. - Nothing - Nothing + Number + - playableSlotsNumber + reload - Returns the number of available slots in mission per side (both empty and taken). In singleplayer mission, it returns number of playable units per side. + Reload all weapons - https://community.bistudio.com/wiki/playableSlotsNumber + https://community.bistudio.com/wiki/reload - playableSlotsNumber Side + reload Object - playableSlotsNumber side + reload unitName - $Code$_maxBluforPlayers = playableSlotsNumber blufor ;$/Code$ + $Code$if ( needReload player == 1) then { reload player };$/Code$ undefined / undefined @@ -46993,283 +48059,226 @@ - Number + Nothing + - playableUnits + diag_logSlowFrame - Returns a list of playable units in a multiplayer game (occupied by both AI or players), created on the following sides east, west, resistance / independent and civilian only. Does not contain units of sideLogic. This does not include dead players awaiting for respawn. + Log all frames, where section takes longer than the threshold (in seconds). + Note : Only available in specific builds. See Performance Profiling for details. - https://community.bistudio.com/wiki/playableUnits + https://community.bistudio.com/wiki/diag_logSlowFrame - playableUnits + diag_logSlowFrame Array - playableUnits + diag_logSlowFrame [section, threshold] - $Code${_x groupChat "I'm a playable unit.";} forEach playableUnits ;$/Code$ - - $Code$// All playable units in a group: - _playableInGroup = units group player arrayIntersect playableUnits ;$/Code$ - - $Code$// All non-playable units in a group: - _playableInGroup = units group player - playableUnits ;$/Code$ + $Code$diag_logSlowFrame ['total',0.3]$/Code$ undefined / undefined - (July 13, 2009) - In single-player missions, this command will return an empty array. - - (December 23, 2014) - To get a list of all player-controlled units: - $Code$_allPlayers = []; - { - if ( isPlayer _x) then - { - _allPlayers pushBack _x; - }; - } forEach playableUnits ;$/Code$ - - (April 15, 2015) - Quote: $Code$ Killswitch - In single-player missions, this command will return an empty array.$/Code$ - Use the switchableUnits command instead - - (August 16, 2015) - playableUnits will not return dead players, use allPlayers instead. - - (February 14, 2017) - Using the Editor (multiplayer attributes) for unchecking "enable AI", or disabling AI(s) in lobby, will make playableUnits as a public variable, updated by each JIP on disabled slot. So, if all slots are diabled AI, playableunits is same as allPlayers - Furthermore, in this case, non-played slot (playable and disabled AI) units simply don't exist! i.e. If you name 8 playable units: u1..to u8, then 2 players in game: u3 & u6 - playableUnits will return [u3,u6], and true for isNil "u1", isNil "u2"... until another player takes the slot. - Array + Nothing + - playerRespawnTime + and - Return the player remaining time to respawn or -1 if it is not available. + Returns true only if both conditions are true. In case of the alternative syntax, lazy evaluation is used (if left operand is false, evaluation of the right side is skipped completely). - https://community.bistudio.com/wiki/playerRespawnTime + https://community.bistudio.com/wiki/and - playerRespawnTime + Boolean and Boolean + + Boolean and Code - playerRespawnTime + a and b + + a and b - $Code$waitUntil { playerRespawnTime = 0};$/Code$ + $Code$if (( alive player ) and (_enemycount == 0)) then { hint "you win !"}$/Code$ + + $Code$if (( count _array 0) and {(_array select 0) == player }) then { hint "It works! Without lazy evaluation it would throw an error if array was empty."}$/Code$ undefined / undefined - (June 21, 2007) - When playerRespawnTime reaches zero the player respawns as expected. When the player has completed respawning this command returns -1. - - (February 25, 2009) - Also note that spawning doesn't create a body to use, but allows a player to choose an already - existing one as defined either in the mission editor or in a script as player or playable. + (April 12, 2015) + Just like the "or" command, the "and" command allows several conditions to be checked. Example: + $Code$if(alive player and speed player 0 and _someOtherVar) then { hint"All three condtions are true" };$/Code$ + The example above will check if the player is alive and if the player is moving and checks if _someOtherVar is true. - Number + Boolean - Boolean + - playerSide + lnbAddArray - Returns the player's side. This is valid even when the player controlled person is dead (a difference from side player ). + Adds list of rows of strings. - https://community.bistudio.com/wiki/playerSide + https://community.bistudio.com/wiki/lnbAddArray - playerSide + lnbAddArray Array - playerSide + lnbAddArray [idc, [[[text,text],[value,],[data,]],[[text,text],[value,],[data,]],]] - $Code$if ( side man1 == playerSide ) then { - hint "man1 is on your side!"; - };$/Code$ - - $Code$switch ( playerSide ) do { - case west : { - hint "You are BLUFOR"; - }; - case east : { - hint "You are OPFOR"; - }; - };$/Code$ + $Code$lnbAddArray [102,[[["#1"],[1],["#1"]]]];$/Code$ - undefined / undefined + local / local - (27 Jan, 2008) - playerSide defaults to west for JIP players early on during initialization regardless of their side. - So if you are a JIP player on another side (like east ), you will need to cater for this for any early initializations. - - (13 Oct, 2008) - playerSide also shows your starting side, even if your side changes to enemy due to a bad rating. In that case, playerSide != side player. - Side + Number + - playersNumber + setVehicleCargo - Returns count of occupied role selection slots for given side. Players who claimed a slot in the lobby but didn't start the mission are counted as well. If disabledAI = 0; in description.ext or Enable AI option is checked in 3DEN, AI bots will be treated as valid players and will be counted too. Multiplayer only, in singleplayer always returns 0. + Load cargo vehicle inside vehicle if possible, returns bool based on whether the vehicle was able to be loaded. Can also be used to unload a specific loaded vehicle or all loaded vehicles. - https://community.bistudio.com/wiki/playersNumber + https://community.bistudio.com/wiki/setVehicleCargo - playersNumber Side + Object setVehicleCargo Object - playersNumber side + vehicle setVehicleCargo cargo - $Code$_west = playersNumber west ; - _east = playersNumber east ; - _civ = playersNumber civilian ; - hint format ["West:%1 East:%2, Civ:%3", _west, _east, _civ];$/Code$ + $Code$// Blackfish with no vehicle cargo loaded + _success = blackfish setVehicleCargo offroad; //true$/Code$ + + $Code$// Blackfish with full cargo already loaded + _success = blackfish setVehicleCargo offroad; //false$/Code$ + + $Code$// Unload specific loaded vehicle + _success = objNull setVehicleCargo offroad;$/Code$ + + $Code$// Unload all vehicles + _success = blackfish setVehicleCargo objNull ;$/Code$ undefined / undefined - (April 13, 2015) - playersNumber returns playable AI as well as human players. It does not include non playable AI. [NOTE: This was observed in ArmA 1.05] - To get the amount of players that are on the same side as the person executing the script: - $Code$playersNumber playerSide;$/Code$ + (July 4, 2016) + From biforums : + "objnull setVehicleCargo cargo vehicle - will unload specific loaded vehicle" and "transporting vehicle setVehicleCargo objnul - unload all vehicles" - Number + Boolean + - player + allCutLayers - Person controlled by player. - In MP this value is different on each computer and on dedicated server this value is null. - In Intros and Outros this isn't set by default and must be assigned. + Returns all named layers used by cutRsc, cutText, cutObj or cutFadeOut. The layer normally would be added on the first use of any of the aforementioned commands, however if a layer needs to be reserved it could be done like so: _layerNum = "myLayerName" cutFadeOut 0;. The index of the layer name in the array corresponds to the layer number the cut effect will be displayed on. If no layers were defined, the return is [""], because 0 layer is reserved for usage in cut commands without layer param or when name of the layer given is empty "". - https://community.bistudio.com/wiki/player + https://community.bistudio.com/wiki/allCutLayers - player + allCutLayers - player + allCutLayers - $Code$player addRating 500;$/Code$ + $Code$_allLayers = allCutLayers ;$/Code$ undefined / undefined - (20 Jul, 2010) - Before you use the player object (usually to avoid JIP issues) all you need is to run: - waitUntil {!isNull player}; - Anything else you see in other scripts is equivalent and/or redundant. Of course JIP players may need more than just the player to point at the actual JIP player unit, but that's script/mission-specific. - - (27 Jan, 2008) - ( isNull player ) is true for JIP players on their client during initialization. - After initialization, it will be set, making it valid again. - To cater for this, some people use code similar to the following in their spawned scripts: - if (!isServer && (player != player)) then - { - waitUntil {player == player}; - waitUntil {time 10}; - }; - // 'player' will now be valid - _action = player addAction ["heal", "heal.sqf", [], -1, false, false, ""]; - See JIP/player topic for additional helpful information. - - (June 26, 2014) - player can actually be REMOTE object on player's PC: http://www.youtube.com/watch?v=m6IILtfa3cQ - Object + Array + - posScreenToWorld + onPreloadStarted - Convert screen coordinates in map to world coordinates. + Defines an action performed just before the preload screen started. Preload event occurs after briefing screen on mission start. + i + Since Arma 3 v1.57 a stackable version of this EH is available: PreloadStarted + In order to keep compatibility between official and community content the functions BIS_fnc_addStackedEventHandler and BIS_fnc_removeStackedEventHandler should be used instead. - https://community.bistudio.com/wiki/posScreenToWorld + https://community.bistudio.com/wiki/onPreloadStarted - Control posScreenToWorld Array + onPreloadStarted String/Code - map posScreenToWorld [x, y] + onPreloadStarted command - $Code$_WorldCoord = _Control posScreenToWorld _ScreenCoord$/Code$ - - $Code$_WorldCoord = _Control posScreenToWorld [_x,_y]$/Code$ + $Code$onPreloadStarted { diag_log "preload started"};$/Code$ undefined / undefined - (April 7, 2007) - Notes: - You can get the screen coordinates by the UI Event Handlers onMouseButtonDown, onMouseButtonUp, onMouseButtonClick, onMouseButtonDblClick. - The return Array is in 2-D, you can use it with all set-position commands. - _x = returnArray select 0; - _y = returnArray select 1; - Array + Nothing + - posWorldToScreen + groupIconSelectable - Convert world coordinates to screen coordinates in map. + Return if groups icon raises onClick and onOver events. - https://community.bistudio.com/wiki/posWorldToScreen + https://community.bistudio.com/wiki/groupIconSelectable - Control posWorldToScreen Array + groupIconSelectable - map posWorldToScreen position + groupIconSelectable @@ -47279,142 +48288,120 @@ - Array + Boolean + - positionCameraToWorld + ctAddHeader - Transforms position from camera coordinate space to world coordinate space. - Camera axes are relative to camera orientation. x axis goes from left of the camera to right of the camera, z axis goes from underneath the camera to above the camera and y axis goes from back of the camera to where the camera is looking. + Adds a header line of controls according to the HeaderTemplate class. It returns an array containing header index and array of created controls in a format [ headerIndex, [ control0, control1... control n ]]. + Note that rows and headers are indexed separately. - https://community.bistudio.com/wiki/positionCameraToWorld + https://community.bistudio.com/wiki/ctAddHeader - positionCameraToWorld PositionRelative + ctAddHeader Control - positionCameraToWorld cameraPos + ctAddHeader Control - $Code$_worldPos = positionCameraToWorld _cameraPos;$/Code$ - - $Code$// Example demonstrating reversed y and z: - player setDir 0; //assuming player is looking forward - hint str [ positionCameraToWorld [0,0,0], positionCameraToWorld [0,0,1]]; - //[[2481.35,567 1.21,1.51395],[2481.35,567 2.21,1.46955]]$/Code$ + $Code$_array = ctAddHeader _control;$/Code$ - undefined / undefined + local / local - (October 17, 2008) - By measuring the distance between the camera and the player one can determine whether 1st-person or 3rd-person view is being used: - $Code$ if (( positionCameraToWorld [0,0,0] distance player ) 2) then { hint "3rd person"} else { hint "1st person"};$/Code$ - - (22:45, 17 October 2010 (CEST)) - The camera coordinate system is different from the model coordinate system: when modelToWorld uses [x, y, z] then positionCameraToWorld uses [x, z, y]. So for a steady camera the following is true: - $Code$ positionCameraToWorld [5,10,15] == _camera modelToWorld [5,15,10];$/Code$ - - (July 20, 2014) - When over land, the position returned is in format PositionATL, and over sea, PositionASLW. - Array + Array + - position + ctrlMapAnimClear - Synonym for getPos. + Clears the map animation. - https://community.bistudio.com/wiki/position + https://community.bistudio.com/wiki/ctrlMapAnimClear - position Object/Location + ctrlMapAnimClear Control - position object + ctrlMapAnimClear controlName - $Code$_pos = position player ;$/Code$ - + - undefined / undefined + local / local - Array + Nothing + - ppEffectAdjust + isWalking - Set post process effect parameters. NOTE: The two syntaxes differ in what format of the params they accept. The syntax with PP name expects colors to be packed into arrays within main array, while the syntax with PP handle can handle both flat and packed array. Therefore it is recommended to use the universal packed format, such as shown in the examples. + Returns true if walk is toggled (W+S in Arma 3). - https://community.bistudio.com/wiki/ppEffectAdjust + https://community.bistudio.com/wiki/isWalking - String ppEffectAdjust Array - - Number ppEffectAdjust Array + isWalking Object - effect ppEffectAdjust settings - - effect ppEffectAdjust settings + isWalking unitName - $Code$"colorCorrections" ppEffectAdjust [1, 1, -0.01, [0, 0, 0, 0], [1.5, 1, 1.2, 0.6], [0.199, 0.587, 0.114, 0]];$/Code$ - - $Code$// Black&White: - _colorCorrectionsEffHandle ppEffectAdjust [1, 0.4, 0, [0, 0, 0, 0], [1, 1, 1, 0], [1, 1, 1, 0]];$/Code$ + $Code$_bool = isWalking player ;$/Code$ - undefined / local + global / undefined + (March 8, 2015) + To expand on the limited description, this command doesn't necessarily say whether or not the unit is currently walking. All it says is that walking is toggled on or off. This command can still return true when the unit is sprinting. When walking is toggled on, the unit will return to walking pace when not sprinting. When walking is toggled off, the unit will return to jogging pace when not sprinting. This command is not intended to gauge a units current movement speed. - Nothing - Nothing + Boolean + - ppEffectCommitted + attachedTo - Check whether given post process effect is committed + Returns the object it is attached to. + Returns objNull if not attached to anything. - https://community.bistudio.com/wiki/ppEffectCommitted + https://community.bistudio.com/wiki/attachedTo - ppEffectCommitted String - - ppEffectCommitted Number + attachedTo Object - ppEffectCommitted effect - - ppEffectCommitted effect + attachedTo object - $Code$ppEffectCommitted "colorCorrection";$/Code$ - - $Code$ppEffectCommitted _hndl;$/Code$ - - $Code$if ( ppEffectCommitted "colorCorrection") then { hint "alteration done !"};$/Code$ + $Code$if ( isNull attachedTo _obj1) then { + hint "_obj1 is not attached to anything."; + };$/Code$ undefined / undefined @@ -47422,112 +48409,86 @@ - Boolean - Boolean + Object + - ppEffectCommit + menuShortcut - Commit post process effect in given time. + Returns shortcut related to menu entry on given path. - https://community.bistudio.com/wiki/ppEffectCommit + https://community.bistudio.com/wiki/menuShortcut - String ppEffectCommit Number - - Number ppEffectCommit Number - - Array ppEffectCommit Number + menuShortcut Array - effect ppEffectCommit commit - - effect ppEffectCommit commit - - [effect1,] ppEffectCommit commit + menuShortcut [idc, path] - $Code$"colorCorrection" ppEffectCommit 3;$/Code$ - - $Code$_hndl ppEffectCommit 3;$/Code$ - - $Code$[_hndl1, _hndl2] ppEffectCommit 3;$/Code$ - + undefined / undefined - Nothing - Nothing - Nothing + Number + - ppEffectCreate + loadStatus - Creates Post process effects specified by effect name and priority. Supported effects are: - "RadialBlur" - "ChromAberration" - "WetDistortion" - "ColorCorrections" - "DynamicBlur" - "FilmGrain" - "ColorInversion" + Loads object's properties from Objects.sav file in campaign directory (from entry name). - https://community.bistudio.com/wiki/ppEffectCreate + https://community.bistudio.com/wiki/loadStatus - ppEffectCreate Array + Object loadStatus String - ppEffectCreate [name, priority] - - ppEffectCreate [[name1, priority1],] + obj loadStatus entryName - $Code$_ppGrain = ppEffectCreate ["filmGrain", 2005];$/Code$ + $Code$_ok = player loadStatus "playerState";$/Code$ undefined / undefined - (July 24, 2015) - "wetDistortion" only works if handle is used. Arma 3 (1.48.131561) - Number + Boolean + - ppEffectDestroy + set3DENObjectType - Destroy Post process effects given by handle or array of handles. + Sets the classname of one or more given Eden Editor objects. For Logic objects use set3DENLogicType - https://community.bistudio.com/wiki/ppEffectDestroy + https://community.bistudio.com/wiki/set3DENObjectType - ppEffectDestroy Number - - ppEffectDestroy Array + Array set3DENObjectType String - ppEffectDestroy effect - - ppEffectDestroy [effect1,] + objects set3DENObjectType classname - $Code$ppEffectDestroy _hndl;$/Code$ - - $Code$ppEffectDestroy [_hndl0, _hndl1, _hndl2];$/Code$ + $Code$[ get3DENMouseOver select 1] set3DENObjectType "B_crew_F"; + // turns object under cursor into a blufor crewman$/Code$ undefined / undefined @@ -47535,39 +48496,28 @@ - Nothing - Nothing + Nothing + - ppEffectEnable + ctrlSetTooltipColorText - Enable / disable Post process effects + Sets tooltip text color of given control. Color is in format Color. - https://community.bistudio.com/wiki/ppEffectEnable + https://community.bistudio.com/wiki/ctrlSetTooltipColorText - String ppEffectEnable Boolean - - Number ppEffectEnable Boolean - - Array ppEffectEnable Boolean + Control ctrlSetTooltipColorText Array - effect ppEffectEnable enable - - effect ppEffectEnable enable - - [effect1,] ppEffectEnable enable + display ctrlSetTooltipColorText color - $Code$"colorCorrections" ppEffectEnable true ;$/Code$ - - $Code$_hndl ppEffectEnable true ;$/Code$ - - $Code$[_hndl1, _hndl2] ppEffectEnable true ;$/Code$ + $Code$_control ctrlSetTooltipColorText [1, 0, 0, 1]$/Code$ undefined / undefined @@ -47575,114 +48525,147 @@ - Nothing - Nothing - Nothing + Nothing + - ppEffectEnabled + setHit - Checks whether given post process effect is enabled + Damage / repair part of object. The object must be local to the computer where command is executed. + Damage 0 means fully functional, damage 1 means completely destroyed / dead. Note: Some part names are in Czech; see translation table. - https://community.bistudio.com/wiki/ppEffectEnabled + https://community.bistudio.com/wiki/setHit - ppEffectEnabled Number + Object setHit Array - ppEffectEnabled effect + object setHit [part, damage, useEffects] - $Code$_enabled = ppEffectEnabled _hndl;$/Code$ + $Code$vehicle player setHit ["motor", 1]$/Code$ + + $Code$vehicle player setHit ["mala vrtule", 0.95]$/Code$ + + $Code$if ( local _heli) then { + _heli setHit ["velka vrtule", 0]; + } else { + hint "Vehicle " + str _heli + " must be local to this machine to do that!"; + };$/Code$ - undefined / undefined + local / global + Damaging specific parts of the vehicle will not update its overall damage value (as of v1.03): + player setHit ["hands", 0.9]; + hint str (damage player); //will return 0 + + Direct use of the names of sections of the model is likely a bad practice, and will not work on some addons. + So instead: + _MH60S setHit ["elektronika", _hit]; + should be used: + _MH60S setHit [getText(configFile "cfgVehicles" "MH60S" "HitPoints" "HitAvionics" "name"), _hit]; + + Since there is no getHit (as of 1.61), you can use canMove command to check if vehicle is capable of moving. + For land wheeled vehicles canMove will return false if any real wheel (damaging nonexistent wheels doesn't count) has hitpoint damage greater than 0.9. Having HitEngine damage greater than 0.9 will make canMove to return false as well (plus will result in vehicle exploding). HitFuel however doesn't make canMove return false even though having high HitFuel damage will make car explode. + For helicopters HitEngine with damage greater than 0.9 will make canMove return false as well. Having HitHRotor (main rotor) damaged even up to 1 will never make canMove return false. However, if HitVRotor (tail rotor) will have damage greater than 0.703608 it will make canMove return false (even though some helicopters are controllable and flyable by player with broken tail rotor). + In same manner you can use canFire to check if turret hitpoints are not damaged enough to be able to fire. (canFire always returns false if there is nobody in vehicle) + Update: Since ArmA 3 1.31 getHit has been introduced. - Boolean + Nothing + - ppEffectForceInNVG + addPlayerScores - Forces use of Post process effects in NVG. + MP server only: Adds player score. - https://community.bistudio.com/wiki/ppEffectForceInNVG + https://community.bistudio.com/wiki/addPlayerScores - Number ppEffectForceInNVG Boolean + Object addPlayerScores Array - number ppEffectForceInNVG bool + unit addPlayerScores values - $Code$_ppGrain ppEffectForceInNVG true ;$/Code$ + $Code$player addPlayerScores [0, 1, 0, 0, 1];$/Code$ undefined / undefined + This scripting command must be executed on the server to work properly in multiplayer + + (May 2, 2017) + As this command will add the given number to a player's score, a little bit of thought needs to be given to friendly-fire if it's for something like a deathmatch or a FFA, due to friendly-fire incurring negative points. So to counter this just add 2 points every time a player kills a unit from the same side: + $Code$player addPlayerScores [2, 0, 0, 0, 0];$/Code$ + The 2 points will add 1 point to counter the negative friendly-fire point and 1 point to add correctly to the score. - Nothing + Nothing + - precision + getHit - Return the precision of the given entity, how is the entity able to be precise when moving to given target. + Returns selection damage. Same as getHitPointDamage only argument is selection part instead of hit point. Note: Some part names are in Czech; see translation table. - https://community.bistudio.com/wiki/precision + https://community.bistudio.com/wiki/getHit - precision Object + Object getHit String - precision entity + vehicle getHit selection - $Code$if ( position _this distance _dangerPos = precision _this) then {...}; - //used in formationCDanger.fsm$/Code$ + $Code$player getHit "head";$/Code$ + + $Code$_car getHit "motor";$/Code$ - undefined / undefined + global / undefined - Number + Number/Nothing + - preloadCamera + saveStatus - Preload all textures and models around given Position to avoid visual artifacts after camera is moved. - Should be used before any abrupt camera change/cut. - Returns true once all data is ready. + Saves object's properties to Objects.sav file in campaign directory as entry name. - https://community.bistudio.com/wiki/preloadCamera + https://community.bistudio.com/wiki/saveStatus - preloadCamera Array + Object saveStatus String - preloadCamera position + object saveStatus name - $Code$waitUntil { preloadCamera markerPos "cam_location_2"};$/Code$ + $Code$player saveStatus "playerstate"$/Code$ undefined / undefined @@ -47690,71 +48673,58 @@ - Boolean + Boolean + - preloadObject + createMenu - Preloads all textures, materials and proxies needed to render given object. Works with both class names and objects. Returns true once all data is loaded and ready. + Creates a previously added menu. + i + Some Old Editor Command - https://community.bistudio.com/wiki/preloadObject + https://community.bistudio.com/wiki/createMenu - Number preloadObject Object - - Number preloadObject String + Control createMenu Number - distance preloadObject object - - distance preloadObject classname + map createMenu index - $Code$[] spawn - { - waitUntil {10 preloadObject "SoldierW"}; - hint "Preload finished"; - };$/Code$ - - $Code$[] spawn - { - waitUntil {10 preloadObject leader player }; - hint "Preload finished"; - };$/Code$ - + undefined / undefined - Boolean - Boolean + Nothing + - preloadSound + playMission - Makes sure that a sound can start playing without any delay once it is needed. Command works in Arma 3, but might not be implemented in earlier Arma installments. + The mission is launched (from the main menu). Both campaign and mission are given as their directory name. If the campaign is empty, a single mission is launched. If skipBriefing is true, the intro and briefing are skipped. - https://community.bistudio.com/wiki/preloadSound + https://community.bistudio.com/wiki/playMission - preloadSound String + playMission Array - preloadSound soundName + playMission [campaign, mission, skipBriefing] - $Code${ - waitUntil { preloadSound _x}; - } forEach getArray ( missionConfigFile "CfgSounds" "sounds");$/Code$ + $Code$playMission ["XOutrage","x05Negotiator.Noe"]$/Code$ undefined / undefined @@ -47762,60 +48732,59 @@ - Boolean + Nothing + - preloadTitleObj + setFatigue - Object title - Preload data the object can be defined in the Description.ext file. + Sets the person's fatigue, from 0 to 1. - https://community.bistudio.com/wiki/preloadTitleObj + https://community.bistudio.com/wiki/setFatigue - preloadTitleObj Array + Object setFatigue Number - preloadTitleObj [name, type] - - preloadTitleObj [name, type, speed, showInMap] + unit setFatigue value - $Code$_ok=preloadTitleObj ["BISLogo","plain"]$/Code$ + $Code$player setFatigue 1;$/Code$ - undefined / undefined + global / local + (05 April, 2014) + setFatigue will affect fatigue of a local unit only. If you execute it on remote unit, the getFatigue value will only change locally with no effect on remote unit. Scripted setFatigue changes don't broadcast at all. In short, use setFatigue on local units only. - Boolean + Nothing + - preloadTitleRsc + setLocalWindParams - Resource title - Preload data. - The resource can be defined in the Description.ext file. + Sets parameters for helicopter rotor wash. Visually it affects how much the grass and bushes bend under a helicopter and how big is the area of the effect. Default [1.0, 1.0]. - https://community.bistudio.com/wiki/preloadTitleRsc + https://community.bistudio.com/wiki/setLocalWindParams - preloadTitleRsc Array + setLocalWindParams Array - preloadTitleRsc [name, type] - - preloadTitleRsc [name, type, speed, showInMap] + setLocalWindParams [strength, diameter] - $Code$_ok=preloadTitleRsc ["BIS", "PLAIN"]$/Code$ + $Code$setLocalWindParams [10, 5];$/Code$ undefined / undefined @@ -47823,404 +48792,279 @@ - Boolean + Nothing + - preprocessFileLineNumbers + setFlagAnimationPhase - Returns the preprocessed content of the given file. The preprocessor is C-like, it supports comments using // or /* and */ and macros defined with #define. The return is file content starting with #line 1 "aFilename" - This is how mysterious #line keyword works: - The keyword can be used in any script, even the one made on-the-fly and executed in debug console for example. The format is: - #line number " name " - followed by new line. number could be any positive integer and name could be any name. This will be used only if an error occurs in the script. The error will contain the line: - File filename, line linenumber - where filename will be the name you set and linenumber will be number + how many lines it is from the #line line. If the error happened on the line right under #line it will add 0 to number, if on second line, it will add 1 etc. - It is possible to use more than one #line keywords, but it seems having just one at the top of the script is enough to pinpoint position of the error easily. + Sets flag position on the flag pole according to the given animation phase, where 0 is the bottom of the flag pole, 1 is the top of the flag pole. The changes to the flag position are local to the PC command is executed on. To animate flag use BIS_fnc_animateFlag - https://community.bistudio.com/wiki/preprocessFileLineNumbers + https://community.bistudio.com/wiki/setFlagAnimationPhase - preprocessFileLineNumbers String + Object setFlagAnimationPhase Number - preprocessFileLineNumbers fileName + flag setFlagAnimationPhase phase - $Code$_string = preprocessFileLineNumbers "A3\ui_f\scripts\IGUI\RscUnitInfo.sqf" - // Result is: - //#line 1 "A3\ui_f\scripts\IGUI\RscUnitInfo.sqf" - //disableserialization; - //........$/Code$ + $Code$_flag1 setFlagAnimationPhase 0.5;$/Code$ - undefined / undefined + global / local - (December 17, 2013) - The main difference between preprocessFile and preprocessFileLineNumbers is that the latter adds #line keyword to the target file, which allows to log the __LINE__ error happened at and the __FILE__ error happened in. - String + Nothing + - preprocessFile + estimatedTimeLeft - Reads and processes the content of the specified file. Preprocessor is C-like, supports comments using // or /* and */ and macros defined with #define. Due to the hard-drive access this command executes (and the lack of caching) this command should not be used in time-critical script loops. + Sets the estimated time left in the game. Using this function the designer can provide a "time left" estimate that is shown in the "Game in progress" screen or in the master browser. This command works in MP only and must be executed on the server only. NOTE that since Arma 3 v1.69 the max value that can be set is 10 hours (36000 seconds) - https://community.bistudio.com/wiki/preprocessFile + https://community.bistudio.com/wiki/estimatedTimeLeft - preprocessFile String + estimatedTimeLeft Number - preprocessFile fileName + estimatedTimeLeft seconds - $Code$_content = preprocessFile "myFunction.sqf";$/Code$ + $Code$estimatedTimeLeft 600; //10 min$/Code$ + + $Code$// For missions with a hard set limit adjusted via Param1, the following example can be used in the init.sqs file: + estimatedTimeLeft Param1;$/Code$ - undefined / undefined + undefined / global - (March 4, 2008) - File path is always relative to mission directory. If script dir\a.sqf includes dir\b.sqf, use "dir\b.sqf" and not "b.sqf". - - (July 8, 2011) - Use preprocessFileLineNumbers instead as it provides more context information on error. - - (December 17, 2013) - The main difference between preprocessFile and preprocessFileLineNumbers is that the latter adds #line directive to the target file, which allows to log the __LINE__ error happened at and the __FILE__ error happened in. - - (July 25, 2014) - Essentially what the preprocessFile command does is it refers to the contents of a file as a string: - Example 1: - boop.html: - $Code$ t align = 'center' valign = 'middle' shadow = '0' size = '2' structured text /t $/Code$ - init.sqf: - $Code$_text = parseText preprocessFile "boop.html"; - hint _text; - $/Code$ - This is especially useful for long strings, and it works on files with any file extension as long as they can be edited with a text editor. - Example 2: - init.sqf: - $Code$ hint preprocessFile "description.ext"; - copyToClipboard preprocessFile "mission.sqm"; - $/Code$ - The above is all valid. However, using *.jpg or any other files saved in an image format is not possible. + This scripting command must be executed on the server to work properly in multiplayer - String + Nothing + - primaryWeaponItems + enableDiagLegend - Returns array with all items assigned to the primary weapon. This command is used for infantry weapons only. + Enable or disable the legend for diagnostics. Internal dev only - https://community.bistudio.com/wiki/primaryWeaponItems + https://community.bistudio.com/wiki/enableDiagLegend - primaryWeaponItems Object + enableDiagLegend Boolean - primaryWeaponItems unit + enableDiagLegend Bool - $Code$primaryWeaponItems player ; - /* - [ - "muzzle_snds_H",//silencer - "acc_pointer_IR",//laser - "optic_Aco",//optics - "bipod_01_F_blk"//bipod - ] - */$/Code$ + $Code$enableDiagLegend false$/Code$ undefined / undefined - (March 16, 2015) - Since revision 129742, this command also returns an attached bipod. - Array + Nothing + - primaryWeaponMagazine + isUAVConnected - Returns array containing class name of currently loaded primary weapon magazine (or magazine s in case of weapon having grenade launcher), otherwise it returns []. This command is used for infantry weapons only. + Returns true if UAV is connected to some terminal. - https://community.bistudio.com/wiki/primaryWeaponMagazine + https://community.bistudio.com/wiki/isUAVConnected - primaryWeaponMagazine Object + isUAVConnected Object - primaryWeaponMagazine unit + isUAVConnected uav - $Code$hint primaryWeaponMagazine player ; //["30Rnd_65x39_caseless_mag"]$/Code$ - - $Code$_array = primaryWeaponMagazine player ; - if ( count _array 0) then { - hint ("Primary weapon is loaded with " + (_array select 0) + "!"); - } else { - if ( primaryWeapon player != "") then { - hint "Primary weapon is not loaded!"; - } else { - hint "Player doesn't have a primary weapon!"; - }; - };$/Code$ + $Code$bool = isUAVConnected cursorTarget ;$/Code$ undefined / undefined - (June 8, 2014) - This function returns an array like ["type of magazine loaded in primary weapon", "type of grenade loaded in launcher if exist"] - For example ["30Rnd_556x45_Stanag", "1Rnd_HE_Grenade_shell"], with no consideration about amount of these ammo. - However, be careful if you intend to use it in expression like : (magazines _unit) - (primaryWeaponMagazine _unit), i.e. magazines "minus" this array, - The result will inventory all magazines (with grenades, chemlights...) except ALL magazines (and grenades eventually) belonging to the TYPE of the loaded one! i.e. you suppress ALL "30Rnd_556x45_Stanag" but the "30Rnd_556x45_Stanag_Tracer_Green" are still remaining. - If you kill the unit, the same expression will return a consistent inventory as primary weapon "disappears" and primaryWeaponMagazine is empty. "30Rnd_556x45_Stanag" are back! - Array + Boolean + - primaryWeapon + echo - Returns name of unit's primary weapon (empty string if none). + Sends any text into the debugger console or the logfile. Present in internal version only, not working in the retail version. - https://community.bistudio.com/wiki/primaryWeapon + https://community.bistudio.com/wiki/echo - primaryWeapon Object + echo String - primaryWeapon unit + echo text - $Code$_pWeap = primaryWeapon player ;$/Code$ - - $Code$hint primaryWeapon player ; //"arifle_MX_ACO_pointer_F"$/Code$ + $Code$echo "Text in logfile"$/Code$ - global / undefined + undefined / undefined - (August 4, 2006) - primaryWeapon tells you what weapon the unit has irrespective of the status of the weapon. For example a unit that has an M16 on his back will still report an M16 as its primary weapon. - - (October 11, 2015) - To directly detect the active weapon use currentWeapon command. - String + Nothing + - priority + onShowNewObject - Return the priority of the task. + Defines an action performed when the user right clicks on the map and,selects New Object. Set to empty for default behavior. Command receives:,_pos array position, + i + Some Old Editor Command - https://community.bistudio.com/wiki/priority + https://community.bistudio.com/wiki/onShowNewObject - priority Task + Control onShowNewObject String - priority task + map onShowNewObject command - $Code$_prioTsk01 = priority task01$/Code$ - + undefined / undefined - Number + Any_Value + - private + get3DENLinesVisible - Sets a variable to the innermost scope as demonstrated in Example 3. One other command that is capable of creating private variables is params. - Since Arma 3 v1.53.132932 private can be used as keyword as shown in Example 4. + Get visibility state of Eden Editor lines. - https://community.bistudio.com/wiki/private + https://community.bistudio.com/wiki/get3DENLinesVisible - private String - - private Array + get3DENLinesVisible - private variableName - - private variableNameList + get3DENLinesVisible - $Code$private "_varname";$/Code$ - - $Code$private ["_varname1", "_varname2"];$/Code$ - - $Code$_myvar = 123; - systemChat str [_myvar]; // -- [123] - call { - systemChat str [_myvar]; // -- [123] - private "_myvar"; - systemChat str [_myvar]; // -- [any] - _myvar = 345; - systemChat str [_myvar]; // -- [345] - }; - systemChat str [_myvar]; // -- [123]$/Code$ - - $Code$// Usage of private as keyword: - private _myvar = 123; - //is the same as - private "_myvar"; - _myvar = 123;$/Code$ - - $Code$_lol = 123; call { hint str [_lol]}; // [123] - _lol = 123; call { private "_lol"; hint str [_lol]}; // [any]$/Code$ + $Code$if ( get3DENLinesVisible select 0) then { hint "Lines are visible in the map.";};$/Code$ undefined / undefined - (Sep 24, 2009 15:04) - The example provided is fairly worthless without a context. - Using the private command allows you to declare a variable in the current scope, without regards to variables in a higher scope with the same name. Note that if you try to declare a variable without an underscore (meaning it's global) with the private command, it will cause an error. Specifically: "Error Local variable in global space". - Here's a code example with output for your benefit. - $Code$ - _foo = 10; - if (true) then - { - private ["_foo"]; - _foo = 5; - player sideChat format ["%1", _foo]; - }; - player sideChat format ["%1", _foo]; - $/Code$ - In this example, the first sidechat (innermost) returns 5 while the second sidechat (outermost) returns 10. - $Code$ - if (true) then - { - private ["_bar"]; - _bar = 5; - player sideChat format ["%1", _bar]; - }; - $/Code$ - In this example, the private command does nothing and is simply a waste of code, assuming there is no higher level code to interfere with the if statement. - - (August 4, 2010) - The higher scope is also the script from which the function has been called. - If you've got in the script: - $Code$ - _a = 1; - call compile loadFile "function.sqf"; - hint format ["%1", _a]; - $/Code$ - And in the function.sqf : - $Code$ - _a = 2; - $/Code$ - Game will display 2. - Inserting private "_a" in the function prevents the change and so number 1 will be displayed on the screen. - - (February 25, 2015) - Recursive loops require the use of private. Without it, your variables will be overwritten. - Nothing - Nothing + Array + - processDiaryLink + nil - Open the diary screen on the record specified by link. + Nil value. This value can be used to undefine existing variables. - https://community.bistudio.com/wiki/processDiaryLink + https://community.bistudio.com/wiki/nil - processDiaryLink String + nil - processDiaryLink link + nil - + $Code$variableToDestroy = nil ;$/Code$ + undefined / undefined - (June 30, 2017) - To select various tabs in the map screen: - $Code$ processDiaryLink createDiaryLink ["selected_tab", player, ""];$/Code$ - ... where "selected_tab" can be "Map", "Tasks", "Diary", "Units", "Players", "Log". + Note that ArrayName = nil destroys the arrayNAME not the array content. + Array content is 'destroyed' when no more ArrayName s refer to the content. - (June 30, 2017) - You can also force open diary with selected link by passing string in link format directly: - $Code$ processDiaryLink " log subject=""Diary"" /log ";$/Code$ - The above will open tab Briefing. - $Code$ processDiaryLink " log subject=""Diary"" record=""Record2"" /log ";$/Code$ - The above will open tab Briefing and select 3rd record from the bottom, provided the records were added consistently. + Never ever assign a value to nil ! + Doing so creates a global variable with the same name that overrides the "command" nil : + foo = "foo"; + nil = "bar"; + foo = nil; + hint foo; // displays "bar" + + (September 25, 2014) + While isNil isn't available in OFP/CWA you can easily emulate it with something like this: + _nil = format["%1",_nilstring]; + ?(format["%1",foo]==_nil): foo = "Hello World!" - Nothing + Void + - productVersion + objectFromNetId - Returns the product's friendly name, identifier and version. In Arma 3 it also returns branch identifier, whether or not the game was launched using mods, and the platform. + Get object with given unique ID. If object is a group use groupFromNetId. As this command is MP only, you can use BIS_fnc_objectFromNetId, which extends the use to SP as well. - https://community.bistudio.com/wiki/productVersion + https://community.bistudio.com/wiki/objectFromNetId - productVersion + objectFromNetId String - productVersion + objectFromNetId id - $Code$hint str productVersion ; // would return ["Arma 2 OA", "arma2oa", 162, 95208] on Arma 2 OA 1.62.95208$/Code$ - - $Code$hint str productVersion ; // ["Arma 3","Arma3",137,128764,"Development",false,"Windows"]$/Code$ + $Code$objectFromNetId "2:3"$/Code$ undefined / undefined @@ -48228,55 +49072,75 @@ - Array + Object + - profileNameSteam + animateDoor - Returns name of the current Steam profile. + Animates a door on a vehicle. Animation is defined in config file in CfgVehicles - AnimationSources. Wanted animation phase is set with phase param. This command works only on animation sources with "door" controller. Door_L in the example below can be animated with animateDoor but not CargoRamp_Open: heli animateDoor ["Door_L", 1]; + class AnimationSources + { + class CargoRamp_Open + { + source = "user" ; + animPeriod = 5 ; + initPhase = 0 ; + }; + class Door_L + { + source = "door" ; + animPeriod = 1.6 ; + }; + }; + To animate doors or other sources that have "user" controller, use animate command, or even better, animateSource (recommended). Sources with "hit" controller can be animated with setHitPointDamage command applied to the name contained in hitpoint property. For availability of animation sources and their controller types see: createVehicle/vehicles - https://community.bistudio.com/wiki/profileNameSteam + https://community.bistudio.com/wiki/animateDoor - profileNameSteam + Object animateDoor Array - profileNameSteam + object animateDoor [doorname, phase, instant] - $Code$_mySteamProfileName = profileNameSteam ;$/Code$ + $Code$Taru animateDoor ["Door_1_source", 1];$/Code$ + + $Code$// Open left front door on Ifrit instantly: + Ifrit animateDoor ["Door_LF", 1, true ];$/Code$ - undefined / undefined + global / global - String + Nothing + - profileName + ctrlSetFontPB - Returns profile name. + Sets P bold font of given HTML control. - https://community.bistudio.com/wiki/profileName + https://community.bistudio.com/wiki/ctrlSetFontPB - profileName + Control ctrlSetFontPB String - profileName + controlName ctrlSetFontPB fontName - $Code$_myProfileName = profileName ;$/Code$ + $Code$_control ctrlSetFontPB "TahomaB"$/Code$ undefined / undefined @@ -48284,68 +49148,59 @@ - String + Nothing + - profileNamespace + exp - Returns the global namespace attached to the active user profile. Use setVariable and getVariable to save and load data to and from this Namespace. A variable can be deleted by setting its value to nil. By default the variables set in this namespace will exist while the game is running. In order to make variables save permanently, use saveProfileNamespace before the game is over. - The variables are stored next to the user profile in a file named myUsername.vars.GAMENAME (e.g. in the My Documents\Take On Helicopters folder). + Let x be a number, then exp (x) is equal to e to the power of x (or e^x) - https://community.bistudio.com/wiki/profileNamespace + https://community.bistudio.com/wiki/exp - profileNamespace + exp Number - profileNamespace + exp x - $Code$_namespace = profileNamespace ;$/Code$ - - $Code$profileNamespace setVariable ["var_kills",10000]; - _playerKills = profileNamespace getVariable "var_kills";$/Code$ + $Code$_result = exp 1 + // returns 2.7182$/Code$ undefined / undefined - The variables are loaded when the user profile is loaded or changed. + Note that you cannot exponent a value greater than 88.72283554077147726999 (999 repeating), as this is beyond what the game can calculate. - Namespace + Number + - progressLoadingScreen + waves - If loading screen is shown, sets progress bar to the given value (interval is from 0 to 1]) + Return waves value. - https://community.bistudio.com/wiki/progressLoadingScreen + https://community.bistudio.com/wiki/waves - progressLoadingScreen Number + waves - progressLoadingScreen progress + waves - $Code$startLoadingScreen ["Loading My Mission"]; - //Batch of code - //Batch of code - //Batch of code - progressLoadingScreen 0.5; - //Batch of code - //Batch of code - //Batch of code - endLoadingScreen ;$/Code$ + $Code$waveIntensity = waves ;$/Code$ undefined / undefined @@ -48353,62 +49208,76 @@ - Nothing + Number + - progressPosition + backpackContainer - Returns the current position in the progress bar. + Returns a cargo container of a unit's backpack. - https://community.bistudio.com/wiki/progressPosition + https://community.bistudio.com/wiki/backpackContainer - progressPosition Control + backpackContainer Object - progressPosition control + backpackContainer unit - $Code$_pos = progressPosition _control;$/Code$ + $Code$hint str backpackContainer player ; //1a5f7900# 163944: backpack_fast.p3d$/Code$ + + $Code$hint str getMagazineCargo backpackContainer player ; + // [ + //[ + //"APERSBoundingMine_Range_Mag", + //"ClaymoreDirectionalMine_Remote_Mag", + //"SLAMDirectionalMine_Wire_Mag", + //"DemoCharge_Remote_Mag" + //],[ + //3, + //2, + //2, + //1 + //] + //]$/Code$ + + $Code$( backpackContainer player ) addWeaponCargoGlobal [ weapons player select 0,1];$/Code$ undefined / undefined + (Apr 29, 2014) + In ArmA3 ver 1.16, we can use either backpackContainer or unitBackpack at present since both of them enjoy same operand type and return value. - Number + Object + - progressSetPosition + currentWeaponTurret - Sets progress position of the progress bar ( DialogControls-ProgressBar ) + Returns the name of the currently selected weapon on specified turret. Use turret path [-1] for driver's turret. - https://community.bistudio.com/wiki/progressSetPosition + https://community.bistudio.com/wiki/currentWeaponTurret - Control progressSetPosition Number + Object currentWeaponTurret Array - control progressSetPosition pos + vehicle currentWeaponTurret [turret path] - $Code$_control progressSetPosition 0.5$/Code$ - - $Code$with uiNamespace do { - bar = findDisplay 46 ctrlCreate ["RscProgress", -1]; - bar ctrlSetPosition [0,0,1,0.01]; - bar ctrlCommit 0; - bar progressSetPosition 0.75; - };$/Code$ + $Code$_weapon = MBT_Kuma currentWeaponTurret [0];$/Code$ undefined / undefined @@ -48416,358 +49285,272 @@ - Nothing + String + - publicVariableClient + doMove - Send the variable value to the client computer - same limitations regarding variable type as publicVariable. - The Client ID is the temporary ID given to a connected client for that session. You can find out this ID with the owner command (using it on a player's character, for example, will give you that players client ID). - In Arma 3 it is possible to broadcast nil value + Order the given unit(s) to move to the given position (without radio messages). After reaching his destination, the unit will immediately return to formation (if in a group); or order his group to form around his new position (if a group leader). Use doStop to stop units returning to formation. - https://community.bistudio.com/wiki/publicVariableClient + https://community.bistudio.com/wiki/doMove - Number publicVariableClient String + Object/Array doMove Array - clientID publicVariableClient varName + unit doMove position - $Code$3 publicVariableClient "CTFscoreOne";$/Code$ + $Code$_soldier1 doMove ( position _officer);$/Code$ + + $Code$this doMove ( getMarkerPos "Marker1");$/Code$ - undefined / undefined + local / global - (24 Aug, 2012) - publicVariableServer (run on client) - publicVariableClient (run on server) - Publishes a variable (name as STRING) to a specific client, from the server. This is useful where you want to synchronize a variable with only a specific client. - This is a useful way to cut down on network traffic, as publicVariable commands are issued as a priority message. So use publicVariable sparingly, and these commands where they apply. - Rocket - - (21 Sep, 2013) - While publicVariable is JIP compatible and persistent, publicVariableClient is not. If you log out then log in with the same owner id the public variable sent to your client prior will be nil. - $Code$//server - pv = 123; - 3 publicVariableClient "pv"; - //connected client with id 3 - hint str pv; //123 - // - //client log out/log in - // - //client id is still 3 - hint str pv; //error, undefined variable pv$/Code$ + (February 9, 2008) + If doMove is to be used in conjunction with waypoint behavior commands (e.g. setSpeedMode ), then those have to be issued after the move command to have an effect. Otherwise the move will be done with the default settings. - (April 12, 2015) - Tested in Arma 3 v1.43, publicVariableClient works client-to-client if owner id of the targeted client is known. + (February 3, 2009) + If a unit is part of a group, and is not the leader, the unit will fall back into formation soon after the domove is completed. This does not happen for units that are in a group alone (because they are their own leader). + There is no single command to get a unit to move to a position and stay there. The best way to do this is to issue a domove, then wait for the unit to reach his destination, then disable his movement AI. VBS2 users can use the fn_vbs_doMoveEx function. - Nothing + Nothing + - publicVariableServer + scudState - Send the variable value to the server - same limitations regarding variable type as publicVariable. - In Arma 3 it is possible to broadcast nil value + Current state of given Scud launcher. Following states are recognized: + 0 - No activity + 1 - Launch preparation, + 2 - Launch prepared + 3 - Ignition + 4 - Launched. - https://community.bistudio.com/wiki/publicVariableServer + https://community.bistudio.com/wiki/scudState - publicVariableServer String + scudState Object - publicVariableServer varName + scudState scudName - $Code$publicVariableServer "CTFscoreOne";$/Code$ + $Code$if (( scudState _scud) == 3) exitWith + { + player sideChat "SCUD Launch status: Missile Ignition"; + };$/Code$ undefined / undefined - (24 Aug, 2012) - publicVariableServer (run on client) - publicVariableClient (run on server) - Publishers the variable (name as STRING) to the server only. Useful when you want to synchronize a variable with the server but not any other clients. - Rocket + (August 4, 2006) + This command checks the scud status (Non-integral values are used to indicate transition between states). + To make the scud be upright, launch or cancel launch you need to use actions. + $Code$scud1 action ["scudLaunch",scud1]; // erect the missile + scud1 action ["scudStart",scud1]; // launch the missile + scud1 action ["scudCancel",scud1]; // down the missile + $/Code$ + (Make sure either the scud launcher has a crew inside or you use the game logic to perform actions). - Nothing + Number + - publicVariable + sliderPosition - Broadcasts missionNamespace variable and its value to all computers. The data is sent consequently and reliably to all clients. Using publicVariable too frequently in a given period of time can cause other parts of the game to experience bandwidth problems. - Variables broadcast with publicVariable during a mission stay persistent for JIP (Join In Progress) clients. Such persistent variables are synced to the JIP client before the first batch of client side Event Scripts are ran. - The following Types of data are supported: - Number - Since OFP version 1.34 : - Boolean - Object - Group - Since ArmA version 1.00: - String - Text - Since ArmA version 1.09 : - Array - Code - Since Arma 3 version 1.26 : - Nothing ( nil ) - Limitations : Cannot use reserved names, such as " player " or " west " or " side ", etc. It is also not possible to transfer references to entities which are local, like scripts, displays, or local objects. Team Member is also not supported. + Return current thumb position of slider idc of topmost user dialog. - https://community.bistudio.com/wiki/publicVariable + https://community.bistudio.com/wiki/sliderPosition - publicVariable String + sliderPosition Number + + sliderPosition Control - publicVariable varName + sliderPosition idc + + sliderPosition control - $Code$publicVariable "CTFscoreOne";$/Code$ - - $Code$myPubVar = [123, "456", true ]; - publicVariable "myPubVar";$/Code$ + $Code$_slidepos1 = sliderPosition 105;$/Code$ - local / global + undefined / undefined - (3 Aug, 2006 23:03) - This command broadcasts a variable to all clients, but as soon as you change the variable again, you have to use publicVariable again, as it does not automatically synchronise it. - - (12 April, 2008) - Be sure to place your variable name in quotation marks. This may sound awfully simple, but many times I have forgotten to do this, and it has resulted in no end of headaches for me. - - (2 Feb, 2008) - When initialising a public variable to handle JIP, you will usually first want to check if the public variable has already been (broadcast, received and) set locally. Otherwise you may inadvertantly overwrite the broadcast value with your default value. - To perform this check, use code similar to the following to first check that the variable is nil: - if ( isNil "PV_abc") then - { - // set the nil variable with a default value for server and both JIP & 'join at mission start' - PV_abc = [7, 8, 9]; - }; - // else public variable has already been set due to a public variable broadcast. - - (14 July, 2011) - To make Dr_Eyeball's note even more clear: - For JIP players pV'ed variables are received and set BEFORE the init.sqf. - So to avoid the received variables getting overwritten by variable initialization normally done in the init.sqf, you HAVE TO to use the 'if ( isNil "PV_abc")' pattern. - It says literally: "Only initialize value it has not yet been set. And in a JIP this may already been the cause due to publicVariable use". - - (21 September, 2013) - To make Dr_Eyeball's and kju's notes even more clear, public variable is persistent. Once it has been broadcast it will be delivered to all clients, present and future. Therefore it is wise to check if the variable already exists on a client due to it being persistent before initialising its value. - - (23 February, 2014) - Just to clarify, when players JIP, they get the value of the variable from the last call to publicVariable, not the current value of the variable. Eg. with - $Code$SomeVar = 5; publicVariable "SomeVar"; SomeVar = 10;$/Code$ - Connecting players will receive 5, not the current value of 10. - - (October 19, 2014) - I'm pretty far down the notes list so I hope this doesn't get buried. - For clarity, after a variable has been publicVariable'd, scripts in all clients can use it as if it had been defined locally. - Variables that have been publicVariable'd do not need to be pre-defined on receiving clients. In fact, this could cause issues with JIP players overwriting a publicVariable value, as mentioned above. (tested in A3 1.32.127785) - Local variables cannot be publicVariable'd. (tested in A3 1.32.127785) (tested by having dedicated server publicVariable a local variable, then trying to hint it on client. Error was "Undefined variable in expression") - Nothing + Number - Number + - pushBackUnique + uiSleep - Adds element to the back of the given array but only if it is unique to the array. The index of the added element is returned upon success, otherwise -1. This command modifies the original array. + Suspend execution of script for given uitime. uiSleep is a sleep method to delay script execution where script time/simulation time is stopped. uiSleep is basically using the system time (uiTime more specifically) and not simulation time. So in the cases where sleep command would get stuck indefinitely, uiSleep can still be used to effectively delay script execution. For example in a mission briefing or an editor or when simulation is paused in general. - https://community.bistudio.com/wiki/pushBackUnique + https://community.bistudio.com/wiki/uiSleep - Array pushBackUnique Anything + uiSleep Number - array pushBackUnique element + uiSleep delay - $Code$_arr = [1,2,3]; - _index = _arr pushBackUnique 3; - hint str [_index, _arr]; //[-1,[1,2,3]]$/Code$ - - $Code$_arr = [1,2,3]; - _index = _arr pushBackUnique 4; - hint str [_index, _arr]; //[3,[1,2,3,4]]$/Code$ + $Code$uiSleep 0.5$/Code$ undefined / undefined + (March 28, 2016) + If the game is paused in SP (via ESC) the sleep command will stop working, to prevent that use uiSleep. - Number + Nothing + - pushBack + viewDistance - Insert an element to the back of the given array. This command modifies the original array. (see also: pushBackUnique ) + Returns the rendering distance. - https://community.bistudio.com/wiki/pushBack + https://community.bistudio.com/wiki/viewDistance - Array pushBack Anything + viewDistance - array pushBack element + viewDistance - $Code$_arr = [1,2,3]; - _arr pushBack 4; - hint str _arr; //[1,2,3,4]$/Code$ - - $Code$_arr = [1,[2,4],3]; - (_arr select 1) pushBack [5,6]; - hint str _arr //[1,[2,4,[5,6]],3]$/Code$ + $Code$hint ("my view distance is " + str viewDistance + " meters");$/Code$ undefined / undefined - (Aug 1, 2014) - (A3 1.26) It is recommended to use pushBack instead of BIS_fnc_arrayPush. - $Code$_array = [1,2,3]; - _array pushBack 4; //same as [_array, 4] call BIS_fnc_arrayPush ; - $/Code$ - - (August 23, 2014) - It's highly recommended to use the new pushBack command, up to 43% faster than set and up to 11843% faster a plus b ! - - (November 26, 2014) - pushBack does not support nil while set and a plus b do. For example: - $Code$_array = []; - for "_i" from 0 to 3 do - { - _array pushBack nil ; - }; - hint str _array; // hint is []$/Code$ - - (May 21, 2015) - Array "push" implementation using pushBack, alternative to BIS_fnc_arrayPush - $Code$KK_fnc_push = { - _this select 0 pushBack (_this select 1); - _this select 0 - }; - // Example - arr = [1,2,3]; - [arr, 4] call KK_fnc_push; //both arr and return of function are now [1,2,3,4]$/Code$ - - (October 5, 2016) - Note that pushBack does not create a new object. - Therefore, if you edit an object that was pushed back to an array, it also affects the object in the array. - e.g. - $Code$_first_squence = [1,2,3]; - _second_squence = [5,4]; - _first_squence pushBack _second_squence; - systemChat str _first_squence // prints [1,2,3,[5,4]]] - reverse _second_squence; - systemChat str _first_squence // prints [1,2,3,[4,5]]] - $/Code$ - If you pushBack an array for instance, you can just copy it to generate a new object. - e.g. - $Code$_first_squence pushBack +_second_squence; - $/Code$ - Number + Number + - putWeaponPool + removeAllHandgunItems - Transfer weapons and magazines from weapon pool into cargo of object obj. Used in campaign to transfer weapons into next mission. + Removes all items from weapon except magazine. - https://community.bistudio.com/wiki/putWeaponPool + https://community.bistudio.com/wiki/removeAllHandgunItems - putWeaponPool Object + removeAllHandgunItems Object - putWeaponPool object + removeAllHandgunItems unit - undefined / undefined + local / global - Nothing + Nothing + - queryItemsPool + weaponState - Returns the number of items of type in the weapon pool (used in campaigns to transfer weapons to the next mission). + Returns the currently selected weapon state for unit or vehicle. + Since Arma 3 v1.69.140397 this command has been improved and extended: + It is now possible to query any weapon of a vehicle without the need to place a weapon operator first, provided the weapon or muzzle is specified in optional param. By default a vehicle has no weapons selected, so querying currently selected weapon returns no weapon, unless weapon is specified. + Driver turret can now be accessed as well with turret path [-1]. + Muzzle name is supported as well as weapon name. Weapon search gets priority, but if there is no weapon with given name, the muzzles will be searched. - https://community.bistudio.com/wiki/queryItemsPool + https://community.bistudio.com/wiki/weaponState - queryItemsPool String + weaponState Object + + weaponState Array - queryItemsPool name + weaponState unit + + weaponState [vehicle, turretPath, weapon] - + $Code$_wsPlayer = weaponState player ; // ["arifle_MXC_ACO_F","arifle_MXC_ACO_F","Single","30Rnd_65x39_caseless_mag",30]$/Code$ + + $Code$_wsVehicle = weaponState [_apc, [0]]; // ["autocannon_40mm_CTWS","HE","player","60Rnd_40mm_GPR_Tracer_Red_shells",60]$/Code$ + + $Code$_wsVehicle = weaponState [_apc, [0], "AP"]; // ["autocannon_40mm_CTWS","AP","player","40Rnd_40mm_APFSDS_Tracer_Red_shells",40]$/Code$ + undefined / undefined - Number + Array - Array + - queryMagazinePool + turretUnit - Return number of magazines of type name in magazine pool (used in campaign to transfer magazines into next mission). + Returns the unit in the vehicle turret. Driver turret [-1] is supported since Arma 3 v1.57.135045 - https://community.bistudio.com/wiki/queryMagazinePool + https://community.bistudio.com/wiki/turretUnit - queryMagazinePool String + Object turretUnit Array - queryMagazinePool name + vehicle turretUnit turretpath - $Code$_num = queryMagazinePool "M16";$/Code$ + $Code$_vehicle turretUnit _thisTurret$/Code$ undefined / undefined @@ -48775,27 +49558,29 @@ - Number + Object + - queryWeaponPool + removeWeaponCargo - Return number of weapons of type name in weapon pool (used in campaign to transfer weapons into next mission). + Remove weapon from the vehicle cargo space. + This is unoffical documentation. All Information here is as it exists in the Engine. It might not reflect the reality. - https://community.bistudio.com/wiki/queryWeaponPool + https://community.bistudio.com/wiki/removeWeaponCargo - queryWeaponPool String + Object removeWeaponCargo Array - queryWeaponPool name + vehicle removeWeaponCargo [weaponID,creatorID] - $Code$_num=queryWeaponPool "M16"$/Code$ + $Code$rearmTruckOne removeWeaponCargo [19, 1]$/Code$ undefined / undefined @@ -48803,99 +49588,153 @@ - Number + Nothing + - radioChannelAdd + lnbText - Add the units to the custom radio channel. + Returns the shown text in the item with the given position of the given 2D listbox. - https://community.bistudio.com/wiki/radioChannelAdd + https://community.bistudio.com/wiki/lnbText - Number radioChannelAdd Array + Control lnbText Array - index radioChannelAdd units + control lnbText [row,column] - $Code$2 radioChannelAdd [player, unit1];$/Code$ + $Code$_ctrl lnbText [0,0];$/Code$ - undefined / undefined + local / local + (Sep 9 2014) + (A3 1.28)As for invisible data processing, lnbAddArray, lnbAddColumn, lnbData, lnbGetColumnsPosition, lnbSetColumnsPos, lnbSetData, lnbSetText, lnbSetValue, lnbText and lnbValue store data types into exact position of the listNbox with different spaces. Accessing data with coordinate command at nearly the same syntax: + $Code$ + //Set same value to one position of a Control + _ctrl lnbSetData [ [0,0],"#1"]; + lnbSetColumnsPos [102, [0,1], 1]; + _ctrl lnbSetText [ [0,1], "#1"]; + _ctrl lnbSetValue [ [0,0],1]; + //Accessing the value disregard affecting one another. + _ctrl lnbData [0,0]; //"#1" + lnbGetColumnsPosition _ctrl //[1]; + _ctrl lnbText [0,0];//"#1" + _ctrl lnbValue [0,0];//1 + $/Code$ + For a direct visible control over CT_LISTNBOX: + $Code$ + 0 = [_CT_LISTNBOX] spawn { + private ["_CT_LISTNBOX","_color","_current","_pic"]; + disableSerialization ; + _CT_LISTNBOX = _this select 0; + { + _CT_LISTNBOX lnbAddRow [ getText (_x "displayNameShort"), getText (_x "displayName")]; + _CT_LISTNBOX lnbSetPicture [ [_foreachIndex,0], getText (_x "texture")]; + } forEach (" isClass _x" configClasses ( configFile "CfgRanks")); + _CT_LISTNBOX lnbSetCurSelRow 0; + _current = lnbCurSelRow _CT_LISTNBOX; + _color = _CT_LISTNBOX lnbColor [_current,0]; + _CT_LISTNBOX lnbSetColor [ [_current,1], [(_color select 0)/2,0,0,1] ]; + _CT_LISTNBOX lnbDeleteColumn 0; + _CT_LISTNBOX lnbDeleteRow 1; + sleep 1; + lnbClear _CT_LISTNBOX;//Clear all items but control still remains just invisible. + }; + $/Code$ + A combined use of both invisible and visible data processing commands alive the Control. - Nothing + String + - radioChannelCreate + setOvercast - Create a custom radio channel with the given color, label, call sign and registered characters. The index returned can be used to manipulate the created channel later. There are 10 slots for custom radio channels which would correspond to channels 6-15 (see getPlayerChannel ). The command will find an unused index in this range and create it when found. Server only. + Set overcast to given value smoothly during given time (in seconds). Zero time means immediate change. An overcast setting of zero means clear (sunny) weather, and one means storms and rain are very likely. Higher overcast values also result in higher wind speeds. - https://community.bistudio.com/wiki/radioChannelCreate + https://community.bistudio.com/wiki/setOvercast - radioChannelCreate Array + Number setOvercast Number - radioChannelCreate [color, label, callSign, units, sentenceType] + time setOvercast overcast - $Code$_index = radioChannelCreate [[0.96, 0.34, 0.13, 0.8], "Q-dance Radio", "%UNIT_NAME", [player1, player2]];$/Code$ - - $Code$_index = radioChannelCreate [[0.96, 0.34, 0.13, 0.8], "Q-dance Radio", "%UNIT_NAME", [player1, player2], false ]; - // disable automatic quotes for chat in channel (ArmA 3)$/Code$ - - $Code$// Create custom channel and add all players to it, present and JIP: - if ( isServer ) then - { - private _channelName = "Q-dance Radio"; - private _channelID = radioChannelCreate [[0.96, 0.34, 0.13, 0.8], _channelName, "%UNIT_NAME", []]; - if (_channelID == 0) exitWith { diag_log format ["Custom channel '%1' creation failed!", _channelName]}; - [_channelID, {_this radioChannelAdd [ player ]}] remoteExec ["call", [0, -2] select isDedicated, _channelName]; - };$/Code$ + $Code$50 setOvercast 0.5$/Code$ - global / global + undefined / local - This scripting command must be executed on the server to work properly in multiplayer + (August 4, 2006) + Notes from before the conversion: + Use setRain if you want to make sure it rains. - (January 21, 2016) - Make sure you add all units you intend to speak or receive messages on created custom channel to the channel. + Only one script command induced weather change (either setOvercast or setFog ) can be happening at a time. Starting a new weather change will immediately halt the current weather change. SetRain changes are independent and can occur simultaneously to a weather change. + + Arma 3 's volumetric clouds cannot be instantly changed (it would take up to a few seconds to do a full recompute). Therefore, 0 setOvercast 0 will not have the desired effect. You can use skipTime to get to the desired cloud coverage. + NOTE: To get instant, seamless overcast change to overcast 1 advance the time 24 hours with skipTime while setting overcast transition time to 86400 seconds (24 hours) -- Killzone_Kid + $Code$86400 setOvercast 1; + skipTime 24; + //to remain on the same date: + skipTime -24; + 86400 setOvercast 1; + skipTime 24; + $/Code$ + + With removal of simulSetHumidity‎, in order to add instant cloud cover, execute simulWeatherSync with delay (for now): + $Code$ skipTime -24; + 86400 setOvercast 1; + skipTime 24; + 0 = [] spawn { + sleep 0.1; + simulWeatherSync ; + };$/Code$ + There is slight freeze with simul command. + + Delay in Arma 3 doesn't work for quick changes. Using 120 setOvercast 1 only reaches full overcast after about 50 minutes. Using setTimeMultiplier does speed up the overcast, but it doesn't render any clouds. You will need to skipTime or forceWeatherChange to render clouds if you want it to happen within the hour. + + (May 4, 2016) + Actual transition time is inversely proportional to the timeMultiplier. For example, a time of 7200 (2 hours) and a timeMultiplier of 2 will result in a real-life transition time of 7200 / 2 = 3600 (1 hour). + In case of overcast, a timeMultiplier 1 will cause gradual desyncing of the cloud cover with the overcast value, so it is advised that you multiply the transition time by the multiplier, i.e. : + $Code$(7200 * timeMultiplier ) setOvercast 1$/Code$ - Number + Nothing + - radioChannelRemove + reportRemoteTarget - Remove the units from the custom radio channel. + Shares the target vehicle via datalink to the Side center for a given time. - https://community.bistudio.com/wiki/radioChannelRemove + https://community.bistudio.com/wiki/reportRemoteTarget - Number radioChannelRemove Array + Side reportRemoteTarget Array - index radioChannelRemove units + side reportRemoteTarget [target, time] - $Code$3 radioChannelRemove [blufor_unit_1, blufor_unit_2];$/Code$ + $Code$blufor reportRemoteTarget [ vehicle player, 60];$/Code$ undefined / undefined @@ -48903,39 +49742,28 @@ - Nothing + Nothing + - radioChannelSetCallSign + taskDestination - Set the custom radio channel's call sign. - Available special parameters: - $KEY (reference to a localized text) - %CHANNEL_LABEL - %UNIT_SIDE - %UNIT_NAME - %UNIT_RANK - %UNIT_ID - %UNIT_REF - %UNIT_GRP_NAME - %UNIT_GRP_LEADER - %UNIT_VEH_NAME - %UNIT_VEH_POSITION + Returns the position of the task (as specified by destination parameter in config). - https://community.bistudio.com/wiki/radioChannelSetCallSign + https://community.bistudio.com/wiki/taskDestination - Number radioChannelSetCallSign String + taskDestination Task - index radioChannelSetCallSign callSign + taskDestination task - $Code$4 radioChannelSetCallSign "%UNIT_NAME";$/Code$ + $Code$if (! isNull currentTask player ) then { taskDestination currentTask player }; //return Position ( Array )$/Code$ undefined / undefined @@ -48943,278 +49771,459 @@ - Nothing + Array + - radioChannelSetLabel + displayRemoveEventHandler - Set the custom radio channel's label. + Remove a given event handler from the given display. - https://community.bistudio.com/wiki/radioChannelSetLabel + https://community.bistudio.com/wiki/displayRemoveEventHandler - Number radioChannelSetLabel String + Display displayRemoveEventHandler Array - index radioChannelSetLabel label + display displayRemoveEventHandler [handler name,id] - $Code$5 radioChannelSetLabel "Q-dance Radio";$/Code$ - + undefined / undefined + (April 19, 2015) + If you for example used this code to add the eventHandler: + $Code$_myEH = (findDisplay 46) displayAddEventHandler ["KeyDown", "hint str _this"];$/Code$ + Then this would be the correct code to remove that eventHandler again: + $Code$(findDisplay 46) displayRemoveEventHandler ["KeyDown", _myEH];$/Code$ - Nothing + Nothing + - radioVolume + ctrlMapAnimDone - Checks the current radio volume (set by fadeRadio ). + Checks whether the map animation has finished. - https://community.bistudio.com/wiki/radioVolume + https://community.bistudio.com/wiki/ctrlMapAnimDone - radioVolume + ctrlMapAnimDone Control - radioVolume + ctrlMapAnimDone controlName - $Code$_volume = radioVolume;$/Code$ - + - undefined / undefined + local / local - Number + Boolean + - rad + createVehicleCrew - Convert x from Degrees to Radians. 360 degrees is equal to 2 multiplied with pi. + Creates crew to given empty vehicle. Crew members are default crew defined in config. Crew side will also correspond to vehicle's faction. This command does not addVehicle to the created crew in the same way this normally happens when crewed vehicle created in the editor. - https://community.bistudio.com/wiki/rad + https://community.bistudio.com/wiki/createVehicleCrew - rad Number + createVehicleCrew Object - rad x + createVehicleCrew vehicle - $Code$_radians = rad 180 - // Result is 3.1415 (eg pi$/Code$ + $Code$// Spawn a flying UAV with crew. + myUAV = [ getPos player, 0, "B_UAV_02_F", west ] call BIS_fnc_spawnVehicle ; + createVehicleCrew (myUAV select 0);$/Code$ + + $Code$_veh = createVehicle ["O_MRAP_02_hmg_F", position player, [], 0, "NONE"]; + createVehicleCrew _veh; + { + diag_log [_x, faction _x, side _x, side group _x]; + } forEach crew _veh;[O Alpha 1-1:1,"OPF_F",EAST,EAST] + [O Alpha 1-1:2,"OPF_F",EAST,EAST]$/Code$ undefined / undefined + (August 20, 2014) + As of ARMA 3 v1.26 the command will work on non-empty vehicles. If any of the crew defined in config are missing they will be added. + + (November 8, 2014) + This command creates drivers/copilots, commanders and gunners where appropriate, but it never creates cargo crew. + So a gunship Huron will get a pilot and copilot plus 2 door gunners, but nobody in the back. + + (December 22, 2015) + createVehicleCrew does not work with Transport Unload waypoints for helicopters. You need to spawn the pilots separately and then get them into the helicopter in order to get Transport Unload waypoints to work. + + (July 2, 2017) + The particular seats to which units are added depend on the dontCreateAI property, the hasDriver property of the base class, and the hasGunner propery of turret classes. + For instance, the following snippet calculates how many seats will be occupied by the created crew: + $Code$private _vehCfg = configFile "CfgVehicles" typeOf _vehicle; + private _crewCount = {round getNumber (_x "dontCreateAI") 1 && + ((_x == _vehCfg && {round getNumber (_x "hasDriver") 0}) || + (_x != _vehCfg && {round getNumber (_x "hasGunner") 0}))} count ([_vehicle, configNull] call BIS_fnc_getTurrets); + $/Code$ + Also, I've written a function to create a UAV crew for a specific side: https://gist.github.com/AgentRev/cb25d30e464f2239b6cee51fa0110c78 - Number + Nothing + - rainbow + lbText - Returns the current rainbow intensity. + Returns the shown text in the item with the given index of the listbox or combobox with id idc of the topmost user dialog. - https://community.bistudio.com/wiki/rainbow + https://community.bistudio.com/wiki/lbText - rainbow + lbText Array + + Control lbText Number - rainbow + lbText [idc, index] + + control lbText index - + $Code$_text = lbText [101, 0];$/Code$ + + $Code$_text = _control lbText 0;$/Code$ + - undefined / undefined + local / local + More information on the LB command family can be found here - Number + String - String + - rain + lbSetPicture - Returns the current value of rain density in range 1...0 + Sets the picture in the item (left) with the given index of the listbox or combobox with id idc of the topmost user dialog. Name is the picture name. The picture is searched for in the mission directory, the dtaExt subdirectory of the campaign directory and the dtaExt directory and the data bank (or directory). + In Arma 3 it might be necessary to set the color of the picture as well with lbSetPictureColor as default [0,0,0,0] color makes picture invisible. - https://community.bistudio.com/wiki/rain + https://community.bistudio.com/wiki/lbSetPicture - rain + lbSetPicture Array + + Control lbSetPicture Array - rain + lbSetPicture [idc, index, name] + + control lbSetPicture [index, name] - $Code$_rainLevel = rain ;$/Code$ + $Code$lbSetPicture [101, 0, "iskoda"];$/Code$ + + $Code$_control lbSetPicture [0, "iskoda"];$/Code$ + + local / local + + + More information on the LB command family can be found here + + (August 18, 2015) + (ArmA 3) To place an image on the right end of the listItem: $Code$_ctrl lbSetPictureRight [_index, "A3\path\to\image.paa"];$/Code$ + + + Nothing - Nothing + + + + + + menuAdd + + + Adds new submenu entry into item on given path. + + + https://community.bistudio.com/wiki/menuAdd + + + menuAdd Array + + + menuAdd [idc, path, text] + + + undefined / undefined - Number + Number + - random + processDiaryLink - Random real (floating point) value from 0 (inclusive) to x (not inclusive). - Since Arma 3 v1.55.133393 alternative syntax is added, allowing to define Gaussian Distribution params. Uses the same method as setTriggerTimeout command. Quite useful for spawning loot for example, making more valuable items more rare. - Since Arma 3 v1.67.139663 an alternative syntax is available, allowing to generate semi-random number based on provided seed. - Since Arma 3 v1.67.139663 an alternative syntax is available, generating pseudo-random noise texture based on provided seed and returning a single number between 0 (included) and 1 (excluded) at supplied x and y coordinates. + Open the diary screen on the record specified by link. - https://community.bistudio.com/wiki/random + https://community.bistudio.com/wiki/processDiaryLink - random Number - - random Array - - Number random Number - - Number random Array + processDiaryLink String - random x - - random [min, mid, max] - - seed random x - - seed random [x,y] + processDiaryLink link - $Code$_rNumber = random 1;$/Code$ - - $Code$_rNumber = random -10;$/Code$ - - $Code$// Generate random position inside a circle - _center getPos [_radius * sqrt random 1, random 360];$/Code$ + + + undefined / undefined + + + (June 30, 2017) + To select various tabs in the map screen: + $Code$ processDiaryLink createDiaryLink ["selected_tab", player, ""];$/Code$ + ... where "selected_tab" can be "Map", "Tasks", "Diary", "Units", "Players", "Log". + + (June 30, 2017) + You can also force open diary with selected link by passing string in link format directly: + $Code$ processDiaryLink " log subject=""Diary"" /log ";$/Code$ + The above will open tab Briefing. + $Code$ processDiaryLink " log subject=""Diary"" record=""Record2"" /log ";$/Code$ + The above will open tab Briefing and select 3rd record from the bottom, provided the records were added consistently. + + + Nothing + + + + + + ctrlSetText + + + Set the text of a control of the currently active user dialog or display. This command can be used for: static texts, buttons, edit lines and active texts as well as for images, where you can use it to set the image path. + Read Dialog Control for more information about user dialogs and controls. + + + https://community.bistudio.com/wiki/ctrlSetText + + + ctrlSetText Array + + Control ctrlSetText String + + + ctrlSetText [idc, text] + + controlName ctrlSetText text + + + $Code$ctrlSetText [100, "Hello world"];//for Dialogs$/Code$ - $Code$// Compare (each command was executed 100000 times to gather statistics): - floor random 10; - // 0 - 10099 (10%) - // 1 - 10040 (10%) - // 2 - 10154 (10%) - // 3 - 9910 (10%) - // 4 - 10023 (10%) - // 5 - 9937 (10%) - // 6 - 10118 (10%) - // 7 - 9716 (10%) - // 8 - 9986 (10%) - // 9 - 10017 (10%) - floor random [0,5,10]; - // 0 - 109 (0%) - // 1 - 1604 (2%) - // 2 - 6839 (7%) - // 3 - 16671 (17%) - // 4 - 24706 (25%) - // 5 - 24702 (25%) - // 6 - 16626 (17%) - // 7 - 6925 (7%) - // 8 - 1702 (2%) - // 9 - 116 (0%) - floor random [0,10,0]; - // 0 - 19 (0%) - // 1 - 209 (0%) - // 2 - 817 (1%) - // 3 - 2384 (2%) - // 4 - 4841 (5%) - // 5 - 8976 (9%) - // 6 - 14067 (14%) - // 7 - 18955 (19%) - // 8 - 23605 (24%) - // 9 - 26127 (26%) - floor random [0,10,5]; - // 0 - 11 (0%) - // 1 - 98 (0%) - // 2 - 430 (0%) - // 3 - 1149 (1%) - // 4 - 2384 (2%) - // 5 - 4546 (5%) - // 6 - 8612 (9%) - // 7 - 16283 (16%) - // 8 - 28393 (28%) - // 9 - 38094 (38%)$/Code$ + $Code$_control ctrlSetText "Hello world.";// for Displays$/Code$ - undefined / undefined + local / local - (July 12, 2015) - Random selections including negative numbers can be obtained via: - $Code$_Xrnd = round(random 200) -100;$/Code$ - This will yield numbers between -100 and 100. - Be careful using random numbers in multiplayer, each client will come up with a different result. See multiplayer tutorials for more general information about locality. - The number returned is unlikely to be a whole number. To return a whole number use either round, ceil or floor together with random : - x=round(random 5) will return 0,1,2,3,4 or 5. (non-uniform distribution, 0 and 5 are half as likely to be selected than any of the other numbers) - x=floor(random 5) will return 0,1,2,3 or 4. (uniform distribution, all numbers have the same probability of being selected) - x=ceil(random 5) will return 0,1,2,3,4 or 5. (0 is very unlikely, but possible, as ceil 0 is 0) + (16 Nov, 2011) + For ArmA2 textured "shortcut" buttons (type = 16), you must use the alternative syntax. + + (October 16, 2016) + When using ctrlSetText with picture control, the path to the texture is cached, so that if the new texture is from the same file as old one, the precious CPU cycles would not be wasted on reloading it. - Number - Number - Number - Number + Nothing - Nothing + - rankId + countFriendly - Return the rank of the given unit for comparison. - Value may be : - 0 - Private - 1 - Corporal - 2 - Sergeant - 3 - Lieutenant - 4 - Captain - 5 - Major - 6 - Colonel + Count how many units in the array are considered friendly to the given unit. - https://community.bistudio.com/wiki/rankId + https://community.bistudio.com/wiki/countFriendly - rankId Object + Object countFriendly Array - rankId unit + unitName countFriendly arrayName - $Code$_myIdRank = rankId player;$/Code$ + $Code$_num = player countFriendly list _triggerOne;$/Code$ + + + global / undefined + + + (August 3, 2006) + Notes from before the conversion: + The countFriendly command seem to count the number of units from the array that are considered to be of the given type by the whole side, not just the specified unit. + + + Number + + + + + + callExtension + + + Calls custom.dll also known as Extension. The name of the extension is the name of the extension.dll without ".dll" part (or without "_x64.dll" part on 64-bit Arma). For example if the file is 'myExtension.dll' the name of the extension will be "myExtension". For 64-bit extensions, the name of the extension doesn't need to change and is still "myExtension". The game will automatically look for 'myExtension_x64.dll' when you use 64-bit Arma exe. + This command is blocking, meaning that the game will wait for the extension to return before continuing. This may cause FPS drop if extension is not optimised. If extension takes too long, consider making asynchronous extension, where the result of the work of the extension is collected in a separate call. + Currently there is no limit how much data you can send to the extension. However there is a limit on how much data you can return from extension in one call. The limit is known to the extension and is passed in int outputSize. The limit may or may not change in the future and is currently 10240 bytes. It is up to extension designer to handle multipart results if returned data exceeds output limit. + Since Arma 3 v1.67 it is possible to pass array of arguments to extensions. The array of arguments could be anything and all elements will be converted to strings, however you might want to only send simple types like Booleans, Strings, Numbers and Arrays of all of the above. There is currently a limit on how many arguments can be sent and it is 1024. However an argument could be an Array itself, in this case extension maker will have to provide additional methods for parsing such arguments. + Possible error codes: + 101: SYNTAX_ERROR_WRONG_PARAMS_SIZE + 102: SYNTAX_ERROR_WRONG_PARAMS_TYPE + 201: PARAMS_ERROR_TOO_MANY_ARGS + 301: EXECUTION_WARNING_TAKES_TOO_LONG + Each error will have entry in.rpt file with more details. + Since Arma 3 v1.69, RVExtensionVersion interface (see source code example below) has been added, which is called by the engine on extension load and expects extension version. This interface is designed to work with both, Linux and Windows. The max buffer size is 32 bytes. The version information will then appear in. rpt file like so: + $Code$19:06:36 CallExtension loaded: test_extension (.\test_extension.dll) [1.0.0.1]$/Code$ + For more information see Extensions. + + + https://community.bistudio.com/wiki/callExtension + + + String callExtension String + + String callExtension Array + + + extension callExtension function + + extension callExtension [function, arguments] + + + $Code$_return = "myExtension" callExtension "stringToBeParsed";$/Code$ + + $Code$_result = "test_extension" callExtension str weapons player ; + _result = "test_extension" callExtension ["fnc1", getUnitLoadout player ]; + _result = "test_extension" callExtension ["fnc2", magazinesAmmoFull player ]; + _result = "test_extension" callExtension ["fnc1", [ weapons player, magazines player ]];$/Code$ + + $Code$_result = "test_extension" callExtension ["fnc1", [1,"two", true,[4,"five", false ]]]; + parseSimpleArray (_result select 0) params ["_number","_string","_boolean","_array"]; + systemChat str [_number,_string,_boolean,_array]; + // Source Code ( Download.dll ) + //This is an example of an extension compatible with both syntaxes. When using 1st syntax, the data is just copied from input to output. When using alt syntax, the arguments are parsed and then assembled back into string array in 2 ways: fnc1 and fnc2. fnc1 is a fraction faster. + //#include string + //#include vector + //#include iterator + //#include sstream + //#define CURRENT_VERSION "1.0.0.1" + //extern "C" + //{ + ////--- Engine called on extension load + //__declspec ( dllexport ) void __stdcall RVExtensionVersion ( char * output, int outputSize ); + ////--- STRING callExtension STRING + //__declspec ( dllexport ) void __stdcall RVExtension ( char * output, int outputSize, const char * function ); + ////--- STRING callExtension ARRAY + //__declspec ( dllexport ) int __stdcall RVExtensionArgs ( char * output, int outputSize, const char * function, const char ** args, int argsCnt ); + //} + ////--- Extension version information shown in.rpt file + //void __stdcall RVExtensionVersion ( char * output, int outputSize ) + //{ + ////--- max outputSize is 32 bytes + //strncpy_s ( output, outputSize, CURRENT_VERSION, _TRUNCATE ); + //} + ////--- name callExtension function + //void __stdcall RVExtension ( char * output, int outputSize, const char * function ) + //{ + //std :: string str = function ; + //strncpy_s ( output, outputSize, ( "Input Was: " + str ). c_str (), _TRUNCATE ); + //} + ////--- name callExtension [function, args] + //int __stdcall RVExtensionArgs ( char * output, int outputSize, const char * function, const char ** args, int argsCnt ) + //{ + //if ( strcmp ( function, "fnc1" ) == 0 ) + //{ + ////--- Manually assemble output array + //int i = 0 ; + //std :: string str = "[" ; + ////--- Each argument can be accessed via args[n] + //if ( argsCnt 0 ) + //str += args [ i ++ ]; + //while ( i argsCnt ) + //{ + //str += "," ; + //str += args [ i ++ ]; + //} + //str += "]" ; + ////--- Extension result + //strncpy_s ( output, outputSize, str. c_str (), _TRUNCATE ); + ////--- Extension return code + //return 100 ; + //} + //else if ( strcmp ( function, "fnc2" ) == 0 ) + //{ + ////--- Parse args into vector + //std :: vector std :: string vec ( args, std :: next ( args, argsCnt )); + //std :: ostringstream oss ; + //if ( ! vec. empty ()) + //{ + ////--- Assemble output array + //std :: copy ( vec. begin (), vec. end () - 1, std :: ostream_iterator std :: string ( oss, "," )); + //oss vec. back (); + //} + ////--- Extension result + //strncpy_s ( output, outputSize, ( "[" + oss. str () + "]" ). c_str (), _TRUNCATE ); + ////--- Extension return code + //return 200 ; + //} + //else + //{ + //strncpy_s ( output, outputSize, "Avaliable Functions: fnc1, fnc2", outputSize - 1 ); + //return - 1 ; + //} + //}$/Code$ undefined / undefined @@ -49222,92 +50231,105 @@ - Number + String - Array + - rank + configProperties - Returns the rank of the given unit. Rank can be one of the following: - "PRIVATE" - "CORPORAL" - "SERGEANT" - "LIEUTENANT" - "CAPTAIN" - "MAJOR" - "COLONEL" + Returns an array of config entries which meet criteria in condition code. Command iterates through available classes and config properties for given config entry. If 3rd param is true the search also includes inherited properties. Current looked at config is stored in _x variable (similar to alternative count command implementation). Condition has to return true in order for the looked at property to be added to the resulting array. A bit slower than configClasses but allows to access inherited entires. + The condition code passed to configProperties should only be used for simple filter expressions and nothing more - https://community.bistudio.com/wiki/rank + https://community.bistudio.com/wiki/configProperties - rank Object + configProperties Array - rank unitName + configProperties [config, condition, inherit] - $Code$_rank = rank player;$/Code$ + $Code$_configs = configProperties [ configFile "CfgVehicles" "O_Truck_02_box_F"];$/Code$ + + $Code$_configs = configProperties [ configFile "RscText", " true ", true ];$/Code$ + + $Code$// Get all hitpoints of a truck: + _hitPoints = []; + _hitPointsCfgs = configProperties [ + configFile "CfgVehicles" "O_Truck_02_box_F" "HitPoints", + " true ", + true + ]; + hint str _hitPointsCfgs;$/Code$ - global / undefined + undefined / undefined - String + Array + - rating + ctrlSetChecked - Check unit rating. Rating is increased for killing enemies, decreased for killing friendlies (see Rating Values ). Can be changed via addRating by the mission designer. - The rating of the player is displayed as the "score" at the end of the mission. Via Description.ext one can define how many points it takes to get a perfect score, as well as the number of stars. + Sets checked state of a checkbox in checkboxes control (CT_CHECKBOXES, type = 7; ). Since Arma 3 v1.71.141591 it is possible to check checkbox with given index in multiple checkboxes set-up. For more information see DialogControls-CheckBoxes. - https://community.bistudio.com/wiki/rating + https://community.bistudio.com/wiki/ctrlSetChecked - rating Object + Control ctrlSetChecked Boolean + + Control ctrlSetChecked Array - rating unitName + control ctrlSetChecked checked + + control ctrlSetChecked [index, checked] - $Code$_score = rating player$/Code$ + $Code$_control ctrlSetChecked true ;$/Code$ + + $Code$_control ctrlSetChecked [3, true ];$/Code$ - global / undefined + undefined / undefined - In ArmA 1.18 rating does only return rating levels for units that are local. - Number + Nothing - Nothing + - rectangular + enableUAVWaypoints - Checks if a location is rectangular (returns true) or elliptical (returns false). + Enables/disables the option for player to set waypoints for UAV in AV terminal. - https://community.bistudio.com/wiki/rectangular + https://community.bistudio.com/wiki/enableUAVWaypoints - rectangular Location + Object enableUAVWaypoints Boolean - rectangular location + uav enableUAVWaypoints enable - $Code$_isRect = rectangular myLocation;$/Code$ + $Code$_uav enableUAVWaypoints false ; + hint str waypointsEnabledUAV _uav; // returns false$/Code$ undefined / undefined @@ -49315,34 +50337,41 @@ - Boolean + Nothing + - registerTask + default - Register a new task type. Parameters are defined in the given config class (subclass of CfgTasks). + See switch do. - https://community.bistudio.com/wiki/registerTask + https://community.bistudio.com/wiki/default - Team_Member registerTask String + default Code - teamMember registerTask entryName + default a - + $Code$switch (_condition) do { + case 1: { hint "1" }; + case 2: { hint "2" }; + default { hint "default" }; + };$/Code$ + undefined / undefined - Boolean + Nothing + @@ -49374,238 +50403,164 @@ - Array + Array + - reloadEnabled + captive - Check whether magazine is reloaded whenever emptied. + Returns the captive state of the given unit (set with setCaptive ). A captive unit will not be attacked by its enemies. + ! + While a captive unit won't be attacked, it will still attack its enemies – be sure to setBehaviour "CARELESS" / removeAllWeapons accordingly. - https://community.bistudio.com/wiki/reloadEnabled + https://community.bistudio.com/wiki/captive - reloadEnabled Object + captive Object - reloadEnabled unitName + captive object - + $Code$if ( captive _general) then { removeAllWeapons _general; };$/Code$ + - undefined / undefined + global / undefined - Boolean + Boolean + - reload + addTeamMember - Reload all weapons + Add given member to given team. Effect is local, unless both member and team are local to PC on which command is executed, then effect is global. + The same Team Member can be member of several different teams at the same time. - https://community.bistudio.com/wiki/reload + https://community.bistudio.com/wiki/addTeamMember - reload Object + Team_Member addTeamMember Team_Member - reload unitName + team addTeamMember member - $Code$if ( needReload player == 1) then { reload player };$/Code$ + $Code$_team addTeamMember _teamMember;$/Code$ - undefined / undefined + local / local - Nothing + Nothing + - remoteControl + assignAsTurret - Switches on remote control of the unit. Command needs to be executed locally to the player. If driver is remote it will get transferred to players PC. + Assigns the soldier to turret. - https://community.bistudio.com/wiki/remoteControl + https://community.bistudio.com/wiki/assignAsTurret - Object remoteControl Object + Object assignAsTurret Array - who remoteControl whom + unit assignAsTurret [vehicle, [turretPath]] - $Code$// Set player remote control of driver: - player remoteControl driver UAV; - driver UAV switchCamera "Internal"; //switchCamera required - //sometimes switchCamera is not needed - player remoteControl driver UAV;$/Code$ - - $Code$// Return control to player: - objNull remoteControl driver UAV;$/Code$ - + - local / global + undefined / undefined - You must use switchCamera in order to remote control the unit and. - You can only remoteControl characters, e.g. if yo want to remote control a car, you have - to add a driver and use - "player remoteControl driver someVehicle". - - (Jan 25, 2010) - Arma 1.05 : - You can remoteControl multiple units at the same time. - It is not needed to switchCamera to the unit to be able to control it - it is needed to be able to fire with. - The switchCamera is fixed : the player can't change internal/external/optics view. - Do not think about it like a selectPlayer : it is used to give the control to the vehicle role the unit is in. - SwitchCamera to the vehicle the unit is in ; the camera will go depending the role you are remoteControlling. - The AI driver won't follow your vehicle move orders. - If the player dies, the death screen will appear, not automatically turning back to the player. - If you want to stop the remote control, use objNull as remote controller. - Example : - player remoteControl driver jeep1; // will remoteControl it, you still will have full control of the player - jeep1 switchCamera "internal"; // fix the camera to the ''vehicle'' and not to (driver jeep1) ! - waitUntil { !(alive jeep1) || !(alive player) }; - objNull remoteControl driver jeep1; // removes the remoteControlling - player switchCamera "internal"; // returns to the player - Nothing + Nothing + - remoteExecCall + inArea - Asks server to execute given scripted function or script command on given target PC. The environment chosen for the execution is as follows: - Scripted function - unscheduled environment ( suspension is NOT allowed). - Script command - unscheduled environment ( suspension is NOT allowed). - remoteExecCall can also be used in SP (the same restrictions apply both to SP and MP). For more information about the usage, security features and advanced jip techniques check the remote execution dedicated section. - While it is true that this function executes the desired scripted command/function by calling it, it does not mean remoteExecCall itself will be executed right away. Therefore, calling remoteExecCall is by no means a replacement for calling scripted commands/functions directly. - Example: - remoteExecCall ["func1"]; call func2; // func2 can be executed sooner than func1 - call func1; call func2; // func2 will always execute after func1. + Checks whether given position is inside given area. The area is usually a rectangle or an ellipse defined similar to triggerArea format. Hence argument for this command could be a trigger, a marker, a location or an array in format [center, a, b, angle, isRectangle, c]. This command also supports hexagon area which can be created from ellipse when both a and b are negative. Hexagon ellipses are also supported by both marker creation and drawEllipse. + Alternatively, use inAreaArray to check multiple positions/objects within area. - https://community.bistudio.com/wiki/remoteExecCall + https://community.bistudio.com/wiki/inArea - Anything remoteExecCall Array + Array/Object inArea Object + + Array/Object inArea String + + Array/Object inArea Location + + Array/Object inArea Array - params remoteExecCall [functionName, targets, JIP] + position inArea trigger + + position inArea marker + + position inArea location + + position inArea [center, a, b, angle, isRectangle, c] - $Code$// runs hint "hello" on each connected client - "hello" remoteExecCall [" hint "];$/Code$ - - $Code$// runs hint "hello" on first connected client - "hello" remoteExecCall [" hint ", 3];$/Code$ - - $Code$// runs hint "hello" everywhere but server - "hello" remoteExecCall [" hint ", -2];$/Code$ - - $Code$// runs hint "hello" everywhere but server, JIPs the message - // and returns e.g. "3_1" as a unique JIP id - myJipID = "hello" remoteExecCall [" hint ", -2, true ];$/Code$ - - $Code$// runs hint "hello" everywhere but server, JIPs the message under ID "some_JIP_ID" - // replacing any previous message with this ID in the JIP queue. - "hello" remoteExecCall [" hint ", -2, "some_JIP_ID"];$/Code$ - - $Code$// runs "someFuncWithNoArgs" on each connected client - remoteExecCall ["someFuncWithNoArgs"];$/Code$ - - $Code$// removes a message identified by "IamUnique" from the JIP queue - remoteExecCall ["", "IamUnique"];$/Code$ - - $Code$// all clients will have their ammo set to 1 for their current weapon - { player setAmmo [ primaryWeapon player, 1];} remoteExecCall [" bis_fnc_call ", 0];$/Code$ - - $Code$// Object obj will have its ammo set to 1 where it is local - [obj,[ primaryWeapon obj, 1]] remoteExecCall [" setAmmo ", obj];$/Code$ + $Code$_playerIsInside = player inArea _myTrigger;$/Code$ - $Code$myJipID = "hello" remoteExecCall ["", 0]; - if ( isNil "myJipID") then { hint "empty function name is not allowed"; };$/Code$ + $Code$_positionIsInside = _myPosition inArea [[100, 100, 0], 20, 30, 45, false ];$/Code$ undefined / undefined - (July 16, 2015) - Removal of persistent call must be in the following format no argument remoteExecCall [ empty string, JIP id ]. For example: - $Code$ remoteExecCall ["", "5:8"];$/Code$ - - (December 29, 2015) - remoteExec and remoteExecCall are currently filtered by BattlEye's remoteexec.txt, the string analyzed by BE is formatted the same way as the following example's output: - $Code$ format ["%1 %2", functionName, str params]$/Code$ - If CfgRemoteExec class Functions is in mode 1 (whitelist), the following BE filter exclusion can be used to safely allow all whitelisted *_fnc_* functions taking an array as parameter to go through: - $Code$!="\w+?_fnc_\w+? \[.*\]"$/Code$ - Any attempt to exploit this exclusion using other RE methods like createUnit will run into "Error Missing ;" without any malicious code being executed. - Mod makers should refrain from remote-executing raw commands from clients, and instead use functions, as commands need to be excluded individually for BE, while all functions are covered by the above exclusion. - - (May 10, 2017) - To remoteExecCall : - $Code$ titleText ["Test Message", "PLAIN", 1];$/Code$ - Use - $Code$[["Test Message", "PLAIN", 1]] remoteExecCall ["titleText"];$/Code$ - Anything + Boolean - Boolean - Boolean - Boolean + - remoteExecutedOwner + preloadTitleRsc - Returns clientOwner of the PC, which initiated Remote Execution call. If used in SP or outside of remote executed context, the command returns 0. To check if the context was remote executed or remote executed from JIP queue, use isRemoteExecuted and isRemoteExecutedJIP + Resource title - Preload data. + The resource can be defined in the Description.ext file. - https://community.bistudio.com/wiki/remoteExecutedOwner + https://community.bistudio.com/wiki/preloadTitleRsc - remoteExecutedOwner + preloadTitleRsc Array - remoteExecutedOwner + preloadTitleRsc [name, type] + + preloadTitleRsc [name, type, speed, showInMap] - $Code$_callerRE = remoteExecutedOwner ;$/Code$ - - $Code$// Send request to the server and get immediate response: - { - // in this scope, the remoteExecutedOwner equals clientOwner of the sender - // so using it as target in remoteExec will send response right back at him - [ - time, // mission time value on the server - { - hint format - [ - "Request recieved!\nMission time value on the server is: %1", - _this - ]; - } - ] - remoteExec ["call", remoteExecutedOwner ]; // server response to the sender - } - remoteExec ["call", 2]; // send request to server$/Code$ + $Code$_ok=preloadTitleRsc ["BIS", "PLAIN"]$/Code$ undefined / undefined @@ -49613,256 +50568,186 @@ - Number + Boolean + - remoteExec + removeBackpackGlobal - Asks server to execute given scripted function or script command on given target PC. The environment chosen for the execution is as follows: - Scripted function - scheduled environment ( suspension is allowed, i.e. spawn, execVM ). - Script command - unscheduled environment ( suspension is NOT allowed). - remoteExec can also be used in SP (the same restrictions apply both to SP and MP). For more information about the usage, security features and advanced jip techniques check the remote execution dedicated section. + Removes backpack from a unit. (even non-local) - https://community.bistudio.com/wiki/remoteExec + https://community.bistudio.com/wiki/removeBackpackGlobal - Anything remoteExec Array + removeBackpackGlobal Object - params remoteExec [functionName, targets, JIP] + removeBackpackGlobal unit - $Code$// runs hint "hello" on each connected client - "hello" remoteExec [" hint "];$/Code$ - - $Code$// runs hint "hello" on first connected client - "hello" remoteExec [" hint ", 3];$/Code$ - - $Code$// runs hint "hello" everywhere but server - "hello" remoteExec [" hint ", -2];$/Code$ - - $Code$// runs hint "hello" everywhere but server, JIPs the message - // and returns e.g. "3_1" as a unique JIP id - myJipID = "hello" remoteExec [" hint ", -2, true ];$/Code$ - - $Code$// runs hint "hello" everywhere but server, JIPs the message under ID "some_JIP_ID" - // replacing any previous message with this ID in the JIP queue. - "hello" remoteExec [" hint ", -2, "some_JIP_ID"];$/Code$ - - $Code$// runs "someFuncWithNoArgs" on each connected client - remoteExec ["someFuncWithNoArgs"];$/Code$ - - $Code$// removes a message identified by "IamUnique" from the JIP queue - remoteExec ["", "IamUnique"];$/Code$ - - $Code$// all clients will have their ammo set to 1 for their current weapon - { player setAmmo [ primaryWeapon player, 1];} remoteExec [" bis_fnc_call ", 0];$/Code$ - - $Code$// Object obj will have its ammo set to 1 where it is local - [obj,[ primaryWeapon obj, 1]] remoteExec [" setAmmo ", obj];$/Code$ - - $Code$myJipID = "hello" remoteExec ["", 0]; - if ( isNil "myJipID") then { hint "empty function name is not allowed"; };$/Code$ + $Code$removeBackpackGlobal player ;$/Code$ - undefined / undefined + global / global - (June 30, 2015) - While it is true that this function executes the desired scripted command/function by calling it, it does not mean remoteExecCall itself will be executed right away. Therefore, calling remoteExecCall is by no means a replacement for calling scripted commands/functions directly. - Example: - remoteExecCall ["func1"]; call func2; // func2 can be executed sooner than func1 - call func1; call func2; // func2 will always execute after func1. - - (December 29, 2015) - remoteExec and remoteExecCall are currently filtered by BattlEye's remoteexec.txt, the string analyzed by BE is formatted the same way as the following example's output: - $Code$ format ["%1 %2", functionName, str params]$/Code$ - If CfgRemoteExec class Functions is in mode 1 (whitelist), the following BE filter exclusion can be used to safely allow all whitelisted *_fnc_* functions taking an array as parameter to go through: - $Code$!="\w+?_fnc_\w+? \[.*\]"$/Code$ - Any attempt to exploit this exclusion using other RE methods like createUnit will run into "Error Missing ;" without any malicious code being executed. - Mod makers should refrain from remote-executing raw commands from clients, and instead use functions, as commands need to be excluded individually for BE, while all functions are covered by the above exclusion. - - (January 15, 2016) - Executing commands/functions via remoteExec is more faster than using BIS_fnc_MP. Tested with BIS_fnc_codePerformance in ArmA 3 1.52. - $Code$['"string" remoteExec ["hint",player];',[],100] call BIS_fnc_codePerformance ; //Result ~0.1ms$/Code$ - $Code$['["string","hint", player ] call BIS_fnc_MP ;',[],100] call BIS_fnc_codePerformance ; //Result ~0.6ms$/Code$ - - (March 24, 2016) - The INCORRECT way to call reveal command on a certain object for every player: - $Code$[ player, _desired_object] remoteExec ["reveal", 0];$/Code$ - In this case player object will be the object obtained on the computer where remoteExec is initiated. If it is dedicated server, player will be objNull, if it is client, player would be player object on this client. In any case this will not reveal _desired_object for all connected players. - The CORRECT way: - $Code$[_desired_object, { player reveal _this}] remoteExec ["call", 0];$/Code$ - The _desired_object will be identical on every client, this is what we want, but player will refer to individual player on each client, so _desired_object will be revealed to all connected players. - - (May 25, 2016) - When adapting mission from dedicated server for SP, if target used in remoteExec is -2 (execute on every client but not server), in SP this will not execute since client is server in SP. To work around, the target could be set using isMultiplayer condition like this: - $Code$"123" remoteExec ["hint", [0, -2] select isMultiplayer ];$/Code$ - This will execute hint on every client in MP on dedicated server (target -2) and will also execute it in SP (target 0). - - (May 28, 2016) - While KK's solution works fine in sp missions and on dedicated servers, it will not work properly for hosted missions. - Solution: - $Code$[0,0.5] remoteExec [' fadeRadio ',[0,-2] select isDedicated, true ];$/Code$ - Singleplayer: isDedicated returns false - code is executed everywhere (0) - Hosted: isDedicated returns false - code is executed everywhere including host (0) - Dedicated: isDedicated returns true - code is executed everywhere excluding server (-2) - - (Jan 30, 2017) - $Code$[some params] remoteExec ['some command',2,true];$/Code$ - will fail, as you can't use JIP and remoteExec on server only - $Code$[some params] remoteExec ['some command',2]; // works$/Code$ - - (May 10, 2017) - To remoteExec : - $Code$ titleText ["Test Message", "PLAIN", 1];$/Code$ - Use - $Code$[["Test Message", "PLAIN", 1]] remoteExec ["titleText"];$/Code$ + (May 8, 2016) + Because of AG (Arguments Global), you can use this command to remove the backpack from UNITS that are local as well as REMOTE. + $Code$ removeBackpackGlobal UNIT;$/Code$ where UNIT can be a local and/or REMOTE player and/or AI - Anything + Nothing + - remove3DENConnection + typeOf - Remove connection between entities. + Returns the config class name of given object or "" if object doesn't have config class. - https://community.bistudio.com/wiki/remove3DENConnection + https://community.bistudio.com/wiki/typeOf - remove3DENConnection Array + typeOf Object - remove3DENConnection [type, from, to] + typeOf object - $Code$remove3DENConnection ["RandomStart", get3DENSelected "Object","marker_0"] - // Remove random start on marker "marker_0" from all selected objects.$/Code$ + $Code$if ( typeOf vehicle player == "B_Heli_Light_01_armed_F") then { hint "Player is in AH-9 Pawnee"};$/Code$ undefined / undefined + (August 4, 2006) + (CWR 1.90)Try using this on an object pre-placed in the mission editor (such as a house): hint format ["%1", typeOf object xxx] Now place an object in the editor, save the map, and open up the Mission.sqm. Find the line: vehicle = "XXX", and replace XXX with the name of the object that you found above. Save it, and load the map. (this method is no longer available since ArmA) - Boolean + String + - remove3DENEventHandler + moveTo - Removes Eden Editor event handler of given type and ID. - See the list of all Eden Editor Event Handlers. + Low level command to person to move to given position. - https://community.bistudio.com/wiki/remove3DENEventHandler + https://community.bistudio.com/wiki/moveTo - remove3DENEventHandler Array + Object moveTo PositionATL - remove3DENEventHandler [type,id] + person moveTo position - $Code$eh = add3DENEventHandler ["onUndo",{ systemChat "Zip..."}]; - remove3DENEventHandler ["onUndo",eh];$/Code$ - + - undefined / undefined + local / global + (August 14, 2010) + moveTo is a low-level command used in FSM called with doFSM or commandFSM. See doFSM for more information about this. Use doMove everywhere else - even in FSM executed with execFSM. - Nothing + Nothing + - remove3DENLayer + menuShortcutText - Remove Eden Editor editing layer. + Returns a string containing shortcut text for menu item on the given path. - https://community.bistudio.com/wiki/remove3DENLayer + https://community.bistudio.com/wiki/menuShortcutText - remove3DENLayer Number + menuShortcutText Array - remove3DENLayer layerID + menuShortcutText [idc, path] - $Code$_myLayer = -1 add3DENLayer "Enemy Base"; - remove3DENLayer _myLayer ;$/Code$ - + undefined / undefined - Boolean + String + - removeAction + selectedEditorObjects - Removes user added action with given id index. This only removes actions added with the addAction command. You cannot remove default game actions, such as reload. - This command has local effect. The action will only be removed on the computer that executes the command. + Returns a list of currently selected editor objects. + i + Some Old Editor Command - https://community.bistudio.com/wiki/removeAction + https://community.bistudio.com/wiki/selectedEditorObjects - Object removeAction Number + selectedEditorObjects Control - unit removeAction index + selectedEditorObjects map - $Code$player removeAction 0;$/Code$ + $Code$_selObjects = selectedEditorObjects _map + Result can be: ["_vehicle_0","_vehicle_9","_vehicle_11"]$/Code$ - global / local + undefined / undefined - Nothing + Array + - removeAll3DENEventHandlers + grpNull - Removes all Eden Editor event handlers of given type. - See the list of all Eden Editor Event Handlers. + A non-existing Group. To compare non-existent groups use isNull or isEqualTo : + grpNull == grpNull ; // false + isNull grpNull ; // true + grpNull isEqualTo grpNull ; // true - https://community.bistudio.com/wiki/removeAll3DENEventHandlers + https://community.bistudio.com/wiki/grpNull - removeAll3DENEventHandlers String + grpNull - removeAll3DENEventHandlers type + grpNull - $Code$removeAll3DENEventHandlers "onUndo";$/Code$ + $Code$! isNull grpNull ; // false$/Code$ + + $Code$str grpNull ; // NULL-group$/Code$ undefined / undefined @@ -49870,200 +50755,302 @@ - Nothing + Group + - removeAllActions + finishMissionInit - Removes all unit's user added actions. + Finish world initialization before mission is launched. - https://community.bistudio.com/wiki/removeAllActions + https://community.bistudio.com/wiki/finishMissionInit - removeAllActions Object + finishMissionInit - removeAllActions unit + finishMissionInit - $Code$removeAllActions player ;$/Code$ - + - global / local + undefined / undefined - (30 October, 2013) - Syntax of this command was until Arma 3 ver. 1.06: unit removeAllActions number - Nothing + Nothing + - removeAllAssignedItems + create3DENComposition - Unassigns and deletes all linked items from inventory. The commands operates on assignedItems array, which doesnt include goggles or headgear. Use removeGoggles and removeHeadgear for those. + Create new Composition. To create individual entities, use create3DENEntity. - https://community.bistudio.com/wiki/removeAllAssignedItems + https://community.bistudio.com/wiki/create3DENComposition - removeAllAssignedItems Object + create3DENComposition Array - removeAllAssignedItems unit + create3DENComposition [configPath, position] - $Code$removeAllAssignedItems player ;$/Code$ + $Code$myComposition = create3DENComposition [ + configFile "CfgGroups" "West" "BLU_F" "Infantry" "BUS_InfSquad", + screenToWorld [0.5,0.5] + ];$/Code$ - local / global + undefined / undefined - Nothing + Array + - removeAllContainers + getMarkerColor - Removes all containers from the unit. + Returns marker color for given marker. See setMarkerColor. Note: This function is identical to markerColor. - https://community.bistudio.com/wiki/removeAllContainers + https://community.bistudio.com/wiki/getMarkerColor - removeAllContainers Object + getMarkerColor String - removeAllContainers unit + getMarkerColor markerName - $Code$removeAllContainers player;$/Code$ + $Code$"MarkerOne" setMarkerColor "ColorBlack"; + _color = getMarkerColor "MarkerOne"; //returns "ColorBlack"$/Code$ - undefined / undefined + global / undefined - (2013) - This will remove the Uniform, Vest and Backpack from a unit leaving them unable to hold or pickup inventory items. - Nothing + String + - removeAllCuratorAddons + call - Restrict access to all addons for given curator. + Executes given set of compiled instructions with an option to pass arguments to the executed Code. In OFP this command used to accept String for the code. - https://community.bistudio.com/wiki/removeAllCuratorAddons + https://community.bistudio.com/wiki/call - removeAllCuratorAddons Object + call Code + + Anything call Code - removeAllCuratorAddons curatorObj + call code + + args call code - $Code$removeAllCuratorAddons myCurator;$/Code$ + $Code$call { hint str 123};$/Code$ + + $Code$123 call { hint str _this};$/Code$ + + $Code$_sum = [1, 2] call {(_this select 0) + (_this select 1)}; + hint str _sum; //3$/Code$ + + $Code$123 call compile " hint str _this";$/Code$ + + $Code$_result = 123 call compile preprocessFileLineNumbers "myfile.sqf";$/Code$ undefined / undefined - This scripting command must be executed on the server to work properly in multiplayer + (July 5, 2014) + A called function may only use suspension ( sleep, uiSleep, waitUntil ) if it originates in a scheduled environment. If the called function originates in a non-scheduled environment it will return a generic error. + $Code$// *** non-scheduled origin *** + [] spawn { + // *** scheduled scope *** + [] call { + // *** scheduled scope *** + sleep 3; // - OK + hintSilent "Hello World!"; + }; + }; + $/Code$ + $Code$// *** non-scheduled origin *** + [] call { + // *** non-scheduled scope*** + [] call { + // *** non-scheduled scope *** + sleep 3; // - NOT OK + hintSilent "Hello World!"; + }; + }; + $/Code$ + $Code$// *** scheduled origin *** + [] spawn { + // *** scheduled scope *** + [] call { + // *** scheduled scope *** + sleep 3; // - OK + hintSilent "Hello World!"; + }; + }; + $/Code$ + $Code$// *** scheduled origin *** + [] call { + // *** scheduled scope*** + [] call { + // *** scheduled scope *** + sleep 3; // - OK + hintSilent "Hello World!"; + }; + }; + $/Code$ + + (February 17, 2015) + If the code is in non-scheduled scope and contains while-do statement, the code runs only 10,000 times at the maximum, even if the statement makes infinite loop. (ARMA3 Ver. 1.38.128937) + $Code$// *** non-scheduled origin *** + [] call { + // *** non-scheduled scope*** + [] call { + // *** non-scheduled scope *** + _a=0; + while{_a 15000} do{ + _a=_a+1; + }; + hint str(_a);//10000 + }; + };$/Code$ - Nothing + Anything - Anything + - removeAllCuratorCameraAreas + lightIsOn - Delete all curator camera areas. + Check if lampost is on (shining). For working with CfgNonAIVehicles class "StreetLamp" only. Possible values are: + "ON" + "OFF" + "AUTO" (auto is only on during the night). + "ERROR" - https://community.bistudio.com/wiki/removeAllCuratorCameraAreas + https://community.bistudio.com/wiki/lightIsOn - removeAllCuratorCameraAreas Object + lightIsOn Object - removeAllCuratorCameraAreas curatorObj + lightIsOn lamppost - $Code$removeAllCuratorCameraAreas myCurator;$/Code$ + $Code$? lightIsOn nearestObject [ player, "StreetLamp"] == "ON" :hint "nightime"$/Code$ + + $Code$_it = lightIsOn object 159582$/Code$ + + $Code$if ( count allMissionObjects "StreetLamp" == 0) then { + hint "Objects compatible with 'lightIsOn' are not found."; + } else { + hint "'lightIsOn' compatible objects are found!"; + };$/Code$ undefined / undefined + (August 4, 2006) + Notes from before the conversion: + Use switchLight to turn lamposts on and off. - Nothing + String + - removeAllCuratorEditingAreas + cutFadeOut - Delete all curator edit areas. + Terminates the effect in the given layer by fading it out according to the given duration. If named layer used and it doesn't exist, it will be allocated. + For greater efficiency and ease of modability it is recommended to use named layers available with alternative syntax since Arma 3 v1.57.134673 - https://community.bistudio.com/wiki/removeAllCuratorEditingAreas + https://community.bistudio.com/wiki/cutFadeOut - removeAllCuratorEditingAreas Object + Number cutFadeOut Number + + String cutFadeOut Number - removeAllCuratorEditingAreas curatorObj + layer cutFadeOut duration + + layerName cutFadeOut duration - $Code$removeAllCuratorEditingAreas myCurator;$/Code$ + $Code$0 cutFadeOut 2;$/Code$ + + $Code$_layer = "layer1" cutFadeOut 2;$/Code$ undefined / undefined + (July 9, 2016) + (ArmA v1.60) + The actual fadeout-duration can be dependent on the duration for the fadein (e.g. specified by cutText ). If the fadein-duration is set to a value less than 1 the fadeout-duration will be the given number multiplied by the fadein-duration. + "test" cutText ["", "BLACK", 0.5, true]; // fadein is 0 + "test" cutFadeout 2; // The actual fadeout-time is 2 * 0.5 = 1 - Nothing + Nothing - Number + - removeAllEventHandlers + get3DENEntityID - Removes all event handlers of given type that were added by addEventHandler. Since VBS2 v1.24 can be applied on individual weapon rounds. + Returns unique index of an Eden Entity. This number remains the same even after saving and loading the scenario. - https://community.bistudio.com/wiki/removeAllEventHandlers + https://community.bistudio.com/wiki/get3DENEntityID - Object removeAllEventHandlers String + get3DENEntityID EdenEntity - objectName removeAllEventHandlers handlerType + get3DENEntityID entity - $Code$player removeAllEventHandlers "killed";$/Code$ + $Code$myID = get3DENEntityID player$/Code$ undefined / undefined @@ -50071,54 +51058,82 @@ - Nothing + Number + - removeAllHandgunItems + playGesture - Removes all items from weapon except magazine. + When used on a person,a smooth transition to the given move will be initiated. Command doesn't seem to be functional - https://community.bistudio.com/wiki/removeAllHandgunItems + https://community.bistudio.com/wiki/playGesture - removeAllHandgunItems Object + Object playGesture String - removeAllHandgunItems unit + soldier playGesture moveName - + $Code$soldierOne playGesture "Wave"$/Code$ + - local / global + undefined / undefined + (August 31, 2010) + Rpt says "Not implemented" as of OA 1.54. - Nothing + Nothing + - removeAllItemsWithMagazines + ctrlSetAngle - Removes all itemsWithMagazines from the uniform, vest and backpack. + Sets the rotation of an ST_PICTURE control. Rotation will be done within the control boundaries, so if the X and Y are given off center, the picture may get clipped by the control boundaries. Doesn't require ctrlCommit. Procedural textures filled controls do not rotate. - https://community.bistudio.com/wiki/removeAllItemsWithMagazines + https://community.bistudio.com/wiki/ctrlSetAngle - removeAllItemsWithMagazines Object + Control ctrlSetAngle Array - removeAllItemsWithMagazines unit + control ctrlSetAngle [angle, centerX, centerY] + + control ctrlSetAngle [angle, centerX, centerY, now] - $Code$removeAllItemsWithMagazines player ;$/Code$ + $Code$_control ctrlSetAngle [25, 0.5, 0.5];$/Code$ + + $Code$with uiNamespace do + { + ctrl = findDisplay 46 ctrlCreate ["RscPictureKeepAspect", -1]; + ctrl ctrlSetPosition [0,0,1,1]; + ctrl ctrlSetText "A3\Missions_F_Exp\data\Img\lobby\ui_campaign_lobby_background_tablet_radial_left_ca.paa"; + ctrl ctrlCommit 0; + angle = 0; + onEachFrame + { + with uiNamespace do + { + if (angle 359) then {angle = 0}; + ctrl ctrlSetAngle [angle, 0.5, 0.5]; + angle = angle + 1; + }; + }; + };$/Code$ + + $Code$_control ctrlSetAngle [25, 0.5, 0.5, false ]; + _control ctrlCommit 1; // Rotation applies smoothly for 1 second.$/Code$ undefined / undefined @@ -50126,85 +51141,88 @@ - Nothing + Nothing + - removeAllItems + weaponsItemsCargo - Removes all special items from the unit. + Returns an array with subarrays contains class names and also names of connected items of all the vehicle's cargo weapons in weaponsItems format. If weapon has no magazine, an empty array [] is returned instead of magazine info. - https://community.bistudio.com/wiki/removeAllItems + https://community.bistudio.com/wiki/weaponsItemsCargo - removeAllItems Object + weaponsItemsCargo Object - removeAllItems unit + weaponsItemsCargo vehicle - $Code$removeAllItems unitName;$/Code$ + $Code$weaponsItemsCargo vehicle player ;$/Code$ + + $Code$weaponsItemsCargo _weaponholder;$/Code$ - local / global + undefined / undefined - (June 18, 2013) - Arma 3, version 0.70 - removes only items listed by command items. - Nothing + Array + - removeAllMPEventHandlers + showWaypoints - Removes all MP event handlers of the given type which were added by addMPEventHandler. Command needs to be executed only on one PC for MP event handler to be removed globally. + Shows/Hides task HUD markers and waypoints that will fade out in time. Dependable on difficulty settings. - https://community.bistudio.com/wiki/removeAllMPEventHandlers + https://community.bistudio.com/wiki/showWaypoints - Object removeAllMPEventHandlers String + showWaypoints Boolean - objectName removeAllMPEventHandlers event + showWaypoints enabled - $Code$player removeAllMPEventHandlers "mpkilled";$/Code$ + $Code$showWaypoints true ;$/Code$ - global / global + undefined / undefined - Nothing + Nothing + - removeAllMissionEventHandlers + ropeDestroy - Removes all mission event handlers of the given type which were added by addMissionEventHandler. + Destroy a rope. - https://community.bistudio.com/wiki/removeAllMissionEventHandlers + https://community.bistudio.com/wiki/ropeDestroy - removeAllMissionEventHandlers String + ropeDestroy Object - removeAllMissionEventHandlers type + ropeDestroy rope - $Code$removeAllMissionEventHandlers "Loaded";$/Code$ + $Code$ropeDestroy myRope;$/Code$ undefined / undefined @@ -50212,29 +51230,28 @@ - Nothing + Nothing + - removeAllMusicEventHandlers + markerBrush - Removes all music track event handlers of given type. + Gets the marker brush. See setMarkerBrush. - https://community.bistudio.com/wiki/removeAllMusicEventHandlers + https://community.bistudio.com/wiki/markerBrush - removeAllMusicEventHandlers String + markerBrush String - removeAllMusicEventHandlers type + markerBrush name - $Code$removeAllMusicEventHandlers "MusicStart"$/Code$ - - $Code$removeAllMusicEventHandlers "MusicStop"$/Code$ + $Code$if ( markerBrush "Marker1" == "Solid") then { hint "Marker1 is solid!"}$/Code$ undefined / undefined @@ -50242,27 +51259,29 @@ - Nothing + String + - removeAllOwnedMines + toLower - Removes ownership of all owned mines/explosive devices of the given unit + Converts the supplied string to all lowercase characters. - https://community.bistudio.com/wiki/removeAllOwnedMines + https://community.bistudio.com/wiki/toLower - removeAllOwnedMines Object + toLower String - removeAllOwnedMines unit + toLower string - $Code$removeAllOwnedMines player ;$/Code$ + $Code$hint toLower("AaBb1") + // returns "aabb1"$/Code$ undefined / undefined @@ -50270,179 +51289,220 @@ - Nothing + String + - removeAllPrimaryWeaponItems + lnbColor - Removes all items from weapon except magazine. + Returns the text color of the item with the given position of the 2D listbox. The color is returned in format Color. - https://community.bistudio.com/wiki/removeAllPrimaryWeaponItems + https://community.bistudio.com/wiki/lnbColor - removeAllPrimaryWeaponItems Object + lnbColor Array + + Control lnbColor Array - removeAllPrimaryWeaponItems unit + lnbColor [idc, [row, column]] + + control lnbColor [row, column] - + $Code$_ctrl lnbColor [0,0];$/Code$ + - local / global + undefined / undefined - - - Nothing + (Sep 9 2014) + (A3 1.28)As for invisible data processing, lnbAddArray, lnbAddColumn, lnbData, lnbGetColumnsPosition, lnbSetColumnsPos, lnbSetData, lnbSetText, lnbSetValue, lnbText and lnbValue store data types into exact position of the listNbox with different spaces. Accessing data with coordinate command at nearly the same syntax: + $Code$ + //Set same value to one position of a Control + _ctrl lnbSetData [ [0,0],"#1"]; + lnbSetColumnsPos [102, [0,1], 1]; + _ctrl lnbSetText [ [0,1], "#1"]; + _ctrl lnbSetValue [ [0,0],1]; + //Accessing the value disregard affecting one another. + _ctrl lnbData [0,0]; //"#1" + lnbGetColumnsPosition _ctrl //[1]; + _ctrl lnbText [0,0];//"#1" + _ctrl lnbValue [0,0];//1 + $/Code$ + For a direct visible control over CT_LISTNBOX: + $Code$ + 0 = [_CT_LISTNBOX] spawn { + private ["_CT_LISTNBOX","_color","_current","_pic"]; + disableSerialization ; + _CT_LISTNBOX = _this select 0; + { + _CT_LISTNBOX lnbAddRow [ getText (_x "displayNameShort"), getText (_x "displayName")]; + _CT_LISTNBOX lnbSetPicture [ [_foreachIndex,0], getText (_x "texture")]; + } forEach (" isClass _x" configClasses ( configFile "CfgRanks")); + _CT_LISTNBOX lnbSetCurSelRow 0; + _current = lnbCurSelRow _CT_LISTNBOX; + _color = _CT_LISTNBOX lnbColor [_current,0]; + _CT_LISTNBOX lnbSetColor [ [_current,1], [(_color select 0)/2,0,0,1] ]; + _CT_LISTNBOX lnbDeleteColumn 0; + _CT_LISTNBOX lnbDeleteRow 1; + sleep 1; + lnbClear _CT_LISTNBOX;//Clear all items but control still remains just invisible. + }; + $/Code$ + A combined use of both invisible and visible data processing commands alive the Control. + + + Array - Array + - removeAllWeapons + removeAllCuratorAddons - Remove all weapons and magazines of the unit. - On vehicles only ammo is removed - Does not remove map, compass, radio. Use - unitname removeweapon "itemmap" - for that purpose. + Restrict access to all addons for given curator. - https://community.bistudio.com/wiki/removeAllWeapons + https://community.bistudio.com/wiki/removeAllCuratorAddons - removeAllWeapons Object + removeAllCuratorAddons Object - removeAllWeapons unitName + removeAllCuratorAddons curatorObj - $Code$removeAllWeapons player ;$/Code$ + $Code$removeAllCuratorAddons myCurator;$/Code$ - local / global + undefined / undefined - (October 14, 2014) - removeAllWeapons doesn't quite work with vehicles. If you need to remove all weapons from a vehicle, remove each weapon individually: - $Code${tank removeWeapon _x} forEach weapons tank;$/Code$ + This scripting command must be executed on the server to work properly in multiplayer - Nothing + Nothing + - removeBackpackGlobal + getEnvSoundController - Removes backpack from a unit. (even non-local) + Returns value of the specified controller. - https://community.bistudio.com/wiki/removeBackpackGlobal + https://community.bistudio.com/wiki/getEnvSoundController - removeBackpackGlobal Object + Position getEnvSoundController String - removeBackpackGlobal unit + position getEnvSoundController controller - $Code$removeBackpackGlobal player ;$/Code$ + $Code$position player getEnvSoundController "trees"; //0.3333$/Code$ - global / global + undefined / undefined - (May 8, 2016) - Because of AG (Arguments Global), you can use this command to remove the backpack from UNITS that are local as well as REMOTE. - $Code$ removeBackpackGlobal UNIT;$/Code$ where UNIT can be a local and/or REMOTE player and/or AI + (March 25, 2018) + Other environmental variables are; + rain, night, wind, daytime, meadows, trees, houses, forest, sea, coast, altitudeGround. alititudeSea, shooting, deadbody and fog - Nothing + Number + - removeBackpack + removeAllActions - Removes unit's backpack + Removes all unit's user added actions. - https://community.bistudio.com/wiki/removeBackpack + https://community.bistudio.com/wiki/removeAllActions - removeBackpack Object + removeAllActions Object - removeBackpack unit + removeAllActions unit - $Code$removeBackpack this ;$/Code$ - - $Code$removeBackpack mySoldierDude;$/Code$ + $Code$removeAllActions player ;$/Code$ - local / global + global / local + (30 October, 2013) + Syntax of this command was until Arma 3 ver. 1.06: unit removeAllActions number - Nothing + Nothing + - removeCuratorAddons + atg - Restrict curator use of given addons. + Equivalent to atan - https://community.bistudio.com/wiki/removeCuratorAddons + https://community.bistudio.com/wiki/atg - Object removeCuratorAddons Array + atg Number - curatorObj removeCuratorAddons addons + atg x - $Code$curatorModule removeCuratorAddons [addon1,addon2]$/Code$ - + undefined / undefined - This scripting command must be executed on the server to work properly in multiplayer - Nothing + Number + - removeCuratorCameraArea + glanceAt - Removes curator camera area. + Control what the unit is glancing at (target or Position ). + How frequently the unit is glancing there depends on behaviour. - https://community.bistudio.com/wiki/removeCuratorCameraArea + https://community.bistudio.com/wiki/glanceAt - Object removeCuratorCameraArea Number + Object/Array glanceAt Object/Array - curatorObj removeCuratorCameraArea cameraAreaID + unit glanceAt position - $Code$myCurator removeCuratorCameraArea 3;$/Code$ + $Code$_someSoldier glanceAt _otherSoldier$/Code$ + + $Code$_otherSoldier glanceAt markerPos "markerOne"$/Code$ undefined / undefined @@ -50450,112 +51510,181 @@ - Nothing + Nothing + - removeCuratorEditableObjects + setWaypointFormation - Unregister objects which can be edited by a curator. + Switches the group formation when the waypoint becomes active. + Possible values are: + "NO CHANGE" + "COLUMN" + "STAG COLUMN" + "WEDGE" + "ECH LEFT" + "ECH RIGHT" + "VEE" + "LINE" + "FILE" + "DIAMOND" - https://community.bistudio.com/wiki/removeCuratorEditableObjects + https://community.bistudio.com/wiki/setWaypointFormation - Object removeCuratorEditableObjects Array + Array setWaypointFormation String - curatorObj removeCuratorEditableObjects [[objects],removeCrew] + waypoint setWaypointFormation formation - $Code$curatorModule removeCuratorEditableObjects [[ cursorTarget ],true]$/Code$ + $Code$[_grp, 2] setWaypointFormation "LINE";$/Code$ - undefined / undefined + undefined / global This scripting command must be executed on the server to work properly in multiplayer - Nothing + Nothing + - removeCuratorEditingArea + inheritsFrom - Removes editing area for given curator. + Returns base entry of config entry. - https://community.bistudio.com/wiki/removeCuratorEditingArea + https://community.bistudio.com/wiki/inheritsFrom - Object removeCuratorEditingArea Number + inheritsFrom Config - curatorObj removeCuratorEditingArea editAreaID + inheritsFrom config - $Code$myCurator removeCuratorEditingArea 3;$/Code$ + $Code$_base = inheritsFrom ( configFile "CfgVehicles" "Car"); + // Result is Config entry for class "LandVehicle"$/Code$ + + $Code$// Print parent tree of given config class: + fnc_printParents = + { + disableSerialization ; + if (! isClass _this) exitWith { hint "Argument is not a config Class"}; + private _parents = []; + while {! isNull _this} do + { + _parents pushBack configName _this; + _this = inheritsFrom _this; + }; + reverse _parents; + private _tv = findDisplay 46 createDisplay "RscDisplayEmpty" ctrlCreate ["RscTree", -1]; + _tv ctrlSetPosition [0,0,1,1]; + _tv ctrlSetBackgroundColor [0,0,0,0.5]; + _tv ctrlCommit 0; + private _path = []; + { + _tv tvAdd [_path, _x]; + _path pushBack 0; + } + forEach _parents; + tvExpandAll _tv; + }; + // Example: + ( configFile "CfgVehicles" typeOf player ) call fnc_printParents;$/Code$ undefined / undefined + (Apr 2, 2014) + (A3 1.14)Use BIS_fnc_returnParents if a parents' collection of the given entry is needed. + $Code$ + [( configFile "CfgVehicles" "Land_Atm_02_F"), true ] call BIS_fnc_returnParents ; + //return: ["Land_Atm_02_F","House_Small_F","House_F","House","HouseBase","NonStrategic","Building","Static","All"] + $/Code$ + Not all entries have parent, and please differ parents from path. + $Code$ + inheritsFrom ( configFile "CfgUIColors" "IGUI" "Presets" "PresetA1" "Variables"); + //return: Nothing + $/Code$ - Nothing + Config + - removeDrawIcon + vehicleVarName - Removes an icon for an editor object. - i - Some Old Editor Command + Returns the name of the variable which contains a primary editor reference to this object. This is the variable given in the Insert Unit dialog / name field, in the editor. It can be changed using setVehicleVarName. + If object refers to a vehicle that wasn't given a name in the editor, the return value is an empty string, "". + Since it is possible to setVehicleVarName individually on each PC, the value of vehicleVarName returned will be local to the PC on which command is executed. - https://community.bistudio.com/wiki/removeDrawIcon + https://community.bistudio.com/wiki/vehicleVarName - Control removeDrawIcon Array + vehicleVarName Object - map removeDrawIcon [object,string identifier] + vehicleVarName object - + $Code$hint vehicleVarName player ;$/Code$ + - undefined / undefined + global / local + (April 19, 2015) + To get variable names referencing an object in mission namespace: + $Code$KK_fnc_objectVarNames = { + private "_names"; + _names = []; + { + if ( missionNamespace getVariable _x isEqualTo _this) then { + _names pushBack _x; + }; + } forEach allVariables missionNamespace ; + _names + }; + //example + myGroup = group player ; + aGroup = group player ; + hint str ( group player call KK_fnc_objectVarNames); //["agroup","mygroup"]$/Code$ - Nothing + String + - removeDrawLinks + reversedMouseY - Remove all drawn links for the given editor object for the given editor,object type. Pass an empty string as param type to remove all draw,links for an object. - i - Some Old Editor Command + Return if mouse vertical axe is inverted. - https://community.bistudio.com/wiki/removeDrawLinks + https://community.bistudio.com/wiki/reversedMouseY - Control removeDrawLinks Array + reversedMouseY - map removeDrawLinks [from,param type] + reversedMouseY @@ -50565,28 +51694,30 @@ - Nothing + Boolean + - removeEventHandler + diag_resetShapes - Removes event handler added by addEventHandler. - When any handler is removed, all handler indices higher than the deleted one should be decremented. + Reload models on-the-fly without the need of restarting the game. Changes applied by diag_resetShapes are applied to all new entities so restart of mission is not necessarily required - spawning vehicle again or changing back forth weapon should usually do the trick. It works only with "-FilePatching" in combination with local data. Command will reload only models present in local data. + Limitation - you can't reload cfgSkeletons (Which is inside model.cfg) + Command is only available when using Arma 3 Diagnostics Exe on Dev-Branch. - https://community.bistudio.com/wiki/removeEventHandler + https://community.bistudio.com/wiki/diag_resetShapes - Object removeEventHandler Array + diag_resetShapes - objectName removeEventHandler [type, index] + diag_resetShapes - $Code$player removeEventHandler ["killed", 0]$/Code$ + $Code$diag_resetShapes$/Code$ undefined / undefined @@ -50594,680 +51725,968 @@ - Nothing + Nothing + - removeFromRemainsCollector + isSteamMission - Removes vehicles/units from disposal manager, added earlier with addToRemainsCollector + Returns true if the current mission is a Steam Workshop mission. - https://community.bistudio.com/wiki/removeFromRemainsCollector + https://community.bistudio.com/wiki/isSteamMission - removeFromRemainsCollector Array + isSteamMission - removeFromRemainsCollector remains + isSteamMission - $Code$removeFromRemainsCollector [unit1, unit2, vehicle1];$/Code$ + $Code$if ( isSteamMission ) then + { + hint "Thank you for subscribing to my mission on Steam!"; + } + else + { + hint "Thank you for downloading my mission off the Internet!"; + };$/Code$ - global / global + undefined / undefined - Nothing + Boolean + - removeGoggles + removeEventHandler - Removes goggles from unit (diver goggles for example). This command does not remove NVGoggles. Use unassignItem and removeItem or just unlinkItem for latter. + Removes event handler added by addEventHandler. + When any handler is removed, all handler indices higher than the deleted one should be decremented. - https://community.bistudio.com/wiki/removeGoggles + https://community.bistudio.com/wiki/removeEventHandler - removeGoggles Object + Object removeEventHandler Array - removeGoggles unit + objectName removeEventHandler [type, index] - $Code$removeGoggles assaultDiver;$/Code$ + $Code$player removeEventHandler ["killed", 0]$/Code$ - global / global + undefined / undefined - Nothing + Nothing + - removeGroupIcon + selectBestPlaces - Remove icon with given ID from group. + Find the places with the maximum value of expression in the given area. Places can be on water. Results are sorted by value. Search pattern is randomised every command execution. - https://community.bistudio.com/wiki/removeGroupIcon + https://community.bistudio.com/wiki/selectBestPlaces - Group removeGroupIcon Number + selectBestPlaces Array - group removeGroupIcon iconID + selectBestPlaces [position, radius, expression, precision, sourcesCount] - $Code$_target removeGroupIcon (_target getvariable "hc_attackicon");$/Code$ + $Code$myPlaces = selectBestPlaces [ position player, 50, "meadow + 2*hills", 1, 5];$/Code$ undefined / undefined + (Jul 17, 2010) + see http://forums.bistudio.com/showthread.php?t=93897 for some more information (though neither official, nor complete). The most important information is the list of useable keywords for the expression which is: forest, trees, meadow, hills, houses, sea, night, rain, windy and deadBody. The keyword will be replaced by the actual value at the given sample position and thus the expression gets evaluated. For example the following expression (which returns high values in forest) "forest + trees - meadow - houses - (10 * sea)" might be transformed to 0 + 0.1 - 0.7 - 0 - (10 * 0) which is - with it's result of -0.6 - not in the forest, though there are some tree(s) around. You get the idea. + Also note that you may aswell check such an expression value at a single position by passing a low radius and a sourceCount of 1, which is often just as useful as retrieving multiple (and already sorted) positions. + Also do not underestimate the keywords night, rain or windy, for if you couple them with the other keywords, you can easily get a highly dynamic system at a very low cost. (this, btw., is how animals "choose" where and when to spawn) + + (Apr 3, 2014) + In ArmA3 ver 1.14 Two new expressions are available: waterDepth (0-1) and camDepth (0-1), along with three simple operators: interpolate, randomGen and factor that can be used together with expressions. E.g. + $Code$ + p = selectBestPlaces [ + position player, + 500, + "(2 * (waterDepth interpolate [1,16,0,1]) * ((0.1+houses factor [0.1,0.8]) * (randomGen 1 + houses)))", + 1, + 1]; + $/Code$ + A lgorithm randomGen: + $Code$ + randomGen A(number): randomly generate a float number from 0 - A + $/Code$ + A lgorithm factor: + $Code$ + A(number) factor [p,q] = + p A q: [(A -p)/(q-p)] + $/Code$ + A lgorithm interpolate: + $Code$ + A(number) interpolate [p,q,r,s] = + A =p:r + A =q:s + p A q: [(A -p)/(q-p)]*(s-r) +r + $/Code$ + + (June 15, 2015) + precision seems to have range 0 - 100. At very low values the command is extremely slow. 100 makes it quite fast. It looks like precision is some kind of grid search size. Large chunks make the search faster but less accurate. + Resulting array is [] if sourcesCount is 0 or expression is "". In all other cases it seems that result is array of arrays of the set max count. The sole indication of successful search is expressionResult value when it is 0. + + (June 4, 2017) + Results are sorted by value, that is, the result of the expression. + They are sorted in descending order, so in the case of waterdepth, the deepest water will be found at the locations at the start of the returned array and the shallowest water will be found at the locations at the end. + + (September 22, 2017) + The sourcesCount parameter is capped to 50. Asking for any more is capped to 50. - Nothing + Array + - removeHandgunItem + difficulty - Removes given weapon item from the handgun weapon cargo space. - As of Arma 3 DEV 1.37, this command also supports weapon magazines. + Returns high-level selected difficulty mode. + Returned value will be: 0 (Recruit), 1 (Regular), 2 (Veteran) or 3 (Elite) - https://community.bistudio.com/wiki/removeHandgunItem + https://community.bistudio.com/wiki/difficulty - Object removeHandgunItem String + difficulty - unit removeHandgunItem item + difficulty - $Code$player removeHandgunItem "muzzle_snds_L";$/Code$ + $Code$value = difficulty ;$/Code$ + + $Code$// The command returns the index of selected difficulty as they appear in CfgDifficulties + hint str difficulty ; //Result: 4$/Code$ - local / global + undefined / undefined - Nothing + Number + - removeHeadgear + add3DENConnection - Removes headgear from a unit. If unit has no headgear command quietly fails. + Connect entities together. - https://community.bistudio.com/wiki/removeHeadgear + https://community.bistudio.com/wiki/add3DENConnection - removeHeadgear Object + add3DENConnection Array - removeHeadgear unit + add3DENConnection [type, from, to] - $Code$removeHeadgear player ;$/Code$ + $Code$add3DENConnection ["RandomStart", get3DENSelected "Object","marker_0"] + // Set random start on marker "marker_0" for all selected objects.$/Code$ - global / global + undefined / undefined - (August 5, 2016) - To clarify, this command effectively DELETES the headgear. It does not simply remove it from unit's head and move it into inventory. - Nothing + Boolean + - removeItemFromBackpack + moonPhase - Removes item from soldier's backpack. + Returns the phase of the in-game Moon on the given date in range 0...1, where 0 - new Moon, 1 - full Moon. According to this command the fullest Moon in Arma 3 at midnight is on setDate [4804,7,13,0,0]; Use Moon Phase Utility to find out date for a mission with desired moon. - https://community.bistudio.com/wiki/removeItemFromBackpack + https://community.bistudio.com/wiki/moonPhase - Object removeItemFromBackpack String + moonPhase Array - unit removeItemFromBackpack item + moonPhase date - + $Code$_currentMoonPhase = moonPhase date ;$/Code$ + + $Code$// Returns array of dates for given year when moon is at its fullest + fnc_fullMoonDates = + { + private _year = param [0, 2035]; + private ["_date", "_phase", "_fullMoonDate"]; + private _fullMoonPhase = 1; + private _waxing = false ; + private _fullMoonDates = []; + for "_i" from dateToNumber [_year, 1, 1, 0, 0] to dateToNumber [_year, 12, 31, 23, 59] step 1 / 365 do + { + _date = numberToDate [_year, _i]; + _phase = moonPhase _date; + call + { + if (_phase _fullMoonPhase) exitWith + { + _waxing = true ; + _fullMoonDate = _date; + }; + if (_waxing) exitWith + { + _waxing = false ; + _fullMoonDates pushBack _fullMoonDate; + }; + }; + _fullMoonPhase = _phase; + }; + _fullMoonDates + }; + //set random full moon date in year 1970 + setDate selectRandom (1970 call fnc_fullMoonDates);$/Code$ + - global / global + undefined / undefined - Nothing + Number + - removeItemFromUniform + currentMagazineTurret - Removes item from soldier's uniform. Can be used with magazines and weapons too. + Returns the name of the type of the currently using magazine on specified turret. Use turret path [-1] for driver's turret. Note that a turret is not loaded until unit enters it, so this command will return "". - https://community.bistudio.com/wiki/removeItemFromUniform + https://community.bistudio.com/wiki/currentMagazineTurret - Object removeItemFromUniform String + Object currentMagazineTurret Array - unit removeItemFromUniform item + vehicle currentMagazineTurret [turret path] - + $Code$_magazine = MBT_Kuma currentMagazineTurret [0];$/Code$ + - global / global + undefined / undefined - Nothing + String + - removeItemFromVest + lnbSetValue - Removes item from soldier's vest. + Sets the additional integer value in the item with the position index of the 2D listbox. - https://community.bistudio.com/wiki/removeItemFromVest + https://community.bistudio.com/wiki/lnbSetValue - Object removeItemFromVest String + lnbSetValue Array + + Control lnbSetValue Array - unit removeItemFromVest item + lnbSetValue [idc, [row, column], value] + + control lnbSetValue [[row, column], value] - + $Code$_ctrl lnbSetValue [[0,0],1];$/Code$ + - global / global + undefined / undefined + (Sep 9 2014) + (A3 1.28)As for invisible data processing, lnbAddArray, lnbAddColumn, lnbData, lnbGetColumnsPosition, lnbSetColumnsPos, lnbSetData, lnbSetText, lnbSetValue, lnbText and lnbValue store data types into exact position of the listNbox with different spaces. Accessing data with coordinate command at nearly the same syntax: + $Code$ + //Set same value to one position of a Control + _ctrl lnbSetData [ [0,0],"#1"]; + lnbSetColumnsPos [102, [0,1], 1]; + _ctrl lnbSetText [ [0,1], "#1"]; + _ctrl lnbSetValue [ [0,0],1]; + //Accessing the value disregard affecting one another. + _ctrl lnbData [0,0]; //"#1" + lnbGetColumnsPosition _ctrl //[1]; + _ctrl lnbText [0,0];//"#1" + _ctrl lnbValue [0,0];//1 + $/Code$ + For a direct visible control over CT_LISTNBOX: + $Code$ + 0 = [_CT_LISTNBOX] spawn { + private ["_CT_LISTNBOX","_color","_current","_pic"]; + disableSerialization ; + _CT_LISTNBOX = _this select 0; + { + _CT_LISTNBOX lnbAddRow [ getText (_x "displayNameShort"), getText (_x "displayName")]; + _CT_LISTNBOX lnbSetPicture [ [_foreachIndex,0], getText (_x "texture")]; + } forEach (" isClass _x" configClasses ( configFile "CfgRanks")); + _CT_LISTNBOX lnbSetCurSelRow 0; + _current = lnbCurSelRow _CT_LISTNBOX; + _color = _CT_LISTNBOX lnbColor [_current,0]; + _CT_LISTNBOX lnbSetColor [ [_current,1], [(_color select 0)/2,0,0,1] ]; + _CT_LISTNBOX lnbDeleteColumn 0; + _CT_LISTNBOX lnbDeleteRow 1; + sleep 1; + lnbClear _CT_LISTNBOX;//Clear all items but control still remains just invisible. + }; + $/Code$ + A combined use of both invisible and visible data processing commands alive the Control. - Nothing + Nothing - Nothing + - removeItems + name - Removes all items with given template from the inventory. + When argument is Object, the command returns the name given to a unit using the setIdentity instruction or selected randomly by the game engine if setIdentity has not been used on the unit. If used on vehicle, name of first crew member (in order commander, driver, gunner). If used on an object, "Error: No unit" is being returned. + When argument is Location, the location's name is returned. To return the textual value of a location use text command instead. + NOTE: In Arma 3 setName can be used on a person to set name. However in multiplayer name always returns profileName. - https://community.bistudio.com/wiki/removeItems + https://community.bistudio.com/wiki/name - Object removeItems String + name Object + + name Location - unit removeItems item + name object + + name location - $Code$player removeItems "FirstAidKit";$/Code$ + $Code$_name = name player ;$/Code$ + + $Code$_locationName = name myLocation;$/Code$ + + $Code$name nearestLocation [ position player, "Hill"]; //"" + text nearestLocation [ position player, "Hill"]; //"Lesnoy Khrebet"$/Code$ undefined / undefined + Location variant appears to be only for the 3d editor. + + (August 4, 2006) + Notes from before the conversion: + Name will return an error for units that have been dead for more than a few seconds. + + (December 15, 2006) + To return the name of the unit that was given in the editor's "name" field, call up the unit's object in a format statement: + hint format["Unit's name: %1",_unitobject] + + (April 14, 2009) + Will return + Error: No vehicle + for JIP players in init.sqf, if no sleep were performed - Nothing + String - String + - removeItem + set3DENGrid - Removes item from the inventory. + Sets the grid increment for the given transformation type. + Transformation types: + Rotation - "r" + Translation - "t" + Scale - "s" - https://community.bistudio.com/wiki/removeItem + https://community.bistudio.com/wiki/set3DENGrid - Object removeItem String + set3DENGrid Array - unit removeItem item + set3DENGrid [type,value] - $Code$bluforUnit unassignItem "NVGoggles"; - bluforUnit removeItem "NVGoggles"; - opforUnit unassignItem "NVGoggles_OPFOR"; - opforUnit removeItem "NVGoggles_OPFOR"; - independentUnit unassignItem "NVGoggles_INDEP"; - independentUnit removeItem "NVGoggles_INDEP";$/Code$ + $Code$set3DENGrid ["t",100];// 100m movement increment$/Code$ - global / global + undefined / undefined - Nothing + Nothing + - removeMPEventHandler + setSpeech - Removes MP event handler added by addMPEventHandler. Format of handler is [type,index]. Index is returned by addMPEventHandler. When any handler is removed, all handler indices highter than the deleted one should decremented + Add speech to location. - https://community.bistudio.com/wiki/removeMPEventHandler + https://community.bistudio.com/wiki/setSpeech - Object removeMPEventHandler Array + Location setSpeech String - unitName removeMPEventHandler [event, index] + location setSpeech speech - $Code$player removeMPEventHandler ["killed", 0];$/Code$ - + - global / global + undefined / undefined - (25 July, 2011) - At least for MPKilled it needs to be executed where the target unit is local. The effect (the removal) is global. - Nothing + Nothing + - removeMagazineGlobal + cameraEffect - Removes the magazine from the unit. + Sets the given effect on the given camera. If you want to switch the screen directly to the first-person, aiming, third-person or group view of an object, use switchCamera instead. The effect type "Terminate" is used to exit the current camera view and switch back to the player's view. Does not need camCommit. + Since Arma 3 v1.73.142217, it is possible to terminate individual r2t source. For example: $Code$cam cameraEffect ["terminate", "back", "rtt1"]; // would terminate "rtt1" r2t source + cam cameraEffect ["terminate", "back"]; // would terminate all r2t sources$/Code$ - https://community.bistudio.com/wiki/removeMagazineGlobal + https://community.bistudio.com/wiki/cameraEffect - Object removeMagazineGlobal String + Object cameraEffect Array - unit removeMagazineGlobal magazineName + camera cameraEffect [effectName, effectPosition, r2tName] - $Code$player removeMagazineGlobal "30Rnd_65x39_caseless_mag";$/Code$ + $Code$_cam cameraEffect ["internal", "BACK"];$/Code$ + + $Code$_cam cameraEffect ["internal", "back", "rendersurface"];$/Code$ + + $Code$cam = "seagull" camCreate ( player modelToWorld [0,0,100]); + cam cameraEffect ["FIXED", "LEFT TOP"]; + cam camCommand "MANUAL ON";$/Code$ - global / global + local / local + (October 30, 2016) + Types of camera for CfgCameraEffects config: + CamExternal (CamInterpolated) type = 0; // linked directly with object + CamStatic type = 1; // fixed point in space + CamStaticWithZoom type = 2; // fixed point in space + CamChained type = 3; // chained + CamTerminate type = 4; // terminate + CamInternal type = 5; // internal view - Nothing + Nothing + - removeMagazineTurret + weaponsTurret - Removes the magazine from the turret. Use turret path [-1] for driver's turret. - Note: you may create invalid combinations by using this function. When doing so, application behaviour is undefined. + Returns all weapons of given turret. Use turret path [-1] for driver's turret. - https://community.bistudio.com/wiki/removeMagazineTurret + https://community.bistudio.com/wiki/weaponsTurret - Object removeMagazineTurret Array + Object weaponsTurret Array - vehicle removeMagazineTurret [magazineName, turretPath] + vehicle weaponsTurret turretPath - $Code$vehicle player removeMagazineTurret ["60rnd_cmflaremagazine",[-1]]$/Code$ + $Code$_weapons = vehicle player weaponsTurret [0,0]$/Code$ - $Code$_tank removeMagazineTurret ["20Rnd_120mmSABOT_M1A2",[0]]$/Code$ + $Code$_weapons = _tank weaponsTurret [0]$/Code$ + + $Code$_driverWeapon = _ka50pilot weaponsTurret [-1]$/Code$ + + $Code$_weaponsForAnyTurrentPosition = (vehicle player) weaponsTurret ((assignedVehicleRole player) select 1)$/Code$ - local / global + global / undefined + (11 March 2011) + Use assignedVehicleRole in combination to easily determine the weapons for any vehicle position. You need to check for -1 if the unit is in the driver/pilot position. See example 3 and 4. + + (11 March 2011) + funcGetTurretsWeapons = { + private ["_result", "_getAnyMagazines", "_findRecurse", "_class"]; + _result = []; + _getAnyMagazines = { + private ["_weapon", "_mags"]; + _weapon = configFile "CfgWeapons" _this; + _mags = []; + { + _mags = _mags + getArray ( + (if (_x == "this") then { _weapon } else { _weapon _x }) "magazines" + ) + } foreach getArray (_weapon "muzzles"); + _mags + }; + _findRecurse = { + private ["_root", "_class", "_path", "_currentPath"]; + _root = (_this select 0); + _path = +(_this select 1); + for "_i" from 0 to count _root -1 do { + _class = _root select _i; + if (isClass _class) then { + _currentPath = _path + [_i]; + { + _result set [count _result, [_x, _x call _getAnyMagazines, _currentPath, str _class]]; + } foreach getArray (_class "weapons"); + _class = _class "turrets"; + if (isClass _class) then { + [_class, _currentPath] call _findRecurse; + }; + }; + }; + }; + _class = ( + configFile "CfgVehicles" ( + switch (typeName _this) do { + case "STRING" : {_this}; + case "OBJECT" : {typeOf _this}; + default {nil} + } + ) "turrets" + ); + [_class, []] call _findRecurse; + _result; + }; + This call: + "M1A2_US_TUSK_MG_EP1" call funcGetTurretsWeapons + will return all turrets weapons, its magazines and its paths: + [ + ["M256", ["20Rnd_120mmSABOT_M1A2", "20Rnd_120mmHE_M1A2"], [0], "bin\config.bin/CfgVehicles/M1A2_US_TUSK_MG_EP1/Turrets/MainTurret"], + ["M240_veh", ["100Rnd_762x51_M240", "1200Rnd_762x51_M240"], [0], "bin\config.bin/CfgVehicles/M1A2_US_TUSK_MG_EP1/Turrets/MainTurret"], + ["M2BC", ["100Rnd_127x99_M2"], [0, 0], "bin\config.bin/CfgVehicles/M1A2_US_TUSK_MG_EP1/Turrets/MainTurret/Turrets/CommanderOptics"], + ["SmokeLauncher", ["SmokeLauncherMag"], [0, 0], "bin\config.bin/CfgVehicles/M1A2_US_TUSK_MG_EP1/Turrets/MainTurret/Turrets/CommanderOptics"], + ["M240_veh_2", ["100Rnd_762x51_M240", "1200Rnd_762x51_M240"], [0, 1], "bin\config.bin/CfgVehicles/M1A2_US_TUSK_MG_EP1/Turrets/MainTurret/Turrets/LoaderTurret"] + ] + denisko.redisko (denvdmj) - Nothing + Array + - removeMagazinesTurret + checkVisibility - Removes all magazines of the given type from given vehicle. Use turret path [-1] for driver's turret. + Checks if one position is visible from another position and how much. The results can be affected by getTerrainGrid value, especially if position is near the ground. Particle effects such as smoke can also affect the results. - https://community.bistudio.com/wiki/removeMagazinesTurret + https://community.bistudio.com/wiki/checkVisibility - Object removeMagazinesTurret Array + Array checkVisibility Array - vehicle removeMagazinesTurret [magazineName, turretPath] + [ignore, LOD, ignore2] checkVisibility [beg, end] - $Code$vehicle player removeMagazinesTurret ["60rnd_cmflaremagazine",[-1]]$/Code$ - - $Code$_tank removeMagazinesTurret ["20Rnd_120mmSABOT_M1A2",[0]]$/Code$ + $Code$_cansee = [ objNull, "VIEW"] checkVisibility [ eyePos player, eyePos unit1];$/Code$ - local / global + undefined / undefined - (July 30, 2011) - Here's how you would remove all machine gun ammo from an M1A2 TUSK: - remove the gunner's M240 ammo. - $Code$this removeMagazinesTurret ["1200Rnd_762x51_M240",[0]];$/Code$ - remove the commander's M2 ammo. - $Code$this removeMagazinesTurret ["100Rnd_127x99_M2",[0,0]];$/Code$ - remove the loader's M240 ammo. - $Code$this removeMagazinesTurret ["100Rnd_762x51_M240",[0,1]];$/Code$ + (August 8, 2016) + Particles that have blockAIVisibility set to 1 will influence the result, but will not make checkVisibility return 0. Instead an extremly small number will be returned. + Distance, fog, overcast, rain and nighttime have no effect on the result. - Nothing + Number + - removeMagazines + listObjects - Remove all magazines of given type from the unit. - Note: You may create invalid combinations with this function. When doing so, application behaviour is undefined. + Return the list of all objects of given type. + i + Some Old Editor Command - https://community.bistudio.com/wiki/removeMagazines + https://community.bistudio.com/wiki/listObjects - Object removeMagazines String + Control listObjects String - unitName removeMagazines magazineName + map listObjects type - $Code$player removeMagazines "M16";$/Code$ - + - local / undefined + undefined / undefined - Though BIS did not provide a command to remove all magazines of every type, it can still be accomplished using forEach magazines. example: - {player removeMagazine _x} forEach magazines player - Nothing + Array + - removeMagazine + simulCloudDensity - Remove magazine from the unit. - Note: You may create invalid combinations with this function. When doing so, application behaviour is undefined. + Returns density of clouds at given position. - https://community.bistudio.com/wiki/removeMagazine + https://community.bistudio.com/wiki/simulCloudDensity - Object removeMagazine String + simulCloudDensity Position - unitName removeMagazine magazineName + simulCloudDensity pos - $Code$player removeMagazine "M16"$/Code$ + $Code$simulCloudDensity (getPos player)$/Code$ - local / undefined + undefined / undefined - Nothing + Number + - removeMenuItem + distance - Removes a previously added menu item. - i - Some Old Editor Command + Returns a distance in meters between Objects, Positions or Locations. + NOTE: If positions are supplied as arguments, the coordinates are treated as PositionATL if over the land and as PositionASLW if over the sea. If 2D position is supplied, z is assumed 0. - https://community.bistudio.com/wiki/removeMenuItem + https://community.bistudio.com/wiki/distance - Control removeMenuItem Number + Object/Array distance Object/Array + + Location/Array distance Location/Array - map removeMenuItem index + param1 distance param2 + + location1 distance location2 - + $Code$_meters = player distance _object;$/Code$ + + $Code$_meters = player distance [1,2,3];$/Code$ + + $Code$_meters = [1,2,3] distance [4,5,6];$/Code$ + + $Code$_meters = position player distance nearestLocation [ position player, "hill"];$/Code$ + - undefined / undefined + global / undefined + (Feb 14, 2007) + distance to position3D (array) doesnt work with OFP, only objects + Armed Assault: + position3D (array) and object works + + (Mar 10, 2010) + This returns the map distance, not the vector distance, [0,0,0] distance [0,0,1] can be 1 or 1, not exactly 1; unlike the vector math. + + (Aug 03, 2012) + If a position in format [x, y, z] is provided for both arguments, distance also checks the z dimension as well. Ie: + player distance [0,0,200] + will return 200, if the player is at this position at ground/sea level. + + (March 22, 2014) + When objects are supplied as arguments, distance is calculated from their model center (object modelToWorld [0,0,0]), and not the position returned by getPos/ATL/ASL. + However, this is not relevant for units, as their model center matches their world position. - Nothing + Number - Number + - removeMissionEventHandler + findEmptyPositionReady - Removes mission event handler added by addMissionEventHandler. - When any handler is removed, all handler indices higher that the deleted one should be decremented. + Check if findEmptyPosition command can be called without waiting for files. - https://community.bistudio.com/wiki/removeMissionEventHandler + https://community.bistudio.com/wiki/findEmptyPositionReady - removeMissionEventHandler Array + Array findEmptyPositionReady Array - removeMissionEventHandler [type, index] + center findEmptyPositionReady [radius,maxDistance] - $Code$for "_i" from 0 to 4 do { - missionNamespace setVariable [ format ["handler%1",_i], addMissionEventHandler ["Loaded","hint ""_i"";"]]; - }; - removeMissionEventHandler ["Loaded",handler2]; //Remove the third index under type "Loaded"$/Code$ - + undefined / undefined - (August 6, 2015) - As of Arma 3 version 1.38 you can safely remove mission event handlers without worrying about decrementing higher indices. - Nothing + Boolean + - removeMusicEventHandler + setCenterOfMass - Removes specified music track event handler. + Changes the center of mass of an object smoothly during the given time (in seconds). A time of zero (or using the alternative syntax) means an immediate change. - https://community.bistudio.com/wiki/removeMusicEventHandler + https://community.bistudio.com/wiki/setCenterOfMass - removeMusicEventHandler Array + Object setCenterOfMass Array - removeMusicEventHandler [type, id] + myObject setCenterOfMass [com, time] + + myObject setCenterOfMass com - $Code$removeMusicEventHandler ["MusicStart", 12];$/Code$ - - $Code$removeMusicEventHandler ["MusicStop", 12];$/Code$ + $Code$myObject setCenterOfMass [[0,-1,0],0.5];$/Code$ - $Code$hnd_stop = addMusicEventHandler ["MusicStop",{}]; - removeMusicEventHandler ["MusicStop",hnd_stop];$/Code$ + $Code$myObject setCenterOfMass [0,-1,0];$/Code$ - undefined / undefined + local / global + (20 Jun, 2014) + (ArmA3 1.22) A quick reference: + category + setMass + setCenterOfMass + unit + The larger the mass is, the easier a unit will physically fatigued + N/A + aircraft + The larger the mass is, the more sensitive an aircraft will react to joystick, vice versa. + Aircraft slant due to center change accordingly, and the position of the camera view will be altered relatively at the same time. (3rd person view) + vehicle + The larger the mass is, the slower a vehicle drives (Ships will sink), vice versa. (Land vehicle performs like a bouncing ball while ships accelerated pretty speedy.) + Vehicle slant due to center change accordingly. - Nothing + Nothing + - removeOwnedMine + setFormation - Removes ownership over a remotely detonatable mine from the unit. + Set group formation. + Formation is one of: + "COLUMN" + "STAG COLUMN" + "WEDGE" + "ECH LEFT" + "ECH RIGHT" + "VEE" + "LINE" + "FILE" (ArmA) + "DIAMOND" (ArmA) - https://community.bistudio.com/wiki/removeOwnedMine + https://community.bistudio.com/wiki/setFormation - Object removeOwnedMine Object + Object/Group setFormation String - unit removeOwnedMine mine + group setFormation formation - $Code$player removeOwnedMine SuperMine;$/Code$ + $Code$_groupOne setFormation "LINE"$/Code$ - undefined / undefined + local / global - Nothing + Nothing + - removePrimaryWeaponItem + lnbSort - Removes given weapon item from the primary weapon cargo space. - As of Arma 3 DEV 1.37, this command also supports weapon magazines. + Sorts given multicolumn listbox by lnbText in given column in ascending or descending order. - https://community.bistudio.com/wiki/removePrimaryWeaponItem + https://community.bistudio.com/wiki/lnbSort - Object removePrimaryWeaponItem String + lnbSort Array + + control lnbSort Array - unit removePrimaryWeaponItem item + lnbSort [idc, column, reversed] + + control lnbSort [column, reversed] - $Code$player removePrimaryWeaponItem "acc_flashlight";$/Code$ + $Code$lnbSort [1800, 1, false ];$/Code$ + + $Code$_ctl lnbSort [1, true ]$/Code$ - local / global + undefined / undefined - Nothing + Nothing - Nothing + - removeSecondaryWeaponItem + setRepairCargo - Removes given weapon item from the secondary weapon cargo space. This command also supports weapon magazines. + Set amount of repair resources in cargo space of repair vehicle. + Amount 1 is full cargo. - https://community.bistudio.com/wiki/removeSecondaryWeaponItem + https://community.bistudio.com/wiki/setRepairCargo - Object removeSecondaryWeaponItem String + Object setRepairCargo Number - unit removeSecondaryWeaponItem item + vehicleName setRepairCargo amount - $Code$player removeSecondaryWeaponItem ( secondaryWeaponItems select 0);$/Code$ + $Code$_repairTruck1 setRepairCargo 0$/Code$ local / global + (July 10, 2015) + (ArmA 3 1.44) setRepairCargo will have no effect if the vehicle doesn't support getRepairCargo. - Nothing + Nothing + - removeSimpleTask + setMousePosition - Remove a simple task from the list of simple tasks. + Moves mouse pointer to specified position on the screen. x and y could be any number, but will be clipped so mouse never leaves the screen area. - https://community.bistudio.com/wiki/removeSimpleTask + https://community.bistudio.com/wiki/setMousePosition - Object removeSimpleTask Task + setMousePosition Array - person removeSimpleTask task + setMousePosition [x, y] - $Code$player removeSimpleTask _tskKillSpongebob$/Code$ + $Code$setMousePosition [0.5, 0.5];$/Code$ undefined / undefined @@ -51275,295 +52694,311 @@ - Nothing + Nothing + - removeSwitchableUnit + not - Remove a unit from the list of units available for Team Switch. + not a. + Exactly the same as ! a - https://community.bistudio.com/wiki/removeSwitchableUnit + https://community.bistudio.com/wiki/not - removeSwitchableUnit Object + not Boolean - removeSwitchableUnit unitName + not a - + $Code$not false + // Result is true.$/Code$ + undefined / undefined - Nothing + Boolean + - removeTeamMember + setArmoryPoints - Remove given member from given team. Effect is local, unless both member and team are local to PC on which command is executed, then effect is global. + Stores passed number into [USERNAME].ArmaXProfile file, where it assigns it as a value to armoryPoints entry. If entry doesn't exist, it is created. - https://community.bistudio.com/wiki/removeTeamMember + https://community.bistudio.com/wiki/setArmoryPoints - Team_Member removeTeamMember Team_Member + setArmoryPoints Number - team removeTeamMember member + setArmoryPoints points - $Code$_team removeTeamMember _teamMember;$/Code$ + $Code$setArmoryPoints ( armoryPoints + 20);$/Code$ + + $Code$setArmoryPoints 3.14;$/Code$ - local / local + undefined / undefined - Nothing + Nothing + - removeUniform + ctAddRow - Removes uniform from unit. + Adds one row of controls according to the RowTemplate class. It returns an array containing row index and array of created controls in a format [ rowIndex, [ control0, control1... control n ]]. + Note that rows and headers are indexed separately. - https://community.bistudio.com/wiki/removeUniform + https://community.bistudio.com/wiki/ctAddRow - removeUniform Object + ctAddRow Control - removeUniform unit + ctAddRow Control - $Code$removeUniform player ;$/Code$ + $Code$_array = ctAddRow _control;$/Code$ - global / global + local / local - Nothing + Array + - removeVest + isObjectRTD - Removes vest from unit. + Returns true if RTD model is loaded - https://community.bistudio.com/wiki/removeVest + https://community.bistudio.com/wiki/isObjectRTD - removeVest Object + isObjectRTD Object - removeVest unit + isObjectRTD helicopter - $Code$removeVest player ;$/Code$ + $Code$_heliRTD = isObjectRTD vehicle player ;$/Code$ - global / global + undefined / undefined - Nothing + Boolean + - removeWeaponAttachmentCargo + lightAttachObject - Remove attachment linked to a weapon from the vehicle cargo space. - This is unoffical documentation. All Information here is as it exists in the Engine. It might not reflect the reality. + Attach light to given object at given position on object. - https://community.bistudio.com/wiki/removeWeaponAttachmentCargo + https://community.bistudio.com/wiki/lightAttachObject - Object removeWeaponAttachmentCargo Array + Object lightAttachObject Array - vehicle removeWeaponAttachmentCargo [weaponID,creatorID,attachment] + light lightAttachObject [object, position] - $Code$rearmTruckOne removeWeaponAttachmentCargo[weaponID,creatorID,"attachment"]$/Code$ + $Code$myLight lightAttachObject [myVehicle, [-0.5,-0.25,1]];$/Code$ - undefined / undefined + global / local + (Dec 1, 2006) + Light can be created with command createVehicleLocal with special vehicle class "#lightpoint" + for example: + $Code$_light = "#lightpoint" createVehicleLocal pos; + _light setLightBrightness 1.0; + _light setLightAmbient [0.0, 1.0, 0.0]; + _light setLightColor [0.0, 1.0, 0.0]; + _light lightAttachObject [_object, [0,0,0]]; + $/Code$ + + (March 31, 2015) + When attached, movement is slow to update (jumpy). Use attachTo when attaching a light to moving objects. - Nothing + Nothing + - removeWeaponCargo + serverCommandExecutable - Remove weapon from the vehicle cargo space. - This is unoffical documentation. All Information here is as it exists in the Engine. It might not reflect the reality. + Returns true if the serverCommand can be performed on the machine and in this exact environment, otherwise false. serverCommand can be executed only from User Interface Event Handlers, and this command also checks if that's the case. - https://community.bistudio.com/wiki/removeWeaponCargo + https://community.bistudio.com/wiki/serverCommandExecutable - Object removeWeaponCargo Array + serverCommandExecutable String - vehicle removeWeaponCargo [weaponID,creatorID] + serverCommandExecutable command - $Code$rearmTruckOne removeWeaponCargo [19, 1]$/Code$ - - - undefined / undefined - - - - - Nothing - - - - - removeWeaponGlobal - - - Remove a weapon from a unit. An attempt to remove a weapon, which is not in unit's possession, is simply ignored. - - - https://community.bistudio.com/wiki/removeWeaponGlobal - - - Object removeWeaponGlobal String - - - unit removeWeaponGlobal weapon - - - $Code${ - _x removeWeaponGlobal "Laserdesignator"; - } forEach allUnits ;$/Code$ + $Code$_canKick = serverCommandAvailable "#kick";$/Code$ - $Code${ - if ( typeOf _x == "O_Heli_Attack_02_black_F") then { - _x removeWeaponGlobal "rockets_Skyfire"; + $Code$// Add button to the main map to lock server, which could only be activated by admin: + with uiNamespace do { + ctrl = findDisplay 12 ctrlCreate ["RscButton", -1]; + ctrl ctrlSetPosition [0,0,0.5,0.1]; + ctrl ctrlCommit 0; + ctrl ctrlSetText "LOCK SERVER"; + ctrl ctrlAddEventHandler ["ButtonDown", + { + if ( serverCommandExecutable "#lock") then { + serverCommand "#lock"; + } else { + hint "You need to be logged in as admin to do this"; }; - } forEach vehicles ;$/Code$ + }]; + };$/Code$ - global / global + undefined / undefined - Nothing + Boolean + - removeWeaponTurret + animationPhase - Removes weapon from the turret. Use turret path [-1] for driver's turret. + Returns the phase of the given animation on the given object. Animation can be scripted ( animate, animateSource, animateDoor ) or engine driven. Animation names for an object could be found out with animationNames command. When animation is rotation, like with "MainTurret" for example, the output is in radians, to convert to degrees use deg command. - https://community.bistudio.com/wiki/removeWeaponTurret + https://community.bistudio.com/wiki/animationPhase - Object removeWeaponTurret Array + Object animationPhase String - vehicle removeWeaponTurret [weaponName, turretPath] + object animationPhase animationName - $Code$_tank removeWeaponTurret ["LMG_M200",[0,0]];$/Code$ + $Code$_building animate ["maindoor",1]; + sleep 1; + _p = _building animationPhase "maindoor"; + // returns 1 (if the animation speed is = 2 seconds)$/Code$ - $Code$vehicle player removeWeaponTurret ["SportCarHorn",[-1]];$/Code$ + $Code$_flagPole animationPhase "flag";$/Code$ + + $Code$_tank animationPhase "MainTurret";$/Code$ - local / global + global / undefined - Nothing + Number + - removeWeapon + isClass - Remove weapon from a unit. The unit must be local to the computer where command is executed. For a global version of this command see removeWeaponGlobal. - Note : It is possible to create invalid combinations with this command (ie, attempting to remove a weapon that a unit does not possess). When doing so, application behaviour is undefined. + Check if config entry represents config class. - https://community.bistudio.com/wiki/removeWeapon + https://community.bistudio.com/wiki/isClass - Object removeWeapon String + isClass Config - unit removeWeapon weapon + isClass config - $Code$player removeWeapon "BAF_L85A2_RIS_SUSAT";$/Code$ - - $Code$An_2 removeWeapon "M240_veh";$/Code$ + $Code$_ok = isClass ( configFile "CfgVehicles"); + // Result is true.$/Code$ - local / global + undefined / undefined - (May 27, 2009) - CTD may occur in certain conditions: when shooter is AI and is currently shooting at target in some proximity (tested with M136 on ACE 1.08 and Compact Fix 1.14H+). Even "dropweapon" action may cause CTD with AI. + (March 2, 2007) + This command allows you to check for the presence of an addon. + isClass (configFile "cfgVehicles" "MyCustomCar") + will return true if the addon "MyCustomCar" is installed, and false if it is not installed. + You will have to know under which class the addon is categorized (in this case "cfgVehicles") to be able to use the right config path. + + (Mar 31, 2014) + (ArmA3 ver 1.14) According to BI Dev Karel Mořický, BIS_fnc_getCfgIsClass provides a comfortable workaround with custom config under description.ext compared with isClass. (But as a function created specifically for A3 campaign, it is in no way intended as a replacement for isClass. So it is not suggested to use it for configFile classes. But isClass instead.) + E.g. + $Code$["Something1","Something2","Something3"] call bis_fnc_getCfgIsClass //Same as isClass (missionconfigfile "Something1" "Something2" "Something3")$/Code$ - Nothing + Boolean + - reportRemoteTarget + ctrlSetActiveColor - Shares the target vehicle via datalink to the Side center for a given time. + Sets text color of given control when control is selected. - https://community.bistudio.com/wiki/reportRemoteTarget + https://community.bistudio.com/wiki/ctrlSetActiveColor - Side reportRemoteTarget Array + Control ctrlSetActiveColor Array - side reportRemoteTarget [target, time] + display ctrlSetActiveColor color - $Code$blufor reportRemoteTarget [ vehicle player, 60];$/Code$ + $Code$_control ctrlSetActiveColor [1, 0, 0, 1]$/Code$ undefined / undefined @@ -51571,86 +53006,158 @@ - Nothing + Nothing + - requiredVersion + allTurrets - Check if version of application is available. If the current version is older than the required one, a warning message is shown and false is returned. - Version of format Major.Minor, e.g. 1.30 + Returns array of available turret paths from vehicle object. To look up turrets from config, use BIS_fnc_allTurrets - https://community.bistudio.com/wiki/requiredVersion + https://community.bistudio.com/wiki/allTurrets - requiredVersion String + allTurrets Object + + allTurrets Array - requiredVersion version + allTurrets vehicle + + allTurrets [vehicle, personTurrets] - $Code$if !( requiredVersion "1.09") exitWith {};$/Code$ + $Code$_turretPaths = allTurrets SlammerUP; //[[0],[0,0]] + _turretPaths = allTurrets [SlammerUP, true ]; //[[0],[0,0]] - Commander turret is also FFV turret + _turretPaths = allTurrets [SlammerUP, false ]; //[[0]]$/Code$ + + $Code$// Return FFV turrets only: + _FFVTurrets = allTurrets [tank, true ] - allTurrets [tank, false ];$/Code$ undefined / undefined - (March 12, 2008) - If the script contains a command that was introduced after the required version, it will still generate a syntax error, even if this test is done at the top of the script (as the whole script is parsed before execution). + (April 13, 2016) + The first syntax (vehicle only without boolean) will include commander turrets like in the example, and does not include actual FFV turrets like offroad back seats, as expected. + Also, the driver turret [-1] is never included in the results, which can be solved as follows: + $Code$_paths = [[-1]] + allTurrets _vehicle;$/Code$ - Boolean + Array - Array + - resetCamShake + inGameUISetEventHandler - Stops any ongoing camera shake effects. Does not prevent new effects from being created. To disallow new effects altogether, enableCamShake should be used. + Sets given event handler of in-game UI. If EH function returns true, performed action is overridden. Event handlers available are: + "PrevAction" - mouse scroll up + "Action" - action key press + "NextAction" - mouse scroll down + This is "set" type EH, which means it will replace previously set EH of the same type. So to remove EH, set another one with empty string "" for the function. + Since Arma 3 v1.49.131743 this EH returns array of params for selected/activated action in _this variable: + 0: Object - target object to which action is attached + 1: Object - caller object, basically player + 2: Number - index of the action in action menu (0 - top most) + 3: String - engine based action name ("User" for user added actions) + 4: String - localized action plain text as seen by the caller + 5: Number - action priority value + 6: Boolean - action showWindow value + 7: Boolean - action hideOnUse value + 8: String - action shortcut name or "" + 9: Boolean - action menu visibility (on first scroll or action press the menu is still invisible, so no action is performed, only menu is shown) + 10: String - EH event name - https://community.bistudio.com/wiki/resetCamShake + https://community.bistudio.com/wiki/inGameUISetEventHandler - resetCamShake + inGameUISetEventHandler Array - resetCamShake + inGameUISetEventHandler [handlerName, function] - $Code$resetCamShake ;$/Code$ + $Code$inGameUISetEventHandler ["Action","hint 'Lights, Camera, Action!'; true "];$/Code$ + + $Code$inGameUISetEventHandler ["PrevAction", " hint str _this; false "]; + inGameUISetEventHandler ["NextAction", " hint str _this; false "]; + inGameUISetEventHandler ["Action", " hint str _this; false "];$/Code$ + + $Code$// Deny any weapon disassembly: + inGameUISetEventHandler ["Action", " + if (_this select 3 == 'DisAssemble') then { + hint 'You are not allowed to do this'; + true + } + "];$/Code$ + + $Code$// Detect explosive/mine placement: + onMagazineUse = ' + params ["_target", "", "", "_action", "", "", "", "", "", "", "_event"]; + if (_action == "UseMagazine") then { + if (_event == "Action") then { + 0 = _target spawn { + waitUntil {!(all_magazines isEqualTo magazines _this)}; + { + 0 = all_magazines deleteAt (all_magazines find _x); + } count magazines _this; + hint format ["Magazine Used: %1", all_magazines select 0]; + } + } else { + all_magazines = magazines _target; + }; + }; + false + '; + inGameUISetEventHandler ["PrevAction", onMagazineUse]; + inGameUISetEventHandler ["NextAction", onMagazineUse]; + inGameUISetEventHandler ["Action", onMagazineUse];$/Code$ - undefined / undefined + undefined / local + (May 12, 2016) + In case of the "Action" event, (param 6 || param 9) also denotes if the action is performed or not. For example, if the action menu is closed or fading off, pressing Spacebar will bring it up and trigger an "Action" event; in that case, param 9 (action menu visibility) is false. But if the action menu is open, and Spacebar is pressed to perform the selected action, then param 9 will be true. If param 6 (showWindow) is true, then it means the action was performed, regardless of param 9. + + (February 08, 2017) + This powerful command can override the actions (previous/next/action), depending on true/false return. But, the command overrides itself, no matter of the returned value. That means, if two mods or scripts are using the same command parameter, say 'action', the last inGameUISetEventHandler 'action' will override the first one. Example: trigger1 : + $Code$inGameUISetEventHandler ["Action","hint 'action for mod 1';true "];// true or false doesn't matter here$/Code$ + trigger2 (delayed): + $Code$inGameUISetEventHandler ["Action","false "];// true or false doesn't matter here$/Code$ + trigger2 will run after trigger1, then, you'll never see the hint, what ever the trigger2 action code could be. What ever could be the last code, it will override all previous ones. You have to group these codes in a same event handler. But, beyond this, inGameUISetEventHandler is not stackable and implies a competition between scripts (or mods) using it. - Nothing + Nothing + - resetSubgroupDirection + fogForecast - Resets direction of subgroup. + Returns the forecast fog value. A value of 0 means no fog, 1 means maximum fog. - https://community.bistudio.com/wiki/resetSubgroupDirection + https://community.bistudio.com/wiki/fogForecast - resetSubgroupDirection Object + fogForecast - resetSubgroupDirection unit + fogForecast - $Code$resetSubgroupDirection myUnit;$/Code$ + $Code$_level = fogForecast ;$/Code$ undefined / undefined @@ -51658,465 +53165,530 @@ - Nothing + Number + - resistance + headgear - Resistance side. - When used in a format statement ( hint format ["%1",resistance] ), the string returned is "GUER". + Returns headgear of unit. - https://community.bistudio.com/wiki/resistance + https://community.bistudio.com/wiki/headgear - resistance + headgear Object - resistance + headgear unit - $Code$// SQS: - ?((side _unit) == resistance ) : hint "This is a resistance unit!"$/Code$ - - $Code$// SQF: - if (( side _unit) == resistance ) then { - hint "This is a resistance unit!"; - };$/Code$ + $Code$hint headgear player ; //H_HelmetB$/Code$ - undefined / undefined + global / undefined - Side + String + - resize + getMarkerSize - Changes the size of the given array. The command does not return new array, it resizes the source array to the desired number of elements. If the new size is bigger than the current size, the new places are filled with nils. + Returns the size of the given marker. A getter for setMarkerSize and an alias of markerSize. - https://community.bistudio.com/wiki/resize + https://community.bistudio.com/wiki/getMarkerSize - Array resize Number + getMarkerSize String - array resize count + getMarkerSize markerName - $Code$_arrayNum = [0,1,2,3,4]; - _arrayNum resize 2; // _arrayNum is now [0,1]$/Code$ + $Code$"MarkerOne" setMarkerSize [100,200]; + _size = getMarkerSize "MarkerOne"; //returns [100,200]$/Code$ - undefined / undefined + global / undefined - (November 13, 2014) - Use this number to resize the array to the number of elements desired, not the desired index of the final element. - resize cannot be used to create a new array. - Nothing + Array + - resources + radioChannelCreate - Returns the resources of a team member. Results are local to the PC on which command was executed. + Create a custom radio channel with the given color, label, call sign and registered characters. The index returned can be used to manipulate the created channel later. There are 10 slots for custom radio channels which would correspond to channels 6-15 (see getPlayerChannel ). The command will find an unused index in this range and create it when found. Server only. - https://community.bistudio.com/wiki/resources + https://community.bistudio.com/wiki/radioChannelCreate - resources Team_Member + radioChannelCreate Array - resources member + radioChannelCreate [color, label, callSign, units, sentenceType] - + $Code$_index = radioChannelCreate [[0.96, 0.34, 0.13, 0.8], "Q-dance Radio", "%UNIT_NAME", [player1, player2]];$/Code$ + + $Code$_index = radioChannelCreate [[0.96, 0.34, 0.13, 0.8], "Q-dance Radio", "%UNIT_NAME", [player1, player2], false ]; + // disable automatic quotes for chat in channel (ArmA 3)$/Code$ + + $Code$// Create custom channel and add all players to it, present and JIP: + if ( isServer ) then + { + private _channelName = "Q-dance Radio"; + private _channelID = radioChannelCreate [[0.96, 0.34, 0.13, 0.8], _channelName, "%UNIT_NAME", []]; + if (_channelID == 0) exitWith { diag_log format ["Custom channel '%1' creation failed!", _channelName]}; + [_channelID, {_this radioChannelAdd [ player ]}] remoteExec ["call", [0, -2] select isDedicated, _channelName]; + };$/Code$ + - global / local + global / global + This scripting command must be executed on the server to work properly in multiplayer + + (January 21, 2016) + Make sure you add all units you intend to speak or receive messages on created custom channel to the channel. + + (October 12, 2017) + WARNING : Be aware that created channels order and count are different between server and client. Example 3 shown that server-side channel ID is actually 4, while client currentChannel on the same channel results in 9. + Behaviour is yet unknown for me. - Array + Number + - respawnVehicle + isAbleToBreathe - Sets vehicle as respawnable in MP game. The vehicle will be spawned at the locality and coordinates it was prior to destruction. If respawn type is set to base respawn (type 3) and vehicle respawn marker is provided (respawn_vehicle_XXXSIDEXXX), vehicle will spawn on the marker. - NOTE : Command has to be executed where vehicle is local + If unit is diving and doesn't have a re-breather, it returns false. Diving means the unit's head is underwater. If unit is underwater and has a re-breather, the command returns true. - https://community.bistudio.com/wiki/respawnVehicle + https://community.bistudio.com/wiki/isAbleToBreathe - Object respawnVehicle Array + isAbleToBreathe Object - vehicle respawnVehicle [delay, count] + isAbleToBreathe unit - $Code$car respawnVehicle [5, 3]; - // 'car' will respawn at the predefined marker for the side after 5 seconds. The unit will respawn 3 times.$/Code$ - - $Code$car respawnVehicle [30]; - // 'car' will respawn at the predefined marker for the side after 30 seconds. The unit will respawn an unlimited number of times.$/Code$ - + - local / global + undefined / undefined - (May 28, 2007) - For this command to work (in MP) you need the appropriate markers in the mission. - The markers are... - respawn_vehicle_west - respawn_vehicle_east - respawn_vehicle_guerilla - respawn_vehicle_civilian - Also, by default it will use respawnDelay from the description.ext as mentioned unless you specify - respawnVehicleDelay = x; - Where x is delay in seconds. - In Multiplayer the respawned vehicle remains local to the client who was the last driver of the vehicle or the client who was the leader of the last AI driver of the vehicle. - If the vehicle has yet to be driven or the AI driver is local to the Server then the respawned vehicle will be local to the Server. - Nothing + Boolean + - restartEditorCamera + tvSetPictureRightColor - Restarts the mission editor camera (if it was deleted by a script,for example). - i - Some Old Editor Command + Sets color of the right picture on the tree view item defined by path - https://community.bistudio.com/wiki/restartEditorCamera + https://community.bistudio.com/wiki/tvSetPictureRightColor - restartEditorCamera Control + tvSetPictureRightColor Array + + Control tvSetPictureRightColor Array - restartEditorCamera map + tvSetPictureRightColor [idc, path, color] + + control tvSetPictureRightColor [path, color] - + $Code$tvSetPictureRightColor [101, [0], [1,0,1,1]];$/Code$ + + $Code$_ctrl tvSetPictureRightColor [[0], [1,0,1,1]];$/Code$ + undefined / undefined - Nothing + Nothing - Nothing + - revealMine + remoteExecCall - Sets given mine as known to the side. (Knowledge about a mine is always shared across all units in a side.) + Asks server to execute given scripted function or script command on given target PC. The environment chosen for the execution is as follows: + Scripted function - unscheduled environment ( suspension is NOT allowed). + Script command - unscheduled environment ( suspension is NOT allowed). + remoteExecCall can also be used in SP (the same restrictions apply both to SP and MP). For more information about the usage, security features and advanced jip techniques check the remote execution dedicated section. + While it is true that this function executes the desired scripted command/function by calling it, it does not mean remoteExecCall itself will be executed right away. Therefore, calling remoteExecCall is by no means a replacement for calling scripted commands/functions directly. + Example: + remoteExecCall ["func1"]; call func2; // func2 can be executed sooner than func1 + call func1; call func2; // func2 will always execute after func1. - https://community.bistudio.com/wiki/revealMine + https://community.bistudio.com/wiki/remoteExecCall - Side revealMine Object + Anything remoteExecCall Array + + remoteExecCall Array - side revealMine mine + params remoteExecCall [functionName, targets, JIP] + + remoteExecCall [functionName, targets, JIP] - $Code$west revealMine _mine;$/Code$ + $Code$// runs hint "hello" on each connected client + "hello" remoteExecCall [" hint "];$/Code$ + + $Code$// runs hint "hello" on first connected client + "hello" remoteExecCall [" hint ", 3];$/Code$ + + $Code$// runs hint "hello" everywhere but server + "hello" remoteExecCall [" hint ", -2];$/Code$ + + $Code$// runs hint "hello" everywhere but server, JIPs the message + // and returns e.g. "3_1" as a unique JIP id + myJipID = "hello" remoteExecCall [" hint ", -2, true ];$/Code$ + + $Code$// runs hint "hello" everywhere but server, JIPs the message under ID "some_JIP_ID" + // replacing any previous message with this ID in the JIP queue. + "hello" remoteExecCall [" hint ", -2, "some_JIP_ID"];$/Code$ + + $Code$// runs "someFuncWithNoArgs" on each connected client + remoteExecCall ["someFuncWithNoArgs"];$/Code$ + + $Code$// removes a message identified by "IamUnique" from the JIP queue + remoteExecCall ["", "IamUnique"];$/Code$ + + $Code$// all clients will have their ammo set to 1 for their current weapon + { player setAmmo [ primaryWeapon player, 1];} remoteExecCall [" bis_fnc_call ", 0];$/Code$ + + $Code$// Object obj will have its ammo set to 1 where it is local + [obj,[ primaryWeapon obj, 1]] remoteExecCall [" setAmmo ", obj];$/Code$ + + $Code$myJipID = "hello" remoteExecCall ["", 0]; + if ( isNil "myJipID") then { hint "empty function name is not allowed"; };$/Code$ undefined / undefined + (July 16, 2015) + Removal of persistent call must be in the following format no argument remoteExecCall [ empty string, JIP id ]. For example: + $Code$ remoteExecCall ["", "5:8"];$/Code$ + + (December 29, 2015) + remoteExec and remoteExecCall are currently filtered by BattlEye's remoteexec.txt, the string analyzed by BE is formatted the same way as the following example's output: + $Code$ format ["%1 %2", functionName, str params]$/Code$ + If CfgRemoteExec class Functions is set to mode = 1;, the following remoteexec.txt exclusion can be used to safely allow all whitelisted *_fnc_* functions taking an array as parameter to go through: + $Code$!="\w+?_fnc_\w+? \[.*\]"$/Code$ + Any attempt to exploit this exclusion using other RE methods like createUnit will run into "Error Missing ;" without any malicious code being executed. Mod makers should refrain from remote-executing raw commands from clients, as they require individual exclusions, and instead use *_fnc_* functions taking an array as parameter, which are covered by the above exclusion. + + (May 10, 2017) + To remoteExecCall : + $Code$ titleText ["Test Message", "PLAIN", 1];$/Code$ + Use + $Code$[["Test Message", "PLAIN", 1]] remoteExecCall ["titleText"];$/Code$ - Nothing + Anything - Anything + - reveal + setSimulWeatherLayers - Reveals a target to a group. If toWhom is a unit, unit's group is considered. If toWhom is a vehicle, vehicle commander's group is considered. - The knowledge value will be set to the highest level any unit of the revealing side has about the revealed target. If the revealing side has no knowledge about the revealed target, the value will be set to 1. - Since ARMA 2 OA 1.60 the alternative syntax is available. Values greater than or equal 1.5 reveal the side of the target, too. - The knowledge level can only be increased, not decreased by this command. - In MP targetKnowledge and knowsAbout infos get updated only on the PC where command was executed. + Sets number of simul weather layers, affects quality of simul weather clouds. - https://community.bistudio.com/wiki/reveal + https://community.bistudio.com/wiki/setSimulWeatherLayers - Object/Group reveal Object - - Object/Group reveal Array + setSimulWeatherLayers Number - toWhom reveal target - - toWhom reveal [target, accuracy] + setSimulWeatherLayers layers - $Code$_soldierOne reveal _soldierTwo; //soldierOne knowsAbout information about soldierTwo is updated$/Code$ - - $Code$player reveal cursorObject ; //player knowsAbout information about object under cursor is updated$/Code$ - - $Code$_soldierOne reveal [_soldierTwo, 1.5];$/Code$ - + - global / local + undefined / undefined - (January 15, 2007) - In OFP v1.96, When a target is revealed to a unit, it's knowsAbout rating is set to 1, unless it was already more than 1 in which case reveal does nothing. See knowsAbout for more details about knowsAbout ratings and limitations. - - (January 24, 2008) - Use reveal to allow client to see a created vehicle faster - the associated menu interaction will become available therefore, like the player has option to get in sooner. - _tank = "M1A1" createVehicle (position player); - player reveal _tank; - //get in user actions become available instantly - - (January 15, 2012) - The same idea from Doolittle's note applies to beaming of units. If you setPos an unit or a player, reveal (all) nearby objects and vehicles to make the interaction possible a lot quicker. - - (January 15, 2012) - Revealing a targetUnit will also add it to nearTargets database of the given sourceUnit. The quality/detail level of the info depends on the knowsAbout value used with reveal. More detail in the nearTargets page. - - (October 21, 2014) - Units that have been previously subjected to enableSimulation false; or enableSimulationGlobal false; may stay unrecognised for a long time even after simulation was re-enabled, returning objNull as cursorTarget. Force revealing units with reveal command usually solves the problem. For example: $Code${ player reveal _x} forEach allUnits ;$/Code$ - Nothing - Nothing + Nothing + - reverse + setUnitAbility - Reverses given array by reference (modifies the original array, just like resize ). + Sets skill of given unit. Unlike setSkill, setUnitAbility can set values 1. Even though the skill command will correctly return set value, the actual unit ability will be capped to max available. - https://community.bistudio.com/wiki/reverse + https://community.bistudio.com/wiki/setUnitAbility - reverse Array + Object setUnitAbility Number - reverse array + unit setUnitAbility value - $Code$_arr = [1,2,3]; - reverse _arr; - hint str _arr; //[3,2,1]$/Code$ + $Code$_unit setUnitAbility 1;$/Code$ - $Code$_wordArr = toArray "gateman"; - reverse _wordArr; - hint toString _wordArr; //nametag$/Code$ + $Code$bob setUnitAbility - log 0; + hint str skill bob; //1.#INF$/Code$ undefined / undefined + (October 8, 2014) + AFAIK not used in Arma 3 anymore (or equals to setSkill) - Nothing + Nothing + - reversedMouseY + enableCollisionWith - Return if mouse vertical axe is inverted. + Enable collision between vehicles. - https://community.bistudio.com/wiki/reversedMouseY + https://community.bistudio.com/wiki/enableCollisionWith - reversedMouseY + Object enableCollisionWith Object - reversedMouseY + vehicle enableCollisionWith vehicle - undefined / undefined + local / global + (April 5, 2015) + enableCollisionWith is a script that when you apply it to an object, it will be solid and the player will not be able to go through it. However, if you want your unit to go through it, you may want to use the disableCollisionWith command. An example for this is: + $Code$//name of unit in editor such as player1 + //name of object in editor such as car1 + car1 enableCollisionWith player1; + //to make your unit go through the car, use the below and make sure you know what your doing! + car1 disableCollisionWith player1; + $/Code$ + Both commands enableCollisionWith and disableCollisionWith, are very handy codes and could be used for example: map testing, mission editing and even animation cutscenes. - Boolean + Nothing + - roadAt + useAudioTimeForMoves - Returns road segment at given position, objNull otherwise. Same as isOnRoad only returns the actual road object instead of boolean. + Switch between elapsed game time and audio time being used as animation timer. Used for audio/animation synchronization. - https://community.bistudio.com/wiki/roadAt + https://community.bistudio.com/wiki/useAudioTimeForMoves - roadAt Object/Array + Object useAudioTimeForMoves Boolean - roadAt position + soldier useAudioTimeForMoves toggle - $Code$_road = roadAt ASLToAGL getPosASL player ;$/Code$ - - $Code$_isOnRoad = ! isNull roadAt player ;$/Code$ + $Code$player useAudioTimeForMoves true$/Code$ - global / undefined + undefined / undefined - (December 30, 2016) - This command does not nessecarly return the segment which center is the closest to the given position. - In order to get such segment use nearRoads. - $Code$_closest_road = (_pos nearRoads 0.1) select 0;$/Code$ - Object + Nothing + - roadsConnectedTo + commandSuppressiveFire - Find the road segments connected to the given road segment. + Order the given unit to suppress a given position or target (via the radio). - https://community.bistudio.com/wiki/roadsConnectedTo + https://community.bistudio.com/wiki/commandSuppressiveFire - roadsConnectedTo Object + Object/Array commandSuppressiveFire Object/Array - roadsConnectedTo roadSegment + unitName commandSuppressiveFire target - $Code$_road = ( player nearRoads 50) select 0; - _connectedRoads = roadsConnectedTo _road;$/Code$ + $Code$_soldier commandSuppressiveFire [1869.508,5760.962,0.000]$/Code$ + + $Code$_soldier commandSuppressiveFire cursorTarget$/Code$ - undefined / undefined + local / local + (October 8, 2016) + Command expects position as second argument in format ASL in A3 1.64.138497. - Array + Nothing + - roleDescription + waypointFormation - Returns unit description set in Editor and visible on role selection screen in MP. Works in MP and SP. + Gets the waypoint formation. + Possible values are: + "NO CHANGE" + "COLUMN" + "STAG COLUMN" + "WEDGE" + "ECH LEFT" + "ECH RIGHT" + "VEE" + "LINE" + "FILE" + "DIAMOND" - https://community.bistudio.com/wiki/roleDescription + https://community.bistudio.com/wiki/waypointFormation - roleDescription Object + waypointFormation Array - roleDescription unit + waypointFormation waypoint - $Code$_playerRole = roleDescription player ;$/Code$ + $Code$waypointFormation [groupOne,1]$/Code$ undefined / undefined - (June 29, 2015) - One thing you should know about roles. When switching to units placed in editor on the fly in MP, it could mess up the role of the player. Could be bug, could be intended, but I would not recommend doing this. Create new unit dynamically if you need to switch to. Anyway, if role of the unit is messed up so is roleDescription. - - (May 26, 2017) - roleDescription works for playableUnits only. That means not on AI disabled in lobby and not in SP (even for player). - String + String + - ropeAttachEnabled + toString - Returns true if vehicle can be attached to ropes + Converts the supplied Array of Numbers into a String. + The numbers in the array to be converted are the decimal Unicode representations of characters. - https://community.bistudio.com/wiki/ropeAttachEnabled + https://community.bistudio.com/wiki/toString - ropeAttachEnabled Object + toString Array - ropeAttachEnabled vehicle + toString array - $Code$ropeAttachEnabled veh1;$/Code$ + $Code$hint toString [65,97,338]; + // returns "AaŒ"$/Code$ + + $Code$["test","test"] joinString toString [12345] splitString toString [12345]; // ["test","test"]$/Code$ undefined / undefined + (February 10, 2015) + Tabs and new lines can be created with toString [9] and toString [10], respectively. Alternatively, a new line can also be created with toString [92,110] ("\n"). If you save these strings into a variable, they can be manipulated like any other string. For example, the following code will work just fine and return the expected output: + $Code$_tab = toString [9]; + for "_i" from 0 to 3 do + { + _tab = _tab + ( toString [9]); + }; + copyToClipboard format ["x%1x",tab];$/Code$ + + (August 25, 2015) + While you can convert any String to Array with toArray command, only numbers from 1 to 55295 (not 65535 as expected) can be successfully converted to String with toString and then back to Array with toArray without loss of data. - Boolean + String + - ropeAttachTo + formatText - Attach vehicle to rope with optional offset + Creates a structured text by replacing %1, %2, etc. in format with plain or structured texts given as arguments. - https://community.bistudio.com/wiki/ropeAttachTo + https://community.bistudio.com/wiki/formatText - Array ropeAttachTo Object + formatText Array - [veh, toPoint, ropeEndDownDir] ropeAttachTo rope + formatText [format, arg1, arg2,] - $Code$[veh1,[0,0,0],[0,0,-1]] ropeAttachTo ( ropes heli1 select 0);$/Code$ + $Code$_text = formatText ["Image: %1", image "data\isniper.paa"];$/Code$ undefined / undefined @@ -52124,27 +53696,28 @@ - Nothing + Structured_Text + - ropeAttachedObjects + teamName - Returns list of attached objects on ropes + Return a name of given team. - https://community.bistudio.com/wiki/ropeAttachedObjects + https://community.bistudio.com/wiki/teamName - ropeAttachedObjects Object + teamName Team_Member - ropeAttachedObjects vehicle + teamName team - $Code$_cargoArray = ropeAttachedObjects heli1;$/Code$ + $Code$_name = teamName _team;$/Code$ undefined / undefined @@ -52152,27 +53725,32 @@ - Array + String + - ropeAttachedTo + setWaypointScript - Returns the object it is attached to by rope + Attaches a script to a scripted waypoint. In early versions of Arma, command consisted of a script name and additional script arguments and the script had to use SQS -Syntax. The script receives the following arguments in _this variable: [group, position, target] + [the optional passed arguments]. The optional arguments are appended to the end of the return array. + In Arma 3, command argument can be a String with code, a reference to.sqf script (it will have to explicitly end with.sqf ) or a reference to.sqs script. + See Mission editor Description for more information about scripted waypoints. - https://community.bistudio.com/wiki/ropeAttachedTo + https://community.bistudio.com/wiki/setWaypointScript - ropeAttachedTo Object + Array setWaypointScript String - ropeAttachedTo vehicle + waypoint setWaypointScript command - $Code$_heli = ropeAttachedTo veh1;$/Code$ + $Code$[_grp, 2] setWaypointScript "find.sqs player ";$/Code$ + + $Code$[_grp, 2] setWaypointScript "somescript.sqf [1,2,3,4,5,6,7,8]";$/Code$ undefined / undefined @@ -52180,72 +53758,64 @@ - Object + Nothing + - ropeCreate + leader - Create a rope (PhysX rope in Arma 3). + Returns the group leader for the given unit or group. For dead units, objNull is returned. - https://community.bistudio.com/wiki/ropeCreate + https://community.bistudio.com/wiki/leader - ropeCreate Array + leader Object/Group - ropeCreate [fromObject, fromPoint, toObject, toPoint, segments, length] - - ropeCreate [fromObject, fromPoint, length, segments, unroll] + leader unitName - $Code$myRope = ropeCreate [ vehicle player, "slingload0", myCargo, [0, 0, 0], 10]; //A3 example$/Code$ + $Code$leader group player == leader player$/Code$ - $Code$myRope = ropeCreate [ vehicle player, "fastrope0", 10, 10, true ]; //TakeOn example$/Code$ + $Code$_GroupLeader = leader ( group ( vehicle player ))$/Code$ - $Code$myRope = ropeCreate [veh1, [0,0,-2], veh2, [0,0,0], 10] //A3 1.34$/Code$ + $Code$_UnitLeader = leader player$/Code$ - undefined / undefined + global / undefined - (November 8, 2014) - Doesn't work well for towing vehicles on the ground. - Their wheels don't turn freely and have a LOT of friction. You'll most likely end up flipping the vehicle over if you try to tow it. - Also note that ropes can be destroyed/cut by shooting at them. - - (January 4, 2015) - Pay special attention to what is your fromObject and what is your toObject as this will have an impact on the physics of the rope. - For example: If you want to tow an Assault CRRC from a heavier Speedboat Minigun, attach two boats together with a rope. If you drive the Speedboat Minigun and set the CRRC as the fromObject, the rope will have almost no elasticity and the CRRC will yank around as you tow it. However, if you set the CRRC as the toObject, the rope will have more elasticity and will be a little friendlier for the CRRC when you are towing it. - - (July 9, 2015) - Parameters segments and unroll are not supported in Arma 3. Segments are set automatically according the length of a rope. - Object + Object + - ropeCut + setConvoySeparation - Cut rope and detach rope from vehicle + Sets the distance to keep to the vehicle which is in front. + This command has to be applied to all vehicles in a convoy in order to have a separation of, for example, 50 m. + Vehicles in a convoy can also have different distances. + It's recommended that small values ( 10m) should only be used for slowly moving convoys, otherwise AI driven vehicles will leave the road frequently to avoid collisions - https://community.bistudio.com/wiki/ropeCut + https://community.bistudio.com/wiki/setConvoySeparation - ropeCut Array + Object setConvoySeparation Number - ropeCut [rope, distance] + vehicle setConvoySeparation distance - $Code$ropeCut [ ropes heli1 select 0, 5];$/Code$ + $Code$vehicle setConvoySeparation 20;$/Code$ undefined / undefined @@ -52253,274 +53823,380 @@ - Nothing + Nothing + - ropeDestroy + getCenterOfMass - Destroy a rope. + Returns center of mass of an object. - https://community.bistudio.com/wiki/ropeDestroy + https://community.bistudio.com/wiki/getCenterOfMass - ropeDestroy Object + getCenterOfMass Object - ropeDestroy rope + getCenterOfMass object - $Code$ropeDestroy myRope;$/Code$ + $Code$_com = getCenterOfMass _myCar;$/Code$ - undefined / undefined + global / undefined - Nothing + Array + - ropeDetach + handsHit - Detach a rope from an object. + Checks if a soldier's hands are hit, which results in inaccurate aiming. - https://community.bistudio.com/wiki/ropeDetach + https://community.bistudio.com/wiki/handsHit - Object ropeDetach Object + handsHit Object - vehicle ropeDetach rope + handsHit unitName - $Code$vehicle player ropeDetach myRope;$/Code$ + $Code$? (handsHit player == 1) : player globalChat "Ouch! Don't shoot at my hands dammit!"$/Code$ - undefined / undefined + global / undefined - Nothing + Number + - ropeEndPosition + deleteVehicleCrew - Return rope end positions in Position3D format + Deletes a member of the crew of a vehicle. Human players cannot be deleted. - https://community.bistudio.com/wiki/ropeEndPosition + https://community.bistudio.com/wiki/deleteVehicleCrew - ropeEndPosition Object + Object deleteVehicleCrew Object - ropeEndPosition rope + vehicle deleteVehicleCrew unit - $Code$_ends = ropeEndPosition ( ropes heli1 select 0); - _end1 = _ends select 0; - _end2 = _ends select 1;$/Code$ + $Code$heli deleteVehicleCrew driver heli;$/Code$ - undefined / undefined + global / global + (August 31, 2014) + Not quite sure of the exact use of this command. You can delete AI pilot for example with $Code$ deleteVehicle driver heli;$/Code$ but co-pilot will then jump out. If you use $Code$heli deleteVehicleCrew driver heli;$/Code$ co-pilot stays. + + (April 10, 2015) + Using the following code will remove ALL crew from the given vehicle. + $Code${_myvehicle deleteVehicleCrew _x} forEach crew _myvehicle;$/Code$ - Array + Nothing + - ropeLength + loadUniform - Return rope length in meters (set by ropeCreate, ropeCut, ropeUnwind ) + Returns current sum of mass from items stored in a uniform. - https://community.bistudio.com/wiki/ropeLength + https://community.bistudio.com/wiki/loadUniform - ropeLength Object + loadUniform Object - ropeLength rope + loadUniform unit - $Code$_length = ropeLength ( ropes heli1 select 0);$/Code$ - + undefined / undefined - (March 19, 2016) - When a rope gets stretched ropeLength will still return the same length as before. - Number + Number + - ropeUnwind + scriptDone - Unwind rope to target length. Use relative parameter for changing rope length +/- from current length + Check if a script is finished running using the Script_(Handle) returned by execVM or spawn. - https://community.bistudio.com/wiki/ropeUnwind + https://community.bistudio.com/wiki/scriptDone - ropeUnwind Array + scriptDone Script_Handle - ropeUnwind [rope, speed, targetLength, relative] + scriptDone handle - $Code$ropeUnwind [ ropes heli1 select 0, 3, 10];//set rope length to 10m at 3m/s$/Code$ + $Code$// SQS Syntax: + @ scriptDone _Handle$/Code$ - $Code$ropeUnwind [ ropes heli1 select 0, 3, -5, true];//decrease rope length by 5m at 3m/s$/Code$ + $Code$// SQF Syntax: + script_handler = [parameters] execVM "scriptname.sqf"; + waitUntil { scriptDone script_handler };$/Code$ undefined / undefined - (November 8, 2014) - Unwinding speed is not linear but instead automatically accelerates at the beginning and slows down at the end. - The speed also only seems to have no effect when pulling the rope in. (unless the end of the rope is not attached to anything) - High unwinding speeds (over ~250) can cause your cargo to get stuck in midair. - - (January 4, 2015) - Rope length limits are between 0.5 and 100 meters. + (03:54, 11 September 2009) + A Null Script handle can be created in this manner: + $Code$_handle = 0 spawn {};$/Code$ + That is what any Script_(Handle) becomes when a script is finished running, meaning it will test as true with: + $Code$ scriptDone _handle $/Code$ and it returns " NULL-script " when converted to string. This in turn lets you initialize the variable with a completed Script_(Handle) and lets you test the variable even though nothing else may have set the handle by creating a script with spawn or execVM. It also lets you store and manage script handles in arrays, and a few other sexy things. - Nothing + Boolean + - ropeUnwound + weaponsItems - False if unwinding in progress, otherwise true + Returns an array with subarrays contains class names and also names of connected items of all the vehicle's weapons. + Since Arma 3 v1.21.124406 it is possible to query weapon holders and ammo crates with this command. If weapon has no magazine, an empty array [] is returned instead of magazine info. - https://community.bistudio.com/wiki/ropeUnwound + https://community.bistudio.com/wiki/weaponsItems - ropeUnwound Object + weaponsItems Object - ropeUnwound rope + weaponsItems vehicle - $Code$_isUnwound = ropeUnwound ( ropes heli1 select 0);$/Code$ + $Code$hint str weaponsItems player ;[ + [//=PRIMARY= + "arifle_MX_ACO_pointer_F",//weapon + "muzzle_snds_H",//suppressor + "acc_pointer_IR",//laser + "optic_Aco",//optics + [//loaded magazine + "30Rnd_65x39_caseless_mag",//mag type + 30//mag ammo count + ], + "bipod_01_F_blk"//bipod + ], + [//=SECONDARY= + "launch_NLAW_F", + "", + "", + "", + [ + "NLAW_F", + 1 + ], + "" + ], + [//=HANDGUN= + "hgun_P07_F", + "muzzle_snds_L", + "", + "", + [ + "16Rnd_9x21_Mag", + 11 + ], + "" + ] + ]$/Code$ + + $Code$hint str weaponsItems vehicle player ;[ + [ + "gatling_30mm", + "", + "", + "", + [ + "250Rnd_30mm_HE_shells", + 250 + ], + "" + ], + [ + "missiles_SCALPEL", + "", + "", + "", + [ + "8Rnd_LG_scalpel", + 8 + ], + "" + ], + [ + "rockets_Skyfire", + "", + "", + "", + [ + "38Rnd_80mm_rockets", + 38 + ], + "" + ] + ]$/Code$ undefined / undefined + (August 17, 2013) + Be careful with this function. The weapons are listed in the order they were taken by the unit, with the most recent at the bottom of the array. Therefore, do not assume the first one is always the primary weapon, and so on. + Also, here's how the primary weapon looks if it has a grenade launcher with a loaded grenade: + $Code$[ + "arifle_MX_GL_F", + "muzzle_snds_H", + "acc_pointer_IR", + "optic_Aco", + [ + "30Rnd_65x39_caseless_mag", + 30 + ], + [ + "1Rnd_HE_Grenade_shell", + 1 + ], + "" + ]$/Code$ + + (October 25, 2014) + The output of this command is an array of arrays and is as follows: (If the unit only has 1 weapon, output is an array within an array.) + $Code$[ + [ + ((_arr select 0) select 0) //STRING - The weapon's classname + ((_arr select 0) select 1) //STRING - Classname of the unit's equipped 'Muzzle/Barrel Accessory' + ((_arr select 0) select 2) //STRING - Classname of the unit's equipped 'Side Accessory' + ((_arr select 0) select 3) //STRING - Classname of the unit's equipped 'Top/Optic Accessory' + ((_arr select 0) select 4) //ARRAY - Magazine information + [ + (((_arr select 0) select 4) select 0) //STRING - Classname of the loaded magazine + (((_arr select 0) select 4) select 1) //SCALAR(Number) - Amount of bullets in the mag + ] + ] //If unit has more than one weapon, the output will follow the same pattern as above except with a new element + ]$/Code$ - Boolean + Array + - ropes + titleObj - Returns a vehicle's rope objects in an Array. + Shows object defined in global config in CfgTitles - https://community.bistudio.com/wiki/ropes + https://community.bistudio.com/wiki/titleObj - ropes Object + titleObj Array - ropes vehicle + titleObj [class, type, speed, showInMap] - $Code$hint str ( ropes vehicle player );$/Code$ - - $Code$_rope1 = ( ropes heli1) select 0;$/Code$ + $Code$titleObj ["BISLogo", "PLAIN"]$/Code$ undefined / undefined - (05 April, 2014) - The ropes command seems to return each individual sling load rope. ropes will return an empty Array if the sling load ropes are not deployed. Ropes as of A3 1.33 have a cfgVehicles classname of "Rope". - Array + Nothing + - rotorsForcesRTD + magazinesDetailUniform - Returns force produced by rotors. + Returns an array with the type names of all the unit's uniform magazines. - https://community.bistudio.com/wiki/rotorsForcesRTD + https://community.bistudio.com/wiki/magazinesDetailUniform - rotorsForcesRTD Object + magazinesDetailUniform Object - rotorsForcesRTD RTD_helicopter + magazinesDetailUniform unit - $Code$_rotorForces = rotorsForcesRTD _taru// Returns [[-465.981,351.941,45960.5],[-469.079,397.451,46933.3]]$/Code$ + $Code$magazinesDetailUniform player$/Code$ undefined / undefined - (November 4, 2014) - There is no official information I can find on what these values mean. According to my testing on the Mi-290 Taru, here is what I have come up with: - $Code$[[ rotor 1 roll +right/-left, rotor 1 pitch +down/-up, rotor 1 collective +up/-down ], - [ rotor 2 roll +right/-left, rotor 2 pitch +down/-up, rotor 2 collective +up/-down ]]$/Code$ - When yawing left and right, rotor 1 and 2 collective differ from each other. This is normal behaviour with coaxial rotors. Yawing right increase rotor 1 collective and decreases rotor 2 collective. Yawing left does the opposite. Rotor 1 in this example seems to be the bottom rotor. - Array + Array + - rotorsRpmRTD + ctrlSetFontH2B - Returns rotors RPM + Sets H2 bold font of given HTML control. - https://community.bistudio.com/wiki/rotorsRpmRTD + https://community.bistudio.com/wiki/ctrlSetFontH2B - rotorsRpmRTD Object + Control ctrlSetFontH2B String - rotorsRpmRTD RTD_helicopter + controlName ctrlSetFontH2B fontName - $Code$_mh9_main = ( rotorsRpmRTD _MH9) select 0;//main rotor - _mh9_tail = ( rotorsRpmRTD _MH9) select 1;//tail rotor$/Code$ + $Code$_control ctrlSetFontH2B "TahomaB"$/Code$ undefined / undefined @@ -52528,144 +54204,149 @@ - Array + Nothing + - round + setPlayerRespawnTime - Rounds up or down to the closest integer. + Sets the time interval to wait on player respawn. It resets to mission default on mission start. In Single Player or when respawn type is GROUP or SIDE in Multiplayer, setting player respawn time has no effect and is always -1. - https://community.bistudio.com/wiki/round + https://community.bistudio.com/wiki/setPlayerRespawnTime - round Number + setPlayerRespawnTime Number - round x + setPlayerRespawnTime interval - $Code$_val= round 5.25, result is 5$/Code$ - - $Code$_val= round 5.55, result is 6$/Code$ + $Code$setPlayerRespawnTime 5;$/Code$ - undefined / undefined + undefined / local - Number + Nothing + - runInitScript + accTime - Launch init.sqs or init.sqf scripts. + Returns the current time acceleration factor - https://community.bistudio.com/wiki/runInitScript + https://community.bistudio.com/wiki/accTime - runInitScript + accTime - runInitScript + accTime - + $Code$_acc = accTime$/Code$ + undefined / undefined + (August 2, 2006) + Use setAccTime to change the time acceleration factor. Not to be confused with skipTime. - Nothing + Number + - safeZoneH + catch - Returns the height of the screen in screen measurement units. Taken from top left corner of the default viewport (0,0) of the screen and going in the same direction as the Y axis, the value will be positive but resulting Y will end up beyond the bottom border. Therefore in order to calculate Y of the bottom screen border, the length of safeZoneY must be subtracted from safeZoneH, but because it is negative, it must be added instead. _screenBottomBorderY = safeZoneH + safeZoneY. The measurement units depend on the current screen resolution getResolution. See also SafeZone + Processes code when an exception is thrown in a try block. The exception caught can be found in the _exception variable. - https://community.bistudio.com/wiki/safeZoneH + https://community.bistudio.com/wiki/catch - safeZoneH + Exception catch Code - SafeZoneH + try-block catch code - $Code$_screenHeight = safeZoneH ;$/Code$ - - $Code$_screenBottomBorderY = safeZoneH + safeZoneY ;$/Code$ - + undefined / undefined - Number + Anything + - safeZoneWAbs + hcSelectGroup - Returns SafeZone width (of all monitors, in case there's more than one) + Select given group in high command bar. - https://community.bistudio.com/wiki/safeZoneWAbs + https://community.bistudio.com/wiki/hcSelectGroup - safeZoneWAbs + Object hcSelectGroup Array - safeZoneWAbs + unit hcSelectGroup array - $Code$_szW = safeZoneWAbs;$/Code$ - + undefined / undefined - Number + Nothing + - safeZoneW + case - Returns the width of the screen in screen measurement units. Taken from top left corner of the default viewport (0,0) of the screen and going in the same direction as the X axis, the value will be positive but resulting X will end up beyond the right border. Therefore in order to calculate X of the right screen border, the length of safeZoneX must be subtracted from safeZoneW, but because it is negative, it must be added instead. _screenRightBorderX = safeZoneW + safeZoneX. The measurement units depend on the current screen resolution getResolution. See also SafeZone + This command is used inside a switch do construct. Although the syntax below states that this operator takes only one argument, that is most likely not true. It seems like it needs two arguments of which the left one is some sort of hidden variable that gets defined inside a switch do construct. That is the reason why this operator can not be used outside a switch do construct. (see https://foxhound.international/arma-3-sqf-grammar.html for further explaination) + Also note that it is not possible to store the returned Switch Type in a variable and use that variable in another switch do construct. It will never lead to an execution of the corresponding code block. - https://community.bistudio.com/wiki/safeZoneW + https://community.bistudio.com/wiki/case - safeZoneW + case Anything - safeZoneW + case b - $Code$_screenWidth = safeZoneW ;$/Code$ - - $Code$_screenRightBorderX = safeZoneW + safeZoneX ;$/Code$ + $Code$switch (_condition) do { + case 1: { hint "1" }; + case 2: { hint "2" }; + default { hint "default" }; + };$/Code$ undefined / undefined @@ -52673,27 +54354,28 @@ - Number + Switch_Type + - safeZoneXAbs + targetsAggregate - Returns SafeZone left border (of all monitors, in case there's more than one) + Aggregate candidates. - https://community.bistudio.com/wiki/safeZoneXAbs + https://community.bistudio.com/wiki/targetsAggregate - safeZoneXAbs + Array targetsAggregate Array - safeZoneXAbs + [speaker, side, unit, place, time] targetsAggregate candidates - $Code$_szX = safeZoneXAbs;$/Code$ + $Code$_aggregation = [_this,"","","",""] targetsAggregate _selected;//ca\characters\scripts\reactCore_Full.fsm$/Code$ undefined / undefined @@ -52701,258 +54383,346 @@ - Number + Array + - safeZoneX + tvSetPicture - Returns the X of the left border of the screen, which is also a distance in screen measurement units from top left corner of the default viewport (0,0) of the screen to the left border of the screen. Since it is going in opposite way of the X axis, the value is negative. The measurement units depend on the current screen resolution getResolution. See also SafeZone + Sets picture to item selected by path. IDC means id of parent Tree View. Name is picture name. The picture is searched in the mission directory. - https://community.bistudio.com/wiki/safeZoneX + https://community.bistudio.com/wiki/tvSetPicture - safeZoneX + tvSetPicture Array + + Control tvSetPicture Array - SafeZoneX + tvSetPicture [idc, path, name] + + control tvSetPicture [path, name] - $Code$_screenLeftBorderX = safeZoneX ; // returns a float value 0$/Code$ + $Code$tvSetPicture [101, [0], "picture"];$/Code$ + + $Code$_ctrl tvSetPicture [[0,0,0], getText ( configFile "CfgWeapons" "optic_NVS" "picture")];$/Code$ undefined / undefined + (Sep 11 2014) + (A3 1.28)tv command family overview + $Code$ + //tv command family available for CT_TREE (type 12) + private ["_count","_current","_data","_text","_value","_pic"]; + _CT_TREE tvAdd [ [],"Parent_A"]; + _CT_TREE tvAdd [ [0],"Child_A"]; + _CT_TREE tvAdd [ [0,0],"Grandchild_A"]; + _CT_TREE tvAdd [ [],"Parent_B"]; + _CT_TREE tvAdd [ [1],"Child_B"]; + _count = _CT_TREE tvCount []; //return 2 + _CT_TREE tvSetCurSel [0,0,0]; //select grandchild_A + _current = tvCurSel _CT_TREE; //return [0,0,0] + _CT_TREE tvSetData [_current,"I'm grandchild_A"]; + _data = _CT_TREE tvData _current; // "I'm grandchild_A" + _text = _CT_TREE tvText _current; //"Grandchild_A" + _CT_TREE tvSetValue [_current,14]; + _value = _CT_TREE tvValue _current; // 14 + _CT_TREE tvSetPicture [_current, getText ( configFile "CfgWeapons" "optic_NVS" "picture")]; + _pic = _CT_TREE tvPicture _current; + _CT_TREE tvExpand [1]; + _CT_TREE tvSort [[], false ]; + _CT_TREE tvSortByValue [[], false ]; + _CT_TREE tvDelete [0,0]; //remove child_b + tvClear 12; + _CT_TREE tvCollapse []; + $/Code$ - Number + Nothing - Nothing + - safeZoneY + clearMagazineCargo - Returns the Y of the top border of the screen, which is also a distance in screen measurement units from top left corner of the default viewport (0,0) of the screen to the top border of the screen. Since it is going in opposite way of the Y axis, the value is negative. The measurement units depend on the current screen resolution getResolution. See also SafeZone + Remove all magazines from the given vehicle's magazine cargo space. - https://community.bistudio.com/wiki/safeZoneY + https://community.bistudio.com/wiki/clearMagazineCargo - safeZoneY + clearMagazineCargo Object - SafeZoneY + clearMagazineCargo vehicleName - $Code$_screenTopBorderY = safeZoneY ; // returns a float value 0$/Code$ + $Code$clearMagazineCargo _truck;$/Code$ - undefined / undefined + global / local + (11:02, 24 October 2009 (CEST)) + Effect is local, run on each client for global effect. - Number + Nothing + - save3DENInventory + restartEditorCamera - Saves current state of entitie's inventory to SQM. + Restarts the mission editor camera (if it was deleted by a script,for example). + i + Some Old Editor Command - https://community.bistudio.com/wiki/save3DENInventory + https://community.bistudio.com/wiki/restartEditorCamera - save3DENInventory Array + restartEditorCamera Control - save3DENInventory entities + restartEditorCamera map - $Code$save3DENInventory [_soldier1,_solider2]$/Code$ - + undefined / undefined - Nothing + Nothing + - saveGame + formationDirection - Autosave game (used for Retry). + Return the direction in degrees of the 'unit' watching in formation. - https://community.bistudio.com/wiki/saveGame + https://community.bistudio.com/wiki/formationDirection - saveGame + formationDirection Object - saveGame + formationDirection unitName - $Code$saveGame ;$/Code$ + $Code$_degrees = FormationDirection _unit$/Code$ - undefined / undefined + local / undefined - Nothing + Number + - saveIdentity + binocular - Saves person's identity to Objects.sav file in campaign directory as entry name. + Returns class name of currently used binocular weapon. - https://community.bistudio.com/wiki/saveIdentity + https://community.bistudio.com/wiki/binocular - Object saveIdentity String + binocular Object - unitName saveIdentity name + binocular unit - $Code$player saveIdentity "playerid"$/Code$ + $Code$_binocs = binocular player ; //Rangefinder$/Code$ undefined / undefined - (August 12, 2006) - Can be also used in singleplayer missions to save player status before cutscenes and load it to player's double. - Boolean + String + - saveJoysticks + weightRTD - Saves joysticks key mappings into the joysticks.cfg file. Engine add these joysticks to the Joystick Scheme mapping dialog in options controls section. + Returns weight of RTD helicopter. - https://community.bistudio.com/wiki/saveJoysticks + https://community.bistudio.com/wiki/weightRTD - saveJoysticks + weightRTD Object - saveJoysticks + weightRTD helicopter - + $Code$_taruWeight = weightRTD taru// Returns [7000,300,1990.56,0,0]$/Code$ + undefined / undefined - Nothing + Array + - saveOverlay + buttonSetAction - Save the current overlay. - i - Some Old Editor Command + Set the action of a control of the currently active user dialog. Can be used for buttons and active texts. See Dialog Control for more information about user dialogs. Works with: + CT_BUTTON + CT_XBUTTON + CT_ACTIVETEXT + CT_SHORTCUTBUTTON + The action code is expected to be in SQS format - https://community.bistudio.com/wiki/saveOverlay + https://community.bistudio.com/wiki/buttonSetAction - saveOverlay Control + buttonSetAction Array + + Control buttonSetAction String - saveOverlay map + buttonSetAction [idc, action] + + control buttonSetAction action - $Code$saveOverlay _map$/Code$ + $Code$buttonSetAction [100, " player exec ""reply.sqs"""];$/Code$ + + $Code$_ctrl buttonSetAction " if ( alive bob) then { hint 'alive'} else { hint 'dead'}"; // SQF but SQS compatible, see SQS$/Code$ - undefined / undefined + local / local + (October 5, 2009) + When using buttonSetAction for an ActiveText control from a script, you cannot use any variables local to the script in it. + /* This will print 'any bar' in the hint box, + since _foo has no value according to buttonSetAction */ + _foo = "foo"; + buttonSetAction [100, "hint format[""%1 bar"", _foo];"]; + + (February 15, 2016) + This command does not overwride the buttonaction which was set via "action" in the hpp of the dialog + + (June 11, 2016) + To use variables local to the defining script, a syntax like the one below needs to be used: + $Code$_foo = "foo"; + buttonSetAction [100, format["hint '%1 bar'", _foo]]; + $/Code$ + works! thanks to Kronzky for commenting this workaround in the VBS wiki - Nothing + Nothing - Nothing + - saveProfileNamespace + setUserMFDvalue - Saves the variables stored in profileNamespace to the persistent active user profile. - Warning : this is a file operation, which makes it expensive! It is not recommended to do this at a high frequency in a loop for example. It is however also recommended not to change a large amount of variables and wait long before saving, because certain game crashes may cause a loss of data. - Warning : saving a lot of data can quickly increase the size of the profile variables file, so keep an eye on this. - Warning : TKOH's Heliport status (used in the Career mode for example) is stored in this file, so be mindful of working with this technology to avoid losing data and progress. + When MFD is using user controllers, this command can set values on them. For example, MFD config for Blackfoot has an entry + ... + class Draw + { + alpha = "user3" ; + color [] = { "user0", "user1", "user2" }; + ... + which could control color of the MFD. See Example 2-3-4 on how to set different colors of the Blackfoot MFD - https://community.bistudio.com/wiki/saveProfileNamespace + https://community.bistudio.com/wiki/setUserMFDvalue - saveProfileNamespace + Object setUserMFDvalue Array - saveProfileNamespace + vehicle setUserMFDvalue [index, value] - $Code$saveProfileNamespace;$/Code$ + $Code$BIS_Plane setUserMFDvalue [0,1]; // user0 in MFD will return 1$/Code$ + + $Code$// Set MFD Red: + Blackfoot setUserMFDvalue [0, 1]; // "user0" - 1 + Blackfoot setUserMFDvalue [1, 0]; // "user1" - 0 + Blackfoot setUserMFDvalue [2, 0]; // "user2" - 0 + Blackfoot setUserMFDvalue [3, 1]; // "user3" - 1$/Code$ + + $Code$// Set MFD pale Blue: + Blackfoot setUserMFDvalue [0, 0]; // "user0" - 0 + Blackfoot setUserMFDvalue [1, 0]; // "user1" - 0 + Blackfoot setUserMFDvalue [2, 1]; // "user2" - 1 + Blackfoot setUserMFDvalue [3, 0.1]; // "user3" - 0.1$/Code$ + + $Code$// Hide MFD: + Blackfoot setUserMFDvalue [3, 0]; // "user3" - 0$/Code$ undefined / undefined - Variables are also saved when the game is quit. - Nothing + Nothing + - saveStatus + activateKey - Saves object's properties to Objects.sav file in campaign directory as entry name. + Activates the given keyname for the current user profile. The keys are used to unlock missions or campaigns. + See keys, keysLimit and doneKeys in the description.ext file of the missions. - https://community.bistudio.com/wiki/saveStatus + https://community.bistudio.com/wiki/activateKey - Object saveStatus String + activateKey String - object saveStatus name + activateKey keyname - $Code$player saveStatus "playerstate"$/Code$ + $Code$activateKey "Mission04Key";$/Code$ undefined / undefined @@ -52960,296 +54730,241 @@ - Boolean + Nothing + - saveVar + unregisterTask - Save variable value into the campaign space. This variable is available to all following missions in the campaign. + Unregister a task type. - https://community.bistudio.com/wiki/saveVar + https://community.bistudio.com/wiki/unregisterTask - saveVar String + Team_Member unregisterTask String - saveVar varname + teamMember unregisterTask name - $Code$saveVar "varOne"$/Code$ + $Code$player unregisterTask taskName;$/Code$ undefined / undefined - (January 28, 2009) - If you try to saveVar a vehicle saved in your variable (SavedVars = [Car1]; saveVar "SavedVars"), then Car1 will not be properly "saved", refering to ObjNull if you try to use it in subsequent missions, even if a vehicle with the same vehicle varname exists. To get around this, save the vehicle's varname as a string (SavedVars = [str(Car1)]) and then when you need it just use call compile to "unstring" the varname (_car = call compile (SavedVars select 0);). - Nothing + Boolean + - savingEnabled + isDamageAllowed - Check if saving the game is enabled. + A getter for allowDamage command. The command indicates if damage is allowed at current locality, hence local effect of the command. A complete solution for being able to tell whether or not an object can be damaged at current locality looks like this: + $Code$_canBeDamaged = local _obj && isDamageAllowed _obj;$/Code$ - https://community.bistudio.com/wiki/savingEnabled + https://community.bistudio.com/wiki/isDamageAllowed - savingEnabled + isDamageAllowed Object - savingEnabled + isDamageAllowed object - $Code$if ( savingEnabled ) then { - hint "Saving is enabled!"; - };$/Code$ + $Code$_isGod = ! isDamageAllowed player ;$/Code$ - undefined / undefined + global / local - Boolean + Boolean + - say2D + canUnloadInCombat - Plays given sound in 2D + Check if cargo of this vehicle want to get out when in combat. - https://community.bistudio.com/wiki/say2D + https://community.bistudio.com/wiki/canUnloadInCombat - Object say2D String - - Object say2D Array - - Array say2D String - - Array say2D Array + canUnloadInCombat Object - from say2D sound - - from say2D [sound, maxTitlesDistance, speed] - - [from, to] say2D sound - - [from, to] say2D [sound, maxTitlesDistance, speed] + canUnloadInCombat vehicle - + $Code$if (canUnloadInCombat _vehicle) then {...};$/Code$ + - global / local + undefined / undefined - Nothing - Nothing - Nothing - Nothing + Boolean + - say3D + ctrlAutoScrollRewind - Unit or object will say given sound in 3D Space. This allows broadcasting of positional music or sound from a source, without having to script a fade sound or music command. Compare this with say2D which will always play a sound at the location of the player after he has been in the vicinity of a broadcasting sound. Sound is defined in "CfgSounds" of the Description.ext or main config. - NOTE : You can stop say3D sound currently playing in 2 ways: delete the source of the sound (from) with deleteVehicle or kill the source with setDamage for example. + Returns true if auto-scroll should move back to start after it reaches the end. + Autorscroll is available for CT_LISTBOX and CT_CONTROLS_GROUP types of controls only. Autoscroll will wait ctrlAutoScrollDelay seconds (must be 0) and then will scroll the scroll bar down to the bottom. ctrlAutoScrollSpeed defines the speed with which scrollbar is scrolled. If ctrlAutoScrollRewind is true, the control will fade out, immediately rewind to the top, then fade in, wait ctrlAutoScrollDelay seconds and then repeat the scrolling in a loop. If user focuses on the control, autoscrolling is interrupted. - https://community.bistudio.com/wiki/say3D + https://community.bistudio.com/wiki/ctrlAutoScrollRewind - Object say3D String - - Object say3D Array - - Array say3D String - - Array say3D Array + ctrlAutoScrollRewind Control - from say3D sound - - from say3D [sound, maxDistance, pitch] - - [from, to] say3D sound - - [from, to] say3D [sound, maxDistance, pitch] + ctrlAutoScrollRewind control - $Code$helicopter1 say3D "Fortunateson"$/Code$ + $Code$_ctrlRewind = ctrlAutoScrollRewind _ctrlGroup;$/Code$ - global / local + undefined / undefined - (7 March 2013) - The only difference with this command and say is during cutscenes (when some camera effect is active). In cutscenes, say3D is 3D, say is not. - - (July 19, 2015) - In Arma 2 1.63, the object this command is assigned to must be alive for the sound to broadcast. If the object is killed while the sound is still playing, the sound will stop immediately. - Here is a link to the forum to get around this issue: [1] - I have not tested this in Arma 3 yet. - - (October 13, 2016) - This command is local. - - (March 11, 2017) - This command creates sound object "#soundonvehicle" which can be detected with allMissionObjects : - $Code$ onEachFrame { hintSilent str allMissionObjects "#soundonvehicle"}; - [] spawn { sleep 1; player say3D "Alarm"};$/Code$ - Nothing - Nothing - Nothing - Nothing + Boolean + - say + getObjectMaterials - Unit will say given sound. - When the Unit is a Person, it will also perform corresponding lipsync effect provided an appropriate.lip file has been created for this sound. - A unit that has been killed or does not exist will not say anything. - Compare this with playSound which will always play a sound at the location of the player. - If the camera is not within given range, title is not shown and the sound will not be heard. - Sound is defined in CfgSound of the Description.ext. - NOTE: say will mimic either say2D or say3D depending on whether it is there executed in a cut scene or in a game scene. + Gets all custom materials associated with the object. - https://community.bistudio.com/wiki/say + https://community.bistudio.com/wiki/getObjectMaterials - Object say String - - Object say Array - - Array say String - - Array say Array + getObjectMaterials Object - from say sound - - from say [sound, maxTitlesDistance, speed] - - [from, to] say sound - - [from, to] say [sound, maxTitlesDistance, speed] + getObjectMaterials obj - $Code$( units player select 1) say ["whisper1",5];$/Code$ - - $Code$// Arma 3: - player say "scuba_breath";$/Code$ + $Code$_materials = getObjectMaterials car;$/Code$ - global / local + global / undefined - (7 March 2013) - Say will occur in 3D when the player is active, during cutscenes it will not. Use say3D for cutscenes. - Nothing - Nothing - Nothing - Nothing + Array + - scopeName + playerRespawnTime - Defines name of current scope. Name is visible in debugger, and name is also used as reference in some commands like breakOut and breakTo. Scope name should be defined only once per scope. Trying to set a different name on the scope that has already defined scope name will result in error. + Return the player remaining time to respawn or -1 if it is not available. - https://community.bistudio.com/wiki/scopeName + https://community.bistudio.com/wiki/playerRespawnTime - scopeName String + playerRespawnTime - scopeName name + playerRespawnTime - $Code$scopeName "main"; - while {true} do { - scopeName "loop1"; - while {true} do { - scopeName "loop2"; - ... - }; - };$/Code$ + $Code$waitUntil { playerRespawnTime = 0};$/Code$ undefined / undefined + (June 21, 2007) + When playerRespawnTime reaches zero the player respawns as expected. When the player has completed respawning this command returns -1. + + (February 25, 2009) + Also note that spawning doesn't create a body to use, but allows a player to choose an already + existing one as defined either in the mission editor or in a script as player or playable. - Nothing + Number + - scoreSide + vectorUp - Returns score for the given side. MP Only. + Return object's up vector in world Position coordinates ( [x, y, z] ). - https://community.bistudio.com/wiki/scoreSide + https://community.bistudio.com/wiki/vectorUp - scoreSide Side + vectorUp Object - scoreSide side + vectorUp objectName - $Code$_number = scoreSide west ;$/Code$ + $Code$objVector = vectorUp myObject;$/Code$ - undefined / undefined + global / undefined + (28 Jun, 2014) + (ArmA3 1.22) Returns the pitch and bank of an object in degrees, use BIS_fnc_getPitchBank instead. - Number + Array + - score + ctrlSetFontH1B - Returns the person's score in MP. + Sets H1 bold font of given HTML control. - https://community.bistudio.com/wiki/score + https://community.bistudio.com/wiki/ctrlSetFontH1B - score Object + Control ctrlSetFontH1B String - score unit + controlName ctrlSetFontH1B fontName - $Code$_pScore = score player ;$/Code$ + $Code$_control ctrlSetFontH1B "TahomaB"$/Code$ undefined / undefined @@ -53257,1247 +54972,1079 @@ - Number + Nothing + - screenToWorld + setVectorDirAndUp - Returns the position on landscape ( PositionAGL ) corresponding to the given point on screen (in UI coordinates). + Sets orientation of an object. The command takes 2 vector arrays, one for vectorDir and one for vectorUp. Default object orientation will always have vectorDir pointing forward (North) along Y axis and vectorUp pointing up along Z axis - [[0,1,0],[0,0,1]], as shown on the diagram below. + When attaching object to an object the axes are relative to the object that gets the attachment. If it is player object for example, then X goes from left to right, Y goes from back to front, and Z goes from down up. + The setDir command is incompatible with setVectorDirAndUp and should not be used together on the same object. Using setVectorDirAndUp alone should be sufficient for any orientation. + In Multiplayer, setVectorDirAndUp must be executed on the machine where the object it applied to is local. - https://community.bistudio.com/wiki/screenToWorld + https://community.bistudio.com/wiki/setVectorDirAndUp - screenToWorld Array + Object setVectorDirAndUp Array - screenToWorld screen + vehicle setVectorDirAndUp [[x1, y1, z1],[x2, y2, z2]] - $Code$_wPos = screenToWorld [0.5,0.5];$/Code$ + $Code$// set exact yaw, pitch, and roll + _y = 45; _p = -80; _r = 0; + BRICK setVectorDirAndUp [ + [ sin _y * cos _p, cos _y * cos _p, sin _p], + [ [ sin _r,- sin _p, cos _r * cos _p],-_y] call BIS_fnc_rotateVector2D + ];$/Code$ + + $Code$// To rotate BRICK on Z axis 90 degrees clockwise, change its vectorDir but leave vectorUp unchanged. + BRICK setVectorDirAndUp [[1,0,0],[0,0,1]];$/Code$ + + $Code$// To rotate BRICK on Y axis 90 degrees clockwise, change its vectorUp but leave vectorDir unchanged. + BRICK setVectorDirAndUp [[0,1,0],[1,0,0]];$/Code$ + + $Code$// To rotate BRICK on X axis 90 degrees (tilt forward), change both vectorDir and vectorUp accordingly. + BRICK setVectorDirAndUp [[0,0,-1],[0,1,0]];$/Code$ + + $Code$// More complex orientations + //tilt forward 90 + rotate left 90 + BRICK setVectorDirAndUp [[1,0,0],[0,1,0]]; + //tilt backward 45 degrees + BRICK setVectorDirAndUp [[0,0.5,0.5],[0,-0.5,0.5]]; + //tilt forward 30 degrees + BRICK setVectorDirAndUp [[0,0.66,-0.33],[0,0.33,0.66]];$/Code$ - undefined / undefined + local / global + (March 16, 2008) + Command can be also used to rotate camera in all three axis (which also mean it's possible to set camera bank). + + (May 9, 2008) + The object's vectorDir can only control its pitch, while its vectorUp can only control its bank. To set an object's yaw (direction), use the setdir command, before using this command. + You would think vectorUp would control pitch as well, but any pitch that would be set due to vectorUp is ignored. The same is true with vectorDir and yaw; any vectorDir that would adjust yaw is also ignored. If this doesn't make sense, try to visualize it with a box or soda can. + This command does NOT work with values relative to a unit, but rather it works with world vectors (think world coordinates as opposed to model coordinates). As a result, this command can be difficult to use in many situations, because the input values needed to get a certain pitch / bank for an object vary, depending on what direction the object is facing (yaw). + A function to set an object's pitch / bank can be found here + + (October 23rd, 2009) + Note this odd command may now be better understood. There's a thread about it here: + BI Studios Forum Thread + + (1 Jun, 2014) + (ArmA3 ver 1.20) setDir overwrites setVectorDirAndUp (P.S. setVectorDirAndUp also affects setVelocity.), so use setDir before BIS_fnc_setPitchBank, which is an easier workaround on vector, if changing yaw, pitch and bank are needed. setVectorDirAndUp is CCW, so if we wanna to set an obj 40 degrees CW, 170 degrees pitch and 85 degrees bank: + $Code$_obj setDir (40 - 180); [_obj, 170, 85] call BIS_fnc_setPitchBank ;$/Code$ + Same as: + $Code$_obj setVectorDirAndUp [[0.63,0.75,0.17],[-0.75,0.65,-0.084]];$/Code$ + Be aware that attachTo may flip vectorDir if pitch beyond 90 degrees and cause unexpected behavior to BIS_fnc_setPitchBank, e.g. + $Code$[_obj, 100, 0] call BIS_fnc_setPitchBank ; //vector: [-0.14,-0.09,0.98],[-0.83,-0.51,-0.17]$/Code$ + $Code$_obj attachTo [_logic,[0,0,2]]; + [_obj, 100, 0] call BIS_fnc_setPitchBank ; //vector: [0.11,0.33,0.93],[-0.06,0.94,-0.32] + compass direction algorism failed if obj was attached at present.$/Code$ + To overcome such limitation we can use fallowing function for a better workaround. (code originated from bapedibupa, remodified) + $Code$ + _obj attachTo [_logic,[0,0,2]]; + [_obj,[120,-78,37]] call fnc_SetPitchBankYaw; // pitch: 120, bank: -78, yaw: 37$/Code$ + $Code$ + fnc_SetPitchBankYaw = { + private ["_object","_rotations","_aroundX","_aroundY","_aroundZ","_dirX","_dirY", + "_dirZ","_upX","_upY","_upZ","_dir","_up","_dirXTemp","_upXTemp"]; + _object = _this select 0; + _rotations = _this select 1; + _aroundX = _rotations select 0; + _aroundY = _rotations select 1; + _aroundZ = (360 - (_rotations select 2)) - 360; + _dirX = 0; + _dirY = 1; + _dirZ = 0; + _upX = 0; + _upY = 0; + _upZ = 1; + if (_aroundX != 0) then { + _dirY = cos _aroundX; + _dirZ = sin _aroundX; + _upY = - sin _aroundX; + _upZ = cos _aroundX; + }; + if (_aroundY != 0) then { + _dirX = _dirZ * sin _aroundY; + _dirZ = _dirZ * cos _aroundY; + _upX = _upZ * sin _aroundY; + _upZ = _upZ * cos _aroundY; + }; + if (_aroundZ != 0) then { + _dirXTemp = _dirX; + _dirX = (_dirXTemp* cos _aroundZ) - (_dirY * sin _aroundZ); + _dirY = (_dirY * cos _aroundZ) + (_dirXTemp * sin _aroundZ); + _upXTemp = _upX; + _upX = (_upXTemp * cos _aroundZ) - (_upY * sin _aroundZ); + _upY = (_upY * cos _aroundZ) + (_upXTemp * sin _aroundZ); + }; + _dir = [_dirX,_dirY,_dirZ]; + _up = [_upX,_upY,_upZ]; + _object setVectorDirAndUp [_dir,_up]; + }; + $/Code$ - Array + Nothing + - screenshot + activateAddons - Captures a screenshot and stores it to given filename. PNG is the only available format and the file must have.png extension. - The file is saved into Screenshots folder in the Profile directory. The folder is by default limited to 250 MB to prevent abuse. - To increase the limit, add the following line at the end of the profile file: - $Code$maxScreenShotFolderSizeMB = 2000;$/Code$ - 2000 can be replaced by any value in MB. + Activates the listed addons. The list of active addons is initialized during this function. - https://community.bistudio.com/wiki/screenshot + https://community.bistudio.com/wiki/activateAddons - screenshot String + activateAddons Array - screenshot filename + activateAddons [addon1,] - $Code$screenshot "";$/Code$ - - $Code$screenshot "testFile.png";$/Code$ - - $Code$// The following code will result in the screenshot being placed in \Documents\Arma 3\Screenshots\any\where\you\want.png - screenshot "any\where\you\want.png";$/Code$ + $Code$activateAddons ["BISOFP"];$/Code$ undefined / undefined - (July 18, 2016) - This command only captures the rendered picture (including ppEffects). GUI nor the mouse are visible on the screenshot. (ArmA 3 1.62.137494) + (Jan 21, 2009) + Be aware that "Addon1" is the cfgPatches class of the desired addon to preload. + + (May 10, 2009) + This command will activate addons that are referenced via scripts but not included in a missions required addons section. If executed from a configs init event with the call command, it will effectively override a missions required addons, preventing them from being activated (Appears to only happen in multi player). + To activate the passed addons along with those defined in the mission.sqm, execute the command from a configs init event using spawn or execVM. UNN - Nothing + Nothing + - scriptDone + enableSaving - Check if a script is finished running using the Script_(Handle) returned by execVM or spawn. + Enable / disable saving of the game. + When disabled, the autosave is created (if not forbidden by save == false). - https://community.bistudio.com/wiki/scriptDone + https://community.bistudio.com/wiki/enableSaving - scriptDone Script_Handle + enableSaving Boolean + + enableSaving Array - scriptDone handle + enableSaving enable + + enableSaving [enable, save] - $Code$// SQS Syntax: - @ scriptDone _Handle$/Code$ - - $Code$// SQF Syntax: - script_handler = [parameters] execVM "scriptname.sqf"; - waitUntil { scriptDone script_handler };$/Code$ + $Code$enableSaving false ; // Saving disabled and make autosave. + enableSaving true ; // Saving enabled without autosave. + enableSaving [ false, false ]; // Saving disabled without autosave. + enableSaving [ false, true ]; // Saving disabled and make autosave. + enableSaving [ true, false ]; // Saving enabled without autosave. + enableSaving [ true, true ]; // Saving enabled and make autosave.$/Code$ undefined / undefined - (03:54, 11 September 2009) - A Null Script handle can be created in this manner: - $Code$_handle = 0 spawn {};$/Code$ - That is what any Script_(Handle) becomes when a script is finished running, meaning it will test as true with: - $Code$ scriptDone _handle $/Code$ and it returns " NULL-script " when converted to string. This in turn lets you initialize the variable with a completed Script_(Handle) and lets you test the variable even though nothing else may have set the handle by creating a script with spawn or execVM. It also lets you store and manage script handles in arrays, and a few other sexy things. - Boolean + Nothing - Nothing + - scriptName + progressSetPosition - Assign a user friendly name to the VM script this command is executed from. - Once name is assigned, it cannot be changed. + Sets progress position of the progress bar ( DialogControls-ProgressBar ) - https://community.bistudio.com/wiki/scriptName + https://community.bistudio.com/wiki/progressSetPosition - scriptName String + Control progressSetPosition Number - scriptName name + control progressSetPosition pos - $Code$scriptName "leetScript.sqf";$/Code$ + $Code$_control progressSetPosition 0.5$/Code$ - $Code$scriptName format ["%1ARTY\data\scripts\ARTY_sadarmDeploy.sqf (_this: %1)",_this];$/Code$ + $Code$with uiNamespace do { + bar = findDisplay 46 ctrlCreate ["RscProgress", -1]; + bar ctrlSetPosition [0,0,1,0.01]; + bar ctrlCommit 0; + bar progressSetPosition 0.75; + };$/Code$ undefined / undefined - (17:39, 13 June 2009 (CEST)) - scriptName is good when you want to load the handle of some spawn or call with some name: - on top of leetscript.sqf - $Code$ - scriptName "LEETSCRIPT"; - GLOBAL_SCR_NAME = [] spawn "leetscript.sqf"; - hint format ["%1",GLOBAL_SCR_NAME]; - //display "LEETSCRIPT"$/Code$ - Nothing + Nothing + - scriptNull + setObjectArguments - A non-existing Script or script that has finished ( scriptDone ). To compare non-existent scripts use isNull or isEqualTo : - scriptNull == scriptNull ; // ERROR! == cannot be used with script object - isNull scriptNull ; // true - scriptNull isEqualTo scriptNull ; // true + Set object arguments in mission editor. + i + Some Old Editor Command - https://community.bistudio.com/wiki/scriptNull + https://community.bistudio.com/wiki/setObjectArguments - scriptNull + Control setObjectArguments Array - scriptNull + map setObjectArguments [object,[name1,value1,]] - $Code$// Wait until previous script is finished before starting a new one: - [] spawn - { - _script = scriptNull ; - for "_i" from 1 to 10 do { - waitUntil { isNull _script}; - _script = _i spawn { - hint format ["script %1 started", _this]; - sleep 1; - hint format ["script %1 finished", _this]; - sleep 0.2; - }; - }; - };$/Code$ - - $Code$if ( scriptDone (_obj getVariable ["objScript", scriptNull ])) then { - _obj setVariable ["objScript", _obj spawn { - waitUntil { damage _this 0.9}; - hint "Critical Damage!"; - }]; - };$/Code$ - - $Code$str scriptNull ; // NULL-script$/Code$ - + undefined / undefined - Script_Handle + Any_Value + - scudState + nextWeatherChange - Current state of given Scud launcher. Following states are recognized: - 0 - No activity - 1 - Launch preparation, - 2 - Launch prepared - 3 - Ignition - 4 - Launched. + Return the remaining time (in seconds) over which the current weather change will occur. + When a weather change finishes, the game engine will automatically generate a new random weather change over a realistic time period (minimum of 90 minutes). - https://community.bistudio.com/wiki/scudState + https://community.bistudio.com/wiki/nextWeatherChange - scudState Object + nextWeatherChange - scudState scudName + nextWeatherChange - $Code$if (( scudState _scud) == 3) exitWith - { - player sideChat "SCUD Launch status: Missile Ignition"; - };$/Code$ + $Code$_seconds = nextWeatherChange ;$/Code$ undefined / undefined - (August 4, 2006) - This command checks the scud status (Non-integral values are used to indicate transition between states). - To make the scud be upright, launch or cancel launch you need to use actions. - $Code$scud1 action ["scudLaunch",scud1]; // erect the missile - scud1 action ["scudStart",scud1]; // launch the missile - scud1 action ["scudCancel",scud1]; // down the missile - $/Code$ - (Make sure either the scud launcher has a crew inside or you use the game logic to perform actions). - Number + Number + - secondaryWeaponItems + setFuel - Returns array with all items assigned to the secondary weapon. This command is used for infantry weapons only. + Sets fuel percentage from 0 (empty) to 1 (full). The vehicle must be local to the computer where command is executed. - https://community.bistudio.com/wiki/secondaryWeaponItems + https://community.bistudio.com/wiki/setFuel - secondaryWeaponItems Object + Object setFuel Number - secondaryWeaponItems unit + vehicle setFuel amount - $Code$secondaryWeaponItems player ; //["","","",""]$/Code$ + $Code$_jeepOne setFuel 0.5;$/Code$ - undefined / undefined + local / global - Array + Nothing + - secondaryWeaponMagazine + damage - Returns either single element array, containing class name of currently loaded in the secondary weapon magazine, or an empty array if unit has no secondary weapon or secondary weapon is not loaded. This command is used for infantry weapons only. + Return the damage value of an object. - https://community.bistudio.com/wiki/secondaryWeaponMagazine + https://community.bistudio.com/wiki/damage - secondaryWeaponMagazine Object + damage Object - secondaryWeaponMagazine unit + damage object - $Code$hint secondaryWeaponMagazine player ; //["NLAW_F"]$/Code$ + $Code$? (( damage player ) 0.1) : player groupChat "I'm hurt! Medic!"$/Code$ - $Code$_array = secondaryWeaponMagazine player ; - if ( count _array 0) then { - hint ("Secondary weapon is loaded with " + (_array select 0) + "!"); - } else { - if ( secondaryWeapon player != "") then { - hint "Secondary weapon is not loaded!"; - } else { - hint "Player doesn't have a secondary weapon!"; - }; - };$/Code$ + $Code$_health = (1 - damage player ) * 100 //Health in % from 0 to 100$/Code$ - undefined / undefined + global / undefined + (February 13, 2015) + The returned value depends on the couple target/ammo fired. This value has no correlation with the sum of all hitpoints damage status and the effective status of the object. Firing bullets on cars often lead to weird results. For example: damage returns zero while a Hunter is fired at will with an.50 HMG! Hunter can be almost destroyed with zero damage for this function. If you script, use instead the getHitPointDamage function. - Array + Number + - secondaryWeapon + isShowing3DIcons - Returns name of a unit's secondary weapon (empty string if none). + Returns true if the editor is set to draw 3D icons. + i + Some Old Editor Command - https://community.bistudio.com/wiki/secondaryWeapon + https://community.bistudio.com/wiki/isShowing3DIcons - secondaryWeapon Object + isShowing3DIcons Control - secondaryWeapon unit + isShowing3DIcons map - $Code$_sWeap = secondaryWeapon player ;$/Code$ - - $Code$hint secondaryWeapon player ; //"launch_NLAW_F"$/Code$ - + undefined / undefined - (August 4, 2006) - Notes from before the conversion: - secondaryWeapon tells you what weapon the unit has irrespective of the status of the weapon. For example a unit that has a LAWLauncher on his back will still report a LAWLauncher as its secondary weapon. Use currentWeapon to detect the active weapon. - String + Boolean + - selectBestPlaces + setMarkerTextLocal - Find the places with the maximum value of expression in the given area. Places can be on water. Results are sorted by value. Search pattern is randomised every command execution. + Sets the text label of an existing marker. - https://community.bistudio.com/wiki/selectBestPlaces + https://community.bistudio.com/wiki/setMarkerTextLocal - selectBestPlaces Array + String setMarkerTextLocal String - selectBestPlaces [position, radius, expression, precision, sourcesCount] + markerName setMarkerTextLocal text - $Code$myPlaces = selectBestPlaces [ position player, 50, "meadow + 2*hills", 1, 5];$/Code$ + $Code$"Marker1" setMarkerTextLocal "You are here.";$/Code$ - undefined / undefined + undefined / local - (Jul 17, 2010) - see http://forums.bistudio.com/showthread.php?t=93897 for some more information (though neither official, nor complete). The most important information is the list of useable keywords for the expression which is: forest, trees, meadow, hills, houses, sea, night, rain, windy and deadBody. The keyword will be replaced by the actual value at the given sample position and thus the expression gets evaluated. For example the following expression (which returns high values in forest) "forest + trees - meadow - houses - (10 * sea)" might be transformed to 0 + 0.1 - 0.7 - 0 - (10 * 0) which is - with it's result of -0.6 - not in the forest, though there are some tree(s) around. You get the idea. - Also note that you may aswell check such an expression value at a single position by passing a low radius and a sourceCount of 1, which is often just as useful as retrieving multiple (and already sorted) positions. - Also do not underestimate the keywords night, rain or windy, for if you couple them with the other keywords, you can easily get a highly dynamic system at a very low cost. (this, btw., is how animals "choose" where and when to spawn) - - (Apr 3, 2014) - In ArmA3 ver 1.14 Two new expressions are available: waterDepth (0-1) and camDepth (0-1), along with three simple operators: interpolate, randomGen and factor that can be used together with expressions. E.g. - $Code$ - p = selectBestPlaces [ - position player, - 500, - "(2 * (waterDepth interpolate [1,16,0,1]) * ((0.1+houses factor [0.1,0.8]) * (randomGen 1 + houses)))", - 1, - 1]; - $/Code$ - A lgorithm randomGen: - $Code$ - randomGen A(number): randomly generate a float number from 0 - A - $/Code$ - A lgorithm factor: - $Code$ - A(number) factor [p,q] = - p A q: [(A -p)/(q-p)] - $/Code$ - A lgorithm interpolate: - $Code$ - A(number) interpolate [p,q,r,s] = - A =p:r - A =q:s - p A q: [(A -p)/(q-p)]*(s-r) +r - $/Code$ - - (June 15, 2015) - precision seems to have range 0 - 100. At very low values the command is extremely slow. 100 makes it quite fast. It looks like precision is some kind of grid search size. Large chunks make the search faster but less accurate. - Resulting array is [] if sourcesCount is 0 or expression is "". In all other cases it seems that result is array of arrays of the set max count. The sole indication of successful search is expressionResult value when it is 0. - - (June 4, 2017) - Results are sorted by value, that is, the result of the expression. - They are sorted in descending order, so in the case of waterdepth, the deepest water will be found at the locations at the start of the returned array and the shallowest water will be found at the locations at the end. - Array + Nothing + - selectDiarySubject + get3DENIconsVisible - Select the subject page in a log. + Get visibility state of Eden Editor icons. - https://community.bistudio.com/wiki/selectDiarySubject + https://community.bistudio.com/wiki/get3DENIconsVisible - Object selectDiarySubject String + get3DENIconsVisible - person selectDiarySubject subject + get3DENIconsVisible - + $Code$if ( get3DENIconsVisible select 0) then { hint "Icons are visible in the map.";};$/Code$ + undefined / undefined - Nothing + Array + - selectEditorObject + titleText - Select an editor object. Does not un-select previously selected objects. - i - Some Old Editor Command + Displays text across the screen. If used along with cutText two different texts (in different type styles) can be shown at once. The text can be displayed on multiple lines by using "\n" new line characters: + titleText ["line1\nline2\nline3", "PLAIN"];. Since Arma 3 v1.73.142260 this command supports Structured Text formatting. - https://community.bistudio.com/wiki/selectEditorObject + https://community.bistudio.com/wiki/titleText - Control selectEditorObject String + titleText Array - map selectEditorObject object + titleText [text, type, speed, showInMap, isStructuredText] - + $Code$titleText ["Show this text", "PLAIN"];$/Code$ + + $Code$titleText ["Your message", "BLACK", 2];$/Code$ + + $Code$// Since Arma 3 v1.73.142260: + titleText [" t color='#ff0000' size='5' RED ALERT! /t br/ ***********", "PLAIN", -1, true, true ];$/Code$ + - undefined / undefined + undefined / local + (November 21, 2014) + The third parameter or 'speed', as it's called in the description, refers to the amount of time the message will be shown on-screen. Multiply each number by 10 to get the number of seconds it will be shown. You can even use floats as input, like 0.1, to show a message for only 1 second. + Note : Calculating the time with that method does not include the time it takes to fade in/out, which is about 1 second unless you use numbers lower than 1. + Note : Using anything lower than 0.001 seems to have no effect, or the effect is so little it's negligible. + (A3 1.34.128075) - Any_Value + Nothing + - selectLeader + environmentEnabled - Select a group's leader. In MP the group has to be local to the PC executing the command. Locality of the group can be checked with local command and group ownership with groupOwner command. + Returns status of enableEnvironment command - https://community.bistudio.com/wiki/selectLeader + https://community.bistudio.com/wiki/environmentEnabled - Group selectLeader Object + environmentEnabled - groupName selectLeader unitName + environmentEnabled - $Code$group player selectLeader player ;$/Code$ - - $Code$// Make unit a leader from server: - [ group _unit, _unit] remoteExec ["selectLeader", groupOwner group _unit];$/Code$ + $Code$_enabled = environmentEnabled ;$/Code$ - local / global + undefined / undefined - Nothing + Array + - selectMax + curatorWaypointCost - Returns the array element with maximum numerical value. Engine solution to BIS_fnc_greatestNum and BIS_fnc_findExtreme. Therefore it is expected that supplied array consists of Numbers only. Booleans however are also supported and will be evaluated as Numbers : true - 1, false - 0. nil value treated as 0. Other non Number elements (not recommended) will be evaluated as 0 and Bad conversion: scalar message will be logged into. rpt. + Return current price for placing waypoints (curator specific). - https://community.bistudio.com/wiki/selectMax + https://community.bistudio.com/wiki/curatorWaypointCost - selectMax Array + curatorWaypointCost Object - selectMax array + curatorWaypointCost curatorObj - $Code$_max = selectMax [1,2,3,4,5]; //5$/Code$ - - $Code$// Same as, for example: - _max = _a max _b max _c max _d; - // Only faster: - _max = selectMax [_a,_b,_c,_d];$/Code$ - + undefined / undefined - (December 19, 2016) - Returns either number or boolean value, in case max value in array 0, command will return either 0 or false, which ever comes first. - Same for 1 and true values. - $Code$selectMax [false,0] // returns false - selectMax [0,false] // returns 0 - selectMax [true,1] // returns true - selectMax [1,true] // returns 1 - $/Code$ - in case all values are equal or less than zero, command may also return other type of values - $Code$selectMax ["",false,0,-1] // returns "" - $/Code$ - if nil value appears in array, other values are equal or less than zero, command returns nil - Anything + Number + - selectMin + runInitScript - Returns the array element with minimum numerical value. Engine solution to BIS_fnc_lowestNum and BIS_fnc_findExtreme. Therefore it is expected that supplied array consists of Numbers only. Booleans however are also supported and will be evaluated as Numbers : true - 1, false - 0. nil value treated as 0. Other non Number elements (not recommended) will be evaluated as 0 and Bad conversion: scalar message will be logged into. rpt. + Launch init.sqs or init.sqf scripts. - https://community.bistudio.com/wiki/selectMin + https://community.bistudio.com/wiki/runInitScript - selectMin Array + runInitScript - selectMin array + runInitScript - $Code$_min = selectMin [1,2,3,4,5]; //1$/Code$ - - $Code$// Same as, for example: - _min = _a min _b min _c min _d; - // Only faster: - _min = selectMin [_a,_b,_c,_d];$/Code$ - + undefined / undefined - Anything + Nothing + - selectNoPlayer + vehicle - Switches player to no unit, makes player return objNull. SP only, the command is completely ignored in MP. + Vehicle in which given unit is mounted. If none, unit is returned. Alternatively, use objectParent - https://community.bistudio.com/wiki/selectNoPlayer + https://community.bistudio.com/wiki/vehicle - selectNoPlayer + vehicle Object - selectNoPlayer + vehicle unitName - $Code$// Single player: - selectNoPlayer ; - hint str player ; // NULL-object - // Rough multiplayer emulation:_noPlayer = createGroup sideLogic createUnit [ - "Logic", - [0,0,1000], - [], - 0, - "NONE" - ]; - selectPlayer _noPlayer; - hint str player ; //L Charlie 4-3:1 (KK)$/Code$ + $Code$// SQS + ? vehicle player != player : hint "Player is in a vehicle"$/Code$ + + $Code$// SQF + if ( vehicle player != player ) then { hint "Player is in a vehicle"};$/Code$ undefined / undefined - Player returns objNull after this command has been used. It also has at least the following side effects: closeDialog won't work anymore and onKeyDown event handlers cease to detect the ESC key. In order to get things back to normal a new player object has to be set with selectPlayer. Using objNull won't cut it in this case. - Nothing + Object + - selectPlayer + terrainIntersectASL - Moves player into given unit. In Arma 3 it is now not possible to selectPlayer into unit occupied by another player. Also avoid selecting player into editor placed units in multiplayer, as it may, on occasion, lead to some undefined behaviour. If you need to selectPlayer into another unit, consider creatingUnit dynamically. + Checks for intersection of terrain between two ASL positions. Returns true if intersects with terrain. For AGL variant, see terrainIntersect - https://community.bistudio.com/wiki/selectPlayer + https://community.bistudio.com/wiki/terrainIntersectASL - selectPlayer Object + terrainIntersectASL Array - selectPlayer unitName + terrainIntersectASL [pos1, pos2] - $Code$selectPlayer bob;$/Code$ + $Code$_intersects = terrainIntersectASL [ getPosASL player, getPosASL chopper];$/Code$ + + $Code$_intersects = terrainIntersectASL [ eyePos player, eyePos enemy1];$/Code$ - local / global + undefined / undefined - This command has significant effects on locality - Notes on locality issues with selectPlayer in multiplayer environments: - 1) If you switch to a unit that's not local, control over movement will not be given to you immediately. For example, if you switch to an AI unit whose leader is a player, you will not be able to control the movement of your new avatar, as its control remains with the leader unit. You will however be able to look around while the unit walks automatically. - 2) The identity of units are not transferred properly: If your old unit dies, this will count for your stats. Your old unit might remain identifiable as you (if you aim at the unit you see your own name). Your new unit will keep it's name, face and voice (face can be set dynamically, but name, voice and glasses have to be defined before mission start in the description.ext). When chatting, not the name of your original identity, but the identity of the transferred to person will show. - Those 2 Points were for ArmA I, I am currently analyzing the behaviour in ArmA II with version 1.08 + OA 1.57 - So with ArmA II, you still have to keep an eye on locality (otherwise the AI will controll the unit you are), but there are cool possibilities now: if you do a "selectPlayer unitVarName",the unit takes your identity (with name, voice, face and glasses) - and your identity is also visible on other clients! - But you have to remember that your old unit will stay with your Identity. Dies the old unit, the stats count it. An other thing you have to pay attention is the Death for your new unit - you have to register an EventHandler, otherwise you will stay in your dead unit, and also the MenuOption Respawn won't help you out! 3.Jan. 2011 - 3) If you do a selectPlayer call, join,joinSilent,joinAs,joinAsSilent wont work anymore correctly. Means: Your unit joins the other group AND your unit will be local to the other group. so at the moment you can use selectPlayer only as a single human player in a group. In the later day I will try what happens if both human players are units by selectPlayer, and both join the same group (till yet tried with one selectPlayer unit and one originUnit) - 14.May 2011 - Tried to create ingame a group with a selectPlayer Unit (on both clients), and joint the new squad. The result was, the group was local to the client who created the group, so after that, all other units that join that Group are - as you may think already, local to that single client. 18.May 2011 - - 3) After switching to a unit that's not local, the unit will remain local to you after switching back. For example, if we have units A and B, and a client starts as unit A and unit B is AI under server control. If you switch to unit B, it will take some time, but eventually you can control the movement of unit B (see (1) above). Now if you switch back to unit A, unit B will remain local to you, the player. Any server-side scripts which try to execute local arguments -- such as doMove -- will fail. - - A working implementation can be found at A&S ProMode dev-heaven repo, acc guest, pw guest or at pastebin. - Be careful to learn all the pitfalls and things you need to take into consideration to have this working in MP. - - (09 March 2014) - Arma 3 (v1.13): In MP the Identity and the name carries over to the new Unit but not in SP. Use setName to set the name in SP. + (may 31, 2012) + Please note the difference : + terrainIntersect + terrainIntersectASL + lineIntersect s + lineIntersect s With + lineIntersect s Objs + intersect - (June 24, 2015) - Most of the notes above do not apply to Arma 3 anymore. + (may 31, 2012) + This command is CPU intensive on the engine, be careful with its use. - Nothing + Boolean + - selectRandomWeighted + getWingsOrientationRTD - Returns a random element from the given array according to assigned weights. Engine solution to BIS_fnc_selectRandomWeighted. A few notes: - Negative weights are not supported - If an item's weight is 0, the item is ignored - The weights don't have to total to 1 - If numbers of items and weights do not match, the shortest array is used - A single array Syntax is slightly faster then Alt Syntax + Returns orientation of horizontal stabilizers. - https://community.bistudio.com/wiki/selectRandomWeighted + https://community.bistudio.com/wiki/getWingsOrientationRTD - selectRandomWeighted Array - - Array selectRandomWeighted Array + getWingsOrientationRTD Object - selectRandomWeighted valuesAndWeights - - values selectRandomWeighted weights + getWingsOrientationRTD RTD_helicopter - $Code$_randomWeightedElement = selectRandomWeighted [1,0.1,2,0.2,3,1.3,4,2.4,5,7.5];$/Code$ - - $Code$_randomWeightedElement = [1,2,3,4,5] selectRandomWeighted [0.1,0.2,1.3,2.4,7.5];$/Code$ + $Code$_orientation = getWingsOrientationRTD myHelicopter;$/Code$ undefined / undefined - (June 26, 2017) - A 100000 runs of the following code: - $Code$_values = [0,1,2,3,4,5,6,7,8,9]; - _weights = [0.109,0.65,0.01,1.01,1.24,0,1.59,0.09,1.15,0.55]; - _result = _values selectRandomWeighted _weights;$/Code$ - Gave this result: - 0 - 0 - 0.01 - 144 - 0.09 - 1409 - 0.109 - 1633 - 0.55 - 8673 - 0.65 - 10127 - 1.01 - 15668 - 1.15 - 18059 - 1.24 - 19518 - 1.59 - 24769 - Anything - Anything + Number + - selectRandom + clearWeaponPool - Returns a random element from the given array. Engine solution to BIS_fnc_selectRandom + Remove all weapons from the weapon pool, of which the player may choose in the following missions. Available in campaigns only. - https://community.bistudio.com/wiki/selectRandom + https://community.bistudio.com/wiki/clearWeaponPool - selectRandom Array + clearWeaponPool - selectRandom array + clearWeaponPool - $Code$_randomElement = selectRandom [1,2,3,4,5];$/Code$ - + undefined / undefined - Anything + Nothing + - selectWeaponTurret + ctrlSetFontH4B - Selects the given weapon on specified turret. Use turret path [-1] for driver's turret. Since ver. 1.63.136864 this command supports both weapon name and muzzle name. + Sets H4 bold font of given HTML control. - https://community.bistudio.com/wiki/selectWeaponTurret + https://community.bistudio.com/wiki/ctrlSetFontH4B - Object selectWeaponTurret Array + Control ctrlSetFontH4B String - vehicle selectWeaponTurret [weapon, turretPath] + controlName ctrlSetFontH4B fontName - $Code$MBT_Kuma selectWeaponTurret ["LMG_coax",[0]];$/Code$ + $Code$_control ctrlSetFontH4B "TahomaB"$/Code$ undefined / undefined - (February 13, 2017) - The command will treat weapon or muzzle param like a weapon first. If no such weapon is found then it will try to find muzzle with such name. For example AMV-7 Marshall APC has main gun "autocannon_40mm_CTWS" which has 2 muzzles "HE" and "AP". Default muzzle is "HE". So if you try to select weapon by the name "autocannon_40mm_CTWS" you will always get "HE" muzzle selected. However if you pass "AP" as param, it will correctly select "AP" muzzle, since no "AP" weapon exists on this turret it will continue searching for a muzzle with this name and will find it eventually. - Nothing + Nothing + - selectWeapon + leaderboardInit - Selects the given weapon. - Note: For weapons that have more than one muzzle, you have to input the muzzlename and not the weaponName. - The only weapons that have muzzleNames seem to be rifles with grenade launchers, handgrenades, smokeshells and satchels. - In all other cases the weaponName must be used. - Fortunately, in OFP, in most cases, both names are the same. But check. - In ArmA the weaponNames and muzzleNames are different. - For muzzle names see cfgWeapons. - NOTE: The unit must be local to the PC on which command is executed. + Initialize the leaderboard structure for board with given name. Returns true if board is already initialized. - https://community.bistudio.com/wiki/selectWeapon + https://community.bistudio.com/wiki/leaderboardInit - Object selectWeapon String + leaderboardInit String - unitName selectWeapon muzzleName + leaderboardInit boardName - $Code$_soldier1 selectWeapon "LAWLauncher";$/Code$ - - $Code$player selectWeapon "M203Muzzle";$/Code$ + $Code$leaderboardInit "TT01"$/Code$ - local / global + undefined / undefined - (5 Aug, 2008) - Rather than simply using selectWeapon to select your default weapon after adding them to your player, it is recommended you use a script instead similar to the following, which caters for multiple muzzles: - SelectWeapon.sqf - // Desc: select default weapon & handle multiple muzzles - if (count weapons player 0) then - { - private['_type', '_muzzles']; - _type = ((weapons player) select 0); - // check for multiple muzzles (eg: GL) - _muzzles = getArray(configFile "cfgWeapons" _type "muzzles"); - if (count _muzzles 1) then - { - player selectWeapon (_muzzles select 0); - } - else - { - player selectWeapon _type; - }; - }; - - (22 Mar, 2010) - Can be used with primaryWeapon to select the primary weapon. - An example with muzzle care (see Dr_EyeBall note) : - if ( (primaryWeapon player) != "") then - { - private['_type', '_muzzles']; - _type = primaryWeapon player; - // check for multiple muzzles (eg: GL) - _muzzles = getArray(configFile "cfgWeapons" _type "muzzles"); - if (count _muzzles 1) then - { - player selectWeapon (_muzzles select 0); - } - else - { - player selectWeapon _type; - }; - }; - Nothing + Boolean + - selectedEditorObjects + remoteExecutedOwner - Returns a list of currently selected editor objects. - i - Some Old Editor Command + Returns clientOwner of the PC, which initiated Remote Execution call. If used in SP or outside of remote executed context, the command returns 0. To check if the context was remote executed or remote executed from JIP queue, use isRemoteExecuted and isRemoteExecutedJIP - https://community.bistudio.com/wiki/selectedEditorObjects + https://community.bistudio.com/wiki/remoteExecutedOwner - selectedEditorObjects Control + remoteExecutedOwner - selectedEditorObjects map + remoteExecutedOwner - $Code$_selObjects = selectedEditorObjects _map - Result can be: ["_vehicle_0","_vehicle_9","_vehicle_11"]$/Code$ + $Code$_callerRE = remoteExecutedOwner ;$/Code$ + + $Code$// Send request to the server and get immediate response: + { + // in this scope, the remoteExecutedOwner equals clientOwner of the sender + // so using it as target in remoteExec will send response right back at him + [ + time, // mission time value on the server + { + hint format + [ + "Request recieved!\nMission time value on the server is: %1", + _this + ]; + } + ] + remoteExec ["call", remoteExecutedOwner ]; // server response to the sender + } + remoteExec ["call", 2]; // send request to server$/Code$ undefined / undefined + (September 11, 2017) + NOTE : Always be sure to check if the remoteExecutedOwner is not equal to 0 when sending a remoteExec / remoteExecCall packet back, as this will result in sending packet to ANYONE (0): + $Code$if (remoteExecutedOwner isEqualTo 0) exitWith {}; // Not valid RE owner + _gearArray remoteExecCall ['someGearFunction',remoteExecutedOwner]; + $/Code$ + Will prevent from code being accidentaly sent for everyone on the server. - Array + Number + - selectionNames + allowDammage - Returns the list of model selections + Allow or prevent an object being damaged (or injured, or killed). Alias of allowDamage. + The command does not prevent object from taking scripted damage such as setDamage or setHit. + ! + Command has to be executed where object is local and as long as object does not change locality the effect of this command will be global. + If object changes locality, the command needs to be executed again on the new owner 's machine to maintain the effect. - https://community.bistudio.com/wiki/selectionNames + https://community.bistudio.com/wiki/allowDammage - selectionNames Object + Object allowDammage Boolean - selectionNames object + object allowDammage allow - $Code$_house= "Land_i_House_Small_02_V3_F" createVehicle _pos; - selectionNames _house; - //[ - //"door_1","door_2","damt_1","door_handle_1","door_handle_2","glass_1_hide", - //"glass_2_hide","glass_3_hide","glass_1_unhide","glass_2_unhide","glass_3_unhide", - //"glass_4_hide","glass_4_unhide" - //]$/Code$ + $Code$player allowDammage false ;$/Code$ undefined / undefined - (June 5, 2016) - selectionNames returns an array of named selections from only the resolution LODs. + (October 24, 2014) + This command is still working in A3 1.32.127785, at least in single player. I didn't test multiplayer. - Array + Nothing + - selectionPosition + getPlayerUID - Search for selection in the object model (first in the memory level, then in geometry LODs). - Returns position in model space. In A1 it returns the initial position of the selection, in A2/3 position of the selection (e.g. when it is animated) in render time scope. If a selection does not exist [0,0,0] is returned. + Return an uniqueID of the given unit as string if it's player and empty value if it's AI. The unique ID may be up to 100 characters long and may contain numbers, uppercase letters and underscores (the value can be used to construct a valid variable name by appending to another valid variable name). + Note: while for ArmA 2 or ArmA 2: Operation Arrowhead until version 1.60 the result always contains a number, it should be always handled as an opaque string. Converting it to a Number can cause precision problems, as Number cannot accurately represent integers above 16777216 (2^24). Moreover, game versions since ArmA 2: Operation Arrowhead 1.61 provide a non-numeric value as a result. + In some cases, the identity of certain player units might fail to propagate to other clients and the server, which causes isPlayer and getPlayerUID to incorrectly return false and "", respectively, where the affected units are not local. [1] Therefore, beware of false negatives. - https://community.bistudio.com/wiki/selectionPosition + https://community.bistudio.com/wiki/getPlayerUID - Object selectionPosition String - - Object selectionPosition Array + getPlayerUID Object - object selectionPosition selectionName - - object selectionPosition [selectionName, LODName] + getPlayerUID unit - $Code$_inModelPosition = player selectionPosition "head_hit";$/Code$ - - $Code$_inModelPosition = player selectionPosition "pelvis";$/Code$ - - $Code$_inModelPosition = player selectionPosition "head";$/Code$ - - $Code$_inModelPosition = player selectionPosition "camera";$/Code$ + $Code$_uid = getPlayerUID player ;$/Code$ global / undefined - (January 5, 2007) - To know more selections simply create an eventHandler damage on an object. - - (July 29, 2015) - Since 1.49.131660, you can use an alternative syntax: - object selectionPosition [selectionName, lodName] - lodName: "Memory", "Geometry", "FireGeometry", "LandContact", "HitPoints" - If the given selectionName is not found in the given lod, [0,0,0] is returned. - - (June 25, 2017) - Do use the filter that comes with Alt Syntax to suit your needs. For example player has 3 selections called "head" and their selectionPositions are quite different from each other: - $Code$ player selectionPosition ["head", "Memory"]; // [0.173798,0.330415,1.37783] - player selectionPosition ["head", "FireGeometry"]; // [0.14375,0.206039,1.44689] - player selectionPosition ["head", "HitPoints"]; // [0.144257,0.306769,1.53471]$/Code$ + (April 17, 2014) + In Arma 3 the returned string is the steamID64 of the player. $Code$ _steamProfileUrl = "http://steamcommunity.com/profiles/" + ( getPlayerUID player );$/Code$ - Array - Array + String + - select + onPlayerConnected - Selects an element from an array, config entry from Config or substring from a string or a range from an array. + This command will execute attached code whenever a player is connected to a MP session. The code will receive a number of special variables: + _id : Number - is the unique DirectPlay ID. Quite useless as the number is too big for in-built string representation and gets rounded. It is also the same id used for user placed markers. + _uid : String - is getPlayerUID of the joining player. In Arma 3 it is also the same as Steam ID. + _name : String - is profileName of the joining player. + _jip : ( since Arma 3 v1.49 ) Boolean - is a flag that indicates whether or not the player joined after the mission has started ( J oined I n P rogress). true - when the player is JIP, otherwise false. + _owner : ( since Arma 3 v1.49 ) Number - is owner id of the joining player. Can be used for kick or ban purposes or just for publicVariableClient. + i + Since Arma 3 v1.57 a stackable version of this EH is available: PlayerConnected + In order to keep compatibility between official and community content the functions BIS_fnc_addStackedEventHandler and BIS_fnc_removeStackedEventHandler should be used instead. - https://community.bistudio.com/wiki/select + https://community.bistudio.com/wiki/onPlayerConnected - Array select Number - - Array select Boolean - - Config select Number - - String select Array - - Array select Array - - Array select Code + onPlayerConnected String/Code - array select index - - array select boolean - - config select index - - string select [start, length] - - array select [start, count] - - array select expression + onPlayerConnected code - $Code$[1,2,3,4] select 2; //result is 3 - position player select 2; //result is Z coordinate of player position$/Code$ - - $Code$["", currentWeapon player ] select alive player ; //if dead "" is selected$/Code$ - - $Code$( configFile "cfgVehicles" typeOf vehicle player "Turrets") select 0 "gunnerAction";$/Code$ + $Code$onPlayerConnected "[_id, _name] execVM ""PlayerConnected.sqf""";$/Code$ - $Code$hint str ("japa is the man!" select [8]); //the man! - hint str ("japa is the man!" select [0,7]); //japa is$/Code$ + $Code$onPlayerConnected { diag_log [_id, _uid, _name]};$/Code$ - $Code$hint str ([1,2,3,4,5,6] select [1,4]); //[2,3,4,5]$/Code$ + $Code$// From Arma 3 v1.49: + onPlayerConnected { + somevar = random 123; + _owner publicVariableClient "somevar"; + //this will set somevar on + //joining player PC to a random value + };$/Code$ - $Code$_even = [1,2,3,4,5,6,7,8,9,0] select {_x%2 == 0}; // returns [2, 4, 6, 8, 0]$/Code$ + $Code$// From Arma 3 v1.49: + onPlayerConnected {isJip = _jip; _owner publicVariableClient "isJip"}; + //Each player will now have variable isJip containing individual JIP info$/Code$ undefined / undefined - (3 March 2009) - When combined with the count command, this can be used to read all entries out of a config; even when you don't know exactly how many entries there will be. See the notes under count for more info. - - (27 Sep, 2013) - Rounding of fractions with select is not the same as when you use round command: - $Code$_roundThis = 0.5; - hint str ([0,1] select _roundThis); //0 - hint str round _roundThis; //1$/Code$ - - (30 May, 2014) - In ArmA3 ver 1.18, Boolean type supported. Which true defaulted as 1 and false as 0. - $Code$[0,1] select (56 40) // 1 - [0,1,2] select ((! isNil "v") && false ) // 0$/Code$ - - (14 juil, 2016) - You can substract array from array using select: - $Code$_array = [[1],[2],[3]]; _sub = [2]; - _array - _sub // [[1],[2],[3]; - _array select {!(_x isEqualTo _sub)} // [[1],[3]]; - [[1],[2],[2],[2],[2],[3]] select {!(_x isEqualTo _sub)} // [[1],[3]]; - $/Code$ - - (June 22, 2015) - Usually when select tries to pick up element out of range, Arma throws "division by zero" error. However there are exceptions. Basically as long as index of element you are selecting is less then or equal to array size, you will get no error. - $Code$[] select 0; //ok, result is nil - [1,2,3] select 3; //ok, result is nil - [1,2,3] select 4; //division by zero$/Code$ - - (November 12, 2016) - It is not safe to escape the code block of alternative syntax #5 with exitWith, breakOut etc. - $Code$x3 = [1,2,3,4,5] select { - if (_x == 3) exitWith { - false; - }; - true - }; - // could be expected to be: x3 = [1,2,4,5] - // actual result: x3 = false - $/Code$ - - (February 14, 2017) - Syntax #5 is the equivalent of passing in a predicate that returns a boolean. In SQF, a piece of code will always return what the last executed command returned. - $Code$ - myAliveUnits = allunits select {alive _x;}; // alive returns a boolean, the last statement run was alive _x, therefore this piece of code will return a true/false to the select command - myEastGroups = allgroups select {side _x == EAST;}; // returns all groups that are side EAST - my4ManGroups = allgroups select { count (units _x) == 4;}; // returns all groups that have 4 men in them - UnitsThatDetectedMe = allunits select {_x knowsAbout player 0.1;}; // returns a list of units that have detected the player - $/Code$ - - (May 28, 2017) - Very simple example of how to report about the status of the player: - $Code$[ "Player is dead.", "Player is alive" ] select ( alive player )$/Code$ - returns "Player is alive" because ( alive player ) returned true. If ( alive player ) returned false, the first element (0) - would have been returned. - That is a great way of reporting about something without having to write a complicated it then else statement. + This scripting command must be executed on the server to work properly in multiplayer - Anything - Anything - Config - String - Array - Array + Nothing + - sendAUMessage + setMagazineTurretAmmo - Send the command to the list of clients. + Sets ammo count to given amount for given turret. + Broken when vehicle has multiple magazines of the same type - https://community.bistudio.com/wiki/sendAUMessage + https://community.bistudio.com/wiki/setMagazineTurretAmmo - sendAUMessage Array + Object setMagazineTurretAmmo Array - sendAUMessage [clientList, command] + vehicle setMagazineTurretAmmo [magazineClass, ammoCount, turretPath] - $Code$sendAUMessage [[dpnid1, dpnid2], "ConnectTo: 192.168.1.66"]$/Code$ - + undefined / undefined - Nothing + Number + - sendSimpleCommand + sendTask - Sends a simple command to the vehicle's driver / gunner. The player executing command should be in the vehicle. - Gunner commands - "FIRE" - "CEASE FIRE" - "MANUAL FIRE" - "CANCEL MANUAL FIRE" - "KEY FIRE" - Driver commands - "FORWARD" - move forward - "FAST" - move forward, fast - "SLOW" - move forward, slow - "STOP" - stop moving forward or backward - "BACK" - move backward - "LEFT" - turn left, while moving or not - "RIGHT" - turn right, while moving or not - "STOPTURNING" - cancel turning (special case, normally would be called by the engine when LEFT or RIGHT turn key is released by the player) ( since Arma 3 v1.77 ) - "KEY UP" - "KEY DOWN" - "KEY FAST" - "KEY SLOW" + Create a new AI task (subtask of parentTask). Type is name of registered task type. - https://community.bistudio.com/wiki/sendSimpleCommand + https://community.bistudio.com/wiki/sendTask - Object sendSimpleCommand String + Team_Member sendTask Array - vehicleName sendSimpleCommand command + sender sendTask [receiver,[type] or [type,parentTask],priority,name1,value1,name2,value2,] - $Code$vehicle player sendSimpleCommand "STOP";$/Code$ - + undefined / undefined - Valid commands include: "FORWARD", "SLOW", "FAST" "BACK", "LEFT", "RIGHT", "STOP", "FIRE", "CEASE FIRE", "MANUAL FIRE", "CANCEL MANUAL FIRE". There may be more. - Only vehicles crewed by a player can use sendSimpleCommand. - - Other commands that work: "KEY FIRE", "KEY FAST", "KEY SLOW", "KEY DOWN", "KEY UP". These will simulate key presses. - In Arma 3 player doesn't always need to be in the vehicle to give commands. - Nothing + Task + - sendTaskResult + setMarkerColor - Send a result of the task to the task sender. + Sets marker color. Marker color names and their corresponding RGBA values for Arma 3 could be found in here: CfgMarkerColors_Arma_3 - https://community.bistudio.com/wiki/sendTaskResult + https://community.bistudio.com/wiki/setMarkerColor - Task sendTaskResult Array + String setMarkerColor String - task sendTaskResult [state,result,sentence] + markerName setMarkerColor color - + $Code$"MarkerOne" setMarkerColor "ColorBlack";$/Code$ + - undefined / undefined + undefined / global - Nothing + Nothing + - sendTask + setDynamicSimulationDistanceCoef - Create a new AI task (subtask of parentTask). Type is name of registered task type. + Sets activation distance multiplier of Arma_3_Dynamic_Simulation for the given class - https://community.bistudio.com/wiki/sendTask + https://community.bistudio.com/wiki/setDynamicSimulationDistanceCoef - Team_Member sendTask Array + String setDynamicSimulationDistanceCoef Number - sender sendTask [receiver,[type] or [type,parentTask],priority,name1,value1,name2,value2,] + class setDynamicSimulationDistanceCoef multiplier - + $Code$"IsMoving" setDynamicSimulationDistanceCoef 3;$/Code$ + undefined / undefined - Task + Nothing + - sendUDPMessage + cameraView - Send message to given address using UDP protocol. Returns false if the message has not been delivered - Note: Not implemented (see talk page for more info). + Returns mode of active camera view. Mode is one of: + "INTERNAL" (1st person) + "EXTERNAL" (3rd person) + "GUNNER" (optics / sights) + "GROUP" (commander view) - https://community.bistudio.com/wiki/sendUDPMessage + https://community.bistudio.com/wiki/cameraView - sendUDPMessage Array + cameraView - sendUDPMessage [ip, port, message] + cameraView - $Code$_bool = sendUDPMessage ["192.168.0.1", 2302, "Here goes you message..."];$/Code$ + $Code$if ( cameraOn == _vehicle && cameraView == "External") then + { + _vehicle switchCamera "Internal"; + };$/Code$ undefined / undefined @@ -54505,46 +56052,28 @@ - Boolean + String + - serverCommandAvailable + ctrlSetFontH1 - Returns true if given serverCommand is available on current machine, false if not. Here is the general table of availability of Arma 3 server commands: - Available to anyone - #login, #userlist, #beclient, #vote - Available to any admin (voted in / logged in) or server host - #kick, #debug - Available to logged in admin or server host - #lock, #unlock, #maxping, #maxdesync, #maxpacketloss - Available to any admin (voted in / logged in) - #logout, #restart, #mission, #missions, #reassign, #monitor, #init - Available to logged in admin - #shutdown, #restartserver, #exec, #beserver, #monitords, #logentities, #exportjipqueue - Available to logged in admin on certain game builds - #captureframe, #enabletest, #disabletest - To check if server command could be executed in current environment use serverCommandExecutable. For more information on what each server command does, see Multiplayer Server Commands. - NOTE : When password variant of serverCommand is used on dedicated server, the table above does not apply as everything is available to it. + Sets H1 font of given HTML control. - https://community.bistudio.com/wiki/serverCommandAvailable + https://community.bistudio.com/wiki/ctrlSetFontH1 - serverCommandAvailable String + Control ctrlSetFontH1 String - serverCommandAvailable command + controlName ctrlSetFontH1 fontName - $Code$_can = serverCommandAvailable "#kick";$/Code$ - - $Code$if ( serverCommandAvailable "#logout") then - { - hint "You are a some sort of admin"; - };$/Code$ + $Code$_control ctrlSetFontH1 "TahomaB"$/Code$ undefined / undefined @@ -54552,94 +56081,106 @@ - Boolean + Nothing + - serverCommandExecutable + exitWith - Returns true if the serverCommand can be performed on the machine and in this exact environment, otherwise false. serverCommand can be executed only from User Interface Event Handlers, and this command also checks if that's the case. + Exits current scope {...} it is executed from if condition evaluates true, creates new scope {...code...} and executes the given code in it. Often used for exiting do, for, count or forEach. Simply exiting waitUntil or onEachFrame scopes with exitWith will have no effect as these scopes are called repeatedly by the engine and require different handling to terminate (see Example 3). - https://community.bistudio.com/wiki/serverCommandExecutable + https://community.bistudio.com/wiki/exitWith - serverCommandExecutable String + If_Type exitWith Code - serverCommandExecutable command + ifType exitWith code - $Code$_can = serverCommandAvailable "#kick";$/Code$ + $Code$if (_x 5) exitWith { echo "_x is too big"; _x} + // When _x is greater than 5, outputs message and terminates code in current level with value of _x.$/Code$ - $Code$// Add button to the main map to lock server, which could only be activated by admin: - with uiNamespace do { - ctrl = findDisplay 12 ctrlCreate ["RscButton", -1]; - ctrl ctrlSetPosition [0,0,0.5,0.1]; - ctrl ctrlCommit 0; - ctrl ctrlSetText "LOCK SERVER"; - ctrl ctrlAddEventHandler ["ButtonDown", + $Code$for "_j" from 1 to 10 do { - if ( serverCommandExecutable "#lock") then { - serverCommand "#lock"; - } else { - hint "You need to be logged in as admin to do this"; + player sideChat format ["%1",_j]; + if (_j==5) exitWith { player sideChat "5 is enough"}; }; - }]; - };$/Code$ + player sideChat "Complete"; + // Only the "for" loop will exit when the exitWith condition has been fulfilled (not the whole script). Execution will continue after the end of the loop (player sideChat "Complete").$/Code$ + + $Code$// Most loops will also terminate when their scope exited. To exit and terminate scopes which are called every frame such as onEachFrame and waitUntil use the following examples: + onEachFrame { + if (! alive player ) exitWith { + onEachFrame {} + } + } + _time = time + 10; + waitUntil { + if ( time _time) exitWith { + true + } + }$/Code$ undefined / undefined + (May 28, 2010) + Since ArmA2 uses Blocks in FSM as any ordinary Handle like while, for etc. in Scripts, ExitWith also only closes the Block in the FSM. + + (August 04, 2013) + The command will exit the current scope - no ifs no buts. If the current scope is a loop, it will exit the loop. If the current scope is the main body of a script, it will exit the script. For more understanding of scopes and exitWith have a look at this resource. + + (January 06, 2014) + To further explain Killzone_Kid 's above statement, exitWith does not work as described within any subsequent inner scopes of a loop - it will only simply exit the current scope. For example, this code will not exit the while loop: + $Code$ while { true } do { // 'while' scope + if ( player == ( leader player )) then { // 'if-then' scope + if ( time (5 * 60)) exitWith {}; // This will only exit the 'if-then' scope + }; + sleep 1; + }; + hint "Mission Started"; // This code will never execute$/Code$ + + (March 10, 2016) + exitWith cannot be used in event handlers with override ability to simply exit with override value. The following is incorrect: + $Code$// INCORRECT USAGE + onMapSingleClick { if (! isServer ) exitWith { true }};$/Code$ + The override value must be returned in the main scope of EH, but since it is exited with exitWith, it never happens. The correct way in this case would be: + $Code$// CORRECT USAGE + onMapSingleClick { call { if (! isServer ) exitWith { true }}};$/Code$ + exitWith will exit current call scope only and override value therefore will appear in the main scope of the EH, right where we want it. + + (October 12, 2016) + exitWith does not use standard "if-then" syntax, but a unique "if-exitWith" structure. - Boolean + Anything + - serverCommand + ctrlSetFontH5 - Executes a server command. Which command is available for execution can be found with serverCommandAvailable and whether or not it can be executed with serverCommandExecutable. - If serverCommand is executed on a client, it must be executed from UI event handler ( ctrlAddEventHandler, displayAddEventHandler ), such as onButtonDown or other User_Interface_Event_Handlers. - As of Arma 3 v1.39 serverCommand can be used on dedicated server and headless clients. This requires a password, both set in server.cfg and passed to the command itself (See Alt Syntax). + Sets H5 font of given HTML control. - https://community.bistudio.com/wiki/serverCommand + https://community.bistudio.com/wiki/ctrlSetFontH5 - serverCommand String - - String serverCommand String + Control ctrlSetFontH5 String - serverCommand command - - password serverCommand command + controlName ctrlSetFontH5 fontName - $Code$serverCommand "#logout";$/Code$ - - $Code$// Create button on the main map which will show userlist to anyone who clicks on it: - with uiNamespace do - { - ctrl = findDisplay 12 ctrlCreate ["RscButton", -1]; - ctrl ctrlSetPosition [0,0,0.5,0.1]; - ctrl ctrlSetText "USERLIST"; - ctrl ctrlCommit 0; - ctrl ctrlAddEventHandler ["ButtonDown", - { - serverCommand "#userlist"; - }]; - };$/Code$ - - $Code$serverCommand format ["#kick %1",_name];$/Code$ - - $Code$_isOK = "MyServerCommandPassword" serverCommand "#lock";$/Code$ + $Code$_control ctrlSetFontH5 "TahomaB"$/Code$ undefined / undefined @@ -54647,90 +56188,86 @@ - Boolean - Boolean + Nothing + - serverName + ctrlSetFontH4 - Returns name of the hosting server in MP, "" in SP. + Sets H4 font of given HTML control. - https://community.bistudio.com/wiki/serverName + https://community.bistudio.com/wiki/ctrlSetFontH4 - serverName + Control ctrlSetFontH4 String - serverName + controlName ctrlSetFontH4 fontName - + $Code$_control ctrlSetFontH4 "TahomaB"$/Code$ + undefined / undefined - String + Nothing + - serverTime + ctrlSetFontH3 - Server time synchronized to clients. Returns always 0 in Singleplayer. - Note that in ArmA2 1.05 Final, this command only returns the time since the Server was actually started. - NOTE: serverTime is available to both server and clients and shows the same value when synced. The only time it is not synced is on the server, right after server restart and only for the first 300 seconds. Client side serverTime is synced from the start. serverTime is also different from server time and server diag_tickTime + Sets H3 font of given HTML control. - https://community.bistudio.com/wiki/serverTime + https://community.bistudio.com/wiki/ctrlSetFontH3 - serverTime + Control ctrlSetFontH3 String - serverTime + controlName ctrlSetFontH3 fontName - $Code$hint format ["Synced server time : %1", serverTime ];$/Code$ + $Code$_control ctrlSetFontH3 "TahomaB"$/Code$ - global / undefined + undefined / undefined - (Sep 8, 2010(CEST) 19:31) - There is a bug in this command, about 3 minutes after missionstart this command returns something completely different. - See http://dev-heaven.net/issues/13581 for further infomation. - Number + Nothing + - set3DENAttribute + ctrlSetFontH2 - Set one of entity attributes. - ! - Attributes are available only within the Eden Editor workspace. You cannot access them in scenario preview or exported scenario! + Sets H2 font of given HTML control - https://community.bistudio.com/wiki/set3DENAttribute + https://community.bistudio.com/wiki/ctrlSetFontH2 - EdenEntity set3DENAttribute Array + Control ctrlSetFontH2 String - entity set3DENAttribute [class, value] + controlName ctrlSetFontH2 fontName - $Code$player set3DENAttribute ["allowDamage", false ]; - // Mark player as invincible$/Code$ + $Code$_control ctrlSetFontH2 "TahomaB"$/Code$ undefined / undefined @@ -54738,31 +56275,33 @@ - Boolean + Nothing + - set3DENAttributes + displayNull - Set entity attributes. - An attribute is identified by its property ( data when it's engine-drive attribute) value in config. For the list of all attributes with their properties, see Setting Attributes. - ! - Attributes are available only within the Eden Editor workspace. You cannot access them in scenario preview or exported scenario! + A non-existing Display. To compare non-existent displays use isNull or isEqualTo : + displayNull == displayNull ; // false + isNull displayNull ; // true + displayNull isEqualTo displayNull ; // true - https://community.bistudio.com/wiki/set3DENAttributes + https://community.bistudio.com/wiki/displayNull - set3DENAttributes Array + displayNull - set3DENAttributes [[ entities1, class1, value1 ],, [ entitiesN, classN, valueN ]] + displayNull - $Code$set3DENAttributes [[ get3DENSelected "Object","ControlMP", true ]]; - // Set all selected objects as playable$/Code$ + $Code$! isNull displayNull ; // false$/Code$ + + $Code$str displayNull ; // No display$/Code$ undefined / undefined @@ -54770,31 +56309,28 @@ - Boolean + Display + - set3DENGrid + vehicleReceiveRemoteTargets - Sets the grid increment for the given transformation type. - Transformation types: - Rotation - "r" - Translation - "t" - Scale - "s" + Gets whether the vehicle can acquire targets via datalink from the Side center. - https://community.bistudio.com/wiki/set3DENGrid + https://community.bistudio.com/wiki/vehicleReceiveRemoteTargets - set3DENGrid Array + vehicleReceiveRemoteTargets Object - set3DENGrid [type,value] + vehicleReceiveRemoteTargets vehicle - $Code$set3DENGrid ["t",100];// 100m movement increment$/Code$ + $Code$vehicleReceiveRemoteTargets ( vehicle player );$/Code$ undefined / undefined @@ -54802,28 +56338,28 @@ - Nothing + Boolean + - set3DENIconsVisible + ctrlSetFontH6 - Toggle visibility of Eden Editor icons. + Sets H6 font of given HTML control. - https://community.bistudio.com/wiki/set3DENIconsVisible + https://community.bistudio.com/wiki/ctrlSetFontH6 - set3DENIconsVisible Array + Control ctrlSetFontH6 String - set3DENIconsVisible [showMap, showScene] + controlName ctrlSetFontH6 fontName - $Code$set3DENIconsVisible [ false, false ]; - // Hide all icons$/Code$ + $Code$_control ctrlSetFontH6 "TahomaB"$/Code$ undefined / undefined @@ -54831,28 +56367,28 @@ - Nothing + Nothing + - set3DENLayer + ctrlSetFontH3B - Set layer for Eden Entity. + Sets H3 bold font of given HTML control. - https://community.bistudio.com/wiki/set3DENLayer + https://community.bistudio.com/wiki/ctrlSetFontH3B - EdenEntity set3DENLayer Number + Control ctrlSetFontH3B String - entity set3DENLayer layerID + controlName ctrlSetFontH3B fontName - $Code$_myLayer = -1 add3DENLayer "CTRG"; - player set3DENLayer _myLayer;$/Code$ + $Code$_control ctrlSetFontH3B "TahomaB"$/Code$ undefined / undefined @@ -54860,28 +56396,29 @@ - Boolean + Nothing + - set3DENLinesVisible + vectorModelToWorldVisual - Toggle visibility of Eden Editor lines. + Converts vector from model to world space in render time scope. - https://community.bistudio.com/wiki/set3DENLinesVisible + https://community.bistudio.com/wiki/vectorModelToWorldVisual - set3DENLinesVisible Array + Object vectorModelToWorldVisual Array - set3DENLinesVisible [showMap, showScene] + object vectorModelToWorldVisual modelDir - $Code$set3DENLinesVisible [ false, false ]; - // Hide all lines$/Code$ + $Code$// Convert model space vector [0,-10,4] to world space; vector gets rotated according to _airplane: + _airplane vectorModelToWorldVisual [0,-10,4];$/Code$ undefined / undefined @@ -54889,59 +56426,109 @@ - Nothing + Array + - set3DENLogicType + typeName - Sets the new type of Logic object(s). For other objects use set3DENObjectType + Returns the data type of an expression. + The type is returned as on of the following all-uppercase strings: + " ARRAY " + " BOOL " + " CODE " + " CONFIG " + " CONTROL " + " DISPLAY " + " GROUP " + " LOCATION " + " OBJECT " + " SCALAR " + " SCRIPT " + " SIDE " + " STRING " + " TEXT " + " TEAM_MEMBER " + " NAMESPACE " + They represent the available data types in ArmA. - https://community.bistudio.com/wiki/set3DENLogicType + https://community.bistudio.com/wiki/typeName - Array set3DENLogicType String + typeName Anything - objects set3DENLogicType classname + typeName anything - $Code$[ get3DENSelected "logic" select 0] set3DENLogicType "MiscOR_F";$/Code$ + $Code$_msg = "hello"; _result = typeName _msg; //_result will be "STRING"$/Code$ + + $Code$_unit = player ; _result = typeName _unit; //_result becomes "OBJECT"$/Code$ + + $Code$// Values representing direct Data Types : + hint typeName 0; //SCALAR + hint typeName ""; //STRING + hint typeName true ; //BOOL + hint typeName []; //ARRAY + hint typeName {}; //CODE + hint typeName objNull ; //OBJECT + hint typeName grpNull ; //GROUP + hint typeName controlNull ; //CONTROL + hint typeName teamMemberNull ; //TEAM_MEMBER + hint typeName displayNull ; //DISPLAY + hint typeName taskNull ; //TASK + hint typeName locationNull ; //LOCATION + hint typeName sideUnknown ; //SIDE + hint typeName text ""; //TEXT + hint typeName configFile ; //CONFIG + hint typeName configNull ; //CONFIG (Since Arma 3 v1.53.133130) + hint typeName missionNamespace ; //NAMESPACE$/Code$ + + $Code$if ( typeName _this != "ARRAY") exitWith { + hint "_this is not an array!" + } + //is the same as + if ( typeName _this != typeName []) exitWith { + hint "_this is not an array!" + } + //is the same as + if !(_this isEqualType []) exitWith { + hint "_this is not an array!"$/Code$ undefined / undefined + (September 25, 2016) + typeName of nil is ANY, however this is not possible to test as script command is just ignored when any argument is nil - Nothing + String + - set3DENMissionAttribute + dynamicSimulationSystemEnabled - Set scenario attribute. - An attribute is identified by its property ( data when it's engine-drive attribute) value in config. For the list of all attributes with their properties, see Setting Attributes. - ! - Attributes are available only within the Eden Editor workspace. You cannot access them in scenario preview or exported scenario! + A getter for enableDynamicSimulationSystem - https://community.bistudio.com/wiki/set3DENMissionAttribute + https://community.bistudio.com/wiki/dynamicSimulationSystemEnabled - String set3DENMissionAttribute Array + dynamicSimulationSystemEnabled - section set3DENMissionAttribute [ class, value ] + dynamicSimulationSystemEnabled - $Code$"Multiplayer" set3DENMissionAttribute ["respawn",3]; - // Set respawn type to 3$/Code$ + $Code$hint str dynamicSimulationSystemEnabled ;$/Code$ undefined / undefined @@ -54949,31 +56536,28 @@ - Boolean + Boolean + - set3DENMissionAttributes + allAirports - Set scenario attributes. - An attribute is identified by its property ( data when it's engine-drive attribute) value in config. For the list of all attributes with their properties, see Setting Attributes. - ! - Attributes are available only within the Eden Editor workspace. You cannot access them in scenario preview or exported scenario! + Returns all map airports, both static and dynamic - https://community.bistudio.com/wiki/set3DENMissionAttributes + https://community.bistudio.com/wiki/allAirports - set3DENMissionAttributes Array + allAirports - set3DENMissionAttributes [[ section, class1, value1 ],, [ section, classN, valueN ]] + allAirports - $Code$set3DENMissionAttributes [["Multiplayer","respawn",3],["Multiplayer","respawnDelay",10]]; - // Set respawn type to 3 and respawn delay to 10 seconds$/Code$ + $Code$_allAirports = allAirports ;$/Code$ undefined / undefined @@ -54981,631 +56565,651 @@ - Boolean + Array + - set3DENModelsVisible + missionNamespace - Enables or disables lines visibility in 3DEN + Returns the global namespace attached to mission. - https://community.bistudio.com/wiki/set3DENModelsVisible + https://community.bistudio.com/wiki/missionNamespace - set3DENModelsVisible Array + missionNamespace - set3DENModelsVisible [map, scene] + missionNamespace - + $Code$missionNamespace setVariable ["YourString",3];//Same as: YourString = 3; + _yourString = missionNamespace getVariable "YourString";$/Code$ + undefined / undefined - Nothing + Namespace + - set3DENObjectType + roadAt - Sets the classname of one or more given Eden Editor objects. For Logic objects use set3DENLogicType + Returns road segment at given position, objNull otherwise. Same as isOnRoad only returns the actual road object instead of boolean. - https://community.bistudio.com/wiki/set3DENObjectType + https://community.bistudio.com/wiki/roadAt - Array set3DENObjectType String + roadAt Object/Array - objects set3DENObjectType classname + roadAt position - $Code$[ get3DENMouseOver select 1] set3DENObjectType "B_crew_F"; - // turns object under cursor into a blufor crewman$/Code$ + $Code$_road = roadAt ASLToAGL getPosASL player ;$/Code$ + + $Code$_isOnRoad = ! isNull roadAt player ;$/Code$ - undefined / undefined + global / undefined + (December 30, 2016) + This command does not nessecarly return the segment which center is the closest to the given position. + In order to get such segment use nearRoads. + $Code$_closest_road = (_pos nearRoads 0.1) select 0;$/Code$ - Nothing + Object + - set3DENSelected + getMagazineCargo - Changes selection in 3den to what is inside entities array. + Returns all magazines types and count from the cargo space - https://community.bistudio.com/wiki/set3DENSelected + https://community.bistudio.com/wiki/getMagazineCargo - set3DENSelected Array + getMagazineCargo Object - set3DENSelected entities + getMagazineCargo object - + $Code$_content = getMagazineCargo carName;$/Code$ + + $Code$_content = getMagazineCargo ammoBoxName;$/Code$ + + $Code$hint str getMagazineCargo unitBackpack cursorTarget ;$/Code$ + - undefined / undefined + global / undefined - Nothing + Array + - setAccTime + ctrlSetFontH6B - Set time acceleration coefficient. May be also used to slow time in cutscenes. This command does NOT work in multiplayer. accFactor is clamped to [1/128; 4]. + Sets H6 bold font of given HTML control. - https://community.bistudio.com/wiki/setAccTime + https://community.bistudio.com/wiki/ctrlSetFontH6B - setAccTime Number + Control ctrlSetFontH6B String - setAccTime accFactor + controlName ctrlSetFontH6B fontName - $Code$setAccTime 0.1$/Code$ + $Code$_control ctrlSetFontH6B "TahomaB"$/Code$ undefined / undefined - (August 4, 2006) - Notes from before the conversion: - A good habit to get into is setting the accTime to 1 at the start of all cutscenes, in case the player is running at 4x speed when the scene starts. - Nothing + Nothing + - setAirplaneThrottle + formLeader - Sets a wanted throttle position, works only on player's vehicle. + Returns the formation leader of a given unit. This is often the same as the group leader, but not always, for example in cases when a unit is ordered to follow another unit. - https://community.bistudio.com/wiki/setAirplaneThrottle + https://community.bistudio.com/wiki/formLeader - Object setAirplaneThrottle Number + formLeader Object - airplane setAirplaneThrottle value + formLeader unitName - + $Code$? (formLeader player != leader player) : + hint "The formation leader is different to the group leader!" + returns X$/Code$ + - undefined / undefined + global / undefined - Nothing + Object + - setAirportSide + sendSimpleCommand - Set owning side of the airport. ID is the number to identify which airport on the island you want to check. + Sends a simple command to the vehicle's driver / gunner. The player executing command should be in the vehicle. + Gunner commands + "FIRE" + "CEASE FIRE" + "MANUAL FIRE" + "CANCEL MANUAL FIRE" + "KEY FIRE" + Driver commands + "FORWARD" - move forward + "FAST" - move forward, fast + "SLOW" - move forward, slow + "STOP" - stop moving forward or backward + "BACK" - move backward + "LEFT" - turn left, while moving or not + "RIGHT" - turn right, while moving or not + "STOPTURNING" - cancel turning (special case, normally would be called by the engine when LEFT or RIGHT turn key is released by the player) ( since Arma 3 v1.77 ) + "KEY UP" + "KEY DOWN" + "KEY FAST" + "KEY SLOW" - https://community.bistudio.com/wiki/setAirportSide + https://community.bistudio.com/wiki/sendSimpleCommand - Number setAirportSide Side - - Object setAirportSide Side + Object sendSimpleCommand String - id setAirportSide side - - target setAirportSide side + vehicleName sendSimpleCommand command - $Code$0 setAirportSide east$/Code$ + $Code$vehicle player sendSimpleCommand "STOP";$/Code$ undefined / undefined + Valid commands include: "FORWARD", "SLOW", "FAST" "BACK", "LEFT", "RIGHT", "STOP", "FIRE", "CEASE FIRE", "MANUAL FIRE", "CANCEL MANUAL FIRE". There may be more. + Only vehicles crewed by a player can use sendSimpleCommand. + + Other commands that work: "KEY FIRE", "KEY FAST", "KEY SLOW", "KEY DOWN", "KEY UP". These will simulate key presses. + In Arma 3 player doesn't always need to be in the vehicle to give commands. - Nothing - Nothing + Nothing + - setAmmoCargo + addCuratorCameraArea - Set amount of ammo resources in cargo space of a rearm vehicle. Ammo resource is used to resupply vehicles that take ammo. Soldiers use individual magazines instead. Amount: 1 is full cargo. - The actual quantity to work with is determined by the model's class in CfgVehicles + Adds or changes curator camera area (depends on if ID is already used). - https://community.bistudio.com/wiki/setAmmoCargo + https://community.bistudio.com/wiki/addCuratorCameraArea - Object setAmmoCargo Number + Object addCuratorCameraArea Array - vehicleName setAmmoCargo ammoCargo + curatorObj addCuratorCameraArea [cameraAreaID,position,radius] - $Code$_ammoTruck1 setAmmoCargo 0.5;$/Code$ + $Code$myCurator addCuratorCameraArea [3, position mySoldier,300];$/Code$ - local / global + undefined / undefined - (31 Aug, 2011) - While the amount of total 'ammo' that can be reloaded is defined in the truck/supply point's CfgVehicles entry, the amount each round of ammunition takes from that total is defined in the CfgAmmo 'Cost' entry for that round. - Your typical truck has 300000 ammo capacity, and the tunguska's missiles have a Cost of 50000. So the tunguska can reload a total of 6 missiles from the ammo truck before the ammo capacity is depleted and needs to be set with setAmmoCargo. - A similar thing applies with a vehicle's cfgVehicle Cost entry for repairing, and the vehicle's fuelCapacity entry when refuelling. - - (July 10, 2015) - (ArmA 3 1.44) setAmmoCargo will have no effect if the vehicle doesn't support getAmmoCargo. - Nothing + Nothing + - setAmmoOnPylon + isFilePatchingEnabled - Set count of ammo in magazine on pylon + Returns true if file patching is enabled otherwise false - https://community.bistudio.com/wiki/setAmmoOnPylon + https://community.bistudio.com/wiki/isFilePatchingEnabled - Object setAmmoOnPylon Array + isFilePatchingEnabled - vehicle setAmmoOnPylon [pylon nameindex, ammo count] + isFilePatchingEnabled - $Code$( vehicle player ) setAmmoOnPylon [1, 12];$/Code$ - + undefined / undefined - (August 18, 2017) - The pylon indices start at 1 and not at 0. - Nothing + Boolean + - setAmmo + isEngineOn - Sets custom ammo count in the currently loaded magazine of the specified weapon. The unit must be local to the computer where command is executed. + Returns true if engine is on, false if it is off. - https://community.bistudio.com/wiki/setAmmo + https://community.bistudio.com/wiki/isEngineOn - Object setAmmo Array + isEngineOn Object - unit setAmmo [weapon, count] + isEngineOn vehicle - $Code$// Set player's handgun magazine ammo count to 10 rounds: - player setAmmo [ handgunWeapon player, 10];$/Code$ - - $Code$// Set player's current weapon magazine ammo count to 1 round: - player setAmmo [ currentWeapon player, 1];$/Code$ - - $Code$// If player is a gunner in a vehicle, set current weapon magazine ammo count to 5 rounds: - if ( local vehicle player ) then { - vehicle player setAmmo [ currentWeapon vehicle player, 5]; - } else { - hint "Vehicle must be local to this machine for 'setAmmo' to work"; - };$/Code$ - - $Code$// If you try to set more ammo than the magazine can hold, it will be clipped at default magazine capacity: - player setAmmo [ primaryWeapon player, 1000000]; //full mag with default ammo count$/Code$ + $Code$_carEngineIsOn = isEngineOn _carOne;$/Code$ - local / global + global / undefined + (March 20, 2015) + isEngineOn returns true for static objects without an engine + + (April 6, 2015) + Bind Engine action to User Action 1 + $Code$this addAction ["", + { + _this select 1 action + [ + ["EngineOn", "EngineOff"] select isEngineOn (_this select 0), + _this select 0 + ]; + }, "", -10, false, true, "User1", "_this == driver _target"];$/Code$ - Nothing + Boolean + - setAnimAimPrecision + screenToWorld - Set aimPrecision value of the current animation state (parameter aimPrecision) + Returns the position on landscape ( PositionAGL ) corresponding to the given point on screen (in UI coordinates). - https://community.bistudio.com/wiki/setAnimAimPrecision + https://community.bistudio.com/wiki/screenToWorld - Object setAnimAimPrecision Number + screenToWorld Array - unit setAnimAimPrecision value + screenToWorld screen - $Code$player setAnimAimPrecision 1$/Code$ + $Code$_wPos = screenToWorld [0.5,0.5];$/Code$ - global / global + undefined / undefined - Nothing + Array + - setAnimSpeedCoef + setFaceAnimation - Sets a coefficient for animation speed + Set facial animation phase (eye blinking), blink is in the range from 0 to 1. - https://community.bistudio.com/wiki/setAnimSpeedCoef + https://community.bistudio.com/wiki/setFaceAnimation - Object setAnimSpeedCoef Number + Object setFaceAnimation Number - unit setAnimSpeedCoef coef + person setFaceAnimation blink - $Code$player setAnimSpeedCoef 0.75;$/Code$ + $Code$_soldier1 setFaceAnimation 0.5;$/Code$ undefined / undefined - (November 14, 2016) - Increasing animation speed of a unit also increases its run/walk speed (thanks to Killzone Kid ) - - (November 27, 2016) - Setting negative values with this makes animations act in reverse or make you stuck sliding in unknown directions. + (09:01, 23 December 2008 (CET)) + Setting face animation to 4 will give "devilish" features (ArmA) - Nothing + Nothing + - setApertureNew + removeBackpack - Sets custom camera aperture ([-1] to do it automatically). + Removes unit's backpack - https://community.bistudio.com/wiki/setApertureNew + https://community.bistudio.com/wiki/removeBackpack - setApertureNew Array + removeBackpack Object - setApertureNew [min, std, max, stdLum] + removeBackpack unit - $Code$setApertureNew [0.3, 0.2, 0.1, 1];$/Code$ - - $Code$// Simulate eye adjustment at night: - setDate [2016, 8, 10, 4, 0]; - setApertureNew [2, 8, 14,.9];$/Code$ + $Code$removeBackpack this ;$/Code$ - $Code$// Narrower range for a subtler effect: - setDate [2016, 8, 10, 4, 0]; - setApertureNew [2, 5, 9,.8];$/Code$ + $Code$removeBackpack mySoldierDude;$/Code$ - undefined / undefined + local / global - (October 30, 2016) - Some notes on example 2 - try it outdoors on a piece of ground with high contrasting areas. I suggest the end of a runway, standing among the white painted triangles. - Look up about 60 degrees above the horizon and toggle between setApertureNew [2, 8, 14,.9]; and the default setting of setAperture -1;. There should be little change -- at least on the date in the example. - Reset again to setApertureNew [2, 8, 14,.9]; and then pan slowly down until you're basically looking at your feet. The less sky (the main outdoor light source) you see, the 'wider' (toward the 'min' number) the aperture will become. Looking at the ground on a runway, for example, you should be able to easily distinguish the painted white triangles from the unpainted pavement. Again, toggle back to the default aperture. The view should get much darker. - This setting allows for some natural adjustment based on the amount of visible light in the scene, and is highly encouraged over the default fixed aperature for night missions. When you're standing in the beam of a lighthouse, for example (try near the 'Spartan' on Stratis), you will be basically unable to see anything not illuminated by the beam. Once the beam passes and your vision returns to normal, your immediate surroundings will be dimmer, of course, but you'll be able to see further out. - Nothing + Nothing + - setAperture + shownScoretable - Sets custom camera aperture (-1 to do it automatically). + Returns the state of the score table set with showScoretable command. + Since Arma 3 v1.63.137869, the previous functionality of this command (score table visibility check) is moved to visibleScoretable command. Please update your scripts and sorry for any inconvinience. - https://community.bistudio.com/wiki/setAperture + https://community.bistudio.com/wiki/shownScoretable - setAperture Number + shownScoretable - setAperture aperture + shownScoretable - $Code$setAperture 0.3;$/Code$ + $Code$_state = shownScoretable ;$/Code$ undefined / undefined - The aperture value to simulate typical daylight (outdoor) conditions is 50. The aperture value to simulate typical daylight (indoor) conditions is 30. Setting the value to less than 20 will result in a very bright scene, suitable for night conditions. The closer the number is to 0, the more light will be let into the lens, to carry on the aperture metaphor. Different lighting/weather conditions can change the actual indoor and outdoor aperture values. Experiment and test to be sure. - Nothing + Number + - setArmoryPoints + nearestLocationWithDubbing - Stores passed number into [USERNAME].ArmaXProfile file, where it assigns it as a value to armoryPoints entry. If entry doesn't exist, it is created. + Find the nearest location (to the given position) having it speech non-empty. - https://community.bistudio.com/wiki/setArmoryPoints + https://community.bistudio.com/wiki/nearestLocationWithDubbing - setArmoryPoints Number + nearestLocationWithDubbing Object/Array - setArmoryPoints points + nearestLocationWithDubbing position - $Code$setArmoryPoints ( armoryPoints + 20);$/Code$ - - $Code$setArmoryPoints 3.14;$/Code$ - + undefined / undefined - Nothing + Location + - setAttributes + assignedTeam - Returns a structured text created by the given structured or plain text by setting attributes to the given values. + Returns the team the unit belongs to. Possible values: + MAIN (default and white) + RED + GREEN + BLUE + YELLOW + This command will return nil if given unit is objNull, remoteControling another unit or is not local - https://community.bistudio.com/wiki/setAttributes + https://community.bistudio.com/wiki/assignedTeam - String/Structured_Text setAttributes Array + assignedTeam Object - text setAttributes [name1, value1, name2, value2,] + assignedTeam unitName - $Code$txt = img setAttributes ["image", "data\iSoldier.paa"]$/Code$ + $Code$_team = assignedTeam player ;$/Code$ - undefined / undefined + local / undefined - (November 9, 2014) - This command doesn't seem to work in Arma 3. + (December 13, 2014) + As of Arma 3 version 1.36. assignedTeam might return nil instead of any of the STRINGs above if the player is currently remote controlling a unit. + $Code$ assignedTeam player + - $/Code$ + + (May 23, 2017) + Executed on server also nothing is returned... so arguments need to be local. - Structured_Text + String/Nothing + - setAutonomous + dissolveTeam - Sets UAV autonomous mode. + Dissolves the given team. All members become members of the main team. Possible team values are: "RED", "GREEN", "BLUE" or "YELLOW". - https://community.bistudio.com/wiki/setAutonomous + https://community.bistudio.com/wiki/dissolveTeam - Object setAutonomous Boolean + dissolveTeam String - uav setAutonomous bool + dissolveTeam teamColor - $Code$uav setAutonomous true ;$/Code$ + $Code$dissolveTeam "RED"$/Code$ - undefined / undefined + local / undefined - Nothing + Nothing + - setBehaviour + forceWeatherChange - Sets group behaviour mode. If a unit is given as argument, behaviour is set for the unit's group. Behaviour is one of: - "CARELESS" - "SAFE" - "AWARE" - "COMBAT" - "STEALTH". - See this page for details of the effect of this command on AI units. For Arma 3 see Arma_3_AI_Behavior + Forces saved wanted settings for weather to be actual (BEWARE: Will cause lag). + NOTE The engine has own idea about the weather and will interfere with your scripted weather at every opportunity it gets. So don't give it the opportunity. In the editor's Intel there are Manual Override setting for many aspects of the weather. Select them to disable engine interference. Some commands such as setWaves and setLightnings will not even work until their respective settings are set to manual. - https://community.bistudio.com/wiki/setBehaviour + https://community.bistudio.com/wiki/forceWeatherChange - Group setBehaviour String + forceWeatherChange - groupName setBehaviour behaviour + forceWeatherChange - $Code$_group1 setBehaviour "SAFE";$/Code$ + $Code$240 setOvercast 1; + 360 setRain 1; + forceWeatherChange ; comment "force immediate change overriding smooth transition";$/Code$ - local / global + undefined / undefined - Warning! Since ArmA v.1.14 the command setBehaviour "COMBAT" do not work correctly any loger. - Units ( Groups ) which are using this behaviour and then get a move order, will not move to the given position. - - Although setBehaviour can be called on an individual unit, the entire group will be affected. - - If setting a behaviour on an individual unit is required, it can be achieved by creating a temporary group, use joinSilent to make the individual unit belong to that group, then change his behaviour, use joinSilent into the original group, then delete the temporary group. + This scripting command must be executed on the server to work properly in multiplayer - Nothing + Nothing + - setBleedingRemaining + ctSetCurSel - Sets for how many seconds injured unit leaves blood trail. The unit damage must be = 0.1 for this command to have an effect, otherwise, the getBleedingRemaining will return 0 and no blood trail is left behind. + Selects the line with the given index. Will take only rows, but not headers into account. -1 deselects all. Returns Nothing. - https://community.bistudio.com/wiki/setBleedingRemaining + https://community.bistudio.com/wiki/ctSetCurSel - Object setBleedingRemaining Number + Control ctSetCurSel Number - unit setBleedingRemaining time + Control ctSetCurSel Number - $Code$_unit setBleedingRemaining 60;$/Code$ - - $Code$player setDamage 0.25; - player setBleedingRemaining 120;$/Code$ + $Code$_control ctSetCurSel 0;$/Code$ - undefined / undefined + local / local - Nothing + Nothing + - setCamShakeDefParams + getMousePosition - Sets camera shake default params, the default camshake when, for example, you freelook at your character shooting a 12.7mm sniper rifle or firing tank cannon. Would also work in 1st person. + Returns mouse position in UI coordinates. - https://community.bistudio.com/wiki/setCamShakeDefParams + https://community.bistudio.com/wiki/getMousePosition - setCamShakeDefParams Array + getMousePosition - setCamShakeDefParams [power, duration, frequency, minSpeed, minMass, caliberCoefHit, vehicleCoef] + getMousePosition - $Code$setCamShakeDefParams [1, 2, 3, 4, 5,.5,.5];$/Code$ - - $Code$setCamShakeDefParams [100, 10, 10, 4, 5, 1, 1];$/Code$ + $Code$_pos = getMousePosition ;$/Code$ undefined / undefined - (December 1, 2014) - Doesn't appear to have any effect in ArmA 3. - Nothing + Array + - setCamShakeParams + setMusicEventHandler - Set camera shake parameters. - Will not have any effect until shake is started via addCamShake. + Sets given music track event handler. Will overwrite other music event handlers. Use addMusicEventHandler if you want to stack them. - https://community.bistudio.com/wiki/setCamShakeParams + https://community.bistudio.com/wiki/setMusicEventHandler - setCamShakeParams Array + setMusicEventHandler Array - setCamShakeParams [posCoef, vertCoef, horzCoef, bankCoef, interpolation] + setMusicEventHandler [type, function] - $Code$setCamShakeParams [0.1, 1, 1, 1, true];$/Code$ + $Code$_ehID = setMusicEventHandler ["MusicStart", " hint str _this"];$/Code$ + + $Code$_ehID = setMusicEventHandler ["MusicStop", " hint str _this"];$/Code$ undefined / undefined @@ -55613,250 +57217,227 @@ - Nothing + Number + - setCamUseTI + allowDamage - Activates thermal vision. Mode index defines what sort of thermal vision it is: - 0 - White Hot - 1 - Black Hot - 2 - Light Green Hot / Darker Green cold - 3 - Black Hot / Darker Green cold - 4 - Light Red Hot /Darker Red Cold - 5 - Black Hot / Darker Red Cold - 6 - White Hot. Darker Red Cold - 7 - Thermal (Shade of Red and Green, Bodies are white) - This command only works with camCreate created camera that is currently the main camera for the player (see example). + Allow or prevent an object being damaged (or injured, or killed). The command does not prevent object from taking scripted damage such as setHit, setHitIndex, setHitPointDamage or setDamage. To check if damage is allowed at current locality, see isDamageAllowed. + ! + This command has to be executed where object is local and as long as object does not change locality the effect of this command will be global. If object changes locality, the command needs to be executed again on the new owner 's machine to maintain the effect - https://community.bistudio.com/wiki/setCamUseTI + https://community.bistudio.com/wiki/allowDamage - Boolean setCamUseTI Number + Object allowDamage Boolean - Bool setCamUseTI modeIndex + object allowDamage allow - $Code$true setCamUseTI 1;$/Code$ - - $Code$// "Preditor" vision: - _cam = "camera" camCreate [0,0,0]; - _cam camSetTarget player ; - _cam camSetRelPos [0,1,1.5]; - _cam cameraEffect ["Internal","Back"]; - _cam camCommit 0; - true setCamUseTI 7;$/Code$ + $Code$player allowDamage false ;$/Code$ - undefined / undefined + local / global + (September 2, 2013) + $Code$_object allowDamage false$/Code$ + has the same effect as + $Code$_object addEventHandler ["HandleDamage", {0}]$/Code$ + (except for buildings that are native to the map; for those, the effects of HandleDamage will not sync properly across all clients, even if added to the building on every client and the server) - Nothing + Nothing + - setCameraInterest + diarySubjectExists - Set camera interest for given entity. Camera interest is by default 0. Any unit which is speaking has its camera interest raised to 50. Camera interest is used to focus camera to control depth of field in cutscenes. Combination of camera interest, unit position of the screen, unit movement, unit type, and some other properties is used to determine which unit to focus at. Higher camera interest increases the chance of the unit being focused. + Checks whether given subject is present in the diary of given person. - https://community.bistudio.com/wiki/setCameraInterest + https://community.bistudio.com/wiki/diarySubjectExists - Object setCameraInterest Number + Object diarySubjectExists String - entity setCameraInterest interest + person diarySubjectExists name - $Code$_soldier setCameraInterest 50;$/Code$ - + undefined / undefined - Nothing + Boolean + - setCaptive + getHitIndex - Mark a unit as captive. If unit is a vehicle, commander is marked. A captive is neutral to everyone (belong to civilian side ), and will not trigger "detected by" conditions for its original side. - Using a number (instead of a boolean) for the status has no further effect on the engine's behavior, but can be used by captiveNum to keep track of the captivity status at a finer resolution (e.g. handcuffed, grouped, etc.). The numbered status syntax was introduced in Arma 2. + Return current level of damage for a specific Hit Point (specified by its hit part index). All hit points can be obtained with getAllHitPointsDamage command. + 0: no damage + 1: full damage - https://community.bistudio.com/wiki/setCaptive + https://community.bistudio.com/wiki/getHitIndex - Object setCaptive Boolean - - Object setCaptive Number + Object getHitIndex Number - unitName setCaptive status - - unitName setCaptive status + vehicle getHitIndex hitPartIndex - $Code$_soldier1 setCaptive true ;$/Code$ - - $Code$_soldier1 setCaptive 1;$/Code$ + $Code$vehicle player getHitIndex 3;$/Code$ - local / global + global / undefined - (August 4, 2006) - This function does not remove unit's weapons. - If you make a unit captive, that unit will still fire on the enemy, but the enemy will not fire back. - - (January 1, 2011) - If you change a unit from captive to no longer captive (for example, to "reveal" an undercover unit), enemy units that already have prior knowledge of the unit as a captive will only partially engage, making it very easy for the undercover unit. This seems to be a bug. - However other enemy unit the unit later encounters will engage freely with full force. - Nothing - Nothing + Number/Nothing + - setCenterOfMass + hostMission - Changes the center of mass of an object smoothly during the given time (in seconds). A time of zero (or using the alternative syntax) means an immediate change. + Host the mp mission described by config class. Should be called as reaction to some UI action in some dialog. + For example you can start a MP scenario from a button. It creates a host and takes you to the lobby with the scenario loaded. + You need to provide the display which is active when the hostMission command is called. - https://community.bistudio.com/wiki/setCenterOfMass + https://community.bistudio.com/wiki/hostMission - Object setCenterOfMass Array + hostMission Array - myObject setCenterOfMass [com, time] - - myObject setCenterOfMass com + hostMission [pConfig, pDisplay] - $Code$myObject setCenterOfMass [[0,-1,0],0.5];$/Code$ + $Code$hostMission [configMissionName, display];$/Code$ - $Code$myObject setCenterOfMass [0,-1,0];$/Code$ + $Code$hostMission [ configFile /"CfgMissions"/"MPMissions"/_scenarioClassName, _currentlyActiveDisplay];$/Code$ + + $Code$// Launch host mission dialog in Arma 3 from a client on dedicated server + hostMission [ + configFile "CfgMissions" "MPmissions" "MP_COOP_m01", + findDisplay 46 + ];$/Code$ - local / global + undefined / undefined - (20 Jun, 2014) - (ArmA3 1.22) A quick reference: - category - setMass - setCenterOfMass - unit - The larger the mass is, the easier a unit will physically fatigued - N/A - aircraft - The larger the mass is, the more sensitive an aircraft will react to joystick, vice versa. - Aircraft slant due to center change accordingly, and the position of the camera view will be altered relatively at the same time. (3rd person view) - vehicle - The larger the mass is, the slower a vehicle drives (Ships will sink), vice versa. (Land vehicle performs like a bouncing ball while ships accelerated pretty speedy.) - Vehicle slant due to center change accordingly. + (January 03, 2011) + The command must be called in the main menu or something similar menu it seems. - Nothing + Nothing + - setCollisionLight + isCopilotEnabled - Switches collision lights of a vehicle on/off. Note that the vehicle has to be local, for global variant use Arma 3 Actions "CollisionLightOn"/"CollisionLightOff" + Returns true if copilots actions are enabled. - https://community.bistudio.com/wiki/setCollisionLight + https://community.bistudio.com/wiki/isCopilotEnabled - Object setCollisionLight Boolean + isCopilotEnabled Object - vehicle setCollisionLight set + isCopilotEnabled vehicle - $Code$heli setCollisionLight true ;$/Code$ + $Code$if (! isCopilotEnabled myHeli) then { + myHeli enableCopilot true ; + };$/Code$ - local / global + global / undefined + (February 17, 2014) + Only returns whether or not the actions are enabled and shown to the pilot and co-pilot. This will still return TRUE if the pilot uses the 'Lock Controls' action to disable co-pilot controls. + You can use the Arma 3 Event Handler - Controls Shifted to detect 'Take Controls' or 'Release Controls' actions - Nothing + Boolean + - setCombatMode + rain - Set group combat mode (engagement rules). - Mode may be one of: - " BLUE " (Never fire) - " GREEN " (Hold fire - defend only) - " WHITE " (Hold fire, engage at will) - " YELLOW " (Fire at will) - " RED " (Fire at will, engage at will) + Returns the current value of rain density in range 1...0 - https://community.bistudio.com/wiki/setCombatMode + https://community.bistudio.com/wiki/rain - Object/Group setCombatMode String + rain - groupName setCombatMode mode + rain - $Code$_group1 setCombatMode "BLUE"$/Code$ + $Code$_rainLevel = rain ;$/Code$ - local / global + undefined / undefined - Nothing + Number + - setCompassOscillation + magazinesDetailVest - Sets compass oscillation. + Returns an array with the type names of all the unit's vest magazines. - https://community.bistudio.com/wiki/setCompassOscillation + https://community.bistudio.com/wiki/magazinesDetailVest - setCompassOscillation Array + magazinesDetailVest Object - setCompassOscillation [angle, frequencyMin, frequencyMax] + magazinesDetailVest unit - $Code$setCompassOscillation [1, 1, 1];$/Code$ + $Code$magazinesDetailVest player$/Code$ undefined / undefined @@ -55864,30 +57445,47 @@ - Nothing + Array + - setConvoySeparation + serverCommandAvailable - Sets the distance to keep to the vehicle which is in front. - This command has to be applied to all vehicles in a convoy in order to have a separation of, for example, 50 m. - Vehicles in a convoy can also have different distances. - It's recommended that small values ( 10m) should only be used for slowly moving convoys, otherwise AI driven vehicles will leave the road frequently to avoid collisions + Returns true if given serverCommand is available on current machine, false if not. Here is the general table of availability of Arma 3 server commands: + Available to anyone + #login, #userlist, #beclient, #vote + Available to any admin (voted in / logged in) or server host + #kick, #debug + Available to logged in admin or server host + #lock, #unlock, #maxping, #maxdesync, #maxpacketloss + Available to any admin (voted in / logged in) + #logout, #restart, #mission, #missions, #reassign, #monitor, #init + Available to logged in admin + #shutdown, #restartserver, #exec, #beserver, #monitords, #logentities, #exportjipqueue + Available to logged in admin on certain game builds + #captureframe, #enabletest, #disabletest + To check if server command could be executed in current environment use serverCommandExecutable. For more information on what each server command does, see Multiplayer Server Commands. + NOTE : When password variant of serverCommand is used on dedicated server, the table above does not apply as everything is available to it. - https://community.bistudio.com/wiki/setConvoySeparation + https://community.bistudio.com/wiki/serverCommandAvailable - Object setConvoySeparation Number + serverCommandAvailable String - vehicle setConvoySeparation distance + serverCommandAvailable command - $Code$vehicle setConvoySeparation 20;$/Code$ + $Code$_can = serverCommandAvailable "#kick";$/Code$ + + $Code$if ( serverCommandAvailable "#logout") then + { + hint "You are a some sort of admin"; + };$/Code$ undefined / undefined @@ -55895,296 +57493,282 @@ - Nothing + Boolean + - setCuratorCameraAreaCeiling + ctrlSetFontH5B - Sets maximal height to which curator camera can move. + Sets H5 bold font of given HTML control. - https://community.bistudio.com/wiki/setCuratorCameraAreaCeiling + https://community.bistudio.com/wiki/ctrlSetFontH5B - Object setCuratorCameraAreaCeiling Number + Control ctrlSetFontH5B String - curatorObj setCuratorCameraAreaCeiling height + controlName ctrlSetFontH5B fontName - $Code$myCurator setCuratorCameraAreaCeiling 50;$/Code$ + $Code$_control ctrlSetFontH5B "TahomaB"$/Code$ undefined / undefined - This scripting command must be executed on the server to work properly in multiplayer - Nothing + Nothing + - setCuratorCoef + sizeOf - Sets coef for some action (coef have to be bigger than -1 000 000, anything lower is considered as disabled action). + Returns the diameter of bounding sphere of the object of given type in meters. Size returned is usually bigger than the biggest size of the object along any of the axes. For example if object is 10 x 4 x 5 the sizeOf value returned expected to be around 10. If you need to estimate the size of the object more precisely, use boundingBox or boundingBoxReal. + NOTE: The object has to be present in current mission to be able to read its size (otherwise zero will be returned). - https://community.bistudio.com/wiki/setCuratorCoef + https://community.bistudio.com/wiki/sizeOf - Object setCuratorCoef Array + sizeOf String - curatorObj setCuratorCoef [action,coef] + sizeOf type - $Code$curatorModule setCuratorCoef ["Place", 1]$/Code$ - - $Code$curatorModule setCuratorCoef ["Delete", -1e10]$/Code$ + $Code$_dimension = sizeOf "M1Abrams"; //returns 10.7833$/Code$ undefined / undefined - This scripting command must be executed on the server to work properly in multiplayer - - (March 25, 2015) - Possible actions are: - place - edit - delete - destroy - group - synchronize - Nothing + Number + - setCuratorEditingAreaType + serverTime - Set whether curator can edit in all editing areas (true) or outside of them (false). + Server time synchronized to clients. Returns always 0 in Singleplayer. + Note that in ArmA2 1.05 Final, this command only returns the time since the Server was actually started. + NOTE: serverTime is available to both server and clients and shows the same value when synced. The only time it is not synced is on the server, right after server restart and only for the first 300 seconds. Client side serverTime is synced from the start. serverTime is also different from server time and server diag_tickTime - https://community.bistudio.com/wiki/setCuratorEditingAreaType + https://community.bistudio.com/wiki/serverTime - Object setCuratorEditingAreaType Boolean + serverTime - curatorObj setCuratorEditingAreaType bool + serverTime - $Code$curatorModule setCuratorEditingAreaType true$/Code$ + $Code$hint format ["Synced server time : %1", serverTime ];$/Code$ - undefined / undefined + global / undefined - This scripting command must be executed on the server to work properly in multiplayer + (Sep 8, 2010(CEST) 19:31) + There is a bug in this command, about 3 minutes after missionstart this command returns something completely different. + See http://dev-heaven.net/issues/13581 for further infomation. - Nothing + Number + - setCuratorWaypointCost + removeMagazines - Sets cost of waypoints (used for placing, editing and deleting). + Remove all magazines of given type from the unit. + Note: You may create invalid combinations with this function. When doing so, application behaviour is undefined. - https://community.bistudio.com/wiki/setCuratorWaypointCost + https://community.bistudio.com/wiki/removeMagazines - Object setCuratorWaypointCost Number + Object removeMagazines String - curatorObj setCuratorWaypointCost cost + unitName removeMagazines magazineName - $Code$myCUrator setCuratorWaypointCost 0.1;$/Code$ + $Code$player removeMagazines "M16";$/Code$ - undefined / undefined + local / undefined - This scripting command must be executed on the server to work properly in multiplayer + Though BIS did not provide a command to remove all magazines of every type, it can still be accomplished using forEach magazines. example: + {player removeMagazine _x} forEach magazines player - Nothing + Nothing + - setCurrentChannel + pixelW - Sets given channel as current chat channel. Scripted way of selecting desired channel on the UI. The given channel may be disabled (see enableChannel ), this is why this command returns boolean, true on success or false on failure. Correspondence between channel and number: - 0 = Global - 1 = Side - 2 = Command - 3 = Group - 4 = Vehicle - 5 = Direct - 6-15 = Custom Radio (see radioChannelCreate ) + Returns width of one pixel for current resolution. - https://community.bistudio.com/wiki/setCurrentChannel + https://community.bistudio.com/wiki/pixelW - setCurrentChannel Number + pixelW - setCurrentChannel channel + pixelW - $Code$_isDirectSelected = setCurrentChannel 5; // sets Direct channel as current active$/Code$ + $Code$_pixelWidth = pixelW ;$/Code$ - undefined / local + undefined / undefined - (December 9, 2015) - This command can be used together with custom radio channels, but an offset of 5 must be added to the index from radioChannelCreate. - $Code$_index = radioChannelCreate [[1, 0, 0, 1], "Custom Channel 1", "%UNIT_NAME", [player]]; - setCurrentChannel (_index + 5); - $/Code$ - Boolean + Number + - setCurrentTask + getMarkerType - Set the task as a current task of the person. + Returns the type of a given marker. See cfgMarkers for a list of standard markers. - https://community.bistudio.com/wiki/setCurrentTask + https://community.bistudio.com/wiki/getMarkerType - Object setCurrentTask Task + getMarkerType String - object setCurrentTask task + getMarkerType markerName - $Code$player setCurrentTask tskKillSpongebob;$/Code$ + $Code$"MarkerOne" setMarkerType "Destroy" + _type = getMarkerType "MarkerOne" + returns "Destroy"$/Code$ - undefined / undefined + global / undefined - Nothing + String + - setCurrentWaypoint + getGroupIcons - Sets the currently active waypoint for a group. + Returns all group icons. [id,icon,[offsetx,offsety],[..],..] - https://community.bistudio.com/wiki/setCurrentWaypoint + https://community.bistudio.com/wiki/getGroupIcons - Object/Group setCurrentWaypoint Array + getGroupIcons Group - groupName setCurrentWaypoint waypoint + getGroupIcons group - $Code$_grp setCurrentWaypoint [_grp, 1];$/Code$ - + - local / undefined + global / undefined - (27 Aug 2007) - (A1 1.08) Does not seem to work with Game Logic. Crashes to desktop. - - (26 Nov 2008) - Note that a waypoints number as seen in the mission editor is not the same as it's waypoint number using this command. In the mission editor, waypoint 0 refers to the first placed waypoint, whereas waypoint 0 with the setCurrentWaypoint command refers to the unit's initial position waypoint. - - (17 Jan 2010) - (A2 1.05) This command may crash the game to desktop if you call it from the on act field of a waypoint that belongs to that same unit. - - (13 Aug 2012) - Using this command forces the last waypoint to complete. Any code in the on Act of that waypoint will run. - Nothing + Array + - set + ropes - Changes the element at the given (zero-based) index of the array. - If the element does not exist, resize index+1 is called to create it. + Returns a vehicle's rope objects in an Array. - https://community.bistudio.com/wiki/set + https://community.bistudio.com/wiki/ropes - Array set Array + ropes Object - array set [index, value] + ropes vehicle - $Code$_arrayOne set [0, "Hello"];$/Code$ - - $Code$_arrayTwo set [ count _arrayTwo, "Bye"]; - // appends "Bye" as last element to _arrayTwo$/Code$ + $Code$hint str ( ropes vehicle player );$/Code$ - $Code$_arrayThree set [( count _arrayThree) - 1, 23]; - // replaces the last element of _arrayTwo with 23$/Code$ + $Code$_rope1 = ( ropes heli1) select 0;$/Code$ undefined / undefined + (05 April, 2014) + The ropes command seems to return each individual sling load rope. ropes will return an empty Array if the sling load ropes are not deployed. Ropes as of A3 1.33 have a cfgVehicles classname of "Rope". - Nothing + Array + - setCustomAimCoef + camUseNVG - Set custom aim precision coefficient for weapon sway + Set / clear using of night vision during cutscenes. This command only works with camCreate created camera that is currently the main camera for the player (see example). - https://community.bistudio.com/wiki/setCustomAimCoef + https://community.bistudio.com/wiki/camUseNVG - Object setCustomAimCoef Number + camUseNVG Boolean - unit setCustomAimCoef coef + camUseNVG set - $Code$player setCustomAimCoef 1;$/Code$ + $Code$camUseNVG true ;$/Code$ + + $Code$setDate [2000,12,31,0,0]; + _cam = "camera" camCreate [0,0,0]; + _cam camSetTarget player ; + _cam camSetRelPos [0,-5,3]; + _cam cameraEffect ["Internal","Back"]; + _cam camCommit 0; + camUseNVG true ;$/Code$ undefined / undefined @@ -56192,637 +57776,674 @@ - Nothing + Nothing + - setDamage + getClientState - Damage / repair object. Damage 0 means fully functional, damage 1 means completely destroyed / dead. (This function is an alias of setDammage and was introduced to fix the obvious spelling error in the original function name) - Since Arma 3 v1.67 there is an alternative syntax to this command allowing to switch off destruction effects. - - - https://community.bistudio.com/wiki/setDamage - - - Object setDamage Number - - Object setDamage Array - - - object setDamage damage - - object setDamage [damage, useEffects] + Returns client state in network game. Works on both, client and dedicated server. The following states are possible: + getClientStateNumber + getClientState + 0 + "NONE" + No client (or singleplayer) + 1 + "CREATED" + Client is created + 2 + "CONNECTED" + Client is connected to server, message formats are registered + 3 + "LOGGED IN" + Identity is created + 4 + "MISSION SELECTED" + Mission is selected + 5 + "MISSION ASKED" + Server was asked to send / not send mission + 6 + "ROLE ASSIGNED" + Role was assigned (and confirmed) + 7 + "MISSION RECEIVED" + Mission received + 8 + "GAME LOADED" + Island loaded, vehicles received + 9 + "BRIEFING SHOWN" + Briefing was displayed + 10 + "BRIEFING READ" + Ready to play mission + 11 + "GAME FINISHED" + Game was finished + 12 + "DEBRIEFING READ" + Debriefing read, ready to continue with next mission + + + https://community.bistudio.com/wiki/getClientState + + + getClientState + + + getClientState - $Code$_soldier1 setDamage 1;$/Code$ + $Code$_state = getClientState ;$/Code$ - $Code$_house1 setDamage [1, false ];$/Code$ + $Code$if ( getClientState == "BRIEFING READ") then { hint "Let the show begin!"};$/Code$ - global / global + undefined / undefined - In OFP, setting a unit's damage to a negative value will set it's health to full, but impair their aim. - - (May 29, 2015) - Using this possible overrides individual hit damages such as setHitPointDamage ["HitHead", _value]; if you're having issues try setting hitdamage after setdamage - Nothing - Nothing + String + - setDammage + pixelH - Damage / repair object. - Damage 0 means fully functional, damage 1 means completely destroyed / dead. - Alias of setDamage, which was introduced to fix a spelling error in this operator's name. + Returns the height of one pixel for current resolution. - https://community.bistudio.com/wiki/setDammage + https://community.bistudio.com/wiki/pixelH - Object setDammage Number + pixelH - object setDammage damage + pixelH - $Code$_soldier1 setDammage 1;$/Code$ + $Code$_pixelHeight = pixelH ;$/Code$ - global / global + undefined / undefined - In OFP, setting a unit's damage to a negative value will set it's health to full, but impair their aim. - Nothing + Number + - setDate + setPiPEffect - Sets the actual mission date and time. + Sets Render Target's visual effect (Picture-in-Picture). + 0: Normal - [0] + 1: Night Vision - [1] + 2: Thermal - [2] + 3: Color Correction - [3, enabled, brightness, contrast, offset, blend [r,g,b,a], lerp [r,g,b,a], rgb [r,g,b,a]] + 4: Mirror - [4] currently not working + 5: Chromatic Aberration - [5, enabled, powerx, powery, (bool) aspectCorrection] currently not working + 6: Film Grain - [6, enabled, intensity, sharpness, grainsize, intensityx1, intensityx2, (bool) monochromatic] currently not working + 7: Thermal Inverted [7] - https://community.bistudio.com/wiki/setDate + https://community.bistudio.com/wiki/setPiPEffect - setDate Array + String setPiPEffect Array - setDate [year, month, day, hour, minute] + name setPiPEffect [effect, optionalParam1,, optionalParamN] - $Code$setDate [1986, 2, 25, 16, 0]; //(4:00pm February 25, 1986)$/Code$ + $Code$"rendersurface" setPiPEffect [0];$/Code$ - $Code$// Set real date: - //postInit = 1; - if ( isServer ) then { - waitUntil { time 0}; - setDate ( missionStart select [0,5]); + $Code$"rendertarget0" setPiPEffect [3, 1.0, 1.0, 1.0, 0.0, [0.0, 1.0, 0.0, 0.25], [1.0, 0.0, 1.0, 1.0], [0.199, 0.587, 0.114, 0.0]];$/Code$ + + $Code$cam = "camera" camCreate ( player modelToWorld [0,-5,2]); + cam cameraEffect ["internal","back","rtt"]; + "rtt" setPiPEffect [2]; + with uiNamespace do { + pic = findDisplay 46 ctrlCreate ["RscPicture", -1]; + pic ctrlSetPosition [0,0,1,1]; + pic ctrlCommit 0; + pic ctrlSetText "#(argb,512,512,1)r2t(rtt,1.0)"; };$/Code$ + + $Code$// Black&White: + "rtt" setPiPEffect [3,1,1,0.4,0,[0,0,0,0],[1,1,1,0],[1,1,1,1]];$/Code$ - local / local + undefined / undefined - This scripting command must be executed on the server to work properly in multiplayer - - This command is special in that it is "smart". If you add 120 minutes, for example, it will actually advance hours by 2, and so on. - 10:00, 7/12/2010 (BST) - - This command sets the date for the southern hemisphere only, i.e. when the map is in northern hemisphere a date [2010,12,7,17,0] is in day light and and date [2010,6,7,17,0] is in darkness. - 21:35, 31 October 2011 (EET) - - In multiplayer, the effect of this command is local, not global. The date from the server is synchronized with clients when they join the game (including start of the mission and joining in progress). E.g. if this command is executed on server in the init.sqf before the mission starts, every client will be synchronized with server as mission is started. However, if you run this command in the middle of the mission, effect is local. - 10 September 2013 (EET) - - This command is JIP compatible. Players joining after mission start will get current server date set up. - - (October 4, 2014) - Since an unknown version of ARMA 3, this command now has global effect when executed on the server. - - (February 5, 2015) - Arma 3 1.38.128937- Leapyear BUG - setdate [2016,12,31,23,59] yields an ingame date of the 1st of January 2017. If left to tick over from the 30th of December it ticks to 1st January skipping the 31st of December entirely. - Feedback_Link - - (April 23, 2017) - Regarding execution in the middle of a session, the post of MulleDK13 is not entirely true. If you don't change the year, you are perfectly fine when executing the command on the server only. However, the server does not sync the year. Hence, if you do change the year, you have to execute the command on the server, clients and JIP to account for the missing sync. e.g. - $Code$[[], { setDate [1986, 2, 25, 16, 0]}] remoteExec [" call ",0,"JIP_id_setDate"];$/Code$ + (July 9, 2017) + If Color Corrections effect has been used, going back to Normal will have no effect. In order to unset Color Corrections, set 2nd param in it (enable) to 0. - Nothing + Nothing + - setDebriefingText + lbSetData - Sets debriefing text for endType defined in CfgDebriefing. - This command is broken. https://feedback.bistudio.com/T85682 + Sets the additional text (invisible) in the item with the given index of the listbox or combobox with id idc of the topmost user dialog to the given data. - https://community.bistudio.com/wiki/setDebriefingText + https://community.bistudio.com/wiki/lbSetData - String setDebriefingText Array + lbSetData Array + + Control lbSetData Array - endType setDebriefingText [title, description] + lbSetData [idc, index, data] + + control lbSetData [index, data] - $Code$_currentObjective = ( taskDescription ( currentTask player )) select 2; - "endDeath" setDebriefingText ["You Lose","All of your men were killed while assaulting the " + _currentObjective];$/Code$ + $Code$lbSetData [101, 1, "#1"];$/Code$ + + $Code$_control lbSetData [1, "#1"];$/Code$ undefined / undefined + More information on the LB command family can be found here - Nothing + Nothing - Nothing + - setDefaultCamera + cursorObject - Sets the position and direction for the camera used after camera is set on no object (log out view when leaving MP game for example) + Returns the object under cursor. This command is quite different from cursorTarget as it is more precise in determining the boundaries of the pointed at object and can detect a larger variety of objects including map objects and trees. - https://community.bistudio.com/wiki/setDefaultCamera + https://community.bistudio.com/wiki/cursorObject - setDefaultCamera Array + cursorObject - setDefaultCamera [position, direction] + cursorObject - $Code$setDefaultCamera [[5000,5000,200],[1,1,-1]];$/Code$ - - $Code$// Lift camera 100m up above current player position and point downwards: - setDefaultCamera [ ATLtoASL ( player modelToWorld [0,0,100]),[0,0,-1]];$/Code$ + $Code$hint str [ getModelInfo cursorObject, typeOf cursorObject ];$/Code$ undefined / undefined + (March 23, 2015) + If you point at the primary weapon of an infantry unit, cursorObject will return the p3d of the weapon instead of the unit itself (B Alpha 1-2:1.. or its variable name ). That doesn't occur for anything else (backpack or headgear). - Nothing + Object + - setDestination + primaryWeapon - Set the destination for path planning of the pilot. - Possible values for planningMode are: - "DoNotPlan" - used when not moving - "DoNotPlanFormation" - used in formation when simple path testing is used - "LEADER PLANNED" - used for formation leader (full path finding used) - "LEADER DIRECT" - used for DirectGo (like getin, supply) - "FORMATION PLANNED" - used in formation when full path finding is used - "VEHICLE PLANNED" - used for vehicle driver - Works best when used on agents + Returns name of unit's primary weapon (empty string if none). - https://community.bistudio.com/wiki/setDestination + https://community.bistudio.com/wiki/primaryWeapon - Object setDestination Array + primaryWeapon Object - object setDestination [position, planningMode, forceReplan] + primaryWeapon unit - $Code$bob setDestination [ screenToWorld [0.5,0.5], "LEADER PLANNED", true ]$/Code$ + $Code$_pWeap = primaryWeapon player ;$/Code$ + + $Code$hint primaryWeapon player ; //"arifle_MX_ACO_pointer_F"$/Code$ - local / global + global / undefined + (August 4, 2006) + primaryWeapon tells you what weapon the unit has irrespective of the status of the weapon. For example a unit that has an M16 on his back will still report an M16 as its primary weapon. + + (October 11, 2015) + To directly detect the active weapon use currentWeapon command. - Nothing + String + - setDetailMapBlendPars + playSound3D - Sets the detail texture map blend pars. Allows for smooth transition between detailed and undetailed terrain texture at distance. If noDetail fullDetail, the texture detail will incur smooth transition in the area between the thresholds. If noDetail = fullDetail there will be obvious visible edge between texture detail changes at fullDetail distance. + Plays positional sound with given filename on every computer on network. At least 2 parameters must be specified. - https://community.bistudio.com/wiki/setDetailMapBlendPars + https://community.bistudio.com/wiki/playSound3D - setDetailMapBlendPars Array + playSound3D Array - setDetailMapBlendPars [fullDetail, noDetail] + playSound3D [filename, soundSource, isInside, soundPosition, volume, soundPitch, distance] - $Code$setDetailMapBlendPars [20, 50];$/Code$ + $Code$playSound3D ["A3\Sounds_F\sfx\blip1.wav", player ]$/Code$ - $Code$setDetailMapBlendPars ( if ( currentWeapon player in [ - "Binocular", - "Rangefinder", - "Laserdesignator" - ]) then [ - {[300,600]}, - {[20,50]} - ]);$/Code$ + $Code$playSound3D ["A3\Sounds_F\sfx\blip1.wav", player, false, getPosASL player, 1, 1, 0]$/Code$ + + $Code$// Sound file extension must be specified even if a config entry has none: + playSound3D ["A3\Sounds_F\sfx\alarm_independent", player ]; //no sound + playSound3D ["A3\Sounds_F\sfx\alarm_independent.wss", player ]; //alarm$/Code$ - undefined / local + global / global + (September 23, 2013) + This command works well with addon sounds, however getting it to play mission sound files is a bit tricky. Follow this guide + + (September 26, 2014) + Currently, playSound3D is not JIP compatible, so joining players will not hear the sound if is started before and is still playing when player joins. + + (October 16, 2013) + You need to get the correct path for custom mission sounds. Use missionConfigFile with BIS_fnc_trimString (to trim off " description.ext "), then add your mission's sound directory and sound file: + $Code$_soundPath = [( str missionConfigFile ), 0, -15] call BIS_fnc_trimString; + _soundToPlay = _soundPath + "sounds\some_sound_file.ogg"; + playSound3D [_soundToPlay, _sourceObject, false, getPos _sourceObject, 10, 1, 50]; + //Volume db+10, volume drops off to 0 at 50 meters from _sourceObject$/Code$ + + (November 8, 2014) + When object is supplied but not a position, the position is taken from object, otherwise the position is taken from supplied position. That doesn't mean that when position is taken from object it is going to follow object when it changes position. The sound is generated at object position and it stays there. - Nothing + Nothing + - setDirection + setLightAttenuation - Set's the orientation of a location. It's area and map icon (if it's type uses an icon) will be rotated to this orientation. + Sets attenuation of light. Standard method of attenuation (1 / (constant + linear*dist + quadratic*dist*dist)). start param represents distance, where the attenuation starts to take effects (dist = distance - start). - https://community.bistudio.com/wiki/setDirection + https://community.bistudio.com/wiki/setLightAttenuation - Location setDirection Number + Object setLightAttenuation Array - location setDirection direction + light setLightAttenuation [start, constant, linear, quadratic, hardlimitstart, hardlimitend] - $Code$location1 = createLocation ["VegetationPalm", getPos player, 200, 200]; - location1 setText "Benargee's Palm Tree"; - location1 setDirection 45;$/Code$ + $Code$myLight setLightAttenuation [2,4,4,0,9,10];$/Code$ - undefined / undefined + local / local + (Mar 25, 2014) + (A3 1.14) setLightAttenuation array will present fallowing visual effects: + [start(SCALAR), constant(SCALAR), linear (SCALAR), quadratic(SCALAR)] + start(SCALAR) – Number can be unlimited, this parameter determines the range that the light source takes effect. Terrain environmental color will be bathed by ‎setLightAmbient within the range and its covered objects will reflect the color by ‎setLightColor. + constant(SCALAR) – Support signed number, this parameter determines the brightness proportion of the light source, higher the number is, less the brightness will be, vice versa. Any minus value passed will be treated as 0 (100% brightness). In other words, this parameter is related with ‎‎setLightBrightness and ‎setLightIntensity. + linear (SCALAR) – Support signed number, effective range is from 0 ~ 100 (passed minus value will be treated as 0), this parameter determines the concentration of the light source, higher the number is, more will the light concentrate, vice versa. In other words, this parameter will turn the source into spotlight and sharpens its light circle border. + Please pay attention to a special value: 4.31918e-005 + e.g. + $Code$ + _light setLightAttenuation [2,4, 4.31918e-005,0]; //This value will make the light source reach an ultra high effect range. Any initial param set before will be discarded and overwritten. + $/Code$ + quadratic(SCALAR) – Support signed number (range unlimited, passed minus number will be treated as 0), this parameter determines the range that the light source is visible and its visual presentation looks similar to linear. 0 means the maximum visible range. In further explanation, a less bright source can’t be seen out of the range on the land but still visible on the sea, and a bright enough source won’t be effected by the passed range who is still visible out of the range. + Please pay attention to a special value: 4.31918e-005 + e.g. + $Code$ + _light setLightAttenuation [6,0,0, 4.31918e-005 ]; //This value will make the light source reach an ultra high effect range. Any initial param set before will be discarded and overwritten. + $/Code$ - Nothing + Nothing + - setDir + removeItemFromBackpack - Sets object heading. Angles are measured in degrees clockwise from north. The accepted heading range is from 0 to 360 Negative angles represent a counter-clockwise angle and the angle can be of any size. + Removes item from soldier's backpack. - https://community.bistudio.com/wiki/setDir + https://community.bistudio.com/wiki/removeItemFromBackpack - Object setDir Number + Object removeItemFromBackpack String - object setDir heading + unit removeItemFromBackpack item - $Code$_soldier1 setDir 45 - // Will set soldier1 to face North East$/Code$ - - $Code$_soldier1 setDir -675 - // Will also set soldier1 to face North East$/Code$ - + - local / global + global / global - (November 27, 2013) - Make sure you setDir BEFORE you set position. Setting direction after set position could lead to unpredictable behaviour. For example main part of the hospital building in Arma 3 can lose collision detection near both side entrances. AI will also can get confused and will stop detecting obstacles if setDir called after setPos. - - (May 9, 2007) - Though effects of this command remain local, you can do a setPos afterwards to synchronize the direction on all machines in MP. - $Code$myObj setDir 90; - myObj setPos getPos myObj;$/Code$ - - (January 9, 2009) - In ArmA, the effect of setDir is synchronized across the network. - - (April 5th, 2011) - In OA 1.59 the comment of Manny still holds true for createVehicle'd empty vehicles by the server. - For the player object a local setDir alone is enough. - - (July 10, 2010) - In ArmA 2 OA, this command only makes the unit glance momentarily to the direction. To change his heading more permanently use setFormDir. - - (August 28, 2013) - Be careful letting the command to do the conversion for you when the angle is 0 or 360 - $Code$ player setDir 360+1; - hint str direction player ; //1 - player setDir -360+1; - hint str direction player ; //1.00001 - player setDir 360*5+1; - hint str direction player ; //1.00002 - player setDir -360*5+1; - hint str direction player ; //0.999972 - player setDir 360*10+1; - hint str direction player ; //0.999876 - player setDir -360*10+1; - hint str direction player ; //1 - player setDir 360*100000+1; - hint str direction player ; //358.24 - player setDir -360*100000+1; - hint str direction player ; //1.76001 - player setDir 360*10000000+1; - hint str direction player ; //298.591 - player setDir -360*10000000+1; - hint str direction player ; //61.4094$/Code$ - - (November 25, 2013) - In Arma 3, setDir affects vectorUp, vectorDir and velocity of the object it applied to. While this is not noticeable with stationary objects, a moving objects will have its orientation and velocity reset. So if you are planning on using setDir on a moving object, make sure you read the velocity value before and restore it after if you want the object to continue to move. - $Code$_vel = velocity _object; - _object setDir 45; - _object setVelocity _vel; - $/Code$ - With orientation it is a bit more complicated. setDir resets vectorUp to [0,0,1] and changes vectorDir accordingly to accommodate set direction. If your object's vectorUp is not [0,0,1] and you want to keep it this way, then you have to use setVectorDirAndUp to change object's direction not setDir. This is also the reason why it is better to use setVectorDirAndUp instead of setDir on attached objects for a better control of object's orientation. - - (November 22, 2014) - To setDir for AI unit, setFormDir first: - $Code$_ai setFormDir 180; - _ai setDir 180;$/Code$ - Nothing + Nothing + - setDrawIcon + breakTo - Set the icon to be shown in 2D editor for the specified editor object. If maintain size is false,icon will not scale depending on the scale,of the map. If maintain size is a number,the icon will maintain size,if map scale is below that number. is3D,show line and priority are,optional. - i - Some Old Editor Command + Breaks block to scope named name. Nil is returned. + Scope name can be assigned using scopeName command. - https://community.bistudio.com/wiki/setDrawIcon + https://community.bistudio.com/wiki/breakTo - Control setDrawIcon Array + breakTo String - map setDrawIcon [object,texture,color,offset,width,height,maintain size,angle,string identifier,shadow,is3D,draw line,priority] + breakTo name - + $Code$scopeName "main"; + while { true } do { + scopeName "loop1"; + while { true } do { + scopeName "loop2"; + if (condition1) then { breakTo "main"}; // Breaks all scopes and return to "main" + if (condition2) then { breakOut "loop2"}; // Breaks scope named "loop2" + sleep 1; + }; + sleep 1; + };$/Code$ + undefined / undefined + (May 18, 2017) + This command can not be used to re-execute scopes in which command is inside of. Example: + $Code$scopeName "whatever"; + if true then { + breakTo "whatever" + }; + $/Code$ + The example above will not make the engine jump back to line 1 and re-execute the 2nd line. Instead, it will just jump across line 2 to line 5 if it [ line 5 ] exists. - Nothing + Nothing + - setDriveOnPath + lockWP - Sets the path to follow for AI driver + Disable switching to next waypoint (current waypoint will never complete while lockwp is used). Sometimes used during cut-scenes. - https://community.bistudio.com/wiki/setDriveOnPath + https://community.bistudio.com/wiki/lockWP - Object setDriveOnPath Array + Object/Group lockWP Boolean - vehicleName setDriveOnPath [points] + groupName lockWP lock - $Code$myVehicle setDriveOnPath [[1000,10,1000],[1100,10,1000]]$/Code$ + $Code$_groupOne lockWP true ;$/Code$ + + $Code$_Soldier lockWP true ;$/Code$ + + $Code$_MyTank lockWP false ;$/Code$ - undefined / undefined + local / local - Nothing + Nothing + - setDropInterval + getAllEnvSoundControllers - Set interval of emitting particles from particle source. In Arma 3 hardcoded limit of how many particles can exist at the same time is 18000. Correspondence between CfgCloudlets class param name and command param: - $Code$particleSource setDropInterval interval;$/Code$ + Returns an array containing the names and values of environmental variables that can be used in simple expressions when configuring sounds. - https://community.bistudio.com/wiki/setDropInterval + https://community.bistudio.com/wiki/getAllEnvSoundControllers - Object setDropInterval Number + getAllEnvSoundControllers Position - particleSource setDropInterval interval + getAllEnvSoundControllers position - $Code$_source setDropInterval 0.05;$/Code$ + $Code$getAllEnvSoundControllers position player ; + // Result: + //[["rain",0],["night",0],["wind",0.161588],...]$/Code$ undefined / undefined + (March 25, 2018) + This command will return data on the following attributes; + rain, night, wind, daytime, meadows, trees, houses, forest, sea, coast, altitudeGround. alititudeSea, shooting, deadbody and fog - Nothing + Array + - setDynamicSimulationDistanceCoef + diag_fps - Sets activation distance multiplier of Arma_3_Dynamic_Simulation for the given class + Returns average framerate calculated over last 16 frames. - https://community.bistudio.com/wiki/setDynamicSimulationDistanceCoef + https://community.bistudio.com/wiki/diag_fps - String setDynamicSimulationDistanceCoef Number + diag_fps - class setDynamicSimulationDistanceCoef multiplier + diag_fps - $Code$"IsMoving" setDynamicSimulationDistanceCoef 3;$/Code$ + $Code$diag_log diag_fps;$/Code$ undefined / undefined + (November 19, 2014) + The engine will always calculate the last 16 frames without caring if they are frames in which the loading screen was drawn, or actual mission frames. - Nothing + Number + - setDynamicSimulationDistance + getPlayerChannel - Sets activation distance of Arma_3_Dynamic_Simulation for given category + Returns channel number for given player, provided that player is speaking, otherwise -1. Having mic on is not enough, player has to make a sound. There are several limitations to this command: + It does not work on dedicated server, the return is always -1, only client can detect other client talking. + It does not detect when someone talks on direct chat at all anywhere. + The client on which command is executed has to able to receive transmission before the transmission channel can be detected. For example if a player is not in the same group as a speaker and the speaker speaks on Group Channel, the player cannot hear the speaker and therefore cannot detect what channel the speaker is on. + In short, this command mimics the speaking icon from the UI. Correspondence between channel and number: + 0 = Global + 1 = Side + 2 = Command + 3 = Group + 4 = Vehicle + 5 = Direct (Is not detected by getPlayerChannel ) + 6-15 = Custom Radio (see radioChannelCreate ) - https://community.bistudio.com/wiki/setDynamicSimulationDistance + https://community.bistudio.com/wiki/getPlayerChannel - String setDynamicSimulationDistance Number + getPlayerChannel Object - category setDynamicSimulationDistance distance + getPlayerChannel player - $Code$"Group" setDynamicSimulationDistance 1000;$/Code$ + $Code$_channel = getPlayerChannel player ;$/Code$ - undefined / undefined + global / undefined - (March 19, 2017) - Desired distances for "Group" and "Vehicle" must be based on viewDistance and fog to exclude any rendering problems with frequently moving objects. Example: - $Code$"Group" setDynamicSimulationDistance (( viewDistance * 0.8) - ( viewDistance * fog)) - // 80% of maximum rendering and fog distance$/Code$ - But that might impair objects simulations if you are using long-scope optics, so there's a even better solution using cameraView with it: - $Code$[] spawn { - while { true } do { - if ( cameraView isEqualTo "GUNNER") then { - "Group" setDynamicSimulationDistance (( viewDistance - ( viewDistance * fog )); - // Scoped - } else { - "Group" setDynamicSimulationDistance (( viewDistance * 0.8) - ( viewDistance * fog )); - // Not scoped - }; - uiSleep 0.25; - }; - }; - $/Code$ - Nothing + Number + - setEditorMode + lbSetTooltip - Sets map mode to MAP,3D or PREVIEW. - i - Some Old Editor Command + Sets tooltip for item with given index of the listbox or combobox with id idc of the topmost user dialog to the given data. - https://community.bistudio.com/wiki/setEditorMode + https://community.bistudio.com/wiki/lbSetTooltip - Control setEditorMode String + lbSetTooltip Array + + Control lbSetTooltip Array - map setEditorMode mode + lbSetTooltip [idc, index, tooltip] + + control lbSetTooltip [index, tooltip] - + $Code$lbSetTooltip [101, 1, "tooltip"];$/Code$ + + $Code$_control lbSetTooltip [0, "another tooltip"];$/Code$ + - undefined / undefined + local / local + More information on the LB command family can be found here + + (August 9, 2017) + [ ArmA 3 v1.75.142535 ] if you want to put linebreaks into a tooltip, use this method: + $Code$format [ "%1,%2%3", "hi", parseText "\n", "my name is Will" ]$/Code$ - Nothing + Nothing - Nothing + - setEditorObjectScope + doFollow - This command defines the level of access a user has to editor objects. - "objects" is an array of either Editor Objects (eg ["_unit_0"]) or actual Game Objects (eg [player]). If the array is empty then the command will automatically parse all editor objects. - "editorType" is the editor type to effect (eg "unit", "vehicle", "center") or "" for all types. - "condition" is an executable string that must evaluate to true or false. If true, the scope of the evaluated editor object will be modified. "_x" can be used in the string as reference to the ingame representation of the currently processed array member. - "scope" is one of "HIDE", "VIEW", "SELECT", "LINKTO", "LINKFROM", "ALLNODRAG", "ALLNOTREE", "ALLNOCOPY", "ALLNOSELECT" or "ALL". - "subordinatesAlso" is a boolean value. If true then subordinates in the editor will be assigned the same scope as the parent. - i - Some Old Editor Command + Order the given unit(s) to follow the given other unit or vehicle eg (without radio messages). Also is used to resume unit formation after doStop, just doFollow leader even if it is the leader himself you want to resume (see Example 2). - https://community.bistudio.com/wiki/setEditorObjectScope + https://community.bistudio.com/wiki/doFollow - Control setEditorObjectScope Array + Object/Array doFollow Object - map setEditorObjectScope [objects, editorType, condition, scope, subordinatesAlso] + unitName doFollow unitName2 - $Code$_map setEditorObjectScope [ [],"vehicle", "side effectiveCommander _x != side player", "HIDE", false]$/Code$ + $Code$_soldier1 doFollow _soldier2$/Code$ - $Code$((findDisplay 128) displayCtrl 51) setEditorObjectScope [ ["_unit_0"], "", "true", "ALLNODRAG", false]$/Code$ + $Code$units _group doFollow leader _group;$/Code$ - undefined / undefined + local / global + These commands ( doFollow or commandFollow ) work only if the two units are in the same group. + + (August 29, 2016) + The name of this command is a bit misleading, it is used to make a unit return to the formation of its group or subformation. - Nothing + Nothing + - setEffectCondition + ctrlTextWidth - The statement is executed when the trigger or waypoint is activated and the effects are launched depending on the result. - If the result is a boolean and true, the effect is launched. - If the result is an object, the effect is launched if the result is the player or the player vehicle. - If the result is an array, the effect is launched if the result contains the player or the player vehicle. + Returns the control text width. Supported control types are: + CT_STATIC 0 + CT_EDIT 2 + CT_STRUCTURED_TEXT 13 - https://community.bistudio.com/wiki/setEffectCondition + https://community.bistudio.com/wiki/ctrlTextWidth - Object setEffectCondition String - - Waypoint setEffectCondition String + ctrlTextWidth Control - trigger setEffectCondition statement - - waypoint setEffectCondition statement + ctrlTextWidth control - $Code$_triggerObj setEffectCondition "thisList";$/Code$ + $Code$_w = ctrlTextWidth _ctrl;$/Code$ undefined / undefined @@ -56830,717 +58451,666 @@ - Nothing - Nothing + Number + - setFSMVariable + allControls - Set variable to given value in the variable space of given FSM. - The FSM handle is the number returned by the execFSM command. + Returns a list of all controls for desired existing display. Returned controls also include controls from control groups - https://community.bistudio.com/wiki/setFSMVariable + https://community.bistudio.com/wiki/allControls - Number setFSMVariable Array + allControls Display - handle setFSMVariable [name, value] + allControls display - $Code$_handle = execFSM "test.fsm"; - _handle setFSMVariable ["_foo", 23]; - - // sets variable _foo in the FSM to 23$/Code$ + $Code$_allCtrls = allControls findDisplay 46;$/Code$ undefined / undefined - (March 23, 2014) - If the variable is not yet defined within the FSM it will be created. - Nothing + Array + - setFace + disableSerialization - Set person's face. For a list of available faces, check Category:CfgIdentities. + Disable saving of script containing this command. After this, the script can work with data types which do not support serialization (UI types). + NOTE : When using spawn command, if the argument passed to it is Display or Control, an error will show asking to consider to disable serialization because of use of _this variable. What's more neither disableSerialization no use of uiNamespace will solve this. Passing Display or Control as part of an array however, will do the job: + $Code$ findDisplay 46 spawn { hint str _this}; // serialization error + [ findDisplay 46] spawn { hint str (_this select 0)}; // OK $/Code$ - https://community.bistudio.com/wiki/setFace + https://community.bistudio.com/wiki/disableSerialization - Object setFace String + disableSerialization - person setFace face + disableSerialization - $Code$soldier1 setFace "WhiteHead_02"$/Code$ - - $Code$// Set persistent face for a unit in MP - if ( isServer ) then {[_unit, "AsianHead_A3_02"] remoteExec ["setFace", 0, _unit]};$/Code$ + $Code$disableSerialization ; + _display = findDisplay 46;$/Code$ - global / local + undefined / undefined - (September 19, 2013) - For ArmA 3 face can be any of the following: - AfricanHead_01 - AfricanHead_02 - AfricanHead_03 - AsianHead_A3_01 - AsianHead_A3_02 - AsianHead_A3_03 - GreekHead_A3_01 - GreekHead_A3_02 - GreekHead_A3_03 - GreekHead_A3_04 - GreekHead_A3_05 - GreekHead_A3_06 - GreekHead_A3_07 - GreekHead_A3_08 - GreekHead_A3_09 - PersianHead_A3_01 - PersianHead_A3_02 - PersianHead_A3_03 - NATOHead_01 - WhiteHead_02 - WhiteHead_03 - WhiteHead_04 - WhiteHead_05 - WhiteHead_06 - WhiteHead_07 - WhiteHead_08 - WhiteHead_09 - WhiteHead_10 - WhiteHead_11 - WhiteHead_12 - WhiteHead_13 - WhiteHead_14 - WhiteHead_15 + (19 June, 2010) + Can be used to detecting load. Scope with disabled serialization is discontinued after load, even if there's endless loop inside. + _loaded = [] spawn { disableSerialization ; waitUntil { false };}; + waitUntil { scriptDone _loaded;}; + hint "Game was loaded!" + Works for all possible load types - loading user save, loading autosave and resuming mission from main menu. + Use with caution, as it handles two threads in memory, having impact at overall scripting time. - (unknown) - For ArmA 2 the face value is a string from Face01 to Face107. Camo faces are available as well, 6 per face. For example the full set of class names for face value 77 would be: - Face77, Face77_camo1, Face77_camo2, Face77_camo3, Face77_camo4, Face77_camo5 and Face77_camo6 - All Armed Assault 1.08 faces plus tutorial, - Online gallery of 1.08 Armed Assault faces - a full list of Arma 2 faces + (23 October, 2013) + If you do not store UI elements ( Display, Control ) in variables, you do not need disableSerialization ; UI elements are usually returned by scripting commands such as findDisplay or passed as params in UI event handler scripts ( displayAddEventHandler, ctrlAddEventHandler ). + This code will require disableSerialization : $Code$ disableSerialization ; + _display = findDisplay 123; + _ctrl = _display displayCtrl -1; + _ctrl ctrlSetText "LOL";$/Code$ + This code will not: $Code$ findDisplay 123 displayCtrl -1 ctrlSetText "LOL";$/Code$ + + (July 25, 2017) + In ArmA 3 1.72.142223, a scripted FSM does somehow not work with disableSerialization. As a workaround, store a display inside an array. + Example: $Code$_d = [ findDisplay idd ];$/Code$ - Nothing + Nothing + - setFaceAnimation + move - Set facial animation phase (eye blinking), blink is in the range from 0 to 1. + Let group move to given position (format Position or Position2D ) without waypoint. Active waypoints will be ignored when command is used. - https://community.bistudio.com/wiki/setFaceAnimation + https://community.bistudio.com/wiki/move - Object setFaceAnimation Number + Object/Group move Array - person setFaceAnimation blink + group move position - $Code$_soldier1 setFaceAnimation 0.5;$/Code$ + $Code$_groupOne move position player ;$/Code$ - undefined / undefined + local / global - (09:01, 23 December 2008 (CET)) - Setting face animation to 4 will give "devilish" features (ArmA) - Nothing + Nothing + - setFatigue + estimatedEndServerTime - Sets the person's fatigue, from 0 to 1. + Estimated end of MP game in seconds converted to serverTime. - https://community.bistudio.com/wiki/setFatigue + https://community.bistudio.com/wiki/estimatedEndServerTime - Object setFatigue Number + estimatedEndServerTime - unit setFatigue value + estimatedEndServerTime - $Code$player setFatigue 1;$/Code$ + $Code$// Estimated minutes left: + _min = ( ceil ( estimatedEndServerTime - serverTime ) / 60);$/Code$ - global / local + undefined / undefined - (05 April, 2014) - setFatigue will affect fatigue of a local unit only. If you execute it on remote unit, the getFatigue value will only change locally with no effect on remote unit. Scripted setFatigue changes don't broadcast at all. In short, use setFatigue on local units only. - Nothing + Number + - setFeatureType + assignAsCargoIndex - Enable/disable object as a feature/landmark. Possible feature types: - 0 - Feature disabled - 1 - Object is always visible within object view distance - 2 - Object is always visible within terrain view distance - The limit is 500 map/static objects and 200 dynamic objects including config features and auto features (flying helicopters, airplanes). When limit is reached, function returns false. + Assigns the character to a specific cargo / passenger index of the given vehicle. - https://community.bistudio.com/wiki/setFeatureType + https://community.bistudio.com/wiki/assignAsCargoIndex - Object setFeatureType Number + Object assignAsCargoIndex Array - object setFeatureType type + character assignAsCargoIndex [vehicle, index] - $Code$// Set a building to be always rendered: - building setFeatureType 2;$/Code$ + $Code$player assignAsCargoIndex [myHelicopter, 1];$/Code$ - global / local + undefined / undefined - Boolean + Boolean + - setFlagAnimationPhase + removeAllWeapons - Sets flag position on the flag pole according to the given animation phase, where 0 is the bottom of the flag pole, 1 is the top of the flag pole. The changes to the flag position are local to the PC command is executed on. To animate flag use BIS_fnc_animateFlag + Remove all weapons and magazines of the unit. + On vehicles only ammo is removed + Does not remove map, compass, radio. Use + unitname removeweapon "itemmap" + for that purpose. - https://community.bistudio.com/wiki/setFlagAnimationPhase + https://community.bistudio.com/wiki/removeAllWeapons - Object setFlagAnimationPhase Number + removeAllWeapons Object - flag setFlagAnimationPhase phase + removeAllWeapons unitName - $Code$_flag1 setFlagAnimationPhase 0.5;$/Code$ + $Code$removeAllWeapons player ;$/Code$ - global / local + local / global + (October 14, 2014) + removeAllWeapons doesn't quite work with vehicles. If you need to remove all weapons from a vehicle, remove each weapon individually: + $Code${tank removeWeapon _x} forEach weapons tank;$/Code$ - Nothing + Nothing + - setFlagOwner + terrainIntersect - Sets flag owner. When owner is set to objNull or any object other than a unit of class man or logic, flag is returned to the flagpole. A flag owned by a logic has no visual representation. + Checks for intersection of terrain between two AGL positions. Returns true if intersects with terrain. For ASL variant see terrainIntersectASL - https://community.bistudio.com/wiki/setFlagOwner + https://community.bistudio.com/wiki/terrainIntersect - Object setFlagOwner Object + terrainIntersect Array - flag setFlagOwner owner + terrainIntersect [pos1, pos2] - $Code$_flag1 setFlagOwner _soldier1;$/Code$ + $Code$_intersects = terrainIntersect [ getPos player, getPos chopper];$/Code$ - $Code$// To return the flag back to the flag pole: - //Method 1: (set owner null) - flag _flagCarrier setFlagOwner objNull ; - //Method 2: (set the flag mast as the owner) - flag _flagCarrier setFlagOwner flag _flagCarrier;$/Code$ + $Code$_intersects = terrainIntersect [ position player, position enemy1];$/Code$ - global / global + undefined / undefined - Since flags can not be owned by vehicles, use "flag setFlagOwner driver tank1" or "flag1 setFlagOwner tank1D" to assign the flag to the vehicle's driver. The second method will only work if tank1 is the name of a unit, not a variable refering to it. True for OFP&Arma + (may 31, 2012) + Please note the difference : + terrainIntersect + terrainIntersectASL + lineIntersect s + lineIntersect s With + lineIntersect s Objs + intersect + + (may 31, 2012) + This command is CPU intensive on the engine, be careful with its use. + + (Jun 23, 2012) + This command was changed to ATL and counterpart for ASL was added in build 94049. - Nothing + Boolean + - setFlagSide + say - Sets flag Side. A flag may be taken by any unit that is enemy to the side that owns the flag. Just like with setFlagTexture, if the command executed where unit is local effect of the command will be global and JIP compatible. + Unit will say given sound. + When the Unit is a Person, it will also perform corresponding lipsync effect provided an appropriate.lip file has been created for this sound. + A unit that has been killed or does not exist will not say anything. + Compare this with playSound which will always play a sound at the location of the player. + If the camera is not within given range, title is not shown and the sound will not be heard. + Sound is defined in CfgSound of the Description.ext. + NOTE: say will mimic either say2D or say3D depending on whether it is there executed in a cut scene or in a game scene. - https://community.bistudio.com/wiki/setFlagSide + https://community.bistudio.com/wiki/say - Object setFlagSide Side + Object say String + + Object say Array + + Array say String + + Array say Array - flag setFlagSide side + from say sound + + from say [sound, maxTitlesDistance, speed] + + [from, to] say sound + + [from, to] say [sound, maxTitlesDistance, speed] - $Code$_flag1 setFlagSide east ;$/Code$ + $Code$( units player select 1) say ["whisper1",5];$/Code$ - $Code$// Capturable OPFOR flag: - private _flag = "FlagPole_F" createVehicle position player ; - _flag setFlagTexture "\A3\Data_F\Flags\Flag_CSAT_CO.paa"; - _flag setFlagSide east ;$/Code$ + $Code$// Arma 3: + player say "scuba_breath";$/Code$ - local / global + global / local + (7 March 2013) + Say will occur in 3D when the player is active, during cutscenes it will not. Use say3D for cutscenes. - Nothing + Nothing - Nothing - Nothing - Nothing + - setFlagTexture + ropeAttachedTo - Sets flag texture. - If texture is "", flag is not drawn. - Custom texture can be used, as long as it is in *.jpg format, and has dimensions of 200px*200px. - The page Flag Textures shows which textures are available in each game. - NOTE : In MP this command has to be executed where Flag Pole is local. If you add Flag Pole in the editor, it will be local to the server, so executing setFlagTexture on the server will change flag texture on all clients. The command is also persistent and is synchronised for JIP clients. + Returns the object it is attached to by rope - https://community.bistudio.com/wiki/setFlagTexture + https://community.bistudio.com/wiki/ropeAttachedTo - Object setFlagTexture String + ropeAttachedTo Object - flag setFlagTexture texture + ropeAttachedTo vehicle - $Code$_flagE setFlagTexture "\ca\misc\data\sever_vlajka.paa";$/Code$ - - $Code$_flagW setFlagTexture "\ca\misc\data\usa_vlajka.paa";$/Code$ - - $Code$flag1 setFlagTexture "\A3\Data_F\Flags\Flag_red_CO.paa";$/Code$ - - $Code$flagARMA3 setFlagTexture "\a3\ui_f\data\Logos\arma3_expansion_ca.paa";$/Code$ - - $Code$// Capturable OPFOR flag: - private _flag = "FlagPole_F" createVehicle position player ; - _flag setFlagTexture "\A3\Data_F\Flags\Flag_CSAT_CO.paa"; - _flag setFlagSide east ;$/Code$ + $Code$_heli = ropeAttachedTo veh1;$/Code$ - local / global + undefined / undefined - Nothing + Object + - setFog + queryItemsPool - Changes the fog smoothly over the the given TransitionTime (in seconds). A time of zero means there will be an immediate change. A fog intensity of zero is minimum fog and a fog level of one is maximum fog. - NOTE : Since Arma 3 this command is MP synchronised, if executed on server, the changes will propagate globally. If executed on client effect is temporary as it will soon change to the server setting. - A little information about how Alt Syntax works. The fogValue is normal fog value that could be set independently with original setFog command. fogBase is the ASL altitude at which the fog will start. 0 is the sea level. fogDecay is how defined the fog start is. The more defined, the denser is the fog. 1 (or -1) are the max values. If it is positive the fog will be generated below fogBase line, if negative, above it. If fogDecay is small, the fog will transition more smoothly from no fog to full fog, and because of that it will cross fogBase line by quite a lot, depending on how small is fogDecay value. Current values of fogDecay and fogBase can be retrieved with fogParams + Returns the number of items of type in the weapon pool (used in campaigns to transfer weapons to the next mission). - https://community.bistudio.com/wiki/setFog + https://community.bistudio.com/wiki/queryItemsPool - Number setFog Number - - Number setFog Array + queryItemsPool String - time setFog fog - - time setFog [fogValue, fogDecay, fogBase] + queryItemsPool name - $Code$15 setFog 0.5;$/Code$ - - $Code$// Force no fog: - 0 setFog 0; - forceWeatherChange ; - 999999 setFog 0;$/Code$ - - $Code$0 setFog [1, 0.01, 0];$/Code$ - - $Code$// Mountain fog, starts from 70m ASL and thickens more the higher you climb: - 0 setFog [1, -1, 70];$/Code$ - - $Code$// Valley fog, starts from 60m ASL and thickens more the lower you descend: - 0 setFog [1, 1, 60];$/Code$ - - $Code$// Fooooog on the waaaater: - 0 setFog [1, 1, 0];$/Code$ - + - undefined / global + undefined / undefined - This scripting command must be executed on the server to work properly in multiplayer - - Only one script command induced weather change (either setOvercast or setFog) can be happening at a time. Starting a new weather change will immediately halt the current weather change. SetRain changes are independent and can occur simultaneously to a weather change. - - (December 15, 2015) - setTimeMultiplier DOES affect transition time. - Nothing - Nothing + Number + - setFormDir + showSubtitles - Set group formation heading. Accepted heading range is 0 to 360. Formation is facing this direction unless enemy is seen. When group is moving, this value is overriden by movement direction. + Enables / disables showing of subtitles in a chat. Only scripted/engine chatter is affected, player manual chat is unaffected. Returns the previous state. - https://community.bistudio.com/wiki/setFormDir + https://community.bistudio.com/wiki/showSubtitles - Object/Group setFormDir Number + showSubtitles Boolean - group setFormDir heading + showSubtitles enable - $Code$_group1 setFormDir 180;$/Code$ - - $Code$_unit1 setFormDir random 360;$/Code$ - - $Code$//center the main turret - ( group BIS_Crew1) setFormDir ( getDir BIS_Armor);$/Code$ + $Code$showSubtitles false;$/Code$ - local / global + undefined / local - (November 22, 2014) - When applied to AI, setFormDir will set unit formation direction, which in turn will force unit to change direction to match formation direction, however unit will stop turning as soon as unit direction is +/- 30 degrees of the formation direction. To precisely match formation direction, additional setDir is required: - $Code$_unit setFormDir 45; - _unit setDir 45; - hint str direction _unit; //45$/Code$ - Nothing + Boolean + - setFormationTask + isUniformAllowed - Set the current task of the formation member. + Check whether given uniform can be dressed by target soldier. - https://community.bistudio.com/wiki/setFormationTask + https://community.bistudio.com/wiki/isUniformAllowed - Object setFormationTask String + Object isUniformAllowed String - object setFormationTask task + unit isUniformAllowed type - + $Code$_canUse = _unit isUniformAllowed "U_B_CombatUniform_mcam";$/Code$ + - undefined / undefined + global / undefined - (16:57, 2 March 2007 (CET)) - Nothing + Boolean + - setFormation + assignedVehicle - Set group formation. - Formation is one of: - "COLUMN" - "STAG COLUMN" - "WEDGE" - "ECH LEFT" - "ECH RIGHT" - "VEE" - "LINE" - "FILE" (ArmA) - "DIAMOND" (ArmA) + Returns the vehicle a unit is assigned to. If no vehicle is assigned objNull is returned. - https://community.bistudio.com/wiki/setFormation + https://community.bistudio.com/wiki/assignedVehicle - Object/Group setFormation String + assignedVehicle Object - group setFormation formation + assignedVehicle unit - $Code$_groupOne setFormation "LINE"$/Code$ + $Code$_vehicle = assignedVehicle player ;$/Code$ - local / global + local / undefined - Nothing + Object + - setFriend + positionCameraToWorld - Sets how friendly side1 is with side2. For a value smaller than 0.6 it results in being enemy, otherwise it's friendly. - Intended to be used on mission start. Changing value during mission can cause unexpected errors in AI behavior. See also Side relations. + Transforms position from camera coordinate space to world coordinate space. + Camera axes are relative to camera orientation. x axis goes from left of the camera to right of the camera, z axis goes from underneath the camera to above the camera and y axis goes from back of the camera to where the camera is looking. - https://community.bistudio.com/wiki/setFriend + https://community.bistudio.com/wiki/positionCameraToWorld - Side setFriend Array + positionCameraToWorld PositionRelative - side1 setFriend [side2, value] + positionCameraToWorld cameraPos - $Code$west setFriend [ resistance, 0];$/Code$ + $Code$_worldPos = positionCameraToWorld _cameraPos;$/Code$ + + $Code$// Example demonstrating reversed y and z: + player setDir 0; //assuming player is looking forward + hint str [ positionCameraToWorld [0,0,0], positionCameraToWorld [0,0,1]]; + //[[2481.35,567 1.21,1.51395],[2481.35,567 2.21,1.46955]]$/Code$ - undefined / global + undefined / undefined - This scripting command must be executed on the server to work properly in multiplayer - - (18:49, 28 December 2006) - This command might be buggy in ArmA (or the description regarding enemy status is wrong). See this discussion. - - (11:25, 30 November 2007) - Setting the civilian side to be the enemy of any other side will result in the other side attacking inanimate mission editor placed objects such as empty vehicles and static objects, since these objects belong to the civilian side. + (October 17, 2008) + By measuring the distance between the camera and the player one can determine whether 1st-person or 3rd-person view is being used: + $Code$ if (( positionCameraToWorld [0,0,0] distance player ) 2) then { hint "3rd person"} else { hint "1st person"};$/Code$ - (15:57, 27 February 2008) - Be aware that this command only sets the friendliness of one side. If you want to have both sides attacking each other, you have to set both: $Code$Resistance setFriend [East, 0]; - East setFriend [Resistance, 0];$/Code$ + (22:45, 17 October 2010 (CEST)) + The camera coordinate system is different from the model coordinate system: when modelToWorld uses [x, y, z] then positionCameraToWorld uses [x, z, y]. So for a steady camera the following is true: + $Code$ positionCameraToWorld [5,10,15] == _camera modelToWorld [5,15,10];$/Code$ - (October 11, 2014) - (Arma 3 1.30 stable) It is possible to make a side hostile towards itself. - $Code$ west setFriend [ west, 0]; $/Code$ - It is only possible to do so with west / blufor, east / opfor, independent / resistance and civilian. This essentially creates a free for all deathmatch. Affects AI behaviour too. + (July 20, 2014) + When over land, the position returned is in format PositionATL, and over sea, PositionASLW. - Nothing + Array + - setFromEditor + ctSetHeaderTemplate - Set if given team member was inserted directly from editor. + Takes config path to the new header template. Clears the whole RscControlsTable and sets the new header template. - https://community.bistudio.com/wiki/setFromEditor + https://community.bistudio.com/wiki/ctSetHeaderTemplate - Team_Member setFromEditor Boolean + Control ctSetHeaderTemplate Config - teamMember setFromEditor fromEditor + Control ctSetHeaderTemplate Config - $Code$_teamMember setFromEditor true$/Code$ + $Code$_control ctSetHeaderTemplate _configPath;$/Code$ - undefined / undefined + local / local - Nothing + Nothing + - setFuel + delete3DENEntities - Sets fuel percentage from 0 (empty) to 1 (full). The vehicle must be local to the computer where command is executed. + Delete given entities in Eden Editor, including anything that can be placed in editor. - https://community.bistudio.com/wiki/setFuel + https://community.bistudio.com/wiki/delete3DENEntities - Object setFuel Number + delete3DENEntities Array - vehicle setFuel amount + delete3DENEntities entities - $Code$_jeepOne setFuel 0.5;$/Code$ + $Code$delete3DENEntities ( all3DENEntities select 0); + // removes all objects$/Code$ - local / global + undefined / undefined - Nothing + Nothing + - setFuelCargo + removeFromRemainsCollector - Sets fuel amount in cargo space of refuel vehicle from empty (0) to full (1) - Note, the carrying capacity of each side's refuel trucks differ. + Removes vehicles/units from disposal manager, added earlier with addToRemainsCollector - https://community.bistudio.com/wiki/setFuelCargo + https://community.bistudio.com/wiki/removeFromRemainsCollector - Object setFuelCargo Number + removeFromRemainsCollector Array - vehicle setFuelCargo amount + removeFromRemainsCollector remains - $Code$_refuelTruckOne setFuelCargo 0;$/Code$ + $Code$removeFromRemainsCollector [unit1, unit2, vehicle1];$/Code$ - local / global + global / global - (July 10, 2015) - (ArmA 3 1.44) setFuelCargo will have no effect if the vehicle doesn't support getFuelCargo. - Nothing + Nothing + - setGroupIconParams + get3DENConnections - Set group icons parameters. [color,string,float,bool] + Return all connections currently present on an entity. - https://community.bistudio.com/wiki/setGroupIconParams + https://community.bistudio.com/wiki/get3DENConnections - Group setGroupIconParams Array + get3DENConnections EdenEntity - group setGroupIconParams properties + get3DENConnections entity - $Code$_grp setGroupIconParams [_color,_text,_scale,_visible]; - _grp setGroupIconParams [[0,0,0,0],"",1,false];$/Code$ - + undefined / undefined - Nothing + Array + - setGroupIconsSelectable + showChat - Sets if group icons raises onclick and onover events. + Shows/hides the whole chat window. - https://community.bistudio.com/wiki/setGroupIconsSelectable + https://community.bistudio.com/wiki/showChat - setGroupIconsSelectable Boolean + showChat Boolean - setGroupIconsSelectable bool + showChat bool - $Code$setGroupIconsSelectable true ;$/Code$ + $Code$showChat false ;$/Code$ - undefined / undefined + undefined / local - Object + Nothing + - setGroupIconsVisible + diag_toggle - Sets if group icons are visible. + Used to enable/disabled various diagnostics. + Only available in the Arma 3 Diagnostic exe - https://community.bistudio.com/wiki/setGroupIconsVisible + https://community.bistudio.com/wiki/diag_toggle - setGroupIconsVisible Array + diag_toggle String - setGroupIconsVisible array + diag_toggle diag_mode - $Code$setGroupIconsVisible [true,true];//[show markers on map, show markers on player hud] - setGroupIconsVisible [true,false]; //Show only 2D - setGroupIconsVisible [false,false];$/Code$ + $Code$diag_toggle "Animation";//enable + diag_toggle "Animation";//disable$/Code$ undefined / undefined @@ -57548,315 +59118,280 @@ - Nothing + Nothing + - setGroupIcon + nMenuItems - Set group icons properties. + Returns the total number of user-added menu items belonging to the given menu. + i + Some Old Editor Command - https://community.bistudio.com/wiki/setGroupIcon + https://community.bistudio.com/wiki/nMenuItems - Group setGroupIcon Array + Control nMenuItems String + + Control nMenuItems Number - group setGroupIcon [id, icon, offset] + map nMenuItems menuName + + map nMenuItems index - $Code$_target setGroupIcon [_icon,"hc_selectedEnemy"]; - _target setGroupIcon [_icon,"flag"]; - _grp setGroupIcon [_iconsize,_iconsizeclass,_offset]; - _grp setGroupIcon [_newid,_icon,_offset]; - _grp setGroupIcon [_icon,_iconclass];$/Code$ - + undefined / undefined - Nothing + Number - Number + - setGroupIdGlobal + setTriggerTimeout - A global equivalent of setGroupId + Defines the time between condition satisfaction and trigger activation (randomly from min to max, with an average value mid). If the last argument is true, the condition must be fullfilled all the time. + For a normal trigger, min, mid and max are used to generate random duration according to Gaussian Distribution. For a "Seized" type of trigger, the duration value is generated using side ruling power - https://community.bistudio.com/wiki/setGroupIdGlobal + https://community.bistudio.com/wiki/setTriggerTimeout - Object/Group setGroupIdGlobal Array + Object setTriggerTimeout Array - group setGroupIdGlobal [nameFormat, nameParam1,, nameParamN] + trigger setTriggerTimeout [min, mid, max, interruptable] - + $Code$_trigger setTriggerTimeout [5, 10, 7, false ];$/Code$ + - global / global + global / local - Nothing + Nothing + - setGroupId + setWPPos - Sets a group's identity, how it will be displayed in chat, for example. While groups on the different sides can have identical ids, the groups on the same side cannot. When given id exists already, the group which currently has it will simply swap it with the current id of the group for which this id is intended. For example: - $Code$group1 = createGroup west ; - group2 = createGroup west ; - group1 setGroupId ["Active Group"]; - group2 setGroupId ["Inactive Group"]; - systemChat groupId group1; //"Active Group"; - systemChat groupId group2; //"Inactive Group"; - group2 setGroupId ["Active Group"]; - systemChat groupId group1; //"Inactive Group"; - systemChat groupId group2; //"Active Group";$/Code$ - The identity setup could also consist of format keywords (marked with %) and param keywords taken from CfgWorlds config. Basically it is like format command but with some special group keywords. For Arma 3 possible values are: - %GroupSquad - "Squad1" - 1 - "Squad2" - 2 - "Squad3" - 3 - "Squad4" - 4 - %GroupPlatoon - "Platoon1" - 1 - "Platoon2" - 2 - "Platoon3" - 3 - "Platoon4" - 4 - %GroupCompany - "CompanyAlpha" - Alpha - "CompanyBravo" - Bravo - "CompanyCharlie" - Charlie - "CompanyDelta" - Delta - "CompanyEcho" - Echo - "CompanyFoxtrot" - Foxtrot - "CompanyGolf" - Golf - "CompanyHotel" - Hotel - "CompanyIndia" - India - "CompanyKilo" - Kilo - "CompanyLima" - Lima - "CompanyMike" - Mike - "CompanyNovember" - November - "CompanyOscar" - Oscar - "CompanyPapa" - Papa - "CompanyQuebec" - Quebec - "CompanyRomeo" - Romeo - "CompanySierra" - Sierra - "CompanyTango" - Tango - "CompanyUniform" - Uniform - "CompanyVictor" - Victor - "CompanyWhiskey" - Whiskey - "CompanyXray" - X-Ray - "CompanyYankee" - Yankee - "CompanyZulu" - Zulu - %GroupNames - "Alpha" - Alpha - "Bravo" - Bravo - "Charlie" - Charlie - "Delta" - Delta - "Echo" - Echo - "Foxtrot" - Foxtrot - "Golf" - Golf - "Hotel" - Hotel - "November" - November - "Kilo" - Kilo - "Yankee" - Yankee - "Zulu" - Zulu - "Two" - Two - "Three" - Three - "Buffalo" - Buffalo - "Guardian" - Guardian - "Convoy" - Convoy - "Fox" - Fox - %GroupColors - "GroupColor1" - Black - "GroupColor2" - Red - "GroupColor3" - Green - "GroupColor4" - Blue - "GroupColor5" - Yellow - "GroupColor6" - Orange - "GroupColor7" - Pink - "GroupColor0" - - "Six" - Six - For global variant of this command use setGroupIdGlobal. + Set waypoint position - https://community.bistudio.com/wiki/setGroupId + https://community.bistudio.com/wiki/setWPPos - Object/Group setGroupId Array + Array setWPPos Array - group setGroupId [nameFormat, nameParam1,, nameParamN] + waypoint setWPPos pos - $Code$// Arma 3 : - group player setGroupId ["Some name for the group"]; - hint groupId group player ; //"Some name for the group" - player sideChat "lalala"; //Some name for the group (KK): "lalala"$/Code$ - - $Code$// Arma 3 : - group player setGroupId ["%GroupNames :=: %GroupColors","Alpha","GroupColor2"]; - hint groupId group player ; //"Alpha :=: Red" - player sideChat "lalala"; //Alpha :=: Red (KK): "lalala"$/Code$ - - $Code$// OFP : - _group1 setGroupId ["Delta","GroupColor4"]$/Code$ - - $Code$// ArmA / ArmA 2 : - _group1 setGroupId ["Assault Squad"]$/Code$ + $Code$[_groupOne, 1] setWPPos markerPos "MarkerOne";$/Code$ - global / local + undefined / local - Letter is one of: - "Alpha" - "Bravo" - "Charlie" - "Delta" - "Echo" - "Foxtrot" - "Golf" - "Hotel" - "Kilo" - "Yankee" - "Zulu" - "Buffalo" - "Convoy" - "Guardian" - "November" - "Two" - "Three" - "Fox" - Colour may be one of the following: - "GroupColor0" - (Nothing) - "GroupColor1" - Black - "GroupColor2" - Red - "GroupColor3" - Green - "GroupColor4" - Blue - "GroupColor5" - Yellow - "GroupColor6" - Orange - "GroupColor7" - Pink - "Six" - Six - - (August 4, 2006) - Notes from before the conversion: - Note that this command does not name the group. To call a group "grp1", for example, write this in the init field of the group leader : - grp1 = group this - - (December 9, 2006) - Selfdefined Callsigns: - In Armed Assault you're able to define the callsignletter by yourself. This can be for example "Fireteam", or "Specialforces". - this setgroupId ["Attackteam"] - - In OFP v1.96, the radio callsign strings for a mission can be redefined by creating a stringtable.csv in the mission folder. All string names except FOX can be found within the main stringtable.csv. Note "SIX" has a string suggesting it is a groupname, although the engine uses it as a colour. Some examples of the string names : STR_CFG_GRPNAMES_ALPHA, STR_CFG_GRPNAMES_FOX, STR_CFG_GRPCOL_BLACK, STR_CFG_GRPNAMES_SIX, STR_CFG_FIREFLYBASE, STR_CFG_PAPABEAR, STR_CFG_HQ_BASE, STR_CFG_HQ_BASE. - - (April 21, 2015) - List of available keywords from config: $Code$"if ((configName _x) select [0, 5] == 'group') then { - diag_log ('%' + configName _x); - for '_i' from 0 to count _x - 1 do { - diag_log ('* ""' + configName (_x select _i) + '"" - ' + getText ((_x select _i) 'name')); - }; - }; false" configClasses (configFile "CfgWorlds");$/Code$ - Nothing + Nothing + - setGroupOwner + isInRemainsCollector - Changes the ownership of a group (and all its units) to a given client. Group leader can't be a player. Only works when called from a server. Returns true if locality was changed. For agents use setOwner command. + Checks if unit or vehicle is queued for disposal after death. - https://community.bistudio.com/wiki/setGroupOwner + https://community.bistudio.com/wiki/isInRemainsCollector - Group setGroupOwner Number + isInRemainsCollector Object - group setGroupOwner clientID + isInRemainsCollector remain - $Code$_localityChanged = _someGroup setGroupOwner ( owner _playerObject);$/Code$ + $Code$if ( isInRemainsCollector unit1) then { hint "unit1 is queued for disposal"};$/Code$ + + + global / undefined + + + + + Boolean + + + + + + formationPosition + + + Return position of unit in the formation + + + https://community.bistudio.com/wiki/formationPosition + + + formationPosition Object + + + formationPosition person + + + $Code$_pos=FormationPosition _person$/Code$ undefined / undefined - This scripting command must be executed on the server to work properly in multiplayer + + + Array + + + + + + getNumber + + + Extract number from config entry. + + + https://community.bistudio.com/wiki/getNumber + + + getNumber Config + + + getNumber config + + + $Code$_value = getNumber ( configFile "CfgVehicles" "Thing" "maxSpeed");$/Code$ + + + undefined / undefined + + + (04:45, 3 March 2007 (CET)) + Use getNumber to get boolean values from a config file. 1 equals true, 0 equals false and if no value is found (when a valid variable is undefined) 0.67 is returned. - (July 30, 2015) - In ArmA3 1.48, setGroupOwner does NOT work if group has no units + (13 September 2011) + With an not existing entry, getNumber returns 0. + + (Mar 28, 2014) + (ArmA3 1.14), It's recommended to use BIS_fnc_getCfgData or BIS_fnc_returnConfigEntry to get variable cfg data rather than conditioning via isNumber, isText, isArray, getNumber, getText and getArray combination. + Traditional workaround: + $Code$ + _cfg = configFile "CfgVehicles" _SomeAddonClassName "DestructionEffects" "Smoke1" "type" + switch ( true ) do + { + case ( isNumber _cfg): { getNumber _cfg}; + case ( isText _cfg): { getText _cfg}; + case ( isArray _cfg): { getArray _cfg;}; + default {nil}; + }; + $/Code$ + Recommended workaround: + $Code$ + ( configFile "CfgVehicles" _SomeAddonClassName "DestructionEffects" "Smoke1" "type") call BIS_fnc_getCfgData ; + $/Code$ + To return default value once entry was not found, we can use BIS_fnc_returnConfigEntry instead of BIS_fnc_getCfgData. + $Code$ + [( configFile "CannonFire" "LightExp"),"lifeTime",0] call BIS_fnc_returnConfigEntry ;//0.5 + $/Code$ + To compose collected Number into Array, use BIS_fnc_getCfgDataArray instead. + $Code$ + ( configFile "CfgVehicles" _SomeAddonClassName "DestructionEffects" "Smoke1" "type") call BIS_fnc_getCfgDataArray ; + $/Code$ + To retype collected Number into Boolean, use BIS_fnc_getCfgDataBool. Anything bigger than 0 is true, otherwise false. + $Code$ + ( configFile "CfgVehicles" _SomeAddonClassName "DestructionEffects" "Smoke1" "type") call BIS_fnc_getCfgDataBool ; + $/Code$ - Boolean + Number + - setGusts + setVehicleAmmoDef - Changes the gusts value smoothly during the given time (in seconds). A time of zero means there will be an immediate change. Value is 0 to 1. + Sets how much ammunition (compared to the configuration of magazines defined in the vehicle's class) the vehicle has. Note that the ammo will only be added to local turrets. To check the locality of turret use turretLocal. - https://community.bistudio.com/wiki/setGusts + https://community.bistudio.com/wiki/setVehicleAmmoDef - Number setGusts Number + Object setVehicleAmmoDef Number - time setGusts value + unit setVehicleAmmoDef value - $Code$60 setGusts 0.75;$/Code$ + $Code$player setVehicleAmmoDef 0;$/Code$ - undefined / local + local / global + (December 20, 2014) + For vehicles this command operates relative to its stock magazine loadout (i.e. its CfgVehicles magazines[] values). Thus setVehicleAmmoDef 1 will fully restore a vehicle to its default ammunition capacity, resetting any changes made by intentionally/implicitly adding/removing magazines. + Use setVehicleAmmo to operate in relation to a vehicle's current magazine loadout. + -- Actium ( talk ) 22:49, 20 December 2014 (CET) - Nothing + Nothing + - setHUDMovementLevels + synchronizeTrigger - Set min/max movement borders displayed in HUD gauges. Use -1 to skip some value. + Synchronizes the trigger with zero or more waypoints. - https://community.bistudio.com/wiki/setHUDMovementLevels + https://community.bistudio.com/wiki/synchronizeTrigger - setHUDMovementLevels Array + Object synchronizeTrigger Array - setHUDMovementLevels [minSpeed, maxSpeed, minAlt, maxAlt, minDir, maxDir, targetOrPosition] + trigger synchronizeTrigger [waypoint1, waypoint2,] - $Code$setHUDMovementLevels [20,30,-1,-1,0.23,2.1,[0,0,0]]$/Code$ + $Code$_trigger synchronizeTrigger []$/Code$ - $Code$setHUDMovementLevels [20,30,-1,-1,0.23,2.1,player]$/Code$ + $Code$_trigger synchronizeTrigger [_waypoint1]$/Code$ + + $Code$_trigger synchronizeTrigger [_waypoint1, [_group5, 7], _waypoint3]$/Code$ undefined / undefined @@ -57864,436 +59399,281 @@ - Nothing + Nothing + - setHideBehind + displayCtrl - Sets the data for hiding. objectWhereHide can be taken using findCover. hidePosition can be taken using getHideFrom. Command is not functional in ArmA 2. - This command is not implemented + Return child control with specified idc. - https://community.bistudio.com/wiki/setHideBehind + https://community.bistudio.com/wiki/displayCtrl - Object setHideBehind Array + Display displayCtrl Number - object setHideBehind [objectWhereHide, hidePosition] + display displayCtrl idc - + $Code$_ChildControl = _ParentDisplay displayCtrl 101;$/Code$ + undefined / undefined + (May 1, 2017) + Since Arma 3 1.42 you can also return a control inside a controls group using controlsGroupCtrl (created with ctrlCreate or inside a controls[] of a control config). Example: + $Code$((uiNamespace getVariable "RscUnitInfo") displayCtrl 2303) controlsGroupCtrl 154; // Display - Controls Group - Control$/Code$ + Note that control inside controls group having -1 IDC currently cannot be returned in any way. - Nothing + Control + - setHitIndex + humidity - Set the current level of damage for a specific Hit Point (specified by its hit part index). All hit points can be obtained with getAllHitPointsDamage command. - 0: no damage - 1: full damage + Returns the current humidity value. 0 is no humidity and 1 is 100% humidity. Humidity value quickly changes from 0 to 1 when rain starts, then slowly changes from 1 to 0 when rain stops. - https://community.bistudio.com/wiki/setHitIndex + https://community.bistudio.com/wiki/humidity - Object setHitIndex Array + humidity - vehicle setHitIndex [hitPartIndex, damage, useEffects] + humidity - $Code$vehicle player setHitIndex [1, 1];$/Code$ + $Code$currentHumidity = humidity ;$/Code$ - $Code$player setHitIndex [7, 0.5];$/Code$ + $Code$skipTime -24; + 86400 setOvercast 1; + skipTime 24; + [] spawn { + 10 setRain 1; + sleep 10; + 10 setRain 0; + }; + onEachFrame { + hintSilent str [ round ( rain * 10) / 10, round ( humidity * 10) / 10]; + };$/Code$ - local / global + undefined / undefined - Nothing + Number + - setHitPointDamage + rank - Set the current level of damage for a specific Hit Point (specified by its config class). - 0: no damage - 1: full damage - See also BIS_fnc_setHitPointDamage for setting hit with dependency + Returns the rank of the given unit. Rank can be one of the following: + "PRIVATE" + "CORPORAL" + "SERGEANT" + "LIEUTENANT" + "CAPTAIN" + "MAJOR" + "COLONEL" - https://community.bistudio.com/wiki/setHitPointDamage + https://community.bistudio.com/wiki/rank - Object setHitPointDamage Array + rank Object - vehicle setHitPointDamage [hitPointName, damage, useEffects] + rank unitName - $Code$vehicle player setHitPointDamage ["hitEngine2", 1.0];$/Code$ - - $Code$player setHitPointDamage ["hitHead", 0.5]; - player setHitPointDamage ["hitBody", 0.5]; - player setHitPointDamage ["hitHands", 0.5]; - player setHitPointDamage ["hitLegs", 0.5];$/Code$ + $Code$_rank = rank player;$/Code$ - local / global + global / undefined - (August 30, 2012) - This command is using the Hit Points (defined in the HitPoints class in the config) while setHit is using Named Selections (defined in the model itself). - - (November 10, 2016) - This command has no affect when allowDamage is false. - - (November 14, 2016) - Mention that setHitPointDamage only can be executed localy, while the getHitPointDamage is global. - Nothing + String + - setHit + scoreSide - Damage / repair part of object. The object must be local to the computer where command is executed. - Damage 0 means fully functional, damage 1 means completely destroyed / dead. Note: Some part names are in Czech; see translation table. + Returns score for the given side. MP Only. - https://community.bistudio.com/wiki/setHit + https://community.bistudio.com/wiki/scoreSide - Object setHit Array + scoreSide Side - object setHit [part, damage, useEffects] + scoreSide side - $Code$vehicle player setHit ["motor", 1]$/Code$ - - $Code$vehicle player setHit ["mala vrtule", 0.95]$/Code$ - - $Code$if ( local _heli) then { - _heli setHit ["velka vrtule", 0]; - } else { - hint "Vehicle " + str _heli + " must be local to this machine to do that!"; - };$/Code$ + $Code$_number = scoreSide west ;$/Code$ - local / global + undefined / undefined - Damaging specific parts of the vehicle will not update its overall damage value (as of v1.03): - player setHit ["hands", 0.9]; - hint str (damage player); //will return 0 - - Direct use of the names of sections of the model is likely a bad practice, and will not work on some addons. - So instead: - _MH60S setHit ["elektronika", _hit]; - should be used: - _MH60S setHit [getText(configFile "cfgVehicles" "MH60S" "HitPoints" "HitAvionics" "name"), _hit]; - - Since there is no getHit (as of 1.61), you can use canMove command to check if vehicle is capable of moving. - For land wheeled vehicles canMove will return false if any real wheel (damaging nonexistent wheels doesn't count) has hitpoint damage greater than 0.9. Having HitEngine damage greater than 0.9 will make canMove to return false as well (plus will result in vehicle exploding). HitFuel however doesn't make canMove return false even though having high HitFuel damage will make car explode. - For helicopters HitEngine with damage greater than 0.9 will make canMove return false as well. Having HitHRotor (main rotor) damaged even up to 1 will never make canMove return false. However, if HitVRotor (tail rotor) will have damage greater than 0.703608 it will make canMove return false (even though some helicopters are controllable and flyable by player with broken tail rotor). - In same manner you can use canFire to check if turret hitpoints are not damaged enough to be able to fire. (canFire always returns false if there is nobody in vehicle) - Update: Since ArmA 3 1.31 getHit has been introduced. - Nothing + Number + - setHorizonParallaxCoef + diag_tickTime - Sets coef used to shift horizon position based on camera height (use 0 to disable shifting). + Real time spent from the start of the game. Expressed in fractions of second. Resolution of 1 tick is 1 ms. - https://community.bistudio.com/wiki/setHorizonParallaxCoef + https://community.bistudio.com/wiki/diag_tickTime - setHorizonParallaxCoef Number + diag_tickTime - setHorizonParallaxCoef coef + diag_tickTime - $Code$setHorizonParallaxCoef 1;$/Code$ + $Code$_start = diag_tickTime ; + //code + _stop = diag_tickTime ; + diag_log format ["%1",_stop - _start];$/Code$ undefined / undefined + (8 Sept, 2010) + In Arma 2 Operation Arrowhead 1.54.0.72888 this returns the time in seconds since the game was started. + + (25 Jan, 2014) + This command will return time since last client restart as float. However because of Number format used in Arma, the more time has past since restart the less precise the returned value will be. - Nothing + Number + - setIdentity + selectWeapon - Set identity of person. - Identities are defined in Description.ext of the mission or campaign. For a list of available faces, glasses and speakers check Category:CfgIdentities. + Selects the given weapon. + Note: For weapons that have more than one muzzle, you have to input the muzzlename and not the weaponName. + The only weapons that have muzzleNames seem to be rifles with grenade launchers, handgrenades, smokeshells and satchels. + In all other cases the weaponName must be used. + Fortunately, in OFP, in most cases, both names are the same. But check. + In ArmA the weaponNames and muzzleNames are different. + For muzzle names see cfgWeapons. + NOTE: The unit must be local to the PC on which command is executed. - https://community.bistudio.com/wiki/setIdentity + https://community.bistudio.com/wiki/selectWeapon - Object setIdentity String + Object selectWeapon String - person setIdentity identity + unitName selectWeapon muzzleName - $Code$_soldier1 setIdentity "MyLittleSoldier";$/Code$ + $Code$_soldier1 selectWeapon "LAWLauncher";$/Code$ + + $Code$player selectWeapon "M203Muzzle";$/Code$ - undefined / undefined + local / global - (August 28, 2013) - For ArmA3 the definition format in the Description.ext file is: - class CfgIdentities + (5 Aug, 2008) + Rather than simply using selectWeapon to select your default weapon after adding them to your player, it is recommended you use a script instead similar to the following, which caters for multiple muzzles: + SelectWeapon.sqf + // Desc: select default weapon & handle multiple muzzles + if (count weapons player 0) then { - class MyLittleSoldier + private['_type', '_muzzles']; + _type = ((weapons player) select 0); + // check for multiple muzzles (eg: GL) + _muzzles = getArray(configFile "cfgWeapons" _type "muzzles"); + if (count _muzzles 1) then { - name = "Givens"; - nameSound = "Givens"; - face="WhiteHead_06"; - glasses="None"; - speaker="Male05ENG"; - pitch=1.1; + player selectWeapon (_muzzles select 0); + } + else + { + player selectWeapon _type; }; }; - nameSound can be any preset BIS recorded name value. By default units will be called out in voice by their number. By using nameSound you can call them out by name using the following values: - Default: - Armstrong - Nichols - Tanny - Frost - Lacey - Larkin - Kerry - Jackson - Miller - McKendrick - Levine - Reynolds - BLUFOR: - Adams - Bennett - Campbell - Dixon - Everett - Franklin - Givens - Hawkins - Lopez - Martinez - O'Connor - Ryan - Patterson - Sykes - Taylor - Walker - OPFOR: - Amin - Masood - Fahim - Habibi - Kushan - Jawadi - Nazari - Siddiqi - Takhtar - Wardak - Yousuf - INDEPENDENT: - Anthis - Costa - Dimitirou - Elias - Gekas - Kouris - Leventis - Markos - Nikas - Nicolo - Panas - Petros - Rosi - Samaras - Stavrou - Thanos - Vega - CODE NAMES: - Ghost - Stranger - Fox - Snake - Razer - Jester - Nomad - Viper - Korneedler - face can be any of the following: - AfricanHead_01 - AfricanHead_02 - AfricanHead_03 - AsianHead_A3_01 - AsianHead_A3_02 - AsianHead_A3_03 - GreekHead_A3_01 - GreekHead_A3_02 - GreekHead_A3_03 - GreekHead_A3_04 - GreekHead_A3_05 - GreekHead_A3_06 - GreekHead_A3_07 - GreekHead_A3_08 - GreekHead_A3_09 - PersianHead_A3_01 - PersianHead_A3_02 - PersianHead_A3_03 - NATOHead_01 - WhiteHead_02 - WhiteHead_03 - WhiteHead_04 - WhiteHead_05 - WhiteHead_06 - WhiteHead_07 - WhiteHead_08 - WhiteHead_09 - WhiteHead_10 - WhiteHead_11 - WhiteHead_12 - WhiteHead_13 - WhiteHead_14 - WhiteHead_15 - speaker can be any of the following: - Male01ENG - Male01ENGB - Male01GRE - Male01PER - Male02ENG - Male02ENGB - Male02GRE - Male02PER - Male03ENG - Male03ENGB - Male03GRE - Male03PER - Male04ENG - Male04ENGB - Male04GRE - Male05ENG - Male06ENG - Male07ENG - Male08ENG - Male09ENG - In ArmA 3 1.04+ these settings can also be set individually without description.ext editing by using the following commands: setFace, setName, setNameSound, setSpeaker, setPitch - (August 4, 2006) - Notes from before the conversion: - The definition format in the Description.ext file is: - class CfgIdentities + (22 Mar, 2010) + Can be used with primaryWeapon to select the primary weapon. + An example with muzzle care (see Dr_EyeBall note) : + if ( (primaryWeapon player) != "") then { - class John_Doe + private['_type', '_muzzles']; + _type = primaryWeapon player; + // check for multiple muzzles (eg: GL) + _muzzles = getArray(configFile "cfgWeapons" _type "muzzles"); + if (count _muzzles 1) then { - name = "John Bartholemew Doe"; - face = "Face20"; - glasses = "None"; - speaker = "Dan"; - pitch = 1.1; + player selectWeapon (_muzzles select 0); + } + else + { + player selectWeapon _type; }; }; - In Operation Flashpoint, - Name can be any string. - Face can take any of the following values: - Male: "Face1"... to "Face52", "Face99" & "FaceR01" to "Face R04" - Female: "Eva", "Kamila", "Lada", "Lucie", "Marketa" & "Nada" - Glasses can take the following values: "None", "Spectacles" & "Sunglasses" - Speaker determines which voice is used and can take any of the following values: - "Adam" - "Dan" - "George" - "Greg" - "John" - "Jonah" - "Marc" - "Patrick" - "Paul" - "Peter" - "Rich" - "Rob" - "Ted" - "Tom" - "Nikolai" - "Vitaliy" - "Sergey" - "Oleg" - "Ruslan" - "Aleksei" - "Andrei" - "Boris" - "Georgiy" - "Vadim" - "Vladimir" - "Ivan" - Pitch sets the tone of voice. 1.0 for normal; 1.0 for deep; 1.0 for high pitched - - (November 18, 2006) - Preview of all faces in Armed Assault can be found on Czech Biki - - (May 10, 2008) - Glasses and Female faces do not work as of Arma patch 1.12beta. - Nothing + Nothing + - setImportance + diag_setLightNew - Sets the importance value of location. + Overrides currently used scene lightning. The operand is config that is placed as a string (not file). The changes may not be applied immediately, but can be forced by the call of simulWeatherSync. + Command is only available when using Arma 3 Diagnostics Exe on Dev-Branch. - https://community.bistudio.com/wiki/setImportance + https://community.bistudio.com/wiki/diag_setLightNew - Location setImportance Number + diag_setLightNew String - location setImportance value + diag_setLightNew config - $Code$myLocation setImportance 2$/Code$ + $Code$diag_setLightNew "sunOrMoon = 1; diffuse[] = { 0, 0, 0, 0 }; diffuseCloud[] = { 0, 0, 0, 0 }; ambient[] = { 0, 0, 0, 0 };... "$/Code$ undefined / undefined @@ -58301,383 +59681,409 @@ - Nothing + Nothing + - setLeader + isServer - Set the leader of given team. Effect is local, unless both leader unit and team are local to PC on which command is executed, then effect is global. + Returns true if the machine (executing the command) is the server in a multiplayer game or is running single player. isServer will return true for both, dedicated server and player hosted. Dedicated server could be detected with isDedicated command. Hosted by player server can be detected by presense of UI: isServer && hasInterface - https://community.bistudio.com/wiki/setLeader + https://community.bistudio.com/wiki/isServer - Team_Member setLeader Team_Member + isServer - team setLeader leader + isServer - + $Code$if (! isServer ) exitWith {};$/Code$ + - local / local + undefined / undefined + (April 8, 2011) + You can use isServer inside the condition of a trigger to have the trigger activate only for the server. All other conditions for the trigger will be checked across all machines, but it will only activate the trigger created on the server. For example: $Code$this && isServer $/Code$ + + (December 21, 2014) + $Code$ if ( isDedicated ) then { + //run on dedicated server only + }; + if ( isServer ) then { + //run on dedicated server or player host + }; + if ( hasInterface ) then { + //run on all player clients incl. player host + }; + if (! isDedicated ) then { + //run on all player clients incl. player host and headless clients + }; + if (! isServer ) then { + //run on all player clients incl. headless clients but not player host + }; + if (! hasInterface ) then { + //run on headless clients and dedicated server + }; + if (! hasInterface && ! isDedicated ) then { + //run on headless clients only + };$/Code$ - Nothing + Boolean + - setLightAmbient + isAgent - Set ambient color of light. This includes surfaces that face away from the light, unlike setLightColor. + Check if team member is an agent. - https://community.bistudio.com/wiki/setLightAmbient + https://community.bistudio.com/wiki/isAgent - Object setLightAmbient Array + isAgent Team_Member - light setLightAmbient [r, g, b] + isAgent teamMember - $Code$myLight setLightAmbient [0.5,0,0]; //produces red light around the origin source$/Code$ - + - local / local + undefined / undefined - (Dec 1, 2006) - Light can be created with command createVehicleLocal with special vehicle class "#lightpoint" - for example: - $Code$_light = "#lightpoint" createVehicleLocal pos; - _light setLightBrightness 1.0; - _light setLightAmbient [0.0, 1.0, 0.0]; - _light setLightColor [0.0, 1.0, 0.0]; - _light lightAttachObject [_object, [0,0,0]]; - $/Code$ - - (Aug 17, 2007) - To clarify: - setLightAmbient - Terrain and surrounding objects are bathed in this colour. - setLightColor - Controls the "haze" seen around the lightsource (ex flares). - - (Mar 25, 2014) - When both setLightAmbient and setLightColor were [0,0,0], there won’t be any visual presentation on the light source. + (May 19, 2017) + One can check if a unit is an agent via + $Code$ isAgent teamMember _unit$/Code$ - Nothing + Boolean + - setLightAttenuation + allVariables - Sets attenuation of light. Standard method of attenuation (1 / (constant + linear*dist + quadratic*dist*dist)). start param represents distance, where the attenuation starts to take effects (dist = distance - start). + Returns a list of all variables from desired namespace. Namespaces supported: + Control + Team_Member + Namespace + Object + Group + Task + Location - https://community.bistudio.com/wiki/setLightAttenuation + https://community.bistudio.com/wiki/allVariables - Object setLightAttenuation Array + allVariables Control/Team_Member - light setLightAttenuation [start, constant, linear, quadratic, hardlimitstart, hardlimitend] + allVariables namespace - $Code$myLight setLightAttenuation [2,4,4,0,9,10];$/Code$ + $Code$_allVarsUINamespace = allVariables uiNamespace ;$/Code$ + + $Code$_allVarsTrigger = allVariables trigger1;$/Code$ - local / local + undefined / undefined - (Mar 25, 2014) - (A3 1.14) setLightAttenuation array will present fallowing visual effects: - [start(SCALAR), constant(SCALAR), linear (SCALAR), quadratic(SCALAR)] - start(SCALAR) – Number can be unlimited, this parameter determines the range that the light source takes effect. Terrain environmental color will be bathed by ‎setLightAmbient within the range and its covered objects will reflect the color by ‎setLightColor. - constant(SCALAR) – Support signed number, this parameter determines the brightness proportion of the light source, higher the number is, less the brightness will be, vice versa. Any minus value passed will be treated as 0 (100% brightness). In other words, this parameter is related with ‎‎setLightBrightness and ‎setLightIntensity. - linear (SCALAR) – Support signed number, effective range is from 0 ~ 100 (passed minus value will be treated as 0), this parameter determines the concentration of the light source, higher the number is, more will the light concentrate, vice versa. In other words, this parameter will turn the source into spotlight and sharpens its light circle border. - Please pay attention to a special value: 4.31918e-005 - e.g. - $Code$ - _light setLightAttenuation [2,4, 4.31918e-005,0]; //This value will make the light source reach an ultra high effect range. Any initial param set before will be discarded and overwritten. - $/Code$ - quadratic(SCALAR) – Support signed number (range unlimited, passed minus number will be treated as 0), this parameter determines the range that the light source is visible and its visual presentation looks similar to linear. 0 means the maximum visible range. In further explanation, a less bright source can’t be seen out of the range on the land but still visible on the sea, and a bright enough source won’t be effected by the passed range who is still visible out of the range. - Please pay attention to a special value: 4.31918e-005 - e.g. - $Code$ - _light setLightAttenuation [6,0,0, 4.31918e-005 ]; //This value will make the light source reach an ultra high effect range. Any initial param set before will be discarded and overwritten. - $/Code$ + (June 11, 2016) + Using profileNamespace and uiNamespace with this command has been disabled in multiplayer. [1] + + (October 1, 2016) + One still can use allVariables in Multiplayer against profileNamespace and uiNamespace using config parser. In Description.ext + $Code$_EXEC(somevar = allVariables profileNamespace)$/Code$ + in code + $Code$_allprofilevars = parsingNamespace getVariable "somevar"$/Code$ + but list will be valid only at the moment of parsing config. - Nothing + Array + - setLightBrightness + taskParent - Set brightness of light. + Return the parent task of the specified task. - https://community.bistudio.com/wiki/setLightBrightness + https://community.bistudio.com/wiki/taskParent - Object setLightBrightness Number + taskParent Task - light setLightBrightness brightness + taskParent task - $Code$myLight setLightBrightness 2;$/Code$ - + - local / local + undefined / undefined - (Dec 1, 2006) - Light can be created with command createVehicleLocal with special vehicle class "#lightpoint" - for example: - $Code$_light = "#lightpoint" createVehicleLocal pos; - _light setLightBrightness 1.0; - _light setLightAmbient [0.0, 1.0, 0.0]; - _light setLightColor [0.0, 1.0, 0.0]; - _light lightAttachObject [_object, [0,0,0]]; - $/Code$ - - (Mar 24, 2014) - In ArmA3 ver1.14 setLightBrightness will overwrite the previous effect processed by setLightIntensity on the same light source, vice versa. And both of them currently play the same role on brightness, for example: $Code$_light setLightBrightness 1;// same as _light setLightIntensity 3000;$/Code$ - Nothing + Task + - setLightColor + landResult - Set diffuse color of light. Illuminates surfaces that are facing the light. + Return the result of helicopter landing position searching (performed, after land command). The value can be "Found" (position found),"NotFound" (position not found), "NotReady" (position searching is,still in progress) or empty string when wrong argument given. - https://community.bistudio.com/wiki/setLightColor + https://community.bistudio.com/wiki/landResult - Object setLightColor Array + landResult Object - light setLightColor [r, g, b] + landResult helicopter - $Code$myLight setLightColor [0.5,0,0]; //produces red$/Code$ - + - local / local + undefined / undefined - (Dec 1, 2006) - Light can be created with command createVehicleLocal with special vehicle class "#lightpoint" - for example: - $Code$_light = "#lightpoint" createVehicleLocal pos; - _light setLightBrightness 1.0; - _light setLightAmbient [0.0, 1.0, 0.0]; - _light setLightColor [0.0, 1.0, 0.0]; - _light lightAttachObject [_object, [0,0,0]]; - $/Code$ - - (Aug 17, 2007) - To clarify: - setLightAmbient - Terrain and surrounding objects are bathed in this colour. - setLightColor - Controls the "haze" seen around the lightsource (ex flares). - - (Mar 24, 2014) - 1. In ArmA3 ver 1.14 setLightColor will also change the color of the flare when setLightUseFlare, setLightFlareSize and setLightFlareMaxDistance were used on the same light source. For example: - $Code$ - _light setLightUseFlare true; - _light setLightFlareSize 2; - _light setLightFlareMaxDistance 60; - _light setLightColor [1, 1, 1]; - $/Code$ - 2. When both setLightAmbient and setLightColor were [0,0,0], there won’t be any visual presentation on the light source. - Nothing + String + - setLightDayLight + ctrlSetAutoScrollDelay - Sets if light can be used during the day. + Sets number of second before auto-scroll starts/rewinds. Setter for ctrlAutoScrollDelay. + Autorscroll is available for CT_LISTBOX and CT_CONTROLS_GROUP types of controls only. Autoscroll will wait ctrlAutoScrollDelay seconds (must be 0) and then will scroll the scroll bar down to the bottom. ctrlAutoScrollSpeed defines the speed with which scrollbar is scrolled. If ctrlAutoScrollRewind is true, the control will fade out, immediately rewind to the top, then fade in, wait ctrlAutoScrollDelay seconds and then repeat the scrolling in a loop. If user focuses on the control, autoscrolling is interrupted. - https://community.bistudio.com/wiki/setLightDayLight + https://community.bistudio.com/wiki/ctrlSetAutoScrollDelay - Object setLightDayLight Boolean + Control ctrlSetAutoScrollDelay Number - light setLightDayLight bool + control ctrlSetAutoScrollDelay delay - $Code$myLight setLightDayLight true;$/Code$ + $Code$_ctrlGroup ctrlSetAutoScrollDelay 5;$/Code$ - local / local + undefined / undefined - Nothing + Nothing + - setLightFlareMaxDistance + vestContainer - Sets max distance where the flare is visible. + Returns a cargo container of a unit's vest. - https://community.bistudio.com/wiki/setLightFlareMaxDistance + https://community.bistudio.com/wiki/vestContainer - Object setLightFlareMaxDistance Number + vestContainer Object - light setLightFlareMaxDistance distance + vestContainer unit - $Code$myLight setLightFlareMaxDistance 500;$/Code$ + $Code$hint str vestContainer player ; //2df7d600# 163942: dummyweapon.p3d$/Code$ + + $Code$hint str getMagazineCargo vestContainer player ; + // [ + //[ + //"30Rnd_65x39_caseless_mag", + //"16Rnd_9x21_Mag", + //"HandGrenade", + //"APERSMine_Range_Mag", + //"SmokeShell", + //"SmokeShellGreen", + //"Chemlight_green" + //],[ + //2, + //2, + //2, + //3, + //1, + //1, + //2 + //] + //]$/Code$ - local / local + undefined / undefined - Nothing + Object + - setLightFlareSize + deleteCollection - Sets relative size of the flare for the light. + Delete a collection. As example, used with a soldier, it'll hide the ingame model. + When targetting ArmA 2 1.06 or newer, use hideObject instead. This function is a relic from dynamic building destruction development. It is left only for compatibility with scripts created before ArmA 2 1.06, and its functionality may be changed or removed in the future. - https://community.bistudio.com/wiki/setLightFlareSize + https://community.bistudio.com/wiki/deleteCollection - Object setLightFlareSize Number + deleteCollection Object - light setLightFlareSize size + deleteCollection object - $Code$myLight setLightFlareSize 5;$/Code$ + $Code$deleteCollection unitName;$/Code$ - local / local + undefined / undefined + (August 20, 2014) + In Arma 3 deleteCollection is alias for hideObject - Nothing + Nothing + - setLightIntensity + ropeUnwind - Sets intensity of light. + Unwind rope to target length. Use relative parameter for changing rope length +/- from current length - https://community.bistudio.com/wiki/setLightIntensity + https://community.bistudio.com/wiki/ropeUnwind - Object setLightIntensity Number + ropeUnwind Array - light setLightIntensity value + ropeUnwind [rope, speed, targetLength, relative] - $Code$myLight setLightIntensity 4;$/Code$ + $Code$ropeUnwind [ ropes heli1 select 0, 3, 10];//set rope length to 10m at 3m/s$/Code$ + + $Code$ropeUnwind [ ropes heli1 select 0, 3, -5, true];//decrease rope length by 5m at 3m/s$/Code$ - local / local + undefined / undefined - (Mar 24, 2014) - In ArmA3 ver1.14 setLightIntensity will overwrite the previous effect processed by setLightBrightness on the same light source, vice versa. And both of them currently play the same role on brightness, for example: $Code$_light setLightIntensity 3000;// same as _light setLightBrightness 1;$/Code$ + (November 8, 2014) + Unwinding speed is not linear but instead automatically accelerates at the beginning and slows down at the end. + The speed also only seems to have no effect when pulling the rope in. (unless the end of the rope is not attached to anything) + High unwinding speeds (over ~250) can cause your cargo to get stuck in midair. + + (January 4, 2015) + Rope length limits are between 0.5 and 100 meters. - Nothing + Nothing + - setLightUseFlare + lbSetPictureRightColorDisabled - Sets if light has flare. + Sets the disabled color of second (right aligned) picture of the item with the given index of the listbox with id idc of the topmost user dialog to the given color. Color is in format Color. Color which consists from only zeros means disable this override. - https://community.bistudio.com/wiki/setLightUseFlare + https://community.bistudio.com/wiki/lbSetPictureRightColorDisabled - Object setLightUseFlare Boolean + lbSetPictureRightColorDisabled Array + + Control lbSetPictureRightColorDisabled Array - light setLightUseFlare bool + lbSetPictureRightColorDisabled [idc, index, color] + + control lbSetPictureRightColorDisabled [index, color] - $Code$myLight setLightUseFlare true ;$/Code$ + $Code$lbSetPictureRightColorDisabled [101, 0, [1, 1, 1, 0.25]];$/Code$ + + $Code$_ctrl lbSetPictureRightColorDisabled [0, [1, 1, 1, 0.25]];$/Code$ - local / local + undefined / undefined - (Mar 25, 2014) - 1. In ArmA3 ver 1.14 flare color can be changed via setLightColor. - 2. Flare won't have visual presentation in daytime. - 3. setLightUseFlare needs to be used together with setLightFlareSize and setLightFlareMaxDistance so that a flare can be seen. + More information on the LB command family can be found here - Nothing + Nothing - Nothing + - setLightnings + setTaskState - Changes the lightnings value smoothly during the given time (in seconds). A time of zero means there will be an immediate change. - NOTE : This command will have no effect (even though the value of lightnings changes) unless Manual Override option is selected in the editor in the Intel, which is normally off. + Set the state of a given task. + State value may be one of: + "None" + "Created" + "Assigned" + "Succeeded" + "Failed" + "Canceled" - https://community.bistudio.com/wiki/setLightnings + https://community.bistudio.com/wiki/setTaskState - Number setLightnings Number + Task setTaskState String - time setLightnings value + task setTaskState state - $Code$1800 setLightnings 0.7;$/Code$ + $Code$_tskKillSpongebob setTaskState "Succeeded";$/Code$ undefined / undefined @@ -58685,807 +60091,1008 @@ - Nothing + Nothing + - setLocalWindParams + getVehicleCargo - Sets parameters for helicopter rotor wash. Visually it affects how much the grass and bushes bend under a helicopter and how big is the area of the effect. Default [1.0, 1.0]. + Get a list of vehicles loaded as cargo inside this vehicle. The returned array is in the order the cargo vehicles were added to containing vehicle. - https://community.bistudio.com/wiki/setLocalWindParams + https://community.bistudio.com/wiki/getVehicleCargo - setLocalWindParams Array + getVehicleCargo Object - setLocalWindParams [strength, diameter] + getVehicleCargo storingVehicle - $Code$setLocalWindParams [10, 5];$/Code$ + $Code$_vehicleCargo = getVehicleCargo blackfish; // returns [] if empty$/Code$ + + $Code$_vehicleCargo = getVehicleCargo blackfish; // returns [quad_3, quad_1, quad_2] as they were loaded in this order$/Code$ - undefined / undefined + global / global - Nothing + Array + - setMagazineTurretAmmo + showCommandingMenu - Sets ammo count to given amount for given turret. - Broken when vehicle has multiple magazines of the same type + Create the commanding menu described by the given config class or menu name. When the name is empty, the current menu is hidden. + If commanding menu has "expression" set up, the expression will receive the following arguments when user activated the menu item: + Local variable _target : Object - Target under the cursor. This works in both 3D and 2D (when cursor is over the unit icon on the map). + Local variable _pos : Array - Cursor position. + Local variable _is3D : Boolean - false if cursor is over the map, otherwise true. - https://community.bistudio.com/wiki/setMagazineTurretAmmo + https://community.bistudio.com/wiki/showCommandingMenu - Object setMagazineTurretAmmo Array + showCommandingMenu String - vehicle setMagazineTurretAmmo [magazineClass, ammoCount, turretPath] + showCommandingMenu name - + $Code$showCommandingMenu "";$/Code$ + + $Code$showCommandingMenu "MyClassName";$/Code$ + + $Code$showCommandingMenu "#USER:Tag_Menu_myMenu_0";$/Code$ + + $Code$showCommandingMenu "RscMainMenu";$/Code$ + undefined / undefined + (July 22nd, 2012) + //This script will create a custom menu, and display it once. + MY_SUBMENU_inCommunication = + [ + ["User submenu",true], + ["Option-1", [2], "", -5, [["expression", "player sidechat ""-1"" "]], "0", "0", "\ca\ui\data\cursor_support_ca"], + ["Option 0", [3], "", -5, [["expression", "player sidechat "" 0"" "]], "1", "0", "\ca\ui\data\cursor_support_ca"], + ["Option 1", [4], "", -5, [["expression", "player sidechat "" 1"" "]], "1", "CursorOnGround", "\ca\ui\data\cursor_support_ca"] + ]; + MY_MENU_inCommunication = + [ + // First array: "User menu" This will be displayed under the menu, bool value: has Input Focus or not. + // Note that as to version Arma2 1.05, if the bool value set to false, Custom Icons will not be displayed. + ["User menu",false], + // Syntax and semantics for following array elements: + // ["Title_in_menu", [assigned_key], "Submenu_name", CMD, [["expression",script-string]], "isVisible", "isActive", optional icon path ] + // Title_in_menu: string that will be displayed for the player + // Assigned_key: 0 - no key, 1 - escape key, 2 - key-1, 3 - key-2,..., 10 - key-9, 11 - key-0, 12 and up... the whole keyboard + // Submenu_name: User menu name string (eg "#USER:MY_SUBMENU_NAME" ), "" for script to execute. + // CMD: (for main menu:) CMD_SEPARATOR -1; CMD_NOTHING -2; CMD_HIDE_MENU -3; CMD_BACK -4; (for custom menu:) CMD_EXECUTE -5 + // script-string: command to be executed on activation. (no arguments passed) + // isVisible - Boolean 1 or 0 for yes or no, - or optional argument string, eg: "CursorOnGround" + // isActive - Boolean 1 or 0 for yes or no - if item is not active, it appears gray. + // optional icon path: The path to the texture of the cursor, that should be used on this menuitem. + ["First", [0], "", -5, [["expression", "player sidechat ""First"" "]], "1", "1"], + ["Second", [2], "", -5, [["expression", "player sidechat ""Second"" "]], "1", "1"], + ["Submenu", [3], "#USER:MY_SUBMENU_inCommunication", -5, [["expression", "player sidechat ""Submenu"" "]], "1", "1"] + ]; + showCommandingMenu "#USER:MY_MENU_inCommunication"; + // Appendix, list of optional argument strings + HasRadio + CanAnswer + IsLeader + IsAlone + IsAloneInVehicle + IsCommander + VehicleCommander + CommandsToGunner + CommandsToPilot + NotEmpty + NotEmptySoldiers + NotEmptyCommanders + NotEmptyMainTeam + NotEmptyRedTeam + NotEmptyGreenTeam + NotEmptyBlueTeam + NotEmptyYellowTeam + NotEmptySubgroups + NotEmptyInVehicle + SelectedTeam + SelectedUnit + FuelLow + AmmoLow + Injured + Multiplayer + AreActions + CursorOnGroupMember + CursorOnHoldingFire + CursorOnEmptyVehicle + CursorOnVehicleCanGetIn + CursorOnFriendly + CursorOnEnemy + CursorOnGround + CanSelectUnitFromBar + CanDeselectUnitFromBar + CanSelectVehicleFromBar + CanDeselectVehicleFromBar + CanSelectTeamFromBar + CanDeselectTeamFromBar + FormationLine + FormationDiamond + SomeSelectedHoldingFire + PlayableLeader + PlayableSelected + IsWatchCommanded + IsSelectedToAdd + HCIsLeader + HCCursorOnIcon + HCCursorOnIconSelectable + HCCanSelectUnitFromBar + HCCanDeselectUnitFromBar + HCCanSelectTeamFromBar + HCCanDeselectTeamFromBar + HCNotEmpty + PlayerVehicleCanGetIn + IsXbox + IsTeamSwitch + CursorOnNotEmptySubgroups + SomeSelectedHaveTarget + CursorOnGroupMemberSelected + HCCursorOnIconSelectableSelected + HCCursorOnIconenemy + PlayerOwnRadio + CursorOnNeedFirstAID + CursorOnNeedHeal + + (July 23, 2016) + You can combine the argument strings (see the above note) together to create OR conditions. + Hence $Code$"HasRadioIsLeader"$/Code$ is true when the unit is a leader or has a radio. - Number + Nothing + - setMarkerAlphaLocal + confirmSensorTarget - Sets the marker alpha. The marker is only modified on the computer where the command is called. - When alpha equals 1, the marker is visible, but if alpha equals 0, then the marker is invisible. - Alpha can be numbers and fractions. + Sets for which Side the entity becomes a "confirmed hostile" target - a target that becomes highlighted red on the sensors display. - https://community.bistudio.com/wiki/setMarkerAlphaLocal + https://community.bistudio.com/wiki/confirmSensorTarget - String setMarkerAlphaLocal Number + Object confirmSensorTarget Array - marker setMarkerAlphaLocal alpha + vehicle confirmSensorTarget [side, isConfirmed] - $Code$"my_marker" setMarkerAlphaLocal 0.5;$/Code$ - - $Code$"enemy_convoy_marker" setMarkerAlphaLocal 0;$/Code$ + $Code$( vehicle player ) confirmSensorTarget [ west, true ];$/Code$ - undefined / local + undefined / undefined - (January 7, 2010) - - The range for 'alpha' is 0... 1 - Nothing + Nothing + - setMarkerAlpha + listRemoteTargets - Sets the marker alpha. The marker is modified on all computers in a network session. - When alpha equals 1, the marker is visible, but if alpha equals 0, then the marker is invisible. - Alpha can be numbers and fractions. + Return list of datalink targets and time for which they will be/were known - https://community.bistudio.com/wiki/setMarkerAlpha + https://community.bistudio.com/wiki/listRemoteTargets - String setMarkerAlpha Number + listRemoteTargets Side - marker setMarkerAlpha alpha + listRemoteTargets side - $Code$"my_marker" setMarkerAlpha 0.5;$/Code$ - - $Code$"enemy_convoy_marker" setMarkerAlpha 0;$/Code$ + $Code$listRemoteTargets east;$/Code$ - undefined / global + undefined / undefined - Nothing + Array + - setMarkerBrushLocal + addCuratorPoints - Selects the fill texture for the marker ("RECTANGLE" or "ELLIPSE"). Brush is the name of the subclass in CfgMarkerBrushes. - brush can be: - "Solid" - "SolidFull" (A3 only) - "Horizontal" - "Vertical" - "Grid" - "FDiagonal" - "BDiagonal" - "DiagGrid" - "Cross" - "Border" (A2/A3 only) - "SolidBorder" (OA/A3 only) + Adds or removes curator points. Points can be only in range from 0 to 1. - https://community.bistudio.com/wiki/setMarkerBrushLocal + https://community.bistudio.com/wiki/addCuratorPoints - String setMarkerBrushLocal String + Object addCuratorPoints Number - markerName setMarkerBrushLocal brush + curatorObj addCuratorPoints points - $Code$"Marker1" setMarkerBrushLocal "DiagGrid";$/Code$ + $Code$curatorModule addCuratorPoints 0.5$/Code$ - undefined / local + undefined / undefined - Nothing + Nothing + - setMarkerBrush + isStreamFriendlyUIEnabled - Selects the fill texture for the marker ("RECTANGLE" or "ELLIPSE"). Brush is the name of the subclass in CfgMarkerBrushes. - brush can be: - "Solid" - "SolidFull" (A3 only) - "Horizontal" - "Vertical" - "Grid" - "FDiagonal" - "BDiagonal" - "DiagGrid" - "Cross" - "Border" - "SolidBorder" + Returns the status of STREAM FRIENDLY UI setting in UI (OPTIONS GAME GENERAL STREAM FRIENDLY UI). - https://community.bistudio.com/wiki/setMarkerBrush + https://community.bistudio.com/wiki/isStreamFriendlyUIEnabled - String setMarkerBrush String + isStreamFriendlyUIEnabled - markerName setMarkerBrush brush + isStreamFriendlyUIEnabled - $Code$"Marker1" setMarkerBrush "DIAGGRID";$/Code$ + $Code$hint str isStreamFriendlyUIEnabled ;$/Code$ - undefined / global + undefined / undefined - Nothing + Boolean + - setMarkerColorLocal + triggerTimeoutCurrent - Sets marker color for the given marker locally. Marker color names and their corresponding RGBA values for Arma 3 could be found in here: CfgMarkerColors_Arma_3 + Returns trigger timeout or -1 if countdown is not in progress. + Note: The trigger could be local or remote but the result returned by this command will be for the trigger condition set up locally on the client that executed the command. See createTrigger for more info. - https://community.bistudio.com/wiki/setMarkerColorLocal + https://community.bistudio.com/wiki/triggerTimeoutCurrent - String setMarkerColorLocal String + triggerTimeoutCurrent Object - markerName setMarkerColorLocal color + triggerTimeoutCurrent trigger - $Code$"MarkerOne" setMarkerColorLocal "ColorBlack";$/Code$ + $Code$_remaining = triggerTimeoutCurrent _trigger;$/Code$ global / local + (November 26, 2013) + Triggers have their own schedule. If you create a trigger with timeout and try to read triggerTimeoutCurrent immediately it will return -1. This is because the countdown will not start until the next scheduled trigger check is due, and this could take up to 0.5 seconds. - Nothing + Number + - setMarkerColor + waypointTimeout - Sets marker color. Marker color names and their corresponding RGBA values for Arma 3 could be found in here: CfgMarkerColors_Arma_3 + Gets the waypoint timeout values. - https://community.bistudio.com/wiki/setMarkerColor + https://community.bistudio.com/wiki/waypointTimeout - String setMarkerColor String + waypointTimeout Array - markerName setMarkerColor color + waypointTimeout waypoint - $Code$"MarkerOne" setMarkerColor "ColorBlack";$/Code$ + $Code$waypointTimeout [groupOne,1]$/Code$ - undefined / global + undefined / undefined - Nothing + Array + - setMarkerDirLocal + clearMagazinePool - Sets the orientation of the marker. Angle is in degrees. + Remove all magazines from the magazine pool, of which the player may choose in the following missions. Available in campaigns only. - https://community.bistudio.com/wiki/setMarkerDirLocal + https://community.bistudio.com/wiki/clearMagazinePool - String setMarkerDirLocal Number + clearMagazinePool - markerName setMarkerDirLocal angle + clearMagazinePool - $Code$"Marker1" setMarkerDirLocal 90;$/Code$ - + - undefined / local + undefined / undefined - Nothing + Nothing + - setMarkerDir + lnbCurSelRow - Sets the orientation of the marker. Angle is in degrees. + Returns the index of the selected row id 2D listbox. - https://community.bistudio.com/wiki/setMarkerDir + https://community.bistudio.com/wiki/lnbCurSelRow - String setMarkerDir Number + lnbCurSelRow Number + + lnbCurSelRow Control - markerName setMarkerDir angle + lnbCurSelRow idc + + lnbCurSelRow ctrl - $Code$"Marker1" setMarkerDir 90;$/Code$ + $Code$lnbCurSelRow _ctrl;$/Code$ - undefined / global + undefined / undefined + (Sep 9 2014) + (A3 1.28)As for invisible data processing, lnbAddArray, lnbAddColumn, lnbData, lnbGetColumnsPosition, lnbSetColumnsPos, lnbSetData, lnbSetText, lnbSetValue, lnbText and lnbValue store data types into exact position of the listNbox with different spaces. Accessing data with coordinate command at nearly the same syntax: + $Code$ + //Set same value to one position of a Control + _ctrl lnbSetData [ [0,0],"#1"]; + lnbSetColumnsPos [102, [0,1], 1]; + _ctrl lnbSetText [ [0,1], "#1"]; + _ctrl lnbSetValue [ [0,0],1]; + //Accessing the value disregard affecting one another. + _ctrl lnbData [0,0]; //"#1" + lnbGetColumnsPosition _ctrl //[1]; + _ctrl lnbText [0,0];//"#1" + _ctrl lnbValue [0,0];//1 + $/Code$ + For a direct visible control over CT_LISTNBOX: + $Code$ + 0 = [_CT_LISTNBOX] spawn { + private ["_CT_LISTNBOX","_color","_current","_pic"]; + disableSerialization ; + _CT_LISTNBOX = _this select 0; + { + _CT_LISTNBOX lnbAddRow [ getText (_x "displayNameShort"), getText (_x "displayName")]; + _CT_LISTNBOX lnbSetPicture [ [_foreachIndex,0], getText (_x "texture")]; + } forEach (" isClass _x" configClasses ( configFile "CfgRanks")); + _CT_LISTNBOX lnbSetCurSelRow 0; + _current = lnbCurSelRow _CT_LISTNBOX; + _color = _CT_LISTNBOX lnbColor [_current,0]; + _CT_LISTNBOX lnbSetColor [ [_current,1], [(_color select 0)/2,0,0,1] ]; + _CT_LISTNBOX lnbDeleteColumn 0; + _CT_LISTNBOX lnbDeleteRow 1; + sleep 1; + lnbClear _CT_LISTNBOX;//Clear all items but control still remains just invisible. + }; + $/Code$ + A combined use of both invisible and visible data processing commands alive the Control. - Nothing + Number - Number + - setMarkerPosLocal + drawIcon3D - Moves the marker. Pos format is Position2D. + Draws an ingame icon at a given position. Command has to be executed each frame. Use onEachFrame or addMissionEventHandler "Draw3D" - https://community.bistudio.com/wiki/setMarkerPosLocal + https://community.bistudio.com/wiki/drawIcon3D - String setMarkerPosLocal Array + drawIcon3D Array - markerName setMarkerPosLocal pos + drawIcon3D [texture, color, pos, width, height, angle, text, shadow, textSize, font, textAlign, drawSideArrows] - $Code$"MarkerOne" setMarkerPosLocal getMarkerPos "MarkerTwo";$/Code$ + $Code$// Icon and text: + onEachFrame { + drawIcon3D ["targetIcon.paa", [1,1,1,1], getPos cursorTarget, 1, 1, 45, "Target", 1, 0.05, "TahomaB"]; + };$/Code$ + + $Code$// Just text: + addMissionEventHandler ["Draw3D", { + drawIcon3D ["", [1,0,0,1], position cursorTarget, 0, 0, 0, "Target", 1, 0.05, "PuristaMedium"]; + }];$/Code$ - undefined / local + undefined / undefined + (August 31, 2013) + As command syntax indicates, this command expects icon position in format PositionAGL meaning that over the land it expects PositionATL and over the sea PositionASLW. Use additional ASLToAGL if needed. + To draw smooth moving icon for a moving object use visiblePosition and visiblePositionASL accordingly. + This command works well with addon textures, however getting it to display mission textures is a bit tricky. Follow this guide. + + (April 19, 2014) + You should rely exclusively on modelToWorldVisual for a moving object's icon position if you want it to accurately stay at the correct height over the sea. + Width, height, and textSize are proportional to the user's interface size, which can optionally be compensated against via size / ( getResolution select 5) + Additionally, width and height are inversely proportional to the fovLeft and fovTop parameters from the user's ArmaProfile, and AFAIK those parameters are not retrievable via scripting. For example, a fovTop higher than the default value of 0.75 will make all 3D icons smaller vertically. I'm not sure if this is a bug or by design, however it is definitely annoying to take into account. + + (October 23, 2014) + drawIcon3D and BIS_fnc_addStackedEventHandler work well together. + Using formatting commands with drawIcon3D will not work, instead, they will be added to the string. + $Code$["uniqueID", "onEachFrame", + { + drawIcon3D["myIcon.jpg", [1,1,1,0.5], getPos player, 1, 1, 0, format["%1\n%2", "Dreaded", "Entity"]]; + }] call BIS_fnc_addStackedEventHandler;$/Code$ + Shown text will be Dreaded\nEntity. (A3 1.32.127785) + The "text" parameter must be a string. You cannot use Structured_Text. + $Code$["uniqueID", "onEachFrame", + { + drawIcon3D + [ + "myIcon.jpg", + [1,1,1,0.5], + getPos player, + 1, + 1, + 0, + parseText format[" t size='1.25' font='PuristaLight' color='#ff0000' %1%2 /t ", Dreaded, Entity] + ]; + }] call BIS_fnc_addStackedEventHandler;$/Code$ + (A3 1.32.127785) + + (November 13 (2014)) + Here's a practical example combining both drawLine3D and drawIcon3D. Note: You may want to use visiblePosition instead of getPos for moving objects. + $Code$DEADPILOTS = []; + { + if (getText (configfile "CfgVehicles" typeOf _x "textSingular") == "pilot") then { + DEADPILOTS pushBack _x; + }; + } forEach allDeadMen; + addMissionEventHandler ["Draw3D", { + if ( + { + player distance _x = 15 + } count DEADPILOTS 0 + ) then { + { + _corpsePos = getPos _x; + if (player distance _corpsePos = 15) then { + _line1_start = _corpsePos; + _line1_end = [(_line1_start select 0), (_line1_start select 1), 0.5]; + _line2_start = [(_line1_end select 0), (_line1_end select 1) + 0.5, (_line1_end select 2)]; + drawLine3D [_line1_start, _line1_end, [0,0,0,0.5]]; + drawLine3D [_line1_end, _line2_start, [0,0,0,0.5]]; + drawIcon3D ["\a3\ui_f\data\gui\cfg\hints\BasicLook_ca.paa", [0,0,0,0.5], _line2_start, 0.75, 0.75, 0]; + }; + } forEach DEADPILOTS; + }; + }]; + $/Code$ + + (April 11, 2015) + Doesn't work when showHUD false, textAlign is broken, drawSideArrows will turn if angle is not 0 [1] + + (February 11, 2016) + You can also use getPosWorld (for X and Y only, but not Z), which works splendid in script performance. Here is an example: + $Code$addMissionEventHandler ["Draw3D", { _pos = getPosWorld player; drawIcon3D ["a3\ui_f\data\gui\Rsc\RscDisplayArsenal\radio_ca.paa", [1,1,1,1], [(_pos select 0),(_pos select 1), 1], 0.8, 0.8, 0, (name player), 1, 0.0315, "EtelkaMonospacePro"]; }];$/Code$ - Nothing + Nothing + - setMarkerPos + shownUAVFeed - Moves the marker. Pos format is Position2D. + Returns true if video feed transmitted from UAV is shown. A getter for showUAVFeed - https://community.bistudio.com/wiki/setMarkerPos + https://community.bistudio.com/wiki/shownUAVFeed - String setMarkerPos Array + shownUAVFeed - markerName setMarkerPos pos + shownUAVFeed - $Code$"MarkerOne" setMarkerPos getMarkerPos "MarkerTwo"$/Code$ + $Code$_bool = shownUAVFeed ;$/Code$ - undefined / global + undefined / undefined - Effect is local in OFP. - - (March 31, 2008) - This command will not move a marker on dedicated server (if a client calls it). AI will continue to respawn at old spot if you are moving something like respawn_west. - - (August 7, 2009) - The marker position can actually be set in 3D. This has a benefit for respawn markers, when placed at the correct altitude ASL on the LHD, the correct altitude will be used for respawn. There is no particular benefit for regular markers since markerPos will still return 0 for the altitude array element. - Nothing + Boolean + - setMarkerShapeLocal + vectorMagnitude - Selects the shape (type) of the marker. - Shape can be "ICON", "RECTANGLE" or "ELLIPSE". + Magnitude of a 3D vector. - https://community.bistudio.com/wiki/setMarkerShapeLocal + https://community.bistudio.com/wiki/vectorMagnitude - String setMarkerShapeLocal String + vectorMagnitude Array - markerName setMarkerShapeLocal shape + vectorMagnitude vector - $Code$"Marker1" setMarkerShapeLocal "RECTANGLE";$/Code$ + $Code$_size = vectorMagnitude [0,3,4]; //5$/Code$ + + $Code$_speed = vectorMagnitude velocity player ; // return velocity of player in m/s + _speed = ( vectorMagnitude velocity player ) * 3.6; // return velocity of player in Km/h + _speed = ( vectorMagnitude velocity player ) * 2.23694; // return velocity of player in mph$/Code$ - undefined / local + undefined / undefined + (28 Jun, 2014) + (ArmA3 1.22)Algorithm: + $Code$ + Vector = [x,y,z]; + Result = sqrt ((x ^ 2) + (y ^ 2) + (z ^ 2)) + $/Code$ + It is recommended to use vectorMagnitude instead of BIS_fnc_magnitude. - Nothing + Number + - setMarkerShape + handgunWeapon - Selects the shape (type) of the marker. - Shape can be "ICON", "RECTANGLE", "ELLIPSE" or "POLYLINE". + Returns the name of a unit's handgun (an empty string if there is none). - https://community.bistudio.com/wiki/setMarkerShape + https://community.bistudio.com/wiki/handgunWeapon - String setMarkerShape String + handgunWeapon Object - markerName setMarkerShape shape + handgunWeapon unit - $Code$"Marker1" setMarkerShape "RECTANGLE";$/Code$ + $Code$hint handgunWeapon player ; //"hgun_P07_F"$/Code$ - undefined / global + global / undefined - Nothing + String + - setMarkerSizeLocal + set - Set marker size. - Size is in format [a-axis, b-axis]. + Changes the element at the given (zero-based) index of the array. + If the element does not exist, resize index+1 is called to create it. - https://community.bistudio.com/wiki/setMarkerSizeLocal + https://community.bistudio.com/wiki/set - String setMarkerSizeLocal Array + Array set Array - markerName setMarkerSizeLocal [a-axis, b-axis] + array set [index, value] - $Code$"MarkerOne" setMarkerSizeLocal [100, 200];$/Code$ - - - undefined / local - - - - - Nothing - - - - - setMarkerSize - - - Set marker size. - Size is in format [a-axis, b-axis]. - - - https://community.bistudio.com/wiki/setMarkerSize - - - String setMarkerSize Array - - - markerName setMarkerSize [a-axis, b-axis] - - - $Code$"MarkerOne" setMarkerSize [100, 200];$/Code$ + $Code$_arrayOne set [0, "Hello"];$/Code$ + + $Code$_arrayTwo set [ count _arrayTwo, "Bye"]; + // appends "Bye" as last element to _arrayTwo$/Code$ + + $Code$_arrayThree set [( count _arrayThree) - 1, 23]; + // replaces the last element of _arrayTwo with 23$/Code$ - undefined / global + undefined / undefined - Nothing + Nothing + - setMarkerTextLocal + set3DENLogicType - Sets the text label of an existing marker. + Sets the new type of Logic object(s). For other objects use set3DENObjectType - https://community.bistudio.com/wiki/setMarkerTextLocal + https://community.bistudio.com/wiki/set3DENLogicType - String setMarkerTextLocal String + Array set3DENLogicType String - markerName setMarkerTextLocal text + objects set3DENLogicType classname - $Code$"Marker1" setMarkerTextLocal "You are here.";$/Code$ + $Code$[ get3DENSelected "logic" select 0] set3DENLogicType "MiscOR_F";$/Code$ - undefined / local + undefined / undefined - Nothing + Nothing + - setMarkerText + setAmmo - Sets the text label of an existing marker. + Sets custom ammo count in the currently loaded magazine of the specified weapon. The unit must be local to the computer where command is executed. - https://community.bistudio.com/wiki/setMarkerText + https://community.bistudio.com/wiki/setAmmo - String setMarkerText String + Object setAmmo Array - markerName setMarkerText text + unit setAmmo [weapon, count] - $Code$"Marker1" setMarkerText "You are here.";$/Code$ + $Code$// Set player's handgun magazine ammo count to 10 rounds: + player setAmmo [ handgunWeapon player, 10];$/Code$ + + $Code$// Set player's current weapon magazine ammo count to 1 round: + player setAmmo [ currentWeapon player, 1];$/Code$ + + $Code$// If player is a gunner in a vehicle, set current weapon magazine ammo count to 5 rounds: + if ( local vehicle player ) then { + vehicle player setAmmo [ currentWeapon vehicle player, 5]; + } else { + hint "Vehicle must be local to this machine for 'setAmmo' to work"; + };$/Code$ + + $Code$// If you try to set more ammo than the magazine can hold, it will be clipped at default magazine capacity: + player setAmmo [ primaryWeapon player, 1000000]; //full mag with default ammo count$/Code$ - undefined / global + local / global - createMarker is GLOBAL in multiplayer, so all markers created with it exist for all clients. But they are not visible. Almost all setMarker commands can then be used for different effects on LOCAL clients. - BUT if you use the setMarkerText command, then the marker will become visible to all clients since the command is GLOBAL. - Nothing + Nothing + - setMarkerTypeLocal + assignedTarget - Set marker type. See cfgMarkers for a list of standard markers. + Returns the target assigned to the vehicle/unit. To unassign the target use doWatch objNull or commandWatch objNull. - https://community.bistudio.com/wiki/setMarkerTypeLocal + https://community.bistudio.com/wiki/assignedTarget - String setMarkerTypeLocal String + assignedTarget Object - markerName setMarkerTypeLocal type + assignedTarget vehicleName - $Code$"MarkerOne" setMarkerTypeLocal "Warning";$/Code$ + $Code$_target = assignedTarget _T72$/Code$ - undefined / local + local / undefined - Nothing + Object + - setMarkerType + createGearDialog - Set marker type. See cfgMarkers for a list of standard markers. + Opens gear dialog for given unit. Alternatively use action command: + $Code$ player action ["Gear", player ];$/Code$ - https://community.bistudio.com/wiki/setMarkerType + https://community.bistudio.com/wiki/createGearDialog - String setMarkerType String + createGearDialog Array - markerName setMarkerType type + createGearDialog [unit, resource] - $Code$"MarkerOne" setMarkerType "Warning";$/Code$ + $Code$createGearDialog [player];$/Code$ - undefined / global + undefined / undefined - Nothing + Nothing + - setMass + leaderboardsRequestUploadScoreKeepBest - Changes the mass of an object smoothly during the given time (in seconds). A time of zero (or using the alternative syntax) means an immediate change. + Starts async. operation to upload score to board with given name, value is only stored to board if it's better than one already in the board. The details array is optional. The board has to be initialized before the call. - https://community.bistudio.com/wiki/setMass + https://community.bistudio.com/wiki/leaderboardsRequestUploadScoreKeepBest - Object setMass Array - - Object setMass Number + leaderboardsRequestUploadScoreKeepBest Array - myObject setMass [mass, time] - - myObject setMass mass + leaderboardsRequestUploadScoreKeepBest [boardName, score, [details]] - $Code$myObject setMass [10,0.5];$/Code$ - - $Code$myObject setMass 10;$/Code$ + $Code$leaderboardsRequestUploadScoreKeepBest ["TT01", 1234, [5,6,7,8]]$/Code$ - local / global + undefined / undefined - (20 Jun, 2014) - (ArmA3 1.22) A quick reference: - category - setMass - setCenterOfMass - unit - The larger the mass is, the easier a unit will physically fatigued - N/A - aircraft - The larger the mass is, the more sensitive an aircraft will react to joystick, vice versa (Except when AFM is enabled). - Aircraft slant due to center change accordingly, and the position of the camera view will be altered relatively at the same time. (3rd person view) - vehicle - The larger the mass is, the slower a vehicle drives (Ships will sink), vice versa. (Land vehicle performs like a bouncing ball while ships accelerated pretty speedy.) - Vehicle slant due to center change accordingly. - - (March 26, 2015) - If you intend to use setMass in conjunction with ropeCreate in MP i highly recommend to first ropeCreate then setMass (on clientside). - RopeCreate in MP will set the mass of the attached object to the server value upon execution. - Nothing - Nothing + Boolean + - setMimic + fadeSound - Set person's facial expression. Following mimic values are recognized: - "Default" - "Normal" - "Smile" - "Hurt" - "Ironic" - "Sad" - "Cynic" - "Surprised" - "Agresive" - "Angry" - Since Arma 2 OA 1.6*, these values are used : - "neutral" - "dead" - "danger" - "hurt" - "aware" - "safe" - "combat" + Changes the sound volume smoothly within the given time. - https://community.bistudio.com/wiki/setMimic + https://community.bistudio.com/wiki/fadeSound - Object setMimic String + Number fadeSound Number - person setMimic mimic + time fadeSound volume - $Code$_soldier1 setmimic "angry"$/Code$ + $Code$5 fadeSound 0$/Code$ - global / local + undefined / local - To give the impression of hard faced guys going into a mission, use the setmimic "angry" command. I always have this on my guys to stop them grinning during a cutscene/mission. - - In OFP v1.96, a character will keep any facial expression you set indefinately. Setmimic to "" to return soldier to automatic facial expressions. - - (Jan 19, 2010) - Not working in Arma 2 1.05. - - (September 2, 2013) - In Arma 3 the following face expressions work: "neutral","dead","danger","hurt","aware","safe","combat". Names must be written in all lower case letters. There is another grimace in config - "unconscious", which doesn't quite work. + (January 19, 2010) + This command doesn't work, in Arma 2 1.05. - Nothing + Nothing + - setMousePosition + tvValue - Moves mouse pointer to specified position on the screen. x and y could be any number, but will be clipped so mouse never leaves the screen area. + Returns scalar data from item on given path. IDC means id of parent Tree View. - https://community.bistudio.com/wiki/setMousePosition + https://community.bistudio.com/wiki/tvValue - setMousePosition Array + tvValue Array + + Control tvValue Array - setMousePosition [x, y] + tvValue [idc, [path]] + + _ctrl tvValue [path] - $Code$setMousePosition [0.5, 0.5];$/Code$ + $Code$tvValue [101, [0]];$/Code$ + + $Code$_ctrl tvValue [0,0,0];$/Code$ - undefined / undefined + local / local + (Sep 11 2014) + (A3 1.28)tv command family overview + $Code$ + //tv command family available for CT_TREE (type 12) + private ["_count","_current","_data","_text","_value","_pic"]; + _CT_TREE tvAdd [ [],"Parent_A"]; + _CT_TREE tvAdd [ [0],"Child_A"]; + _CT_TREE tvAdd [ [0,0],"Grandchild_A"]; + _CT_TREE tvAdd [ [],"Parent_B"]; + _CT_TREE tvAdd [ [1],"Child_B"]; + _count = _CT_TREE tvCount []; //return 2 + _CT_TREE tvSetCurSel [0,0,0]; //select grandchild_A + _current = tvCurSel _CT_TREE; //return [0,0,0] + _CT_TREE tvSetData [_current,"I'm grandchild_A"]; + _data = _CT_TREE tvData _current; // "I'm grandchild_A" + _text = _CT_TREE tvText _current; //"Grandchild_A" + _CT_TREE tvSetValue [_current,14]; + _value = _CT_TREE tvValue _current; // 14 + _CT_TREE tvSetPicture [_current, getText ( configFile "CfgWeapons" "optic_NVS" "picture")]; + _pic = _CT_TREE tvPicture _current; + _CT_TREE tvExpand [1]; + _CT_TREE tvSort [[], false ]; + _CT_TREE tvSortByValue [[], false ]; + _CT_TREE tvDelete [0,0]; //remove child_b + tvClear 12; + _CT_TREE tvCollapse []; + $/Code$ - Nothing + Number - Number + - setMusicEffect + isObjectHidden - Defines the music track played on activation. - Track is a subclass name of CfgMusic. In addition, "$STOP$" (stops the current music track). + Checks visibility of a given object on the local machine. - https://community.bistudio.com/wiki/setMusicEffect + https://community.bistudio.com/wiki/isObjectHidden - Object setMusicEffect String - - Array setMusicEffect String + isObjectHidden Object - trigger setMusicEffect track - - waypoint setMusicEffect track + isObjectHidden object - $Code$_trigger setMusicEffect "Track1"$/Code$ - - $Code$[_group1,1] setMusicEffect "$STOP$"$/Code$ + $Code$_bobIsHidden = isObjectHidden bob;$/Code$ - undefined / undefined + global / local - Nothing - Nothing + Boolean + - setMusicEventHandler + get3DENCamera - Sets given music track event handler. Will overwrite other music event handlers. Use addMusicEventHandler if you want to stack them. + Returns the camera Object used by the Eden Editor. - https://community.bistudio.com/wiki/setMusicEventHandler + https://community.bistudio.com/wiki/get3DENCamera - setMusicEventHandler Array + get3DENCamera - setMusicEventHandler [type, function] + get3DENCamera - $Code$_ehID = setMusicEventHandler ["MusicStart", " hint str _this"];$/Code$ + $Code$// set exact yaw, pitch, and roll + _y = 45; _p = -80; _r = 0; + get3DENCamera setVectorDirAndUp [ + [ sin _y * cos _p, cos _y * cos _p, sin _p], + [ [ sin _r,- sin _p, cos _r * cos _p],-_y] call BIS_fnc_rotateVector2D + ];$/Code$ - $Code$_ehID = setMusicEventHandler ["MusicStop", " hint str _this"];$/Code$ + $Code$//Look at player + _a = positionCameraToWorld [0,0,0] vectorFromTo ( getPosATL player ); + _y = asin (_a select 0); + _b = [_a,_y] call BIS_fnc_rotateVector2D ; + _z = _b select 2; + _p = asin (_z / sqrt ((_b select 1)^2 + _z^2)); + get3DENCamera setVectorDirAndUp [ + _a, + [ [0,- sin _p, cos _p],-_y] call BIS_fnc_rotateVector2D + ];$/Code$ undefined / undefined @@ -59493,279 +61100,179 @@ - Number + Object + - setNameSound + setStaminaScheme - Sets the nameSound of a person. By default, when giving orders, the units are addressed by their number. When nameSound is set, it will be used instead to address the unit. For example: "Two, hold fire!", one can have: "Miller, hold fire!" + Set stamina bar color. The scheme can be "Normal", "FastDrain", "Exhausted" or "Default". - https://community.bistudio.com/wiki/setNameSound + https://community.bistudio.com/wiki/setStaminaScheme - Object setNameSound String + setStaminaScheme String - person setNameSound name + setStaminaScheme scheme - $Code$unit1 setNameSound "dixon";$/Code$ - - $Code$unit1 setNameSound ""; // will reset to default behaviour$/Code$ - - $Code$_name = "Masood"; - unit1 setNameSound _name; - unit1 setName _name;$/Code$ + $Code$setStaminaScheme "Default";$/Code$ undefined / undefined - (September 19, 2013) - nameSound can be any preset BIS recorded name value. By default units will be called out in voice by their number. By using nameSound you can call them out by name using the following values: - Default: - Armstrong - Nichols - Tanny - Frost - Lacey - Larkin - Kerry - Jackson - Miller - McKendrick - Levine - Reynolds - BLUFOR: - Adams - Bennett - Campbell - Dixon - Everett - Franklin - Givens - Hawkins - Lopez - Martinez - OConnor - Ryan - Patterson - Sykes - Taylor - Walker - OPFOR: - Amin - Masood - Fahim - Habibi - Kushan - Jawadi - Nazari - Siddiqi - Takhtar - Wardak - Yousuf - INDEPENDENT: - Anthis - Costa - Dimitirou - Elias - Gekas - Kouris - Leventis - Markos - Nikas - Nicolo - Panas - Petros - Rosi - Samaras - Stavrou - Thanos - Vega - CODE NAMES: - Ghost - Stranger - Fox - Snake - Razer - Jester - Nomad - Viper - Korneedler - - (December 22, 2013) - setting an incorrect value like "0" or "randomString" will remove the callsign (" /* 2, */ fall back") - - (April 25, 2015) - While kylania listed available names, you can use any word you want. Available words for english can be found in configfile "RadioProtocolENG" "Words". - Nothing + Nothing + - setName + cbChecked - Sets the name of a location or a person. In Arma 3 this can be used to set name of a person but only in single player. + Returns the current state of a checkbox (CT_CHECKBOX type 77 of Dialog Control ). - https://community.bistudio.com/wiki/setName + https://community.bistudio.com/wiki/cbChecked - Object setName String - - Object setName Array - - Location setName String + cbChecked Control - object setName name - - unit setName [name, firstName, lastName] - - location setName name + cbChecked control - $Code$myLocation setName "My Location Name";$/Code$ - - $Code$player setName "New Name";$/Code$ - - $Code$player setName ["Ben Kerry","Ben","Kerry"];$/Code$ + $Code$_checked = cbChecked _myCheckBox;$/Code$ - undefined / local + undefined / undefined - (July 9, 2010‎) - Appears to be only for the 3d editor. - - (September 19, 2013‎) - Support of a person as the first parameter from Arma 3 v. 1.02. - - (April 12, 2014) - Seems to have no effect on players in Multiplayer. (ArmA 3 v1.00) - - (August 18, 2014) - Only last name will appear in command bar i.e. this setname _mynameArray will display _mynameArray select 2. If setname is used with a string : this setname "blah", nothing occurs in command bar and default randomized name is displayed. - Dealing with the units' names in a script, _x (in a foreach units group, for example) will return the "object" as B ALFA 4-1:2 or the name written in ai unit name field in editor (if exists). This context is rather a "variable name" for each object (ai) than an "identity name" as given via setname function. - Nothing - Nothing - Nothing + Boolean + - setObjectArguments + showScoretable - Set object arguments in mission editor. - i - Some Old Editor Command + Forces the score table to be shown, hidden or reset to default functionality. Forcing score table will make it show even in SP. When score table is forced opened it cannot be closed manually, when it is force closed, it cannot be opened manually. - https://community.bistudio.com/wiki/setObjectArguments + https://community.bistudio.com/wiki/showScoretable - Control setObjectArguments Array + showScoretable Number - map setObjectArguments [object,[name1,value1,]] + showScoretable force - + $Code$showScoretable 1;$/Code$ + undefined / undefined - Any_Value + Nothing + - setObjectMaterialGlobal + unassignTeam - Set the material of the given selection on all computers in a network session. + Unassigns the unit (in the case of a vehicle its commander unit) from his team. This is equal to unit assignTeam "MAIN". - https://community.bistudio.com/wiki/setObjectMaterialGlobal + https://community.bistudio.com/wiki/unassignTeam - Object setObjectMaterialGlobal Array + unassignTeam Object - obj setObjectMaterialGlobal [selection, material] + unassignTeam vehicleName - $Code$player setObjectMaterialGlobal [0, "A3\Structures_F\Data\Windows\window_set.rvmat"];$/Code$ + $Code$unassignTeam _soldier2$/Code$ - global / global + local / undefined - Nothing + Nothing + - setObjectMaterial + language - Sets material of object selection. The selection number is defined through the hiddenselection []={} array in the vehicle's config (starting with 0). + Returns current game language. - https://community.bistudio.com/wiki/setObjectMaterial + https://community.bistudio.com/wiki/language - Object setObjectMaterial Array + language - obj setObjectMaterial [selectionNumber, material] + language - $Code$car setObjectMaterial [0,"A3\Structures_F\Data\Windows\window_set.rvmat"]; - car setObjectMaterial [1,"A3\Structures_F\Data\Windows\window_set.rvmat"];$/Code$ - + - global / local + undefined / undefined - Nothing + String + - setObjectProxy + do - Set the proxy object associated with the given editor object. - i - Some Old Editor Command + Executes code. Used as part of construct, such as while, with, for and switch. The code is always executed in missionNamespace unless do is used with with as an argument. - https://community.bistudio.com/wiki/setObjectProxy + https://community.bistudio.com/wiki/do - Control setObjectProxy Array + While_Type/With_Type/For_Type/Switch_Type do Code - map setObjectProxy [object,proxy object] + construct do code - $Code$_map setObjectProxy ["_group_0", vehicle (leader _group)];$/Code$ + $Code$while {b a} do {a = a + 1};$/Code$ + + $Code$// A practical example: Repair all members of a group to such a level that they are able to stand up: + { + while {! canStand _x && alive _x } do { + _x setDamage ( damage _x - 0.01); + }; + } forEach units group unitname;$/Code$ undefined / undefined @@ -59773,289 +61280,249 @@ - Nothing + Anything + - setObjectTextureGlobal + setTerrainGrid - Set the texture of the given selection on all computers in a network session. NOTES : - Do not put global commands such this one into init field in editor and expect it to work in Multiplayer. See Talk:setObjectTextureGlobal for the explanation. - Not all objects could be textured this way. To find out, run getObjectTextures command on an object. Empty array [] usually indicates it cannot be textured. - All textures must have resolution 2^x / 2^y (e.g. 16 / 16, 16 / 32, 64 / 256, 512 / 512, etc). The largest texture size commonly supported by graphics cards and RV engine is 4096x4096 + Operation Flashpoint, VBS1 : Set desired terrain resolution (in meters). + For default landscapes, supported resolutions are: + 50 - smoothest, less lag + 25 - default in multiplayer + 12.5 - default in singleplayer + 6.25 + 3.125 - bumpiest, higher lag + If you select unsupported resolutions, nearest supported value is used instead. + Armed Assault, VBS2 : Terrain resolution is fixed, determined by the world created. This function controls terrain LOD instead (the distance in which the terrain mesh resolution starts to degrade). Higher number means less vertices are used for terrain rendering, making distant hills less smooth. Value 12.5 corresponds to selecting Terrain Detail Normal in Video options, 50 to Very Low, 3.125 to Very High. - https://community.bistudio.com/wiki/setObjectTextureGlobal + https://community.bistudio.com/wiki/setTerrainGrid - Object setObjectTextureGlobal Array + setTerrainGrid Number - obj setObjectTextureGlobal [selection, texture] + setTerrainGrid grid - $Code$player setObjectTextureGlobal [0, "\MyAddon\blue.paa"];$/Code$ - - $Code$//set up persistent texture keeper - player addEventHandler ["Take", { - ( getObjectTextures player + [ uniformContainer player getVariable "texture"]) - params ["_texUniform", "_texInsignia", "_texCustom"]; - if ( isNil "_texCustom") exitWith {}; - if (_texUniform == _texCustom) exitWith {}; - player setObjectTextureGlobal [0, _texCustom]; - false - }]; - //Example: make current uniform persistently blue - _texture = "#(rgb,8,8,3)color(0,0,1,1)"; //blue texture - player setObjectTextureGlobal [0, _texture]; //set it on player - uniformContainer player setVariable ["texture", _texture, true ]; //store it on uniform$/Code$ + $Code$setTerrainGrid 12.5$/Code$ - global / global + undefined / local - (March 8, 2015) - The effect is persistent and will be synchronized for players who join in progress. (Tested with Arma 3 v1.40) + (August 4, 2006) + Notes from before the conversion: + This is like opening up your video preferences and changing "terrain detail", i.e.: setTerrainGrid 50 = lowest detail + setTerrainGrid 3.125 = highest detail It is similar to the command setViewDistance. - (December 29, 2015) - In some cases the ".paa" files do not work. Instead you can try ".jpg" files. + (August 18, 2007) + Effects on grass: + 50: disables/removes grass altogether. + 25: grass is visible. + Lower values make grass drawn a bit further at distance. However the effect is decreasing rapidly: Grass radius of 25 is 100%. 12.5 is now like 100% + 20%, 6.25 is like 100% + 20% + 5% and 3.125 is 100% + 20% + 5% + 1%. Note these are estimates! + Demo Mission Test_VD_TD.Sara.rar : ViewDistance and TerrainGrid can be changed via RadioTriggers - (October 24, 2016) - Sometimes it could be necessary to set default material on an object for the texture to take effect: - $Code$_block = createVehicle ["Land_VR_Block_02_F", player getPos [20, getDir player ], [], 0, "CAN_COLLIDE"]; - _block setObjectMaterialGlobal [0, "\a3\data_f\default.rvmat"]; - _block setObjectTextureGlobal [0, "#(rgb,8,8,3)color(1,0,0,1)"];$/Code$ - Courtesy of Larrow + (December 15, 2019) + ArmA2 Supported Reso: + In ArmA2 you are not stuck to 50, 25, 12 etc. 45 is a lower setting then 25! + + (March 13, 2013) + ArmA 3 Multiplayer default: + Some testing indicates that the default value for Arma 3 multiplayer is 10 - just like before. 10 is between "Normal" and "High". + An user's terrain detail setting is ignored in multiplayer just like in ArmA 2. + + (November 19, 2014) + TerrainGrid values for Arma 3 1.34: + Low = 50 (NoGrass) + Standard = 25 + High = 12.5 + Very High = 6.25 + Ultra = 3.125 - Nothing + Nothing + - setObjectTexture + openDLCPage - Textures object selection with texture named in array. - Array has the form [selectionNumber, "Texture"]. - The selection number is defined through the hiddenselection []={} array in the vehicle's config (starting with 0). - NOTES : - Not all objects could be textured this way. To find out, run getObjectTextures command on an object. Empty array [] usually indicates it cannot be textured. - All textures must have resolution 2^x / 2^y (e.g. 16 / 16, 16 / 32, 64 / 256, 512 / 512, etc). The largest texture size commonly supported by graphics cards and RV engine is 4096x4096 - Supported formats:.pac,.paa,.jpg,.jpeg,.ogg,.ogv + Opens a Steam page of the app with given appId. Only works for known appId (game + linked DLCs) - https://community.bistudio.com/wiki/setObjectTexture + https://community.bistudio.com/wiki/openDLCPage - Object setObjectTexture Array + openDLCPage Number - object setObjectTexture [selectionNumber,texture] + openDLCPage dlcID - $Code$_objectname setObjectTexture [0, "\pboname\texture.paa"]; - _objectname setObjectTexture [1, "\pboname\texture2.paa"];$/Code$ - - $Code$_obj setObjectTexture [0, "#(rgb,8,8,3)color(1,0,0,1)"];$/Code$ - - $Code$_obj setObjectTexture [0, "#(argb,512,512,1)r2t(rendersurface,1.333)"];$/Code$ - - $Code$// When applying custom texture in Editor on vehicles that have randomization enabled ( Arma 3 Assets ), disable randomization first: - this setVariable ["BIS_enableRandomization", false ]; - this setObjectTexture [0,"#(rgb,8,8,3)color(1,0,0,1)"];$/Code$ + $Code$openDLCPage 288520$/Code$ - global / local + undefined / undefined - (Aug 4, 2006) - In MP this command has only local effect. If you want to change a texture on all clients, you have to execute this command on each client (or setObjectTextureGlobal ). This command has also a bug: when a saved game is loaded the texture you have set will disappear and needs to be reset. - - (December 19, 2009) - Instead of bitmaps, procedural textures can be used. - The syntax for those is #(argb,8,8,3)color(R,G,B,A), where R,G,B stands for Red, Green, Blue, and A stands for Alpha, all values can be anything between 0 and 1 (including decimals). e.g. - $Code$_obj setObjectTexture [0,'#(argb,8,8,3)color(0,1,0,1)']$/Code$ - would color myObj in flat green. See Procedural Textures for more details. - - (August 25, 2014) - Also works with absolute path and.jpg files. - $Code$_obj setObjectTexture [0, "C:\Folder\Folder\Texture.paa"]; - _obj setObjectTexture [0, "C:\Folder\Folder\Texture.jpg"];$/Code$ - Texture can also be blank: - $Code$_obj setObjectTexture [2,""];$/Code$ - This will make the texture selection invisible on certain units without an error message. In some cases this is a desirable effect - - (March 18, 2015) - It is also possible to apply texture to unit's backpack, as it also has hidden selection (unfortunately does not work for vests) - $Code$(backpackContainer player) setObjectTexture [0,'#(argb,8,8,3)color(0,0,0,1)']$/Code$ - Also keep in mind that player's custom texture is being reset when you open BIS Arsenal (even without changing any gear) - - (May 13, 2015) - You can also use the gameinternal skins: List of MH9 Skins $Code$_obj setObjectTexture [0, "\a3\air_f\heli_light_01\data\skins\heli_light_01_ext_digital_co.paa"];$/Code$ - - (October 24, 2016) - Sometimes it could be necessary to set default material on an object for the texture to take effect: - $Code$_block = createVehicle ["Land_VR_Block_02_F", player getPos [20, getDir player ], [], 0, "CAN_COLLIDE"]; - _block setObjectMaterial [0, "\a3\data_f\default.rvmat"]; - _block setObjectTexture [0, "#(rgb,8,8,3)color(1,0,0,1)"];$/Code$ - Courtesy of Larrow - Nothing + Boolean + - setObjectViewDistance + getResolution - Sets the rendering distance of objects (and shadows). + Returns an array containing all information about resolution. + The returned Array is as follow: [width, height, 2D viewport width, 2D viewport height, aspect ratio, UI scale] + Note: aspect ratio and UI scale are returned as coefficients and not 16:9 for example. - https://community.bistudio.com/wiki/setObjectViewDistance + https://community.bistudio.com/wiki/getResolution - setObjectViewDistance Number - - setObjectViewDistance Array + getResolution - setObjectViewDistance distance - - setObjectViewDistance [objectDistance, shadowDistance] + getResolution - $Code$setObjectViewDistance 2000;$/Code$ + $Code$_res = getResolution ; //some single monitor setup[ + 1360,//width + 768,//height + 867,//2D viewport width + 653,//2D viewport height + 1.77778,//aspect ratio + 0.85//UI scale + ]$/Code$ - $Code$setObjectViewDistance [2000,800];$/Code$ + $Code$_res = getResolution ; //dedicated server[ + 160,//width + 120,//height + 136,//2D viewport width + 102,//2D viewport height + 1.33333,//aspect ratio + 0.85//UI scale + ]$/Code$ + + $Code$_res = getResolution ; //some triple monitor setup[ + 5760,//width + 1080,//height + 792,//2D viewport width + 594,//2D viewport height + 5.33333,//aspect ratio + 0.55//UI scale + ]$/Code$ - undefined / local + undefined / undefined + (05:38, 20 December 2010) + This command can be usefull to play a video (see this function BIS_fnc_playVideo ) in the given format if you've compiled it for different UI scale. - Nothing - Nothing + Array + - setOvercast + isUIContext - Set overcast to given value smoothly during given time (in seconds). Zero time means immediate change. An overcast setting of zero means clear (sunny) weather, and one means storms and rain are very likely. Higher overcast values also result in higher wind speeds. + Returns true if the script originated from some UI control event, for example from "onButtonDown" EH. Exists within parent scope and immediate child scopes. - https://community.bistudio.com/wiki/setOvercast + https://community.bistudio.com/wiki/isUIContext - Number setOvercast Number + isUIContext - time setOvercast overcast + isUIContext - $Code$50 setOvercast 0.5$/Code$ + $Code$if ( isUIContext ) then { hint "UI control event"};$/Code$ + + $Code$_button ctrlSetEventHandler ['ButtonDown'," call { diag_log isUIContext }"]; // Outputs true$/Code$ + + $Code$_button ctrlSetEventHandler ['ButtonDown',"[] spawn { diag_log isUIContext }"]; // Outputs false$/Code$ - undefined / local + undefined / undefined - (August 4, 2006) - Notes from before the conversion: - Use setRain if you want to make sure it rains. - - Only one script command induced weather change (either setOvercast or setFog ) can be happening at a time. Starting a new weather change will immediately halt the current weather change. SetRain changes are independent and can occur simultaneously to a weather change. - - Arma 3 's volumetric clouds cannot be instantly changed (it would take up to a few seconds to do a full recompute). Therefore, 0 setOvercast 0 will not have the desired effect. You can use skipTime to get to the desired cloud coverage. - NOTE: To get instant, seamless overcast change to overcast 1 advance the time 24 hours with skipTime while setting overcast transition time to 86400 seconds (24 hours) -- Killzone_Kid - $Code$86400 setOvercast 1; - skipTime 24; - //to remain on the same date: - skipTime -24; - 86400 setOvercast 1; - skipTime 24; - $/Code$ - - With removal of simulSetHumidity‎, in order to add instant cloud cover, execute simulWeatherSync with delay (for now): - $Code$ skipTime -24; - 86400 setOvercast 1; - skipTime 24; - 0 = [] spawn { - sleep 0.1; - simulWeatherSync ; - };$/Code$ - There is slight freeze with simul command. - - Delay in Arma 3 doesn't work for quick changes. Using 120 setOvercast 1 only reaches full overcast after about 50 minutes. Using setTimeMultiplier does speed up the overcast, but it doesn't render any clouds. You will need to skipTime or forceWeatherChange to render clouds if you want it to happen within the hour. - - (May 4, 2016) - Actual transition time is inversely proportional to the timeMultiplier. For example, a time of 7200 (2 hours) and a timeMultiplier of 2 will result in a real-life transition time of 7200 / 2 = 3600 (1 hour). - In case of overcast, a timeMultiplier 1 will cause gradual desyncing of the cloud cover with the overcast value, so it is advised that you multiply the transition time by the multiplier, i.e. : - $Code$(7200 * timeMultiplier ) setOvercast 1$/Code$ - Nothing + Boolean + - setOwner + lbClear - From server machine, change the ownership of an object to a given client. Returns true if locality was changed. - Since Arma 3 v1.40, this command should not be used to transfer ownership of units with AI ( agents are an exception to this rule). - Using command in an unintended way will display an on-screen warning and log a message to.rpt file. - To transfer ownership of all AI units in a group properly, use setGroupOwner instead. + Clear all items in listbox or combobox with id idc of topmost user dialog. - https://community.bistudio.com/wiki/setOwner + https://community.bistudio.com/wiki/lbClear - Object setOwner Number + lbClear Number + + lbClear Control - object setOwner clientID + lbClear idc + + lbClear control - $Code$_someObject setOwner 12;$/Code$ + $Code$lbClear 101;$/Code$ - $Code$_someObject setOwner ( owner _playerObject);$/Code$ + $Code$lbClear _ctrl;$/Code$ - undefined / undefined + local / local - This scripting command must be executed on the server to work properly in multiplayer - - (January 7, 2015) - The ownership can only be given from server to client. For some reason the server cannot return ownership back with this command. This is fixed in Arma 3 1.40 + More information on the LB command family can be found here - Boolean + Nothing - Nothing + - setOxygenRemaining + vehicleReportOwnPosition - Sets oxygen remaining. It has no effect when soldier is not diving. Oxygen remaining is a number between 0 and 1. + Gets whether the vehicle shares its own position via datalink with the Side center. - https://community.bistudio.com/wiki/setOxygenRemaining + https://community.bistudio.com/wiki/vehicleReportOwnPosition - Object setOxygenRemaining Number + vehicleReportOwnPosition Object - unit setOxygenRemaining value + vehicleReportOwnPosition vehicle - $Code$player setOxygenRemaining 0; // Drowns player$/Code$ + $Code$vehicleReportOwnPosition ( vehicle player );$/Code$ undefined / undefined @@ -60063,101 +61530,86 @@ - Nothing + Boolean + - setParticleCircle + doorPhase - Updates particle source, creates particles in circle with given radius. Velocity is transformed and added to total velocity. Correspondence between CfgCloudlets class param names and command array of params: - $Code$particleSource setParticleCircle - [ - circleRadius, - circleVelocity - ];$/Code$ + Return animation phase of door on vehicle. - https://community.bistudio.com/wiki/setParticleCircle + https://community.bistudio.com/wiki/doorPhase - Object setParticleCircle Array + Object doorPhase String - particleSource setParticleCircle [radius, velocity] + object doorPhase door - + $Code$_phase = heli doorPhase "door_L";$/Code$ + undefined / undefined - Nothing + Number + - setParticleClass + clearItemPool - Set parameters from existing config class. ClassName is name of the class from CfgCloudlets. - Since version 1.11.114706 you can use setParticleParams to overwrite many values set by config class, particularity those defined in ParticleArray. + Removes all items from ammo box (or any general weapon holder container) - https://community.bistudio.com/wiki/setParticleClass + https://community.bistudio.com/wiki/clearItemPool - Object setParticleClass String + clearItemPool Object - source setParticleClass className + clearItemPool box - $Code$_source01 = "#particlesource" createVehicleLocal _pos01; - _source01 setParticleClass "ObjectDestructionFire1Smallx"; - _source01 attachTo [_object,[0,0,0]];$/Code$ + $Code$clearItemPool jeepOne$/Code$ undefined / undefined - (June 28, 2015) - This can be very useful for getting features that can't normally be added with commands, such as AI view blocking and particles that can only be above/underwater. - Nothing + Nothing + - setParticleFire + setVehicleReceiveRemoteTargets - Set fire parameters to particle effect. - Note: You need to create emitter at first. Basic parameters of particle effect must be defined too. You can use script commands setParticleClass or setParticleParams to do so (see example). Correspondence between CfgCloudlets class param names and command array of params: - $Code$particleSource setParticleFire - [ - coreIntensity, - coreDistance, - damageTime - ];$/Code$ + Sets that the vehicle will be able to receive targets acquired by someone else via datalink from the Side center. - https://community.bistudio.com/wiki/setParticleFire + https://community.bistudio.com/wiki/setVehicleReceiveRemoteTargets - Object setParticleFire Array + Object setVehicleReceiveRemoteTargets Boolean - source setParticleFire [coreIntensity, coreDistance, damageTime] + vehicle setVehicleReceiveRemoteTargets bool - $Code$_emitter = "#particlesource" createVehicleLocal ( getPos player ); - _emitter setParticleClass "MediumSmoke"; - _emitter setParticleFire [0.3,1.0,0.1];$/Code$ + $Code$( vehicle player ) setVehicleReceiveRemoteTargets true;$/Code$ undefined / undefined @@ -60165,60 +61617,32 @@ - Nothing + Nothing + - setParticleParams + set3DENAttributes - Set parameters to particle source. Array is in format ParticleArray. - Since Arma 3 version 1.11.114706 you can use this command to overwrite many values set by setParticleClass, particularity those defined in ParticleArray. Correspondence between CfgCloudlets class param names and command array of params: - $Code$particleSource setParticleParams - [ - [ - particleShape, - particleFSNtieth, - particleFSIndex, - particleFSFrameCount, - particleFSLoop - ], - animationName, - particleType, - timerPeriod, - lifeTime, - position, - moveVelocity, - rotationVelocity, - weight, - volume, - rubbing, - size, - color, - animationSpeed, - randomDirectionPeriod, - randomDirectionIntensity, - onTimerScript, - beforeDestroyScript, - this, - angle, - onSurface, - bounceOnSurface, - emissiveColor - ];$/Code$ + Set entity attributes. + An attribute is identified by its property ( data when it's engine-drive attribute) value in config. For the list of all attributes with their properties, see Setting Attributes. + ! + Attributes are available only within the Eden Editor workspace. You cannot access them in scenario preview or exported scenario! - https://community.bistudio.com/wiki/setParticleParams + https://community.bistudio.com/wiki/set3DENAttributes - Object setParticleParams Array + set3DENAttributes Array - particleSource setParticleParams array + set3DENAttributes [[ entities1, class1, value1 ],, [ entitiesN, classN, valueN ]] - $Code$see ParticleArray$/Code$ + $Code$set3DENAttributes [[ get3DENSelected "Object","ControlMP", true ]]; + // Set all selected objects as playable$/Code$ undefined / undefined @@ -60226,477 +61650,577 @@ - Nothing + Boolean + - setParticleRandom + findIf - Sets randomization of particle source parameters. Correspondence between CfgCloudlets class param names and command array of params: - $Code$particleSource setParticleRandom - [ - lifeTimeVar, - positionVar, - moveVelocityVar, - rotationVelocityVar, - sizeVar, - colorVar, - randomDirectionPeriodVar, - randomDirectionIntensityVar, - angleVar, - bounceOnSurfaceVar - ];$/Code$ + Searches for an element within array for which the code evaluates to true. Returns the 0 based index on success or -1 if not found. Code on the right side of the command is evaluated for each element of the array, processed element can be referenced in code as _x. + NOTE: Because command findIf terminates as soon as it finds an element that fulfills the condition, it is more efficient then count in scenarios where you need to check for presence / absence of at least one element that evaluates to true. - https://community.bistudio.com/wiki/setParticleRandom + https://community.bistudio.com/wiki/findIf - Object setParticleRandom Array + Array findIf Code - particleSource setParticleRandom [lifeTime, position, moveVelocity, rotationVelocity, size, color, randomDirectionPeriod, randomDirectionIntensity, angle, bounceOnSurface] + array findIf code - $Code$_PS setParticleRandom [0, [0.1, 0.1, 0.1], [0, 0, 0.5], 0, 0.1, [0, 0, 0, 0], 0, 0];$/Code$ + $Code$[unit1,unit2,unit3] findIf { ! alive _x }; //return index of first dead unit$/Code$ + + $Code$//two ways how to 'wait for all units to be dead': + waitUntil {[unit1,unit2,unit3] findIf { alive _x } == -1}; //fast, terminates as soon as it finds alive unit + waitUntil {[unit1,unit2,unit3] count { alive _x } == 0}; //slow, always goes through all array elements$/Code$ undefined / undefined - (July 03, 2013) - Support of parameter bounceOnSurface ( Number - 0-1) is in the game since Arma 3 version 0.74. It's variability in speed's loosing in collision with ground. Requires collisions with ground enabled by script command setParticleParams. - Nothing + Number + - setPiPEffect + image - Sets Render Target's visual effect (Picture-in-Picture). - 0: Normal - [0] - 1: Night Vision - [1] - 2: Thermal - [2] - 3: Color Correction - [3, enabled, brightness, contrast, offset, blend [r,g,b,a], lerp [r,g,b,a], rgb [r,g,b,a]] - 4: Mirror - [4] currently not working - 5: Chromatic Aberration - [5, enabled, powerx, powery, (bool) aspectCorrection] currently not working - 6: Film Grain - [6, enabled, intensity, sharpness, grainsize, intensityx1, intensityx2, (bool) monochromatic] currently not working - 7: Thermal Inverted [7] + Creates a structured text containing the given image. - https://community.bistudio.com/wiki/setPiPEffect + https://community.bistudio.com/wiki/image - String setPiPEffect Array + image String - name setPiPEffect [effect, optionalParam1,, optionalParamN] + image filename - $Code$"rendersurface" setPiPEffect [0];$/Code$ - - $Code$"rendertarget0" setPiPEffect [3, 1.0, 1.0, 1.0, 0.0, [0.0, 1.0, 0.0, 0.25], [1.0, 0.0, 1.0, 1.0], [0.199, 0.587, 0.114, 0.0]];$/Code$ - - $Code$cam = "camera" camCreate ( player modelToWorld [0,-5,2]); - cam cameraEffect ["internal","back","rtt"]; - "rtt" setPiPEffect [2]; - with uiNamespace do { - pic = findDisplay 46 ctrlCreate ["RscPicture", -1]; - pic ctrlSetPosition [0,0,1,1]; - pic ctrlCommit 0; - pic ctrlSetText "#(argb,512,512,1)r2t(rtt,1.0)"; - };$/Code$ - - $Code$// Black&White: - "rtt" setPiPEffect [3,1,1,0.4,0,[0,0,0,0],[1,1,1,0],[1,1,1,1]];$/Code$ + $Code$_txt1 = image "data\isniper.paa";$/Code$ undefined / undefined - (July 9, 2017) - If Color Corrections effect has been used, going back to Normal will have no effect. In order to unset Color Corrections, set 2nd param in it (enable) to 0. + (March 21, 2009) + Although there is a dedicated image command, parseText gives more options: + $Code$_imageText = parseText " img size='5' color='#ff0000' image='fish.paa'/ "$/Code$ - Nothing + Structured_Text + - setPilotCameraDirection + showCinemaBorder - Sets the direction of object airplane or helicopter pilotCamera (vector in model space). + Forces drawing of cinema borders when using custom camera camCreate. This is normally used in cutscenes to indicate player has no control. - https://community.bistudio.com/wiki/setPilotCameraDirection + https://community.bistudio.com/wiki/showCinemaBorder - Object setPilotCameraDirection Array + showCinemaBorder Boolean - object setPilotCameraDirection Vector3D + showCinemaBorder show - $Code$vehicle player setPilotCameraDirection [0,1,0] //re-centers the camera$/Code$ + $Code$showCinemaBorder false ;$/Code$ - local / undefined + undefined / undefined + (13 October 2007) + This command does only work when Mission is started. Use waitUntil { time 0}; to be sure it works. - Nothing + Nothing + - setPilotCameraRotation + updateObjectTree - Sets rotation (relative to the centered camera position) of the object airplane or helicopter pilotCamera. + Update the editor object tree. + i + Some Old Editor Command - https://community.bistudio.com/wiki/setPilotCameraRotation + https://community.bistudio.com/wiki/updateObjectTree - Object setPilotCameraRotation Array + updateObjectTree Control - object setPilotCameraRotation rotation + updateObjectTree map - $Code$vehicle player setPilotCameraRotation [ rad 90, rad 45 ]$/Code$ - + - local / undefined + undefined / undefined - Nothing + Nothing + - setPilotCameraTarget + parseText - Sets an area or target to be tracked by the object airplane or helicopter pilotCamera. - To track an object the vehicle has to have appropriate sensors ( scanners ) that can detect the given target type. - Using objNull will unlock the camera + Creates a structured text by parsing the given XML description. Do not use parseText when displaying a localized text from stringtable.xml (see notes below). - https://community.bistudio.com/wiki/setPilotCameraTarget + https://community.bistudio.com/wiki/parseText - Object setPilotCameraTarget Object/Array + parseText String - object setPilotCameraTarget target + parseText text - $Code$_pilotCamTrack = vehicle player setPilotCameraTarget [2100,4200,4.2];$/Code$ + $Code$_Stxt = parseText "First line img image='data\isniper.paa'/ br/ Second line";$/Code$ - $Code$_pilotCamTrack = vehicle player setPilotCameraTarget BIS_Edita;$/Code$ + $Code$hintSilent parseText format [" t size='1.25' font='Zeppelin33' color='#ff0000' %1 lives remaining. /t ", 12];$/Code$ + + $Code$_clickableLink = parseText " a href='http://arma3.com' A3 /a ";$/Code$ - local / undefined + undefined / undefined + (22:07, 11 May 2007 (CEST)) + You can also colorate your text. You just have to use following tag: + t color='#ffff00' Your yellow text! /t + To change the size of your text, use this command: + t size='2.2' Your bigger text! /t + To change text font, use: + t font='Zeppelin33' Bold Text /t + To change horizontal alignment, use (parameter can be 'left', 'center', 'right'): + t align='center' Centered Text /t + To change vertical alignment within a line, use (parameter can be 'top', 'middle', 'bottom'): + t valign='bottom' Text at Line Bottom /t + To underline text, use: + t underline='true' Underlined Text /t + To put shadow under text, use: + t shadow='true' t shadowColor='#ff0000' Text with Red Shadow /t /t + Following statements are valid too: + t underline='1' Underlined Text /t + t shadow='1'shadowColor='#ff0000' Green shadow text /t + Following fonts are valid (got from config): + t font='Zeppelin32' Zeppelin32 (normal text) /t + t font='Zeppelin33' Zeppelin33 (bold text) /t + t font='Zeppelin33Italic' Zeppelin33Italic (bold italic text) /t + t font='Bitstream' Bitstream (same as Zeppelin32) /t + t font='TahomaB' TahomaB (same as Zeppelin32) /t + t font='LucidaConsoleB' LucidaConsoleB (like Courier) /t + + (21 March 2009) + Although there is a dedicated image command, parseText gives more options: + img size='5' color='#ff0000' image='fish.paa'/ + + (1 September 2016) + To convert a structured text back to a string type, just use: + _str = str parseText _structuredText; + + (September 1, 2017) + If you are parsing user-defined strings like player names, you may want to convert special characters to their XML entities as a precaution beforehand: + $Code$private _encodeText = + { + private _specialChars = [38, 60, 62, 34, 39]; // & " ' + private _convertTo = [[38,97,109,112,59], [38,108,116,59], [38,103,116,59], [38,113,117,111,116,59], [38,97,112,111,115,59]]; // + private _chars = []; + private "_i"; + { + _i = _specialChars find _x; + if (_i isEqualTo -1) then { _chars pushBack _x } else { _chars append (_convertTo select _i) }; + } forEach toArray param [0,"",[""]]; + toString _chars + }; + private _encodedName = _name call _encodeText; + private _redName = parseText format [" t color='#ff0000' %1 /t ", _encodedName]; $/Code$ - Boolean + Structured_Text + - setPilotLight + camSetFocus - Switches headlights of a vehicle on/off. Note that the vehicle has to be local, for global variant use Arma 3 Actions " LightOn "/" LightOff " + Sets camera focus range in format [distance, blur]. blur param - sets the camera focus blur. It does not automatically commit changes (see camCommit ). Use [-1, -1] to disable focus completely. - https://community.bistudio.com/wiki/setPilotLight + https://community.bistudio.com/wiki/camSetFocus - Object setPilotLight Boolean + Object camSetFocus Array - vehicle setPilotLight set + camera camSetFocus focusRange - $Code$car setPilotLight true ;$/Code$ + $Code$_camera camSetFocus [50, 1];$/Code$ - local / global + undefined / undefined - Nothing + Nothing + - setPitch + ctrlSetPosition - Sets the pitch of a persons voice. + Sets wanted position and size for 2D control animation. Width and height are optional. ctrlCommit is required to complete the operation. For 3D control, param is relative [x,y,z] and no ctrlCommit is required as it cannot be animated. - https://community.bistudio.com/wiki/setPitch + https://community.bistudio.com/wiki/ctrlSetPosition - Object setPitch Number + Control ctrlSetPosition Array - person setPitch pitch + controlName ctrlSetPosition [x, y] + + controlName ctrlSetPosition [x, y, w, h] + + controlName ctrlSetPosition [x, y, z] - $Code$unit1 setPitch 1$/Code$ + $Code$// Move control: + _control2D ctrlSetPosition [0, 0]; + _control2D ctrlCommit 0;$/Code$ + + $Code$// Move control and resize: + _control2D ctrlSetPosition [0, 0, 1, 1]; + _control2D ctrlCommit 0;$/Code$ + + $Code$_control3D ctrlSetPosition [0.5, 1, 0.5]; //centered and 1m away from screen$/Code$ - undefined / local + undefined / undefined + (January 27, 2007) + IMPORTANT + You have to use ctrlCommit command to apply this effect(Arma v1.02.5103GER) + + (May 22, 2017) + If the target ctrl is part of a ctrlGroup, the position needs to be relative to the ctrlGroup position. + + (July 20, 2017) + If the target control is a controls' group, all the child controls of that group will be moved automatically (as their position is relative to the control group rather than the display) - Nothing + Nothing + - setPlayable + vectorWorldToModel - Create MP role for the unit. The roles created this way are used for Join In Progress and Team Switch. - NOTE: Currently in Arma 3 this command does nothing. - Doesn't work as intended + Converts vector direction from world to model space. - https://community.bistudio.com/wiki/setPlayable + https://community.bistudio.com/wiki/vectorWorldToModel - setPlayable Object + Object vectorWorldToModel Array - setPlayable unitName + object vectorWorldToModel worldDir - $Code$setPlayable _aPerson$/Code$ + $Code$// Convert world space vector [0,-10,4] to model space of object _airplane: + _airplane vectorWorldToModel [0,-10,4];$/Code$ undefined / undefined - (december 19, 2009) - if you want to add a TeamSwitchable unit (at least in Arma2), better use addSwitchableUnit - Nothing + Array + - setPlayerRespawnTime + missionConfigFile - Sets the time interval to wait on player respawn. It resets to mission default on mission start. In Single Player or when respawn type is GROUP or SIDE in Multiplayer, setting player respawn time has no effect and is always -1. + Return root of mission Description.ext entries hierarchy. + ! + Since introduction of the Eden Editor, scenario attributes can be configured in the editor itself, not only in the external Description.ext file. To access desired value independently on where it's stored, use the following commands instead: + getMissionConfigValue + getMissionConfig - https://community.bistudio.com/wiki/setPlayerRespawnTime + https://community.bistudio.com/wiki/missionConfigFile - setPlayerRespawnTime Number + missionConfigFile - setPlayerRespawnTime interval + missionConfigFile - $Code$setPlayerRespawnTime 5;$/Code$ + $Code$for "_i" from (0) to (( count paramsArray ) - 1) do { + missionNamespace setVariable [ configName (( missionConfigFile /"Params") select _i), paramsArray select _i]; + };$/Code$ + + $Code$// To define custom values in description.ext : + class myMissionConfig + { + class mySetup + { + myNumber = 3; + myArray[] = { 1, 2, 3 }; + myText = "LOL"; + }; + }; + // To read defined custom values from a script:_myNumber = getNumber ( missionConfigFile "myMissionConfig" "mySetup" "myNumber"); + _myArray = getArray ( missionConfigFile "myMissionConfig" "mySetup" "myArray"); + _myText = getText ( missionConfigFile "myMissionConfig" "mySetup" "myText");$/Code$ + + $Code$// To get file path with description.ext to play sound via playSound3D : + _filePath = [( str missionConfigFile ), 0, -15] call BIS_fnc_trimString ;$/Code$ + + $Code$// Obtaining mission root using A3 substring functionality + MISSION_ROOT = str missionConfigFile select [0, count str missionConfigFile - 15];$/Code$ - undefined / local + undefined / undefined + (February 17, 2015) + missionConfigFile can be used to parse mission.sqm file data as well if it is included into description.ext : + class MissionSQM + { + #include "mission.sqm" + }; + Then mission.sqm data can be accessed like this: + $Code$ getNumber ( missionConfigFile "MissionSQM" "version"); //12 - version param in mission.sqm $/Code$ + (courtesy of Master85 ) - Nothing + Config + - setPosASL2 + enableFatigue - Sets the object position. The pos array uses the PositionASL format. The version of the command does not offset based on object center. - Appears to be broken + Enables/Disables the person's fatigue. - https://community.bistudio.com/wiki/setPosASL2 + https://community.bistudio.com/wiki/enableFatigue - Object setPosASL2 Array + Object enableFatigue Boolean - obj setPosASL2 pos + unit enableFatigue enable - $Code$player setPosASL2 [ getPosASL player select 0, ( getPosASL player select 1) + 10, getPosASL player select 2]$/Code$ + $Code$player enableFatigue false ;$/Code$ + + $Code${ _x enableFatigue false ; } forEach ( units group player );$/Code$ - undefined / undefined + local / global - (21 Aug, 2013) - This command appears to do nothing in both Arma 2 and Arma 3. Tested on 21-08-2013. + (March 24, 2015) + When the player dies enableFatigue is set to true after the respawn + + (January 27, 2016) + To precise the note of Harmdhast, this command is not persistent (after respawn). So, in MP, you'll have to enableFatigue false, also in onPlayerRespawn.sqf or through the MP eventHandler MPRespawn. - Nothing + Nothing + - setPosASLW + configHierarchy - Sets the object position above sea surface. The pos array uses the PositionASLW format. + Returns hierarchy of the given config class. Just like with inheritsFrom, only complete config classes are supported - https://community.bistudio.com/wiki/setPosASLW + https://community.bistudio.com/wiki/configHierarchy - Object setPosASLW Array + configHierarchy Config - obj setPosASLW pos + configHierarchy configClass - $Code$_diver setPosASLW [( position _diver) select 0, ( position _diver) select 1, -10];$/Code$ + $Code$_hierarchy = configHierarchy ( configFile "CfgVehicles" "Car"); + //[bin\config.bin,bin\config.bin/CfgVehicles,bin\config.bin/CfgVehicles/Car]$/Code$ - global / global + undefined / undefined - Nothing + Array + - setPosASL + mapAnimAdd - Sets the object position above sea level. The pos array uses the PositionASL format. + Add next frame to map animation. - https://community.bistudio.com/wiki/setPosASL + https://community.bistudio.com/wiki/mapAnimAdd - Object setPosASL Array + mapAnimAdd Array - object setPosASL pos + mapAnimAdd [time, zoom, position] - $Code$player setPosASL [ getPosASL player select 0, ( getPosASL player select 1) + 10, getPosASL player select 2];$/Code$ + $Code$mapAnimAdd [1, 0.1, markerPos "anim1"]; + mapAnimCommit ;$/Code$ - $Code$this setPosASL [ position this select 0, position this select 1, 9]; //[ X, Y, Z]$/Code$ + $Code$mapAnimAdd [3, 0.01, player ]; + mapAnimCommit ;$/Code$ - global / global + local / local + (05:26, 2 February 2007) + In OFP v1.96, the mapAnim series of commands, together with forceMap can only be used in the intro and mission, as it is not possible to access the map from the outro. (not checked, sourced from an old copy of the OFPEC comref) - Nothing + Nothing + - setPosATL + addEventHandler - Sets the position of an object relative to the terrain. + Adds event handler (EH) to the given object and returns EH handle. If EH has some data to return upon event (e.g. the "killed" EH will return an array with 2 elements: the killed unit, and the killer), it is passed in _this variable. Since Arma 3 v.1.63.137807 the EH handle is also stored in _thisEventHandler variable and is available during EH code execution. For more information about event handlers and their types check the scripting topic Event handlers in this reference. You may add as many event handlers of any type as you like to every unit. For instance, if you add an event handler of type "killed" and one already exists, the old one doesn't get overwritten. Use removeEventHandler to delete event handlers. - https://community.bistudio.com/wiki/setPosATL + https://community.bistudio.com/wiki/addEventHandler - Object setPosATL Array + Object addEventHandler Array - object setPosATL pos + object addEventHandler [type, command] - $Code$player setPosATL [ getPosATL player select 0, ( getPosATL player select 1) - 10, getPosATL player select 2];$/Code$ + $Code$_EHkilledIdx = player addEventHandler ["killed", {_this exec "playerKilled.sqs"}]$/Code$ + + $Code$this addEventHandler ["killed", " hint format ['Killed by %1',_this select 1]"]$/Code$ - global / global + global / local - (Feb 26, 2012) - Please Note : this command demands PositionATL format ; one does not simply give 2D position, as this function won't do anything. - - (November 11, 2014) - If you plan on creating bases through script, setPosATL and getPosATL will be your friends. Other commands like getPos or getPosASL will return the position relative to any objects that are underneath. I wrote a base building helper script and through multiple tests, I have found that getPosATL is the absolute best way to get position for objects that are over land. + (July 7, 2015) + When using overridable EH, such as "InventoryOpened" and similar, where returning true allows to override default action, exitWith cannot be used to return value. So: + $Code$ if (whatever) exitWith { true }; false ;$/Code$ + Forget about it, will not work. Instead use: + $Code$ if (whatever) then { true } else { false };$/Code$ + 100% satisfaction guaranteed! - Nothing + Number + - setPosWorld + setTaskResult - Sets position of an object based on PositionWorld, which is PositionASL of the model centre [0,0,0]. + Set a result of the task. - https://community.bistudio.com/wiki/setPosWorld + https://community.bistudio.com/wiki/setTaskResult - Object setPosWorld PositionWorld + Task setTaskResult Array - object setPosWorld position + task setTaskResult [state,result] - $Code$_obj setPosWorld getPosWorld _obj;$/Code$ - + - global / global + undefined / undefined - Nothing + Nothing + - setPosition + fog - Sets the position of a location. + A getter for setFog. Returns the current value of the fog in range 0...1. - https://community.bistudio.com/wiki/setPosition + https://community.bistudio.com/wiki/fog - Location setPosition Array + fog - location setPosition pos + fog - $Code$myLocation setPosition [1000,5320,10]$/Code$ + $Code$_foglevel = fog ;$/Code$ undefined / undefined @@ -60704,103 +62228,88 @@ - Nothing + Number + - setPos + setWaypointName - Sets object position. + Changes the waypoint name. - https://community.bistudio.com/wiki/setPos + https://community.bistudio.com/wiki/setWaypointName - Object setPos Array + Waypoint setWaypointName String - object setPos pos + waypoint setWaypointName name - $Code$player setPos [ getPos player select 0, getPos player select 1, ( getPos player select 2) +10]; - //the same as above using modelToWorld : - player setPos ( player modelToWorld [0,0,10]); - //the same as above using vectorAdd : - player setPos ( getPos player vectorAdd [0,0,10]);$/Code$ - - $Code$_obj setPos [ getPos _obj select 0, getPos _obj select 1, -5];$/Code$ - - $Code$player setPos ( getPos _obj);$/Code$ + $Code$[_grp,2] setWaypointName "myName";$/Code$ - global / global + undefined / undefined - (6 Feb, 2011) - Calling setPos on an object can cause the object's orientation to change. This depends on the terrain and/or objects below the object. This was tested by calling setPos on a test object with the position of a helicopter ( modelToWorld with some offset). When flying over land the orientation of the test object would rapidly change depending on the slope of the ground and objects beneath it. - Comment applicable to Ver 1.96 and earlier : - obj1 setPos [x,y,z] - Will place most objects z metres above ground level (negative numbers for underground). But if obj1 is a trigger then it will be placed z metres above sea level. This can be very useful if you want to check a unit's height above sea level but it can be a problem if you want to move a trigger to create an explosion or a sound. To move a trigger to a location at ground level: - $Code$triggername setPos [x,y,0]; - triggername setPos [x,y, abs ( getPos triggername select 2)];$/Code$ - Note for Armed Assault: Using setPos for a trigger will work in exactly the same way that setPos works for other objects - namely that setPos [x,y,z] will place the trigger z metres above ground level. - SetPos for static objects like a ammo crate do not work in MP. - - (23 Nov, 2011) - You can use getPos and setPos on triggers. - Nothing + Nothing + - setPylonLoadOut + addItemToUniform - Will add missile to vehicle pylon, TransportPylonsComponent in config is required + Create new item and store it to soldier's uniform. The item can also be a weapon or a magazine. - https://community.bistudio.com/wiki/setPylonLoadOut + https://community.bistudio.com/wiki/addItemToUniform - Object setPylonLoadOut Array + Object addItemToUniform String - vehicle setPylonLoadOut [pylon nameindex, magazine name, forced, turret] + unit addItemToUniform item - $Code$( vehicle player ) setPylonLoadOut ["pylon1", ""];$/Code$ + $Code$player addItemToUniform "itemGPS";$/Code$ + + $Code$player addItemToUniform "hgun_Rook40_F";$/Code$ - undefined / undefined + global / global - Boolean + Nothing + - setPylonsPriority + setPosition - Overrides default pylons priorities + Sets the position of a location. - https://community.bistudio.com/wiki/setPylonsPriority + https://community.bistudio.com/wiki/setPosition - Object setPylonsPriority Array + Location setPosition Array - vehicle setPylonsPriority [priority pylon1, priority pylon2,] + location setPosition pos - $Code$( vehicle player ) setPylonsPriority [0,1,2,3,4,5,5,4,3,2,1,0];$/Code$ + $Code$myLocation setPosition [1000,5320,10]$/Code$ undefined / undefined @@ -60808,188 +62317,230 @@ - Nothing + Nothing + - setRadioMsg + lnbSortByValue - Sets radio trigger menu title text (0 - 0 - map radio). Use "NULL" to disable radio slot. Use "" to restore default title + Sorts given multicolumn listbox by lnbValue in given column in ascending or descending order. - https://community.bistudio.com/wiki/setRadioMsg + https://community.bistudio.com/wiki/lnbSortByValue - Number setRadioMsg String + lnbSortByValue Array + + control lnbSortByValue Array - index setRadioMsg text + lnbSortByValue [idc, column, reversed] + + control lnbSortByValue [column, reversed] - $Code$1 setRadioMsg "Click meeeeeeeeee"; //changes title of radio Alpha$/Code$ + $Code$lnbSortByValue [1800, 1, false ];$/Code$ + + $Code$_ctl lnbSortByValue [1, true ]$/Code$ - undefined / local + undefined / undefined - Nothing + Nothing - Nothing + - setRainbow + setType - Changes the rainbow value smoothly during the given time (in seconds). A time of zero means there will be an immediate change. + Changes a location to the specified class. Location classes are defined in CfgLocationTypes. - https://community.bistudio.com/wiki/setRainbow + https://community.bistudio.com/wiki/setType - Number setRainbow Number + Location setType String - time setRainbow value + location setType name - + $Code$myLocation setType "RockArea"$/Code$ + undefined / undefined - (April 24, 2015) - It should be known that this command does not create a rainbow in all conditions. As in real life, the rainbow can only appear after rainfall and opposite of the sun when it is low on the horizon. - Nothing + Nothing + - setRain + getClientStateNumber - Set rain density smoothly over the given transition time (in seconds). A transition time of zero means an immediate change. A rain density of zero is no rain, one is maximum rain. Rain is not possible when overcast is less than 0.7. - NOTE : Since Arma 3 this command is MP synchronised, if executed on server, the changes will propagate globally. If executed on client effect is temporary as it will soon change to the server setting. + Returns client state in network game. Works on both, client and dedicated server. The following states are possible: + getClientStateNumber + getClientState + 0 + "NONE" + No client (or singleplayer) + 1 + "CREATED" + Client is created + 2 + "CONNECTED" + Client is connected to server, message formats are registered + 3 + "LOGGED IN" + Identity is created + 4 + "MISSION SELECTED" + Mission is selected + 5 + "MISSION ASKED" + Server was asked to send / not send mission + 6 + "ROLE ASSIGNED" + Role was assigned (and confirmed) + 7 + "MISSION RECEIVED" + Mission received + 8 + "GAME LOADED" + Island loaded, vehicles received + 9 + "BRIEFING SHOWN" + Briefing was displayed + 10 + "BRIEFING READ" + Ready to play mission + 11 + "GAME FINISHED" + Game was finished + 12 + "DEBRIEFING READ" + Debriefing read, ready to continue with next mission - https://community.bistudio.com/wiki/setRain + https://community.bistudio.com/wiki/getClientStateNumber - Number setRain Number + getClientStateNumber - time setRain rain + getClientStateNumber - $Code$60 setRain 1;$/Code$ + $Code$_state = getClientStateNumber ;$/Code$ - $Code$// Force no rain: - 0 setRain 0; - forceWeatherChange ; - 999999 setRain 0;$/Code$ + $Code$_inGame = getClientStateNumber 8;$/Code$ - undefined / global + undefined / undefined - This scripting command must be executed on the server to work properly in multiplayer - - (December 15, 2015) - setTimeMultiplier does NOT affect transition time. - - (November 16, 2016) - Using Example 2 on dedicated server might need additional interference on JIP clients. The reason is that JIP has rain value 0 slowly changing to 0. To force client to sync one can execute this on client: $Code$ skipTime 1; skipTime -1;$/Code$ - Nothing + Number + - setRandomLip + vectorDir - Enables/Disables random lip. When enabled, the unit continuously moves its lips as if it's talking. + Return object's normalized direction vector in world space ( [x,y,z] ). + A unit facing North would return [0,1,0] + A unit facing East would return [1,0,0] + A unit facing South would return [0,-1,0] + A unit facing West would return [-1,0,0] - https://community.bistudio.com/wiki/setRandomLip + https://community.bistudio.com/wiki/vectorDir - Object setRandomLip Boolean + vectorDir Object - unit setRandomLip bool + vectorDir objectName - $Code$player setRandomLip true ;$/Code$ + $Code$_dirVector = vectorDir _unit;$/Code$ - undefined / undefined + global / undefined - Nothing + Array + - setRank + setPilotCameraDirection - Sets rank of given unit. - Possible values: PRIVATE, CORPORAL, SERGEANT, LIEUTENANT, CAPTAIN, MAJOR or COLONEL. - Since Arma 3 v1.67 this command is + Sets the direction of object airplane or helicopter pilotCamera (vector in model space). - https://community.bistudio.com/wiki/setRank + https://community.bistudio.com/wiki/setPilotCameraDirection - Object setRank String + Object setPilotCameraDirection Array - unitName setRank rank + object setPilotCameraDirection Vector3D - $Code$player setRank "COLONEL"$/Code$ + $Code$vehicle player setPilotCameraDirection [0,1,0] //re-centers the camera$/Code$ - global / local + local / undefined - (Mar 26, 2009) - Changing a unit's rank using either setUnitRank or setRank will also REPLACE their current rating dependent on their new rank (colonels have a rating of 7500 etc). That is to say REPLACE, not add to: the unit's old rating will disappear with the rank change. - - (April 12, 2014) - Behavior when used on players in multiplayer seems unpredictable. (ArmA 3 1.00) - Nothing + Nothing + - setRectangular + for - Set the shape of a location to be either rectangular or elliptical. Locations default shape is elliptical. + This operator creates a For Type which is used in the for-constructs (There is the for forspec and the for var syntax available for this construct) - https://community.bistudio.com/wiki/setRectangular + https://community.bistudio.com/wiki/for - Location setRectangular Boolean + for String/Array - location setRectangular set + for arg - $Code$myLocation setRectangular true ;$/Code$ + $Code$for "_i" from 1 to 10 do { debugLog _i;};$/Code$ + + $Code$for "_i" from 9 to 1 step -2 do { debugLog _i;};$/Code$ + + $Code$for [{_i=0}, {_i 10}, {_i = _i + 1}] do {hint str _i};$/Code$ undefined / undefined @@ -60997,150 +62548,188 @@ - Nothing + For_Type + - setRepairCargo + isManualFire - Set amount of repair resources in cargo space of repair vehicle. - Amount 1 is full cargo. + Returns true if manual fire is on. Manual fire could either be selected in vehicle action menu (if available) or with action "ManualFire" and "ManualFireCancel". Always returns false for a soldier. - https://community.bistudio.com/wiki/setRepairCargo + https://community.bistudio.com/wiki/isManualFire - Object setRepairCargo Number + isManualFire Object - vehicleName setRepairCargo amount + isManualFire vehicleName - $Code$_repairTruck1 setRepairCargo 0$/Code$ + $Code$_bool = isManualFire vehicle player ;$/Code$ - local / global + global / undefined - (July 10, 2015) - (ArmA 3 1.44) setRepairCargo will have no effect if the vehicle doesn't support getRepairCargo. + (February 5, 2017) + Manual fire means the effectiveCommander of the vehicle controls firing (but not aiming) of the gunner turret weapons (usually path [0]), while unable to fire his own weapons. - Nothing + Boolean + - setShadowDistance + everyBackpack - Sets the shadows rendering distance. + Returns array of backpacks stored in given crate or vehicle. Used for accessing backpack content of a backpack on ground. - https://community.bistudio.com/wiki/setShadowDistance + https://community.bistudio.com/wiki/everyBackpack - setShadowDistance Number + everyBackpack Object - setShadowDistance value + everyBackpack box - $Code$setShadowDistance 1000$/Code$ + $Code$everyBackpack cursorTarget ;$/Code$ + + $Code$_vehicleBackpacks = everyBackpack vehicle player ;$/Code$ - undefined / local + undefined / undefined + (Apr 29, 2014) + (ArmA3 ver 1.16), here's a quick reference to backpack command family. + Command + Operand type + Return + Example + firstBackpack + Object (WeaponHolder, AmmoCrate, VehicleCrate) + Object (eg 2bba9d00# 163957: backpack_compact.p3d) + firstBackpack ( getPos player nearestObject "weaponholder") + backpackContainer + Unit( Object ) + Object (eg 2bba9d00# 163957: backpack_compact.p3d) + backpackContainer player //Currently same as unitBackpack + unitBackpack + Unit( Object ) + Object (eg 2bba9d00# 163957: backpack_compact.p3d) + unitBackpack player //Currently same as backpackContainer + backpack + Unit( Object ) + String (eg 2bba9d00# 163957: backpack_compact.p3d) + backpack player //See also ( typeOf backpackContainer player ) or ( typeOf unitBackpack player ) + backpackCargo + Object (WeaponHolder, AmmoCrate, VehicleCrate) + Array of String (eg ["Backpack0","Backpack1"]) + backpackCargo _AmmoCrate + getBackpackCargo + Object (WeaponHolder, AmmoCrate, VehicleCrate) + Array of Array (eg [["Backpack0","Backpack1"],[1,1]]) + getBackpackCargo _AmmoCrate + everyBackpack + Object (WeaponHolder, AmmoCrate, VehicleCrate) + Array of Object (eg [22504f00# 163960: backpack_fast.p3d...]) + everyBackpack _AmmoCrate - Nothing + Array + - setShotParents + addMagazineGlobal - Sets vehicle and instigator pair for the given projectile. + Adds a magazine to the unit. + Note: You may create invalid combinations by adding more magazines than the free space in unit's inventory allows. When doing so, application behaviour is undefined. + This command is broken in MP as it dupes inventory items. Use addMagazine array for now, it takes global argument and has global effect too. - https://community.bistudio.com/wiki/setShotParents + https://community.bistudio.com/wiki/addMagazineGlobal - Object setShotParents Array + Object addMagazineGlobal String - projectile setShotParents [vehicle, instigator] + unit addMagazineGlobal magazineName - $Code$myProjectile setShotParents [ vehicle bob, bob];$/Code$ - - $Code$tank addEventHandler ["Fired", {_this select 6 setShotParents [tank, commander tank]];$/Code$ + $Code$player addMagazineGlobal "30Rnd_65x39_caseless_mag";$/Code$ global / global - This scripting command must be executed on the server to work properly in multiplayer - Nothing + Nothing + - setSide + productVersion - Sets a location's side. The default side is Unknown. + Returns the product's friendly name, identifier and version. In Arma 3 it also returns branch identifier, whether or not the game was launched using mods, and the platform. - https://community.bistudio.com/wiki/setSide + https://community.bistudio.com/wiki/productVersion - Location setSide Side + productVersion - location setSide side + productVersion - $Code$myLocation setSide resistance$/Code$ + $Code$hint str productVersion ; // would return ["Arma 2 OA", "arma2oa", 162, 95208] on Arma 2 OA 1.62.95208$/Code$ + + $Code$hint str productVersion ; // ["Arma 3","Arma3",137,128764,"Development",false,"Windows"]$/Code$ undefined / undefined - (16:00, 3 December 2013 (CEST)) - For units, vehicles you can use: " array joinSilent createGroup Side ", e.g. in init: "[this] joinSilent createGroup EAST;" described in the note below - - (19:05, 6 August 2009 (CEST)) - This is a frequent question on OFPEC, but produced here because it was difficult to find an answer to. setSide does not work for men, vehicles, etc.: it is intended for locations ( i.e., territory). If you want to switch a unit's ( e.g., the player's) side in the middle of a battle, make the unit joinSilent a group on the given side instead. If you want the unit to become the group leader after joining, use selectLeader. I haven't tested the idea of spawning a temporary unit of that side, assigning the player to that unit, setting the player as the leader, then deleting the original unit, but I don't see why it wouldn't work. (It begs the question why we don't have a setSide object function, though.) - Nothing + Array + - setSimpleTaskAlwaysVisible + safeZoneW - Makes the given task allways visible or not. + Returns the width of the screen in screen measurement units. Taken from top left corner of the default viewport (0,0) of the screen and going in the same direction as the X axis, the value will be positive but resulting X will end up beyond the right border. Therefore in order to calculate X of the right screen border, the length of safeZoneX must be subtracted from safeZoneW, but because it is negative, it must be added instead. _screenRightBorderX = safeZoneW + safeZoneX. The measurement units depend on the current screen resolution getResolution. See also SafeZone - https://community.bistudio.com/wiki/setSimpleTaskAlwaysVisible + https://community.bistudio.com/wiki/safeZoneW - Task setSimpleTaskAlwaysVisible Boolean + safeZoneW - taskID setSimpleTaskAlwaysVisible state + safeZoneW - $Code$getWarka setSimpleTaskAlwaysVisible true ;$/Code$ + $Code$_screenWidth = safeZoneW ;$/Code$ + + $Code$_screenRightBorderX = safeZoneW + safeZoneX ;$/Code$ undefined / undefined @@ -61148,603 +62737,584 @@ - Nothing + Number + - setSimpleTaskCustomData + safeZoneX - Set custom data for the task. Tooltip will be drawn in task list on the right side. Description will be drawn in task description panel on the bottom. + Returns the X of the left border of the screen, which is also a distance in screen measurement units from top left corner of the default viewport (0,0) of the screen to the left border of the screen. Since it is going in opposite way of the X axis, the value is negative. The measurement units depend on the current screen resolution getResolution. See also SafeZone - https://community.bistudio.com/wiki/setSimpleTaskCustomData + https://community.bistudio.com/wiki/safeZoneX - Task setSimpleTaskCustomData Array + safeZoneX - task setSimpleTaskCustomData [IconPath, tooltip, description] + SafeZoneX - + $Code$_screenLeftBorderX = safeZoneX ; // returns a float value 0$/Code$ + undefined / undefined - Nothing + Number + - setSimpleTaskDescription + cameraOn - Attach descriptions to the simple task. + Returns the vehicle to which the camera is attached. - https://community.bistudio.com/wiki/setSimpleTaskDescription + https://community.bistudio.com/wiki/cameraOn - Task setSimpleTaskDescription Array + cameraOn - task setSimpleTaskDescription [description, descriptionShort, descriptionHUD] + cameraOn - $Code$mytask setSimpleTaskDescription ["Today you have to kill Spongebob","Kill Spongebob","Here he is!"];$/Code$ - + undefined / undefined + (November 2, 2015) + $Code$ _MyScreenPos = getPos cameraOn; code + This would getPos for the current player or vehicle that the client's camera is attached to. + code _CameraOnSetPos = cameraOn setPos _pos; code + This would do setPos for the current player or vehicle that the client's camera is attached to. + /dd + /dl + $/Code$ - Nothing + Object + - setSimpleTaskDestination + random - Attach a destination to the simple task. + Random real (floating point) value from 0 (inclusive) to x (not inclusive). + Since Arma 3 v1.55.133393 alternative syntax is added, allowing to define Gaussian Distribution params. Uses the same method as setTriggerTimeout command. Quite useful for spawning loot for example, making more valuable items more rare. + Since Arma 3 v1.67.139663 an alternative syntax is available, allowing to generate semi-random number based on provided seed. + Since Arma 3 v1.67.139663 an alternative syntax is available, generating pseudo-random noise texture based on provided seed and returning a single number between 0 (included) and 1 (excluded) at supplied x and y coordinates. - https://community.bistudio.com/wiki/setSimpleTaskDestination + https://community.bistudio.com/wiki/random - Task setSimpleTaskDestination Array + random Number + + random Array + + Number random Number + + Number random Array - task setSimpleTaskDestination pos + random x + + random [min, mid, max] + + seed random x + + seed random [x,y] - $Code$_tskGoHere setSimpleTaskDestination ( getMarkerPos "obj1");$/Code$ + $Code$_rNumber = random 1;$/Code$ + + $Code$_rNumber = random -10;$/Code$ + + $Code$// Generate random position inside a circle + _center getPos [_radius * sqrt random 1, random 360];$/Code$ + + $Code$// Compare (each command was executed 100000 times to gather statistics): + floor random 10; + // 0 - 10099 (10%) + // 1 - 10040 (10%) + // 2 - 10154 (10%) + // 3 - 9910 (10%) + // 4 - 10023 (10%) + // 5 - 9937 (10%) + // 6 - 10118 (10%) + // 7 - 9716 (10%) + // 8 - 9986 (10%) + // 9 - 10017 (10%) + floor random [0,5,10]; + // 0 - 109 (0%) + // 1 - 1604 (2%) + // 2 - 6839 (7%) + // 3 - 16671 (17%) + // 4 - 24706 (25%) + // 5 - 24702 (25%) + // 6 - 16626 (17%) + // 7 - 6925 (7%) + // 8 - 1702 (2%) + // 9 - 116 (0%) + floor random [0,10,0]; + // 0 - 19 (0%) + // 1 - 209 (0%) + // 2 - 817 (1%) + // 3 - 2384 (2%) + // 4 - 4841 (5%) + // 5 - 8976 (9%) + // 6 - 14067 (14%) + // 7 - 18955 (19%) + // 8 - 23605 (24%) + // 9 - 26127 (26%) + floor random [0,10,5]; + // 0 - 11 (0%) + // 1 - 98 (0%) + // 2 - 430 (0%) + // 3 - 1149 (1%) + // 4 - 2384 (2%) + // 5 - 4546 (5%) + // 6 - 8612 (9%) + // 7 - 16283 (16%) + // 8 - 28393 (28%) + // 9 - 38094 (38%)$/Code$ undefined / undefined + (July 12, 2015) + Random selections including negative numbers can be obtained via: + $Code$_Xrnd = round(random 200) -100;$/Code$ + This will yield numbers between -100 and 100. + Be careful using random numbers in multiplayer, each client will come up with a different result. See multiplayer tutorials for more general information about locality. + The number returned is unlikely to be a whole number. To return a whole number use either round, ceil or floor together with random : + x=round(random 5) will return 0,1,2,3,4 or 5. (non-uniform distribution, 0 and 5 are half as likely to be selected than any of the other numbers) + x=floor(random 5) will return 0,1,2,3 or 4. (uniform distribution, all numbers have the same probability of being selected) + x=ceil(random 5) will return 0,1,2,3,4 or 5. (0 is very unlikely, but possible, as ceil 0 is 0) - Nothing + Number - Number - Number - Number + - setSimpleTaskTarget + getObjectChildren - Attach a target to the simple task. Overrides setSimpleTaskDestination. + Return a list of all the children of the specified object. + i + Some Old Editor Command - https://community.bistudio.com/wiki/setSimpleTaskTarget + https://community.bistudio.com/wiki/getObjectChildren - Task setSimpleTaskTarget Array + Control getObjectChildren String - task setSimpleTaskTarget [target, precisePosition] + map getObjectChildren object - $Code$task setSimpleTaskTarget [targetVehicle, true];$/Code$ - + undefined / undefined - Nothing + Array + - setSimpleTaskType + markerAlpha - Attach type to the simple task. See Default Task Types. + Gets the marker alpha. See setMarkerAlpha. - https://community.bistudio.com/wiki/setSimpleTaskType + https://community.bistudio.com/wiki/markerAlpha - Task setSimpleTaskType String + markerAlpha String - task setSimpleTaskType taskType + markerAlpha markerName - $Code$( currentTask player ) setSimpleTaskType "attack";$/Code$ + $Code$AlphaMarker = markerAlpha "myMarker;$/Code$ - undefined / undefined + global / undefined - Nothing + Number + - setSimulWeatherLayers + skill - Sets number of simul weather layers, affects quality of simul weather clouds. + Returns current level of ability of a unit, in range between 0 and 1, 1 being the highest level of skill. - https://community.bistudio.com/wiki/setSimulWeatherLayers + https://community.bistudio.com/wiki/skill - setSimulWeatherLayers Number + skill Object + + Object skill String - setSimulWeatherLayers layers + skill unitName + + unitName skill skillName - + $Code$_skill = skill unit1;$/Code$ + + $Code$_myCourage = player skill "courage"$/Code$ + undefined / undefined + Skill of AI units set via the slider in unit placement screen varies from 0.2 to 1.0. + If superAI is enabled all units have skill of 1.0 regardless of the skill slider - Nothing + Number - Number + - setSize + allow3DMode - Sets the size (radius) of a location. - The width is 2 * x, the height is 2 * y. + Allow/dissallow 3D mode., + i + Some Old Editor Command - https://community.bistudio.com/wiki/setSize + https://community.bistudio.com/wiki/allow3DMode - Location setSize Array + Control allow3DMode Boolean - location setSize size + map allow3DMode bool - $Code$myLocation setSize [10,30]$/Code$ - + undefined / undefined - Nothing + Nothing + - setSkill + canSlingLoad - Sets ability level of person (commander unit). Value of skill may vary from 0 to 1. + Returns true if it is possible to sling load cargo - https://community.bistudio.com/wiki/setSkill + https://community.bistudio.com/wiki/canSlingLoad - Object setSkill Number + Object canSlingLoad Object - vehicleName setSkill skill + vehicle canSlingLoad cargo - $Code$_hero setskill 1$/Code$ + $Code$_slingable = veh1 canSlingLoad veh2;$/Code$ + + $Code$hint str (( vehicle player ) canSlingLoad veh1);$/Code$ undefined / undefined - (August 4, 2006) - Notes from before the conversion: - Approximate ranges are: - Novice 0.25 - Rookie = 0.25 and = 0.45 - Recruit 0.45 and = 0.65 - Veteran 0.65 and = 0.85 - Expert 0.85 - - (June 30, 2007) - If "SuperAI" is turned on in the Difficulty Menu, the skill level is always 1, no matter what was defined in the editor or via this command. - Nothing + Boolean + - setSlingLoad + sin - Creates sling loading from first object to second object if possible. To unload cargo, pass objNull as second param. + Sine of x, argument in Degrees. - https://community.bistudio.com/wiki/setSlingLoad + https://community.bistudio.com/wiki/sin - Object setSlingLoad Object + sin Number - vehicle setSlingLoad cargo + sin x - $Code$_success = heli1 setSlingLoad veh1;$/Code$ - - $Code$// To unload cargo: - _success = heli setSlingLoad objNull ;$/Code$ + $Code$_sine = sin 30;//result is 0.5$/Code$ undefined / undefined - (November 8, 2014) - "... if possible " - FYI, that only means that 'vehicle' has to be able to lift 'cargo'. The position/distance does not matter, 'cargo' is automatically moved to a position that is close enough but doesn't doesn't collide with 'vehicle'. (can also be used if 'vehicle' is not flying, in which case 'cargo' will be placed and attached on the ground next to it). - Boolean + Number + - setSoundEffect + getFatigue - Defines the different sound effects. - Sound - plays a 2D sound from CfgSounds - Voice - plays a 3D sound from CfgSounds - SoundEnv - plays an environmental sound from CfgEnvSounds - SoundDet (only for triggers) - creates a dynamic sound object attached to a trigger defined in CfgSFX - To stop any sound, deactivate the trigger (might take up to 0.5 sec to stop) or delete the trigger (immediate). Also use "$NONE$" to skip the sound (1st item), when there is none to be used (Example 3, 4, 5). + Returns fatigue of given unit. - https://community.bistudio.com/wiki/setSoundEffect + https://community.bistudio.com/wiki/getFatigue - Object setSoundEffect Array - - Array setSoundEffect Array + getFatigue Object - trigger setSoundEffect [sound, voice, soundEnv, soundDet] - - waypoint setSoundEffect [sound, voice, soundEnv, soundDet] + getFatigue unit - $Code$_trigger setSoundEffect ["Alarm", "", "", ""];$/Code$ - - $Code$[_group1,2] setSoundEffect ["Alarm", "", "", ""];$/Code$ - - $Code$_trigger setSoundEffect ["$NONE$", "Alarm", "", ""];$/Code$ - - $Code$_trigger setSoundEffect ["$NONE$", "", "BattlefieldFirefight1", ""];$/Code$ + $Code$value = getFatigue player ;$/Code$ - $Code$_trigger setSoundEffect ["$NONE$", "", "", "Owl"];$/Code$ + $Code$if ( getFatigue player 0.5) then { player sideChat "I'm good to go!" };$/Code$ - undefined / undefined + global / undefined - (October 2, 2013) - To avoid having to create a dummy sound definition, you can use $NONE$ instead. - $Code$private "_trigger"; - _trigger = createTrigger ["EmptyDetector", position player]; - _trigger setTriggerStatements ["true", "", ""]; - _trigger setSoundEffect ["$NONE$", "", "BattlefieldFirefight1", ""]; - $/Code$ - - (March 7, 2012) - When using this function, I found that if the parameter sound was empty, then you would always get a 'Sound not found' error. The following code fixes this problem. You need to create a dummy sound. This is what example 3 is hinting towards. - description.ext: - $Code$class CfgSounds - { - sounds[] = {}; - class NoSound - { - name = "NoSound"; - sound[] = {"", 0, 1}; - titles[] = {}; - }; //Dummy sound needed for setSoundEffect command, due to stupid bug in engine. - }; - $/Code$ - (code sample above written by 'CarlGustaffa' on the Bohemia Interactive forums.) - script.sqf: - $Code$_trigger = createTrigger[ "EmptyDetector", _position ]; - _trigger setTriggerStatements [ "true", "", "" ]; - _trigger setSoundEffect[ "NoSound", "", "", "Wind2_EP1" ]; - $/Code$ + getFatigue can be applied to remote unit however it will not read the changes made to unit's fatigue with setFatigue command. Only natural changes resulting from unit moving will be counted. When applied to local unit, it will read resulting value of natural fatigue combined with artificial changes added locally by setFatigue. In short, the server wouldn't know the correct value of remote unit's fatigue if you used setFatigue on the unit prior. - Nothing - Nothing + Number + - setSpeaker + rotorsRpmRTD - Sets the speaker of a person. In order to setSpeaker dynamically in MP, the command needs to run on every computer with exactly the same params otherwise the speaking unit could appear silent on other PCs. Run this on server: - [bob, "Male02GRE"] remoteExecCall ["setSpeaker", 0]; + Returns rotors RPM - https://community.bistudio.com/wiki/setSpeaker + https://community.bistudio.com/wiki/rotorsRpmRTD - Object setSpeaker String + rotorsRpmRTD Object - person setSpeaker speaker + rotorsRpmRTD RTD_helicopter - $Code$unit1 setSpeaker "Male02GRE";$/Code$ + $Code$_mh9_main = ( rotorsRpmRTD _MH9) select 0;//main rotor + _mh9_tail = ( rotorsRpmRTD _MH9) select 1;//tail rotor$/Code$ - local / local + undefined / undefined - (September 19, 2013) - speaker can be any of the following: - Male01ENG - Male01ENGB - Male01GRE - Male01PER - Male02ENG - Male02ENGB - Male02GRE - Male02PER - Male03ENG - Male03ENGB - Male03GRE - Male03PER - Male04ENG - Male04ENGB - Male04GRE - Male05ENG - Male06ENG - Male07ENG - Male08ENG - Male09ENG - - (January 12, 2014) - speakers available in Arma 3 (v1.08) : - Gender - Profile setting - US English (B) for EN-GB available - Greek - Persian - Male - Male01_F - Male01ENG(B) - Male01GRE - Male01PER - Male02_F - Male02ENG(B) - Male02GRE - Male02PER - Male03_F - Male03ENG(B) - Male03GRE - Male03PER - Male04_F - Male04ENG(B) - Male04GRE - Male01PER - Male05_F - Male05ENG - Male05GRE - Male02PER - Male06_F - Male06ENG - Male02GRE - Male03PER - Male07_F - Male07ENG - Male03GRE - Male01PER - Male08_F - Male08ENG - Male04GRE - Male02PER - Male09_F - Male09ENG - Male01GRE - Male03PER - Female - - - - - - - - - - (November 10, 2014) - In order to stop a unit from talking you can use: - $Code$_unit setSpeaker "NoVoice"$/Code$ - This will have no negative effect on the ability to command the unit. - Nothing + Array + - setSpeech + canSuspend - Add speech to location. + Returns true if sleep, uiSleep or waitUntil commands can be used in current scope. Usually when suspension is not allowed but used, for example when code is executed in unscheduled environment, the script engine would ignore any suspension command and throw error: "Suspending not allowed in this context". Using canSuspend command allows to detect the correct environment for the code. + Note : The definition of scheduled and unscheduled environment is not the same as whether or not the script execution can or cannot be suspended. For example while. sqs and. fsm scripts are scheduled (i.e. added to the scheduler : diag_activeSQSScripts, diag_activeMissionFSMs ), they cannot use sleep or be suspended like execVM or spawn scripts can, therefore canSuspend for these types of scripts will return false. - https://community.bistudio.com/wiki/setSpeech + https://community.bistudio.com/wiki/canSuspend - Location setSpeech String + canSuspend - location setSpeech speech + canSuspend - + $Code$onEachFrame + { + systemChat str canSuspend ; //false + [] spawn { hint str canSuspend }; //true + onEachFrame {}; + };$/Code$ + + $Code$// Make sure the function code is always spawned even when called: + mysleep = + { + if (! canSuspend ) exitWith {_this spawn mysleep}; + sleep _this; + hint ("slept " + str _this); + }; + 5 call mysleep;$/Code$ + undefined / undefined - Nothing + Boolean + - setSpeedMode + safeZoneH - Set group speed mode. Mode may be one of: - "LIMITED" (half speed) - "NORMAL" (full speed, maintain formation) - "FULL" (do not wait for any other units in formation) + Returns the height of the screen in screen measurement units. Taken from top left corner of the default viewport (0,0) of the screen and going in the same direction as the Y axis, the value will be positive but resulting Y will end up beyond the bottom border. Therefore in order to calculate Y of the bottom screen border, the length of safeZoneY must be subtracted from safeZoneH, but because it is negative, it must be added instead. _screenBottomBorderY = safeZoneH + safeZoneY. The measurement units depend on the current screen resolution getResolution. See also SafeZone - https://community.bistudio.com/wiki/setSpeedMode + https://community.bistudio.com/wiki/safeZoneH - Object/Group setSpeedMode String + safeZoneH - groupName setSpeedMode mode + SafeZoneH - $Code$_groupOne setSpeedMode "LIMITED"$/Code$ + $Code$_screenHeight = safeZoneH ;$/Code$ + + $Code$_screenBottomBorderY = safeZoneH + safeZoneY ;$/Code$ - local / global + undefined / undefined - (14 Feb 2010) - Although setSpeedMode can be called on an individual unit, the entire group will be affected. - - (17 May 2008) - In Multiplayer, this command is overwritten by itself to NORMAL or FULLSPEED (i don't know which one, but it's fast move) when you ask the unit to move via script (ex : _unit doMove (getMarkerPos "destination"); ) - The solution to solve this problem is to initialize the setSpeedMode after your order the unit to move. - So basically it gives you : - _unit doMove (getMarkerPos "destination"); - _unit setSpeedMode "LIMITED"; - If you plan to move the unit again after it reaches its destination, you will have to set the speed mode to LIMITED again like i did just above. - Nothing + Number + - setStamina + insertEditorObject - Set units' stamina (seconds until depletion) + Insert an object to the editor and assign arguments. Create script is,not called. Returns the ID of the new EditorObject. Subtype class is,optional. + i + Some Old Editor Command - https://community.bistudio.com/wiki/setStamina + https://community.bistudio.com/wiki/insertEditorObject - Object setStamina Number + Control insertEditorObject Array - unit setStamina stamina + map insertEditorObject [type,value,[name1,value1,],subtype class] - $Code$player setStamina 42;$/Code$ - + undefined / undefined - (December 30, 2015) - "setStamina" has the same effect as "setFatigue". + (May 7, 2015) + "This works only in the old 3D editor" - KM - Nothing + String + - setStaminaScheme + connectTerminalToUAV - Set stamina bar color. The scheme can be "Normal", "FastDrain", "Exhausted" or "Default". + Connect person with UAV terminal to UAV unit. UAV Terminal item needs to be assigned to GPS slot. If UAV is already connected to another terminal, this new connection will fail. - https://community.bistudio.com/wiki/setStaminaScheme + https://community.bistudio.com/wiki/connectTerminalToUAV - setStaminaScheme String + Object connectTerminalToUAV Object - setStaminaScheme scheme + person connectTerminalToUAV uav - $Code$setStaminaScheme "Default";$/Code$ + $Code$bool = player connectTerminalToUAV uav1;$/Code$ + + $Code$player connectTerminalToUAV objNull ; //disconnect$/Code$ - undefined / undefined + global / global - Nothing + Boolean + - setStatValue + vectorModelToWorld - Sets a value to a given stat. - A list of possible StatNames can be found here: StatNames - Its important to note that most Stats are restricted to scripts in certain paths. - For example "ExpWarlockDown" is restricted to scripts in any subdirectory of "a3\Missions_F_Exp\Campaign\Missions\" + Converts vector direction from model to world space. - https://community.bistudio.com/wiki/setStatValue + https://community.bistudio.com/wiki/vectorModelToWorld - setStatValue Array + Object vectorModelToWorld Array - setStatValue [name, value] + object vectorModelToWorld modelDir - $Code$setStatValue ["ExpWarlockDown", 1]; //Unlocks the "Warlock Down" Steam achivement$/Code$ + $Code$// Convert model space vector [0,-10,4] to world space; vector gets rotated according to _airplane: + _airplane vectorModelToWorld [0,-10,4];$/Code$ undefined / undefined @@ -61752,56 +63322,34 @@ - Boolean + Array + - setSuppression + tvSetText - Sets the person's suppression, from 0 to 1. + Sets string text to item on given path. IDC means id of parent Tree View. - https://community.bistudio.com/wiki/setSuppression + https://community.bistudio.com/wiki/tvSetText - Object setSuppression Number + tvSetText Array + + Control tvSetText Array - unit setSuppression value - - - $Code$AI_unit_1 setSuppression 1;$/Code$ - - - undefined / undefined - - - - - Nothing - - - - - setSystemOfUnits - - - Set system of units. - - - https://community.bistudio.com/wiki/setSystemOfUnits - - - setSystemOfUnits Number - - - setSystemOfUnits value + tvSetText [idc, path, text] + + control tvSetText [path, text] - $Code$myNum = 5; - myNumNew = setSystemOfUnits myNum;$/Code$ + $Code$tvSetText [101, [0], "Test data"];$/Code$ + + $Code$_ctrl tvSetText [[0,0,0], "Test data"];$/Code$ undefined / undefined @@ -61809,28 +63357,29 @@ - Nothing + Nothing - Nothing + - setTargetAge + false - Sets how the target is known to the other centers. They behave like the target was seen age seconds ago. - Possible age values are: "ACTUAL", "5 MIN", "10 MIN", "15 MIN", "30 MIN", "60 MIN", "120 MIN" or "UNKNOWN". + Always false. - https://community.bistudio.com/wiki/setTargetAge + https://community.bistudio.com/wiki/false - Object setTargetAge String + false - object setTargetAge age + false - $Code$player setTargetAge "10 MIN"$/Code$ + $Code$_var = false ; + systemChat str _var; //false$/Code$ undefined / undefined @@ -61838,224 +63387,191 @@ - Nothing + Boolean + - setTaskResult + setObjectViewDistance - Set a result of the task. + Sets the rendering distance of objects (and shadows). - https://community.bistudio.com/wiki/setTaskResult + https://community.bistudio.com/wiki/setObjectViewDistance - Task setTaskResult Array + setObjectViewDistance Number + + setObjectViewDistance Array - task setTaskResult [state,result] + setObjectViewDistance distance + + setObjectViewDistance [objectDistance, shadowDistance] - + $Code$setObjectViewDistance 2000;$/Code$ + + $Code$setObjectViewDistance [2000,800];$/Code$ + - undefined / undefined + undefined / local - Nothing + Nothing - Nothing + - setTaskState + commandFollow - Set the state of a given task. - State value may be one of: - "None" - "Created" - "Assigned" - "Succeeded" - "Failed" - "Canceled" + Order the given unit to follow the given other unit (via the radio). - https://community.bistudio.com/wiki/setTaskState + https://community.bistudio.com/wiki/commandFollow - Task setTaskState String + Object/Array commandFollow Object - task setTaskState state + unitName commandFollow followedunit - $Code$_tskKillSpongebob setTaskState "Succeeded";$/Code$ + $Code$_soldier1 commandFollow _soldier2$/Code$ - undefined / undefined + local / undefined - Nothing + Nothing + - setTerrainGrid + safeZoneY - Operation Flashpoint, VBS1 : Set desired terrain resolution (in meters). - For default landscapes, supported resolutions are: - 50 - smoothest, less lag - 25 - default in multiplayer - 12.5 - default in singleplayer - 6.25 - 3.125 - bumpiest, higher lag - If you select unsupported resolutions, nearest supported value is used instead. - Armed Assault, VBS2 : Terrain resolution is fixed, determined by the world created. This function controls terrain LOD instead (the distance in which the terrain mesh resolution starts to degrade). Higher number means less vertices are used for terrain rendering, making distant hills less smooth. Value 12.5 corresponds to selecting Terrain Detail Normal in Video options, 50 to Very Low, 3.125 to Very High. + Returns the Y of the top border of the screen, which is also a distance in screen measurement units from top left corner of the default viewport (0,0) of the screen to the top border of the screen. Since it is going in opposite way of the Y axis, the value is negative. The measurement units depend on the current screen resolution getResolution. See also SafeZone - https://community.bistudio.com/wiki/setTerrainGrid + https://community.bistudio.com/wiki/safeZoneY - setTerrainGrid Number + safeZoneY - setTerrainGrid grid + SafeZoneY - $Code$setTerrainGrid 12.5$/Code$ + $Code$_screenTopBorderY = safeZoneY ; // returns a float value 0$/Code$ - undefined / local + undefined / undefined - (August 4, 2006) - Notes from before the conversion: - This is like opening up your video preferences and changing "terrain detail", i.e.: setTerrainGrid 50 = lowest detail - setTerrainGrid 3.125 = highest detail It is similar to the command setViewDistance. - - (August 18, 2007) - Effects on grass: - 50: disables/removes grass altogether. - 25: grass is visible. - Lower values make grass drawn a bit further at distance. However the effect is decreasing rapidly: Grass radius of 25 is 100%. 12.5 is now like 100% + 20%, 6.25 is like 100% + 20% + 5% and 3.125 is 100% + 20% + 5% + 1%. Note these are estimates! - Demo Mission Test_VD_TD.Sara.rar : ViewDistance and TerrainGrid can be changed via RadioTriggers - - (December 15, 2019) - ArmA2 Supported Reso: - In ArmA2 you are not stuck to 50, 25, 12 etc. 45 is a lower setting then 25! - - (March 13, 2013) - ArmA 3 Multiplayer default: - Some testing indicates that the default value for Arma 3 multiplayer is 10 - just like before. 10 is between "Normal" and "High". - An user's terrain detail setting is ignored in multiplayer just like in ArmA 2. - - (November 19, 2014) - TerrainGrid values for Arma 3 1.34: - Low = 50 (NoGrass) - Standard = 25 - High = 12.5 - Very High = 6.25 - Ultra = 3.125 - Nothing + Number + - setText + drawEllipse - Sets the text associated with a location. This text will be displayed on the game map at the location's position. + Draws an ellipse on the map. Just like with marker or trigger area, negative a and b will result in hexagon. - https://community.bistudio.com/wiki/setText + https://community.bistudio.com/wiki/drawEllipse - Location setText String + Control drawEllipse Array - location setText text + map drawEllipse [c, a, b, angle, color, fill] - $Code$myLocation setText "Rahmadi Village"$/Code$ + $Code$findDisplay 12 displayCtrl 51 ctrlAddEventHandler ["Draw", + { + _this select 0 drawEllipse [ + player, 10, 10, 0, [1, 0, 0, 1], "" + ]; + _this select 0 drawEllipse [ + player, -10, -10, 0, [1, 1, 1, 1], "#(rgb,8,8,3)color(1,0.6,0,1)" + ]; + _this select 0 drawEllipse [ + player, -10, -10, 90, [0, 0, 1, 1], "" + ]; + }];$/Code$ undefined / undefined + (July 7, 2015) + Be careful when using this command. Unlike map markers, the draw commands can decrease your framerate. - Nothing + Nothing + - setTimeMultiplier + pickWeaponPool - Sets a time multiplier for in-game time. The command range is now capped at 0.1 - 120 to avoid performance problems. + Transfer weapons and magazines from cargo of object into weapon pool (used in campaign to transfer weapons into next mission). - https://community.bistudio.com/wiki/setTimeMultiplier + https://community.bistudio.com/wiki/pickWeaponPool - setTimeMultiplier Number + pickWeaponPool Object - setTimeMultiplier value + pickWeaponPool object - $Code$setTimeMultiplier 60;$/Code$ - - $Code$setTimeMultiplier 0.5;$/Code$ - + - undefined / global + undefined / undefined - This scripting command must be executed on the server to work properly in multiplayer - Nothing + Nothing + - setTitleEffect + setWindStr - Defines the title effect via [Type, Effect, Text] where - 'Type' can be - "NONE", - "OBJECT", - 'Text' defines the shown object, a subclass of CfgTitles. - "RES" - 'Text' defines a resource class, a subclass of RscTitles. - "TEXT" - The 'Text' is shown as text itself. 'Effect' defines a subtype: "PLAIN", "PLAIN DOWN", "BLACK", "BLACK FADED", "BLACK OUT", "BLACK IN", "WHITE OUT" or "WHITE IN". + Changes the wind strength smoothly during the given time (in seconds). A time of zero means there will be an immediate change. - https://community.bistudio.com/wiki/setTitleEffect + https://community.bistudio.com/wiki/setWindStr - Object setTitleEffect Array - - Array setTitleEffect Array + Number setWindStr Number - trigger setTitleEffect [type, effect, text] - - waypoint setTitleEffect [type, effect, text] + time setWindStr value - $Code$_trigger setTitleEffect ["TEXT", "PLAIN DOWN", "Hello world."]$/Code$ + $Code$60 setWindStr 0.8; // set the wind strength to 0.8 gradually over the next 60 seconds$/Code$ undefined / undefined @@ -62063,1208 +63579,1401 @@ - Nothing - Nothing + Nothing + - setTriggerActivation + laserTarget - Defines the trigger activation type. - See ArmA:Mission Editor - Triggers for a thorough overview of triggers and its fields for activation, effects, etc. Since Arma 3 v1.67, "ANYPLAYER" activation can be used to detect any player. + Returns laser target object created by given unit (gunner in vehicle or on foot) when using "Laserdesignator" or another laser targeting device. Laser target object is global and can be retrieved from any PC. - https://community.bistudio.com/wiki/setTriggerActivation + https://community.bistudio.com/wiki/laserTarget - Object setTriggerActivation Array + laserTarget Object - trigger setTriggerActivation [by, type, repeating] + laserTarget unitName - $Code$_trigger setTriggerActivation ["WEST", "EAST D", true ]$/Code$ + $Code$_target = laserTarget gunner heli;$/Code$ + + $Code$_designatedPos = position laserTarget player;$/Code$ - global / local + global / undefined + (December 15, 2010) + Need to be try with a soldier and laser designator + + (December 19, 2010) + Works with either infantry or vehicles. Returns objNull if no target is present - Nothing + Object + - setTriggerArea + get3DENGrid - Defines the area monitored by the given trigger. The area could be either rectangular or elliptical. Since Arma 3 v1.59.135137 it is possible to define 3 dimensional area to monitor by specifying extra param for the area height (see pic). - Just like with a and b dimensions, c dimension will alter area in opposite directions from the trigger position along z axis. Therefore if the trigger position is on the surface, half of the trigger area will be above the surface and half below. To place the whole area above the surface, adjust trigger position (move it up c meters). If c is not specified or = 0, the trigger area considered infinitely tall, like in old triggers. + Returns the grid increment for the given transformation type. + Transformation types: + Rotation - "r" + Translation - "t" + Scale - "s" - https://community.bistudio.com/wiki/setTriggerArea + https://community.bistudio.com/wiki/get3DENGrid - Object setTriggerArea Array + get3DENGrid String - trigger setTriggerArea [a, b, angle, isRectangle, c] + get3DENGrid type - $Code$_trigger setTriggerArea [100, 50, 45, false ];$/Code$ - - $Code$// Possible since Arma 3 v1.59.135137: - _trigger setTriggerArea [100, 50, 45, false, 100];$/Code$ + $Code$currentMovementIncrement = get3DENGrid "t";// returns 1$/Code$ - global / local + undefined / undefined - Nothing + Number + - setTriggerStatements + forcedMap - Defines trigger condition, activation and deactivation statements. Trigger condition has to return Boolean. true will activate the trigger, false will deactivate it (only if activation is set to repeat). thisList returns the same result as list command, which includes all entities in the trigger area that are capable of activating the trigger. Dead entities are excluded as well as crew in vehicles, vehicles themselves are included. + Returns if map was forced by using forceMap command or openMap command with force option - https://community.bistudio.com/wiki/setTriggerStatements + https://community.bistudio.com/wiki/forcedMap - Object setTriggerStatements Array + forcedMap - trigger setTriggerStatements [condition, activation, deactivation] + forcedMap - $Code$_trg setTriggerStatements ["this", " hint 'trigger on'", " hint 'trigger off'"]$/Code$ + $Code$_forceMapForced = forcedMap select 0; + _openMapForced = forcedMap select 1;$/Code$ - global / local + undefined / undefined - (Mar 14, 2011) - An array with three arguments is mandatory for this function. - - (September 16, 2014) - Magic variable thisList does not contain dead units. - Nothing + Array + - setTriggerText + waypointType - Sets the text label attached to the trigger object. This is used for example as a radio slot label for radio activated triggers. + Gets the waypoint type. + Type can be: + "MOVE" + "DESTROY" + "GETIN" + "SAD" + "JOIN" + "LEADER" + "GETOUT" + "CYCLE" + "LOAD" + "UNLOAD" + "TR UNLOAD" + "HOLD" + "SENTRY" + "GUARD" + "TALK" + "SCRIPTED" + "SUPPORT" + "GETIN NEAREST" + "DISMISS" + "AND" + "OR" + More details at Waypoint types. - https://community.bistudio.com/wiki/setTriggerText + https://community.bistudio.com/wiki/waypointType - Object setTriggerText String + waypointType Array - trigger setTriggerText text + waypointType waypoint - $Code$trigger setTriggerText "Call for support"$/Code$ + $Code$waypointType [groupOne,1],$/Code$ - global / local + undefined / undefined + (August 6, 2015) + With the new sling loading in Arma 3, 2 new waypoint types are added aswell being: + Drop Cargo and Lift Cargo. + The names for these 2 waypoints are: + "UNHOOK" and "HOOK". - Nothing + String + - setTriggerTimeout + waypointAttachObject - Defines the time between condition satisfaction and trigger activation (randomly from min to max, with an average value mid). If the last argument is true, the condition must be fullfilled all the time. - For a normal trigger, min, mid and max are used to generate random duration according to Gaussian Distribution. For a "Seized" type of trigger, the duration value is generated using side ruling power + Attaches a static object via it's numeric ID to the given waypoint. + The alternative syntax is (at least) available since Arma 2. - https://community.bistudio.com/wiki/setTriggerTimeout + https://community.bistudio.com/wiki/waypointAttachObject - Object setTriggerTimeout Array + Array waypointAttachObject Number + + Array waypointAttachObject Object - trigger setTriggerTimeout [min, mid, max, interruptable] + waypoint waypointAttachObject objectID + + waypoint waypointAttachObject object - $Code$_trigger setTriggerTimeout [5, 10, 7, false ];$/Code$ + $Code$[_grp, 2] waypointAttachObject 1234$/Code$ + + $Code$_wp = group player addWaypoint [[1907.5,5746.5,0.00144196],0]; + _wp waypointAttachObject (( waypointPosition _wp) nearestObject 66220);$/Code$ - global / local + undefined / undefined + (June 20, 2014) + In Arma 3 1.22 only the alternative syntax is working. - Nothing + Nothing - Nothing + - setTriggerType + lnbSetData - Sets the type of action processed by the trigger after activation (no action, a waypoints switch or an end of mission): - "NONE" - "EAST G" - Guarded by OPFOR - use createGuardedPoint instead! - "WEST G" - Guarded by BLUFOR - use createGuardedPoint instead! - "GUER G" - Guarded by Independent - use createGuardedPoint instead! - "SWITCH" - Switch waypoints/break loop (see Triggers ) - "END1" - End #1 - "END2" - End #2 - "END3" - End #3 - "END4" - End #4 - "END5" - End #5 - "END6" - End #6 - "LOOSE" - Lose //it is not a typo on the wiki, it is indeed misspelt in the game engine. - "WIN" - (not found in ArmA) + Sets the additional text (invisible) in the item with the given position of the 2D listbox. - https://community.bistudio.com/wiki/setTriggerType + https://community.bistudio.com/wiki/lnbSetData - Object setTriggerType String + lnbSetData Array + + Control lnbSetData Array - trigger setTriggerType action + lnbSetData [idc, [row, column], data] + + ctrl lnbSetData [[row, column], data] - $Code$_trigger setTriggerType "END1"$/Code$ + $Code$_ctrl lnbSetData [ [0,0],"#1"];$/Code$ - global / local + local / local + (Sep 9 2014) + (A3 1.28)As for invisible data processing, lnbAddArray, lnbAddColumn, lnbData, lnbGetColumnsPosition, lnbSetColumnsPos, lnbSetData, lnbSetText, lnbSetValue, lnbText and lnbValue store data types into exact position of the listNbox with different spaces. Accessing data with coordinate command at nearly the same syntax: + $Code$ + //Set same value to one position of a Control + _ctrl lnbSetData [ [0,0],"#1"]; + lnbSetColumnsPos [102, [0,1], 1]; + _ctrl lnbSetText [ [0,1], "#1"]; + _ctrl lnbSetValue [ [0,0],1]; + //Accessing the value disregard affecting one another. + _ctrl lnbData [0,0]; //"#1" + lnbGetColumnsPosition _ctrl //[1]; + _ctrl lnbText [0,0];//"#1" + _ctrl lnbValue [0,0];//1 + $/Code$ + For a direct visible control over CT_LISTNBOX: + $Code$ + 0 = [_CT_LISTNBOX] spawn { + private ["_CT_LISTNBOX","_color","_current","_pic"]; + disableSerialization ; + _CT_LISTNBOX = _this select 0; + { + _CT_LISTNBOX lnbAddRow [ getText (_x "displayNameShort"), getText (_x "displayName")]; + _CT_LISTNBOX lnbSetPicture [ [_foreachIndex,0], getText (_x "texture")]; + } forEach (" isClass _x" configClasses ( configFile "CfgRanks")); + _CT_LISTNBOX lnbSetCurSelRow 0; + _current = lnbCurSelRow _CT_LISTNBOX; + _color = _CT_LISTNBOX lnbColor [_current,0]; + _CT_LISTNBOX lnbSetColor [ [_current,1], [(_color select 0)/2,0,0,1] ]; + _CT_LISTNBOX lnbDeleteColumn 0; + _CT_LISTNBOX lnbDeleteRow 1; + sleep 1; + lnbClear _CT_LISTNBOX;//Clear all items but control still remains just invisible. + }; + $/Code$ + A combined use of both invisible and visible data processing commands alive the Control. - Nothing + Nothing - Nothing + - setType + playMove - Changes a location to the specified class. Location classes are defined in CfgLocationTypes. + When used on person, smooth transition to given move will be done. + List of moves in ArmA 2 List of moves in Armed Assault List of moves in Operation Flashpoint: Resistance + The difference between playMove and playMoveNow is that playMove adds another move to the move queue, while playMoveNow replaces the whole move queue with new move: + $Code$ player switchMove "amovpercmstpsraswrfldnon"; + [] spawn + { + sleep 0.5; + player playMove "amovppnemstpsraswrfldnon"; // player goes prone + player playMove "amovpknlmstpsraswrfldnon"; // player gets up on one knee + };$/Code$ + Compared to: + $Code$ player switchMove "amovpercmstpsraswrfldnon"; + [] spawn + { + sleep 0.5; + player playMove "amovppnemstpsraswrfldnon"; // player never goes prone + player playMoveNow "amovpknlmstpsraswrfldnon"; // player goes down on one knee straight away + };$/Code$ - https://community.bistudio.com/wiki/setType + https://community.bistudio.com/wiki/playMove - Location setType String + Object playMove String - location setType name + unitName playMove moveName - $Code$myLocation setType "RockArea"$/Code$ + $Code$soldierOne playMove "Stand"$/Code$ - undefined / undefined + local / global + For an immediate transition use switchMove. This command must be executed after mission start. If you place it into init.sqs / init.sqf or in the Init field of some unit, it will not work. Just add a little delay (~0.001) and then place the command. - Nothing + Nothing + - setUnconscious + vectorCrossProduct - Since Arma 3 v1.63.136889, this command sets unit into incapacitated state and lifeState command returns "INCAPACITATED". Animation played while incapacitated depends on the injuries received. + Cross product of two 3D vectors. + In layman's terms, if you have a polygon (surface) defined by 3 points, you can find a normal to it (just like terrain surfaceNormal ). To invert direction of the normal, swap arguments around. - https://community.bistudio.com/wiki/setUnconscious + https://community.bistudio.com/wiki/vectorCrossProduct - Object setUnconscious Boolean + Array vectorCrossProduct Array - unit setUnconscious set + vector1 vectorCrossProduct vector2 - $Code$_unit setUnconscious true;$/Code$ + $Code$_vector = [1,1,1] vectorCrossProduct [2,2,2];$/Code$ + + $Code$_vectorUp = [0,1,0] vectorCrossProduct [-1,0,0]; //[0,-0,1]$/Code$ + + $Code$_vectorSide = ( vectorDir player ) vectorCrossProduct ( vectorUp player );$/Code$ - local / global + undefined / undefined + (28 Jun, 2014) + (ArmA3 1.22)Algorithm: + $Code$ + Vector1 = [x1,y1,z1]; Vector2 = [x2,y2,z2]; + Result = [(y1 * z2) – (z1 * y2),(z1 * x2) – (x1 * z2),(x1 * y2) – (y1 * x2)]; + $/Code$ + It is recommended to use vectorCrossProduct instead of BIS_fnc_crossProduct. - Nothing + Array + - setUnitAbility + select - Sets skill of given unit. Unlike with setSkill it is possible to use values 1 with this command, and even though skill will correctly return set value, the actual unit ability will be capped to max available. + Selects an element from an array, config entry from Config or substring from a string or a range from an array. - https://community.bistudio.com/wiki/setUnitAbility + https://community.bistudio.com/wiki/select - Object setUnitAbility Number + Array select Number + + Array select Boolean + + Config select Number + + String select Array + + Array select Array + + Array select Code - unit setUnitAbility skill + array select index + + array select boolean + + config select index + + string select [start, length] + + array select [start, count] + + array select expression - $Code$_unit setUnitAbility 1;$/Code$ + $Code$[1,2,3,4] select 2; //result is 3 + position player select 2; //result is Z coordinate of player position$/Code$ - $Code$bob setUnitAbility - log 0; - hint str skill bob; //1.#INF$/Code$ + $Code$["", currentWeapon player ] select alive player ; //if dead "" is selected$/Code$ + + $Code$( configFile "cfgVehicles" typeOf vehicle player "Turrets") select 0 "gunnerAction";$/Code$ + + $Code$hint str ("japa is the man!" select [8]); //the man! + hint str ("japa is the man!" select [0,7]); //japa is$/Code$ + + $Code$hint str ([1,2,3,4,5,6] select [1,4]); //[2,3,4,5]$/Code$ + + $Code$_even = [1,2,3,4,5,6,7,8,9,0] select {_x%2 == 0}; // returns [2, 4, 6, 8, 0]$/Code$ undefined / undefined - (October 8, 2014) - AFAIK not used in Arma 3 anymore (or equals to setSkill) - - - Nothing - - - - - setUnitLoadout + (3 March 2009) + When combined with the count command, this can be used to read all entries out of a config; even when you don't know exactly how many entries there will be. See the notes under count for more info. + + (27 Sep, 2013) + Rounding of fractions with select is not the same as when you use round command: + $Code$_roundThis = 0.5; + hint str ([0,1] select _roundThis); //0 + hint str round _roundThis; //1$/Code$ + + (30 May, 2014) + In ArmA3 ver 1.18, Boolean type supported. Which true defaulted as 1 and false as 0. + $Code$[0,1] select (56 40) // 1 + [0,1,2] select ((! isNil "v") && false ) // 0$/Code$ + + (14 juil, 2016) + You can substract array from array using select: + $Code$_array = [[1],[2],[3]]; _sub = [2]; + _array - _sub // [[1],[2],[3]; + _array select {!(_x isEqualTo _sub)} // [[1],[3]]; + [[1],[2],[2],[2],[2],[3]] select {!(_x isEqualTo _sub)} // [[1],[3]]; + $/Code$ + + (June 22, 2015) + Usually when select tries to pick up element out of range, Arma throws "division by zero" error. However there are exceptions. Basically as long as index of element you are selecting is less then or equal to array size, you will get no error. + $Code$[] select 0; //ok, result is nil + [1,2,3] select 3; //ok, result is nil + [1,2,3] select 4; //division by zero$/Code$ + + (November 12, 2016) + It is not safe to escape the code block of alternative syntax #5 with exitWith, breakOut etc. + $Code$x3 = [1,2,3,4,5] select { + if (_x == 3) exitWith { + false; + }; + true + }; + // could be expected to be: x3 = [1,2,4,5] + // actual result: x3 = false + $/Code$ + + (February 14, 2017) + Syntax #5 is the equivalent of passing in a predicate that returns a boolean. In SQF, a piece of code will always return what the last executed command returned. + $Code$ + myAliveUnits = allunits select {alive _x;}; // alive returns a boolean, the last statement run was alive _x, therefore this piece of code will return a true/false to the select command + myEastGroups = allgroups select {side _x == EAST;}; // returns all groups that are side EAST + my4ManGroups = allgroups select { count (units _x) == 4;}; // returns all groups that have 4 men in them + UnitsThatDetectedMe = allunits select {_x knowsAbout player 0.1;}; // returns a list of units that have detected the player + $/Code$ + + (May 28, 2017) + Very simple example of how to report about the status of the player: + $Code$[ "Player is dead.", "Player is alive" ] select ( alive player )$/Code$ + returns "Player is alive" because ( alive player ) returned true. If ( alive player ) returned false, the first element (0) + would have been returned. + That is a great way of reporting about something without having to write a complicated it then else statement. + + + Anything - Anything - Config - String - Array - Array + + + + + + sliderSetSpeed - Creates a loadout from given inventory structure and applies it to a unit. - This command is not final and might be changed in a near future. + Set speed of slider with id idc of topmost user dialog. + Click to arrow - move by line + Click to scale outside thumb - move by page. - https://community.bistudio.com/wiki/setUnitLoadout + https://community.bistudio.com/wiki/sliderSetSpeed - Object setUnitLoadout Array + sliderSetSpeed Array + + Control sliderSetSpeed Array - unit setUnitLoadout [loadout, rearm] + sliderSetSpeed [idc,line,page] + + control sliderSetSpeed [line, page] - $Code$_loadout = getUnitLoadout player_1 ; - player_2 setUnitLoadout _loadout;//Copies loadout from player_1 and applies it to player_2$/Code$ + $Code$sliderSetSpeed [101, 0.5, 2];$/Code$ - global / global + undefined / undefined - Nothing + Nothing - Nothing + - setUnitPosWeak + setObjectMaterialGlobal - Set unit position rules. Mode may be one of: - "DOWN" - person goes prone and stays prone. - "UP" - person stands and stays standing. - "Middle" - Kneel Position. ArmA version 1.04 - "AUTO" - person chooses mode according to circumstances. + Set the material of the given selection on all computers in a network session. - https://community.bistudio.com/wiki/setUnitPosWeak + https://community.bistudio.com/wiki/setObjectMaterialGlobal - Object setUnitPosWeak String + Object setObjectMaterialGlobal Array - unit setUnitPosWeak mode + obj setObjectMaterialGlobal [selection, material] - $Code$_soldier disableAI "FSM"; - _soldier setUnitPosWeak "DOWN";$/Code$ + $Code$player setObjectMaterialGlobal [0, "A3\Structures_F\Data\Windows\window_set.rvmat"];$/Code$ - local / global + global / global - This command is the lowest level of priority for setting unit position and to be used in scripted - FSM's. - The current priorities are: - 1. Unit pos commanded (from the commanding menu, higher priority). - 2. Unit pos scripted (from setUnitPos scripting command, medium priority). - 3. Unit pos FSM / setUnitPosWeak (used in the formation FSM, lowest priority). - Command most likely only works if run before join into group after createUnit array. - Nothing + Nothing + - setUnitPos + setCurrentWaypoint - Set unit position rules. Mode may be one of: - "DOWN" - unit goes prone and stays prone. - "UP" - unit stands and stays standing. - "MIDDLE" - Kneel Position. ArmA version 1.04 (Unit will not kneel if it is unarmed ) - "AUTO" - unit chooses mode according to circumstances. - This command will not change the stance of the human player, even though it will change the output of unitPos command. To change player stance use playAction or playActionNow : - $Code$ player playAction "PlayerProne"; // DOWN - player playAction "PlayerStand"; // UP - player playAction "PlayerCrouch"; // MIDDLE$/Code$ + Sets the currently active waypoint for a group. - https://community.bistudio.com/wiki/setUnitPos + https://community.bistudio.com/wiki/setCurrentWaypoint - Object setUnitPos String + Object/Group setCurrentWaypoint Array - unit setUnitPos mode + groupName setCurrentWaypoint waypoint - $Code$_soldier setUnitPos "UP";$/Code$ + $Code$_grp setCurrentWaypoint [_grp, 1];$/Code$ - local / global + local / undefined - (18 September 2008‎) - Command most likely only works if run before join into group after createUnit. + (27 Aug 2007) + (A1 1.08) Does not seem to work with Game Logic. Crashes to desktop. - (11 March 2011) - The above comment by Dwarden about 'an additional join required' is no longer true for Operation Arrowhead. + (26 Nov 2008) + Note that a waypoints number as seen in the mission editor is not the same as it's waypoint number using this command. In the mission editor, waypoint 0 refers to the first placed waypoint, whereas waypoint 0 with the setCurrentWaypoint command refers to the unit's initial position waypoint. - (26 September 2013‎) - A unit might not always go prone when ordered to setUnitPos "DOWN", if the unit doesn't agree with the command. To force the unit to go prone, stop the unit from firing by setCombatMode "BLUE" and then order the unit to prone. + (17 Jan 2010) + (A2 1.05) This command may crash the game to desktop if you call it from the on act field of a waypoint that belongs to that same unit. + + (13 Aug 2012) + Using this command forces the last waypoint to complete. Any code in the on Act of that waypoint will run. - Nothing + Nothing + - setUnitRank + enableAI - Sets rank of given unit. - Possible rank values, and the associated rating that is automatically given: - PRIVATE: 0 - CORPORAL: 500 - SERGEANT: 1500 - LIEUTENANT: 2500 - CAPTAIN: 3500 - MAJOR: 5000 - COLONEL: 7500 - Since Arma 3 v1.67 this command is + Enables parts of the AI behavior that was disabled by disableAI. + NOTE: When player switches and leaves behind AI unit, you need to enable "TeamSwitch" AI on it _unit enableAI "TeamSwitch" so that the unit continues with waypoints - https://community.bistudio.com/wiki/setUnitRank + https://community.bistudio.com/wiki/enableAI - Object setUnitRank String + Object enableAI String - unitName setUnitRank rank + unit enableAI skilltype - $Code$player setUnitRank "COLONEL"$/Code$ + $Code$_soldierOne enableAI "Move";$/Code$ - global / local + local / global - (Mar 26, 2009) - Changing a unit's rank using either setUnitRank or setRank will also REPLACE their current rating dependent on their new rank (colonels have a rating of 7500 etc). That is to say REPLACE, not add to: the unit's old rating will disappear with the rank change. - - (December 24, 2015) - In Arma 3, if the rank is not spelled correctly or the string is empty, it will default to Private. This command is not case sensitive. For Arma 3 the rating set by this command is as follows. - (PRIVATE: 0) - (CORPORAL: 50) - (SERGEANT: 150) - (LIEUTENANT: 250) - (CAPTAIN: 350) - (MAJOR: 500) - (COLONEL: 750) The rating listed here will be present on base type respawn. - Nothing + Nothing + - setUnitRecoilCoefficient + setWind - Proportionaly increase/decrease unit's recoil. Drives muzzle up with every shot when supplied positive number and down when negative. 0 cancels recoil. + Set current (forced == false) or permanent (forced == true) wind vector. + NOTE : The effect is global only if command is executed on the server. Wind set locally will sync back to server value in a while. - https://community.bistudio.com/wiki/setUnitRecoilCoefficient + https://community.bistudio.com/wiki/setWind - Object setUnitRecoilCoefficient Number + setWind Array - unitName setUnitRecoilCoefficient coefficient + setWind [x, y, forced] - $Code$player setUnitRecoilCoefficient 10$/Code$ + $Code$setWind [10, 10, true];$/Code$ - undefined / undefined + undefined / global - (March 28, 2015) - Doesnt seem to work on AI or remote controlled units. Setting the value too high, positive or negative produces some interesting recoil animations. - Nothing + Nothing + - setUnitTrait + inAreaArray - Enables or disables a trait or alters a trait of the given unit. Custom trait can only be a bool. - Default traits are: - audibleCoef (scalar) - camouflageCoef (scalar) - engineer (bool) - explosiveSpecialist (bool) - loadCoef (scalar) - medic (bool) - UAVHacker (bool) + Filters given list of Objects and/or Positions in relation to the given area, defined by a trigger, marker, location or array. Returns array of Objects and/or Positions from the list that are inside the area - https://community.bistudio.com/wiki/setUnitTrait + https://community.bistudio.com/wiki/inAreaArray - Object setUnitTrait Array + Array inAreaArray Object + + Array inAreaArray String + + Array inAreaArray Location + + Array inAreaArray Array - unit setUnitTrait [skill_name, value, isCustom] + positions inAreaArray trigger + + positions inAreaArray marker + + positions inAreaArray location + + positions inAreaArray [center, a, b, angle, isRectangle, c] - $Code$player setUnitTrait ["Medic", true ];$/Code$ + $Code$vehicles inAreaArray trigger_1;$/Code$ + + $Code$allUnits inAreaArray marker_1;$/Code$ + + $Code$allPlayers inAreaArray location_1;$/Code$ + + $Code$allDead inAreaArray [[100, 100, 0], 20, 30, 45, false, 10];$/Code$ - local / global + undefined / undefined - (April 27, 2016) - The higher the value for the loadCoef the less stamina a unit has. Negative values will dramatically increase the stamina actually to a point where it extends the stamina bar. + (June 11, 2017) + The array you send the command can be filtered. For example: + $Code$ vehicles inAreaArray "mymarker" select {_x isKindOf "StaticWeapon"}$/Code$ + Will return only the statics inside the given marker - Nothing + Array - Array - Array - Array + - setUnloadInCombat + ctrlCreate - If cargo or turret units should get out of vehicle when in combat. If true, vehicle will stop and units will dismount. Vehicle must be local. + Creates new control in given display. Some of the common controls that can be used with this command: + RscText - simple text box + RscTextMulti - simple multiline text box + RscPicture - simple picture box + RscPictureKeepAspect - picture box that doesn't stretch picture + RscEdit - input box + RscEditMulti - multiline input box + RscTree - tree view control + RscTreeSearch - searchable tree view control (see Example 4) + RscVideo - picture control with autostart for video texture (see BIS_fnc_playVideo ) + RscVideoKeepAspect - picture control for video to keep original video aspect ratio + NOTE : Since Arma 3 v1.69.141213 ctrlCreate will also search for control class in mission config, if search in the main config failed. This means one can now define classes in mission config and use them with ctrlCreate - https://community.bistudio.com/wiki/setUnloadInCombat + https://community.bistudio.com/wiki/ctrlCreate - Object setUnloadInCombat Array + Display ctrlCreate Array - vehicle setUnloadInCombat [allowCargo, allowTurrets] + display ctrlCreate [class, idc, controlsGroup] - $Code$_veh setUnloadInCombat [ true, false ];$/Code$ + $Code$_display ctrlCreate ["RscText", 1234];$/Code$ + + $Code$_map = findDisplay 46 ctrlCreate ["RscMapControl", -1]; + _multiLineText = findDisplay 46 ctrlCreate ["RscTextMulti", -1]; + _multiLineEdit = findDisplay 46 ctrlCreate ["RscEditMulti", -1];$/Code$ + + $Code$myControl = findDisplay 0 ctrlCreate ["RscText", 1234, findDisplay 0 displayCtrl 2300];$/Code$ + + $Code$// Create Tree View control with search. Available RscTreeSearch class is hardcoded to be used with RscEdit with idc 645. Example below demonstrates how to. After tree is generated, try typing something in the top box. + [] spawn + { + disableSerialization ; + _display = findDisplay 46 createDisplay "RscDisplayEmpty"; + _edit = _display ctrlCreate ["RscEdit", 645]; + _edit ctrlSetPosition [0,0,1,0.04]; + _edit ctrlSetBackgroundColor [0,0,0,1]; + _edit ctrlCommit 0; + _tv = _display ctrlCreate ["RscTreeSearch", -1]; + _tv ctrlSetFont "EtelkaMonospacePro"; + _tv ctrlSetFontHeight 0.03; + _tv ctrlSetPosition [0,0.06,1,0.94]; + _tv ctrlSetBackgroundColor [0,0,0,1]; + _tv ctrlCommit 0; + _classes = "true" configClasses ( configFile "CfgVehicles"); + for "_i" from 0 to 5 do + { + _tv tvAdd [[], configName selectRandom _classes]; + for "_j" from 0 to 5 do + { + _tv tvAdd [[_i], configName selectRandom _classes]; + for "_k" from 0 to 5 do + { + _tv tvAdd [[_i, _j], configName selectRandom _classes]; + for "_n" from 0 to 5 do + { + _tv tvAdd [[_i, _j, _k], configName selectRandom _classes]; + }; + }; + }; + }; + };$/Code$ - local / global + undefined / undefined + (February 6, 2016) + Although you can only dynamically create controls using BIS's configs, there are many commands to change certain aspects of each created control. See GUI Control + + (May 29, 2017) + Since Arma 3 1.70 ListBoxes created thru ctrlCreate are no more encountering problems with max of 7 selections without scrolling the control. - Nothing + Control + - setUserActionText + addAction - Changes user added action (see addAction ) menu item text. - Since Arma 3 v1.61.136587 it is possible to set 2 more optional texts, one for background and one for foreground when action is displayed on the screen ( showWindow = true ) + This command syntax is for Arma 3 only. For TKOH and older versions see addAction TKOH + Adds an entry to the action menu of an object (scroll wheel menu). The action can only be activated when in proximity to the object (eg: building). Adding an action to the player obviously makes that action available to the player at all times. The appearance of onscreen text could be further tweaked with setUserActionText. For event handling of user interaction see inGameUISetEventHandler + This command has local effect. Created action is only available on the computer where command was executed. To make action available to all players, command must be executed on all connected clients (see remoteExec ). addAction is also ignored on dedicated server, because of no user interface. In Arma 3 addAction does not work on animals. This is intended behavior. + Since Arma 3 v1.63.136787, two new params are available: radius and unconscious. + Since Arma 3 v1.69.140846, new param is available: selection. + Since Arma 3 v1.81.144102, new param is available: memoryPoint & radius param is now always referencing distance between player eye position ( eyePos ) and object selection, memory point or [0,0,0]; in this order, depending on what params are supplied to the command. - https://community.bistudio.com/wiki/setUserActionText + https://community.bistudio.com/wiki/addAction - Object setUserActionText Array + Object addAction Array - object setUserActionText [actionIndex, textMenu, textWindowBackground, textWindowForeground] + object addAction [title, script, arguments, priority, showWindow, hideOnUse, shortcut, condition, radius, unconscious, selection, memoryPoint] - $Code$_id = player addAction ["Hello", ""]; - player setUserActionText [_id, "Good Bye"];$/Code$ + $Code$// Short and sweet: + player addAction ["A Useless Action That Does Nothing", {}]; + player addAction [" t color='#FF0000' This Useless Action Is RED /t ", { hint "RED"}]; + player addAction ["Hint Hello!", { hint format ["Hello %1!", _this select 3]}, name player ]; + player addAction ["String Exec", " hint 'this is also compiled'"];$/Code$ - $Code$_id = billboard addAction ["Some Action", {}]; - billboard setUserActionText [ - _id, - "Some Action", - " t color='#ff0000' Background----------------- /t br/ Multiline br/ Multiline br/ Multiline br/...", - " t color='#00ff00' -----------------Foreground /t " - ];$/Code$ + $Code$// SQF file example: + _act = player addAction ["Exec the file", "somescript.sqf"] + // somescript.sqf: hint str _this;$/Code$ + + $Code$// SQS file example: + _genAct = generator addAction ["Switch on generator", "activate_generator.sqs"] + // activate_generator.sqs:_gen = _this select 0 + _caller = _this select 1 + _id = _this select 2 + ; remove the action once it is activated + _gen removeAction _id + // This example shows an action called "Switch on generator" added to an object with the name 'generator'. As soon as the player gets close to this object, he can execute the given action via the action menu. Then the script 'activate_generator.sqs' is executed, which in our example only removes the action from the generator.$/Code$ + + $Code$// Create object on dedicated server and add action to the object on every client: + if ( isDedicated ) then + { + _obj = "some_obj_class" createVehicle [1234, 1234, 0]; + [_obj, ["Greetings!", { hint "Hello!"}]] remoteExec ["addAction", -2, _obj]; + };$/Code$ global / local + (August 2, 2006) + An easy way to keep track of and remove actions is to store the IDs of the actions in variables. + This can be accomplished by doing the following: + $Code$_myaction = player addAction ["Hello", "hello.sqs"];$/Code$ + This stores the action's ID in the local variable "_myaction" and assists in keeping track of the action ID. + To remove the above action, you would use the following line: + $Code$ player removeAction _myaction;$/Code$ + + (17:35, 24 August 2013 (CEST)) + In Arma 3 addAction does not work on animals. This is intended behavior. + + (June 19, 2014) + If executing actual script code like this: + $Code$_unit addAction [ "yourAction", { hint "A line of code" } ];$/Code$ + you can have a user action that uses and/or affects variables used elsewhere in the script that adds the action. + But beware! + The variable(s) must be global otherwise it won't work! i.e. + Fail + $Code$_variable = false ; _unit addAction [ "action", { _variable = true } ];$/Code$ + Succeed + $Code$variable = false ; _unit addAction [ "action", { variable = true } ];$/Code$ + + (March 10, 2015) + Actionception: $Code$actions = []; + actions set [0, player addAction ["Actionception", { + if ( count actions == 1) then { + actions set [1, player addAction [" Actionception ", { + if ( count actions == 2) then { + actions set [2, player addAction [" Actionception ", { + if ( count actions == 3) then { + actions set [3, player addAction [" Actionception ", { + { + player removeAction _x ; + } forEach actions; + }, [], 10, false, true ]]; + }; + }, [], 10, false, false ]]; + }; + }, [], 10, false, false ]]; + }; + }, [], 10, false, false ]];$/Code$ + Function to remove user actions with unknown ids: + $Code$KK_fnc_removeUnknownUserActions = { + for "_i" from 0 to ( player addAction ["",""]) do { + if !(_i in _this ) then { + player removeAction _i; + }; + }; + };$/Code$ + To test: + $Code$ for "_i" from 0 to 9 do { + player addAction ["Action #" + str _i, { + [0,5,6] call KK_fnc_removeUnknownUserActions; + }]; + }; + $/Code$ + Removes all user actions but 0, 5 and 6. + + (July 18, 2016) + A3 v1.62.137494 : Condition is not evaluated when map is opened (and probably also true for other displays or opened dialog) + + (October 28, 2017) + addAction with all the default parameters: + $Code$ + addAction["Cookies",{},nil,1.5,true,true,"","true",15,false,""]; + $/Code$ + /dd + /dl - Nothing + Number + - setUserMFDvalue + sqrt - When MFD is using user controllers, this command can set values on them. For example, MFD config for Blackfoot has an entry - ... - class Draw - { - alpha = "user3" ; - color [ ] = { "user0", "user1", "user2" } ; - ... - which could control color of the MFD. See Example 2-3-4 on how to set different colors of the Blackfoot MFD + Returns square root of x. - https://community.bistudio.com/wiki/setUserMFDvalue + https://community.bistudio.com/wiki/sqrt - Object setUserMFDvalue Array + sqrt Number - vehicle setUserMFDvalue [index, value] + sqrt x - $Code$BIS_Plane setUserMFDvalue [0,1]; // user0 in MFD will return 1$/Code$ - - $Code$// Set MFD Red: - Blackfoot setUserMFDvalue [0, 1]; // "user0" - 1 - Blackfoot setUserMFDvalue [1, 0]; // "user1" - 0 - Blackfoot setUserMFDvalue [2, 0]; // "user2" - 0 - Blackfoot setUserMFDvalue [3, 1]; // "user3" - 1$/Code$ - - $Code$// Set MFD pale Blue: - Blackfoot setUserMFDvalue [0, 0]; // "user0" - 0 - Blackfoot setUserMFDvalue [1, 0]; // "user1" - 0 - Blackfoot setUserMFDvalue [2, 1]; // "user2" - 1 - Blackfoot setUserMFDvalue [3, 0.1]; // "user3" - 0.1$/Code$ - - $Code$// Hide MFD: - Blackfoot setUserMFDvalue [3, 0]; // "user3" - 0$/Code$ + $Code$_sq = sqrt 9; // Result is 3$/Code$ undefined / undefined + (18:05, 24 August 2014 (EST)) + Alternatively use "x^0.5" or "x^(1/2)". $Code$_sq = 9^0.5; //Result is 3 + _sq = 9^(1/2); //Result is 3$/Code$ + You can use this method to get any root. + Cubed root = x^(1/3) or x^0.333[repeating]. + Root 4 = x^(1/4) or x^0.25. - Nothing + Number + - setVariable + else - Set variable to given value in the variable space of given element. - To remove a variable, set it to nil (e.g. player setVariable ["varname", nil ];$/Code$ ). - When variable is set on Task, it is not actually set on task itself, but on FSM attached to the task. So if there is no FSM setVariable will not work. - All available variable spaces which support setVariable : - Namespace setVariable Array - Object setVariable Array - Group setVariable Array - Team_Member setVariable Array - Task setVariable Array - Location setVariable Array - Control setVariable Array (since Arma 3 v1.55.133553) - Display setVariable Array (since Arma 3 v1.55.133553) - In Arma 3 it is possible to broadcast nil value + Executes else code when if condition returns false - https://community.bistudio.com/wiki/setVariable + https://community.bistudio.com/wiki/else - Namespace/Object/Group/Team_Member/Task/Location/Control/Display setVariable Array - - Namespace/Object/Group setVariable Array + Code else Code - varspace setVariable [name, value] - - varspace setVariable [name, value, public] + ifCode else elseCode - $Code$_myTruck setVariable ["myPublicVariable", 123, true ];$/Code$ - - $Code$_myTruck setVariable ["myLocalVariable", ["321", _var], false ];$/Code$ - - $Code$missionNamespace setVariable ["myName", "KK"]; - hint myName; //KK$/Code$ + $Code$if (a b) then { c = 0 } else { c = 1 };$/Code$ - $Code$// Get current value of a variable and if it is undefined, define it and get the defined value: - private _var = missionNamespace getVariable "varName"; - if ( isNil "_var") then - { - missionNamespace setVariable ["varName", 123]; - _var = 123; - }; - // _var here will contain current value of the variable varName$/Code$ + $Code$if (a b) then { + hint "B is greater than A"; + } else { + hint "A is greater than B"; + };$/Code$ - global / local + undefined / undefined - (December 9, 2015) - This command does not work with CfgAmmo or CfgNonAIVehicles objects, like bullets, mines or butterflies (probably because they are local objects Killzone Kid ( talk ) 11:25, 9 July 2017 (CEST)). - Nothing - Nothing + Array + - setVectorDirAndUp + getMarkerPos - Sets orientation of an object. The command takes 2 vector arrays, one for vectorDir and one for vectorUp. Default object orientation will always have vectorDir pointing forward (North) along Y axis and vectorUp pointing up along Z axis - [[0,1,0],[0,0,1]], as shown on the diagram below. - When attaching object to an object the axes are relative to the object that gets the attachment. If it is player object for example, then X goes from left to right, Y goes from back to front, and Z goes from down up. - The setDir command is incompatible with setVectorDirAndUp and should not be used together on the same object. Using setVectorDirAndUp alone should be sufficient for any orientation. - In Multiplayer, setVectorDirAndUp must be executed on the machine where the object it applied to is local. + Returns the position of a given marker in format [x,y,0]. Array element 3 (height above ground) is always zero. If a non-existing marker is referenced the values returned are [0,0,0]. - https://community.bistudio.com/wiki/setVectorDirAndUp + https://community.bistudio.com/wiki/getMarkerPos - Object setVectorDirAndUp Array + getMarkerPos String - vehicle setVectorDirAndUp [[x1, y1, z1],[x2, y2, z2]] + getMarkerPos markerName - $Code$// set exact yaw, pitch, and roll - _y = 45; _p = -80; _r = 0; - BRICK setVectorDirAndUp [ - [ sin _y * cos _p, cos _y * cos _p, sin _p], - [ [ sin _r,- sin _p, cos _r * cos _p],-_y] call BIS_fnc_rotateVector2D - ];$/Code$ - - $Code$// To rotate BRICK on Z axis 90 degrees clockwise, change its vectorDir but leave vectorUp unchanged. - BRICK setVectorDirAndUp [[1,0,0],[0,0,1]];$/Code$ - - $Code$// To rotate BRICK on Y axis 90 degrees clockwise, change its vectorUp but leave vectorDir unchanged. - BRICK setVectorDirAndUp [[0,1,0],[1,0,0]];$/Code$ - - $Code$// To rotate BRICK on X axis 90 degrees (tilt forward), change both vectorDir and vectorUp accordingly. - BRICK setVectorDirAndUp [[0,0,-1],[0,1,0]];$/Code$ - - $Code$// More complex orientations - //tilt forward 90 + rotate left 90 - BRICK setVectorDirAndUp [[1,0,0],[0,1,0]]; - //tilt backward 45 degrees - BRICK setVectorDirAndUp [[0,0.5,0.5],[0,-0.5,0.5]]; - //tilt forward 30 degrees - BRICK setVectorDirAndUp [[0,0.66,-0.33],[0,0.33,0.66]];$/Code$ + $Code$"MarkerOne" setMarkerPos [200,100]; + _pos = getMarkerPos "MarkerOne" + // _pos is [200,100,0]$/Code$ - local / global + undefined / undefined - (March 16, 2008) - Command can be also used to rotate camera in all three axis (which also mean it's possible to set camera bank). - - (May 9, 2008) - The object's vectorDir can only control its pitch, while its vectorUp can only control its bank. To set an object's yaw (direction), use the setdir command, before using this command. - You would think vectorUp would control pitch as well, but any pitch that would be set due to vectorUp is ignored. The same is true with vectorDir and yaw; any vectorDir that would adjust yaw is also ignored. If this doesn't make sense, try to visualize it with a box or soda can. - This command does NOT work with values relative to a unit, but rather it works with world vectors (think world coordinates as opposed to model coordinates). As a result, this command can be difficult to use in many situations, because the input values needed to get a certain pitch / bank for an object vary, depending on what direction the object is facing (yaw). - A function to set an object's pitch / bank can be found here - - (October 23rd, 2009) - Note this odd command may now be better understood. There's a thread about it here: - BI Studios Forum Thread - - (1 Jun, 2014) - (ArmA3 ver 1.20) setDir overwrites setVectorDirAndUp (P.S. setVectorDirAndUp also affects setVelocity.), so use setDir before BIS_fnc_setPitchBank, which is an easier workaround on vector, if changing yaw, pitch and bank are needed. setVectorDirAndUp is CCW, so if we wanna to set an obj 40 degrees CW, 170 degrees pitch and 85 degrees bank: - $Code$_obj setDir (40 - 180); [_obj, 170, 85] call BIS_fnc_setPitchBank ;$/Code$ - Same as: - $Code$_obj setVectorDirAndUp [[0.63,0.75,0.17],[-0.75,0.65,-0.084]];$/Code$ - Be aware that attachTo may flip vectorDir if pitch beyond 90 degrees and cause unexpected behavior to BIS_fnc_setPitchBank, e.g. - $Code$[_obj, 100, 0] call BIS_fnc_setPitchBank ; //vector: [-0.14,-0.09,0.98],[-0.83,-0.51,-0.17]$/Code$ - $Code$_obj attachTo [_logic,[0,0,2]]; - [_obj, 100, 0] call BIS_fnc_setPitchBank ; //vector: [0.11,0.33,0.93],[-0.06,0.94,-0.32] - compass direction algorism failed if obj was attached at present.$/Code$ - To overcome such limitation we can use fallowing function for a better workaround. (code originated from bapedibupa, remodified) - $Code$ - _obj attachTo [_logic,[0,0,2]]; - [_obj,[120,-78,37]] call fnc_SetPitchBankYaw; // pitch: 120, bank: -78, yaw: 37$/Code$ - $Code$ - fnc_SetPitchBankYaw = { - private ["_object","_rotations","_aroundX","_aroundY","_aroundZ","_dirX","_dirY", - "_dirZ","_upX","_upY","_upZ","_dir","_up","_dirXTemp","_upXTemp"]; - _object = _this select 0; - _rotations = _this select 1; - _aroundX = _rotations select 0; - _aroundY = _rotations select 1; - _aroundZ = (360 - (_rotations select 2)) - 360; - _dirX = 0; - _dirY = 1; - _dirZ = 0; - _upX = 0; - _upY = 0; - _upZ = 1; - if (_aroundX != 0) then { - _dirY = cos _aroundX; - _dirZ = sin _aroundX; - _upY = - sin _aroundX; - _upZ = cos _aroundX; - }; - if (_aroundY != 0) then { - _dirX = _dirZ * sin _aroundY; - _dirZ = _dirZ * cos _aroundY; - _upX = _upZ * sin _aroundY; - _upZ = _upZ * cos _aroundY; - }; - if (_aroundZ != 0) then { - _dirXTemp = _dirX; - _dirX = (_dirXTemp* cos _aroundZ) - (_dirY * sin _aroundZ); - _dirY = (_dirY * cos _aroundZ) + (_dirXTemp * sin _aroundZ); - _upXTemp = _upX; - _upX = (_upXTemp * cos _aroundZ) - (_upY * sin _aroundZ); - _upY = (_upY * cos _aroundZ) + (_upXTemp * sin _aroundZ); - }; - _dir = [_dirX,_dirY,_dirZ]; - _up = [_upX,_upY,_upZ]; - _object setVectorDirAndUp [_dir,_up]; - }; + (September 1, 2016) + To acomplish getting the altitude of a marker you can do workaround using setMarkerDir as it accepts any number (above 360 or below -360): + $Code$"Marker" setMarkerPos [200,200]; + "Marker" setMarkerDir 1640; $/Code$ + After, setting player position as an example: + $Code$player setPosASL [(getMarkerPos "Marker") select 0, (getMarkerPos "Marker") select 1,(markerDir "Marker")]$/Code$ - Nothing + Array + - setVectorDir + shownRadio - Set object's direction vector. Up vector will remain unchanged. + Check if player has Radio enabled. - https://community.bistudio.com/wiki/setVectorDir + https://community.bistudio.com/wiki/shownRadio - Object setVectorDir Array + shownRadio - object setVectorDir [x,y,z] + shownRadio - + $Code$if ( shownRadio ) then { hint "You have Radio enabled."};$/Code$ + - local / global + undefined / undefined - (March 16, 2008) - Command can be also used to rotate camera in all three axis. - - (21:06, 3 March 2009 (CET)) - setVectorDir can only influence an object's pitch. It can not influence bank. Example: - $Code$player setVectorDir [0,0,1]$/Code$ - If the player is facing 0 degrees (north), then this will do NOTHING. - If the player is facing 90 degrees (east), then this will make him pitch 90 degrees up. - You can't directly pitch an object beyond 90 degrees, because this would change its facing direction. You must first flip it's direction using setDir, then you must bank the object 180 degrees, THEN you pitch the object appropriately. - - (August 17, 2015) - In Arma 3, setVectorDir does not control an object's pitch or bank, in fact, it is not possible to change either of those solely using setVectorDir. This command can only affect horizontal rotation along the x-plane, unless an object first has it's vectorUp changed to something other than [0,0,1]. Correct input to setVectorDir should be calculated using the trigonometric functions sin and cos. - examples: - $Code$ - 0 degrees (north) - player setVectorDir - [ - sin 0, //equals 0 - cos 0, //equals 1 - 1 - ]; - 45 degrees (north-east) - player setVectorDir - [ - sin 45, //equals 0.707 - cos 45, //equals 0.707 - 1 - ];$/Code$ - If you are doing trigonometric calculations, it may be better to use setVectorDir rather than setDir, since sine and cosine have already been calculated and will not need to be re-calculated - (also, setDir probably uses setVectorDir anyway.) - Nothing + Boolean + - setVectorUp + profileName - Set object's up vector. Direction of the object remain unchanged. Default object's vectorUp is [0,0,1]. - In Multiplayer, setVectorUp must be executed on the machine where the object it applied to is local. + Returns profile name. - https://community.bistudio.com/wiki/setVectorUp + https://community.bistudio.com/wiki/profileName - Object setVectorUp Array + profileName - object setVectorUp [x, y, z] + profileName - $Code$// Turn object upside down: - _obj setVectorUp [0,0,-1];$/Code$ - - $Code$// Align object with the terrain underneath: - _obj setVectorUp surfaceNormal position _obj;$/Code$ + $Code$_myProfileName = profileName ;$/Code$ - local / global + undefined / undefined - setVectorUp can only influence an object's bank. It can not influence pitch. Example: - player setVectorUp [0,1,0] - If the player is facing 0 degrees (north), then this will do NOTHING. - If the player is facing 90 degrees (east), then this will make him bank 90 degrees to his left. - - (March 22, 2007) - An in-depth discussion on the concept of vectors is available here. - - (March 16, 2008) - Command can be also used to rotate camera in all three axis (which also mean it's possible to set camera bank). - - (October 3, 2013) - It is possible to change both pitch and bank of an object ( surfaceNormal application for instance). Assuming an ammo box in the following example is facing North (default direction is 0): $Code$_ammobox setVectorUp [0,1,0]; //box is pitched 90 degrees forward - _ammobox setVectorUp [1,0,0]; //box is banked 90 degrees to the right$/Code$ - However the above will stop working as soon as you attach the box to something. The following trick however will work in this case: - $Code$_ammobox attachTo [ player, [0,2,1]]; - _ammobox setVectorUp [0,0.99,0.01]; //box is pitched ~90 degrees forward - _ammobox setVectorUp [0.99,0,0.01]; //box is banked ~90 degrees to the right$/Code$ - Nothing + String + - setVehicleAmmoDef + join - Sets how much ammunition (compared to the configuration of magazines defined in the vehicle's class) the vehicle has. Note that the ammo will only be added to local turrets. To check the locality of turret use turretLocal. + Join all units in the array to given group. + Maximum number of group members is: + OFP: 12 + Arma: ? + Arma 2: ? + Arma 3: "unlimited" (3000+) + VBS 2: "unlimited" (260+) + To have a group member leave a group, join him with the grpNull group (e.g. [guy1] join grpNull ), but beware, as brand new group is created for the leaving unit and this could result in the number of groups in a mission growing out of control. - https://community.bistudio.com/wiki/setVehicleAmmoDef + https://community.bistudio.com/wiki/join - Object setVehicleAmmoDef Number + Array join Group/Object - unit setVehicleAmmoDef value + unitArray join group - $Code$player setVehicleAmmoDef 0;$/Code$ + $Code$[_unitOne, _unitTwo] join player ;$/Code$ + + $Code$[_unitOne, _unitTwo] join ( group player );$/Code$ - local / global + global / global - (December 20, 2014) - For vehicles this command operates relative to its stock magazine loadout (i.e. its CfgVehicles magazines[] values). Thus setVehicleAmmoDef 1 will fully restore a vehicle to its default ammunition capacity, resetting any changes made by intentionally/implicitly adding/removing magazines. - Use setVehicleAmmo to operate in relation to a vehicle's current magazine loadout. - -- Actium ( talk ) 22:49, 20 December 2014 (CET) - Nothing + Nothing + - setVehicleAmmo + if - Sets how much ammunition (compared to a full state defined by the vehicle type) the vehicle has. Note that the ammo will be added only to local turrets. To check locality of turret use turretLocal. - The value ranges from 0 to 1. + This operator creates a If Type which is used in the if-construct as described here. - https://community.bistudio.com/wiki/setVehicleAmmo + https://community.bistudio.com/wiki/if - Object setVehicleAmmo Number + if Boolean - vehicleName setVehicleAmmo value + if condition - $Code$player setVehicleAmmo 0;$/Code$ + $Code$_retVal = if (1 0) then { "It's true" } else { "It's false" }; + hint str _retVal$/Code$ - $Code$_vehicle setVehicleAmmo 1;$/Code$ + $Code$_val = if ( true ) then [ { "true" }, { "false" } ]; + hint _val;$/Code$ - local / global + undefined / undefined - This command does not add magazines to vehicle weapons that normally start with more than one magazine. It can however, remove these magazines. - - A2:OA v1.59 - Magazines of vehicle turrets are also refilled by this command. - - If you 'unit/vehicle setVehicleAmmo 0;' an unit/vehicle first, you cannot refill it with 'unit/vehicle setVehicleAmmo 1;'. - You need to execute where the unit is local. - You need to execute on the effectiveCommander of a vehicle. - - In ArmA 3, using this command seems correctly rearm the vehicle and its turrets in all situations (tested with beta 0.72). + (Jan 31, 2007) + Any _local variables you declare within the body of an if / then statement (ie between the curly braces) are local to that 'if' statement, and are destroyed at the end of the statement. If you know you want to use the variable outside the 'if' statement, make sure your declare it before the 'if' statement. - In ArmA 3, when using this on a player, this command can only reduce the number of magazine in relation to the current ammo quantity of the unit. For example if player has 8 magazines, player setVehicleAmmo 0.5; will leave unit with 4 mags. Executing player setVehicleAmmo 0.5; again will leave unit with 2 mags. player setVehicleAmmo 0.5; again - 1 mag. player setVehicleAmmo 0; will remove all mags. If player had 10 mags with 30 bullets in each, player setVehicleAmmo 0.01; will leave player with loaded mag with 3 bullets in it (300 x 0.01 = 3) + (Jan 17, 2010) + (A2 1.05) If the condition is nil then neither the "then" nor the "else" section get executed, but the script will proceed with no error messages. + Example code: + $Code$ + hint "script started"; //will get executed + if (nil) then + { + hint "true"; // will never get executed + } + else + { + hint "false"; // will never get executed + }; + sleep 3; + hint "script ended"; //will get executed$/Code$ - (December 20, 2014) - This command does not operate compared to a full state defined by the vehicle type, but rather relative to a vehicle's current magazine loadout. To get the former behaviour use setVehicleAmmoDef, which utilizes the vehicles default magazine loadout (i.e. its CfgVehicles magazines[] values). + (June 5, 2015) + If you only need to choose between 2 raw values, it is possible to use the following trick to avoid using code blocks, as required by the if command, which results in greater atomicity and faster execution: + $Code$_result = [falseValue, trueValue] select condition;$/Code$ + The select command treats "false" as 0 and "true" as 1, therefore you can feed it a condition determining the array index of the value to be returned. Here is another example: + $Code$_result = [1,-1] select (_this 0); // If _this is less than 0, _result will be equal to -1, otherwise it will be 1$/Code$ + This feature was added in Arma 3. - Nothing + If_Type + - setVehicleArmor + getRepairCargo - Sets the armor (or health for men) state of the vehicle (a value from 0 to 1). - Works like setDamage only in reverse: player setVehicleArmor 1 is the same as player setDamage 0, and player setVehicleArmor 0 is the same as player setDamage 0.97 + Returns the amount of repair resources from empty (0) to full (1) in the cargo space of a repair vehicle. - https://community.bistudio.com/wiki/setVehicleArmor + https://community.bistudio.com/wiki/getRepairCargo - Object setVehicleArmor Number + getRepairCargo Object - vehicleName setVehicleArmor value + getRepairCargo vehicle - $Code$player setVehicleArmor 0.5;$/Code$ + $Code$value = getRepairCargo vehicleName;$/Code$ - local / global + global / undefined + (December 22, 2014) + If the vehicle is not alive, it always returns Nothing, which you should check for using isNil. + If the vehicle is unable to carry that type of cargo, it returns -1.#IND, which you should check for using finite. - Nothing + Number + - setVehicleCargo + ropeAttachedObjects - Load cargo vehicle inside vehicle if possible, returns bool based on whether the vehicle was able to be loaded. Can also be used to unload a specific loaded vehicle or all loaded vehicles. + Returns list of attached objects on ropes - https://community.bistudio.com/wiki/setVehicleCargo + https://community.bistudio.com/wiki/ropeAttachedObjects - Object setVehicleCargo Object + ropeAttachedObjects Object - vehicle setVehicleCargo cargo + ropeAttachedObjects vehicle - $Code$// Blackfish with no vehicle cargo loaded - _success = blackfish setVehicleCargo offroad; //true$/Code$ - - $Code$// Blackfish with full cargo already loaded - _success = blackfish setVehicleCargo offroad; //false$/Code$ - - $Code$// Unload specific loaded vehicle - _success = objNull setVehicleCargo offroad;$/Code$ - - $Code$// Unload all vehicles - _success = blackfish setVehicleCargo objNull ;$/Code$ + $Code$_cargoArray = ropeAttachedObjects heli1;$/Code$ undefined / undefined - (July 4, 2016) - From biforums : - "objnull setVehicleCargo cargo vehicle - will unload specific loaded vehicle" and "transporting vehicle setVehicleCargo objnul - unload all vehicles" - Boolean + Array + - setVehicleId + createAgent - Sets id (integer value) to vehicle. By this id vehicle is referenced by triggers and waypoints. + Creates an (independent) agent (person) of the given type (type is a name of a subclass of CfgVehicles ). An agent does not have a group or leader or the standard soldier FSM associated with it -- for instance, an enemy soldier spawned as an agent has limited AI and will stand stupidly when fired upon -- which can be useful to limit the amount of AI processing being done in a mission with very large numbers of "AI". If the markers array contains several marker names, the position of a random one is used, otherwise, the given position is used. The unit is placed inside a circle with this position as its center and placement as its radius. + Players assigned to an agent using setPlayable will be able to control the agent, operate weapons and other actions, but will not be able to access their inventory using the gear screen. + Special properties can be: "NONE", "CAN_COLLIDE" and "FORM". - https://community.bistudio.com/wiki/setVehicleId + https://community.bistudio.com/wiki/createAgent - Object setVehicleId Number + createAgent Array - vehicleName setVehicleId id + createAgent [type, position, markers, placement, special] - $Code$player setVehicleId 1$/Code$ + $Code$agent = createAgent ["SoldierWB", position player, [], 0, "FORM"];$/Code$ undefined / undefined + (September 29, 2014) + In Arma 3, default FSM is calling BIS_fnc_animalBehaviour script upon agent creation, which takes on some animal behavioural logic. The problem here is that it is almost impossible to make animal do what is told. Until now. Since Arma 3 v1.31.127383 you can set BIS_fnc_animalBehaviour_disable variable on the agent at the moment of agent creation, to override the function. + $Code$tr = createTrigger ["EmptyDetector", player modelToWorld [0, 10, 0]]; + tr setTriggerArea [5, 5, 0, true ]; + tr setTriggerActivation ["CIV", "PRESENT", true]; + rabbits = []; + private "_r"; + for "_i" from 1 to 10 do { + _r = createAgent ["Rabbit_F", position tr, [], 0, "NONE"]; + _r setVariable ["BIS_fnc_animalBehaviour_disable", true ]; + rabbits pushBack _r; + }; + tr setTriggerStatements [ + " if (rabbits isEqualTo thisList) exitWith { + _r = thisList select floor random count thisList; + _r moveTo (_r modelToWorld [2.5 - random 5, 2.5 - random 5, 0]); + }; + _esc = rabbits - thisList; + doStop _esc; + {_x moveTo position thisTrigger} forEach _esc; + systemChat str [ time, _esc]; + false ", + "", + "" + ];$/Code$ + + (April 18, 2015) + Agents seem to use the same collision model that the player uses, unlike normal AI. Normal AI don't collide with objects, but agents are physically stopped by obstacles the same way players are. This also probably means agents cost more resources than normal AI. - Nothing + Object + - setVehicleLock + isDLCAvailable - Sets vehicle lock. Possible values: - "UNLOCKED" - "DEFAULT" - "LOCKED" - "LOCKEDPLAYER" + Returns true if the DLC is marked as available. (Steam) - https://community.bistudio.com/wiki/setVehicleLock + https://community.bistudio.com/wiki/isDLCAvailable - Object setVehicleLock String + isDLCAvailable Number - vehicleName setVehicleLock lockState + isDLCAvailable appid - $Code$_veh1 setVehicleLock "LOCKED";$/Code$ + $Code$_Karts = 288520; + isDLCAvailable _Karts;//Returns true$/Code$ - local / global + undefined / undefined - (October 22, 2014) - In Arma 3: - setVehicleLock "UNLOCKED" = same as " lock 0" - setVehicleLock "DEFAULT" = same as " lock 1" - setVehicleLock "LOCKED" = same as " lock 2" - setVehicleLock "LOCKEDPLAYER" = same as " lock 3" - - (March 4, 2015) - DEFAULT lock is default vehicle lock when vehicle placed in editor. If player is in a group of AIs and not the leader, he will not be able to enter this vehicle as he will not have GetIn action for this vehicle. + (October 19, 2014) + appid can be taken from Steam DLC url. + Karts url is http://store.steampowered.com/app/ 288520 / + Zeus url is http://store.steampowered.com/app/ 275700 / + DLC bundle url is http://store.steampowered.com/app/ 304400 / - Nothing + Boolean + - setVehiclePosition + in - Moves the object to a given position (same as createVehicle placement algorithm). Uses either the position that's defined by the position param, or one of the marker positions from the markers array. The object is placed inside a circle with position as its center and placement as its radius. The type of placement could also be controlled with special. - If position is in water and vehicle can float, it is placed on water surface, otherwise it is placed on the ground, even if ground is under water. If roof surfaces support walking, units will be placed on roofs if such position is given. + Checks whether value is in array, unit in vehicle or position inside location. In case of value in array check, String values will be compared on CaSEseNsiTIve basis (see Example 2). Note: In Arma 2 you can not test for arrays within arrays using this command. - https://community.bistudio.com/wiki/setVehiclePosition + https://community.bistudio.com/wiki/in - Object setVehiclePosition Array + Anything in Array + + Object in Object + + Array in Location - object setVehiclePosition [position, markers, placement, special] + value in array + + unit in vehicle + + position in location - $Code$player setVehiclePosition [[1000,2000], ["Pos1","Pos2","Pos3"], 0, "CAN_COLLIDE"]; - // Will place the player at either [1000,2000], or one of the three markers positions.$/Code$ + $Code$1 in [0,1,2]; //true$/Code$ - $Code$heli setVehiclePosition [ player, [], 0, "FLY"];$/Code$ + $Code$"lol" in ["Lol", "LOL", "loL"]; //false + "loL" in ["Lol", "LOL", "loL"]; //true$/Code$ - $Code$_cam = "camera" camCreate [0,0,0]; - _cam setDir random 360; - _cam setVehiclePosition [[5000,5000], [], 1000, "NONE"]; - _cam setPosWorld ( getPosWorld _cam vectorAdd [0,0,1.8]); - _cam cameraEffect ["Internal", "Back"];$/Code$ + $Code$// Arma 3: + [1,2,3] in [[1,2,3],[4,5,6]]; //true$/Code$ - $Code$private _tablePos = player getRelPos [3, 0]; - private _table = "Land_CampingTable_F" createVehicle [0,0,0]; - private _laptop = "Land_Laptop_unfolded_F" createVehicle [0,0,0]; - _table setPos _tablePos; - _laptop setVehiclePosition [_tablePos vectorAdd [0.5, 0.2, 10], [], 0, "CAN_COLLIDE"]; - _laptop attachTo [_table];$/Code$ + $Code$_isInCar = player in car;$/Code$ + + $Code$_isInside = [1000,2000,0] in myLocation;$/Code$ - global / global + undefined / undefined - (June 24, 2015) - If you need to set direction as well, set it before using setVehiclePosition. The command will use existing dir of the object for its calculations. - $Code$ player setDir random 360; - player setVehiclePosition [ player, [], 100, "none"];$/Code$ + (15:58, 18 January 2007 (CET)) + For a case- insensitive test use count : + $Code${_x == "lol"} count ["Lol", "LOL", "loL"]; //returns 3.$/Code$ + Checking if an array (for example a position) is in another array doesn't produce an error, but it will always return false. e.g. + $Code$[0,0,0] in [[0,0,0],[1,4,3],[5,3,1]]; //returns: false.$/Code$ + + (August 23, 2014) + As of Arma 3 1.26: + $Code$[0,0,0] in [[0,0,0],[1,4,3],[5,3,1]]; //returns true + [1,2,3] in [[1,2,3],[4,5,6]]; //returns true + $/Code$ + Assuming it is now using comparison as found in isEqualTo + + (August 27, 2017) + The Object syntax of in might not behave as you'd expect (e.g. it would always return true ) when both parameters are the same object. It serves as a quick method of checking if a unit is mounted: + $Code$ private _onFoot = _unit in _unit;$/Code$ - Boolean + Boolean - Boolean - Boolean + - setVehicleRadar + leaderboardState - Sets the AI rules of Radar usage (Emission Control). Automatic means Radar switched on only when in Combat. The command doesn't affect player-controlled vehicles. + returns state of the board with given name. 0: Busy (async. operation in progress); 1: Async. operation ended with success; 2: Async. operation ended with error; 3: Invalid board (bad board name, not initialized etc.). - https://community.bistudio.com/wiki/setVehicleRadar + https://community.bistudio.com/wiki/leaderboardState - Object setVehicleRadar Number + leaderboardState String - vehicle setVehicleRadar rules + leaderboardState boardname - $Code$_vehicle setVehicleRadar 1;$/Code$ + $Code$leaderboardState ["TT01", 1234, [5,6,7,8]]$/Code$ undefined / undefined @@ -63272,27 +64981,37 @@ - Nothing + Number + - setVehicleReceiveRemoteTargets + targetKnowledge - Sets that the vehicle will be able to receive targets acquired by someone else via datalink from the Side center. + Returns unit's knowledge about target. The returned array includes information whether the target is + known by group + known by the unit + last time the target was seen by the unit + last time the target endangered the unit + target side + position error + target position - https://community.bistudio.com/wiki/setVehicleReceiveRemoteTargets + https://community.bistudio.com/wiki/targetKnowledge - Object setVehicleReceiveRemoteTargets Boolean + Object targetKnowledge Object - vehicle setVehicleReceiveRemoteTargets bool + unit targetKnowledge target - $Code$( vehicle player ) setVehicleReceiveRemoteTargets true;$/Code$ + $Code$_allInfo = _soldierOne targetKnowledge _jeepOne;$/Code$ + + $Code$_posError = (_soldierOne targetKnowledge _jeepOne) select 5;$/Code$ undefined / undefined @@ -63300,83 +65019,111 @@ - Nothing + Array + - setVehicleReportOwnPosition + allMissionObjects - Sets that the vehicle will share its own position via datalink to the Side center. + Returns all mission objects (created by or during a mission) with given type (or its subtype). In some cases allMissionObjects could be substituted with entities, which would be much much faster alternative. Some of the unusual mission objects that can be detected with this command (as well as with nearestObject ): + "#slop" - blood drop + "#mark" - unit footprints + "#track" - vehicle tracks + "#crater" - explosion crater on the ground + "#crateronvehicle" - bullet marks on vehicle + "#explosion" - an explosion + "#objectdestructed" - building, tree or bush destruction + "#soundonvehicle" - sound created with say3D for example + "#dynamicsound" - sound source created using createSoundSource - https://community.bistudio.com/wiki/setVehicleReportOwnPosition + https://community.bistudio.com/wiki/allMissionObjects - Object setVehicleReportOwnPosition Boolean + allMissionObjects String - vehicle setVehicleReportOwnPosition report + allMissionObjects type - $Code$( vehicle player ) setVehicleReportOwnPosition true;$/Code$ - - - undefined / undefined + $Code$_airObjects = allMissionObjects "Air";$/Code$ + + $Code${ deleteVehicle _x } forEach ( allMissionObjects "");$/Code$ + + $Code$_allMObjects = allMissionObjects "All";$/Code$ + + + undefined / undefined + (June 22, 2012) + Be VERY careful with the use of this command. It is very demanding as it must iterate through all mission created objects. Particular care should be taken exercising this often on dedicated servers. + + (Decembere 15, 2013) + For some reason in Arma 3 this command is up to 5 times faster on the dedicated server than on a connected client. In my experiments it took on average 5 ms for the command to complete on a client while under 1 ms on the server. - Nothing + Array + - setVehicleReportRemoteTargets + getArtilleryAmmo - Sets that the vehicle will share targets that were acquired by its own sensors via datalink to the Side center. + Get list of all available magazines of artillery units on the list. Command returns only unique magazine types and doesn't contain any information about which unit has which magazine. - https://community.bistudio.com/wiki/setVehicleReportRemoteTargets + https://community.bistudio.com/wiki/getArtilleryAmmo - Object setVehicleReportRemoteTargets Boolean + getArtilleryAmmo Array - vehicle setVehicleReportRemoteTargets bool + getArtilleryAmmo [unit1, unit2, unit3] - $Code$( vehicle player ) setVehicleReportRemoteTargets true;$/Code$ + $Code$if ("8Rnd_82mm_Mo_Flare_white" in getArtilleryAmmo [ + _mortar1, + _mortar2, + _mortar3, + _mortar4 + ]) then { + hint "Sir, we have white flares, sir!"; + };$/Code$ - undefined / undefined + global / undefined - Nothing + Array + - setVehicleTIPars + setRectangular - Sets the "heat" state of different vehicle parts (for TI detection). This allows simulation of heated up parts of a vehicle without it actually having to utilize them. (0: cold, 1: hot) + Set the shape of a location to be either rectangular or elliptical. Locations default shape is elliptical. - https://community.bistudio.com/wiki/setVehicleTIPars + https://community.bistudio.com/wiki/setRectangular - Object setVehicleTIPars Array + Location setRectangular Boolean - vehicle setVehicleTIPars [engine, wheels, weapon] + location setRectangular set - $Code$vehicle player setVehicleTIPars [1,1,1];$/Code$ + $Code$myLocation setRectangular true ;$/Code$ undefined / undefined @@ -63384,33 +65131,32 @@ - Nothing + Nothing + - setVehicleVarName + triggerArea - Sets string representation of an object to a custom string. For example it is possible to return "MyFerrari" instead of default "ce06b00# 164274: offroad_01_unarmed_f.p3d" when querying object as string: - $Code$ hint str _offroad; //MyFerrari$/Code$ - When a vehicle is created and named in the editor, the name becomes both the variable containing the vehicle object and the string representation of the vehicle object. vehicleVarName on the other hand is only string representation of the object. So if you want to refer to the actual object by its vehicleVarName, an extra step needed to assign the object to a variable of the same name. For example to see and refer to offroad as myFerrari: - $Code$_offroad setVehicleVarName "MyFerrari"; MyFerrari = _offroad;$/Code$ - In multiplayer environment setVehicleVarName has to be executed on every PC if you want the custom name to be known everywhere. If vehicle is created and named in the editor, the vehicle name will be known globally automatically. - To reset vehicleVarName and str representation of the object to original form set vehicleVarName to an empty string: - $Code$_offroad setVehicleVarName "";$/Code$ + Returns currently monitored trigger area. The trigger could be local or remote but the result returned by this command will be for the trigger condition set up locally on the client that executed the command. See createTrigger for more info. + NOTE : Since Arma 3 v1.59.135137, triggerArea returns 3rd dimension for the monitored area. If height is not set, the value for it would be -1; - https://community.bistudio.com/wiki/setVehicleVarName + https://community.bistudio.com/wiki/triggerArea - Object setVehicleVarName String + triggerArea Object - object setVehicleVarName name + triggerArea trigger - $Code$player setVehicleVarName "aP";$/Code$ + $Code$_area = triggerArea sensor1; // result is [200, 120, 45, false]$/Code$ + + $Code$// Since Arma 3 v1.59.135137: + _area = triggerArea sensor1; // result is [200, 120, 45, false, -1];$/Code$ global / local @@ -63418,368 +65164,455 @@ - Nothing + Array + - setVelocityModelSpace + createUnit - Sets the velocity (speed vector) of the given vehicle relative to its model. + Create unit of a class that's defined in CfgVehicles. + The Group parameter MUST be an existing group or the unit won't be created. - https://community.bistudio.com/wiki/setVelocityModelSpace + https://community.bistudio.com/wiki/createUnit - Object setVelocityModelSpace Array + Group createUnit Array + + String createUnit Array - vehicle setVelocityModelSpace [x, y, z] + group createUnit [type, position, markers, placement, special] + + type createUnit [position, group, init, skill, rank] - $Code$car setVelocityModelSpace [0, 10, 0]; //pushes car forward$/Code$ + $Code$_unit = group player createUnit ["B_RangeMaster_F", position player, [], 0, "FORM"];$/Code$ + + $Code$"B_RangeMaster_F" createUnit [ position player, group player ];$/Code$ + + $Code$"B_RangeMaster_F" createUnit [ getMarkerPos "barracks", _groupAlpha];$/Code$ + + $Code$"B_RangeMaster_F" createUnit [ getMarkerPos "marker_1", _groupAlpha, "loon1 = this; + this addWeapon 'BAF_L85A2_RIS_SUSAT'", 0.6, "corporal"];$/Code$ - local / global + undefined / global + (August 13, 2006) + To give a newly created unit a name, put "newUnit = this" in the init field. + + (18:41, 5 April 2007 (CEST)) + The eventhandlers added with addEventHandler in the init parameter will only fire locally on the machine where this creation command is called from. + + (December 24, 2007) + If you do not wish it to be in a group, you can create a gamelogic and group it to that. Note: The unit will deny to move away from the gamelogic. + + (August 27, 2015) + In order to solve the above problem you can simply group it to the game logic as stated, then group it to grpNull + e.g + $Code$myUnit join myGroupLogic; + myUnit join grpNull + $/Code$ + + (21 December 2006) + Although this command takes a group as an argument, you need to use the join command if you want the created units to perform actions such as move. For example: + $Code$ comment "Create a new soldier within 100m of the player and cause them to run towards the player" ; + _grp = createGroup west ; + unit = _grp createUnit ["SoldierWB", position player, [], 100, "FORM"] ; + [unit] join _grp ; + unit move position player ; + $/Code$ + However, some commands such as setUnitPos only work if run before the join. + + (11 March 2011) + Comment above about 'an additional join required' is no longer true for Operation Arrowhead. + + (27th Nov 2016) + (A3 v1.64)The side of created unit by this command fallows the fraction from its config and won’t be affected by the side of the passed group parameter which is created by createGroup on the fly without entities. + $Code$ + _grp = createGroup east ; // O Alpha 1-1 + _ap = _grp createUnit [ “C_man_p_beggar_F”, position player, [], 0, "FORM"]; + //the side of _ap is still CIV not EAST. + $/Code$ + We can use join command family or fill the _grp with entities in advance to set _ap to our desired side. - Nothing + Object - Nothing + - setVelocityTransformation + params - Interpolate and sets vectors. For additional info see this resource. + Parses input argument into array of private variables. When used without argument, as shown in main syntax, internal variable _this, which is usually available inside functions and event handlers, is used as argument. + In addition to simple parsing directly into variables, input can be tested in case it is undefined, of the wrong type or of the wrong size (if array) and substituted if necessary with default values. Since Arma 3 v1.53.132691, onscreen errors are displayed for when the input is of the wrong type or size. - https://community.bistudio.com/wiki/setVelocityTransformation + https://community.bistudio.com/wiki/params - Object setVelocityTransformation Array + params Array + + Anything params Array - objectName setVelocityTransformation [position1, position2, velocity1, velocity2, direction1, direction2, up1, up2, time] + params [element1, element2,elementN] + + argument params [element1, element2,elementN] - $Code$_tracker setVelocityTransformation [ - getPosASL _currentPos, - getPosASL _nextPos, - velocity _currentVelocity, - velocity _nextVelocity, - vectorDir _currentVectorDir, - vectorDir _nextVectorDir, - vectorUp _currentVectorUp, - vectorUp _nextVectorUp, - _timeDiff - ];$/Code$ + $Code$[1, 2, 3] call { + private ["_one", "_two", "_three"]; + _one = _this select 0; + _two = _this select 1; + _three = _this select 2; + //..... + }; + // Same as above, only using params + [1, 2, 3] call { + params ["_one", "_two", "_three"]; + //..... + };$/Code$ - $Code$// Bob on imaginary stairway to heaven: - bob = createAgent ["C_man_1", player getRelPos [5, 0], [], 0, "CAN_COLLIDE"]; - bob switchMove "ladderciviluploop"; - pos1 = getPosASL bob; - pos2 = pos1 vectorAdd [0,0,0.75]; - bob addEventHandler ["AnimDone", - { - pos1 = pos2; - pos2 = pos2 vectorAdd [0,0,0.75] - }]; - onEachFrame - { - if (! alive bob) then - { - onEachFrame {}; - bob switchMove ""; - bob removeAllEventHandlers "AnimDone"; + $Code$[123] call { + params ["_myvar"]; }; - bob setVelocityTransformation [ - pos1, - pos2, - [0,0,0], - [0,0,0], - [0,1,0], - [0,1,0], - [0,0,1], - [0,0,1], - moveTime bob - ]; + // Below would produce the same result as above + 123 call { + params ["_myvar"]; + };$/Code$ + + $Code$position player params ["", "", "_z"]; + if (_z 10) then { + hint "YOU ARE FLYING!"; + };$/Code$ + + $Code$[1, nil, 2] params ["_var1", "_var2", "_var3"]; + // All 3 variables are made private but only _var1 and _var3 are defined + [1, nil, 2] params ["_var1", ["_var2", 23], "_var3"]; + // All 3 variables are private and defined$/Code$ + + $Code$[1, 2] call { + if (! params ["_var1", "_var2", ["_var3", true, [ true ]]]) exitWith { + hint str [_var1, _var2, _var3]; + }; + }; + // The hint shows [1,2,true] + //Script exits, default value was used due to missing value + [1, 2, 3] call { + if (! params ["_var1", "_var2", ["_var3", true, [ true ]]]) exitWith { + hint str [_var1, _var2, _var3]; + }; + }; + // The hint shows [1,2,true] + //Script exits, default value was used due incorrect value type$/Code$ + + $Code$[1, "ok", [1, 2, 3]] call { + if (! params [ + ["_var1", 0, [0]], + ["_var2", "", [""]], + ["_var3", [0,0,0], [[], objNull, 0], [2,3]] + ]) exitWith {}; + hint "ok"; + }; + // Passes validation + [1, 2, [3, 4, 5]] call { + if (! params ["_var1", "_var2", ["_var3", [], [[], objNull, 0], 0]]) exitWith {}; + hint "ok"; + }; + // Fails, because passed array is expected to be of 0 length, i.e. empty$/Code$ + + $Code$position player params ["_x", "_y"]; + player setPos [_x, _y, 100];$/Code$ + + $Code$[1, 2, 3, [4, 5, 6]] call { + params ["_one", "_two", "_three"]; + _this select 3 params ["_four", "_five", "_six"]; };$/Code$ + + $Code${ + _x params ["_group", "_index"]; + //..... + } forEach waypoints group player ; + fn_someFnc = { + params ["_position", ["_direction", 0], ["_name", ""]]; + // Extract the x, y, and z from "_position" array: + _position params ["_x", "_y", "_z"]; + //..... + }; + [ position player, direction player, name player ] call fn_someFnc;$/Code$ + + $Code$targ addEventHandler ["HitPart", { + _this select 0 params ["_target", "_shooter", "_projectile"]; + }];$/Code$ undefined / undefined - (Aug 4, 2014 – 12:35) - (A3 1.24) Generally speaking setVelocityTransformation is more likely a combination of setPosASL, setVectorDirAndUp (or BIS_fnc_setPitchBank ) and time multiplier. It can be used as a position tracker with all necessary information collected, copied and then released within one function. Here’s a simple reproduction on how setVelocityTransformation works in game: - $Code$ - private ["_dataOld","_dataNext","_capturedData","_obj","_fps","_startTrackingTime","_stepOld","_stepNext","_tracker","_tempTime"]; - _stepOld = 0; - _tempTime = 0; - _stepNext = 1; - while { true } do { - _capturedData = _capturedData + [[ getPosASL _obj, velocity _obj, vectorDir _obj, vectorUp _obj]]; - sleep _fps; - _tempTime = _tempTime + _fps; - if (_tempTime = _startTrackingTime) then { - _dataOld = _capturedData select _stepOld; - _dataNext = _capturedData select _stepNext; - _stepOld = _stepOld + 1; - _stepNext = if (_stepNext = ( count _capturedData)) then [{_stepOld},{_stepNext + 1}]; - _tracker setVelocityTransformation - [_dataOld select 0,_dataNext select 0,_dataOld select 1,_dataNext select 1, - _dataOld select 2,_dataNext select 2,_dataOld select 3,_dataNext select 3,1]; + (August 30, 2015) + Because params doubles as private, instead of: + $Code$[1, 2, 3] params ["_one", "_two", "_three"]; + private "_four"; + _four = 4;$/Code$ + You can just: + $Code$[1, 2, 3] params ["_one", "_two", "_three", "_four"]; + _four = 4;$/Code$ + + (November 3, 2016) + With a function only taking one Parameter, it doesn't matter whether the parameter is in an array or not: + Example: + $Code$1 call { + params [ ["_number",0, [0]] ]; }; + or + [1] call { + params [ ["_number",0, [0]] ]; };$/Code$ - Tracker starts coping the route and stance from the object when time start counting. TimeDiff determines the distance multiply between the current position and the next position. + But when the one Parameter is an array that parameter has to be inside of an array when the function is called + Example: + $Code$[1,2] call { + params [ ["_array", [], [[]], 2] ]; + };//Fails + [[1,2]] call { + params [ ["_array", [], [[]], 2] ]; + };//Succeeds$/Code$ - Nothing + Boolean - Boolean + - setVelocity + getArray - Set velocity (speed vector) of a vehicle. Units are in metres per second. + Extract array from config entry. - https://community.bistudio.com/wiki/setVelocity + https://community.bistudio.com/wiki/getArray - Object setVelocity Array + getArray Config - vehicleName setVelocity [x, y, z] + getArray config - $Code$_truck1 setVelocity [20, 0, 0];$/Code$ - - $Code$// Advanced method used for relative acceleration: - _vel = velocity _vehicle; - _dir = direction _vehicle; - _speed = 10; comment "Added speed"; - _vehicle setVelocity [ - (_vel select 0) + ( sin _dir * _speed), - (_vel select 1) + ( cos _dir * _speed), - (_vel select 2) - ];$/Code$ + $Code$_array = getArray (configFile "CfgVehicles" "Thing" "threat")$/Code$ - local / global + undefined / undefined - (20 Jun, 2014) - (ArmA3 1.22) setVelocity will be affected by setDir and setVectorDirAndUp. So use it after them. + (Mar 28, 2014) + (ArmA3 1.14) It's recommended to use BIS_fnc_GetCfgData or BIS_fnc_returnConfigEntry to get variable cfg data rather than conditioning via isNumber, isText, isArray, getNumber, getText and getArray combination. + Traditional workaround: + $Code$ + _cfg = configFile "CfgVehicles" _SomeAddonClassName "DestructionEffects" "Smoke1" "type" + switch ( true ) do + { + case ( isNumber _cfg): { getNumber _cfg}; + case ( isText _cfg): { getText _cfg}; + case ( isArray _cfg): { getArray _cfg;}; + default { nil }; + }; + $/Code$ + Recommended workaround: + $Code$ + ( configFile "CfgVehicles" _SomeAddonClassName "DestructionEffects" "Smoke1" "type") call BIS_fnc_GetCfgData ; + $/Code$ + To return default value once entry was not found, we can use BIS_fnc_returnConfigEntry instead of BIS_fnc_GetCfgData. + $Code$ + [( configFile "CannonFire" "LightExp"),"lifeTime",0] call BIS_fnc_returnConfigEntry ;//0.5 + $/Code$ + + (January 12, 2018) + There is special behaviour if you try to read a description.ext config entry Array that contains a Bool. + Getting array in MP will result in Number, while SP will return String. + $Code$// SP with false in array + getArray ( missionConfigFile "someClass" "someArray") // - "false" + // MP with false in array + getArray ( missionConfigFile "someClass" "someArray") // - 0$/Code$ - Nothing + Array + - setViewDistance + setVehicleId - Set rendering distance, in metres. Default is 900m (in OFP) or 1,200m (in ArmA), accepted range is 500m to 5,000m (in OFP) or 10,000m (in ArmA). Setting view distance to = 0 resets the value to the one set in Options- Video- General- Visibility- Overall + Sets id (integer value) to vehicle. By this id vehicle is referenced by triggers and waypoints. - https://community.bistudio.com/wiki/setViewDistance + https://community.bistudio.com/wiki/setVehicleId - setViewDistance Number + Object setVehicleId Number - setViewDistance distance + vehicleName setVehicleId id - $Code$setViewDistance 2250;$/Code$ - - $Code$//reset view distance in Arma 3 - setViewDistance -1;$/Code$ + $Code$player setVehicleId 1$/Code$ - undefined / local + undefined / undefined - In OFP v1.96, view distance also defines the maximum distance between a unit and any other unit they can know about. Higher view distance will involve more AI simulation cycles for every unit, which causes low performance. - - I tested the above and it seems to apply in Arma 2 as well. AI at a bit above 500m would stop engaging when I lowered the view distance down to 500m and re-engaged when I increased it back. - - In ArmA 2 viewDistance can be set up to 15 km with this command ( while from interface only 10 km ) - - (October 15, 2014) - In Arma 3, Values below 200 have no visible effect. - - (November 20, 2014) - To clarify Bernagee's post, values under 200 have no effect. Tested by setViewDistance below 200, then hint viewDistance. It will not go below 200. Also, as object view distance can only be, at a maximum, the view distance, object view distance will also be reset to 200. - - (June 8, 2015) - Client-side max view distance is limited by the server's view distance. - Tested in Arma 3. - Nothing + Nothing + - setVisibleIfTreeCollapsed + mapAnimClear - Sets whether or not the object is visible even if the tree is collapsed. - i - Some Old Editor Command + Clear map animation. - https://community.bistudio.com/wiki/setVisibleIfTreeCollapsed + https://community.bistudio.com/wiki/mapAnimClear - Control setVisibleIfTreeCollapsed Array + mapAnimClear - map setVisibleIfTreeCollapsed [object, visible] + mapAnimClear - $Code$_map setVisibleIfTreeCollapsed ["_unit_0", true]$/Code$ - + - undefined / undefined + local / local + In OFP v1.96, the mapAnim series of commands, together with forceMap can only be used in the intro and mission, as it is not possible to access the map from the outro. (not checked, sourced from an old copy of the OFPEC comref) - Nothing + Nothing + - setWPPos + get3DENLayerEntities - Set waypoint position + Return all entities and sub-layer in Eden Entity layer. - https://community.bistudio.com/wiki/setWPPos + https://community.bistudio.com/wiki/get3DENLayerEntities - Array setWPPos Array + get3DENLayerEntities Number - waypoint setWPPos pos + get3DENLayerEntities layerID - $Code$[_groupOne, 1] setWPPos markerPos "MarkerOne";$/Code$ + $Code$_myLayer = -1 add3DENLayer "CTRG"; + player set3DENLayer _myLayer; + _entities = get3DENLayerEntities _myLayer;$/Code$ - undefined / local + undefined / undefined - Nothing + Array + - setWaves + waypointPosition - Changes the waves value smoothly during the given time (in seconds). A time of zero means there will be an immediate change. - NOTE : This command will have no effect (even though the value of waves changes) unless Manual Override option is selected in the editor in the Intel, which is normally off. + Get Waypoint 's Position. Note : This function is identical to getWPPos. - https://community.bistudio.com/wiki/setWaves + https://community.bistudio.com/wiki/waypointPosition - Number setWaves Number + waypointPosition Array - time setWaves value + waypointPosition waypoint - $Code$180 setWaves.5;$/Code$ - - $Code$0 setWaves 1;$/Code$ + $Code$_wPos = waypointPosition [_groupOne, 1];$/Code$ - undefined / local + undefined / undefined - Nothing + Array + - setWaypointBehaviour + menuAction - Switches the unit behaviour when the waypoint becomes active. - Possible values are: - "UNCHANGED" - "CARELESS" - "SAFE" - "AWARE" - "COMBAT" - "STEALTH" - See the AIBehaviour page for details of the effect of this command on AI units. + Returns action stored in item on given path. - https://community.bistudio.com/wiki/setWaypointBehaviour + https://community.bistudio.com/wiki/menuAction - Array setWaypointBehaviour String + menuAction Array - waypoint setWaypointBehaviour mode + menuAction [idc, path] - $Code$[_grp, 2] setWaypointBehaviour "AWARE";$/Code$ - + - undefined / global + undefined / undefined - This scripting command must be executed on the server to work properly in multiplayer - - (August 26, 2008) - Modes are case sensitive - "safe" won't work, while "SAFE" is ok. - Nothing + String + - setWaypointCombatMode + setSize - The group combat mode is switched when the waypoint becomes active. - Possible mode values are: - "NO CHANGE" (No change) - " BLUE " (Never fire) - " GREEN " (Hold fire - defend only) - " WHITE " (Hold fire, engage at will) - " YELLOW " (Fire at will) - " RED " (Fire at will, engage at will) + Sets the size (radius) of a location. + The width is 2 * x, the height is 2 * y. - https://community.bistudio.com/wiki/setWaypointCombatMode + https://community.bistudio.com/wiki/setSize - Array setWaypointCombatMode String + Location setSize Array - waypoint setWaypointCombatMode mode + location setSize size - $Code$[_grp, 2] setWaypointCombatMode "RED";$/Code$ + $Code$myLocation setSize [10,30]$/Code$ undefined / undefined @@ -63787,157 +65620,156 @@ - Nothing + Nothing + - setWaypointCompletionRadius + assignAsCommander - The completion radius allows units to call the waypoint completed once they are inside of the given circle. + Assign a unit as commander of a vehicle. Used together with orderGetIn to order subordinate units to get in as commander of a specific vehicle. Before usage of this command a subordinate unit hasn't got the option to get into the commander place of the vehicle. - https://community.bistudio.com/wiki/setWaypointCompletionRadius + https://community.bistudio.com/wiki/assignAsCommander - Array setWaypointCompletionRadius Number + Object assignAsCommander Object - waypoint setWaypointCompletionRadius radius + unitName assignAsCommander vehicleName - $Code$[grp, 2] setWaypointCompletionRadius 30;$/Code$ + $Code$_soldier1 assignAsCommander _tank + [_soldier1] orderGetIn true$/Code$ - undefined / undefined + global / global - (29 January 2010‎, 14:12) - The completion radius is currently important for units moving in the Combat mode. - With default completion radius = 0 the leader always finishes in the exact location of the waypoint. - By providing a completion radius you allow him to plan his road to a cover nearby instead. - This does not necessarily mean the waypoint is complete once they are inside of the circle. - The way it works now it is complete once unit is inside and does not think it would be reasonable to move any closer. - Nothing + Nothing + - setWaypointDescription + setCuratorCameraAreaCeiling - Sets the description shown in the HUD while the waypoint is active. + Sets maximal height to which curator camera can move. - https://community.bistudio.com/wiki/setWaypointDescription + https://community.bistudio.com/wiki/setCuratorCameraAreaCeiling - Array setWaypointDescription String + Object setCuratorCameraAreaCeiling Number - waypoint setWaypointDescription text + curatorObj setCuratorCameraAreaCeiling height - $Code$[_grp, 2] setWaypointDescription "Move here.";$/Code$ + $Code$myCurator setCuratorCameraAreaCeiling 50;$/Code$ undefined / undefined + This scripting command must be executed on the server to work properly in multiplayer - Nothing + Nothing + - setWaypointForceBehaviour + alive - Forces the behavior of waypoint, disables AUTOCOMBAT. + Check if given vehicle/person/building is alive (i.e. not dead or destroyed). alive objNull returns false. - https://community.bistudio.com/wiki/setWaypointForceBehaviour + https://community.bistudio.com/wiki/alive - Waypoint setWaypointForceBehaviour Boolean + alive Object - waypoint setWaypointForceBehaviour state + alive object - $Code$[grp, 2] setWaypointForceBehaviour true ;$/Code$ + $Code$// SQS: + ?!( alive player ) : exit$/Code$ + + $Code$// SQF: + if (! alive player ) exitWith {};$/Code$ - undefined / undefined + global / undefined + (October 19, 2015) + Alive or not could be the question! in multi-player, missions come with respawn module(s). When a player is dead shot, (alive player) will return false, then almost immediately true if the "revive" respawn template is enabled, then could turn on false if time for assistance is elapsed or if the player activates the respawn menu before; and finally true after player respawns. Just be aware that in that case (respawn + revive enabled), the status of the player is toggling: true false true false true. Then, alive status while player is waiting for being rescued could lead to some error scripts as player is supposed to be alive but in limbo and the dead entity "player" passed to server. - Nothing + Boolean + - setWaypointFormation + getDescription - Switches the group formation when the waypoint becomes active. - Possible values are: - "NO CHANGE" - "COLUMN" - "STAG COLUMN" - "WEDGE" - "ECH LEFT" - "ECH RIGHT" - "VEE" - "LINE" - "FILE" - "DIAMOND" + Returns the string representation of unit as an four slots array. - https://community.bistudio.com/wiki/setWaypointFormation + https://community.bistudio.com/wiki/getDescription - Array setWaypointFormation String + getDescription Object - waypoint setWaypointFormation formation + getDescription unit - $Code$[_grp, 2] setWaypointFormation "LINE";$/Code$ - + - undefined / global + undefined / undefined - This scripting command must be executed on the server to work properly in multiplayer + Return value fixed in revision 0.51.103185. + + (September 21, 2014) + Pretty useless command tbh, return is something like this: + ["B_Soldier_F","Combat Fatigues (MTP)","Carrier Lite (Green)",""] or ["ERROR","ERROR","ERROR","ERROR"] - Nothing + Array + - setWaypointHousePosition + loadBackpack - For waypoints attached to a house, this defines the target house position. + Returns current sum of mass from items stored in a backpack. - https://community.bistudio.com/wiki/setWaypointHousePosition + https://community.bistudio.com/wiki/loadBackpack - Array setWaypointHousePosition Number + loadBackpack Object - waypoint setWaypointHousePosition pos + loadBackpack unit - $Code$[_grp, 2] setWaypointHousePosition 1;$/Code$ + $Code$myVariable = loadBackpack myUnit;$/Code$ undefined / undefined @@ -63945,57 +65777,68 @@ - Nothing + Number + - setWaypointLoiterRadius + simulWeatherSync - Assignes loiter radius to waypoint + Synchronizes Simul Weather with Arma weather, generates all keyframes. - https://community.bistudio.com/wiki/setWaypointLoiterRadius + https://community.bistudio.com/wiki/simulWeatherSync - Waypoint setWaypointLoiterRadius Number + simulWeatherSync - waypoint setWaypointLoiterRadius radius + simulWeatherSync - $Code$[_grp, 2] setWaypointLoiterRadius 200;$/Code$ - + undefined / undefined + (May 4, 2016) + The behavior of this command is similar to forceWeatherChange, however it leaves current weather transitions intact. Its main purpose would be to refresh the cloud cover to properly reflect current overcast, as they can sometime get out of sync, especially when using setTimeMultiplier and setAccTime. - Nothing + Nothing + - setWaypointLoiterType + canAddItemToBackpack - Sets the waypoint loiter type. + Checks if given object can be stored into soldier's backpack. - https://community.bistudio.com/wiki/setWaypointLoiterType + https://community.bistudio.com/wiki/canAddItemToBackpack - Waypoint setWaypointLoiterType String + Object canAddItemToBackpack String + + Object canAddItemToBackpack Array - waypoint setWaypointLoiterType type + unit canAddItemToBackpack item + + unit canAddItemToBackpack [item, count] - $Code$[_grp, 2] setWaypointLoiterType "CIRCLE";$/Code$ - - $Code$[_grp, 2] setWaypointLoiterType "CIRCLE_L";$/Code$ + $Code$_item = "HandGrenade"; + _fits = player canAddItemToBackpack _item; + if (_fits) then { + player addItemToBackpack _item; + } else { + hint "no room!"; + };$/Code$ undefined / undefined @@ -64003,430 +65846,427 @@ - Nothing + Boolean - Boolean + - setWaypointName + synchronizedObjects - Changes the waypoint name. + Return the list of objects synchronized with the given unit. - https://community.bistudio.com/wiki/setWaypointName + https://community.bistudio.com/wiki/synchronizedObjects - Waypoint setWaypointName String + synchronizedObjects Object - waypoint setWaypointName name + synchronizedObjects unit - $Code$[_grp,2] setWaypointName "myName";$/Code$ + $Code$_objects = synchronizedObjects _logic;$/Code$ - undefined / undefined + local / undefined + This command only returns the LEADER of a vehicle that is synchronized. You have to use the "vehicle" + command to select the actual vehicle. + This command only returns the synchronized objects when used on intelligent objects such as units or + logic objects. All other objects returns an empty array. + In MP this command returns only values when the object is local. otherwise it returns an empty array. + + (February 26, 2015) + When returning the synchronized objects, they are returned in the order that they were placed on the map + + (October 27, 2016) + In Eden you can synchronize both units and their vehicles separately by syncing the gamelogic (or whatever) to the vehicle itself, and then the driver (or whatever other passengers) of the vehicle. To use an entire group, just sync all units within that group to the gamelogic (not just the leader or group icon). By doing this you can execute commands on each unit in a group and just the crew/single unit of a vehicle, or just the vehicle and not the crew, or both the vehicle and the crew. - Nothing + Array + - setWaypointPosition + countEnemy - Moves the waypoint to a random position in a circle with the given center and radius. + Count how many units in the array are considered enemy to the given unit. - https://community.bistudio.com/wiki/setWaypointPosition + https://community.bistudio.com/wiki/countEnemy - Array setWaypointPosition Array + Object countEnemy Array - waypoint setWaypointPosition [center, radius] + unitName countEnemy arrayName - $Code$[_grp, 2] setWaypointPosition [ position player, 0];$/Code$ + $Code$_num = player countEnemy list _triggerOne;$/Code$ - undefined / undefined + global / undefined + (August 3, 2006) + Notes from before the conversion: + The countEnemy command seem to count the number of units from the array that are considered to be of the given type by the whole side, not just the specified unit. + + (December 15, 2006) + The unit that's checking (left side of the command) needs a certain level of knowledge about the target (about.1) before the enemy units are actually counted. (OFP & ArmA) - Nothing + Number + - setWaypointScript + setDate - Attaches a script to a scripted waypoint. In early versions of Arma, command consisted of a script name and additional script arguments and the script had to use SQS -Syntax. The script receives the following arguments in _this variable: [group, position, target] + [the optional passed arguments]. The optional arguments are appended to the end of the return array. - In Arma 3, command argument can be a String with code, a reference to.sqf script (it will have to explicitly end with.sqf ) or a reference to.sqs script. - See Mission editor Description for more information about scripted waypoints. + Sets the actual mission date and time. - https://community.bistudio.com/wiki/setWaypointScript + https://community.bistudio.com/wiki/setDate - Array setWaypointScript String + setDate Array - waypoint setWaypointScript command + setDate [year, month, day, hour, minute] - $Code$[_grp, 2] setWaypointScript "find.sqs player ";$/Code$ + $Code$setDate [1986, 2, 25, 16, 0]; //(4:00pm February 25, 1986)$/Code$ - $Code$[_grp, 2] setWaypointScript "somescript.sqf [1,2,3,4,5,6,7,8]";$/Code$ + $Code$// Set real date: + //postInit = 1; + if ( isServer ) then { + waitUntil { time 0}; + setDate ( missionStart select [0,5]); + };$/Code$ - undefined / undefined + local / local + This scripting command must be executed on the server to work properly in multiplayer + + This command is special in that it is "smart". If you add 120 minutes, for example, it will actually advance hours by 2, and so on. + 10:00, 7/12/2010 (BST) + + This command sets the date for the southern hemisphere only, i.e. when the map is in northern hemisphere a date [2010,12,7,17,0] is in day light and and date [2010,6,7,17,0] is in darkness. + 21:35, 31 October 2011 (EET) + + In multiplayer, the effect of this command is local, not global. The date from the server is synchronized with clients when they join the game (including start of the mission and joining in progress). E.g. if this command is executed on server in the init.sqf before the mission starts, every client will be synchronized with server as mission is started. However, if you run this command in the middle of the mission, effect is local. + 10 September 2013 (EET) + + This command is JIP compatible. Players joining after mission start will get current server date set up. + + (October 4, 2014) + Since an unknown version of ARMA 3, this command now has global effect when executed on the server. + + (February 5, 2015) + Arma 3 1.38.128937- Leapyear BUG - setdate [2016,12,31,23,59] yields an ingame date of the 1st of January 2017. If left to tick over from the 30th of December it ticks to 1st January skipping the 31st of December entirely. + Feedback_Link + + (April 23, 2017) + Regarding execution in the middle of a session, the post of MulleDK13 is not entirely true. If you don't change the year, you are perfectly fine when executing the command on the server only. However, the server does not sync the year. Hence, if you do change the year, you have to execute the command on the server, clients and JIP to account for the missing sync. e.g. + $Code$[[], { setDate [1986, 2, 25, 16, 0]}] remoteExec [" call ",0,"JIP_id_setDate"];$/Code$ - Nothing + Nothing + - setWaypointSpeed + getPilotCameraTarget - Switches the group speed mode when the waypoint becomes active. - Possible values are: - "UNCHANGED" - "LIMITED" - "NORMAL" - "FULL" + Returns the target of the object airplane or helicopter pilotCamera tracking. - https://community.bistudio.com/wiki/setWaypointSpeed + https://community.bistudio.com/wiki/getPilotCameraTarget - Array setWaypointSpeed String + getPilotCameraTarget Object - waypoint setWaypointSpeed mode + getPilotCameraTarget object - $Code$[_grp, 2] setWaypointSpeed "FULL";$/Code$ + $Code$_pilotCamTrack = ( getPilotCameraTarget vehicle player ) select 0; + _pilotCamTargetPos = ( getPilotCameraTarget vehicle player ) select 1; + _pilotCamTarget = ( getPilotCameraTarget vehicle player ) select 2;$/Code$ - undefined / global + local / undefined - This scripting command must be executed on the server to work properly in multiplayer - Nothing + Array + - setWaypointStatements + isMarkedForCollection - The waypoint is done only when the condition is fulfilled. When the waypoint is done, the statement expression is executed. - Within the Condition & Statement code string: - this refers to the group leader - thisList refers to an array containing each unit in the group + Checks whether the object is marked for weapons collection. - https://community.bistudio.com/wiki/setWaypointStatements + https://community.bistudio.com/wiki/isMarkedForCollection - Array setWaypointStatements Array + isMarkedForCollection Object - waypoint setWaypointStatements [condition, statement] + isMarkedForCollection object - $Code$new_wp setWaypointStatements [" true ", " hint 'hello'; hint 'goodbye'"];$/Code$ - - $Code$new_wp setWaypointStatements [" true ", " diag_log ['GroupLeader: ', this ]; diag_log ['Units: ', thislist ]"];$/Code$ + $Code$_marked = isMarkedForCollection _truck$/Code$ - undefined / undefined + global / undefined - (May 21, 2016) - Within the completion statement currentWaypoint will give the index of the waypoint being completed (as opposed to the following one). - This is particularly useful if you need a self deleting waypoint: $Code$ setWaypointStatements [" true "," deleteWaypoint [ group this, currentWaypoint ( group this)]"]$/Code$ - - (May 9, 2017) - The condition block carries the same rules as functions which return a value. The return value must be of type Boolean. I can bypass the use of triggers in this manner. - $Code$_wp setWaypointStatements [" code code code; _returnBool ", " onActivation block; "];$/Code$ - Nothing + Boolean + - setWaypointTimeout + libraryCredits - Defines the time between condition satisfaction and waypoint finish (randomly from min to max, with an average value mid). + Returns the credits for the libraries used by the game. - https://community.bistudio.com/wiki/setWaypointTimeout + https://community.bistudio.com/wiki/libraryCredits - Array setWaypointTimeout Array + libraryCredits - waypoint setWaypointTimeout [min, mid, max] + libraryCredits - $Code$[_grp, 2] setWaypointTimeout [5, 10, 6];$/Code$ + $Code$hint str libraryCredits ; // as in Arma2 OA 1.62.95208 + /* + [ + [ + "Botan", + "1999-2012 Jack Lloyd, 2001 Peter J Jones, 2004-2007 Justin Karneges, 2004 Vaclav Ovsik, 2005 Matthew Gregan, 2005-2006 Matt Johnston, 2006 Luca Piccarreta, 2007 Yves Jerschow, 2007-2008 FlexSecure GmbH, 2007-2008 Technische Universitat Darmstadt, 2007-2008 Falko Strenzke, 2007-2008 Martin Doering, 2007 Manuel Hartl, 2007 Christoph Ludwig, 2007 Patrick Sona, 2010 Olivier de Gaalon" + ], + [ + "rapidjson", + "2011 Milo Yip" + ], + [ + "libcurl", + "Copyright (c) 1996 - 2012, Daniel Stenberg" + ], + [ + "GameSpy", + "2009 GameSpy Industries, Inc." + ], + [ + "Theora", + "2002-2009 by the Xiph.Org Foundation http://www.xiph.org/" + ], + [ + "OggVorbis", + "1994-2002 by the Xiph.Org Foundation http://www.xiph.org/" + ], + [ + "Intel JPEG Library", + "1998 Intel Corporation" + ], + [ + "Matrix Template Library", + "2001-2005 The Trustees of Indiana University" + ], + [ + "Matrix Template Library", + "1998-2001 University of Notre Dame" + ], + [ + "Speex", + "2002-2006 Jean-Marc Valin" + ], + [ + "LZO Professional", + "1996-2011 Markus Franz Xaver Johannes Oberhumer" + ], + [ + "NVIDIA FXAA by TIMOTHY LOTTES", + "2010, 2011 NVIDIA CORPORATION" + ], + [ + "Jimenez's MLAA", + "2012 2011 by Jorge Jimenez, Belen Masia, Jose I. Echevarria, Fernando Navarro and Diego Gutierrez" + ] + ] + */$/Code$ undefined / undefined - (00:32, 12 December 2010) - The example doesn't seem to make sense, according to the listed syntax. It seems to set a Max time greater than the Mid time. - - (03:30, 12 December 2010) - If mid is greater than max, the result will be really near the mid value. - Results with the values of the example: 8.237, 9.383, 10.425, 9.417, 9.43401, 10.425, 9.90601, 9.96701, 9.42401, 9.42502, 9.96698, 9.89999... - Nothing + Array + - setWaypointType + enableAIFeature - Changes the waypoint type. - Type can be: - "MOVE" - "DESTROY" - "GETIN" - "SAD" - "JOIN" - "LEADER" - "GETOUT" - "CYCLE" - "LOAD" - "UNLOAD" - "TR UNLOAD" - "HOLD" - "SENTRY" - "GUARD" (for use with GUARDED BY trigger or createGuardedPoint ) - "TALK" - "SCRIPTED" - "SUPPORT" - "GETIN NEAREST" - "DISMISS" - "LOITER" (new in Arma 3) - "AND" (only for game logics) - "OR" (only for game logics) - More details at Waypoint types. + Enable/disable given AI feature. Feature may be one of: + "AwareFormationSoft", "CombatFormationSoft". - https://community.bistudio.com/wiki/setWaypointType + https://community.bistudio.com/wiki/enableAIFeature - Array setWaypointType String + String enableAIFeature Boolean - waypoint setWaypointType type + feature enableAIFeature enabled - $Code$[_grp, 2] setWaypointType "HOLD";$/Code$ + $Code$"AwareFormationSoft" enableAIFeature true$/Code$ undefined / undefined - (07:44, 23 November 2007) - For waypoint types description look at - ArmA: Mission_Editor - OFP: Mission_Editor - Using Move With a game logic group will move the logic to the set location just like setpos. In the editor only AND and OR type of waypoints are available for GAME LOGICS but you can use CYCLE type as well in setWaypointType. - $Code$_wp = group logic1 addWaypoint [ getPos player, 1]; - [ group logic1, 1] setWPPos getPos player ; - [ group logic1, 1] setWaypointType "move";$/Code$ - - (23:07, 18 October 2013 (CEST)) - To clear up any confusion regarding the syntax, follow this example where grp01 is the name of a group of AI units: - $Code$_wp = grp01 addWaypoint [[25295,21919,85], 0]; - _wp setWaypointType "MOVE"; - _wp1 = grp01 addWaypoint [[25381,21882,70], 0]; - _wp1 setWaypointType "MOVE"; - _wp2 = grp01 addWaypoint [[ 25332,21782,78], 0]; - _wp2 setWaypointType "CYCLE"; //Use the variable (_wp2), not [grp01, 0]$/Code$ - - (December 22, 2015) - To spawn a helicopter with troops inside and make them land and unload. - - (May 6, 2017) - To use the LAND function in a waypoint, you must set "A3\functions_f\waypoints\fn_wpLand.sqf" as the script for that waypoint. - - (May 30, 2017) - In ArmA3 1.70.141838, if you add a MOVE waypoint very soon after a LOITER waypoint, ( assuming that the index of the MOVE waypoint is HIGHER than the index of the LOITER waypoint ) - then the LOITER waypoint will be considered as a MOVE waypoint. - And, if you add another waypoint after ( for example ) more than 1 second after adding the LOITER waypoint, - then the LOITER waypoint will NOT complete even when its condition has been met. - There are two ways to quit an existing LOITER waypoint that was added more than about 1 second ago; use the setCurrentWaypoint command OR add a waypoint that has the same ID as the LOITER waypoint. - The difference between those two methods is that the lather prevents the LOITER waypoint from executing its statement. - Nothing + Nothing + - setWaypointVisible + moveInAny - Sets the visibility of the waypoint. + Moves unit to the first available seat in a vehicle. The order of priorities is the same order used in squad command when you order subordinates to get in vehicle to any position and is the same order used in Zeus when you drag units to a vehicle. Seat assignment seems to use the following priority logic: + driver ( moveInDriver ) - commander turret ( moveInCommander ) - gunner turret ( moveInGunner ) - remaining turrets ( moveInTurret ) - cargo ( moveInCargo ). + NOTE : This command will move player into the locked vehicle or seat just as well. - https://community.bistudio.com/wiki/setWaypointVisible + https://community.bistudio.com/wiki/moveInAny - Array setWaypointVisible Boolean + Object moveInAny Object - waypoint setWaypointVisible visible + unit moveInAny vehicle - $Code$[grp, 2] setWaypointVisible false ;$/Code$ - - $Code$[ group player, currentWaypoint ( group player )] setWaypointVisible false ;$/Code$ + $Code$player moveInAny tank;$/Code$ - undefined / global + local / global - (September 23, 2015) - This does not apply to Zeus/Curator view... so this command won't hide the Waypoint lines and icons from your view as a Zeus when units are in your EditableAddons list. - Nothing + Boolean + - setWeaponReloadingTime + ctrlSetFontHeightSecondary - Sets states and/or makes an action of/on weapon. Reload time is between 0 and 1 inclusive, where 1 is 100% of maximum reloading time. + Sets the font size of the secondary text of given control. - https://community.bistudio.com/wiki/setWeaponReloadingTime + https://community.bistudio.com/wiki/ctrlSetFontHeightSecondary - Object setWeaponReloadingTime Array + Control ctrlSetFontHeightSecondary Number - vehicle setWeaponReloadingTime [gunner, muzzleName, reloadTime] + ctrl ctrlSetFontHeightSecondary value - $Code$_done = _vehicle setWeaponReloadingTime [ gunner ( vehicle player ), currentMuzzle ( gunner ( vehicle player )), 0.5];$/Code$ + $Code$_control ctrlSetFontHeightSecondary 0.05;$/Code$ undefined / undefined - (January 15, 2012) - The description is confusing to me. What the command essential does is to set the reloading state/time of the given weapon. For example you can fire a missile, and make the weapon available to fire again instantly if you apply 0. - Or you can delay or stop the reload event indefinitely. The 0-1 range is a percentage - the reload time is taken from the weapons's config value (either reloadTime or magazineReloadTime - not sure). The effect is one time only each - it does not modify the weapon's general reload time. - Works also for infantry weapons - probably useful weapons with longer reload time like sniper weapons or launchers: - player setWeaponReloadingTime [player,currentWeapon player,0]; - No idea what's point of the return value. - - (May 14, 2017) - Note that setWeaponReloadingTime is only having effect on a current weapon state (loaded projectile) so since the projectile is fired the next one will be reverted to a weapon config defaults. To keep the fire rate speed changed over time, use this code: - $Code$player addEventHandler ["FiredMan",{ - params ["","_weapon","_muzzle"]; - private _type = _weapon call BIS_fnc_itemType; - private _time = -1; - switch (_type select 1) do { - case 'SniperRifle' : {_time = 0.5}; - case 'AssaultRifle' : {}; - case 'Handgun' : {}; - case 'Rifle' : {}; - case 'SubmachineGun' : {}; - case 'MachineGun' : {}; - case 'Mortar' : {}; - case 'GrenadeLauncher' : {}; - case 'BombLauncher' : {}; - case 'MissileLauncher' : {}; - case 'RocketLauncher' : {}; - case 'Cannon' : {}; - case 'Throw' : {}; - }; - if (_time isEqualTo -1) exitWith {}; - (vehicle player) setWeaponReloadingTime [(vehicle player), _muzzle, _time]; - }]; - $/Code$ - This Event Handler makes the gun of specific type shoot at a desired rate on each weapon state (sniper rifle will shoot 50% faster in this example). For more information about weapon kinds are there, visit BIS_fnc_itemType. - Boolean + Nothing + - setWindDir + getPlayerScores - Changes the wind direction smoothly during the given time (in seconds). A time of zero means there will be an immediate change. - NOTE : Effect is global only when executed on the server. On clients wind direction will sync to server value in a while. + In MP: returns the unit's table of scores (infantry kills, soft vehicle kills, armor kills, air kills, deaths, total score). In SP: empty array [] - https://community.bistudio.com/wiki/setWindDir + https://community.bistudio.com/wiki/getPlayerScores - Number setWindDir Number + getPlayerScores Object - time setWindDir value + getPlayerScores unitName - $Code$60 setWindDir 180$/Code$ + $Code$getPlayerScores BIS_player1;$/Code$ - undefined / global + undefined / undefined - (April 12, 2014) - Seems to make wind [0,0] in MP. (ArmA 3 1.00) - Nothing + Array + - setWindForce + configName - Set max. wind overall wind changes in time. A time of zero means there will be an immediate change. A wind level of zero is minimal changes and a wind level of one means that wind can change rapidly. + Returns name of config entry. - https://community.bistudio.com/wiki/setWindForce + https://community.bistudio.com/wiki/configName - Number setWindForce Number + configName Config - time setWindForce wind + configName config - $Code$1800 setWindForce 0.5$/Code$ + $Code$_name = configName ( configFile "CfgVehicles"); + // Result is "CfgVehicles"$/Code$ undefined / undefined @@ -64434,527 +66274,525 @@ - Nothing + String + - setWindStr + modParams - Changes the wind strength smoothly during the given time (in seconds). A time of zero means there will be an immediate change. + Returns list of mod parameters according to given options, values are in same order as the given options. Available options: + "name" : String - name to be shown (Arma 3 instead of A3, etc.) + "picture" : String - picture shown in Mod Launcher + "logo" : String - logo to be shown in Main Menu + "logoOver" : String - logo to be shown in Main Menu when mouse is over + "logoSmall" : String - small version of logo, prepared for drawing small icons + "tooltip" : String - tooltip to be shown on mouse over + "tooltipOwned" : String - tooltip to be shown on mouse over the icon when DLC is owned by player + "action" : String - url to be triggered when mod button is clicked + "actionName" : String - what to put on Action Button + "overview" : String - overview text visible in expansion menu + "hidePicture" : Boolean - do not show mod picture icon in the main menu mod list + "hideName" : Boolean - do not show mod name in the main menu mod list + "defaultMod" : Boolean - default mods cannot be moved or disabled by Mod Launcher + "serverOnly" : Boolean - mod doesn't have to be installed on client in order to play on server with this mod running + "active" : Boolean - active mod (activated through command line or stored in profile by mod launcher) + NOTE that "active" does not actually tell you if a mod ( is running / pretends to be running ) - https://community.bistudio.com/wiki/setWindStr + https://community.bistudio.com/wiki/modParams - Number setWindStr Number + modParams Array - time setWindStr value + modParams [modClass, options] - - + $Code$_data = modParams ["Kart", ["name", "logo", "picture"]];$/Code$ + + undefined / undefined + (April 24, 2017) + This command used to spam. rpt when queried mod didn't exist, making it little awkward to use for testing if mod is active. For example: + $Code$_superDuperModEnabled = modParams ["super_duper", ["active"]] param [0, false];$/Code$ + Since v1.69 the command would fail silently if mod doesn't exist. - Nothing + Array + - setWind + playActionNow - Set current (forced == false) or permanent (forced == true) wind vector. - NOTE : The effect is global only if command is executed on the server. Wind set locally will sync back to server value in a while. + When used on a person, a smooth transition to the given action will be initiated, but all previous playAction are discarded. + For Arma 3 actions see: playAction/actions. - https://community.bistudio.com/wiki/setWind + https://community.bistudio.com/wiki/playActionNow - setWind Array + Object playActionNow String - setWind [x, y, forced] + soldier playActionNow action - $Code$setWind [10, 10, true];$/Code$ + $Code$soldierOne playActionNow "SitDown";$/Code$ + + $Code$rabbitTwo playActionNow "WalkF";$/Code$ - undefined / global + local / global + (October 12, 2010) + Some other possible playactions: + "walkf" - walk forward + "walkb" - walk backwards + "walkr" - strafe right + "walkl" - strafe left + "grabdrag" - initiate First Aid dragging animation + "stopdrag" - stops First Aid dragging animation + "reloadMagazine" - reloads the current magazine + "gestureFreeze" - hand signal "Freeze" + "GestureGo" + "GestureCover" + "GestureAttack" + "GestureCeaseFire" + "GestureFollow" + "GestureUp" + "GestureAdvance" + "GesturePoint" + Note that playAction works regardless of stance (rifle up, down, crouched, prone). - Nothing + Nothing + - show3DIcons + ctrlParentControlsGroup - Toggle the drawing of 3D icons. - i - Some Old Editor Command + Returns the parent control of a given child control - https://community.bistudio.com/wiki/show3DIcons + https://community.bistudio.com/wiki/ctrlParentControlsGroup - Control show3DIcons Boolean + ctrlParentControlsGroup Control - map show3DIcons bool + ctrlParentControlsGroup ctrl - + $Code$_ctrlCombo = _ctrl controlsGroupCtrl 100;//Control + ctrlParentControlsGroup _ctrlCombo;//Parent control group (_ctrl)$/Code$ + undefined / undefined - Nothing + Control + - showChat + setMarkerColorLocal - Shows/hides the whole chat window. + Sets marker color for the given marker locally. Marker color names and their corresponding RGBA values for Arma 3 could be found in here: CfgMarkerColors_Arma_3 - https://community.bistudio.com/wiki/showChat + https://community.bistudio.com/wiki/setMarkerColorLocal - showChat Boolean + String setMarkerColorLocal String - showChat bool + markerName setMarkerColorLocal color - $Code$showChat false ;$/Code$ + $Code$"MarkerOne" setMarkerColorLocal "ColorBlack";$/Code$ - undefined / local + global / local - Nothing + Nothing + - showCinemaBorder + side - Forces drawing of cinema borders when using custom camera camCreate. This is normally used in cutscenes to indicate player has no control. + Returns the side of a unit, vehicle, object or location. + a renegade soldier's side will return a sideEnemy + an empty vehicle will return civilian + a crewed vehicle will return, if present, commander's gunner's driver's or cargo's side, in this order + a captive or dead unit will return civilian. Use side group _unit to get the underlying side + you can use playerSide to know the real player's side + converting a side to string ( via str or format } will not return the side command: + east = "EAST" + west = "WEST" + resistance = "GUER" + civilian = "CIV" + sideUnknown = "UNKNOWN" + sideEnemy = "ENEMY" + sideFriendly = "FRIENDLY" + sideLogic = "LOGIC" + sideEmpty = "EMPTY" + sideAmbientLife = "AMBIENT LIFE" - https://community.bistudio.com/wiki/showCinemaBorder + https://community.bistudio.com/wiki/side - showCinemaBorder Boolean + side Object/Group/Location - showCinemaBorder show + side object - $Code$showCinemaBorder false ;$/Code$ + $Code$if ( side player == west ) then { hint "Player is on the West side" };$/Code$ + + $Code$_sideAlsoWorkingForDead = side group player ;$/Code$ + + $Code$_sideLocation = side myLocation;$/Code$ + + $Code$if (side player != playerSide ) then { hint "player is renegade or dead"; };$/Code$ - undefined / undefined + global / undefined - (13 October 2007) - This command does only work when Mission is started. Use waitUntil { time 0}; to be sure it works. + In ArmA, the following objects are on side civilian : dead bodies and vehicles, empty vehicles, all mission editor placed objects (that do not have an inherit side), all objects with interactive components such as ladders and doors, man made structures such as buildings (including classless wrp placed objects), docks, high tension powerlines, see-saws, large rubbish bins, fountains. Basically if an object uses a non-simple damage or physics simulation it is likely to be on the civilian side. + NOTE: If you need to know the side of a dead body, you can use faction command as a workaround -- Killzone_Kid + + In OFP v1.96, the side return value for a vehicle is based on the side of its commander, then gunner, then driver, then cargo. It will retain its side value until it is either empty, or a unit of another side takes over in a equal or higher role, irrespective of the side of other units still on board. This can be used to simulate friendly fire, as a vehicle can be made to appear to be an enemy even though all units on board are actually friendly. + + As CEEB says above, in ArmA2, side for a vehicle often depends on who the command or driver is, for example, A KA52, piloted by a USMC guy will have side WEST. For an accurate result of what 'where the vehicle was made', use faction. This ignores the pilot/commander, so in my example here, this KA52 will always return faction "RU". Note that faction returns different values to side though. + February 4, 2011 + + Side values for ambient life (animals) are bizarre. side _unit returns "CIV", but playerSide returns "AMBIENT LIFE" when the player is an animal. In that case, playerSide == side player returns false! + Fortunately, you can easily check if a unit is an animal with _unit isKindOf "ANIMAL"' - Nothing + Side + - showCommandingMenu + camSetBank - Create the commanding menu described by the given config class or menu name. When the name is empty, the current menu is hidden. - If commanding menu has "expression" set up, the expression will receive the following arguments when user activated the menu item: - Local variable _target : Object - Target under the cursor. This works in both 3D and 2D (when cursor is over the unit icon on the map). - Local variable _pos : Array - Cursor position. - Local variable _is3D : Boolean - false if cursor is over the map, otherwise true. + Sets camera bank angle. Does not commit changes. + This command is non-functional ! - https://community.bistudio.com/wiki/showCommandingMenu + https://community.bistudio.com/wiki/camSetBank - showCommandingMenu String + Object camSetBank Number - showCommandingMenu name + camera camSetBank bank - $Code$showCommandingMenu "";$/Code$ - - $Code$showCommandingMenu "MyClassName";$/Code$ - - $Code$showCommandingMenu "#USER:Tag_Menu_myMenu_0";$/Code$ - - $Code$showCommandingMenu "RscMainMenu";$/Code$ + $Code$_camera camSetBank -0.1$/Code$ undefined / undefined - (July 22nd, 2012) - //This script will create a custom menu, and display it once. - MY_SUBMENU_inCommunication = - [ - ["User submenu",true], - ["Option-1", [2], "", -5, [["expression", "player sidechat ""-1"" "]], "0", "0", "\ca\ui\data\cursor_support_ca"], - ["Option 0", [3], "", -5, [["expression", "player sidechat "" 0"" "]], "1", "0", "\ca\ui\data\cursor_support_ca"], - ["Option 1", [4], "", -5, [["expression", "player sidechat "" 1"" "]], "1", "CursorOnGround", "\ca\ui\data\cursor_support_ca"] - ]; - MY_MENU_inCommunication = - [ - // First array: "User menu" This will be displayed under the menu, bool value: has Input Focus or not. - // Note that as to version Arma2 1.05, if the bool value set to false, Custom Icons will not be displayed. - ["User menu",false], - // Syntax and semantics for following array elements: - // ["Title_in_menu", [assigned_key], "Submenu_name", CMD, [["expression",script-string]], "isVisible", "isActive", optional icon path ] - // Title_in_menu: string that will be displayed for the player - // Assigned_key: 0 - no key, 1 - escape key, 2 - key-1, 3 - key-2,..., 10 - key-9, 11 - key-0, 12 and up... the whole keyboard - // Submenu_name: User menu name string (eg "#USER:MY_SUBMENU_NAME" ), "" for script to execute. - // CMD: (for main menu:) CMD_SEPARATOR -1; CMD_NOTHING -2; CMD_HIDE_MENU -3; CMD_BACK -4; (for custom menu:) CMD_EXECUTE -5 - // script-string: command to be executed on activation. (no arguments passed) - // isVisible - Boolean 1 or 0 for yes or no, - or optional argument string, eg: "CursorOnGround" - // isActive - Boolean 1 or 0 for yes or no - if item is not active, it appears gray. - // optional icon path: The path to the texture of the cursor, that should be used on this menuitem. - ["First", [0], "", -5, [["expression", "player sidechat ""First"" "]], "1", "1"], - ["Second", [2], "", -5, [["expression", "player sidechat ""Second"" "]], "1", "1"], - ["Submenu", [3], "#USER:MY_SUBMENU_inCommunication", -5, [["expression", "player sidechat ""Submenu"" "]], "1", "1"] - ]; - showCommandingMenu "#USER:MY_MENU_inCommunication"; - // Appendix, list of optional argument strings - HasRadio - CanAnswer - IsLeader - IsAlone - IsAloneInVehicle - IsCommander - VehicleCommander - CommandsToGunner - CommandsToPilot - NotEmpty - NotEmptySoldiers - NotEmptyCommanders - NotEmptyMainTeam - NotEmptyRedTeam - NotEmptyGreenTeam - NotEmptyBlueTeam - NotEmptyYellowTeam - NotEmptySubgroups - NotEmptyInVehicle - SelectedTeam - SelectedUnit - FuelLow - AmmoLow - Injured - Multiplayer - AreActions - CursorOnGroupMember - CursorOnHoldingFire - CursorOnEmptyVehicle - CursorOnVehicleCanGetIn - CursorOnFriendly - CursorOnEnemy - CursorOnGround - CanSelectUnitFromBar - CanDeselectUnitFromBar - CanSelectVehicleFromBar - CanDeselectVehicleFromBar - CanSelectTeamFromBar - CanDeselectTeamFromBar - FormationLine - FormationDiamond - SomeSelectedHoldingFire - PlayableLeader - PlayableSelected - IsWatchCommanded - IsSelectedToAdd - HCIsLeader - HCCursorOnIcon - HCCursorOnIconSelectable - HCCanSelectUnitFromBar - HCCanDeselectUnitFromBar - HCCanSelectTeamFromBar - HCCanDeselectTeamFromBar - HCNotEmpty - PlayerVehicleCanGetIn - IsXbox - IsTeamSwitch - CursorOnNotEmptySubgroups - SomeSelectedHaveTarget - CursorOnGroupMemberSelected - HCCursorOnIconSelectableSelected - HCCursorOnIconenemy - PlayerOwnRadio - CursorOnNeedFirstAID - CursorOnNeedHeal - - (July 23, 2016) - You can combine the argument strings (see the above note) together to create OR conditions. - Hence $Code$"HasRadioIsLeader"$/Code$ is true when the unit is a leader or has a radio. + (Apr 15, 2010) + Command is non-functional. Instead, use fn vbs setPitchBank in VBS2, or setVectorUp or this user function in Arma. - Nothing + Nothing + - showCompass + hintCadet - Shows or hides the compass on the map screen, if enabled for the mission and you possess the item. (default true ) + Shows a text hint only when in cadetMode. + The text can contain several lines. \n is used to indicate the end of a line. - https://community.bistudio.com/wiki/showCompass + https://community.bistudio.com/wiki/hintCadet - showCompass Boolean + hintCadet String - showCompass show + hintCadet text - $Code$showCompass false ;$/Code$ + $Code$hintCadet "Press W to move forward";$/Code$ - undefined / undefined + undefined / local - (16 Aug, 2009) - In Arma 2, the Compass is now an inventory item. Class path is CfgWeapons- ItemCompass. Use the commands addWeapon and removeWeapon to add or remove it from a unit's inventory. (example: player addweapon "ItemCompass") + hintCadet can be used with formatting like this: + $Code$ hintCadet format ["Hello %1", player ]$/Code$ - Nothing + Nothing + - showCuratorCompass + overcastForecast - Hides or shows compass in curator interface. + Return the overcast forecast. - https://community.bistudio.com/wiki/showCuratorCompass + https://community.bistudio.com/wiki/overcastForecast - showCuratorCompass Boolean + overcastForecast - showCuratorCompass bool + overcastForecast - $Code$showCuratorCompass true;$/Code$ - + undefined / undefined - Nothing + Number + - showGPS + parseSimpleArray - Shows or hides the GPS receiver on the map screen, if enabled for the mission and you possess the item. (default false ) + Converts given, formatted as simple array, String into a valid Array. Simple array is array consisting of Numbers, Strings, Booleans and Arrays of all of the above. For example: [1,"2",true,[4,"five",false]]. The string representation of this array compatible with parseSimpleArray will be "[1,""2"",true,[4,""five"",false]]" accordingly. + This command is built for speed and security and because of this has several limitations. There is limited error reporting about format errors as the command expects well formatted array as argument. To be able to see exact format expected, you can just copy output result of str command applied to an array for reference: copyToClipboard str str [1,"2",true,[4,"five",false]] (notice the use of double str with copyToClipboard ). + In any case here are the explicit rules: + no spaces are permitted between array elements: [1,2,3] - correct, [1, 2, 3] - incorrect! + only double quotes " supported for Strings : ["hello"] - correct, ['hello'] - incorrect! + use " to escape ", for example ["hello"] converted to string should look like this: "[""hello""]" + no spaces should exist before or after array brackets: "[1,2,3]" - correct, "[1,2,3] " - incorrect! + To simplify, your constructed array format should be the same as Arma array converted to string with str : + $Code$_arr1 = getUnitLoadout player ; + _arr2 = parseSimpleArray str _arr1; + hint str (_arr1 isEqualTo _arr2); //true + $/Code$ + Because of this strictness the command is on average 3x faster than similar call compile string array method. And because call compile is not required, it is also more secure and primarily intended for use with callExtension to parse the String output into Array. - https://community.bistudio.com/wiki/showGPS + https://community.bistudio.com/wiki/parseSimpleArray - showGPS Boolean + parseSimpleArray String - showGPS show + parseSimpleArray stringArray - $Code$showGPS true ;$/Code$ + $Code$_arr = parseSimpleArray "[1,2,3]";$/Code$ + + $Code$_bool = true ; + _num = 123.45; + _str = "ok"; + _arr = [1,false,"cool"]; + _res = parseSimpleArray format ["[%1,%2,%3,%4]", _bool, _num, str _str, str _arr]; + // Note how _bool and _num do not need str, however if used anyway, the result in this case would be identical + hint str _res; // [true,123.45,"ok",[1,false,"cool"]]$/Code$ undefined / undefined - (16 Aug, 2009) - In Arma 2, the GPS is now an inventory item. Class path is CfgWeapons- ItemGPS. Use the commands addWeapon and removeWeapon to add or remove it from a unit's inventory. (example: player addweapon "ItemGPS") - - (14 Jun, 2010) - In Arma 2 GPS is also an item, so will not be removed by removeAllWeapons, even though it can be removed by removeWeapon and added by addWeapon. To remove all items use the removeAllItems command (though this will also remove basic items such as map and compass). - Nothing + Array + - showHUD + vest - Enable / disable showing of HUD. Defines visibility of weapon crosshair and any informational tags that appear when pointing the weapon at an object as well as availability of the default action menu. Unfortunately, it also hides icons drawn with drawIcon3D. - Appearance of HUD can also be controlled with showHUD param in description.ext. NOTE: As of Arma 3 v1.49.131879 there is a showHUD[] array param, that is identical in format to the extended showHUD command. When showHUD[] array param is present in description.ext, it will disable showHUD command entirely, allowing mission makers to permanently alter visibility of some HUD elements. + Returns name of vest. - https://community.bistudio.com/wiki/showHUD + https://community.bistudio.com/wiki/vest - showHUD Boolean - - showHUD Array + vest Object - showHUD enable - - showHUD [hud, info, radar, compass, direction, menu, group, cursors, panels] + vest unit - $Code$showHUD false ;$/Code$ - - $Code$// Hide vehicle radar and compass: - showHUD [ true, true, false, false, true, true, true, true ];$/Code$ - - $Code$// Check if HUD visibility is hardcoded in mission config and showHUD command is overriden: - _disabledShowHUD = isArray ( missionConfigFile "showHUD");$/Code$ + $Code$_myVest = vest player;$/Code$ - undefined / local + undefined / undefined - (August 17, 2015) - Last param, "cursors" controls visibility of the action menu as well as weapon cursors. However if 1st param "hud" hides and disables action menu, last param "cursors" only hides it. So you get invisible action menu that is fully operational. inGameUISetEventHandler will still fire on interaction, giving the information about selected item on the action menu even if you cannot see it. Unfortunately it also hides icons drawn with drawIcon3D. - Nothing - Nothing + String + - showLegend + actionParams - Show/hide map legend. - i - Some Old Editor Command + Returns Array with params for given user action id (similar to addAction param array). The output array is of the following format: + [title, script, arguments, priority, showWindow, hideOnUse, shortcut, condition, radius, unconscious, textWindowBackground, textWindowForeground, selection], where: + title: String - action title text + script: String - script file or script expression assigned to the action + arguments: Anything or nil - arguments passed to the action + priority: Number - action priority on the action menu + showWindow: Boolean - whether the action is shown in the center of the screen too + hideOnUse: Boolean - whether the action menu should close after selecting the action + shortcut: String - action bindings to some existing engine action if any + condition: String - expression returning true or nil for action to appear on the action menu + radius: Number - max distance to entity at which action becomes available. -1 means it is engine default (~15m) + unconscious: Boolean - whether the action is available to unconscious person + textWindowBackground: String - same as textWindowBackground in setUserActionText + textWindowForeground: String - same as textWindowForeground in setUserActionText + selection: String - named selection in Geometry LOD to which the action is attached + New array element selection is available since Arma 3 v1.69.140846 - https://community.bistudio.com/wiki/showLegend + https://community.bistudio.com/wiki/actionParams - Control showLegend Boolean + Object actionParams Number - map showLegend bool + entity actionParams id - + $Code$_params = player actionParams 0;$/Code$ + undefined / undefined - Nothing + Array/Nothing + - showMap + enableEngineArtillery - Enable Map (default true ) + Enable/disable the artillery engine. This allows the user to use the artillery computer on mortar/artillery, and for AI to use it for indirect fire. - https://community.bistudio.com/wiki/showMap + https://community.bistudio.com/wiki/enableEngineArtillery - showMap Boolean + enableEngineArtillery Boolean - showMap show + enableEngineArtillery enabled - $Code$showMap false$/Code$ + $Code$enableEngineArtillery false;$/Code$ - undefined / undefined + undefined / local - In ArmA 2 - This command no longer works. The map is now an inventory item. It is kept under the weapon class name "itemmap". - Example: $Code$unitname removeweapon "itemmap"$/Code$ To add again use $Code$unitname addweapon "itemmap"$/Code$. - Nothing + Nothing + - showNewEditorObject + setDebriefingText - Show the add editor object dialog,type is editor object type,class is,class definition to automatically select,side filters by a certain,side,pos is position to create the object. - i - Some Old Editor Command + Sets debriefing text for endType defined in CfgDebriefing. + This command is broken. https://feedback.bistudio.com/T85682 - https://community.bistudio.com/wiki/showNewEditorObject + https://community.bistudio.com/wiki/setDebriefingText - Control showNewEditorObject Array + String setDebriefingText Array - map showNewEditorObject [type,class,side,position] + endType setDebriefingText [title, description] - + $Code$_currentObjective = ( taskDescription ( currentTask player )) select 2; + "endDeath" setDebriefingText ["You Lose","All of your men were killed while assaulting the " + _currentObjective];$/Code$ + undefined / undefined - Any_Value + Nothing + - showPad + waypointVisible - Shows or hides the notebook on the map screen, if enabled for the mission. (default true ). It is no longer relevant to Arma 2. + Returns the visibility of the waypoint. + Returns 0 ( Number ) for a non valid waypoint. - https://community.bistudio.com/wiki/showPad + https://community.bistudio.com/wiki/waypointVisible - showPad Boolean + waypointVisible Array - showPad show + waypointVisible waypoint - $Code$showPad false$/Code$ + $Code$_visible = waypointVisible [groupOne, 1];$/Code$ + + $Code$_visible = waypointVisible [group player, currentWayPoint (group player)];$/Code$ undefined / undefined @@ -64962,233 +66800,253 @@ - Nothing + Boolean + - showRadio + setSuppression - Shows or hides the radio on the map screen, if enabled for the mission and you possess the item. (default true ) + Sets the person's suppression, from 0 to 1. - https://community.bistudio.com/wiki/showRadio + https://community.bistudio.com/wiki/setSuppression - showRadio Boolean + Object setSuppression Number - showRadio show + unit setSuppression value - $Code$showRadio false$/Code$ + $Code$AI_unit_1 setSuppression 1;$/Code$ undefined / undefined - (16 Aug, 2009) - In Arma 2, the radio is now an item in ArmA 2. Class path is CfgWeapons- ItemRadio. Use the command addWeapon and removeWeapon to remove it from a unit's inventory. (example: player removeweapon "ItemRadio") - Nothing + Nothing + - showScoretable + aimPos - Forces the score table to be shown, hidden or reset to default functionality. Forcing score table will make it show even in SP. When score table is forced opened it cannot be closed manually, when it is force closed, it cannot be opened manually. + Returns the position of the object other units can aim to. - https://community.bistudio.com/wiki/showScoretable + https://community.bistudio.com/wiki/aimPos - showScoretable Number + aimPos Object - showScoretable force + aimPos object - $Code$showScoretable 1;$/Code$ + $Code$aimPos player$/Code$ - undefined / undefined + global / undefined + (July 7, 2015) + Generally returns the center position of the object (middle of the geometry, not the model's [0,0,0]). - Nothing + Array + - showSubtitles + removeWeaponGlobal - Enables / disables showing of subtitles in a chat. Only scripted/engine chatter is affected, player manual chat is unaffected. Returns the previous state. + Remove a weapon from a unit. An attempt to remove a weapon, which is not in unit's possession, is simply ignored. - https://community.bistudio.com/wiki/showSubtitles + https://community.bistudio.com/wiki/removeWeaponGlobal - showSubtitles Boolean + Object removeWeaponGlobal String - showSubtitles enable + unit removeWeaponGlobal weapon - $Code$showSubtitles false;$/Code$ + $Code${ + _x removeWeaponGlobal "Laserdesignator"; + } forEach allUnits ;$/Code$ + + $Code${ + if ( typeOf _x == "O_Heli_Attack_02_black_F") then { + _x removeWeaponGlobal "rockets_Skyfire"; + }; + } forEach vehicles ;$/Code$ - undefined / undefined + global / global - Boolean + Nothing + - showUAVFeed + removeMagazinesTurret - Shows/hides video feed transmitted from UAV. When enabled, the video is streamed to following texture - "#(argb,512,512,1)r2t(uavpipsingleview,1.25)" - in the feed window. The feed window IGUI display idd is 315. The actual feed control idc is 102. - $Code$_UAVFeedDisplay = uiNamespace getVariable "RscAvCamera";$/Code$ + Removes all magazines of the given type from given vehicle. Use turret path [-1] for driver's turret. - https://community.bistudio.com/wiki/showUAVFeed + https://community.bistudio.com/wiki/removeMagazinesTurret - showUAVFeed Boolean + Object removeMagazinesTurret Array - showUAVFeed show + vehicle removeMagazinesTurret [magazineName, turretPath] - $Code$showUAVFeed true ;$/Code$ + $Code$vehicle player removeMagazinesTurret ["60rnd_cmflaremagazine",[-1]]$/Code$ + + $Code$_tank removeMagazinesTurret ["20Rnd_120mmSABOT_M1A2",[0]]$/Code$ - undefined / undefined + local / global + (July 30, 2011) + Here's how you would remove all machine gun ammo from an M1A2 TUSK: + remove the gunner's M240 ammo. + $Code$this removeMagazinesTurret ["1200Rnd_762x51_M240",[0]];$/Code$ + remove the commander's M2 ammo. + $Code$this removeMagazinesTurret ["100Rnd_127x99_M2",[0,0]];$/Code$ + remove the loader's M240 ammo. + $Code$this removeMagazinesTurret ["100Rnd_762x51_M240",[0,1]];$/Code$ - Boolean + Nothing + - showWarrant + addCuratorEditingArea - Enable ID card (default false ). Obsolete command. + Adds or changes curator edit area (depends on if ID is already used). - https://community.bistudio.com/wiki/showWarrant + https://community.bistudio.com/wiki/addCuratorEditingArea - showWarrant Boolean + Object addCuratorEditingArea Array - showWarrant show + curatorObj addCuratorEditingArea [editAreaID,position,radius] - + $Code$myCurator addCuratorEditingArea [4, position player,1000];$/Code$ + undefined / undefined - Nothing + Nothing + - showWatch + pixelGrid - Shows or hides the watch on the map screen, if enabled for the mission and you possess the item. (default true ) + Returns grid size based on screen resolution, UI size and configs: uiScaleFactor, uiScaleMaxGrids. - https://community.bistudio.com/wiki/showWatch + https://community.bistudio.com/wiki/pixelGrid - showWatch Boolean + pixelGrid - showWatch show + pixelGrid - $Code$showWatch false ;$/Code$ + $Code$_gridHeight = pixelH * pixelGrid ;$/Code$ undefined / undefined - (16 Aug, 2009) - In Arma 2, the Watch is now an inventory item. Class path is CfgWeapons- ItemWatch. Use the commands addWeapon and removeWeapon to add or remove it from a unit's inventory. (example: player addweapon "ItemWatch") - Nothing + Number + - showWaypoints + loadOverlay - Shows/Hides task HUD markers and waypoints that will fade out in time. Dependable on difficulty settings. + Creates the load overlay dialog for the specified type of overlay. + i + Some Old Editor Command - https://community.bistudio.com/wiki/showWaypoints + https://community.bistudio.com/wiki/loadOverlay - showWaypoints Boolean + Control loadOverlay Config - showWaypoints enabled + map loadOverlay config - $Code$showWaypoints true ;$/Code$ - + undefined / undefined - Nothing + Nothing + - showWaypoint + ln - Sets the condition determining when the waypoint is shown. - Possible values are: - "NEVER" - never show it - "EASY" - show only in cadet mode - "ALWAYS" - always show it + Natural logarithm of x. - https://community.bistudio.com/wiki/showWaypoint + https://community.bistudio.com/wiki/ln - Array showWaypoint String + ln Number - waypoint showWaypoint show + ln x - $Code$[_grp, 2] showWaypoint "ALWAYS";$/Code$ + $Code$_nlog = ln 10 + // Result is 2.302$/Code$ undefined / undefined @@ -65196,83 +67054,93 @@ - Nothing + Number + - shownArtilleryComputer + addVehicle - Checks whether the player has the artillery computer currently open. + Adds a specified vehicle for use by a specified AI led group taking into account vehicle's cost. The vehicle will be considered as an available vehicle for use by this group. + When vehicle is added in this way, it can appear as a target for the enemy even if the vehicle is currently free of the crew. Vehicles with crew, which are placed in the editor, get automatically added to the group. To remove vehicle from a group, use leaveVehicle. - https://community.bistudio.com/wiki/shownArtilleryComputer + https://community.bistudio.com/wiki/addVehicle - shownArtilleryComputer + Group addVehicle Object - shownArtilleryComputer + groupName addVehicle vehicleName - $Code$if ( shownArtilleryComputer ) then { hint "Artillery Computer shown on screen"; };$/Code$ + $Code$_grp addVehicle _vehicle$/Code$ + + $Code$// Using on crewed vehicle: + group tank addVehicle tank;$/Code$ - undefined / undefined + local / undefined + (22 Nov, 2008 00:40) + This command works best when used on empty vehicles. If used on a vehicle already driven by a member of another group, the driver will continue under his own group's orders, which may not benefit the addVehicle group. + More than one vehicle can be added to a group, and more than one group can be added to a vehicle. + When deciding whether to board a vehicle, AI leaders seem to only consider the transport benefit of a vehicle, ignoring any combat benefits the vehicle may provide. - Boolean + Nothing + - shownChat + menuPicture - Returns true if chat window is enabled. Chat window can be disabled with showChat command. + Returns picture set into item on given path - https://community.bistudio.com/wiki/shownChat + https://community.bistudio.com/wiki/menuPicture - shownChat + menuPicture Array - shownChat + menuPicture [idc, path] - $Code$_bool = shownChat ;$/Code$ - + undefined / undefined - Boolean + String + - shownCompass + setCustomAimCoef - Checks if client has Compass enabled in description.ext ( showCompass param) or force enabled with showCompass command. + Set custom aim precision coefficient for weapon sway - https://community.bistudio.com/wiki/shownCompass + https://community.bistudio.com/wiki/setCustomAimCoef - shownCompass + Object setCustomAimCoef Number - shownCompass + unit setCustomAimCoef coef - $Code$if ( shownCompass ) then { hint "You have Compass enabled"};$/Code$ + $Code$player setCustomAimCoef 1;$/Code$ undefined / undefined @@ -65280,82 +67148,109 @@ - Boolean + Nothing + - shownCuratorCompass + while - Returns true if compass is shown. + Repeats Code while condition is true. A part of while do construct. - https://community.bistudio.com/wiki/shownCuratorCompass + https://community.bistudio.com/wiki/while - shownCuratorCompass + while Code - shownCuratorCompass + while condition - + $Code$while {a b} do {a = a + 1};$/Code$ + + $Code$// A practical example: Repair all members of a group to such a level that they are able to stand up: + { + while {! canStand _x && alive _x } do { + _x setDamage ( damage _x - 0.01); + }; + } forEach units group unitname;$/Code$ + undefined / undefined + (May 14, 2008) + The boolean code that's used to evaluate the while condition can be preceded by code that executes a regular command. + $Code$ while {_a =_a + 1; _a 10} do {...}$/Code$ + + (August 30, 2014) + In non-scheduled environment, while do loop is limited to 10,000 iterations, after which it exits even if condition is still true. In scheduled environment no such limit exists. - Boolean + While_Type + - shownGPS + setUserActionText - Checks if client has GPS reciever enabled in description.ext ( showGPS param) or force enabled with showGPS command. + Changes user added action (see addAction ) menu item text. + Since Arma 3 v1.61.136587 it is possible to set 2 more optional texts, one for background and one for foreground when action is displayed on the screen ( showWindow = true ) - https://community.bistudio.com/wiki/shownGPS + https://community.bistudio.com/wiki/setUserActionText - shownGPS + Object setUserActionText Array - shownGPS + object setUserActionText [actionIndex, textMenu, textWindowBackground, textWindowForeground] - $Code$if ( shownGPS ) then { hint "You have GPS reciever enabled"};$/Code$ + $Code$_id = player addAction ["Hello", ""]; + player setUserActionText [_id, "Good Bye"];$/Code$ + + $Code$_id = billboard addAction ["Some Action", {}]; + billboard setUserActionText [ + _id, + "Some Action", + " t color='#ff0000' Background----------------- /t br/ Multiline br/ Multiline br/ Multiline br/...", + " t color='#00ff00' -----------------Foreground /t " + ];$/Code$ - undefined / undefined + global / local - Boolean + Nothing + - shownHUD + waypointAttachedObject - Returns array of Booleans corresponding to the visibility of various HUD elements (see extended showHUD ). + Gets the object attached to the waypoint. - https://community.bistudio.com/wiki/shownHUD + https://community.bistudio.com/wiki/waypointAttachedObject - shownHUD + waypointAttachedObject Array - shownHUD + waypointAttachedObject waypoint - $Code$_hudStatus = shownHUD ;$/Code$ + $Code$waypointAttachedObject [groupOne,1]$/Code$ undefined / undefined @@ -65363,83 +67258,87 @@ - Array + Object + - shownMap + cameraEffectEnableHUD - Checks if client has Map enabled in description.ext ( showMap param) or force enabled with showMap command. + Enable / disable showing of in-game UI during currently active camera effect. - https://community.bistudio.com/wiki/shownMap + https://community.bistudio.com/wiki/cameraEffectEnableHUD - shownMap + cameraEffectEnableHUD Boolean - shownMap + cameraEffectEnableHUD enable - $Code$if ( shownMap ) then { hint "You have Map enabled"};$/Code$ + $Code$cameraEffectEnableHUD true ;$/Code$ undefined / undefined + (November 3, 2015) + Must be executed after camCommit. - Boolean + Nothing + - shownPad + currentTask - Checks if client has Notepad enabled. + Return current task of given person. - https://community.bistudio.com/wiki/shownPad + https://community.bistudio.com/wiki/currentTask - shownPad + currentTask Object - shownPad + currentTask person - $Code$if ( shownPad ) then { hint "You have Notepad enabled."};$/Code$ - + undefined / undefined - Boolean + Task + - shownRadio + getStatValue - Check if player has Radio enabled. + Returns value of the given stat. - https://community.bistudio.com/wiki/shownRadio + https://community.bistudio.com/wiki/getStatValue - shownRadio + getStatValue String - shownRadio + getStatValue name - $Code$if ( shownRadio ) then { hint "You have Radio enabled."};$/Code$ + $Code$getStatValue "ExpWarlockDown"; //Checks if the "Warlock Down" Achivement was already aquired$/Code$ undefined / undefined @@ -65447,28 +67346,40 @@ - Boolean + Number + - shownScoretable + ppEffectEnable - Returns the state of the score table set with showScoretable command. - Since Arma 3 v1.63.137869, the previous functionality of this command (score table visibility check) is moved to visibleScoretable command. Please update your scripts and sorry for any inconvinience. + Enable / disable Post process effects - https://community.bistudio.com/wiki/shownScoretable + https://community.bistudio.com/wiki/ppEffectEnable - shownScoretable + String ppEffectEnable Boolean + + Number ppEffectEnable Boolean + + Array ppEffectEnable Boolean - shownScoretable + effect ppEffectEnable enable + + effect ppEffectEnable enable + + [effect1,] ppEffectEnable enable - $Code$_state = shownScoretable ;$/Code$ + $Code$"colorCorrections" ppEffectEnable true ;$/Code$ + + $Code$_hndl ppEffectEnable true ;$/Code$ + + $Code$[_hndl1, _hndl2] ppEffectEnable true ;$/Code$ undefined / undefined @@ -65476,52 +67387,62 @@ - Number + Nothing - Nothing - Nothing + - shownUAVFeed + locked - Returns true if video feed transmitted from UAV is shown. A getter for showUAVFeed + Check if vehicle is locked for Persons. If it is locked, Persons cannot mount / dismount without order. - https://community.bistudio.com/wiki/shownUAVFeed + https://community.bistudio.com/wiki/locked - shownUAVFeed + locked Object - shownUAVFeed + locked vehicle - $Code$_bool = shownUAVFeed ;$/Code$ + $Code$_locked = locked _jeepOne;$/Code$ - undefined / undefined + global / undefined + (March 4, 2013) + From Arma 3 version 0.50 is return value Number : + -1 - Object is null + 0 - Unlocked + 1 - Default + 2 - Locked + 3 - Locked for player - Boolean + Number + - shownWarrant + setHideBehind - Check if player has ID card enabled. Obsolete command. + Sets the data for hiding. objectWhereHide can be taken using findCover. hidePosition can be taken using getHideFrom. Command is not functional in ArmA 2. + This command is not implemented - https://community.bistudio.com/wiki/shownWarrant + https://community.bistudio.com/wiki/setHideBehind - shownWarrant + Object setHideBehind Array - shownWarrant + object setHideBehind [objectWhereHide, hidePosition] @@ -65531,27 +67452,28 @@ - Boolean + Nothing + - shownWatch + get3DENMouseOver - Checks if client has Watch enabled in description.ext ( showWatch param) or force enabled with showWatch command. + Returns the Eden Entity the mouse is hovering over in Eden Editor. - https://community.bistudio.com/wiki/shownWatch + https://community.bistudio.com/wiki/get3DENMouseOver - shownWatch + get3DENMouseOver - shownWatch + get3DENMouseOver - $Code$if ( shownWatch ) then { hint "You have Watch enabled"};$/Code$ + $Code$systemChat str get3DENMouseOver ;// returns: ["Object",B Alpha 1-1:1]$/Code$ undefined / undefined @@ -65559,130 +67481,220 @@ - Boolean + Array + - sideAmbientLife + createVehicle - Returns side of ambient life, for example ambient life placed in Eden Editor. + Creates an empty object of given classname type (See Arma 3 Assets or createVehicle/vehicles ) + For a class reference from older games see Classes. + Some special 'Scripted' vehicle classes: + DemoCharge_Remote_Ammo_Scripted - same as DemoCharge_Remote_Ammo but will explode when destroyed or setDamage 1; + SatchelCharge_Remote_Ammo_Scripted - same as SatchelCharge_Remote_Ammo but will explode when destroyed or setDamage 1; + ClaymoreDirectionalMine_Remote_Ammo_Scripted - same as ClaymoreDirectionalMine_Remote_Ammo but will explode when destroyed or setDamage 1; + GroundWeaponHolder_Scripted - same as GroundWeaponHolder but will not be auto-deleted when empty + WeaponHolderSimulated_Scripted - same as WeaponHolderSimulated but will not be auto-deleted when empty + Randomization: + In Arma 3 many vehicles will get randomized in appearance by default in order to add some variety to the game. It is possible to override this default behavior by setting BIS_enableRandomization variable to false in the vehicle namespace: + $Code$_veh = "C_Offroad_01_F" createVehicle position player ; + [_veh, true, true, true ] call bis_fnc_initVehicle;$/Code$ + or + $Code$[this, true, true, true ] call bis_fnc_initVehicle;$/Code$ + if done in mission editor init field. + Check Vehicle Customization (VhC) page for more info about the parameters. - https://community.bistudio.com/wiki/sideAmbientLife + https://community.bistudio.com/wiki/createVehicle - sideAmbientLife + String createVehicle Position + + createVehicle Array - sideAmbientLife + type createVehicle position + + createVehicle [type, position, markers, placement, special] - $Code$_sideAmbientLife = sideAmbientLife ;$/Code$ + $Code$_jeep = "Jeep" createVehicle position player ;$/Code$ + + $Code$_heli = "AH1Z" createVehicle getMarkerPos "hspawn";$/Code$ + + $Code$_veh = createVehicle ["ah1w", position player, [], 0, "FLY"];$/Code$ + + $Code$_veh = createVehicle ["2S6M_Tunguska", getMarkerPos "marker1", ["marker2","marker3"], 0, "NONE"];$/Code$ + + $Code$// Objects such as + //test_EmptyObjectForBubbles + //test_EmptyObjectForFireBig + //test_EmptyObjectForSmoke + //create additional emitters, which are stored in "effects" variable on the object. Since Arma 3 v1.71 these emitters are automatically deleted when object is deleted + [] spawn + { + _fire = "test_EmptyObjectForFireBig" createVehicle position player ; + sleep 5; + deleteVehicle _fire; + };$/Code$ + + $Code$// The following explosives (with ending _Scripted) + //DemoCharge_Remote_Ammo_Scripted + //SatchelCharge_Remote_Ammo_Scripted + //ClaymoreDirectionalMine_Remote_Ammo_Scripted + //can be set off by applying setDamage 1 to them for ease of scripting: + _claymore = "ClaymoreDirectionalMine_Remote_Ammo_Scripted" createVehicle position player ; + 0 = _claymore spawn + { + uiSleep 5; + _this setDamage 1; + };$/Code$ + + $Code$// How to add inventory to objects without inventory: + _boxes = "Land_Pallet_MilBoxes_F" createVehicle position player ; + _cargo = "Supply500" createVehicle [0,0,0]; + _cargo attachTo [_boxes, [0,0,0.85]]; + // optional for objects that can take damage + _boxes addEventHandler ["Killed", + { + { + detach _x, + deleteVehicle _x; + } + forEach attachedObjects (_this select 0); + }];$/Code$ + + $Code$// Drop weapon: + _wh = "GroundWeaponHolder_Scripted" createVehicle position player ; + player action ["DropWeapon", _wh, currentWeapon player ];$/Code$ - undefined / undefined + undefined / global + (August 13, 2006) + Using main syntax of this command sets the created vehicle not exactly at the given position, you have to setPos it there, if accuracy counts. + + (Jan 20, 2006) + Using main syntax of this command sets the created vehicle in the nearest possible position. You can create a dozen of tanks with it - they will appear side by side. + + (December 13, 2006) + Observe that buildings with the default destrType will not work correctly in multiplayer in Armed Assault when created with this command. The Destruction effect will only be displayed where the building is local. + + (Oct 18, 2009) + As of Arma2, this command cannot be used to create game logics (source). Use createUnit instead. + + (January 14, 2011) + In multiplayer, only run this command on one machine. It will create a the vehicle on all machines every time it is called on any machine. + + (January 26 2014) + Using getPosATL should work, if otherwise you are struggling to get a the proper position coordinates. + + (September 12, 2014) + "vehclass" createVehicle pos is the same if not faster than createVehicle ["vehclass", pos, [], 0, "NONE"] + + (August 22, 2015) + GroundWeaponHolder class is automatically deleted when empty after 0.5 to 1 seconds in A3 1.48. The exact delay is random but never lower than 0.50 secs after creation. You can stop deletion by adding something (cargo) to it within 0.5 seconds. + + (December 1, 2015) + The short syntax creates vehicles at ground level ignoring the Z in pos + $Code$"vehclass" createVehicle pos$/Code$ This is equivalent to $Code$createVehicle ["vehclass", [pos select 0, pos select 1, 0], [], 0, "NONE"]$/Code$ + + (May 16, 2017) + For the alternative syntax, if the vehicle has canFloat = 1; in its config class (e.g. boats and wheeled APCs), the command expects PositionAGL, and otherwise always PositionATL. - Side + Object - Object + - sideChat + setVehicleTIPars - Types text to the side radio channel. Must have assigned "ItemRadio" to see or transmit the messages. The text will be visible only on the PC where command was executed. If you need the message to show on all computers, you have to execute it globally (see remoteExec ) + Sets the "heat" state of different vehicle parts (for TI detection). This allows simulation of heated up parts of a vehicle without it actually having to utilize them. (0: cold, 1: hot) - https://community.bistudio.com/wiki/sideChat + https://community.bistudio.com/wiki/setVehicleTIPars - Object sideChat String - - Array sideChat String + Object setVehicleTIPars Array - unitName sideChat chatText - - [side, identity] sideChat chatText + vehicle setVehicleTIPars [engine, wheels, weapon] - $Code$_soldierOne sideChat "Show this text";$/Code$ - - $Code$[ west, "HQ"] sideChat "Hi there";$/Code$ - - $Code$driver vehicle player sideChat "sideChat"; - driver vehicle player globalChat "globalChat"; - driver vehicle player groupChat "groupChat"; - vehicle player vehicleChat "vehicleChat"; - driver vehicle player commandChat "commandChat"; - driver vehicle player customChat [1, "customChat"]; - systemChat "systemChat";$/Code$ + $Code$vehicle player setVehicleTIPars [1,1,1];$/Code$ - global / local + undefined / undefined - In OFP v1.96, sideChat messages can be sent from 2 abstract sources: "Papa_Bear" and "Base FireFly". Use sideChat on an array in the form [SIDE,"base"],[SIDE,"HQ"],[SIDE,"Papa_bear"] or [SIDE,"airbase"], where SIDE is the side broadcasting. "HQ", "base" and "Papa_bear" seem to be the same object. The callsign strings can be re-defined using a stringTable.csv file, using STR_CFG_PAPABEAR and STR_CFG_FIREFLYBASE. Example : [EAST,"base"] sideChat "Return to base!". - Nothing - Nothing + Nothing + - sideEmpty + setAmmoCargo - Returns empty side, for example static buildings in Eden Editor. + Set amount of ammo resources in cargo space of a rearm vehicle. Ammo resource is used to resupply vehicles that take ammo. Soldiers use individual magazines instead. Amount: 1 is full cargo. + The actual quantity to work with is determined by the model's class in CfgVehicles - https://community.bistudio.com/wiki/sideEmpty + https://community.bistudio.com/wiki/setAmmoCargo - sideEmpty + Object setAmmoCargo Number - sideEmpty + vehicleName setAmmoCargo ammoCargo - $Code$_sideEmpty = sideEmpty ;$/Code$ + $Code$_ammoTruck1 setAmmoCargo 0.5;$/Code$ - undefined / undefined + local / global + (31 Aug, 2011) + While the amount of total 'ammo' that can be reloaded is defined in the truck/supply point's CfgVehicles entry, the amount each round of ammunition takes from that total is defined in the CfgAmmo 'Cost' entry for that round. + Your typical truck has 300000 ammo capacity, and the tunguska's missiles have a Cost of 50000. So the tunguska can reload a total of 6 missiles from the ammo truck before the ammo capacity is depleted and needs to be set with setAmmoCargo. + A similar thing applies with a vehicle's cfgVehicle Cost entry for repairing, and the vehicle's fuelCapacity entry when refuelling. + + (July 10, 2015) + (ArmA 3 1.44) setAmmoCargo will have no effect if the vehicle doesn't support getAmmoCargo. - Side + Nothing + - sideEnemy + taskType - The enemy side (used for renegades). Unit of this side is enemy to everyone. - To become one, you can attack members of your own side or use addRating. - When below a rating of -2000 units switch automatically to this side. + Returns the type of the given task - https://community.bistudio.com/wiki/sideEnemy + https://community.bistudio.com/wiki/taskType - sideEnemy + taskType Task - sideEnemy + taskType task - $Code$if ( side player == sideEnemy ) then { - hint "We've got a renegade!"; - };$/Code$ + $Code$_type = taskType ( currentTask player );$/Code$ undefined / undefined @@ -65690,311 +67702,321 @@ - Side + String + - sideFriendly + waypointTimeoutCurrent - The Friendly side (used for captives). + Gets the current waypoint timeout or -1 if countdown is not in progress. - https://community.bistudio.com/wiki/sideFriendly + https://community.bistudio.com/wiki/waypointTimeoutCurrent - sideFriendly + waypointTimeoutCurrent Group - sideFriendly + waypointTimeoutCurrent waypoint - + $Code$_timeout = waypointTimeoutCurrent groupOne;$/Code$ + undefined / undefined - Side + Number + - sideLogic + removeSecondaryWeaponItem - The Logic side. - Side of Game Logics and Modules. + Removes given weapon item from the secondary weapon cargo space. This command also supports weapon magazines. - https://community.bistudio.com/wiki/sideLogic + https://community.bistudio.com/wiki/removeSecondaryWeaponItem - sideLogic + Object removeSecondaryWeaponItem String - sideLogic + unit removeSecondaryWeaponItem item - $Code$if ( side _obj == sideLogic ) then { - hint "It's a logic!"; - };$/Code$ + $Code$player removeSecondaryWeaponItem ( secondaryWeaponItems select 0);$/Code$ - undefined / undefined + local / global - Side + Nothing + - sideUnknown + lbCurSel - The unknown side. - Used when the side of a unit is unknown, e.g. for spotted targets with insufficient information. + Returns the index of the selected item of the listbox or combobox with id idc of the topmost user dialog. For listbox LB_MULTI (multi-selection) use lbSelection. - https://community.bistudio.com/wiki/sideUnknown + https://community.bistudio.com/wiki/lbCurSel - sideUnknown + lbCurSel Number + + lbCurSel Control - sideUnknown + lbCurSel idc + + lbCurSel control - $Code$//soldier1 and soldier2 of different sides and out of sight - soldier1 reveal soldier2; - hint str (soldier1 nearTargets 1000); - //returns: [[[1557.96,5047.4,1.32402],"SoldierWB",UNKNOWN,0.0155183,soldier2,5]] - soldier1 reveal [soldier2,1.5]; - //returns: [[[1556.52,5050.08,1.32402],"SoldierWB",WEST,0.0211193,soldier2,5]]$/Code$ + $Code$_index = lbCurSel 101;$/Code$ + + $Code$lbCurSel _ctrl;$/Code$ undefined / undefined + More information on the LB command family can be found here + + (July 11, 2014) + If nothing is selected this command returns -1 - Side + Number - Number + - side + removeWeaponAttachmentCargo - Returns the side of a unit, vehicle, object or location. Once dead, a unit will be on the civilian side. Query the side of the Group to get a reliable result. - When used in conjunction with a format statement hint format ["%1", side player ], the returned strings are: " WEST ", " EAST ", " GUER ", " CIV ", " LOGIC ", " ENEMY " (eg: renegades), " FRIENDLY ", " AMBIENT LIFE ", " EMPTY " or " UNKNOWN ". + Remove attachment linked to a weapon from the vehicle cargo space. + This is unoffical documentation. All Information here is as it exists in the Engine. It might not reflect the reality. - https://community.bistudio.com/wiki/side + https://community.bistudio.com/wiki/removeWeaponAttachmentCargo - side Object/Group - - side Location + Object removeWeaponAttachmentCargo Array - side object - - side location + vehicle removeWeaponAttachmentCargo [weaponID,creatorID,attachment] - $Code$if ( side player == west ) then { hint "Player is on the West side"};$/Code$ - - $Code$_sideAlsoWorkingForDead = side group player ;$/Code$ - - $Code$_sideLocation = side myLocation;$/Code$ - - $Code$// SQS - ? ( side player == west ) : hint "Player is on the West side."$/Code$ + $Code$rearmTruckOne removeWeaponAttachmentCargo[weaponID,creatorID,"attachment"]$/Code$ undefined / undefined - In ArmA, the following objects are on side civilian : dead bodies and vehicles, empty vehicles, all mission editor placed objects (that do not have an inherit side), all objects with interactive components such as ladders and doors, man made structures such as buildings (including classless wrp placed objects), docks, high tension powerlines, see-saws, large rubbish bins, fountains. Basically if an object uses a non-simple damage or physics simulation it is likely to be on the civilian side. - NOTE: If you need to know the side of a dead body, you can use faction command as a workaround -- Killzone_Kid - - In OFP 1.96, side return value for empty vehicles will be civilian. - - In OFP v1.96, the side return value for a vehicle is based on the side of it's commander, then gunner, then driver, then cargo. It will retain it's side value until it is either empty, or a unit of another side takes over in a equal or higher role, irrespective of the side of other units still on board. This can be used to simulate friendly fire, as a vehicle can be made to appear to be an enemy even though all units on board are actually friendly. - - Units with negative score(rating) are sideEnemy. - - The Side for civilians is civilian and the string name of the side is "CIV". For Resistance/Independent (Guerilla) they are resistance and "GUER". - - As CEEB says above, in ArmA2, side for a vehicle often depends on who the command or driver is, for example, A KA52, piloted by a USMC guy will have side WEST. For an accurate result of what 'where the vehicle was made', use faction. This ignores the pilot/commander, so in my example here, this KA52 will always return faction "RU". Note that faction returns different values to side though. - - Side values for ambient life (animals) are bizarre. side _unit returns "CIV", but playerSide returns "AMBIENT LIFE" when the player is an animal. In that case, playerSide == side player returns false! - Fortunately, you can easily check if a unit is an animal with _unit isKindOf "ANIMAL"' - - Units who set via 'this setcaptive true' are always on side civilian. - - (July 30, 2015) - This is probably the most confusing section of the wiki so here I give my clarification: - In ArmA3 1.48, forEach'ing playableUnits to find certain players from certain sides, you will need to do it like this: - $Code$if (side _x isEqualTo EAST) then { diag_log format["%1's side is %2", name _x, side _x];$/Code$ - Instead, this page might trick you into thinking that you will need to check for player's side like this: - $Code$side _x isEqualTo "EAST"$/Code$ ^^^^^ That does NOT work. - Side - Side + Nothing + - sideRadio + controlNull - Sends the audio message to the side radio channel. Must have assigned "ItemRadio" to send or receive the transmission. The message is defined in CfgRadio in the description.ext file or config radio protocol. The transmission will play only on the PC where command was executed. If you need the transmission to play on all computers, you have to execute it globally (see remoteExec ). - Note: When transmitting unit gets killed, transmission will be interrupted, however when receiving unit gets killed, the transmission continues to play. - + A non-existing Control. To compare non-existent objects use isNull or isEqualTo : + controlNull == controlNull ; // false + isNull controlNull ; // true + controlNull isEqualTo controlNull ; // true + - https://community.bistudio.com/wiki/sideRadio + https://community.bistudio.com/wiki/controlNull - Object sideRadio String - - Array sideRadio String + controlNull - unit sideRadio radioName - - [side, identity] sideRadio radioName + controlNull - $Code$_soldierOne sideRadio "messageOne";$/Code$ - - $Code$player sideRadio configName selectRandom ("true" configClasses ( configFile "CfgRadio"));$/Code$ + $Code$! isNull controlNull ; // false$/Code$ - $Code$[ west, "Base"] sideRadio configName selectRandom ("true" configClasses ( configFile "CfgRadio"));$/Code$ + $Code$str controlNull ; // No control$/Code$ - global / local + undefined / undefined - (03:47, 12 February 2007) - In OFP v1.96, sideRadio messages can be sent from 2 abstract sources: "Papa_Bear" and "Base FireFly". Use sideRadio on an array in the form [SIDE,"base"],[SIDE,"HQ"],[SIDE,"Papa_bear"] or [SIDE,"airbase"], where SIDE is the side broadcasting. "HQ", "base" and "Papa_bear" seem to be the same object. The callsign strings can be re-defined using a stringTable.csv file, using STR_CFG_PAPABEAR and STR_CFG_FIREFLYBASE. Example : [EAST,"base"] sideRadio "returnToBase". - - (December 3, 2016) - To transmit user custom sounds (see Multiplayer_Custom_Sounds_Tutorial ), prefix the full filename including file extension with #. For example if there is a custom user sound file called MySound.ogg, to play it on the radio use: - $Code$ player sideRadio "#MySound.ogg";$/Code$ - Nothing - Nothing + Control + - simpleTasks + lockCargo - Return all simple tasks assigned to given person. + Lock all cargo positions of a vehicle or lock by index. This command must be executed where vehicle is local. - https://community.bistudio.com/wiki/simpleTasks + https://community.bistudio.com/wiki/lockCargo - simpleTasks Object + Object lockCargo Boolean + + Object lockCargo Array - simpleTasks person + vehicle lockCargo lock + + vehicle lockCargo [index, lock] - + $Code$vehicleName lockCargo true ;$/Code$ + + $Code$vehicleName lockCargo [0, true ];$/Code$ + - undefined / undefined + local / global - Array + Nothing - Nothing + - simulCloudDensity + eyePos - Returns density of clouds at given position. + Returns the object's eyes / main turret position. - https://community.bistudio.com/wiki/simulCloudDensity + https://community.bistudio.com/wiki/eyePos - simulCloudDensity Position + eyePos Object - simulCloudDensity pos + eyePos object - $Code$simulCloudDensity (getPos player)$/Code$ + $Code$eyePos player$/Code$ - undefined / undefined + global / undefined - Number + Array + - simulCloudOcclusion + lnbSetColor - Returns clouds occlusion between two given points (0 - no clouds, 1 - full clouds). + Sets the color of the item with the given position of the 2D listbox. Color is in format Color. - https://community.bistudio.com/wiki/simulCloudOcclusion + https://community.bistudio.com/wiki/lnbSetColor - simulCloudOcclusion Array + lnbSetColor Array + + Control lnbSetColor Array - simulCloudOcclusion [pos1,pos2] + lnbSetColor [idc,[row,column],color] + + _ctrl lnbSetColor [ [row,column],color] - $Code$canSeeSun = ( simulCloudOcclusion == 0)$/Code$ + $Code$_ctrl lnbSetColor [ [0,0], [1,0,0,1] ];$/Code$ - undefined / undefined + local / local - (8 August, 2014) - The simulCloudOcclusion command is not recognized on dedicated servers, and will produce an error. If you use this command, it cannot be anywhere within a script that is run on the dedicated server, or the entire script will halt. To get around this, you can use: $Code$if ! isDedicated then {[] execVM "simulCloudOcclusionScript.sqf"};$/Code$ + (Sep 9 2014) + (A3 1.28)As for invisible data processing, lnbAddArray, lnbAddColumn, lnbData, lnbGetColumnsPosition, lnbSetColumnsPos, lnbSetData, lnbSetText, lnbSetValue, lnbText and lnbValue store data types into exact position of the listNbox with different spaces. Accessing data with coordinate command at nearly the same syntax: + $Code$ + //Set same value to one position of a Control + _ctrl lnbSetData [ [0,0],"#1"]; + lnbSetColumnsPos [102, [0,1], 1]; + _ctrl lnbSetText [ [0,1], "#1"]; + _ctrl lnbSetValue [ [0,0],1]; + //Accessing the value disregard affecting one another. + _ctrl lnbData [0,0]; //"#1" + lnbGetColumnsPosition _ctrl //[1]; + _ctrl lnbText [0,0];//"#1" + _ctrl lnbValue [0,0];//1 + $/Code$ + For a direct visible control over CT_LISTNBOX: + $Code$ + 0 = [_CT_LISTNBOX] spawn { + private ["_CT_LISTNBOX","_color","_current","_pic"]; + disableSerialization ; + _CT_LISTNBOX = _this select 0; + { + _CT_LISTNBOX lnbAddRow [ getText (_x "displayNameShort"), getText (_x "displayName")]; + _CT_LISTNBOX lnbSetPicture [ [_foreachIndex,0], getText (_x "texture")]; + } forEach (" isClass _x" configClasses ( configFile "CfgRanks")); + _CT_LISTNBOX lnbSetCurSelRow 0; + _current = lnbCurSelRow _CT_LISTNBOX; + _color = _CT_LISTNBOX lnbColor [_current,0]; + _CT_LISTNBOX lnbSetColor [ [_current,1], [(_color select 0)/2,0,0,1] ]; + _CT_LISTNBOX lnbDeleteColumn 0; + _CT_LISTNBOX lnbDeleteRow 1; + sleep 1; + lnbClear _CT_LISTNBOX;//Clear all items but control still remains just invisible. + }; + $/Code$ + A combined use of both invisible and visible data processing commands alive the Control. - Number + Nothing - Nothing + - simulInClouds + enableVehicleSensor - Returns if given position is in clouds. + Enable/disable given sensor - https://community.bistudio.com/wiki/simulInClouds + https://community.bistudio.com/wiki/enableVehicleSensor - simulInClouds Position + Object enableVehicleSensor Array - simulInClouds pos + vehicle enableVehicleSensor [componentName, state] - $Code$simulInClouds (getPos player)$/Code$ + $Code$vehicle player enableVehicleSensor ["PassiveRadarSensorComponent",false]; // disables passive radar$/Code$ undefined / undefined @@ -66002,83 +68024,95 @@ - Boolean + Nothing + - simulWeatherSync + HUDMovementLevels - Synchronizes Simul Weather with Arma weather, generates all keyframes. + Returns movement borders for HUD [min speed, max speed, min alt, max alt, min dir, max dir, position[x,y,z] or target] - https://community.bistudio.com/wiki/simulWeatherSync + https://community.bistudio.com/wiki/HUDMovementLevels - simulWeatherSync + HUDMovementLevels - simulWeatherSync + HUDMovementLevels - + $Code$HUDMovementLevels;//[0,0,0,0,0,0,[0,0,0]]$/Code$ + undefined / undefined - (May 4, 2016) - The behavior of this command is similar to forceWeatherChange, however it leaves current weather transitions intact. Its main purpose would be to refresh the cloud cover to properly reflect current overcast, as they can sometime get out of sync, especially when using setTimeMultiplier and setAccTime. - Nothing + Array + - simulationEnabled + directSay - Check if the entity has enabled simulation. + Sends given audio message to the direct channel. Command operates just like xxxxRadio commands, but the sound is played over direct channel and is independent of fadeRadio. The message is defined in CfgRadio in the description.ext file or config radio protocol or a kbAddTopic. The transmission will play only on the PC where command was executed. If you need the transmission to play on all computers, you have to execute it globally (see remoteExec ). + Note: When transmitting unit gets killed, transmission will be interrupted, however when receiving unit gets killed, the transmission continues to play. - https://community.bistudio.com/wiki/simulationEnabled + https://community.bistudio.com/wiki/directSay - simulationEnabled Object + Object directSay String - simulationEnabled entity + unit directSay radioName - + $Code$player directSay configName selectRandom ("true" configClasses ( configFile "CfgRadio"));$/Code$ + - undefined / undefined + global / local + (December 3, 2016) + To transmit user custom sounds (see Multiplayer_Custom_Sounds_Tutorial ), prefix the full filename including file extension with #. For example if there is a custom user sound file called MySound.ogg, to play it on the radio use: + $Code$ player directSay "#MySound.ogg";$/Code$ - Boolean + Nothing + - sin + getObjectArgument - Sine of x, argument in Degrees. + Return name of object argument in mission editor. + i + Some Old Editor Command - https://community.bistudio.com/wiki/sin + https://community.bistudio.com/wiki/getObjectArgument - sin Number + Control getObjectArgument Array - sin x + map getObjectArgument [object, argument] - $Code$_sine = sin 30;//result is 0.5$/Code$ + $Code$// returns string "[1009.0351, 1319.4928]" + ( findDisplay 128 displayCtrl 51) getObjectArgument ["_unit_1", "POSITION"] + // returns array [1009.0351, 1319.4928] + ( findDisplay 128 displayCtrl 51) evalObjectArgument ["_unit_1", "POSITION"]$/Code$ undefined / undefined @@ -66086,27 +68120,29 @@ - Number + String + - size + ctrlSetScale - Returns a location's size. + Sets wanted scale for control animation. Top left corner remains same. This command requires ctrlCommit. - https://community.bistudio.com/wiki/size + https://community.bistudio.com/wiki/ctrlSetScale - size Location + Control ctrlSetScale Number - size location + control ctrlSetScale scale - $Code$_locSize = size myLocation$/Code$ + $Code$_control ctrlSetScale 0.5; + _control ctrlCommit 0;$/Code$ undefined / undefined @@ -66114,28 +68150,28 @@ - Array + Nothing + - sizeOf + setVehicleRadar - Returns the diameter of bounding sphere of the object of given type in meters. Size returned is usually bigger than the biggest size of the object along any of the axes. For example if object is 10 x 4 x 5 the sizeOf value returned expected to be around 10. If you need to estimate the size of the object more precisely, use boundingBox or boundingBoxReal. - NOTE: The object has to be present in current mission to be able to read its size (otherwise zero will be returned). + Sets the AI rules of Radar usage (Emission Control). Automatic means Radar switched on only when in Combat. The command doesn't affect player-controlled vehicles. - https://community.bistudio.com/wiki/sizeOf + https://community.bistudio.com/wiki/setVehicleRadar - sizeOf String + Object setVehicleRadar Number - sizeOf type + vehicle setVehicleRadar rules - $Code$_dimension = sizeOf "M1Abrams"; //returns 10.7833$/Code$ + $Code$_vehicle setVehicleRadar 1;$/Code$ undefined / undefined @@ -66143,224 +68179,193 @@ - Number + Nothing + - skillFinal + setWaypointCombatMode - Returns final, recalculated sub skill value of given unit. (with regard to AI Level coefficient (Difficulty settings)). + The group combat mode is switched when the waypoint becomes active. + Possible mode values are: + "NO CHANGE" (No change) + " BLUE " (Never fire) + " GREEN " (Hold fire - defend only) + " WHITE " (Hold fire, engage at will) + " YELLOW " (Fire at will) + " RED " (Fire at will, engage at will) - https://community.bistudio.com/wiki/skillFinal + https://community.bistudio.com/wiki/setWaypointCombatMode - Object skillFinal String + Array setWaypointCombatMode String - unitName skillFinal sub-skill + waypoint setWaypointCombatMode mode - $Code$cursorTarget skillFinal "Endurance"$/Code$ + $Code$[_grp, 2] setWaypointCombatMode "RED";$/Code$ undefined / undefined - Since 1.40 the command works also in MP environment - - (January 31, 2015) - Number + Nothing + - skill + commandChat - Returns current level of ability of person, in range between 0 and 1. Skill 1 is highest skill. + Types text to the command radio channel. Must have assigned "ItemRadio" to see or transmit the messages. The text will be visible only on the PC where command was executed. If you need the message to show on all computers, you have to execute it globally (see remoteExec ) - https://community.bistudio.com/wiki/skill + https://community.bistudio.com/wiki/commandChat - skill Object + Object commandChat String - Object skill String + Array commandChat String - skill unitName + unitName commandChat chatText - unitName skill skillType + [side, identity] commandChat chatText - $Code$_skill = skill unit1$/Code$ + $Code$_soldierOne commandChat "Show this text";$/Code$ + + $Code$[ playerSide, "HQ"] commandChat "Do this! That's an order!";$/Code$ - $Code$_myEndurance = player skill "Endurance"$/Code$ + $Code$driver vehicle player sideChat "sideChat"; + driver vehicle player globalChat "globalChat"; + driver vehicle player groupChat "groupChat"; + vehicle player vehicleChat "vehicleChat"; + driver vehicle player commandChat "commandChat"; + driver vehicle player customChat [1, "customChat"]; + systemChat "systemChat";$/Code$ - undefined / undefined + global / local - Skill of AI units set via the slider in unit placement screen varies from 0.2 to 1.0. - If superAI is enabled all units have skill of 1.0 regardless of the skill slider - Number - Number + Nothing - Nothing + - skipTime + isFormationLeader - Jumps the specified number of hours forward or backward. The time of day and tides are adjusted, but no changes are made to any units. If present, the lower level of clouds instantly jump to the position they would be in if time had passed normally. + Returns true if the specified unit is subgroup leader. - https://community.bistudio.com/wiki/skipTime + https://community.bistudio.com/wiki/isFormationLeader - skipTime Number + isFormationLeader Object - skipTime duration + isFormationLeader unit - $Code$skipTime 5;$/Code$ + $Code$_isLeader = isFormationLeader player ;$/Code$ undefined / undefined - This scripting command must be executed on the server to work properly in multiplayer - - To simulate a smooth time-lapse effect (e.g. in cut-scenes), you can use the following code: - $Code$while {true} do {skiptime 0.00333; sleep 0.1};$/Code$ - - To skip forward to a specific time, irrespective of the current mission time, use - $Code$skipTime (_timeToSkipTo - daytime + 24 ) % 24;$/Code$ - - In ArmA & OFP, skipTime does not actually estimate weather changes beyond moving the clouds across the sky. Weather counters continue as if no time has passed. The setDate command can be used instead of skiptime to change the time without the visual give-away of the lower clouds jumping. - - I cannot confirm this for OA 1.60 beta (85889): - MP: Even though the immediate effect of skipTime is only local, - the new time will propagate through the network after 30 seconds or so. - Instead the date, which includes time, is synced automatically for new JIP clients - NOT for present instances. - So one has to apply skipTime on all instances in MP (server + all present clients). - - This command is blocking and in some cases it may take up to 1.5 seconds (probably depends on CPU) for it to calculate the changes to the environment, during which the game will microfreeze. It largely depends on weather changes, which are quite random. However one thing remains consistent, skipTime 24 hours is always almost instant. This is quite helpful when used in conjunction with commands such as setOvercast for instant and seamless effect. To try it yourself use this script: - $Code$[] spawn { - for "_i" from 1 to 24 do { - _time = diag_tickTime ; - skipTime _i; - diag_log [_i, diag_tickTime - _time]; - sleep 3; - }; - };$/Code$ - One of the results (results will vary depending on weather conditions): - $Code$[1,1.44507] - [2,1.46118] - [3,1.33105] - [4,1.396] - [5,0.0310059] - [6,1.37891] - [7,1.4502] - [8,1.37817] - [9,1.37695] - [10,1.37012] - [11,1.448] - [12,1.32593] - [13,1.45508] - [14,1.448] - [15,0.0349121] - [16,0.0368652] - [17,1.25903] - [18,1.38599] - [19,1.4519] - [20,0.052002] - [21,0.0400391] - [22,0.0490723] - [23,1.35205] - [24,0.0151367] //this is always the lowest$/Code$ - - In Arma 3 (around v1.14) skipTime executed on the server will get synced in 5 seconds or so with all the clients. It will also be JIP compatible. skipTime executed on a client will change time on client for about 5 seconds after which it will sync back to server time. - Nothing + Boolean + - sleep + lifeState - Suspends code execution for given time in seconds. The sleep precision is given by a framerate, the delay given is the minimal delay expected. Must be called inside of a context which is interruptible, i.e. a script executed by execVM or spawn. + Returns the life state of the given unit. Can be one of: + (Pre-Arma 3) + "ALIVE" + "DEAD" + "DEAD-RESPAWN" + "DEAD-SWITCHING" + "ASLEEP" + "UNCONSCIOUS" + (Arma 3) + "HEALTHY" + "DEAD" + "DEAD-RESPAWN" + "DEAD-SWITCHING" + "INCAPACITATED" + "INJURED" + In Arma 3 lifeState seems to change to "INJURED" when damage aliveUnit = 0.1 (0.1 seems to be the value defined in config under "InjuredTreshold"). - https://community.bistudio.com/wiki/sleep + https://community.bistudio.com/wiki/lifeState - sleep Number + lifeState Object - sleep delay + lifeState unit - $Code$[] spawn { sleep 5; hint "after 5 sec..."};$/Code$ + $Code$_ls = lifeState loon;$/Code$ - undefined / undefined + global / undefined - this command will suspend the script indefinitely if game simulation is paused in SP. To avoid this, use uiSleep. - - (December 20, 2006) - Sleep suspends both SQF functions and SQF scripts. In functions, the calling script is still in suspension due to waiting for a return from the call command. The game engine will continue, however. See Function for more detail. - - (February 12, 2007) - Sleep durations between.0005 and.02 will cause the same delay (roughly.02 seconds). Delays of.0005 and less have no effect (ie, the sleep call will return immediately). - - The comment above is a little misleading. The game engine appears to work by processing frames and then checking to see whether scripts are available to execute. Sleep causes the script/function to be suspended until at least the specified time has elapsed. To wait for the next frame, or give other scripts a chance to run, use Sleep 0.001. - - (July 16, 2007) - For scripts called by the Init Event Handler the first sleep command will suspend the script at the briefing screen at the start of a mission. The script will continue after the briefing screen, when actually "in game". - - (July 12, 2014) - Sleep will treat negative values as if they were 0. (Tested in Arma 3 v1.22) - - (October 18, 2014) - For server scripts, if you are creating "while true" timers, it is best to use uiSleep instead, as the sleep from that command is not slowed down by simulation / server lag, so the timers will execute at intervals that are much closer to real time, even under heavy lag. - Nothing + String + - sliderPosition + switch - Return current thumb position of slider idc of topmost user dialog. + Creates a switch type that can be used inside a switch do -block - https://community.bistudio.com/wiki/sliderPosition + https://community.bistudio.com/wiki/switch - sliderPosition Number - - sliderPosition Control + switch Anything - sliderPosition idc - - sliderPosition control + switch arg - $Code$_slidepos1 = sliderPosition 105;$/Code$ + $Code$_mySwitch = switch "Test"; + _mySwitch do {/*Something*/};$/Code$ + + $Code$switch (_a) do { case 1 : { /*...code...*/ }; case 2 : { /*...code...*/ }; default { /*...code...*/ }; }; switch (_condition) do { + case 1: { hint "1" }; + case 2: { hint "2" }; + default { hint "default" }; + }; switch (_condition) do { + case "string1"; + case "string2": { hint "string1 or string2" }; + case "string3"; + case "string4": { hint "string3 or string4" }; + default { hint "default" }; + };$/Code$ undefined / undefined @@ -66368,63 +68373,57 @@ - Number - Number + Switch_Type + - sliderRange + mapAnimDone - Return limits, as an Array [min, max] of slider idc of topmost user dialog. + Check if map animation is finished. - https://community.bistudio.com/wiki/sliderRange + https://community.bistudio.com/wiki/mapAnimDone - sliderRange Number - - sliderRange Control + mapAnimDone - sliderRange idc - - sliderRange control + mapAnimDone - $Code$_slidelimits1 = sliderRange 105;$/Code$ - + - undefined / undefined + local / local + In OFP v1.96, the mapAnim series of commands, together with forceMap can only be used in the intro and mission, as it is not possible to access the map from the outro. (not checked, sourced from an old copy of the OFPEC comref) - Array - Array + Boolean + - sliderSetPosition + dialog - Set current thumb position of slider idc of topmost user dialog. + Tests whether any user dialog is open. - https://community.bistudio.com/wiki/sliderSetPosition + https://community.bistudio.com/wiki/dialog - sliderSetPosition Array - - Control sliderSetPosition Number + dialog - sliderSetPosition [idc, pos] - - control sliderSetPosition pos + dialog - $Code$sliderSetPosition [101, 50];$/Code$ + $Code$if (! dialog ) then { createDialog "Dialog1";};$/Code$ undefined / undefined @@ -66432,97 +68431,88 @@ - Nothing - Nothing + Boolean + - sliderSetRange + formationLeader - Set limits of slider idc of topmost user dialog. + Return leader of the formation. - https://community.bistudio.com/wiki/sliderSetRange + https://community.bistudio.com/wiki/formationLeader - sliderSetRange Array - - Control sliderSetRange Array + formationLeader Object - sliderSetRange [idc, min, max] - - control sliderSetRange [min, max] + formationLeader unitName - $Code$sliderSetRange [101, 0, 100];$/Code$ + $Code$? (formationLeader player != leader player) : + hint "Formation leader is not the group leader."$/Code$ undefined / undefined + (December 2, 2006) + Return value is NULL-OBJECT if no group members exist. - Nothing - Nothing + Object + - sliderSetSpeed + ctrlRemoveAllEventHandlers - Set speed of slider with id idc of topmost user dialog. - Click to arrow - move by line - Click to scale outside thumb - move by page. + Remove all event handlers from the given control. - https://community.bistudio.com/wiki/sliderSetSpeed + https://community.bistudio.com/wiki/ctrlRemoveAllEventHandlers - sliderSetSpeed Array - - Control sliderSetSpeed Array + Control ctrlRemoveAllEventHandlers String - sliderSetSpeed [idc,line,page] - - control sliderSetSpeed [line, page] + control ctrlRemoveAllEventHandlers handlerName - $Code$sliderSetSpeed [101, 0.5, 2];$/Code$ - + undefined / undefined - Nothing - Nothing + Nothing + - sliderSpeed + getArtilleryComputerSettings - Return speed, as an Array [min, max] of slider idc of topmost user dialog. + Returns settings from artillery computer currently opened by player. - https://community.bistudio.com/wiki/sliderSpeed + https://community.bistudio.com/wiki/getArtilleryComputerSettings - sliderSpeed Number - - sliderSpeed Control + getArtilleryComputerSettings - sliderSpeed idc - - sliderSpeed control + getArtilleryComputerSettings - $Code$_slidespeed1 = sliderSpeed 105;$/Code$ + $Code$hint str getArtilleryComputerSettings ; //["Semi (medium)","HE Mortar Shells",0]$/Code$ undefined / undefined @@ -66530,29 +68520,28 @@ - Array - Array + Array + - slingLoadAssistantShown + radioChannelSetLabel - Returns true of Sling Load Assistant is open + Set the custom radio channel's label. - https://community.bistudio.com/wiki/slingLoadAssistantShown + https://community.bistudio.com/wiki/radioChannelSetLabel - slingLoadAssistantShown + Number radioChannelSetLabel String - slingLoadAssistantShown + index radioChannelSetLabel label - $Code$waitUntil { slingLoadAssistantShown }; - hint "You lack rudimentary motor skills and basic eye-hand coordination."; - //scold user for unethical practices$/Code$ + $Code$5 radioChannelSetLabel "Q-dance Radio";$/Code$ undefined / undefined @@ -66560,35 +68549,28 @@ - Boolean + Nothing + - soldierMagazines + isBleeding - Get array with all magazines of the given unit. + Returns whether the unit is bleeding. - https://community.bistudio.com/wiki/soldierMagazines + https://community.bistudio.com/wiki/isBleeding - soldierMagazines Object + isBleeding Object - soldierMagazines unit + isBleeding unit - $Code$soldierMagazines player ;[ - "6.5mm 30Rnd STANAG Mag(30/30)[id/cr:1/0](5x)", - "9mm 16Rnd Mag(16/16)[id/cr:7/0](2x)", - "RGO Frag Grenade(1/1)[id/cr:10/0](2x)", - "Smoke Grenade (White)(1/1)[id/cr:12/0](1x)", - "Smoke Grenade (Green)(1/1)[id/cr:13/0](1x)", - "Chemlight (Green)(1/1)[id/cr:14/0](2x)", - "Titan AT Missile(1/1)[id/cr:16/0](2x)" - ]$/Code$ + $Code$if ( isBleeding player ) then { player groupChat "I'm bleeding!!"; }$/Code$ undefined / undefined @@ -66596,714 +68578,565 @@ - Array + Boolean + - someAmmo + lnbClear - Check if unit has some ammo. + Clears all items in the given listbox or combobox. - https://community.bistudio.com/wiki/someAmmo + https://community.bistudio.com/wiki/lnbClear - someAmmo Object + lnbClear Number + + lnbClear Control - someAmmo unitName + lnbClear idc + + lnbClear ctrl - $Code$? not (someAmmo _loon1) : hint "Loon1 is out of ammo!"$/Code$ + $Code$lnbClear _ctrl;$/Code$ undefined / undefined + (Sep 9 2014) + (A3 1.28)As for invisible data processing, lnbAddArray, lnbAddColumn, lnbData, lnbGetColumnsPosition, lnbSetColumnsPos, lnbSetData, lnbSetText, lnbSetValue, lnbText and lnbValue store data types into exact position of the listNbox with different spaces. Accessing data with coordinate command at nearly the same syntax: + $Code$ + //Set same value to one position of a Control + _ctrl lnbSetData [ [0,0],"#1"]; + lnbSetColumnsPos [102, [0,1], 1]; + _ctrl lnbSetText [ [0,1], "#1"]; + _ctrl lnbSetValue [ [0,0],1]; + //Accessing the value disregard affecting one another. + _ctrl lnbData [0,0]; //"#1" + lnbGetColumnsPosition _ctrl //[1]; + _ctrl lnbText [0,0];//"#1" + _ctrl lnbValue [0,0];//1 + $/Code$ + For a direct visible control over CT_LISTNBOX: + $Code$ + 0 = [_CT_LISTNBOX] spawn { + private ["_CT_LISTNBOX","_color","_current","_pic"]; + disableSerialization ; + _CT_LISTNBOX = _this select 0; + { + _CT_LISTNBOX lnbAddRow [ getText (_x "displayNameShort"), getText (_x "displayName")]; + _CT_LISTNBOX lnbSetPicture [ [_foreachIndex,0], getText (_x "texture")]; + } forEach (" isClass _x" configClasses ( configFile "CfgRanks")); + _CT_LISTNBOX lnbSetCurSelRow 0; + _current = lnbCurSelRow _CT_LISTNBOX; + _color = _CT_LISTNBOX lnbColor [_current,0]; + _CT_LISTNBOX lnbSetColor [ [_current,1], [(_color select 0)/2,0,0,1] ]; + _CT_LISTNBOX lnbDeleteColumn 0; + _CT_LISTNBOX lnbDeleteRow 1; + sleep 1; + lnbClear _CT_LISTNBOX;//Clear all items but control still remains just invisible. + }; + $/Code$ + A combined use of both invisible and visible data processing commands alive the Control. - Boolean + Nothing - Nothing + - sort + menuSetValue - Attempts to sort given array either in ascending ( true ) or descending ( false ) order. All array elements should be one of the following types: - String - array of strings (["a","b","c"...]) - Number - array of numbers ([1,2,3...]) - Array - array of subarrays ([["a",1,2],["b",3,4],["c",5,6]...]). Subarrays should be of the same structure. Subarray elements other than String or Number will be ignored during sorting. - Mixed arrays (["a",1,[true]...]) are not supported and results are undefined. + Sets new value into menu entry on given path. - https://community.bistudio.com/wiki/sort + https://community.bistudio.com/wiki/menuSetValue - Array sort Boolean + menuSetValue Array - array sort order + menuSetValue [idc, path, value] - $Code$_arr = [5.21725,1.30859,4,5.03028,1]; - _arr sort true ; - hint str _arr; //[1,1.30859,4,5.03028,5.21725]$/Code$ - - $Code$_dev = ["ja","pa","pa","tram","tara"]; - _dev sort false ; - hint str _dev; //["tram","tara","pa","pa","ja"]$/Code$ - - $Code$#define ASC true - #define DESC false - _scores = [[123,"bob",15],[123,"bill",20],[200,"dave",21],[200,"steve",11]]; - _scores sort DESC; - hint str _scores; //[[200,"steve",11],[200,"dave",21],[123,"bob",15],[123,"bill",20]]$/Code$ - - $Code$// Sort buildings by distance and return position of the most distant building: - _buildings = player nearObjects ["Land_Cargo_Patrol_V1_F", 500]; - _buildings = _buildings apply { [_x distance player, _x] }; - _buildings sort false ; - hint format [ - "Most distant building is at %1, distance %2 m", - getPos (_buildings select 0 select 1), - round (_buildings select 0 select 0) - ];$/Code$ - + undefined / undefined - (April 16, 2015) - The algorithm for sorting subarrays: compare 1st element, if equal compare 2nd, if equal compare 3rd...etc. - Nothing + Nothing + - soundVolume + or - Check current sound volume (set by fadeSound ). + Returns true only if one or both conditions are true. In case of the alternative syntax, lazy evaluation is used (if left operand is true, evaluation of the right side is skipped completely). + Identical to: a || b - https://community.bistudio.com/wiki/soundVolume + https://community.bistudio.com/wiki/or - soundVolume + Boolean or Boolean + + Boolean or Code - soundVolume + a or b + + a or b - $Code$_vol = soundVolume$/Code$ + $Code$if ((OBJ1) or (_enemycount == 0)) then { hint "you win !"}$/Code$ + + $Code$if (( count _array == 0) or {(_array select 0) != player }) then { hint "It works! Without lazy evaluation it would throw an error if array was empty."}$/Code$ undefined / undefined + (March 29, 2015) + The examples suggest that you can only use two conditions with or. You can use more if you want. + It is not recommended to use a lot of conditions because the check will take longer to complete. - Number + Boolean - Boolean + - spawn + create3DENEntity - Adds given code to the scheduler. Exactly when the code will be executed is unknown, it depends on how busy is the engine and how filled up is the scheduler. Therefore spawn does not wait for the supplied code to finish, instead, spawn returns a Script handle to the scheduler task. scriptDone command can be used to check the code completion. Additional arguments are passed to the code in local variable _this. Since Arma 3 v1.55 the script handle also exists inside the code in _thisScript variable. + Create new Eden Entity. Used for creating individual entities; to create a composition (e.g., infantry squad), use create3DENComposition. + This is the only way how to add new editable entities to Eden Editor scenario. Other 'create' commands like createVehicle or createUnit will still work, but the resulting entity won't be editable. - https://community.bistudio.com/wiki/spawn + https://community.bistudio.com/wiki/create3DENEntity - Any_Value spawn Code + create3DENEntity Array + + Group create3DENEntity Array - arguments spawn code + create3DENEntity [mode, class, position, ] + + group create3DENEntity [mode, class, position, ] - $Code$_handle = [] spawn { player globalChat "Hello world!"};$/Code$ + $Code$dude1 = create3DENEntity ["Object","B_Soldier_F", screenToWorld [0.5,0.5]];$/Code$ - $Code$// There is no guarantee that spawned scripts will be executed in the same order they spawned: - for "_i" from 0 to 100 do - { - _null = _i spawn - { - diag_log _this; - }; - }; - // // Result: 51,1,2...49,50,0,52,53...100$/Code$ + $Code$dude2 = ( group dude1) create3DENEntity ["Object","B_Soldier_AR_F", screenToWorld [0.5,0.5]];$/Code$ + + $Code$myMarker = create3DENEntity ["Marker","mil_warning", position player ];$/Code$ + + $Code$mytrigger = create3DENEntity ["Trigger","EmptyDetectorArea10x10", position player ];$/Code$ undefined / undefined - (5 March, 2009) - spawn cannot call other local functions on the same scope as itself. - It can, however, call other global functions: - $Code$_addOne = {TST=TST+1}; - TST_addOne = {TST=TST+1}; - _add = { - TST=TST+1; - player sideChat format ["added: %1",TST]; - [] call _addOne; - player sideChat format ["called local: %1",TST]; - [] call TST_addOne; - player sideChat format ["called global: %1",TST]; - }; - TST=0; - [] call _add; - [] spawn _add;$/Code$ - The call of _addOne from the spawned function does not do anything. - - (October 21, 2014) - spawn requires a script handle when used in the 2D editor. (A3) - In scripts and in the debug console, it is not required, but very useful for keeping track of running scripts. Having a script handle also makes it easy to terminate scripts at any time. - Since spawn creates a new scheduled environment, having an excess of open threads can make the scheduler queue extremely long, significantly increasing the execution time of each thread. (it takes an extremely large amount of threads, though) + (March 29, 2016) + The classnames for triggers can be found in the config class CfgNonAIVehicles - (August 25, 2015) - If you want to call a local function which has NOT been created inside a spawned function, then do this: - $Code$_fncOne = { systemChat"This is _fncOne" }; _fncTwo = { call (_this select 0) }; [_fncOne] spawn _fncTwo;$/Code$ + (June 14, 2016) + Mode can also be "Logic". Not sure if it's a replacement for "System" or a it's a completely separate mode. - Script_Handle + EdenEntity - EdenEntity + - speaker + enableStamina - Returns the speaker of a person. + Enable/disable stamina system - https://community.bistudio.com/wiki/speaker + https://community.bistudio.com/wiki/enableStamina - speaker Object + Object enableStamina Boolean - speaker person + unit enableStamina enabled - $Code$speaker player$/Code$ + $Code$player enableStamina true;$/Code$ - undefined / undefined + local / global - String + Nothing + - speed + ctrlSetBackgroundColor - Object speed (in km/h). Returns relative speed of given object along Y axis. An equivalent to: 3.6 * ( velocityModelSpace _obj select 1) + Sets background color of given control. - https://community.bistudio.com/wiki/speed + https://community.bistudio.com/wiki/ctrlSetBackgroundColor - speed Object + Control ctrlSetBackgroundColor Array - speed object + control ctrlSetBackgroundColor color - $Code$if ( speed _truck1 = 100) then { hint "You're going too fast!"};$/Code$ + $Code$_control ctrlSetBackgroundColor [1, 0, 0, 1]$/Code$ undefined / undefined + (May 10, 2017) + According to https://feedback.bistudio.com/T78904 + This definetly doesn't work with RscButton's. \br + According to ( https://resources.bisimulations.com/wiki/ctrlSetBackgroundColor ) this "Only affects Comboboxes, Static Text, Structured Text or Maps. " - Number + Nothing + - speedMode + commandTarget - Returns speed mode of the group, which can be any of the following: - "LIMITED" - "NORMAL" - "FULL" + Order the given unit(s) to target the given target (via the radio). Command given to the player, puts a red square with words Target and Distance on player's HUD at target location. If player in vehicle and has radar facilities, it also adds target marker to the radar. - https://community.bistudio.com/wiki/speedMode + https://community.bistudio.com/wiki/commandTarget - speedMode Object/Group + Object commandTarget Object - speedMode groupName + unitName commandTarget target - $Code$_grpspeed1 = speedMode grp1$/Code$ + $Code$_ESoldier1 commandTarget _WSoldier1;$/Code$ + + $Code$player commandTarget bob;$/Code$ - undefined / undefined + local / global - String + Nothing + - splitString + visibleScoretable - An SQF version of C++ strtok. Splits given string str into an array of tokens according to given delimiters. In addition, if empty string "" is used for delimiters, str is split by each character. + Checks whether the score table is visible. - https://community.bistudio.com/wiki/splitString + https://community.bistudio.com/wiki/visibleScoretable - String splitString String + visibleScoretable - str splitString delimiters + visibleScoretable - $Code$_str = "- This, is a sample string." splitString "-,. "; // ["This","is","a","sample","string"] - _str joinString " "; // "This is a sample string"$/Code$ - - $Code$"\A3\ui_f\data\map\vehicleicons\iconLogic_ca.paa" splitString "\."; - // ["A3","ui_f","data","map","vehicleicons","iconLogic_ca","paa"]$/Code$ - - $Code$"1:2:3" splitString ":"; // ["1","2","3"]$/Code$ - - $Code$["test","test"] joinString toString [12345] splitString toString [12345]; // ["test","test"]$/Code$ - - $Code$"Japa is the best!" splitString "" joinString " "; // "J a p a i s t h e b e s t !"$/Code$ - - $Code$_cmd = currentMagazineDetail player ; //"9mm 16Rnd Mag(13/16)[id/cr:10000011/0]" - _cmd splitString "([ ]/:)"; //["9mm","16Rnd","Mag","13","16","id","cr","10000011","0"]$/Code$ - - $Code$// Remove all \r\n from file: - loadFile "somefile.txt" splitString toString [13,10] joinString " "$/Code$ + $Code$_visible = visibleScoretable ;$/Code$ undefined / undefined - (May 17, 2016) - This command is unreliable/broken when it comes to some non-ASCII characters (as of Arma 3 1.58): - $Code$"Mörser" splitString "" - - ["M"," "," ","r","s","e","r"] - "Mörser" splitString "ö" - - ["M","rser"] - "Mörser" splitString "ä" - - ["M"," rser"]$/Code$ - - (October 17, 2016) - This commands works only with ASCII chars, any chars with codes 127, also used in different languages, will be converted to [" ", " "]. Use toArray to preserve special characters: - $Code$_spaced = toArray "Mörser" apply { toString [_x]} joinString " "; // M ö r s e r$/Code$ - Array + Boolean + - sqrt + currentMagazine - Returns square root of x. + Returns class name of currently loaded vehicle's magazine. - https://community.bistudio.com/wiki/sqrt + https://community.bistudio.com/wiki/currentMagazine - sqrt Number + currentMagazine Object - sqrt x + currentMagazine vehicle - $Code$_sq = sqrt 9; // Result is 3$/Code$ + $Code$_magazineClass = currentMagazine player ;//Example: "30Rnd_545x39_AK"$/Code$ undefined / undefined - (18:05, 24 August 2014 (EST)) - Alternatively use "x^0.5" or "x^(1/2)". $Code$_sq = 9^0.5; //Result is 3 - _sq = 9^(1/2); //Result is 3$/Code$ - You can use this method to get any root. - Cubed root = x^(1/3) or x^0.333[repeating]. - Root 4 = x^(1/4) or x^0.25. + (October 4, 2010) + See notes of currentWeapon. - Number + String + - squadParams + ctrlSetFontP - Returns data about squad of given unit loaded from squad.xml. - All items in returned array are String. + Sets P font of given HTML control or its size. - https://community.bistudio.com/wiki/squadParams + https://community.bistudio.com/wiki/ctrlSetFontP - squadParams Object + Control ctrlSetFontP String/Number - squadParams unit + control ctrlSetFontP fontOrSize - $Code$_info = squadParams player ;$/Code$ + $Code$_control ctrlSetFontP "TahomaB"$/Code$ + + $Code$_control ctrlSetFontP 0.05$/Code$ - global / undefined + undefined / undefined - (July 19, 2015) - Returns an empty array in singleplayer. - Array + Nothing + - stance + lockIdentity - Returns the stance of the given unit. It can be one of: - "STAND" - "CROUCH" - "PRONE" - "UNDEFINED" (for example, swimming) - "" (on non-person object ) + Locks the identity of a person. This will disable default identity. - https://community.bistudio.com/wiki/stance + https://community.bistudio.com/wiki/lockIdentity - stance Object + lockIdentity Object - stance unit + lockIdentity unit - $Code$if ( stance player == "STAND") then { hint "I am standing!"};$/Code$ + $Code$_success = lockIdentity player;$/Code$ - global / undefined + undefined / undefined - String + Boolean + - startLoadingScreen + addItemCargo - Shows loading screen with the given text, using the given resource. While loading screen is shown, simulation and scene drawing is disabled, user control is disabled, mouse cursor is hidden, scripts run at full speed. The loading screen does not end by itself and needs endLoadingScreen command, so make sure there is one at the end of loading operation. - NOTE: The game simulation is disabled during Loading Screen operation (at least in SP), therefore any use of sleep command will pause the game indefinitely. If you have to "sleep", use uiSleep - By default (if custom resource is not provided) startLoadingScreen will use "RscDisplayNotFreeze" resource. If you are using custom resource (could be also defined in description.ext ), the following resource's controls are supported by the engine: - idc = 101; - text (type = 0;) or picture (type = 48;). The text will be set to the text provided by the command param. - idc = 103; - progress (type = 8;) or animated texture (type = 45;). This control indicates global hardcoded mission loading progress and is useless after mission is loaded. - idc = 104; - progress (type = 8;). This control's progress is initially set to 0 and can be manipulated with progressLoadingScreen command. + Creates new items and stores them in given container. Works with items, weapons and magazines. For global variant see addItemCargoGlobal - https://community.bistudio.com/wiki/startLoadingScreen + https://community.bistudio.com/wiki/addItemCargo - startLoadingScreen Array + Object addItemCargo Array - startLoadingScreen [text, resource] + box addItemCargo [item, count] - $Code$startLoadingScreen ["Loading My Mission, please wait..."];$/Code$ - - $Code$startLoadingScreen ["Can't skip loading time...", "MyLoadingRsc"];$/Code$ - - $Code$startLoadingScreen ["Loading My Mission"]; - //Batch of code - //Batch of code - //Batch of code - progressLoadingScreen 0.5; - //Batch of code - //Batch of code - //Batch of code - endLoadingScreen ;$/Code$ + $Code$supplyBox addItemCargo ["optic_ARCO", 10];$/Code$ - undefined / undefined + local / local - (July 15, 2009) - As it stops simulation as well as scene drawing, be sure not to put any sleep (or waitUntil if you are checking for in-game changes ; waitUntil for var initialization or script loading is ok) command between startLoadingScreen and endLoadingScreen. - - (January 18, 2010) - edit 10:15 : Whatever transparence you define in your own resource, there will be a black screen to cache loading. - It's up to you to choose a nice blue background :-) - Resource has to be defined in description.ext ; it must NOT be defined as RscTitles ! Here is an example : - Details anzeigen - $Code$ - // basic defines - // - class RscText - { - type = 0; - idc = -1; - x = 0; - y = 0; - h = 0.037; - w = 0.3; - style = 0x100; - font = Zeppelin32; - SizeEx = 0.03921; - colorText[] = {1,1,1,1}; - colorBackground[] = {0, 0, 0, 0}; - linespacing = 1; - }; - class RscPicture - { - access=0; - type=0; - idc=-1; - style=48; - colorBackground[]={0,0,0,0}; - colorText[]={1,1,1,1}; - font="TahomaB"; - sizeEx=0; - lineSpacing=0; - text=""; - }; - class RscLoadingText : RscText - { - style = 2; - x = 0.323532; - y = 0.666672; - w = 0.352944; - h = 0.039216; - sizeEx = 0.03921; - colorText[] = {0.543,0.5742,0.4102,1.0}; - }; - class RscProgress - { - x = 0.344; - y = 0.619; - w = 0.313726; - h = 0.0261438; - texture = "\ca\ui\data\loadscreen_progressbar_ca.paa"; - colorFrame[] = {0,0,0,0}; - colorBar[] = {1,1,1,1}; - }; - class RscProgressNotFreeze - { - idc = -1; - type = 45; - style = 0; - x = 0.022059; - y = 0.911772; - w = 0.029412; - h = 0.039216; - texture = "#(argb,8,8,3)color(0,0,0,0)"; - }; - // - // the loading screen itself - // - class Harrier_loadingScreen - { - idd = -1; - duration = 10e10; - fadein = 0; - fadeout = 0; - name = "loading screen"; - class controlsBackground - { - class blackBG : RscText - { - x = safezoneX; - y = safezoneY; - w = safezoneW; - h = safezoneH; - text = ""; - colorText[] = {0,0,0,0}; - colorBackground[] = {0,0,0,1}; - }; - class nicePic : RscPicture - { - style = 48 + 0x800; // ST_PICTURE + ST_KEEP_ASPECT_RATIO - x = safezoneX + safezoneW/2 - 0.25; - y = safezoneY + safezoneH/2 - 0.2; - w = 0.5; - h = 0.4; - text = "img\nicePic.paa"; - }; - }; - class controls - { - class Title1 : RscLoadingText - { - text = "$STR_LOADING"; // "Loading" text in the middle of the screen - }; - class CA_Progress : RscProgress // progress bar, has to have idc 104 - { - idc = 104; - type = 8; // CT_PROGRESS - style = 0; // ST_SINGLE - texture = "\ca\ui\data\loadscreen_progressbar_ca.paa"; - }; - class CA_Progress2 : RscProgressNotFreeze // progress bar that will go reverse - { - idc = 103; - }; - class Name2: RscText // the text on the top-left - { - idc = 101; - x = 0.05; - y = 0.029412; - w = 0.9; - h = 0.04902; - text = ""; - sizeEx = 0.05; - colorText[] = {0.543,0.5742,0.4102,1.0}; - }; - }; - }; - $/Code$ - - (February 19, 2015) - Based on what Lou Montana has previously said, the simulation does become disabled upon using this command. If you wish to use a delay 'sleep' will not work. The work around would be to use 'uiSleep' - - (November 21, 2015) - In Arma 3 default loading screen has no control do display text. The description of the command now contains information what is needed to create custom loading screen resource. - Nothing + Nothing + - step + isEqualTypeParams - Optionally can set step. If you want to count down, step must be specified, and set negative. Default value is 1. + Compares types of all elements of input array to types of all elements of template array. Similar to isEqualTypeArray however this command is designed for fast validation of functions params, so there are differences: + Input can be anything but will be expected to be an Array, otherwise false is returned + Input array can be longer but not shorter than template array, will return false if shorter + nil could be used in template type array as a wild card to allow any type match - https://community.bistudio.com/wiki/step + https://community.bistudio.com/wiki/isEqualTypeParams - For_Type step Number + Anything isEqualTypeParams Array - for step stepSize + input isEqualTypeParams template - $Code$for "_x" from 20 to 10 step -2 do {..code..}$/Code$ - - + $Code$[1,2, player,"10"] isEqualTypeParams [0,0, objNull,""]; //true + 123 isEqualTypeParams [0,0, objNull,""]; //false + [] isEqualTypeParams [0,0, objNull,""]; //false + [1,2, player ] isEqualTypeParams [0,0, objNull,""]; //false + [1,2, player,"10", true ] isEqualTypeParams [0,0, nil,""]; //true + [1,2, getPos player,"10", true ] isEqualTypeParams [0,0, nil,""]; //true$/Code$ + + undefined / undefined - For_Type + Boolean + - stopEngineRTD + joinAs - Instant engines stop. + Joins the unit to the given group, if position id is available, this one is used. - https://community.bistudio.com/wiki/stopEngineRTD + https://community.bistudio.com/wiki/joinAs - stopEngineRTD Object + Object joinAs Array - stopEngineRTD heli + unit joinAs [group, id] - $Code$stopEngineRTD myHeli$/Code$ + $Code$player joinAs [_group, 4];$/Code$ + + $Code$// To get the position id: + getUnitPositionId = { + private ["_vvn", "_str"]; + _vvn = vehicleVarName _this; + _this setVehicleVarName ""; + _str = str _this; + _this setVehicleVarName _vvn; + parseNumber (_str select [(_str find ":") + 1]) + }; + player joinAs [ createGroup west, 5]; + _id = player call getUnitPositionId; + hint str _id; //5$/Code$ - undefined / undefined + global / global - Array + Nothing + - stop + onDoubleClick - Stop AI unit. Stopped unit will not be able to move, fire, or change its orientation to follow a watched object. It may still change the stance if deemed appropriate (e.g. under fire). Use disableAI to disable specific AI capabilities. + Defines an action performed when the user double clicks on the map. Command receives:,_pos array position,_units array selected units,_shift,_alt bool key state + i + Some Old Editor Command - https://community.bistudio.com/wiki/stop + https://community.bistudio.com/wiki/onDoubleClick - Object stop Boolean + Control onDoubleClick String - unitName stop toggle + map onDoubleClick command - $Code$loon1 stop true$/Code$ - + - local / global + undefined / undefined - (January 6, 2011) - This command appears to be local only. - Nothing + Nothing + - stopped + mapCenterOnCamera - Check if unit is stopped by stop command. + control mapCenterOnCamera boolean syntax enables/disables continuous centering of the main map type control on the camera position. Needs to be executed once. + mapCenterOnCamera control syntax centers mini map type control on camera. The command returns world position of the camera. Needs to be executed each frame (preferably inside onDraw EH). - https://community.bistudio.com/wiki/stopped + https://community.bistudio.com/wiki/mapCenterOnCamera - stopped Object + Control mapCenterOnCamera Boolean + + mapCenterOnCamera Control - stopped unitName + mainmap mapCenterOnCamera enable + + mapCenterOnCamera minimap - $Code$? (stopped _loon1) : hint "Loon1 is stopped"$/Code$ + $Code$//--- Minimap update + (( uiNamespace getVariable "BIS_UAV_DISPLAY") displayCtrl 112410) mapCenterOnCamera true ;$/Code$ undefined / undefined @@ -67311,170 +69144,168 @@ - Boolean + Nothing - Array + - str + canAddItemToUniform - Converts any value into a string by placing " and " around the argument. Since Arma 3 v1.63.137891 this command will correctly escape all " inside a string: - $Code$// Before the fix: - hint str "string "" string"; // "string " string" - invalid string - call compile str "string "" string"; // ERROR - // After the fix: - hint str "string "" string"; // "string "" string" - valid string - call compile str "string "" string"; // OK - $/Code$ - When used on object, object debug name is returned. + Checks if given object can be stored into soldier's uniform. - https://community.bistudio.com/wiki/str + https://community.bistudio.com/wiki/canAddItemToUniform - str Anything + Object canAddItemToUniform String + + Object canAddItemToUniform Array - str value + unit canAddItemToUniform item + + unit canAddItemToUniform [item, count] - $Code$_s = str (2 + 3); - // The value of _s is the string "5"$/Code$ - - $Code$a = []; - ac = 0; - while {ac 5} do { - ac = count a; - a set [ac, format ["Index %1", ac]]; - }; - hintSilent str a; - // Hints all of ["Index 0","Index 1","Index 2","Index 3","Index 4"] including brackets, quotes and commas.$/Code$ + $Code$_item = "HandGrenade"; + _fits = player canAddItemToUniform _item; + if (_fits) then { + player addItemToUniform _item; + } else { + hint "no room!"; + };$/Code$ undefined / undefined - (September 29, 2009) - When applied to a unit, this returns the variable name that was assigned to the unit in the editor. For example, if you have created a playable unit with the name 'thePlayer' then you can use 'str player' to return "thePlayer"; - - (December 5, 2014) - If you try to count string, the added quotations marks are valid characters and will be counted. - - (July 15, 2017) - If you want to make empty string with str that doesn't have any quotation marks, but is still a String you can use text : - $Code$ str ""; // "" - count str ""; // 2 - str text ""; // - count str text ""; // 0$/Code$ - String + Boolean - Boolean + - sunOrMoon + enableSimulation - Returns the sun to moon transition state in range 0...1 + Enable / disable simulation for given entity. - https://community.bistudio.com/wiki/sunOrMoon + https://community.bistudio.com/wiki/enableSimulation - sunOrMoon + Object enableSimulation Boolean - sunOrMoon + entity enableSimulation state - $Code$_transitionState = sunOrMoon ;$/Code$ + $Code$player enableSimulation false;$/Code$ - undefined / undefined + global / local - (September 21, 2014) - Note that at a 0.99 value, the twilight is still quite dark. - Can be tested with : - $Code$//test - onEachFrame - { - systemchat format ["%1",sunOrMoon]; - };$/Code$ + (15 July, 2009) + enableSimulation will "freeze" the unit, including animations, eye blinking, etc ; you cannot switchMove or playMove. + the unit can still take damages and report status and enemies by radio. - (May 18, 2017) - As of Arma 3 1.7, this returns either 1 for sun or 0 for moon. Nothing in between. + (19 July, 2011) + Nou/Jaynus have discovered something quite important about the Arma2 engine: + Orient yourself to the enableSimulation command in ARMA 2: + If simulation is disabled on objects (this enablesimulation false), they do not send updates across the network, drastically reducing traffic across the network by an order of magnitude. What this means in practicality is that it is possible to have huge mission maker created cities with no or negligible impact on mission performance. Mission placed objects is the most common cause of performance woes - so this is huge news, and was previously undocumented, both on the BIS wiki and elsewhere. + There are some quirks. + While an object which has enableSimulation false set on it will take damage, it will not display any animations or damage states until enableSimulation is enabled back onto it. If you want to disable simulation on a unit and then show it as dieing once it is hit or damaged, add an eventhandler onto it which enables simulation on the object when it is hit or killed. Hit handler for best visual, killed handler for best performance. + This discovery will be the basis of a new unit caching script by Jaynus. + This also has importance in a technical sense: bandwith is the most significant factor in mission performance. The lower the server bandwith, the better the performance. + + (9 Sept, 2011) + Objects with disabled simulation are not calculated for lightsources beyond the global light (moon/sun), so any light sources you create will not light them. + + (12 Nov, 2011) + Contrary to Krause's suggestions above, using "this enableSimulation False" on static objects has no effect on a dedicated server's bandwidth usage or FPS (as per current 1.59 Release version). + + (8 May, 2012) + re: Homer. + Yep. That's because this functionality is now part of the basic arma netcode. Pretty nice :) + + (October 3, 2014) + Units with disabled simulation will not be affected by gravity. + + (October 21, 2014) + Units that have been previously subjected to enableSimulation false; or enableSimulationGlobal false; may stay unrecognised for a long time even after simulation was re-enabled, returning objNull as cursorTarget. Force revealing units with reveal command usually solves the problem. For example: $Code${ player reveal _x} forEach allUnits ;$/Code$ + + (May 23, 2015) + After using enableSimulation false or enableSimulationGlobal false on an object, setPos will still update its position across the network in MP. + + (December 2, 2015) + After using enableSimulation false or enableSimulationGlobal false on a vehicle (car, helo), don't forget to re-enable simulation on this vehicle before a player jumps into it. Otherwise, he will be stick in it, with a black screen and no way to escape! + + (February 5, 2016) + cursorTarget returns a null_object for objects with disabled simulation. But you can find them with other commands such nearEntities. + + (September 1, 2016) + Since Arma 3 1.56 the object can also be returned with cursorObject even if the simulation is not enabled - Number + Nothing + - supportInfo + pi - Creates a list of supported operators and type. Each field of array has the format: "x:name" Where x can be: - 't' - type - 'n' - null operator - 'u' - unary operator - 'b' - binary operator. - 'name' is the operator or type name (in case operator, type of input operands is included). - mask parameter can be an empty string, or one of field. In this case, function returns empty array, if operator is not included in the list. Limited wildcard support is available. Type x may be replaced with *, meaning all types. For the mask partial match may be used, like abc*, meaning any operators starting with 'abc' are reported, for example: *:name, t:*, t:name* or *:*. + pi (180 degrees converted to Radians ). - https://community.bistudio.com/wiki/supportInfo + https://community.bistudio.com/wiki/pi - supportInfo String + pi - supportInfo mask + pi - $Code$supportInfo "b:select*"; //Returns ["b:ARRAY select SCALAR","b:ARRAY select BOOL","b:CONFIG select SCALAR"]$/Code$ - - $Code$// Return all available commands: - _commands = supportInfo "";$/Code$ + $Code$_radians = 2*pi + // Result is 6.2830$/Code$ undefined / undefined - (July 22nd, 2012) - With CBA one can create a list of all available SQF commands in the RPT - [supportInfo ""] call cba_fnc_debug; - One can get CBA here. - - (September 24, 2014) - To get the list of all supported commands in Arma 3 one can simply: - $Code${ diag_log _x} forEach supportInfo "";$/Code$ - Array + Number + - suppressFor + backpackMagazines - Force suppressive fire from the unit. + Get array with all magazines from backpack of the given unit. - https://community.bistudio.com/wiki/suppressFor + https://community.bistudio.com/wiki/backpackMagazines - Object suppressFor Number + backpackMagazines Object - unit suppressFor duration + backpackMagazines unit - $Code$_soldier1 suppressFor 10 - // Will force soldier1 to do suppressive fire to known enemies during 10 seconds$/Code$ + $Code$backpackMagazines player ;[ + "Titan AT Missile(1/1)[id/cr:16/0](2x)" + ]$/Code$ undefined / undefined @@ -67482,411 +69313,269 @@ - Nothing + Array + - surfaceIsWater + stance - Returns whether water is at given position. + Returns the stance of the given unit. It can be one of: + "STAND" + "CROUCH" + "PRONE" + "UNDEFINED" (for example, swimming) + "" (on non-person object ) - https://community.bistudio.com/wiki/surfaceIsWater + https://community.bistudio.com/wiki/stance - surfaceIsWater Array + stance Object - surfaceIsWater position + stance unit - $Code$_isWater= surfaceIsWater [1000, 3000];$/Code$ - - $Code$_isWater = surfaceIsWater position player ;$/Code$ + $Code$if ( stance player == "STAND") then { hint "I am standing!"};$/Code$ - undefined / undefined + global / undefined - (4 May, 2012) - Does not work with inland water. Works only with sea water. - Boolean + String + - surfaceNormal + wingsForcesRTD - Returns surface normal on given position. + Returns force produced by wings. - https://community.bistudio.com/wiki/surfaceNormal + https://community.bistudio.com/wiki/wingsForcesRTD - surfaceNormal Array + wingsForcesRTD Object - surfaceNormal position + wingsForcesRTD RTD_helicopter - $Code$_normal = surfaceNormal [300, 500];$/Code$ - - $Code$_normal = surfaceNormal position player ;$/Code$ + $Code$_wingForce = wingsForcesRTD _rtdHelo$/Code$ undefined / undefined + (March 19, 2015) + Advanced helicopter flight model MUST be enabled for this function to work, otherwise it returns an empty array. + Returns a 3x3 two-dimensional array. In the editor while climbing in a little bird, it returned this: + [ [ 0.3993577, 11.72865, -30.21434 ], [ 0.3053164, 11.17272, -30.17695 ], [ 94.33984, 51.3513, -40.4908 ] ] - Array + Array + - surfaceType + getTerrainHeightASL - Returns what surface type is at the given position. - See the spoiler for surface types: - Details anzeigen - A3 1.28: - "#GdtStratisConcrete" - "#GdtStratisDryGrass" - "#GdtStratisGreenGrass" - "#GdtStratisRocky" - "#GdtStratisForestPine" - "#GdtStratisBeach" - "#GdtStratisDirt" - "#GdtVRsurface01" - "#GdtDirt" - "#GdtGrassGreen" - "#GdtGrassDry" - "#GdtSoil" - "#GdtThorn" - "#GdtStony" - "#GdtConcrete" - "#GdtMarsh" - "#GdtBeach" - "#GdtSeabed" - "#GdtDead" - A3 1.66: - "#Default" - "#Water" - "#SurfRoadDirt" - "#SurfRoadConcrete" - "#SurfRoadTarmac" - "#SurfWood" - "#SurfMetal" - "#SurfRoofTin" - "#SurfRoofTiles" - "#SurfIntWood" - "#SurfIntConcrete" - "#SurfIntTiles" - "#SurfIntMetal" - "#SurfWater" - "#TEST_SurfNormal" - "#GdtStratisConcrete" - "#GdtStratisBeach" - "#GdtStratisDirt" - "#GdtStratisSeabedCluttered" - "#GdtStratisSeabed" - "#GdtStratisDryGrass" - "#GdtStratisGreenGrass" - "#GdtStratisRocky" - "#GdtStratisThistles" - "#GdtStratisForestPine" - "#GdtRubble" - "#GdtForestPine" - "#GdtConcrete" - "#GdtSoil" - "#GdtBeach" - "#GdtRock" - "#GdtDead" - "#GdtDirt" - "#GdtDesert" - "#GdtGrassGreen" - "#GdtGrassDry" - "#GdtGrassWild" - "#GdtWeed" - "#GdtWildField" - "#GdtThorn" - "#GdtStony" - "#GdtStonyThistle" - "#GdtMud" - "#GdtMarsh" - "#GdtSeabed" - "#concrete" - "#concrete_out" - "#concrete_inside" - "#dirtrunway" - "#road" - "#floor" - "#floor_inside" - "#carpet_inside" - "#carpet" - "#mud" - "#concrete_hall" - "#stones" - "#cardboard" - "#lino" - "#steel" - "#trash" - "#parquet" - "#sand" - "#metalPlate" - "#woodenFloor" - "#planks" - "#planks_inside" - "#grid" - "#rubble" - "#BuildingRubble" - "#tiling" - "#wavyMetal" - "#GdtVRsurface01" - "#surf_metal" - "#surf_roadconcrete" - "#surf_roaddirt" - "#surf_roadtarmac" - "#surf_rooftiles" - "#surf_rooftin" - "#surf_wood" - "#surfint_concrete" - "#surfint_metal" - "#surfint_tiles" - "#surfint_wood" - "#road_exp" - "#sand_exp" - "#SurfRoadDirt_exp" - "#SurfRoadConcrete_exp" - "#SurfRoadTarmac_exp" - "#SurfTrailDirt_exp" - "#concrete_exp" - "#concrete_in_exp" - "#concrete_hall_exp" - "#floor_exp" - "#floor_in_exp" - "#stones_exp" - "#planks_in_exp" - "#planks_exp" - "#softwood_in_exp" - "#steel_exp" - "#metalPlate_exp" - "#metalPlatePressed_exp" - "#metalPlate_in_exp" - "#grid_exp" - "#wavyMetal_exp" - "#carpet_exp" - "#carpet_in_exp" - "#mat_in_exp" - "#mud_exp" - "#straw_exp" - "#cardboard_exp" - "#lino_in_exp" - "#lino_exp" - "#roof_tiles_exp" - "#trash_exp" - "#rubble_exp" - "#BuildingRubble_exp" - "#GdtGrassShort" - "#GdtGrassTall" - "#GdtGrassLong" - "#GdtVolcanoBeach" - "#GdtRedDirt" - "#GdtAsphalt" - "#GdtField" - "#GdtForest" - "#GdtVolcano" - "#GdtCliff" + Returns the terrain height above the sea for the given position. - https://community.bistudio.com/wiki/surfaceType + https://community.bistudio.com/wiki/getTerrainHeightASL - surfaceType Array + getTerrainHeightASL Position2D/Position3D - surfaceType position + getTerrainHeightASL position - $Code$_surface = surfaceType [4500, 4500];$/Code$ + $Code$_height = getTerrainHeightASL ( position player );$/Code$ - $Code$_surface = surfaceType position player ;$/Code$ + $Code$_height = getTerrainHeightASL [5213,3245];$/Code$ + + $Code$_seadepth = abs ( getTerrainHeightASL getPos player ); // sea depth at players position;$/Code$ undefined / undefined - (February 05, 2010) - In ArmA 2 returned value is "#UTGRASS" for natural surface and "#UTCONCRETE" for urban surface. - - (December 16, 2006) - Only seems to return either "#GRASSSOUTH" or "#GRASSGENERAL", even when you're in a building or in water. - - (December 30, 2006) - Another returned value is "#SANDGENERAL". However, when providing an exact [x,y] position the "surfaceType" function seems to return the general surface type of the environment rather than the exact type on that given position. + (June 6, 2017) + This command can usefully return the depth of water at the given position when in water. Note that the number it returns is the depth, albiet expressed as a negative number. Use abs to always return a positive number. See example 3 - String + Number + - swimInDepth + removeAllMusicEventHandlers - Sets the target depth level for swimming soldier. Depth should be a negative number. + Removes all music track event handlers of given type. - https://community.bistudio.com/wiki/swimInDepth + https://community.bistudio.com/wiki/removeAllMusicEventHandlers - Object swimInDepth Number + removeAllMusicEventHandlers String - unit swimInDepth value + removeAllMusicEventHandlers type - $Code$soldier swimInDepth -20;$/Code$ + $Code$removeAllMusicEventHandlers "MusicStart"$/Code$ - $Code$bob swimInDepth -10; - bob doMove ASLToAGL getPosASL player ;$/Code$ + $Code$removeAllMusicEventHandlers "MusicStop"$/Code$ undefined / undefined - (June 13, 2017) - Doesn't work with animals. - Nothing + Nothing + - switchAction + posScreenToWorld - When used on a person, the given action is started immediately (there is no transition). Use switchmove "" to switch back to the default movement if there is no transition back, otherwise the person may be stuck. + Convert screen coordinates in map to world coordinates. - https://community.bistudio.com/wiki/switchAction + https://community.bistudio.com/wiki/posScreenToWorld - Object switchAction String + Control posScreenToWorld Array - soldier switchAction action + map posScreenToWorld [x, y] - $Code$soldierOne switchAction "SitDown"$/Code$ + $Code$_WorldCoord = _Control posScreenToWorld _ScreenCoord$/Code$ + + $Code$_WorldCoord = _Control posScreenToWorld [_x,_y]$/Code$ undefined / undefined + (April 7, 2007) + Notes: + You can get the screen coordinates by the UI Event Handlers onMouseButtonDown, onMouseButtonUp, onMouseButtonClick, onMouseButtonDblClick. + The return Array is in 2-D, you can use it with all set-position commands. + _x = returnArray select 0; + _y = returnArray select 1; - Nothing + Array + - switchGesture + magazinesAmmoCargo - When used on a person,the given move is started immediately (there is no transition). + Returns an array of subarrays with the type names and ammo left of all the vehicle's cargo or container magazines. - https://community.bistudio.com/wiki/switchGesture + https://community.bistudio.com/wiki/magazinesAmmoCargo - Object switchGesture String + magazinesAmmoCargo Object - soldier switchGesture moveName + magazinesAmmoCargo vehicle - $Code$soldierOne switchGesture "Wave";$/Code$ + $Code$magazinesAmmoCargo vehicle player ;$/Code$ + + $Code$magazinesAmmoCargo uniformContainer player ;[ + ["30Rnd_65x39_caseless_mag",30], + ["30Rnd_65x39_caseless_mag",30], + ["Chemlight_green",1] + ]$/Code$ undefined / undefined - (August 31, 2010) - Rpt says "Not implemented" as of OA 1.54. - Nothing + Array + - switchableUnits + setWaypointCompletionRadius - Returns a list of playable units available for switching to. Command is relative to the client on which it is executed and will only show playable units for the same side as player 's group + player himself. The playableUnits command on the other hand will show all playable units regardless of the side. Exception is SP, where playable units from all sides will be accessible via this command. Dead units are automatically removed from the resulting array. Playable units that are already occupied by other human players will also not show in the results. - NOTE that in Multiplayer, switchableUnits are only available when respawn type is set to SIDE or GROUP. In all other cases it is an empty array []. + The completion radius allows units to call the waypoint completed once they are inside of the given circle. - https://community.bistudio.com/wiki/switchableUnits + https://community.bistudio.com/wiki/setWaypointCompletionRadius - switchableUnits + Array setWaypointCompletionRadius Number - switchableUnits + waypoint setWaypointCompletionRadius radius - + $Code$[grp, 2] setWaypointCompletionRadius 30;$/Code$ + - undefined / local + undefined / undefined - (July 06, 2011) - On dedicated server this command returns empty array. + (29 January 2010‎, 14:12) + The completion radius is currently important for units moving in the Combat mode. + With default completion radius = 0 the leader always finishes in the exact location of the waypoint. + By providing a completion radius you allow him to plan his road to a cover nearby instead. + This does not necessarily mean the waypoint is complete once they are inside of the circle. + The way it works now it is complete once unit is inside and does not think it would be reasonable to move any closer. - Array + Nothing + - switch + configSourceAddonList - Creates a switch type that can be used inside a switch do -block + Returns an array of addons ( CfgPatches ) in which the given config class is defined. - https://community.bistudio.com/wiki/switch + https://community.bistudio.com/wiki/configSourceAddonList - switch Anything + configSourceAddonList Config - switch arg + configSourceAddonList config - $Code$_mySwitch = switch "Test"; - _mySwitch do {/*Something*/};$/Code$ - - $Code$switch (_a) do { case 1 : { /*...code...*/ }; case 2 : { /*...code...*/ }; default { /*...code...*/ }; }; switch (_condition) do { - case 1: { hint "1" }; - case 2: { hint "2" }; - default { hint "default" }; - }; switch (_condition) do { - case "string1"; - case "string2": { hint "string1 or string2" }; - case "string3"; - case "string4": { hint "string3 or string4" }; - default { hint "default" }; - };$/Code$ + $Code$_addons = configSourceAddonList ( configFile "CfgVehicles" "Man"); + hint str _addons; // ["A3_Data_F","A3_Characters_F","A3_Data_F_Curator","A3_Air_F_Heli"]$/Code$ undefined / undefined @@ -67894,248 +69583,301 @@ - Switch_Type + Array + - switchCamera + tvText - Switch camera to given vehicle / camera. Mode is one of: - "INTERNAL" : 1st person - "GUNNER" : optics / sights - "EXTERNAL" : 3rd person - "GROUP" : group - "CARGO" : same as "INTERNAL" - If you switch to a unit in a vehicle, this command uses the correct turret. Control over the unit is not given to the player. Use selectPlayer or a combination of switchCamera and remoteControl to achieve this. + Returns shown text in the item on given path. IDC means id of parent Tree View. - https://community.bistudio.com/wiki/switchCamera + https://community.bistudio.com/wiki/tvText - Object switchCamera String + tvText Array - switchCamera Object + Control tvText Array - target switchCamera mode + tvText [idc, path] - switchCamera target + control tvText path - $Code$player switchCamera "Gunner";$/Code$ + $Code$tvText [101, [0]];$/Code$ - $Code$vehicle player switchCamera "External";$/Code$ + $Code$_ctrl tvText [0,0,0];$/Code$ undefined / undefined - (May 16, 2015) - Force top down view: $Code$cam = "Land_HandyCam_F" createVehicleLocal [0,0,0]; - cam hideObject true ; - cam attachTo [ player, [0,0,10]]; - cam setVectorUp [0,0.99,0.01]; - cam switchCamera "Internal"; - findDisplay 46 displayAddEventHandler ["MouseButtonDown", { - if (_this select 1 == 0) then { - player forceWeaponFire [ currentMuzzle player, currentWeaponMode player ]; - }; - false - }]; - findDisplay 46 displayAddEventHandler ["KeyDown", { - if (_this select 1 in actionKeys "ReloadMagazine") then { - reload player ; - }; - false - }];$/Code$ + (Sep 11 2014) + (A3 1.28)tv command family overview + $Code$ + //tv command family available for CT_TREE (type 12) + private ["_count","_current","_data","_text","_value","_pic"]; + _CT_TREE tvAdd [ [],"Parent_A"]; + _CT_TREE tvAdd [ [0],"Child_A"]; + _CT_TREE tvAdd [ [0,0],"Grandchild_A"]; + _CT_TREE tvAdd [ [],"Parent_B"]; + _CT_TREE tvAdd [ [1],"Child_B"]; + _count = _CT_TREE tvCount []; //return 2 + _CT_TREE tvSetCurSel [0,0,0]; //select grandchild_A + _current = tvCurSel _CT_TREE; //return [0,0,0] + _CT_TREE tvSetData [_current,"I'm grandchild_A"]; + _data = _CT_TREE tvData _current; // "I'm grandchild_A" + _text = _CT_TREE tvText _current; //"Grandchild_A" + _CT_TREE tvSetValue [_current,14]; + _value = _CT_TREE tvValue _current; // 14 + _CT_TREE tvSetPicture [_current, getText ( configFile "CfgWeapons" "optic_NVS" "picture")]; + _pic = _CT_TREE tvPicture _current; + _CT_TREE tvExpand [1]; + _CT_TREE tvSort [[], false ]; + _CT_TREE tvSortByValue [[], false ]; + _CT_TREE tvDelete [0,0]; //remove child_b + tvClear 12; + _CT_TREE tvCollapse []; + $/Code$ - Nothing - Nothing + String - String + - switchLight + animate - Controls whether a lamp is lit or not. For working with CfgNonAIVehicles class "StreetLamp" only. + Activates given object animation. Animation is defined in CfgModels Animations class of model.cfg or another model config. Since Arma 3 v1.65.138459 speed of animation can be altered with coefficient. + To animate door of the house from example below: house animate ["Door_1_rot", 1]; + class Animations + { + class Door_1_rot + { + type = rotation ; + source = Door_1_source ; + selection = Door_1 ; + axis = Door_1_axis ; + memory = 1 ; + minValue = 0.1 ; + maxValue = 1 ; + angle0 = 0 ; + angle1 = ( rad 110 ); + }; + class Door_Handle_1_rot_1 + { + type = rotation ; + source = Door_1_handle_source ; + selection = Door_Handle_1 ; + axis = Door_Handle_1_axis ; + memory = 1 ; + minValue = 0 ; + maxValue = 0.1 ; + angle0 = 0 ; + angle1 = ( rad - 50 ); + }; + }; + Since model.cfg is not always available for reference, most animation names could also be obtained from animationNames command. Class names listed in CfgVehicles AnimationSources bound to "Proxy" controller can also be animated with animate command (see createVehicle/vehicles ): offroad animate ["HideBackpacks", 0]; + It is recommended that animateSource command is used instead of animate whenever is possible, as it is more efficient and optimised for MP + Mixing animateSource command with animate command to animate the same part may produce some undefined behaviour - https://community.bistudio.com/wiki/switchLight + https://community.bistudio.com/wiki/animate - Object switchLight String + Object animate Array - lamp switchLight mode + objectName animate [animationName, phase, speed] - $Code$( object 12345) switchLight "off"$/Code$ + $Code$_building animate ["maindoor", 1];$/Code$ - $Code$nearestObject [player, "Streetlamp"] switchLight "OFF"$/Code$ + $Code$_building animate ["Door_1_rot", 1, true ];$/Code$ - $Code$if ( count allMissionObjects "StreetLamp" == 0) then { - hint "Objects compatible with 'switchLight' are not found."; - } else { - hint "'switchLight' compatible objects are found!"; - };$/Code$ + $Code$// Create Offroad and add flashing police light bar: + offroad = "C_Offroad_01_F" createVehicle ( player getRelPos [5, 0]); + offroad animate ["HidePolice", 0]; + offroad animate ["BeaconsStart", 1];$/Code$ - undefined / undefined + global / global - (January 23, 2010) - If you want turn street lamp off in ArmA2, the syntax is: - ID959522=position player nearestObject 959522 - ID959522 switchLight "off" + (Aug 2007) + Animations can be used on existing game models such as houses that have doors eg. The general syntax is house animate ["dvere1",1] to 'open' the door and house animate ["dvere1",0] to 'close it'. Whether used on Oem addons, or official ones, an internal working knowledge (via config.cpp) of the model's animated name(s) is required. + 'open' and 'close' are visual perceptions of the state of the model, and are a design decision of the p3d. Open does not, necessarily mean, 1, and close does not mean 0. + '0' and '1' are better seen as FULLY_OFF and FULLY_ON + If a door is initially closed in the model, FULLY_ON, will open it. If it is initialy OPEN visually, in the model, FULLY_ON will close it. + initphase=1; (in config cpp) does not alter open and close meanings, all it does, is, set the model to the 'on' (rather than 'off') state to begin with. Whether on means open or close visually, is a p3d design decision. - (September 16, 2013) - In ArmA3 use setHit instead: - $Code$_lamp = nearestObject [ player, "Lamps_base_F"]; - _lamp setHit ["light_1_hitpoint", 0.97]; //off - _lamp setHit ["light_1_hitpoint", 0]; //on$/Code$ - Switch all lights off in the 500 radius of player: - $Code${ - for "_i" from 0 to count getAllHitPointsDamage _x - 1 do - { - _x setHitIndex [_i, 0.97]; - }; - } - forEach nearestObjects - [ - player, - [ - "Lamps_base_F", - "PowerLines_base_F", - "PowerLines_Small_base_F" - ], - 500 - ];$/Code$ + (June 2011) + Also, to animate the object called "Bar Gate" in ArmA, use the following: $Code$myGate animate ["Bargate",1]$/Code$ to close it, and $Code$myGate animate ["Bargate", 0]$/Code$ to open it. + + (June 21, 2015) + With this command you can switch the offroad police lights on like this : + $Code$_vehicle animate ["BeaconsStart",1];$/Code$ + And switch it off : + $Code$_vehicle animate ["BeaconsStart",0];$/Code$ + + (February 16, 2016) + Aparently "Bargate" was exchainged with "Door_1_rot" + Doesen't work: + $Code$object animate ["Bargate", 0];$/Code$ + Works: + $Code$object animate ["Door_1_rot", 0];$/Code$ + + (March 14, 2016) + To animate bargate use animateSource : + $Code$bargate animateSource ["Door_1_source", 1];$/Code$ + + (November 25, 2017) + For pop-up targets, you can keep the target down (until you tell it to pop up) with: + $Code$target1 animate ["terc", 1];$/Code$ + When you're ready for the target to pop up, you can use: + $Code$target1 animate ["terc", 0];$/Code$ + With this setting, the target will return to its usual behavior of going down when hit and automatically popping back up again. To make the target stay down after being hit, add the following line: + $Code$target1 addEventHandler ["HitPart", {target1 animate ["terc", 1];}];$/Code$ - Nothing + Nothing + - switchMove + commandRadio - When used on a person, the given move is started immediately (there is no transition). Use switchmove "" to switch back to the default movement if there is no transition back, otherwise the person may be stuck. - List of moves in ArmA 2 - List of moves in Armed Assault - List of moves in Operation Flashpoint: Resistance + Sends the audio message to the command radio channel. Must have assigned "ItemRadio" to send or receive the transmission. The message is defined in CfgRadio in the description.ext file or config radio protocol. The transmission will play only on the PC where command was executed. If you need the transmission to play on all computers, you have to execute it globally (see remoteExec ). + Note: When transmitting unit gets killed, transmission will be interrupted, however when receiving unit gets killed, the transmission continues to play. - https://community.bistudio.com/wiki/switchMove + https://community.bistudio.com/wiki/commandRadio - Object switchMove String + Object commandRadio String + + Array commandRadio String - person switchmove movename + unit commandRadio radioName + + [side, identity] commandRadio radioName - $Code$_loon1 switchMove "FXStandDip"$/Code$ + $Code$_soldierOne commandRadio "messageOne";$/Code$ + + $Code$player commandRadio configName selectRandom ("true" configClasses ( configFile "CfgRadio"));$/Code$ + + $Code$[ west, "Base"] commandRadio configName selectRandom ("true" configClasses ( configFile "CfgRadio"));$/Code$ global / local - (March 25, 2007) - In some cases the movement won't stay. I.e. AI hostages that put their hands behind their heads (_hostage switchMove "AmovPercMstpSsurWnonDnon") won't hold their hands up, unless you first use disableAI "autoTarget" on them. They mostly put their hands down because they 'noticed' unknown objects. - - (August 03, 2008) - This command will not cause an AnimChanged or AnimDone event. However, playMove will. + (June 24, 2010) + example: $Code$ _unit commandRadio "SentCmdHide";$/Code$ + radio command from CA_Dubbing config should work - (November 12, 2016) - When using this command on the player unit outside unscheduled UI contexts, it will cause a minor camera glitch for a single frame. - For example, Draw3D and KeyDown are UI contexts and so are not affected by the glitch, but EachFrame and scheduled scripts are not UI contexts and are affected by the glitch. + (December 3, 2016) + To transmit user custom sounds (see Multiplayer_Custom_Sounds_Tutorial ), prefix the full filename including file extension with #. For example if there is a custom user sound file called MySound.ogg, to play it on the radio use: + $Code$ player commandRadio "#MySound.ogg";$/Code$ - Nothing + Nothing - Nothing + - synchronizeObjectsAdd + getRelPos - Add given objects to the unit's list of synchronized objects. + Returns position, which is given distance and relative direction away from original object. - https://community.bistudio.com/wiki/synchronizeObjectsAdd + https://community.bistudio.com/wiki/getRelPos - Object synchronizeObjectsAdd Array + Object getRelPos Array - unit synchronizeObjectsAdd [objects] + object getRelPos [distance, direction] - $Code$_acm = _groupLogic createUnit ["AmbientCombatManager",position player,[],0,"NONE"]; - _acm synchronizeObjectsAdd [player];$/Code$ + $Code$// Find position 100 metres away at player's 3 o'clock: + _relpos = player getRelPos [100, 90];$/Code$ - global / global + global / undefined + getPos vs getRelPos: getRelPos operates similarly to getPos except in getRelPos the direction is calculated 'relative' to the current object direction whereas getPos's direction is from North. Thus while getPos can take a position array as it's starting point, getRelPos requires an object with its own azithmus heading. + + (3 March, 2016) - Nothing + Array + - synchronizeObjectsRemove + triggerAttachedVehicle - Remove given objects from the unit's list of synchronized objects. + Returns vehicle attached to the trigger (for example using triggerAttachVehicle ). + Note: The trigger could be local or remote but the result returned by this command will be for the trigger condition set up locally on the client that executed the command. See createTrigger for more info. - https://community.bistudio.com/wiki/synchronizeObjectsRemove + https://community.bistudio.com/wiki/triggerAttachedVehicle - Object synchronizeObjectsRemove Array + triggerAttachedVehicle Object - unit synchronizeObjectsRemove [objects] + triggerAttachedVehicle trigger - + $Code$return = triggerAttachedVehicle triggerName;$/Code$ + - global / global + global / local - Nothing + Object + - synchronizeTrigger + addMenu - Synchronizes the trigger with zero or more waypoints. + Adds a new menu button. Priority is optional. + i + Some Old Editor Command - https://community.bistudio.com/wiki/synchronizeTrigger + https://community.bistudio.com/wiki/addMenu - Object synchronizeTrigger Array + Control addMenu Array - trigger synchronizeTrigger [waypoint1, waypoint2,] + map addMenu [text,priority] - $Code$_trigger synchronizeTrigger []$/Code$ - - $Code$_trigger synchronizeTrigger [_waypoint1]$/Code$ - - $Code$_trigger synchronizeTrigger [_waypoint1, [_group5, 7], _waypoint3]$/Code$ + $Code$example$/Code$ undefined / undefined @@ -68143,189 +69885,190 @@ - Nothing + Number + - synchronizeWaypoint + removeWeapon - Synchronizes the waypoint with other waypoints. Each waypoint is given as an array [group, index]. + Remove weapon from a unit. The unit must be local to the computer where command is executed. For a global version of this command see removeWeaponGlobal. + Note : It is possible to create invalid combinations with this command (ie, attempting to remove a weapon that a unit does not possess). When doing so, application behaviour is undefined. - https://community.bistudio.com/wiki/synchronizeWaypoint + https://community.bistudio.com/wiki/removeWeapon - Array synchronizeWaypoint Array + Object removeWeapon String - waypoint synchronizeWaypoint [waypoint1, waypoint2,] + unit removeWeapon weapon - $Code$[_group1, 2] synchronizeWaypoint [ [_group2, 3] ];$/Code$ + $Code$player removeWeapon "BAF_L85A2_RIS_SUSAT";$/Code$ + + $Code$An_2 removeWeapon "M240_veh";$/Code$ - undefined / undefined + local / global - (March 31, 2008) - To 'unsynchronize' a waypoint use: Waypoint synchronizeWaypoint [] + (May 27, 2009) + CTD may occur in certain conditions: when shooter is AI and is currently shooting at target in some proximity (tested with M136 on ACE 1.08 and Compact Fix 1.14H+). Even "dropweapon" action may cause CTD with AI. - Nothing + Nothing + - synchronizedObjects + keyName - Return the list of objects synchronized with the given unit. + Returns the name of a button (on the keyboard, mouse or joystick) with the given code. - https://community.bistudio.com/wiki/synchronizedObjects + https://community.bistudio.com/wiki/keyName - synchronizedObjects Object + keyName Number - synchronizedObjects unit + keyName dikCode - $Code$_objects = synchronizedObjects _logic;$/Code$ + $Code$_name = keyName 28; //result is "Enter"$/Code$ - local / undefined + undefined / undefined - This command only returns the LEADER of a vehicle that is synchronized. You have to use the "vehicle" - command to select the actual vehicle. - This command only returns the synchronized objects when used on intelligent objects such as units or - logic objects. All other objects returns an empty array. - In MP this command returns only values when the object is local. otherwise it returns an empty array. - - (February 26, 2015) - When returning the synchronized objects, they are returned in the order that they were placed on the map - - (October 27, 2016) - In Eden you can synchronize both units and their vehicles separately by syncing the gamelogic (or whatever) to the vehicle itself, and then the driver (or whatever other passengers) of the vehicle. To use an entire group, just sync all units within that group to the gamelogic (not just the leader or group icon). By doing this you can execute commands on each unit in a group and just the crew/single unit of a vehicle, or just the vehicle and not the crew, or both the vehicle and the crew. - Array + String + - synchronizedTriggers + taskHint - Returns the list of triggers synchronized with a given waypoint. + Shows info about new, changed or failed task. The text can contain several lines. \n is used to indicate the end of a line. + To maintain Arma 3 visual style, it's recommended to use BIS_fnc_showNotification instead. - https://community.bistudio.com/wiki/synchronizedTriggers + https://community.bistudio.com/wiki/taskHint - synchronizedTriggers Waypoint + taskHint Array - synchronizedTriggers waypoint + taskHint [hintText, [r, g, b, a], icon] - + $Code$taskhint ["Task failed!\nBad job!", [1, 0, 0, 1], "taskFailed"]$/Code$ + undefined / undefined + Here are the BIS colors: + $Code$ + taskHint ["New Task!\nHere's your new task!", [1, 1, 1, 1], "taskNew"]; + taskHint ["Task Assigned!\nDo this now!", [1, 1, 1, 1], "taskCurrent"]; + taskHint ["Task Succeeded!\nGood job!", [0.600000,0.839215,0.466666,1], "taskDone"]; + taskHint ["Task Failed!\nBad job!", [0.972549,0.121568,0,1], "taskFailed"]; + taskHint ["Task Canceled!\nNever mind!", [0.75,0.75,0.75,1], "taskFailed"]; + $/Code$ - Array + Nothing + - synchronizedWaypoints + disableNVGEquipment - Returns the list of waypoints synchronized with a given trigger or waypoint. + Enables or disables transport NV (Night Vision). To disable TI (Thermal Imaging) use disableTIEquipment. - https://community.bistudio.com/wiki/synchronizedWaypoints + https://community.bistudio.com/wiki/disableNVGEquipment - synchronizedWaypoints Object/Waypoint + Object disableNVGEquipment Boolean - synchronizedWaypoints obj + vehicle disableNVGEquipment state - + $Code$myTank disableNVGEquipment true ;$/Code$ + - undefined / undefined + global / global - Array + Nothing + - systemChat + blufor - Types text to the system radio channel. The text will be visible only on the PC where command was executed. If you need the message to show on all computers, you have to execute it globally (see remoteExec ) + Pre-defined variable for the blufor side. + Alias for west. - https://community.bistudio.com/wiki/systemChat + https://community.bistudio.com/wiki/blufor - systemChat String + blufor - systemChat text + blufor - $Code$systemChat "Hello world!";$/Code$ - - $Code$driver vehicle player sideChat "sideChat"; - driver vehicle player globalChat "globalChat"; - driver vehicle player groupChat "groupChat"; - vehicle player vehicleChat "vehicleChat"; - driver vehicle player commandChat "commandChat"; - driver vehicle player customChat [1, "customChat"]; - systemChat "systemChat";$/Code$ + $Code$if ( side player == blufor ) then { + hint "BLUFOR"; + };$/Code$ - undefined / local + undefined / undefined - Nothing + Side + - systemOfUnits + shownGPS - Returns the currently selected system of units. - 0: Metric - 1: Mixed (ground vehicles use Metric / air vehicles use Imperial) - 2: Imperial + Checks if client has GPS reciever enabled in description.ext ( showGPS param) or force enabled with showGPS command. - https://community.bistudio.com/wiki/systemOfUnits + https://community.bistudio.com/wiki/shownGPS - systemOfUnits + shownGPS - systemOfUnits + shownGPS - $Code$_system = systemOfUnits;$/Code$ + $Code$if ( shownGPS ) then { hint "You have GPS reciever enabled"};$/Code$ undefined / undefined @@ -68333,28 +70076,28 @@ - Number + Boolean + - tan + addLiveStats - Tangent of x, argument in Degrees. + Adds score to the Xbox Live Statistics score for the given unit (or the commander unit of the given vehicle). (Also available in OFPE & VBS2) - https://community.bistudio.com/wiki/tan + https://community.bistudio.com/wiki/addLiveStats - tan Number + Object addLiveStats Number - tan x + unit addLiveStats score - $Code$_tangent = tan 45 - // Result is 1$/Code$ + $Code$player addLiveStats 10$/Code$ undefined / undefined @@ -68362,36 +70105,28 @@ - Number + Nothing + - targetKnowledge + ctrlSetForegroundColor - Returns unit's knowledge about target. The returned array includes information whether the target is - known by group - known by the unit - last time the target was seen by the unit - last time the target endangered the unit - target side - position error - target position + Sets foreground color of given control. Color is in format Color. - https://community.bistudio.com/wiki/targetKnowledge + https://community.bistudio.com/wiki/ctrlSetForegroundColor - Object targetKnowledge Object + Control ctrlSetForegroundColor Array - unit targetKnowledge target + control ctrlSetForegroundColor color - $Code$_allInfo = _soldierOne targetKnowledge _jeepOne;$/Code$ - - $Code$_posError = (_soldierOne targetKnowledge _jeepOne) select 5;$/Code$ + $Code$_control ctrlSetForegroundColor [1, 0, 0, 1]$/Code$ undefined / undefined @@ -68399,325 +70134,421 @@ - Array + Nothing + - targets + setSimpleTaskType - Retrives list of given unit targets matching specified filter. If the filter is not specified, all targets are returned. + Attach type to the simple task. See Default Task Types. - https://community.bistudio.com/wiki/targets + https://community.bistudio.com/wiki/setSimpleTaskType - Object targets Array + Task setSimpleTaskType String - unit targets [enemyOnly, maxDistance, sides, maxAge, alternateCenter] + task setSimpleTaskType taskType - $Code$_targets = _unit targets [false, 300, [east,sideEnemy]]; //all targets of east or renegade side in 300m$/Code$ - - $Code$_targets = _unit targets [true, 300]; //enemy targets in 300m$/Code$ - - $Code$_targets = _unit targets []; //all targets$/Code$ + $Code$( currentTask player ) setSimpleTaskType "attack";$/Code$ - global / undefined + undefined / undefined - Array + Nothing + - targetsAggregate + tvDelete - Aggregate candidates. + Removes an item with given Tree View Path from Tree View. The paths of other items on the same branch are updated accordingly and may change. - https://community.bistudio.com/wiki/targetsAggregate + https://community.bistudio.com/wiki/tvDelete - Array targetsAggregate Array + tvDelete Array + + Control tvDelete Array - [speaker, side, unit, place, time] targetsAggregate candidates + tvDelete [idc, path] + + control tvDelete path - $Code$_aggregation = [_this,"","","",""] targetsAggregate _selected;//ca\characters\scripts\reactCore_Full.fsm$/Code$ + $Code$tvDelete [101, [0, 0]];$/Code$ + + $Code$_ctrl tvDelete [0, 0];$/Code$ - undefined / undefined + local / local - - - Array - - - - - targetsQuery - - - Returns sorted array of targets, known to the enquirer (including own troops), where the accuracy coefficient reflects how close the result matches the query. This command could be CPU intensive. - + (Sep 11 2014) + (A3 1.28)tv command fmily overview + $Code$ + //tv command family available for CT_TREE (type 12) + private ["_count","_current","_data","_text","_value","_pic"]; + _CT_TREE tvAdd [ [],"Parent_A"]; + _CT_TREE tvAdd [ [0],"Child_A"]; + _CT_TREE tvAdd [ [0,0],"Grandchild_A"]; + _CT_TREE tvAdd [ [],"Parent_B"]; + _CT_TREE tvAdd [ [1],"Child_B"]; + _count = _CT_TREE tvCount []; //return 2 + _CT_TREE tvSetCurSel [0,0,0]; //select grandchild_A + _current = tvCurSel _CT_TREE; //return [0,0,0] + _CT_TREE tvSetData [_current,"I'm grandchild_A"]; + _data = _CT_TREE tvData _current; // "I'm grandchild_A" + _text = _CT_TREE tvText _current; //"Grandchild_A" + _CT_TREE tvSetValue [_current,14]; + _value = _CT_TREE tvValue _current; // 14 + _CT_TREE tvSetPicture [_current, getText ( configFile "CfgWeapons" "optic_NVS" "picture")]; + _pic = _CT_TREE tvPicture _current; + _CT_TREE tvExpand [1]; + _CT_TREE tvSort [[], false ]; + _CT_TREE tvSortByValue [[], false ]; + _CT_TREE tvDelete [0,0]; //remove child_b + tvClear 12; + _CT_TREE tvCollapse []; + $/Code$ + + + Nothing - Nothing + + + + + + activatedAddons + + + Returns a list of all activated addons. + - https://community.bistudio.com/wiki/targetsQuery + https://community.bistudio.com/wiki/activatedAddons - Object targetsQuery Array + activatedAddons - enquirer targetsQuery [targetIgnore, targetSide, targetType, targetPosition, targetMaxAge] + activatedAddons - $Code$// Return all known targets for player: - _targets = player targetsQuery [ objNull, sideUnknown, "", [], 0];$/Code$ - - $Code$// Prioritise all known OPFOR targets and return targets less than 10 seconds old: - _targets = player targetsQuery [ objNull, east, "", [], 10];$/Code$ + $Code$_addons = activatedAddons ;$/Code$ undefined / undefined + (March 28, 2014) + This command can return a large array, often too large to be diag_log'd or hinted. At the time of writing, my game returned an array with 389 elements. The code below will ignore all the BI addons (they start with a3_) and writes the rest (ie, all your custom addons) to the RPT. + $Code${ if (! (["a3_", _x] call BIS_fnc_inString )) then { diag_log _x;} } forEach activatedAddons ;$/Code$ - Array + Array + - taskAlwaysVisible + deleteGroup - Returns true if the task is flagged to be always visible or false if not. + Destroys the given group. Group must be empty and local to the machine executing command. + NOTE: In Arma 3 you can find out locality of the group with local command, unlike with previous games. However owner and setOwner dont work with groups anywhere. The group will always be local to the client that created it, until the client disconnects, then the group becomes local to the server. + In Arma 3 when last unit leaves a group, the group gets auto deleted. Manually deleting all units from a group however, does not auto delete the empty group. To force the group to get auto-deleted when empty use deleteGroupWhenEmpty - https://community.bistudio.com/wiki/taskAlwaysVisible + https://community.bistudio.com/wiki/deleteGroup - taskAlwaysVisible Task + deleteGroup Group - taskAlwaysVisible task + deleteGroup group - $Code$_isAlwaysVisible = taskAlwaysVisible ( currentTask player );$/Code$ + $Code$deleteGroup _groupname$/Code$ - undefined / undefined + local / global + (December 17, 2006) + The deleteGroup Command does not work when there are living members of in the group. It doesn't error, it simply doesn't do anything. + + (07:50, 10 July 2007 (CEST)) + Living or not doesn't matter - you can't delete the group while it contains any units - even dead ones. It takes few seconds until a dead unit is automatically removed from its group. + + (September 12, 2013) + deleteGroup will only delete local groups even if called by server. Say we have a situation where client creates a group and puts a unit there and later unit dies\gets deleted, server will not be able to delete that empty group until client leaves the game and group ownership switches to server - Boolean + Nothing + - taskChildren + then - Return the child tasks of the specified task. + First or second element of array is executed depending on result of if condition. Result of the expression executed is returned as a result (result may be Nothing ). - https://community.bistudio.com/wiki/taskChildren + https://community.bistudio.com/wiki/then - taskChildren Task + If_Type then Code/Array - taskChildren task + if then else - + $Code$if (a b) then { c = 1 };$/Code$ + + $Code$if (a b) then { + c = 1; + } else { + c = 2; + }; + hint str c;$/Code$ + undefined / undefined + Any variables you declare within the body of an if /then statement (ie between the curly braces) are local to that 'if' statement, and are destroyed at the end of the statement. If you know you want to use the variable outside the 'if' statement, make sure your declare it before the 'if' statement. - Array + Anything + - taskCompleted + getForcedFlagTexture - Return if task is completed. (state Succeeded, Failed or Canceled) + A getter for forceFlagTexture. Forced texture is different from your normal flag texture, which can be retrieved with flagTexture - https://community.bistudio.com/wiki/taskCompleted + https://community.bistudio.com/wiki/getForcedFlagTexture - taskCompleted Task + getForcedFlagTexture Object - taskCompleted task + getForcedFlagTexture object - + $Code$getForcedFlagTexture player ;$/Code$ + undefined / undefined - Boolean + String + - taskCustomData + locationNull - Returns custom data attached to the local task or an empty array if there are no custom data attached. + A non-existing Location. To compare non-existent locations use isNull or isEqualTo : + locationNull == locationNull ; // false + isNull locationNull ; // true + locationNull isEqualTo locationNull ; // true - https://community.bistudio.com/wiki/taskCustomData + https://community.bistudio.com/wiki/locationNull - taskCustomData Task + locationNull - taskCustomData task + locationNull - + $Code$! isNull locationNull ; // false$/Code$ + + $Code$str locationNull ; // No location$/Code$ + + $Code$position locationNull ; // [0,0,0]$/Code$ + undefined / undefined - Array + Location + - taskDescription + enableDebriefingStats - Returns the sub-parts of the task description. The returned Array is in format [Task description, Task title, Task waypoint description]. + enable debrifing score table. - https://community.bistudio.com/wiki/taskDescription + https://community.bistudio.com/wiki/enableDebriefingStats - taskDescription Task + enableDebriefingStats Array - taskDescription task + enableDebriefingStats [left, top, width, height] - $Code$_taskDescArray = taskDescription _task;$/Code$ + $Code$enableDebriefingStats [0.1, 0.1, 0.8, 0.8];$/Code$ undefined / undefined - (November 14, 2014) - Be careful if you want to use this to retrieve the title of a task. - If the task has no description set, then "taskDescription" will only return an array of empty Strings. - Therefor always use setSimpleTaskDescription directly after creating a new task, even if you set the Description to "". - Array + Nothing + - taskDestination + str - Returns the position of the task (as specified by destination parameter in config). + Converts any value into a string by placing " and " around the argument. Since Arma 3 v1.63.137891 this command will correctly escape all " inside a string: + $Code$// Before the fix: + hint str "string "" string"; // "string " string" - invalid string + call compile str "string "" string"; // ERROR + // After the fix: + hint str "string "" string"; // "string "" string" - valid string + call compile str "string "" string"; // OK + $/Code$ + When used on object, object debug name is returned. - https://community.bistudio.com/wiki/taskDestination + https://community.bistudio.com/wiki/str - taskDestination Task + str Anything - taskDestination task + str value - $Code$if (! isNull currentTask player ) then { taskDestination currentTask player }; //return Position ( Array )$/Code$ + $Code$_s = str (2 + 3); + // The value of _s is the string "5"$/Code$ + + $Code$a = []; + ac = 0; + while {ac 5} do { + ac = count a; + a set [ac, format ["Index %1", ac]]; + }; + hintSilent str a; + // Hints all of ["Index 0","Index 1","Index 2","Index 3","Index 4"] including brackets, quotes and commas.$/Code$ undefined / undefined + (September 29, 2009) + When applied to a unit, this returns the variable name that was assigned to the unit in the editor. For example, if you have created a playable unit with the name 'thePlayer' then you can use 'str player' to return "thePlayer"; + + (December 5, 2014) + If you try to count string, the added quotations marks are valid characters and will be counted. + + (July 15, 2017) + If you want to make empty string with str that doesn't have any quotation marks, but is still a String you can use text : + $Code$ str ""; // "" + count str ""; // 2 + str text ""; // + count str text ""; // 0$/Code$ - Array + String + - taskHint + configSourceMod - Shows info about new, changed or failed task. The text can contain several lines. \n is used to indicate the end of a line. - To maintain Arma 3 visual style, it's recommended to use BIS_fnc_showNotification instead. + Returns modDir of the mod that given config class was loaded from. - https://community.bistudio.com/wiki/taskHint + https://community.bistudio.com/wiki/configSourceMod - taskHint Array + configSourceMod Config - taskHint [hintText, [r, g, b, a], icon] + configSourceMod config - $Code$taskhint ["Task failed!\nBad job!", [1, 0, 0, 1], "taskFailed"]$/Code$ + $Code$configSourceMod ( configFile "CfgVehicles" "Heli_Transport_04_base_F"); //Returns "heli"$/Code$ + + $Code$configSourceMod ( configFile "CfgVehicles" "Car"); //Returns "A3"$/Code$ undefined / undefined - Here are the BIS colors: - $Code$ - taskHint ["New Task!\nHere's your new task!", [1, 1, 1, 1], "taskNew"]; - taskHint ["Task Assigned!\nDo this now!", [1, 1, 1, 1], "taskCurrent"]; - taskHint ["Task Succeeded!\nGood job!", [0.600000,0.839215,0.466666,1], "taskDone"]; - taskHint ["Task Failed!\nBad job!", [0.972549,0.121568,0,1], "taskFailed"]; - taskHint ["Task Canceled!\nNever mind!", [0.75,0.75,0.75,1], "taskFailed"]; - $/Code$ - Nothing + String + - taskMarkerOffset + camCommitted - Returns model space position for the task marker + Checks if the conduction of the last camCommit call already finished. - https://community.bistudio.com/wiki/taskMarkerOffset + https://community.bistudio.com/wiki/camCommitted - taskMarkerOffset Object + camCommitted Object - taskMarkerOffset unit + camCommitted camera - $Code$_offset = taskMarkerOffset player ;$/Code$ + $Code$// SQS: + ; create a camera object + _cam = "camera" camCreate [5600,4800,10] + _cam camSetTarget player + _cam cameraEffect ["internal", "BACK"] + _cam camCommit 0 + ; smoothly move the camera to its new position in 6 seconds + _cam camSetPos [5680,4720,20] + _cam camCommit 6 + @ camCommitted _cam + ; proceed$/Code$ undefined / undefined @@ -68725,32 +70556,28 @@ - Array + Boolean + - taskNull + enableDynamicSimulationSystem - A non-existing Task. To compare non-existent tasks use isNull or isEqualTo : - taskNull == taskNull ; // false - isNull taskNull ; // true - taskNull isEqualTo taskNull ; // true + Enables or disables the whole Arma_3_Dynamic_Simulation system - https://community.bistudio.com/wiki/taskNull + https://community.bistudio.com/wiki/enableDynamicSimulationSystem - taskNull + enableDynamicSimulationSystem Boolean - taskNull + enableDynamicSimulationSystem enable - $Code$! isNull taskNull ; // false$/Code$ - - $Code$str taskNull ; // No task$/Code$ + $Code$enableDynamicSimulationSystem true ;$/Code$ undefined / undefined @@ -68758,117 +70585,130 @@ - Task + Nothing + - taskParent + underwater - Return the parent task of the specified task. + Return whether object is fully underwater. From Arma 3 v1.66, this also works for units. - https://community.bistudio.com/wiki/taskParent + https://community.bistudio.com/wiki/underwater - taskParent Task + underwater Object - taskParent task + underwater object - + $Code$_isUnderwater = underwater player ;$/Code$ + + $Code$_isUnderwater = eyePos player select 2 0;$/Code$ + undefined / undefined + (February 2, 2017) + This is still quite buggy and not always reliable. Code in Example 2 is a good alternative. - Task + Boolean + - taskResult + shownPad - Send a result of the task to the task sender. + Checks if client has Notepad enabled. - https://community.bistudio.com/wiki/taskResult + https://community.bistudio.com/wiki/shownPad - taskResult Task + shownPad - taskResult task + shownPad - + $Code$if ( shownPad ) then { hint "You have Notepad enabled."};$/Code$ + undefined / undefined - Array + Boolean + - taskState + daytime - Returns the current state of a task. - Possible return values are: - None - Created - Assigned - Succeeded - Failed - Canceled + Returns the current ingame time in hours. - https://community.bistudio.com/wiki/taskState + https://community.bistudio.com/wiki/daytime - taskState Task + daytime - taskState task + daytime - $Code$tskSomeTask = player createSimpleTask ["NewTask"]; - hint format["Taskstate: %1", taskState tskSomeTask];$/Code$ + $Code$; assumme it is 16:30 + _daytime = daytime + returns 16.5$/Code$ undefined / undefined + (September 23, 2014) + To change daytime To 24 hour format with hours, minutes, and seconds use this: + $Code$// daytime = 1.66046 + _hour = floor daytime ; + _minute = floor (( daytime - _hour) * 60); + _second = floor ((((( daytime ) - (_hour))*60) - _minute)*60); + _time24 = text format ["%1:%2:%3",_hour,_minute,_second]; + //_time24 = 1:39:37$/Code$ + Note: Not perfect method, "12:03:06" will display as "12:3:6", more script needed to remove this. Other methods might exist for basic functionality. - String + Number + - taskType + getBleedingRemaining - Returns the type of the given task + Returns how many seconds injured unit will continue leaving blood trail. If unit damage is 0.1, the return value is 0 and unit doesn't leave any blood trail. Use setBleedingRemaining to set different remaining time. - https://community.bistudio.com/wiki/taskType + https://community.bistudio.com/wiki/getBleedingRemaining - taskType Task + getBleedingRemaining Object - taskType task + getBleedingRemaining unit - $Code$_type = taskType ( currentTask player );$/Code$ + $Code$_bleedingRemaining = getBleedingRemaining _unit;$/Code$ undefined / undefined @@ -68876,36 +70716,29 @@ - String + Number + - teamMemberNull + remove3DENLayer - A non-existent Team Member. To compare non-existent team members use isNull or isEqualTo : - teamMemberNull == teamMemberNull ; // false - isNull teamMemberNull ; // true - teamMemberNull isEqualTo teamMemberNull ; // true + Remove Eden Editor editing layer. - https://community.bistudio.com/wiki/teamMemberNull + https://community.bistudio.com/wiki/remove3DENLayer - teamMemberNull + remove3DENLayer Number - teamMemberNull + remove3DENLayer layerID - $Code$! isNull teamMemberNull ; // false$/Code$ - - $Code$str teamMemberNull ; // NULL - team member$/Code$ - - $Code$if (_teamMember isEqualTo teamMemberNull ) then { - hint "is null member"; - };$/Code$ + $Code$_myLayer = -1 add3DENLayer "Enemy Base"; + remove3DENLayer _myLayer ;$/Code$ undefined / undefined @@ -68913,109 +70746,126 @@ - Team_Member + Boolean + - teamMember + getObjectProxy - Return an agent for given person. + Return the proxy object associated with the given editor object. + i + Some Old Editor Command - https://community.bistudio.com/wiki/teamMember + https://community.bistudio.com/wiki/getObjectProxy - teamMember Object + Control getObjectProxy String - teamMember person + map getObjectProxy object - $Code$_agent = teamMember player ;$/Code$ + $Code$( findDisplay 128 displayCtrl 51) getObjectProxy "_unit_1" + // returns the object 'B 1-1-A:1 (Sean Johnson)'$/Code$ undefined / undefined + classWorks in BIS RTE only? - Team_Member + Object + - teamName + countSide - Return a name of given team. + Count how many units in the given array belong to given side. If the object in passed array is a Group, the leader of the group will be counted. - https://community.bistudio.com/wiki/teamName + https://community.bistudio.com/wiki/countSide - teamName Team_Member + Side countSide Array - teamName team + side countSide arrayName - $Code$_name = teamName _team;$/Code$ + $Code$_num = west countSide list _triggerOne;$/Code$ + + $Code$_numCivPlayable = civilian countSide playableUnits ;$/Code$ - undefined / undefined + global / undefined + (July 4, 2014) + The countSide command will also accept an array of groups. Tested in ARMA 3 v1.22 + + (October 19, 2014) + This command considers captive units as civilians, regardless of their group's side. - String + Number + - teamSwitchEnabled + setVisibleIfTreeCollapsed - Check if Team Switch is currently enabled. - Team Switch is enabled by default. + Sets whether or not the object is visible even if the tree is collapsed. + i + Some Old Editor Command - https://community.bistudio.com/wiki/teamSwitchEnabled + https://community.bistudio.com/wiki/setVisibleIfTreeCollapsed - teamSwitchEnabled + Control setVisibleIfTreeCollapsed Array - teamSwitchEnabled + map setVisibleIfTreeCollapsed [object, visible] - + $Code$_map setVisibleIfTreeCollapsed ["_unit_0", true]$/Code$ + undefined / undefined - Boolean + Nothing + - teamSwitch + deleteSite - Invoke the Team Switch dialog (force it even when conditions are not met). There has to be at least one playable unit for team switch to work, and for this command to work in MP, respawn type in description.ext should be 5 (SIDE). - NOTE: When player switches and leaves behind AI unit, you need to enable "TeamSwitch" AI on it _unit enableAI "TeamSwitch" so that the unit continues with waypoints + Removes the site. + This command is considered deprecated and is no longer supported - https://community.bistudio.com/wiki/teamSwitch + https://community.bistudio.com/wiki/deleteSite - teamSwitch + deleteSite Object - teamSwitch + deleteSite site @@ -69025,27 +70875,28 @@ - Nothing + Nothing + - teamType + save3DENInventory - Returns a type of given team. + Saves current state of entitie's inventory to SQM. - https://community.bistudio.com/wiki/teamType + https://community.bistudio.com/wiki/save3DENInventory - teamType Team_Member + save3DENInventory Array - teamType team + save3DENInventory entities - $Code$_type = teamType _team;$/Code$ + $Code$save3DENInventory [_soldier1,_solider2]$/Code$ undefined / undefined @@ -69053,498 +70904,565 @@ - String + Nothing + - teams + lockedDriver - Return a list of teams in the current mission. + Check whether driver position of the vehicle turret is locked. - https://community.bistudio.com/wiki/teams + https://community.bistudio.com/wiki/lockedDriver - teams + lockedDriver Object - teams + lockedDriver vehicle - $Code$_teams = teams ;$/Code$ - + undefined / undefined - Array + Boolean + - terminate + unitRecoilCoefficient - Terminate (abort) spawned or execVM 'd script. Note : The given script will not terminate immediately upon terminate command execution, it will do so the next time the script is processed by the scheduler. + Returns recoil coefficient of a soldier. - https://community.bistudio.com/wiki/terminate + https://community.bistudio.com/wiki/unitRecoilCoefficient - terminate Script_Handle + unitRecoilCoefficient Object - terminate scriptHandle + unitRecoilCoefficient soldier - $Code$_script = [] execVM "script.sqf"; - sleep 5; - terminate _script; - hint "'script.sqf' has been terminated after 5 seconds";$/Code$ + $Code$_myRecoil = unitRecoilCoefficient player$/Code$ undefined / undefined + (September 7, 2013) + If the unit doesn't exist / is null, -1 is returned. - Nothing + Number + - terrainIntersectASL + setMarkerText - Checks for intersection of terrain between two ASL positions. Returns true if intersects with terrain. For AGL variant, see terrainIntersect + Sets the text label of an existing marker. - https://community.bistudio.com/wiki/terrainIntersectASL + https://community.bistudio.com/wiki/setMarkerText - terrainIntersectASL Array + String setMarkerText String - terrainIntersectASL [pos1, pos2] + markerName setMarkerText text - $Code$_intersects = terrainIntersectASL [ getPosASL player, getPosASL chopper];$/Code$ - - $Code$_intersects = terrainIntersectASL [ eyePos player, eyePos enemy1];$/Code$ + $Code$"Marker1" setMarkerText "You are here.";$/Code$ - undefined / undefined + undefined / global - (may 31, 2012) - Please note the difference : - terrainIntersect - terrainIntersectASL - lineIntersect s - lineIntersect s With - lineIntersect s Objs - intersect - - (may 31, 2012) - This command is CPU intensive on the engine, be careful with its use. + createMarker is GLOBAL in multiplayer, so all markers created with it exist for all clients. But they are not visible. Almost all setMarker commands can then be used for different effects on LOCAL clients. + BUT if you use the setMarkerText command, then the marker will become visible to all clients since the command is GLOBAL. - Boolean + Nothing + - terrainIntersectAtASL + menuSetAction - Checks for intersection of terrain between two ASL positions. Same as terrainIntersectASL, only returns intersect position instead of Boolean + Sets new action into menu entry on given path. - https://community.bistudio.com/wiki/terrainIntersectAtASL + https://community.bistudio.com/wiki/menuSetAction - terrainIntersectAtASL Array + menuSetAction Array - terrainIntersectAtASL [pos1, pos2] + menuSetAction [idc, path, action] - $Code$_posASL = terrainIntersectAtASL [ eyePos player, getPosASL chopper];$/Code$ - + undefined / undefined - Array + Number + - terrainIntersect + execFSM - Checks for intersection of terrain between two AGL positions. Returns true if intersects with terrain. For ASL variant see terrainIntersectASL + Executes scripted FSM and returns the FSM handle or 0 when failed. The FSM file is first searched in the mission folder, then in the campaign scripts folder and finally in the global scripts folder. Argument (if any) are available in _this variable inside FSM. In Arma 3 FSM handle is also available in _thisFSM variable. - https://community.bistudio.com/wiki/terrainIntersect + https://community.bistudio.com/wiki/execFSM - terrainIntersect Array + Anything execFSM String + + execFSM String - terrainIntersect [pos1, pos2] + arguments execFSM filename + + execFSM filename - $Code$_intersects = terrainIntersect [ getPos player, getPos chopper];$/Code$ + $Code$_id = player execFSM "test.fsm";$/Code$ - $Code$_intersects = terrainIntersect [ position player, position enemy1];$/Code$ + $Code$_handle = [_a, _b, _c] execFSM "test.fsm";$/Code$ + + $Code$_handle = execFSM "test.fsm";$/Code$ undefined / undefined - (may 31, 2012) - Please note the difference : - terrainIntersect - terrainIntersectASL - lineIntersect s - lineIntersect s With - lineIntersect s Objs - intersect - - (may 31, 2012) - This command is CPU intensive on the engine, be careful with its use. - - (Jun 23, 2012) - This command was changed to ATL and counterpart for ASL was added in build 94049. - Boolean + Number - Number + - textLogFormat + ropeAttachEnabled - Debugging output. - This command is non-functional in the retail version + Returns true if vehicle can be attached to ropes - https://community.bistudio.com/wiki/textLogFormat + https://community.bistudio.com/wiki/ropeAttachEnabled - textLogFormat Array + ropeAttachEnabled Object - textLogFormat [format, arg1, arg2,] + ropeAttachEnabled vehicle - + $Code$ropeAttachEnabled veh1;$/Code$ + undefined / undefined - Nothing + Boolean + - text + setSkill - Creates a structured text containing the given plain text if argument is String or returns location's text value if argument is Location (see Alt Syntax) + Sets ability level of person (commander unit). Value of skill may vary from 0 to 1. + Available sub-skills are: + aimingShake + aimingSpeed + endurance + spotDistance + spotTime + courage + reloadSpeed + commanding + general + The value of a sub-skill is interpolated into a range defined in CfgAISkill. - https://community.bistudio.com/wiki/text + https://community.bistudio.com/wiki/setSkill - text String + Object setSkill Number - text Location + Object setSkill Array - text string + unit setSkill skill - text location + unit setSkill [skillName, value] - $Code$_stxt2 = text "Hello world.";$/Code$ + $Code$_hero setSkill 1;$/Code$ - $Code$_townName = text myTownLocation;$/Code$ - - $Code$_loc = text nearestLocation [ position player, "NameMarine"]; //"Marina Bay"$/Code$ + $Code$_finalBoss setSkill ["reloadSpeed", 0.8]; _finalBoss setSkill ["aimingSpeed", 0.33];$/Code$ undefined / undefined + (August 4, 2006) + Approximate ranges are: + Novice 0.25 + Rookie = 0.25 and = 0.45 + Recruit 0.45 and = 0.65 + Veteran 0.65 and = 0.85 + Expert 0.85 + + (June 30, 2007) + If "SuperAI" is turned on in the Difficulty Menu, the skill level is always 1, no matter what was defined in the editor or via this command. - Structured_Text - String + Nothing - Nothing + - textLog + civilian - Dump argument value to debugging output. - This command is non-functional in the retail version + Pre-defined variable for the civilian side. + When used in a format statement ( hint format ["%1",civilian] ), the string returned is "CIV". - https://community.bistudio.com/wiki/textLog + https://community.bistudio.com/wiki/civilian - textLog Any_Value + civilian - textLog anything + civilian - $Code$textLog player$/Code$ + $Code$// SQS: + ?((side _unit) == civilian ) : hint "This is a civilian unit!"$/Code$ + + $Code$// SQF: + if (( side _unit) == civilian ) then { + hint "This is a civilian unit!"; + };$/Code$ undefined / undefined + In OFP v1.96, empty vehicles, objects and dead soldiers are on side civilian. - Nothing + Side + - tg + lnbDeleteColumn - Identical to tan + Removes column with given index from ListNBox control. - https://community.bistudio.com/wiki/tg + https://community.bistudio.com/wiki/lnbDeleteColumn - tg Number + lnbDeleteColumn Array + + Control lnbDeleteColumn Number - tg x + lnbDeleteColumn [idc,index] + + ctrl lnbDeleteColumn index - + $Code$_ctrl lnbDeleteColumn 1;$/Code$ + - undefined / undefined + local / local + (Sep 9 2014) + (A3 1.28)As for invisible data processing, lnbAddArray, lnbAddColumn, lnbData, lnbGetColumnsPosition, lnbSetColumnsPos, lnbSetData, lnbSetText, lnbSetValue, lnbText and lnbValue store data types into exact position of the listNbox with different spaces. Accessing data with coordinate command at nearly the same syntax: + $Code$ + //Set same value to one position of a Control + _ctrl lnbSetData [ [0,0],"#1"]; + lnbSetColumnsPos [102, [0,1], 1]; + _ctrl lnbSetText [ [0,1], "#1"]; + _ctrl lnbSetValue [ [0,0],1]; + //Accessing the value disregard affecting one another. + _ctrl lnbData [0,0]; //"#1" + lnbGetColumnsPosition _ctrl //[1]; + _ctrl lnbText [0,0];//"#1" + _ctrl lnbValue [0,0];//1 + $/Code$ + For a direct visible control over CT_LISTNBOX: + $Code$ + 0 = [_CT_LISTNBOX] spawn { + private ["_CT_LISTNBOX","_color","_current","_pic"]; + disableSerialization ; + _CT_LISTNBOX = _this select 0; + { + _CT_LISTNBOX lnbAddRow [ getText (_x "displayNameShort"), getText (_x "displayName")]; + _CT_LISTNBOX lnbSetPicture [ [_foreachIndex,0], getText (_x "texture")]; + } forEach (" isClass _x" configClasses ( configFile "CfgRanks")); + _CT_LISTNBOX lnbSetCurSelRow 0; + _current = lnbCurSelRow _CT_LISTNBOX; + _color = _CT_LISTNBOX lnbColor [_current,0]; + _CT_LISTNBOX lnbSetColor [ [_current,1], [(_color select 0)/2,0,0,1] ]; + _CT_LISTNBOX lnbDeleteColumn 0; + _CT_LISTNBOX lnbDeleteRow 1; + sleep 1; + lnbClear _CT_LISTNBOX;//Clear all items but control still remains just invisible. + }; + $/Code$ + A combined use of both invisible and visible data processing commands alive the Control. - Number + Nothing - Nothing + - then + commandingMenu - First or second element of array is executed depending on result of if condition. Result of the expression executed is returned as a result (result may be Nothing ). + Return the name of the player actual topmost commanding menu. - https://community.bistudio.com/wiki/then + https://community.bistudio.com/wiki/commandingMenu - If_Type then Code/Array + commandingMenu - if then else + commandingMenu - $Code$if (a b) then { c = 1 };$/Code$ - - $Code$if (a b) then { - c = 1; - } else { - c = 2; - }; - hint str c;$/Code$ + $Code$waitUntil { commandingMenu == "RscStatus"}; hint "Press 4, I'm bleeding !";$/Code$ undefined / undefined - Any variables you declare within the body of an if /then statement (ie between the curly braces) are local to that 'if' statement, and are destroyed at the end of the statement. If you know you want to use the variable outside the 'if' statement, make sure your declare it before the 'if' statement. + (July 15, 2009) + Possible values are : + "" - means menu is closed + "RscMainMenu" - Main menu, by pressing backspace + "RscMoveHigh" - Move menu (1) + "#WATCH" - Watch menu (2) + "#WATCH0" - Watch menu - next page (2-0) + "RscWatchDir" - Engage menu (3) + "RscWatchMoreDir" - Engage menu - watch a direction (3-8) + "#GET_IN" - Mount menu (4) + "RscStatus" - Status menu (5) + "RscCallSupport" - Mount menu - call support (5-1) + "#ACTION" - Action menu (6) + "RscCombatMode" - Combat mode menu (7) + "RscFormations" - Formation menu(8) + "RscTeam" - Team menu (9) + "RscSelectTeam" - Team menu - select team (0-5) + "RscReply" - Reply menu (0) + "#User:BIS_Menu_GroupCommunication" - Communication menu (0-8) + "#CUSTOM_RADIO" - Custom sounds menu (0-9) + "RscRadio" - Radio menu (0-0) + "RscGroupRootMenu" - "simplified" menu - Anything + String + - throw + revealMine - Throws an exception. The exception is processed by first catch block. This command will terminate further execution of the code. - NOTE : Avoid using alternative shorthand syntax if you are planning on preparing your exception information dynamically, as it will have to be generated first regardless of the condition of the if statement before it, as shown in example 3. + Sets given mine as known to the side. (Knowledge about a mine is always shared across all units in a side.) - https://community.bistudio.com/wiki/throw + https://community.bistudio.com/wiki/revealMine - throw Anything - - If_Type throw Anything + Side revealMine Object - throw expression - - if throw exception + side revealMine mine - $Code$try { throw "invalid argument"} catch { hint str _exception};$/Code$ - - $Code$// Since Arma 3 v1.53.133045: - 123 try { if (_this != 123) throw "invalid argument"} catch { hint str _exception};$/Code$ - - $Code$// The correct usage of shorthand alt syntax: - try { - if (a b) throw "Error: some error"; /// OK - /// The command argument is static - } catch { - hint str _exception; - }; - try { - _someFunc = { - ..... - }; - if (a b) throw ( call _someFunc); /// NOT OK - /// The command argument is dynamic - /// _someFunc is called first to get the value regardless of (a b) outcome - } catch { - hint str _exception; - }; - try { - _someFunc = { - ..... - }; - if (a b) then { throw ( call _someFunc)}; /// OK - /// The command argument is dynamic - /// _someFunc is only called when (a b) is true - } catch { - hint str _exception; - };$/Code$ + $Code$west revealMine _mine;$/Code$ undefined / undefined + (September 10, 2017) + Manual mine detection introduced in A3 v1.76 can be overridden with something like this: + $Code$0 spawn + { + while {true} do + { + if ("MineDetector" in items player ) then + { + { + if ( mineActive _x && !(_x mineDetectedBy playerSide )) then + { + playerSide revealMine _x; + }; + } forEach (player nearObjects ["MineBase", 10]); + uiSleep 0.1; + } + else + { + uiSleep 3; + }; + }; + };$/Code$ - Nothing - Nothing + Nothing + - timeMultiplier + tvClear - Returns the value set with setTimeMultiplier. + Removes all items from Tree View with given idc. - https://community.bistudio.com/wiki/timeMultiplier + https://community.bistudio.com/wiki/tvClear - timeMultiplier + tvClear Number + + tvClear Control - timeMultiplier + tvClear idc + + tvClear control - $Code$_multiplier = timeMultiplier ;$/Code$ + $Code$tvClear 101;$/Code$ - undefined / undefined + local / local + (Sep 11 2014) + (A3 1.28)tv command family overview + $Code$ + //tv command family available for CT_TREE (type 12) + private ["_count","_current","_data","_text","_value","_pic"]; + _CT_TREE tvAdd [ [],"Parent_A"]; + _CT_TREE tvAdd [ [0],"Child_A"]; + _CT_TREE tvAdd [ [0,0],"Grandchild_A"]; + _CT_TREE tvAdd [ [],"Parent_B"]; + _CT_TREE tvAdd [ [1],"Child_B"]; + _count = _CT_TREE tvCount []; //return 2 + _CT_TREE tvSetCurSel [0,0,0]; //select grandchild_A + _current = tvCurSel _CT_TREE; //return [0,0,0] + _CT_TREE tvSetData [_current,"I'm grandchild_A"]; + _data = _CT_TREE tvData _current; // "I'm grandchild_A" + _text = _CT_TREE tvText _current; //"Grandchild_A" + _CT_TREE tvSetValue [_current,14]; + _value = _CT_TREE tvValue _current; // 14 + _CT_TREE tvSetPicture [_current, getText ( configFile "CfgWeapons" "optic_NVS" "picture")]; + _pic = _CT_TREE tvPicture _current; + _CT_TREE tvExpand [1]; + _CT_TREE tvSort [[], false ]; + _CT_TREE tvSortByValue [[], false ]; + _CT_TREE tvDelete [0,0]; //remove child_b + tvClear 12; + _CT_TREE tvCollapse []; + $/Code$ - Number + Nothing - Nothing + - time + ctrlSetFontHeightH3 - Returns time elapsed since mission started (in seconds). The value is different on each client. If you need unified time, use serverTime. + Sets H3 font size of given HTML control. - https://community.bistudio.com/wiki/time + https://community.bistudio.com/wiki/ctrlSetFontHeightH3 - time + Control ctrlSetFontHeightH3 Number - time + controlName ctrlSetFontHeightH3 height - $Code$_future = time + 30; - waitUntil { time = _future}; /* continue after 30 seconds... */$/Code$ - - $Code$// Wait until mission fully started: - waitUntil { time 0};$/Code$ + $Code$_control ctrlSetFontHeightH3 0.05$/Code$ undefined / undefined - (August 4, 2006) - Notes from before the conversion: - Not to be confused with _time. Within a script, the reserved local variable _time returns the time elapsed since the script started running. Note that the value of time is not saved when the mission is saved and so will be reset to zero when a mission is restarted from a saved position. The value of _time is saved correctly and will resume from where it was. - _time has only special meaning in SQS scripts, in SQF script it is just another variable. -- Killzone_Kid - - (January 5, 2007) - Notes from before the conversion: - time works properly in sqf called with execVM command. In an other hand, _time does not works in sqf called with execVM command.(Arma v1.02.5103GER) - - (October 02, 2010) - On overloaded servers (below ~10 server FPS), time readings are unreliable. Seconds actually take longer. While the clients keep a steady tempo, server time lags behind, resulting in considerable offset between client and server time (easily 30 minutes for a 2 hour game). Client time is synchronised to server time during JIP, but other than that it runs independently. - - (30 Oct 2013) - Arma 3 JIP bug: - As of Arma 3 v1.02, for JIP clients 'time' value will start off counting from 0, not the real 'time' value. After about 2.5sec (on average), it will then jump to a high value and synchronise with the real 'time' value, which could be 900, for example. - Therefore, do not use 'time' for any start of mission init timeouts; it's unreliable. (It's odd that it doesn't synchronise at the same time as public variables.) - - (September 1, 2016) - In MP : Since per-client time and server time is unconsistant I strongly recommend execution of time-critical tasks from server-side scripts and with remoteExec or remoteExecCall ( Since only A3 1.50 alternative may be publicVariableClient with pre-defined handler) as this will eliminate any time calculation lags and make it reliable. - Number + Nothing + - titleCut + loadMagazine - this command was obsoleted, use cutText instead. + Initiates the loading action on given weapon of the turret of a transport. So the new magazine is not available instantly, yet according to the reloadTime. + The turret has to be manned. One can also change the magazine if its respective weapon is not selected. - https://community.bistudio.com/wiki/titleCut + https://community.bistudio.com/wiki/loadMagazine - titleCut Array + Object loadMagazine Array - titleCut [text, type, speed] + transport loadMagazine [turretPath, weaponName, magazineName] - $Code$titleCut ["Hello, how are you?","Plain Down",3];$/Code$ + $Code$vehicle player loadMagazine [[0],"m256","20Rnd_120mmHE_M1A2"];$/Code$ undefined / undefined @@ -69552,27 +71470,28 @@ - Nothing + Nothing + - titleFadeOut + ctrlSetFontHeightH4 - Terminate the title effect and set duration of the fade out phase to the given time. + Sets H3 font size of given HTML control. - https://community.bistudio.com/wiki/titleFadeOut + https://community.bistudio.com/wiki/ctrlSetFontHeightH4 - titleFadeOut Number + Control ctrlSetFontHeightH4 Number - titleFadeOut duration + controlName ctrlSetFontHeightH4 height - $Code$titleText ["Hi", "plain"]; titleFadeOut 2$/Code$ + $Code$_control ctrlSetFontHeightH4 0.05$/Code$ undefined / undefined @@ -69580,27 +71499,28 @@ - Nothing + Nothing + - titleObj + ctrlSetFontHeightH5 - Shows object defined in global config in CfgTitles + Sets H5 font size of given HTML control. - https://community.bistudio.com/wiki/titleObj + https://community.bistudio.com/wiki/ctrlSetFontHeightH5 - titleObj Array + Control ctrlSetFontHeightH5 Number - titleObj [class, type, speed, showInMap] + controlName ctrlSetFontHeightH5 height - $Code$titleObj ["BISLogo", "PLAIN"]$/Code$ + $Code$_control ctrlSetFontHeightH5 0.05$/Code$ undefined / undefined @@ -69608,210 +71528,202 @@ - Nothing + Nothing + - titleRsc + stopped - Display a resource defined in RscTitles. Also see cutRsc, with these two commands you can show two different resources at once. + Check if unit is stopped by stop command. - https://community.bistudio.com/wiki/titleRsc + https://community.bistudio.com/wiki/stopped - titleRsc Array + stopped Object - titleRsc [text, type, speed, showInMap] + stopped unitName - $Code$titleRsc ["BIS", "PLAIN"]$/Code$ + $Code$? (stopped _loon1) : hint "Loon1 is stopped"$/Code$ undefined / undefined - (30 Jun, 2008) - Using titleRsc (unlike cutRsc ) for a HUD will mean: - the HUD will remain visible when you access the map and overlay it. - using the 'Direct communication' chat channel messages will interfere with the HUD by hiding it, since it appears to use the same 'resource layer'. - - (September 25, 2014) - In OFP/CWA any x Rsc will hide all the elements of the HUD, including the map. - Nothing + Boolean + - titleText + ctrlSetFontHeightH6 - Displays text across the screen. If used along with cutText two different texts (in different type styles) can be shown at once. The text can be displayed on multiple lines by using "\n" new line characters: - titleText ["line1\nline2\nline3", "PLAIN"];. Since Arma 3 v1.73.142260 this command supports Structured Text formatting. + Sets H6 font size of given HTML control. - https://community.bistudio.com/wiki/titleText + https://community.bistudio.com/wiki/ctrlSetFontHeightH6 - titleText Array + Control ctrlSetFontHeightH6 Number - titleText [text, type, speed, showInMap, isStructuredText] + controlName ctrlSetFontHeightH6 height - $Code$titleText ["Show this text", "PLAIN"];$/Code$ - - $Code$titleText ["Your message", "BLACK", 2];$/Code$ - - $Code$// Since Arma 3 v1.73.142260: - titleText [" t color='#ff0000' size='5' RED ALERT! /t br/ ***********", "PLAIN", -1, true, true ];$/Code$ + $Code$_control ctrlSetFontHeightH6 0.05$/Code$ - undefined / local + undefined / undefined - (November 21, 2014) - The third parameter or 'speed', as it's called in the description, refers to the amount of time the message will be shown on-screen. Multiply each number by 10 to get the number of seconds it will be shown. You can even use floats as input, like 0.1, to show a message for only 1 second. - Note : Calculating the time with that method does not include the time it takes to fade in/out, which is about 1 second unless you use numbers lower than 1. - Note : Using anything lower than 0.001 seems to have no effect, or the effect is so little it's negligible. - (A3 1.34.128075) - Nothing + Nothing + - toArray + ctHeaderCount - Converts the supplied String into an Array of Numbers. - The numbers in the created array are the decimal Unicode representations of characters. + Returns number of headers (rows not included) in the RscControlsTable. - https://community.bistudio.com/wiki/toArray + https://community.bistudio.com/wiki/ctHeaderCount - toArray String + ctHeaderCount Control - toArray string + ctHeaderCount ctrl - $Code$hint format["%1",toArray("AaŒ")] - // returns "[65,97,338]"$/Code$ + $Code$ctHeaderCount _control;$/Code$ - undefined / undefined + local / local - Array + Number + - toFixed + ctrlMapCursor - Converts a number into a string, keeping the specified number of decimals. If the desired number of decimals is higher than the actual number, nulls are added to create the desired decimal length. This command is almost identical in behaviour to JavaScript toFixed() - NOTE: Converted number is never presented in scientific notation unlike with other number to string commands. Also Arma's default string conversion limits numbers to 6 significant figures, whereas with this command it is possible to preserve some extra precision. - $Code$ str ( pi /100000); //"3.14159e-005" - scientific notation - ( pi /100000) toFixed 10; //"0.0000314159" - no scientific notation - str pi ; //"3.14159" - 6 significant figures (default) - pi toFixed 6; //"3.141593" - forced to 7 significant figures - pi toFixed 7; //"3.1415927" - forced to 8 significant figures$/Code$ - Since Arma 3 v1.71.141859 an alternative syntax is added, which takes no number and returns Nothing. Instead it acts as keyword and switches engine Number to String global conversion into desired format, from the moment it is applied until the end of script. To reset output back to default at any time, use toFixed -1. For example: - $Code$ systemChat str position player ; - call - { - toFixed 6; - systemChat str position player ; - }; - systemChat str position player ; - toFixed -1; - systemChat str position player ;$/Code$ - The result is: - [11580.3,11797.7,0.00146675] - [11580.341797,11797.737305,0.001467] - [11580.341797,11797.737305,0.001467] - [11580.3,11797.7,0.00146675] - Ideal to be used when saving data to a database when more precise positioning is required. + Changes the default cursor that appears when interacting with a map control to a custom one. Use an empty string to restore the default cursor. If the specified cursor does not exist, the default is used and no error is produced. ( NOT in case of ArmA 3. Using an empty string will result in an error: "No entry 'bin\config.bin/CfgWrapperUI/Cursors.' ). The cursor is the name of a config entry from CfgWrapperUI / Cursors. This command has the following specifics: + When used on Main Map ( findDisplay 12 displayCtrl 51) it is possible to override multiple default cursors. For example, while leaving default "Arrow" intact, it is possible to just override "Scroll" with lets say "Wait" (Example 3) + When used on a custom map, for example user made Mini Map, there is only one single cursor "" for everything, therefore only this cursor can be overridden (see Example 4 on how to override it) + Some possible class names (for the whole list see ctrlMapCursor/cursors ): + Arrow + Track + Move + Scroll + Rotate + Track3D + Move3D + Rotate3D + Raise3D + Wait + HC_move + HC_overFriendly + HC_overEnemy + HC_overMission + HC_unsel + NOTE1 : Cursor names are case sensitive. - https://community.bistudio.com/wiki/toFixed + https://community.bistudio.com/wiki/ctrlMapCursor - Number toFixed Number - - toFixed Number + Control ctrlMapCursor Array - number toFixed decimals - - toFixed decimals + control ctrlMapCursor [defaultCursor, newCursor] - $Code$123 toFixed 2; //"123.00"$/Code$ + $Code$_map ctrlMapCursor ["Track", "Arrow"];$/Code$ - $Code$2.34 toFixed 1; //"2.3" - 2.35 toFixed 1; //"2.4"$/Code$ + $Code$uiNamespace setVariable ["_map", findDisplay 12 displayCtrl 51]; + ( uiNamespace getVariable "_map") ctrlMapCursor ["Track","HC_overFriendly"];$/Code$ - $Code$// Convert position to string preserving position precision: - fn_posToString = - { - format [ - "[%1,%2,%3]", - _this select 0 toFixed 8, - _this select 1 toFixed 8, - _this select 2 toFixed 8 - ] - }; - str getPos player ; // "[3231.05,171.802,0.00143862]" - getPos player call fn_posToString; // "[3231.04882813,171.80192566,0.00143862]"$/Code$ + $Code$findDisplay 12 displayCtrl 51 ctrlMapCursor ["Scroll", "Wait"];$/Code$ - $Code$// Same as Example 3 only using new alternative syntax: - str getPos player ; // "[3231.05,171.802,0.00143862]" - toFixed 8; - str getPos player ; // "[3231.04882813,171.80192566,0.00143862]"$/Code$ + $Code$// Cycle through all available cursors over custom map: + 0 = [] spawn + { + disableSerialization ; + _map = findDisplay 46 createDisplay "RscCredits" ctrlCreate ["RscMapControl", -1]; + _map ctrlSetPosition [0,0,1,1]; + _map ctrlCommit 0; + { + _map ctrlMapCursor ["", configName _x]; // -- the actual usage + hint format ["Current cursor: %1", configName _x]; + sleep 1; + } + forEach ("true" configClasses ( configFile "CfgWrapperUI" "Cursors")); + };$/Code$ undefined / undefined - (September 2, 2016) - parseNumber (3.56346 toFixed 4); //0.0026 ms (10000 cycles) - [3.5634,4] call BIS_fnc_cutDecimals ; //0.0111 ms (10000 cycles) - - - String - Nothing - - - - - toLower + (February 8, 2016) + When using this command, the cursor will change for the whole display, resulting in visual glitches. Adding the onMouseMoving event handler can help solve this problem: + $Code$ + _control ctrlAddEventHandler ["MouseMoving",{ + _this params [ + ["_mapCtrl", controlNull,[[[controlNull]]]], + ["_xPos",-1,[0]], + ["_yPos",-1,[0]], + ["_mouseIn", false,[[[true]]]] + ]; + if (_mouseIn) then { + // Mouse is in control area + _mapCtrl ctrlMapCursor ["","Track"]; + } else { + // Mouse is out of control area, goes back to arrow + _mapCtrl ctrlMapCursor ["","Arrow"]; + }; + }]; + $/Code$ + + + Nothing + + + + + + AISFinishHeal - Converts the supplied string to all lowercase characters. + Alternative Injury Simulation (AIS) end state. Used to tell engine that script side healing is done when using "HandleHeal" event handler. - https://community.bistudio.com/wiki/toLower + https://community.bistudio.com/wiki/AISFinishHeal - toLower String + AISFinishHeal Array - toLower string + AISFinishHeal [unit, healer, healercanheal] - $Code$hint toLower("AaBb1") - // returns "aabb1"$/Code$ + $Code$AISFinishHeal [_wounded, _medic, true ];$/Code$ undefined / undefined @@ -69819,99 +71731,101 @@ - String + Nothing + - toString + onGroupIconOverLeave - Converts the supplied Array of Numbers into a String. - The numbers in the array to be converted are the decimal Unicode representations of characters. + Defines an action performed when pointer, previously positioned over icon, is moved away from it (3D or in a map). The code is executed once. + i + Since Arma 3 v1.57 a stackable version of this EH is available: GroupIconOverLeave - https://community.bistudio.com/wiki/toString + https://community.bistudio.com/wiki/onGroupIconOverLeave - toString Array + onGroupIconOverLeave String/Code - toString array + onGroupIconOverLeave command - $Code$hint toString [65,97,338]; - // returns "AaŒ"$/Code$ - - $Code$["test","test"] joinString toString [12345] splitString toString [12345]; // ["test","test"]$/Code$ + $Code$onGroupIconOverLeave + { + // Passed values for _this are: + _is3D = _this select 0; + _group = _this select 1; + _wpID = _this select 2; + _posx = _this select 3; + _posy = _this select 4; + _shift = _this select 5; + _ctrl = _this select 6; + _alt = _this select 7; + _message = format ["____ Info ____"]; + {_message = _message + format ["\n %1",_x]} forEach _this; + hint _message; + }$/Code$ undefined / undefined - (February 10, 2015) - Tabs and new lines can be created with toString [9] and toString [10], respectively. Alternatively, a new line can also be created with toString [92,110] ("\n"). If you save these strings into a variable, they can be manipulated like any other string. For example, the following code will work just fine and return the expected output: - $Code$_tab = toString [9]; - for "_i" from 0 to 3 do - { - _tab = _tab + ( toString [9]); - }; - copyToClipboard format ["x%1x",tab];$/Code$ - - (August 25, 2015) - While you can convert any String to Array with toArray command, only numbers from 1 to 55295 (not 65535 as expected) can be successfully converted to String with toString and then back to Array with toArray without loss of data. - String + Nothing + - toUpper + camTarget - Converts the supplied string to all uppercase characters. + Returns camera's target. - https://community.bistudio.com/wiki/toUpper + https://community.bistudio.com/wiki/camTarget - toUpper String + camTarget Object - toUpper string + camTarget camera - $Code$hint toUpper("AaBb1") - // returns "AABB1"$/Code$ - + undefined / undefined - String + Object + - to + ctrlSetFontHeightH1 - Continue sequence of for var construct. It sets the end value of the index variable + Sets H1 font size of given HTML control. - https://community.bistudio.com/wiki/to + https://community.bistudio.com/wiki/ctrlSetFontHeightH1 - For_Type to Number + Control ctrlSetFontHeightH1 Number - forType to b + controlName ctrlSetFontHeightH1 height - $Code$for "_x" from 10 to 20 do {/* Do something*/}$/Code$ + $Code$_control ctrlSetFontHeightH1 0.05$/Code$ undefined / undefined @@ -69919,1334 +71833,1868 @@ - For_Type + Nothing + - triggerActivated + ctrlSetFontHeightH2 - Returns true if the trigger has been activated. - Note: The trigger could be local or remote but the result returned by this command will be for the trigger condition set up locally on the client that executed the command. See createTrigger for more info. + Sets H2 font size of given HTML control. - https://community.bistudio.com/wiki/triggerActivated + https://community.bistudio.com/wiki/ctrlSetFontHeightH2 - triggerActivated Object + Control ctrlSetFontHeightH2 Number - triggerActivated trigger + controlName ctrlSetFontHeightH2 height - $Code$if ( triggerActivated trg1) then { - // Code - };$/Code$ + $Code$_control ctrlSetFontHeightH2 0.05$/Code$ - global / local + undefined / undefined - If trigger already activated at least once, triggerActivated will only return false if trigger is set to activate Repeatedly. - In other words, a trigger set to activate Once will always return true once activated at least once (even if trigger is no longer activated). - Boolean + Nothing + - triggerActivation + diag_list - Returns trigger activation in the form [by, type, repeating]. - Note: The trigger could be local or remote but the result returned by this command will be for the trigger condition set up locally on the client that executed the command. See createTrigger for more info. + Returns an array of all diag modes available in the game. + Command is only available when using Arma 3 Diagnostics Exe on Dev-Branch. - https://community.bistudio.com/wiki/triggerActivation + https://community.bistudio.com/wiki/diag_list - triggerActivation Object + diag_list String - triggerActivation trigger + diag_list name - + $Code$diag_list "toggle";$/Code$ + + $Code$diag_list "drawMode"$/Code$ + - global / local + undefined / undefined + (October 7, 2016) + Arma 3 Version 1.65.138660 + $Code$ diag_list "toggle";$/Code$ returns: + ["Force","Animation","Mines","HitPoints","AnimSrcUnit","AnimSrcTarget","Suspension", + "EPEForce","EPEVehicle","ParticleNames","Particles","SurfaceUnder","AISkill","AIDriving", + "AIAiming","AIBrain","AIDynamicError","AISuppression"] - Array + Array + - triggerArea + ppEffectCommit - Returns currently monitored trigger area. The trigger could be local or remote but the result returned by this command will be for the trigger condition set up locally on the client that executed the command. See createTrigger for more info. - NOTE : Since Arma 3 v1.59.135137, triggerArea returns 3rd dimension for the monitored area. If height is not set, the value for it would be -1; + Commit post process effect in given time. - https://community.bistudio.com/wiki/triggerArea + https://community.bistudio.com/wiki/ppEffectCommit - triggerArea Object + String ppEffectCommit Number + + Number ppEffectCommit Number + + Array ppEffectCommit Number - triggerArea trigger + effect ppEffectCommit commit + + effect ppEffectCommit commit + + [effect1,] ppEffectCommit commit - $Code$_area = triggerArea sensor1; // result is [200, 120, 45, false]$/Code$ + $Code$"colorCorrection" ppEffectCommit 3;$/Code$ - $Code$// Since Arma 3 v1.59.135137: - _area = triggerArea sensor1; // result is [200, 120, 45, false, -1];$/Code$ + $Code$_hndl ppEffectCommit 3;$/Code$ + + $Code$[_hndl1, _hndl2] ppEffectCommit 3;$/Code$ - global / local + undefined / undefined - Array + Nothing - Nothing - Nothing + - triggerAttachObject + onBriefingGroup - Assigns a static object to the trigger. The activation source is changed to "STATIC". + Select a sound declared in the Description.ext of the mission to be played the first time the Group tab is selected in the briefing. - https://community.bistudio.com/wiki/triggerAttachObject + https://community.bistudio.com/wiki/onBriefingGroup - Object triggerAttachObject Number + onBriefingGroup String - triggerName triggerAttachObject objectId + onBriefingGroup soundName - $Code$_trigger triggerAttachObject 1234;$/Code$ + $Code$onBriefingGroup "GroupVoiceOver"$/Code$ undefined / undefined - (October 31, 2013) - This command doesn't quite work in Arma 3 [1] - Further investigation reveals that objectId param for this command is some kind of map id and not the id you can see in the editor. This map id could be seen in multiplayer when looking at netId of the static objects, for example "1:-23984219837", the -23984219837 would be the objectId. Unfortunately it still doesn't work. - Nothing + Nothing + - triggerAttachVehicle + tg - Specifies the entity which will activate the selected trigger. - If [] is given, the trigger is decoupled from the assigned vehicle (example 2). - If the activation source is "VEHICLE", "GROUP", "LEADER" or "MEMBER", it's changed to "NONE". - If [vehicle] is given, the trigger is coupled to the vehicle or its group. - When the source is "GROUP", "LEADER" or "MEMBER", it's coupled to the group, otherwise it's coupled to the vehicle and the source is changed to "VEHICLE". + Identical to tan - https://community.bistudio.com/wiki/triggerAttachVehicle + https://community.bistudio.com/wiki/tg - Object triggerAttachVehicle Array + tg Number - triggerName triggerAttachVehicle objects + tg x - $Code$trigger triggerAttachVehicle [ player ];$/Code$ - - $Code$trigger triggerAttachVehicle [];$/Code$ - + - global / local + undefined / undefined - Nothing + Number + - triggerAttachedVehicle + waypointAttachedVehicle - Returns vehicle attached to the trigger (for example using triggerAttachVehicle ). - Note: The trigger could be local or remote but the result returned by this command will be for the trigger condition set up locally on the client that executed the command. See createTrigger for more info. + Gets the vehicle attached to the waypoint. + A vehicle can be attached to a waypoint by + creating the waypoint on top of the vehicle (in the editor) + using waypointAttachVehicle - https://community.bistudio.com/wiki/triggerAttachedVehicle + https://community.bistudio.com/wiki/waypointAttachedVehicle - triggerAttachedVehicle Object + waypointAttachedVehicle Array - triggerAttachedVehicle trigger + waypointAttachedVehicle waypoint - $Code$return = triggerAttachedVehicle triggerName;$/Code$ + $Code$waypointAttachedVehicle [groupOne,1]$/Code$ + + $Code$waypointAttachedVehicle [ group player, currentWaypoint group player ]$/Code$ - global / local + undefined / undefined - Object + Object + - triggerDynamicSimulation + selectLeader - Controls ability of given unit to activate entities with disabled Arma_3_Dynamic_Simulation. If false dynamically disabled entities will not be activated by unit presence + Select a group's leader. In MP the group has to be local to the PC executing the command. Locality of the group can be checked with local command and group ownership with groupOwner command. - https://community.bistudio.com/wiki/triggerDynamicSimulation + https://community.bistudio.com/wiki/selectLeader - Object triggerDynamicSimulation Boolean + Group selectLeader Object - unit triggerDynamicSimulation trigger + groupName selectLeader unitName - $Code$player triggerDynamicSimulation false ;$/Code$ + $Code$group player selectLeader player ;$/Code$ + + $Code$// Make unit a leader from server: + [ group _unit, _unit] remoteExec ["selectLeader", groupOwner group _unit];$/Code$ - undefined / undefined + local / global - Nothing + Nothing + - triggerStatements + vectorNormalized - Returns trigger statements in the form [cond, activ, desactiv]. - Note: The trigger could be local or remote but the result returned by this command will be for the trigger condition set up locally on the client that executed the command. See createTrigger for more info. + Returns normalized vector (unit vector, vectorMagnitude = 1) of given vector. If given vector is 0 result is a 0 vector as well. - https://community.bistudio.com/wiki/triggerStatements + https://community.bistudio.com/wiki/vectorNormalized - triggerStatements Object + vectorNormalized Array - triggerStatements trigger + vectorNormalized vector - + $Code$vectorNormalized [12345,7890,38383]; //[0.300481,0.192045,0.934254] + vectorMagnitude [0.300481,0.192045,0.934254]; //1$/Code$ + - global / local + undefined / undefined + (19 Jul, 2014) + (ArmA3 1.26) Algorithm: + $Code$ + Vector = [x,y,z]; + Result = [x/( sqrt (x ^ 2 + y ^ 2 + z ^ 2)), y/( sqrt (x ^ 2 + y ^ 2 + z ^ 2)), z/( sqrt (x ^ 2 + y ^ 2 + z ^ 2))] + $/Code$ + In mathematics, a unit vector in a normed vector space is a vector whose length is 1. - Array + Array + - triggerText + to - Returns trigger text. - Note: The trigger could be local or remote but the result returned by this command will be for the trigger condition set up locally on the client that executed the command. See createTrigger for more info. + Continue sequence of for var construct. It sets the end value of the index variable - https://community.bistudio.com/wiki/triggerText + https://community.bistudio.com/wiki/to - triggerText Object + For_Type to Number - triggerText trigger + forType to b - $Code$result = triggerText triggerName;$/Code$ + $Code$for "_x" from 10 to 20 do {/* Do something*/}$/Code$ - global / local + undefined / undefined - String + For_Type + - triggerTimeoutCurrent + getCargoIndex - Returns trigger timeout or -1 if countdown is not in progress. - Note: The trigger could be local or remote but the result returned by this command will be for the trigger condition set up locally on the client that executed the command. See createTrigger for more info. + Returns index of the unit in cargo. 0,1,2... or -1 if not in cargo. - https://community.bistudio.com/wiki/triggerTimeoutCurrent + https://community.bistudio.com/wiki/getCargoIndex - triggerTimeoutCurrent Object + Object getCargoIndex Object - triggerTimeoutCurrent trigger + vehicle getCargoIndex unit - $Code$_remaining = triggerTimeoutCurrent _trigger;$/Code$ + $Code$player moveInCargo heli; + hint str (heli getCargoIndex player );$/Code$ - global / local + global / undefined - (November 26, 2013) - Triggers have their own schedule. If you create a trigger with timeout and try to read triggerTimeoutCurrent immediately it will return -1. This is because the countdown will not start until the next scheduled trigger check is due, and this could take up to 0.5 seconds. - Number + Number + - triggerTimeout + addBackpackCargo - Returns trigger timeout in the form [min, mid, max, interruptable]. - Note: The trigger could be local or remote but the result returned by this command will be for the trigger condition set up locally on the client that executed the command. See createTrigger for more info. + Add backpack(s) to the cargo space of vehicle. Classname list of available backpacks is here. + In Arma 3, arguments for this command must be local ( ). For global variant see addBackpackCargoGlobal - https://community.bistudio.com/wiki/triggerTimeout + https://community.bistudio.com/wiki/addBackpackCargo - triggerTimeout Object + Object addBackpackCargo Array - triggerTimeout trigger + vehicle addBackpackCargo [packClassName,count] - + $Code$this addBackpackCargo ["TK_RPG_Backpack_EP1",2];$/Code$ + + $Code$_apc addBackpackCargo ["US_Patrol_Pack_EP1",4];$/Code$ + global / local - Array + Nothing + - triggerType + inflamed - Returns trigger type (see setTriggerType ). - Note: The trigger could be local or remote but the result returned by this command will be for the trigger condition set up locally on the client that executed the command. See createTrigger for more info. + Checks if fireplace is inflamed (burning) or not. To check if a unit is receiving damage from fire, use isBurning command. - https://community.bistudio.com/wiki/triggerType + https://community.bistudio.com/wiki/inflamed - triggerType Object + inflamed Object - triggerType trigger + inflamed fireplace - $Code$_type = triggerType tr1;$/Code$ + $Code$_inflamed = inflamed _fireplaceOne;$/Code$ - global / local + global / undefined - String + Boolean + - true + addWeaponTurret - Always true + Adds a weapon to the turret. Use turret path [-1] for driver's turret. - https://community.bistudio.com/wiki/true + https://community.bistudio.com/wiki/addWeaponTurret - true + Object addWeaponTurret Array - true + vehicle addWeaponTurret [weaponName, turretPath] - $Code$_var = true ; - systemChat str _var; //true$/Code$ + $Code$_tank addWeaponTurret ["LMG_M200",[0,0]];$/Code$ - undefined / undefined + local / global - Boolean + Nothing + - try + setMarkerPosLocal - Defines a try-catch structure. This sets up an exception handling block. Any thrown exception in a try block is caught in a catch block. The structured exception block has the following form: - $Code$ try //begin of try-catch block - { //block, that can throw exception } - catch - { //block, that process an exception. Exception is described in _exception variable };$/Code$ + Moves the marker. Pos format is Position2D. - https://community.bistudio.com/wiki/try + https://community.bistudio.com/wiki/setMarkerPosLocal - try Code - - Anything try Code + String setMarkerPosLocal Array - try code - - args try code + markerName setMarkerPosLocal pos - + $Code$"MarkerOne" setMarkerPosLocal getMarkerPos "MarkerTwo";$/Code$ + - undefined / undefined + undefined / local - (June 9, 2015) - Do not expect this behave like Javascript try catch and ignore all errors. But it does have one useful behaviour. Normally when runtime error occurs in SQF (unlike when there is compile error) it continues to execute till the end. But if the script is placed in try {} scope and throw is used upon error, the script immediately terminates, exits the try {} scope and enters catch {} scope. This way it is possible to process possible exceptions in civilised manner. - Exception - Exception + Nothing + - turretLocal + sendTaskResult - Checks if a turret is local. - Some info on turrets: A vehicle turret will change locality when player gunner gets in it, just like vehicle changes locality when player driver gets in it. Many commands for turrets work only where turret is local. When gunner leaves turret it is supposed to change locality to the locality of the vehicle. + Send a result of the task to the task sender. - https://community.bistudio.com/wiki/turretLocal + https://community.bistudio.com/wiki/sendTaskResult - Object turretLocal Array + Task sendTaskResult Array - vehicle turretLocal turretPath + task sendTaskResult [state,result,sentence] - $Code$_isLocal = vehicle player turretLocal [0];$/Code$ - - $Code$if (heli turretLocal [1]) then {heli setVehicleAmmo 1};$/Code$ - - $Code$if ( isNil {heli turretLocal [5]}) then { hint "Turret 5 is non-existent"};$/Code$ - + - global / undefined + undefined / undefined - Boolean/Nothing + Nothing + - turretOwner + playableSlotsNumber - Returns id of the owner of the turret. Server only. Returns 0 on non-server and SP. - Some info on turrets: A vehicle turret will change locality when player gunner gets in it, just like vehicle changes locality when player driver gets in it. Many commands for turrets work only where turret is local. When gunner leaves turret it is supposed to change locality to the locality of the vehicle. A vehicle can have one owner while turrets have different owners. + Returns the number of available slots in mission per side (both empty and taken). In singleplayer mission, it returns number of playable units per side. - https://community.bistudio.com/wiki/turretOwner + https://community.bistudio.com/wiki/playableSlotsNumber - Object turretOwner Array + playableSlotsNumber Side - vehicle turretOwner turretPath + playableSlotsNumber side - $Code$_ownerId = vehicle player turretOwner [0];$/Code$ + $Code$_maxBluforPlayers = playableSlotsNumber blufor ;$/Code$ - global / undefined + undefined / undefined - This scripting command must be executed on the server to work properly in multiplayer - Number + Number + - turretUnit + didJIPOwner - Returns the unit in the vehicle turret. Driver turret [-1] is supported since Arma 3 v1.57.135045 + Checks if the current owner of supplied Object Joined In Progress. Server execution only. On clients returns false. - https://community.bistudio.com/wiki/turretUnit + https://community.bistudio.com/wiki/didJIPOwner - Object turretUnit Array + didJIPOwner Object - vehicle turretUnit turretpath + didJIPOwner object - $Code$_vehicle turretUnit _thisTurret$/Code$ + $Code$ownerDidJip = didJIPOwner tank;$/Code$ undefined / undefined + This scripting command must be executed on the server to work properly in multiplayer - Object + Boolean + - tvAdd + swimInDepth - Adds an item with given text to Tree View control. The position on Tree View where to add the item and the actual path to this item once added are different. If item is added to existing item, then parent item path is used. If no parent exists, empty array [] is used. See Tree View Path for more information. + Sets the target depth level for swimming soldier. Depth should be a negative number. - https://community.bistudio.com/wiki/tvAdd + https://community.bistudio.com/wiki/swimInDepth - tvAdd Array - - Control tvAdd Array + Object swimInDepth Number - tvAdd [idc, pathParent, text] - - control tvAdd [pathParent, text] + unit swimInDepth value - $Code$_index = _ctrl tvAdd [[], "Parent Item"];$/Code$ + $Code$soldier swimInDepth -20;$/Code$ - $Code$_index = tvAdd [101, [0], "First item"];$/Code$ + $Code$bob swimInDepth -10; + bob doMove ASLToAGL getPosASL player ;$/Code$ undefined / undefined - (Sep 11 2014) - (A3 1.28)tv command family overview - $Code$ - //tv command family available for CT_TREE (type 12) - private ["_count","_current","_data","_text","_value","_pic"]; - _CT_TREE tvAdd [ [],"Parent_A"]; - _CT_TREE tvAdd [ [0],"Child_A"]; - _CT_TREE tvAdd [ [0,0],"Grandchild_A"]; - _CT_TREE tvAdd [ [],"Parent_B"]; - _CT_TREE tvAdd [ [1],"Child_B"]; - _count = _CT_TREE tvCount []; //return 2 - _CT_TREE tvSetCurSel [0,0,0]; //select grandchild_A - _current = tvCurSel _CT_TREE; //return [0,0,0] - _CT_TREE tvSetData [_current,"I'm grandchild_A"]; - _data = _CT_TREE tvData _current; // "I'm grandchild_A" - _text = _CT_TREE tvText _current; //"Grandchild_A" - _CT_TREE tvSetValue [_current,14]; - _value = _CT_TREE tvValue _current; // 14 - _CT_TREE tvSetPicture [_current, getText ( configFile "CfgWeapons" "optic_NVS" "picture")]; - _pic = _CT_TREE tvPicture _current; - _CT_TREE tvExpand [1]; - _CT_TREE tvSort [[], false ]; - _CT_TREE tvSortByValue [[], false ]; - _CT_TREE tvDelete [0,0]; //remove child_b - tvClear 12; - _CT_TREE tvCollapse []; - $/Code$ + (June 13, 2017) + Doesn't work with animals. - Number - Number + Nothing + - tvClear + addRating - Removes all items from Tree View with given idc. + Add a number to the rating of a unit - negative values can be used to reduce the rating. + This command is usually used to reward for completed mission objectives. The rating is given at the end of the mission and is automatically adjusted when killing enemies or friendlies. + When the rating gets below -2000, the unit's side switches to "ENEMY" ( sideEnemy ) and the unit is attacked by everyone.(see Rating Values ) + See also: Arma_3:_Event_Handlers#HandleRating - https://community.bistudio.com/wiki/tvClear + https://community.bistudio.com/wiki/addRating - tvClear Number - - tvClear Control + Object addRating Number - tvClear idc - - tvClear control + unitName addRating rating - $Code$tvClear 101;$/Code$ + $Code$player addRating 2000;$/Code$ - local / local + local / global - (Sep 11 2014) - (A3 1.28)tv command family overview - $Code$ - //tv command family available for CT_TREE (type 12) - private ["_count","_current","_data","_text","_value","_pic"]; - _CT_TREE tvAdd [ [],"Parent_A"]; - _CT_TREE tvAdd [ [0],"Child_A"]; - _CT_TREE tvAdd [ [0,0],"Grandchild_A"]; - _CT_TREE tvAdd [ [],"Parent_B"]; - _CT_TREE tvAdd [ [1],"Child_B"]; - _count = _CT_TREE tvCount []; //return 2 - _CT_TREE tvSetCurSel [0,0,0]; //select grandchild_A - _current = tvCurSel _CT_TREE; //return [0,0,0] - _CT_TREE tvSetData [_current,"I'm grandchild_A"]; - _data = _CT_TREE tvData _current; // "I'm grandchild_A" - _text = _CT_TREE tvText _current; //"Grandchild_A" - _CT_TREE tvSetValue [_current,14]; - _value = _CT_TREE tvValue _current; // 14 - _CT_TREE tvSetPicture [_current, getText ( configFile "CfgWeapons" "optic_NVS" "picture")]; - _pic = _CT_TREE tvPicture _current; - _CT_TREE tvExpand [1]; - _CT_TREE tvSort [[], false ]; - _CT_TREE tvSortByValue [[], false ]; - _CT_TREE tvDelete [0,0]; //remove child_b - tvClear 12; - _CT_TREE tvCollapse []; - $/Code$ + (November 16, 2014) + Since there is no setRating command, its expected behaviour can scripted as such: + $Code$BNRG_fnc_setRating = { + _setRating = _this select 0; + _unit = _this select 1; + _getRating = rating _unit; + _addVal = _setRating - _getRating; + _unit addRating _addVal; + }; + [1000,player] call BNRG_fnc_setRating//set player rating 1000$/Code$ + Using this example, no matter what the units rating was before, it will always set its rating to 1000. - Nothing - Nothing + Nothing + - tvCollapseAll + removeCuratorEditableObjects - Collapses all tree items for the given Tree View. + Unregister objects which can be edited by a curator. - https://community.bistudio.com/wiki/tvCollapseAll + https://community.bistudio.com/wiki/removeCuratorEditableObjects - tvCollapseAll Number - - tvCollapseAll Control + Object removeCuratorEditableObjects Array - tvCollapseAll idc - - tvCollapseAll control + curatorObj removeCuratorEditableObjects [[objects],removeCrew] - $Code$tvCollapseAll 101;$/Code$ - - $Code$tvCollapseAll _ctrl;$/Code$ + $Code$curatorModule removeCuratorEditableObjects [[ cursorTarget ],true]$/Code$ - local / local + undefined / undefined + This scripting command must be executed on the server to work properly in multiplayer - Nothing - Nothing + Nothing + - tvCollapse + getAnimSpeedCoef - Collapses tree item pointed to by the path. IDC means id of parent Tree View. + Get coefficient for animation speed. - https://community.bistudio.com/wiki/tvCollapse + https://community.bistudio.com/wiki/getAnimSpeedCoef - tvCollapse Array - - Control tvCollapse Array + getAnimSpeedCoef Object - tvCollapse [idc, path] - - control tvCollapse path + getAnimSpeedCoef unit - $Code$tvCollapse [101, [0]];$/Code$ - - $Code$_ctrl tvCollapse [0];$/Code$ + $Code$getAnimSpeedCoef player ;$/Code$ - local / local + undefined / undefined - (Sep 11 2014) - (A3 1.28)tv command family overview - $Code$ - //tv command family available for CT_TREE (type 12) - private ["_count","_current","_data","_text","_value","_pic"]; - _CT_TREE tvAdd [ [],"Parent_A"]; - _CT_TREE tvAdd [ [0],"Child_A"]; - _CT_TREE tvAdd [ [0,0],"Grandchild_A"]; - _CT_TREE tvAdd [ [],"Parent_B"]; - _CT_TREE tvAdd [ [1],"Child_B"]; - _count = _CT_TREE tvCount []; //return 2 - _CT_TREE tvSetCurSel [0,0,0]; //select grandchild_A - _current = tvCurSel _CT_TREE; //return [0,0,0] - _CT_TREE tvSetData [_current,"I'm grandchild_A"]; - _data = _CT_TREE tvData _current; // "I'm grandchild_A" - _text = _CT_TREE tvText _current; //"Grandchild_A" - _CT_TREE tvSetValue [_current,14]; - _value = _CT_TREE tvValue _current; // 14 - _CT_TREE tvSetPicture [_current, getText ( configFile "CfgWeapons" "optic_NVS" "picture")]; - _pic = _CT_TREE tvPicture _current; - _CT_TREE tvExpand [1]; - _CT_TREE tvSort [[], false ]; - _CT_TREE tvSortByValue [[], false ]; - _CT_TREE tvDelete [0,0]; //remove child_b - tvClear 12; - _CT_TREE tvCollapse []; - $/Code$ - Nothing - Nothing + Number + - tvCount + getPylonMagazines - Returns childrens count of item on given path. IDC means id of parent Tree View. + Return array of magazines on pylons - https://community.bistudio.com/wiki/tvCount + https://community.bistudio.com/wiki/getPylonMagazines - tvCount Array - - Control tvCount Array + getPylonMagazines Object - tvCount [idc, [path]] - - _ctrl tvCount [path] + getPylonMagazines vehicle - $Code$tvCount [101, [0]];$/Code$ - - $Code$_ctrl tvCount [1,0];$/Code$ + $Code$getPylonMagazines ( vehicle player )$/Code$ - local / local + undefined / undefined - (Sep 11 2014) - (A3 1.28)tv command family overview - $Code$ - //tv command family available for CT_TREE (type 12) - private ["_count","_current","_data","_text","_value","_pic"]; - _CT_TREE tvAdd [ [],"Parent_A"]; - _CT_TREE tvAdd [ [0],"Child_A"]; - _CT_TREE tvAdd [ [0,0],"Grandchild_A"]; - _CT_TREE tvAdd [ [],"Parent_B"]; - _CT_TREE tvAdd [ [1],"Child_B"]; - _count = _CT_TREE tvCount []; //return 2 - _CT_TREE tvSetCurSel [0,0,0]; //select grandchild_A - _current = tvCurSel _CT_TREE; //return [0,0,0] - _CT_TREE tvSetData [_current,"I'm grandchild_A"]; - _data = _CT_TREE tvData _current; // "I'm grandchild_A" - _text = _CT_TREE tvText _current; //"Grandchild_A" - _CT_TREE tvSetValue [_current,14]; - _value = _CT_TREE tvValue _current; // 14 - _CT_TREE tvSetPicture [_current, getText ( configFile "CfgWeapons" "optic_NVS" "picture")]; - _pic = _CT_TREE tvPicture _current; - _CT_TREE tvExpand [1]; - _CT_TREE tvSort [[], false ]; - _CT_TREE tvSortByValue [[], false ]; - _CT_TREE tvDelete [0,0]; //remove child_b - tvClear 12; - _CT_TREE tvCollapse []; - $/Code$ + (May 12, 2017) + The indexes of the returned array's elements are relative to the pylon IDs, such that element 0 is pylon 1, element 1 is pylon 2, etc. - Number - Number + Array + - tvCurSel + doArtilleryFire - Returns path to currently selected item. IDC means id of parent Tree View. + Orders a unit to reload defined magazine commence fire burst on the given position (silently). - https://community.bistudio.com/wiki/tvCurSel + https://community.bistudio.com/wiki/doArtilleryFire - tvCurSel Number - - tvCurSel Control + Object doArtilleryFire Array - tvCurSel idc - - tvCurSel control + unit doArtilleryFire [position, type, rounds] - $Code$tvCurSel 101;$/Code$ - - $Code$tvCurSel _ctrl;$/Code$ + $Code$mortar1 doArtilleryFire [[3000, 120, 1000], "8Rnd_82mm_Mo_shells", 3];$/Code$ - local / local + undefined / undefined - (Sep 11 2014) - (A3 1.28)tv command fmily overview - $Code$ - //tv command family available for CT_TREE (type 12) - private ["_count","_current","_data","_text","_value","_pic"]; - _CT_TREE tvAdd [ [],"Parent_A"]; - _CT_TREE tvAdd [ [0],"Child_A"]; - _CT_TREE tvAdd [ [0,0],"Grandchild_A"]; - _CT_TREE tvAdd [ [],"Parent_B"]; - _CT_TREE tvAdd [ [1],"Child_B"]; - _count = _CT_TREE tvCount []; //return 2 - _CT_TREE tvSetCurSel [0,0,0]; //select grandchild_A - _current = tvCurSel _CT_TREE; //return [0,0,0] - _CT_TREE tvSetData [_current,"I'm grandchild_A"]; - _data = _CT_TREE tvData _current; // "I'm grandchild_A" - _text = _CT_TREE tvText _current; //"Grandchild_A" - _CT_TREE tvSetValue [_current,14]; - _value = _CT_TREE tvValue _current; // 14 - _CT_TREE tvSetPicture [_current, getText ( configFile "CfgWeapons" "optic_NVS" "picture")]; - _pic = _CT_TREE tvPicture _current; - _CT_TREE tvExpand [1]; - _CT_TREE tvSort [[], false ]; - _CT_TREE tvSortByValue [[], false ]; - _CT_TREE tvDelete [0,0]; //remove child_b - tvClear 12; - _CT_TREE tvCollapse []; - $/Code$ - Array - Array + Nothing + - tvData + execEditorScript - Returns string data from item on given path. IDC means id of parent Tree View. + Execute an editor script for the specified object. + i + Some Old Editor Command - https://community.bistudio.com/wiki/tvData + https://community.bistudio.com/wiki/execEditorScript - tvData Array - - Control tvData Array + Control execEditorScript Array - tvData [idc, [path]] - - control tvData [path] + map execEditorScript [object,script] - $Code$tvData [101, [0]];$/Code$ - - $Code$(_display displayCtrl 101) tvData [0];$/Code$ + $Code$_map execEditorScript ["_team_1","create"]$/Code$ - local / local + undefined / undefined - (Sep 11 2014) - (A3 1.28)tv command family overview - $Code$ - //tv command family available for CT_TREE (type 12) - private ["_count","_current","_data","_text","_value","_pic"]; - _CT_TREE tvAdd [ [],"Parent_A"]; - _CT_TREE tvAdd [ [0],"Child_A"]; - _CT_TREE tvAdd [ [0,0],"Grandchild_A"]; - _CT_TREE tvAdd [ [],"Parent_B"]; - _CT_TREE tvAdd [ [1],"Child_B"]; - _count = _CT_TREE tvCount []; //return 2 - _CT_TREE tvSetCurSel [0,0,0]; //select grandchild_A - _current = tvCurSel _CT_TREE; //return [0,0,0] - _CT_TREE tvSetData [_current,"I'm grandchild_A"]; - _data = _CT_TREE tvData _current; // "I'm grandchild_A" - _text = _CT_TREE tvText _current; //"Grandchild_A" - _CT_TREE tvSetValue [_current,14]; - _value = _CT_TREE tvValue _current; // 14 - _CT_TREE tvSetPicture [_current, getText ( configFile "CfgWeapons" "optic_NVS" "picture")]; - _pic = _CT_TREE tvPicture _current; - _CT_TREE tvExpand [1]; - _CT_TREE tvSort [[], false ]; - _CT_TREE tvSortByValue [[], false ]; - _CT_TREE tvDelete [0,0]; //remove child_b - tvClear 12; - _CT_TREE tvCollapse []; - $/Code$ - String - String + Any_Value + - tvDelete + groupId - Removes an item with given Tree View Path from Tree View. The paths of other items on the same branch are updated accordingly and may change. + Returns group name. - https://community.bistudio.com/wiki/tvDelete + https://community.bistudio.com/wiki/groupId - tvDelete Array - - Control tvDelete Array + groupId Group - tvDelete [idc, path] + groupId group + + + $Code$_name = groupId ( group player );$/Code$ + + + global / undefined + + + + + String + + + + + + addWeaponItem + + + Adds a weapon item to the specified weapon. The item can be weapon magazine, in which case the amount of ammo and target muzzle could also be specified. + + + https://community.bistudio.com/wiki/addWeaponItem + + + Object addWeaponItem Array + + + unit addWeaponItem [weaponName, itemName] - control tvDelete path + unit addWeaponItem [weaponName, [itemName, ammoCount, muzzleName]] - $Code$tvDelete [101, [0, 0]];$/Code$ + $Code$player addWeaponItem ["arifle_MX_GL_ACO_F", "1Rnd_HE_Grenade_shell"];$/Code$ - $Code$_ctrl tvDelete [0, 0];$/Code$ + $Code$player addWeaponItem ["arifle_MX_GL_ACO_F", ["1Rnd_HE_Grenade_shell", 1, "GL_3GL_F"]];$/Code$ - local / local + local / global - (Sep 11 2014) - (A3 1.28)tv command fmily overview - $Code$ - //tv command family available for CT_TREE (type 12) - private ["_count","_current","_data","_text","_value","_pic"]; - _CT_TREE tvAdd [ [],"Parent_A"]; - _CT_TREE tvAdd [ [0],"Child_A"]; - _CT_TREE tvAdd [ [0,0],"Grandchild_A"]; - _CT_TREE tvAdd [ [],"Parent_B"]; - _CT_TREE tvAdd [ [1],"Child_B"]; - _count = _CT_TREE tvCount []; //return 2 - _CT_TREE tvSetCurSel [0,0,0]; //select grandchild_A - _current = tvCurSel _CT_TREE; //return [0,0,0] - _CT_TREE tvSetData [_current,"I'm grandchild_A"]; - _data = _CT_TREE tvData _current; // "I'm grandchild_A" - _text = _CT_TREE tvText _current; //"Grandchild_A" - _CT_TREE tvSetValue [_current,14]; - _value = _CT_TREE tvValue _current; // 14 - _CT_TREE tvSetPicture [_current, getText ( configFile "CfgWeapons" "optic_NVS" "picture")]; - _pic = _CT_TREE tvPicture _current; - _CT_TREE tvExpand [1]; - _CT_TREE tvSort [[], false ]; - _CT_TREE tvSortByValue [[], false ]; - _CT_TREE tvDelete [0,0]; //remove child_b - tvClear 12; - _CT_TREE tvCollapse []; - $/Code$ - Nothing - Nothing + Nothing + - tvExpand + setEditorMode - Expands tree item pointed to by the path. IDC means id of parent Tree View. + Sets map mode to MAP,3D or PREVIEW. + i + Some Old Editor Command - https://community.bistudio.com/wiki/tvExpand + https://community.bistudio.com/wiki/setEditorMode - tvExpand Array - - Control tvExpand Array + Control setEditorMode String - tvExpand [idc, path] - - control tvExpand path + map setEditorMode mode - $Code$tvExpand [101, [0]];$/Code$ + + + undefined / undefined + + + + + Nothing + + + + + + disableTIEquipment + + + Disables TI (Thermal Imaging) equipment for given vehicle. In older versions of Arma this command would also disable NV (Night Vision), but since Arma 3 v1.52.132676 this command disables only TI. Use disableNVGEquipment to disable NV. + + + https://community.bistudio.com/wiki/disableTIEquipment + + + Object disableTIEquipment Boolean + + + vehicle disableTIEquipment state + + + $Code$vehicle player disableTIEquipment true ;$/Code$ - $Code$_ctrl tvExpand [1];$/Code$ + $Code$_tank disableTIEquipment true ;$/Code$ - local / local + global / global - (Sep 11 2014) - (A3 1.28)tv command family overview - $Code$ - //tv command family available for CT_TREE (type 12) - private ["_count","_current","_data","_text","_value","_pic"]; - _CT_TREE tvAdd [ [],"Parent_A"]; - _CT_TREE tvAdd [ [0],"Child_A"]; - _CT_TREE tvAdd [ [0,0],"Grandchild_A"]; - _CT_TREE tvAdd [ [],"Parent_B"]; - _CT_TREE tvAdd [ [1],"Child_B"]; - _count = _CT_TREE tvCount []; //return 2 - _CT_TREE tvSetCurSel [0,0,0]; //select grandchild_A - _current = tvCurSel _CT_TREE; //return [0,0,0] - _CT_TREE tvSetData [_current,"I'm grandchild_A"]; - _data = _CT_TREE tvData _current; // "I'm grandchild_A" - _text = _CT_TREE tvText _current; //"Grandchild_A" - _CT_TREE tvSetValue [_current,14]; - _value = _CT_TREE tvValue _current; // 14 - _CT_TREE tvSetPicture [_current, getText ( configFile "CfgWeapons" "optic_NVS" "picture")]; - _pic = _CT_TREE tvPicture _current; - _CT_TREE tvExpand [1]; - _CT_TREE tvSort [[], false ]; - _CT_TREE tvSortByValue [[], false ]; - _CT_TREE tvDelete [0,0]; //remove child_b - tvClear 12; - _CT_TREE tvCollapse []; - $/Code$ - Nothing - Nothing + Nothing + + + + + + removeItems + + + Removes all items with given template from the inventory. + + + https://community.bistudio.com/wiki/removeItems + + + Object removeItems String + + + unit removeItems item + + + $Code$player removeItems "FirstAidKit";$/Code$ + + + undefined / undefined + + + + + Nothing + + + + + + addMenuItem + + + Creates a new menu item. Menu can be "file" or "view",index is index,as returned from addMenu command. priority is optional and determines,where in the menu the item will reside (higher priority items first). + i + Some Old Editor Command + + + https://community.bistudio.com/wiki/addMenuItem + + + Control addMenuItem Array + + + map addMenuItem [menu or index,text,command,priority] + + + + + undefined / undefined + + + + + Number + + + + + + ppEffectForceInNVG + + + Forces use of Post process effects in NVG. + + + https://community.bistudio.com/wiki/ppEffectForceInNVG + + + Number ppEffectForceInNVG Boolean + + + number ppEffectForceInNVG bool + + + $Code$_ppGrain ppEffectForceInNVG true ;$/Code$ + + + undefined / undefined + + + + + Nothing + + + + + + setUnconscious + + + Since Arma 3 v1.63.136889, this command sets unit into incapacitated state and lifeState command returns "INCAPACITATED". Animation played while incapacitated depends on the injuries received. + + + https://community.bistudio.com/wiki/setUnconscious + + + Object setUnconscious Boolean + + + unit setUnconscious set + + + $Code$_unit setUnconscious true;$/Code$ + + + local / global + + + + + Nothing + + + + + + getPos + + + Returns the object position in format PositionAGLS. Z value is height over the surface underneath. + Since Arma 3 v1.55.133361, an alternative syntax is added that allows to get position given distance and heading away from original object or position, the equivalent of BIS_fnc_relPos + + + https://community.bistudio.com/wiki/getPos + + + getPos Object/Location + + Object/Position2D/Position3D getPos Array + + + getPos object + + origin getPos [distance, heading] + + + $Code$hintSilent str getPos player ;$/Code$ + + $Code$// getPos vs. other methods (over sea) + diag_log getPos ship; // [2412.01, 6036.33, -0.839965] + diag_log getPosATL ship; // [2412.01, 6036.33, 19.4266] + diag_log getPosASL ship; // [2412.01, 6036.33, -0.920066] + diag_log getPosASLW ship; // [2412.01, 6036.33, -0.865981] + diag_log visiblePosition ship; // [2412.02, 6036.33, -0.837952] + diag_log visiblePositionASL ship; // [2412.02, 6036.33, -0.91798] + diag_log position ship; // [2412.01, 6036.33, -0.839965]$/Code$ + + $Code$// getPos vs. other methods (over land) + diag_log getPos car; // [2508.64, 5681.47, 0.0609589] + diag_log getPosATL car; // [2508.64, 5681.47, 0.0356369] + diag_log getPosASL car; // [2508.64, 5681.47, 71.718] + diag_log getPosASLW car; // [2508.64, 5681.47, 71.718] + diag_log visiblePosition car; // [2508.64, 5681.47, 0.0609512] + diag_log visiblePositionASL car; // [2508.64, 5681.47, 71.718] + diag_log position car; // [2508.64, 5681.47, 0.0609589]$/Code$ + + $Code$// Find position 100 metres and 45 degrees from player position: + player getPos [100,45];$/Code$ + + + global / undefined + + + (16 Feb, 2007) + getPos obj select 2 + might return the vertical position above ground level, but for a stacked object, it returns the vertical position above the object beneath it. The same problem exists for getPosASL. There was a discussion thread in the BIS forums which suggested the use of the command modelToWorld instead to get around this issue where an absolute vertical position is required. ArmA Ver 1.02. + + (6 Feb, 2011) + The z height returned changes dynamically with the height of waves beneath the object, if the object is located over sea. The z height returned by getPosATL and getPosASL does not change like this. This was tested by continuously retrieving the position of a static object, like the cross in the empty/corpses category, placed over sea or land. + getPos behaves similar to + _obj modelToWorld [0.0, 0.0, 0.0] + but it does not give the same result, therefore + (_obj modelToWorld [0.0, 0.0, 0.0]) is not the same as (getPos _obj). + + (23 Nov, 2011) + You can use getPos and setPos on triggers. + + + Array - Array + + + + + + addMagazine + + + Add a magazine to a person. Infantry units can only carry a specific number of magazines, once the magazine slots are filled (or uniform/vest/bagpack are full in Arma3), any further addMagazine commands are ignored. + NOTE: use addMagazine before addWeapon for the weapon to be loaded. + + + https://community.bistudio.com/wiki/addMagazine + + + Object addMagazine String + + Object addMagazine Array + + + unitName addMagazine magazineName + + unitName addMagazine [magazineName, ammoCount] + + + $Code$player addMagazine "30Rnd_556x45_STANAG";$/Code$ + + $Code$player addMagazine ["30Rnd_556x45_STANAG", 15]; // since Arma 2 OA 1.62$/Code$ + + $Code$nonLocalUnit addMagazine ["30Rnd_556x45_STANAG", 15]; // global argument since Arma 3$/Code$ + + $Code$player addMagazine ["30Rnd_556x45_STANAG", 9999]; // will give a 30 rounds magazine anyway$/Code$ + + + local / global + + + (August 2, 2006) + If the unit has magazines already, you may need to use the commands removeMagazine or removeMagazines to make space for the mags you want to add. + + (February 21, 2010) + In turreted vehicles the magazine is added to the first turret with primaryGunner = 1; set in the Vehicles turret config part (and the magazine is ONLY added to the very first turret if more than one is configged with primaryGunner = 1; ). + + (May 12, 2010) + When wanting to add many magazines to an object's init-line it can be easier to use loops than to just repeat the addMagazine command. + If you want to add N magazines to an object either of the two below ways are handy, the first for fewer magazines, and the latter when you want to add many since it then is the easiest of the two to read. + $Code${this addMagazine "magazineClassName"} forEach [1,2,3,...,N]; + for "_i" from 0 to (N - 1) do {this addMagazine "magazineClassName"};$/Code$ + + (November 28, 2017) + If adding a magazine to an empty artillery support with this command in ArmA 3, use reload. If you do not reload, Artillery calls will not fire rounds, because the AI won't reload automatically (tested with 82mm mortar) + + + Nothing - Nothing + + + + + + hint + + + Outputs a multi-line hint message in the left upper corner of the screen (in the right upper corner in Arma). This version of hint is supposed to play a sound when hint is shown, but this varies between games and versions. Use hintSilent for soundless hint. + The effect of this command is local, i.e. the hint will only show on the computer command was executed. + + + https://community.bistudio.com/wiki/hint + + + hint String/Structured_Text + + + hint text + + + $Code$hint "Press W to move forward. \nPress S to move backwards." + outputs the following message: + Press W to move forward. + Press S to move backwards. + Known Problems: Avoid hint messages that exceed the screen, as this may lead to crashes.$/Code$ + + + undefined / local + + + Hint can be used with formatting like this: + $Code$ hint format ["Hello %1", player ]$/Code$ + + To remove the hint box from the screen, pass a null string ( "" ) to the command. + $Code$ hint ""$/Code$ + + hint happily accepts structured text : + $Code$_starL = " img image='\ca\ui\data\debr_star.paa' align='left'/ "; + _starL = _starL + _starL + _starL; + _starR = " img image='\ca\ui\data\debr_star.paa' align='right'/ "; + _starR = _starR + _starR + _starR; + _title = " t color='#ff0000' size='1.2' shadow='1' shadowColor='#000000' align='center' TITLE /t "; + _text = "Bla bla bla bla bla..."; + hint parseText (_starL + _starR + _title + _text); + $/Code$ + (Tested with 1.14, 1.15 beta and 1.16 beta) + + (October 20, 2014) + Be careful when using hints to visualize the effects of commands using the Debug Console. Hint can accept an undefined variable and neither the error nor the hint is shown, the command simply fails. Also notice how the hint command should be "hint str _o;" + $Code$for "_i" from 0 to 50 do + { + hint _o; + };$/Code$ + tested in A3 1.32.127785 In a script, an "undefined variable" error will be shown as expected. + + (October 21, 2014) + Contrary to what's written under "Examples", Arma 3 will happily display hints that far exceed screen space. However, as hints get longer, FPS suffers tremendously. + (tested in Debug Console, A3 1.32.127785, using: + $Code$hint str (( nearestObjects [player, ["BUILDING"], 100]) - [player]); [] spawn { sleep 5; systemChat str diag_fps;}; + hint str (( nearestObjects [player, ["BUILDING"], 1000]) - [player]); [] spawn { sleep 5; systemChat str diag_fps;};$/Code$ + Results were: 59.7015 and 5.17297, respectively. Drawing a hint even longer than this, such as nearestObjects with a radius of 10,000 or 100,000 reduces your FPS so much Arma 3 appears to crash, though it doesn't. + Unrelated: Hints will stay on screen for 30 seconds, then fade away over the course of 5 seconds. Tested with: (A3 1.32.127785) + $Code$hint "a";[] spawn{_counter = 0;while {true} do{sleep 1;_counter = _counter + 1;systemChat str _counter;};};$/Code$ + + (February 17, 2015) + An open dialog will pause the 30-second hint fade timer. + (A3 1.38.128937) + + (March 25, 2017) + The hint sound is audible only when you have the music volume turned up above 0 in the audio settings. Otherwise, it seems to act the same as hintSilent. + This is important because if you are running a hint that fires at 30 fps or more, the hint will slow down machines that have the music volume turned up but won't slow down machines that have the music volume turned off. + Best practice is to use hint for an alert to the player and use hintSilent for a makeshift display of data to the player that is updated fairly often. + + + Nothing + + + + + + setGroupId + + + Sets a group's identity, how it will be displayed in chat, for example. While groups on the different sides can have identical ids, the groups on the same side cannot. When given id exists already, the group which currently has it will simply swap it with the current id of the group for which this id is intended. For example: + $Code$group1 = createGroup west ; + group2 = createGroup west ; + group1 setGroupId ["Active Group"]; + group2 setGroupId ["Inactive Group"]; + systemChat groupId group1; //"Active Group"; + systemChat groupId group2; //"Inactive Group"; + group2 setGroupId ["Active Group"]; + systemChat groupId group1; //"Inactive Group"; + systemChat groupId group2; //"Active Group";$/Code$ + The identity setup could also consist of format keywords (marked with %) and param keywords taken from CfgWorlds config. Basically it is like format command but with some special group keywords. For Arma 3 possible values are: + %GroupSquad + "Squad1" - 1 + "Squad2" - 2 + "Squad3" - 3 + "Squad4" - 4 + %GroupPlatoon + "Platoon1" - 1 + "Platoon2" - 2 + "Platoon3" - 3 + "Platoon4" - 4 + %GroupCompany + "CompanyAlpha" - Alpha + "CompanyBravo" - Bravo + "CompanyCharlie" - Charlie + "CompanyDelta" - Delta + "CompanyEcho" - Echo + "CompanyFoxtrot" - Foxtrot + "CompanyGolf" - Golf + "CompanyHotel" - Hotel + "CompanyIndia" - India + "CompanyKilo" - Kilo + "CompanyLima" - Lima + "CompanyMike" - Mike + "CompanyNovember" - November + "CompanyOscar" - Oscar + "CompanyPapa" - Papa + "CompanyQuebec" - Quebec + "CompanyRomeo" - Romeo + "CompanySierra" - Sierra + "CompanyTango" - Tango + "CompanyUniform" - Uniform + "CompanyVictor" - Victor + "CompanyWhiskey" - Whiskey + "CompanyXray" - X-Ray + "CompanyYankee" - Yankee + "CompanyZulu" - Zulu + %GroupNames + "Alpha" - Alpha + "Bravo" - Bravo + "Charlie" - Charlie + "Delta" - Delta + "Echo" - Echo + "Foxtrot" - Foxtrot + "Golf" - Golf + "Hotel" - Hotel + "November" - November + "Kilo" - Kilo + "Yankee" - Yankee + "Zulu" - Zulu + "Two" - Two + "Three" - Three + "Buffalo" - Buffalo + "Guardian" - Guardian + "Convoy" - Convoy + "Fox" - Fox + %GroupColors + "GroupColor1" - Black + "GroupColor2" - Red + "GroupColor3" - Green + "GroupColor4" - Blue + "GroupColor5" - Yellow + "GroupColor6" - Orange + "GroupColor7" - Pink + "GroupColor0" - + "Six" - Six + For global variant of this command use setGroupIdGlobal. + + + https://community.bistudio.com/wiki/setGroupId + + + Object/Group setGroupId Array + + + group setGroupId [nameFormat, nameParam1,, nameParamN] + + + $Code$// Arma 3 : + group player setGroupId ["Some name for the group"]; + hint groupId group player ; //"Some name for the group" + player sideChat "lalala"; //Some name for the group (KK): "lalala"$/Code$ + + $Code$// Arma 3 : + group player setGroupId ["%GroupNames :=: %GroupColors","Alpha","GroupColor2"]; + hint groupId group player ; //"Alpha :=: Red" + player sideChat "lalala"; //Alpha :=: Red (KK): "lalala"$/Code$ + + $Code$// OFP : + _group1 setGroupId ["Delta","GroupColor4"]$/Code$ + + $Code$// ArmA / ArmA 2 : + _group1 setGroupId ["Assault Squad"]$/Code$ + + + global / local + + + Letter is one of: + "Alpha" + "Bravo" + "Charlie" + "Delta" + "Echo" + "Foxtrot" + "Golf" + "Hotel" + "Kilo" + "Yankee" + "Zulu" + "Buffalo" + "Convoy" + "Guardian" + "November" + "Two" + "Three" + "Fox" + Colour may be one of the following: + "GroupColor0" - (Nothing) + "GroupColor1" - Black + "GroupColor2" - Red + "GroupColor3" - Green + "GroupColor4" - Blue + "GroupColor5" - Yellow + "GroupColor6" - Orange + "GroupColor7" - Pink + "Six" - Six + + (August 4, 2006) + Notes from before the conversion: + Note that this command does not name the group. To call a group "grp1", for example, write this in the init field of the group leader : + grp1 = group this + + (December 9, 2006) + Selfdefined Callsigns: + In Armed Assault you're able to define the callsignletter by yourself. This can be for example "Fireteam", or "Specialforces". + this setgroupId ["Attackteam"] + + In OFP v1.96, the radio callsign strings for a mission can be redefined by creating a stringtable.csv in the mission folder. All string names except FOX can be found within the main stringtable.csv. Note "SIX" has a string suggesting it is a groupname, although the engine uses it as a colour. Some examples of the string names : STR_CFG_GRPNAMES_ALPHA, STR_CFG_GRPNAMES_FOX, STR_CFG_GRPCOL_BLACK, STR_CFG_GRPNAMES_SIX, STR_CFG_FIREFLYBASE, STR_CFG_PAPABEAR, STR_CFG_HQ_BASE, STR_CFG_HQ_BASE. + + (April 21, 2015) + List of available keywords from config: $Code$"if ((configName _x) select [0, 5] == 'group') then { + diag_log ('%' + configName _x); + for '_i' from 0 to count _x - 1 do { + diag_log ('* ""' + configName (_x select _i) + '"" - ' + getText ((_x select _i) 'name')); + }; + }; false" configClasses (configFile "CfgWorlds");$/Code$ + + + Nothing + + + + + + shownWatch + + + Checks if client has Watch enabled in description.ext ( showWatch param) or force enabled with showWatch command. + + + https://community.bistudio.com/wiki/shownWatch + + + shownWatch + + + shownWatch + + + $Code$if ( shownWatch ) then { hint "You have Watch enabled"};$/Code$ + + + undefined / undefined + + + + + Boolean + + + + + + drop + + + Creates a particle effect. + This command is used to create smoke, fire and similar effects. + The particles are single polygons with single textures that always face the player. + They can be set to dynamically change their position, size, direction, can be set to different weights and more or less dependant on the wind. + + + https://community.bistudio.com/wiki/drop + + + drop Array + + + drop array + + + $Code$drop ["cl_basic", "", "Billboard", 1, 1, [-3.5*( sin ( direction xural)), + -3.5*( cos ( direction xural)),0], [ random 0.1, random 0.1, random 0.5], 1, 0.005, 0.0042, + 0.7, [0.3,3], [[0.5,0.5,0.5,0],[0.7,0.7,0.7,0.5],[0.9,0.9,0.9,0]], [0,1,0,1,0,1], + 0.2, 0.2, "", "", xural]$/Code$ + + + undefined / local + + + + + Nothing + + + + + + groupOwner + + + Returns ID of client to which the group is local. Can be run only from server. When called from client, it always returns 0 + + + https://community.bistudio.com/wiki/groupOwner + + + groupOwner Group + + + groupOwner group + + + $Code$_clientID = groupOwner _someGroup;$/Code$ + + + global / undefined + + + This scripting command must be executed on the server to work properly in multiplayer + + + Number + + + + + + attackEnabled + + + Return whether a group's leader can issue attack commands to soldiers under his command. + + + https://community.bistudio.com/wiki/attackEnabled + + + attackEnabled Object/Group + + + attackEnabled name + + + $Code$if (not attackEnabled _soldier) then {_soldier setCombatMode "Careless"}$/Code$ + + + global / undefined + + + + + Boolean + + + + + + setMarkerAlphaLocal + + + Sets the marker alpha. The marker is only modified on the computer where the command is called. + When alpha equals 1, the marker is visible, but if alpha equals 0, then the marker is invisible. + Alpha can be numbers and fractions. + + + https://community.bistudio.com/wiki/setMarkerAlphaLocal + + + String setMarkerAlphaLocal Number + + + marker setMarkerAlphaLocal alpha + + + $Code$"my_marker" setMarkerAlphaLocal 0.5;$/Code$ + + $Code$"enemy_convoy_marker" setMarkerAlphaLocal 0;$/Code$ + + + undefined / local + + + (January 7, 2010) + + The range for 'alpha' is 0... 1 + + + Nothing + + + + + + removeOwnedMine + + + Removes ownership over a remotely detonatable mine from the unit. + + + https://community.bistudio.com/wiki/removeOwnedMine + + + Object removeOwnedMine Object + + + unit removeOwnedMine mine + + + $Code$player removeOwnedMine SuperMine;$/Code$ + + + undefined / undefined + + + + + Nothing + + + + + + vehicles + + + Returns an array of all vehicles available to current client. This command returns both empty and crewed vehicles but not soldiers. It will also return "WeaponHolderSimulated" of dead bodies (weapon on the ground). Vehicles created with createVehicleLocal will only be returned on the client that created them. + + + https://community.bistudio.com/wiki/vehicles + + + vehicles + + + vehicles + + + $Code$_vehicles = vehicles ;$/Code$ + + + undefined / local + + + + + Array + + + + + + canFire + + + Returns true if the given vehicle is still able to fire. For the command to return true, vehicle must be alive, have weapon operator and the weapon cannot be damaged = 0.9 but can be empty due to running out of ammo. If mission starts with vehicle having no ammo or setVehicleAmmo 0 command is executed on the vehicle, then canFire will always report false for it. + + + https://community.bistudio.com/wiki/canFire + + + canFire Object + + + canFire unitName + + + $Code$// SQS: + ?!( canFire _tank) : player sideChat "Tank disabled!"$/Code$ + + $Code$// SQF: + if ( ! ( canFire _tank)) then { + player sideChat "Tank disabled!"; + };$/Code$ + + + global / undefined + + + (07:16, 20 January 2007 (CEST)) + true even if unit is out of ammo. Only false if gun is damaged. + + (05:20, 24 August 2008 (CEST)) + False if there is no gunner in the vehicle, regardless of damage level. + + (07:20, 23 April 2018 (UTC)) + This command seems to have evolved. Returns "true" (on Hunter, Ifrit) even if Gun's damage is set to 1 and turret also, as far there is a gunner. The only way to obtain a canFire "false" is to make the crew disembark (2 burned tires for example). Then no matter the gun state, if the gunner disembarks without order, the vehicle can't fire. In this case: can't move can't fire. + NB: if you jump into a hunter HMG after having setHitPointDamage(d) "hitTurret" and "hitGun" to 1, the turret can't rotate any more, the gun is pitched down but you can fire (trigger) to the ground. Difficult to check the behavior for each vehicles. + + + Boolean + - tvExpandAll + vestItems - Expands all tree items for the given Tree View. + Get array with all items (of any kind, even weapons) from vest. - https://community.bistudio.com/wiki/tvExpandAll + https://community.bistudio.com/wiki/vestItems - tvExpandAll Number - - tvExpandAll Control + vestItems Object - tvExpandAll idc - - tvExpandAll control + vestItems unit - $Code$tvExpandAll 101;$/Code$ - - $Code$tvExpandAll _ctrl;$/Code$ + $Code$vestItems player ;[ + "30Rnd_65x39_caseless_mag", + "30Rnd_65x39_caseless_mag", + "16Rnd_9x21_Mag", + "16Rnd_9x21_Mag", + "HandGrenade", + "HandGrenade", + "SmokeShell", + "SmokeShellGreen", + "Chemlight_green", + "Chemlight_green" + ]$/Code$ - local / local + undefined / undefined - Nothing - Nothing + Array + - tvPicture + ctrlSetEventHandler - Returns name of picture from item pointed to by path. IDC means id of parent Tree View. + Sets given event handler of given control. + The provided function should return true/false indicating that the event has handled this event fully or not and whether the engine should execute it's default code or not afterwards. + See User Interface Event Handlers for the full list of handler names. + If applicable, see DIK_KeyCodes for a list of key code constants, which are relevant to key related user interface events like: KeyDown & KeyUp. - https://community.bistudio.com/wiki/tvPicture + https://community.bistudio.com/wiki/ctrlSetEventHandler - tvPicture Array - - Control tvPicture Array + Control ctrlSetEventHandler Array - tvPicture [idc, [path]] - - _ctrl tvPicture [path] + controlName ctrlSetEventHandler [handlerName, function] - $Code$tvPicture [101, [0]];$/Code$ + $Code$_control ctrlSetEventHandler ["KeyDown", ""]$/Code$ - $Code$_ctrl tvPicture [0,0,0];$/Code$ + $Code$(_display displayCtrl 108) ctrlSetEventHandler ["LBSelChanged","['ListChange',_this] call FireEvents"];$/Code$ - local / local + undefined / undefined - (Sep 11 2014) - (A3 1.28)tv command family overview - $Code$ - //tv command family available for CT_TREE (type 12) - private ["_count","_current","_data","_text","_value","_pic"]; - _CT_TREE tvAdd [ [],"Parent_A"]; - _CT_TREE tvAdd [ [0],"Child_A"]; - _CT_TREE tvAdd [ [0,0],"Grandchild_A"]; - _CT_TREE tvAdd [ [],"Parent_B"]; - _CT_TREE tvAdd [ [1],"Child_B"]; - _count = _CT_TREE tvCount []; //return 2 - _CT_TREE tvSetCurSel [0,0,0]; //select grandchild_A - _current = tvCurSel _CT_TREE; //return [0,0,0] - _CT_TREE tvSetData [_current,"I'm grandchild_A"]; - _data = _CT_TREE tvData _current; // "I'm grandchild_A" - _text = _CT_TREE tvText _current; //"Grandchild_A" - _CT_TREE tvSetValue [_current,14]; - _value = _CT_TREE tvValue _current; // 14 - _CT_TREE tvSetPicture [_current, getText ( configFile "CfgWeapons" "optic_NVS" "picture")]; - _pic = _CT_TREE tvPicture _current; - _CT_TREE tvExpand [1]; - _CT_TREE tvSort [[], false ]; - _CT_TREE tvSortByValue [[], false ]; - _CT_TREE tvDelete [0,0]; //remove child_b - tvClear 12; - _CT_TREE tvCollapse []; - $/Code$ + The article User Interface Event Handlers contains a list of event handler names. + Be aware though, that the preceding "on" in the listed names must be eliminated when used with the ctrlSetEventHandler command. + e.g. instead of $Code$ _control ctrlSetEventHandler [" OnLBSelChanged ", ""]; // WRONG $/Code$ + use + $Code$ _control ctrlSetEventHandler [" LBSelChanged ", ""]; // RIGHT $/Code$ - String - String + Nothing + - tvSetColor + modelToWorldVisualWorld - Sets text color on given Tree View Item + Converts position from object model space to world space in render time. - https://community.bistudio.com/wiki/tvSetColor + https://community.bistudio.com/wiki/modelToWorldVisualWorld - tvSetColor Array - - Control tvSetColor Array + Object modelToWorldVisualWorld Array - tvSetColor [idc, path, color] - - control tvSetColor [path, color] + obj modelToWorldVisualWorld modelPos - $Code$tvSetColor [101, [0,0], [1,0,0,1]];$/Code$ - - $Code$_ctrl tvSetColor [[0,0], [1,0,0,1]];$/Code$ + $Code$player modelToWorldVisualWorld [0,1,0]$/Code$ undefined / undefined + (May 28, 2017) + This command produces identical result to modelToWorldVisual command used in conjunction with AGLToASL + $Code$obj modelToWorldVisualWorld [1,2,3] isEqualTo AGLToASL (obj modelToWorldVisual [1,2,3]); // true$/Code$ - Nothing - Nothing + Array + - tvSetCurSel + param - Sets cursor to given item on given path. IDC means id of parent Tree View. To deselect all items use [-1] for the path param ( available since Arma 3 v1.55.133898 ) + Extracts a single value with given index from input argument, similar to BIS_fnc_param. When used without argument, as shown in main syntax, internal variable _this, which is usually available inside functions and event handlers, is used as argument. If input argument is not an array, it will be converted to 1 element array. + If extracted item of input with given index is undefined, of the wrong type or of the wrong length (if the item is an array), default value is used instead. Since Arma 3 v1.53.132691, onscreen errors are displayed for when the input is of the wrong type or size. - https://community.bistudio.com/wiki/tvSetCurSel + https://community.bistudio.com/wiki/param - tvSetCurSel Array + param Array - Control tvSetCurSel Array + Anything param Array - tvSetCurSel [idc, path] + param [index, defaultValue, expectedDataTypes, expectedArrayCount] - control tvSetCurSel path + argument param [index, defaultValue, expectedDataTypes, expectedArrayCount] - $Code$tvSetCurSel [101, [0]];$/Code$ + $Code$[1, 2, 3] call + { + private _one = param [0, 1]; + private _two = param [1, 2]; + private _three = param [2, 3]; + //..... + };$/Code$ - $Code$_ctrl tvSetCurSel [0,0,0];$/Code$ + $Code$[123] call + { + private _val = param [0]; + }; + // Below would produce the same result as above + 123 call + { + private _val = param [0]; + };$/Code$ - $Code$[] spawn + $Code$_z = position player param [2, 0]; + if (_z 10) then { - disableSerialization ; - _CT_TREE = findDisplay 46 ctrlCreate ["RscTree", -1]; - _CT_TREE ctrlSetPosition [0,0,0.3,1]; - _CT_TREE ctrlCommit 0; - _CT_TREE tvAdd [[],"Parent_A"]; - _CT_TREE tvAdd [[0],"Child_A"]; - _CT_TREE tvAdd [[0,0],"Grandchild_A"]; - _CT_TREE tvAdd [[],"Parent_B"]; - _CT_TREE tvAdd [[1],"Child_B"]; - sleep 1; - hint "SELECT [0,0,0]"; - _CT_TREE tvSetCurSel [0,0,0]; - sleep 2; - hint "DESELECT ALL"; - _CT_TREE tvSetCurSel [-1]; + hint "YOU ARE FLYING!"; };$/Code$ + + $Code$fnc = + { + private _pos = param [0, [0,0,0], [ objNull, []], [2,3]]; + private _rad = param [1, 0, [0]]; + _pos nearObjects _rad; + }; + [ position player, 25] call fnc; //ok + [ player, 25] call fnc; //ok + [25, player ] call fnc; //default values are used$/Code$ undefined / undefined - (Sep 11 2014) - (A3 1.28)tv command family overview - $Code$ - //tv command family available for CT_TREE (type 12) - private ["_count","_current","_data","_text","_value","_pic"]; - _CT_TREE tvAdd [[],"Parent_A"]; - _CT_TREE tvAdd [[0],"Child_A"]; - _CT_TREE tvAdd [[0,0],"Grandchild_A"]; - _CT_TREE tvAdd [[],"Parent_B"]; - _CT_TREE tvAdd [[1],"Child_B"]; - _count = _CT_TREE tvCount []; //return 2 - _CT_TREE tvSetCurSel [0,0,0]; //select grandchild_A - _current = tvCurSel _CT_TREE; //return [0,0,0] - _CT_TREE tvSetData [_current,"I'm grandchild_A"]; - _data = _CT_TREE tvData _current; // "I'm grandchild_A" - _text = _CT_TREE tvText _current; //"Grandchild_A" - _CT_TREE tvSetValue [_current,14]; - _value = _CT_TREE tvValue _current; // 14 - _CT_TREE tvSetPicture [_current, getText ( configFile "CfgWeapons" "optic_NVS" "picture")]; - _pic = _CT_TREE tvPicture _current; - _CT_TREE tvExpand [1]; - _CT_TREE tvSort [[], false ]; - _CT_TREE tvSortByValue [[], false ]; - _CT_TREE tvDelete [0,0]; //remove child_b - tvClear 12; - _CT_TREE tvCollapse []; + (November 8, 2016) + You can also use param in a complex with another commands. For example call, compile and format : + $Code$["var = 2"] call { + call compile format ["%1", param [0,"",[""]]]; // compiled param string value + hint str (var); // 2 + }; $/Code$ - Nothing - Nothing + Anything - Anything + - tvSetData + getRemoteSensorsDisabled - Sets string data to item on given path. IDC means id of parent Tree View. + Get status of disabled raycasts for remote entities. See disableRemoteSensors for detailed description. - https://community.bistudio.com/wiki/tvSetData + https://community.bistudio.com/wiki/getRemoteSensorsDisabled - tvSetData Array - - Control tvSetData Array + getRemoteSensorsDisabled - tvSetData [idc, [path], data] - - _ctrl tvSetData [ [path], data] + getRemoteSensorsDisabled - $Code$tvSetData [101, [0], "Test data"];$/Code$ - - $Code$_ctrl tvSetData [ [0,0,0], "Test data"];$/Code$ + $Code$_status = getRemoteSensorsDisabled ;$/Code$ - local / local + undefined / undefined - (Sep 11 2014) - (A3 1.28)tv command family overview - $Code$ - //tv command family available for CT_TREE (type 12) - private ["_count","_current","_data","_text","_value","_pic"]; - _CT_TREE tvAdd [ [],"Parent_A"]; - _CT_TREE tvAdd [ [0],"Child_A"]; - _CT_TREE tvAdd [ [0,0],"Grandchild_A"]; - _CT_TREE tvAdd [ [],"Parent_B"]; - _CT_TREE tvAdd [ [1],"Child_B"]; - _count = _CT_TREE tvCount []; //return 2 - _CT_TREE tvSetCurSel [0,0,0]; //select grandchild_A - _current = tvCurSel _CT_TREE; //return [0,0,0] - _CT_TREE tvSetData [_current,"I'm grandchild_A"]; - _data = _CT_TREE tvData _current; // "I'm grandchild_A" - _text = _CT_TREE tvText _current; //"Grandchild_A" - _CT_TREE tvSetValue [_current,14]; - _value = _CT_TREE tvValue _current; // 14 - _CT_TREE tvSetPicture [_current, getText ( configFile "CfgWeapons" "optic_NVS" "picture")]; - _pic = _CT_TREE tvPicture _current; - _CT_TREE tvExpand [1]; - _CT_TREE tvSort [[], false ]; - _CT_TREE tvSortByValue [[], false ]; - _CT_TREE tvDelete [0,0]; //remove child_b - tvClear 12; - _CT_TREE tvCollapse []; - $/Code$ - Nothing - Nothing + Boolean + - tvSetPictureColorDisabled + enableMimics - Sets the color of left picture of a tree item defined by path when item is disabled + Enables/disables mimics on a given unit. - https://community.bistudio.com/wiki/tvSetPictureColorDisabled + https://community.bistudio.com/wiki/enableMimics - Control tvSetPictureColorDisabled Array + Object enableMimics Boolean - control tvSetPictureColorDisabled [path, color] + unit enableMimics enabled - $Code$_control tvSetPictureColorDisabled [[0], [1,0,1,1]]$/Code$ + $Code$cursorTarget enableMimics false ;$/Code$ undefined / undefined @@ -71254,444 +73702,494 @@ - Nothing + Nothing + - tvSetPictureColorSelected + rotorsForcesRTD - Sets the color of the left picture of a tree item defined by path when item is selected + Returns force produced by rotors. - https://community.bistudio.com/wiki/tvSetPictureColorSelected + https://community.bistudio.com/wiki/rotorsForcesRTD - Control tvSetPictureColorSelected Array + rotorsForcesRTD Object - control tvSetPictureColorSelected [path, color] + rotorsForcesRTD RTD_helicopter - $Code$_control tvSetPictureColorSelected [[0], [1,0,1,1]]$/Code$ + $Code$_rotorForces = rotorsForcesRTD _taru// Returns [[-465.981,351.941,45960.5],[-469.079,397.451,46933.3]]$/Code$ undefined / undefined + (November 4, 2014) + There is no official information I can find on what these values mean. According to my testing on the Mi-290 Taru, here is what I have come up with: + $Code$[[ rotor 1 roll +right/-left, rotor 1 pitch +down/-up, rotor 1 collective +up/-down ], + [ rotor 2 roll +right/-left, rotor 2 pitch +down/-up, rotor 2 collective +up/-down ]]$/Code$ + When yawing left and right, rotor 1 and 2 collective differ from each other. This is normal behaviour with coaxial rotors. Yawing right increase rotor 1 collective and decreases rotor 2 collective. Yawing left does the opposite. Rotor 1 in this example seems to be the bottom rotor. - Nothing + Array + - tvSetPictureColor + mapAnimCommit - Sets the colour of the picture (set via tvSetPicture ) under the specified tree view path. + Play map animation. - https://community.bistudio.com/wiki/tvSetPictureColor + https://community.bistudio.com/wiki/mapAnimCommit - tvSetPictureColor Array - - Control tvSetPictureColor Array + mapAnimCommit - tvSetPictureColor [idc, path, color] - - ctrl tvSetPictureColor [path, color] + mapAnimCommit - $Code$tvSetPictureColor [101, [0,2], [1,0,1,1]];$/Code$ - - $Code$_tree tvSetPictureColor [[0,2], [1,0,1,1]];$/Code$ - + local / local + In OFP v1.96, the mapAnim series of commands, together with forceMap can only be used in the intro and mission, as it is not possible to access the map from the outro. (not checked, sourced from an old copy of the OFPEC comref) - Nothing - Nothing + Nothing + - tvSetPictureRightColor + pushBack - Sets color of the right picture on the tree view item defined by path + Insert an element to the back of the given array. This command modifies the original array. (see also: pushBackUnique ) - https://community.bistudio.com/wiki/tvSetPictureRightColor + https://community.bistudio.com/wiki/pushBack - tvSetPictureRightColor Array - - Control tvSetPictureRightColor Array + Array pushBack Anything - tvSetPictureRightColor [idc, path, color] - - control tvSetPictureRightColor [path, color] + array pushBack element - $Code$tvSetPictureRightColor [101, [0], [1,0,1,1]];$/Code$ + $Code$_arr = [1,2,3]; + _arr pushBack 4; + hint str _arr; //[1,2,3,4]$/Code$ - $Code$_ctrl tvSetPictureRightColor [[0], [1,0,1,1]];$/Code$ + $Code$_arr = [1,[2,4],3]; + (_arr select 1) pushBack [5,6]; + hint str _arr //[1,[2,4,[5,6]],3]$/Code$ undefined / undefined + (Aug 1, 2014) + (A3 1.26) It is recommended to use pushBack instead of BIS_fnc_arrayPush. + $Code$_array = [1,2,3]; + _array pushBack 4; //same as [_array, 4] call BIS_fnc_arrayPush ; + $/Code$ + + (August 23, 2014) + It's highly recommended to use the new pushBack command, up to 43% faster than set and up to 11843% faster a plus b ! + + (November 26, 2014) + pushBack does not support nil while set and a plus b do. For example: + $Code$_array = []; + for "_i" from 0 to 3 do + { + _array pushBack nil ; + }; + hint str _array; // hint is []$/Code$ + + (May 21, 2015) + Array "push" implementation using pushBack, alternative to BIS_fnc_arrayPush + $Code$KK_fnc_push = { + _this select 0 pushBack (_this select 1); + _this select 0 + }; + // Example + arr = [1,2,3]; + [arr, 4] call KK_fnc_push; //both arr and return of function are now [1,2,3,4]$/Code$ + + (October 5, 2016) + Note that pushBack does not create a new object. + Therefore, if you edit an object that was pushed back to an array, it also affects the object in the array. + e.g. + $Code$_first_squence = [1,2,3]; + _second_squence = [5,4]; + _first_squence pushBack _second_squence; + systemChat str _first_squence // prints [1,2,3,[5,4]]] + reverse _second_squence; + systemChat str _first_squence // prints [1,2,3,[4,5]]] + $/Code$ + If you pushBack an array for instance, you can just copy it to generate a new object. + e.g. + $Code$_first_squence pushBack +_second_squence; + $/Code$ - Nothing - Nothing + Number + - tvSetPictureRightColorDisabled + ctrlMapAnimAdd - Sets the color of the right picture of a tree item defined by path when item is disabled + Adds the next frame to the map animation. - https://community.bistudio.com/wiki/tvSetPictureRightColorDisabled + https://community.bistudio.com/wiki/ctrlMapAnimAdd - Control tvSetPictureRightColorDisabled Array + Control ctrlMapAnimAdd Array - control tvSetPictureRightColorDisabled [path, color] + map ctrlMapAnimAdd [time, zoom, position] - $Code$_control tvSetPictureRightColorDisabled [[0], [1,0,1,1]]$/Code$ + $Code$_map ctrlMapAnimAdd [1, 0.1, getMarkerPos "anim1"]; + ctrlMapAnimCommit _map;$/Code$ + + $Code$// Center map on player: + _ctrl ctrlMapAnimAdd [0, 0.05, player ]; + ctrlMapAnimCommit _ctrl;$/Code$ - undefined / undefined + local / local + (17:11, 9 March 2010) + Besides Position2D, both Objects and Position3D work. + + (03:48, 27 August 2017) + Map control created with ctrlCreate have a weird behaviour. Control doesn't respect the aspects of Controls Group or Display itself. Results of ctrlMapAnimAdd applied to this control are also shifted for some reason. - Nothing + Nothing + - tvSetPictureRightColorSelected + assignTeam - Sets the color of the right picture of a tree item defined by path when item is selected + Assigns the unit (in case of a vehicle, its commander) to the given team. Team is an option in group control (unit management) menu that allows to split player group in teams and then give bulk order to separate teams. In order to operate properly, the command requires specific conditions: + The command requires player to be fully initialised + The unit getting assigned must be either player himself or a unit in player's group + Units in player's group as well as player himself can all have different teams assigned + The colour of the assigned team for a unit is seen on the group management UI as well as squad radar + The possible team values (colours) are: + "MAIN" - (white) + "RED" - (red) + "GREEN" - (green) + "BLUE" - (blue) + "YELLOW" - (yellow) + NOTE : In older version of the game the effect of this command is local - https://community.bistudio.com/wiki/tvSetPictureRightColorSelected + https://community.bistudio.com/wiki/assignTeam - Control tvSetPictureRightColorSelected Array + Object assignTeam String - control tvSetPictureRightColorSelected [path, color] + unit assignTeam team - $Code$_control tvSetPictureRightColorSelected [[0], [1,0,1,1]]$/Code$ + $Code$_soldier2 assignTeam "RED";$/Code$ - undefined / undefined + global / global + (July 12, 2016) + Since Arma 3 v1.62 this command has global effects and is persistent even on machines that join in progress. - Nothing + Nothing + - tvSetPictureRight + ammo - Sets right picture on the tree view item defined by path + Check how many rounds are left in the currently loaded magazine in the given muzzle. Since Arma v1.55.133505 the command also returns ammo for units in vehicles. - https://community.bistudio.com/wiki/tvSetPictureRight + https://community.bistudio.com/wiki/ammo - tvSetPictureRight Array - - Control tvSetPictureRight Array + Object ammo String - tvSetPictureRight [idc, path, name] - - control tvSetPictureRight [path, name] + unit ammo muzzle - $Code$tvSetPictureRight [101, [0], "picture"];$/Code$ + $Code$_count = player ammo "M16"; //returns 30 in case of a full magazine$/Code$ - $Code$_ctrl tvSetPictureRight [[0], "picture"];$/Code$ + $Code$_count = player ammo "M203Muzzle";$/Code$ + + $Code$_count = player ammo primaryWeapon player ;$/Code$ - undefined / undefined + global / undefined + (February 17, 2012) + OA 1.60 : The command works (now?) also for units in vehicles. However only for the vehicle's gunners' weapons - aka those returned by "weapons vehicle". - Nothing - Nothing + Number + - tvSetPicture + setShotParents - Sets picture to item selected by path. IDC means id of parent Tree View. Name is picture name. The picture is searched in the mission directory. + Sets vehicle and instigator pair for the given projectile. - https://community.bistudio.com/wiki/tvSetPicture - - - tvSetPicture Array - - Control tvSetPicture Array - - - tvSetPicture [idc, path, name] - - control tvSetPicture [path, name] - - - $Code$tvSetPicture [101, [0], "picture"];$/Code$ - - $Code$_ctrl tvSetPicture [[0,0,0], getText ( configFile "CfgWeapons" "optic_NVS" "picture")];$/Code$ - - - undefined / undefined - - - (Sep 11 2014) - (A3 1.28)tv command family overview - $Code$ - //tv command family available for CT_TREE (type 12) - private ["_count","_current","_data","_text","_value","_pic"]; - _CT_TREE tvAdd [ [],"Parent_A"]; - _CT_TREE tvAdd [ [0],"Child_A"]; - _CT_TREE tvAdd [ [0,0],"Grandchild_A"]; - _CT_TREE tvAdd [ [],"Parent_B"]; - _CT_TREE tvAdd [ [1],"Child_B"]; - _count = _CT_TREE tvCount []; //return 2 - _CT_TREE tvSetCurSel [0,0,0]; //select grandchild_A - _current = tvCurSel _CT_TREE; //return [0,0,0] - _CT_TREE tvSetData [_current,"I'm grandchild_A"]; - _data = _CT_TREE tvData _current; // "I'm grandchild_A" - _text = _CT_TREE tvText _current; //"Grandchild_A" - _CT_TREE tvSetValue [_current,14]; - _value = _CT_TREE tvValue _current; // 14 - _CT_TREE tvSetPicture [_current, getText ( configFile "CfgWeapons" "optic_NVS" "picture")]; - _pic = _CT_TREE tvPicture _current; - _CT_TREE tvExpand [1]; - _CT_TREE tvSort [[], false ]; - _CT_TREE tvSortByValue [[], false ]; - _CT_TREE tvDelete [0,0]; //remove child_b - tvClear 12; - _CT_TREE tvCollapse []; - $/Code$ + https://community.bistudio.com/wiki/setShotParents + + + Object setShotParents Array + + + projectile setShotParents [vehicle, instigator] + + + $Code$myProjectile setShotParents [ vehicle bob, bob];$/Code$ + + $Code$tank addEventHandler ["Fired", {_this select 6 setShotParents [tank, commander tank]];$/Code$ + + + global / global + + + This scripting command must be executed on the server to work properly in multiplayer - Nothing - Nothing + Nothing + - tvSetText + setSide - Sets string text to item on given path. IDC means id of parent Tree View. + Sets a location's side. The default side is Unknown. - https://community.bistudio.com/wiki/tvSetText + https://community.bistudio.com/wiki/setSide - tvSetText Array - - Control tvSetText Array + Location setSide Side - tvSetText [idc, path, text] - - control tvSetText [path, text] + location setSide side - $Code$tvSetText [101, [0], "Test data"];$/Code$ - - $Code$_ctrl tvSetText [[0,0,0], "Test data"];$/Code$ + $Code$myLocation setSide resistance$/Code$ undefined / undefined + (16:00, 3 December 2013 (CEST)) + For units, vehicles you can use: " array joinSilent createGroup Side ", e.g. in init: "[this] joinSilent createGroup EAST;" described in the note below + + (19:05, 6 August 2009 (CEST)) + This is a frequent question on OFPEC, but produced here because it was difficult to find an answer to. setSide does not work for men, vehicles, etc.: it is intended for locations ( i.e., territory). If you want to switch a unit's ( e.g., the player's) side in the middle of a battle, make the unit joinSilent a group on the given side instead. If you want the unit to become the group leader after joining, use selectLeader. I haven't tested the idea of spawning a temporary unit of that side, assigning the player to that unit, setting the player as the leader, then deleting the original unit, but I don't see why it wouldn't work. (It begs the question why we don't have a setSide object function, though.) - Nothing - Nothing + Nothing + - tvSetTooltip + setDir - Sets the tooltip text associated with the specified tree view path. + Sets object heading. Angles are measured in degrees clockwise from north, and regular range goes from 0 to 360 (0° = N, 90° = E, 180° = S, 270° = W). Negative angles represent a counter-clockwise angle. - https://community.bistudio.com/wiki/tvSetTooltip + https://community.bistudio.com/wiki/setDir - tvSetTooltip Array - - Control tvSetTooltip Array + Object setDir Number - tvSetTooltip [idc, path, text] - - ctrl tvSetTooltip [path, text] + object setDir heading - $Code$tvSetTooltip [101, [0,2], "This is a tooltip"];$/Code$ + $Code$unit1 setDir 45; // will set unit1 to face North-East$/Code$ - $Code$_tree tvSetTooltip [[0,2], "This is a tooltip"];$/Code$ + $Code$unit1 setDir -675; // will also set unit1 to face North-East (= 45-360-360)$/Code$ + + $Code$unit1 setDir 30; + unit1 setFormDir 30; // needed for AI to keep the given direction$/Code$ - undefined / undefined + local / global + (May 9, 2007) + Though effects of this command remain local, you can do a setPos afterwards to synchronize the direction on all machines in MP. + $Code$myObj setDir 90; + myObj setPos getPos myObj;$/Code$ + + (January 9, 2009) + In ArmA, the effect of setDir is synchronized across the network. + + (April 5th, 2011) + In OA 1.59 the comment of Manny still holds true for createVehicle 'd empty vehicles by the server. + For the player object a local setDir alone is enough. + + (November 25, 2013) + In Arma 3, setDir affects vectorUp, vectorDir and velocity of the object it applied to. While this is not noticeable with stationary objects, a moving objects will have its orientation and velocity reset. So if you are planning on using setDir on a moving object, make sure you read the velocity value before and restore it after if you want the object to continue to move. + $Code$_vel = velocity _object; + _object setDir 45; + _object setVelocity _vel;$/Code$ + With orientation it is a bit more complicated. setDir resets vectorUp to [0,0,1] and changes vectorDir accordingly to accommodate set direction. If your object's vectorUp is not [0,0,1] and you want to keep it this way, then you have to use setVectorDirAndUp to change object's direction not setDir. This is also the reason why it is better to use setVectorDirAndUp instead of setDir on attached objects for a better control of object's orientation. + + (November 27, 2013) + Make sure you setDir BEFORE you set position. Setting direction after set position could lead to unpredictable behaviour. For example main part of the hospital building in Arma 3 can lose collision detection near both side entrances. AI will also get confused and will stop detecting obstacles if setDir is called after setPos. + + (February 9, 2018) + setDir is not propagated across the network when used on mines. Clients will see mines facing zero. This is especially noticeable on tripwire mines. + Use remoteExec to run the setDir command on the mine for all clients. - Nothing - Nothing + Nothing + - tvSetValue + createMarker - Sets scalar data to item on given path. IDC means id of parent Tree View. If the given value is not integer, it will be converted to integer + Creates a new marker at the given position. The marker name has to be unique. - https://community.bistudio.com/wiki/tvSetValue + https://community.bistudio.com/wiki/createMarker - tvSetValue Array - - Control tvSetValue Array + createMarker Array - tvSetValue [idc, [path], val] - - _ctrl tvSetValue [ [path], val] + createMarker [name, position] - $Code$tvSetValue [101, [0], 555];$/Code$ + $Code$_marker1 = createMarker ["Marker1", position player ];$/Code$ - $Code$_ctrl tvSetValue [ [0,0,0], 14];$/Code$ + $Code$_marker2 = createMarker ["Marker2", player ];$/Code$ - local / local + undefined / global - (September 11, 2014) - (A3 1.28)tv command family overview - $Code$ - //tv command family available for CT_TREE (type 12) - private ["_count","_current","_data","_text","_value","_pic"]; - _CT_TREE tvAdd [ [],"Parent_A"]; - _CT_TREE tvAdd [ [0],"Child_A"]; - _CT_TREE tvAdd [ [0,0],"Grandchild_A"]; - _CT_TREE tvAdd [ [],"Parent_B"]; - _CT_TREE tvAdd [ [1],"Child_B"]; - _count = _CT_TREE tvCount []; //return 2 - _CT_TREE tvSetCurSel [0,0,0]; //select grandchild_A - _current = tvCurSel _CT_TREE; //return [0,0,0] - _CT_TREE tvSetData [_current,"I'm grandchild_A"]; - _data = _CT_TREE tvData _current; // "I'm grandchild_A" - _text = _CT_TREE tvText _current; //"Grandchild_A" - _CT_TREE tvSetValue [_current,14]; - _value = _CT_TREE tvValue _current; // 14 - _CT_TREE tvSetPicture [_current, getText ( configFile "CfgWeapons" "optic_NVS" "picture")]; - _pic = _CT_TREE tvPicture _current; - _CT_TREE tvExpand [1]; - _CT_TREE tvSort [[], false ]; - _CT_TREE tvSortByValue [[], false ]; - _CT_TREE tvDelete [0,0]; //remove child_b - tvClear 12; - _CT_TREE tvCollapse []; - $/Code$ + $Code$_markerstr = createMarker ["markername",[_Xpos,_Ypos]]; + _markerstr setMarkerShape "ICON"; + _markerstr setMarkerType "hd_dot";$/Code$ + + (September 19, 2015) + createMarker accepts an object as position parameter as well (A3 - 1.50.131969). You could try this with the following code (both SP/MP) + $Code$_markerstr = createMarker ["markername", player]; + _markerstr setMarkerShape "RECTANGLE"; + _markerstr setMarkerSize [100,100];$/Code$ - Nothing - Nothing + String + - tvSortByValue + isTouchingGround - Sorts children of given item by tvValue from highest to lowest by default. IDC means id of parent Tree View. + Returns true if object is touching the ground. - https://community.bistudio.com/wiki/tvSortByValue + https://community.bistudio.com/wiki/isTouchingGround - Control tvSortByValue Array - - tvSortByValue Array + isTouchingGround Object - control tvSortByValue [path, reversed] - - tvSortByValue [idc, path, reversed] + isTouchingGround object - $Code$control tvSortByValue [[0], false ];$/Code$ - - $Code$tvSortByValue [102, [0], false ];$/Code$ + $Code$if ( isTouchingGround player ) then { hint "Terraferma!";};$/Code$ - undefined / undefined + global / undefined + (June 1, 2014) + If you are using this command as a validation method, it should not be the sole thing you are checking for, as the result is often inaccurate. For example, it returns false for some helicopters when landed on the roof of certain buildings, and it always returns false for boats, even if they are beached. + + (September 29, 2016) + In addition to previous statement: That behaviour is true, simply because isTouchingGround applied to a player unit (or any unit) is frozen to a last state when unit enters vehicle. + To get proper return from this command you should go for units vehicle : + $Code$_var = isTouchingGround player // Unreliable + _var = isTouchingGround (vehicle player) // Pretty reliable + $/Code$ + + (November 10, 2016) + This command returns always true if the falling object is attached to some other object with the command attachTo, like for vehicle air drop with parachute. + + (April 26, 2017) + Be aware: it's not reliable on remote objects. - Nothing - Nothing + Boolean + - tvSort + particlesQuality - Sorts childrens of given item by item name ( tvText ). IDC means id of parent Tree View. - Param reversed is optional. + Returns current settings for particles quality (configure- video- general- particles). 0-low, 1-normal, 2-high - https://community.bistudio.com/wiki/tvSort + https://community.bistudio.com/wiki/particlesQuality - Control tvSort Array - - tvSort Array + particlesQuality - control tvSort [path, reversed] - - tvSort [idc, path, reversed] + particlesQuality - $Code$control tvSort [[0], true ];$/Code$ - - $Code$tvSort [102, [0], true ];$/Code$ + $Code$_currentQuality = particlesQuality ;$/Code$ undefined / undefined @@ -71699,183 +74197,204 @@ - Nothing - Nothing + Number + - tvText + markerText - Returns shown text in the item on given path. IDC means id of parent Tree View. + Get marker text. - https://community.bistudio.com/wiki/tvText + https://community.bistudio.com/wiki/markerText - tvText Array - - Control tvText Array + markerText String - tvText [idc, path] - - control tvText path + markerText markerName - $Code$tvText [101, [0]];$/Code$ - - $Code$_ctrl tvText [0,0,0];$/Code$ + $Code$hint format ["Marker Text: %1", markerText "Marker1"];$/Code$ - undefined / undefined + global / undefined - (Sep 11 2014) - (A3 1.28)tv command family overview - $Code$ - //tv command family available for CT_TREE (type 12) - private ["_count","_current","_data","_text","_value","_pic"]; - _CT_TREE tvAdd [ [],"Parent_A"]; - _CT_TREE tvAdd [ [0],"Child_A"]; - _CT_TREE tvAdd [ [0,0],"Grandchild_A"]; - _CT_TREE tvAdd [ [],"Parent_B"]; - _CT_TREE tvAdd [ [1],"Child_B"]; - _count = _CT_TREE tvCount []; //return 2 - _CT_TREE tvSetCurSel [0,0,0]; //select grandchild_A - _current = tvCurSel _CT_TREE; //return [0,0,0] - _CT_TREE tvSetData [_current,"I'm grandchild_A"]; - _data = _CT_TREE tvData _current; // "I'm grandchild_A" - _text = _CT_TREE tvText _current; //"Grandchild_A" - _CT_TREE tvSetValue [_current,14]; - _value = _CT_TREE tvValue _current; // 14 - _CT_TREE tvSetPicture [_current, getText ( configFile "CfgWeapons" "optic_NVS" "picture")]; - _pic = _CT_TREE tvPicture _current; - _CT_TREE tvExpand [1]; - _CT_TREE tvSort [[], false ]; - _CT_TREE tvSortByValue [[], false ]; - _CT_TREE tvDelete [0,0]; //remove child_b - tvClear 12; - _CT_TREE tvCollapse []; - $/Code$ - String - String + String + - tvTooltip + requiredVersion - Gets the tooltip text associated with the specified tree view path. + Check if version of application is available. If the current version is older than the required one, a warning message is shown and false is returned. + Version of format Major.Minor, e.g. 1.30 - https://community.bistudio.com/wiki/tvTooltip + https://community.bistudio.com/wiki/requiredVersion - tvTooltip Array - - Control tvTooltip Array + requiredVersion String - tvTooltip [idc, path] - - ctrl tvTooltip path + requiredVersion version - $Code$_text = tvTooltip [101, [0,2]];$/Code$ - - $Code$_text = _treeCtrl tvTooltip [0,2];$/Code$ + $Code$if !( requiredVersion "1.09") exitWith {};$/Code$ undefined / undefined + (March 12, 2008) + If the script contains a command that was introduced after the required version, it will still generate a syntax error, even if this test is done at the top of the script (as the whole script is parsed before execution). - String - String + Boolean + - tvValue + nearestTerrainObjects - Returns scalar data from item on given path. IDC means id of parent Tree View. + Returns a list of nearest terrain objects of the given types to the given position or object, within the specified distance. If more than one object is found they will be ordered according to 3D distance to the object (i.e. the closest one will be first in the array). + In contrast to nearestObjects this command returns terrain placed objects like trees, rocks and buildings which don't necessarily need an associated config class. + position can use the format: + [[x,y,z], ["Type",...], radius] + or + [object, ["Type",...], radius] + To use it without any type filter: + [object or position, [], radius] + Possible type names: "TREE", "SMALL TREE", "BUSH", "BUILDING", "HOUSE", "FOREST BORDER", "FOREST TRIANGLE", "FOREST SQUARE", "CHURCH", "CHAPEL", "CROSS", "BUNKER", "FORTRESS", "FOUNTAIN", "VIEW-TOWER", "LIGHTHOUSE", "QUAY", "FUELSTATION", "HOSPITAL", "FENCE", "WALL", "HIDE", "BUSSTOP", "ROAD", "FOREST", "TRANSMITTER", "STACK", "RUIN", "TOURISM", "WATERTOWER", "TRACK", "MAIN ROAD", "ROCK", "ROCKS", "POWER LINES", "RAILWAY", "POWERSOLAR", "POWERWAVE", "POWERWIND", "SHIPWRECK", "TRAIL" + Since Arma 3 v1.61.136035 it is possible to switch the sorting algorithm off by providing optional param, which significantly increases the performance of this command, especially if the search is performed with large radius. + Since Arma 3 v1.65.138818 it is possible to switch search and sorting mode between 2D and 3D - https://community.bistudio.com/wiki/tvValue + https://community.bistudio.com/wiki/nearestTerrainObjects - tvValue Array - - Control tvValue Array + nearestTerrainObjects Array - tvValue [idc, [path]] - - _ctrl tvValue [path] + nearestTerrainObjects [position, types, radius, sort, 2Dmode] - $Code$tvValue [101, [0]];$/Code$ + $Code$nearestTerrainObjects [ player, ["Tree","Bush"], 200];$/Code$ - $Code$_ctrl tvValue [0,0,0];$/Code$ + $Code$nearestTerrainObjects [ player, ["House"], 200];$/Code$ + + $Code$nearestTerrainObjects [[2716,2949,0], ["Chapel","Fuelstation"], 100];$/Code$ + + $Code$// Return every terrain object in 50 metres radius around player sorted, closest first: + nearestTerrainObjects [ player, [], 50]$/Code$ + + $Code$// Return every terrain object in 50 metres radius around player unsorted: + nearestTerrainObjects [ player, [], 50, false ]$/Code$ + + $Code$// Hide all terrain objects command could find: + if ( isServer ) then + { + { + _x hideObjectGlobal true ; + } + forEach nearestTerrainObjects + [ + [ worldSize /2, worldSize /2], + [], + worldSize, + false + ]; + };$/Code$ - local / local + undefined / undefined - (Sep 11 2014) - (A3 1.28)tv command family overview - $Code$ - //tv command family available for CT_TREE (type 12) - private ["_count","_current","_data","_text","_value","_pic"]; - _CT_TREE tvAdd [ [],"Parent_A"]; - _CT_TREE tvAdd [ [0],"Child_A"]; - _CT_TREE tvAdd [ [0,0],"Grandchild_A"]; - _CT_TREE tvAdd [ [],"Parent_B"]; - _CT_TREE tvAdd [ [1],"Child_B"]; - _count = _CT_TREE tvCount []; //return 2 - _CT_TREE tvSetCurSel [0,0,0]; //select grandchild_A - _current = tvCurSel _CT_TREE; //return [0,0,0] - _CT_TREE tvSetData [_current,"I'm grandchild_A"]; - _data = _CT_TREE tvData _current; // "I'm grandchild_A" - _text = _CT_TREE tvText _current; //"Grandchild_A" - _CT_TREE tvSetValue [_current,14]; - _value = _CT_TREE tvValue _current; // 14 - _CT_TREE tvSetPicture [_current, getText ( configFile "CfgWeapons" "optic_NVS" "picture")]; - _pic = _CT_TREE tvPicture _current; - _CT_TREE tvExpand [1]; - _CT_TREE tvSort [[], false ]; - _CT_TREE tvSortByValue [[], false ]; - _CT_TREE tvDelete [0,0]; //remove child_b - tvClear 12; - _CT_TREE tvCollapse []; - $/Code$ - - - Number - Number + (October 31, 2016) + Since Arma 3 v1.65.138818 the default sorting is done according to 3D distance not distance2D as before. This is an attempt to correct some very old bug in implementation. + + (December 28, 2016) + Be aware that some terrain objects types might be tricky to be found, such as terrain rocks and boulders which are not considered to be "ROCKS" or "ROCK", but "HIDE". Example: + $Code$nearestTerrainObjects [player, ["HIDE"], 20]; // [939688: bluntstone_01.p3d,939691: garbagebags_f.p3d,939671: wreck_car_f.p3d,939692: junkpile_f.p3d]$/Code$ + + (October 31, 2017) + Here is a readout for Altis (as of 1.76), showing you the actual usefulness of the different object-types (some of them are apparently not used/defined at all). + Especially the road type names sadly return nothing. + TREE: 263630 + SMALL TREE: 0 + BUSH: 747193 + BUILDING: 0 + HOUSE: 17472 + FOREST BORDER: 0 + FOREST TRIANGLE: 0 + FOREST SQUARE: 0 + CHURCH: 54 + CHAPEL: 165 + CROSS: 0 + BUNKER: 0 + FORTRESS: 0 + FOUNTAIN: 0 + VIEW-TOWER: 0 + LIGHTHOUSE: 7 + QUAY: 0 + FUELSTATION: 32 + HOSPITAL: 1 + FENCE: 47940 + WALL: 38943 + HIDE: 655066 + BUSSTOP: 0 + ROAD: 0 + FOREST: 0 + TRANSMITTER: 23 + STACK: 48 + RUIN: 3 + TOURISM: 1 + WATERTOWER: 10 + TRACK: 0 + MAIN ROAD: 0 + ROCK: 5483 + ROCKS: 0 + POWER LINES: 2224 + RAILWAY: 0 + POWERSOLAR: 10 + POWERWAVE: 51 + POWERWIND: 128 + SHIPWRECK: 43 + TRAIL: 0 + + + Array + - type + kbWasSaid - Returns a string of a location's class name. + Check if given item was said by person to someone. See Conversations for more details. - https://community.bistudio.com/wiki/type + https://community.bistudio.com/wiki/kbWasSaid - type Location + Object kbWasSaid Array - type location + person kbWasSaid [receiver, topic, sentenceID, maxAge] - $Code$_locationType = type myLocation$/Code$ + $Code$player kbWasSaid [otherUnit, "myTopic", "mySentenceID", 3];$/Code$ undefined / undefined @@ -71883,398 +74402,402 @@ - String + Boolean + - typeName + setAttributes - Returns the data type of an expression. - The type is returned as on of the following all-uppercase strings: - " ARRAY " - " BOOL " - " CODE " - " CONFIG " - " CONTROL " - " DISPLAY " - " GROUP " - " LOCATION " - " OBJECT " - " SCALAR " - " SCRIPT " - " SIDE " - " STRING " - " TEXT " - " TEAM_MEMBER " - " NAMESPACE " - They represent the available data types in ArmA. + Returns a structured text created by the given structured or plain text by setting attributes to the given values. - https://community.bistudio.com/wiki/typeName + https://community.bistudio.com/wiki/setAttributes - typeName Anything + String/Structured_Text setAttributes Array - typeName anything + text setAttributes [name1, value1, name2, value2,] - $Code$_msg = "hello"; _result = typeName _msg; //_result will be "STRING"$/Code$ - - $Code$_unit = player ; _result = typeName _unit; //_result becomes "OBJECT"$/Code$ - - $Code$// Values representing direct Data Types : - hint typeName 0; //SCALAR - hint typeName ""; //STRING - hint typeName true ; //BOOL - hint typeName []; //ARRAY - hint typeName {}; //CODE - hint typeName objNull ; //OBJECT - hint typeName grpNull ; //GROUP - hint typeName controlNull ; //CONTROL - hint typeName teamMemberNull ; //TEAM_MEMBER - hint typeName displayNull ; //DISPLAY - hint typeName taskNull ; //TASK - hint typeName locationNull ; //LOCATION - hint typeName sideUnknown ; //SIDE - hint typeName text ""; //TEXT - hint typeName configFile ; //CONFIG - hint typeName configNull ; //CONFIG (Since Arma 3 v1.53.133130) - hint typeName missionNamespace ; //NAMESPACE$/Code$ - - $Code$if ( typeName _this != "ARRAY") exitWith { - hint "_this is not an array!" - } - //is the same as - if ( typeName _this != typeName []) exitWith { - hint "_this is not an array!" - } - //is the same as - if !(_this isEqualType []) exitWith { - hint "_this is not an array!"$/Code$ + $Code$txt = img setAttributes ["image", "data\iSoldier.paa"]$/Code$ undefined / undefined - (September 25, 2016) - typeName of nil is ANY, however this is not possible to test as script command is just ignored when any argument is nil + (November 9, 2014) + This command doesn't seem to work in Arma 3. - String + Structured_Text + - typeOf + allGroups - Returns the config class name of given object or "" if object doesn't have config class. + Return a list of all groups created on the following sides east, west, resistance / independent and civilian only. Does not contain groups of sideLogic. - https://community.bistudio.com/wiki/typeOf + https://community.bistudio.com/wiki/allGroups - typeOf Object + allGroups - typeOf object + allGroups - $Code$if ( typeOf vehicle player == "B_Heli_Light_01_armed_F") then { hint "Player is in AH-9 Pawnee"};$/Code$ + $Code${( leader _x) sideChat "Go ! Go ! Go !"} forEach allGroups ;$/Code$ + + $Code$// All groups with players: + private _allGroupsWithPlayers = []; + {_allGroupsWithPlayers pushBackUnique group _x} forEach allPlayers ;$/Code$ undefined / undefined - (August 4, 2006) - (CWR 1.90)Try using this on an object pre-placed in the mission editor (such as a house): hint format ["%1", typeOf object xxx] Now place an object in the editor, save the map, and open up the Mission.sqm. Find the line: vehicle = "XXX", and replace XXX with the name of the object that you found above. Save it, and load the map. (this method is no longer available since ArmA) - String + Array + - UAVControl + setVehicleVarName - Returns array with current operator of UAV and his vehicle role in UAV. + Sets string representation of an object to a custom string. For example it is possible to return "MyFerrari" instead of default "ce06b00# 164274: offroad_01_unarmed_f.p3d" when querying object as string: + $Code$ hint str _offroad; //MyFerrari$/Code$ + When a vehicle is created and named in the editor, the name becomes both the variable containing the vehicle object and the string representation of the vehicle object. vehicleVarName on the other hand is only string representation of the object. So if you want to refer to the actual object by its vehicleVarName, an extra step needed to assign the object to a variable of the same name. For example to see and refer to offroad as myFerrari: + $Code$_offroad setVehicleVarName "MyFerrari"; MyFerrari = _offroad;$/Code$ + In multiplayer environment setVehicleVarName has to be executed on every PC if you want the custom name to be known everywhere. If vehicle is created and named in the editor, the vehicle name will be known globally automatically. + To reset vehicleVarName and str representation of the object to original form set vehicleVarName to an empty string: + $Code$_offroad setVehicleVarName "";$/Code$ - https://community.bistudio.com/wiki/UAVControl + https://community.bistudio.com/wiki/setVehicleVarName - UAVControl Object + Object setVehicleVarName String - UAVControl uav + object setVehicleVarName name - $Code$UAVControl uav;$/Code$ + $Code$player setVehicleVarName "aP";$/Code$ - undefined / undefined + global / local - Array + Nothing + - uiNamespace + openCuratorInterface - Returns the global namespace attached to user interface. + Force opens curator interface. - https://community.bistudio.com/wiki/uiNamespace + https://community.bistudio.com/wiki/openCuratorInterface - uiNamespace + openCuratorInterface - uiNamespace + openCuratorInterface - $Code$uiNamespace setVariable ["LIB_interruptDisplay", _display];$/Code$ + $Code$// Open interface: + openCuratorInterface ;$/Code$ - $Code$uiNamespace setVariable ["myVar", 46]; - with uiNamespace do { - hint str myVar; //46 - };$/Code$ + $Code$// Close interface: + findDisplay 312 closeDisplay 2;$/Code$ + + $Code$// Detect if user used "Zeus" key to open curator interface in the absence of event handler for it: + findDisplay 46 displayAddEventHandler ["KeyDown", { + if ( inputAction "CuratorInterface" 0) then { + hint "Curator interface is open"; + }; + false + }];$/Code$ undefined / undefined - variables in uiNamespace are not lost between mission changes, they are carried over. Also take note that the server can make use of uiNamespace. - - (29 September, 2014) - ^The same can be said with parsingNamespace. - Namespace + Nothing + - uiSleep + unitBackpack - Suspend execution of script for given uitime. uiSleep is a sleep method to delay script execution where script time/simulation time is stopped. uiSleep is basically using the system time (uiTime more specifically) and not simulation time. So in the cases where sleep command would get stuck indefinitely, uiSleep can still be used to effectively delay script execution. For example in a mission briefing or an editor or when simulation is paused in general. + Returns unit's backpack - https://community.bistudio.com/wiki/uiSleep + https://community.bistudio.com/wiki/unitBackpack - uiSleep Number + unitBackpack Object - uiSleep delay + unitBackpack unit - $Code$uiSleep 0.5$/Code$ + $Code$myBackpack = unitBackpack player$/Code$ + + $Code$clearMagazineCargo unitBackpack player$/Code$ + + $Code$player action ["gear", unitBackpack player]$/Code$ undefined / undefined - (March 28, 2016) - If the game is paused in SP (via ESC) the sleep command will stop working, to prevent that use uiSleep. + (Apr 29, 2014) + In ArmA3 ver 1.16, we can use either backpackContainer or unitBackpack at present since both of them enjoy same operand type and return value. - Nothing + Object + - unassignCurator + lbSetValue - Unassign curator (will destroy both sides of connection). + Sets the additional integer value in the item with the given index of the listbox or combobox with id idc of the topmost user dialog to the given value. - https://community.bistudio.com/wiki/unassignCurator + https://community.bistudio.com/wiki/lbSetValue - unassignCurator Object + lbSetValue Array + + Control lbSetValue Array - unassignCurator curatorObj + lbSetValue [idc, index, value] + + control lbSetValue [index, value] - $Code$unassignCurator myCurator;$/Code$ + $Code$lbSetValue [101, 0, 1];$/Code$ + + $Code$_control lbSetValue [0, 1];$/Code$ undefined / undefined - This scripting command must be executed on the server to work properly in multiplayer + More information on the LB command family can be found here + + (September 21, 2014) + lbSetValue only accepts integer, no decimal number. + Example: + CONTROL lbSetValue [index,10]; // value will be 10 + CONTROL lbSetValue [index,3.1]; // value will be 3 - Nothing + Nothing - Nothing + - unassignItem + setObjectTextureGlobal - Unassigns existing item and tries to put it into inventory. If there is no space in inventory the item simply disappears. + Set the texture of the given selection on all computers in a network session. NOTES : + Do not put global commands such this one into init field in editor and expect it to work in Multiplayer. See Talk:setObjectTextureGlobal for the explanation. + Not all objects could be textured this way. To find out, run getObjectTextures command on an object. Empty array [] usually indicates it cannot be textured. + All textures must have resolution 2^x / 2^y (e.g. 16 / 16, 16 / 32, 64 / 256, 512 / 512, etc). The largest texture size commonly supported by graphics cards and RV engine is 4096x4096 - https://community.bistudio.com/wiki/unassignItem + https://community.bistudio.com/wiki/setObjectTextureGlobal - Object unassignItem String + Object setObjectTextureGlobal Array - unit unassignItem item + obj setObjectTextureGlobal [selection, texture] - $Code$bluforUnit unassignItem "NVGoggles"; - bluforUnit removeItem "NVGoggles"; - opforUnit unassignItem "NVGoggles_OPFOR"; - opforUnit removeItem "NVGoggles_OPFOR"; - independentUnit unassignItem "NVGoggles_INDEP"; - independentUnit removeItem "NVGoggles_INDEP";$/Code$ + $Code$player setObjectTextureGlobal [0, "\MyAddon\blue.paa"];$/Code$ + + $Code$//set up persistent texture keeper + player addEventHandler ["Take", { + ( getObjectTextures player + [ uniformContainer player getVariable "texture"]) + params ["_texUniform", "_texInsignia", "_texCustom"]; + if ( isNil "_texCustom") exitWith {}; + if (_texUniform == _texCustom) exitWith {}; + player setObjectTextureGlobal [0, _texCustom]; + false + }]; + //Example: make current uniform persistently blue + _texture = "#(rgb,8,8,3)color(0,0,1,1)"; //blue texture + player setObjectTextureGlobal [0, _texture]; //set it on player + uniformContainer player setVariable ["texture", _texture, true ]; //store it on uniform$/Code$ global / global + (March 8, 2015) + The effect is persistent and will be synchronized for players who join in progress. (Tested with Arma 3 v1.40) + + (December 29, 2015) + In some cases the ".paa" files do not work. Instead you can try ".jpg" files. + + (October 24, 2016) + Sometimes it could be necessary to set default material on an object for the texture to take effect: + $Code$_block = createVehicle ["Land_VR_Block_02_F", player getPos [20, getDir player ], [], 0, "CAN_COLLIDE"]; + _block setObjectMaterialGlobal [0, "\a3\data_f\default.rvmat"]; + _block setObjectTextureGlobal [0, "#(rgb,8,8,3)color(1,0,0,1)"];$/Code$ + Courtesy of Larrow - Nothing + Nothing + - unassignTeam + type - Unassigns the unit (in the case of a vehicle its commander unit) from his team. This is equal to unit assignTeam "MAIN". + Returns a string of a location's class name. - https://community.bistudio.com/wiki/unassignTeam + https://community.bistudio.com/wiki/type - unassignTeam Object + type Location - unassignTeam vehicleName + type location - $Code$unassignTeam _soldier2$/Code$ + $Code$_locationType = type myLocation$/Code$ - local / undefined + undefined / undefined - Nothing + String + - unassignVehicle + allDisplays - Unassigns individual unit from a vehicle, i.e removes assignedVehicleRole of the unit. If the unit is currently in that vehicle, the group leader will issue an order to disembark. + Returns a list of all opened GUI displays. Other displays, such as IGUI displays could be accessed via uiNamespace variable, which is updated every time display is opened or closed. For example, to access IGUI displays: + $Code$ uiNamespace getVariable ["IGUI_displays", []];$/Code$. Other display variables: + 3DENDisplays_displays + 3DENDisplaysTemp_displays + GUI_displays + IGUI_displays + Loading_displays + CuratorDisplays_displays + BootcampDisplays_displays + CuratorTitles_displays + BootcampTitles_displays + KartDisplays_displays - https://community.bistudio.com/wiki/unassignVehicle + https://community.bistudio.com/wiki/allDisplays - unassignVehicle Object + allDisplays - unassignVehicle unitName + allDisplays - $Code$unassignVehicle player ;$/Code$ - - $Code${ unassignVehicle _x } forEach crew _vehiclename; - // Will make all the occupants of a vehicle disembark$/Code$ + $Code$_allDisps = allDisplays ;$/Code$ - local / global + undefined / undefined - (August 4, 2006) - Notes from before the conversion: - Even though: - {unassignVehicle _x} forEach crew vehiclename - will make all the occupants of a vehicle disembark, if they are the original crew of the vehicle then they will just get back in again. - To prevent this happening also use allowGetIn as in the example below: - {unassignVehicle _x} forEach crew vehiclename; crew vehiclename allowGetIn false - Nothing + Array + - underwater + actionIDs - Return whether object is fully underwater. From Arma 3 v1.66, this also works for units. + Returns Array of Numbers, where numbers are IDs of all user actions added to given entity with addAction command. - https://community.bistudio.com/wiki/underwater + https://community.bistudio.com/wiki/actionIDs - underwater Object + actionIDs Object - underwater object + actionIDs entity - $Code$_isUnderwater = underwater player ;$/Code$ - - $Code$_isUnderwater = eyePos player select 2 0;$/Code$ + $Code$_actions = actionIDs player ;$/Code$ undefined / undefined - (February 2, 2017) - This is still quite buggy and not always reliable. Code in Example 2 is a good alternative. - Boolean + Array + - uniformContainer + setSystemOfUnits - Returns a cargo container of a unit's uniform. + Set system of units. - https://community.bistudio.com/wiki/uniformContainer + https://community.bistudio.com/wiki/setSystemOfUnits - uniformContainer Object + setSystemOfUnits Number - uniformContainer unit + setSystemOfUnits value - $Code$hint str uniformContainer player ; //2df7dd00# 163941: dummyweapon.p3d$/Code$ - - $Code$hint str getMagazineCargo uniformContainer player ; - // [ - //["30Rnd_65x39_caseless_mag"], - //[3] - //]$/Code$ + $Code$myNum = 5; + myNumNew = setSystemOfUnits myNum;$/Code$ undefined / undefined @@ -72282,32 +74805,37 @@ - Object + Nothing + - uniformItems + all3DENEntities - Get array with all items (of any kind, even weapons) from uniform. + Returns an array of all currently placed Eden Editor entities, including groups, waypoints, and markers in following format: + [objects, groups, triggers, systems, waypoints, markers, layers, comments] + objects: Array of Objects + groups: Array of Groups + triggers: Array of Objects + systems: Array of Objects + waypoints: Array of Arrays in Waypoint format + markers: Array of Strings + layers: Array of Numbers + comments: Array of Numbers - https://community.bistudio.com/wiki/uniformItems + https://community.bistudio.com/wiki/all3DENEntities - uniformItems Object + all3DENEntities - uniformItems unit + all3DENEntities - $Code$uniformItems player ;[ - "FirstAidKit", - "30Rnd_65x39_caseless_mag", - "30Rnd_65x39_caseless_mag", - "30Rnd_65x39_caseless_mag" - ]$/Code$ + $Code$systemChat str all3DENEntities ;$/Code$ undefined / undefined @@ -72315,29 +74843,31 @@ - Array + Array + - uniformMagazines + onTeamSwitch - Get array with all magazines from uniform of the given unit. + Defines an action performed when the team switch is finished. Commandset receives the following special variables: _from object previous unit, _to object current unit. Consecutive use of onTeamSwitch command will overwrite previously set commandset. + i + Since Arma 3 v1.57 a stackable version of this EH is available: TeamSwitch + NOTE: When player switches and leaves behind AI unit, you need to enable "TeamSwitch" AI on it onTeamSwitch {_from enableAI "TeamSwitch"}; so that the unit continues with waypoints - https://community.bistudio.com/wiki/uniformMagazines + https://community.bistudio.com/wiki/onTeamSwitch - uniformMagazines Object + onTeamSwitch String/Code - uniformMagazines unit + onTeamSwitch commandset - $Code$uniformMagazines player ;[ - "6.5mm 30Rnd STANAG Mag(30/30)[id/cr:1/0](3x)" - ]$/Code$ + $Code$onTeamSwitch {[_from, _to] execVM "myTeamSwitchScript.sqf";};$/Code$ undefined / undefined @@ -72345,180 +74875,239 @@ - Array + Nothing + - uniform + playScriptedMission - Returns name of uniform. + Load the given world, launch an empty mission and execute the given, expression. Config (optional) can reference to the config entry, replacing description.ext for this mission. - https://community.bistudio.com/wiki/uniform + https://community.bistudio.com/wiki/playScriptedMission - uniform Object + playScriptedMission Array - uniform unit + playScriptedMission [world,expression,config,ignoreChildWindow] - $Code$_uniform = uniform _unit$/Code$ + $Code$playScriptedMission + [ + "desert_e", + { + private["_handle"]; + _handle = execVM "\ca\missions_e\data\scenes\credits1\init.sqf"; + }, + configFile/"CfgMissions"/"Cutscenes"/"Credits" + ];$/Code$ undefined / undefined + (December 31, 2015) + For this command to work, you will need to + call command with ignoreChildWindow param set to true (in VBS docs its called fromMission) + close any opened display (not sure about this part, but closing every display (but #0) seems to work): + If mission is run from 2D editor, you can just close RscDisplayArcadeMap display (idd 26) (because this was done from 2D editor, so RscDisplayArcadeMap is still active in background -- benargee ) + If mission is run from single mission browser, you can just close RscDisplaySingleMission (idd 2) + end mission + Debriefing will show and player will be moved to new mission after clicking on Continue. + Command is a bit bugged: + Third (config) param doesn't seem to work + If you run this command in mission loaded from pbo, said pbo won't be writable until you close the game (you can't update it) + Following code will change change island to Stratis and spawns player as basic soldier at [0,0,0] coordinates. + $Code$disableSerialization; + playScriptedMission ['Stratis',{ + createCenter west; + _grp = createGroup west; + _player = _grp createUnit ["B_Soldier_F",[0,0,0],[],0,"NONE"]; + selectPlayer _player; + },missionConfigFile, true]; + //Close all displays that could be the background display... this is essentialy forceEnd command + //Closing #0 will cause game to fail + _zero = findDisplay(0); + { + if (_x != _zero) then { + _x closeDisplay 1; + }; + } foreach allDisplays; + failMission "END1";$/Code$ + (tested in Arma 3 1.54.133741) - String + Nothing + - unitAddons + setTriggerType - Returns list with addons the unit belongs to. + Sets the type of action processed by the trigger after activation (no action, a waypoints switch or an end of mission): + "NONE" + "EAST G" - Guarded by OPFOR - use createGuardedPoint instead! + "WEST G" - Guarded by BLUFOR - use createGuardedPoint instead! + "GUER G" - Guarded by Independent - use createGuardedPoint instead! + "SWITCH" - Switch waypoints/break loop (see Triggers ) + "END1" - End #1 + "END2" - End #2 + "END3" - End #3 + "END4" - End #4 + "END5" - End #5 + "END6" - End #6 + "LOOSE" - Lose //it is not a typo on the wiki, it is indeed misspelt in the game engine. + "WIN" - (not found in ArmA) - https://community.bistudio.com/wiki/unitAddons + https://community.bistudio.com/wiki/setTriggerType - unitAddons String + Object setTriggerType String - unitAddons className + trigger setTriggerType action - $Code$hint str unitAddons typeOf player ; //["A3_Characters_F_BLUFOR"]$/Code$ + $Code$_trigger setTriggerType "END1"$/Code$ - undefined / undefined + global / local - (Mar 31, 2014) - 1. (A3 1.14) Old BIS function BIS_fnc_unitAddon has been deprecated, please always use unitAddons instead. - $Code$ hint str ([player] call BIS_fnc_unitAddon ) // same as unitAddons ( typeOf player )$/Code$ - 2. To return the addon that a weapon belongs to, use BIS_fnc_weaponAddon instead. E.g. - $Code$ - (( primaryWeapon player ) call BIS_fnc_weaponAddon ); //return: "A3_Weapons_F_Rifles_Khaybar" - $/Code$ - Array + Nothing + - unitAimPositionVisual + resetCamShake - Returns the position on the unit other units can aim at in render scope. See also aimPos, unitAimPosition. + Stops any ongoing camera shake effects. Does not prevent new effects from being created. To disallow new effects altogether, enableCamShake should be used. - https://community.bistudio.com/wiki/unitAimPositionVisual + https://community.bistudio.com/wiki/resetCamShake - unitAimPositionVisual Object + resetCamShake - unitAimPositionVisual unit + resetCamShake - $Code$unitAimPositionVisual player ;$/Code$ + $Code$resetCamShake ;$/Code$ - global / undefined + undefined / undefined - Array + Nothing + - unitAimPosition + menuText - Returns the position on the unit other units can aim at. Same as aimPos only returns position in PositionAGL format and has render scope alternative unitAimPositionVisual. + Returns current text set in menu entry on given path. - https://community.bistudio.com/wiki/unitAimPosition + https://community.bistudio.com/wiki/menuText - unitAimPosition Object + menuText Array - unitAimPosition unit + menuText [idc, path] - $Code$unitAimPosition player ;$/Code$ - + - global / undefined + undefined / undefined - Array + String + - unitBackpack + respawnVehicle - Returns unit's backpack + Sets vehicle as respawnable in MP game. The vehicle will be spawned at the locality and coordinates it was prior to destruction. If respawn type is set to base respawn (type 3) and vehicle respawn marker is provided (respawn_vehicle_XXXSIDEXXX), vehicle will spawn on the marker. + NOTE : Command has to be executed where vehicle is local - https://community.bistudio.com/wiki/unitBackpack + https://community.bistudio.com/wiki/respawnVehicle - unitBackpack Object + Object respawnVehicle Array - unitBackpack unit + vehicle respawnVehicle [delay, count] - $Code$myBackpack = unitBackpack player$/Code$ - - $Code$clearMagazineCargo unitBackpack player$/Code$ + $Code$car respawnVehicle [5, 3]; + // 'car' will respawn at the predefined marker for the side after 5 seconds. The unit will respawn 3 times.$/Code$ - $Code$player action ["gear", unitBackpack player]$/Code$ + $Code$car respawnVehicle [30]; + // 'car' will respawn at the predefined marker for the side after 30 seconds. The unit will respawn an unlimited number of times.$/Code$ - undefined / undefined + local / global - (Apr 29, 2014) - In ArmA3 ver 1.16, we can use either backpackContainer or unitBackpack at present since both of them enjoy same operand type and return value. + (May 28, 2007) + For this command to work (in MP) you need the appropriate markers in the mission. + The markers are... + respawn_vehicle_west + respawn_vehicle_east + respawn_vehicle_guerilla + respawn_vehicle_civilian + Also, by default it will use respawnDelay from the description.ext as mentioned unless you specify + respawnVehicleDelay = x; + Where x is delay in seconds. + In Multiplayer the respawned vehicle remains local to the client who was the last driver of the vehicle or the client who was the leader of the last AI driver of the vehicle. + If the vehicle has yet to be driven or the AI driver is local to the Server then the respawned vehicle will be local to the Server. - Object + Nothing + - unitIsUAV + kbRemoveTopic - Returns true if the unit type is UAV - coresponding to transport param "isUAV" + Unregister conversation topic from given person. See Conversations for more details. - https://community.bistudio.com/wiki/unitIsUAV + https://community.bistudio.com/wiki/kbRemoveTopic - unitIsUAV Object + Object kbRemoveTopic String - unitIsUAV unit + person kbRemoveTopic topicName - $Code$_isUAV = unitIsUAV veh;$/Code$ + $Code$_unit1 kbRemoveTopic "howsTheWeather";$/Code$ undefined / undefined @@ -72526,269 +75115,324 @@ - Boolean + Nothing + - unitPos + magazinesAmmo - Return the unit position rules. - The return value is always "Auto" unless the unit has gotten a setUnitPos command. In that case the value is the last stance the unit was ordered to. - Available modes are listed at setUnitPos. + Returns array of arrays of all vehicle's magazines and their ammo count (also works on supply boxes). When applied to a unit (soldier), the command behaves differently and will omit magazines already loaded into unit's weapons. Use magazinesAmmoFull to return all magazines. + Output format : + [[magazine1],[magazine2],[magazine3]...[magazineN]] + Magazine format : + 0: Magazine class name + 1: Magazine current ammo count - https://community.bistudio.com/wiki/unitPos + https://community.bistudio.com/wiki/magazinesAmmo - unitPos Object + magazinesAmmo Object - unitPos unit + magazinesAmmo vehicle - $Code$hint str unitPos _unit;$/Code$ + $Code$_magazinesAmmo = magazinesAmmo player ; + /* + [ + ["30Rnd_65x39_caseless_mag",30], + ["30Rnd_65x39_caseless_mag",30], + ["16Rnd_9x21_Mag",16], + ["SmokeShellGreen",1], + ["Chemlight_green",1], + ["HandGrenade",1] + ] + */$/Code$ + + $Code$_magazinesAmmo = magazinesAmmo Mi_48; + /* + [ + ["250Rnd_30mm_APDS_shells",250], + ["250Rnd_30mm_HE_shells",250], + ["8Rnd_LG_scalpel",8], + ["38Rnd_80mm_rockets",38] + ] + */$/Code$ - global / undefined + undefined / undefined + (December 20, 2014) + When used on vehicles this will only return all magazines associated with a single turretPath (which one depends on the actual armament of the vehicle, usually the first armed turretPath or alternatively turretPath [-1]). + If you want to get all turrets' magazines, use allTurrets and magazinesTurret. + -- Actium ( talk ) 15:41, 20 December 2014 (CET) - String + Array + - unitReady + setSlingLoad - Check if the unit is ready. Unit is busy when it is given some command like move, until the command is finished. + Creates sling loading from first object to second object if possible. To unload cargo, pass objNull as second param. - https://community.bistudio.com/wiki/unitReady + https://community.bistudio.com/wiki/setSlingLoad - unitReady Object + Object setSlingLoad Object - unitReady unitName + vehicle setSlingLoad cargo - $Code$_it = unitReady _soldierOne;$/Code$ + $Code$_success = heli1 setSlingLoad veh1;$/Code$ + + $Code$// To unload cargo: + _success = heli setSlingLoad objNull ;$/Code$ undefined / undefined - (August 26, 2010) - Keep in mind that a) dead units are unitReady and b) that it takes a while until it get's known to group members that a unit is not alive anymore, which leads to c) the current leader of a group might be actually dead (until another group member takes command). - Why this is important? I'll give you an example: if you're using unitReady as a condition inside one of your fsm to advance whatever the fsm/group is doing, you really might wanna check that this unit is actually still alive. Otherwise you might end up with really fast and nasty loops in your fsm, eventually accompanied by a stream of radio commands that will last until finally a living leader is in command again.. and that could take a while... nasty, I tell you :) - - Regarding vehicles, there is only one single unit (from the vehicle crew) whose unitReady-status is affected by giving that vehicle (or that unit) commands. While it's the driver unit for a truck, it is the gunner unit for a mg-jeep or the commander for a tank. Generally it's always the unit "in control" of the vehicle. (because it's only that unit, that is seen as "full unit" to the "outside world". Only he can be adressed with commands.) - In consequence you can't just send vehicles around and check if they've arrived with something like: - waitUntil{(unitReady (driver _vehicle))}; // don't do this! - Because it's not guaranteed, that the driver is in command of the vehicle and only that unit will have it's unitReady status affected. - So in conclusion, if you need to check if a vehicle is ready, try something like this: _vehicleReady = { - private ["_veh", "_ready"]; - _veh = _this; - _ready = true; - { - if (!(isNull _x)) then - { - _ready = _ready && (unitReady _x); - }; - } forEach [ - (commander _veh), - (gunner _veh), - (driver _veh) - ]; - _ready - }; - - (November 21, 2015) - To check readiness of a vehicle, don't check it's crew, driver, gunner, commander, etc., but the vehicle itself, e.g.: - $Code$unitReady (vehicle driver _YourVehicle);$/Code$ - Only tested 11/21/2015 by me with A2 1.63.131129 and A3 1.52.132676 but possibly true since 1964. :P + (November 8, 2014) + "... if possible " + FYI, that only means that 'vehicle' has to be able to lift 'cargo'. The position/distance does not matter, 'cargo' is automatically moved to a position that is close enough but doesn't doesn't collide with 'vehicle'. (can also be used if 'vehicle' is not flying, in which case 'cargo' will be placed and attached on the ground next to it). - Boolean + Boolean + - unitRecoilCoefficient + allUnitsUAV - Returns recoil coefficient of a soldier. + Return a list of all UAV vehicles. - https://community.bistudio.com/wiki/unitRecoilCoefficient + https://community.bistudio.com/wiki/allUnitsUAV - unitRecoilCoefficient Object + allUnitsUAV - unitRecoilCoefficient soldier + allUnitsUAV - $Code$_myRecoil = unitRecoilCoefficient player$/Code$ + $Code$hint format ["No. of UAV(s) on the map: %1", count allUnitsUAV ];$/Code$ + + $Code${_x setDamage 1} forEach allUnitsUAV ;$/Code$ undefined / undefined - (September 7, 2013) - If the unit doesn't exist / is null, -1 is returned. + (October 10, 2014) + This command returns a list of all unmanned vehicles, not the UAV AI units inside them, as the name might otherwise suggest. - Number + Array + - unitsBelowHeight + backpackCargo - Returns units in group/array below given height Above The Land (ATL). Current unit height ATL could be found with - _height = ( getPosATL _unit) select 2; + Get array with backpacks from ammo box (or any general weapon holder container). - https://community.bistudio.com/wiki/unitsBelowHeight + https://community.bistudio.com/wiki/backpackCargo - Group/Array unitsBelowHeight Number + backpackCargo Object - units unitsBelowHeight height + backpackCargo box - $Code$_allOnGroudUnits = group player unitsBelowHeight 10;$/Code$ - - $Code$_units = allUnits unitsBelowHeight 30;$/Code$ + $Code$hint str backpackCargo vehicle player ;$/Code$ - global / undefined + undefined / undefined - (Nov 12, 2009) - the height is calculated above terrain level (ATL), not water level or building level. - Array + Array + - units + setStamina - Returns an array with all the units in the group or group of the unit. For a destroyed object an empty array is returned. + Set units' stamina (seconds until depletion) - https://community.bistudio.com/wiki/units + https://community.bistudio.com/wiki/setStamina - units Group/Object + Object setStamina Number - units groupOrUnit + unit setStamina stamina - $Code$_myUnitCount = count units group player ;$/Code$ - - $Code$_isInMyGroup = _soldier1 in units player ;$/Code$ + $Code$player setStamina 42;$/Code$ undefined / undefined - (September 24, 2009) - The returned array on MP clients is not updated when team members die (only when they are deleted). ( Tested on VBS2 ) + (December 30, 2015) + "setStamina" has the same effect as "setFatigue". - Array + Nothing + - unlinkItem + skipTime - Unassign and delete existing item from its assigned slot. If item does not exist or is not in the assigned slot, command simply fails. + Jumps the specified number of hours forward or backward. The time of day and tides are adjusted, but no changes are made to any units. If present, the lower level of clouds instantly jump to the position they would be in if time had passed normally. - https://community.bistudio.com/wiki/unlinkItem + https://community.bistudio.com/wiki/skipTime - Object unlinkItem String + skipTime Number - unit unlinkItem item + skipTime duration - - $Code$bluforUnit unlinkItem "NVGoggles"; - opforUnit unlinkItem "NVGoggles_OPFOR"; - independentUnit unlinkItem "NVGoggles_INDEP";$/Code$ + + $Code$skipTime 5;$/Code$ - global / global + undefined / undefined + This scripting command must be executed on the server to work properly in multiplayer + + To simulate a smooth time-lapse effect (e.g. in cut-scenes), you can use the following code: + $Code$while {true} do {skiptime 0.00333; sleep 0.1};$/Code$ + + To skip forward to a specific time, irrespective of the current mission time, use + $Code$skipTime (_timeToSkipTo - daytime + 24 ) % 24;$/Code$ + + In ArmA & OFP, skipTime does not actually estimate weather changes beyond moving the clouds across the sky. Weather counters continue as if no time has passed. The setDate command can be used instead of skiptime to change the time without the visual give-away of the lower clouds jumping. + + I cannot confirm this for OA 1.60 beta (85889): + MP: Even though the immediate effect of skipTime is only local, + the new time will propagate through the network after 30 seconds or so. + Instead the date, which includes time, is synced automatically for new JIP clients - NOT for present instances. + So one has to apply skipTime on all instances in MP (server + all present clients). + + This command is blocking and in some cases it may take up to 1.5 seconds (probably depends on CPU) for it to calculate the changes to the environment, during which the game will microfreeze. It largely depends on weather changes, which are quite random. However one thing remains consistent, skipTime 24 hours is always almost instant. This is quite helpful when used in conjunction with commands such as setOvercast for instant and seamless effect. To try it yourself use this script: + $Code$[] spawn { + for "_i" from 1 to 24 do { + _time = diag_tickTime ; + skipTime _i; + diag_log [_i, diag_tickTime - _time]; + sleep 3; + }; + };$/Code$ + One of the results (results will vary depending on weather conditions): + $Code$[1,1.44507] + [2,1.46118] + [3,1.33105] + [4,1.396] + [5,0.0310059] + [6,1.37891] + [7,1.4502] + [8,1.37817] + [9,1.37695] + [10,1.37012] + [11,1.448] + [12,1.32593] + [13,1.45508] + [14,1.448] + [15,0.0349121] + [16,0.0368652] + [17,1.25903] + [18,1.38599] + [19,1.4519] + [20,0.052002] + [21,0.0400391] + [22,0.0490723] + [23,1.35205] + [24,0.0151367] //this is always the lowest$/Code$ + + In Arma 3 (around v1.14) skipTime executed on the server will get synced in 5 seconds or so with all the clients. It will also be JIP compatible. skipTime executed on a client will change time on client for about 5 seconds after which it will sync back to server time. - Nothing + Nothing + - unlockAchievement + getStamina - Unlock the given achievement. + Get current stamina (~ seconds until depletion) - https://community.bistudio.com/wiki/unlockAchievement + https://community.bistudio.com/wiki/getStamina - unlockAchievement String + getStamina Object - unlockAchievement name + getStamina unit - + $Code$getStamina player;$/Code$ + undefined / undefined - (February 10, 2016) - This is an obsolete command used in the experimental Arma 2 Xbox 360 version. - https://forums.bistudio.com/topic/187873-unlockachievment-command/ - Boolean + Number + - unregisterTask + teams - Unregister a task type. + Return a list of teams in the current mission. - https://community.bistudio.com/wiki/unregisterTask + https://community.bistudio.com/wiki/teams - Team_Member unregisterTask String + teams - teamMember unregisterTask name + teams - $Code$player unregisterTask taskName;$/Code$ + $Code$_teams = teams ;$/Code$ undefined / undefined @@ -72796,142 +75440,161 @@ - Boolean + Array + - updateDrawIcon + ropeDetach - Updates the icon to be shown in 2D editor for the specified editor,object. If maintain size is false,icon will not scale depending on the,scale of the map. If maintain size is a number,the icon will maintain,size if map scale is below that number. - i - Some Old Editor Command + Detach a rope from an object. - https://community.bistudio.com/wiki/updateDrawIcon + https://community.bistudio.com/wiki/ropeDetach - Control updateDrawIcon Array + Object ropeDetach Object - map updateDrawIcon [object,string identifier,color,offset,width,height,maintain size,angle,shadow] + vehicle ropeDetach rope - + $Code$vehicle player ropeDetach myRope;$/Code$ + undefined / undefined - Nothing + Nothing + - updateMenuItem + addSecondaryWeaponItem - Sets the text and command for the menu item. index is index as returned from addMenuItem command. command is optional. - i - Some Old Editor Command + Adds weapon item to the weapon cargo space. This is used for infantry weapons. + As of Arma 3 DEV 1.37, this command also supports weapon magazines. - https://community.bistudio.com/wiki/updateMenuItem + https://community.bistudio.com/wiki/addSecondaryWeaponItem - Control updateMenuItem Array + Object addSecondaryWeaponItem String - map updateMenuItem [menu item index,text,command] + unit addSecondaryWeaponItem item - undefined / undefined + local / global - Nothing + Nothing + - updateObjectTree + isPipEnabled - Update the editor object tree. - i - Some Old Editor Command + Returns true if Picture in Picture (Render to Texture) is enabled. - https://community.bistudio.com/wiki/updateObjectTree + https://community.bistudio.com/wiki/isPipEnabled - updateObjectTree Control + isPipEnabled - updateObjectTree map + isPipEnabled - + $Code$PIPon = isPipEnabled;$/Code$ + undefined / undefined - Nothing + Boolean + - useAISteeringComponent + curatorEditableObjects - Enable the new AI driving, used to test the old and new AI driving. + Returns all editable objects which belong to a curator. - https://community.bistudio.com/wiki/useAISteeringComponent + https://community.bistudio.com/wiki/curatorEditableObjects - useAISteeringComponent Boolean + curatorEditableObjects Object - useAISteeringComponent state + curatorEditableObjects curatorObj - $Code$useAISteeringComponent true$/Code$ + $Code$_objects = curatorEditableObjects myCurator;$/Code$ - undefined / global + global / undefined - Nothing + Array + - useAudioTimeForMoves + createDiaryLink - Switch between elapsed game time and audio time being used as animation timer. Used for audio/animation synchronization. + Create a link to the section of diary given by subject. Record is selected based on given object (diary record,task or unit). - https://community.bistudio.com/wiki/useAudioTimeForMoves + https://community.bistudio.com/wiki/createDiaryLink - Object useAudioTimeForMoves Boolean + createDiaryLink Array - soldier useAudioTimeForMoves toggle + createDiaryLink [subject,object,text] - $Code$player useAudioTimeForMoves true$/Code$ + $Code$_link = createDiarySubject ["Group", player,"Player"]$/Code$ + + $Code$diaryRec1 = player createDiaryRecord ["diary", ["Record 1", "We can't refer to next record (("]]; + diaryRec2 = player createDiaryRecord ["diary", ["Record 2", "Got to " + ( createDiaryLink ["Diary", diaryRec1, "record 1"])]]; + diaryRec3 = player createDiaryRecord ["diary", ["Record 3", "Got to " + ( createDiaryLink ["Diary", diaryRec2, "record 2"])]];$/Code$ + + $Code$funcProcessDiaryLink = { + processDiaryLink createDiaryLink ["diary", _this, ""]; + }; + diaryRec1 = player createDiaryRecord ["diary", ["Record 1", + "In this example, we can go to any next record: go to execute expression='diaryRec2 call funcProcessDiaryLink' Record 2 /execute " + ]]; + diaryRec2 = player createDiaryRecord ["diary", ["Record 2", + "Go to execute expression='diaryRec3 call funcProcessDiaryLink' Record 3 /execute " + ]]; + diaryRec3 = player createDiaryRecord ["diary", ["Record 3", + "Go to execute expression='diaryRec1 call funcProcessDiaryLink' Record 1 /execute " + ]];$/Code$ undefined / undefined @@ -72939,804 +75602,1078 @@ - Nothing + String + - vectorAdd + removeAllContainers - Adds two 3D vectors. + Removes all containers from the unit. - https://community.bistudio.com/wiki/vectorAdd + https://community.bistudio.com/wiki/removeAllContainers - Array vectorAdd Array + removeAllContainers Object - vector1 vectorAdd vector2 + removeAllContainers unit - $Code$hint str ( velocity unit1 vectorAdd velocity unit2);$/Code$ - - $Code$[5,10,5] vectorAdd [5,5,10]; //returns [10,15,15]$/Code$ + $Code$removeAllContainers player;$/Code$ undefined / undefined - (28 Jun, 2014) - (ArmA3 1.22)Algorithm: - $Code$ - Vector1 = [x1,y1,z1]; Vector2 = [x2,y2,z2]; - Result = [x1 + x2,y1 + y2,z1 + z2;] - $/Code$ - It is recommended to use vectorAdd instead of BIS_fnc_vectorAdd. + (2013) + This will remove the Uniform, Vest and Backpack from a unit leaving them unable to hold or pickup inventory items. - Array + Nothing + - vectorCos + showUAVFeed - Cosine of angle between two 3D vectors. + Shows/hides video feed transmitted from UAV. When enabled, the video is streamed to following texture + "#(argb,512,512,1)r2t(uavpipsingleview,1.25)" + in the feed window. The feed window IGUI display idd is 315. The actual feed control idc is 102. + $Code$_UAVFeedDisplay = uiNamespace getVariable "RscAvCamera";$/Code$ - https://community.bistudio.com/wiki/vectorCos + https://community.bistudio.com/wiki/showUAVFeed - Array vectorCos Array + showUAVFeed Boolean - vector1 vectorCos vector2 + showUAVFeed show - $Code$_cos = getPos player vectorCos [0,0,2];$/Code$ + $Code$showUAVFeed true ;$/Code$ undefined / undefined - (28 Jun, 2014) - (ArmA3 1.22)Algorithm: - $Code$ - Vector1 = [x1,y1,z1]; Vector2 = [x2,y2,z2]; - Result = ((x1 * x2) + (y1 * y2) + (z1 * z2))/(( sqrt (x1 ^ 2 + y1 ^ 2 + z1 ^ 2))*( sqrt (x2 ^ 2 + y2 ^ 2 + z2 ^ 2))) - $/Code$ - Given two vectors of attributes, A and B, the cosine similarity, cos(θ), is represented using a dot product and magnitude. The resulting similarity values indicating intermediate similarity or dissimilarity between two vectors. - Number + Boolean + - vectorCrossProduct + selectionNames - Cross product of two 3D vectors. - In layman's terms, if you have a polygon (surface) defined by 3 points, you can find a normal to it (just like terrain surfaceNormal ). To invert direction of the normal, swap arguments around. + Returns the list of model selections - https://community.bistudio.com/wiki/vectorCrossProduct + https://community.bistudio.com/wiki/selectionNames - Array vectorCrossProduct Array + selectionNames Object - vector1 vectorCrossProduct vector2 + selectionNames object - $Code$_vector = [1,1,1] vectorCrossProduct [2,2,2];$/Code$ - - $Code$_vectorUp = [0,1,0] vectorCrossProduct [-1,0,0]; //[0,-0,1]$/Code$ - - $Code$_vectorSide = ( vectorDir player ) vectorCrossProduct ( vectorUp player );$/Code$ + $Code$_house= "Land_i_House_Small_02_V3_F" createVehicle _pos; + selectionNames _house; + //[ + //"door_1","door_2","damt_1","door_handle_1","door_handle_2","glass_1_hide", + //"glass_2_hide","glass_3_hide","glass_1_unhide","glass_2_unhide","glass_3_unhide", + //"glass_4_hide","glass_4_unhide" + //]$/Code$ undefined / undefined - (28 Jun, 2014) - (ArmA3 1.22)Algorithm: - $Code$ - Vector1 = [x1,y1,z1]; Vector2 = [x2,y2,z2]; - Result = [(y1 * z2) – (z1 * y2),(z1 * x2) – (x1 * z2),(x1 * y2) – (y1 * x2)]; - $/Code$ - It is recommended to use vectorCrossProduct instead of BIS_fnc_crossProduct. + (June 5, 2016) + selectionNames returns an array of named selections from only the resolution LODs. - Array + Array + - vectorDiff + lbSetPictureRightColorSelected - Subtracts one 3D vector from another. (vector1 - vector2) + Sets the selected color of the second (right aligned) picture of the item with the given index of the listbox with id idc of the topmost user dialog to the given color. Color is in format Color. Color which consists from only zeros means disable this override. - https://community.bistudio.com/wiki/vectorDiff + https://community.bistudio.com/wiki/lbSetPictureRightColorSelected - Array vectorDiff Array + lbSetPictureRightColorSelected Array + + Control lbSetPictureRightColorSelected Array - vector1 vectorDiff vector2 + lbSetPictureRightColorSelected [idc, index, color] + + control lbSetPictureRightColorSelected [index, color] - $Code$hint str ( velocity car vectorDiff velocity bike);$/Code$ + $Code$lbSetPictureRightColorSelected [101, 0, [0, 1, 0, 0.5]];$/Code$ + + $Code$_ctrl lbSetPictureRightColorSelected [0, [1, 1, 1, 1]];$/Code$ undefined / undefined - (28 Jun, 2014) - (ArmA3 1.22)Algorithm: - $Code$ - Vector1 = [x1,y1,z1]; Vector2 = [x2,y2,z2]; - Result = [x1 – x2,y1 – y2,z1 – z2;] - $/Code$ - It is recommended to use vectorDiff instead of BIS_fnc_vectorDiff. + More information on the LB command family can be found here - Array + Nothing - Nothing + - vectorDirVisual + loadIdentity - Return object's normalized direction vector in world space ( [x,y,z] ) in render time scope. - A unit facing North would return [0,1,0] - A unit facing East would return [1,0,0] - A unit facing South would return [0,-1,0] - A unit facing West would return [-1,0,0] + Loads person's identity from Objects.sav file in campaign directory (from entry name). - https://community.bistudio.com/wiki/vectorDirVisual + https://community.bistudio.com/wiki/loadIdentity - vectorDirVisual Object + Object loadIdentity String - vectorDirVisual objectName + person loadIdentity name - $Code$_dirVector = vectorDirVisual _unit;$/Code$ + $Code$_ok = player loadIdentity "playerIdentity"$/Code$ - global / undefined + undefined / undefined - Array + Boolean + - vectorDir + backpackItems - Return object's normalized direction vector in world space ( [x,y,z] ). - A unit facing North would return [0,1,0] - A unit facing East would return [1,0,0] - A unit facing South would return [0,-1,0] - A unit facing West would return [-1,0,0] + Get array with all items (of any kind, even weapons) in backpack of the given unit. - https://community.bistudio.com/wiki/vectorDir + https://community.bistudio.com/wiki/backpackItems - vectorDir Object + backpackItems Object - vectorDir objectName + backpackItems unit - $Code$_dirVector = vectorDir _unit;$/Code$ + $Code$backpackItems player ;[ + "hgun_P07_F", + "Titan_AT" + ]$/Code$ - global / undefined + undefined / undefined - Array + Array + - vectorDistanceSqr + targetsQuery - Squared distance between two 3D vectors. + Returns sorted array of targets, known to the enquirer (including own troops), where the accuracy coefficient reflects how close the result matches the query. This command could be CPU intensive. - https://community.bistudio.com/wiki/vectorDistanceSqr + https://community.bistudio.com/wiki/targetsQuery - Array vectorDistanceSqr Array + Object targetsQuery Array - vector1 vectorDistanceSqr vector2 + enquirer targetsQuery [targetIgnore, targetSide, targetType, targetPosition, targetMaxAge] - $Code$_distSqr = getPos player vectorDistanceSqr [0,0,2];$/Code$ + $Code$// Return all known targets for player: + _targets = player targetsQuery [ objNull, sideUnknown, "", [], 0];$/Code$ + + $Code$// Prioritise all known OPFOR targets and return targets less than 10 seconds old: + _targets = player targetsQuery [ objNull, east, "", [], 10];$/Code$ undefined / undefined - (28 Jun, 2014) - (ArmA3 1.22)Algorithm: - $Code$ - Vector1 = [x1,y1,z1]; Vector2 = [x2,y2,z2]; - Result = (x2 - x1) ^ 2 + (y2 - y1) ^ 2 + (z2 - z1) ^ 2; - $/Code$ - Number + Array + - vectorDistance + drawRectangle - Distance between two 3D vectors. + Draws a rectangle on the map. - https://community.bistudio.com/wiki/vectorDistance + https://community.bistudio.com/wiki/drawRectangle - Array vectorDistance Array + Control drawRectangle Array - vector1 vectorDistance vector2 + map drawRectangle [c, a, b, angle, color, fill] - $Code$_euclideanDist = getPosASL player vectorDistance [0,0,0];$/Code$ + $Code$_ctrl drawRectangle [ + getPos player, + 20, + 20, + getDir player, + [0,0,1,1], + "" + ];$/Code$ - $Code$( getPosASL _a) vectorDistance ( getPosASL _b); /* same as */( getPosATL _a) distance ( getPosATL _b);$/Code$ + $Code$_ctrl drawRectangle [ + player, + 10, + 20, + getDir player, + [1,1,1,1], + "#(rgb,8,8,3)color(1,0,0,1)" + ];$/Code$ undefined / undefined - (28 Jun, 2014) - (ArmA3 1.22)Algorithm: - $Code$ - Vector1 = [x1,y1,z1]; Vector2 = [x2,y2,z2]; - Result = sqrt ((x2 - x1) ^ 2 + (y2 - y1) ^ 2 + (z2 - z1) ^ 2); - $/Code$ + (March 22, 2014) + Map example: $Code$( findDisplay 12 displayCtrl 51) ctrlAddEventHandler ["Draw",{ + (_this select 0) drawRectangle [ + getPos player, + 20, + 20, + getDir player, + [0,0,1,1], + "" + ]; + }];$/Code$ + Be careful when using this command. Unlike map markers, the draw commands can decrease your framerate. - Number + Nothing + - vectorDotProduct + actionKeys - Dot product of two 3D vectors. + Returns Array containing dikCodes of keys, buttons and combos assigned to the given user action. Action names could be found in config class ControllerSchemes or user action names or user profile, for example: + keyWatch [] = { 24 }; + To retrieve the value, use the property name without 'key': + $Code$ actionKeys "Watch"; // 24$/Code$ + In addition, some of the actions are also listed in here: inputAction/actions - https://community.bistudio.com/wiki/vectorDotProduct + https://community.bistudio.com/wiki/actionKeys - Array vectorDotProduct Array + actionKeys String - vector1 vectorDotProduct vector2 + actionKeys userAction - $Code$_dot = [1,0,1] vectorDotProduct [0,0,2];$/Code$ + $Code$_array = actionKeys "ReloadMagazine"$/Code$ undefined / undefined - (28 Jun, 2014) - (ArmA3 1.22)Algorithm: - $Code$ - Vector1 = [x1,y1,z1]; Vector2 = [x2,y2,z2]; - Result = (x1 * x2) + (y1 * y2) + (z1 * z2) + (May 11, 2016) + If an action key is configured with a modifier (e.g. "Right Ctrl + M" for "MiniMapToggle"), the DIK code returned by this command has a weird value, equivalent to the following: + Left Ctrl + Key = 486539264 + DIK + Left Shift + Key = 704643072 + DIK + Left Alt + Key = 939524096 + DIK + Right Ctrl + Key = -1660944384 + DIK + Right Shift + Key = 905969664 + DIK + Right Alt + Key = -1207959552 + DIK + For example, to detect if actionKeys "NetworkPlayers" contain a match for "Right Ctrl + P", one must do the following: + $Code$ if (-1660944359 in actionKeys "NetworkPlayers") then$/Code$ + with -1660944359 being equal to -1660944384 + 25, and 25 being the DIK code for the "P" key. + This increases the difficulty of accurately comparing key codes to actionKeys in UI event handlers. Those strange numbers are probably due to bit flags being added to the DIK value by the game engine for easier storage in the ArmaProfile. + In case of mouse buttons, actionKeys will also return values that are different from those in "MouseButton" UI events: + LMB: MouseButton 0 = actionKeys 65536 + RMB: MouseButton 1 = actionKeys 65665 (65536 + 1 + 128) + MMB: MouseButton 2 = actionKeys 65538 (65536 + 2) + 4MB: MouseButton 3 = actionKeys 65539 (65536 + 3) + 5MB: MouseButton 4 = actionKeys 65540 (65536 + 4) + The values above are valid for a right-handed mouse configuration, and may or may not differ for a left-handed config. + + (August 6, 2016) + The method described by @AgentRev does not work. + All numbers in SQF are floats and those are only precise up to 6...7 digits. + $Code$486539264 + 19 == 486539264 + 20 + - true $/Code$ - It is recommended to use vectorDotProduct instead of BIS_fnc_dotProduct. + The DIK codes for 'LCtrl + R' and 'LCtrl + T' are indistinguishable. - Number + Array + - vectorFromTo + setUnitRank - Unit vector, equal to direction from vector1 to vector2. In other words this command produces vectorNormalized between given 2 points. To get a normal vector use vectorDiff. + Sets rank of given unit. + Possible rank values, and the associated rating that is automatically given: + PRIVATE: 0 + CORPORAL: 500 + SERGEANT: 1500 + LIEUTENANT: 2500 + CAPTAIN: 3500 + MAJOR: 5000 + COLONEL: 7500 + Since Arma 3 v1.67 this command is - https://community.bistudio.com/wiki/vectorFromTo + https://community.bistudio.com/wiki/setUnitRank - Array vectorFromTo Array + Object setUnitRank String - vector1 vectorFromTo vector2 + unitName setUnitRank rank - $Code$[1,2,3] vectorFromTo [4,5,6]; //[0.57735,0.57735,0.57735] - //is the same as - vectorNormalized ([4,5,6] vectorDiff [1,2,3]); //[0.57735,0.57735,0.57735]$/Code$ + $Code$player setUnitRank "COLONEL"$/Code$ - undefined / undefined + global / local - (19 Jul, 2014) - (ArmA3 1.26) Algorithm: - $Code$ - Vector1 = [x1,y1,z1]; Vector2 = [x2,y2,z2]; - Result = [(x1 – x2)/( sqrt ((x1 – x2) ^ 2 + (y1 – y2) ^ 2 + (z1 – z2) ^ 2)), - (y1 – y2)/( sqrt ((x1 – x2) ^ 2 + (y1 – y2) ^ 2 + (z1 – z2) ^ 2)), - (z1 – z2)/( sqrt ((x1 – x2) ^ 2 + (y1 – y2) ^ 2 + (z1 – z2) ^ 2))]; - $/Code$ + (Mar 26, 2009) + Changing a unit's rank using either setUnitRank or setRank will also REPLACE their current rating dependent on their new rank (colonels have a rating of 7500 etc). That is to say REPLACE, not add to: the unit's old rating will disappear with the rank change. + + (December 24, 2015) + In Arma 3, if the rank is not spelled correctly or the string is empty, it will default to Private. This command is not case sensitive. For Arma 3 the rating set by this command is as follows. + (PRIVATE: 0) + (CORPORAL: 50) + (SERGEANT: 150) + (LIEUTENANT: 250) + (CAPTAIN: 350) + (MAJOR: 500) + (COLONEL: 750) The rating listed here will be present on base type respawn. - Array + Nothing + - vectorMagnitudeSqr + isVehicleRadarOn - Squared magnitude of a 3D vector. + Returns true if vehicle has active sensors on - https://community.bistudio.com/wiki/vectorMagnitudeSqr + https://community.bistudio.com/wiki/isVehicleRadarOn - vectorMagnitudeSqr Array + isVehicleRadarOn Object - vectorMagnitudeSqr vector + isVehicleRadarOn vehicle - $Code$_sizeSqr = vectorMagnitudeSqr [0,3,4]; //25$/Code$ + $Code$isVehicleRadarOn vehicle player ; // returns true if radar is turned on$/Code$ undefined / undefined - (28 Jun, 2014) - (ArmA3 1.22)Algorithm: - $Code$ - Vector = [x,y,z]; - Result = (x ^ 2) + (y ^ 2) + (z ^ 2) - $/Code$ - It is recommended to use vectorMagnitudeSqr instead of BIS_fnc_magnitudeSqr. - Number + Boolean + - vectorMagnitude + localize - Magnitude of a 3D vector. + Used to internationalise text messages. A string is returned from Stringtable.csv (or Stringtable.xml ) which corresponds to the stringName. - https://community.bistudio.com/wiki/vectorMagnitude + https://community.bistudio.com/wiki/localize - vectorMagnitude Array + localize String - vectorMagnitude vector + localize stringName - $Code$_size = vectorMagnitude [0,3,4]; //5$/Code$ + $Code$hint localize "STR_WEST"; // - "BLUFOR" (in Arma2)$/Code$ - $Code$_speed = vectorMagnitude velocity player ; // return velocity of player in m/s - _speed = ( vectorMagnitude velocity player ) * 3.6; // return velocity of player in Km/h - _speed = ( vectorMagnitude velocity player ) * 2.23694; // return velocity of player in mph$/Code$ + $Code$hint format ["Go %1", localize "STR_Q_NORTH"]; // - "Go North"$/Code$ + + $Code$hint format [ localize "STR_ACTION_DROP_WEAPON", localize "STR_SN_RIFLE"]; // - "Drop Rifle" + // STR_ACTION_DROP_WEAPON contains "Drop %1", STR_SN_RIFLE contains "Rifle"$/Code$ - undefined / undefined + undefined / local - (28 Jun, 2014) - (ArmA3 1.22)Algorithm: - $Code$ - Vector = [x,y,z]; - Result = sqrt ((x ^ 2) + (y ^ 2) + (z ^ 2)) - $/Code$ - It is recommended to use vectorMagnitude instead of BIS_fnc_magnitude. + (September 12, 2014) + The command localize will strip all HTML tags from your stringtable.xml entries, however there is a way to trick it by substituting tags with HTML code instead: + ?xml version="1.0" encoding="utf-8"? + Key ID= "STR_TEST_KK" + Original ![CDATA[ t color='#ff0000' This doesn't work /t ]] /Original + /Key + Key ID= "STR_TEST_KK2" + Original t color='#ff0000' This works /t /Original + /Key + $Code$ hint parseText localize "str_test_kk"; //no change of colour$/Code$ + $Code$ hint parseText localize "str_test_kk2"; //hint content is in red$/Code$ - Number + String + - vectorModelToWorldVisual + tvSetCurSel - Converts vector from model to world space in render time scope. + Sets cursor to given item on given path. IDC means id of parent Tree View. To deselect all items use [-1] for the path param ( available since Arma 3 v1.55.133898 ) - https://community.bistudio.com/wiki/vectorModelToWorldVisual + https://community.bistudio.com/wiki/tvSetCurSel - Object vectorModelToWorldVisual Array + tvSetCurSel Array + + Control tvSetCurSel Array - object vectorModelToWorldVisual modelDir + tvSetCurSel [idc, path] + + control tvSetCurSel path - $Code$// Convert model space vector [0,-10,4] to world space; vector gets rotated according to _airplane: - _airplane vectorModelToWorldVisual [0,-10,4];$/Code$ + $Code$tvSetCurSel [101, [0]];$/Code$ + + $Code$_ctrl tvSetCurSel [0,0,0];$/Code$ + + $Code$[] spawn + { + disableSerialization ; + _CT_TREE = findDisplay 46 ctrlCreate ["RscTree", -1]; + _CT_TREE ctrlSetPosition [0,0,0.3,1]; + _CT_TREE ctrlCommit 0; + _CT_TREE tvAdd [[],"Parent_A"]; + _CT_TREE tvAdd [[0],"Child_A"]; + _CT_TREE tvAdd [[0,0],"Grandchild_A"]; + _CT_TREE tvAdd [[],"Parent_B"]; + _CT_TREE tvAdd [[1],"Child_B"]; + sleep 1; + hint "SELECT [0,0,0]"; + _CT_TREE tvSetCurSel [0,0,0]; + sleep 2; + hint "DESELECT ALL"; + _CT_TREE tvSetCurSel [-1]; + };$/Code$ undefined / undefined + (Sep 11 2014) + (A3 1.28)tv command family overview + $Code$ + //tv command family available for CT_TREE (type 12) + private ["_count","_current","_data","_text","_value","_pic"]; + _CT_TREE tvAdd [[],"Parent_A"]; + _CT_TREE tvAdd [[0],"Child_A"]; + _CT_TREE tvAdd [[0,0],"Grandchild_A"]; + _CT_TREE tvAdd [[],"Parent_B"]; + _CT_TREE tvAdd [[1],"Child_B"]; + _count = _CT_TREE tvCount []; //return 2 + _CT_TREE tvSetCurSel [0,0,0]; //select grandchild_A + _current = tvCurSel _CT_TREE; //return [0,0,0] + _CT_TREE tvSetData [_current,"I'm grandchild_A"]; + _data = _CT_TREE tvData _current; // "I'm grandchild_A" + _text = _CT_TREE tvText _current; //"Grandchild_A" + _CT_TREE tvSetValue [_current,14]; + _value = _CT_TREE tvValue _current; // 14 + _CT_TREE tvSetPicture [_current, getText ( configFile "CfgWeapons" "optic_NVS" "picture")]; + _pic = _CT_TREE tvPicture _current; + _CT_TREE tvExpand [1]; + _CT_TREE tvSort [[], false ]; + _CT_TREE tvSortByValue [[], false ]; + _CT_TREE tvDelete [0,0]; //remove child_b + tvClear 12; + _CT_TREE tvCollapse []; + $/Code$ - Array + Nothing - Nothing + - vectorModelToWorld + flag - Converts vector direction from model to world space. + Returns the original flag pole of the flag the unit is carrying. - https://community.bistudio.com/wiki/vectorModelToWorld + https://community.bistudio.com/wiki/flag - Object vectorModelToWorld Array + flag Object - object vectorModelToWorld modelDir + flag unit - $Code$// Convert model space vector [0,-10,4] to world space; vector gets rotated according to _airplane: - _airplane vectorModelToWorld [0,-10,4];$/Code$ + $Code$_flag = flag _soldier;$/Code$ - undefined / undefined + global / undefined - Array + Object + - vectorMultiply + lnbSetCurSelRow - Multiplies 3D vector by a scalar. + Selects the row with the given index of the 2D listbox. - https://community.bistudio.com/wiki/vectorMultiply + https://community.bistudio.com/wiki/lnbSetCurSelRow - Array vectorMultiply Number + lnbSetCurSelRow Array + + Control lnbSetCurSelRow Number - vector vectorMultiply scalar + lnbSetCurSelRow [idc, index] + + ctrl lnbSetCurSelRow index - $Code$_newVector = [1,2,3] vectorMultiply 3; //[3,6,9]$/Code$ + $Code$disableSerialization ; + _ctrl = ( findDisplay 300) displayCtrl 304; + _ctrl lnbSetCurSelRow 1;$/Code$ undefined / undefined - (28 Jun, 2014) - (ArmA3 1.22)Algorithm: + (Sep 9 2014) + (A3 1.28)As for invisible data processing, lnbAddArray, lnbAddColumn, lnbData, lnbGetColumnsPosition, lnbSetColumnsPos, lnbSetData, lnbSetText, lnbSetValue, lnbText and lnbValue store data types into exact position of the listNbox with different spaces. Accessing data with coordinate command at nearly the same syntax: $Code$ - Vector = [x,y,z]; scalar = a; - Result = [(x * a),(y * a),(z * a)]; + //Set same value to one position of a Control + _ctrl lnbSetData [ [0,0],"#1"]; + lnbSetColumnsPos [102, [0,1], 1]; + _ctrl lnbSetText [ [0,1], "#1"]; + _ctrl lnbSetValue [ [0,0],1]; + //Accessing the value disregard affecting one another. + _ctrl lnbData [0,0]; //"#1" + lnbGetColumnsPosition _ctrl //[1]; + _ctrl lnbText [0,0];//"#1" + _ctrl lnbValue [0,0];//1 $/Code$ - It is recommended to use vectorMultiply instead of BIS_fnc_vectorMultiply. This is a very useful function, as it can be used with the velocity command to move an object from one position to another. (ie vector1 to vector2 ) - ensure both positions are found using getPosASL. + For a direct visible control over CT_LISTNBOX: $Code$ - _obj setVelocity ((( getPosASL _target) vectorDiff ( getPosASL _obj)) vectorMultiply 2); + 0 = [_CT_LISTNBOX] spawn { + private ["_CT_LISTNBOX","_color","_current","_pic"]; + disableSerialization ; + _CT_LISTNBOX = _this select 0; + { + _CT_LISTNBOX lnbAddRow [ getText (_x "displayNameShort"), getText (_x "displayName")]; + _CT_LISTNBOX lnbSetPicture [ [_foreachIndex,0], getText (_x "texture")]; + } forEach (" isClass _x" configClasses ( configFile "CfgRanks")); + _CT_LISTNBOX lnbSetCurSelRow 0; + _current = lnbCurSelRow _CT_LISTNBOX; + _color = _CT_LISTNBOX lnbColor [_current,0]; + _CT_LISTNBOX lnbSetColor [ [_current,1], [(_color select 0)/2,0,0,1] ]; + _CT_LISTNBOX lnbDeleteColumn 0; + _CT_LISTNBOX lnbDeleteRow 1; + sleep 1; + lnbClear _CT_LISTNBOX;//Clear all items but control still remains just invisible. + }; $/Code$ + A combined use of both invisible and visible data processing commands alive the Control. - Array + Nothing - Nothing + - vectorNormalized + setWaypointBehaviour - Returns normalized vector (unit vector, vectorMagnitude = 1) of given vector. If given vector is 0 result is a 0 vector as well. + Switches the unit behaviour when the waypoint becomes active. + Possible values are: + "UNCHANGED" + "CARELESS" + "SAFE" + "AWARE" + "COMBAT" + "STEALTH" + See the AIBehaviour page for details of the effect of this command on AI units. - https://community.bistudio.com/wiki/vectorNormalized + https://community.bistudio.com/wiki/setWaypointBehaviour - vectorNormalized Array + Array setWaypointBehaviour String - vectorNormalized vector + waypoint setWaypointBehaviour mode - $Code$vectorNormalized [12345,7890,38383]; //[0.300481,0.192045,0.934254] - vectorMagnitude [0.300481,0.192045,0.934254]; //1$/Code$ + $Code$[_grp, 2] setWaypointBehaviour "AWARE";$/Code$ - undefined / undefined + undefined / global - (19 Jul, 2014) - (ArmA3 1.26) Algorithm: - $Code$ - Vector = [x,y,z]; - Result = [x/( sqrt (x ^ 2 + y ^ 2 + z ^ 2)), y/( sqrt (x ^ 2 + y ^ 2 + z ^ 2)), z/( sqrt (x ^ 2 + y ^ 2 + z ^ 2))] - $/Code$ - In mathematics, a unit vector in a normed vector space is a vector whose length is 1. + This scripting command must be executed on the server to work properly in multiplayer + + (August 26, 2008) + Modes are case sensitive - "safe" won't work, while "SAFE" is ok. - Array + Nothing + - vectorUpVisual + difficultyEnabled - Return object's up vector in world Position coordinates ( [x, y, z] ) in render time scope. + This command is deprecated since Arma 3 1.58. Since this version it always returns false. Use difficultyOption instead. See Arma 3 Difficulty Overhaul for further details. + Former functionality: + Checks specific difficulty settings of the current user. Difficulty flag names can be found in the ArmA profile file under class Difficulties/xxx/Flags (xxx being regular or veteran). + Note: stress damage for some reason is a separate difficulty so difficultyEnabled "stressDamageEnabled" might not return correct set value. There are however 2 dedicated commands for it: + enableStressDamage + isStressDamageEnabled + Note: auto trim is also for some reason a separate difficulty so difficultyEnabled "autoTrimEnabled" might not return correct set value. There are also 2 dedicated commands for it: + enableAutoTrimRTD + isAutoTrimOnRTD - https://community.bistudio.com/wiki/vectorUpVisual + https://community.bistudio.com/wiki/difficultyEnabled - vectorUpVisual Object + difficultyEnabled String - vectorUpVisual objectName + difficultyEnabled flagName - $Code$_vUp = vectorUpVisual vehicle player ;$/Code$ + $Code$hint str ( difficultyEnabled "armor");$/Code$ + + $Code$// List current difficulty settings: + call { + private ["_diff", "_cfg", "_flags", "_res"]; + _diff = []; + _cfg = configFile "CfgDifficulties"; + { + _flags = _cfg configName _x "Flags"; + for "_i" from 0 to count _flags - 1 do { + _diff pushBack configName (_flags select _i); + }; + } forEach ("true" configClasses _cfg); + _diff = _diff arrayIntersect _diff; + _diff sort true ; + _res = text ""; + { + _res = composeText [_res, parseText format [ + " t align='left' %1 - %2 /t ", + _x, + [0, 1] select difficultyEnabled _x + ], lineBreak ]; + } forEach _diff; + hint _res; + };$/Code$ - global / undefined + undefined / undefined + (June 29, 2015) + Arma 3 Flags: + 3rdPersonView + armor + autoAim + autoGuideAT + autoSpot + autoTrimEnabled + cameraShake + clockIndicator + deathMessages + enemyTag + extendetInfoType + friendlyTag + hud + hudGroupInfo + hudPerm + hudWp + hudWpPerm + map + mineTag + netStats + roughLanding + stanceIndicator + stressDamageEnabled + unlimitedSaves + vonID + weaponCursor + windEnabled + + Possible Values for Arma 2: + 3rdPersonView + armor + autoSpot + autoGuideAT + autoAim + allowSeagull + clockIndicator + deathMessages + enemyTag + friendlyTag + hud + hudPerm + hudWp + hudWpPerm + map + netStats + suppressPlayer + tracers + realisticFatigue + ultraAI + unlimitedSaves + weaponCursor - Array + Boolean + - vectorUp + onBriefingTeamSwitch - Return object's up vector in world Position coordinates ( [x, y, z] ). + Select a sound declared in the Description.ext of the mission to be played the first time the TeamSwitch tab is selected in the briefing. - https://community.bistudio.com/wiki/vectorUp + https://community.bistudio.com/wiki/onBriefingTeamSwitch - vectorUp Object + onBriefingTeamSwitch String - vectorUp objectName + onBriefingTeamSwitch soundName - $Code$objVector = vectorUp myObject;$/Code$ + $Code$onBriefingTeamSwitch "TeamSwitchVoiceOver"$/Code$ - global / undefined + undefined / undefined - (28 Jun, 2014) - (ArmA3 1.22) Returns the pitch and bank of an object in degrees, use BIS_fnc_getPitchBank instead. - Array + Nothing + - vectorWorldToModelVisual + parsingNamespace - Converts vector direction from world to model space in render time scope. + Returns the global namespace attached to config parser. - https://community.bistudio.com/wiki/vectorWorldToModelVisual + https://community.bistudio.com/wiki/parsingNamespace - Object vectorWorldToModelVisual Array + parsingNamespace - object vectorWorldToModelVisual worldDir + parsingNamespace - $Code$// Convert world space vector [0,-10,4] to model space of object _airplane: - _airplane vectorWorldToModelVisual [0,-10,4];$/Code$ + $Code$parsingNamespace setVariable ["var1",101.23124]; + _profVar1 = parsingNamespace getVariable "var1";$/Code$ undefined / undefined + (January 27, 2015) + Any global variable defined in a config using __EXEC() will be stored in this namespace. + For example in the description.ext: + $Code$__EXEC(testVar = 1);$/Code$ + The variable "testVar" can be accessed during mission run time using getVariable + $Code$ hint str ( parsingNamespace getVariable ["testVar", 0]);$/Code$ + The above example would print 1. + This example however: + $Code$__EXEC(_testVar = 1);$/Code$ + Would print 0, because adding an underscore will make the variable local to the config in the same way that it would make it local to a script. + See PreProcessor Commands for more details on __EXEC() - Array + Namespace + - vectorWorldToModel + hcLeader - Converts vector direction from world to model space. + Returns group's high command commander. - https://community.bistudio.com/wiki/vectorWorldToModel + https://community.bistudio.com/wiki/hcLeader - Object vectorWorldToModel Array + hcLeader Group - object vectorWorldToModel worldDir + hcLeader group - $Code$// Convert world space vector [0,-10,4] to model space of object _airplane: - _airplane vectorWorldToModel [0,-10,4];$/Code$ + $Code$_leader = hcLeader groupName;$/Code$ undefined / undefined + (September 2, 2009) + hcLeader returns 'NULL_OBJECT' if you use it on your HC commander's group in a HC setup with subordinates. It seems to work as expected if you don't use subordinates. - Array + Object + - vehicleCargoEnabled + onMapSingleClick - Check if the vehicle has enabled transporting other vehicles or not. + Define action performed when user clicks in map by executing command string. + the string receives 5 (localised in scope) variables: + _this: Anything - Params passed to onMapSingleClick + _pos: Array - Clicked position + _units: Array - Units which were selected (via function keys) before opening the map ( may be non-functional in Arma ) + _shift: Boolean - Whether Shift was pressed when clicking on the map + _alt: Boolean - Whether Alt was pressed when clicking on the map + In Arma 3 the code should return true only if you wish to override default engine handling of the mouse click on map (see example #4) For older games, when click is processed, code should ultimately return true back to the engine. If false is returned, default processing by the game engine is done. Return value of any other type (including Nothing ) is an error. In such case default processing by the game engine is done, and error message may be displayed. + The code is executed on every click, until the Command is + removed via onMapSingleClick "", or + replaced by onMapSingleClick "SomeOtherCommand(s)" + i + Since Arma 3 v1.57 a stackable version of this EH is available: MapSingleClick + In order to keep compatibility between official and community content the functions BIS_fnc_addStackedEventHandler and BIS_fnc_removeStackedEventHandler should be used instead. - https://community.bistudio.com/wiki/vehicleCargoEnabled + https://community.bistudio.com/wiki/onMapSingleClick - vehicleCargoEnabled Object + onMapSingleClick String/Code + + Anything onMapSingleClick String/Code - vehicleCargoEnabled vehicle + onMapSingleClick command + + params onMapSingleClick command - $Code$// Blackfish (Vehicle Transport) with given variable name blackfish - _canTransportVehicles = vehicleCargoEnabled blackfish; //returns true$/Code$ + $Code$onMapSingleClick "'SoldierWB' createUnit [_pos, group player ]; true"; + // ArmA: Creates a soldier unit at the position clicked.$/Code$ + + $Code$onMapSingleClick "grp1 move _pos; onMapSingleClick ''; true "; + // ArmA: Orders "grp1" to move to position clicked. Disables further map-click actions.$/Code$ + + $Code$onMapSingleClick "'SoldierWB' createUnit [_pos, group player ]; true "; + // OFP: In OFP single quotes cannot be used for string definition, so two double-quotes have to be used instead.$/Code$ + + $Code$//The following code will disable Shift+click waypoint marker creation + onMapSingleClick {_shift};$/Code$ + + $Code$//Pass params to onMapSingleClick code + player onMapSingleClick { hint ("Hello " + name _this)}; //Hello KK$/Code$ + + $Code$//Pass params to onMapSingleClick code and disable Shift+click waypoint marker creation + player onMapSingleClick " hint (""Hello "" + name _this ); _shift"; //Hello KK$/Code$ undefined / undefined + (8 July, 2009) + See my Multiple OnMapSingleClick script to allow you to add multiple events to the onMapSingleClick event. Some minor editing of the scripts would be required to use them in Arma. + + (April 1, 2016) + _units param is supposed to return what groupSelectedUnits returns. Player must be leader and some units in the group must be selected on the group bar. However selected units are connected with group orders menu, which interferes with map click. In other words, when you click on the main map, the map gets focus and group orders menu closes, deselecting any selected unit, so _units is [] pretty much all the time. - Boolean + Nothing - Nothing + - vehicleChat + inPolygon - Types text to the vehicle radio channel. The text will be visible only on the PC where command was executed. If you need the message to show on all computers, you have to execute it globally (see remoteExec ) - Note: Object parameter must be a vehicle, not a player. - Note: If you are in a crew seat (i.e. driver, gunner or commander), then it will include that role in the chat name output (Eg: Driver (you_name): "Message"). + Checks whether position is inside given polygon - https://community.bistudio.com/wiki/vehicleChat + https://community.bistudio.com/wiki/inPolygon - Object vehicleChat String + Array inPolygon Array - vehicleName vehicleChat chatText + position inPolygon polygon - $Code$vehicle player vehicleChat "Show this text";$/Code$ - - $Code$driver vehicle player sideChat "sideChat"; - driver vehicle player globalChat "globalChat"; - driver vehicle player groupChat "groupChat"; - vehicle player vehicleChat "vehicleChat"; - driver vehicle player commandChat "commandChat"; - driver vehicle player customChat [1, "customChat"]; - systemChat "systemChat";$/Code$ + $Code$_isInside = [100,100,0] inPolygon [[0,0,0],[1000,1000,0],[1000,0,0]];$/Code$ - global / local + undefined / undefined - Nothing + Boolean + - vehicleRadio + assert - Sends the audio message to the vehicle radio channel. The message is defined in CfgRadio in the description.ext file or config radio protocol. The transmission will play only on the PC where command was executed. If you need the transmission to play on all computers, you have to execute it globally (see remoteExec ). - Note: When transmitting unit gets killed, transmission will be interrupted, however when receiving unit gets killed, the transmission continues to play. + Tests a condition and if the condition is false, displays error on screen (if -showscripterrors enabled) and logs error into.rpt file. It does not interrupt the script execution. + If script was pre-processed with preprocessFileLineNumbers, it will also show/log the error line number and the file name. - https://community.bistudio.com/wiki/vehicleRadio + https://community.bistudio.com/wiki/assert - Object vehicleRadio String + assert Boolean - unit vehicleRadio radioName + assert condition - $Code$_soldierOne vehicleRadio "messageOne";$/Code$ + $Code$assert (1 2);$/Code$ - $Code$player vehicleRadio configName selectRandom ("true" configClasses ( configFile "CfgRadio"));$/Code$ + $Code$// Check function params (Faster alternative to BIS_fnc_param ) + some_func = { + _0 = _this select 0; + _1 = _this select 1; + _2 = _this select 2; + if (! assert ( + typeName _0 == "ARRAY" && + typeName _1 == "STRING" && + typeName _2 == "SCALAR" + )) exitWith {/*optional error logging*/}; + hint "Alright!"; + }; + [1,2,3] call some_func; //assert error + [[1],"2",3] call some_func; //Alright!$/Code$ - global / local + undefined / undefined - (December 3, 2016) - To transmit user custom sounds (see Multiplayer_Custom_Sounds_Tutorial ), prefix the full filename including file extension with #. For example if there is a custom user sound file called MySound.ogg, to play it on the radio use: - $Code$ player vehicleRadio "#MySound.ogg";$/Code$ + (May 15, 2010) + Returns false, if condition is false, and returns true, if condition is true. - Nothing + Boolean + - vehicleReceiveRemoteTargets + rectangular - Gets whether the vehicle can acquire targets via datalink from the Side center. + Checks if a location is rectangular (returns true) or elliptical (returns false). - https://community.bistudio.com/wiki/vehicleReceiveRemoteTargets + https://community.bistudio.com/wiki/rectangular - vehicleReceiveRemoteTargets Object + rectangular Location - vehicleReceiveRemoteTargets vehicle + rectangular location - $Code$vehicleReceiveRemoteTargets ( vehicle player );$/Code$ + $Code$_isRect = rectangular myLocation;$/Code$ undefined / undefined @@ -73744,27 +76681,28 @@ - Boolean + Boolean + - vehicleReportOwnPosition + isGroupDeletedWhenEmpty - Gets whether the vehicle shares its own position via datalink with the Side center. + Checks if the given group marked for auto-deletion when empty. See deleteGroupWhenEmpty. - https://community.bistudio.com/wiki/vehicleReportOwnPosition + https://community.bistudio.com/wiki/isGroupDeletedWhenEmpty - vehicleReportOwnPosition Object + isGroupDeletedWhenEmpty Group - vehicleReportOwnPosition vehicle + isGroupDeletedWhenEmpty group - $Code$vehicleReportOwnPosition ( vehicle player );$/Code$ + $Code$_isMarked = isGroupDeletedWhenEmpty _group;$/Code$ undefined / undefined @@ -73772,133 +76710,131 @@ - Boolean + Boolean + - vehicleReportRemoteTargets + getPosASL - Gets whether the vehicle shares acquired targets via datalink with the Side center. + Returns the object position height above sea level. - https://community.bistudio.com/wiki/vehicleReportRemoteTargets + https://community.bistudio.com/wiki/getPosASL - vehicleReportRemoteTargets Object + getPosASL Object - vehicleReportRemoteTargets vehicle + getPosASL object - $Code$vehicleReportRemoteTargets ( vehicle player );$/Code$ + $Code$_AslPos = getPosASL player ;$/Code$ + + $Code$hint format ["position above sea level: %1", ( getPosASL player ) select 2];$/Code$ - undefined / undefined + global / undefined + (23 Feb, 2007) + $Code$ getPosASL _obj select 2;$/Code$ + might sometimes return the vertical position above sea level, but over land for stacked objects, it returns the vertical position above the object beneath it or at least affected by this offset. The same problem exists for getPos. There was a discussion thread in the BIS forums which suggested the use of the command modelToWorld instead to get around this issue where an absolute vertical position is required. ArmA Ver 1.02. + + (27 Mar, 2014) + According to Code Optimisation, this function is the fastest (2x) and should be used instead of getPos, getPosATL and position. + Conversion keep this speed ratio and is structured like: $Code$ ASLtoATL getPosASL Object ;$/Code$ - Boolean + Array + - vehicleVarName + setMusicEffect - Returns the name of the variable which contains a primary editor reference to this object. This is the variable given in the Insert Unit dialog / name field, in the editor. It can be changed using setVehicleVarName. - If object refers to a vehicle that wasn't given a name in the editor, the return value is an empty string, "". - Since it is possible to setVehicleVarName individually on each PC, the value of vehicleVarName returned will be local to the PC on which command is executed. + Defines the music track played on activation. + Track is a subclass name of CfgMusic. In addition, "$STOP$" (stops the current music track). - https://community.bistudio.com/wiki/vehicleVarName + https://community.bistudio.com/wiki/setMusicEffect - vehicleVarName Object + Object setMusicEffect String + + Array setMusicEffect String - vehicleVarName object + trigger setMusicEffect track + + waypoint setMusicEffect track - $Code$hint vehicleVarName player ;$/Code$ + $Code$_trigger setMusicEffect "Track1"$/Code$ + + $Code$[_group1,1] setMusicEffect "$STOP$"$/Code$ - global / local + undefined / undefined - (April 19, 2015) - To get variable names referencing an object in mission namespace: - $Code$KK_fnc_objectVarNames = { - private "_names"; - _names = []; - { - if ( missionNamespace getVariable _x isEqualTo _this) then { - _names pushBack _x; - }; - } forEach allVariables missionNamespace ; - _names - }; - //example - myGroup = group player ; - aGroup = group player ; - hint str ( group player call KK_fnc_objectVarNames); //["agroup","mygroup"]$/Code$ - String + Nothing - Nothing + - vehicles + sendAUMessage - Returns an array of all vehicles available to current client. This command returns both empty and crewed vehicles but not soldiers. It will also return "WeaponHolderSimulated" of dead bodies (weapon on the ground). Vehicles created with createVehicleLocal will only be returned on the client that created them. + Send the command to the list of clients. - https://community.bistudio.com/wiki/vehicles + https://community.bistudio.com/wiki/sendAUMessage - vehicles + sendAUMessage Array - vehicles + sendAUMessage [clientList, command] - $Code$_vehicles = vehicles ;$/Code$ + $Code$sendAUMessage [[dpnid1, dpnid2], "ConnectTo: 192.168.1.66"]$/Code$ - undefined / local + undefined / undefined - Array + Nothing + - vehicle + switchAction - Vehicle in which given unit is mounted. If none, unit is returned. Alternatively, use objectParent + When used on a person, the given action is started immediately (there is no transition). Use switchmove "" to switch back to the default movement if there is no transition back, otherwise the person may be stuck. - https://community.bistudio.com/wiki/vehicle + https://community.bistudio.com/wiki/switchAction - vehicle Object + Object switchAction String - vehicle unitName + soldier switchAction action - $Code$// SQS - ? vehicle player != player : hint "Player is in a vehicle"$/Code$ - - $Code$// SQF - if ( vehicle player != player ) then { hint "Player is in a vehicle"};$/Code$ + $Code$soldierOne switchAction "SitDown"$/Code$ undefined / undefined @@ -73906,66 +76842,67 @@ - Object + Nothing + - velocityModelSpace + currentChannel - Returns the velocity (speed vector) of the vehicle as an array with format [x, y, z]. Vector is in model space. + Returns currently selected user chat channel on the UI (selected with and in MP). Correspondence between channel and number: + 0 = Global + 1 = Side + 2 = Command + 3 = Group + 4 = Vehicle + 5 = Direct + 6-15 = Custom Radio (see radioChannelCreate ) - https://community.bistudio.com/wiki/velocityModelSpace + https://community.bistudio.com/wiki/currentChannel - velocityModelSpace Object + currentChannel - velocityModelSpace vehicle + currentChannel - $Code$velocityModelSpace _chopper; - comment "Returns [X (left(-) right(+)), Y (backward(-) forward(+)), Z (down(-) up(+))]";$/Code$ + $Code$_selected = currentChannel ; // 3 - for example for the Group$/Code$ undefined / undefined - (December 11, 2014) - This function is useful for helicopters as it returns Z vector like an indicator of thrust/load ratio. More or less climb (+) or descent (-) tendency but: - As X,Y,Z vectors are relative to vehicle attitude, this function doesn't return a climb or descend rate (as the attitude of the vehicle can be far from horizontal). You can get negative Z vector, in jets, while climbing fast, peeling off in the sky! - More or less, you can use as a Z accelerometer factor but invert the sign: +G acceleration (negative vector below the jet) is -Z here. - If not "physically" correct, the behavior is sufficient enough for Arma flight model. - - (June 21, 2015) - Previous note is physically incorrect. Velocity can not be used to give information about Thrust/Load ratio or G-Forces/acceleration. To get acceleration you have to create the derivative of velocity after time dv/dt - the difference of velocity between 2 timesteps divided by the time that passed between the 2 steps. - Array + Number + - velocity + set3DENAttribute - Return velocity (speed vector) of Unit as an array with format [x, y, z]. Units are in metres per second. + Set one of entity attributes. + ! + Attributes are available only within the Eden Editor workspace. You cannot access them in scenario preview or exported scenario! - https://community.bistudio.com/wiki/velocity + https://community.bistudio.com/wiki/set3DENAttribute - velocity Object + EdenEntity set3DENAttribute Array - velocity vehicleName + entity set3DENAttribute [class, value] - $Code$_vector = velocity jeep;$/Code$ - - $Code$if ( velocity _plane1 select 2 50) then { hint "Aircraft is climbing up too fast!"};$/Code$ + $Code$player set3DENAttribute ["allowDamage", false ]; + // Mark player as invincible$/Code$ undefined / undefined @@ -73973,78 +76910,65 @@ - Array + Boolean + - verifySignature + triggerStatements - Check if file is signed by any key present in game keys folders. Note: On client, it does not check against the keys accepted by server. + Returns trigger statements in the form [cond, activ, desactiv]. + Note: The trigger could be local or remote but the result returned by this command will be for the trigger condition set up locally on the client that executed the command. See createTrigger for more info. - https://community.bistudio.com/wiki/verifySignature + https://community.bistudio.com/wiki/triggerStatements - verifySignature String + triggerStatements Object - verifySignature filename + triggerStatements trigger - $Code$verifySignature "@MyAddon\Addons\SomeAddon.pbo";$/Code$ - - $Code$verifySignature "@MyAddon\Somefnc.dll";$/Code$ - + - undefined / undefined + global / local - Boolean + Array + - vestContainer + progressLoadingScreen - Returns a cargo container of a unit's vest. + If loading screen is shown, sets progress bar to the given value (interval is from 0 to 1]) - https://community.bistudio.com/wiki/vestContainer + https://community.bistudio.com/wiki/progressLoadingScreen - vestContainer Object + progressLoadingScreen Number - vestContainer unit + progressLoadingScreen progress - $Code$hint str vestContainer player ; //2df7d600# 163942: dummyweapon.p3d$/Code$ - - $Code$hint str getMagazineCargo vestContainer player ; - // [ - //[ - //"30Rnd_65x39_caseless_mag", - //"16Rnd_9x21_Mag", - //"HandGrenade", - //"APERSMine_Range_Mag", - //"SmokeShell", - //"SmokeShellGreen", - //"Chemlight_green" - //],[ - //2, - //2, - //2, - //3, - //1, - //1, - //2 - //] - //]$/Code$ + $Code$startLoadingScreen ["Loading My Mission"]; + //Batch of code + //Batch of code + //Batch of code + progressLoadingScreen 0.5; + //Batch of code + //Batch of code + //Batch of code + endLoadingScreen ;$/Code$ undefined / undefined @@ -74052,129 +76976,121 @@ - Object + Nothing + - vestItems + addItemToBackpack - Get array with all items (of any kind, even weapons) from vest. + Create new item and store it to soldier's backpack. The item can also be a weapon or a magazine. - https://community.bistudio.com/wiki/vestItems + https://community.bistudio.com/wiki/addItemToBackpack - vestItems Object + Object addItemToBackpack String - vestItems unit + unit addItemToBackpack item - $Code$vestItems player ;[ - "30Rnd_65x39_caseless_mag", - "30Rnd_65x39_caseless_mag", - "16Rnd_9x21_Mag", - "16Rnd_9x21_Mag", - "HandGrenade", - "HandGrenade", - "SmokeShell", - "SmokeShellGreen", - "Chemlight_green", - "Chemlight_green" - ]$/Code$ + $Code$player addItemToBackpack "arifle_MXM_Hamr_pointer_F";$/Code$ + + $Code$player addItemToBackpack "itemGPS";$/Code$ - undefined / undefined + global / global - Array + Nothing + - vestMagazines + menuSort - Get array with all magazines from vest of the given unit. + Sorts subentries of item on given path by their text. - https://community.bistudio.com/wiki/vestMagazines + https://community.bistudio.com/wiki/menuSort - vestMagazines Object + menuSort Array - vestMagazines unit + menuSort [idc, path, reversed] - $Code$vestMagazines player ;[ - "6.5mm 30Rnd STANAG Mag(30/30)[id/cr:4/0](2x)", - "9mm 16Rnd Mag(16/16)[id/cr:7/0](2x)", - "RGO Frag Grenade(1/1)[id/cr:10/0](2x)", - "Smoke Grenade (White)(1/1)[id/cr:12/0](1x)", - "Smoke Grenade (Green)(1/1)[id/cr:13/0](1x)", - "Chemlight (Green)(1/1)[id/cr:14/0](2x)" - ]$/Code$ - + undefined / undefined - Array + Nothing + - vest + nearestBuilding - Returns name of vest. + Finds the nearest building to a given object or position. A "building" is defined as an object that is of class "House" and contains a path LOD. - https://community.bistudio.com/wiki/vest + https://community.bistudio.com/wiki/nearestBuilding - vest Object + nearestBuilding Object/Array - vest unit + nearestBuilding position - $Code$_myVest = vest player;$/Code$ + $Code$_nBuilding = nearestBuilding player ;$/Code$ + + $Code$_nBuilding = nearestBuilding position player ;$/Code$ undefined / undefined + (February 18, 2016) + This command doesn't return any house or building placed in editor (with createVehicle ). Use nearestObjects instead: + $Code$ nearestObjects [ player, ["House", "Building"], 50] select 0$/Code$ - String + Object + - viewDistance + stopEngineRTD - Returns the rendering distance. + Instant engines stop. - https://community.bistudio.com/wiki/viewDistance + https://community.bistudio.com/wiki/stopEngineRTD - viewDistance + stopEngineRTD Object - viewDistance + stopEngineRTD heli - $Code$hint ("my view distance is " + str viewDistance + " meters");$/Code$ + $Code$stopEngineRTD myHeli$/Code$ undefined / undefined @@ -74182,27 +77098,30 @@ - Number + Array + - visibleCompass + netObjNull - Checks if the player has compass opened and visible + A non existing network object. Not used in scripting anywhere in game. - https://community.bistudio.com/wiki/visibleCompass + https://community.bistudio.com/wiki/netObjNull - visibleCompass + netObjNull - visibleCompass + netObjNull - $Code$if ( visibleCompass ) then { hint "Compass is visible"};$/Code$ + $Code$netObjNull == netObjNull // Returns false$/Code$ + + $Code$netObjNull isEqualTo netObjNull // Returns true$/Code$ undefined / undefined @@ -74210,141 +77129,184 @@ - Boolean + NetObject + - visibleGPS + playSound - Checks if the player has GPS receiver opened and visible + Selects sound from Description.ext#CfgSounds or config.cpp. - https://community.bistudio.com/wiki/visibleGPS + https://community.bistudio.com/wiki/playSound - visibleGPS + playSound String + + playSound Array - visibleGPS + playSound soundName + + playSound [soundName, isSpeech] - $Code$if ( visibleGPS ) then { hint "GPS is visible"};$/Code$ + $Code$playSound "soundname"$/Code$ + + $Code$// Start a sound and then stop it after 1.2 second: + playSound "AlarmCar"; + [] spawn + { + _sound = ASLToAGL [0,0,0] nearestObject "#soundonvehicle"; + sleep 1.2; + deleteVehicle _sound; + };$/Code$ + + $Code$// Start a sound and wait until it is finished: + playSound "Alarm"; + hint "Started!"; + [] spawn + { + _sound = ASLToAGL [0,0,0] nearestObject "#soundonvehicle"; + waitUntil { isNull _sound}; + hint "Finished!"; + };$/Code$ - undefined / undefined + undefined / local + (August 4, 2006) + Notes from before the conversion: + For dialogue involving living units it is better to use say, playSound will play a sound at the location of the player, say will play a sound at the location of the unit that is speaking, and it will only play that sound if the unit is alive. + + (December 28, 2014) + As you may have noticed, the parameter for playsound/say3d that deals with the "volume" of the sound played has little to do with the effective loudness heard in game. What it is alters is the drop off for fading the sound at a distance. A higher decibel or integer value will increase the distance before any sort of fading will take place. The actual volume of the sound file played will factor in to this, as it does throughout the playing action. + Amplifying the Sound + Modifying the effective volume of sounds played by the engine is possible by "spamming" the sounds. By quickly playing the sounds overtop of one another, you can effectively amplify the volume + This example, + $Code$ + playSound "soundname"; + playSound "soundname"; + $/Code$ + Will effectively amplify the sound by a sensed 2x. The volume of the sound file itself will still affect the sound volume as it appears as though the arma engine has no normalization for sound files added to it. + This technique may cause issues in sound quality in large multiplayer servers. I observed multiple instances when a triggered sound amplified with this method was out of sync with each other. Timing of the individual commands sent over the network is probably the issue. Recommend you compile your amplification code into a single finished function for better syncing for clients not activating the action/far away from the activation position. - Boolean + Nothing - Nothing + - visibleMap + hcRemoveAllGroups - Return true if the main map is shown (active). + Remove all groups from unit's high command bar. - https://community.bistudio.com/wiki/visibleMap + https://community.bistudio.com/wiki/hcRemoveAllGroups - visibleMap + hcRemoveAllGroups Object - visibleMap + hcRemoveAllGroups unit - $Code$if (visibleMap) then {hint "You're showing the map !"}$/Code$ - + undefined / undefined - Boolean + Nothing + - visiblePositionASL + behaviour - Returns an object's rendered 3D position ASL (z value above sea level) in render time scope. + Return the behaviour of a unit. For Arma 3 behaviour explanation see Arma_3_AI_Behavior - https://community.bistudio.com/wiki/visiblePositionASL + https://community.bistudio.com/wiki/behaviour - visiblePositionASL Object + behaviour Object - visiblePositionASL object + behaviour unitName - $Code$playerRenderedPosASL = visiblePositionASL player;$/Code$ + $Code$_soldier setBehaviour "CARELESS"; + _b = behaviour _soldier; //returns "CARELESS"$/Code$ - undefined / undefined + global / undefined + (14 Feb 2010) + Although behaviour is called on an individual unit, what you are really getting back is the behaviour of that unit's group. Behaviour is a group setting. - Array + String + - visiblePosition + ctrlSetModel - Returns an object's rendered position (z value above surface underneath) in render time scope. Same as getPosVisual + Sets model for 3D Dialog Control. - https://community.bistudio.com/wiki/visiblePosition + https://community.bistudio.com/wiki/ctrlSetModel - visiblePosition Object + Control ctrlSetModel String - visiblePosition object + control ctrlSetModel model - $Code$playerRenderedPos = visiblePosition player;$/Code$ + $Code$_control3D ctrlSetModel "\a3\Ui_f\objects\Compass.p3d";$/Code$ undefined / undefined - (February 4, 2015) - Z (visiblePosition select 2) works but if unit/object is in a building, Z remains at ground level. If you need Z depending on building floors/stages, use getPosAtl select 2 instead. - Array + Nothing + - visibleScoretable + setFromEditor - Checks whether the score table is visible. + Set if given team member was inserted directly from editor. - https://community.bistudio.com/wiki/visibleScoretable + https://community.bistudio.com/wiki/setFromEditor - visibleScoretable + Team_Member setFromEditor Boolean - visibleScoretable + teamMember setFromEditor fromEditor - $Code$_visible = visibleScoretable ;$/Code$ + $Code$_teamMember setFromEditor true$/Code$ undefined / undefined @@ -74352,364 +77314,536 @@ - Boolean + Nothing + - visibleWatch + startLoadingScreen - Checks if the player has watch opened and visible + Shows loading screen with the given text, using the given resource. While loading screen is shown, simulation and scene drawing is disabled, user control is disabled, mouse cursor is hidden, scripts run at full speed. The loading screen does not end by itself and needs endLoadingScreen command, so make sure there is one at the end of loading operation. + NOTE: The game simulation is disabled during Loading Screen operation (at least in SP), therefore any use of sleep command will pause the game indefinitely. If you have to "sleep", use uiSleep + By default (if custom resource is not provided) startLoadingScreen will use "RscDisplayNotFreeze" resource. If you are using custom resource (could be also defined in description.ext ), the following resource's controls are supported by the engine: + idc = 101; - text (type = 0;) or picture (type = 48;). The text will be set to the text provided by the command param. + idc = 103; - progress (type = 8;) or animated texture (type = 45;). This control indicates global hardcoded mission loading progress and is useless after mission is loaded. + idc = 104; - progress (type = 8;). This control's progress is initially set to 0 and can be manipulated with progressLoadingScreen command. - https://community.bistudio.com/wiki/visibleWatch + https://community.bistudio.com/wiki/startLoadingScreen - visibleWatch + startLoadingScreen Array - visibleWatch + startLoadingScreen [text, resource] - $Code$if ( visibleWatch ) then { hint "Watch is visible"};$/Code$ + $Code$startLoadingScreen ["Loading My Mission, please wait..."];$/Code$ + + $Code$startLoadingScreen ["Can't skip loading time...", "MyLoadingRsc"];$/Code$ + + $Code$startLoadingScreen ["Loading My Mission"]; + //Batch of code + //Batch of code + //Batch of code + progressLoadingScreen 0.5; + //Batch of code + //Batch of code + //Batch of code + endLoadingScreen ;$/Code$ undefined / undefined + (July 15, 2009) + As it stops simulation as well as scene drawing, be sure not to put any sleep (or waitUntil if you are checking for in-game changes ; waitUntil for var initialization or script loading is ok) command between startLoadingScreen and endLoadingScreen. + + (January 18, 2010) + edit 10:15 : Whatever transparence you define in your own resource, there will be a black screen to cache loading. + It's up to you to choose a nice blue background :-) + Resource has to be defined in description.ext ; it must NOT be defined as RscTitles ! Here is an example : + Show text + $Code$ + // basic defines + // + class RscText + { + type = 0; + idc = -1; + x = 0; + y = 0; + h = 0.037; + w = 0.3; + style = 0x100; + font = Zeppelin32; + SizeEx = 0.03921; + colorText[] = {1,1,1,1}; + colorBackground[] = {0, 0, 0, 0}; + linespacing = 1; + }; + class RscPicture + { + access=0; + type=0; + idc=-1; + style=48; + colorBackground[]={0,0,0,0}; + colorText[]={1,1,1,1}; + font="TahomaB"; + sizeEx=0; + lineSpacing=0; + text=""; + }; + class RscLoadingText : RscText + { + style = 2; + x = 0.323532; + y = 0.666672; + w = 0.352944; + h = 0.039216; + sizeEx = 0.03921; + colorText[] = {0.543,0.5742,0.4102,1.0}; + }; + class RscProgress + { + x = 0.344; + y = 0.619; + w = 0.313726; + h = 0.0261438; + texture = "\ca\ui\data\loadscreen_progressbar_ca.paa"; + colorFrame[] = {0,0,0,0}; + colorBar[] = {1,1,1,1}; + }; + class RscProgressNotFreeze + { + idc = -1; + type = 45; + style = 0; + x = 0.022059; + y = 0.911772; + w = 0.029412; + h = 0.039216; + texture = "#(argb,8,8,3)color(0,0,0,0)"; + }; + // + // the loading screen itself + // + class Harrier_loadingScreen + { + idd = -1; + duration = 10e10; + fadein = 0; + fadeout = 0; + name = "loading screen"; + class controlsBackground + { + class blackBG : RscText + { + x = safezoneX; + y = safezoneY; + w = safezoneW; + h = safezoneH; + text = ""; + colorText[] = {0,0,0,0}; + colorBackground[] = {0,0,0,1}; + }; + class nicePic : RscPicture + { + style = 48 + 0x800; // ST_PICTURE + ST_KEEP_ASPECT_RATIO + x = safezoneX + safezoneW/2 - 0.25; + y = safezoneY + safezoneH/2 - 0.2; + w = 0.5; + h = 0.4; + text = "img\nicePic.paa"; + }; + }; + class controls + { + class Title1 : RscLoadingText + { + text = "$STR_LOADING"; // "Loading" text in the middle of the screen + }; + class CA_Progress : RscProgress // progress bar, has to have idc 104 + { + idc = 104; + type = 8; // CT_PROGRESS + style = 0; // ST_SINGLE + texture = "\ca\ui\data\loadscreen_progressbar_ca.paa"; + }; + class CA_Progress2 : RscProgressNotFreeze // progress bar that will go reverse + { + idc = 103; + }; + class Name2: RscText // the text on the top-left + { + idc = 101; + x = 0.05; + y = 0.029412; + w = 0.9; + h = 0.04902; + text = ""; + sizeEx = 0.05; + colorText[] = {0.543,0.5742,0.4102,1.0}; + }; + }; + }; + $/Code$ + + (February 19, 2015) + Based on what Lou Montana has previously said, the simulation does become disabled upon using this command. If you wish to use a delay 'sleep' will not work. The work around would be to use 'uiSleep' + + (November 21, 2015) + In Arma 3 default loading screen has no control do display text. The description of the command now contains information what is needed to create custom loading screen resource. - Boolean + Nothing + - WFSideText + visiblePositionASL - Returns the un localized text value of an object's side / a group's side or a side as: - east, opfor - "East" - west, blufor - "West" - resistance, independent - "Resistance" - civilian - "Civilian" - sideUnknown - "Unknown" - sideEnemy - "Unknown" - sideFriendly - "Unknown" - sideLogic - "Unknown" - sideEmpty - "Unknown" - sideAmbientLife - "Unknown" + Returns an object's rendered 3D position ASL (z value above sea level) in render time scope. - https://community.bistudio.com/wiki/WFSideText + https://community.bistudio.com/wiki/visiblePositionASL - WFSideText Object/Group/Side + visiblePositionASL Object - WFSideText param + visiblePositionASL object - $Code$WFSideText player ;$/Code$ - - $Code$WFSideText group player ;$/Code$ - - $Code$WFSideText west$/Code$ + $Code$playerRenderedPosASL = visiblePositionASL player;$/Code$ undefined / undefined - (August 17, 2014) - WF stands for Warfare - String + Array + - waitUntil + getEditorCamera - Suspends execution of function or SQF based script until given condition is satisfied. This command will loop and call the code inside {} mostly every frame (depends on complexity of condition and overall engine load) until the code returns true. The execution of the rest of the script therefore will be suspended until waitUntil completes. - If the very first execution of the code returns true the command will exit immediately, therefore it will not produce any "Suspending not allowed in this context" error when used inside non-scheduled script. For all other uses it must be executed in environment that allows suspension ( canSuspend ), such as spawned or execVMed code. + Fetches a reference to the mission editor camera. + i + Some Old Editor Command - https://community.bistudio.com/wiki/waitUntil + https://community.bistudio.com/wiki/getEditorCamera - waitUntil Code + getEditorCamera Control - waitUntil condition + getEditorCamera map - $Code$waitUntil { not alive player };$/Code$ - - $Code$_i = 0; waitUntil { _i = _i + 1; _i = 100 };$/Code$ - - $Code$waitUntil { sleep 0.1; not alive player };$/Code$ - - $Code$// An on-the-fly custom event handler : - _myEH = ["ZoomIn"] spawn { - while { true } do { - waitUntil { - inputAction ( _this select 0) == 1; - }; - diag_log format ["%1 @ %2", _this select 0, diag_tickTime ]; - }; - }; - // Although perhaps better to use onEachFrame, depending on the application.$/Code$ - + undefined / undefined - (September 20, 2013) - In case you have more complex code inside waitUntil loop, to be on the safe side always return boolean at the end of the scope: - $Code$ player addEventHandler ["Fired", { - _null = (_this select 6) spawn { - _p = [0,0,0]; - waitUntil { - if ( isNull _this) exitWith { true }; - _p = getPos _this; - false // -- boolean at the end of the scope - }; - hint str _p; - }; - }];$/Code$ - - (December 20, 2006) - waitUntil suspends both SQF functions and SQF scripts. In functions, the calling script is still in suspension due to waiting for a return from the call command. The game engine will continue, however. See Function for more detail. - - (April 2, 2010) - If WaitUntil uses an undefined call code, WaitUntil won't release, even when this code is separated from other conditions through or. Be warned that this won't cause an error message. - - (Jan 07, 2011) - By default the cycle time for the condition check is per frame. Look at the example 3, how to set it at a lower rate yourself. - Often times one does not need per frame checking. Saves a lot CPU checks; especially when the condition is complex to compute. - - (December 13, 2014) - If you want to use waitUntil together with exitWith, remember that the loop only exits if the code block returns true. - It should look like this: - $Code$ - waitUntil { - // exit loop if the unit gets deleted - if (isNull _unit) exitWith {true}; // has to return true to continue - !alive _unit; - }; - $/Code$ - Nothing + Object + - waves + || - Return waves value. + Returns true only if one or both conditions are true. In case of the alternative syntax(code as right argument), lazy evaluation is used (if left operand is true, evaluation of the right side is skipped completely). Identical to: a or b - https://community.bistudio.com/wiki/waves + https://community.bistudio.com/wiki/a_or_b - waves + Boolean || Boolean/Code - waves - + - $Code$waveIntensity = waves ;$/Code$ - + undefined / undefined - Number + Boolean + - waypointAttachObject + date - Attaches a static object via it's numeric ID to the given waypoint. - The alternative syntax is (at least) available since Arma 2. + Return the actual mission date and time as an array [ year, month, day, hour, minute ]$/Code$. Month is a full number between 1 and 12, day is between 1 and 31, hour is between 0 and 23 and minute is between 0 and 59. - https://community.bistudio.com/wiki/waypointAttachObject + https://community.bistudio.com/wiki/date - Array waypointAttachObject Number - - Array waypointAttachObject Object + date - waypoint waypointAttachObject objectID - - waypoint waypointAttachObject object + date - $Code$[_grp, 2] waypointAttachObject 1234$/Code$ + $Code$_now = date ; // _now = [2014,10,30,2,30] (Oct. 30th, 2:30am) + _hour = _now select 3; + _min = _now select 4;$/Code$ - $Code$_wp = group player addWaypoint [[1907.5,5746.5,0.00144196],0]; - _wp waypointAttachObject (( waypointPosition _wp) nearestObject 66220);$/Code$ + $Code$if ( date select 3 = 19) then { // 7pm + hintSilent "ah, Arma sunset"; //...cue bad guys + };$/Code$ undefined / undefined - (June 20, 2014) - In Arma 3 1.22 only the alternative syntax is working. + (January 23, 2018) + a useful command here: + $Code$_curDate = date; + _ddMMyyyy = format ["%3/%2/%1", + _curDate select 0, + (if (_curDate select 1 10) then { "0" } else { "" }) + str (_curDate select 1), + (if (_curDate select 2 10) then { "0" } else { "" }) + str (_curDate select 2)];$/Code$ + it can be shortened to: (no variable but more request to date ) + $Code$_ddMMyyyy = format ["%3/%2/%1", + date select 0, + (if (date select 1 10) then { "0" } else { "" }) + str (date select 1), + (if (date select 2 10) then { "0" } else { "" }) + str (date select 2)];$/Code$ - Nothing - Nothing + Array + - waypointAttachVehicle + forceRespawn - Attaches a Unit to the given Waypoint. + Forces unit to respawn. The effect as if the player pressed RESPAWN button in the game pause menu, the unit is killed only there is no "so and so was killed" message and no score adjustment. - https://community.bistudio.com/wiki/waypointAttachVehicle + https://community.bistudio.com/wiki/forceRespawn - Array waypointAttachVehicle Object + forceRespawn Object - waypoint waypointAttachVehicle vehicleName + forceRespawn unit - $Code$[_grp, 2] waypointAttachVehicle vehicle player$/Code$ - - $Code$[_grp, 2] waypointAttachVehicle _soldier1$/Code$ + $Code$forceRespawn player ;$/Code$ - undefined / undefined + local / global - (June 19, 2010) - You can attach waypoint only to vehicle inserted from classic editor. Trying to attach it to dynamically spawned ( createUnit, createVehicle ) won't work. Engine will then try to find suitable target by itself, affecting game performance. - Nothing + Nothing + - waypointAttachedObject + forceFlagTexture - Gets the object attached to the waypoint. + Forces a flag texture onto a flag carrier (unit, vehicle or flag pole). No flag holder is required. If "" is used as texture, the texture is removed. This will override regularly owned flags. This type of flag texture cannot be retrieved using flagTexture. + Note : Forced flag texture is an additional flag texture, which visually overrides original flag texture and therefore is very expensive to simulate, so please use the functionality sparingly. - https://community.bistudio.com/wiki/waypointAttachedObject + https://community.bistudio.com/wiki/forceFlagTexture - waypointAttachedObject Array + Object forceFlagTexture String - waypointAttachedObject waypoint + object forceFlagTexture texture - $Code$waypointAttachedObject [groupOne,1]$/Code$ + $Code$player forceFlagTexture "\A3\Data_F\Flags\Flag_red_CO.paa";$/Code$ - undefined / undefined + global / global - Object + Nothing + - waypointAttachedVehicle + getHitPointDamage - Gets the vehicle attached to the waypoint. - A vehicle can be attached to a waypoint by - creating the waypoint on top of the vehicle (in the editor) - using waypointAttachVehicle + Return current level of damage for a specific Hit Point (specified by its config class). If you need to get damage of a selection instead of hit point, use getHit. + 0: no damage + 1: full damage - https://community.bistudio.com/wiki/waypointAttachedVehicle + https://community.bistudio.com/wiki/getHitPointDamage - waypointAttachedVehicle Array + Object getHitPointDamage String - waypointAttachedVehicle waypoint + vehicle getHitPointDamage hitPointName - $Code$waypointAttachedVehicle [groupOne,1]$/Code$ - - $Code$waypointAttachedVehicle [ group player, currentWaypoint group player ]$/Code$ + $Code$(vehicle player) getHitPointDamage "hitEngine";$/Code$ - undefined / undefined + global / undefined + Common ObjectRTD TKOH Hit Points: + HitEngine (engine #1) + HitEngine2 (engine #2) + HitEngine3 (engine #3) + HitHRotor (main rotor) + HitVRotor (tail rotor) + HitBatteries (electrical systems) + HitLight (landing light) + HitHydraulics (entire hydraulics system) + HitTransmission (engine transmission) + HitGear (landing gear) + HitFuel (all fuel tanks) + HitHStabilizerL1 (first left horizontal stabilizer) + HitHStabilizerR1 (first right horizontal stabilizer) + HitVStabilizer1 (first vertical stabilizer) + HitTail (tail boom) + HitPitotTube (all pitot tubes) + HitStaticPort (all static ports) + HitStarter1 (starter for engine #1) + HitStarter2 (starter for engine #2) + HitStarter3 (starter for engine #3) + HitAvionics + HitHull + HitMissiles + HitRGlass + HitLGlass + HitGlass1 + HitGlass2 + HitGlass3 + HitGlass4 + HitGlass5 + HitGlass6 + + (March 4, 2017) + Note that vehicles with multiple turrets have multiple HitTurret and HitGun classes that can't be distinguished based on the Hitpoint class name. They can only be distinguished by their selection names. The selection names do not necessarily correspond to a common nomenclature, especially for mod vehicles. There can also be multiple empty Hitpoint Class names on a vehicle or infantry unit. They can be hitpoints for vehicle headlights or be the result of a bad config/model, as hitpoints that have an undefined named selection in their config class or are missing their named selection in the model will result in an empty HitPoint class name. - Object + Number/Nothing + - waypointBehaviour + reveal - Gets the waypoint behavior. + Reveals a target to a group. If toWhom is a unit, unit's group is considered. If toWhom is a vehicle, vehicle commander's group is considered. + The knowledge value will be set to the highest level any unit of the revealing side has about the revealed target. If the revealing side has no knowledge about the revealed target, the value will be set to 1. + Since ARMA 2 OA 1.60 the alternative syntax is available. Values greater than or equal 1.5 reveal the side of the target, too. + The knowledge level can only be increased, not decreased by this command. + In MP targetKnowledge and knowsAbout infos get updated only on the PC where command was executed. - https://community.bistudio.com/wiki/waypointBehaviour + https://community.bistudio.com/wiki/reveal - waypointBehaviour Array + Object/Group reveal Object + + Object/Group reveal Array - waypointBehaviour waypoint + toWhom reveal target + + toWhom reveal [target, accuracy] - $Code$waypointBehaviour [groupOne,1]$/Code$ + $Code$_soldierOne reveal _soldierTwo; //soldierOne knowsAbout information about soldierTwo is updated$/Code$ + + $Code$player reveal cursorObject ; //player knowsAbout information about object under cursor is updated$/Code$ + + $Code$_soldierOne reveal [_soldierTwo, 1.5];$/Code$ - undefined / undefined + global / local + (January 15, 2007) + In OFP v1.96, When a target is revealed to a unit, it's knowsAbout rating is set to 1, unless it was already more than 1 in which case reveal does nothing. See knowsAbout for more details about knowsAbout ratings and limitations. + + (January 24, 2008) + Use reveal to allow client to see a created vehicle faster - the associated menu interaction will become available therefore, like the player has option to get in sooner. + _tank = "M1A1" createVehicle (position player); + player reveal _tank; + //get in user actions become available instantly + + (January 15, 2012) + The same idea from Doolittle's note applies to beaming of units. If you setPos an unit or a player, reveal (all) nearby objects and vehicles to make the interaction possible a lot quicker. + + (January 15, 2012) + Revealing a targetUnit will also add it to nearTargets database of the given sourceUnit. The quality/detail level of the info depends on the knowsAbout value used with reveal. More detail in the nearTargets page. + + (October 21, 2014) + Units that have been previously subjected to enableSimulation false; or enableSimulationGlobal false; may stay unrecognised for a long time even after simulation was re-enabled, returning objNull as cursorTarget. Force revealing units with reveal command usually solves the problem. For example: $Code${ player reveal _x} forEach allUnits ;$/Code$ - String + Nothing - Nothing + - waypointCombatMode + tvSort - Gets the waypoint combat mode. + Sorts childrens of given item by item name ( tvText ). IDC means id of parent Tree View. + Param reversed is optional. - https://community.bistudio.com/wiki/waypointCombatMode + https://community.bistudio.com/wiki/tvSort - waypointCombatMode Array + Control tvSort Array + + tvSort Array - waypointCombatMode waypoint + control tvSort [path, reversed] + + tvSort [idc, path, reversed] - $Code$waypointCombatMode [groupOne,1]$/Code$ + $Code$control tvSort [[0], true ];$/Code$ + + $Code$tvSort [102, [0], true ];$/Code$ undefined / undefined @@ -74717,150 +77851,155 @@ - String + Nothing - Nothing + - waypointCompletionRadius + putWeaponPool - Gets the radius around the waypoint where the waypoint is completed. + Transfer weapons and magazines from weapon pool into cargo of object obj. Used in campaign to transfer weapons into next mission. - https://community.bistudio.com/wiki/waypointCompletionRadius + https://community.bistudio.com/wiki/putWeaponPool - waypointCompletionRadius Array + putWeaponPool Object - waypointCompletionRadius waypoint + putWeaponPool object - $Code$_radius = waypointCompletionRadius [groupOne, 1];$/Code$ - + undefined / undefined - Number + Nothing + - waypointDescription + triggerType - Gets the waypoint description. + Returns trigger type (see setTriggerType ). + Note: The trigger could be local or remote but the result returned by this command will be for the trigger condition set up locally on the client that executed the command. See createTrigger for more info. - https://community.bistudio.com/wiki/waypointDescription + https://community.bistudio.com/wiki/triggerType - waypointDescription Array + triggerType Object - waypointDescription waypoint + triggerType trigger - $Code$waypointDescription [groupOne,1]$/Code$ + $Code$_type = triggerType tr1;$/Code$ - undefined / undefined + global / local - String + String + - waypointForceBehaviour + lbSize - Returns true if the waypoint behavior is forced. + Return number of items of listbox or combobox with id idc of topmost user dialog. - https://community.bistudio.com/wiki/waypointForceBehaviour + https://community.bistudio.com/wiki/lbSize - waypointForceBehaviour Waypoint + lbSize Number + + lbSize Control - waypointForceBehaviour waypoint + lbSize idc + + lbSize control - $Code$_isForced = waypointForceBehaviour [groupOne, 1];$/Code$ + $Code$_size = lbSize 101;$/Code$ + + $Code$_size = lbSize _control;$/Code$ - undefined / undefined + local / local + More information on the LB command family can be found here - Boolean + Number - Number + - waypointFormation + setGroupOwner - Gets the waypoint formation. - Possible values are: - "NO CHANGE" - "COLUMN" - "STAG COLUMN" - "WEDGE" - "ECH LEFT" - "ECH RIGHT" - "VEE" - "LINE" - "FILE" - "DIAMOND" + Changes the ownership of a group (and all its units) to a given client. Group leader can't be a player. Only works when called from a server. Returns true if locality was changed. For agents use setOwner command. - https://community.bistudio.com/wiki/waypointFormation + https://community.bistudio.com/wiki/setGroupOwner - waypointFormation Array + Group setGroupOwner Number - waypointFormation waypoint + group setGroupOwner clientID - $Code$waypointFormation [groupOne,1]$/Code$ + $Code$_localityChanged = _someGroup setGroupOwner ( owner _playerObject);$/Code$ undefined / undefined + This scripting command must be executed on the server to work properly in multiplayer + + (July 30, 2015) + In ArmA3 1.48, setGroupOwner does NOT work if group has no units - String + Boolean + - waypointHousePosition + removeAllOwnedMines - Gets the house position assigned to the waypoint. + Removes ownership of all owned mines/explosive devices of the given unit - https://community.bistudio.com/wiki/waypointHousePosition + https://community.bistudio.com/wiki/removeAllOwnedMines - waypointHousePosition Array + removeAllOwnedMines Object - waypointHousePosition waypoint + removeAllOwnedMines unit - $Code$waypointHousePosition [groupOne,1]$/Code$ + $Code$removeAllOwnedMines player ;$/Code$ undefined / undefined @@ -74868,55 +78007,59 @@ - Number + Nothing + - waypointLoiterRadius + clearWeaponCargoGlobal - Gets the waypoint loiter radius. Waypoint uses format Waypoint. + Removes all weapons from the vehicle cargo space. MP synchronized. - https://community.bistudio.com/wiki/waypointLoiterRadius + https://community.bistudio.com/wiki/clearWeaponCargoGlobal - waypointLoiterRadius Waypoint + clearWeaponCargoGlobal Object - waypointLoiterRadius Waypoint + clearWeaponCargoGlobal unit - $Code$_radius = waypointLoiterRadius [groupOne, 1];$/Code$ + $Code$clearWeaponCargoGlobal jeepOne;$/Code$ - undefined / undefined + global / global - Number + Nothing + - waypointLoiterType + isEqualType - Gets the waypoint loiter type. Waypoint uses format Waypoint. + Compares 2 values by their type. A much faster alternative to typeName a == typeName b. - https://community.bistudio.com/wiki/waypointLoiterType + https://community.bistudio.com/wiki/isEqualType - waypointLoiterType Waypoint + Anything isEqualType Anything - waypointLoiterType Waypoint + val1 isEqualType val2 - $Code$_type = waypointLoiterType [groupOne, 1]$/Code$ + $Code$_var = [1,2,3]; + _var isEqualType 0; //false + _var isEqualType []; //true$/Code$ undefined / undefined @@ -74924,233 +78067,320 @@ - String + Boolean + - waypointName + hideSelection - Gets the waypoint name. + Hides or enables the given selection for the object - https://community.bistudio.com/wiki/waypointName + https://community.bistudio.com/wiki/hideSelection - waypointName Waypoint + object hideSelection Array - waypointName waypoint + object hideSelection [selection, hidden] - $Code$_wpName = waypointName [_grp,2];$/Code$ - + - undefined / undefined + local / global + (April 28, 2016) + Only seems to work for objects created with createSimpleObject, and will only work for certain selections. - String + Nothing + - waypointPosition + canStand - Get Waypoint 's Position. Note : This function is identical to getWPPos. + Returns if the given soldier is able to stand up. - https://community.bistudio.com/wiki/waypointPosition + https://community.bistudio.com/wiki/canStand - waypointPosition Array + canStand Object - waypointPosition waypoint + canStand unitName - $Code$_wPos = waypointPosition [_groupOne, 1];$/Code$ + $Code$// SQS : + ?!( canStand player ) : player groupChat "My legs! They hit my legs!"$/Code$ + + $Code$if (! canStand player ) then + { + player groupChat "My legs! They hit my legs!"; + };$/Code$ - undefined / undefined + global / undefined + The command may return true for dead units. - Array + Boolean + - waypointScript + setUnitPosWeak - Gets the waypoint script. + Set unit position rules. Mode may be one of: + "DOWN" - person goes prone and stays prone. + "UP" - person stands and stays standing. + "Middle" - Kneel Position. ArmA version 1.04 + "AUTO" - person chooses mode according to circumstances. - https://community.bistudio.com/wiki/waypointScript + https://community.bistudio.com/wiki/setUnitPosWeak - waypointScript Array + Object setUnitPosWeak String - waypointScript waypoint + unit setUnitPosWeak mode - $Code$waypointScript [groupOne,1]$/Code$ + $Code$_soldier disableAI "FSM"; + _soldier setUnitPosWeak "DOWN";$/Code$ - undefined / undefined + local / global + This command is the lowest level of priority for setting unit position and to be used in scripted + FSM's. + The current priorities are: + 1. Unit pos commanded (from the commanding menu, higher priority). + 2. Unit pos scripted (from setUnitPos scripting command, medium priority). + 3. Unit pos FSM / setUnitPosWeak (used in the formation FSM, lowest priority). + Command most likely only works if run before join into group after createUnit array. - String + Nothing + - waypointShow + attachTo - Gets the waypoint show/hide status. - Possible values are: - "NEVER" - never show it - "EASY" - show only in cadet mode - "ALWAYS" - always show it - "ERROR" - when set to any different string + Attaches an object to another object. The offset is applied to the object center unless a memory point is provided. If no offset is specified, the offset used will be the current relative positioning of objects against each other. - https://community.bistudio.com/wiki/waypointShow + https://community.bistudio.com/wiki/attachTo - waypointShow Array + Object attachTo Array - waypointShow waypoint + object1 attachTo [object2, offset, memPoint] - $Code$_wpShow = waypointShow [groupOne,1];$/Code$ + $Code$player attachTo [car, [0, 0, 1] ];$/Code$ + + $Code$player attachTo [tank, [0, -1, 0], "Usti hlavne"];$/Code$ + + $Code$// Automatic offset: + ammoCrate attachTo [ player ];$/Code$ + + $Code$To set orientation of attached object use setVectorDirAndUp command: + _expl1 = "DemoCharge_Remote_Ammo" createVehicle position player ; + _expl1 attachTo [ player, [-0.1, 0.1, 0.15], "Pelvis"]; + _expl1 setVectorDirAndUp [ [0.5, 0.5, 0], [-0.5, 0.5, 0] ]; + _expl2 = "DemoCharge_Remote_Ammo" createVehicle position player ; + _expl2 attachTo [ player, [0, 0.15, 0.15], "Pelvis"]; + _expl2 setVectorDirAndUp [ [1, 0, 0], [0, 1, 0] ]; + _expl3 = "DemoCharge_Remote_Ammo" createVehicle position player ; + _expl3 attachTo [ player, [0.1, 0.1, 0.15], "Pelvis"]; + _expl3 setVectorDirAndUp [ [0.5, -0.5, 0], [0.5, 0.5, 0] ];$/Code$ - undefined / undefined + global / global + (June 6, 2009) + You can use setDir to change the direction of the attached object. The direction is relative to the object you attach it to, so setDir 180 won't point to the south but to the rear of the object you attach it to. + Use setPos to synchronize the direction of the object in a network game. + Example code: + $Code$ + _obj setDir 180; + _obj setPos getPos _obj;$/Code$ + + (September 17, 2011) + Some objects you cannot attach anything to. To be more precise, you can attach objects to them, but the behaviour is unexpected. For instance: $Code$ + SuitcaseObject attachTo [FoldingTableObject, [0,0,0]];$/Code$ + You would expect the suitcase to jump to the pivot point of the table, and stick to it. + Instead, the suitcase will freeze in it's original position. Even if the table is moved, the suitcase will be unaffected: it will not follow the table, it will not even respond to actions it reacted to prior to being attached: pushing, being shot at, etc.. It's just an object frozen in space. In MP it's even weirder, the suitcase would turn invisible. + Dodgy objects when it comes to attaching things to them: most in Objects(small), Objects(signs), all of Objects(helpers) categories, etc.. + + (March 28, 2014) + If you attach an explosive charge to an object (e.g. ammobox), the charge will not detonate when you simply set the damage to 1. You must detach it before. + $Code$ private ["_target"]; + _target = your_ammobox ; + // create and attach charge + private ["_charge"]; + _charge = "DemoCharge_Remote_Ammo_Scripted" createVehicle position player ; + _charge attachTo [_target, [0,0,0.2]]; + _charge setVectorDirAndUp [[0.5,0.5,0],[-0.5,0.5,0]]; + // now detonate charge + detach _charge; //Important! + _charge setDamage 1; + $/Code$ + + (1 Jun, 2014) + (ArmA3 ver 1.20) attachTo overwrites setVectorDirAndUp if attached obj was changed to attach another one. + $Code$ + _obj attachTo [_logic,[0,0,0]]; + _obj setVectorDirAndUp [[0,1,0],[0,0,-1]]; + _obj attachTo [_logic,[0,0,2]]; //vector no changes + _obj attachTo [_anotherOne,[0,0,0]]; //vector changes to default + $/Code$ + + (September 25, 2014) + Attaching an object does not update the accessibility of a place for the AI. The command shouldn't be used for positioning large static objects - the AI will simply walk thru such objects. + + (September 1, 2016) + Using attachTo with an objects that have ragdoll physics (such as ammo boxes, containers, etc.) may cause unexpected behaviour. When you do so, if the attached object intersect origin object, origin object may gain some + enormous collision properties even if the collision model for the attached object is not present localy to origin object, until detached. Vehicles may start flipping with no mass calculation (ie tank might fly), player object might gain inifinite + Z-vector velocity on any interaction with terrain relief and other objects. - String + Nothing + - waypointSpeed + getConnectedUAV - Gets the waypoint speed. - Possible values are: - "UNCHANGED" - "LIMITED" - "NORMAL" - "FULL" + Returns UAV if unit has connection to some UAV. - https://community.bistudio.com/wiki/waypointSpeed + https://community.bistudio.com/wiki/getConnectedUAV - waypointSpeed Array + getConnectedUAV Object - waypointSpeed waypoint + getConnectedUAV unit - $Code$_speed = waypointSpeed [groupOne,1];$/Code$ - + undefined / undefined - String + Object + - waypointStatements + lbTextRight - Gets the waypoint statements. + Returns the shown right text in the item with the given index of the listbox or combobox with id idc of the topmost user dialog. - https://community.bistudio.com/wiki/waypointStatements + https://community.bistudio.com/wiki/lbTextRight - waypointStatements Array + lbTextRight Array + + Control lbTextRight Number - waypointStatements waypoint + lbTextRight [idc, index] + + control lbTextRight index - $Code$waypointStatements [groupOne,1]$/Code$ + $Code$_text = lbTextRight [101, 0];$/Code$ + + $Code$_text = _control lbTextRight 0;$/Code$ - undefined / undefined + local / local - Array + String - String + - waypointTimeoutCurrent + ropeLength - Gets the current waypoint timeout or -1 if countdown is not in progress. + Return rope length in meters (set by ropeCreate, ropeCut, ropeUnwind ) - https://community.bistudio.com/wiki/waypointTimeoutCurrent + https://community.bistudio.com/wiki/ropeLength - waypointTimeoutCurrent Group + ropeLength Object - waypointTimeoutCurrent waypoint + ropeLength rope - $Code$_timeout = waypointTimeoutCurrent groupOne;$/Code$ + $Code$_length = ropeLength ( ropes heli1 select 0);$/Code$ undefined / undefined + (March 19, 2016) + When a rope gets stretched ropeLength will still return the same length as before. - Number + Number + - waypointTimeout + tan - Gets the waypoint timeout values. + Tangent of x, argument in Degrees. - https://community.bistudio.com/wiki/waypointTimeout + https://community.bistudio.com/wiki/tan - waypointTimeout Array + tan Number - waypointTimeout waypoint + tan x - $Code$waypointTimeout [groupOne,1]$/Code$ + $Code$_tangent = tan 45 + // Result is 1$/Code$ undefined / undefined @@ -75158,86 +78388,69 @@ - Array + Number + - waypointType + get3DENSelected - Gets the waypoint type. - Type can be: - "MOVE" - "DESTROY" - "GETIN" - "SAD" - "JOIN" - "LEADER" - "GETOUT" - "CYCLE" - "LOAD" - "UNLOAD" - "TR UNLOAD" - "HOLD" - "SENTRY" - "GUARD" - "TALK" - "SCRIPTED" - "SUPPORT" - "GETIN NEAREST" - "DISMISS" - "AND" - "OR" - More details at Waypoint types. + Returns an array of all selected Eden Editor Entities, including groups, waypoints, and markers. In case a wrong type is used the command will return [[],[],[],[],[],[]] and an error message is displayed. - https://community.bistudio.com/wiki/waypointType + https://community.bistudio.com/wiki/get3DENSelected - waypointType Array + get3DENSelected String - waypointType waypoint + get3DENSelected type - $Code$waypointType [groupOne,1],$/Code$ + $Code$systemChat str ( get3DENSelected ""); + /* outputs: [ + [B Alpha 2-1:1],//objects + [B Alpha 2-1],//groups + [164494: no shape ],//triggers + [ No center Charlie 1-2:4],//logic + [ [B Alpha 2-1,0] ],//waypoints + ["Hotel_Whiskey"]//markers + ]*/$/Code$ + + $Code$systemChat str ( get3DENSelected "object"); + // outputs: [B Alpha 2-1:1]$/Code$ undefined / undefined - (August 6, 2015) - With the new sling loading in Arma 3, 2 new waypoint types are added aswell being: - Drop Cargo and Lift Cargo. - The names for these 2 waypoints are: - "UNHOOK" and "HOOK". - String + Array + - waypointVisible + do3DENAction - Returns the visibility of the waypoint. - Returns 0 ( Number ) for a non valid waypoint. + Performs given Eden Editor action. + See the list of all actions. - https://community.bistudio.com/wiki/waypointVisible + https://community.bistudio.com/wiki/do3DENAction - waypointVisible Array + do3DENAction String - waypointVisible waypoint + do3DENAction action - $Code$_visible = waypointVisible [groupOne, 1];$/Code$ - - $Code$_visible = waypointVisible [group player, currentWayPoint (group player)];$/Code$ + $Code$do3DENAction "MissionSave";// saves the scenario$/Code$ undefined / undefined @@ -75245,28 +78458,28 @@ - Boolean + Nothing + - waypointsEnabledUAV + getSoundControllerResult - Checks if the UAV has waypoints enabled. + Returns the calculated value of simple expression in config. - https://community.bistudio.com/wiki/waypointsEnabledUAV + https://community.bistudio.com/wiki/getSoundControllerResult - waypointsEnabledUAV Object + Object getSoundControllerResult Config - waypointsEnabledUAV uav + obj getSoundControllerResult configEntry - $Code$_uav enableUAVWaypoints false ; - hint str waypointsEnabledUAV _uav; // returns false$/Code$ + $Code$_result = ( vehicle player ) getSoundControllerResult ( configFile "cfgVehicles" typeOf ( vehicle player ) "sounds" "idle_ext" "volume");$/Code$ undefined / undefined @@ -75274,205 +78487,195 @@ - Boolean + Number + - waypoints + addEditorObject - Returns an array of waypoints for the specified unit/group. + Add an object to the editor and assign arguments. Create script is,called with _new equal to true. Returns the ID of the new EditorObject.,Subtype class is optional. + i + Some Old Editor Command - https://community.bistudio.com/wiki/waypoints + https://community.bistudio.com/wiki/addEditorObject - waypoints Group + Control addEditorObject Array - waypoints groupName + map addEditorObject [type,[name1,value1,],subtype class] - $Code$waypoints player ;$/Code$ - - $Code$_wPosArray = waypoints group10; - // could return [[EAST 1-1-A,0],[EAST 1-1-A,1],[EAST 1-1-A,2]]$/Code$ - + - global / undefined + undefined / undefined - Array + String + - weaponAccessoriesCargo + camSetDir - Returns array with all items assigned to the given weapon in given cargo container. + Sets the orientation of the given camera in the direction of the given vector. Needs camCommit. - https://community.bistudio.com/wiki/weaponAccessoriesCargo + https://community.bistudio.com/wiki/camSetDir - Object weaponAccessoriesCargo Array + Object camSetDir Array - container weaponAccessoriesCargo [weaponId, creatorId] + camera camSetDir direction - + $Code$pos1 = player modelToWorld [0,5,5]; + cam = "camera" camCreate pos1; + cam cameraEffect ["INTERNAL", "BACK"]; + pos2 = player modelToWorld [0,50,50]; + cam camSetPos pos2; + cam camSetDir (pos2 vectorFromTo pos1); + cam camCommit 5; + 0 = [] spawn + { + waitUntil { camCommitted cam}; + cam camSetPos pos1; + cam camCommit 5; + };$/Code$ + - undefined / undefined + local / local + (May 9, 2016) + cameraEffect "INTERNAL" works better than "EXTERNAL" with this command. - Array + Nothing + - weaponAccessories + camPrepareFocus - Get array with all items linked to a given weapon. + focusRange is in format [distance,blur]. Prepares the camera focus blur. + [-1,1] will reset default values (auto focusing), [-1,-1] will disable postprocessing (all is focused). - https://community.bistudio.com/wiki/weaponAccessories + https://community.bistudio.com/wiki/camPrepareFocus - Object weaponAccessories String + Object camPrepareFocus Array - unit weaponAccessories weapon + camera camPrepareFocus focusRange - $Code$player weaponAccessories primaryWeapon player ; ["","acc_pointer_IR","optic_Aco",""]$/Code$ + $Code$_camera camPrepareFocus [50, 1]$/Code$ undefined / undefined - (October 26, 2014) - To check if currently selected muzzle has a silencer: - $Code$hasSilencer = player weaponAccessories currentMuzzle player param [0, ""] != "";$/Code$ - - (March 16, 2015) - Since revision 129742, this command also returns an attached bipod. - Array + Nothing + - weaponCargo + enableIRLasers - Get array with weapons from ammo box (or any general weapon holder container). + Allows the AI to use IR lasers - https://community.bistudio.com/wiki/weaponCargo + https://community.bistudio.com/wiki/enableIRLasers - weaponCargo Object + Object/Group enableIRLasers Boolean - weaponCargo box + thing enableIRLasers value - $Code$hint str weaponCargo backpackContainer player ;$/Code$ + $Code$(units group player) enableIRLasers true$/Code$ - undefined / undefined + local / global - Array + Nothing + - weaponDirection + tvSetPictureRight - Returns the direction that the vehicle weapon is aiming in. - For addons the weapon name must be an entry in CfgWeapons. - Returns an array in format [x, y, z] + Sets right picture on the tree view item defined by path - https://community.bistudio.com/wiki/weaponDirection + https://community.bistudio.com/wiki/tvSetPictureRight - Object weaponDirection String + tvSetPictureRight Array + + Control tvSetPictureRight Array - vehicleName weaponDirection weaponName + tvSetPictureRight [idc, path, name] + + control tvSetPictureRight [path, name] - $Code$_weaponVectorDir = player weaponDirection currentWeapon player ;$/Code$ + $Code$tvSetPictureRight [101, [0], "picture"];$/Code$ - $Code$// Draw AI eye direction (green) and weapon direction (red) in 3D: - bob = createGroup east createUnit ["O_Soldier_F", [0,0,0], [], 0, "NONE"]; - bob setVehiclePosition [ player modelToWorld [0,100,0], [], 0, "NONE"]; - onEachFrame - { - _beg = ASLToAGL eyePos bob; - _endE = (_beg vectorAdd ( eyeDirection bob vectorMultiply 100)); - drawLine3D [ _beg, _endE, [0,1,0,1]]; - _endW = (_beg vectorAdd (bob weaponDirection currentWeapon bob vectorMultiply 100)); - drawLine3D [_beg, _endW, [1,0,0,1]]; - };$/Code$ + $Code$_ctrl tvSetPictureRight [[0], "picture"];$/Code$ - global / undefined + undefined / undefined - (August 18, 2007) - Works great in multiplayer. - The numbers are representing offset as follows : [X axis,Y axis,Z axis] - The return array can be processed-converted into degrees as follows: - $Code$_array = _this weaponDirection "weapon class" ; - _dir_degrees = (_array select 0) atan2 (_array select 1);$/Code$ - - (November 11, 2007) - WeaponClass can only be the primary turret of the vehicle. For example it is not possible to get direction of commander's M2 on M1Abrams. - - (November 13, 2007) - For an alternative to the weaponDirection command, see the following post on the offical forums. On how to obtain the direction of multiple turrets on vehicles. - Turret Animations - new forum - - (December 9, 2014) - The suggestion above using atan2 and weaponDirection get the direction the barrel of a weapon is pointing, but this is not the same as the direction a shell will be fired (verify this by getting in an M4 Scorcher, parking it on a slope, elevating the barrel "across" the slope and watching the shell come out in third person). - Array + Nothing - Nothing + - weaponInertia + removeAllCuratorCameraAreas - Returns current rate of how much the weapon view is distorted because of quick aiming + Delete all curator camera areas. - https://community.bistudio.com/wiki/weaponInertia + https://community.bistudio.com/wiki/removeAllCuratorCameraAreas - weaponInertia Object + removeAllCuratorCameraAreas Object - weaponInertia unit + removeAllCuratorCameraAreas curatorObj - $Code$_inertia = weaponInertia player ;$/Code$ + $Code$removeAllCuratorCameraAreas myCurator;$/Code$ undefined / undefined @@ -75480,395 +78683,244 @@ - Array + Nothing + - weaponLowered + removeMusicEventHandler - True if given soldier's weapon is lowered. + Removes specified music track event handler. - https://community.bistudio.com/wiki/weaponLowered + https://community.bistudio.com/wiki/removeMusicEventHandler - weaponLowered Object + removeMusicEventHandler Array - weaponLowered unit + removeMusicEventHandler [type, id] - $Code$isWeaponLowered = weaponLowered player;$/Code$ + $Code$removeMusicEventHandler ["MusicStart", 12];$/Code$ + + $Code$removeMusicEventHandler ["MusicStop", 12];$/Code$ + + $Code$hnd_stop = addMusicEventHandler ["MusicStop",{}]; + removeMusicEventHandler ["MusicStop",hnd_stop];$/Code$ undefined / undefined - (November 11, 2016) - This command seems to work for player only, not for AI. - Boolean + Nothing + - weaponState + setSimpleTaskCustomData - Returns the currently selected weapon state for unit or vehicle. - Since Arma 3 v1.69.140397 this command has been improved and extended: - It is now possible to query any weapon of a vehicle without the need to place a weapon operator first, provided the weapon or muzzle is specified in optional param. By default a vehicle has no weapons selected, so querying currently selected weapon returns no weapon, unless weapon is specified. - Driver turret can now be accessed as well with turret path [-1]. - Muzzle name is supported as well as weapon name. Weapon search gets priority, but if there is no weapon with given name, the muzzles will be searched. + Set custom data for the task. Tooltip will be drawn in task list on the right side. Description will be drawn in task description panel on the bottom. - https://community.bistudio.com/wiki/weaponState + https://community.bistudio.com/wiki/setSimpleTaskCustomData - weaponState Object - - weaponState Array + Task setSimpleTaskCustomData Array - weaponState unit - - weaponState [vehicle, turretPath, weapon] + task setSimpleTaskCustomData [IconPath, tooltip, description] - $Code$_wsPlayer = weaponState player ; // ["arifle_MXC_ACO_F","arifle_MXC_ACO_F","Single","30Rnd_65x39_caseless_mag",30]$/Code$ - - $Code$_wsVehicle = weaponState [_apc, [0]]; // ["autocannon_40mm_CTWS","HE","player","60Rnd_40mm_GPR_Tracer_Red_shells",60]$/Code$ - - $Code$_wsVehicle = weaponState [_apc, [0], "AP"]; // ["autocannon_40mm_CTWS","AP","player","40Rnd_40mm_APFSDS_Tracer_Red_shells",40]$/Code$ - + undefined / undefined - Array - Array + Nothing + - weaponsItemsCargo + setHitPointDamage - Returns an array with subarrays contains class names and also names of connected items of all the vehicle's cargo weapons in weaponsItems format. If weapon has no magazine, an empty array [] is returned instead of magazine info. + Set the current level of damage for a specific Hit Point (specified by its config class). + 0: no damage + 1: full damage + See also BIS_fnc_setHitPointDamage for setting hit with dependency - https://community.bistudio.com/wiki/weaponsItemsCargo + https://community.bistudio.com/wiki/setHitPointDamage - weaponsItemsCargo Object + Object setHitPointDamage Array - weaponsItemsCargo vehicle + vehicle setHitPointDamage [hitPointName, damage, useEffects] - $Code$weaponsItemsCargo vehicle player ;$/Code$ + $Code$vehicle player setHitPointDamage ["hitEngine2", 1.0];$/Code$ - $Code$weaponsItemsCargo _weaponholder;$/Code$ + $Code$player setHitPointDamage ["hitHead", 0.5]; + player setHitPointDamage ["hitBody", 0.5]; + player setHitPointDamage ["hitHands", 0.5]; + player setHitPointDamage ["hitLegs", 0.5];$/Code$ - undefined / undefined + local / global + (August 30, 2012) + This command is using the Hit Points (defined in the HitPoints class in the config) while setHit is using Named Selections (defined in the model itself). + + (November 10, 2016) + This command has no affect when allowDamage is false. + + (November 14, 2016) + Mention that setHitPointDamage only can be executed localy, while the getHitPointDamage is global. - Array + Nothing + - weaponsItems + getPosATL - Returns an array with subarrays contains class names and also names of connected items of all the vehicle's weapons. - Since Arma 3 v1.21.124406 it is possible to query weapon holders and ammo crates with this command. If weapon has no magazine, an empty array [] is returned instead of magazine info. + Returns the position of an object relative to the terrain. - https://community.bistudio.com/wiki/weaponsItems + https://community.bistudio.com/wiki/getPosATL - weaponsItems Object + getPosATL Object - weaponsItems vehicle + getPosATL object - $Code$hint str weaponsItems player ;[ - [//=PRIMARY= - "arifle_MX_ACO_pointer_F",//weapon - "muzzle_snds_H",//suppressor - "acc_pointer_IR",//laser - "optic_Aco",//optics - [//loaded magazine - "30Rnd_65x39_caseless_mag",//mag type - 30//mag ammo count - ], - "bipod_01_F_blk"//bipod - ], - [//=SECONDARY= - "launch_NLAW_F", - "", - "", - "", - [ - "NLAW_F", - 1 - ], - "" - ], - [//=HANDGUN= - "hgun_P07_F", - "muzzle_snds_L", - "", - "", - [ - "16Rnd_9x21_Mag", - 11 - ], - "" - ] - ]$/Code$ - - $Code$hint str weaponsItems vehicle player ;[ - [ - "gatling_30mm", - "", - "", - "", - [ - "250Rnd_30mm_HE_shells", - 250 - ], - "" - ], - [ - "missiles_SCALPEL", - "", - "", - "", - [ - "8Rnd_LG_scalpel", - 8 - ], - "" - ], - [ - "rockets_Skyfire", - "", - "", - "", - [ - "38Rnd_80mm_rockets", - 38 - ], - "" - ] - ]$/Code$ + $Code$_objPosition = getPosATL player$/Code$ - undefined / undefined + global / undefined - (August 17, 2013) - Be careful with this function. The weapons are listed in the order they were taken by the unit, with the most recent at the bottom of the array. Therefore, do not assume the first one is always the primary weapon, and so on. - Also, here's how the primary weapon looks if it has a grenade launcher with a loaded grenade: - $Code$[ - "arifle_MX_GL_F", - "muzzle_snds_H", - "acc_pointer_IR", - "optic_Aco", - [ - "30Rnd_65x39_caseless_mag", - 30 - ], - [ - "1Rnd_HE_Grenade_shell", - 1 - ], - "" - ]$/Code$ - - (October 25, 2014) - The output of this command is an array of arrays and is as follows: (If the unit only has 1 weapon, output is an array within an array.) - $Code$[ - [ - ((_arr select 0) select 0) //STRING - The weapon's classname - ((_arr select 0) select 1) //STRING - Classname of the unit's equipped 'Muzzle/Barrel Accessory' - ((_arr select 0) select 2) //STRING - Classname of the unit's equipped 'Side Accessory' - ((_arr select 0) select 3) //STRING - Classname of the unit's equipped 'Top/Optic Accessory' - ((_arr select 0) select 4) //ARRAY - Magazine information - [ - (((_arr select 0) select 4) select 0) //STRING - Classname of the loaded magazine - (((_arr select 0) select 4) select 1) //SCALAR(Number) - Amount of bullets in the mag - ] - ] //If unit has more than one weapon, the output will follow the same pattern as above except with a new element - ]$/Code$ + (December 18, 2015) + If one desires to retrieve an object from an array of object, be sure to wrap your array information in parenthesis. e.g. getPosATL ( myArray select 0 ) ; - Array + Array + - weaponsTurret + moveOut - Returns all weapons of given turret. Use turret path [-1] for driver's turret. + Moves the soldier out of vehicle, immediately, without animation. - https://community.bistudio.com/wiki/weaponsTurret + https://community.bistudio.com/wiki/moveOut - Object weaponsTurret Array + moveOut Object - vehicle weaponsTurret turretPath + moveOut soldier - $Code$_weapons = vehicle player weaponsTurret [0,0]$/Code$ - - $Code$_weapons = _tank weaponsTurret [0]$/Code$ - - $Code$_driverWeapon = _ka50pilot weaponsTurret [-1]$/Code$ + $Code${ if ( lifeState _x == "UNCONSCIOUS") then { moveOut _x}} forEach crew cursorTarget ;$/Code$ - $Code$_weaponsForAnyTurrentPosition = (vehicle player) weaponsTurret ((assignedVehicleRole player) select 1)$/Code$ + $Code$// Move out player just before he dies: + player addEventHandler [ + "HandleDamage", + format [ + ' if ( switch (_this select 1) do { + case "": {_this select 2 = 1}; + case "head": {_this select 2 = %1}; + case "body": {_this select 2 = %2}; + default { false }; + }) then { moveOut player }', + getNumber ( configFile "CfgFirstAid" "CriticalHeadHit"), + getNumber ( configFile "CfgFirstAid" "CriticalBodyHit") + ] + ];$/Code$ - global / undefined + global / global - (11 March 2011) - Use assignedVehicleRole in combination to easily determine the weapons for any vehicle position. You need to check for -1 if the unit is in the driver/pilot position. See example 3 and 4. + (September 12, 2010) + Seems to work only for unconscious - NOT for dead bodies. setPos /ATL/ASL seems to the only working for dead bodies. - (11 March 2011) - funcGetTurretsWeapons = { - private ["_result", "_getAnyMagazines", "_findRecurse", "_class"]; - _result = []; - _getAnyMagazines = { - private ["_weapon", "_mags"]; - _weapon = configFile "CfgWeapons" _this; - _mags = []; - { - _mags = _mags + getArray ( - (if (_x == "this") then { _weapon } else { _weapon _x }) "magazines" - ) - } foreach getArray (_weapon "muzzles"); - _mags - }; - _findRecurse = { - private ["_root", "_class", "_path", "_currentPath"]; - _root = (_this select 0); - _path = +(_this select 1); - for "_i" from 0 to count _root -1 do { - _class = _root select _i; - if (isClass _class) then { - _currentPath = _path + [_i]; - { - _result set [count _result, [_x, _x call _getAnyMagazines, _currentPath, str _class]]; - } foreach getArray (_class "weapons"); - _class = _class "turrets"; - if (isClass _class) then { - [_class, _currentPath] call _findRecurse; - }; - }; - }; - }; - _class = ( - configFile "CfgVehicles" ( - switch (typeName _this) do { - case "STRING" : {_this}; - case "OBJECT" : {typeOf _this}; - default {nil} - } - ) "turrets" - ); - [_class, []] call _findRecurse; - _result; - }; - This call: - "M1A2_US_TUSK_MG_EP1" call funcGetTurretsWeapons - will return all turrets weapons, its magazines and its paths: - [ - ["M256", ["20Rnd_120mmSABOT_M1A2", "20Rnd_120mmHE_M1A2"], [0], "bin\config.bin/CfgVehicles/M1A2_US_TUSK_MG_EP1/Turrets/MainTurret"], - ["M240_veh", ["100Rnd_762x51_M240", "1200Rnd_762x51_M240"], [0], "bin\config.bin/CfgVehicles/M1A2_US_TUSK_MG_EP1/Turrets/MainTurret"], - ["M2BC", ["100Rnd_127x99_M2"], [0, 0], "bin\config.bin/CfgVehicles/M1A2_US_TUSK_MG_EP1/Turrets/MainTurret/Turrets/CommanderOptics"], - ["SmokeLauncher", ["SmokeLauncherMag"], [0, 0], "bin\config.bin/CfgVehicles/M1A2_US_TUSK_MG_EP1/Turrets/MainTurret/Turrets/CommanderOptics"], - ["M240_veh_2", ["100Rnd_762x51_M240", "1200Rnd_762x51_M240"], [0, 1], "bin\config.bin/CfgVehicles/M1A2_US_TUSK_MG_EP1/Turrets/MainTurret/Turrets/LoaderTurret"] - ] - denisko.redisko (denvdmj) + (December 30, 2017) + moveOut currently doesn't work for units with setUnconscious true. Use _unit setPos (_unit modelToWorldVisual [0,0,0]) instead. - Array + Nothing + - weapons + hcSelected - Returns array of names of all Unit 's weapons. + Returns selected groups in high command. - https://community.bistudio.com/wiki/weapons + https://community.bistudio.com/wiki/hcSelected - weapons Object + hcSelected Object - weapons vehicleName + hcSelected unit - $Code$_wArray = weapons player ;$/Code$ + $Code$array = hcSelected unit;$/Code$ undefined / undefined - (12:07, 20 January 2007) - (A1 1.02) this command returns only weapons defined for the primary turret of the vehicle. - for ex. only ["D81", "PKT"] for t72, not ["D81", "PKT","DSHKM"] - - (06:01, 3 March 2007 (CET)) - - (11 March 2011) - Use weaponsTurret to determine the weapons of a non gunner/turret position. - - (25 November 2011) - This command does not include non-turret weapons, such as smoke, flare or chaff launchers which are usually declared in the root of the vehicle's class, rather than in the Turrets hierarchy. (Unsure whether it excludes it because it is not in the turret or because these are not considered true weapons via some property.) - - (18 June 2013) - Lists also weapons in inventory from Arma 3 ver. 0.70. - Array + Array + - weightRTD + isVehicleSensorEnabled - Returns weight of RTD helicopter. + Returns class name (to identify list based on component name) and info if given sensor is enabled - https://community.bistudio.com/wiki/weightRTD + https://community.bistudio.com/wiki/isVehicleSensorEnabled - weightRTD Object + Object isVehicleSensorEnabled String - weightRTD helicopter + vehicle isVehicleSensorEnabled componentName - $Code$_taruWeight = weightRTD taru// Returns [7000,300,1990.56,0,0]$/Code$ + $Code$vehicle player isVehicleSensorEnabled "PassiveRadarSensorComponent"; // [ ["PassiveRadarSensorComponent",true] ]$/Code$ undefined / undefined @@ -75876,33 +78928,28 @@ - Array + Array + - west + weaponCargo - West side. + Get array with weapons from ammo box (or any general weapon holder container). - https://community.bistudio.com/wiki/west + https://community.bistudio.com/wiki/weaponCargo - west + weaponCargo Object - west + weaponCargo box - $Code$// SQS: - ?((side _unit) == west ) : hint "This is a western unit!"$/Code$ - - $Code$// SQF: - if (( side _unit) == west ) then { - hint "This is a western unit!"; - };$/Code$ + $Code$hint str weaponCargo backpackContainer player ;$/Code$ undefined / undefined @@ -75910,98 +78957,100 @@ - Side + Array + - while + vectorDotProduct - Repeats Code while condition is true. A part of while do construct. + Dot product of two 3D vectors. - https://community.bistudio.com/wiki/while + https://community.bistudio.com/wiki/vectorDotProduct - while Code + Array vectorDotProduct Array - while condition + vector1 vectorDotProduct vector2 - $Code$while {a b} do {a = a + 1};$/Code$ - - $Code$// A practical example: Repair all members of a group to such a level that they are able to stand up: - { - while {! canStand _x && alive _x } do { - _x setDamage ( damage _x - 0.01); - }; - } forEach units group unitname;$/Code$ + $Code$_dot = [1,0,1] vectorDotProduct [0,0,2];$/Code$ undefined / undefined - (May 14, 2008) - The boolean code that's used to evaluate the while condition can be preceded by code that executes a regular command. - $Code$ while {_a =_a + 1; _a 10} do {...}$/Code$ - - (August 30, 2014) - In non-scheduled environment, while do loop is limited to 10,000 iterations, after which it exits even if condition is still true. In scheduled environment no such limit exists. + (28 Jun, 2014) + (ArmA3 1.22)Algorithm: + $Code$ + Vector1 = [x1,y1,z1]; Vector2 = [x2,y2,z2]; + Result = (x1 * x2) + (y1 * y2) + (z1 * z2) + $/Code$ + It is recommended to use vectorDotProduct instead of BIS_fnc_dotProduct. - While_Type + Number + - windDir + playersNumber - Returns the current wind azimuth. + Returns count of occupied role selection slots for given side. Players who claimed a slot in the lobby but didn't start the mission are counted as well. If disabledAI = 0; in description.ext or Enable AI option is checked in 3DEN, AI bots will be treated as valid players and will be counted too. Multiplayer only, in singleplayer always returns 0. - https://community.bistudio.com/wiki/windDir + https://community.bistudio.com/wiki/playersNumber - windDir + playersNumber Side - windDir + playersNumber side - $Code$if ( windDir 45 || windDir 315) then { - hint "I feel a northern wind"; - };$/Code$ + $Code$_west = playersNumber west ; + _east = playersNumber east ; + _civ = playersNumber civilian ; + hint format ["West:%1 East:%2, Civ:%3", _west, _east, _civ];$/Code$ undefined / undefined + (April 13, 2015) + playersNumber returns playable AI as well as human players. It does not include non playable AI. [NOTE: This was observed in ArmA 1.05] + To get the amount of players that are on the same side as the person executing the script: + $Code$playersNumber playerSide;$/Code$ - Number + Number + - windStr + numberToDate - Returns the current wind strength. + Convert float number to a date. - https://community.bistudio.com/wiki/windStr + https://community.bistudio.com/wiki/numberToDate - windStr + numberToDate Array - windStr + numberToDate [year,time] - $Code$10 setWindStr (0.5 * windStr );$/Code$ + $Code$_date = numberToDate [2008,0.5324]; //[2008,7,13,7,49]$/Code$ undefined / undefined @@ -76009,142 +79058,118 @@ - Number + Array + - wind + player - Returns the current wind vector (in m/s) as array [x, z, y]. + Person controlled by player. + In MP this value is different on each computer and on dedicated server this value is null. + In Intros and Outros this isn't set by default and must be assigned. - https://community.bistudio.com/wiki/wind + https://community.bistudio.com/wiki/player - wind + player - wind + player - $Code$_windarray = wind ;$/Code$ + $Code$player addRating 500;$/Code$ undefined / undefined - In OFP 1.96, wind speed and direction are directly related to overcast. + (20 Jul, 2010) + Before you use the player object (usually to avoid JIP issues) all you need is to run: + waitUntil {!isNull player}; + Anything else you see in other scripts is equivalent and/or redundant. Of course JIP players may need more than just the player to point at the actual JIP player unit, but that's script/mission-specific. + + (27 Jan, 2008) + ( isNull player ) is true for JIP players on their client during initialization. + After initialization, it will be set, making it valid again. + To cater for this, some people use code similar to the following in their spawned scripts: + if (!isServer && (player != player)) then + { + waitUntil {player == player}; + waitUntil {time 10}; + }; + // 'player' will now be valid + _action = player addAction ["heal", "heal.sqf", [], -1, false, false, ""]; + See JIP/player topic for additional helpful information. + + (June 26, 2014) + player can actually be REMOTE object on player's PC: http://www.youtube.com/watch?v=m6IILtfa3cQ - Array + Object + - wingsForcesRTD + fromEditor - Returns force produced by wings. + Return if given team was inserted directly from mission editor. - https://community.bistudio.com/wiki/wingsForcesRTD + https://community.bistudio.com/wiki/fromEditor - wingsForcesRTD Object + fromEditor Team_Member - wingsForcesRTD RTD_helicopter + fromEditor teamMember - $Code$_wingForce = wingsForcesRTD _rtdHelo$/Code$ + $Code$_fromEditor = fromEditor _member$/Code$ undefined / undefined - (March 19, 2015) - Advanced helicopter flight model MUST be enabled for this function to work, otherwise it returns an empty array. - Returns a 3x3 two-dimensional array. In the editor while climbing in a little bird, it returned this: - [ [ 0.3993577, 11.72865, -30.21434 ], [ 0.3053164, 11.17272, -30.17695 ], [ 94.33984, 51.3513, -40.4908 ] ] - Array + Boolean + - with + removeHandgunItem - Creates a With Type that is used inside a do construct in order to execute code inside a given namespace. - when used in a do-construct in scripts with allowed suspension, an unexpected namespace switch could happen (see note below) - NOTE for the reasons unknown, namespace switching might unexpectedly occur inside some scopes ( for, if, try, call ) started in scheduled scripts ( canSuspend true) after small suspension if with was not the main scope. For example: - $Code$[] spawn - { - with uiNamespace do - { - for "_i" from 1 to 1 do - { - systemChat str [ - currentNamespace isEqualTo uiNamespace, - currentNamespace isEqualTo missionNamespace - ]; - // result [true, false] - sleep 0.05; // -- small suspension - systemChat str [ - currentNamespace isEqualTo uiNamespace, - currentNamespace isEqualTo missionNamespace - ]; - // result [false, true] -- switching - }; - }; - };$/Code$ - However if with used in parent scope, everything works correctly: - $Code$ with uiNamespace do - { - [] spawn - { - for "_i" from 1 to 1 do - { - systemChat str [ - currentNamespace isEqualTo uiNamespace, - currentNamespace isEqualTo missionNamespace - ]; - // result [true, false] - sleep 0.05; // -- small suspension - systemChat str [ - currentNamespace isEqualTo uiNamespace, - currentNamespace isEqualTo missionNamespace - ]; - // result [true, false] -- NO switching - }; - }; - };$/Code$ - To eliminate possibility of error you can also use setVariable or getVariable with desired Namespace, which is also scheduled environment save. + Removes given weapon item from the handgun weapon cargo space. + As of Arma 3 DEV 1.37, this command also supports weapon magazines. - https://community.bistudio.com/wiki/with + https://community.bistudio.com/wiki/removeHandgunItem - with Namespace + Object removeHandgunItem String - with namespace + unit removeHandgunItem item - $Code$_myWithType = with uiNamespace ;$/Code$ - - $Code$with missionNamespace do {global = global + 1};$/Code$ + $Code$player removeHandgunItem "muzzle_snds_L";$/Code$ - undefined / undefined + local / global - With_Type + Nothing + @@ -76172,27 +79197,88 @@ - String + String + - worldSize + unitAimPositionVisual - Returns config size of the current world. + Returns the position on the unit other units can aim at in render scope. See also aimPos, unitAimPosition. - https://community.bistudio.com/wiki/worldSize + https://community.bistudio.com/wiki/unitAimPositionVisual - worldSize + unitAimPositionVisual Object - worldSize + unitAimPositionVisual unit - $Code$_size = worldSize ; //8192$/Code$ + $Code$unitAimPositionVisual player ;$/Code$ + + + global / undefined + + + + + Array + + + + + + setPilotLight + + + Switches headlights of a vehicle on/off. Note that the vehicle has to be local, for global variant use Arma 3 Actions " LightOn "/" LightOff " + + + https://community.bistudio.com/wiki/setPilotLight + + + Object setPilotLight Boolean + + + vehicle setPilotLight set + + + $Code$car setPilotLight true ;$/Code$ + + + local / global + + + + + Nothing + + + + + + missionVersion + + + Returns the version of the current mission. + Mission from the 2D Editor : 12 + Mission from the Eden Editor : 15 and higher (for example current version for Eden Editor mission in Arma 3 v1.57 is 51) + + + https://community.bistudio.com/wiki/missionVersion + + + missionVersion + + + missionVersion + + + $Code$_version = missionVersion ;$/Code$ undefined / undefined @@ -76200,33 +79286,96 @@ - Number + Number + - worldToModelVisual + customChat - Converts position from world space to object model space in render time scope. + Sends the chat message to the custom radio channel. The radio channel needs to be created on the server before hand, with radioChannelCreate command. - https://community.bistudio.com/wiki/worldToModelVisual + https://community.bistudio.com/wiki/customChat - Object worldToModelVisual Array + Object customChat Array - object worldToModelVisual worldPosition + unit customChat [channel, message] - $Code$_relPos = myObject worldToModelVisual [0,0,0];$/Code$ - - $Code$_relPos = player worldToModelVisual position car;$/Code$ - - $Code$_relPos = car worldToModelVisual [12000,5000];$/Code$ + $Code$_unit customChat [1, "Hi, I am a custom chat message"];$/Code$ - $Code$_relPos = unit worldToModelVisual position tank;$/Code$ + $Code$driver vehicle player sideChat "sideChat"; + driver vehicle player globalChat "globalChat"; + driver vehicle player groupChat "groupChat"; + vehicle player vehicleChat "vehicleChat"; + driver vehicle player commandChat "commandChat"; + driver vehicle player customChat [1, "customChat"]; + systemChat "systemChat";$/Code$ + + + global / local + + + + + Nothing + + + + + + removeTeamMember + + + Remove given member from given team. Effect is local, unless both member and team are local to PC on which command is executed, then effect is global. + + + https://community.bistudio.com/wiki/removeTeamMember + + + Team_Member removeTeamMember Team_Member + + + team removeTeamMember member + + + $Code$_team removeTeamMember _teamMember;$/Code$ + + + local / local + + + + + Nothing + + + + + + collapseObjectTree + + + Collapse the object tree. + i + Some Old Editor Command + + + https://community.bistudio.com/wiki/collapseObjectTree + + + collapseObjectTree Control + + + collapseObjectTree map + + + $Code$collapseObjectTree _map,$/Code$ undefined / undefined @@ -76234,31 +79383,30 @@ - Array + Nothing + - worldToModel + isMultiplayer - Converts position from world space to object model space. + Return true if multiPlayer. - https://community.bistudio.com/wiki/worldToModel + https://community.bistudio.com/wiki/isMultiplayer - Object worldToModel Array + isMultiplayer - model worldToModel position + isMultiplayer - $Code$_relPos = myObject worldToModel [0,0,0];$/Code$ - - $Code$_relPos = player worldToModel position car;$/Code$ - - $Code$_relPos = car worldToModel [12000,5000];$/Code$ + $Code$if (isMultiplayer) then { + //...block + }$/Code$ undefined / undefined @@ -76266,39 +79414,44 @@ - Array + Boolean + - worldToScreen + lbData - Converts position in world space into screen (UI) space. If a specified position is not within the current screen view, an empty array is returned. + Returns the additional text (invisible) in an item with the given index of the listbox or combobox with id idc of the topmost user dialog. - https://community.bistudio.com/wiki/worldToScreen + https://community.bistudio.com/wiki/lbData - worldToScreen Array + lbData Array + + Control lbData Number - worldToScreen position + lbData [idc, index] + + control lbData index - $Code$_screenPos = worldToScreen getPos soldier1;$/Code$ + $Code$_data = lbData [101, 0];$/Code$ - $Code$_screenPos = worldToScreen ( player modelToWorld [0,10,0]);$/Code$ + $Code$_data = _control lbData 0;$/Code$ - undefined / undefined + local / local - (august 19th, 2012) - please take safezones in consideration : the returned result can be out of the [0,0]..[1,1] range and can also be a filled array even if the position is not displayed on your monitor - this command thinks of triplescreens configurations as well. [] returned = not rendered + More information on the LB command family can be found here - Array + String - String + diff --git a/plugin/Raven.SQDev.Misc/src/raven/sqdev/activator/Activator.java b/plugin/Raven.SQDev.Misc/src/raven/sqdev/activator/Activator.java index 829538b9..e597faaa 100644 --- a/plugin/Raven.SQDev.Misc/src/raven/sqdev/activator/Activator.java +++ b/plugin/Raven.SQDev.Misc/src/raven/sqdev/activator/Activator.java @@ -3,7 +3,7 @@ import org.eclipse.ui.plugin.AbstractUIPlugin; import org.osgi.framework.BundleContext; -import raven.sqdev.pluginManager.SQDevPluginManager; +import raven.sqdev.pluginManagement.SQDevPluginManager; public class Activator extends AbstractUIPlugin { diff --git a/plugin/Raven.SQDev.Misc/src/raven/sqdev/constants/ProblemMessages.java b/plugin/Raven.SQDev.Misc/src/raven/sqdev/constants/ProblemMessages.java index bcc70ea8..c0d0589e 100644 --- a/plugin/Raven.SQDev.Misc/src/raven/sqdev/constants/ProblemMessages.java +++ b/plugin/Raven.SQDev.Misc/src/raven/sqdev/constants/ProblemMessages.java @@ -46,6 +46,18 @@ public static final String operatorIsNotNular(String operatorName) { return "The operator \"" + operatorName + "\" can not be used as a nular operator!"; } + /** + * Creates the error message stating that the operator was wrongly used as a + * unary operator + * + * @param operatorName + * The name of the operator + * @return The created error message + */ + public static final String operatorIsNotUnary(String operatorName) { + return "The operator \"" + operatorName + "\" can not be used as a unary operator!"; + } + /** * Creates the error message stating that the operator was wrongly used as a * binary operator @@ -130,39 +142,43 @@ public static final String expectedType(String type) { * The set of given types * @return the generated error message */ - public static final String expectedTypeButGot(EDataType[] expected, EDataType[] got) { + public static final String expectedTypeButGot(Iterable expected, Iterable got) { StringBuilder builder = new StringBuilder("Expected type "); + boolean multipleTypes = false; - for (int i = 0; i < expected.length; i++) { - EDataType currentType = expected[i]; - - if (i == 0) { + for (EDataType currentType : expected) { + if (!multipleTypes) { builder.append("\"" + currentType + "\""); + multipleTypes = true; } else { - if (i == expected.length - 1) { - builder.append(" or \"" + currentType + "\""); - } else { - builder.append(", \"" + currentType + "\""); - } + builder.append(", \"" + currentType + "\""); } } - builder.append(" but got "); + // replace last comma by "or" + int commaIndex = builder.lastIndexOf(","); + if (commaIndex >= 0) { + builder.replace(commaIndex, commaIndex + 1, " or"); + } - for (int i = 0; i < got.length; i++) { - EDataType currentType = got[i]; + builder.append(" but got "); - if (i == 0) { + multipleTypes = false; + for (EDataType currentType : got) { + if (!multipleTypes) { builder.append("\"" + currentType + "\""); + multipleTypes = true; } else { - if (i == got.length - 1) { - builder.append(" or \"" + currentType + "\""); - } else { - builder.append(", \"" + currentType + "\""); - } + builder.append(", \"" + currentType + "\""); } } + // replace last comma by "or" + commaIndex = builder.lastIndexOf(","); + if (commaIndex >= 0) { + builder.replace(commaIndex, commaIndex + 1, " or"); + } + builder.append("!"); return builder.toString(); @@ -272,10 +288,31 @@ public static final String missingSemicolon(String at) { } /** - * The error message stating thath there is an unclosed opening character pair + * The error message stating that there is a missing comma + * + * @param at + * The ID after which the semicolon was expected + */ + public static final String missingComma(String at) { + return "Missing ',' at \"" + at + "\""; + } + + /** + * The error message stating that the given token is misplaced and that it + * should either be deleted or moved elsewhere. + * + * @param token + * The misplaced token + */ + public static final String misplacedToken(String token) { + return "Misplaced token \"" + token + "\". Delete or move it!"; + } + + /** + * The error message stating that there is an unclosed opening character pair * * @param opener - * The opening character that doesnt get closed + * The opening character that doesn't get closed */ public static final String unclosedOpener(char opener) { char openMark, closeMark; @@ -290,7 +327,7 @@ public static final String unclosedOpener(char opener) { } /** - * The error message stating thath there is an invalid closing character + * The error message stating that there is an invalid closing character * * @param opener * The invalid closing character @@ -306,4 +343,83 @@ public static final String invalidClosingCharacter(char closer) { return "Invalid closing character " + openMark + closer + closeMark; } + + /** + * The error message stating that an invalid expression in the given context has + * been found + * + * @param context + * The context in which the invalid expression occurred + */ + public static final String invalidExpression(String context) { + return "Invalid expression in context of \"" + context + "\""; + } + + /** + * The error message stating that "private" is the only permitted modifier for + * an assignment + */ + public static final String privateIsOnlyValidModifierForAssignments() { + return "\"private\" is the only permitted modifier for assignments"; + } + + /** + * Error message stating that private variables have to be local + */ + public static final String privateVariablesMustBeLocal() { + return "Private variables have to be local (starting with \"_\")"; + } + + /** + * Error message stating that the given keyword is reserved + */ + public static final String reservedKeyword(String keyword) { + return "\"" + keyword + "\" is a reserved keyword!"; + } + + /** + * The error message stating that the expected array size has not been matched + * + * @param expected + * The expected array length + * @param got + * The actual array length + * @return The constructed error message + */ + public static final String expectedArrayLength(int expected, int got) { + return "Expected array with exactly " + expected + " elements but got " + got; + } + + /** + * The error message stating that the minimal array size has not been reached + * + * @param minimum + * The expected minimal array length + * @param got + * The actual array length + * @return The constructed error message + */ + public static final String expectedMinimumArrayLength(int minimum, int got) { + return "Expected array with at least " + minimum + " elements but got only " + got; + } + + /** + * The error message stating that the maximal array size has been exceeded + * + * @param maximum + * The expected maximal array length + * @param got + * The actual array length + * @return The constructed error message + */ + public static final String expectedMaximalArrayLength(int maximum, int got) { + return "Expected array with at most " + maximum + " elements but got " + got; + } + + /** + * The error message for internal errors + */ + public static final String internalError() { + return "!!! Internal error !!!"; + } } diff --git a/plugin/Raven.SQDev.Misc/src/raven/sqdev/exceptions/ValidationException.java b/plugin/Raven.SQDev.Misc/src/raven/sqdev/exceptions/ValidationException.java new file mode 100644 index 00000000..a62bcb10 --- /dev/null +++ b/plugin/Raven.SQDev.Misc/src/raven/sqdev/exceptions/ValidationException.java @@ -0,0 +1,26 @@ +package raven.sqdev.exceptions; + +public class ValidationException extends SQDevException { + + private static final long serialVersionUID = 3118718175023220832L; + + public ValidationException() { + } + + public ValidationException(String message) { + super(message); + } + + public ValidationException(Throwable cause) { + super(cause); + } + + public ValidationException(String message, Throwable cause) { + super(message, cause); + } + + public ValidationException(String message, Throwable cause, boolean enableSuppression, boolean writableStackTrace) { + super(message, cause, enableSuppression, writableStackTrace); + } + +} diff --git a/plugin/Raven.SQDev.Misc/src/raven/sqdev/infoCollection/SQFCommandCollector.java b/plugin/Raven.SQDev.Misc/src/raven/sqdev/infoCollection/SQFCommandCollector.java index fbd03015..23f1ff91 100644 --- a/plugin/Raven.SQDev.Misc/src/raven/sqdev/infoCollection/SQFCommandCollector.java +++ b/plugin/Raven.SQDev.Misc/src/raven/sqdev/infoCollection/SQFCommandCollector.java @@ -72,27 +72,25 @@ public class SQFCommandCollector { * The character that is used in order to mark optional parameters */ public static final char OPTIONAL_MARKER = '?'; - + /** - * A set of essential commands that are forced to be included in the - * collection process + * A set of essential commands that are forced to be included in the collection + * process */ - public static final String[] ESSENTIAL_COMMANDS = { "if", "then", "else", - "while", "do", "for", "with", "switch", "from", "to", "step", - "count", "forEach" }; - + public static final String[] ESSENTIAL_COMMANDS = { "if", "then", "else", "while", "do", "for", "with", "switch", + "from", "to", "step", "count", "forEach" }; + /** - * A list of operators that are not retrieved by the normal command - * collection as they are listed in a different format + * A list of operators that are not retrieved by the normal command collection + * as they are listed in a different format */ - public static final String[] MANUAL_COMMANDS = { "!", "==", "!=", "<", "<=", - ">", ">=", "&&", "||", "+", "-", "*", "/", "^", "%", ">>", ":" }; - + public static final String[] MANUAL_COMMANDS = { "!", "==", "!=", "<", "<=", ">", ">=", "&&", "||", "+", "-", "*", + "/", "^", "%", ">>", ":" }; + /** * The corresponding command descriptions to {@link #MANUAL_COMMANDS} */ - public static final String[] MANUAL_COMMANDS_DESCRIPTION = { - "Negates the given Boolean value. Synonym for 'not'.", + public static final String[] MANUAL_COMMANDS_DESCRIPTION = { "Negates the given Boolean value. Synonym for 'not'.", "Check if one value is equal to another. Both values need to be of the same type.", "Returns whether one value is not equal to another. Both values have need be of the same type.", "Checks if the left number is smaller than the right one", @@ -116,79 +114,54 @@ public class SQFCommandCollector { "Returns the remainder of a corresponding division", "Returns subentry of config entry with given name. Identical to config/name.", "Helper construct used in a switch-construct" }; - + /** * The corresponding syntaxes to {@link #MANUAL_COMMANDS} */ - public static final String[][] MANUAL_COMMANDS_SYNTAX = { - { "! " + EDataType.BOOLEAN }, - { EDataType.ANYTHING + " == " + EDataType.ANYTHING }, - { EDataType.ANYTHING + " != " + EDataType.ANYTHING }, - { EDataType.NUMBER + " < " + EDataType.NUMBER }, - { EDataType.NUMBER + " <= " + EDataType.NUMBER }, - { EDataType.NUMBER + " > " + EDataType.NUMBER }, - { EDataType.NUMBER + " >= " + EDataType.NUMBER }, - { EDataType.BOOLEAN + " && " + EDataType.BOOLEAN - + DataTypeList.TYPE_SEPERATOR + EDataType.CODE }, - { EDataType.BOOLEAN + " || " + EDataType.BOOLEAN - + DataTypeList.TYPE_SEPERATOR + EDataType.CODE }, - { EDataType.NUMBER + " + " + EDataType.NUMBER, - EDataType.STRING + " + " + EDataType.STRING, - EDataType.ARRAY + " + " + EDataType.ARRAY, - "+ " + EDataType.NUMBER, "+ " + EDataType.ARRAY, + public static final String[][] MANUAL_COMMANDS_SYNTAX = { { "! " + EDataType.BOOLEAN }, + { EDataType.ANYTHING + " == " + EDataType.ANYTHING }, { EDataType.ANYTHING + " != " + EDataType.ANYTHING }, + { EDataType.NUMBER + " < " + EDataType.NUMBER }, { EDataType.NUMBER + " <= " + EDataType.NUMBER }, + { EDataType.NUMBER + " > " + EDataType.NUMBER }, { EDataType.NUMBER + " >= " + EDataType.NUMBER }, + { EDataType.BOOLEAN + " && " + EDataType.BOOLEAN + DataTypeList.TYPE_SEPERATOR + EDataType.CODE }, + { EDataType.BOOLEAN + " || " + EDataType.BOOLEAN + DataTypeList.TYPE_SEPERATOR + EDataType.CODE }, + { EDataType.NUMBER + " + " + EDataType.NUMBER, EDataType.STRING + " + " + EDataType.STRING, + EDataType.ARRAY + " + " + EDataType.ARRAY, "+ " + EDataType.NUMBER, "+ " + EDataType.ARRAY, "+ " + EDataType.STRING }, - { EDataType.NUMBER + " - " + EDataType.NUMBER, - EDataType.ARRAY + " - " + EDataType.ARRAY, + { EDataType.NUMBER + " - " + EDataType.NUMBER, EDataType.ARRAY + " - " + EDataType.ARRAY, "- " + EDataType.NUMBER }, { EDataType.NUMBER + " * " + EDataType.NUMBER }, - { EDataType.NUMBER + " / " + EDataType.NUMBER, - EDataType.CONFIG + " / " + EDataType.STRING }, - { EDataType.NUMBER + " ^ " + EDataType.NUMBER }, - { EDataType.NUMBER + " % " + EDataType.NUMBER }, - { EDataType.CONFIG + " >> " + EDataType.STRING }, - { EDataType.SWITCH_TYPE + " : " + EDataType.CODE } }; - + { EDataType.NUMBER + " / " + EDataType.NUMBER, EDataType.CONFIG + " / " + EDataType.STRING }, + { EDataType.NUMBER + " ^ " + EDataType.NUMBER }, { EDataType.NUMBER + " % " + EDataType.NUMBER }, + { EDataType.CONFIG + " >> " + EDataType.STRING }, { EDataType.SWITCH_TYPE + " : " + EDataType.CODE } }; + /** * The corresponding wiki page adresses for {@link #MANUAL_COMMANDS} */ - public static final String[] MANUAL_COMMANDS_WIKI = { - "https://community.bistudio.com/wiki/!_a", - "https://community.bistudio.com/wiki/a_%3D%3D_b", - "https://community.bistudio.com/wiki/a_!%3D_b", - "https://community.bistudio.com/wiki/a_less_b", - "https://community.bistudio.com/wiki/a_less%3D_b", - "https://community.bistudio.com/wiki/a_greater_b", - "https://community.bistudio.com/wiki/a_greater%3D_b", - "https://community.bistudio.com/wiki/a_%26%26_b", - "https://community.bistudio.com/wiki/a_or_b", - "https://community.bistudio.com/wiki/valuea_plus_valueb", - "https://community.bistudio.com/wiki/a_-_b", - "https://community.bistudio.com/wiki/a_*_b", - "https://community.bistudio.com/wiki/a_/_b", - "https://community.bistudio.com/wiki/a_%5E_b", - "https://community.bistudio.com/wiki/a_%25_b", + public static final String[] MANUAL_COMMANDS_WIKI = { "https://community.bistudio.com/wiki/!_a", + "https://community.bistudio.com/wiki/a_%3D%3D_b", "https://community.bistudio.com/wiki/a_!%3D_b", + "https://community.bistudio.com/wiki/a_less_b", "https://community.bistudio.com/wiki/a_less%3D_b", + "https://community.bistudio.com/wiki/a_greater_b", "https://community.bistudio.com/wiki/a_greater%3D_b", + "https://community.bistudio.com/wiki/a_%26%26_b", "https://community.bistudio.com/wiki/a_or_b", + "https://community.bistudio.com/wiki/valuea_plus_valueb", "https://community.bistudio.com/wiki/a_-_b", + "https://community.bistudio.com/wiki/a_*_b", "https://community.bistudio.com/wiki/a_/_b", + "https://community.bistudio.com/wiki/a_%5E_b", "https://community.bistudio.com/wiki/a_%25_b", "https://community.bistudio.com/wiki/config_greater_greater_name", "https://community.bistudio.com/wiki/a:b" }; - + /** * The corresponding return values to {@link #MANUAL_COMMANDS} */ - public static final String[][] MANUAL_COMMANDS_RETURN_TYPE = { - { EDataType.BOOLEAN.toString() }, { EDataType.BOOLEAN.toString() }, - { EDataType.BOOLEAN.toString() }, { EDataType.BOOLEAN.toString() }, + public static final String[][] MANUAL_COMMANDS_RETURN_TYPE = { { EDataType.BOOLEAN.toString() }, + { EDataType.BOOLEAN.toString() }, { EDataType.BOOLEAN.toString() }, { EDataType.BOOLEAN.toString() }, + { EDataType.BOOLEAN.toString() }, { EDataType.BOOLEAN.toString() }, { EDataType.BOOLEAN.toString() }, { EDataType.BOOLEAN.toString() }, { EDataType.BOOLEAN.toString() }, - { EDataType.BOOLEAN.toString() }, { EDataType.BOOLEAN.toString() }, - { EDataType.BOOLEAN.toString() }, - { EDataType.NUMBER.toString(), EDataType.STRING.toString(), - EDataType.ARRAY.toString(), EDataType.NUMBER.toString(), - EDataType.ARRAY.toString(), EDataType.STRING.toString() }, - { EDataType.NUMBER.toString(), EDataType.ARRAY.toString(), - EDataType.NUMBER.toString() }, - { EDataType.NUMBER.toString() }, - { EDataType.NUMBER.toString(), EDataType.CONFIG.toString() }, - { EDataType.NUMBER.toString() }, { EDataType.NUMBER.toString() }, - { EDataType.CONFIG.toString() }, { EDataType.NOTHING.toString() } }; - + { EDataType.NUMBER.toString(), EDataType.STRING.toString(), EDataType.ARRAY.toString(), + EDataType.NUMBER.toString(), EDataType.ARRAY.toString(), EDataType.STRING.toString() }, + { EDataType.NUMBER.toString(), EDataType.ARRAY.toString(), EDataType.NUMBER.toString() }, + { EDataType.NUMBER.toString() }, { EDataType.NUMBER.toString(), EDataType.CONFIG.toString() }, + { EDataType.NUMBER.toString() }, { EDataType.NUMBER.toString() }, { EDataType.CONFIG.toString() }, + { EDataType.NOTHING.toString() } }; + /** * The string represnetation of the webadress to the BIKI API */ @@ -197,12 +170,12 @@ public class SQFCommandCollector { * The name of the main page where all the commands are listed */ private final String mainPageName; - + /** * The list of processed Keywords */ private KeywordList list; - + /** * Creates an instance of this collector * @@ -214,17 +187,16 @@ public class SQFCommandCollector { public SQFCommandCollector(String apiAdress, String mainPageName) { Assert.isTrue(apiAdress != null && !apiAdress.isEmpty()); Assert.isTrue(mainPageName != null && !mainPageName.isEmpty()); - + this.apiAdress = apiAdress; this.mainPageName = mainPageName; } - + /** * Starts the collection of the SQF commands * * @param monitor - * The IProgressMonitor used to watch this - * collection + * The IProgressMonitor used to watch this collection * @param repeat * The URL to repeat. This is only if one command has failed and * should be repeated. If there is no such command this argument @@ -232,78 +204,71 @@ public SQFCommandCollector(String apiAdress, String mainPageName) { * @return The KeywordList conatining the gathered keywords * @throws SQDevCollectionException */ - public KeywordList collect(IProgressMonitor monitor, URL repeat) - throws SQDevCollectionException { + public KeywordList collect(IProgressMonitor monitor, URL repeat) throws SQDevCollectionException { monitor.subTask("Initializing"); - + SQFCommandPageProvider provider; try { provider = new SQFCommandPageProvider(apiAdress, mainPageName); } catch (IOException e1) { e1.printStackTrace(); - + // rethrow exception - throw new SQDevCollectionException(e1.getMessage(), null, - new KeywordList()); + throw new SQDevCollectionException(e1.getMessage(), null, new KeywordList()); } - + if (repeat != null) { provider.popBack(repeat); } - + // create keywordList list = new KeywordList(); - - monitor.beginTask("Gathering SQF commands", - provider.size() + MANUAL_COMMANDS.length); - + + monitor.beginTask("Gathering SQF commands", provider.size() + MANUAL_COMMANDS.length); + // Add a few operators manually for (int i = 0; i < MANUAL_COMMANDS.length; i++) { if (monitor.isCanceled()) { // if the job was cancelled return the current state of the list return list; } - + String currentCommand = MANUAL_COMMANDS[i]; String currentDescription = MANUAL_COMMANDS_DESCRIPTION[i]; - + monitor.subTask("Current Command: \"" + currentCommand + "\""); - - SQFCommand command = new SQFCommand(currentCommand, - currentDescription); - + + SQFCommand command = new SQFCommand(currentCommand, currentDescription); + for (int k = 0; k < MANUAL_COMMANDS_SYNTAX[i].length; k++) { String currentSyntax = MANUAL_COMMANDS_SYNTAX[i][k]; - DataTypeList returnTypes = DataTypeList - .fillWith(MANUAL_COMMANDS_RETURN_TYPE[i][k]); + DataTypeList returnTypes = DataTypeList.fillWith(MANUAL_COMMANDS_RETURN_TYPE[i][k]); try { - Syntax syntax = Syntax.parseSyntax(currentSyntax, - currentCommand); - + Syntax syntax = Syntax.parseSyntax(currentSyntax, currentCommand); + command.addSyntax(syntax); - + command.setReturnType(syntax, returnTypes); } catch (BadSyntaxException e) { - throw new SQDevCollectionException(e.getMessage(), null, - list); + throw new SQDevCollectionException(e.getMessage(), null, list); } } - + try { String url = MANUAL_COMMANDS_WIKI[i]; - + if (!url.isEmpty()) { command.setWikiPage(new URL(url)); } } catch (MalformedURLException e) { throw new SQDevCollectionException(e.getMessage(), null, list); } - + list.addKeyword(command); - + monitor.worked(1); } - + int size = provider.size(); // go through each link and gather respective information for (int i = 0; i < size; i++) { @@ -311,85 +276,89 @@ public KeywordList collect(IProgressMonitor monitor, URL repeat) // if the job was cancelled return the current state of the list return list; } - + URL currentCommandURL = provider.next(); - + // get the name of the current command String strURL = currentCommandURL.toString(); String name = strURL.substring(strURL.lastIndexOf("/") + 1).trim(); - - // display which cammand currently is processed + + // display which command currently is processed monitor.subTask("Current Command: \"" + name + "\""); - - SQFCommand command = processCommand(new SQFCommand(name), - currentCommandURL); - + + SQFCommand command = processCommand(new SQFCommand(name), currentCommandURL); + if (command != null) { list.addKeyword(command); } - + monitor.worked(1); } - + return list; } - + /** - * Gets the trimmed content of the specified site + * Gets the content of the specified site * * @param url * The URL to the site + * @param removeHTMLTags + * Whether all HTML tags should get removed * @return The site's content as a String * @throws SQDevCollectionException */ - public static String getSite(URL url) throws IOException { + public static String getSite(URL url, boolean removeHTMLTags) throws IOException { // read the site's content InputStream in = url.openStream(); ByteArrayOutputStream out = new ByteArrayOutputStream(); - + byte[] bArray = new byte[in.available()]; - + in.read(bArray); - + out.write(bArray); - + int next; while ((next = in.read()) > 0) { out.write((char) next); } - + String content = out.toString(); - + // replace html escape characters Pattern escapePattern = Pattern.compile("&#[0-9]+;"); Matcher matcher = escapePattern.matcher(content); - + while (matcher.find()) { int pos1 = matcher.start(); int pos2 = matcher.end(); - + String prefix = content.substring(0, pos1); String fragment = content.substring(pos1, pos2); - char escapeCharacter = (char) Integer - .parseInt(fragment.substring(2, fragment.length() - 1)); + char escapeCharacter = (char) Integer.parseInt(fragment.substring(2, fragment.length() - 1)); String postfix = content.substring(pos2); - + if (escapeCharacter == (char) 160) { // replace non-breaking spaces with normal ones escapeCharacter = ' '; } - + content = prefix + escapeCharacter + postfix; - + matcher = escapePattern.matcher(content); } - + + if (removeHTMLTags) { + content = content.replaceAll("<.*?>", ""); + } + return content.replace(""", "\"").replace("&", "&"); } - + /** - * Will process the given commandPage and feed the gathered information into - * the given SQFCommand + * Will process the given commandPage and feed the gathered information into the + * given SQFCommand * * @param command * The command the gathered information should be associated with @@ -398,88 +367,82 @@ public static String getSite(URL url) throws IOException { * @return The command filled with information or null * @throws SQDevCollectionException */ - private SQFCommand processCommand(SQFCommand command, URL commandPage) - throws SQDevCollectionException { + private SQFCommand processCommand(SQFCommand command, URL commandPage) throws SQDevCollectionException { // get site content String siteContent; try { - siteContent = formatCommandPageContent(getSite(commandPage)); + siteContent = formatCommandPageContent(getSite(commandPage, false)); } catch (IOException e) { // rethrow throw new SQDevCollectionException(e, commandPage, list); } - + String[] categories = categorizeContent(siteContent); - + if (!commandPage.toString().endsWith(command.getKeyword()) - || !categories[CATEGORY_SYNTAX].toLowerCase() - .contains(command.getKeyword().toLowerCase())) { + || !categories[CATEGORY_SYNTAX].toLowerCase().contains(command.getKeyword().toLowerCase())) { // The current command should be integrated in the previous command // with this name or stripped out TODO return null; } - + // store information try { // commandInfo String commandInfo = categories[CATEGORY_COMMAND_INFO]; applyCommandInfo(command, commandInfo); - + // wikiPage command.setWikiPage(commandPage); - + // description String description = categories[CATEGORY_DESCRIPTION]; if (description.startsWith("Description:\n")) { // remove that unnecessary line - description = description - .substring(description.indexOf("\n") + 1); + description = description.substring(description.indexOf("\n") + 1); } - + if (!description.isEmpty()) { command.setDescription(description); } - + // syntax String syntax = categories[CATEGORY_SYNTAX]; - + if (!syntax.isEmpty()) { if (command.getKeyword().toLowerCase().equals("private")) { // exception for private as a keyword - syntax = syntax.substring(0, syntax.toLowerCase() - .lastIndexOf("alternative syntax")); + syntax = syntax.substring(0, syntax.toLowerCase().lastIndexOf("alternative syntax")); } - + applySyntax(command, syntax); } else { throw new SQDevCollectionException( - "The command \"" + command.getKeyword() - + "\" does not specify a syntax!", - commandPage, list); + "The command \"" + command.getKeyword() + "\" does not specify a syntax!", commandPage, list); } - + // examples String examples = categories[CATEGORY_EXAMPLES]; - + if (!examples.isEmpty()) { applyExamples(command, examples); } - + // Notes String notes = categories[CATEGORY_NOTES]; - + if (!notes.isEmpty()) { applyNotes(command, notes); } } catch (SQDevException e) { e.printStackTrace(); - + throw new SQDevCollectionException(e, commandPage, list); } - + return command; } - + /** * Extracts the relevant parts and formats the content of a commandPage * @@ -489,174 +452,158 @@ private SQFCommand processCommand(SQFCommand command, URL commandPage) */ private String formatCommandPageContent(String content) { String[] tagsToRemove = { "script", "style", "header", "head" }; - + for (String currentTag : tagsToRemove) { // remove tags - boolean proceed = content.contains("<" + currentTag) - && content.contains(""); - + boolean proceed = content.contains("<" + currentTag) && content.contains(""); + while (proceed) { - String fragment1 = content.substring(0, - content.indexOf("<" + currentTag)); - String fragment2 = content - .substring(content.indexOf("<" + currentTag)); + String fragment1 = content.substring(0, content.indexOf("<" + currentTag)); + String fragment2 = content.substring(content.indexOf("<" + currentTag)); String fragment3 = fragment2 - .substring(fragment2.indexOf("") - + 3 + currentTag.length()); - + .substring(fragment2.indexOf("") + 3 + currentTag.length()); + content = fragment1 + fragment3; - - proceed = content.contains("<" + currentTag) - && content.contains(""); + + proceed = content.contains("<" + currentTag) && content.contains(""); } } - + if (content.contains("
")) { // if there are notes attached make sure that every note has a date // attached (even an empty one) - - String fragment1 = content - .substring(0, content.indexOf("
")) - .trim(); - String fragment2 = content - .substring(content.indexOf("
")).trim(); - + + String fragment1 = content.substring(0, content.indexOf("
")).trim(); + String fragment2 = content.substring(content.indexOf("
")).trim(); + boolean proceed = true; - + while (proceed) { // add the necessary "Posted on" - if (!fragment1.substring(fragment1.lastIndexOf("\n")) - .contains("
Posted on")) { - fragment1 = fragment1 - + "\n
Posted on\n"; + if (!fragment1.substring(fragment1.lastIndexOf("\n")).contains("
Posted on")) { + fragment1 = fragment1 + "\n
Posted on\n"; } - + // check if there are futher notes - proceed = fragment2.substring(fragment2.indexOf("\n")) - .contains("
"); - + proceed = fragment2.substring(fragment2.indexOf("\n")).contains("
"); + if (proceed) { // reassemble fragments to process further notes - String previousNoteLine = fragment2.substring(0, - fragment2.indexOf("\n")); - String helper = fragment2 - .substring(previousNoteLine.length()); - String fragment3 = helper.substring(0, - helper.indexOf("
")); - - fragment1 += "\n" + previousNoteLine + "\n" - + fragment3.trim(); + String previousNoteLine = fragment2.substring(0, fragment2.indexOf("\n")); + String helper = fragment2.substring(previousNoteLine.length()); + String fragment3 = helper.substring(0, helper.indexOf("
")); + + fragment1 += "\n" + previousNoteLine + "\n" + fragment3.trim(); fragment1 = fragment1.trim(); - - fragment2 = fragment2.substring( - previousNoteLine.length() + fragment3.length()); + + fragment2 = fragment2.substring(previousNoteLine.length() + fragment3.length()); fragment2 = fragment2.trim(); } else { // reset content content = fragment1 + "\n" + fragment2; } } - + // make sure that the user name stands in it's own line - content = content.replace("
", - "\n
"); + content = content.replace("
", "\n
"); } - + // mark parameter content = content.replace("
", "\nparam:\n"); - + // keep code markdown content = content.replace("", " " + SQDev.CODE.getOpener()); content = content.replace("", SQDev.CODE.getCloser() + " "); - - String commandInfoLine = content - .substring(content.indexOf("
")); - commandInfoLine = commandInfoLine.substring(0, - commandInfoLine.indexOf("\n")); - + + String commandInfoLine = content.substring(content.indexOf("
")); + commandInfoLine = commandInfoLine.substring(0, commandInfoLine.indexOf("\n")); + + // remove command info(s) from page as it sometimes appears in inappropriate + // positions + content = content.replaceAll("
"); while (proceed) { String fragment1 = content.substring(0, content.indexOf("<")); String fragment2 = content.substring(content.indexOf("<")); String fragment3 = fragment2.substring(fragment2.indexOf(">") + 1); - + content = fragment1 + " " + fragment3; - + proceed = content.contains("<") && content.contains(">"); } - + // remove tabs while (content.contains("\t")) { content = content.replace("\t", ""); } - + while (content.contains("\n ")) { content = content.replace("\n ", "\n"); } - + // reduce lineBreaks while (content.contains("\n\n")) { content = content.replace("\n\n", "\n"); } - + // remove all unnecessary HTML escape stuff content = content.replaceAll("&[^;\\s]*;", " "); - + while (content.contains(" ")) { content = content.replace(" ", " "); } - + while (content.contains(" .")) { content = content.replace(" .", "."); } - + content = content.trim(); - + // add information about the command String commandInfo = ""; - + if (commandInfoLine.contains("arguments_local.gif")) { commandInfo += "Arguments: " + ELocality.LOCAL + "\n"; } - + if (commandInfoLine.contains("arguments_global.gif")) { commandInfo += "Arguments: " + ELocality.GLOBAL + "\n"; } - + if (commandInfoLine.contains("effects_local.gif")) { commandInfo += "Effects: " + ELocality.LOCAL + "\n"; } - + if (commandInfoLine.contains("effects_global.gif")) { commandInfo += "Effects: " + ELocality.GLOBAL + "\n"; } - + if (commandInfoLine.contains("Exec_Server.gif")) { commandInfo += "ServerExecution: true"; } else { commandInfo += "ServerExecution: false"; } - + // add the gathered information to the content if (!commandInfo.isEmpty()) { - content = "#CommandInfo\n" + commandInfo.trim() - + "\n#EndCommandInfo\n\n" + content; + content = "#CommandInfo\n" + commandInfo.trim() + "\n#EndCommandInfo\n\n" + content; } - + // make sure that commas are set properly while (content.contains(" ,")) { content = content.replace(" ,", ","); } - + // make sure points are set properly while (content.contains(" .")) { content = content.replace(" .", "."); } - + return content; } - + /** * This will categorize the formatted content of a commandPage * @@ -666,99 +613,92 @@ private String formatCommandPageContent(String content) { */ private String[] categorizeContent(String content) { String[] categories = new String[5]; - + String commandInfo = "\n"; String description = "\n"; String syntax = "\n"; String examples = "\n"; String notes = "\n"; - + // add the command infos - commandInfo += content.substring(content.indexOf("\n") + 1, - content.indexOf("#EndCommandInfo") - 1); - - content = content.substring(content.indexOf("#EndCommandInfo") + 15) - .trim(); - + commandInfo += content.substring(content.indexOf("\n") + 1, content.indexOf("#EndCommandInfo") - 1); + + content = content.substring(content.indexOf("#EndCommandInfo") + 15).trim(); + // add the name of the command - commandInfo = "Name: " + content.substring(0, content.indexOf("\n")) - .trim().replace(" ", "_") + "\n" + commandInfo; - + commandInfo = "Name: " + content.substring(0, content.indexOf("\n")).trim().replace(" ", "_") + "\n" + + commandInfo; + content = content.substring(content.indexOf("\n") + 1); - + String currentCategory = ""; - + // categorize the content for (String currentLine : content.split("\n")) { currentLine = currentLine.trim(); - + if (currentLine.startsWith("Only post proven facts here.")) { // skip this line continue; } - + // check for a change of categories switch (currentLine) { - case "Description": - case "Syntax": - case "Examples": - case "Notes": - currentCategory = currentLine; - break; - case "Additional Information": - case "Bottom Section": - currentCategory = ""; - break; + case "Description": + case "Syntax": + case "Examples": + case "Notes": + currentCategory = currentLine; + break; + case "Additional Information": + case "Bottom Section": + currentCategory = ""; + break; } - + if (currentCategory.isEmpty() && currentLine.startsWith("Posted")) { currentCategory = "Notes"; } else { if (!currentCategory.isEmpty() - && (currentLine.startsWith("Categories") - || currentLine.startsWith("Retrieved from"))) { + && (currentLine.startsWith("Categories") || currentLine.startsWith("Retrieved from"))) { currentCategory = ""; } } - + // add line to respective category switch (currentCategory) { - case "Description": - if (!currentLine.equals(currentCategory)) { - description += currentLine + "\n"; - } - break; - case "Syntax": - if (!currentLine.equals(currentCategory)) { - syntax += currentLine + "\n"; - } - break; - case "Examples": - if (!currentLine.equals(currentCategory)) { - examples += currentLine + "\n"; - } - break; - case "Notes": - if (!currentLine.equals(currentCategory)) { - notes += currentLine + "\n"; - } - break; + case "Description": + if (!currentLine.equals(currentCategory)) { + description += currentLine + "\n"; + } + break; + case "Syntax": + if (!currentLine.equals(currentCategory)) { + syntax += currentLine + "\n"; + } + break; + case "Examples": + if (!currentLine.equals(currentCategory)) { + examples += currentLine + "\n"; + } + break; + case "Notes": + if (!currentLine.equals(currentCategory)) { + notes += currentLine + "\n"; + } + break; } } - + categories[CATEGORY_COMMAND_INFO] = commandInfo; - categories[CATEGORY_DESCRIPTION] = description - .substring(description.indexOf("\n")).trim(); - categories[CATEGORY_SYNTAX] = syntax.substring(syntax.indexOf("\n")) - .trim(); - categories[CATEGORY_EXAMPLES] = examples - .substring(examples.indexOf("\n")).trim(); - categories[CATEGORY_NOTES] = notes.substring(notes.indexOf("\n")) - .trim(); - + categories[CATEGORY_DESCRIPTION] = description.substring(description.indexOf("\n")).trim(); + categories[CATEGORY_SYNTAX] = syntax.substring(syntax.indexOf("\n")).trim(); + categories[CATEGORY_EXAMPLES] = examples.substring(examples.indexOf("\n")).trim(); + categories[CATEGORY_NOTES] = notes.substring(notes.indexOf("\n")).trim(); + return categories; } - + /** * Applies the given commandInfo to the given command * @@ -768,101 +708,88 @@ private String[] categorizeContent(String content) { * The info to add up * @throws SQDevException */ - private void applyCommandInfo(SQFCommand command, String info) - throws SQDevException { - String name = info - .substring(info.indexOf("Name:") + 5, info.indexOf("\n")) - .trim(); - + private void applyCommandInfo(SQFCommand command, String info) throws SQDevException { + String name = info.substring(info.indexOf("Name:") + 5, info.indexOf("\n")).trim(); + if (!name.toLowerCase().equals(command.getKeyword().toLowerCase())) { - throw new SQDevException( - "The given commandInfo does not specify the same name (\"" - + name + "\") as the SQFCommand object (\"" - + command.getKeyword() + "\")!"); + throw new SQDevException("The given commandInfo does not specify the same name (\"" + name + + "\") as the SQFCommand object (\"" + command.getKeyword() + "\")!"); } - + // remove processed line info = info.substring(info.indexOf("\n") + 1); - + for (String currentLine : info.split("\n")) { currentLine = currentLine.trim(); - + if (currentLine.startsWith("Arguments:")) { // store argument's locality String argumentsLocality = currentLine.substring(10).trim(); - - command.setArgumentLocality( - ELocality.resolve(argumentsLocality)); + + command.setArgumentLocality(ELocality.resolve(argumentsLocality)); } else { if (currentLine.startsWith("Effects:")) { // store effects locality String effectsLocality = currentLine.substring(8).trim(); - - command.setEffectLocality( - ELocality.resolve(effectsLocality)); + + command.setEffectLocality(ELocality.resolve(effectsLocality)); } else { if (currentLine.equals("ServerExecution: true")) { // add a note when a server execution is necessary - command.addNote( - "This scripting command must be executed on the server" - + " to work properly in multiplayer"); + command.addNote("This scripting command must be executed on the server" + + " to work properly in multiplayer"); } } } } } - + /** * Adds the given examples to the given SQFCommand * * @param command * The command theexamples should get added to * @param examples - * The String containing the examples indexed by "Example 1:" and - * so on + * The String containing the examples indexed by "Example 1:" and so + * on */ private void applyExamples(SQFCommand command, String examples) { boolean proceed = true; int counter = 1; - + if (examples.contains("Example needed")) { return; } - + examples = examples.trim(); - + while (proceed) { String exampleNum = "Example " + counter + ":"; - + if (examples.startsWith(exampleNum)) { // if there is an example with this number - examples = examples.substring( - examples.indexOf(exampleNum) + exampleNum.length()) - .trim(); - + examples = examples.substring(examples.indexOf(exampleNum) + exampleNum.length()).trim(); + counter++; - + String nextExampleNum = "Example " + counter + ":"; - + if (examples.contains(nextExampleNum)) { // only take the content until next example starts - String currentExample = examples - .substring(0, examples.indexOf(nextExampleNum)) - .trim(); - + String currentExample = examples.substring(0, examples.indexOf(nextExampleNum)).trim(); + command.addExample(currentExample); - + // remove processed examples from the examples String - examples = examples.substring(currentExample.length()) - .trim(); - + examples = examples.substring(currentExample.length()).trim(); + proceed = !examples.isEmpty(); } else { // the complete content belongs to the current example if (!examples.isEmpty()) { command.addExample(examples); } - + proceed = false; } } else { @@ -870,7 +797,7 @@ private void applyExamples(SQFCommand command, String examples) { } } } - + /** * Applies the given notes to the given command * @@ -880,38 +807,36 @@ private void applyExamples(SQFCommand command, String examples) { * The notes to apply * @throws SQDevException */ - private void applyNotes(SQFCommand command, String notes) - throws SQDevException { + private void applyNotes(SQFCommand command, String notes) throws SQDevException { String currentNote = ""; boolean skippedName = false; - + if (!notes.contains("Posted on")) { - throw new SQDevException("The notes of " + command.getKeyword() - + "are not in the proper format!"); + throw new SQDevException("The notes of " + command.getKeyword() + "are not in the proper format!"); } - + for (String currentLine : notes.split("\n")) { if (currentLine.startsWith("Posted on")) { if (!currentNote.isEmpty()) { // add the previous note to the command command.addNote(currentNote.trim()); - + // reset currentNote currentNote = ""; } - + // a new note is beginning -> start with post date String date = currentLine.substring(9).trim(); - + if (date.contains("-")) { // don't store time date = date.substring(0, date.indexOf("-")).trim(); } - + if (!date.isEmpty()) { currentNote += "(" + date + ")\n"; } - + // indicate that the name has not yet been skipped skippedName = false; } else { @@ -924,15 +849,15 @@ private void applyNotes(SQFCommand command, String notes) } } } - + if (!currentNote.isEmpty()) { command.addNote(currentNote); } } - + /** - * Applies the given syntax to the given command after having brought it - * into the proper format + * Applies the given syntax to the given command after having brought it into + * the proper format * * @param command * The command the notes should be applied to @@ -941,153 +866,132 @@ private void applyNotes(SQFCommand command, String notes) * command * @throws SQDevException */ - private void applySyntax(SQFCommand command, String syntaxContent) - throws SQDevException { - + private void applySyntax(SQFCommand command, String syntaxContent) throws SQDevException { + String[][] syntaxes = splitSyntaxes(syntaxContent, command); - + for (String[] currentSyntax : syntaxes) { String syntax = currentSyntax[SYNTAXPART_SYNTAX]; - + // add the raw syntax to the command command.addRawSyntax(syntax); - + Pattern arrayPattern = Pattern.compile("\\[[^\\[\\]]*\\]"); Matcher arrayMatcher = arrayPattern.matcher(syntax); - + // replace all array constructs with Array type keyword while (arrayMatcher.find()) { syntax = arrayMatcher.replaceAll(EDataType.ARRAY.toString()); - + arrayMatcher = arrayPattern.matcher(syntax); } - - syntax = processSyntax(syntax, currentSyntax[SYNTAXPART_PARAMETERS], - command); - - DataTypeList returnTypes = DataTypeList - .fillWith(currentSyntax[SYNTAXPART_RETURN_VALUE]); - + + syntax = processSyntax(syntax, currentSyntax[SYNTAXPART_PARAMETERS], command); + + DataTypeList returnTypes = DataTypeList.fillWith(currentSyntax[SYNTAXPART_RETURN_VALUE]); + try { if (syntax.contains(String.valueOf(OPTIONAL_MARKER))) { // create own syntaxes for each optional parameter String[] areas = TextUtils.getTextAreas(syntax); int commandIndex = -1; - + List possibleLeadingArgCombinations = new ArrayList(); List possibleTrailingArgCombinations = new ArrayList(); - + for (int i = 0; i < areas.length; i++) { String currentArea = areas[i]; - - if (currentArea.toLowerCase() - .equals(command.getKeyword().toLowerCase())) { + + if (currentArea.toLowerCase().equals(command.getKeyword().toLowerCase())) { commandIndex = i; continue; } - - if (currentArea - .endsWith(String.valueOf(OPTIONAL_MARKER))) { + + if (currentArea.endsWith(String.valueOf(OPTIONAL_MARKER))) { if (commandIndex < 0) { // optional arg before command StringBuilder builder = new StringBuilder(); - + for (int j = 0; j < i; j++) { // assemble parameter combi - builder.append(areas[j].replace( - String.valueOf(OPTIONAL_MARKER), "") - + " "); + builder.append(areas[j].replace(String.valueOf(OPTIONAL_MARKER), "") + " "); } - - possibleLeadingArgCombinations - .add(builder.toString().trim()); + + possibleLeadingArgCombinations.add(builder.toString().trim()); } else { // optional arg after command StringBuilder builder = new StringBuilder(); - + for (int j = commandIndex + 1; j <= i; j++) { // assemble parameter combi - builder.append(areas[j].replace( - String.valueOf(OPTIONAL_MARKER), "") - + " "); + builder.append(areas[j].replace(String.valueOf(OPTIONAL_MARKER), "") + " "); } - - possibleTrailingArgCombinations - .add(builder.toString().trim()); + + possibleTrailingArgCombinations.add(builder.toString().trim()); } } } - + // make sure the loops below iterates at least once if (possibleLeadingArgCombinations.size() == 0) { // In case there are only non-optional leading params StringBuilder builder = new StringBuilder(); - + for (int i = 0; i < commandIndex; i++) { builder.append(areas[i] + " "); } - - possibleLeadingArgCombinations - .add(builder.toString().trim()); + + possibleLeadingArgCombinations.add(builder.toString().trim()); } if (possibleTrailingArgCombinations.size() == 0) { // In case there are only non-optional trailing params StringBuilder builder = new StringBuilder(); - + for (int i = commandIndex + 1; i < areas.length; i++) { builder.append(areas[i] + " "); } - - possibleTrailingArgCombinations - .add(builder.toString().trim()); + + possibleTrailingArgCombinations.add(builder.toString().trim()); } - - //TODO: optional args don't process properly... See addMenu - + + // TODO: optional args don't process properly... See addMenu + // add all possible syntax variants for (String currentLeadingCombination : possibleLeadingArgCombinations) { for (String currentTrailingCombination : possibleTrailingArgCombinations) { - Syntax parsedSyntax = Syntax.parseSyntax( - currentLeadingCombination + " " - + command.getKeyword() + " " - + currentTrailingCombination, - command.getKeyword()); - + Syntax parsedSyntax = Syntax.parseSyntax(currentLeadingCombination + " " + + command.getKeyword() + " " + currentTrailingCombination, command.getKeyword()); + command.addSyntax(parsedSyntax); - + command.setReturnType(parsedSyntax, returnTypes); } } - - if (possibleLeadingArgCombinations.size() - + possibleTrailingArgCombinations.size() != 0) { + + if (possibleLeadingArgCombinations.size() + possibleTrailingArgCombinations.size() != 0) { // add complete syntax - Syntax parsedSyntax = Syntax.parseSyntax(syntax - .replace(String.valueOf(OPTIONAL_MARKER), ""), + Syntax parsedSyntax = Syntax.parseSyntax(syntax.replace(String.valueOf(OPTIONAL_MARKER), ""), command.getKeyword()); - + command.addSyntax(parsedSyntax); - + command.setReturnType(parsedSyntax, returnTypes); } } else { - Syntax parsedSyntax = Syntax.parseSyntax(syntax, - command.getKeyword()); - + Syntax parsedSyntax = Syntax.parseSyntax(syntax, command.getKeyword()); + command.addSyntax(parsedSyntax); - + command.setReturnType(parsedSyntax, returnTypes); } } catch (BadSyntaxException e) { - throw new SQDevException( - "Failed at parsing syntax for command \"" - + command.getKeyword() + "\""); + throw new SQDevException("Failed at parsing syntax for command \"" + command.getKeyword() + "\""); } } - + System.out.println(command.getSyntaxes()); } - + /** * Replaces the parameters in the syntax with the actual data types * @@ -1100,45 +1004,40 @@ private void applySyntax(SQFCommand command, String syntaxContent) * @return The processed syntax with data types instead of placeholders * @throws SQDevException */ - private String processSyntax(String syntax, String parameter, - SQFElement element) throws SQDevException { + private String processSyntax(String syntax, String parameter, SQFElement element) throws SQDevException { for (String currentParameter : parameter.split("param:\n")) { // process each listed parameter currentParameter = currentParameter.trim(); - + if (currentParameter.isEmpty()) { continue; } - + // make a copy in order to avoid case sensitive problems String syntaxCopy = syntax.toLowerCase(); - + String[] elements = TextUtils.getTextAreas(currentParameter); - + // make sure parameter are in proper format if (!elements[0].contains(":") || elements.length == 1) { - if (elements.length > 2 && (elements[1].equals(":") - || elements[1].equals("-"))) { + if (elements.length > 2 && (elements[1].equals(":") || elements[1].equals("-"))) { // add needed colon elements[0] = elements[0] + ":"; // Move parameter data type elements[1] = elements[2]; } else { - throw new SQDevException( - "Unexpected parameter format - missing\":\" at " - + elements[0]); + throw new SQDevException("Unexpected parameter format - missing\":\" at " + elements[0]); } } - - String parameterName = elements[0] - .substring(0, elements[0].indexOf(":")).toLowerCase(); - + + String parameterName = elements[0].substring(0, elements[0].indexOf(":")).toLowerCase(); + // remove dots from dataType String value = elements[1].replace(".", ""); - + String[] syntaxElements = TextUtils.getTextAreas(syntax); String[] syntaxCopyElements = TextUtils.getTextAreas(syntaxCopy); - + for (int i = 0; i < syntaxCopyElements.length; i++) { if (syntaxCopyElements[i].equals(parameterName)) { // replace placeholder with actual value @@ -1147,20 +1046,20 @@ private String processSyntax(String syntax, String parameter, break; } } - + // convert syntax back to String StringBuilder builder = new StringBuilder(); - + for (String currentElement : syntaxElements) { builder.append(" " + currentElement); } - + syntax = builder.toString().trim(); } - + return syntax; } - + /** * Brings the given syntaxContent into the proper format * @@ -1170,143 +1069,117 @@ private String processSyntax(String syntax, String parameter, */ private String formatSyntaxContent(String syntaxContent) { syntaxContent = syntaxContent.trim(); - + while (Character.isDigit(syntaxContent.charAt(0))) { syntaxContent = syntaxContent.substring(1).trim(); } - + // check for return value if (!syntaxContent.contains("Return Value:")) { // add a Nothing-return value syntaxContent += " Return Value: Nothing"; } else { // make sure that a return value is specified - if (syntaxContent.substring(syntaxContent.indexOf("Return Value:")) - .trim().isEmpty()) { + if (syntaxContent.substring(syntaxContent.indexOf("Return Value:")).trim().isEmpty()) { syntaxContent += " Nothing"; } } - + if (syntaxContent.startsWith("Syntax:")) { // make the syntax start directly without prefix "Syntax:" syntaxContent = syntaxContent.substring(7).trim(); } - + if (syntaxContent.contains("Parameters:")) { // remove unnecessary statement - syntaxContent = syntaxContent.substring(0, - syntaxContent.indexOf("Parameters:")) + "\n" - + syntaxContent.substring( - syntaxContent.indexOf("Parameters:") + 11); + syntaxContent = syntaxContent.substring(0, syntaxContent.indexOf("Parameters:")) + "\n" + + syntaxContent.substring(syntaxContent.indexOf("Parameters:") + 11); } - + // make each syntax part stand in it's own line - - syntaxContent = syntaxContent.substring(0, - syntaxContent.indexOf("Return Value:")) + "\n" - + syntaxContent - .substring(syntaxContent.indexOf("Return Value:")); - - syntaxContent = syntaxContent - .substring(0, syntaxContent.indexOf("Return Value:") + 13) - .trim() - + " " - + syntaxContent - .substring(syntaxContent.indexOf("Return Value:") + 13) - .trim(); - - String syntaxLine = syntaxContent.substring(0, - syntaxContent.indexOf("\n")); - + + syntaxContent = syntaxContent.substring(0, syntaxContent.indexOf("Return Value:")) + "\n" + + syntaxContent.substring(syntaxContent.indexOf("Return Value:")); + + syntaxContent = syntaxContent.substring(0, syntaxContent.indexOf("Return Value:") + 13).trim() + " " + + syntaxContent.substring(syntaxContent.indexOf("Return Value:") + 13).trim(); + + String syntaxLine = syntaxContent.substring(0, syntaxContent.indexOf("\n")); + if (syntaxLine.contains("=")) { // remove asignments from syntax - syntaxLine = syntaxLine.substring(syntaxLine.indexOf("=") + 1) - .trim(); + syntaxLine = syntaxLine.substring(syntaxLine.indexOf("=") + 1).trim(); } - + // remove version tags that are not necessarily between brackets - syntaxLine = syntaxLine.replaceAll("[sS]ince [aA]rm[aA][^)]*", ""); - - return syntaxLine - + syntaxContent.substring(syntaxContent.indexOf("\n")); + syntaxLine = syntaxLine.replaceAll("[sS]ince [aA]rm[aA][^)]*", "").replaceAll("[(][^)]*\\z", ""); + + return syntaxLine + syntaxContent.substring(syntaxContent.indexOf("\n")); } - + /** - * Splits the given syntax(es) and return them in an array (everything - * properly formatted) + * Splits the given syntax(es) and return them in an array (everything properly + * formatted) * * @param syntaxContent * The syntaxes with the respective information * @param The * SQFElement the syntaxes belong to * @return A two-dimensional array where the first dimension stands for - * different syntaxes (alternatives syntaxes) and the second - * dimension is as following: + * different syntaxes (alternatives syntaxes) and the second dimension + * is as following: *
  • index 0: The raw syntax
  • - *
  • index 1: The parameters (each prefixed by "param:\n") with - * their description
  • + *
  • index 1: The parameters (each prefixed by "param:\n") with their + * description
  • *
  • index 2: The return value
  • * @throws SQDevException */ - private String[][] splitSyntaxes(String syntaxContent, SQFElement element) - throws SQDevException { + private String[][] splitSyntaxes(String syntaxContent, SQFElement element) throws SQDevException { // split the syntaxes and their components - ArrayList> syntaxes = new ArrayList>( - 1); - - for (String currentSyntaxContent : syntaxContent - .split("Alternative Syntax")) { + ArrayList> syntaxes = new ArrayList>(1); + + for (String currentSyntaxContent : syntaxContent.split("Alternative Syntax")) { // format the content currentSyntaxContent = formatSyntaxContent(currentSyntaxContent); - - ArrayList currentSyntaxComponents = new ArrayList( - 3); - + + ArrayList currentSyntaxComponents = new ArrayList(3); + // get the syntax - String currentSyntax = currentSyntaxContent.substring(0, - currentSyntaxContent.indexOf("\n")); - + String currentSyntax = currentSyntaxContent.substring(0, currentSyntaxContent.indexOf("\n")); + // trim syntaxContent to remove processed line - currentSyntaxContent = currentSyntaxContent - .substring(currentSyntax.length()).trim(); - + currentSyntaxContent = currentSyntaxContent.substring(currentSyntax.length()).trim(); + // get the parameters - String currentParameter = currentSyntaxContent.substring(0, - currentSyntaxContent.indexOf("Return Value:")); - + String currentParameter = currentSyntaxContent.substring(0, currentSyntaxContent.indexOf("Return Value:")); + // trim syntaxContent to remove processed line - currentSyntaxContent = currentSyntaxContent - .substring(currentParameter.length()).trim(); - + currentSyntaxContent = currentSyntaxContent.substring(currentParameter.length()).trim(); + currentSyntaxContent += "\n"; - - String currentReturnValue = currentSyntaxContent.substring( - currentSyntaxContent.indexOf("Return Value:") + 13); - currentReturnValue = currentReturnValue.substring(0, - currentReturnValue.indexOf("\n")); - + + String currentReturnValue = currentSyntaxContent + .substring(currentSyntaxContent.indexOf("Return Value:") + 13); + currentReturnValue = currentReturnValue.substring(0, currentReturnValue.indexOf("\n")); + // store the gathered values - currentSyntaxComponents.add(SYNTAXPART_SYNTAX, - formatRawSyntax(currentSyntax)); - currentSyntaxComponents.add(SYNTAXPART_PARAMETERS, - formatParameters(currentParameter, element)); + currentSyntaxComponents.add(SYNTAXPART_SYNTAX, formatRawSyntax(currentSyntax)); + currentSyntaxComponents.add(SYNTAXPART_PARAMETERS, formatParameters(currentParameter, element)); currentSyntaxComponents.add(SYNTAXPART_RETURN_VALUE, - formatReturnValue(currentReturnValue, - element.getKeyword())); - + formatReturnValue(currentReturnValue, element.getKeyword())); + syntaxes.add(currentSyntaxComponents); } - + String[][] syntaxArray = new String[syntaxes.size()][]; - + for (int i = 0; i < syntaxes.size(); i++) { - syntaxArray[i] = syntaxes.get(i) - .toArray(new String[syntaxes.get(i).size()]); + syntaxArray[i] = syntaxes.get(i).toArray(new String[syntaxes.get(i).size()]); } - + return syntaxArray; } - + /** * Brings the given raw syntax into a proper format * @@ -1318,13 +1191,13 @@ private String formatRawSyntax(String syntax) { // remove round brackets Pattern bracketPattern = Pattern.compile("\\([^\\(\\)]*\\)"); Matcher bracketMatcher = bracketPattern.matcher(syntax); - + while (bracketMatcher.find()) { syntax = bracketMatcher.replaceAll(""); - + bracketMatcher = bracketPattern.matcher(syntax); } - + final List allowedSpecials = new ArrayList() { private static final long serialVersionUID = -7392233157557632681L; @@ -1349,10 +1222,10 @@ private String formatRawSyntax(String syntax) { System.out.println("Omitting character " + c); } } - + return out.toString(); } - + /** * Brings the given parameters into the proper format * @@ -1363,58 +1236,54 @@ private String formatRawSyntax(String syntax) { * @return The formatted parameters * @throws SQDevException */ - private String formatParameters(String parameters, SQFElement element) - throws SQDevException { + private String formatParameters(String parameters, SQFElement element) throws SQDevException { String[] paramArray = parameters.split("param:\n"); parameters = ""; - + for (String currentParameter : paramArray) { if (currentParameter.isEmpty()) { continue; } // process alternative data types - parameters += "$PARAM$ " - + formatAlternativeDataTypes(currentParameter); + parameters += "$PARAM$ " + formatAlternativeDataTypes(currentParameter); } - + String[] areas; try { areas = TextUtils.getTextAreas(parameters); } catch (BadSyntaxException e) { throw new SQDevException("Can't format parameter", e); } - + StringBuilder builder = new StringBuilder(); - + boolean matchedColon = false; boolean matchedDataType = false; boolean markedOptional = false; boolean optionalMarkingNeeded = false; int dataTypeEndOffset = -1; - + for (int i = 0; i < areas.length; i++) { String currentArea = areas[i]; - + if (currentArea.toLowerCase().contains("optional")) { if (!markedOptional) { // check that it's at an appropriate position - if (dataTypeEndOffset < 0 - || builder.length() - dataTypeEndOffset < 40 - || ArrayUtils.containsElementInmaxDistance(areas, - "$param$", i, 3)) { - + if (dataTypeEndOffset < 0 || builder.length() - dataTypeEndOffset < 40 + || ArrayUtils.containsElementInmaxDistance(areas, "$param$", i, 3)) { + // mark optional parameter if (dataTypeEndOffset < 0) { optionalMarkingNeeded = true; } else { builder.insert(dataTypeEndOffset, OPTIONAL_MARKER); } - + markedOptional = true; } } } - + if (currentArea.startsWith("(")) { if (matchedDataType) { // only maintain brackets after dataType has been @@ -1423,53 +1292,49 @@ private String formatParameters(String parameters, SQFElement element) } } else { switch (currentArea.toLowerCase()) { - case "$param$": - // maintan proper format - currentArea = "param:\n"; - - // new parameter beginning -> reset colon and dataType - // matches - matchedColon = false; - matchedDataType = false; - markedOptional = false; - optionalMarkingNeeded = false; - dataTypeEndOffset = -1; - break; - - default: - if (matchedColon) { - // colon has been matched therefore this must be the - // data type - matchedDataType = true; - - if (optionalMarkingNeeded && Character - .isLetter(currentArea.trim().charAt(0))) { - currentArea += OPTIONAL_MARKER; - optionalMarkingNeeded = false; - } + case "$param$": + // maintan proper format + currentArea = "param:\n"; + + // new parameter beginning -> reset colon and dataType + // matches + matchedColon = false; + matchedDataType = false; + markedOptional = false; + optionalMarkingNeeded = false; + dataTypeEndOffset = -1; + break; + + default: + if (matchedColon) { + // colon has been matched therefore this must be the + // data type + matchedDataType = true; + + if (optionalMarkingNeeded && Character.isLetter(currentArea.trim().charAt(0))) { + currentArea += OPTIONAL_MARKER; + optionalMarkingNeeded = false; } + } } - - if (matchedDataType && dataTypeEndOffset < 0 - && Character.isLetter(currentArea.trim().charAt(0))) { - dataTypeEndOffset = builder.length() + currentArea.length() - + 1; + + if (matchedDataType && dataTypeEndOffset < 0 && Character.isLetter(currentArea.trim().charAt(0))) { + dataTypeEndOffset = builder.length() + currentArea.length() + 1; } - + builder.append(" " + currentArea); - + if (currentArea.endsWith(":")) { matchedColon = true; } } } - - parameters = builder.toString().trim().replace(" :", ":").replace(" / ", - DataTypeList.TYPE_SEPERATOR); - + + parameters = builder.toString().trim().replace(" :", ":").replace(" / ", DataTypeList.TYPE_SEPERATOR); + return parameters; } - + /** * Formats alternative data types (this is when more than one dataType is * allowed) by seperating them with a "/" @@ -1482,45 +1347,43 @@ private String formatAlternativeDataTypes(String input) { // look for alternative data types int pos1 = input.indexOf(":"); String prefix = input.substring(0, pos1 + 1); - + int pos2 = input.length(); - + if (input.contains("-") && input.indexOf("-") > prefix.length() - 1) { pos2 = input.indexOf("-"); } - + String relevantPart = input.substring(pos1 + 1, pos2); String postfix = input.substring(pos2, input.length()); - - + + // prevent trailing commas from being misinterpreted Pattern pattern = Pattern.compile("\\bor\\b"); - + Matcher matcher = pattern.matcher(relevantPart); - + if (matcher.find()) { relevantPart = relevantPart.substring(0, matcher.start()) + relevantPart.substring(matcher.start()).replace(",", " "); } - - + + // replace all seperators by slash - relevantPart = relevantPart.replace(",", DataTypeList.TYPE_SEPERATOR) - .replaceAll("\\bor\\b", DataTypeList.TYPE_SEPERATOR); - + relevantPart = relevantPart.replace(",", DataTypeList.TYPE_SEPERATOR).replaceAll("\\bor\\b", + DataTypeList.TYPE_SEPERATOR); + // make sure the seperators are not seperated from the next word while (relevantPart.contains(" /")) { - relevantPart = relevantPart.replace(" /", - DataTypeList.TYPE_SEPERATOR); + relevantPart = relevantPart.replace(" /", DataTypeList.TYPE_SEPERATOR); } while (relevantPart.contains("/ ")) { - relevantPart = relevantPart.replace("/ ", - DataTypeList.TYPE_SEPERATOR); + relevantPart = relevantPart.replace("/ ", DataTypeList.TYPE_SEPERATOR); } - + return prefix + relevantPart + postfix; } - + /** * Brings the given returnValue into the proper format * @@ -1531,69 +1394,66 @@ private String formatAlternativeDataTypes(String input) { * @return The formatted returnValue * @throws SQDevException */ - private String formatReturnValue(String returnValue, String commandName) - throws SQDevException { + private String formatReturnValue(String returnValue, String commandName) throws SQDevException { returnValue = returnValue.replace(".", " ").trim().toLowerCase(); - + // remove everything that stands in between round brackets Pattern bracketPattern = Pattern.compile("\\([^\\(\\)]*\\)"); Matcher bracketMatcher = bracketPattern.matcher(returnValue); - + while (bracketMatcher.find()) { returnValue = bracketMatcher.replaceAll(""); - + bracketMatcher = bracketPattern.matcher(returnValue); } - + // prevent trailing commas from being misinterpreted Pattern pattern = Pattern.compile("\\bor\\b"); - + Matcher matcher = pattern.matcher(returnValue); - + if (matcher.find()) { returnValue = returnValue.substring(0, matcher.start()) + returnValue.substring(matcher.start()).replace(",", " "); } - - + + // process multiple return values - returnValue = returnValue.replace(",", DataTypeList.TYPE_SEPERATOR) - .replaceAll("\\bor\\b", DataTypeList.TYPE_SEPERATOR); - + returnValue = returnValue.replace(",", DataTypeList.TYPE_SEPERATOR).replaceAll("\\bor\\b", + DataTypeList.TYPE_SEPERATOR); + // remove leading whitespace in fromt of seperator while (returnValue.contains(" " + DataTypeList.TYPE_SEPERATOR)) { - returnValue = returnValue.replace(" " + DataTypeList.TYPE_SEPERATOR, - DataTypeList.TYPE_SEPERATOR); + returnValue = returnValue.replace(" " + DataTypeList.TYPE_SEPERATOR, DataTypeList.TYPE_SEPERATOR); } // remove trailing whitespace in fromt of seperator while (returnValue.contains(DataTypeList.TYPE_SEPERATOR + " ")) { - returnValue = returnValue.replace(DataTypeList.TYPE_SEPERATOR + " ", - DataTypeList.TYPE_SEPERATOR); + returnValue = returnValue.replace(DataTypeList.TYPE_SEPERATOR + " ", DataTypeList.TYPE_SEPERATOR); } - + if (returnValue.contains("-")) { // remove extra info returnValue = returnValue.substring(0, returnValue.indexOf("-")); returnValue = returnValue.trim(); } - + if (returnValue.contains(":")) { // remove extra info returnValue = returnValue.substring(0, returnValue.indexOf(":")); returnValue = returnValue.trim(); } - + if (returnValue.contains(" ")) { // remove additional stuff returnValue = returnValue.substring(0, returnValue.indexOf(" ")); returnValue = returnValue.trim(); } - + returnValue = formatDataType(returnValue, commandName); - + return returnValue; } - + /** * Formats the given dataType according to EDataType * @@ -1605,47 +1465,41 @@ private String formatReturnValue(String returnValue, String commandName) * @throws SQDevException * If the dataType couldn't be resolved */ - private String formatDataType(String type, String commandName) - throws SQDevException { + private String formatDataType(String type, String commandName) throws SQDevException { StringBuilder newDataType = new StringBuilder(); - - boolean isOptionalType = type.trim() - .endsWith(String.valueOf(OPTIONAL_MARKER)); - + + boolean isOptionalType = type.trim().endsWith(String.valueOf(OPTIONAL_MARKER)); + if (isOptionalType) { type = type.substring(0, type.indexOf(OPTIONAL_MARKER)); } - + // remove unfitting characters for (char currentChar : new char[] { '.', ':', '-' }) { type = type.replace(currentChar, ' '); } - + type = type.trim(); - + for (String currentType : type.split(DataTypeList.TYPE_SEPERATOR)) { if (currentType.isEmpty()) { continue; } - + EDataType dataType = EDataType.resolve(currentType); - + if (dataType == null) { - throw new SQDevException("Unknown dataType \"" + currentType - + "\" in command \"" + commandName + "\""); + throw new SQDevException("Unknown dataType \"" + currentType + "\" in command \"" + commandName + "\""); } else { - newDataType.append((newDataType.length() == 0) - ? dataType.toString() + newDataType.append((newDataType.length() == 0) ? dataType.toString() : DataTypeList.TYPE_SEPERATOR + dataType.toString()); } } - + if (newDataType.length() == 0) { - throw new SQDevException( - "Empty data type in command \"" + commandName + "\""); + throw new SQDevException("Empty data type in command \"" + commandName + "\""); } - - return (isOptionalType) ? newDataType.toString() + OPTIONAL_MARKER - : newDataType.toString(); + + return (isOptionalType) ? newDataType.toString() + OPTIONAL_MARKER : newDataType.toString(); } } diff --git a/plugin/Raven.SQDev.Misc/src/raven/sqdev/infoCollection/SQFCommandPageProvider.java b/plugin/Raven.SQDev.Misc/src/raven/sqdev/infoCollection/SQFCommandPageProvider.java index ed7f9174..b02b8bdb 100644 --- a/plugin/Raven.SQDev.Misc/src/raven/sqdev/infoCollection/SQFCommandPageProvider.java +++ b/plugin/Raven.SQDev.Misc/src/raven/sqdev/infoCollection/SQFCommandPageProvider.java @@ -83,7 +83,7 @@ protected void initialize() throws IOException { final Pattern continuePattern = Pattern.compile("cmcontinue.*?\\n"); - String content = SQFCommandCollector.getSite(requestURL); + String content = SQFCommandCollector.getSite(requestURL, true); // gather the complete list while (content.contains("cmcontinue")) { siteContent.append(content); @@ -94,11 +94,11 @@ protected void initialize() throws IOException { final String cont = content .substring(matcher.start(), matcher.end()).replace("\"", "") - .replace(" ", "").replace(":", "="); + .replace(" ", "").replace(":", "=").replace(",", ""); requestURL = new URL(base + "&" + cont); - content = SQFCommandCollector.getSite(requestURL); + content = SQFCommandCollector.getSite(requestURL, true); } siteContent.append(content); @@ -133,18 +133,18 @@ protected void initialize() throws IOException { urlSearchAdress.setLength(urlSearchAdress.length() - 1); urlPageContent.append(SQFCommandCollector - .getSite(new URL(urlSearchAdress.toString()))); + .getSite(new URL(urlSearchAdress.toString()), true)); } // strip out the actual URLs from this page commandURLs = new Stack(); final Matcher urlMatcher = Pattern - .compile("\"fullurl\":\\s\"") + .compile("\"fullurl\":\\s*\".*?\",") .matcher(urlPageContent.toString()); while (urlMatcher.find()) { commandURLs.add(new URL(urlPageContent - .substring(urlMatcher.start() + 21, urlMatcher.end() - 2))); + .substring(urlMatcher.start() + 10, urlMatcher.end() - 1).replace("\"", "").trim())); } } diff --git a/plugin/Raven.SQDev.Misc/src/raven/sqdev/infoCollection/base/KeywordList.java b/plugin/Raven.SQDev.Misc/src/raven/sqdev/infoCollection/base/KeywordList.java index deafd40d..4069aa0e 100644 --- a/plugin/Raven.SQDev.Misc/src/raven/sqdev/infoCollection/base/KeywordList.java +++ b/plugin/Raven.SQDev.Misc/src/raven/sqdev/infoCollection/base/KeywordList.java @@ -2,10 +2,11 @@ import java.util.ArrayList; import java.util.Collection; -import java.util.Collections; +import java.util.HashMap; +import java.util.Iterator; import java.util.List; - -import org.eclipse.core.runtime.Assert; +import java.util.Map; +import java.util.Map.Entry; import raven.sqdev.exceptions.BadSyntaxException; import raven.sqdev.interfaces.ISaveable; @@ -17,10 +18,10 @@ * */ public class KeywordList implements ISaveable { - + /** - * The sequence indicating the start of the keywordList in the saveable - * String format of this class + * The sequence indicating the start of the keywordList in the saveable String + * format of this class */ public static final String LIST_START_SAVESEQUENCE = ""; /** @@ -29,54 +30,47 @@ public class KeywordList implements ISaveable { */ public static final String LIST_END_SAVESEQUENCE = ""; /** - * The sequence seperating the single keywords in the saveable String format - * of this class + * The sequence seperating the single keywords in the saveable String format of + * this class */ public static final String LIST_SEPERATOR_SAVESEQUENCE = ""; - + /** - * The list of keywords where every starting letter has it's own list. - * Therefore get('b'-('a'+1)) will get the list for the - * starting letter b + * The list of keywords where every starting letter has it's own list. Therefore + * get('b'-('a'+1)) will get the list for the starting letter b */ - private List> keywords; + private Map keywords; /** * A list of keywords this list has failed to recreate */ private List failures; - - + + /** * Creates an instance of this KeywordList */ public KeywordList() { - keywords = new ArrayList>(27); - - // initialize a list for every letter - for (int i = ('a' - 1); i <= 'z'; i++) { - keywords.add(new ArrayList()); - } - + keywords = new HashMap(); + failures = new ArrayList(); } - + /** * Recreates an instance of this KeywordList from the given - * saveFormat. If saveFormat is not considered a valid saveFormat the list - * will be initialized as if no parameter was given + * saveFormat. If saveFormat is not considered a valid saveFormat the list will + * be initialized as if no parameter was given * * @param saveFormat - * The saveFormat which should be used to initialize this list - * from + * The saveFormat which should be used to initialize this list from */ public KeywordList(String saveFormat) { this(); - + if (isSaveFormat(saveFormat)) { recreateFrom(saveFormat); } } - + /** * Creates a KeywordList out of the given list of keywords * @@ -86,50 +80,33 @@ public KeywordList(String saveFormat) { */ public KeywordList(List keywords) { this(); - + addKeywords(keywords); } /** - * Adds a keyword to this list + * Creates a KeywordList out of the given list of keywords * - * @param keyword - * The keyword to add + * @param keywords + * The list of variables that should be transformed into a + * KeywordList */ - public void addKeyword(Keyword keyword) { - addKeyword(keyword, true); + public KeywordList(Map keywords) { + this(); + + this.keywords = keywords; } - + /** * Adds a keyword to this list * * @param keyword * The keyword to add - * @param sort - * Whether to sort the respective list after addition */ - private void addKeyword(Keyword keyword, boolean sort) { - Assert.isNotNull(keyword); - - int listIndex; - - if (Character.isLetter(keyword.getKeyword().charAt(0))) { - listIndex = Character.toLowerCase(keyword.getKeyword().charAt(0)) - - ('a' - 1); - } else { - listIndex = 0; - } - - if (!keywords.get(listIndex).contains(keyword)) { - keywords.get(listIndex).add(keyword); - } - - if (sort) { - // sort the list the keywords has been added to - Collections.sort(keywords.get(listIndex)); - } + public void addKeyword(Keyword keyword) { + keywords.put(keyword.getKeyword().toLowerCase(), keyword); } - + /** * Adds all given keywords to this list * @@ -139,15 +116,10 @@ private void addKeyword(Keyword keyword, boolean sort) { public void addKeywords(Collection keywords) { // add all keywords for (Keyword currentKeyword : keywords) { - addKeyword(currentKeyword, false); - } - - // sort list - for (List current : this.keywords) { - Collections.sort(current); + this.keywords.put(currentKeyword.getKeyword().toLowerCase(), currentKeyword); } } - + /** * removes a keyword from this list * @@ -155,17 +127,9 @@ public void addKeywords(Collection keywords) { * The keyword to remove */ public void removeKeyword(Keyword keyword) { - Assert.isNotNull(keyword); - - if (this.contains(keyword)) { - // only add a keyword once - return; - } - - keywords.get(Character.toLowerCase(keyword.getKeyword().charAt(0)) - - ('a' - 1)).remove(keyword); + keywords.remove(keyword.getKeyword().toLowerCase()); } - + /** * Checks if the given Keyword is contained in this list * @@ -173,84 +137,31 @@ public void removeKeyword(Keyword keyword) { * The keyword to search for */ public boolean contains(Keyword keyword) { - return keywords - .get(Character.toLowerCase(keyword.getKeyword().charAt(0)) - - ('a' - 1)) - .contains(keyword); + return keywords.get(keyword.getKeyword().toLowerCase()) != null; } - + /** * Gets all of the keywords stored in this list as one single list * * @return The list of keywords contained in this List in alphabetical order */ - public ArrayList getKeywords() { - ArrayList allKeywords = new ArrayList(); - - for (List currentList : keywords) { - allKeywords.addAll(currentList); - } - - return allKeywords; - } - - /** - * Gets the keywordList where each starting letter is stored in it's own - * subList.
    - * 'a' is index 1 - */ - public List> getKeywordsSorted() { + public Map getKeywords() { return keywords; } - - /** - * Gets the keyword with the respective String representation - * - * @param keyword - * The String representation of the desired keyword - * @param caseSensitive - * Whether the keyword should be searched case-sensitive - * @return The desired Keyword or null if none - * could be found - */ - public Keyword getKeyword(String keyword, boolean caseSensitive) { - List list = keywords - .get(Character.toLowerCase(keyword.charAt(0)) - ('a' - 1)); - - if (caseSensitive) { - // search case sensitive - for (Keyword currentKeyword : list) { - if (currentKeyword.getKeyword().equals(keyword)) { - return currentKeyword; - } - } - } else { - // search case-insensitive - keyword = keyword.toLowerCase(); - - for (Keyword currentKeyword : list) { - if (currentKeyword.getKeyword().toLowerCase().equals(keyword)) { - return currentKeyword; - } - } - } - - return null; - } - + /** - * Gets the keyword with the respective String representation. The search - * will be done case sensitive. + * Gets the keyword with the respective String representation. The search will + * be done case insensitive. * * @param keyword * The String representation of the desired keyword - * @return The desired Keyword or null if none - * could be found + * @return The desired Keyword or null if none could + * be found */ public Keyword getKeyword(String keyword) { - return getKeyword(keyword, true); + return keywords.get(keyword.toLowerCase()); } - + /** * Checks whether this list contains a keyword with the given String * representation @@ -261,51 +172,51 @@ public Keyword getKeyword(String keyword) { public boolean contains(String keyword) { return getKeyword(keyword) != null; } - + @Override public String getSaveableFormat() { String saveableFormat = LIST_START_SAVESEQUENCE + "\n\n"; - - for (Keyword currentKeyword : getKeywords()) { - saveableFormat += "\n\t" - + currentKeyword.getSaveableFormat().replace("\n", "\n\t"); - + + Iterator> it = keywords.entrySet().iterator(); + + while (it.hasNext()) { + Keyword currentKeyword = it.next().getValue(); + + saveableFormat += "\n\t" + currentKeyword.getSaveableFormat().replace("\n", "\n\t"); + saveableFormat += "\n\n" + LIST_SEPERATOR_SAVESEQUENCE + "\n"; } - + if (getKeywords().size() > 0) { // remove last seperator - saveableFormat = saveableFormat.substring(0, saveableFormat.length() - - (LIST_SEPERATOR_SAVESEQUENCE.length() + 1)); + saveableFormat = saveableFormat.substring(0, + saveableFormat.length() - (LIST_SEPERATOR_SAVESEQUENCE.length() + 1)); } - + saveableFormat += "\n\n" + LIST_END_SAVESEQUENCE; - + return saveableFormat.replace("\n", "\r\n"); } - + @Override public boolean recreateFrom(String savedFormat) { savedFormat = savedFormat.replace("\r\n", "\n"); - - String listContent = savedFormat.substring( - savedFormat.indexOf(LIST_START_SAVESEQUENCE) - + LIST_START_SAVESEQUENCE.length(), - savedFormat.indexOf(LIST_END_SAVESEQUENCE)).trim(); - - for (String currentKeywordContent : listContent - .split(LIST_SEPERATOR_SAVESEQUENCE)) { + + String listContent = savedFormat + .substring(savedFormat.indexOf(LIST_START_SAVESEQUENCE) + LIST_START_SAVESEQUENCE.length(), + savedFormat.indexOf(LIST_END_SAVESEQUENCE)) + .trim(); + + for (String currentKeywordContent : listContent.split(LIST_SEPERATOR_SAVESEQUENCE)) { currentKeywordContent = currentKeywordContent.trim(); - + Keyword currentKeyword; - - if (currentKeywordContent - .contains(SQFCommand.SYNTAX_START_SAVESEQUENCE)) { + + if (currentKeywordContent.contains(SQFCommand.SYNTAX_START_SAVESEQUENCE)) { // if the info corresponds to a SQF command currentKeyword = new SQFCommand(); } else { - if (currentKeywordContent - .contains(SQFElement.WIKI_START_SAVESEQUENCE)) { + if (currentKeywordContent.contains(SQFElement.WIKI_START_SAVESEQUENCE)) { // if the info corresponds to a SQFElement currentKeyword = new SQFElement(); } else { @@ -313,7 +224,7 @@ public boolean recreateFrom(String savedFormat) { currentKeyword = new Keyword(); } } - + try { if (!currentKeyword.recreateFrom(currentKeywordContent)) { return false; @@ -324,68 +235,35 @@ public boolean recreateFrom(String savedFormat) { failures.add(e); } } - + return true; } - + @Override public boolean isSaveFormat(String format) { - if (!format.contains(LIST_START_SAVESEQUENCE) - || !format.contains(LIST_END_SAVESEQUENCE)) { + if (!format.contains(LIST_START_SAVESEQUENCE) || !format.contains(LIST_END_SAVESEQUENCE)) { return false; } - + int startPos = format.indexOf(LIST_START_SAVESEQUENCE); int endPos = format.indexOf(LIST_END_SAVESEQUENCE); - + if (endPos < startPos) { return false; } - + return true; } - - /** - * Gets the KeywordList for the given starting character - * - * @param c - * The starting character the returned list should correspond to - * @return The respective list - */ - public List getListFor(char c) { - c = Character.toLowerCase(c); - - if (Character.isLetter(c)) { - return keywords.get(c - ('a' - 1)); - } else { - return keywords.get(0); - } - } - + /** * Gets the list of exceptions thrown during recreation */ public List getFailures() { return failures; } - - /** - * Sorts the content of this keyword list alphabetically - */ - public void sort() { - for (List currentList : keywords) { - Collections.sort(currentList); - } - } - + @Override public String toString() { - StringBuilder builder = new StringBuilder(); - - for (List list : keywords) { - builder.append(list.toString() + "\n"); - } - - return builder.toString(); + return keywords.keySet().toString(); } } diff --git a/plugin/Raven.SQDev.Misc/src/raven/sqdev/infoCollection/base/SQFCommand.java b/plugin/Raven.SQDev.Misc/src/raven/sqdev/infoCollection/base/SQFCommand.java index 77d69580..0f22be39 100644 --- a/plugin/Raven.SQDev.Misc/src/raven/sqdev/infoCollection/base/SQFCommand.java +++ b/plugin/Raven.SQDev.Misc/src/raven/sqdev/infoCollection/base/SQFCommand.java @@ -755,7 +755,7 @@ public String getSaveableFormat() { format = format.substring(0, format.length() - RETURN_VALUE_SYNTAX_SEPERATOR.length()); } - format += RETURNVALUE_END_SAVESEQUENCE; + format += "\n" + RETURNVALUE_END_SAVESEQUENCE; return format; } diff --git a/plugin/Raven.SQDev.Misc/src/raven/sqdev/interfaces/IMacroSupport.java b/plugin/Raven.SQDev.Misc/src/raven/sqdev/interfaces/IMacroSupport.java index 7a58f0fc..39507e3c 100644 --- a/plugin/Raven.SQDev.Misc/src/raven/sqdev/interfaces/IMacroSupport.java +++ b/plugin/Raven.SQDev.Misc/src/raven/sqdev/interfaces/IMacroSupport.java @@ -1,6 +1,6 @@ package raven.sqdev.interfaces; -import java.util.List; +import java.util.Map; import raven.sqdev.misc.Macro; @@ -21,10 +21,10 @@ public interface IMacroSupport { * Whether to allow update of the editor * @return Whether the macros have been updated */ - public boolean setMacros(List macros, boolean update); + public boolean setMacros(Map macros, boolean update); /** - * Gets the collection of macros defined in this editor + * Gets the set of macros defined in this editor */ - public List getMacros(); + public Map getMacros(); } diff --git a/plugin/Raven.SQDev.Misc/src/raven/sqdev/interfaces/IParseResult.java b/plugin/Raven.SQDev.Misc/src/raven/sqdev/interfaces/IParseResult.java new file mode 100644 index 00000000..e5fb8077 --- /dev/null +++ b/plugin/Raven.SQDev.Misc/src/raven/sqdev/interfaces/IParseResult.java @@ -0,0 +1,53 @@ +package raven.sqdev.interfaces; + +import java.util.Collection; + +import org.antlr.v4.runtime.tree.ParseTree; + +import dataStructures.IBuildableIndexTree; +import dataStructures.IToken; +import dataStructures.ITokenSource; +import raven.sqdev.misc.Marker; + +/** + * This interface describes an object that contains the result of parsing some + * content + * + * @author Raven + * + */ +public interface IParseResult { + + + /** + * Gets the {@linkplain IBuildableIndexTree} resulting from parsing the + * respective input + */ + public IBuildableIndexTree getTree(); + + /** + * Gets the token buffer holding the tokens corresponding to the indices as + * listed in the tree retrieved via {@link #getTree()} + */ + public ITokenSource getTokenBuffer(); + + /** + * Gets the markers that have been produced during parsing + */ + public Collection getMarkers(); + + /** + * Gets the ANTLR parse tree (if present) + */ + public ParseTree getANTRLParseTree(); + + /** + * Gets the line in the input at the given offset + * + * @param offset + * The offset whose line should be determined + * @return The respective line + */ + public int getLine(int offset); + +} diff --git a/plugin/Raven.SQDev.Misc/src/raven/sqdev/interfaces/ISQFParseInformation.java b/plugin/Raven.SQDev.Misc/src/raven/sqdev/interfaces/ISQFInformation.java similarity index 59% rename from plugin/Raven.SQDev.Misc/src/raven/sqdev/interfaces/ISQFParseInformation.java rename to plugin/Raven.SQDev.Misc/src/raven/sqdev/interfaces/ISQFInformation.java index bc2950f6..c23450de 100644 --- a/plugin/Raven.SQDev.Misc/src/raven/sqdev/interfaces/ISQFParseInformation.java +++ b/plugin/Raven.SQDev.Misc/src/raven/sqdev/interfaces/ISQFInformation.java @@ -1,6 +1,7 @@ package raven.sqdev.interfaces; -import java.util.List; +import java.util.Collection; +import java.util.Map; import raven.sqdev.infoCollection.base.SQFCommand; import raven.sqdev.infoCollection.base.Variable; @@ -13,55 +14,55 @@ * @author Raven * */ -public interface ISQFParseInformation { +public interface ISQFInformation { /** * Gets the binary SQF operators */ - public List getBinaryOperators(); + public Map getBinaryOperators(); /** * Gets the binary SQF operators keywords as string */ - public List getBinaryKeywords(); + public Collection getBinaryKeywords(); /** * Gets the unary SQF operators */ - public List getUnaryOperators(); + public Map getUnaryOperators(); /** * Gets the unary SQF operators keywords as string */ - public List getUnaryKeywords(); + public Collection getUnaryKeywords(); /** * Gets the nular SQF operators */ - public List getNularOperators(); + public Map getNularOperators(); /** * Gets the nular SQF operators keywords as string */ - public List getNularKeywords(); + public Collection getNularKeywords(); /** * Gets the configured magic variables */ - public List getMagicVariables(); + public Map getMagicVariables(); /** * Gets the configured magic variable-keywords as string */ - public List getMagicVariableNames(); + public Collection getMagicVariableNames(); /** * Gets the configured macros */ - public List getMacros(); + public Map getMacros(); /** * Gets the configured macro-keywords as string */ - public List getMacroNames(); + public Collection getMacroNames(); } diff --git a/plugin/Raven.SQDev.Misc/src/raven/sqdev/interfaces/ISQFParseSupplier.java b/plugin/Raven.SQDev.Misc/src/raven/sqdev/interfaces/ISQFParseSupplier.java new file mode 100644 index 00000000..c36dc3d2 --- /dev/null +++ b/plugin/Raven.SQDev.Misc/src/raven/sqdev/interfaces/ISQFParseSupplier.java @@ -0,0 +1,26 @@ +package raven.sqdev.interfaces; + +import java.util.Map; + +import dataStructures.AbstractSQFTokenFactory; +import raven.sqdev.misc.Macro; + +/** + * An interface describing an object that supplies the necessary information and + * infrastructure for setting up a SQF lexer and parser + * + * @author Raven + * + */ +public interface ISQFParseSupplier { + /** + * Gets the map of defined macros + */ + public Map getMacros(); + + /** + * Gets the {@linkplain AbstractSQFTokenFactory} that should be used in order to + * create the tokens in the lexer + */ + public AbstractSQFTokenFactory getTokenFactory(); +} diff --git a/plugin/Raven.SQDev.Misc/src/raven/sqdev/interfaces/ITreeProcessingResult.java b/plugin/Raven.SQDev.Misc/src/raven/sqdev/interfaces/ITreeProcessingResult.java new file mode 100644 index 00000000..50848873 --- /dev/null +++ b/plugin/Raven.SQDev.Misc/src/raven/sqdev/interfaces/ITreeProcessingResult.java @@ -0,0 +1,39 @@ +package raven.sqdev.interfaces; + +import java.util.Collection; +import java.util.Map; + +import org.eclipse.jface.text.Position; + +import raven.sqdev.infoCollection.base.Variable; +import raven.sqdev.misc.Marker; + +/** + * Interface for an object that holds the information about the result of + * processing a given parse tree + * + * @author Raven + * + */ +public interface ITreeProcessingResult { + + /** + * Gets a collection of all areas that have been determined to be foldable + */ + public Collection getFoldableAreas(); + + /** + * Gets the markers that have been produced during tree processing + */ + public Collection getMarkers(); + + /** + * Gets a map of all encountered global variable declarations + */ + public Map getDeclaredGlobalVariables(); + + /** + * Gets a map of all encountered local variable declarations + */ + public Map getDeclaredLocalVariables(); +} diff --git a/plugin/Raven.SQDev.Misc/src/raven/sqdev/misc/DataTypeList.java b/plugin/Raven.SQDev.Misc/src/raven/sqdev/misc/DataTypeList.java index d77f2ada..14afde0f 100644 --- a/plugin/Raven.SQDev.Misc/src/raven/sqdev/misc/DataTypeList.java +++ b/plugin/Raven.SQDev.Misc/src/raven/sqdev/misc/DataTypeList.java @@ -13,22 +13,22 @@ * */ public class DataTypeList extends ArrayList { - + private static final long serialVersionUID = -3449702221130512936L; - + /** * The seperator used to seperate different data types */ public static final String TYPE_SEPERATOR = "/"; - - + + /** * Creates a new DataTypeList */ public DataTypeList() { super(); } - + /** * Creates a new DataTypeList with the given entry * @@ -37,78 +37,80 @@ public DataTypeList() { */ public DataTypeList(EDataType type) { super(); - + add(type); } - + /** * Creates a new DataTypeList with the given set of entries * * @param types - * The entries to directly add + * The entries to add directly */ public DataTypeList(Collection types) { super(types); } - + + /** + * Creates a new DataTypeList with the given set of entries + * + * @param types + * The entries to add directly + */ + public DataTypeList(EDataType[] types) { + for (EDataType current : types) { + add(current); + } + } + /** - * Checks whether this list contains an exchangable data type for the given - * one. + * Checks whether this list contains an exchangeable data type for the given one. * * @param type * The type that should be checked * @param reverseChecking - * Indicates whether reverse checking should be enabled as well. - * That means that the respective list entry is checked whether - * it can be replaced by the given type instead of only the other - * way round + * Indicates whether reverse checking should be enabled as well. That + * means that the respective list entry is checked whether it can be + * replaced by the given type instead of only the other way round */ - public boolean containsExchangableType(EDataType type, - boolean reverseChecking) { + public boolean containsExchangableType(EDataType type, boolean reverseChecking) { return findExchangableDataType(type, reverseChecking) != -1; } - + /** - * Finds the index of a data type that is exchangable with the given data - * type. + * Finds the index of a data type that is exchangable with the given data type. * * @param type * The data type to search for * @param reverseChecking - * Indicates whether reverse checking should be enabled as well. - * That means that the respective list entry is checked whether - * it can be replaced by the given type instead of only the other - * way round + * Indicates whether reverse checking should be enabled as well. That + * means that the respective list entry is checked whether it can be + * replaced by the given type instead of only the other way round * @return The index of the found entry or -1 if none could be * found */ - public int findExchangableDataType(EDataType type, - boolean reverseChecking) { + public int findExchangableDataType(EDataType type, boolean reverseChecking) { return findExchangableDataType(type, reverseChecking, 0); } - + /** - * Finds the index of a data type that is exchangable with the given data - * type. + * Finds the index of a data type that is exchangable with the given data type. * * @param type * The data type to search for * @param reverseChecking - * Indicates whether reverse checking should be enabled as well. - * That means that the respective list entry is checked whether - * it can be replaced by the given type instead of only the other - * way round + * Indicates whether reverse checking should be enabled as well. That + * means that the respective list entry is checked whether it can be + * replaced by the given type instead of only the other way round * @param startIndex - * Defines the index of the element the search should be started - * at + * Defines the index of the element the search should be started at * @return The index of the found entry or -1 if none could be * found */ - public int findExchangableDataType(EDataType type, boolean reverseChecking, - int startIndex) { + public int findExchangableDataType(EDataType type, boolean reverseChecking, int startIndex) { for (int i = startIndex; i < size(); i++) { EDataType currentType = get(i); - + if (currentType == type) { // a data type is exchangable with itself return i; @@ -116,7 +118,7 @@ public int findExchangableDataType(EDataType type, boolean reverseChecking, if (currentType == null || type == null) { continue; } - + if (type.canBeUsedAs(currentType)) { return i; } @@ -124,10 +126,10 @@ public int findExchangableDataType(EDataType type, boolean reverseChecking, return i; } } - + return -1; } - + /** * Adds the given data type if it is not yert contained in the list * @@ -139,7 +141,7 @@ public void addUnique(EDataType type) { add(type); } } - + /** * Adds the entries of the given collection if they are not yet contained in * this list @@ -152,66 +154,64 @@ public void addAllUnique(Collection collection) { addUnique(currentType); } } - + @Override public String toString() { StringBuilder builder = new StringBuilder(); - + for (EDataType currentType : this) { builder.append(currentType + TYPE_SEPERATOR); } - + if (size() > 0) { // remove last seperator builder.setLength(builder.length() - TYPE_SEPERATOR.length()); } - + return builder.toString(); } - + /** - * Creates a new {@link DataTypeList} and tries to fill it with the given - * types + * Creates a new {@link DataTypeList} and tries to fill it with the given types * * @param types - * The different data types to store in the list. Each datatype - * has to be seperated by {@link #TYPE_SEPERATOR} + * The different data types to store in the list. Each datatype has + * to be seperated by {@link #TYPE_SEPERATOR} * @return The created and populated list */ public static DataTypeList fillWith(String types) { DataTypeList list = new DataTypeList(); - + // extract all types out of this and add them to the list for (String currentStringType : types.split(TYPE_SEPERATOR)) { EDataType currentType = EDataType.resolve(currentStringType); - + if (currentType == null) { try { - throw new SQDevException( - "Couldn't resolve type \"" + currentStringType + "\""); + throw new SQDevException("Couldn't resolve type \"" + currentStringType + "\""); } catch (SQDevException e) { e.printStackTrace(); - + // TODO: log } } else { list.add(currentType); } } - + return list; } - + /** * Converts this list into a respective array */ public EDataType[] toArray() { EDataType[] types = new EDataType[size()]; - + for (int i = 0; i < types.length; i++) { types[i] = get(i); } - + return types; } } diff --git a/plugin/Raven.SQDev.Misc/src/raven/sqdev/misc/SQDevPreferenceUtil.java b/plugin/Raven.SQDev.Misc/src/raven/sqdev/misc/SQDevPreferenceUtil.java index 89f540fa..8eae8878 100644 --- a/plugin/Raven.SQDev.Misc/src/raven/sqdev/misc/SQDevPreferenceUtil.java +++ b/plugin/Raven.SQDev.Misc/src/raven/sqdev/misc/SQDevPreferenceUtil.java @@ -16,7 +16,7 @@ import raven.sqdev.constants.SQDevPreferenceConstants; import raven.sqdev.exceptions.SQDevCoreException; -import raven.sqdev.pluginManager.SQDevPluginManager; +import raven.sqdev.pluginManagement.SQDevPluginManager; /** * This class provides functions for dealing with SQDev preferences diff --git a/plugin/Raven.SQDev.Misc/src/raven/sqdev/parser/misc/BasicErrorListener.java b/plugin/Raven.SQDev.Misc/src/raven/sqdev/parser/misc/BasicErrorListener.java index 73acc64f..7ea229df 100644 --- a/plugin/Raven.SQDev.Misc/src/raven/sqdev/parser/misc/BasicErrorListener.java +++ b/plugin/Raven.SQDev.Misc/src/raven/sqdev/parser/misc/BasicErrorListener.java @@ -19,13 +19,13 @@ public class BasicErrorListener extends BaseErrorListener { /** * The result of this parsing */ - protected ParseResult result; + protected ParseResultOld result; /** * Create an instance of this error listener */ public BasicErrorListener() { - result = new ParseResult(); + result = new ParseResultOld(); } @Override @@ -78,7 +78,7 @@ public void reportError(int offset, int length, String msg) { /** * Gets the parse result */ - public ParseResult getParseResult() { + public ParseResultOld getParseResult() { return result; } } diff --git a/plugin/Raven.SQDev.Misc/src/raven/sqdev/parser/misc/ParseResult.java b/plugin/Raven.SQDev.Misc/src/raven/sqdev/parser/misc/ParseResultOld.java similarity index 80% rename from plugin/Raven.SQDev.Misc/src/raven/sqdev/parser/misc/ParseResult.java rename to plugin/Raven.SQDev.Misc/src/raven/sqdev/parser/misc/ParseResultOld.java index 4019dc4d..fa910098 100644 --- a/plugin/Raven.SQDev.Misc/src/raven/sqdev/parser/misc/ParseResult.java +++ b/plugin/Raven.SQDev.Misc/src/raven/sqdev/parser/misc/ParseResultOld.java @@ -5,10 +5,15 @@ import org.antlr.v4.runtime.tree.ParseTree; +import dataStructures.IBuildableIndexTree; +import dataStructures.IToken; +import dataStructures.ITokenSource; import raven.sqdev.interfaces.IMarkerSupport; +import raven.sqdev.interfaces.IParseResult; import raven.sqdev.misc.Marker; -public class ParseResult implements IMarkerSupport { +@Deprecated +public class ParseResultOld implements IMarkerSupport, IParseResult { /** * The list of reported markers @@ -20,7 +25,7 @@ public class ParseResult implements IMarkerSupport { private ParseTree tree; - public ParseResult() { + public ParseResultOld() { markers = new ArrayList(); } @@ -71,7 +76,7 @@ public void applyMarkersTo(IMarkerSupport support) { * @param other * The other parse result to merge into this one */ - public void mergeWith(ParseResult other) { + public void mergeWith(ParseResultOld other) { other.merging(); markers.addAll(other.getMarkers()); @@ -143,4 +148,31 @@ public List getMarkerTypes() { return names; } + + @Override + @Deprecated + public IBuildableIndexTree getTree() { + // TODO Auto-generated method stub + return null; + } + + @Override + @Deprecated + public ITokenSource getTokenBuffer() { + // TODO Auto-generated method stub + return null; + } + + @Override + public ParseTree getANTRLParseTree() { + // TODO Auto-generated method stub + return tree; + } + + @Override + @Deprecated + public int getLine(int offset) { + // TODO Auto-generated method stub + return 0; + } } diff --git a/plugin/Raven.SQDev.Misc/src/raven/sqdev/parser/misc/ParseUtil.java b/plugin/Raven.SQDev.Misc/src/raven/sqdev/parser/misc/ParseUtil.java index b5321504..bf5d374f 100644 --- a/plugin/Raven.SQDev.Misc/src/raven/sqdev/parser/misc/ParseUtil.java +++ b/plugin/Raven.SQDev.Misc/src/raven/sqdev/parser/misc/ParseUtil.java @@ -1,20 +1,33 @@ package raven.sqdev.parser.misc; +import java.io.IOException; +import java.io.InputStream; import java.util.ArrayList; import java.util.Arrays; +import java.util.HashMap; import java.util.List; +import java.util.Map; import org.antlr.v4.runtime.ANTLRInputStream; import org.antlr.v4.runtime.BufferedTokenStream; import org.antlr.v4.runtime.CommonTokenStream; +import org.antlr.v4.runtime.atn.DecisionInfo; +import org.antlr.v4.runtime.atn.ParseInfo; import org.antlr.v4.runtime.atn.PredictionMode; import org.antlr.v4.runtime.tree.ParseTree; import org.antlr.v4.runtime.tree.ParseTreeWalker; import org.eclipse.core.runtime.Assert; import org.eclipse.core.runtime.IPath; +import dataStructures.CharacterInputStream; +import dataStructures.SQFTreeWalker; +import lexer.SQFLexer; +import parser.SQFParser; import raven.sqdev.infoCollection.base.Variable; -import raven.sqdev.interfaces.ISQFParseInformation; +import raven.sqdev.interfaces.IParseResult; +import raven.sqdev.interfaces.ISQFInformation; +import raven.sqdev.interfaces.ISQFParseSupplier; +import raven.sqdev.interfaces.ITreeProcessingResult; import raven.sqdev.misc.CharacterPair; import raven.sqdev.misc.Pair; import raven.sqdev.misc.TextUtils; @@ -23,11 +36,10 @@ import raven.sqdev.parser.preprocessor.PreprocessorParseListener; import raven.sqdev.parser.preprocessor.PreprocessorParseResult; import raven.sqdev.parser.preprocessor.PreprocessorParser; -import raven.sqdev.parser.sqf.SQFLexer; -import raven.sqdev.parser.sqf.SQFParseInformation; -import raven.sqdev.parser.sqf.SQFParseResult; -import raven.sqdev.parser.sqf.SQFParser; -import raven.sqdev.parser.sqf.SQFValidator; +import raven.sqdev.parser.sqf.SQFInformation; +import raven.sqdev.parser.sqf.SQFParseResultOld; +import raven.sqdev.parser.sqf.SQFValidatorOLD; +import raven.sqdev.sqf.processing.SQFProcessor; /** * A class containing utility methods for parsing processes @@ -36,6 +48,106 @@ * */ public class ParseUtil { + /** + * The lexer instance used by this class + */ + protected static SQFLexer sqfLexer; + /** + * The parser instance used by this class + */ + protected static SQFParser sqfParser; + /** + * The error listener instance used by this class + */ + protected static SQFLexAndParseListener errorListener = new SQFLexAndParseListener(); + + + /** + * Parses the content represented by the given InputStream + * + * @param input + * The InputStream used to retrieve the characters of the content + * that should be parsed + * @param supplier + * The {@linkplain ISQFParseSupplier} providing all necessary extras + * for parsing + * @return The result of parsing the given content. + * @throws IOException + */ + public static final SQFParseResult parseSQF(InputStream input, ISQFParseSupplier supplier) throws IOException { + if (sqfLexer == null) { + sqfLexer = new SQFLexer(errorListener); + } + + SQFParseResult result = new SQFParseResult(); + + sqfLexer.reset(false); + sqfLexer.setMacros(supplier.getMacros().keySet()); + sqfLexer.setTokenFactory(supplier.getTokenFactory()); + errorListener.setMarkerStorage(result); + result.setLineIndices(sqfLexer.getNewlineIndices()); + + CharacterInputStream inStream = new CharacterInputStream(input); + sqfLexer.lex(inStream); + + if (sqfParser == null) { + sqfParser = new SQFParser(errorListener); + sqfParser.setErrorListener(errorListener); + // missing terminators are handled in the SQFProcessor + sqfParser.suppressMissingTerminatorErrorMessages(true); + } + + sqfParser.parse(sqfLexer); + + result.setTree(sqfParser.tree()); + result.setTokenBuffer(sqfLexer); + + return result; + } + + /** + * Processes the SQF tree contained in the given parse result. Part of this + * processing is the SQF validation + * + * @param parseResult + * The parse result containing the tree to process + * @param info + * The {@linkplain ISQFInformation} containing essential information + * about SQF + * @return The {@linkplain ITreeProcessingResult} containing all results of + * processing the given tree + */ + public static final ITreeProcessingResult processSQF(SQFParseResult parseResult, ISQFInformation info) { + TreeProcessingResult result = new TreeProcessingResult(); + result.setMarkers(parseResult.getMarkers()); + + SQFProcessor processor = new SQFProcessor(info, result, sqfLexer); + + SQFTreeWalker walker = new SQFTreeWalker(parseResult.getTree(), parseResult.getTokenBuffer(), processor); + walker.walk(); + + return result; + } + + /** + * Parses and process the given input as SQF + * + * @param input + * The input to process + * @param supplier + * The {@linkplain ISQFParseSupplier} providing all necessary extras + * for parsing + * @param info + * The {@linkplain ISQFInformation} containing essential information + * about SQF + * @return The {@linkplain ITreeProcessingResult} containing all results of + * processing the given tree + * @throws IOException + */ + public static final ITreeProcessingResult parseAndProcessSQF(InputStream input, ISQFParseSupplier supplier, + ISQFInformation info) throws IOException { + return processSQF(parseSQF(input, supplier), info); + } /** * Parses the given input assuming that the input is SQF code @@ -47,21 +159,21 @@ public class ParseUtil { * @return The parseResult containing all necessary information about the * parsing (including the parseTree) */ - public static final SQFParseResult parseSQF(String input, ISQFParseInformation parseInfo) { - SQFParseResult result = new SQFParseResult(); + public static final SQFParseResultOld parseSQFOld(String input, ISQFInformation parseInfo) { + SQFParseResultOld result = new SQFParseResultOld(); BasicErrorListener listener = new BasicErrorListener(); ANTLRInputStream in = new ANTLRInputStream(input); - SQFLexer lexer = new SQFLexer(in, parseInfo.getBinaryKeywords(), parseInfo.getUnaryKeywords(), - parseInfo.getMacroNames()); + raven.sqdev.parser.sqf.SQFLexer lexer = new raven.sqdev.parser.sqf.SQFLexer(in, parseInfo.getBinaryKeywords(), + parseInfo.getUnaryKeywords(), parseInfo.getMacroNames()); lexer.removeErrorListeners(); lexer.addErrorListener(listener); CommonTokenStream tokenStream = new CommonTokenStream(lexer); - SQFParser parser = new SQFParser(tokenStream); + raven.sqdev.parser.sqf.SQFParser parser = new raven.sqdev.parser.sqf.SQFParser(tokenStream); parser.removeErrorListeners(); parser.addErrorListener(listener); @@ -70,6 +182,9 @@ public static final SQFParseResult parseSQF(String input, ISQFParseInformation p // parse with SLL(*) parser.getInterpreter().setPredictionMode(PredictionMode.SLL); + // TODO: debug option + parser.setProfile(true); + ParseTree tree = parser.start(); if (listener.getParseResult().getMarkers().size() > 0) { @@ -88,7 +203,7 @@ public static final SQFParseResult parseSQF(String input, ISQFParseInformation p for (org.antlr.v4.runtime.Token currentToken : tokenStream.getTokens()) { if (currentToken.getChannel() == org.antlr.v4.runtime.Token.HIDDEN_CHANNEL - || currentToken.getType() == SQFParser.STRING) { + || currentToken.getType() == raven.sqdev.parser.sqf.SQFParser.STRING) { // Ignore hidden Tokens continue; } else { @@ -99,7 +214,7 @@ public static final SQFParseResult parseSQF(String input, ISQFParseInformation p // at the next Token break; } else { - // The offedning token is in a relevant + // The offending token is in a relevant // part -> must be reported unbalancedPairsToReport.add(currentPair); } @@ -124,6 +239,11 @@ public static final SQFParseResult parseSQF(String input, ISQFParseInformation p result.setTokenStream(tokenStream); result.mergeWith(listener.getParseResult()); + // TODO: debug info + ParseInfo info = parser.getParseInfo(); + DecisionInfo[] infos = info.getDecisionInfo(); + System.out.println(info); + return result; } @@ -138,15 +258,15 @@ public static final SQFParseResult parseSQF(String input, ISQFParseInformation p * The necessary ParseInformation * @return The result of the validation */ - public static final SQFParseResult validateSQF(ParseTree tree, BufferedTokenStream tokenStream, - ISQFParseInformation info) { + public static final SQFParseResultOld validateSQFOld(ParseTree tree, BufferedTokenStream tokenStream, + ISQFInformation info) { Assert.isNotNull(tokenStream); Assert.isNotNull(tree); Assert.isNotNull(info); ParseTreeWalker walker = new ParseTreeWalker(); - SQFValidator validator = new SQFValidator(info, tokenStream); + SQFValidatorOLD validator = new SQFValidatorOLD(info, tokenStream); walker.walk(validator, tree); @@ -160,11 +280,11 @@ public static final SQFParseResult validateSQF(ParseTree tree, BufferedTokenStre * The input to process * @param parseInfo * The {@link SQFParseInformation}} for this parsing process - * @return The {@link SQFParseResult} of this parsing and validating + * @return The {@link SQFParseResultOld} of this parsing and validating */ - public static final SQFParseResult parseAndValidateSQF(String input, ISQFParseInformation parseInfo) { - SQFParseResult result = parseSQF(input, parseInfo); - result.mergeWith(validateSQF(result.getParseTree(), result.getTokenStream(), parseInfo)); + public static final SQFParseResultOld parseAndValidateSQFOld(String input, ISQFInformation parseInfo) { + SQFParseResultOld result = parseSQFOld(input, parseInfo); + result.mergeWith(validateSQFOld(result.getParseTree(), result.getTokenStream(), parseInfo)); return result; } @@ -172,21 +292,23 @@ public static final SQFParseResult parseAndValidateSQF(String input, ISQFParseIn /** * Gets the default magic variables that are present in SQF code */ - public static final List getDefaultMagicVars() { - List magicVars = new ArrayList(); - magicVars.add(new Variable("_this", + public static final Map getDefaultMagicVars() { + Map magicVars = new HashMap(); + magicVars.put("_this", new Variable("_this", "This variable is available inside of functions and contains the parameters given to it.")); - magicVars.add(new Variable("_fnc_scriptName", - "A String containing the function's name. Only awaylable when the function has " - + "been compiled via CfgFunctions.")); - magicVars.add(new Variable("_fnc_scriptNameParent", - "A String containing the function's parent's name. Only awaylable when the function has " - + "been compiled via CfgFunctions.")); - magicVars.add(new Variable("_x", + magicVars.put("_fnc_scriptname", + new Variable("_fnc_scriptName", + "A String containing the function's name. Only awaylable when the function has " + + "been compiled via CfgFunctions.")); + magicVars.put("_fnc_scriptnameparent", + new Variable("_fnc_scriptNameParent", + "A String containing the function's parent's name. Only awaylable when the function has " + + "been compiled via CfgFunctions.")); + magicVars.put("_x", new Variable("_x", "References the current object oin the iteration. Available inside count or forEach loops")); - magicVars.add(new Variable("_forEachIndex", + magicVars.put("_foreachindex", new Variable("_forEachIndex", "References the index of the current object in the iteration. Only available in a " + "forEach loop.")); - magicVars.add(new Variable("_thisEventHandler", + magicVars.put("_thiseventhandler", new Variable("_thisEventHandler", "References the current event handler. Only available inside an EventHandler")); return magicVars; @@ -201,8 +323,10 @@ public static final List getDefaultMagicVars() { * The origin-path of the given content. This is used in order to * resolve relative paths * @return The result of the preprocessing + * @throws IOException */ - public static final PreprocessorParseResult parseAndValidatePreprocess(String input, IPath origin) { + public static final PreprocessorParseResult parseAndValidatePreprocess(InputStream input, IPath origin) + throws IOException { ANTLRInputStream prepIn = new ANTLRInputStream(input); PreprocessorLexer prepLexer = new PreprocessorLexer(prepIn); diff --git a/plugin/Raven.SQDev.Misc/src/raven/sqdev/parser/misc/SQFLexAndParseListener.java b/plugin/Raven.SQDev.Misc/src/raven/sqdev/parser/misc/SQFLexAndParseListener.java new file mode 100644 index 00000000..fae6e8cf --- /dev/null +++ b/plugin/Raven.SQDev.Misc/src/raven/sqdev/parser/misc/SQFLexAndParseListener.java @@ -0,0 +1,52 @@ +package raven.sqdev.parser.misc; + +import org.eclipse.core.resources.IMarker; + +import dataStructures.IErrorListener; +import dataStructures.SQFToken; +import raven.sqdev.interfaces.IMarkerSupport; + +public class SQFLexAndParseListener implements IErrorListener { + + /** + * The parse result to add the errors to + */ + protected IMarkerSupport markerStorage; + + public SQFLexAndParseListener(IMarkerSupport markerStorage) { + assert (markerStorage != null); + + this.markerStorage = markerStorage; + } + + public SQFLexAndParseListener() { + + } + + @Override + public void error(String msg, SQFToken token) { + if (markerStorage == null) { + throw new IllegalStateException( + "Marker storage may not be null. Has to be set via setMarkerStorage() before calling this method!"); + } + markerStorage.createMarker(IMarker.PROBLEM, token.start(), token.length(), msg, IMarker.SEVERITY_ERROR); + } + + /** + * Gets the parse result + */ + public IMarkerSupport getMarkerStorage() { + return markerStorage; + } + + /** + * Sets the parse result + * + * @param storage + * The {@linkplain IMarkerSupport} to report errors to + */ + public void setMarkerStorage(IMarkerSupport storage) { + this.markerStorage = storage; + } + +} diff --git a/plugin/Raven.SQDev.Misc/src/raven/sqdev/parser/misc/SQFParseResult.java b/plugin/Raven.SQDev.Misc/src/raven/sqdev/parser/misc/SQFParseResult.java new file mode 100644 index 00000000..0bf8d859 --- /dev/null +++ b/plugin/Raven.SQDev.Misc/src/raven/sqdev/parser/misc/SQFParseResult.java @@ -0,0 +1,146 @@ +package raven.sqdev.parser.misc; + +import java.util.ArrayList; +import java.util.Collection; +import java.util.List; + +import org.antlr.v4.runtime.tree.ParseTree; + +import dataStructures.IBuildableIndexTree; +import dataStructures.ITokenSource; +import dataStructures.SQFToken; +import raven.sqdev.interfaces.IMarkerSupport; +import raven.sqdev.interfaces.IParseResult; +import raven.sqdev.misc.Marker; + +public class SQFParseResult implements IParseResult, IMarkerSupport { + + /** + * The tree stored in this result + */ + protected IBuildableIndexTree tree; + /** + * The token buffer holding the tokens corresponding to the stored tree + */ + protected ITokenSource tokenBuffer; + /** + * A collection of markers that have been created during parse-tree-creation + */ + protected Collection markers; + /** + * The ANTLR parse tree + */ + protected ParseTree antlrTree; + /** + * A list of indices of newlines + */ + protected List linieIndices; + + public SQFParseResult() { + markers = new ArrayList<>(); + } + + @Override + public IBuildableIndexTree getTree() { + return tree; + } + + /** + * Sets the tree for this instance + * + * @param tree + * The tree to store + */ + public void setTree(IBuildableIndexTree tree) { + assert (tree != null); + + this.tree = tree; + } + + @Override + public ITokenSource getTokenBuffer() { + return tokenBuffer; + } + + /** + * Sets the token buffer for this instance + * + * @param buffer + * The token buffer corresponding to the stored tree + */ + public void setTokenBuffer(ITokenSource buffer) { + assert (buffer != null); + + this.tokenBuffer = buffer; + } + + @Override + public Collection getMarkers() { + return markers; + } + + @Override + public void createMarker(String type, int offset, int length, String message, int severity) { + if (markers == null) { + markers = new ArrayList(); + } + markers.add(new Marker(type, offset, length, message, severity)); + } + + /** + * Sets the markers for this result. This method is intended for marker + * collections that are passed from through the line. + * + * @param markers + * The marker collection to contribute to + */ + public void setMarkers(Collection markers) { + assert (markers != null); + + this.markers = markers; + } + + /** + * Resets all fields of this instance + */ + public void reset() { + markers = null; + tree = null; + tokenBuffer = null; + } + + @Override + public ParseTree getANTRLParseTree() { + return antlrTree; + } + + public void setANTLRParseTree(ParseTree tree) { + antlrTree = tree; + } + + @Override + public int getLine(int offset) { + if (offset < 0) { + throw new IllegalArgumentException("Offset may not be negative!"); + } + + for (int i = 0; i < linieIndices.size(); i++) { + if (linieIndices.get(i) > offset) { + return linieIndices.get(i - 1); + } + } + + return -1; + } + + /** + * Sets the newline indices + * + * @param lineIndices + * The respective indices + */ + public void setLineIndices(List lineIndices) { + this.linieIndices = lineIndices; + } + +} diff --git a/plugin/Raven.SQDev.Misc/src/raven/sqdev/parser/misc/SQFTokenFactory.java b/plugin/Raven.SQDev.Misc/src/raven/sqdev/parser/misc/SQFTokenFactory.java new file mode 100644 index 00000000..eb24045b --- /dev/null +++ b/plugin/Raven.SQDev.Misc/src/raven/sqdev/parser/misc/SQFTokenFactory.java @@ -0,0 +1,40 @@ +package raven.sqdev.parser.misc; + +import java.util.Collection; + +import dataStructures.AbstractSQFTokenFactory; + + +public class SQFTokenFactory extends AbstractSQFTokenFactory { + + private Collection binaryKeywords; + private Collection unaryKeywords; + + public SQFTokenFactory(Collection binaryKeywords, Collection unaryKeywords) { + assert (binaryKeywords != null); + assert (unaryKeywords != null); + + this.binaryKeywords = binaryKeywords; + this.unaryKeywords = unaryKeywords; + } + + @Override + protected void doInitialize() { + for (String currentOperator : unaryKeywords) { + lookupTable.put(currentOperator.toLowerCase(), UNARY); + } + + for (String currentOperator : binaryKeywords) { + currentOperator = currentOperator.toLowerCase(); + + if (hasSpecialPrecedence(currentOperator)) { + lookupTable.put(currentOperator, specialOperators.get(currentOperator)); + } else { + lookupTable.put(currentOperator, BINARY); + } + } + + lookupTable.put("=", specialOperators.get("=")); + } + +} diff --git a/plugin/Raven.SQDev.Misc/src/raven/sqdev/parser/misc/TreeProcessingResult.java b/plugin/Raven.SQDev.Misc/src/raven/sqdev/parser/misc/TreeProcessingResult.java new file mode 100644 index 00000000..63a44654 --- /dev/null +++ b/plugin/Raven.SQDev.Misc/src/raven/sqdev/parser/misc/TreeProcessingResult.java @@ -0,0 +1,108 @@ +package raven.sqdev.parser.misc; + +import java.util.ArrayList; +import java.util.Collection; +import java.util.HashMap; +import java.util.Map; + +import org.eclipse.jface.text.Position; + +import raven.sqdev.infoCollection.base.Variable; +import raven.sqdev.interfaces.IMarkerSupport; +import raven.sqdev.interfaces.ITreeProcessingResult; +import raven.sqdev.misc.Marker; + +public class TreeProcessingResult implements ITreeProcessingResult, IMarkerSupport { + + /** + * A collection of markers that have been created during tree-processing + */ + protected Collection markers; + /** + * A map containing all encountered local variables + */ + protected Map localVariables; + /** + * A map containing all encountered global variables + */ + protected Map globalVariables; + /** + * A collection holding all areas that have been determined to be foldable + */ + protected Collection foldableAreas; + + + public TreeProcessingResult() { + foldableAreas = new ArrayList<>(); + localVariables = new HashMap<>(); + globalVariables = new HashMap<>(); + markers = new ArrayList<>(); + } + + @Override + public Collection getFoldableAreas() { + return foldableAreas; + } + + /** + * Adds an area that should be foldable + * + * @param area + * The area to add + */ + public void addFoldableArea(Position area) { + assert (area != null); + + foldableAreas.add(area); + } + + @Override + public Collection getMarkers() { + return markers; + } + + @Override + public Map getDeclaredGlobalVariables() { + return globalVariables; + } + + @Override + public Map getDeclaredLocalVariables() { + return localVariables; + } + + /** + * Sets the variables stored in this result + * + * @param localVariables + * The local variables to set + * @param globalVariables + * The global variables to set + */ + public void setVariables(Map localVariables, Map globalVariables) { + this.localVariables = localVariables; + this.globalVariables = globalVariables; + } + + @Override + public void createMarker(String type, int offset, int length, String message, int severity) { + if (markers == null) { + markers = new ArrayList(); + } + markers.add(new Marker(type, offset, length, message, severity)); + } + + /** + * Sets the markers for this result. This method is intended for marker + * collections that are passed from through the line. + * + * @param markers + * The marker collection to contribute to + */ + public void setMarkers(Collection markers) { + assert (markers != null); + + this.markers = markers; + } + +} diff --git a/plugin/Raven.SQDev.Misc/src/raven/sqdev/parser/preprocessor/PreprocessorParseListener.java b/plugin/Raven.SQDev.Misc/src/raven/sqdev/parser/preprocessor/PreprocessorParseListener.java index 10133eff..62a53c66 100644 --- a/plugin/Raven.SQDev.Misc/src/raven/sqdev/parser/preprocessor/PreprocessorParseListener.java +++ b/plugin/Raven.SQDev.Misc/src/raven/sqdev/parser/preprocessor/PreprocessorParseListener.java @@ -3,7 +3,7 @@ import java.io.File; import java.io.FileInputStream; import java.io.IOException; -import java.util.List; +import java.util.Map; import java.util.Stack; import org.antlr.v4.runtime.ANTLRErrorListener; @@ -329,7 +329,7 @@ protected void reportError(int offset, int length, String msg) { /** * Gets the list of macros that have been defined during preprocessing */ - public List getDefinedMacros() { + public Map getDefinedMacros() { return result.getMacros(); } diff --git a/plugin/Raven.SQDev.Misc/src/raven/sqdev/parser/preprocessor/PreprocessorParseResult.java b/plugin/Raven.SQDev.Misc/src/raven/sqdev/parser/preprocessor/PreprocessorParseResult.java index 675d2ef7..cd42bb91 100644 --- a/plugin/Raven.SQDev.Misc/src/raven/sqdev/parser/preprocessor/PreprocessorParseResult.java +++ b/plugin/Raven.SQDev.Misc/src/raven/sqdev/parser/preprocessor/PreprocessorParseResult.java @@ -1,23 +1,23 @@ package raven.sqdev.parser.preprocessor; -import java.util.ArrayList; -import java.util.List; +import java.util.HashMap; +import java.util.Map; import raven.sqdev.misc.Macro; -import raven.sqdev.parser.misc.ParseResult; +import raven.sqdev.parser.misc.ParseResultOld; -public class PreprocessorParseResult extends ParseResult { +public class PreprocessorParseResult extends ParseResultOld { /** * The list of defined macros */ - private List macros; + private Map macros; /** * Creates a new instance of this class */ public PreprocessorParseResult() { - macros = new ArrayList(); + macros = new HashMap(); } @@ -30,7 +30,7 @@ public PreprocessorParseResult() { public void mergeWith(PreprocessorParseResult other) { super.mergeWith(other); - macros.addAll(other.getMacros()); + macros.putAll(other.getMacros()); } /** @@ -40,13 +40,13 @@ public void mergeWith(PreprocessorParseResult other) { * The Macro to add */ public void addMacro(Macro macro) { - macros.add(macro); + macros.put(macro.getKeyword(), macro); } /** * Gets all defined macros */ - public List getMacros() { + public Map getMacros() { return macros; } } diff --git a/plugin/Raven.SQDev.Misc/src/raven/sqdev/parser/sqf/ERelativPosition.java b/plugin/Raven.SQDev.Misc/src/raven/sqdev/parser/sqf/ERelativePosition.java similarity index 93% rename from plugin/Raven.SQDev.Misc/src/raven/sqdev/parser/sqf/ERelativPosition.java rename to plugin/Raven.SQDev.Misc/src/raven/sqdev/parser/sqf/ERelativePosition.java index 8137bd87..e43f6af8 100644 --- a/plugin/Raven.SQDev.Misc/src/raven/sqdev/parser/sqf/ERelativPosition.java +++ b/plugin/Raven.SQDev.Misc/src/raven/sqdev/parser/sqf/ERelativePosition.java @@ -6,7 +6,7 @@ * @author Raven * */ -public enum ERelativPosition { +public enum ERelativePosition { /** * This enum describes a centered postion */ diff --git a/plugin/Raven.SQDev.Misc/src/raven/sqdev/parser/sqf/SQFInformation.java b/plugin/Raven.SQDev.Misc/src/raven/sqdev/parser/sqf/SQFInformation.java new file mode 100644 index 00000000..43435d13 --- /dev/null +++ b/plugin/Raven.SQDev.Misc/src/raven/sqdev/parser/sqf/SQFInformation.java @@ -0,0 +1,157 @@ +package raven.sqdev.parser.sqf; + +import java.util.ArrayList; +import java.util.Collection; +import java.util.HashMap; +import java.util.Map; +import raven.sqdev.infoCollection.base.Keyword; +import raven.sqdev.infoCollection.base.KeywordList; +import raven.sqdev.infoCollection.base.SQFCommand; +import raven.sqdev.infoCollection.base.Variable; +import raven.sqdev.interfaces.ISQFInformation; +import raven.sqdev.misc.Macro; +import raven.sqdev.misc.SQDevInfobox; +import raven.sqdev.parser.misc.ParseUtil; +import raven.sqdev.pluginManagement.ResourceManager; + +/** + * A default implementation for a ISQFParseInformation + * + * @author Raven + * + */ +public class SQFInformation implements ISQFInformation { + /** + * The SQF keywords to use + */ + private static KeywordList keywords; + + private static Map binaryOperator; + private static Map unaryOperator; + private static Map nularOperator; + private static Map magicVars; + + private Map macros; + + /** + * Creates a new instance of this class + */ + public SQFInformation(Map macros) { + this(false, macros); + } + + /** + * Creates a new instance of this class + * + * @param refresh + * Indicates whether the used list of keywords should be refreshed. + * Otheriwse the one from previous instances of this class will be + * used. If the keywords are refreshed every existing instance will + * use the refreshed list + * @param macros + * A map of defined macros the SQF parser should be aware of + */ + public SQFInformation(boolean refresh, Map macros) { + this.macros = macros; + + if (refresh || keywords == null) { + binaryOperator = new HashMap(); + unaryOperator = new HashMap(); + nularOperator = new HashMap(); + + String savedKeywords = getKeywordContent(); + + if (savedKeywords == null) { + SQDevInfobox info = new SQDevInfobox("Failed at instantiating SQF parseInformation properly!\n\nReason:" + + "\nProblems with reading respective resource"); + info.open(); + + return; + } + + keywords = new KeywordList(savedKeywords); + + if (keywords.getFailures().size() > 0) { + SQDevInfobox info = new SQDevInfobox("Failed to load " + keywords.getFailures().size() + " commands", + keywords.getFailures()); + + info.open(false); + } + + for (Keyword currentKeyword : keywords.getKeywords().values()) { + SQFCommand command = (SQFCommand) currentKeyword; + + if (command.isBinaryOperator()) { + binaryOperator.put(command.getKeyword().toLowerCase(), command); + } else { + if (command.isUnaryOperator()) { + unaryOperator.put(command.getKeyword().toLowerCase(), command); + } else { + nularOperator.put(command.getKeyword().toLowerCase(), command); + } + } + } + + magicVars = ParseUtil.getDefaultMagicVars(); + } + } + + /** + * Gets the saved keywords in their storage-form + */ + protected String getKeywordContent() { + ResourceManager manager = ResourceManager.getManager(); + return manager.getResourceContent("SQFKeywords.txt"); + } + + @Override + public Map getBinaryOperators() { + return binaryOperator; + } + + @Override + public Map getUnaryOperators() { + return new HashMap(unaryOperator); + } + + @Override + public Map getNularOperators() { + return nularOperator; + } + + @Override + public Map getMagicVariables() { + return magicVars; + } + + @Override + public Map getMacros() { + return macros; + } + + @Override + public Collection getBinaryKeywords() { + return new ArrayList(binaryOperator.keySet()); + } + + @Override + public Collection getUnaryKeywords() { + return new ArrayList(unaryOperator.keySet()); + } + + @Override + public Collection getNularKeywords() { + return new ArrayList(nularOperator.keySet()); + } + + @Override + public Collection getMagicVariableNames() { + return new ArrayList(magicVars.keySet()); + } + + @Override + public Collection getMacroNames() { + return new ArrayList(macros.keySet()); + } + +} diff --git a/plugin/Raven.SQDev.Misc/src/raven/sqdev/parser/sqf/SQFLexer.java b/plugin/Raven.SQDev.Misc/src/raven/sqdev/parser/sqf/SQFLexer.java index f63279d5..a74aae6b 100644 --- a/plugin/Raven.SQDev.Misc/src/raven/sqdev/parser/sqf/SQFLexer.java +++ b/plugin/Raven.SQDev.Misc/src/raven/sqdev/parser/sqf/SQFLexer.java @@ -2,7 +2,9 @@ package raven.sqdev.parser.sqf; - import java.util.List; + import java.util.Collection; +import java.util.List; +import java.util.stream.Collectors; import org.antlr.v4.runtime.Lexer; import org.antlr.v4.runtime.CharStream; @@ -90,21 +92,17 @@ public Vocabulary getVocabulary() { - protected List binaryOperators; - protected List unaryOperators; - protected List macroNames; + protected Collection binaryOperators; + protected Collection unaryOperators; + protected Collection macroNames; - public SQFLexer(CharStream input, List binaryOperators, List unaryOperators, List macroNames) { + public SQFLexer(CharStream input, Collection binaryOperators, Collection unaryOperators, Collection macroNames) { this(input); // make operators lowercase - for(int i=0; i binaryOperator; - private static List binaryKeywords; - private static List unaryOperator; - private static List unaryKeywords; - private static List nularOperator; - private static List nularKeywords; - private static List magicVars; - private static List magicVarNames; - - private List macros; - private List macroNames; - - /** - * Creates a new instance of this class - */ - public SQFParseInformation(List macros) { - this(false, macros); - } - - /** - * Creates a new instance of this class - * - * @param refresh - * Indicates whether the used list of keywords should be refreshed. - * Otheriwse the one from previous instances of this class will be - * used. If the keywords are refreshed every existing instance will - * use the refreshed list - * @param macros - * A list of defined macros the SQF parser should be aware of - */ - public SQFParseInformation(boolean refresh, List macros) { - this.macros = macros; - macroNames = new ArrayList(); - - loadMacronames(); - - if (refresh || keywords == null) { - binaryOperator = new ArrayList(); - binaryKeywords = new ArrayList(); - unaryOperator = new ArrayList(); - unaryKeywords = new ArrayList(); - nularOperator = new ArrayList(); - nularKeywords = new ArrayList(); - magicVarNames = new ArrayList(); - - String savedKeywords = getKeywordContent(); - - if (savedKeywords == null) { - SQDevInfobox info = new SQDevInfobox( - "Failed at instantiating SQF parseInformation properly!\n\nReason:" - + "\nProblems with reading respective resource"); - info.open(); - - return; - } - - keywords = new KeywordList(savedKeywords); - - if (keywords.getFailures().size() > 0) { - SQDevInfobox info = new SQDevInfobox( - "Failed to load " + keywords.getFailures().size() + " commands", - keywords.getFailures()); - - info.open(false); - } - - for (Keyword currentKeyword : keywords.getKeywords()) { - SQFCommand command = (SQFCommand) currentKeyword; - - if (command.isBinaryOperator()) { - binaryOperator.add(command); - } else { - if (command.isUnaryOperator()) { - unaryOperator.add(command); - } else { - nularOperator.add(command); - } - } - } - - magicVars = ParseUtil.getDefaultMagicVars(); - - loadNames(); - } - } - - /** - * Gets the saved keywords in their storage-form - */ - protected String getKeywordContent() { - ResourceManager manager = ResourceManager.getManager(); - return manager.getResourceContent("SQFKeywords.txt"); - } - - /** - * Initializes all name-lists except the macro-namelist (see - * {@link #loadMacronames()}) - */ - private void loadNames() { - for (Keyword current : binaryOperator) { - binaryKeywords.add(current.getKeyword()); - } - for (Keyword current : unaryOperator) { - unaryKeywords.add(current.getKeyword()); - } - for (Keyword current : nularOperator) { - nularKeywords.add(current.getKeyword()); - } - for (Keyword current : magicVars) { - magicVarNames.add(current.getKeyword()); - } - } - - /** - * Initializes the macro-namelist - */ - private void loadMacronames() { - for (Macro currentMacro : macros) { - macroNames.add(currentMacro.getKeyword()); - } - } - - @Override - public List getBinaryOperators() { - return new ArrayList(binaryOperator); - } - - @Override - public List getUnaryOperators() { - return new ArrayList(unaryOperator); - } - - @Override - public List getNularOperators() { - return new ArrayList(nularOperator); - } - - @Override - public List getMagicVariables() { - return new ArrayList(magicVars); - } - - @Override - public List getMacros() { - return new ArrayList(macros); - } - - @Override - public List getBinaryKeywords() { - return new ArrayList(binaryKeywords); - } - - @Override - public List getUnaryKeywords() { - return new ArrayList(unaryKeywords); - } - - @Override - public List getNularKeywords() { - return new ArrayList(nularKeywords); - } - - @Override - public List getMagicVariableNames() { - return new ArrayList(macroNames); - } - - @Override - public List getMacroNames() { - return new ArrayList(macroNames); - } - -} diff --git a/plugin/Raven.SQDev.Misc/src/raven/sqdev/parser/sqf/SQFParseResult.java b/plugin/Raven.SQDev.Misc/src/raven/sqdev/parser/sqf/SQFParseResultOld.java similarity index 78% rename from plugin/Raven.SQDev.Misc/src/raven/sqdev/parser/sqf/SQFParseResult.java rename to plugin/Raven.SQDev.Misc/src/raven/sqdev/parser/sqf/SQFParseResultOld.java index e9279003..032cb312 100644 --- a/plugin/Raven.SQDev.Misc/src/raven/sqdev/parser/sqf/SQFParseResult.java +++ b/plugin/Raven.SQDev.Misc/src/raven/sqdev/parser/sqf/SQFParseResultOld.java @@ -1,13 +1,15 @@ package raven.sqdev.parser.sqf; import java.util.ArrayList; +import java.util.HashMap; import java.util.List; +import java.util.Map; import org.antlr.v4.runtime.BufferedTokenStream; import org.eclipse.jface.text.Position; import raven.sqdev.infoCollection.base.Variable; -import raven.sqdev.parser.misc.ParseResult; +import raven.sqdev.parser.misc.ParseResultOld; /** * A basic implementation of an {@link ISQFParseResult} @@ -15,17 +17,18 @@ * @author Raven * */ -public class SQFParseResult extends ParseResult { +@Deprecated +public class SQFParseResultOld extends ParseResultOld { /** * A list of local variables declared during the parsing */ - private List declaredLocalVariables; + private Map declaredLocalVariables; /** * A list of global variables declared during the parsing */ - private List declaredGlobalVariables; + private Map declaredGlobalVariables; /** * A list of folding areas */ @@ -40,10 +43,10 @@ public class SQFParseResult extends ParseResult { private BufferedTokenStream tokenStream; - public SQFParseResult() { + public SQFParseResultOld() { foldingAreas = new ArrayList(); - declaredLocalVariables = new ArrayList(); - declaredGlobalVariables = new ArrayList(); + declaredLocalVariables = new HashMap(); + declaredGlobalVariables = new HashMap(); } /** @@ -54,7 +57,7 @@ public SQFParseResult() { * @param globalVariables * The list of found global variables */ - public void setVariables(List localVariables, List globalVariables) { + public void setVariables(Map localVariables, Map globalVariables) { declaredLocalVariables = localVariables; declaredGlobalVariables = globalVariables; @@ -73,14 +76,14 @@ public void addFoldingArea(Position position) { /** * Gets a list of found local variable declarations */ - public List getDeclaredLocalVariables() { + public Map getDeclaredLocalVariables() { return declaredLocalVariables; } /** * Gets a list of found global variable declarations */ - public List getDeclaredGlobalVariables() { + public Map getDeclaredGlobalVariables() { return declaredGlobalVariables; } @@ -145,17 +148,17 @@ public boolean providesTokenStream() { * during that process (unless they are null). * * If you want to only merge the reported markers then cast the argument to a - * {@link SQFParseResult}} + * {@link SQFParseResultOld}} * * @param other * The SQFParseResult to merge into this one */ - public void mergeWith(SQFParseResult other) { + public void mergeWith(SQFParseResultOld other) { super.mergeWith(other); foldingAreas.addAll(other.getFoldingAreas()); - declaredLocalVariables.addAll(other.getDeclaredLocalVariables()); - declaredGlobalVariables.addAll(other.getDeclaredGlobalVariables()); + declaredLocalVariables.putAll(other.getDeclaredLocalVariables()); + declaredGlobalVariables.putAll(other.getDeclaredGlobalVariables()); if (parserRuleNames == null) { parserRuleNames = other.getParserRulenames(); diff --git a/plugin/Raven.SQDev.Misc/src/raven/sqdev/parser/sqf/SQFSyntaxProcessor.java b/plugin/Raven.SQDev.Misc/src/raven/sqdev/parser/sqf/SQFSyntaxProcessor.java index f7d566b6..4842ec8e 100644 --- a/plugin/Raven.SQDev.Misc/src/raven/sqdev/parser/sqf/SQFSyntaxProcessor.java +++ b/plugin/Raven.SQDev.Misc/src/raven/sqdev/parser/sqf/SQFSyntaxProcessor.java @@ -3,8 +3,6 @@ import java.util.ArrayList; import java.util.List; -import org.eclipse.core.runtime.Assert; - import raven.sqdev.constants.ProblemMessages; import raven.sqdev.exceptions.SQDevCoreException; import raven.sqdev.exceptions.SQDevException; @@ -19,15 +17,15 @@ public class SQFSyntaxProcessor { /** * The command whose syntax should be checked */ - private SQFCommand command; + private SQFCommand operator; /** * The potential datatypes of the left argument */ - private EDataType[] leftArgumentTypes; + private Iterable leftArgumentTypes; /** * The potential datatypes of the right argument */ - private EDataType[] rightArgumentTypes; + private Iterable rightArgumentTypes; /** * Indicates whether the command has been validated with the provided argument * types @@ -44,12 +42,15 @@ public class SQFSyntaxProcessor { /** * The relative position describing where the error marker should be placed */ - private ERelativPosition markerPosition; + private ERelativePosition markerPosition; - public SQFSyntaxProcessor(SQFCommand command) { - Assert.isNotNull(command); - this.command = command; + public SQFSyntaxProcessor() { + } + + + public SQFSyntaxProcessor(SQFCommand command) { + setOperator(command); } /** @@ -58,7 +59,7 @@ public SQFSyntaxProcessor(SQFCommand command) { * @param types * The potential EDataTypes */ - public void setLeftArgumentTypes(EDataType[] types) { + public void setLeftArgumentTypes(Iterable types) { leftArgumentTypes = types; validated = false; } @@ -69,7 +70,7 @@ public void setLeftArgumentTypes(EDataType[] types) { * @param types * The potential EDataTypes */ - public void setRightArgumentTypes(EDataType[] types) { + public void setRightArgumentTypes(Iterable types) { rightArgumentTypes = types; validated = false; } @@ -81,9 +82,9 @@ protected void validate() { validated = true; // check possible argument constellations the command accepts - boolean canBeBinary = command.isBinaryOperator(); - boolean canBeUnary = command.isUnaryOperator(); - boolean canBeNular = command.isNularOperator(); + boolean canBeBinary = operator.isBinaryOperator(); + boolean canBeUnary = operator.isUnaryOperator(); + boolean canBeNular = operator.isNularOperator(); // check arguments to determine which constellation can be achieved with // given arguments @@ -106,7 +107,7 @@ protected void validate() { // the command can't be used with the given amount of arguments if (leftArgumentTypes != null && rightArgumentTypes != null) { // tried to use as binary operator - errorMessage = ProblemMessages.operatorIsNotBinary(command.getKeyword()); + errorMessage = ProblemMessages.operatorIsNotBinary(operator.getKeyword()); activeSyntax = null; @@ -114,36 +115,36 @@ protected void validate() { } if (rightArgumentTypes != null) { - if (command.isBinaryOperator()) { + if (operator.isBinaryOperator()) { // command is binary but only one arg provided - errorMessage = ProblemMessages.missingArgLeft(command.getKeyword()); + errorMessage = ProblemMessages.missingArgLeft(operator.getKeyword()); activeSyntax = null; - markerPosition = ERelativPosition.CENTER; + markerPosition = ERelativePosition.CENTER; } else { // operator is nular but has one argument provided - errorMessage = ProblemMessages.operatorIsNular(command.getKeyword()); + errorMessage = ProblemMessages.operatorIsNular(operator.getKeyword()); activeSyntax = null; - markerPosition = ERelativPosition.CENTER; + markerPosition = ERelativePosition.CENTER; } return; } // command must be nular but there must be an argument provided - errorMessage = ProblemMessages.operatorIsNotNular(command.getKeyword()); + errorMessage = ProblemMessages.operatorIsNotNular(operator.getKeyword()); activeSyntax = null; - markerPosition = ERelativPosition.RIGHT; + markerPosition = ERelativePosition.RIGHT; return; } - List possibleSyntaxes = new ArrayList(command.getSyntaxes()); + List possibleSyntaxes = new ArrayList(operator.getSyntaxes()); DataTypeList validProvidedLeftTypes = new DataTypeList(); DataTypeList validGeneralLeftTypes = new DataTypeList(); @@ -198,13 +199,11 @@ protected void validate() { if (leftArgumentTypes != null && validProvidedLeftTypes.isEmpty()) { // left argument is invalid - errorMessage = ProblemMessages.expectedTypeButGot( - validGeneralLeftTypes.toArray(new EDataType[validGeneralLeftTypes.size()]), - leftArgumentTypes); + errorMessage = ProblemMessages.expectedTypeButGot(validGeneralLeftTypes, leftArgumentTypes); activeSyntax = null; - markerPosition = ERelativPosition.LEFT; + markerPosition = ERelativePosition.LEFT; return; } @@ -247,13 +246,11 @@ protected void validate() { // TODO: note the left arg ctx in the error msg if possible // The right argument is invalid as the program reached this part of the // code - errorMessage = ProblemMessages.expectedTypeButGot( - validGeneralRightTypes.toArray(new EDataType[validGeneralRightTypes.size()]), - rightArgumentTypes); + errorMessage = ProblemMessages.expectedTypeButGot(validGeneralRightTypes, rightArgumentTypes); activeSyntax = null; - markerPosition = ERelativPosition.RIGHT; + markerPosition = ERelativePosition.RIGHT; } /** @@ -282,9 +279,9 @@ public String getErrorMessage() { * Gets the relative position the error marker should be drawn at. The command * itself is used as the center point */ - public ERelativPosition getErrorMarkerPosition() { + public ERelativePosition getErrorMarkerPosition() { if (isValid()) { - return ERelativPosition.NONE; + return ERelativePosition.NONE; } return markerPosition; @@ -304,8 +301,8 @@ private DataTypeList getTypesForSide(Syntax syntax, boolean leftSide) { .getElement((leftSide) ? 0 : ((syntax.isBinary()) ? 2 : (syntax.isNular()) ? 0 : 1)); if (!element.isLeafElement()) { - throw new SQDevCoreException("Expected element from the syntax for command \"" - + syntax.getCommandName() + "\" to be a leaf element"); + throw new SQDevCoreException("Expected element from the syntax for command \"" + syntax.getCommandName() + + "\" to be a leaf element"); } DataTypeList dataTypes = new DataTypeList(); @@ -340,9 +337,33 @@ private DataTypeList getTypesForSide(Syntax syntax, boolean leftSide) { */ public DataTypeList getReturnValues() { if (activeSyntax == null) { - return command.getAllReturnTypes(); + return operator.getAllReturnTypes(); } else { - return command.getReturnTypes(activeSyntax); + return operator.getReturnTypes(activeSyntax); } } + + /** + * Resets this processor for another usage + */ + public void reset() { + operator = null; + leftArgumentTypes = null; + rightArgumentTypes = null; + validated = false; + errorMessage = null; + activeSyntax = null; + markerPosition = null; + } + + /** + * Sets the operator to be processed by this processor + * + * @param operator + * The operator to process + */ + public void setOperator(SQFCommand operator) { + assert (operator != null); + this.operator = operator; + } } diff --git a/plugin/Raven.SQDev.Misc/src/raven/sqdev/parser/sqf/SQFValidator.java b/plugin/Raven.SQDev.Misc/src/raven/sqdev/parser/sqf/SQFValidatorOLD.java similarity index 87% rename from plugin/Raven.SQDev.Misc/src/raven/sqdev/parser/sqf/SQFValidator.java rename to plugin/Raven.SQDev.Misc/src/raven/sqdev/parser/sqf/SQFValidatorOLD.java index 73dfcdc6..3d97e2b1 100644 --- a/plugin/Raven.SQDev.Misc/src/raven/sqdev/parser/sqf/SQFValidator.java +++ b/plugin/Raven.SQDev.Misc/src/raven/sqdev/parser/sqf/SQFValidatorOLD.java @@ -23,7 +23,7 @@ import raven.sqdev.exceptions.SQDevEditorException; import raven.sqdev.infoCollection.base.SQFCommand; import raven.sqdev.infoCollection.base.Variable; -import raven.sqdev.interfaces.ISQFParseInformation; +import raven.sqdev.interfaces.ISQFInformation; import raven.sqdev.misc.DataTypeList; import raven.sqdev.misc.EDataType; import raven.sqdev.misc.Macro; @@ -52,7 +52,8 @@ * @author Raven * */ -public class SQFValidator extends SQFBaseListener { +@Deprecated +public class SQFValidatorOLD extends SQFBaseListener { /** * The invoking state indicating that this context object has been created by @@ -61,22 +62,22 @@ public class SQFValidator extends SQFBaseListener { protected static final int CREATED_STATE = -10; /** - * The parse reult object that holds information about the parse result + * The parse result object that holds information about the parse result */ - private SQFParseResult parseResult; + private SQFParseResultOld parseResult; /** * The information that are needed in order to parse the input properly */ - private ISQFParseInformation info; + private ISQFInformation info; /** * A list of found localVariables */ - private List localVariables; + private Map localVariables; /** * A list of found global variables */ - private List globalVariables; + private Map globalVariables; /** * The respective CommonTokenStream associated with the parse tree * this listener corresponds to @@ -95,12 +96,12 @@ public class SQFValidator extends SQFBaseListener { * Creates a new instance of this validator. * * @param info - * The {@link SQFParseInformation} needed to parse the input properly + * The {@link SQFInformation} needed to parse the input properly * @param currentStream * The CommonTokenStream associated with the respective * parse tree */ - public SQFValidator(ISQFParseInformation info, BufferedTokenStream currentStream) { + public SQFValidatorOLD(ISQFInformation info, BufferedTokenStream currentStream) { this(info, null, currentStream); } @@ -108,15 +109,15 @@ public SQFValidator(ISQFParseInformation info, BufferedTokenStream currentStream * Creates a new instance of this validator. * * @param info - * The {@link SQFParseInformation} needed to parse the input properly + * The {@link SQFInformation} needed to parse the input properly * @param parseResult - * The {@link SQFParseResult} to report any parsing results to. If + * The {@link SQFParseResultOld} to report any parsing results to. If * thi is null a new one will be created * @param currentStream * The CommonTokenStream associated with the respective * parse tree */ - public SQFValidator(ISQFParseInformation info, SQFParseResult parseResult, BufferedTokenStream currentStream) { + public SQFValidatorOLD(ISQFInformation info, SQFParseResultOld parseResult, BufferedTokenStream currentStream) { Assert.isNotNull(info); Assert.isNotNull(currentStream); @@ -126,11 +127,11 @@ public SQFValidator(ISQFParseInformation info, SQFParseResult parseResult, Buffe if (parseResult != null) { this.parseResult = parseResult; } else { - this.parseResult = new SQFParseResult(); + this.parseResult = new SQFParseResultOld(); } - localVariables = new ArrayList(); - globalVariables = new ArrayList(); + localVariables = new HashMap(); + globalVariables = new HashMap(); resolvedReturnValues = new HashMap(); } @@ -160,13 +161,9 @@ public void exitAssignment(AssignmentContext ctx) { Variable variable = new Variable(variableName); if (variable.isLocal()) { - if (!localVariables.contains(variable)) { - localVariables.add(variable); - } + localVariables.put(variableName.toLowerCase(), variable); } else { - if (!globalVariables.contains(variable)) { - globalVariables.add(variable); - } + globalVariables.put(variableName.toLowerCase(), variable); } } @@ -340,15 +337,15 @@ public void exitBinaryExpression(BinaryExpressionContext ctx) { String operatorName = ctx.getChild(1).getText(); - SQFCommand operator = resolveOperator(info.getBinaryOperators(), operatorName); + SQFCommand operator = info.getBinaryOperators().get(operatorName.toLowerCase()); if (operator != null) { DataTypeList leftTypes = getReturnValues(ctx.getChild(0)); DataTypeList rightTypes = getReturnValues(ctx.getChild(2)); SQFSyntaxProcessor processor = new SQFSyntaxProcessor(operator); - processor.setLeftArgumentTypes(leftTypes.toArray()); - processor.setRightArgumentTypes(rightTypes.toArray()); + processor.setLeftArgumentTypes(leftTypes); + processor.setRightArgumentTypes(rightTypes); if (!processor.isValid()) { String errorMsg = processor.getErrorMessage(); @@ -408,13 +405,13 @@ public void exitUnaryExpression(UnaryExpressionContext ctx) { SQFSyntaxProcessor processor = new SQFSyntaxProcessor(operator); - processor.setRightArgumentTypes(argumentTypes.toArray()); + processor.setRightArgumentTypes(argumentTypes); if (!processor.isValid()) { String errorMsg = processor.getErrorMessage(); int[] offsets; - if (processor.getErrorMarkerPosition() == ERelativPosition.RIGHT) { + if (processor.getErrorMarkerPosition() == ERelativePosition.RIGHT) { // error has to be on the right argument offsets = getStartOffsetAndLength(ctx.getChild(1)); } else { @@ -435,7 +432,7 @@ public void exitUnaryExpression(UnaryExpressionContext ctx) { } } else { // check if operator is a macro - Macro macro = resolveMacro(info.getMacros(), operatorName); + Macro macro = info.getMacros().get(operatorName); if (macro != null) { resolvedReturnValues.put(ctx, new DataTypeList(EDataType.ANYTHING)); @@ -451,7 +448,7 @@ public void exitNularOperator(NularOperatorContext ctx) { String operatorName = ctx.getText(); - SQFCommand operator = resolveOperator(info.getNularOperators(), operatorName); + SQFCommand operator = info.getNularOperators().get(operatorName.toLowerCase()); if (operator == null) { if (!isDefinedMacro(operatorName) && !isDefinedLocalVariable(operatorName)) { @@ -461,7 +458,7 @@ public void exitNularOperator(NularOperatorContext ctx) { msg = ProblemMessages.undefinedLocalVariable(operatorName); } else { // must be a globl variable - globalVariables.add(new Variable(operatorName)); + globalVariables.put(operatorName.toLowerCase(), new Variable(operatorName)); } } else { msg = ProblemMessages.operatorIsNotNular(operatorName); @@ -482,29 +479,6 @@ public void exitNularOperator(NularOperatorContext ctx) { } } - /** - * Retrieves the SQFCommand out of the list that has the given - * name. The search is case-insensitive! - * - * @param commandList - * The list of commands to search through - * @param commandName - * The command name to search for - * @return The respective SQFCommand or null if none - * could be found - */ - protected SQFCommand resolveOperator(List commandList, String commandName) { - commandName = commandName.toLowerCase(); - - for (SQFCommand currentCommand : commandList) { - if (currentCommand.getKeyword().toLowerCase().equals(commandName)) { - return currentCommand; - } - } - - return null; - } - /** * Retrieves the SQFCommand out of the list that has the given * name. The search is case-insensitive! @@ -515,29 +489,20 @@ protected SQFCommand resolveOperator(List commandList, String comman * could be found */ protected SQFCommand resolveOperator(String operatorName) { - List allOperators = info.getNularOperators(); - allOperators.addAll(info.getUnaryOperators()); - allOperators.addAll(info.getBinaryOperators()); + operatorName = operatorName.toLowerCase(); - return resolveOperator(allOperators, operatorName); - } + SQFCommand command = info.getBinaryOperators().get(operatorName); + if (command != null) { + return command; + } + command = info.getUnaryOperators().get(operatorName); + if (command != null) { + return command; + } - /** - * Finds the Macro in the given list that has the given name. The - * search is case-sensitive! - * - * @param macroList - * The list of macros to search through - * @param macroName - * The name of the Macro to find - * @return The found Macro or null if none could be - * found - */ - protected Macro resolveMacro(List macroList, String macroName) { - for (Macro currentMacro : macroList) { - if (currentMacro.getKeyword().equals(macroName)) { - return currentMacro; - } + command = info.getNularOperators().get(operatorName); + if (command != null) { + return command; } return null; @@ -550,7 +515,7 @@ protected Macro resolveMacro(List macroList, String macroName) { * The macro name to search for */ protected boolean isDefinedMacro(String macroName) { - return resolveMacro(info.getMacros(), macroName) != null; + return info.getMacros().get(macroName) != null; } /** @@ -560,9 +525,7 @@ protected boolean isDefinedMacro(String macroName) { * The name to search for */ protected boolean isOperator(String operatorName) { - return resolveOperator(info.getNularOperators(), operatorName) != null - || resolveOperator(info.getUnaryOperators(), operatorName) != null - || resolveOperator(info.getBinaryOperators(), operatorName) != null; + return resolveOperator(operatorName) != null; } /** @@ -575,12 +538,10 @@ protected boolean isOperator(String operatorName) { protected boolean isDefinedLocalVariable(String varName) { varName = varName.toLowerCase(); - for (Variable currentVariable : info.getMagicVariables()) { - if (currentVariable.getKeyword().toLowerCase().equals(varName)) { - return true; - } + if (info.getMagicVariables().get(varName) != null) { + return true; } - for (Variable currentVariable : localVariables) { + for (Variable currentVariable : localVariables.values()) { if (currentVariable.getKeyword().toLowerCase().equals(varName)) { return true; } @@ -675,7 +636,7 @@ private DataTypeList doGetReturnValues(ParseTree element) { // is global variable boolean found = false; - for (Variable currentVariable : globalVariables) { + for (Variable currentVariable : globalVariables.values()) { if (currentVariable.getKeyword().toLowerCase().equals(varName)) { found = true; break; @@ -685,7 +646,7 @@ private DataTypeList doGetReturnValues(ParseTree element) { if (!found) { // assume it's declared somewhere else // TODO: potential error - globalVariables.add(new Variable(varName)); + globalVariables.put(varName.toLowerCase(), new Variable(varName)); } } } @@ -923,13 +884,15 @@ protected void extractVariableDeclaration(String operatorName, ParseTree argumen parseResult.addMarker(IMarker.PROBLEM, offsets[0], offsets[1], ProblemMessages.canOnlyDeclareLocalVariable(), IMarker.SEVERITY_ERROR); } else { - localVariables.add(new Variable(varName)); + localVariables.put(varName.toLowerCase(), new Variable(varName)); } } } } - - localVariables.addAll(declaredVariables); + + for(Variable currentVar : declaredVariables) { + localVariables.put(currentVar.getKeyword().toLowerCase(), currentVar); + } } /** @@ -982,9 +945,9 @@ private void getVariableDeclaration(TerminalNodeImpl node, List varlis /** * Gets the parse result. This implementation always returns an instance of - * {@link SQFParseResult}. + * {@link SQFParseResultOld}. */ - public SQFParseResult getParseResult() { + public SQFParseResultOld getParseResult() { return parseResult; } } diff --git a/plugin/Raven.SQDev.Misc/src/raven/sqdev/parser/sqf/tests/SQFParserTest.java b/plugin/Raven.SQDev.Misc/src/raven/sqdev/parser/sqf/tests/SQFParserTest.java index 4e3300c7..44c6c7eb 100644 --- a/plugin/Raven.SQDev.Misc/src/raven/sqdev/parser/sqf/tests/SQFParserTest.java +++ b/plugin/Raven.SQDev.Misc/src/raven/sqdev/parser/sqf/tests/SQFParserTest.java @@ -6,7 +6,9 @@ import java.util.ArrayList; import java.util.Arrays; import java.util.Collection; +import java.util.HashMap; import java.util.List; +import java.util.Map; import org.eclipse.core.resources.IMarker; import org.junit.Test; @@ -14,14 +16,15 @@ import raven.sqdev.constants.ProblemMessages; import raven.sqdev.exceptions.SQDevException; import raven.sqdev.infoCollection.base.Keyword; -import raven.sqdev.interfaces.ISQFParseInformation; +import raven.sqdev.interfaces.ISQFInformation; +import raven.sqdev.misc.DataTypeList; import raven.sqdev.misc.EDataType; import raven.sqdev.misc.FileUtil; import raven.sqdev.misc.Macro; import raven.sqdev.misc.Marker; import raven.sqdev.parser.misc.ParseUtil; -import raven.sqdev.parser.sqf.SQFParseInformation; -import raven.sqdev.parser.sqf.SQFParseResult; +import raven.sqdev.parser.sqf.SQFInformation; +import raven.sqdev.parser.sqf.SQFParseResultOld; public class SQFParserTest { @@ -35,7 +38,7 @@ public class SQFParserTest { @Test public void variableDeclarations() { - SQFParseResult result = process(getContent(VARIABLE_DECLARATION)); + SQFParseResultOld result = process(getContent(VARIABLE_DECLARATION)); // Assert that there are no errors in this file assertTrue("The file \"" + VARIABLE_DECLARATION_PATH + "\" is not expected to contain erros!", @@ -47,7 +50,7 @@ public void variableDeclarations() { "_ifVar" }; List definedLocalVariables = Arrays.asList(localVariables); - List foundLocalVariables = getKeywords(result.getDeclaredLocalVariables()); + List foundLocalVariables = getKeywords(result.getDeclaredLocalVariables().values()); if (!collectionContentEqual(definedLocalVariables, foundLocalVariables)) { StringBuilder msg = new StringBuilder("The found declarations don't match with the expected ones"); @@ -71,7 +74,7 @@ public void variableDeclarations() { // Check global variable declarations final String[] globalVariables = new String[] { "GlobalTestVar", "Implicit1", "Implicit2", "Implicit3" }; List definedGlobalVariables = Arrays.asList(globalVariables); - List foundGlobalVariables = getKeywords(result.getDeclaredGlobalVariables()); + List foundGlobalVariables = getKeywords(result.getDeclaredGlobalVariables().values()); if (!collectionContentEqual(definedGlobalVariables, foundGlobalVariables)) { StringBuilder msg = new StringBuilder("The found declarations don't match with the expected ones"); @@ -96,14 +99,16 @@ public void variableDeclarations() { @Test public void error_typeMismatch() { String input; - SQFParseResult result; + SQFParseResultOld result; Marker expectedMarker; input = "hint 3"; result = process(input); - expectedMarker = createErrorMarker(5, 1, ProblemMessages.expectedTypeButGot( - new EDataType[] { EDataType.STRING, EDataType.STRUCTURED_TEXT }, new EDataType[] { EDataType.NUMBER })); + expectedMarker = createErrorMarker(5, 1, + ProblemMessages.expectedTypeButGot( + new DataTypeList(new EDataType[] { EDataType.STRING, EDataType.STRUCTURED_TEXT }), + new DataTypeList(new EDataType[] { EDataType.NUMBER }))); // Do the checking assertMarkerAmountEquals(result, 1); assertMarkersEqual(expectedMarker, result.getMarkers().get(0)); @@ -131,13 +136,13 @@ public void error_typeMismatch() { result = process(input); expectedMarker = createErrorMarker(1, 7, ProblemMessages.expectedTypeButGot( - new EDataType[] { EDataType.NUMBER, EDataType.ARRAY, EDataType.STRING }, - new EDataType[] { EDataType.OBJECT })); + new DataTypeList(new EDataType[] { EDataType.NUMBER, EDataType.ARRAY, EDataType.STRING }), + new DataTypeList(new EDataType[] { EDataType.OBJECT }))); // Do the checking assertMarkerAmountEquals(result, 1); assertMarkersEqual(expectedMarker, result.getMarkers().get(0)); - - + + input = "'hello' + objNull"; result = process(input); expectedMarker = createErrorMarker(10, 7, @@ -145,7 +150,7 @@ public void error_typeMismatch() { // Do the checking assertMarkerAmountEquals(result, 1); assertMarkersEqual(expectedMarker, result.getMarkers().get(0)); - + input = "velocity ''"; result = process(input); expectedMarker = createErrorMarker(9, 2, @@ -154,47 +159,44 @@ public void error_typeMismatch() { assertMarkerAmountEquals(result, 1); assertMarkersEqual(expectedMarker, result.getMarkers().get(0)); } - + @Test public void error_missingSemicolon() { String input; - SQFParseResult result; + SQFParseResultOld result; Marker expectedMarker; - List macros = new ArrayList(); - macros.add(new Macro("CHECK_TRUE")); - - + Map macros = new HashMap(); + macros.put("CHECK_TRUE", new Macro("CHECK_TRUE")); + + input = "diag_log 3 hint 'hello'"; result = process(input); - expectedMarker = createErrorMarker(9, 1, - ProblemMessages.missingSemicolon("3")); + expectedMarker = createErrorMarker(9, 1, ProblemMessages.missingSemicolon("3")); // Do the checking assertMarkerAmountEquals(result, 1); assertMarkersEqual(expectedMarker, result.getMarkers().get(0)); - - + + input = "CHECK_TRUE(nsdvjJSDNV, SAKFN) diag_log 3 hint 'hello'"; result = process(input, macros); - expectedMarker = createErrorMarker(39, 1, - ProblemMessages.missingSemicolon("3")); + expectedMarker = createErrorMarker(39, 1, ProblemMessages.missingSemicolon("3")); // Do the checking assertMarkerAmountEquals(result, 1); assertMarkersEqual(expectedMarker, result.getMarkers().get(0)); - - + + input = "CHECK_TRUE(nsdvjJSDNV, SAKFN) player setPos [1,2,3] hint 'hello'"; result = process(input, macros); - expectedMarker = createErrorMarker(50, 1, - ProblemMessages.missingSemicolon("]")); + expectedMarker = createErrorMarker(50, 1, ProblemMessages.missingSemicolon("]")); // Do the checking assertMarkerAmountEquals(result, 1); assertMarkersEqual(expectedMarker, result.getMarkers().get(0)); } - + @Test public void error_unbalancedCharacterPair() { String input; - SQFParseResult result; + SQFParseResultOld result; Marker expectedMarker; @@ -204,47 +206,47 @@ public void error_unbalancedCharacterPair() { // Do the checking assertMarkerAmountEquals(result, 1); assertMarkersEqual(expectedMarker, result.getMarkers().get(0)); - - + + input = "hint '3;"; result = process(input); expectedMarker = createErrorMarker(5, 1, ProblemMessages.unclosedOpener('\'')); // Do the checking assertMarkerAmountEquals(result, 1); assertMarkersEqual(expectedMarker, result.getMarkers().get(0)); - - + + input = "hint \"3;"; result = process(input); expectedMarker = createErrorMarker(5, 1, ProblemMessages.unclosedOpener('"')); // Do the checking assertMarkerAmountEquals(result, 1); assertMarkersEqual(expectedMarker, result.getMarkers().get(0)); - + input = "hint [3;"; result = process(input); expectedMarker = createErrorMarker(5, 1, ProblemMessages.unclosedOpener('[')); // Do the checking assertMarkerAmountEquals(result, 1); assertMarkersEqual(expectedMarker, result.getMarkers().get(0)); - - + + input = "hint {3;"; result = process(input); expectedMarker = createErrorMarker(5, 1, ProblemMessages.unclosedOpener('{')); // Do the checking assertMarkerAmountEquals(result, 1); assertMarkersEqual(expectedMarker, result.getMarkers().get(0)); - - + + input = "hint '');"; result = process(input); expectedMarker = createErrorMarker(7, 1, ProblemMessages.invalidClosingCharacter(')')); // Do the checking assertMarkerAmountEquals(result, 1); assertMarkersEqual(expectedMarker, result.getMarkers().get(0)); - - + + input = "hint ''];"; result = process(input); expectedMarker = createErrorMarker(7, 1, ProblemMessages.invalidClosingCharacter(']')); @@ -281,11 +283,11 @@ protected static void assertMarkersEqual(Marker expected, Marker actual) { * Checks whether the given parseResult contains the given amount of markers * * @param result - * The {@link SQFParseResult} to check + * The {@link SQFParseResultOld} to check * @param amount * The amount of markers that are expected to be present */ - protected static void assertMarkerAmountEquals(SQFParseResult result, int amount) { + protected static void assertMarkerAmountEquals(SQFParseResultOld result, int amount) { if (result.getMarkers().size() == amount) { return; } @@ -333,11 +335,11 @@ protected static Marker createWarningMarker(int offset, int length, String msg) * @param input * The input to process * @param macros - * The list of macros that should be existant in the given input - * @return The resulting {@link SQFParseResult} + * The list of macros that should be existent in the given input + * @return The resulting {@link SQFParseResultOld} */ - protected static SQFParseResult process(String input, List macros) { - return ParseUtil.parseAndValidateSQF(input, getSQFParseInformation(macros)); + protected static SQFParseResultOld process(String input, Map macros) { + return ParseUtil.parseAndValidateSQFOld(input, getSQFParseInformation(macros)); } /** @@ -346,10 +348,10 @@ protected static SQFParseResult process(String input, List macros) { * * @param input * The input to process - * @return The resulting {@link SQFParseResult} + * @return The resulting {@link SQFParseResultOld} */ - protected static SQFParseResult process(String input) { - return process(input, new ArrayList()); + protected static SQFParseResultOld process(String input) { + return process(input, new HashMap()); } /** @@ -386,8 +388,8 @@ protected static String getContent(File file) { * @param macros * The macro-list that should be used */ - protected static ISQFParseInformation getSQFParseInformation(List macros) { - return new SQFParseInformation(macros) { + protected static ISQFInformation getSQFParseInformation(Map macros) { + return new SQFInformation(macros) { @Override protected String getKeywordContent() { try { diff --git a/plugin/Raven.SQDev.Misc/src/raven/sqdev/pluginManagement/SQDevPluginManager.java b/plugin/Raven.SQDev.Misc/src/raven/sqdev/pluginManagement/SQDevPluginManager.java index 2bf4c43c..0b764689 100644 --- a/plugin/Raven.SQDev.Misc/src/raven/sqdev/pluginManagement/SQDevPluginManager.java +++ b/plugin/Raven.SQDev.Misc/src/raven/sqdev/pluginManagement/SQDevPluginManager.java @@ -1,6 +1,7 @@ package raven.sqdev.pluginManagement; import java.util.ArrayList; +import java.util.List; import org.eclipse.core.runtime.Assert; import org.eclipse.core.runtime.Platform; @@ -10,6 +11,7 @@ import raven.sqdev.exceptions.SQDevCoreException; import raven.sqdev.exceptions.SQDevException; +import raven.sqdev.interfaces.IPluginListener; /** * An manager for all running SQDev plugins @@ -24,6 +26,11 @@ public class SQDevPluginManager { */ protected static SQDevPluginManager manager; + /** + * All plugin listeners + */ + private List pluginListeners; + /** * The list of all registered plugins */ @@ -35,6 +42,7 @@ public class SQDevPluginManager { */ private SQDevPluginManager() { pluginList = new ArrayList(); + pluginListeners = new ArrayList(0); } /** @@ -109,11 +117,11 @@ public AbstractUIPlugin get(String pluginName) { if (pluginList.size() > prevCount) { // if the count of registered plugins changed try to - // fins it again + // find it again return get(pluginName); } else { throw new SQDevException("The started plugin \"" + pluginName - + "\" has not registered to the SQDevPluginManage!"); + + "\" has not registered to the SQDevPluginManager!"); } } catch (BundleException | SQDevException e) { e.printStackTrace(); @@ -137,6 +145,11 @@ public void register(AbstractUIPlugin plugin) { if (!pluginList.contains(plugin)) { pluginList.add(plugin); } + + // notify listeners + for (IPluginListener current : pluginListeners) { + current.started(ESQDevPlugin.resolve(plugin.getBundle().getSymbolicName())); + } } /** @@ -147,5 +160,32 @@ public void register(AbstractUIPlugin plugin) { */ public void unregister(AbstractUIPlugin plugin) { pluginList.remove(plugin); + + // notify listeners + for (IPluginListener current : pluginListeners) { + current.stopped(ESQDevPlugin.resolve(plugin.getBundle().getSymbolicName())); + } + } + + /** + * Adds a plugin listener if it has not been added before + * + * @param listener + * The listener to add + */ + public void addPluginListener(IPluginListener listener) { + if (!pluginListeners.contains(listener)) { + pluginListeners.add(listener); + } + } + + /** + * Removes the given plugin listener + * + * @param listener + * The listener to remove + */ + public void removePluginListener(IPluginListener listener) { + pluginListeners.remove(listener); } } diff --git a/plugin/Raven.SQDev.Misc/src/raven/sqdev/pluginManager/SQDevPluginManager.java b/plugin/Raven.SQDev.Misc/src/raven/sqdev/pluginManager/SQDevPluginManager.java deleted file mode 100644 index d877f5b2..00000000 --- a/plugin/Raven.SQDev.Misc/src/raven/sqdev/pluginManager/SQDevPluginManager.java +++ /dev/null @@ -1,192 +0,0 @@ -package raven.sqdev.pluginManager; - -import java.util.ArrayList; -import java.util.List; - -import org.eclipse.core.runtime.Assert; -import org.eclipse.core.runtime.Platform; -import org.eclipse.ui.plugin.AbstractUIPlugin; -import org.osgi.framework.Bundle; -import org.osgi.framework.BundleException; - -import raven.sqdev.exceptions.SQDevCoreException; -import raven.sqdev.exceptions.SQDevException; -import raven.sqdev.interfaces.IPluginListener; -import raven.sqdev.pluginManagement.ESQDevPlugin; - -/** - * An manager for all running SQDev plugins - * - * @author Raven - * - */ -public class SQDevPluginManager { - - /** - * The manager instance - */ - protected static SQDevPluginManager manager; - - /** - * All plugin listeners - */ - private List pluginListeners; - - /** - * The list of all registered plugins - */ - protected ArrayList pluginList; - - /** - * Creates an SQDevPluginManager instance. It's not meant to be - * done manually - */ - private SQDevPluginManager() { - pluginList = new ArrayList(); - pluginListeners = new ArrayList(0); - } - - /** - * Gets the PluginManager holding all the references to running SQDevPlugins - * - * @return The SQDevPLuginManager - */ - public static SQDevPluginManager getManager() { - if (manager == null) { - manager = new SQDevPluginManager(); - } - - return manager; - } - - /** - * Checks if the given plugin is currently registered in this manager - * - * @param plugin - * The plugin to lok for - * @return - */ - public boolean contains(AbstractUIPlugin plugin) { - return pluginList.contains(plugin); - } - - /** - * Checks if the given plugin is currently registered in this manager - * - * @param pluginName - * The name (ID) of the plugin to searchs - * @return - */ - public boolean contains(String pluginName) { - for (AbstractUIPlugin currentPlugin : pluginList) { - if (currentPlugin.getBundle().getSymbolicName().toLowerCase() - .equals(pluginName.toLowerCase())) { - return true; - } - } - - return false; - } - - /** - * Gets the plugin with the given name (ID). If no plugin is registered and - * the name starts with "raven.sqdev" it will try to find and strat this - * plugin - * - * @param pluginName - * The name (ID) of the plugin to searchs - * @return The desired plugin or null if none is found - */ - public AbstractUIPlugin get(String pluginName) { - // search by name - for (AbstractUIPlugin currentPlugin : pluginList) { - if (currentPlugin.getBundle().getSymbolicName().toLowerCase() - .equals(pluginName.toLowerCase())) { - return currentPlugin; - } - } - - if (pluginName.toLowerCase().startsWith("raven.sqdev")) { - Bundle bundle = Platform.getBundle(pluginName); - - if (bundle != null) { - try { - int prevCount = pluginList.size(); - - // try to start the bundle - bundle.start(); - - if (pluginList.size() > prevCount) { - // if the count of registered plugins changed try to - // find it again - return get(pluginName); - } else { - throw new SQDevException("The started plugin \"" + pluginName - + "\" has not registered to the SQDevPluginManager!"); - } - } catch (BundleException | SQDevException e) { - e.printStackTrace(); - - throw new SQDevCoreException(e); - } - } - } - - return null; - } - - /** - * Registers the given plugin if it's not already registered - * - * @param plugin - */ - public void register(AbstractUIPlugin plugin) { - Assert.isNotNull(plugin); - - if (!pluginList.contains(plugin)) { - pluginList.add(plugin); - } - - // notify listeners - for (IPluginListener current : pluginListeners) { - current.started(ESQDevPlugin.resolve(plugin.getBundle().getSymbolicName())); - } - } - - /** - * Unregisters the given plugin from this manager - * - * @param plugin - * The plugin to unregister - */ - public void unregister(AbstractUIPlugin plugin) { - pluginList.remove(plugin); - - // notify listeners - for (IPluginListener current : pluginListeners) { - current.stopped(ESQDevPlugin.resolve(plugin.getBundle().getSymbolicName())); - } - } - - /** - * Adds a plugin listener if it has not been added before - * - * @param listener - * The listener to add - */ - public void addPluginListener(IPluginListener listener) { - if (!pluginListeners.contains(listener)) { - pluginListeners.add(listener); - } - } - - /** - * Removes the given plugin listener - * - * @param listener - * The listener to remove - */ - public void removePluginListener(IPluginListener listener) { - pluginListeners.remove(listener); - } -} diff --git a/plugin/Raven.SQDev.Misc/src/raven/sqdev/sqf/processing/SQFProcessor.java b/plugin/Raven.SQDev.Misc/src/raven/sqdev/sqf/processing/SQFProcessor.java new file mode 100644 index 00000000..0e70b82f --- /dev/null +++ b/plugin/Raven.SQDev.Misc/src/raven/sqdev/sqf/processing/SQFProcessor.java @@ -0,0 +1,1098 @@ +package raven.sqdev.sqf.processing; + +import java.util.ArrayList; +import java.util.Collection; +import java.util.Collections; +import java.util.HashMap; +import java.util.HashSet; +import java.util.Iterator; +import java.util.List; +import java.util.Map; + +import org.eclipse.core.resources.IMarker; +import dataStructures.ESQFOperatorType; +import dataStructures.ESQFTokentype; +import dataStructures.IBuildableIndexTree; +import dataStructures.ISQFTreeListener; +import dataStructures.ITokenSource; +import dataStructures.IndexTreeElement; +import dataStructures.SQFToken; +import raven.sqdev.constants.ProblemMessages; +import raven.sqdev.exceptions.ValidationException; +import raven.sqdev.infoCollection.base.SQFCommand; +import raven.sqdev.infoCollection.base.Variable; +import raven.sqdev.interfaces.ISQFInformation; +import raven.sqdev.interfaces.ITreeProcessingResult; +import raven.sqdev.misc.DataTypeList; +import raven.sqdev.misc.EDataType; +import raven.sqdev.parser.misc.TreeProcessingResult; +import raven.sqdev.parser.sqf.ERelativePosition; +import raven.sqdev.parser.sqf.SQFSyntaxProcessor; + +public class SQFProcessor implements ISQFTreeListener { + + /** + * A {@linkplain DataTypeList} containing the datatype ANYTHING + */ + public static final DataTypeList ANYTHING = new DataTypeList(EDataType.ANYTHING); + /** + * A {@linkplain DataTypeList} containing the datatype CODE + */ + public static final DataTypeList CODE = new DataTypeList(EDataType.CODE); + /** + * A {@linkplain DataTypeList} containing the datatype ARRAY + */ + public static final DataTypeList ARRAY = new DataTypeList(EDataType.ARRAY); + /** + * A {@linkplain DataTypeList} containing the datatype STRING + */ + public static final DataTypeList STRING = new DataTypeList(EDataType.STRING); + /** + * A {@linkplain DataTypeList} containing the datatype NUMBER + */ + public static final DataTypeList NUMBER = new DataTypeList(EDataType.NUMBER); + + /** + * The buffer holding all tokens + */ + protected ITokenSource tokenBuffer; + /** + * The object containing all results of parsing and validating + */ + protected TreeProcessingResult result; + /** + * The set of so far declared variables. All names are in lowercase + */ + protected HashSet declaredVariables; + /** + * The object holding all necessary meta-information + */ + protected ISQFInformation sqfInformation; + /** + * A map of all resolved return values + */ + protected Map resolvedReturnValues; + /** + * The {@linkplain SQFSyntaxProcessor} to use internally + */ + protected SQFSyntaxProcessor syntaxProcessor; + + + /** + * Creates a new instance of this processor + * + * @param info + * The {@linkplain ISQFInformation} holding all necessary meta + * information about the available commands + * @param result + * The {@linkplain TreeProcessingResult} to put all results of this + * processing to + * @param tokenBuffer + * The buffer holding all tokens to the tree that is going to be + * processed + */ + public SQFProcessor(ISQFInformation info, TreeProcessingResult result, ITokenSource tokenBuffer) { + assert (info != null); + assert (result != null); + assert (tokenBuffer != null); + + declaredVariables = new HashSet<>(); + this.result = result; + this.sqfInformation = info; + this.tokenBuffer = tokenBuffer; + resolvedReturnValues = new HashMap<>(); + syntaxProcessor = new SQFSyntaxProcessor(); + } + + @Override + public void nularExpression(SQFToken expression, IndexTreeElement node) { + assert (expression.operatorType() != ESQFOperatorType.MACRO); + + switch (expression.type()) { + case ID: + case OPERATOR: + // process operators or variables only + break; + default: + return; + } + + final String operatorName = expression.getText(); + final String operatorNameLower = operatorName.toLowerCase(); + final SQFCommand operator = sqfInformation.getNularOperators().get(operatorNameLower); + + if (!declaredVariables.contains(operatorName.toLowerCase()) + && !sqfInformation.getMagicVariables().keySet().contains(operatorNameLower)) { + if (operatorName.startsWith("_")) { + // it is an unknown local variable -> error + error(expression, ProblemMessages.undefinedLocalVariable(operatorName)); + + // assume any type for variables + resolvedReturnValues.put(node, ANYTHING); + return; + } else { + if (operator == null && expression.type() == ESQFTokentype.ID) { + // this is an implicitly declared global variable + // TODO: potential error + declaredVariables.add(operatorName.toLowerCase()); + + // assume any type for variables + resolvedReturnValues.put(node, ANYTHING); + return; + } + } + } else { + // assume any type for variables + resolvedReturnValues.put(node, ANYTHING); + return; + } + + if (operator == null) { + // assume any type for erroneous input + error(expression, ProblemMessages.operatorIsNotNular(operatorName)); + + resolvedReturnValues.put(node, ANYTHING); + } else { + resolvedReturnValues.put(node, operator.getAllReturnTypes()); + } + } + + @Override + public void unaryExpression(SQFToken expression, IndexTreeElement node) { + assert (expression.operatorType() != ESQFOperatorType.MACRO); + assert (node.getChildrenCount() == 1); + + final String operatorName = expression.getText(); + final String operatorNameLower = operatorName.toLowerCase(); + SQFCommand operator = sqfInformation.getUnaryOperators().get(operatorNameLower); + if (operator == null) { + // might be a binary operator used in unary syntax + operator = sqfInformation.getBinaryOperators().get(operatorNameLower); + } + + if (operatorNameLower.equals("private")) { + // handle private separately + handlePrivate(node.getChildren().get(0)); + return; + } + + if (operator == null) { + // if it's still null then this is not a unary operator + error(expression, ProblemMessages.operatorIsNotUnary(operatorName)); + + // assume any type for erroneous input + resolvedReturnValues.put(node, ANYTHING); + + return; + } + + if (!operator.isUnaryOperator()) { + // This operator can't be used in a unary way + error(expression, ProblemMessages.operatorIsNotUnary(operator.getKeyword())); + return; + } + + // check whether the given argument is of a valid type + syntaxProcessor.reset(); + syntaxProcessor.setOperator(operator); + syntaxProcessor.setRightArgumentTypes(getReturnValues(node.getChildren().get(0))); + + // buffer return value for this node + resolvedReturnValues.put(node, syntaxProcessor.getReturnValues()); + + if (!syntaxProcessor.isValid()) { + if (syntaxProcessor.getErrorMarkerPosition() == ERelativePosition.RIGHT) { + error(node.getChildren().get(0), syntaxProcessor.getErrorMessage()); + } else { + error(expression, syntaxProcessor.getErrorMessage()); + } + } else { + // check for special cases in which a variable-name extraction has to be + // performed + switch (operatorNameLower) { + case "params": + handleParams(node.getChildren().get(0)); + break; + + case "for": + handleFor(node.getChildren().get(0)); + break; + } + } + } + + @Override + public void binaryExpression(SQFToken expression, IndexTreeElement node) { + final String operatorName = expression.getText(); + + switch (operatorName.toLowerCase()) { + case "=": + // assignment + assignment(node); + break; + + default: + // "normal" binary operator + SQFCommand operator = sqfInformation.getBinaryOperators().get(operatorName.toLowerCase()); + + if (operator != null) { + DataTypeList leftTypes = getReturnValues(node.getChildren().get(0)); + DataTypeList rightTypes = getReturnValues(node.getChildren().get(1)); + + syntaxProcessor.reset(); + syntaxProcessor.setOperator(operator); + syntaxProcessor.setLeftArgumentTypes(leftTypes); + syntaxProcessor.setRightArgumentTypes(rightTypes); + + if (!syntaxProcessor.isValid()) { + int[] positionData; + + try { + switch (syntaxProcessor.getErrorMarkerPosition()) { + case CENTER: + positionData = new int[] { expression.start(), expression.length() }; + break; + case LEFT: + positionData = getNodeDimension(node.getChildren().get(0)); + break; + case RIGHT: + positionData = getNodeDimension(node.getChildren().get(1)); + break; + case NONE: + default: + positionData = new int[] { 0, 0 }; + error(node, ProblemMessages.internalError()); + System.err.println("Unexpected marker position for binary expression"); + // TODO: log + } + } catch (ValidationException e) { + e.printStackTrace(); + positionData = new int[] { 0, 0 }; + error(node, ProblemMessages.internalError()); + } + + error(positionData[0], positionData[1], syntaxProcessor.getErrorMessage()); + } + + // map the resolved processor to the respective node + resolvedReturnValues.put(node, syntaxProcessor.getReturnValues()); + + if (operatorName.toLowerCase().equals("params")) { + handleParams(node.getChildren().get(1)); + } + } else { + // apparently it is not a binary operator -> shouldn't even be reachable + error(expression, ProblemMessages.operatorIsNotBinary(operatorName)); + } + + break; + } + } + + @Override + public void array(IndexTreeElement node) { + // check whether all array elements are separated by a comma + + boolean wasComma = true; + int lastTokenIndex = node.getChildren().get(node.getChildrenCount() - 1).getIndex(); + // If the last token is the closing bracket, don't iterate over it (if not an + // error should occur somewhere else) + int length = (lastTokenIndex >= 0 + && tokenBuffer.get(lastTokenIndex).type() == ESQFTokentype.SQUARE_BRACKET_CLOSE) + ? node.getChildrenCount() - 1 + : node.getChildrenCount(); + + for (int i = 1; i < length; i++) { + IndexTreeElement element = node.getChildren().get(i); + + if (wasComma) { + if (element.getIndex() >= 0 && (tokenBuffer.get(element.getIndex()).type() == ESQFTokentype.COMMA + || tokenBuffer.get(element.getIndex()).type() == ESQFTokentype.SEMICOLON)) { + // two commas next to each other or a semicolon -> invalid + error(element, ProblemMessages.misplacedToken(",")); + } + wasComma = false; + } else { + // this element has to be a comma or the closing square bracket + if (element.getIndex() < 0 || tokenBuffer.get(element.getIndex()).type() != ESQFTokentype.COMMA) { + // missing comma + SQFToken lastToken = getLastToken(node.getChildren().get(i - 1)); + error(lastToken, ProblemMessages.missingComma(lastToken.getText())); + } else { + wasComma = true; + } + } + } + + if (wasComma && node.getChildrenCount() > 2) { + // The last token in the array before the closing bracket was a comma -> error + error(node.getChildren().get(node.getChildrenCount() - 2), ProblemMessages.misplacedToken(",")); + } + } + + @Override + public void code(IndexTreeElement node) { + checkSemicolons(node.getChildren()); + } + + @Override + public void start(IBuildableIndexTree tree) { + checkSemicolons(tree.branches()); + } + + @Override + public void finished(IBuildableIndexTree tree) { + // add all found variables to the result + Iterator varIterator = declaredVariables.iterator(); + + while (varIterator.hasNext()) { + Variable var = new Variable(varIterator.next()); + + if (var.isLocal()) { + result.getDeclaredLocalVariables().put(var.getKeyword(), var); + } else { + result.getDeclaredGlobalVariables().put(var.getKeyword(), var); + } + } + } + + /** + * Checks whether semicolons are provided where needed and issues errors if this + * is not the case + * + * @param nodes + * The collection of nodes representing the code-elements + */ + protected void checkSemicolons(Collection nodes) { + boolean wasStatement = false; + IndexTreeElement prevNode = null; + + for (IndexTreeElement currentNode : nodes) { + if (currentNode.getIndex() < 0) { + // it's definitely a statement + wasStatement = true; + } else { + SQFToken currentToken = tokenBuffer.get(currentNode.getIndex()); + + boolean isStatement = currentToken.operatorType() != ESQFOperatorType.OTHER + && currentToken.type() != ESQFTokentype.SEMICOLON; + + if (wasStatement && isStatement) { + // there should have been a semicolon in between + assert (prevNode != null); + SQFToken lastToken = getLastToken(prevNode); + error(lastToken, ProblemMessages.missingSemicolon(lastToken.getText())); + } + + wasStatement = isStatement && currentToken.operatorType() != ESQFOperatorType.MACRO; + + prevNode = currentNode; + } + } + } + + /** + * This method processes any occurring assignments done by the "=" operator + * + * @param node + * The parse tree node of the assignment. The two children are + * considered to be assignment arguments (there have to be two!) + */ + protected void assignment(IndexTreeElement node) { + assert (node.getChildrenCount() == 2); + + IndexTreeElement variableNode = node.getChildren().get(0); + + boolean isPrivate = variableNode.hasChildren(); + + if (isPrivate) { + int index = variableNode.getIndex(); + + if (index < 0) { + // The assignment is corrupted + error(variableNode, ProblemMessages.invalidExpression("assignment")); + } + + SQFToken varOperatorToken = tokenBuffer.get(index); + + if (varOperatorToken.operatorType() == ESQFOperatorType.MACRO) { + // handle macros assembling the variable name -> can't really validate -> assume + // it's valid + declaredVariables.add(getFullText(variableNode)); + // abort as other checks and routines don't apply to macros + return; + } + + if (!varOperatorToken.getText().toLowerCase().equals("private")) { + // only private is allowed as a modifier + error(tokenBuffer.get(node.getIndex()), ProblemMessages.privateIsOnlyValidModifierForAssignments()); + + // assume for the moment that the modifier came here by accident + isPrivate = false; + } + + variableNode = variableNode.getChildren().get(0); + + if (variableNode.getIndex() < 0) { + // something's really f*cked up + error(node.getChildren().get(0), ProblemMessages.internalError()); + + return; + } + } + + String varName = tokenBuffer.get(variableNode.getIndex()).getText(); + if (isPrivate && !varName.startsWith("_")) { + // don't add global, private variables + // The error is produced as soon as the unary private keyword is being processed + return; + } + if (!isOperatorName(varName)) { + declaredVariables.add(varName.toLowerCase()); + } else { + error(tokenBuffer.get(variableNode.getIndex()), ProblemMessages.reservedKeyword(varName)); + } + } + + /** + * Adds a new error marker to {@link #result} + * + * @param start + * The starting offset of the error area + * @param length + * The length of the error area + * @param message + * The problem message + */ + protected void error(int start, int length, String message) { + addProblemMarker(IMarker.SEVERITY_ERROR, start, length, message); + } + + /** + * Adds a new error marker to {@link #result} + * + * @param token + * The token corresponding to the error + * @param message + * The problem message + */ + protected void error(SQFToken token, String message) { + addProblemMarker(IMarker.SEVERITY_ERROR, token, message); + } + + /** + * Adds a new error marker to {@link #result} + * + * @param node + * The tree node corresponding to the error + * @param message + * The problem message + */ + protected void error(IndexTreeElement node, String message) { + addProblemMarker(IMarker.SEVERITY_ERROR, node, message); + } + + /** + * Adds a new warning marker to {@link #result} + * + * @param start + * The starting offset of the warning area + * @param length + * The length of the warning area + * @param message + * The problem message + */ + protected void warning(int start, int length, String message) { + addProblemMarker(IMarker.SEVERITY_WARNING, start, length, message); + } + + /** + * Adds a new warning marker to {@link #result} + * + * @param token + * The token corresponding to the warning + * @param message + * The problem message + */ + protected void warning(SQFToken token, String message) { + addProblemMarker(IMarker.SEVERITY_WARNING, token, message); + } + + /** + * Adds a new warning marker to {@link #result} + * + * @param node + * The tree node corresponding to the warning + * @param message + * The problem message + */ + protected void warning(IndexTreeElement node, String message) { + addProblemMarker(IMarker.SEVERITY_WARNING, node, message); + } + + /** + * Adds a new info marker to {@link #result} + * + * @param start + * The starting offset of the info area + * @param length + * The length of the info area + * @param message + * The problem message + */ + protected void info(int start, int length, String message) { + addProblemMarker(IMarker.SEVERITY_INFO, start, length, message); + } + + /** + * Adds a new info marker to {@link #result} + * + * @param token + * The token corresponding to the info + * @param message + * The problem message + */ + protected void info(SQFToken token, String message) { + addProblemMarker(IMarker.SEVERITY_INFO, token, message); + } + + /** + * Adds a new info marker to {@link #result} + * + * @param node + * The tree node corresponding to the info + * @param message + * The problem message + */ + protected void info(IndexTreeElement node, String message) { + addProblemMarker(IMarker.SEVERITY_INFO, node, message); + } + + /** + * Adds a new problem marker to {@link #result} + * + * @param severity + * The severity of the marker to be created. See {@linkplain IMarker} + * for the respective constants + * @param start + * The starting offset of the problem area + * @param length + * The length of the problem area + * @param message + * The problem message + */ + protected void addProblemMarker(int severity, int start, int length, String message) { + result.createMarker(IMarker.PROBLEM, start, length, message, severity); + } + + /** + * Adds a new problem marker to {@link #result} + * + * @param severity + * The severity of the marker to be created. See {@linkplain IMarker} + * for the respective constants + * @param token + * The token corresponding to the problem + * @param message + * The problem message + */ + protected void addProblemMarker(int severity, SQFToken token, String message) { + addProblemMarker(severity, token.start(), token.length(), message); + } + + /** + * Adds a new problem marker to {@link #result}. This method will consider the + * whole dimension of the given node as the problem area + * + * @param severity + * The severity of the marker to be created. See {@linkplain IMarker} + * for the respective constants + * @param node + * The tree node corresponding to the problem + * @param message + * The problem message + */ + protected void addProblemMarker(int severity, IndexTreeElement node, String message) { + // verify that the given indexTreeElement has a corresponding token + int[] dimension; + try { + dimension = getNodeDimension(node); + } catch (ValidationException e) { + e.printStackTrace(); + dimension = new int[] { 0, 0 }; + message = "Error on invalid tree node: " + message; + } + + addProblemMarker(severity, dimension[0], dimension[1], message); + } + + /** + * Gets a node's dimension which is the text area from the start of the token + * associated leftmost child-node and the end of the token associated with the + * rightmost child-node. If this node doesn't have children the token associated + * with this node is used in order to determine the node's dimension. + * + * @param node + * The node whose dimension should be obtained + * @return The dimension of the node in form of a 2D array: [start, length] + * @throws ValidationException + * If asked to determine the dimension of an invalid node + */ + protected int[] getNodeDimension(IndexTreeElement node) throws ValidationException { + if (!node.hasChildren()) { + int index = node.getIndex(); + + if (index < 0) { + throw new ValidationException("Failed at getting node dimension!"); + } + + SQFToken token = tokenBuffer.get(node.getIndex()); + + return new int[] { token.start(), token.length() }; + } + + // use the left- and rightmost child in order to determine the dimension + return new int[] { getNodeDimension(node.getChildren().get(0))[0], + getNodeDimension(node.getChildren().get(node.getChildrenCount() - 1))[1] }; + } + + /** + * Gets the possible return values of the given node. Calling this method will + * trigger the return-value-buffering which means that it will populate + * {@link #resolvedReturnValues} if there is no entry for the given node yet. If + * there is the previously determined return values will be returned + * + * @param node + * The node whose return values are to be determined + * @return The list of return values + */ + protected DataTypeList getReturnValues(IndexTreeElement node) { + // Check whether the return value for that node has already been determined -> + // Especially used for context sensitive return values of operators + if (!resolvedReturnValues.containsKey(node)) { + resolvedReturnValues.put(node, doGetReturnValues(node)); + } + + return resolvedReturnValues.get(node); + } + + /** + * Gets all the possible return values of the given node. Calling this method + * directly will bypass the return-value-buffering system + * + * @param node + * The node whose return values are to be determined + * @return The list of return values + */ + protected DataTypeList doGetReturnValues(IndexTreeElement node) { + if (node.getIndex() >= 0) { + SQFToken token = tokenBuffer.get(node.getIndex()); + + // handle primitives first + switch (token.type()) { + case CURLY_BRACKET_OPEN: + return CODE; + case ERROR_TOKEN: + return ANYTHING; + case NUMBER: + return NUMBER; + case SQUARE_BRACKET_OPEN: + return ARRAY; + case STRING: + return STRING; + case SUBSTRING: + return STRING; + default: + // do nothing -> will be handled below + } + + switch (token.operatorType()) { + case MACRO: + return ANYTHING; + case BINARY: + SQFCommand operator = sqfInformation.getBinaryOperators().get(token.getText().toLowerCase()); + if (operator == null) { + // If it is not recognized it will be handled elsewhere + return ANYTHING; + } else { + return operator.getAllReturnTypes(); + } + case NULAR: + operator = sqfInformation.getNularOperators().get(token.getText().toLowerCase()); + if (operator == null) { + // If it is not recognized it will be handled elsewhere + return ANYTHING; + } else { + return operator.getAllReturnTypes(); + } + case UNARY: + operator = sqfInformation.getUnaryOperators().get(token.getText().toLowerCase()); + if (operator == null) { + // If it is not recognized it will be handled elsewhere + return ANYTHING; + } else { + return operator.getAllReturnTypes(); + } + default: + // Shouldn't get reached + error(node, ProblemMessages.internalError()); + return ANYTHING; + } + } else { + if (node.hasChildren()) { + return getReturnValues(node.getChildren().get(0)); + } else { + // Shouldn't get reached + error(node, ProblemMessages.internalError()); + return ANYTHING; + } + } + } + + /** + * Gets the full text of a {@linkplain IndexTreeElement} which is the text of + * all its associated tokens + * + * @param node + * The node whose text should be obtained + * @return The text corresponding to the given node + */ + protected String getFullText(IndexTreeElement node) { + StringBuilder builder = new StringBuilder(); + + Collection indices = new ArrayList<>(); + getAllTokenIndices(node, indices); + + indices.stream().filter((e) -> { + return e.intValue() >= 0; + }).sorted().forEach((element) -> builder.append(tokenBuffer.get(element.intValue()).getText())); + + return builder.toString(); + } + + /** + * Gets all token indices associated with the given node and its sub-nodes + * + * @param node + * The node to process + * @param indices + * An integer collection to store the indices in + */ + protected void getAllTokenIndices(IndexTreeElement node, Collection indices) { + indices.add(node.getIndex()); + + if (node.hasChildren()) { + node.getChildren().forEach((e) -> getAllTokenIndices(e, indices)); + } + } + + /** + * Handles the argument of the "private" operator/keyword + * + * @param node + * The {@linkplain IndexTreeElement} corresponding to the argument of + * "private" (or the ID of the variable private was used as a keyword + * for) + */ + protected void handlePrivate(IndexTreeElement node) { + assert (node.getIndex() != IndexTreeElement.INVALID); + + if (node.getIndex() < 0) { + // the argument has to be an array of variable names + if (!node.hasChildren()) { + error(node, ProblemMessages.invalidExpression("private-array")); + return; + } + + // iterate through all children and extract declared variables + for (IndexTreeElement currentElement : node.getChildren()) { + if (currentElement.getIndex() < 0) { + error(currentElement, ProblemMessages.invalidExpression("private-array")); + } else { + SQFToken varToken = tokenBuffer.get(currentElement.getIndex()); + + if (varToken.type() != ESQFTokentype.STRING) { + if (varToken.type() != ESQFTokentype.COMMA + && varToken.type() != ESQFTokentype.SQUARE_BRACKET_OPEN + && varToken.type() != ESQFTokentype.SQUARE_BRACKET_CLOSE) { + // comma and square brackets are obviously allowed in an array + error(varToken, ProblemMessages.invalidExpression("private-array-element")); + } + } else { + extractVariableFromString(varToken, varToken.getText(), true); + } + } + } + } else { + // the argument is either a String containing a variable name or an ID + SQFToken argToken = tokenBuffer.get(node.getIndex()); + + if (argToken.type() == ESQFTokentype.STRING) { + extractVariableFromString(argToken, argToken.getText(), true); + } else { + if (argToken.type() == ESQFTokentype.ID) { + String varName = argToken.getText(); + + if (!varName.startsWith("_")) { + error(argToken, ProblemMessages.privateVariablesMustBeLocal()); + return; + } + + if (!isOperatorName(varName)) { + declaredVariables.add(varName.toLowerCase()); + } else { + error(argToken, ProblemMessages.reservedKeyword(varName)); + } + } else { + error(argToken, ProblemMessages.invalidExpression("private")); + } + } + } + } + + /** + * Handles the argument of the "for"-keyword. This method assumes that it has + * already been assured that the respective argument is either of type array or + * of type String + * + * @param arg + * The respective {@linkplain IndexTreeElement} corresponding to the + * argument of a "for" operator + */ + protected void handleFor(IndexTreeElement arg) { + if (arg.getIndex() < 0) { + // it's the array syntax (has been validated before to assure that it is the + // correct type) + + if (!arg.hasChildren()) { + error(arg, ProblemMessages.internalError()); + } + + boolean wasComma = true; + int elements = 0; + + for (int i = 1; i < arg.getChildrenCount() - 1; i++) { + IndexTreeElement currentElement = arg.getChildren().get(i); + + if (wasComma) { + // validate that all elements are of type code + DataTypeList types = getReturnValues(currentElement); + if (types != CODE) { + error(currentElement, ProblemMessages.expectedTypeButGot(CODE, types)); + } + + elements++; + wasComma = false; + } else { + wasComma = true; + } + + } + + if (elements != 3) { + error(arg, ProblemMessages.expectedArrayLength(3, elements)); + } + } else { + // it's the string-syntax (has been validated before to assure that it is the + // correct type) + SQFToken token = tokenBuffer.get(arg.getIndex()); + extractVariableFromString(token, token.getText(), true); + } + } + + /** + * Handles the argument of the "params"-operator. This method assumes that it + * has already been assured that the respective argument is of type array. + * + * @param arg + * The respective {@linkplain IndexTreeElement} corresponding to the + * argument of a "params" operator + */ + protected void handleParams(IndexTreeElement arg) { + assert (arg.hasChildren()); + + for (IndexTreeElement currentChild : arg.getChildren()) { + if (currentChild.getIndex() >= 0 + && tokenBuffer.get(currentChild.getIndex()).operatorType() == ESQFOperatorType.OTHER) { + // skip brackets and commas + continue; + } + + if (currentChild.getIndex() < 0) { + // array syntax + if (!currentChild.hasChildren()) { + error(currentChild, ProblemMessages.internalError()); + continue; + } + handleParamsArray(currentChild); + } else { + // String syntax + SQFToken stringToken = tokenBuffer.get(currentChild.getIndex()); + + if (stringToken.type() != ESQFTokentype.STRING) { + error(stringToken, ProblemMessages.expectedTypeButGot(STRING, getReturnValues(currentChild))); + } else { + if (stringToken.getText().length() > 2) { + // empty strings are allowed in this context but there is no variable to extract + // from them + extractVariableFromString(stringToken, stringToken.getText(), true); + } + } + } + } + } + + /** + * Processes the sub-array-construct that may appear inside the argument-array + * of the "params"-operator + * + * @param array + * The sub-array to process + */ + protected void handleParamsArray(IndexTreeElement array) { + if (array.getChildrenCount() < 5) { + error(array, ProblemMessages.expectedMinimumArrayLength(2, (array.getChildrenCount() - 1) / 2)); + return; + } + + if (array.getChildrenCount() > 9) { + error(array, ProblemMessages.expectedMaximalArrayLength(4, (array.getChildrenCount() - 1) / 2)); + return; + } + + for (int i = 1; i < array.getChildrenCount() - 1; i++) { + IndexTreeElement currentElement = array.getChildren().get(i); + + if (currentElement.getIndex() > 0) { + if (tokenBuffer.get(currentElement.getIndex()).operatorType() == ESQFOperatorType.OTHER) { + // skip commas + continue; + } + } + + DataTypeList types = getReturnValues(currentElement); + + switch (i) { + case 1: + // first element has to be a String + if (types.findExchangableDataType(EDataType.STRING, true) < 0) { + error(currentElement, ProblemMessages.expectedTypeButGot(STRING, types)); + } else { + SQFToken varToken = tokenBuffer.get(currentElement.getIndex()); + extractVariableFromString(varToken, varToken.getText(), true); + } + break; + case 3: + // second element can be anything + break; + case 5: + // third element (if present) has to be an array + if (types.findExchangableDataType(EDataType.ARRAY, true) < 0) { + error(currentElement, ProblemMessages.expectedTypeButGot(ARRAY, types)); + } + break; + case 7: + // forth element (if present) can either be an array or a number + if (types.findExchangableDataType(EDataType.ARRAY, true) < 0 + && types.findExchangableDataType(EDataType.NUMBER, true) < 0) { + error(currentElement, ProblemMessages.expectedTypeButGot( + new DataTypeList(new EDataType[] { EDataType.NUMBER, EDataType.ARRAY }), types)); + } + break; + } + } + } + + /** + * Extracts a variable from a String as it occurs with private, params and for + * + * @param token + * The token corresponding to said String + * @param varString + * The string containing the variable name. Its first and last + * character will be removed in order to "destringify" it + * @param mustBePrivate + * Whether the extracted variable is expected to be a private + * variable + */ + protected void extractVariableFromString(SQFToken token, String varString, boolean mustBePrivate) { + // remove quotes + varString = varString.substring(1, varString.length() - 1); + + if (varString.contains(" ")) { + error(token, ProblemMessages.variableMayNotContainBlank()); + return; + } + + if (varString.isEmpty()) { + error(token, ProblemMessages.stringMayNotBeEmpty()); + return; + } + + if (mustBePrivate && !varString.startsWith("_")) { + error(token, ProblemMessages.canOnlyDeclareLocalVariable()); + return; + } + + if (!isOperatorName(varString)) { + declaredVariables.add(varString.toLowerCase()); + } else { + error(token, ProblemMessages.reservedKeyword(varString)); + } + } + + /** + * Checks whether the given name corresponds to an operator-keyword + * + * @param name + * The name to check. It will be transformed to lowercase + * automatically + */ + protected boolean isOperatorName(String name) { + name = name.toLowerCase(); + return sqfInformation.getBinaryOperators().containsKey(name) + || sqfInformation.getUnaryOperators().containsKey(name) + || sqfInformation.getNularOperators().containsKey(name); + } + + /** + * Gets the token with the lowest index in the given node + * + * @param node + * The node to search for the respective token + * @return The leftmost token + */ + protected SQFToken getFirstToken(IndexTreeElement node) { + List indices = new ArrayList<>(); + + getAllTokenIndices(node, indices); + + Collections.sort(indices); + + return tokenBuffer.get(indices.get(0)); + } + + /** + * Gets the token with the highest index in the given node + * + * @param node + * The node to search for the respective token + * @return The rightmost token + */ + protected SQFToken getLastToken(IndexTreeElement node) { + List indices = new ArrayList<>(); + + getAllTokenIndices(node, indices); + + Collections.sort(indices); + + return tokenBuffer.get(indices.get(indices.size() - 1)); + } + + /** + * Gets the result of this validation + */ + public ITreeProcessingResult getResult() { + return result; + } +} diff --git a/plugin/Raven.SQDev.Misc/src/raven/sqdev/sqf/processing/tests/BinaryExpressions.sqf b/plugin/Raven.SQDev.Misc/src/raven/sqdev/sqf/processing/tests/BinaryExpressions.sqf new file mode 100644 index 00000000..ea93b8e4 --- /dev/null +++ b/plugin/Raven.SQDev.Misc/src/raven/sqdev/sqf/processing/tests/BinaryExpressions.sqf @@ -0,0 +1 @@ +player setPos [0,0,0]; \ No newline at end of file diff --git a/plugin/Raven.SQDev.Misc/src/raven/sqdev/sqf/processing/tests/EncounteredFalsePositives.sqf b/plugin/Raven.SQDev.Misc/src/raven/sqdev/sqf/processing/tests/EncounteredFalsePositives.sqf new file mode 100644 index 00000000..67b9aed4 --- /dev/null +++ b/plugin/Raven.SQDev.Misc/src/raven/sqdev/sqf/processing/tests/EncounteredFalsePositives.sqf @@ -0,0 +1,17 @@ +// { +// [str getPos (_x select 0), getPos (_x select 0), "mil_dot", "ColorYellow", ""] call ENGIMA_CIVILIANS_SetDebugMarkerAllClients; +// } foreach _playerBuildingsTemp; + +CHECK_FALSE(isNil "_type", Invalid eventType!, {}) + +DEBUG_EXEC(EVENT_LOG(fired - %1, str _type)) + +ASL_Is_Supported_Cargo = { + params ["_vehicle","_cargo"]; + private ["_canSling"]; + _canSling = false; + if(not isNull _vehicle && not isNull _cargo) then { + + }; + _canSling; +}; \ No newline at end of file diff --git a/plugin/Raven.SQDev.Misc/src/raven/sqdev/sqf/processing/tests/SQFProcessingTest.java b/plugin/Raven.SQDev.Misc/src/raven/sqdev/sqf/processing/tests/SQFProcessingTest.java new file mode 100644 index 00000000..49e951cf --- /dev/null +++ b/plugin/Raven.SQDev.Misc/src/raven/sqdev/sqf/processing/tests/SQFProcessingTest.java @@ -0,0 +1,959 @@ +package raven.sqdev.sqf.processing.tests; + +import static org.junit.Assert.*; + +import java.io.ByteArrayInputStream; +import java.io.File; +import java.io.FileInputStream; +import java.io.IOException; +import java.util.HashMap; +import java.util.Iterator; +import java.util.Map; + +import org.junit.Before; +import org.junit.Test; + +import dataStructures.AbstractSQFTokenFactory; +import raven.sqdev.constants.ProblemMessages; +import raven.sqdev.exceptions.SQDevException; +import raven.sqdev.interfaces.ISQFParseSupplier; +import raven.sqdev.interfaces.ITreeProcessingResult; +import raven.sqdev.misc.DataTypeList; +import raven.sqdev.misc.EDataType; +import raven.sqdev.misc.FileUtil; +import raven.sqdev.misc.Macro; +import raven.sqdev.misc.Marker; +import raven.sqdev.parser.misc.ParseUtil; +import raven.sqdev.parser.misc.SQFTokenFactory; +import raven.sqdev.parser.sqf.SQFInformation; + +public class SQFProcessingTest { + + public static final File KEYWORD_FILE = new File( + makeOSCompatible(System.getProperty("user.dir") + "/resources/sqf/SQFKeywords.txt")); + + protected static SQFInformation info; + protected static ISQFParseSupplier supplier; + protected static Map macros; + + @Before + public void setUp() throws Exception { + macros = new HashMap(); + + info = getSQFInformation(macros); + SQFTokenFactory factory = new SQFTokenFactory(info.getBinaryKeywords(), info.getUnaryKeywords()); + factory.initialize(); + + supplier = new ISQFParseSupplier() { + + @Override + public AbstractSQFTokenFactory getTokenFactory() { + return factory; + } + + @Override + public Map getMacros() { + return macros; + } + }; + } + + @Test + public void semicolons() throws IOException { + ITreeProcessingResult result = ParseUtil + .parseAndProcessSQF(new ByteArrayInputStream("player; hint ''".getBytes()), supplier, info); + assertTrue(result.getDeclaredGlobalVariables().size() == 0); + assertTrue(result.getDeclaredLocalVariables().size() == 0); + assertTrue(result.getMarkers().size() == 0); + + result = ParseUtil.parseAndProcessSQF( + new ByteArrayInputStream("player setPos getPos leader group player".getBytes()), supplier, info); + assertTrue(result.getDeclaredGlobalVariables().size() == 0); + assertTrue(result.getDeclaredLocalVariables().size() == 0); + assertTrue(result.getMarkers().size() == 0); + + result = ParseUtil.parseAndProcessSQF( + new ByteArrayInputStream("player setPos getPos leader group player; private _i = 4".getBytes()), + supplier, info); + assertTrue(result.getDeclaredGlobalVariables().size() == 0); + assertTrue(result.getDeclaredLocalVariables().size() == 1); + assertTrue(result.getMarkers().size() == 0); + + macros.put("CHECK", new Macro("CHECK")); + + result = ParseUtil.parseAndProcessSQF(new ByteArrayInputStream("CHECK hint \"Test\"".getBytes()), supplier, + info); + assertTrue(result.getDeclaredGlobalVariables().size() == 0); + assertTrue(result.getDeclaredLocalVariables().size() == 0); + assertTrue(result.getMarkers().size() == 0); + + result = ParseUtil.parseAndProcessSQF( + new ByteArrayInputStream("CHECK(some stuff in here) hint \"Test\"".getBytes()), supplier, info); + assertTrue(result.getDeclaredGlobalVariables().size() == 0); + assertTrue(result.getDeclaredLocalVariables().size() == 0); + assertTrue(result.getMarkers().size() == 0); + + result = ParseUtil.parseAndProcessSQF( + new ByteArrayInputStream("CHECK(some, ;stuff in hint str player) hint \"Test\"".getBytes()), supplier, + info); + assertTrue(result.getDeclaredGlobalVariables().size() == 0); + assertTrue(result.getDeclaredLocalVariables().size() == 0); + assertTrue(result.getMarkers().size() == 0); + + result = ParseUtil.parseAndProcessSQF( + new ByteArrayInputStream("CHECK(some stuff in here); hint \"Test\"".getBytes()), supplier, info); + assertTrue(result.getDeclaredGlobalVariables().size() == 0); + assertTrue(result.getDeclaredLocalVariables().size() == 0); + assertTrue(result.getMarkers().size() == 0); + + macros.clear(); + } + + @Test + public void semicolonErrors() throws IOException { + ITreeProcessingResult result = ParseUtil + .parseAndProcessSQF(new ByteArrayInputStream("player hint ''".getBytes()), supplier, info); + assertTrue(result.getDeclaredGlobalVariables().size() == 0); + assertTrue(result.getDeclaredLocalVariables().size() == 0); + assertTrue(result.getMarkers().size() == 1); + assertEquals(ProblemMessages.missingSemicolon("player"), result.getMarkers().iterator().next().getMessage()); + + result = ParseUtil.parseAndProcessSQF(new ByteArrayInputStream("i=1 hint ''".getBytes()), supplier, info); + assertTrue(result.getDeclaredGlobalVariables().size() == 1); + assertTrue(result.getDeclaredLocalVariables().size() == 0); + assertTrue(result.getMarkers().size() == 1); + assertEquals(ProblemMessages.missingSemicolon("1"), result.getMarkers().iterator().next().getMessage()); + + result = ParseUtil.parseAndProcessSQF( + new ByteArrayInputStream("player setPos getPos player disableSerialization".getBytes()), supplier, + info); + assertTrue(result.getDeclaredGlobalVariables().size() == 0); + assertTrue(result.getDeclaredLocalVariables().size() == 0); + assertTrue(result.getMarkers().size() == 1); + assertEquals(ProblemMessages.missingSemicolon("player"), result.getMarkers().iterator().next().getMessage()); + + result = ParseUtil.parseAndProcessSQF(new ByteArrayInputStream("call {3 disableSerialization}".getBytes()), + supplier, info); + assertTrue(result.getDeclaredGlobalVariables().size() == 0); + assertTrue(result.getDeclaredLocalVariables().size() == 0); + assertTrue(result.getMarkers().size() == 1); + assertEquals(ProblemMessages.missingSemicolon("3"), result.getMarkers().iterator().next().getMessage()); + } + + @Test + public void assignments() throws IOException { + ITreeProcessingResult result = ParseUtil.parseAndProcessSQF(new ByteArrayInputStream("myVar = 3".getBytes()), + supplier, info); + assertTrue(result.getDeclaredGlobalVariables().size() == 1); + assertTrue(result.getDeclaredLocalVariables().size() == 0); + assertTrue(result.getMarkers().size() == 0); + assertTrue(result.getDeclaredGlobalVariables().keySet().contains("myvar")); + + result = ParseUtil.parseAndProcessSQF(new ByteArrayInputStream("myVar = 3;".getBytes()), supplier, info); + assertTrue(result.getDeclaredGlobalVariables().size() == 1); + assertTrue(result.getDeclaredLocalVariables().size() == 0); + assertTrue(result.getMarkers().size() == 0); + assertTrue(result.getDeclaredGlobalVariables().keySet().contains("myvar")); + + result = ParseUtil.parseAndProcessSQF(new ByteArrayInputStream("_myVar = 3".getBytes()), supplier, info); + assertTrue(result.getDeclaredGlobalVariables().size() == 0); + assertTrue(result.getDeclaredLocalVariables().size() == 1); + assertTrue(result.getMarkers().size() == 0); + assertTrue(result.getDeclaredLocalVariables().keySet().contains("_myvar")); + + result = ParseUtil.parseAndProcessSQF(new ByteArrayInputStream("_myVar = 3;".getBytes()), supplier, info); + assertTrue(result.getDeclaredGlobalVariables().size() == 0); + assertTrue(result.getDeclaredLocalVariables().size() == 1); + assertTrue(result.getMarkers().size() == 0); + assertTrue(result.getDeclaredLocalVariables().keySet().contains("_myvar")); + + result = ParseUtil.parseAndProcessSQF(new ByteArrayInputStream("private _myVar = 3".getBytes()), supplier, + info); + assertTrue(result.getDeclaredGlobalVariables().size() == 0); + assertTrue(result.getDeclaredLocalVariables().size() == 1); + assertTrue(result.getMarkers().size() == 0); + assertTrue(result.getDeclaredLocalVariables().keySet().contains("_myvar")); + + result = ParseUtil.parseAndProcessSQF(new ByteArrayInputStream("private _myVar = 3;".getBytes()), supplier, + info); + assertTrue(result.getDeclaredGlobalVariables().size() == 0); + assertTrue(result.getDeclaredLocalVariables().size() == 1); + assertTrue(result.getMarkers().size() == 0); + assertTrue(result.getDeclaredLocalVariables().keySet().contains("_myvar")); + + result = ParseUtil.parseAndProcessSQF(new ByteArrayInputStream("_myVar = []".getBytes()), supplier, info); + assertTrue(result.getDeclaredGlobalVariables().size() == 0); + assertTrue(result.getDeclaredLocalVariables().size() == 1); + assertTrue(result.getMarkers().size() == 0); + assertTrue(result.getDeclaredLocalVariables().keySet().contains("_myvar")); + + result = ParseUtil.parseAndProcessSQF(new ByteArrayInputStream("_myVar = [];".getBytes()), supplier, info); + assertTrue(result.getDeclaredGlobalVariables().size() == 0); + assertTrue(result.getDeclaredLocalVariables().size() == 1); + assertTrue(result.getMarkers().size() == 0); + assertTrue(result.getDeclaredLocalVariables().keySet().contains("_myvar")); + + result = ParseUtil.parseAndProcessSQF(new ByteArrayInputStream("_myVar = {}".getBytes()), supplier, info); + assertTrue(result.getDeclaredGlobalVariables().size() == 0); + assertTrue(result.getDeclaredLocalVariables().size() == 1); + assertTrue(result.getMarkers().size() == 0); + assertTrue(result.getDeclaredLocalVariables().keySet().contains("_myvar")); + + result = ParseUtil.parseAndProcessSQF(new ByteArrayInputStream("_myVar = {};".getBytes()), supplier, info); + assertTrue(result.getDeclaredGlobalVariables().size() == 0); + assertTrue(result.getDeclaredLocalVariables().size() == 1); + assertTrue(result.getMarkers().size() == 0); + assertTrue(result.getDeclaredLocalVariables().keySet().contains("_myvar")); + + macros.put("GVAR", new Macro("GVAR")); + + result = ParseUtil.parseAndProcessSQF(new ByteArrayInputStream("GVAR(myVar) = {}".getBytes()), supplier, info); + assertTrue(result.getDeclaredGlobalVariables().size() == 1); + assertTrue(result.getDeclaredLocalVariables().size() == 0); + assertTrue(result.getMarkers().size() == 0); + assertTrue(result.getDeclaredGlobalVariables().keySet().contains("GVAR(myVar)")); + + result = ParseUtil.parseAndProcessSQF(new ByteArrayInputStream("GVAR(myVar) = {}".getBytes()), supplier, info); + assertTrue(result.getDeclaredGlobalVariables().size() == 1); + assertTrue(result.getDeclaredLocalVariables().size() == 0); + assertTrue(result.getMarkers().size() == 0); + assertTrue(result.getDeclaredGlobalVariables().keySet().contains("GVAR(myVar)")); + + macros.clear(); + } + + @Test + public void assignmentErros() throws IOException { + ITreeProcessingResult result = ParseUtil + .parseAndProcessSQF(new ByteArrayInputStream("someOperator myVar = 3".getBytes()), supplier, info); + assertTrue(result.getDeclaredGlobalVariables().size() == 2); + assertTrue(result.getDeclaredLocalVariables().size() == 0); + assertTrue(result.getMarkers().size() == 1); + assertEquals(ProblemMessages.missingSemicolon("someOperator"), + result.getMarkers().iterator().next().getMessage()); + assertTrue(result.getDeclaredGlobalVariables().keySet().contains("myvar")); + + result = ParseUtil.parseAndProcessSQF(new ByteArrayInputStream("player = 3".getBytes()), supplier, info); + assertTrue(result.getDeclaredGlobalVariables().size() == 0); + assertTrue(result.getDeclaredLocalVariables().size() == 0); + assertTrue(result.getMarkers().size() == 1); + assertEquals(ProblemMessages.reservedKeyword("player"), result.getMarkers().iterator().next().getMessage()); + + result = ParseUtil.parseAndProcessSQF(new ByteArrayInputStream("= 3".getBytes()), supplier, info); + assertTrue(result.getDeclaredGlobalVariables().size() == 0); + assertTrue(result.getDeclaredLocalVariables().size() == 0); + assertTrue(result.getMarkers().size() == 1); + assertEquals(ProblemMessages.operatorIsNotUnary("="), result.getMarkers().iterator().next().getMessage()); + + result = ParseUtil.parseAndProcessSQF(new ByteArrayInputStream("=".getBytes()), supplier, info); + assertTrue(result.getDeclaredGlobalVariables().size() == 0); + assertTrue(result.getDeclaredLocalVariables().size() == 0); + assertTrue(result.getMarkers().size() == 1); + assertEquals(ProblemMessages.operatorIsNotNular("="), result.getMarkers().iterator().next().getMessage()); + } + + @Test + public void arrays() throws IOException { + ITreeProcessingResult result = ParseUtil.parseAndProcessSQF(new ByteArrayInputStream("[]".getBytes()), supplier, + info); + assertTrue(result.getDeclaredGlobalVariables().size() == 0); + assertTrue(result.getDeclaredLocalVariables().size() == 0); + assertTrue(result.getMarkers().size() == 0); + + result = ParseUtil.parseAndProcessSQF(new ByteArrayInputStream("[[]]".getBytes()), supplier, info); + assertTrue(result.getDeclaredGlobalVariables().size() == 0); + assertTrue(result.getDeclaredLocalVariables().size() == 0); + assertTrue(result.getMarkers().size() == 0); + + result = ParseUtil.parseAndProcessSQF(new ByteArrayInputStream("[2]".getBytes()), supplier, info); + assertTrue(result.getDeclaredGlobalVariables().size() == 0); + assertTrue(result.getDeclaredLocalVariables().size() == 0); + assertTrue(result.getMarkers().size() == 0); + + result = ParseUtil.parseAndProcessSQF(new ByteArrayInputStream("[2, 3]".getBytes()), supplier, info); + assertTrue(result.getDeclaredGlobalVariables().size() == 0); + assertTrue(result.getDeclaredLocalVariables().size() == 0); + assertTrue(result.getMarkers().size() == 0); + + result = ParseUtil.parseAndProcessSQF(new ByteArrayInputStream("[2, \"\"]".getBytes()), supplier, info); + assertTrue(result.getDeclaredGlobalVariables().size() == 0); + assertTrue(result.getDeclaredLocalVariables().size() == 0); + assertTrue(result.getMarkers().size() == 0); + + result = ParseUtil.parseAndProcessSQF(new ByteArrayInputStream("[2, []]".getBytes()), supplier, info); + assertTrue(result.getDeclaredGlobalVariables().size() == 0); + assertTrue(result.getDeclaredLocalVariables().size() == 0); + assertTrue(result.getMarkers().size() == 0); + + result = ParseUtil.parseAndProcessSQF(new ByteArrayInputStream("[2, [5, 7]]".getBytes()), supplier, info); + assertTrue(result.getDeclaredGlobalVariables().size() == 0); + assertTrue(result.getDeclaredLocalVariables().size() == 0); + assertTrue(result.getMarkers().size() == 0); + + result = ParseUtil.parseAndProcessSQF(new ByteArrayInputStream("[2, {}]".getBytes()), supplier, info); + assertTrue(result.getDeclaredGlobalVariables().size() == 0); + assertTrue(result.getDeclaredLocalVariables().size() == 0); + assertTrue(result.getMarkers().size() == 0); + + result = ParseUtil.parseAndProcessSQF(new ByteArrayInputStream("[2, {test = [2, 'three']}]".getBytes()), + supplier, info); + assertTrue(result.getDeclaredGlobalVariables().size() == 1); + assertTrue(result.getDeclaredLocalVariables().size() == 0); + assertTrue(result.getMarkers().size() == 0); + assertTrue(result.getDeclaredGlobalVariables().keySet().contains("test")); + } + + @Test + public void arrayErrors() throws IOException { + ITreeProcessingResult result = ParseUtil.parseAndProcessSQF(new ByteArrayInputStream("[3,]".getBytes()), + supplier, info); + assertTrue(result.getDeclaredGlobalVariables().size() == 0); + assertTrue(result.getDeclaredLocalVariables().size() == 0); + assertTrue(result.getMarkers().size() == 1); + assertEquals(ProblemMessages.misplacedToken(","), result.getMarkers().iterator().next().getMessage()); + + result = ParseUtil.parseAndProcessSQF(new ByteArrayInputStream("[,]".getBytes()), supplier, info); + assertTrue(result.getDeclaredGlobalVariables().size() == 0); + assertTrue(result.getDeclaredLocalVariables().size() == 0); + assertTrue(result.getMarkers().size() == 1); + assertEquals(ProblemMessages.misplacedToken(","), result.getMarkers().iterator().next().getMessage()); + + result = ParseUtil.parseAndProcessSQF(new ByteArrayInputStream("[[,]]".getBytes()), supplier, info); + assertTrue(result.getDeclaredGlobalVariables().size() == 0); + assertTrue(result.getDeclaredLocalVariables().size() == 0); + assertTrue(result.getMarkers().size() == 1); + assertEquals(ProblemMessages.misplacedToken(","), result.getMarkers().iterator().next().getMessage()); + + result = ParseUtil.parseAndProcessSQF(new ByteArrayInputStream("[[3,]]".getBytes()), supplier, info); + assertTrue(result.getDeclaredGlobalVariables().size() == 0); + assertTrue(result.getDeclaredLocalVariables().size() == 0); + assertTrue(result.getMarkers().size() == 1); + assertEquals(ProblemMessages.misplacedToken(","), result.getMarkers().iterator().next().getMessage()); + + result = ParseUtil.parseAndProcessSQF(new ByteArrayInputStream("[[3],]".getBytes()), supplier, info); + assertTrue(result.getDeclaredGlobalVariables().size() == 0); + assertTrue(result.getDeclaredLocalVariables().size() == 0); + assertTrue(result.getMarkers().size() == 1); + assertEquals(ProblemMessages.misplacedToken(","), result.getMarkers().iterator().next().getMessage()); + + result = ParseUtil.parseAndProcessSQF(new ByteArrayInputStream("[3 3]".getBytes()), supplier, info); + assertTrue(result.getDeclaredGlobalVariables().size() == 0); + assertTrue(result.getDeclaredLocalVariables().size() == 0); + assertTrue(result.getMarkers().size() == 1); + assertEquals(ProblemMessages.missingComma("3"), result.getMarkers().iterator().next().getMessage()); + + result = ParseUtil.parseAndProcessSQF(new ByteArrayInputStream("[3 []]".getBytes()), supplier, info); + assertTrue(result.getDeclaredGlobalVariables().size() == 0); + assertTrue(result.getDeclaredLocalVariables().size() == 0); + assertTrue(result.getMarkers().size() == 1); + assertEquals(ProblemMessages.missingComma("3"), result.getMarkers().iterator().next().getMessage()); + + result = ParseUtil.parseAndProcessSQF(new ByteArrayInputStream("[[] 3]".getBytes()), supplier, info); + assertTrue(result.getDeclaredGlobalVariables().size() == 0); + assertTrue(result.getDeclaredLocalVariables().size() == 0); + assertTrue(result.getMarkers().size() == 1); + assertEquals(ProblemMessages.missingComma("]"), result.getMarkers().iterator().next().getMessage()); + } + + @Test + public void privateTest() throws IOException { + ITreeProcessingResult result = ParseUtil + .parseAndProcessSQF(new ByteArrayInputStream("private _myVar = 3".getBytes()), supplier, info); + assertTrue(result.getDeclaredGlobalVariables().size() == 0); + assertTrue(result.getDeclaredLocalVariables().size() == 1); + assertTrue(result.getMarkers().size() == 0); + assertTrue(result.getDeclaredLocalVariables().keySet().iterator().next().equals("_myvar")); + + result = ParseUtil.parseAndProcessSQF(new ByteArrayInputStream("private \"_myVar\"".getBytes()), supplier, + info); + assertTrue(result.getDeclaredGlobalVariables().size() == 0); + assertTrue(result.getDeclaredLocalVariables().size() == 1); + assertTrue(result.getMarkers().size() == 0); + assertTrue(result.getDeclaredLocalVariables().keySet().contains("_myvar")); + + result = ParseUtil.parseAndProcessSQF(new ByteArrayInputStream("private ['_myVar', \"_yourVar\"]".getBytes()), + supplier, info); + assertTrue(result.getDeclaredGlobalVariables().size() == 0); + assertTrue(result.getDeclaredLocalVariables().size() == 2); + assertTrue(result.getMarkers().size() == 0); + assertTrue(result.getDeclaredLocalVariables().keySet().contains("_myvar")); + assertTrue(result.getDeclaredLocalVariables().keySet().contains("_yourvar")); + } + + @Test + public void privateErrors() throws IOException { + ITreeProcessingResult result = ParseUtil + .parseAndProcessSQF(new ByteArrayInputStream("private myVar = 3".getBytes()), supplier, info); + assertTrue(result.getDeclaredGlobalVariables().size() == 0); + assertTrue(result.getDeclaredLocalVariables().size() == 0); + assertTrue(result.getMarkers().size() == 1); + assertEquals(ProblemMessages.privateVariablesMustBeLocal(), result.getMarkers().iterator().next().getMessage()); + + result = ParseUtil.parseAndProcessSQF(new ByteArrayInputStream("private \"myVar\"".getBytes()), supplier, info); + assertTrue(result.getDeclaredGlobalVariables().size() == 0); + assertTrue(result.getDeclaredLocalVariables().size() == 0); + assertTrue(result.getMarkers().size() == 1); + assertEquals(ProblemMessages.canOnlyDeclareLocalVariable(), result.getMarkers().iterator().next().getMessage()); + + result = ParseUtil.parseAndProcessSQF(new ByteArrayInputStream("private ['myVar', \"_yourVar\"]".getBytes()), + supplier, info); + assertTrue(result.getDeclaredGlobalVariables().size() == 0); + assertTrue(result.getDeclaredLocalVariables().size() == 1); + assertTrue(result.getMarkers().size() == 1); + assertEquals(ProblemMessages.canOnlyDeclareLocalVariable(), result.getMarkers().iterator().next().getMessage()); + assertTrue(result.getDeclaredLocalVariables().keySet().contains("_yourvar")); + + result = ParseUtil.parseAndProcessSQF(new ByteArrayInputStream("private ['_myVar', \"yourVar\"]".getBytes()), + supplier, info); + assertTrue(result.getDeclaredGlobalVariables().size() == 0); + assertTrue(result.getDeclaredLocalVariables().size() == 1); + assertTrue(result.getMarkers().size() == 1); + assertEquals(ProblemMessages.canOnlyDeclareLocalVariable(), result.getMarkers().iterator().next().getMessage()); + assertTrue(result.getDeclaredLocalVariables().keySet().contains("_myvar")); + + result = ParseUtil.parseAndProcessSQF(new ByteArrayInputStream("private ['myVar', \"yourVar\"]".getBytes()), + supplier, info); + assertTrue(result.getDeclaredGlobalVariables().size() == 0); + assertTrue(result.getDeclaredLocalVariables().size() == 0); + assertTrue(result.getMarkers().size() == 2); + assertEquals(ProblemMessages.canOnlyDeclareLocalVariable(), result.getMarkers().iterator().next().getMessage()); + assertEquals(ProblemMessages.canOnlyDeclareLocalVariable(), result.getMarkers().iterator().next().getMessage()); + } + + @Test + public void forTest() throws IOException { + ITreeProcessingResult result = ParseUtil.parseAndProcessSQF(new ByteArrayInputStream("for \"_i\"".getBytes()), + supplier, info); + assertTrue(result.getDeclaredGlobalVariables().size() == 0); + assertTrue(result.getDeclaredLocalVariables().size() == 1); + assertTrue(result.getMarkers().size() == 0); + assertTrue(result.getDeclaredLocalVariables().keySet().contains("_i")); + + result = ParseUtil.parseAndProcessSQF(new ByteArrayInputStream("for \"_i\" from 1 to 4".getBytes()), supplier, + info); + assertTrue(result.getDeclaredGlobalVariables().size() == 0); + assertTrue(result.getDeclaredLocalVariables().size() == 1); + assertTrue(result.getMarkers().size() == 0); + assertTrue(result.getDeclaredLocalVariables().keySet().contains("_i")); + + result = ParseUtil.parseAndProcessSQF(new ByteArrayInputStream("for \"_i\" from 1 to 4 do {}".getBytes()), + supplier, info); + assertTrue(result.getDeclaredGlobalVariables().size() == 0); + assertTrue(result.getDeclaredLocalVariables().size() == 1); + assertTrue(result.getMarkers().size() == 0); + assertTrue(result.getDeclaredLocalVariables().keySet().contains("_i")); + + result = ParseUtil.parseAndProcessSQF(new ByteArrayInputStream("for \"_i\" from 1 to 4 do {};".getBytes()), + supplier, info); + assertTrue(result.getDeclaredGlobalVariables().size() == 0); + assertTrue(result.getDeclaredLocalVariables().size() == 1); + assertTrue(result.getMarkers().size() == 0); + assertTrue(result.getDeclaredLocalVariables().keySet().contains("_i")); + + result = ParseUtil.parseAndProcessSQF(new ByteArrayInputStream("for '_i'".getBytes()), supplier, info); + assertTrue(result.getDeclaredGlobalVariables().size() == 0); + assertTrue(result.getDeclaredLocalVariables().size() == 1); + assertTrue(result.getMarkers().size() == 0); + assertTrue(result.getDeclaredLocalVariables().keySet().contains("_i")); + + result = ParseUtil.parseAndProcessSQF(new ByteArrayInputStream("for '_i' from 1 to 4".getBytes()), supplier, + info); + assertTrue(result.getDeclaredGlobalVariables().size() == 0); + assertTrue(result.getDeclaredLocalVariables().size() == 1); + assertTrue(result.getMarkers().size() == 0); + assertTrue(result.getDeclaredLocalVariables().keySet().contains("_i")); + + result = ParseUtil.parseAndProcessSQF(new ByteArrayInputStream("for '_i' from 1 to 4 do {}".getBytes()), + supplier, info); + assertTrue(result.getDeclaredGlobalVariables().size() == 0); + assertTrue(result.getDeclaredLocalVariables().size() == 1); + assertTrue(result.getMarkers().size() == 0); + assertTrue(result.getDeclaredLocalVariables().keySet().contains("_i")); + + result = ParseUtil.parseAndProcessSQF(new ByteArrayInputStream("for '_i' from 1 to 4 do {};".getBytes()), + supplier, info); + assertTrue(result.getDeclaredGlobalVariables().size() == 0); + assertTrue(result.getDeclaredLocalVariables().size() == 1); + assertTrue(result.getMarkers().size() == 0); + assertTrue(result.getDeclaredLocalVariables().keySet().contains("_i")); + + result = ParseUtil.parseAndProcessSQF( + new ByteArrayInputStream("for [{_i = 0}, {_i < 5}, {_i = _i + 1}]".getBytes()), supplier, info); + assertTrue(result.getDeclaredGlobalVariables().size() == 0); + assertTrue(result.getDeclaredLocalVariables().size() == 1); + assertTrue(result.getMarkers().size() == 0); + assertTrue(result.getDeclaredLocalVariables().keySet().contains("_i")); + } + + @Test + public void forErrors() throws IOException { + ITreeProcessingResult result = ParseUtil.parseAndProcessSQF(new ByteArrayInputStream("for \"i\"".getBytes()), + supplier, info); + assertTrue(result.getDeclaredGlobalVariables().size() == 0); + assertTrue(result.getDeclaredLocalVariables().size() == 0); + assertTrue(result.getMarkers().size() == 1); + assertEquals(ProblemMessages.canOnlyDeclareLocalVariable(), result.getMarkers().iterator().next().getMessage()); + + result = ParseUtil.parseAndProcessSQF(new ByteArrayInputStream("for 'i'".getBytes()), supplier, info); + assertTrue(result.getDeclaredGlobalVariables().size() == 0); + assertTrue(result.getDeclaredLocalVariables().size() == 0); + assertTrue(result.getMarkers().size() == 1); + assertEquals(ProblemMessages.canOnlyDeclareLocalVariable(), result.getMarkers().iterator().next().getMessage()); + + result = ParseUtil.parseAndProcessSQF(new ByteArrayInputStream("for '_ i'".getBytes()), supplier, info); + assertTrue(result.getDeclaredGlobalVariables().size() == 0); + assertTrue(result.getDeclaredLocalVariables().size() == 0); + assertTrue(result.getMarkers().size() == 1); + assertEquals(ProblemMessages.variableMayNotContainBlank(), result.getMarkers().iterator().next().getMessage()); + + result = ParseUtil.parseAndProcessSQF(new ByteArrayInputStream("for [{_i = 0}, {_i < 5}]".getBytes()), supplier, + info); + assertTrue(result.getDeclaredGlobalVariables().size() == 0); + assertTrue(result.getDeclaredLocalVariables().size() == 1); + assertTrue(result.getMarkers().size() == 1); + assertEquals(ProblemMessages.expectedArrayLength(3, 2), result.getMarkers().iterator().next().getMessage()); + assertTrue(result.getDeclaredLocalVariables().keySet().contains("_i")); + + result = ParseUtil.parseAndProcessSQF(new ByteArrayInputStream("for [{_i = 0}, {_i < 5}, '']".getBytes()), + supplier, info); + assertTrue(result.getDeclaredGlobalVariables().size() == 0); + assertTrue(result.getDeclaredLocalVariables().size() == 1); + assertTrue(result.getMarkers().size() == 1); + assertEquals(ProblemMessages.expectedTypeButGot(new DataTypeList(EDataType.CODE), + new DataTypeList(EDataType.STRING)), result.getMarkers().iterator().next().getMessage()); + assertTrue(result.getDeclaredLocalVariables().keySet().contains("_i")); + + result = ParseUtil.parseAndProcessSQF(new ByteArrayInputStream("for [{_i = 0}, {_i < 5}, \"\"]".getBytes()), + supplier, info); + assertTrue(result.getDeclaredGlobalVariables().size() == 0); + assertTrue(result.getDeclaredLocalVariables().size() == 1); + assertTrue(result.getMarkers().size() == 1); + assertEquals(ProblemMessages.expectedTypeButGot(new DataTypeList(EDataType.CODE), + new DataTypeList(EDataType.STRING)), result.getMarkers().iterator().next().getMessage()); + assertTrue(result.getDeclaredLocalVariables().keySet().contains("_i")); + } + + @Test + public void params() throws IOException { + ITreeProcessingResult result = ParseUtil + .parseAndProcessSQF(new ByteArrayInputStream("params [\"_i\", \"_j\"]".getBytes()), supplier, info); + assertTrue(result.getDeclaredGlobalVariables().size() == 0); + assertTrue(result.getDeclaredLocalVariables().size() == 2); + assertTrue(result.getMarkers().size() == 0); + assertTrue(result.getDeclaredLocalVariables().keySet().contains("_i")); + assertTrue(result.getDeclaredLocalVariables().keySet().contains("_j")); + + result = ParseUtil.parseAndProcessSQF(new ByteArrayInputStream("params [\"_i\", \"\", \"_j\"]".getBytes()), + supplier, info); + assertTrue(result.getDeclaredGlobalVariables().size() == 0); + assertTrue(result.getDeclaredLocalVariables().size() == 2); + assertTrue(result.getMarkers().size() == 0); + assertTrue(result.getDeclaredLocalVariables().keySet().contains("_i")); + assertTrue(result.getDeclaredLocalVariables().keySet().contains("_j")); + + result = ParseUtil.parseAndProcessSQF(new ByteArrayInputStream("params ['_i', '_j']".getBytes()), supplier, + info); + assertTrue(result.getDeclaredGlobalVariables().size() == 0); + assertTrue(result.getDeclaredLocalVariables().size() == 2); + assertTrue(result.getMarkers().size() == 0); + assertTrue(result.getDeclaredLocalVariables().keySet().contains("_i")); + assertTrue(result.getDeclaredLocalVariables().keySet().contains("_j")); + + result = ParseUtil.parseAndProcessSQF(new ByteArrayInputStream("params ['_i', '', '_j']".getBytes()), supplier, + info); + assertTrue(result.getDeclaredGlobalVariables().size() == 0); + assertTrue(result.getDeclaredLocalVariables().size() == 2); + assertTrue(result.getMarkers().size() == 0); + assertTrue(result.getDeclaredLocalVariables().keySet().contains("_i")); + assertTrue(result.getDeclaredLocalVariables().keySet().contains("_j")); + + result = ParseUtil.parseAndProcessSQF(new ByteArrayInputStream("params []".getBytes()), supplier, info); + assertTrue(result.getDeclaredGlobalVariables().size() == 0); + assertTrue(result.getDeclaredLocalVariables().size() == 0); + assertTrue(result.getMarkers().size() == 0); + + result = ParseUtil.parseAndProcessSQF(new ByteArrayInputStream("params [[\"_testVar\", nil]]".getBytes()), + supplier, info); + assertTrue(result.getDeclaredGlobalVariables().size() == 0); + assertTrue(result.getDeclaredLocalVariables().size() == 1); + assertTrue(result.getMarkers().size() == 0); + assertTrue(result.getDeclaredLocalVariables().keySet().contains("_testvar")); + + result = ParseUtil.parseAndProcessSQF( + new ByteArrayInputStream("params [[\"_testVar\", nil], ['_secondVar', player]]".getBytes()), supplier, + info); + assertTrue(result.getDeclaredGlobalVariables().size() == 0); + assertTrue(result.getDeclaredLocalVariables().size() == 2); + assertTrue(result.getMarkers().size() == 0); + assertTrue(result.getDeclaredLocalVariables().keySet().contains("_testvar")); + assertTrue(result.getDeclaredLocalVariables().keySet().contains("_secondvar")); + + result = ParseUtil.parseAndProcessSQF(new ByteArrayInputStream("params [[\"_testVar\", nil, []]]".getBytes()), + supplier, info); + assertTrue(result.getDeclaredGlobalVariables().size() == 0); + assertTrue(result.getDeclaredLocalVariables().size() == 1); + assertTrue(result.getMarkers().size() == 0); + assertTrue(result.getDeclaredLocalVariables().keySet().contains("_testvar")); + + result = ParseUtil.parseAndProcessSQF( + new ByteArrayInputStream("params [[\"_testVar\", nil, [player, \"\"]]]".getBytes()), supplier, info); + assertTrue(result.getDeclaredGlobalVariables().size() == 0); + assertTrue(result.getDeclaredLocalVariables().size() == 1); + assertTrue(result.getMarkers().size() == 0); + assertTrue(result.getDeclaredLocalVariables().keySet().contains("_testvar")); + + result = ParseUtil.parseAndProcessSQF( + new ByteArrayInputStream("params [[\"_testVar\", nil, [player, \"\"], 3]]".getBytes()), supplier, info); + assertTrue(result.getDeclaredGlobalVariables().size() == 0); + assertTrue(result.getDeclaredLocalVariables().size() == 1); + assertTrue(result.getMarkers().size() == 0); + assertTrue(result.getDeclaredLocalVariables().keySet().contains("_testvar")); + + result = ParseUtil.parseAndProcessSQF( + new ByteArrayInputStream("params [[\"_testVar\", nil, [player, \"\"], [3,4]]]".getBytes()), supplier, + info); + assertTrue(result.getDeclaredGlobalVariables().size() == 0); + assertTrue(result.getDeclaredLocalVariables().size() == 1); + assertTrue(result.getMarkers().size() == 0); + assertTrue(result.getDeclaredLocalVariables().keySet().contains("_testvar")); + } + + @Test + public void paramsErrors() throws IOException { + ITreeProcessingResult result = ParseUtil + .parseAndProcessSQF(new ByteArrayInputStream("params [\"i\"]".getBytes()), supplier, info); + assertTrue(result.getDeclaredGlobalVariables().size() == 0); + assertTrue(result.getDeclaredLocalVariables().size() == 0); + assertTrue(result.getMarkers().size() == 1); + assertEquals(ProblemMessages.canOnlyDeclareLocalVariable(), result.getMarkers().iterator().next().getMessage()); + + result = ParseUtil.parseAndProcessSQF(new ByteArrayInputStream("params [\"i\", \"\", \"_j\"]".getBytes()), + supplier, info); + assertTrue(result.getDeclaredGlobalVariables().size() == 0); + assertTrue(result.getDeclaredLocalVariables().size() == 1); + assertTrue(result.getMarkers().size() == 1); + assertEquals(ProblemMessages.canOnlyDeclareLocalVariable(), result.getMarkers().iterator().next().getMessage()); + assertTrue(result.getDeclaredLocalVariables().keySet().contains("_j")); + + result = ParseUtil.parseAndProcessSQF(new ByteArrayInputStream("params [[]]".getBytes()), supplier, info); + assertTrue(result.getDeclaredGlobalVariables().size() == 0); + assertTrue(result.getDeclaredLocalVariables().size() == 0); + assertTrue(result.getMarkers().size() == 1); + assertEquals(ProblemMessages.expectedMinimumArrayLength(2, 0), + result.getMarkers().iterator().next().getMessage()); + + result = ParseUtil.parseAndProcessSQF(new ByteArrayInputStream("params [['_test']]".getBytes()), supplier, + info); + assertTrue(result.getDeclaredGlobalVariables().size() == 0); + assertTrue(result.getDeclaredLocalVariables().size() == 0); + assertTrue(result.getMarkers().size() == 1); + assertEquals(ProblemMessages.expectedMinimumArrayLength(2, 1), + result.getMarkers().iterator().next().getMessage()); + + result = ParseUtil.parseAndProcessSQF(new ByteArrayInputStream("params [[nil, nil, nil, nil, nil]]".getBytes()), + supplier, info); + assertTrue(result.getDeclaredGlobalVariables().size() == 0); + assertTrue(result.getDeclaredLocalVariables().size() == 0); + assertTrue(result.getMarkers().size() == 1); + assertEquals(ProblemMessages.expectedMaximalArrayLength(4, 5), + result.getMarkers().iterator().next().getMessage()); + + result = ParseUtil.parseAndProcessSQF(new ByteArrayInputStream("params [[\"testVar\", nil]]".getBytes()), + supplier, info); + assertTrue(result.getDeclaredGlobalVariables().size() == 0); + assertTrue(result.getDeclaredLocalVariables().size() == 0); + assertTrue(result.getMarkers().size() == 1); + assertEquals(ProblemMessages.canOnlyDeclareLocalVariable(), result.getMarkers().iterator().next().getMessage()); + + result = ParseUtil.parseAndProcessSQF( + new ByteArrayInputStream("params [[\"_testVar\", nil], ['secondVar', player]]".getBytes()), supplier, + info); + assertTrue(result.getDeclaredGlobalVariables().size() == 0); + assertTrue(result.getDeclaredLocalVariables().size() == 1); + assertTrue(result.getMarkers().size() == 1); + assertEquals(ProblemMessages.canOnlyDeclareLocalVariable(), result.getMarkers().iterator().next().getMessage()); + assertTrue(result.getDeclaredLocalVariables().keySet().contains("_testvar")); + + result = ParseUtil.parseAndProcessSQF(new ByteArrayInputStream("params [[3, nil]]".getBytes()), supplier, info); + assertTrue(result.getDeclaredGlobalVariables().size() == 0); + assertTrue(result.getDeclaredLocalVariables().size() == 0); + assertTrue(result.getMarkers().size() == 1); + assertEquals(ProblemMessages.expectedTypeButGot(new DataTypeList(EDataType.STRING), + new DataTypeList(EDataType.NUMBER)), result.getMarkers().iterator().next().getMessage()); + + result = ParseUtil.parseAndProcessSQF(new ByteArrayInputStream("params [[\"_testVar\", nil, 3]]".getBytes()), + supplier, info); + assertTrue(result.getDeclaredGlobalVariables().size() == 0); + assertTrue(result.getDeclaredLocalVariables().size() == 1); + assertTrue(result.getMarkers().size() == 1); + assertEquals(ProblemMessages.expectedTypeButGot(new DataTypeList(EDataType.ARRAY), + new DataTypeList(EDataType.NUMBER)), result.getMarkers().iterator().next().getMessage()); + assertTrue(result.getDeclaredLocalVariables().keySet().contains("_testvar")); + + result = ParseUtil.parseAndProcessSQF( + new ByteArrayInputStream("params [[\"_testVar\", nil, [], \"\"]]".getBytes()), supplier, info); + assertTrue(result.getDeclaredGlobalVariables().size() == 0); + assertTrue(result.getDeclaredLocalVariables().size() == 1); + assertTrue(result.getMarkers().size() == 1); + assertEquals(ProblemMessages.expectedTypeButGot( + new DataTypeList(new EDataType[] { EDataType.NUMBER, EDataType.ARRAY }), + new DataTypeList(EDataType.STRING)), result.getMarkers().iterator().next().getMessage()); + assertTrue(result.getDeclaredLocalVariables().keySet().contains("_testvar")); + } + + @Test + public void nularExpressions() throws IOException { + ITreeProcessingResult result = ParseUtil.parseAndProcessSQF(new ByteArrayInputStream("3".getBytes()), supplier, + info); + assertTrue(result.getDeclaredGlobalVariables().size() == 0); + assertTrue(result.getDeclaredLocalVariables().size() == 0); + assertTrue(result.getMarkers().size() == 0); + + result = ParseUtil.parseAndProcessSQF(new ByteArrayInputStream("[]".getBytes()), supplier, info); + assertTrue(result.getDeclaredGlobalVariables().size() == 0); + assertTrue(result.getDeclaredLocalVariables().size() == 0); + assertTrue(result.getMarkers().size() == 0); + + result = ParseUtil.parseAndProcessSQF(new ByteArrayInputStream("{}".getBytes()), supplier, info); + assertTrue(result.getDeclaredGlobalVariables().size() == 0); + assertTrue(result.getDeclaredLocalVariables().size() == 0); + assertTrue(result.getMarkers().size() == 0); + + result = ParseUtil.parseAndProcessSQF(new ByteArrayInputStream("{player}".getBytes()), supplier, info); + assertTrue(result.getDeclaredGlobalVariables().size() == 0); + assertTrue(result.getDeclaredLocalVariables().size() == 0); + assertTrue(result.getMarkers().size() == 0); + + result = ParseUtil.parseAndProcessSQF(new ByteArrayInputStream("\"Test\"".getBytes()), supplier, info); + assertTrue(result.getDeclaredGlobalVariables().size() == 0); + assertTrue(result.getDeclaredLocalVariables().size() == 0); + assertTrue(result.getMarkers().size() == 0); + + result = ParseUtil.parseAndProcessSQF(new ByteArrayInputStream("'Test'".getBytes()), supplier, info); + assertTrue(result.getDeclaredGlobalVariables().size() == 0); + assertTrue(result.getDeclaredLocalVariables().size() == 0); + assertTrue(result.getMarkers().size() == 0); + + result = ParseUtil.parseAndProcessSQF(new ByteArrayInputStream("player".getBytes()), supplier, info); + assertTrue(result.getDeclaredGlobalVariables().size() == 0); + assertTrue(result.getDeclaredLocalVariables().size() == 0); + assertTrue(result.getMarkers().size() == 0); + + result = ParseUtil.parseAndProcessSQF(new ByteArrayInputStream("player; disableSerialization".getBytes()), + supplier, info); + assertTrue(result.getDeclaredGlobalVariables().size() == 0); + assertTrue(result.getDeclaredLocalVariables().size() == 0); + assertTrue(result.getMarkers().size() == 0); + } + + @Test + public void nularExpressionErrors() throws IOException { + ITreeProcessingResult result = ParseUtil.parseAndProcessSQF(new ByteArrayInputStream("_testVar".getBytes()), + supplier, info); + assertTrue(result.getDeclaredGlobalVariables().size() == 0); + assertTrue(result.getDeclaredLocalVariables().size() == 0); + assertTrue(result.getMarkers().size() == 1); + assertEquals(ProblemMessages.undefinedLocalVariable("_testVar"), + result.getMarkers().iterator().next().getMessage()); + + result = ParseUtil.parseAndProcessSQF(new ByteArrayInputStream("[_testVar]".getBytes()), supplier, info); + assertTrue(result.getDeclaredGlobalVariables().size() == 0); + assertTrue(result.getDeclaredLocalVariables().size() == 0); + assertTrue(result.getMarkers().size() == 1); + assertEquals(ProblemMessages.undefinedLocalVariable("_testVar"), + result.getMarkers().iterator().next().getMessage()); + } + + @Test + public void unaryExpressions() throws IOException { + ITreeProcessingResult result = ParseUtil.parseAndProcessSQF(new ByteArrayInputStream("hint 'Test'".getBytes()), + supplier, info); + assertTrue(result.getDeclaredGlobalVariables().size() == 0); + assertTrue(result.getDeclaredLocalVariables().size() == 0); + assertTrue(result.getMarkers().size() == 0); + + result = ParseUtil.parseAndProcessSQF(new ByteArrayInputStream("hint \"Test\"".getBytes()), supplier, info); + assertTrue(result.getDeclaredGlobalVariables().size() == 0); + assertTrue(result.getDeclaredLocalVariables().size() == 0); + assertTrue(result.getMarkers().size() == 0); + + result = ParseUtil.parseAndProcessSQF(new ByteArrayInputStream("hint format []".getBytes()), supplier, info); + assertTrue(result.getDeclaredGlobalVariables().size() == 0); + assertTrue(result.getDeclaredLocalVariables().size() == 0); + assertTrue(result.getMarkers().size() == 0); + } + + @Test + public void unaryExpressionErrors() throws IOException { + ITreeProcessingResult result = ParseUtil.parseAndProcessSQF(new ByteArrayInputStream("hint 3".getBytes()), + supplier, info); + assertTrue(result.getDeclaredGlobalVariables().size() == 0); + assertTrue(result.getDeclaredLocalVariables().size() == 0); + assertTrue(result.getMarkers().size() == 1); + assertEquals(ProblemMessages.expectedTypeButGot( + new DataTypeList(new EDataType[] { EDataType.STRING, EDataType.STRUCTURED_TEXT }), + new DataTypeList(EDataType.NUMBER)), result.getMarkers().iterator().next().getMessage()); + + result = ParseUtil.parseAndProcessSQF(new ByteArrayInputStream("hint []".getBytes()), supplier, info); + assertTrue(result.getDeclaredGlobalVariables().size() == 0); + assertTrue(result.getDeclaredLocalVariables().size() == 0); + assertTrue(result.getMarkers().size() == 1); + assertEquals(ProblemMessages.expectedTypeButGot( + new DataTypeList(new EDataType[] { EDataType.STRING, EDataType.STRUCTURED_TEXT }), + new DataTypeList(EDataType.ARRAY)), result.getMarkers().iterator().next().getMessage()); + + result = ParseUtil.parseAndProcessSQF(new ByteArrayInputStream("hint {}".getBytes()), supplier, info); + assertTrue(result.getDeclaredGlobalVariables().size() == 0); + assertTrue(result.getDeclaredLocalVariables().size() == 0); + assertTrue(result.getMarkers().size() == 1); + assertEquals(ProblemMessages.expectedTypeButGot( + new DataTypeList(new EDataType[] { EDataType.STRING, EDataType.STRUCTURED_TEXT }), + new DataTypeList(EDataType.CODE)), result.getMarkers().iterator().next().getMessage()); + + result = ParseUtil.parseAndProcessSQF(new ByteArrayInputStream("[hint {}]".getBytes()), supplier, info); + assertTrue(result.getDeclaredGlobalVariables().size() == 0); + assertTrue(result.getDeclaredLocalVariables().size() == 0); + assertTrue(result.getMarkers().size() == 1); + assertEquals(ProblemMessages.expectedTypeButGot( + new DataTypeList(new EDataType[] { EDataType.STRING, EDataType.STRUCTURED_TEXT }), + new DataTypeList(EDataType.CODE)), result.getMarkers().iterator().next().getMessage()); + + result = ParseUtil.parseAndProcessSQF(new ByteArrayInputStream("{hint {}}".getBytes()), supplier, info); + assertTrue(result.getDeclaredGlobalVariables().size() == 0); + assertTrue(result.getDeclaredLocalVariables().size() == 0); + assertTrue(result.getMarkers().size() == 1); + assertEquals(ProblemMessages.expectedTypeButGot( + new DataTypeList(new EDataType[] { EDataType.STRING, EDataType.STRUCTURED_TEXT }), + new DataTypeList(EDataType.CODE)), result.getMarkers().iterator().next().getMessage()); + + result = ParseUtil.parseAndProcessSQF(new ByteArrayInputStream("hint player".getBytes()), supplier, info); + assertTrue(result.getDeclaredGlobalVariables().size() == 0); + assertTrue(result.getDeclaredLocalVariables().size() == 0); + assertTrue(result.getMarkers().size() == 1); + assertEquals(ProblemMessages.expectedTypeButGot( + new DataTypeList(new EDataType[] { EDataType.STRING, EDataType.STRUCTURED_TEXT }), + new DataTypeList(EDataType.OBJECT)), result.getMarkers().iterator().next().getMessage()); + } + + @Test + public void binaryExpressions() throws IOException { + ITreeProcessingResult result = ParseUtil + .parseAndProcessSQF(new ByteArrayInputStream("player setPos [0,0,0]".getBytes()), supplier, info); + assertTrue(result.getDeclaredGlobalVariables().size() == 0); + assertTrue(result.getDeclaredLocalVariables().size() == 0); + assertTrue(result.getMarkers().size() == 0); + + result = ParseUtil.parseAndProcessSQF(new ByteArrayInputStream("player setPos getPos player".getBytes()), + supplier, info); + assertTrue(result.getDeclaredGlobalVariables().size() == 0); + assertTrue(result.getDeclaredLocalVariables().size() == 0); + assertTrue(result.getMarkers().size() == 0); + + result = ParseUtil.parseAndProcessSQF( + new ByteArrayInputStream("player setPos getPos leader group player".getBytes()), supplier, info); + assertTrue(result.getDeclaredGlobalVariables().size() == 0); + assertTrue(result.getDeclaredLocalVariables().size() == 0); + assertTrue(result.getMarkers().size() == 0); + + result = ParseUtil.parseAndProcessSQF(new ByteArrayInputStream("[] select params []".getBytes()), supplier, + info); + assertTrue(result.getDeclaredGlobalVariables().size() == 0); + assertTrue(result.getDeclaredLocalVariables().size() == 0); + assertTrue(result.getMarkers().size() == 0); + } + + @Test + public void binaryExpressionErrors() throws IOException { + ITreeProcessingResult result = ParseUtil + .parseAndProcessSQF(new ByteArrayInputStream("player setPos 3".getBytes()), supplier, info); + assertTrue(result.getDeclaredGlobalVariables().size() == 0); + assertTrue(result.getDeclaredLocalVariables().size() == 0); + assertTrue(result.getMarkers().size() == 1); + assertEquals(ProblemMessages.expectedTypeButGot(new DataTypeList(EDataType.ARRAY), + new DataTypeList(EDataType.NUMBER)), result.getMarkers().iterator().next().getMessage()); + + result = ParseUtil.parseAndProcessSQF(new ByteArrayInputStream("player setPos time".getBytes()), supplier, + info); + assertTrue(result.getDeclaredGlobalVariables().size() == 0); + assertTrue(result.getDeclaredLocalVariables().size() == 0); + assertTrue(result.getMarkers().size() == 1); + assertEquals(ProblemMessages.expectedTypeButGot(new DataTypeList(EDataType.ARRAY), + new DataTypeList(EDataType.NUMBER)), result.getMarkers().iterator().next().getMessage()); + + result = ParseUtil.parseAndProcessSQF(new ByteArrayInputStream("time setPos [0,0,0]".getBytes()), supplier, + info); + assertTrue(result.getDeclaredGlobalVariables().size() == 0); + assertTrue(result.getDeclaredLocalVariables().size() == 0); + assertTrue(result.getMarkers().size() == 1); + assertEquals(ProblemMessages.expectedTypeButGot(new DataTypeList(EDataType.OBJECT), + new DataTypeList(EDataType.NUMBER)), result.getMarkers().iterator().next().getMessage()); + + result = ParseUtil.parseAndProcessSQF(new ByteArrayInputStream("[time setPos [0,0,0]]".getBytes()), supplier, + info); + assertTrue(result.getDeclaredGlobalVariables().size() == 0); + assertTrue(result.getDeclaredLocalVariables().size() == 0); + assertTrue(result.getMarkers().size() == 1); + assertEquals(ProblemMessages.expectedTypeButGot(new DataTypeList(EDataType.OBJECT), + new DataTypeList(EDataType.NUMBER)), result.getMarkers().iterator().next().getMessage()); + + result = ParseUtil.parseAndProcessSQF(new ByteArrayInputStream("hint setPos [0,0,0]".getBytes()), supplier, + info); + assertTrue(result.getDeclaredGlobalVariables().size() == 0); + assertTrue(result.getDeclaredLocalVariables().size() == 0); + assertTrue(result.getMarkers().size() == 2); + Iterator it = result.getMarkers().iterator(); + assertEquals(ProblemMessages.operatorIsNotUnary("setPos"), it.next().getMessage()); + assertEquals(ProblemMessages.expectedTypeButGot( + new DataTypeList(new EDataType[] { EDataType.STRING, EDataType.STRUCTURED_TEXT }), + new DataTypeList(EDataType.NOTHING)), it.next().getMessage()); + } + + @Test + public void snippets() throws IOException { + macros.put("CHECK_FALSE", new Macro("CHECK_FALSE")); + macros.put("DEBUG_EXEC", new Macro("DEBUG_EXEC")); + macros.put("EVENT_LOG", new Macro("EVENT_LOG")); + + ITreeProcessingResult result = ParseUtil.parseAndProcessSQF( + new FileInputStream(new File( + makeOSCompatible(System.getProperty("user.dir") + "/src/raven/sqdev/sqf/processing/tests/EncounteredFalsePositives.sqf"))), + supplier, info); + assertTrue(result.getMarkers().size() == 0); + + macros.clear(); + } + + + /** + * Makes the given path (that uses "/" as a FileSeparator) compatible with the + * current OS by using the actual OS-FileSeparator + * + * @param path + * The path to process + * @return The processed path + */ + protected static String makeOSCompatible(String path) { + return path.replace("/", File.separator); + } + + /** + * Gets the needed SQFInformation + * + * @param macros + * The macro-list that should be used + */ + protected static SQFInformation getSQFInformation(Map macros) { + return new SQFInformation(macros) { + @Override + protected String getKeywordContent() { + try { + return FileUtil.getContent(KEYWORD_FILE); + } catch (SQDevException e) { + e.printStackTrace(); + throw new RuntimeException(e); + } + } + }; + } + +} diff --git a/plugin/Raven.SQDev.SQFEditor/.gitignore b/plugin/Raven.SQDev.SQFEditor/.gitignore new file mode 100644 index 00000000..ae3c1726 --- /dev/null +++ b/plugin/Raven.SQDev.SQFEditor/.gitignore @@ -0,0 +1 @@ +/bin/ diff --git a/plugin/Raven.SQDev.SQFEditor/META-INF/MANIFEST.MF b/plugin/Raven.SQDev.SQFEditor/META-INF/MANIFEST.MF index b6973020..59a8feff 100644 --- a/plugin/Raven.SQDev.SQFEditor/META-INF/MANIFEST.MF +++ b/plugin/Raven.SQDev.SQFEditor/META-INF/MANIFEST.MF @@ -2,21 +2,20 @@ Manifest-Version: 1.0 Bundle-ManifestVersion: 2 Bundle-Name: SQFEditor Bundle-SymbolicName: raven.sqdev.editors.sqfeditor;singleton:=true -Bundle-Version: 0.7.4.stable +Bundle-Version: 0.7.5.stable Bundle-Activator: raven.sqdev.activator.Activator Bundle-Vendor: Raven Require-Bundle: org.eclipse.ui, org.eclipse.core.runtime, org.eclipse.ui.editors, - org.eclipse.jface.text;bundle-version="3.9.2", + org.eclipse.jface.text, org.eclipse.osgi, - raven.sqdev.util;bundle-version="0.7.1", - raven.sqdev.editors;bundle-version="0.7.1", - raven.sqdev.preferences;bundle-version="0.5.5", org.eclipse.core.resources, org.eclipse.ui.ide, - raven.sqdev.misc;bundle-version="0.6.0", - org.junit + org.junit, + raven.sqdev.misc, + raven.sqdev.util, + raven.sqdev.editors Bundle-RequiredExecutionEnvironment: JavaSE-1.8 Bundle-ActivationPolicy: lazy Export-Package: raven.sqdev.editors.sqfeditor diff --git a/plugin/Raven.SQDev.SQFEditor/bin/raven/sqdev/activator/Activator.class b/plugin/Raven.SQDev.SQFEditor/bin/raven/sqdev/activator/Activator.class deleted file mode 100644 index b21d21cf..00000000 Binary files a/plugin/Raven.SQDev.SQFEditor/bin/raven/sqdev/activator/Activator.class and /dev/null differ diff --git a/plugin/Raven.SQDev.SQFEditor/bin/raven/sqdev/editors/sqfeditor/SQFKeywordProvider.class b/plugin/Raven.SQDev.SQFEditor/bin/raven/sqdev/editors/sqfeditor/SQFKeywordProvider.class deleted file mode 100644 index 206c0766..00000000 Binary files a/plugin/Raven.SQDev.SQFEditor/bin/raven/sqdev/editors/sqfeditor/SQFKeywordProvider.class and /dev/null differ diff --git a/plugin/Raven.SQDev.SQFEditor/bin/raven/sqdev/editors/sqfeditor/SQFStringPartitionRule$DecreasingCharArrayLengthComparator.class b/plugin/Raven.SQDev.SQFEditor/bin/raven/sqdev/editors/sqfeditor/SQFStringPartitionRule$DecreasingCharArrayLengthComparator.class deleted file mode 100644 index c9d6edde..00000000 Binary files a/plugin/Raven.SQDev.SQFEditor/bin/raven/sqdev/editors/sqfeditor/SQFStringPartitionRule$DecreasingCharArrayLengthComparator.class and /dev/null differ diff --git a/plugin/Raven.SQDev.SQFEditor/bin/raven/sqdev/editors/sqfeditor/SQFStringPartitionRule.class b/plugin/Raven.SQDev.SQFEditor/bin/raven/sqdev/editors/sqfeditor/SQFStringPartitionRule.class deleted file mode 100644 index afc44f93..00000000 Binary files a/plugin/Raven.SQDev.SQFEditor/bin/raven/sqdev/editors/sqfeditor/SQFStringPartitionRule.class and /dev/null differ diff --git a/plugin/Raven.SQDev.SQFEditor/bin/raven/sqdev/editors/sqfeditor/SQF_Editor$1.class b/plugin/Raven.SQDev.SQFEditor/bin/raven/sqdev/editors/sqfeditor/SQF_Editor$1.class deleted file mode 100644 index d3e483df..00000000 Binary files a/plugin/Raven.SQDev.SQFEditor/bin/raven/sqdev/editors/sqfeditor/SQF_Editor$1.class and /dev/null differ diff --git a/plugin/Raven.SQDev.SQFEditor/bin/raven/sqdev/editors/sqfeditor/SQF_Editor.class b/plugin/Raven.SQDev.SQFEditor/bin/raven/sqdev/editors/sqfeditor/SQF_Editor.class deleted file mode 100644 index df6a4fbb..00000000 Binary files a/plugin/Raven.SQDev.SQFEditor/bin/raven/sqdev/editors/sqfeditor/SQF_Editor.class and /dev/null differ diff --git a/plugin/Raven.SQDev.SQFEditor/bin/raven/sqdev/editors/sqfeditor/exceptions/IllegalBlankException.class b/plugin/Raven.SQDev.SQFEditor/bin/raven/sqdev/editors/sqfeditor/exceptions/IllegalBlankException.class deleted file mode 100644 index 1dc8071b..00000000 Binary files a/plugin/Raven.SQDev.SQFEditor/bin/raven/sqdev/editors/sqfeditor/exceptions/IllegalBlankException.class and /dev/null differ diff --git a/plugin/Raven.SQDev.SQFEditor/src/raven/sqdev/activator/Activator.java b/plugin/Raven.SQDev.SQFEditor/src/raven/sqdev/activator/Activator.java index ad5c8856..5b3a741a 100644 --- a/plugin/Raven.SQDev.SQFEditor/src/raven/sqdev/activator/Activator.java +++ b/plugin/Raven.SQDev.SQFEditor/src/raven/sqdev/activator/Activator.java @@ -5,7 +5,7 @@ import org.osgi.framework.BundleContext; import raven.sqdev.misc.SQDevPreferenceUtil; -import raven.sqdev.pluginManager.SQDevPluginManager; +import raven.sqdev.pluginManagement.SQDevPluginManager; /** * The activator class controls the plug-in life cycle diff --git a/plugin/Raven.SQDev.SQFEditor/src/raven/sqdev/editors/sqfeditor/SQF_Editor.java b/plugin/Raven.SQDev.SQFEditor/src/raven/sqdev/editors/sqfeditor/SQF_Editor.java index 035037d1..fe8d3182 100644 --- a/plugin/Raven.SQDev.SQFEditor/src/raven/sqdev/editors/sqfeditor/SQF_Editor.java +++ b/plugin/Raven.SQDev.SQFEditor/src/raven/sqdev/editors/sqfeditor/SQF_Editor.java @@ -1,11 +1,15 @@ package raven.sqdev.editors.sqfeditor; import java.io.FileNotFoundException; +import java.io.IOException; +import java.io.InputStream; import java.util.ArrayList; +import java.util.HashMap; +import java.util.Iterator; import java.util.List; +import java.util.Map; +import java.util.Map.Entry; -import org.antlr.v4.runtime.BufferedTokenStream; -import org.antlr.v4.runtime.tree.ParseTree; import org.eclipse.core.resources.IProject; import org.eclipse.core.runtime.IProgressMonitor; import org.eclipse.core.runtime.IStatus; @@ -16,6 +20,7 @@ import org.eclipse.ui.IEditorInput; import org.eclipse.ui.IFileEditorInput; +import dataStructures.AbstractSQFTokenFactory; import raven.sqdev.constants.SQDevPreferenceConstants; import raven.sqdev.editors.BasicCodeEditor; import raven.sqdev.editors.BasicPartitionScanner; @@ -30,11 +35,16 @@ import raven.sqdev.infoCollection.base.Variable; import raven.sqdev.interfaces.IKeywordListChangeListener; import raven.sqdev.interfaces.IMacroSupport; -import raven.sqdev.interfaces.ISQFParseInformation; +import raven.sqdev.interfaces.IParseResult; +import raven.sqdev.interfaces.ISQFInformation; +import raven.sqdev.interfaces.ISQFParseSupplier; +import raven.sqdev.interfaces.ITreeProcessingResult; import raven.sqdev.misc.Macro; +import raven.sqdev.misc.Marker; import raven.sqdev.misc.SQDevInfobox; import raven.sqdev.parser.misc.ParseUtil; -import raven.sqdev.parser.sqf.SQFParseResult; +import raven.sqdev.parser.misc.SQFParseResult; +import raven.sqdev.parser.misc.SQFTokenFactory; import raven.sqdev.sqdevFile.ESQDevFileAnnotation; import raven.sqdev.sqdevFile.ESQDevFileAttribute; import raven.sqdev.sqdevFile.ESQDevFileType; @@ -50,7 +60,7 @@ * */ public class SQF_Editor extends BasicCodeEditor - implements IKeywordListChangeListener, IMacroSupport, ISQFParseInformation { + implements IKeywordListChangeListener, IMacroSupport, ISQFInformation, ISQFParseSupplier { /** * The KeywordProvider for the SQF keywords @@ -60,40 +70,39 @@ public class SQF_Editor extends BasicCodeEditor /** * A list of all commands that can be used as a binary operator */ - private List binaryCommands; + private Map binaryCommands; /** * A list of all commands that can be used as a unary operator */ - private List unaryCommands; + private Map unaryCommands; /** * A list of all commands that can be used as a nular operator */ - private List nularCommands; + private Map nularCommands; /** * A list of local variables in this editor */ - private List localVariables; + private Map localVariables; /** * A list of global variables in this editor */ - private List globalVariables; + private Map globalVariables; /** * A list of magic variables available in this editor */ - private List magicVariables; + private Map magicVariables; /** * A list of defined macros for this editor */ - protected List macros; + protected Map macros; /** * A list of the macro-names defined for this editor */ protected List macroNames; /** - * The CommonTokenStream that is associated with the current parse - * tree + * The token factory to use for parsing */ - private BufferedTokenStream currentStream; + protected AbstractSQFTokenFactory tokenFactory; public SQF_Editor() { super(); @@ -101,16 +110,14 @@ public SQF_Editor() { BasicSourceViewerConfiguration configuration = getBasicConfiguration(); // create respective keywordScanners - configuration.createKeywordScanner( - SQDevPreferenceConstants.SQDEV_EDITOR_KEYWORDHIGHLIGHTING_COLOR_KEY, false); - configuration.createKeywordScanner( - SQDevPreferenceConstants.SQDEV_EDITOR_LOCALVARIABLEHIGHLIGHTING_COLOR_KEY, false); - configuration.createKeywordScanner( - SQDevPreferenceConstants.SQDEV_EDITOR_GLOBALVARIABLEHIGHLIGHTING_COLOR_KEY, false); - configuration.createKeywordScanner( - SQDevPreferenceConstants.SQDEV_EDITOR_MAGICVARIABLEHIGHLIGHTING_COLOR_KEY, false); - configuration.createKeywordScanner(SQDevPreferenceConstants.SQDEV_EDITOR_MACROHIGHLIGHTING_COLOR_KEY, - true); + configuration.createKeywordScanner(SQDevPreferenceConstants.SQDEV_EDITOR_KEYWORDHIGHLIGHTING_COLOR_KEY, false); + configuration.createKeywordScanner(SQDevPreferenceConstants.SQDEV_EDITOR_LOCALVARIABLEHIGHLIGHTING_COLOR_KEY, + false); + configuration.createKeywordScanner(SQDevPreferenceConstants.SQDEV_EDITOR_GLOBALVARIABLEHIGHLIGHTING_COLOR_KEY, + false); + configuration.createKeywordScanner(SQDevPreferenceConstants.SQDEV_EDITOR_MAGICVARIABLEHIGHLIGHTING_COLOR_KEY, + false); + configuration.createKeywordScanner(SQDevPreferenceConstants.SQDEV_EDITOR_MACROHIGHLIGHTING_COLOR_KEY, true); // get keywordScanner KeywordScanner keywordScanner = configuration @@ -132,17 +139,17 @@ public SQF_Editor() { partitionScanner.removeRule(BasicPartitionScanner.DOUBLE_QUOTE_STRING_RULE); partitionScanner.addRule(new SQFStringPartitionRule(new Token(BasicPartitionScanner.BASIC_STRING))); - binaryCommands = new ArrayList(); - unaryCommands = new ArrayList(); - nularCommands = new ArrayList(); - localVariables = new ArrayList(); - globalVariables = new ArrayList(); - magicVariables = new ArrayList(); + binaryCommands = new HashMap(); + unaryCommands = new HashMap(); + nularCommands = new HashMap(); + localVariables = new HashMap(); + globalVariables = new HashMap(); + magicVariables = new HashMap(); // populate the magic vars with the stadard ones setMagicVariables(ParseUtil.getDefaultMagicVars(), false); - macros = new ArrayList(); + macros = new HashMap(); macroNames = new ArrayList(); categorizeCommands(); @@ -176,14 +183,11 @@ public void doSave(IProgressMonitor progressMonitor) { @Override protected IStatus run(IProgressMonitor monitor) { - monitor.beginTask("Export project \"" + containingProject.getName() + "\"", - 1); + monitor.beginTask("Export project \"" + containingProject.getName() + "\"", 1); try { - ProjectUtil.export(containingProject, - Util.getExportPathFor(containingProject), + ProjectUtil.export(containingProject, Util.getExportPathFor(containingProject), linkFile.parseAnnotation(ESQDevFileAnnotation.IGNORE).getValues(), - linkFile.parseAnnotation(ESQDevFileAnnotation.PRESERVE) - .getValues()); + linkFile.parseAnnotation(ESQDevFileAnnotation.PRESERVE).getValues()); monitor.worked(1); } catch (SQDevFileIsInvalidException e) { @@ -217,34 +221,42 @@ protected IStatus run(IProgressMonitor monitor) { } @Override - protected ParseTree doParse(String input) { - SQFParseResult result = ParseUtil.parseSQF(input, this); - - if (!result.providesParseTree() || !result.providesParserRuleNames() - || !result.providesTokenStream()) { - throw new SQDevCoreException("Expected SQFParseResult to contain tree, names and tokenStream!"); + protected IParseResult doParse(InputStream input) { + SQFParseResult result; + try { + result = ParseUtil.parseSQF(input, this); + } catch (IOException e) { + e.printStackTrace(); + + SQDevInfobox info = new SQDevInfobox("Error during SQF-parsing!", e); + info.open(false); + return null; } - if (parseRuleNames == null) { - parseRuleNames = result.getParserRulenames(); + for (Marker currentMarker : result.getMarkers()) { + this.createMarker(currentMarker.getType(), currentMarker.getOffset(), currentMarker.getLength(), + currentMarker.getMessage(), currentMarker.getSeverity()); } - currentStream = result.getTokenStream(); - - result.applyMarkersTo(this); - - return result.getParseTree(); + return result; } @Override - public boolean processParseTree(ParseTree parseTree) { + public boolean processParseTree(IParseResult parseResult) { + if (!(parseResult instanceof SQFParseResult)) { + throw new IllegalArgumentException("The given parse-result has to be of type SQFParseResult!"); + } // process parse result - SQFParseResult result = ParseUtil.validateSQF(parseTree, currentStream, this); + ITreeProcessingResult result = ParseUtil.processSQF((SQFParseResult) parseResult, this); setVariables(result.getDeclaredLocalVariables(), result.getDeclaredGlobalVariables()); - result.applyMarkersTo(this); - for (Position currentFoldingPos : result.getFoldingAreas()) { + for (Marker currentMarker : result.getMarkers()) { + this.createMarker(currentMarker.getType(), currentMarker.getOffset(), currentMarker.getLength(), + currentMarker.getMessage(), currentMarker.getSeverity()); + } + + for (Position currentFoldingPos : result.getFoldableAreas()) { addFoldingArea(currentFoldingPos); } @@ -258,81 +270,67 @@ public boolean processParseTree(ParseTree parseTree) { * binary/unary/nular operator */ private void categorizeCommands() { - for (Keyword currentKeyword : provider.getKeywordList().getKeywords()) { + Iterator> it = provider.getKeywordList().getKeywords().entrySet().iterator(); + + while (it.hasNext()) { + Keyword currentKeyword = it.next().getValue(); + if (currentKeyword instanceof SQFCommand) { SQFCommand currentCommand = (SQFCommand) currentKeyword; if (currentCommand.isBinaryOperator()) { - binaryCommands.add(currentCommand); + binaryCommands.put(currentCommand.getKeyword().toLowerCase(), currentCommand); } if (currentCommand.isUnaryOperator()) { - unaryCommands.add(currentCommand); + unaryCommands.put(currentCommand.getKeyword().toLowerCase(), currentCommand); } if (currentCommand.isNularOperator()) { - nularCommands.add(currentCommand); + nularCommands.put(currentCommand.getKeyword().toLowerCase(), currentCommand); } } } } - /** - * Gets all SQF commands that can be used as a binary operator - */ - public List getBinaryOperators() { - return new ArrayList(binaryCommands); + @Override + public Map getBinaryOperators() { + return binaryCommands; } - /** - * Gets all SQF commands that can be used as a unary operator - */ - public List getUnaryOperators() { - return new ArrayList(unaryCommands); + @Override + public Map getUnaryOperators() { + return unaryCommands; } - /** - * Gets all SQF commands that can be used as a nular operator - */ - public List getNularOperators() { - return new ArrayList(nularCommands); + @Override + public Map getNularOperators() { + return nularCommands; } - /** - * Gets a list of all keywords that can be used as a binary operator - */ + @Override public List getBinaryKeywords() { - ArrayList list = new ArrayList(); + List list = new ArrayList(); - for (SQFCommand currentCommand : getBinaryOperators()) { - list.add(currentCommand.getKeyword()); - } + list.addAll(binaryCommands.keySet()); return list; } - /** - * Gets a list of all keywords that can be used as a unnary operator - */ + @Override public List getUnaryKeywords() { - ArrayList list = new ArrayList(); + List list = new ArrayList(); - for (SQFCommand currentCommand : getUnaryOperators()) { - list.add(currentCommand.getKeyword()); - } + list.addAll(unaryCommands.keySet()); return list; } - /** - * Gets a list of all keywords that can be used as a nular operator - */ + @Override public List getNularKeywords() { - ArrayList list = new ArrayList(); + List list = new ArrayList(); - for (SQFCommand currentCommand : getNularOperators()) { - list.add(currentCommand.getKeyword()); - } + list.addAll(nularCommands.keySet()); return list; } @@ -360,15 +358,14 @@ public void keywordListChanged(String ctx) { * * @return True when variables were updated */ - public boolean setLocalVariables(List variables, boolean update) { + public boolean setLocalVariables(Map variables, boolean update) { if (!localVariables.equals(variables)) { - localVariables = new ArrayList(variables); + localVariables = new HashMap(variables); // update respective scanner/provider getBasicConfiguration() - .getKeywordScanner( - SQDevPreferenceConstants.SQDEV_EDITOR_LOCALVARIABLEHIGHLIGHTING_COLOR_KEY) - .getKeywordProvider().setKeywordList(new KeywordList(variables)); + .getKeywordScanner(SQDevPreferenceConstants.SQDEV_EDITOR_LOCALVARIABLEHIGHLIGHTING_COLOR_KEY) + .getKeywordProvider().setKeywordList(new KeywordList(new ArrayList<>(variables.values()))); if (update) { update(false); @@ -383,7 +380,7 @@ public boolean setLocalVariables(List variables, boolean update) { /** * Gets the list of local variables that are defined in this editor */ - public List getLocalVariables() { + public Map getLocalVariables() { return localVariables; } @@ -392,8 +389,8 @@ public List getLocalVariables() { * one list */ public List getLocalAndMagicVariables() { - List variables = (localVariables); - variables.addAll(magicVariables); + List variables = new ArrayList(localVariables.values()); + variables.addAll(magicVariables.values()); return variables; } @@ -409,15 +406,14 @@ public List getLocalAndMagicVariables() { * * @return True when variables were updated */ - public boolean setMagicVariables(List variables, boolean update) { + public boolean setMagicVariables(Map variables, boolean update) { if (!magicVariables.equals(variables)) { - magicVariables = new ArrayList(variables); + magicVariables = new HashMap(variables); // update respective scanner/provider getBasicConfiguration() - .getKeywordScanner( - SQDevPreferenceConstants.SQDEV_EDITOR_MAGICVARIABLEHIGHLIGHTING_COLOR_KEY) - .getKeywordProvider().setKeywordList(new KeywordList(variables)); + .getKeywordScanner(SQDevPreferenceConstants.SQDEV_EDITOR_MAGICVARIABLEHIGHLIGHTING_COLOR_KEY) + .getKeywordProvider().setKeywordList(new KeywordList(new ArrayList<>(variables.values()))); if (update) { update(false); @@ -430,9 +426,9 @@ public boolean setMagicVariables(List variables, boolean update) { } /** - * Gets the list of available magic variables for this editor + * Gets the set of available magic variables for this editor */ - public List getMagicVariables() { + public Map getMagicVariables() { return magicVariables; } @@ -447,15 +443,14 @@ public List getMagicVariables() { * * @return True when variables were updated */ - public boolean setGlobalVariables(List variables, boolean update) { + public boolean setGlobalVariables(Map variables, boolean update) { if (!globalVariables.equals(variables)) { - globalVariables = new ArrayList(variables); + globalVariables = variables; // update respective scanner/provider getBasicConfiguration() - .getKeywordScanner( - SQDevPreferenceConstants.SQDEV_EDITOR_GLOBALVARIABLEHIGHLIGHTING_COLOR_KEY) - .getKeywordProvider().setKeywordList(new KeywordList(variables)); + .getKeywordScanner(SQDevPreferenceConstants.SQDEV_EDITOR_GLOBALVARIABLEHIGHLIGHTING_COLOR_KEY) + .getKeywordProvider().setKeywordList(new KeywordList(new ArrayList<>(variables.values()))); if (update) { update(false); @@ -468,9 +463,9 @@ public boolean setGlobalVariables(List variables, boolean update) { } /** - * Gets the list of global variables that are defined in this editor + * Gets the set of global variables that are defined in this editor */ - public List getGlobalVariables() { + public Map getGlobalVariables() { return globalVariables; } @@ -483,7 +478,7 @@ public List getGlobalVariables() { * @param globalVariables * The new set of global variables */ - public void setVariables(List localVariables, List globalVariables) { + public void setVariables(Map localVariables, Map globalVariables) { boolean localUpdate = setLocalVariables(localVariables, false); boolean globalUpdate = setGlobalVariables(globalVariables, false); @@ -493,19 +488,18 @@ public void setVariables(List localVariables, List globalVar } @Override - public boolean setMacros(List macros, boolean update) { + public boolean setMacros(Map macros, boolean update) { macroNames.clear(); - for (Macro currentMacro : macros) { + for (Macro currentMacro : macros.values()) { macroNames.add(currentMacro.getKeyword()); } if (!this.macros.equals(macros)) { - this.macros = new ArrayList(macros); + this.macros = new HashMap(macros); // update respective scanner/provider - getBasicConfiguration() - .getKeywordScanner(SQDevPreferenceConstants.SQDEV_EDITOR_MACROHIGHLIGHTING_COLOR_KEY) - .getKeywordProvider().setKeywordList(new KeywordList(macros)); + getBasicConfiguration().getKeywordScanner(SQDevPreferenceConstants.SQDEV_EDITOR_MACROHIGHLIGHTING_COLOR_KEY) + .getKeywordProvider().setKeywordList(new KeywordList(new ArrayList<>(macros.values()))); if (update) { update(false); @@ -518,7 +512,7 @@ public boolean setMacros(List macros, boolean update) { } @Override - public List getMacros() { + public Map getMacros() { return macros; } @@ -533,10 +527,18 @@ public List getMacroNames() { public List getMagicVariableNames() { List names = new ArrayList(); - for (Variable current : magicVariables) { + for (Variable current : magicVariables.values()) { names.add(current.getKeyword()); } return names; } + + @Override + public AbstractSQFTokenFactory getTokenFactory() { + if (tokenFactory == null) { + tokenFactory = new SQFTokenFactory(getBinaryKeywords(), getUnaryKeywords()); + } + return tokenFactory; + } } diff --git a/plugin/Raven.SQDev.UI/.classpath b/plugin/Raven.SQDev.UI/.classpath index 55dd2e79..eca7bdba 100644 --- a/plugin/Raven.SQDev.UI/.classpath +++ b/plugin/Raven.SQDev.UI/.classpath @@ -3,6 +3,5 @@ - diff --git a/plugin/Raven.SQDev.UI/.gitignore b/plugin/Raven.SQDev.UI/.gitignore new file mode 100644 index 00000000..ae3c1726 --- /dev/null +++ b/plugin/Raven.SQDev.UI/.gitignore @@ -0,0 +1 @@ +/bin/ diff --git a/plugin/Raven.SQDev.UI/META-INF/MANIFEST.MF b/plugin/Raven.SQDev.UI/META-INF/MANIFEST.MF index 7be7dd83..0b4f1a62 100644 --- a/plugin/Raven.SQDev.UI/META-INF/MANIFEST.MF +++ b/plugin/Raven.SQDev.UI/META-INF/MANIFEST.MF @@ -2,35 +2,30 @@ Manifest-Version: 1.0 Bundle-ManifestVersion: 2 Bundle-Name: UI Bundle-SymbolicName: raven.sqdev.ui;singleton:=true -Bundle-Version: 0.3.1.stable +Bundle-Version: 0.3.2.stable Bundle-Activator: raven.sqdev.ui.Activator Bundle-Vendor: Raven -Require-Bundle: org.eclipse.ui, - org.eclipse.core.runtime, - raven.sqdev.editors;bundle-version="0.7.1", - raven.sqdev.util;bundle-version="0.7.1", - org.eclipse.ui.navigator, - org.eclipse.ui.ide, - org.eclipse.ui.editors;bundle-version="3.8.200", - org.eclipse.core.resources, - org.eclipse.ui.navigator.resources, - raven.sqdev.misc;bundle-version="0.6.0" Bundle-RequiredExecutionEnvironment: JavaSE-1.8 Bundle-ActivationPolicy: lazy -Bundle-ClassPath: ., - Abego/org.abego.treelayout.core-1.0.3.jar +Bundle-ClassPath: . Import-Package: org.antlr.v4.runtime, org.antlr.v4.runtime.misc, org.antlr.v4.runtime.tree, - org.eclipse.jdt.core.search, - org.eclipse.jdt.internal.ui.dialogs, + org.eclipse.core.runtime, org.eclipse.jface.text, - org.eclipse.jface.text.source, - org.eclipse.search.ui, + org.eclipse.ui.texteditor, + org.osgi.framework, raven.sqdev.constants, + raven.sqdev.editors, raven.sqdev.exceptions, raven.sqdev.fileSystemListener, raven.sqdev.interfaces, raven.sqdev.misc, + raven.sqdev.pluginManagement, raven.sqdev.util Export-Package: raven.sqdev.ui +Require-Bundle: org.eclipse.ui.workbench, + org.eclipse.jface, + org.eclipse.swt, + raven.sqdev.misc, + raven.sqdev.util diff --git a/plugin/Raven.SQDev.UI/bin/raven/sqdev/bundles/rptViewerFindDialog.properties b/plugin/Raven.SQDev.UI/bin/raven/sqdev/bundles/rptViewerFindDialog.properties deleted file mode 100644 index c42ec959..00000000 --- a/plugin/Raven.SQDev.UI/bin/raven/sqdev/bundles/rptViewerFindDialog.properties +++ /dev/null @@ -1,4 +0,0 @@ -find_replace_action_label=&Find/Replace... -find_replace_action_tooltip=Find/Replace -find_replace_action_image= -find_replace_action_description=Find/Replace \ No newline at end of file diff --git a/plugin/Raven.SQDev.UI/bin/raven/sqdev/ui/Activator.class b/plugin/Raven.SQDev.UI/bin/raven/sqdev/ui/Activator.class deleted file mode 100644 index 5035719c..00000000 Binary files a/plugin/Raven.SQDev.UI/bin/raven/sqdev/ui/Activator.class and /dev/null differ diff --git a/plugin/Raven.SQDev.UI/bin/raven/sqdev/ui/commands/CreatePluginInfo$1.class b/plugin/Raven.SQDev.UI/bin/raven/sqdev/ui/commands/CreatePluginInfo$1.class deleted file mode 100644 index dbc4f1bf..00000000 Binary files a/plugin/Raven.SQDev.UI/bin/raven/sqdev/ui/commands/CreatePluginInfo$1.class and /dev/null differ diff --git a/plugin/Raven.SQDev.UI/bin/raven/sqdev/ui/commands/CreatePluginInfo.class b/plugin/Raven.SQDev.UI/bin/raven/sqdev/ui/commands/CreatePluginInfo.class deleted file mode 100644 index 167a730a..00000000 Binary files a/plugin/Raven.SQDev.UI/bin/raven/sqdev/ui/commands/CreatePluginInfo.class and /dev/null differ diff --git a/plugin/Raven.SQDev.UI/bin/raven/sqdev/ui/commands/ShowParseTreeHandler.class b/plugin/Raven.SQDev.UI/bin/raven/sqdev/ui/commands/ShowParseTreeHandler.class deleted file mode 100644 index 7e432aca..00000000 Binary files a/plugin/Raven.SQDev.UI/bin/raven/sqdev/ui/commands/ShowParseTreeHandler.class and /dev/null differ diff --git a/plugin/Raven.SQDev.UI/bin/raven/sqdev/ui/perspectives/SQDevPerspective.class b/plugin/Raven.SQDev.UI/bin/raven/sqdev/ui/perspectives/SQDevPerspective.class deleted file mode 100644 index 79217b02..00000000 Binary files a/plugin/Raven.SQDev.UI/bin/raven/sqdev/ui/perspectives/SQDevPerspective.class and /dev/null differ diff --git a/plugin/Raven.SQDev.UI/bin/raven/sqdev/ui/util/GraphicsSupport$1.class b/plugin/Raven.SQDev.UI/bin/raven/sqdev/ui/util/GraphicsSupport$1.class deleted file mode 100644 index ff196027..00000000 Binary files a/plugin/Raven.SQDev.UI/bin/raven/sqdev/ui/util/GraphicsSupport$1.class and /dev/null differ diff --git a/plugin/Raven.SQDev.UI/bin/raven/sqdev/ui/util/GraphicsSupport.class b/plugin/Raven.SQDev.UI/bin/raven/sqdev/ui/util/GraphicsSupport.class deleted file mode 100644 index 5c5e2e8a..00000000 Binary files a/plugin/Raven.SQDev.UI/bin/raven/sqdev/ui/util/GraphicsSupport.class and /dev/null differ diff --git a/plugin/Raven.SQDev.UI/bin/raven/sqdev/ui/util/ITreeTextProvider.class b/plugin/Raven.SQDev.UI/bin/raven/sqdev/ui/util/ITreeTextProvider.class deleted file mode 100644 index eb60e3b1..00000000 Binary files a/plugin/Raven.SQDev.UI/bin/raven/sqdev/ui/util/ITreeTextProvider.class and /dev/null differ diff --git a/plugin/Raven.SQDev.UI/bin/raven/sqdev/ui/util/IndexPair.class b/plugin/Raven.SQDev.UI/bin/raven/sqdev/ui/util/IndexPair.class deleted file mode 100644 index bbb3a648..00000000 Binary files a/plugin/Raven.SQDev.UI/bin/raven/sqdev/ui/util/IndexPair.class and /dev/null differ diff --git a/plugin/Raven.SQDev.UI/bin/raven/sqdev/ui/util/JFileChooserConfirmOverwrite.class b/plugin/Raven.SQDev.UI/bin/raven/sqdev/ui/util/JFileChooserConfirmOverwrite.class deleted file mode 100644 index 54f5fc05..00000000 Binary files a/plugin/Raven.SQDev.UI/bin/raven/sqdev/ui/util/JFileChooserConfirmOverwrite.class and /dev/null differ diff --git a/plugin/Raven.SQDev.UI/bin/raven/sqdev/ui/util/TreeLayoutAdaptor$AntlrTreeChildrenIterable$1.class b/plugin/Raven.SQDev.UI/bin/raven/sqdev/ui/util/TreeLayoutAdaptor$AntlrTreeChildrenIterable$1.class deleted file mode 100644 index 0daa541a..00000000 Binary files a/plugin/Raven.SQDev.UI/bin/raven/sqdev/ui/util/TreeLayoutAdaptor$AntlrTreeChildrenIterable$1.class and /dev/null differ diff --git a/plugin/Raven.SQDev.UI/bin/raven/sqdev/ui/util/TreeLayoutAdaptor$AntlrTreeChildrenIterable.class b/plugin/Raven.SQDev.UI/bin/raven/sqdev/ui/util/TreeLayoutAdaptor$AntlrTreeChildrenIterable.class deleted file mode 100644 index b9c0ca20..00000000 Binary files a/plugin/Raven.SQDev.UI/bin/raven/sqdev/ui/util/TreeLayoutAdaptor$AntlrTreeChildrenIterable.class and /dev/null differ diff --git a/plugin/Raven.SQDev.UI/bin/raven/sqdev/ui/util/TreeLayoutAdaptor$AntlrTreeChildrenReverseIterable$1.class b/plugin/Raven.SQDev.UI/bin/raven/sqdev/ui/util/TreeLayoutAdaptor$AntlrTreeChildrenReverseIterable$1.class deleted file mode 100644 index 82594a16..00000000 Binary files a/plugin/Raven.SQDev.UI/bin/raven/sqdev/ui/util/TreeLayoutAdaptor$AntlrTreeChildrenReverseIterable$1.class and /dev/null differ diff --git a/plugin/Raven.SQDev.UI/bin/raven/sqdev/ui/util/TreeLayoutAdaptor$AntlrTreeChildrenReverseIterable.class b/plugin/Raven.SQDev.UI/bin/raven/sqdev/ui/util/TreeLayoutAdaptor$AntlrTreeChildrenReverseIterable.class deleted file mode 100644 index f6f5f70e..00000000 Binary files a/plugin/Raven.SQDev.UI/bin/raven/sqdev/ui/util/TreeLayoutAdaptor$AntlrTreeChildrenReverseIterable.class and /dev/null differ diff --git a/plugin/Raven.SQDev.UI/bin/raven/sqdev/ui/util/TreeLayoutAdaptor.class b/plugin/Raven.SQDev.UI/bin/raven/sqdev/ui/util/TreeLayoutAdaptor.class deleted file mode 100644 index 21f4fc69..00000000 Binary files a/plugin/Raven.SQDev.UI/bin/raven/sqdev/ui/util/TreeLayoutAdaptor.class and /dev/null differ diff --git a/plugin/Raven.SQDev.UI/bin/raven/sqdev/ui/util/TreeViewer$1.class b/plugin/Raven.SQDev.UI/bin/raven/sqdev/ui/util/TreeViewer$1.class deleted file mode 100644 index 8c5a2b69..00000000 Binary files a/plugin/Raven.SQDev.UI/bin/raven/sqdev/ui/util/TreeViewer$1.class and /dev/null differ diff --git a/plugin/Raven.SQDev.UI/bin/raven/sqdev/ui/util/TreeViewer$2.class b/plugin/Raven.SQDev.UI/bin/raven/sqdev/ui/util/TreeViewer$2.class deleted file mode 100644 index 62425f29..00000000 Binary files a/plugin/Raven.SQDev.UI/bin/raven/sqdev/ui/util/TreeViewer$2.class and /dev/null differ diff --git a/plugin/Raven.SQDev.UI/bin/raven/sqdev/ui/util/TreeViewer$3.class b/plugin/Raven.SQDev.UI/bin/raven/sqdev/ui/util/TreeViewer$3.class deleted file mode 100644 index eddfff03..00000000 Binary files a/plugin/Raven.SQDev.UI/bin/raven/sqdev/ui/util/TreeViewer$3.class and /dev/null differ diff --git a/plugin/Raven.SQDev.UI/bin/raven/sqdev/ui/util/TreeViewer$4.class b/plugin/Raven.SQDev.UI/bin/raven/sqdev/ui/util/TreeViewer$4.class deleted file mode 100644 index d83db46a..00000000 Binary files a/plugin/Raven.SQDev.UI/bin/raven/sqdev/ui/util/TreeViewer$4.class and /dev/null differ diff --git a/plugin/Raven.SQDev.UI/bin/raven/sqdev/ui/util/TreeViewer$5.class b/plugin/Raven.SQDev.UI/bin/raven/sqdev/ui/util/TreeViewer$5.class deleted file mode 100644 index 57f414ee..00000000 Binary files a/plugin/Raven.SQDev.UI/bin/raven/sqdev/ui/util/TreeViewer$5.class and /dev/null differ diff --git a/plugin/Raven.SQDev.UI/bin/raven/sqdev/ui/util/TreeViewer$6.class b/plugin/Raven.SQDev.UI/bin/raven/sqdev/ui/util/TreeViewer$6.class deleted file mode 100644 index d614ba90..00000000 Binary files a/plugin/Raven.SQDev.UI/bin/raven/sqdev/ui/util/TreeViewer$6.class and /dev/null differ diff --git a/plugin/Raven.SQDev.UI/bin/raven/sqdev/ui/util/TreeViewer$DefaultTreeTextProvider.class b/plugin/Raven.SQDev.UI/bin/raven/sqdev/ui/util/TreeViewer$DefaultTreeTextProvider.class deleted file mode 100644 index 6bd3674e..00000000 Binary files a/plugin/Raven.SQDev.UI/bin/raven/sqdev/ui/util/TreeViewer$DefaultTreeTextProvider.class and /dev/null differ diff --git a/plugin/Raven.SQDev.UI/bin/raven/sqdev/ui/util/TreeViewer$EmptyIcon.class b/plugin/Raven.SQDev.UI/bin/raven/sqdev/ui/util/TreeViewer$EmptyIcon.class deleted file mode 100644 index 2562812f..00000000 Binary files a/plugin/Raven.SQDev.UI/bin/raven/sqdev/ui/util/TreeViewer$EmptyIcon.class and /dev/null differ diff --git a/plugin/Raven.SQDev.UI/bin/raven/sqdev/ui/util/TreeViewer$TreeNodeWrapper.class b/plugin/Raven.SQDev.UI/bin/raven/sqdev/ui/util/TreeViewer$TreeNodeWrapper.class deleted file mode 100644 index a8273e15..00000000 Binary files a/plugin/Raven.SQDev.UI/bin/raven/sqdev/ui/util/TreeViewer$TreeNodeWrapper.class and /dev/null differ diff --git a/plugin/Raven.SQDev.UI/bin/raven/sqdev/ui/util/TreeViewer$VariableExtentProvide.class b/plugin/Raven.SQDev.UI/bin/raven/sqdev/ui/util/TreeViewer$VariableExtentProvide.class deleted file mode 100644 index 102b50da..00000000 Binary files a/plugin/Raven.SQDev.UI/bin/raven/sqdev/ui/util/TreeViewer$VariableExtentProvide.class and /dev/null differ diff --git a/plugin/Raven.SQDev.UI/bin/raven/sqdev/ui/util/TreeViewer.class b/plugin/Raven.SQDev.UI/bin/raven/sqdev/ui/util/TreeViewer.class deleted file mode 100644 index 6e35905c..00000000 Binary files a/plugin/Raven.SQDev.UI/bin/raven/sqdev/ui/util/TreeViewer.class and /dev/null differ diff --git a/plugin/Raven.SQDev.UI/bin/raven/sqdev/ui/views/RPTViewer$1$1.class b/plugin/Raven.SQDev.UI/bin/raven/sqdev/ui/views/RPTViewer$1$1.class deleted file mode 100644 index ce6dbcfa..00000000 Binary files a/plugin/Raven.SQDev.UI/bin/raven/sqdev/ui/views/RPTViewer$1$1.class and /dev/null differ diff --git a/plugin/Raven.SQDev.UI/bin/raven/sqdev/ui/views/RPTViewer$1.class b/plugin/Raven.SQDev.UI/bin/raven/sqdev/ui/views/RPTViewer$1.class deleted file mode 100644 index 6af58ae9..00000000 Binary files a/plugin/Raven.SQDev.UI/bin/raven/sqdev/ui/views/RPTViewer$1.class and /dev/null differ diff --git a/plugin/Raven.SQDev.UI/bin/raven/sqdev/ui/views/RPTViewer$2.class b/plugin/Raven.SQDev.UI/bin/raven/sqdev/ui/views/RPTViewer$2.class deleted file mode 100644 index bbe83ef3..00000000 Binary files a/plugin/Raven.SQDev.UI/bin/raven/sqdev/ui/views/RPTViewer$2.class and /dev/null differ diff --git a/plugin/Raven.SQDev.UI/bin/raven/sqdev/ui/views/RPTViewer$3.class b/plugin/Raven.SQDev.UI/bin/raven/sqdev/ui/views/RPTViewer$3.class deleted file mode 100644 index a236fc2e..00000000 Binary files a/plugin/Raven.SQDev.UI/bin/raven/sqdev/ui/views/RPTViewer$3.class and /dev/null differ diff --git a/plugin/Raven.SQDev.UI/bin/raven/sqdev/ui/views/RPTViewer$4.class b/plugin/Raven.SQDev.UI/bin/raven/sqdev/ui/views/RPTViewer$4.class deleted file mode 100644 index f7e6dbb7..00000000 Binary files a/plugin/Raven.SQDev.UI/bin/raven/sqdev/ui/views/RPTViewer$4.class and /dev/null differ diff --git a/plugin/Raven.SQDev.UI/bin/raven/sqdev/ui/views/RPTViewer$5$1.class b/plugin/Raven.SQDev.UI/bin/raven/sqdev/ui/views/RPTViewer$5$1.class deleted file mode 100644 index 8d37ee58..00000000 Binary files a/plugin/Raven.SQDev.UI/bin/raven/sqdev/ui/views/RPTViewer$5$1.class and /dev/null differ diff --git a/plugin/Raven.SQDev.UI/bin/raven/sqdev/ui/views/RPTViewer$5$2.class b/plugin/Raven.SQDev.UI/bin/raven/sqdev/ui/views/RPTViewer$5$2.class deleted file mode 100644 index a2946dcb..00000000 Binary files a/plugin/Raven.SQDev.UI/bin/raven/sqdev/ui/views/RPTViewer$5$2.class and /dev/null differ diff --git a/plugin/Raven.SQDev.UI/bin/raven/sqdev/ui/views/RPTViewer$5$3.class b/plugin/Raven.SQDev.UI/bin/raven/sqdev/ui/views/RPTViewer$5$3.class deleted file mode 100644 index f660aa2a..00000000 Binary files a/plugin/Raven.SQDev.UI/bin/raven/sqdev/ui/views/RPTViewer$5$3.class and /dev/null differ diff --git a/plugin/Raven.SQDev.UI/bin/raven/sqdev/ui/views/RPTViewer$5.class b/plugin/Raven.SQDev.UI/bin/raven/sqdev/ui/views/RPTViewer$5.class deleted file mode 100644 index 407dd129..00000000 Binary files a/plugin/Raven.SQDev.UI/bin/raven/sqdev/ui/views/RPTViewer$5.class and /dev/null differ diff --git a/plugin/Raven.SQDev.UI/bin/raven/sqdev/ui/views/RPTViewer.class b/plugin/Raven.SQDev.UI/bin/raven/sqdev/ui/views/RPTViewer.class deleted file mode 100644 index c37702b2..00000000 Binary files a/plugin/Raven.SQDev.UI/bin/raven/sqdev/ui/views/RPTViewer.class and /dev/null differ diff --git a/plugin/Raven.SQDev.UI/plugin.xml b/plugin/Raven.SQDev.UI/plugin.xml index c6464980..192256d1 100644 --- a/plugin/Raven.SQDev.UI/plugin.xml +++ b/plugin/Raven.SQDev.UI/plugin.xml @@ -9,8 +9,8 @@ @@ -28,10 +28,10 @@ point="org.eclipse.ui.commands"> + defaultHandler="raven.sqdev.ui.commands.ShowSyntaxTreeHandler" + description="Displays the syntax tree graphically" + id="raven.sqdev.command.showSyntaxTree" + name="Show syntax tree"> ruleNames = activeEditor.getParseRuleNames(); - - if (tree != null && ruleNames != null) { - TreeViewer viewer = new TreeViewer(ruleNames, tree); - viewer.open(); - } - } - return null; - } - -} diff --git a/plugin/Raven.SQDev.UI/src/raven/sqdev/ui/commands/ShowSyntaxTreeHandler.java b/plugin/Raven.SQDev.UI/src/raven/sqdev/ui/commands/ShowSyntaxTreeHandler.java new file mode 100644 index 00000000..b8ae2f86 --- /dev/null +++ b/plugin/Raven.SQDev.UI/src/raven/sqdev/ui/commands/ShowSyntaxTreeHandler.java @@ -0,0 +1,51 @@ +package raven.sqdev.ui.commands; + +import org.eclipse.core.commands.AbstractHandler; +import org.eclipse.core.commands.ExecutionEvent; +import org.eclipse.core.commands.ExecutionException; +import org.eclipse.swt.SWT; +import org.eclipse.swt.layout.FillLayout; +import org.eclipse.swt.widgets.Shell; +import org.eclipse.ui.IEditorPart; +import org.eclipse.ui.PlatformUI; +import raven.sqdev.editors.BasicCodeEditor; +import raven.sqdev.interfaces.IParseResult; +import raven.sqdev.misc.SQDevInfobox; +import ui.TreeUI; + +public class ShowSyntaxTreeHandler extends AbstractHandler { + + @Override + public Object execute(ExecutionEvent event) throws ExecutionException { + IEditorPart active = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().getActiveEditor(); + + if (active != null && active instanceof BasicCodeEditor) { + BasicCodeEditor activeEditor = (BasicCodeEditor) active; + + IParseResult parseResult = activeEditor.getParseResult(); + + Shell shell = new Shell(PlatformUI.getWorkbench().getDisplay()); + shell.setLayout(new FillLayout()); + shell.setText("Syntax Tree"); + + if (parseResult == null) { + // there is nothing to display + + SQDevInfobox info = new SQDevInfobox("There is no syntax tree to display here.\n" + + "Note that the syntax tree can only be shown when having an SQF editor opened. " + + "If you do happen do have one opened, try to let its content be parsed and try again.", + SWT.ICON_INFORMATION); + + info.open(false); + + return null; + } + + new TreeUI(shell, SWT.NONE, parseResult.getTree(), parseResult.getTokenBuffer()); + + shell.open(); + } + return null; + } + +} diff --git a/plugin/Raven.SQDev.UI/src/raven/sqdev/ui/views/RPTViewer.java b/plugin/Raven.SQDev.UI/src/raven/sqdev/ui/views/RPTViewer.java index de22c064..1b9f9c14 100644 --- a/plugin/Raven.SQDev.UI/src/raven/sqdev/ui/views/RPTViewer.java +++ b/plugin/Raven.SQDev.UI/src/raven/sqdev/ui/views/RPTViewer.java @@ -22,7 +22,6 @@ import java.util.regex.Matcher; import java.util.regex.Pattern; import java.util.stream.Collectors; - import org.eclipse.core.runtime.IPath; import org.eclipse.core.runtime.Path; import org.eclipse.jface.action.Action; @@ -62,7 +61,6 @@ import org.eclipse.ui.actions.ActionFactory; import org.eclipse.ui.part.ViewPart; import org.eclipse.ui.texteditor.FindReplaceAction; - import raven.sqdev.constants.SQDevPreferenceConstants; import raven.sqdev.exceptions.SQDevException; import raven.sqdev.fileSystemListener.FileSystemChangeAdapter; diff --git a/plugin/Raven.SQDev.Util/.gitignore b/plugin/Raven.SQDev.Util/.gitignore new file mode 100644 index 00000000..ae3c1726 --- /dev/null +++ b/plugin/Raven.SQDev.Util/.gitignore @@ -0,0 +1 @@ +/bin/ diff --git a/plugin/Raven.SQDev.Util/META-INF/MANIFEST.MF b/plugin/Raven.SQDev.Util/META-INF/MANIFEST.MF index 14f0a19c..827047da 100644 --- a/plugin/Raven.SQDev.Util/META-INF/MANIFEST.MF +++ b/plugin/Raven.SQDev.Util/META-INF/MANIFEST.MF @@ -2,7 +2,7 @@ Manifest-Version: 1.0 Bundle-ManifestVersion: 2 Bundle-Name: Util Bundle-SymbolicName: raven.sqdev.util;singleton:=true -Bundle-Version: 0.7.2.stable +Bundle-Version: 0.7.3.stable Bundle-Activator: raven.sqdev.activator.Activator Bundle-Vendor: Raven Require-Bundle: org.eclipse.core.runtime, @@ -12,7 +12,7 @@ Require-Bundle: org.eclipse.core.runtime, org.eclipse.ui.editors, org.eclipse.ui.workbench, org.eclipse.swt, - raven.sqdev.misc;bundle-version="0.1.0", + raven.sqdev.misc, org.eclipse.jface.text, org.eclipse.ui Bundle-RequiredExecutionEnvironment: JavaSE-1.8 diff --git a/plugin/Raven.SQDev.Util/bin/raven/sqdev/actions/WikiAction$1.class b/plugin/Raven.SQDev.Util/bin/raven/sqdev/actions/WikiAction$1.class deleted file mode 100644 index 05b198e4..00000000 Binary files a/plugin/Raven.SQDev.Util/bin/raven/sqdev/actions/WikiAction$1.class and /dev/null differ diff --git a/plugin/Raven.SQDev.Util/bin/raven/sqdev/actions/WikiAction.class b/plugin/Raven.SQDev.Util/bin/raven/sqdev/actions/WikiAction.class deleted file mode 100644 index 7699f315..00000000 Binary files a/plugin/Raven.SQDev.Util/bin/raven/sqdev/actions/WikiAction.class and /dev/null differ diff --git a/plugin/Raven.SQDev.Util/bin/raven/sqdev/activator/Activator.class b/plugin/Raven.SQDev.Util/bin/raven/sqdev/activator/Activator.class deleted file mode 100644 index 3641e348..00000000 Binary files a/plugin/Raven.SQDev.Util/bin/raven/sqdev/activator/Activator.class and /dev/null differ diff --git a/plugin/Raven.SQDev.Util/bin/raven/sqdev/exceptions/FailedAtCreatingFileException.class b/plugin/Raven.SQDev.Util/bin/raven/sqdev/exceptions/FailedAtCreatingFileException.class deleted file mode 100644 index b8610099..00000000 Binary files a/plugin/Raven.SQDev.Util/bin/raven/sqdev/exceptions/FailedAtCreatingFileException.class and /dev/null differ diff --git a/plugin/Raven.SQDev.Util/bin/raven/sqdev/exceptions/IllegalAccessStateException.class b/plugin/Raven.SQDev.Util/bin/raven/sqdev/exceptions/IllegalAccessStateException.class deleted file mode 100644 index db7de0ed..00000000 Binary files a/plugin/Raven.SQDev.Util/bin/raven/sqdev/exceptions/IllegalAccessStateException.class and /dev/null differ diff --git a/plugin/Raven.SQDev.Util/bin/raven/sqdev/exceptions/IllegalRGBSyntaxException.class b/plugin/Raven.SQDev.Util/bin/raven/sqdev/exceptions/IllegalRGBSyntaxException.class deleted file mode 100644 index f081cb3c..00000000 Binary files a/plugin/Raven.SQDev.Util/bin/raven/sqdev/exceptions/IllegalRGBSyntaxException.class and /dev/null differ diff --git a/plugin/Raven.SQDev.Util/bin/raven/sqdev/exceptions/SQDevCoreException.class b/plugin/Raven.SQDev.Util/bin/raven/sqdev/exceptions/SQDevCoreException.class deleted file mode 100644 index 70292901..00000000 Binary files a/plugin/Raven.SQDev.Util/bin/raven/sqdev/exceptions/SQDevCoreException.class and /dev/null differ diff --git a/plugin/Raven.SQDev.Util/bin/raven/sqdev/exceptions/SQDevException.class b/plugin/Raven.SQDev.Util/bin/raven/sqdev/exceptions/SQDevException.class deleted file mode 100644 index 883ed3a8..00000000 Binary files a/plugin/Raven.SQDev.Util/bin/raven/sqdev/exceptions/SQDevException.class and /dev/null differ diff --git a/plugin/Raven.SQDev.Util/bin/raven/sqdev/exceptions/SQDevFileIsInvalidException.class b/plugin/Raven.SQDev.Util/bin/raven/sqdev/exceptions/SQDevFileIsInvalidException.class deleted file mode 100644 index c501afca..00000000 Binary files a/plugin/Raven.SQDev.Util/bin/raven/sqdev/exceptions/SQDevFileIsInvalidException.class and /dev/null differ diff --git a/plugin/Raven.SQDev.Util/bin/raven/sqdev/exceptions/SQDevFileNoSuchAttributeException.class b/plugin/Raven.SQDev.Util/bin/raven/sqdev/exceptions/SQDevFileNoSuchAttributeException.class deleted file mode 100644 index 0d3597c7..00000000 Binary files a/plugin/Raven.SQDev.Util/bin/raven/sqdev/exceptions/SQDevFileNoSuchAttributeException.class and /dev/null differ diff --git a/plugin/Raven.SQDev.Util/bin/raven/sqdev/exceptions/SQDevIllegalFileChangeException.class b/plugin/Raven.SQDev.Util/bin/raven/sqdev/exceptions/SQDevIllegalFileChangeException.class deleted file mode 100644 index e69f2d8b..00000000 Binary files a/plugin/Raven.SQDev.Util/bin/raven/sqdev/exceptions/SQDevIllegalFileChangeException.class and /dev/null differ diff --git a/plugin/Raven.SQDev.Util/bin/raven/sqdev/exceptions/SQDevInvalidPreferenceException.class b/plugin/Raven.SQDev.Util/bin/raven/sqdev/exceptions/SQDevInvalidPreferenceException.class deleted file mode 100644 index c2bbefd5..00000000 Binary files a/plugin/Raven.SQDev.Util/bin/raven/sqdev/exceptions/SQDevInvalidPreferenceException.class and /dev/null differ diff --git a/plugin/Raven.SQDev.Util/bin/raven/sqdev/miscellaneous/AdditionalKeywordProposalInformation.class b/plugin/Raven.SQDev.Util/bin/raven/sqdev/miscellaneous/AdditionalKeywordProposalInformation.class deleted file mode 100644 index 5ead43c5..00000000 Binary files a/plugin/Raven.SQDev.Util/bin/raven/sqdev/miscellaneous/AdditionalKeywordProposalInformation.class and /dev/null differ diff --git a/plugin/Raven.SQDev.Util/bin/raven/sqdev/sqdevFile/ESQDevFileAnnotation$1.class b/plugin/Raven.SQDev.Util/bin/raven/sqdev/sqdevFile/ESQDevFileAnnotation$1.class deleted file mode 100644 index 38d13305..00000000 Binary files a/plugin/Raven.SQDev.Util/bin/raven/sqdev/sqdevFile/ESQDevFileAnnotation$1.class and /dev/null differ diff --git a/plugin/Raven.SQDev.Util/bin/raven/sqdev/sqdevFile/ESQDevFileAnnotation$2.class b/plugin/Raven.SQDev.Util/bin/raven/sqdev/sqdevFile/ESQDevFileAnnotation$2.class deleted file mode 100644 index 91a7f606..00000000 Binary files a/plugin/Raven.SQDev.Util/bin/raven/sqdev/sqdevFile/ESQDevFileAnnotation$2.class and /dev/null differ diff --git a/plugin/Raven.SQDev.Util/bin/raven/sqdev/sqdevFile/ESQDevFileAnnotation.class b/plugin/Raven.SQDev.Util/bin/raven/sqdev/sqdevFile/ESQDevFileAnnotation.class deleted file mode 100644 index f17458ec..00000000 Binary files a/plugin/Raven.SQDev.Util/bin/raven/sqdev/sqdevFile/ESQDevFileAnnotation.class and /dev/null differ diff --git a/plugin/Raven.SQDev.Util/bin/raven/sqdev/sqdevFile/ESQDevFileAttribute$1.class b/plugin/Raven.SQDev.Util/bin/raven/sqdev/sqdevFile/ESQDevFileAttribute$1.class deleted file mode 100644 index f53d9eca..00000000 Binary files a/plugin/Raven.SQDev.Util/bin/raven/sqdev/sqdevFile/ESQDevFileAttribute$1.class and /dev/null differ diff --git a/plugin/Raven.SQDev.Util/bin/raven/sqdev/sqdevFile/ESQDevFileAttribute$2.class b/plugin/Raven.SQDev.Util/bin/raven/sqdev/sqdevFile/ESQDevFileAttribute$2.class deleted file mode 100644 index 71ccd245..00000000 Binary files a/plugin/Raven.SQDev.Util/bin/raven/sqdev/sqdevFile/ESQDevFileAttribute$2.class and /dev/null differ diff --git a/plugin/Raven.SQDev.Util/bin/raven/sqdev/sqdevFile/ESQDevFileAttribute$3.class b/plugin/Raven.SQDev.Util/bin/raven/sqdev/sqdevFile/ESQDevFileAttribute$3.class deleted file mode 100644 index 538d3fde..00000000 Binary files a/plugin/Raven.SQDev.Util/bin/raven/sqdev/sqdevFile/ESQDevFileAttribute$3.class and /dev/null differ diff --git a/plugin/Raven.SQDev.Util/bin/raven/sqdev/sqdevFile/ESQDevFileAttribute$4.class b/plugin/Raven.SQDev.Util/bin/raven/sqdev/sqdevFile/ESQDevFileAttribute$4.class deleted file mode 100644 index fa12e83d..00000000 Binary files a/plugin/Raven.SQDev.Util/bin/raven/sqdev/sqdevFile/ESQDevFileAttribute$4.class and /dev/null differ diff --git a/plugin/Raven.SQDev.Util/bin/raven/sqdev/sqdevFile/ESQDevFileAttribute.class b/plugin/Raven.SQDev.Util/bin/raven/sqdev/sqdevFile/ESQDevFileAttribute.class deleted file mode 100644 index 06e6d37a..00000000 Binary files a/plugin/Raven.SQDev.Util/bin/raven/sqdev/sqdevFile/ESQDevFileAttribute.class and /dev/null differ diff --git a/plugin/Raven.SQDev.Util/bin/raven/sqdev/sqdevFile/ESQDevFileType$1.class b/plugin/Raven.SQDev.Util/bin/raven/sqdev/sqdevFile/ESQDevFileType$1.class deleted file mode 100644 index f4d1f931..00000000 Binary files a/plugin/Raven.SQDev.Util/bin/raven/sqdev/sqdevFile/ESQDevFileType$1.class and /dev/null differ diff --git a/plugin/Raven.SQDev.Util/bin/raven/sqdev/sqdevFile/ESQDevFileType.class b/plugin/Raven.SQDev.Util/bin/raven/sqdev/sqdevFile/ESQDevFileType.class deleted file mode 100644 index 49a54e4d..00000000 Binary files a/plugin/Raven.SQDev.Util/bin/raven/sqdev/sqdevFile/ESQDevFileType.class and /dev/null differ diff --git a/plugin/Raven.SQDev.Util/bin/raven/sqdev/sqdevFile/SQDevFile.class b/plugin/Raven.SQDev.Util/bin/raven/sqdev/sqdevFile/SQDevFile.class deleted file mode 100644 index d5f6a578..00000000 Binary files a/plugin/Raven.SQDev.Util/bin/raven/sqdev/sqdevFile/SQDevFile.class and /dev/null differ diff --git a/plugin/Raven.SQDev.Util/bin/raven/sqdev/startup/SQDevStarter.class b/plugin/Raven.SQDev.Util/bin/raven/sqdev/startup/SQDevStarter.class deleted file mode 100644 index 948476aa..00000000 Binary files a/plugin/Raven.SQDev.Util/bin/raven/sqdev/startup/SQDevStarter.class and /dev/null differ diff --git a/plugin/Raven.SQDev.Util/bin/raven/sqdev/util/Activator.class b/plugin/Raven.SQDev.Util/bin/raven/sqdev/util/Activator.class deleted file mode 100644 index f121bea0..00000000 Binary files a/plugin/Raven.SQDev.Util/bin/raven/sqdev/util/Activator.class and /dev/null differ diff --git a/plugin/Raven.SQDev.Util/bin/raven/sqdev/util/EFileType$1.class b/plugin/Raven.SQDev.Util/bin/raven/sqdev/util/EFileType$1.class deleted file mode 100644 index ddd3dbde..00000000 Binary files a/plugin/Raven.SQDev.Util/bin/raven/sqdev/util/EFileType$1.class and /dev/null differ diff --git a/plugin/Raven.SQDev.Util/bin/raven/sqdev/util/EFileType$2.class b/plugin/Raven.SQDev.Util/bin/raven/sqdev/util/EFileType$2.class deleted file mode 100644 index 049d0837..00000000 Binary files a/plugin/Raven.SQDev.Util/bin/raven/sqdev/util/EFileType$2.class and /dev/null differ diff --git a/plugin/Raven.SQDev.Util/bin/raven/sqdev/util/EFileType$3.class b/plugin/Raven.SQDev.Util/bin/raven/sqdev/util/EFileType$3.class deleted file mode 100644 index 8d24ada6..00000000 Binary files a/plugin/Raven.SQDev.Util/bin/raven/sqdev/util/EFileType$3.class and /dev/null differ diff --git a/plugin/Raven.SQDev.Util/bin/raven/sqdev/util/EFileType$4.class b/plugin/Raven.SQDev.Util/bin/raven/sqdev/util/EFileType$4.class deleted file mode 100644 index 29a94e1c..00000000 Binary files a/plugin/Raven.SQDev.Util/bin/raven/sqdev/util/EFileType$4.class and /dev/null differ diff --git a/plugin/Raven.SQDev.Util/bin/raven/sqdev/util/EFileType$5.class b/plugin/Raven.SQDev.Util/bin/raven/sqdev/util/EFileType$5.class deleted file mode 100644 index 17b8d607..00000000 Binary files a/plugin/Raven.SQDev.Util/bin/raven/sqdev/util/EFileType$5.class and /dev/null differ diff --git a/plugin/Raven.SQDev.Util/bin/raven/sqdev/util/EFileType$6.class b/plugin/Raven.SQDev.Util/bin/raven/sqdev/util/EFileType$6.class deleted file mode 100644 index a840cb4e..00000000 Binary files a/plugin/Raven.SQDev.Util/bin/raven/sqdev/util/EFileType$6.class and /dev/null differ diff --git a/plugin/Raven.SQDev.Util/bin/raven/sqdev/util/EFileType$7.class b/plugin/Raven.SQDev.Util/bin/raven/sqdev/util/EFileType$7.class deleted file mode 100644 index e50dd6a7..00000000 Binary files a/plugin/Raven.SQDev.Util/bin/raven/sqdev/util/EFileType$7.class and /dev/null differ diff --git a/plugin/Raven.SQDev.Util/bin/raven/sqdev/util/EFileType$8$1.class b/plugin/Raven.SQDev.Util/bin/raven/sqdev/util/EFileType$8$1.class deleted file mode 100644 index c713c27f..00000000 Binary files a/plugin/Raven.SQDev.Util/bin/raven/sqdev/util/EFileType$8$1.class and /dev/null differ diff --git a/plugin/Raven.SQDev.Util/bin/raven/sqdev/util/EFileType$8.class b/plugin/Raven.SQDev.Util/bin/raven/sqdev/util/EFileType$8.class deleted file mode 100644 index 986d431b..00000000 Binary files a/plugin/Raven.SQDev.Util/bin/raven/sqdev/util/EFileType$8.class and /dev/null differ diff --git a/plugin/Raven.SQDev.Util/bin/raven/sqdev/util/EFileType$9.class b/plugin/Raven.SQDev.Util/bin/raven/sqdev/util/EFileType$9.class deleted file mode 100644 index fca8ddc1..00000000 Binary files a/plugin/Raven.SQDev.Util/bin/raven/sqdev/util/EFileType$9.class and /dev/null differ diff --git a/plugin/Raven.SQDev.Util/bin/raven/sqdev/util/EFileType.class b/plugin/Raven.SQDev.Util/bin/raven/sqdev/util/EFileType.class deleted file mode 100644 index b751073b..00000000 Binary files a/plugin/Raven.SQDev.Util/bin/raven/sqdev/util/EFileType.class and /dev/null differ diff --git a/plugin/Raven.SQDev.Util/bin/raven/sqdev/util/EProjectType.class b/plugin/Raven.SQDev.Util/bin/raven/sqdev/util/EProjectType.class deleted file mode 100644 index 1898996d..00000000 Binary files a/plugin/Raven.SQDev.Util/bin/raven/sqdev/util/EProjectType.class and /dev/null differ diff --git a/plugin/Raven.SQDev.Util/bin/raven/sqdev/util/EditorUtil.class b/plugin/Raven.SQDev.Util/bin/raven/sqdev/util/EditorUtil.class deleted file mode 100644 index 413e827e..00000000 Binary files a/plugin/Raven.SQDev.Util/bin/raven/sqdev/util/EditorUtil.class and /dev/null differ diff --git a/plugin/Raven.SQDev.Util/bin/raven/sqdev/util/FileSystemUtil.class b/plugin/Raven.SQDev.Util/bin/raven/sqdev/util/FileSystemUtil.class deleted file mode 100644 index 87188856..00000000 Binary files a/plugin/Raven.SQDev.Util/bin/raven/sqdev/util/FileSystemUtil.class and /dev/null differ diff --git a/plugin/Raven.SQDev.Util/bin/raven/sqdev/util/ProjectUtil$1.class b/plugin/Raven.SQDev.Util/bin/raven/sqdev/util/ProjectUtil$1.class deleted file mode 100644 index d2e61257..00000000 Binary files a/plugin/Raven.SQDev.Util/bin/raven/sqdev/util/ProjectUtil$1.class and /dev/null differ diff --git a/plugin/Raven.SQDev.Util/bin/raven/sqdev/util/ProjectUtil.class b/plugin/Raven.SQDev.Util/bin/raven/sqdev/util/ProjectUtil.class deleted file mode 100644 index 5ce11c07..00000000 Binary files a/plugin/Raven.SQDev.Util/bin/raven/sqdev/util/ProjectUtil.class and /dev/null differ diff --git a/plugin/Raven.SQDev.Util/bin/raven/sqdev/util/SQDevInformation.class b/plugin/Raven.SQDev.Util/bin/raven/sqdev/util/SQDevInformation.class deleted file mode 100644 index 3ae635dc..00000000 Binary files a/plugin/Raven.SQDev.Util/bin/raven/sqdev/util/SQDevInformation.class and /dev/null differ diff --git a/plugin/Raven.SQDev.Util/bin/raven/sqdev/util/SQDevProjectBuilder.class b/plugin/Raven.SQDev.Util/bin/raven/sqdev/util/SQDevProjectBuilder.class deleted file mode 100644 index e5091fdd..00000000 Binary files a/plugin/Raven.SQDev.Util/bin/raven/sqdev/util/SQDevProjectBuilder.class and /dev/null differ diff --git a/plugin/Raven.SQDev.Util/bin/raven/sqdev/util/StringUtils.class b/plugin/Raven.SQDev.Util/bin/raven/sqdev/util/StringUtils.class deleted file mode 100644 index 9a77e2cc..00000000 Binary files a/plugin/Raven.SQDev.Util/bin/raven/sqdev/util/StringUtils.class and /dev/null differ diff --git a/plugin/Raven.SQDev.Util/bin/raven/sqdev/util/Util$1.class b/plugin/Raven.SQDev.Util/bin/raven/sqdev/util/Util$1.class deleted file mode 100644 index e9958e7c..00000000 Binary files a/plugin/Raven.SQDev.Util/bin/raven/sqdev/util/Util$1.class and /dev/null differ diff --git a/plugin/Raven.SQDev.Util/bin/raven/sqdev/util/Util.class b/plugin/Raven.SQDev.Util/bin/raven/sqdev/util/Util.class deleted file mode 100644 index 94cb810c..00000000 Binary files a/plugin/Raven.SQDev.Util/bin/raven/sqdev/util/Util.class and /dev/null differ diff --git a/plugin/Raven.SQDev.Util/bin/raven/sqdev/utilInterfaces/ISQDevInformationProvider.class b/plugin/Raven.SQDev.Util/bin/raven/sqdev/utilInterfaces/ISQDevInformationProvider.class deleted file mode 100644 index 20b0d787..00000000 Binary files a/plugin/Raven.SQDev.Util/bin/raven/sqdev/utilInterfaces/ISQDevInformationProvider.class and /dev/null differ diff --git a/plugin/Raven.SQDev.Util/src/raven/sqdev/activator/Activator.java b/plugin/Raven.SQDev.Util/src/raven/sqdev/activator/Activator.java index fe356a65..7495728a 100644 --- a/plugin/Raven.SQDev.Util/src/raven/sqdev/activator/Activator.java +++ b/plugin/Raven.SQDev.Util/src/raven/sqdev/activator/Activator.java @@ -3,7 +3,7 @@ import org.eclipse.ui.plugin.AbstractUIPlugin; import org.osgi.framework.BundleContext; -import raven.sqdev.pluginManager.SQDevPluginManager; +import raven.sqdev.pluginManagement.SQDevPluginManager; public class Activator extends AbstractUIPlugin { diff --git a/plugin/Raven.SQDev.Util/src/raven/sqdev/sqdevFile/ESQDevFileType.java b/plugin/Raven.SQDev.Util/src/raven/sqdev/sqdevFile/ESQDevFileType.java index 7330939e..bac38f4e 100644 --- a/plugin/Raven.SQDev.Util/src/raven/sqdev/sqdevFile/ESQDevFileType.java +++ b/plugin/Raven.SQDev.Util/src/raven/sqdev/sqdevFile/ESQDevFileType.java @@ -16,89 +16,85 @@ */ public enum ESQDevFileType { /** - * The name of the sqdev-file that contains information about the linking to - * the ArmA folder + * The name of the sqdev-file that contains information about the linking to the + * ArmA folder */ LINK { @Override public String toString() { return "link"; } - + @Override public String getInitialInput() { // clear the initial content before recreating it initialContent = ""; - + // add attributes addAttribute(ESQDevFileAttribute.PROFILE, info.getProfile()); - + IPath exportPath = Util.getMissionsDirectory(info.getProfile()); - + if (info.isMp()) { exportPath = exportPath.removeLastSegments(1); exportPath = exportPath.append("mpMissions"); } - - addAttribute(ESQDevFileAttribute.EXPORTDIRECTORY, - exportPath.toOSString()); - - addAttribute(ESQDevFileAttribute.AUTOEXPORT, - String.valueOf(info.getAutoExport())); - + + addAttribute(ESQDevFileAttribute.EXPORTDIRECTORY, exportPath.toOSString()); + + addAttribute(ESQDevFileAttribute.AUTOEXPORT, String.valueOf(info.getAutoExport())); + addAttribute(ESQDevFileAttribute.TERRAIN, info.getTerrain()); - + // add annotations initialContent += "\n\n"; - addAnnotation(ESQDevFileAnnotation.IGNORE, - filesToIgnore.toArray(new String[filesToIgnore.size()])); - + addAnnotation(ESQDevFileAnnotation.IGNORE, filesToIgnore.toArray(new String[filesToIgnore.size()])); + initialContent += "\n"; - - addAnnotation(ESQDevFileAnnotation.PRESERVE, filesToPreserve - .toArray(new String[filesToPreserve.size()])); - + + addAnnotation(ESQDevFileAnnotation.PRESERVE, filesToPreserve.toArray(new String[filesToPreserve.size()])); + return initialContent.trim() + "\n"; } }; - + private ESQDevFileType() { initialContent = ""; filesToIgnore = new ArrayList(); filesToPreserve = new ArrayList(); - + addFileToIgnore(this.toString() + EFileType.SQDEV.getExtension()); addFileToIgnore(".project"); } - + protected SQDevInformation info; - + /** * A String containing the initial content od this fileType */ protected String initialContent; - + /** * A list of files/folders that should be ignored during project export */ protected ArrayList filesToIgnore; - + /** * A list of files/foldersy that should not get deleted during cleanup for * exporting a project */ protected ArrayList filesToPreserve; - + public abstract String getInitialInput(); - + /** * Will find the respective instance of this enum * * @param type - * The type of the enum that should be found. Has to be the - * return value of one of the toString()-methods of this enum - * @return The respective instance of this enum or null if the - * type couldn't be resolved + * The type of the enum that should be found. Has to be the return + * value of one of the toString()-methods of this enum + * @return The respective instance of this enum or null if the type + * couldn't be resolved */ public static ESQDevFileType resolve(String type) { for (ESQDevFileType current : ESQDevFileType.values()) { @@ -106,10 +102,10 @@ public static ESQDevFileType resolve(String type) { return current; } } - + return null; } - + /** * Checks if the given type is contained in this enum * @@ -120,11 +116,11 @@ public static ESQDevFileType resolve(String type) { public static boolean contains(String type) { return (resolve(type) == null) ? false : true; } - + public void addFileToIgnore(String fileName) { filesToIgnore.add(fileName); } - + /** * Adds an attribute to the initial content * @@ -134,10 +130,14 @@ public void addFileToIgnore(String fileName) { * The value of this attribute */ protected void addAttribute(ESQDevFileAttribute attr, String value) { - initialContent += ((initialContent.endsWith("\n")) ? "" : "\n") + attr - + " = " + value + ";\n"; + if (value == null || value.equals(SQDevInformation.NOT_SET)) { + // the respective attribute is not set + return; + } + + initialContent += ((initialContent.endsWith("\n")) ? "" : "\n") + attr + " = " + value + ";\n"; } - + /** * Adds an annotation to the initial content * @@ -146,28 +146,31 @@ protected void addAttribute(ESQDevFileAttribute attr, String value) { * @param value * The values of this annotation */ - protected void addAnnotation(ESQDevFileAnnotation annotation, - String[] values) { + protected void addAnnotation(ESQDevFileAnnotation annotation, String[] values) { + if (values == null) { + // the respective annotation is not set + return; + } for (String currentValue : values) { - initialContent += ((initialContent.endsWith("\n")) ? "" : "\n") - + "@" + annotation + " \"" + currentValue + "\"\n"; + initialContent += ((initialContent.endsWith("\n")) ? "" : "\n") + "@" + annotation + " \"" + currentValue + + "\"\n"; } } - + /** * Checks if the information has been et */ public boolean isInformationSet() { return info != null; } - + /** * Gets the set information */ public SQDevInformation getInformation() { return (isInformationSet()) ? info : new SQDevInformation(); } - + /** * Sets the information * diff --git a/plugin/Raven.SQDev.Util/src/raven/sqdev/util/EFileType.java b/plugin/Raven.SQDev.Util/src/raven/sqdev/util/EFileType.java index 4d21b262..12854017 100644 --- a/plugin/Raven.SQDev.Util/src/raven/sqdev/util/EFileType.java +++ b/plugin/Raven.SQDev.Util/src/raven/sqdev/util/EFileType.java @@ -1,6 +1,8 @@ package raven.sqdev.util; import java.io.ByteArrayInputStream; +import java.io.File; +import java.nio.file.Files; import java.util.Random; import java.util.concurrent.atomic.AtomicReference; @@ -167,7 +169,6 @@ public String getExtension() { @Override public String getInitialContent() { - // TODO Auto-generated method stub return ""; } }, @@ -183,7 +184,6 @@ public String getExtension() { @Override public String getInitialContent() { - // TODO Auto-generated method stub return ""; } }, @@ -287,7 +287,7 @@ public void create(String name) { * For {@linkplain #SQDEV} it has to be of type * {@link ESQDevFileType} * @param open - * Indicates whether the file should be dirctly opened in the + * Indicates whether the file should be directly opened in the * respective editor * @see ESQDevFileType */ @@ -306,7 +306,8 @@ public IStatus run(IProgressMonitor monitor) { // get the container where the file should be created IWorkspaceRoot root = ResourcesPlugin.getWorkspace().getRoot(); - IResource resource = root.findMember(getPath()); + IPath path = getPath(); + IResource resource = root.findMember(path); if (resource instanceof IContainer) { IContainer container = (IContainer) resource; @@ -337,8 +338,7 @@ public IStatus run(IProgressMonitor monitor) { } } } else { - // report that the file does already exist (in UI - // thread) + // report that the file does already exist (in UI thread) SQDevInfobox info = new SQDevInfobox("Can't create file \"" + getFileName() + "\" because it already exists!", SWT.ICON_ERROR); @@ -349,6 +349,25 @@ public IStatus run(IProgressMonitor monitor) { // store the file setFile(file); } else { + if(resource == null && path.isAbsolute()) { + // The file is going to be created outside of eclipse's workspace + IPath filePath = path.append(getFileName()); + File file = filePath.toFile(); + if (!file.exists()) { + // create the file with the respective initial content + Files.copy(getInitialContentStream(), file.toPath()); + + // create an IFile that links to the actual file + setFile(root.getFileForLocation(filePath)); + } else { + // report that the file does already exist (in UI thread) + SQDevInfobox info = new SQDevInfobox("Can't create file \"" + + getFileName() + "\" because it already exists!", + SWT.ICON_ERROR); + + info.open(); + } + } else { try { throw new FailedAtCreatingFileException( "Specified resource is not a container!"); @@ -360,6 +379,7 @@ public IStatus run(IProgressMonitor monitor) { info.open(); } + } } if (open) { @@ -533,19 +553,6 @@ public void run() { .makeRelativeTo(root.getRawLocation().makeAbsolute()); } - // check that the container referenced by this path exists - if (root.findMember(detectedPath) == null) { - try { - throw new FailedAtCreatingFileException( - "Couldn't find specified container in the workspace!"); - } catch (FailedAtCreatingFileException e) { - e.printStackTrace(); - - // can't procede -> kill process - throw new RuntimeException(e); - } - } - // pass value to the respective AtomicReference result.set(detectedPath); } diff --git a/plugin/Raven.SQDev.Util/src/raven/sqdev/util/EProjectType.java b/plugin/Raven.SQDev.Util/src/raven/sqdev/util/EProjectType.java index 4474f6a2..152074b7 100644 --- a/plugin/Raven.SQDev.Util/src/raven/sqdev/util/EProjectType.java +++ b/plugin/Raven.SQDev.Util/src/raven/sqdev/util/EProjectType.java @@ -63,7 +63,7 @@ public IProject create(IWorkspaceRoot root) BackingStoreException { String projectName = info.getName(); - IProject project = ProjectUtil.createSQDevProject(root, projectName); + IProject project = ProjectUtil.createSQDevProject(root, projectName, null); switch (this) { case MOD: diff --git a/plugin/Raven.SQDev.Util/src/raven/sqdev/util/ProjectUtil.java b/plugin/Raven.SQDev.Util/src/raven/sqdev/util/ProjectUtil.java index 946f930d..b7eede9b 100644 --- a/plugin/Raven.SQDev.Util/src/raven/sqdev/util/ProjectUtil.java +++ b/plugin/Raven.SQDev.Util/src/raven/sqdev/util/ProjectUtil.java @@ -41,26 +41,26 @@ import raven.sqdev.sqdevFile.SQDevFile; public class ProjectUtil { - + /** * Indicating that the export was successfull */ public static final String SUCCESS = "success"; - + /** * Indicating that the export was canceled */ public static final String CANCELED = "canceled"; - + /** * Indicating that the export has failed */ public static final String FAILED = "failed"; - + /** * Exports the given project to the given location. Hidden files and folders - * (prefixed by a dot) will be ignored automatically during export (not - * during cleaning) + * (prefixed by a dot) will be ignored automatically during export (not during + * cleaning) * * @param project * The project that should get exported @@ -69,50 +69,48 @@ public class ProjectUtil { * @param filesToIgnore * A list of files that should not get exported * @param filesToPreserve - * A list of files that should not get deleted when performing - * the clean of the destination + * A list of files that should not get deleted when performing the + * clean of the destination * @return The status of this export operation. Possible values are: *
  • ProjectUtil.SUCCESS
  • *
  • ProjectUtil.CANCELED
  • *
  • ProjectUtil.FAILED
  • */ - public static String export(IProject project, IPath destination, - ArrayList filesToIgnore, + public static String export(IProject project, IPath destination, ArrayList filesToIgnore, ArrayList filesToPreserve) { if (!new File(destination.toOSString()).exists()) { // check how many folders have to be created IPath copy = new Path(destination.toOSString()); - + // search for the first existing container for (int i = 0; i < copy.segmentCount(); i++) { copy = copy.removeLastSegments(1); - + if (new File(copy.toOSString()).exists()) { break; } } - + // calculate how many files have to be created int diff = destination.segmentCount() - copy.segmentCount(); - + if (diff >= 2) { // normally there should be only the mission folder to be // created SQDevInfobox info = new SQDevInfobox( - "The export process would require an unusual high amount (" - + diff + "The export process would require an unusual high amount (" + diff + ") of new folders being created.\n\nDo you want to proceed?", SWT.ICON_QUESTION | SWT.YES | SWT.NO); - + if (info.open() != SWT.YES) { // abort the export process return CANCELED; } } } - + File missionFolder = new File(destination.toOSString()); - + if (!missionFolder.exists()) { // create the mission folder missionFolder.mkdirs(); @@ -120,78 +118,68 @@ public static String export(IProject project, IPath destination, if (!SQDevPreferenceUtil.autoClean()) { SQDevInfobox info = new SQDevInfobox( "The directory \"" + destination.toOSString() - + "\" has to be cleaned in order to export the project \"" - + project.getName() + + "\" has to be cleaned in order to export the project \"" + project.getName() + "\".\nAny files that are not part of the project in the eclipse " + "workspace will be deleted.\n\nDo you want to proceed?", SWT.ICON_QUESTION | SWT.YES | SWT.NO); - + if (info.open() != SWT.YES) { return CANCELED; } } - + // clean the directory for (File currentFile : missionFolder.listFiles()) { // delete the respective files - if (!FileSystemUtil.deleteFilesWithException(currentFile, - filesToPreserve)) { + if (!FileSystemUtil.deleteFilesWithException(currentFile, filesToPreserve)) { // report that the cleaning couldn't be performed - SQDevInfobox info = new SQDevInfobox( - "Failed to delete file \"" - + currentFile.getAbsolutePath() - + "\"\nMake sure the files are not opened somewhere and try again" - + "\n\nCanceled the export process.", - SWT.ICON_INFORMATION); - + SQDevInfobox info = new SQDevInfobox("Failed to delete file \"" + currentFile.getAbsolutePath() + + "\"\nMake sure the files are not opened somewhere and try again" + + "\n\nCanceled the export process.", SWT.ICON_INFORMATION); + info.open(); - + // abort export when cleaning can't be performed return CANCELED; } } } - + try { for (IResource currentResource : project.members()) { - File currentFile = new File( - currentResource.getRawLocationURI()); - - if (filesToIgnore.contains(currentFile.getName()) - || currentFile.getName().startsWith(".")) { + File currentFile = new File(currentResource.getRawLocationURI()); + + if (filesToIgnore.contains(currentFile.getName()) || currentFile.getName().startsWith(".")) { // skip if this resource is specified to be ignored or if it // is hidden continue; } - + if (!currentFile.exists()) { // skip non-existant files continue; } - - FileSystemUtil.copyFilesWithExceptions(currentFile, destination, - filesToIgnore, true); + + FileSystemUtil.copyFilesWithExceptions(currentFile, destination, filesToIgnore, true); } } catch (CoreException e) { e.printStackTrace(); - + // inform the user about the failure - String message = "Failed at exporting \"" + project.getName() - + "\"\nReason: " - + ((e.getMessage() == null || e.getMessage().isEmpty()) - ? "Unknown" : e.getMessage()); - + String message = "Failed at exporting \"" + project.getName() + "\"\nReason: " + + ((e.getMessage() == null || e.getMessage().isEmpty()) ? "Unknown" : e.getMessage()); + SQDevInfobox info = new SQDevInfobox(message, SWT.ICON_ERROR); - + info.open(); - + return FAILED; } - + // indicate that the export was successfull return SUCCESS; } - + /** * Finds out whether the given project is a valid SQDev project.
    * A project is considered a SQDev project if it contains a link.sqdev @@ -201,61 +189,55 @@ public static String export(IProject project, IPath destination, * @return */ public static boolean isSQDevProject(IProject project) { - IFile testFile = project.getFile(ESQDevFileType.LINK.toString() - + EFileType.SQDEV.getExtension()); - + IFile testFile = project.getFile(ESQDevFileType.LINK.toString() + EFileType.SQDEV.getExtension()); + return testFile.exists(); } - + /** * Gets the profile specified for the given project/mission * * @param project - * The SQDevProject whose corresponding profile should be - * obtained Has to be an SQDevProject! + * The SQDevProject whose corresponding profile should be obtained + * Has to be an SQDevProject! * @return The corresponding profile */ public static String getMissionProfile(IProject project) { SQDevFile linkFile = getLinkFile(project); - + try { - String profile = linkFile - .parseAttribute(ESQDevFileAttribute.PROFILE).getValue() - .toString(); - + String profile = linkFile.parseAttribute(ESQDevFileAttribute.PROFILE).getValue().toString(); + return profile; } catch (SQDevFileIsInvalidException e) { // inform the user SQDevInfobox info = new SQDevInfobox( - "The linkFile in the project \"" + project.getName() - + "\" is invalid!", - SWT.ICON_ERROR); - + "The linkFile in the project \"" + project.getName() + "\" is invalid!", SWT.ICON_ERROR); + info.open(); - + // rethrow throw new SQDevCoreException(e); } } - + /** * Gets the linkFile of this SQDevProject * * @param project - * The SQDevProject whose linkFile should be obtained. Has to - * be an SQDevProject! + * The SQDevProject whose linkFile should be obtained. Has to be + * an SQDevProject! * @return The corresponding linkFile */ public static SQDevFile getLinkFile(IProject project) { Assert.isTrue(isSQDevProject(project)); - - IResource linkMember = project.findMember( - ESQDevFileType.LINK + EFileType.SQDEV.getExtension()); - + + IResource linkMember = project.findMember(ESQDevFileType.LINK + EFileType.SQDEV.getExtension()); + if (linkMember.getType() == IResource.FILE) { try { SQDevFile linkFile = new SQDevFile((IFile) linkMember); - + return linkFile; } catch (FileNotFoundException | IllegalAccessStateException e) { // rethrow @@ -265,27 +247,26 @@ public static SQDevFile getLinkFile(IProject project) { throw new SQDevCoreException("Selected linkFile is not a file!"); } } - + /** * Gets the SQDevInformation corresponding to the given * SQDevProject * * @param project * The SQDevProject - * @return The respective SQDevInformation or null - * if the given project is no SQDevProject + * @return The respective SQDevInformation or null if + * the given project is no SQDevProject */ public static SQDevInformation getInformation(IProject project) { if (!isSQDevProject(project)) { return null; } - + return new SQDevInformation(getLinkFile(project)); } - + /** - * Checks whether a project with the given name already exists in the - * workspace + * Checks whether a project with the given name already exists in the workspace * * @param name * The name of the project @@ -297,102 +278,113 @@ public static boolean exists(String name) { return true; } } - + return false; } - + /** * Imports the given mission folder into the workspace as an SQDevProject * * @param path * The path to the folder to import + * @param copyContent + * Indicates whether all content should get copied into the + * workspace. If this is set to false then the + * respective resources will not be copied and only get linked + * instead. * @return */ - public static String importAsProject(Path path) { + public static String importAsProject(IPath path, boolean copyContent) { Assert.isTrue(path.isAbsolute() && path.toFile().exists()); - + boolean isMission = Util.isMissionFolder(new File(path.toOSString())); - + String possibleName = path.lastSegment(); - + if (isMission) { possibleName = possibleName.substring(0, possibleName.indexOf(".")); } - + final String projectName = possibleName; - + try { // create the project - IProject project = createSQDevProject( - ResourcesPlugin.getWorkspace().getRoot(), projectName); - + IWorkspaceRoot root = ResourcesPlugin.getWorkspace().getRoot(); + IProject project = createSQDevProject(root, projectName, copyContent ? null : path); + project.open(new NullProgressMonitor()); - + // gather information SQDevInformation information = new SQDevInformation(); information.setProfile(SQDevPreferenceUtil.getDefaultProfile()); - information.setTerrain(path.lastSegment() - .substring(path.lastSegment().indexOf(".") + 1)); - information.autoExport = SQDevPreferenceUtil - .getAutoExportDefaultEnabled(); + if (path.lastSegment() != null && path.lastSegment().contains(".")) { + information.setTerrain(path.lastSegment().substring(path.lastSegment().indexOf(".") + 1)); + if (copyContent) { + information.autoExport = SQDevPreferenceUtil.getAutoExportDefaultEnabled(); + } else { + // turn off autoexport for all projects that originate from the Arma-dir and are + // not copied + IPath armaDirPath = new Path(SQDevPreferenceUtil.getArmaDocumentsDirectory()); + information.autoExport = !armaDirPath.isPrefixOf(project.getLocation()) + && SQDevPreferenceUtil.getAutoExportDefaultEnabled(); + } + } else { + information.terrain = SQDevInformation.NOT_SET; + information.autoExport = false; + } information.name = projectName; - + // create linkFile EFileType type = EFileType.SQDEV; type.setInformation(information); type.setPath(project.getLocation().toOSString()); type.create(ESQDevFileType.LINK.toString(), false); - - // copy files and folders - for (File currentFile : path.toFile().listFiles()) { - if (currentFile.isDirectory()) { - FileUtil.copyFolder(currentFile, - (Path) project.getLocation()); - } else { - FileUtil.copyFile(currentFile, - (Path) project.getLocation()); + + if (copyContent) { + // copy files and folders + for (File currentFile : path.toFile().listFiles()) { + if (currentFile.isDirectory()) { + FileUtil.copyFolder(currentFile, (Path) project.getLocation()); + } else { + FileUtil.copyFile(currentFile, (Path) project.getLocation()); + } } } - + // refresh project - project.refreshLocal(IResource.DEPTH_INFINITE, - new NullProgressMonitor()); - + project.refreshLocal(IResource.DEPTH_INFINITE, new NullProgressMonitor()); + // initial build Job buildJob = new Job("Building " + projectName) { - + @Override protected IStatus run(IProgressMonitor monitor) { try { - project.build(IncrementalProjectBuilder.FULL_BUILD, - monitor); + project.build(IncrementalProjectBuilder.FULL_BUILD, monitor); } catch (CoreException e) { e.printStackTrace(); - - SQDevInfobox info = new SQDevInfobox( - "Failed at building project " + projectName, e); + + SQDevInfobox info = new SQDevInfobox("Failed at building project " + projectName, e); info.open(false); } - + return Status.OK_STATUS; } }; buildJob.schedule(); - - } catch (CoreException | FailedAtCreatingFileException - | BackingStoreException e) { - String message = "Failed at importing \"" + path.toOSString() - + "\""; - + + } catch (CoreException | FailedAtCreatingFileException | BackingStoreException e) { + String message = "Failed at importing \"" + path.toOSString() + "\""; + SQDevInfobox info = new SQDevInfobox(message, e); info.open(); - + e.printStackTrace(); } - + return SUCCESS; } - + /** * Creates a new project with the given name in the given workspace root. * @@ -400,62 +392,61 @@ protected IStatus run(IProgressMonitor monitor) { * The workspace root to create the project in * @param projectName * The name of the new project + * @param externalLocation + * null if the project should be created from scratch. + * Otherwise this can point to the source files to include in the + * project but that are stored elsewhere * @return The newly created project * @throws FailedAtCreatingFileException - * If there is a problem with creating the problem such as - * another problem with the same name does already exist + * If there is a problem with creating the problem such as another + * problem with the same name does already exist * @throws CoreException * @throws BackingStoreException */ - public static IProject createSQDevProject(IWorkspaceRoot root, - String projectName) throws FailedAtCreatingFileException, - CoreException, BackingStoreException { + public static IProject createSQDevProject(IWorkspaceRoot root, String projectName, IPath externalLocation) + throws FailedAtCreatingFileException, CoreException, BackingStoreException { IProject project = root.getProject(projectName); - + + // configure the SQDevProjectBuilder + IProjectDescription description = ResourcesPlugin.getWorkspace().newProjectDescription(projectName); + ICommand[] commands = description.getBuildSpec(); + + // add builder to project + ICommand command = description.newCommand(); + command.setBuilderName("raven.sqdev.builder.sqdevprojectbuilder"); + ICommand[] nc = new ICommand[commands.length + 1]; + // Add it before other builders. + System.arraycopy(commands, 0, nc, 1, commands.length); + nc[0] = command; + description.setBuildSpec(nc); + + // set project nature + description.setNatureIds(new String[] { SQDevProjectNature.SQDEV_NATURE_ID }); + + description.setLocation(externalLocation); + // create the project; If anything goes wrong return if (!project.exists()) { try { - project.create(null); + project.create(description, new NullProgressMonitor()); } catch (CoreException e) { throw new FailedAtCreatingFileException(e); } } else { - throw new FailedAtCreatingFileException("A project with the name \"" - + projectName + "\" does already exist!"); + throw new FailedAtCreatingFileException( + "A project with the name \"" + projectName + "\" does already exist!"); } - + project.open(new NullProgressMonitor()); - + // Make sure the project is being encoded in UTF-8 IScopeContext projectScope = new ProjectScope(project); - IEclipsePreferences projectNode = projectScope - .getNode("org.eclipse.core.resources"); + IEclipsePreferences projectNode = projectScope.getNode("org.eclipse.core.resources"); projectNode.node("encoding").put("", "UTF-8"); projectNode.flush(); - - // configure the SQDevProjectBuilder - IProjectDescription description = project.getDescription(); - ICommand[] commands = description.getBuildSpec(); - - // add builder to project - ICommand command = description.newCommand(); - command.setBuilderName("raven.sqdev.builder.sqdevprojectbuilder"); - ICommand[] nc = new ICommand[commands.length + 1]; - // Add it before other builders. - System.arraycopy(commands, 0, nc, 1, commands.length); - nc[0] = command; - description.setBuildSpec(nc); - - - // set project nature - description.setNatureIds( - new String[] { SQDevProjectNature.SQDEV_NATURE_ID }); - - - project.setDescription(description, new NullProgressMonitor()); - + project.close(new NullProgressMonitor()); - + return project; } } diff --git a/plugin/Raven.SQDev.Util/src/raven/sqdev/util/SQDevInformation.java b/plugin/Raven.SQDev.Util/src/raven/sqdev/util/SQDevInformation.java index 942b5922..ab195393 100644 --- a/plugin/Raven.SQDev.Util/src/raven/sqdev/util/SQDevInformation.java +++ b/plugin/Raven.SQDev.Util/src/raven/sqdev/util/SQDevInformation.java @@ -19,7 +19,7 @@ public class SQDevInformation { /** - * The default String indocating that the requested value has not been set + * The default String indicating that the requested value has not been set * and does not have a default value */ public static String NOT_SET = "NotSet"; diff --git a/plugin/Raven.SQDev.Util/src/raven/sqdev/util/SQDevProjectBuilder.java b/plugin/Raven.SQDev.Util/src/raven/sqdev/util/SQDevProjectBuilder.java index 6fecbea9..8c6cbb08 100644 --- a/plugin/Raven.SQDev.Util/src/raven/sqdev/util/SQDevProjectBuilder.java +++ b/plugin/Raven.SQDev.Util/src/raven/sqdev/util/SQDevProjectBuilder.java @@ -17,19 +17,23 @@ import org.eclipse.core.runtime.CoreException; import org.eclipse.core.runtime.IProgressMonitor; -import raven.sqdev.misc.FileUtil; +import dataStructures.AbstractSQFTokenFactory; +import raven.sqdev.interfaces.IParseResult; +import raven.sqdev.interfaces.ISQFParseSupplier; +import raven.sqdev.interfaces.ITreeProcessingResult; +import raven.sqdev.misc.Macro; import raven.sqdev.misc.Marker; import raven.sqdev.misc.SQDevInfobox; import raven.sqdev.parser.misc.ParseUtil; +import raven.sqdev.parser.misc.SQFParseResult; +import raven.sqdev.parser.misc.SQFTokenFactory; import raven.sqdev.parser.preprocessor.PreprocessorParseResult; -import raven.sqdev.parser.sqf.SQFParseInformation; -import raven.sqdev.parser.sqf.SQFParseResult; +import raven.sqdev.parser.sqf.SQFInformation; public class SQDevProjectBuilder extends IncrementalProjectBuilder { @Override - protected IProject[] build(int kind, Map args, IProgressMonitor monitor) - throws CoreException { + protected IProject[] build(int kind, Map args, IProgressMonitor monitor) throws CoreException { try { switch (kind) { @@ -67,8 +71,7 @@ protected IProject[] build(int kind, Map args, IProgressMonitor * @throws FileNotFoundException * @throws CoreException */ - protected void incrementalBuild(IProgressMonitor monitor) - throws FileNotFoundException, IOException, CoreException { + protected void incrementalBuild(IProgressMonitor monitor) throws FileNotFoundException, IOException, CoreException { monitor.beginTask("Building " + getProject().getName(), IProgressMonitor.UNKNOWN); IResourceDelta delta = getDelta(getProject()); @@ -88,10 +91,8 @@ protected void incrementalBuild(IProgressMonitor monitor) * @throws FileNotFoundException * @throws CoreException */ - private void parseChangedFiles(IResourceDelta delta) - throws FileNotFoundException, IOException, CoreException { - for (IResourceDelta currentResourceDelta : delta.getAffectedChildren(IResourceDelta.CHANGED, - IResource.FILE)) { + private void parseChangedFiles(IResourceDelta delta) throws FileNotFoundException, IOException, CoreException { + for (IResourceDelta currentResourceDelta : delta.getAffectedChildren(IResourceDelta.CHANGED, IResource.FILE)) { if (currentResourceDelta.getResource() instanceof IFile) { parseSQFFile((IFile) currentResourceDelta.getResource()); } else { @@ -109,8 +110,7 @@ private void parseChangedFiles(IResourceDelta delta) * @throws IOException * @throws FileNotFoundException */ - protected void fullBuild(IProgressMonitor monitor) - throws CoreException, FileNotFoundException, IOException { + protected void fullBuild(IProgressMonitor monitor) throws CoreException, FileNotFoundException, IOException { List files = getProjectChildren(IResource.FILE); monitor.beginTask("Building project " + getProject().getName(), files.size()); @@ -145,44 +145,64 @@ protected void parseSQFFile(IFile file) throws FileNotFoundException, IOExceptio System.out.println("Parsing " + file.getName()); - final String fileContent = FileUtil.readAll(new FileInputStream(file.getLocation().toFile())); + FileInputStream fileStream = new FileInputStream(file.getLocation().toFile()); - PreprocessorParseResult prepResult = ParseUtil.parseAndValidatePreprocess(fileContent, - file.getLocation()); + PreprocessorParseResult prepResult = ParseUtil.parseAndValidatePreprocess(fileStream, file.getLocation()); - // create parse information with default values - SQFParseInformation info = new SQFParseInformation(prepResult.getMacros()); + // "reset" InputStream + fileStream = new FileInputStream(file.getLocation().toFile()); - SQFParseResult sqfResult = ParseUtil.parseSQF(fileContent, info); + // create parse information with default values + SQFInformation info = new SQFInformation(prepResult.getMacros()); - sqfResult - .mergeWith(ParseUtil.validateSQF(sqfResult.getParseTree(), sqfResult.getTokenStream(), info)); + IParseResult parseResult = ParseUtil.parseSQF(fileStream, new ISQFParseSupplier() { - sqfResult.mergeWith(prepResult); + @Override + public AbstractSQFTokenFactory getTokenFactory() { + return new SQFTokenFactory(info.getBinaryKeywords(), info.getUnaryKeywords()); + } + @Override + public Map getMacros() { + return prepResult.getMacros(); + } + }); // clear old markers file.deleteMarkers(IMarker.PROBLEM, true, IResource.DEPTH_INFINITE); - // apply markers - for (Marker currentMarker : sqfResult.getMarkers()) { - // find line - int line = 1; - for (int i = 0; i < currentMarker.getOffset(); i++) { - if (fileContent.charAt(i) == '\n') { - line++; - } + boolean foundError = false; + + // apply parse- and lex-markers + for (Marker currentMarker : parseResult.getMarkers()) { + addMarker(file, currentMarker, parseResult.getLine(currentMarker.getOffset())); + if (currentMarker.getSeverity() == IMarker.SEVERITY_ERROR) { + foundError = true; } + } - IMarker fileMarker = file.createMarker(currentMarker.getType()); - fileMarker.setAttribute(IMarker.LINE_NUMBER, line); - fileMarker.setAttribute(IMarker.MESSAGE, currentMarker.getMessage()); - fileMarker.setAttribute(IMarker.SEVERITY, currentMarker.getSeverity()); - fileMarker.setAttribute(IMarker.CHAR_START, currentMarker.getOffset()); - fileMarker.setAttribute(IMarker.CHAR_END, currentMarker.getOffset() + currentMarker.getLength()); + if (foundError) { + // don't continue if there have been any errors so far + return; + } + + ITreeProcessingResult processingResult = ParseUtil.processSQF((SQFParseResult) parseResult, info); + + // apply processing-markers + for (Marker currentMarker : processingResult.getMarkers()) { + addMarker(file, currentMarker, parseResult.getLine(currentMarker.getOffset())); } } + private void addMarker(IFile file, Marker marker, int line) throws CoreException { + IMarker fileMarker = file.createMarker(marker.getType()); + fileMarker.setAttribute(IMarker.LINE_NUMBER, line); + fileMarker.setAttribute(IMarker.MESSAGE, marker.getMessage()); + fileMarker.setAttribute(IMarker.SEVERITY, marker.getSeverity()); + fileMarker.setAttribute(IMarker.CHAR_START, marker.getOffset()); + fileMarker.setAttribute(IMarker.CHAR_END, marker.getOffset() + marker.getLength()); + } + /** * Gets the children of this project of the given type. * diff --git a/plugin/Raven.SQDev.Wizards/.gitignore b/plugin/Raven.SQDev.Wizards/.gitignore new file mode 100644 index 00000000..ae3c1726 --- /dev/null +++ b/plugin/Raven.SQDev.Wizards/.gitignore @@ -0,0 +1 @@ +/bin/ diff --git a/plugin/Raven.SQDev.Wizards/META-INF/MANIFEST.MF b/plugin/Raven.SQDev.Wizards/META-INF/MANIFEST.MF index 6ca77bf3..59802a13 100644 --- a/plugin/Raven.SQDev.Wizards/META-INF/MANIFEST.MF +++ b/plugin/Raven.SQDev.Wizards/META-INF/MANIFEST.MF @@ -2,22 +2,27 @@ Manifest-Version: 1.0 Bundle-ManifestVersion: 2 Bundle-Name: Wizards Bundle-SymbolicName: raven.sqdev.wizards;singleton:=true -Bundle-Version: 0.3.4 +Bundle-Version: 0.3.5.stable Bundle-Activator: raven.sqdev.wizards.activator.Activator Bundle-Vendor: Raven -Require-Bundle: org.eclipse.core.runtime, - org.eclipse.core.resources, - org.eclipse.ui, - org.eclipse.ui.ide, - org.eclipse.ui.workbench, - org.eclipse.ui.editors, - org.eclipse.swt, - org.eclipse.jface, - raven.sqdev.editors;bundle-version="0.1.1", - raven.sqdev.preferences, - raven.sqdev.util;bundle-version="0.3.0", - raven.sqdev.misc;bundle-version="0.1.0", - raven.sqdev.ui Bundle-RequiredExecutionEnvironment: JavaSE-1.8 Bundle-ActivationPolicy: lazy -Import-Package: raven.sqdev.preferences.util +Import-Package: org.eclipse.core.resources, + org.eclipse.core.runtime, + org.eclipse.core.runtime.jobs, + org.eclipse.jface.dialogs, + org.eclipse.jface.resource, + org.eclipse.jface.viewers, + org.eclipse.jface.wizard, + org.eclipse.ui, + org.eclipse.ui.wizards.newresource, + org.osgi.framework, + org.osgi.service.prefs, + raven.sqdev.exceptions, + raven.sqdev.misc, + raven.sqdev.pluginManagement, + raven.sqdev.sqdevFile, + raven.sqdev.util, + raven.sqdev.utilInterfaces +Require-Bundle: org.eclipse.swt, + org.eclipse.ui.workbench diff --git a/plugin/Raven.SQDev.Wizards/bin/raven/sqdev/wizards/SQDevBaseNewFileWizard.class b/plugin/Raven.SQDev.Wizards/bin/raven/sqdev/wizards/SQDevBaseNewFileWizard.class deleted file mode 100644 index 880f6067..00000000 Binary files a/plugin/Raven.SQDev.Wizards/bin/raven/sqdev/wizards/SQDevBaseNewFileWizard.class and /dev/null differ diff --git a/plugin/Raven.SQDev.Wizards/bin/raven/sqdev/wizards/SQDevBaseNewProjectWizard.class b/plugin/Raven.SQDev.Wizards/bin/raven/sqdev/wizards/SQDevBaseNewProjectWizard.class deleted file mode 100644 index aa9f66c3..00000000 Binary files a/plugin/Raven.SQDev.Wizards/bin/raven/sqdev/wizards/SQDevBaseNewProjectWizard.class and /dev/null differ diff --git a/plugin/Raven.SQDev.Wizards/bin/raven/sqdev/wizards/activator/Activator.class b/plugin/Raven.SQDev.Wizards/bin/raven/sqdev/wizards/activator/Activator.class deleted file mode 100644 index 6f1e97d8..00000000 Binary files a/plugin/Raven.SQDev.Wizards/bin/raven/sqdev/wizards/activator/Activator.class and /dev/null differ diff --git a/plugin/Raven.SQDev.Wizards/bin/raven/sqdev/wizards/exceptions/FailedAtCreatingFileException.class b/plugin/Raven.SQDev.Wizards/bin/raven/sqdev/wizards/exceptions/FailedAtCreatingFileException.class deleted file mode 100644 index 6c7516b5..00000000 Binary files a/plugin/Raven.SQDev.Wizards/bin/raven/sqdev/wizards/exceptions/FailedAtCreatingFileException.class and /dev/null differ diff --git a/plugin/Raven.SQDev.Wizards/bin/raven/sqdev/wizards/export/SQDevExportWizard$1.class b/plugin/Raven.SQDev.Wizards/bin/raven/sqdev/wizards/export/SQDevExportWizard$1.class deleted file mode 100644 index 44a83bc5..00000000 Binary files a/plugin/Raven.SQDev.Wizards/bin/raven/sqdev/wizards/export/SQDevExportWizard$1.class and /dev/null differ diff --git a/plugin/Raven.SQDev.Wizards/bin/raven/sqdev/wizards/export/SQDevExportWizard.class b/plugin/Raven.SQDev.Wizards/bin/raven/sqdev/wizards/export/SQDevExportWizard.class deleted file mode 100644 index 1eb5268c..00000000 Binary files a/plugin/Raven.SQDev.Wizards/bin/raven/sqdev/wizards/export/SQDevExportWizard.class and /dev/null differ diff --git a/plugin/Raven.SQDev.Wizards/bin/raven/sqdev/wizards/export/SQDevExportWizardPage$1.class b/plugin/Raven.SQDev.Wizards/bin/raven/sqdev/wizards/export/SQDevExportWizardPage$1.class deleted file mode 100644 index 0f07e0c7..00000000 Binary files a/plugin/Raven.SQDev.Wizards/bin/raven/sqdev/wizards/export/SQDevExportWizardPage$1.class and /dev/null differ diff --git a/plugin/Raven.SQDev.Wizards/bin/raven/sqdev/wizards/export/SQDevExportWizardPage$2.class b/plugin/Raven.SQDev.Wizards/bin/raven/sqdev/wizards/export/SQDevExportWizardPage$2.class deleted file mode 100644 index 49879046..00000000 Binary files a/plugin/Raven.SQDev.Wizards/bin/raven/sqdev/wizards/export/SQDevExportWizardPage$2.class and /dev/null differ diff --git a/plugin/Raven.SQDev.Wizards/bin/raven/sqdev/wizards/export/SQDevExportWizardPage.class b/plugin/Raven.SQDev.Wizards/bin/raven/sqdev/wizards/export/SQDevExportWizardPage.class deleted file mode 100644 index 7c287191..00000000 Binary files a/plugin/Raven.SQDev.Wizards/bin/raven/sqdev/wizards/export/SQDevExportWizardPage.class and /dev/null differ diff --git a/plugin/Raven.SQDev.Wizards/bin/raven/sqdev/wizards/importWizard/SQDevImportWizard$1.class b/plugin/Raven.SQDev.Wizards/bin/raven/sqdev/wizards/importWizard/SQDevImportWizard$1.class deleted file mode 100644 index db7e54f2..00000000 Binary files a/plugin/Raven.SQDev.Wizards/bin/raven/sqdev/wizards/importWizard/SQDevImportWizard$1.class and /dev/null differ diff --git a/plugin/Raven.SQDev.Wizards/bin/raven/sqdev/wizards/importWizard/SQDevImportWizard.class b/plugin/Raven.SQDev.Wizards/bin/raven/sqdev/wizards/importWizard/SQDevImportWizard.class deleted file mode 100644 index 70ad2cb9..00000000 Binary files a/plugin/Raven.SQDev.Wizards/bin/raven/sqdev/wizards/importWizard/SQDevImportWizard.class and /dev/null differ diff --git a/plugin/Raven.SQDev.Wizards/bin/raven/sqdev/wizards/importWizard/SQDevImportWizardPage$1.class b/plugin/Raven.SQDev.Wizards/bin/raven/sqdev/wizards/importWizard/SQDevImportWizardPage$1.class deleted file mode 100644 index 3efaf4f3..00000000 Binary files a/plugin/Raven.SQDev.Wizards/bin/raven/sqdev/wizards/importWizard/SQDevImportWizardPage$1.class and /dev/null differ diff --git a/plugin/Raven.SQDev.Wizards/bin/raven/sqdev/wizards/importWizard/SQDevImportWizardPage$2.class b/plugin/Raven.SQDev.Wizards/bin/raven/sqdev/wizards/importWizard/SQDevImportWizardPage$2.class deleted file mode 100644 index f4e6199d..00000000 Binary files a/plugin/Raven.SQDev.Wizards/bin/raven/sqdev/wizards/importWizard/SQDevImportWizardPage$2.class and /dev/null differ diff --git a/plugin/Raven.SQDev.Wizards/bin/raven/sqdev/wizards/importWizard/SQDevImportWizardPage.class b/plugin/Raven.SQDev.Wizards/bin/raven/sqdev/wizards/importWizard/SQDevImportWizardPage.class deleted file mode 100644 index 5dc43229..00000000 Binary files a/plugin/Raven.SQDev.Wizards/bin/raven/sqdev/wizards/importWizard/SQDevImportWizardPage.class and /dev/null differ diff --git a/plugin/Raven.SQDev.Wizards/bin/raven/sqdev/wizards/sqdevProject/SQDevProjectWizard.class b/plugin/Raven.SQDev.Wizards/bin/raven/sqdev/wizards/sqdevProject/SQDevProjectWizard.class deleted file mode 100644 index 70fb7139..00000000 Binary files a/plugin/Raven.SQDev.Wizards/bin/raven/sqdev/wizards/sqdevProject/SQDevProjectWizard.class and /dev/null differ diff --git a/plugin/Raven.SQDev.Wizards/bin/raven/sqdev/wizards/sqdevProject/SQDevProjectWizardPage$1.class b/plugin/Raven.SQDev.Wizards/bin/raven/sqdev/wizards/sqdevProject/SQDevProjectWizardPage$1.class deleted file mode 100644 index d4b14a25..00000000 Binary files a/plugin/Raven.SQDev.Wizards/bin/raven/sqdev/wizards/sqdevProject/SQDevProjectWizardPage$1.class and /dev/null differ diff --git a/plugin/Raven.SQDev.Wizards/bin/raven/sqdev/wizards/sqdevProject/SQDevProjectWizardPage$2.class b/plugin/Raven.SQDev.Wizards/bin/raven/sqdev/wizards/sqdevProject/SQDevProjectWizardPage$2.class deleted file mode 100644 index 2bcb1b5b..00000000 Binary files a/plugin/Raven.SQDev.Wizards/bin/raven/sqdev/wizards/sqdevProject/SQDevProjectWizardPage$2.class and /dev/null differ diff --git a/plugin/Raven.SQDev.Wizards/bin/raven/sqdev/wizards/sqdevProject/SQDevProjectWizardPage$3.class b/plugin/Raven.SQDev.Wizards/bin/raven/sqdev/wizards/sqdevProject/SQDevProjectWizardPage$3.class deleted file mode 100644 index f222267b..00000000 Binary files a/plugin/Raven.SQDev.Wizards/bin/raven/sqdev/wizards/sqdevProject/SQDevProjectWizardPage$3.class and /dev/null differ diff --git a/plugin/Raven.SQDev.Wizards/bin/raven/sqdev/wizards/sqdevProject/SQDevProjectWizardPage$4.class b/plugin/Raven.SQDev.Wizards/bin/raven/sqdev/wizards/sqdevProject/SQDevProjectWizardPage$4.class deleted file mode 100644 index acd842b2..00000000 Binary files a/plugin/Raven.SQDev.Wizards/bin/raven/sqdev/wizards/sqdevProject/SQDevProjectWizardPage$4.class and /dev/null differ diff --git a/plugin/Raven.SQDev.Wizards/bin/raven/sqdev/wizards/sqdevProject/SQDevProjectWizardPage$5.class b/plugin/Raven.SQDev.Wizards/bin/raven/sqdev/wizards/sqdevProject/SQDevProjectWizardPage$5.class deleted file mode 100644 index 56f3455b..00000000 Binary files a/plugin/Raven.SQDev.Wizards/bin/raven/sqdev/wizards/sqdevProject/SQDevProjectWizardPage$5.class and /dev/null differ diff --git a/plugin/Raven.SQDev.Wizards/bin/raven/sqdev/wizards/sqdevProject/SQDevProjectWizardPage.class b/plugin/Raven.SQDev.Wizards/bin/raven/sqdev/wizards/sqdevProject/SQDevProjectWizardPage.class deleted file mode 100644 index a9113337..00000000 Binary files a/plugin/Raven.SQDev.Wizards/bin/raven/sqdev/wizards/sqdevProject/SQDevProjectWizardPage.class and /dev/null differ diff --git a/plugin/Raven.SQDev.Wizards/bin/raven/sqdev/wizards/sqfNewFileWizard/SqfNewFileWizard.class b/plugin/Raven.SQDev.Wizards/bin/raven/sqdev/wizards/sqfNewFileWizard/SqfNewFileWizard.class deleted file mode 100644 index be3fcc56..00000000 Binary files a/plugin/Raven.SQDev.Wizards/bin/raven/sqdev/wizards/sqfNewFileWizard/SqfNewFileWizard.class and /dev/null differ diff --git a/plugin/Raven.SQDev.Wizards/bin/raven/sqdev/wizards/sqfNewFileWizard/SqfNewFileWizardPage$1.class b/plugin/Raven.SQDev.Wizards/bin/raven/sqdev/wizards/sqfNewFileWizard/SqfNewFileWizardPage$1.class deleted file mode 100644 index 022c51e2..00000000 Binary files a/plugin/Raven.SQDev.Wizards/bin/raven/sqdev/wizards/sqfNewFileWizard/SqfNewFileWizardPage$1.class and /dev/null differ diff --git a/plugin/Raven.SQDev.Wizards/bin/raven/sqdev/wizards/sqfNewFileWizard/SqfNewFileWizardPage.class b/plugin/Raven.SQDev.Wizards/bin/raven/sqdev/wizards/sqfNewFileWizard/SqfNewFileWizardPage.class deleted file mode 100644 index 3d925a2d..00000000 Binary files a/plugin/Raven.SQDev.Wizards/bin/raven/sqdev/wizards/sqfNewFileWizard/SqfNewFileWizardPage.class and /dev/null differ diff --git a/plugin/Raven.SQDev.Wizards/bin/raven/sqdev/wizards/stringtable/StringTableWizard.class b/plugin/Raven.SQDev.Wizards/bin/raven/sqdev/wizards/stringtable/StringTableWizard.class deleted file mode 100644 index ee57238a..00000000 Binary files a/plugin/Raven.SQDev.Wizards/bin/raven/sqdev/wizards/stringtable/StringTableWizard.class and /dev/null differ diff --git a/plugin/Raven.SQDev.Wizards/bin/raven/sqdev/wizards/stringtable/StringTableWizardPage.class b/plugin/Raven.SQDev.Wizards/bin/raven/sqdev/wizards/stringtable/StringTableWizardPage.class deleted file mode 100644 index 825044d0..00000000 Binary files a/plugin/Raven.SQDev.Wizards/bin/raven/sqdev/wizards/stringtable/StringTableWizardPage.class and /dev/null differ diff --git a/plugin/Raven.SQDev.Wizards/src/raven/sqdev/wizards/SQDevBaseNewProjectWizard.java b/plugin/Raven.SQDev.Wizards/src/raven/sqdev/wizards/SQDevBaseNewProjectWizard.java index bb2564dd..d1157866 100644 --- a/plugin/Raven.SQDev.Wizards/src/raven/sqdev/wizards/SQDevBaseNewProjectWizard.java +++ b/plugin/Raven.SQDev.Wizards/src/raven/sqdev/wizards/SQDevBaseNewProjectWizard.java @@ -9,7 +9,6 @@ import org.eclipse.ui.INewWizard; import org.eclipse.ui.IWorkbench; import org.eclipse.ui.wizards.newresource.BasicNewProjectResourceWizard; - import raven.sqdev.misc.SQDevInfobox; import raven.sqdev.util.EProjectType; import raven.sqdev.utilInterfaces.ISQDevInformationProvider; diff --git a/plugin/Raven.SQDev.Wizards/src/raven/sqdev/wizards/activator/Activator.java b/plugin/Raven.SQDev.Wizards/src/raven/sqdev/wizards/activator/Activator.java index 6f094ca6..f8101b2e 100644 --- a/plugin/Raven.SQDev.Wizards/src/raven/sqdev/wizards/activator/Activator.java +++ b/plugin/Raven.SQDev.Wizards/src/raven/sqdev/wizards/activator/Activator.java @@ -2,8 +2,7 @@ import org.eclipse.ui.plugin.AbstractUIPlugin; import org.osgi.framework.BundleContext; - -import raven.sqdev.pluginManager.SQDevPluginManager; +import raven.sqdev.pluginManagement.SQDevPluginManager; public class Activator extends AbstractUIPlugin { diff --git a/plugin/Raven.SQDev.Wizards/src/raven/sqdev/wizards/importWizard/SQDevImportWizard.java b/plugin/Raven.SQDev.Wizards/src/raven/sqdev/wizards/importWizard/SQDevImportWizard.java index 6988e407..b7f58e57 100644 --- a/plugin/Raven.SQDev.Wizards/src/raven/sqdev/wizards/importWizard/SQDevImportWizard.java +++ b/plugin/Raven.SQDev.Wizards/src/raven/sqdev/wizards/importWizard/SQDevImportWizard.java @@ -1,8 +1,8 @@ package raven.sqdev.wizards.importWizard; +import org.eclipse.core.runtime.IPath; import org.eclipse.core.runtime.IProgressMonitor; import org.eclipse.core.runtime.IStatus; -import org.eclipse.core.runtime.Path; import org.eclipse.core.runtime.Status; import org.eclipse.core.runtime.jobs.Job; import org.eclipse.jface.viewers.IStructuredSelection; @@ -24,7 +24,8 @@ public void init(IWorkbench workbench, IStructuredSelection selection) { @Override public boolean performFinish() { - Path selectedPath = page.getDirectory(); + IPath importDir = page.getDirectory(); + boolean copyResources = page.copyResources(); Job importJob = new Job("Importing folder...") { @@ -32,7 +33,7 @@ public boolean performFinish() { protected IStatus run(IProgressMonitor monitor) { monitor.beginTask("Importing folder...", 1); - ProjectUtil.importAsProject(selectedPath); + ProjectUtil.importAsProject(importDir, copyResources); monitor.worked(1); monitor.done(); diff --git a/plugin/Raven.SQDev.Wizards/src/raven/sqdev/wizards/importWizard/SQDevImportWizardPage.java b/plugin/Raven.SQDev.Wizards/src/raven/sqdev/wizards/importWizard/SQDevImportWizardPage.java index 7c617c15..12cf3766 100644 --- a/plugin/Raven.SQDev.Wizards/src/raven/sqdev/wizards/importWizard/SQDevImportWizardPage.java +++ b/plugin/Raven.SQDev.Wizards/src/raven/sqdev/wizards/importWizard/SQDevImportWizardPage.java @@ -9,6 +9,8 @@ import org.eclipse.swt.events.ModifyListener; import org.eclipse.swt.events.MouseAdapter; import org.eclipse.swt.events.MouseEvent; +import org.eclipse.swt.events.SelectionAdapter; +import org.eclipse.swt.events.SelectionEvent; import org.eclipse.swt.layout.GridLayout; import org.eclipse.swt.widgets.Button; import org.eclipse.swt.widgets.Combo; @@ -17,61 +19,66 @@ import org.eclipse.swt.widgets.Label; import org.eclipse.ui.PlatformUI; +import raven.sqdev.misc.SQDevPreferenceUtil; import raven.sqdev.util.ProjectUtil; import raven.sqdev.util.Util; public class SQDevImportWizardPage extends WizardPage { - + /** * The directory label */ Label pathLabel; - + /** * The combo for the chosen directory */ Combo directoryCombo; - + /** * The browse button */ Button browseButton; - + /** + * The copy label + */ + Label copyLabel; + /** + * The copy checkbox + */ + Button copyCheckBox; + public SQDevImportWizardPage(String pageName) { super(pageName); setTitle("Import"); } - + @Override public void createControl(Composite parent) { - Composite container = new Composite(parent, SWT.NULL); + Composite container = new Composite(parent, SWT.NONE); GridLayout layout = new GridLayout(); layout.numColumns = 3; layout.verticalSpacing = 9; container.setLayout(layout); - + // directory selection String pathTooltip = "The path to the folder that should be imported"; - - pathLabel = new Label(container, SWT.NULL); + + pathLabel = new Label(container, SWT.NONE); pathLabel.setText("&Path:"); pathLabel.setToolTipText(pathTooltip); - - + + directoryCombo = new Combo(container, SWT.DROP_DOWN); directoryCombo.setToolTipText(pathTooltip); - + for (String currentProfile : Util.getProfiles()) { // add the profiles directories - for (File currentFile : new File( - Util.getMissionsDirectory(currentProfile).toOSString()) - .listFiles()) { - + for (File currentFile : new File(Util.getMissionsDirectory(currentProfile).toOSString()).listFiles()) { + String fileName = currentFile.getName(); - fileName = (fileName.contains(".")) - ? fileName.substring(0, fileName.indexOf(".")) - : fileName; - + fileName = (fileName.contains(".")) ? fileName.substring(0, fileName.indexOf(".")) : fileName; + if (!ProjectUtil.exists(fileName)) { // add all paths to the respective missions if their names // don't conflict with an existing project @@ -79,99 +86,125 @@ public void createControl(Composite parent) { } } } - + directoryCombo.addModifyListener(new ModifyListener() { - + @Override public void modifyText(ModifyEvent e) { dialogChanged(); } }); - - + + browseButton = new Button(container, SWT.PUSH); browseButton.setToolTipText("Browse for the folder to import"); browseButton.setText("Browse..."); - + browseButton.addMouseListener(new MouseAdapter() { @Override public void mouseUp(MouseEvent event) { - DirectoryDialog dialog = new DirectoryDialog(PlatformUI - .getWorkbench().getActiveWorkbenchWindow().getShell()); - + DirectoryDialog dialog = new DirectoryDialog( + PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell()); + String initialPath = directoryCombo.getText(); - + if (initialPath != null && !initialPath.isEmpty()) { dialog.setFilterPath(initialPath); } - + String newPath = dialog.open(); - + if (newPath != null && !newPath.isEmpty()) { directoryCombo.setText(newPath); } } }); - - + + String copyTooltip = "Whether to copy all resources into the workspace instead of simply linking to them"; + copyLabel = new Label(container, SWT.NONE); + copyLabel.setText("&Copy to workspace:"); + copyLabel.setToolTipText(copyTooltip); + + copyCheckBox = new Button(container, SWT.CHECK); + copyCheckBox.setToolTipText(copyTooltip); + // make this the default option + copyCheckBox.setSelection(true); + + copyCheckBox.addSelectionListener(new SelectionAdapter() { + + @Override + public void widgetSelected(SelectionEvent e) { + dialogChanged(); + } + }); + + setControl(container); dialogChanged(); } - + /** * Gets called whenever the dialog changes */ protected void dialogChanged() { validate(); } - + /** * Validates the current input */ protected void validate() { Path filePath = new Path(directoryCombo.getText().trim()); - + if (filePath.isEmpty()) { updateStatus("You have to enter a path!"); return; } - + filePath = (Path) filePath.makeAbsolute(); - + File file = filePath.toFile(); - + if (!file.exists()) { - updateStatus("The file\"" + file.getAbsolutePath() - + "\" does not exist!"); + updateStatus("The file\"" + file.getAbsolutePath() + "\" does not exist!"); return; } - + if (!file.isDirectory()) { updateStatus("The given file has to be a folder!"); return; } - + String projectName; if (Util.isMissionFolder(file)) { - projectName = file.getName().substring(0, - file.getName().lastIndexOf(".")); + projectName = file.getName().substring(0, file.getName().lastIndexOf(".")); } else { projectName = file.getName(); } - + if (ProjectUtil.exists(projectName)) { updateStatus("A project with the given name does already exist!"); return; } - + + if (!copyCheckBox.getSelection() + && new Path(SQDevPreferenceUtil.getArmaDocumentsDirectory()).isPrefixOf(filePath)) { + // if it is disabled and the project to import is in the arma mission directory + // -> warning + setWarning( + "It is intended to copy missions from the Arma directory into the workspace. Proceed at own risk!"); + return; + } + updateStatus(null); + setWarning(null); } - + /** - * Sets the error message for this wizard page. It will automatically - * prevent the page from being finished as long as there is a error message. - * If you want to make remove the error message pass null as an - * argument which will make the page finishable again. + * Sets the error message for this wizard page. It will automatically prevent + * the page from being finished as long as there is a error message. If you want + * to make remove the error message pass null as an argument which + * will make the page finishable again. * * @param message * The message to be displayed @@ -180,12 +213,30 @@ protected void updateStatus(String message) { setErrorMessage(message); setPageComplete(message == null); } - + /** - * Gets the selected flder that should be imported + * Displays a warning message + * + * @param message + * The warning message or null to clear the message + */ + protected void setWarning(String message) { + setMessage(message, WARNING); + } + + /** + * Gets the selected folder that should be imported */ public Path getDirectory() { return (Path) new Path(directoryCombo.getText()).makeAbsolute(); } - + + /** + * Whether or not the resources should get copied into the workspace while + * importing them + */ + public boolean copyResources() { + return copyCheckBox.getSelection(); + } + } diff --git a/plugin/Raven.SQDev/feature.xml b/plugin/Raven.SQDev/feature.xml index b994ecfd..ae9b165e 100644 --- a/plugin/Raven.SQDev/feature.xml +++ b/plugin/Raven.SQDev/feature.xml @@ -2,12 +2,12 @@ SQDev provides a set of features to facilitate the development -of scripts for the ArmA series. +of scripts for the Arma series. @@ -78,59 +78,59 @@ POSSIBILITY OF SUCH DAMAGE. - - - - + + + + diff --git a/plugin/RavenSQDev.Preferences/.gitignore b/plugin/RavenSQDev.Preferences/.gitignore new file mode 100644 index 00000000..ae3c1726 --- /dev/null +++ b/plugin/RavenSQDev.Preferences/.gitignore @@ -0,0 +1 @@ +/bin/ diff --git a/plugin/RavenSQDev.Preferences/META-INF/MANIFEST.MF b/plugin/RavenSQDev.Preferences/META-INF/MANIFEST.MF index f3502095..a64ba0d3 100644 --- a/plugin/RavenSQDev.Preferences/META-INF/MANIFEST.MF +++ b/plugin/RavenSQDev.Preferences/META-INF/MANIFEST.MF @@ -2,7 +2,7 @@ Manifest-Version: 1.0 Bundle-ManifestVersion: 2 Bundle-Name: Preferences Bundle-SymbolicName: raven.sqdev.preferences;singleton:=true -Bundle-Version: 0.5.5 +Bundle-Version: 0.5.6.stable Bundle-Activator: raven.sqdev.preferences.activator.Activator Bundle-Vendor: Raven Require-Bundle: org.eclipse.ui, @@ -10,8 +10,8 @@ Require-Bundle: org.eclipse.ui, org.eclipse.swt, org.eclipse.osgi, org.eclipse.ui.editors, - raven.sqdev.util;bundle-version="0.3.0", - raven.sqdev.misc;bundle-version="0.1.0" + raven.sqdev.util, + raven.sqdev.misc Bundle-RequiredExecutionEnvironment: JavaSE-1.8 Bundle-ActivationPolicy: lazy Export-Package: raven.sqdev.preferences.activator;uses:="org.osgi.framework,org.eclipse.ui.plugin", diff --git a/plugin/RavenSQDev.Preferences/bin/raven/sqdev/preferences/activator/Activator.class b/plugin/RavenSQDev.Preferences/bin/raven/sqdev/preferences/activator/Activator.class deleted file mode 100644 index 396ce7a6..00000000 Binary files a/plugin/RavenSQDev.Preferences/bin/raven/sqdev/preferences/activator/Activator.class and /dev/null differ diff --git a/plugin/RavenSQDev.Preferences/bin/raven/sqdev/preferences/initializer/SQDevPreferenceInitializer.class b/plugin/RavenSQDev.Preferences/bin/raven/sqdev/preferences/initializer/SQDevPreferenceInitializer.class deleted file mode 100644 index d6dc418d..00000000 Binary files a/plugin/RavenSQDev.Preferences/bin/raven/sqdev/preferences/initializer/SQDevPreferenceInitializer.class and /dev/null differ diff --git a/plugin/RavenSQDev.Preferences/bin/raven/sqdev/preferences/pages/EStatus.class b/plugin/RavenSQDev.Preferences/bin/raven/sqdev/preferences/pages/EStatus.class deleted file mode 100644 index c749b475..00000000 Binary files a/plugin/RavenSQDev.Preferences/bin/raven/sqdev/preferences/pages/EStatus.class and /dev/null differ diff --git a/plugin/RavenSQDev.Preferences/bin/raven/sqdev/preferences/pages/ISQDevPreferencePage.class b/plugin/RavenSQDev.Preferences/bin/raven/sqdev/preferences/pages/ISQDevPreferencePage.class deleted file mode 100644 index a801ae17..00000000 Binary files a/plugin/RavenSQDev.Preferences/bin/raven/sqdev/preferences/pages/ISQDevPreferencePage.class and /dev/null differ diff --git a/plugin/RavenSQDev.Preferences/bin/raven/sqdev/preferences/pages/SQDevEditorPreferencePage.class b/plugin/RavenSQDev.Preferences/bin/raven/sqdev/preferences/pages/SQDevEditorPreferencePage.class deleted file mode 100644 index 7b1c422e..00000000 Binary files a/plugin/RavenSQDev.Preferences/bin/raven/sqdev/preferences/pages/SQDevEditorPreferencePage.class and /dev/null differ diff --git a/plugin/RavenSQDev.Preferences/bin/raven/sqdev/preferences/pages/SQDevGeneralPreferencePage$1.class b/plugin/RavenSQDev.Preferences/bin/raven/sqdev/preferences/pages/SQDevGeneralPreferencePage$1.class deleted file mode 100644 index f6e596b0..00000000 Binary files a/plugin/RavenSQDev.Preferences/bin/raven/sqdev/preferences/pages/SQDevGeneralPreferencePage$1.class and /dev/null differ diff --git a/plugin/RavenSQDev.Preferences/bin/raven/sqdev/preferences/pages/SQDevGeneralPreferencePage.class b/plugin/RavenSQDev.Preferences/bin/raven/sqdev/preferences/pages/SQDevGeneralPreferencePage.class deleted file mode 100644 index 62449a16..00000000 Binary files a/plugin/RavenSQDev.Preferences/bin/raven/sqdev/preferences/pages/SQDevGeneralPreferencePage.class and /dev/null differ diff --git a/plugin/RavenSQDev.Preferences/bin/raven/sqdev/preferences/pages/SQDevLinkingPreferencePage.class b/plugin/RavenSQDev.Preferences/bin/raven/sqdev/preferences/pages/SQDevLinkingPreferencePage.class deleted file mode 100644 index b92fd8f1..00000000 Binary files a/plugin/RavenSQDev.Preferences/bin/raven/sqdev/preferences/pages/SQDevLinkingPreferencePage.class and /dev/null differ diff --git a/plugin/RavenSQDev.Preferences/bin/raven/sqdev/preferences/pages/SQDevMiscPreferencePage$1.class b/plugin/RavenSQDev.Preferences/bin/raven/sqdev/preferences/pages/SQDevMiscPreferencePage$1.class deleted file mode 100644 index 0c9f1078..00000000 Binary files a/plugin/RavenSQDev.Preferences/bin/raven/sqdev/preferences/pages/SQDevMiscPreferencePage$1.class and /dev/null differ diff --git a/plugin/RavenSQDev.Preferences/bin/raven/sqdev/preferences/pages/SQDevMiscPreferencePage$2.class b/plugin/RavenSQDev.Preferences/bin/raven/sqdev/preferences/pages/SQDevMiscPreferencePage$2.class deleted file mode 100644 index bf6ae80f..00000000 Binary files a/plugin/RavenSQDev.Preferences/bin/raven/sqdev/preferences/pages/SQDevMiscPreferencePage$2.class and /dev/null differ diff --git a/plugin/RavenSQDev.Preferences/bin/raven/sqdev/preferences/pages/SQDevMiscPreferencePage$3$1.class b/plugin/RavenSQDev.Preferences/bin/raven/sqdev/preferences/pages/SQDevMiscPreferencePage$3$1.class deleted file mode 100644 index 5e6b4ff4..00000000 Binary files a/plugin/RavenSQDev.Preferences/bin/raven/sqdev/preferences/pages/SQDevMiscPreferencePage$3$1.class and /dev/null differ diff --git a/plugin/RavenSQDev.Preferences/bin/raven/sqdev/preferences/pages/SQDevMiscPreferencePage$3.class b/plugin/RavenSQDev.Preferences/bin/raven/sqdev/preferences/pages/SQDevMiscPreferencePage$3.class deleted file mode 100644 index f2c553a5..00000000 Binary files a/plugin/RavenSQDev.Preferences/bin/raven/sqdev/preferences/pages/SQDevMiscPreferencePage$3.class and /dev/null differ diff --git a/plugin/RavenSQDev.Preferences/bin/raven/sqdev/preferences/pages/SQDevMiscPreferencePage.class b/plugin/RavenSQDev.Preferences/bin/raven/sqdev/preferences/pages/SQDevMiscPreferencePage.class deleted file mode 100644 index fad9d777..00000000 Binary files a/plugin/RavenSQDev.Preferences/bin/raven/sqdev/preferences/pages/SQDevMiscPreferencePage.class and /dev/null differ diff --git a/plugin/RavenSQDev.Preferences/bin/raven/sqdev/preferences/pages/SQDevPreferencePage.class b/plugin/RavenSQDev.Preferences/bin/raven/sqdev/preferences/pages/SQDevPreferencePage.class deleted file mode 100644 index 2e35bba7..00000000 Binary files a/plugin/RavenSQDev.Preferences/bin/raven/sqdev/preferences/pages/SQDevPreferencePage.class and /dev/null differ diff --git a/plugin/RavenSQDev.Preferences/bin/raven/sqdev/preferences/pages/SQDevViewsPreferencePage.class b/plugin/RavenSQDev.Preferences/bin/raven/sqdev/preferences/pages/SQDevViewsPreferencePage.class deleted file mode 100644 index 2bf006a8..00000000 Binary files a/plugin/RavenSQDev.Preferences/bin/raven/sqdev/preferences/pages/SQDevViewsPreferencePage.class and /dev/null differ diff --git a/plugin/RavenSQDev.Preferences/bin/raven/sqdev/preferences/preferenceEditors/AbstractSQDevPreferenceEditor.class b/plugin/RavenSQDev.Preferences/bin/raven/sqdev/preferences/preferenceEditors/AbstractSQDevPreferenceEditor.class deleted file mode 100644 index c8bdcf24..00000000 Binary files a/plugin/RavenSQDev.Preferences/bin/raven/sqdev/preferences/preferenceEditors/AbstractSQDevPreferenceEditor.class and /dev/null differ diff --git a/plugin/RavenSQDev.Preferences/bin/raven/sqdev/preferences/preferenceEditors/BooleanSQDevPreferenceEditor$1.class b/plugin/RavenSQDev.Preferences/bin/raven/sqdev/preferences/preferenceEditors/BooleanSQDevPreferenceEditor$1.class deleted file mode 100644 index 9dd0b96a..00000000 Binary files a/plugin/RavenSQDev.Preferences/bin/raven/sqdev/preferences/preferenceEditors/BooleanSQDevPreferenceEditor$1.class and /dev/null differ diff --git a/plugin/RavenSQDev.Preferences/bin/raven/sqdev/preferences/preferenceEditors/BooleanSQDevPreferenceEditor.class b/plugin/RavenSQDev.Preferences/bin/raven/sqdev/preferences/preferenceEditors/BooleanSQDevPreferenceEditor.class deleted file mode 100644 index 68d72248..00000000 Binary files a/plugin/RavenSQDev.Preferences/bin/raven/sqdev/preferences/preferenceEditors/BooleanSQDevPreferenceEditor.class and /dev/null differ diff --git a/plugin/RavenSQDev.Preferences/bin/raven/sqdev/preferences/preferenceEditors/ColorSQDevPreferenceEditor$1.class b/plugin/RavenSQDev.Preferences/bin/raven/sqdev/preferences/preferenceEditors/ColorSQDevPreferenceEditor$1.class deleted file mode 100644 index a78d690a..00000000 Binary files a/plugin/RavenSQDev.Preferences/bin/raven/sqdev/preferences/preferenceEditors/ColorSQDevPreferenceEditor$1.class and /dev/null differ diff --git a/plugin/RavenSQDev.Preferences/bin/raven/sqdev/preferences/preferenceEditors/ColorSQDevPreferenceEditor.class b/plugin/RavenSQDev.Preferences/bin/raven/sqdev/preferences/preferenceEditors/ColorSQDevPreferenceEditor.class deleted file mode 100644 index 62192927..00000000 Binary files a/plugin/RavenSQDev.Preferences/bin/raven/sqdev/preferences/preferenceEditors/ColorSQDevPreferenceEditor.class and /dev/null differ diff --git a/plugin/RavenSQDev.Preferences/bin/raven/sqdev/preferences/preferenceEditors/ComboSQDevPreferenceEditor$1.class b/plugin/RavenSQDev.Preferences/bin/raven/sqdev/preferences/preferenceEditors/ComboSQDevPreferenceEditor$1.class deleted file mode 100644 index 2da1ea68..00000000 Binary files a/plugin/RavenSQDev.Preferences/bin/raven/sqdev/preferences/preferenceEditors/ComboSQDevPreferenceEditor$1.class and /dev/null differ diff --git a/plugin/RavenSQDev.Preferences/bin/raven/sqdev/preferences/preferenceEditors/ComboSQDevPreferenceEditor.class b/plugin/RavenSQDev.Preferences/bin/raven/sqdev/preferences/preferenceEditors/ComboSQDevPreferenceEditor.class deleted file mode 100644 index e295a0c2..00000000 Binary files a/plugin/RavenSQDev.Preferences/bin/raven/sqdev/preferences/preferenceEditors/ComboSQDevPreferenceEditor.class and /dev/null differ diff --git a/plugin/RavenSQDev.Preferences/bin/raven/sqdev/preferences/preferenceEditors/DirectorySQDevPreferenceEditor$1.class b/plugin/RavenSQDev.Preferences/bin/raven/sqdev/preferences/preferenceEditors/DirectorySQDevPreferenceEditor$1.class deleted file mode 100644 index 59081db5..00000000 Binary files a/plugin/RavenSQDev.Preferences/bin/raven/sqdev/preferences/preferenceEditors/DirectorySQDevPreferenceEditor$1.class and /dev/null differ diff --git a/plugin/RavenSQDev.Preferences/bin/raven/sqdev/preferences/preferenceEditors/DirectorySQDevPreferenceEditor$2.class b/plugin/RavenSQDev.Preferences/bin/raven/sqdev/preferences/preferenceEditors/DirectorySQDevPreferenceEditor$2.class deleted file mode 100644 index 7d542dbc..00000000 Binary files a/plugin/RavenSQDev.Preferences/bin/raven/sqdev/preferences/preferenceEditors/DirectorySQDevPreferenceEditor$2.class and /dev/null differ diff --git a/plugin/RavenSQDev.Preferences/bin/raven/sqdev/preferences/preferenceEditors/DirectorySQDevPreferenceEditor.class b/plugin/RavenSQDev.Preferences/bin/raven/sqdev/preferences/preferenceEditors/DirectorySQDevPreferenceEditor.class deleted file mode 100644 index c6953232..00000000 Binary files a/plugin/RavenSQDev.Preferences/bin/raven/sqdev/preferences/preferenceEditors/DirectorySQDevPreferenceEditor.class and /dev/null differ diff --git a/plugin/RavenSQDev.Preferences/bin/raven/sqdev/preferences/preferenceEditors/ISQDevPreferenceEditor.class b/plugin/RavenSQDev.Preferences/bin/raven/sqdev/preferences/preferenceEditors/ISQDevPreferenceEditor.class deleted file mode 100644 index fe673e74..00000000 Binary files a/plugin/RavenSQDev.Preferences/bin/raven/sqdev/preferences/preferenceEditors/ISQDevPreferenceEditor.class and /dev/null differ diff --git a/plugin/RavenSQDev.Preferences/bin/raven/sqdev/preferences/preferenceEditors/IntegerSQDevPreferenceEditor$1.class b/plugin/RavenSQDev.Preferences/bin/raven/sqdev/preferences/preferenceEditors/IntegerSQDevPreferenceEditor$1.class deleted file mode 100644 index 0e6f90d3..00000000 Binary files a/plugin/RavenSQDev.Preferences/bin/raven/sqdev/preferences/preferenceEditors/IntegerSQDevPreferenceEditor$1.class and /dev/null differ diff --git a/plugin/RavenSQDev.Preferences/bin/raven/sqdev/preferences/preferenceEditors/IntegerSQDevPreferenceEditor.class b/plugin/RavenSQDev.Preferences/bin/raven/sqdev/preferences/preferenceEditors/IntegerSQDevPreferenceEditor.class deleted file mode 100644 index 2da59c26..00000000 Binary files a/plugin/RavenSQDev.Preferences/bin/raven/sqdev/preferences/preferenceEditors/IntegerSQDevPreferenceEditor.class and /dev/null differ diff --git a/plugin/RavenSQDev.Preferences/bin/raven/sqdev/preferences/preferenceEditors/MultiStringPreferenceEditor$1.class b/plugin/RavenSQDev.Preferences/bin/raven/sqdev/preferences/preferenceEditors/MultiStringPreferenceEditor$1.class deleted file mode 100644 index 3a49d504..00000000 Binary files a/plugin/RavenSQDev.Preferences/bin/raven/sqdev/preferences/preferenceEditors/MultiStringPreferenceEditor$1.class and /dev/null differ diff --git a/plugin/RavenSQDev.Preferences/bin/raven/sqdev/preferences/preferenceEditors/MultiStringPreferenceEditor$1ContainerUpdater.class b/plugin/RavenSQDev.Preferences/bin/raven/sqdev/preferences/preferenceEditors/MultiStringPreferenceEditor$1ContainerUpdater.class deleted file mode 100644 index c8ae7537..00000000 Binary files a/plugin/RavenSQDev.Preferences/bin/raven/sqdev/preferences/preferenceEditors/MultiStringPreferenceEditor$1ContainerUpdater.class and /dev/null differ diff --git a/plugin/RavenSQDev.Preferences/bin/raven/sqdev/preferences/preferenceEditors/MultiStringPreferenceEditor$2.class b/plugin/RavenSQDev.Preferences/bin/raven/sqdev/preferences/preferenceEditors/MultiStringPreferenceEditor$2.class deleted file mode 100644 index 40ea8fea..00000000 Binary files a/plugin/RavenSQDev.Preferences/bin/raven/sqdev/preferences/preferenceEditors/MultiStringPreferenceEditor$2.class and /dev/null differ diff --git a/plugin/RavenSQDev.Preferences/bin/raven/sqdev/preferences/preferenceEditors/MultiStringPreferenceEditor$3$1.class b/plugin/RavenSQDev.Preferences/bin/raven/sqdev/preferences/preferenceEditors/MultiStringPreferenceEditor$3$1.class deleted file mode 100644 index 685d73a1..00000000 Binary files a/plugin/RavenSQDev.Preferences/bin/raven/sqdev/preferences/preferenceEditors/MultiStringPreferenceEditor$3$1.class and /dev/null differ diff --git a/plugin/RavenSQDev.Preferences/bin/raven/sqdev/preferences/preferenceEditors/MultiStringPreferenceEditor$3.class b/plugin/RavenSQDev.Preferences/bin/raven/sqdev/preferences/preferenceEditors/MultiStringPreferenceEditor$3.class deleted file mode 100644 index ec2076cd..00000000 Binary files a/plugin/RavenSQDev.Preferences/bin/raven/sqdev/preferences/preferenceEditors/MultiStringPreferenceEditor$3.class and /dev/null differ diff --git a/plugin/RavenSQDev.Preferences/bin/raven/sqdev/preferences/preferenceEditors/MultiStringPreferenceEditor$4.class b/plugin/RavenSQDev.Preferences/bin/raven/sqdev/preferences/preferenceEditors/MultiStringPreferenceEditor$4.class deleted file mode 100644 index ef5208ee..00000000 Binary files a/plugin/RavenSQDev.Preferences/bin/raven/sqdev/preferences/preferenceEditors/MultiStringPreferenceEditor$4.class and /dev/null differ diff --git a/plugin/RavenSQDev.Preferences/bin/raven/sqdev/preferences/preferenceEditors/MultiStringPreferenceEditor$5.class b/plugin/RavenSQDev.Preferences/bin/raven/sqdev/preferences/preferenceEditors/MultiStringPreferenceEditor$5.class deleted file mode 100644 index 33972319..00000000 Binary files a/plugin/RavenSQDev.Preferences/bin/raven/sqdev/preferences/preferenceEditors/MultiStringPreferenceEditor$5.class and /dev/null differ diff --git a/plugin/RavenSQDev.Preferences/bin/raven/sqdev/preferences/preferenceEditors/MultiStringPreferenceEditor$6.class b/plugin/RavenSQDev.Preferences/bin/raven/sqdev/preferences/preferenceEditors/MultiStringPreferenceEditor$6.class deleted file mode 100644 index c0f37c3a..00000000 Binary files a/plugin/RavenSQDev.Preferences/bin/raven/sqdev/preferences/preferenceEditors/MultiStringPreferenceEditor$6.class and /dev/null differ diff --git a/plugin/RavenSQDev.Preferences/bin/raven/sqdev/preferences/preferenceEditors/MultiStringPreferenceEditor.class b/plugin/RavenSQDev.Preferences/bin/raven/sqdev/preferences/preferenceEditors/MultiStringPreferenceEditor.class deleted file mode 100644 index 99eb8552..00000000 Binary files a/plugin/RavenSQDev.Preferences/bin/raven/sqdev/preferences/preferenceEditors/MultiStringPreferenceEditor.class and /dev/null differ diff --git a/plugin/RavenSQDev.Preferences/bin/raven/sqdev/preferences/preferenceEditors/ValueSQDevPreferenceEditor$1.class b/plugin/RavenSQDev.Preferences/bin/raven/sqdev/preferences/preferenceEditors/ValueSQDevPreferenceEditor$1.class deleted file mode 100644 index ab334bed..00000000 Binary files a/plugin/RavenSQDev.Preferences/bin/raven/sqdev/preferences/preferenceEditors/ValueSQDevPreferenceEditor$1.class and /dev/null differ diff --git a/plugin/RavenSQDev.Preferences/bin/raven/sqdev/preferences/preferenceEditors/ValueSQDevPreferenceEditor.class b/plugin/RavenSQDev.Preferences/bin/raven/sqdev/preferences/preferenceEditors/ValueSQDevPreferenceEditor.class deleted file mode 100644 index 7fe9cfe3..00000000 Binary files a/plugin/RavenSQDev.Preferences/bin/raven/sqdev/preferences/preferenceEditors/ValueSQDevPreferenceEditor.class and /dev/null differ diff --git a/plugin/RavenSQDev.Preferences/bin/raven/sqdev/preferences/util/EStatus.class b/plugin/RavenSQDev.Preferences/bin/raven/sqdev/preferences/util/EStatus.class deleted file mode 100644 index 126e025d..00000000 Binary files a/plugin/RavenSQDev.Preferences/bin/raven/sqdev/preferences/util/EStatus.class and /dev/null differ diff --git a/plugin/RavenSQDev.Preferences/bin/raven/sqdev/preferences/util/ISQDevPreferenceEditorListener.class b/plugin/RavenSQDev.Preferences/bin/raven/sqdev/preferences/util/ISQDevPreferenceEditorListener.class deleted file mode 100644 index 265cc352..00000000 Binary files a/plugin/RavenSQDev.Preferences/bin/raven/sqdev/preferences/util/ISQDevPreferenceEditorListener.class and /dev/null differ diff --git a/plugin/RavenSQDev.Preferences/bin/raven/sqdev/preferences/util/SQDevChangeEvent.class b/plugin/RavenSQDev.Preferences/bin/raven/sqdev/preferences/util/SQDevChangeEvent.class deleted file mode 100644 index c65ee36f..00000000 Binary files a/plugin/RavenSQDev.Preferences/bin/raven/sqdev/preferences/util/SQDevChangeEvent.class and /dev/null differ diff --git a/plugin/RavenSQDev.Preferences/bin/raven/sqdev/preferences/util/SQDevInvalidPreferenceException.class b/plugin/RavenSQDev.Preferences/bin/raven/sqdev/preferences/util/SQDevInvalidPreferenceException.class deleted file mode 100644 index 53b7d97d..00000000 Binary files a/plugin/RavenSQDev.Preferences/bin/raven/sqdev/preferences/util/SQDevInvalidPreferenceException.class and /dev/null differ diff --git a/plugin/RavenSQDev.Preferences/bin/raven/sqdev/preferences/util/SQDevPreferenceComposite.class b/plugin/RavenSQDev.Preferences/bin/raven/sqdev/preferences/util/SQDevPreferenceComposite.class deleted file mode 100644 index c5b4f756..00000000 Binary files a/plugin/RavenSQDev.Preferences/bin/raven/sqdev/preferences/util/SQDevPreferenceComposite.class and /dev/null differ diff --git a/plugin/RavenSQDev.Preferences/src/raven/sqdev/preferences/activator/Activator.java b/plugin/RavenSQDev.Preferences/src/raven/sqdev/preferences/activator/Activator.java index ec721cad..42520d61 100644 --- a/plugin/RavenSQDev.Preferences/src/raven/sqdev/preferences/activator/Activator.java +++ b/plugin/RavenSQDev.Preferences/src/raven/sqdev/preferences/activator/Activator.java @@ -3,7 +3,7 @@ import org.eclipse.ui.plugin.AbstractUIPlugin; import org.osgi.framework.BundleContext; -import raven.sqdev.pluginManager.SQDevPluginManager; +import raven.sqdev.pluginManagement.SQDevPluginManager; /** * The activator class controls the plug-in life cycle diff --git a/plugin/RavenSQDev.Preferences/src/raven/sqdev/preferences/pages/SQDevMiscPreferencePage.java b/plugin/RavenSQDev.Preferences/src/raven/sqdev/preferences/pages/SQDevMiscPreferencePage.java index 2531a8b1..e6e08d00 100644 --- a/plugin/RavenSQDev.Preferences/src/raven/sqdev/preferences/pages/SQDevMiscPreferencePage.java +++ b/plugin/RavenSQDev.Preferences/src/raven/sqdev/preferences/pages/SQDevMiscPreferencePage.java @@ -40,29 +40,27 @@ public class SQDevMiscPreferencePage extends SQDevPreferencePage { * The list storing previously processed commands */ private KeywordList commandList; - + public SQDevMiscPreferencePage() { super(); } - + @Override public void init(IWorkbench workbench) { setDescription("Miscellaneous preferences about the plugin"); - + // SQF keyword collection updateButton = new Button(createContainer(), SWT.PUSH); - updateButton.setToolTipText( - "Updates the SQF commands according to the BIKI. This may take a while"); - updateButton.setEnabled( - collectionJob == null || collectionJob.getResult() != null); - + updateButton.setToolTipText("Updates the SQF commands according to the BIKI. This may take a while"); + updateButton.setEnabled(collectionJob == null || collectionJob.getResult() != null); + // set text according to status if (!updateButton.isEnabled()) { updateButton.setText("Updating commands..."); } else { updateButton.setText("Update commands"); } - + updateButton.addMouseListener(new MouseAdapter() { @Override public void mouseUp(MouseEvent e) { @@ -70,81 +68,70 @@ public void mouseUp(MouseEvent e) { updateButton.setEnabled(false); updateButton.setText("Updating keywords..."); updateButton.pack(true); - + updateKeywords(); } }); - + Button resetButton = new Button(createContainer(), SWT.PUSH); resetButton.setText("Reset Keywords"); - + if (ResourceManager.getManager().isOnBackup("SQFKeywords.txt")) { resetButton.setEnabled(false); } else { - resetButton.setToolTipText( - "Resets the keywords to the backup version"); - + resetButton.setToolTipText("Resets the keywords to the backup version"); + resetButton.addMouseListener(new MouseAdapter() { - + @Override public void mouseUp(MouseEvent e) { // backup keywords - ResourceManager.getManager() - .switchToBackup("SQFKeywords.txt"); - + ResourceManager.getManager().switchToBackup("SQFKeywords.txt"); + resetButton.setEnabled(false); } }); } - + // preferences about the command collection Group keywordGroup = createGroup("Command collection/updating"); - - createDescription(keywordGroup, - "Preferences about the command update process"); - - addPreferenceEditor(new ValueSQDevPreferenceEditor( - SQDevPreferenceConstants.SQDEV_COLLECTION_API_ADRESS, - "&BIKI API:", - "The adress to the BIKI API. If there is no urgent need do not change this value!", + + createDescription(keywordGroup, "Preferences about the command update process"); + + addPreferenceEditor(new ValueSQDevPreferenceEditor(SQDevPreferenceConstants.SQDEV_COLLECTION_API_ADRESS, + "&BIKI API:", "The adress to the BIKI API. If there is no urgent need do not change this value!", keywordGroup)); - - addPreferenceEditor(new ValueSQDevPreferenceEditor( - SQDevPreferenceConstants.SQDEV_COLLECTION_API_MAINPAGE, - "&Main Page Name:", - "The name of the main page that lists the SQF commands." + + addPreferenceEditor(new ValueSQDevPreferenceEditor(SQDevPreferenceConstants.SQDEV_COLLECTION_API_MAINPAGE, + "&Main Page Name:", "The name of the main page that lists the SQF commands." + " If there is no urgent need do not change this value!", keywordGroup)); - - + + // all preferences about user prompts Group promptGroup = createGroup("User prompt"); - - createDescription(promptGroup, - "Preferences about when to prompt the user to do something"); - - addPreferenceEditor(new BooleanSQDevPreferenceEditor( - SQDevPreferenceConstants.SQDEV_PROMPT_ALWAYS_SAVE_ON_EXIT, + + createDescription(promptGroup, "Preferences about when to prompt the user to do something"); + + addPreferenceEditor(new BooleanSQDevPreferenceEditor(SQDevPreferenceConstants.SQDEV_PROMPT_ALWAYS_SAVE_ON_EXIT, "&Always save on exit:", "Whether unsaved preferences should get saved automatically when clicking \"OK\" without a popup asking for it", promptGroup)); - - addPreferenceEditor(new BooleanSQDevPreferenceEditor( - SQDevPreferenceConstants.SQDEV_PROMPT_ASK_FOR_DELETION, - "&Validate deletions:", - "Whether the plugin should prompt the user to validate a deletion he caused", + + addPreferenceEditor(new BooleanSQDevPreferenceEditor(SQDevPreferenceConstants.SQDEV_PROMPT_ASK_FOR_DELETION, + "&Validate deletions:", "Whether the plugin should prompt the user to validate a deletion he caused", promptGroup)); } - + /** * Schedules the keyword update job */ private void updateKeywords() { commandList = new KeywordList(); - + updateKeywords(null); } - + /** * Schedules the keyword update Job * @@ -161,133 +148,107 @@ private void updateKeywords(URL repeat) { collectionJob = new Job("Updating keywords") { @Override protected IStatus run(IProgressMonitor monitor) { - monitor.beginTask("Updating keywords", - IProgressMonitor.UNKNOWN); - + monitor.beginTask("Updating keywords", IProgressMonitor.UNKNOWN); + try { // gather keywords from the wiki - SQFCommandCollector collector = new SQFCommandCollector( - SQDevPreferenceUtil.getAPIAdress(), + SQFCommandCollector collector = new SQFCommandCollector(SQDevPreferenceUtil.getAPIAdress(), SQDevPreferenceUtil.getAPIMainPage()); - + KeywordList list = collector.collect(monitor, repeat); - - list.addKeywords(commandList.getKeywords()); // add - // previously - // gathered - // commands - + + list.addKeywords(commandList.getKeywords().values()); // add previously gathered commands + if (monitor.isCanceled()) { // ask whether to save the list - SQDevInfobox info = new SQDevInfobox( - "The keyword update has been interrupted.\n" - + "Do you wish to store the current keywords?" - + " (This will override the current keword list and may" - + " leed to an incomplete list)", - SWT.ICON_QUESTION | SWT.YES | SWT.NO); - + SQDevInfobox info = new SQDevInfobox("The keyword update has been interrupted.\n" + + "Do you wish to store the current keywords?" + + " (This will override the current keword list and may" + + " leed to an incomplete list)", SWT.ICON_QUESTION | SWT.YES | SWT.NO); + if (info.open() != SWT.YES) { // don't save return Status.OK_STATUS; } } - - // sort keywords - list.sort(); - + // save the keywords monitor.done(); - monitor.beginTask("Storing keywords...", - IProgressMonitor.UNKNOWN); - + monitor.beginTask("Storing keywords...", IProgressMonitor.UNKNOWN); + ResourceManager manager = ResourceManager.getManager(); - manager.updateResource(ResourceManager.KEYWORDS_RESOURCE, - list.getSaveableFormat()); - + manager.updateResource(ResourceManager.KEYWORDS_RESOURCE, list.getSaveableFormat()); + // tell the user about restart - SQDevInfobox info = new SQDevInfobox( - "In order for the new keywords to take effect" - + " all respective editors will be restarted", - SWT.ICON_INFORMATION); - + SQDevInfobox info = new SQDevInfobox("In order for the new keywords to take effect" + + " all respective editors will be restarted", SWT.ICON_INFORMATION); + if (info.open() != SWT.OK) { return Status.OK_STATUS; } - + // restart all editors in order to overtake the changes Util.restartAllEditors(); } catch (IOException | SQDevException e) { if (e instanceof SQDevCollectionException - && ((SQDevCollectionException) e) - .getFailedKeywordURL() != null) { + && ((SQDevCollectionException) e).getFailedKeywordURL() != null) { SQDevCollectionException ex = (SQDevCollectionException) e; - - commandList - .addKeywords(ex.getPreviouslyProcessedKeywords() - .getKeywords()); - + + commandList.addKeywords(ex.getPreviouslyProcessedKeywords().getKeywords().values()); + SQDevInfobox info = new SQDevInfobox( - "Failed at updating keywords at \"" - + ((ex.getFailedKeywordURL() == null) - ? "Internal" - : ex.getFailedKeywordURL() - .toString()) - + "\"", + "Failed at updating keywords at \"" + ((ex.getFailedKeywordURL() == null) ? "Internal" + : ex.getFailedKeywordURL().toString()) + "\"", ex, "Do you want to retry this command?"); info.addStyle(SWT.CANCEL); - + int result = info.open(); - + switch (result) { - case SWT.YES: - updateKeywords(ex.getFailedKeywordURL()); - break; - - case SWT.NO: - updateKeywords(null); - break; + case SWT.YES: + updateKeywords(ex.getFailedKeywordURL()); + break; + + case SWT.NO: + updateKeywords(null); + break; } - + } else { - SQDevInfobox info = new SQDevInfobox( - "Failed at updating keywords!", e); + SQDevInfobox info = new SQDevInfobox("Failed at updating keywords!", e); info.open(); } - + e.printStackTrace(); return Status.CANCEL_STATUS; } finally { if (!PlatformUI.getWorkbench().getDisplay().isDisposed()) { // reset buton status - PlatformUI.getWorkbench().getDisplay() - .syncExec(new Runnable() { - - @Override - public void run() { - if (updateButton != null - && !updateButton.isDisposed()) { - updateButton - .setText("Update keywords"); - updateButton.setEnabled(true); - updateButton.pack(true); - } - } - }); + PlatformUI.getWorkbench().getDisplay().syncExec(new Runnable() { + + @Override + public void run() { + if (updateButton != null && !updateButton.isDisposed()) { + updateButton.setText("Update keywords"); + updateButton.setEnabled(true); + updateButton.pack(true); + } + } + }); } - + monitor.done(); } - + return Status.OK_STATUS; } }; - + // make sure eclipse is not closed with this job running - SQDevEclipseEventManager.getManager() - .registerCloseSuspendingJob(collectionJob); - + SQDevEclipseEventManager.getManager().registerCloseSuspendingJob(collectionJob); + collectionJob.schedule(); } - - + + } diff --git a/plugin/SQDev/SQDev_0.7.5.zip b/plugin/SQDev/SQDev_0.7.5.zip new file mode 100644 index 00000000..a6f7cec8 Binary files /dev/null and b/plugin/SQDev/SQDev_0.7.5.zip differ diff --git a/plugin/SQDev/site.xml b/plugin/SQDev/site.xml index 603f6fd5..2d7e2d72 100644 --- a/plugin/SQDev/site.xml +++ b/plugin/SQDev/site.xml @@ -1,6 +1,6 @@ - +