Introduction to Arma Scripting: Difference between revisions

From Bohemia Interactive Community
Jump to navigation Jump to search
mNo edit summary
Line 1: Line 1:
{{Stub}}
{{Stub}}


introduction
During [[ArmA: Mission Editing|mission editing]] and [[ArmA: Addon Editing|addon editing]] you will often come into the situation, where your imaginations can't be implemented using the native methods of the editors (f.i. cutscenes in missions, special animations in addons). The '''solution''' is either to learn more about the editor (f.i. advanced features and methods) or [[ArmA: Scripting|scripting]].
 
[[Armed Assault|Armed Assault's]] '''scripting language''' gives you the possibility of influencing the game engine. With any combination of so-called [[ArmA: Scripting Commands|scripting commands]] you can create custom processes, that handle any specific needs and problems in a mission.


== When Do I Need Scripting? ==
== When Do I Need Scripting? ==


difference mission editor - scripts, examples
[[ArmA: Scripting|Scripting]] is primarily needed in [[ArmA: Mission Editing|user missions]] by the mission editor. The goal is to create processes that can't be done with the native features of the [[ArmA: Mission Editor|mission editor]]. So this is the first important check before you start scripting. Often the mission editor wants tiny features in a mission that '''arent't worth a script'''. Ask yourself, whether the user will notice and/or use the outcome of your script.
 
'''Be careful:''' Scripting isn't a solution to everything. The third step is to make sure, whether your needs can be implemented in the scripting language. This can be hard for a beginner, but if you made sure the two above steps, it will be possible in most of the cases. If you aren't sure - just ask in the [http://www.flashpoint1985.com/cgi-bin/ikonboard311/ikonboard.cgi official forums] or at [http://www.ofpec.com OFPEC].
 
=== Checklist ===
 
Here is a short summed up checklist of the above mentioned points:
 
# Can I do it with the native features? ([[ArmA: Mission Editor|mission editor]], [[ArmA: Addon Configuration|addon config files]], ...)
# Will the player notice and/or use it?
# Is it possible?
 
If all of the three points are answered with "Yes", go on and script it! But be warned: It won't always be easy. ;-)


== Scripting Code ==
== Scripting Code ==

Revision as of 18:37, 20 December 2006

Template:Stub

During mission editing and addon editing you will often come into the situation, where your imaginations can't be implemented using the native methods of the editors (f.i. cutscenes in missions, special animations in addons). The solution is either to learn more about the editor (f.i. advanced features and methods) or scripting.

Armed Assault's scripting language gives you the possibility of influencing the game engine. With any combination of so-called scripting commands you can create custom processes, that handle any specific needs and problems in a mission.

When Do I Need Scripting?

Scripting is primarily needed in user missions by the mission editor. The goal is to create processes that can't be done with the native features of the mission editor. So this is the first important check before you start scripting. Often the mission editor wants tiny features in a mission that arent't worth a script. Ask yourself, whether the user will notice and/or use the outcome of your script.

Be careful: Scripting isn't a solution to everything. The third step is to make sure, whether your needs can be implemented in the scripting language. This can be hard for a beginner, but if you made sure the two above steps, it will be possible in most of the cases. If you aren't sure - just ask in the official forums or at OFPEC.

Checklist

Here is a short summed up checklist of the above mentioned points:

  1. Can I do it with the native features? (mission editor, addon config files, ...)
  2. Will the player notice and/or use it?
  3. Is it possible?

If all of the three points are answered with "Yes", go on and script it! But be warned: It won't always be easy. ;-)

Scripting Code

what is it? where to put it? what are commands (doing)?

Layout

layout of code

  • seperation by semicolons

conventions of code files

  • one command per line in scripts and functions
  • {} grouping code
  • spaces or tabs to indent code

Comments

what are comments, where to use

  • line comments
  • block comments

Code Execution

how can I execute code? (external files vs. mission editor)

Mission Editor

how to execute code in the editor, listing of mission editor fields to start scripts

External Files

how to execute code in external files, scripts & functions

Developing a Script

script in this case: code in external files (scripts/functions). how to develop a script?

  • Requirements
  • Concept
  • Implementation
  • Test

usually in your head, for complex scripts on paper and drafts

Requirements

what shall the script do?

Concept

How shall the script do it?

Implementation

Writing the code

Test

Testing the code

What's next?

learning about scripts

Scripts >>