Archive » Month: March 2013

Page 1 of 1

ArmA 3 Alpha: TL_fnc_getParameter, a function for easily handling required and optional parameters in your scripts

I had never dealt with optional parameters in my functions before, and by default, .sqf functions don’t have a way to handle optional parameters nor do they assign a default value if the parameter isn’t provided. I wanted to quickly check for an optional parameter, but also didn’t want to code multiple parameter checks for every function I wrote.

The result is TL_fnc_getParameter. An easy way to handle required and optional parameters in any script.

ArmA 3 Alpha: Scripting an assassination plot for single player missions with consequences for killing civilians

In this scenario, the player must assassinate an OPFOR General and confirm his death by checking his body. The player must not kill more than 3 civilians in the process.

If the player kills a civilian, a warning message is displayed showing how many civilians the player has killed and how many kills they are allowed left before the mission ends. If the player kills 3 civilians, the game ends. If the player confirms the General’s death the game goes on, but will still end if the player kills 3 civilians.

ArmA 3 Alpha: Scripting tasks for single player missions that must be completed in order

In this scenario, the player spawns with Task 1 as their current task and it is displayed on their HUD. A secondary task, called Task 2, is not displayed on the player’s HUD or when viewing all tasks.

To complete Task 1, the player must move to Task 1’s location. Once the player has reached Task 1’s location, a success message displays and indicates the player should now complete Task 2. Task 1 is hidden from the HUD and marked completed. Task 2 is then displayed on the HUD and when viewing all tasks.