Skip to content

Contributing To Ares

Anton Struyk edited this page Oct 1, 2015 · 7 revisions

Submitting Compositions

If you want to build some generic compositions for Ares here are the steps to follow:

  • Load up the VR map.
  • The VR map is perfectly flat and that avoids issues with objects getting placed up in the air when they are actually spawned.
  • Build your base, roadblock, checkpoint, etc..
  • Drop the 'Generate Mission SQF' module from the 'Save/Load' category and copy the resulting text to the clipboard.
  • Create an issue here on GitHub with 'Composition: ' in the title.
  • If you would like you can include a category: 'Composition: /'.
  • If you are submitting more than one composition at the same time that's OK. Just make sure to seperate the codeblocks appropriately.
  • Please use markdown code blocks (each line of SQF indented by 4 spaces) so that it's easier for me to copy/paste the code.
  • If you are not comfortable creating an issue on GitHub, paste your SQF into a new note on http://pastebin.com/ and put the generated link in the Official Ares thread.

That's it! I will do the remaining work to integrate the composition into the mod in the next release and update the issue to let you know when it has been done.

Some tips for making your compositions work well:

  • Don't include any live enemies or waypoints. These will not be included in the final compositions. Empty vehicles or fixed weapons are OK.
  • If you have side-specific units, consider making variations for your compositions for each side (e.g. 'NATO Roadblock', 'CSAT Roadblock', 'AAF Roadblock', etc...)
  • Do not include any units or structures from mods in the compositions - at this time only vanilla non-modded objects will be included in the compositions. DLC content is fine.

Adding New Functionality (Modules)

All new modules should be created through the use of 'Custom Modules'. The basic workflow is something like this:

  1. Come up with an idea for a thing you want to Add to Ares.
  2. Generate a custom module to do the work it in a test mission (see https://github.com/astruyk/Ares/wiki/Extras#defining-custom-modules).
  3. Debug and test your module
  4. When satisfied with the behaviour, copy the module into the 'Ares/src/addons/ares_zeusExtensions/scripts/...' folder with an appropriate filename.
  5. Modify registerBuildInCustomModules.sqf to include your new custom module.
  6. Rebuild the Ares addon.
  7. Check that your module appears and still functions.
  8. Submit your changes to the depot.

This has a number of advantages over the traditional 'write code in the mod' approach:

  • You can develop and test all of your module logic in your test mission without having to re-compile the module every time. This means you don't have to quit arma, recompile the module, restart arma, restart your map, and then re-test for each script error you encounter. You can simply by restarting the mission after making the modifications to your .SQF file.
  • There is no need to update the (finicky) class structure and module definition headers when adding new code. You can simply drop the .SQF into the scripts folder and register it.
  • It is trivial to import custom modules that already exist, and to make modules available for older Ares versions if necessary (since they are all registered the same way a mission's custom modules would be) or to re-package modules in the 'Extras' folder if they have special requirements.

Tips:

  • Setup a custom 'whiteroom' mission on a couple maps that has Zeus setup, a single player spawn, and an init.sqf file. You can simply build your custom module in the .sqf file and then, when satisfied, move the code over to the Ares scripts folder.
  • Make sure to handle common error cases (e.g. where users drops a module that needs to be placed on a unit into empty space). If you want a module to be accepted it should be somewhat robust so that it doesn't cause errors in normal usage.
  • Use the built-in Ares functions to help make UI and inform the user of things as necessary. Two of the most commonly used functions are:
  • Ares_fnc_ShowZeusMessage - shows a message to the zeus player.
  • Ares_fnc_ShowChooseDialog - Displays a dialog that lets the user choose between options.
  • Try to keep modules simple in scope, easy to use, and focused. Clear wording in UI and sensible defaults go a long way towards making things usable.
Clone this wiki locally