R3vo/Sandbox1 – User

From Bohemia Interactive Community
Jump to navigation Jump to search
mNo edit summary
mNo edit summary
Line 39: Line 39:
The following scripts are used to animate the targets. Some of them only create a simply destruction effect, others are more sophisticated.
The following scripts are used to animate the targets. Some of them only create a simply destruction effect, others are more sophisticated.
To see their content, combine [[loadFile]] with the path.
To see their content, combine [[loadFile]] with the path.
* {{ic|a3\structures_f_mark\items\sport\scripts\balloon_01_air_f_hitpart.sqf}}
* <tt>a3\structures_f_mark\items\sport\scripts\balloon_01_air_f_hitpart.sqf</tt>
* {{ic|a3\structures_f_mark\items\sport\scripts\balloon_01_water_f_hitpart.sqf}}
* {{ic|a3\structures_f_mark\items\sport\scripts\balloon_01_water_f_hitpart.sqf}}
* {{ic|a3\structures_f_epa\items\vessels\scripts\eaudecombat_01_f_hitpart.sqf}}
* {{ic|a3\structures_f_epa\items\vessels\scripts\eaudecombat_01_f_hitpart.sqf}}

Revision as of 20:42, 23 April 2021

Arma 3 comes with a variety of shooting targets. Most of these targets come with a somewhat hidden functionality.

Changing pop-up-behaviour

The pop-up-behaviour can be changed by setting the variable noPop in missionNamespace

 missionNamespace setVariable ["noPop", true]; // Will prevent the targets from popping up again once they were hit
 missionNamespace setVariable ["noPop", false]; // Targets will pop up normally again after they were hit

Animating the targets

All of the above listed targets have an animation source called terc. This can be used to change the angle of the target. Let's say we have a pop up target place in the editor with the name popUpTarget:

 popUpTarget animateSource ["terc", 0.5]; // Target will have an angle of 45°
 popUpTarget animateSource ["terc", 1]; // Target will have an angle of 180°
 popUpTarget animateSource ["terc", 0]; // Target will have an angle of 90° e.g. the target will stand up straight
Random Fact: "terc" is Czech and means Object.

Example mission with "noPop" and "terc"

1. Open a new mission in Eden Editor and save it.
2. Place three pop-up targets. Make sure they are compatible. See R3vo/Sandbox1 - Targets.
3. Name the pop-up targets target_0, target_1, target_2.
4. Place any object you would like to use to control the targets' states and name it flag_control_targets.
5. Navigate to Menu StripScenarioOpen Scenario Folder.
6. In that folder create a file called initPlayerLocal.sqf. See Event Scripts for more information.
7. Paste the following code into that file and save it.

// Three local actions are added to the object "flag_control_targets". These actions are available for every player // Reset the animation state of all three targets flag_control_targets addAction ["Reset Targets", {[target_0, target_1, target_2] apply {_x animateSource ["terc", 0]}}]; // Disable the pop-up functionality by setting "noPop" to true globally flag_control_targets addAction ["Disable pop-up", {missionNamespace setVariable ["noPop", true, true]}]; // Enable the pop-up functionality by setting "noPop" to false globally. The targets will not automatically reset. Use the Reset Targets action flag_control_targets addAction ["Enable pop-up", {missionNamespace setVariable ["noPop", false, true]}];

8. Preview the mission and play around with the targets.

Interesting Scripts

The following scripts are used to animate the targets. Some of them only create a simply destruction effect, others are more sophisticated. To see their content, combine loadFile with the path.

  • a3\structures_f_mark\items\sport\scripts\balloon_01_air_f_hitpart.sqf
  • a3\structures_f_mark\items\sport\scripts\balloon_01_water_f_hitpart.sqf
  • a3\structures_f_epa\items\vessels\scripts\eaudecombat_01_f_hitpart.sqf
  • a3\props_f_orange\humanitarian\supplies\scripts\fruit_hitpart.sqf
  • a3\structures_f\training\data\scripts\land_target_oval_f_hitpart.sqf
  • a3\structures_f\training\data\scripts\metal_pole_skeet_f_hitpart.sqf
  • a3\structures_f\training\data\scripts\skeet_clay_f_hitpart.sqf
  • a3\structures_f_mark\training\scripts\target_dueling_01_f_hitpart.sqf
  • a3\structures_f_mark\training\scripts\target_swivel_01_f_hitpart.sqf
  • a3\structures_f\training\data\scripts\targetp_inf_f_hitpart.sqf

Targets

The following targets all posess the "terc" animation source and can therefore be animated.

Display Name Class
Pop-Up Target 1 TargetP_Inf_F
Pop-Up Target 1 (Zones) TargetP_Inf_Acc1_F
Pop-Up Target 1 (Accuracy) TargetP_Inf_Acc2_F
Moving Target 1 (Side) Target_PopUp_Moving_F
Moving Target 1 (Side - Zones) Target_PopUp_Moving_Acc1_F
Moving Target 1 (Side - Accuracy) Target_PopUp_Moving_Acc2_F
Moving Target 1 (Front) Target_PopUp_Moving_90deg_F
Moving Target 1 (Front - Zones) Target_PopUp_Moving_90deg_Acc1_F
Moving Target 1 (Front - Accuracy) Target_PopUp_Moving_90deg_Acc2_F
Pop-Up Target 2 TargetP_Inf2_F
Pop-Up Target 2 (Zones) TargetP_Inf2_Acc1_F
Pop-Up Target 2 (Accuracy) TargetP_Inf2_Acc2_F
Moving Target 2 (Side) Target_PopUp2_Moving_F
Moving Target 2 (Side - Zones) Target_PopUp2_Moving_Acc1_F
Moving Target 2 (Side - Accuracy) Target_PopUp2_Moving_Acc2_F
Moving Target 2 (Front) Target_PopUp2_Moving_90deg_F
Moving Target 2 (Front - Zones) Target_PopUp2_Moving_90deg_Acc1_F
Moving Target 2 (Front - Accuracy) Target_PopUp2_Moving_90deg_Acc2_F
Pop-Up Target 3 TargetP_Inf3_F
Pop-Up Target 3 (Zones) TargetP_Inf3_Acc1_F
Pop-Up Target 3 (Accuracy) TargetP_Inf3_Acc2_F
Moving Target 3 (Side) Target_PopUp3_Moving_F
Moving Target 3 (Side - Zones) Target_PopUp3_Moving_Acc1_F
Moving Target 3 (Side - Accuracy) Target_PopUp3_Moving_Acc2_F
Moving Target 3 (Front) Target_PopUp3_Moving_90deg_F
Moving Target 3 (Front - Zones) Target_PopUp3_Moving_90deg_Acc1_F
Moving Target 3 (Front - Accuracy) Target_PopUp3_Moving_90deg_Acc2_F
Pop-Up Zombie 1 TargetP_Zom_F
Pop-Up Zombie 1 (Zones) TargetP_Zom_Acc1_F
Moving Zombie 1 (Side) Zombie_PopUp_Moving_F
Moving Zombie 1 (Side - Zones) Zombie_PopUp_Moving_Acc1_F
Moving Zombie 1 (Front) Zombie_PopUp_Moving_90deg_F
Moving Zombie 1 (Front - Zones) Zombie_PopUp_Moving_90deg_Acc1_F
Pop-Up Hostage 1 TargetP_Civ_F
Moving Hostage 1 (Side) Hostage_PopUp_Moving_F
Moving Hostage 1 (Front) Hostage_PopUp_Moving_90deg_F
Pop-Up Hostage 2 TargetP_Civ2_F
Moving Hostage 2 (Side) Hostage_PopUp2_Moving_F
Moving Hostage 2 (Front) Hostage_PopUp2_Moving_90deg_F
Pop-Up Hostage 3 TargetP_Civ3_F
Moving Hostage 3 (Side) Hostage_PopUp3_Moving_F
Moving Hostage 3 (Front) Hostage_PopUp3_Moving_90deg_F
Target Human Simple TargetBootcampHumanSimple_F
Target Human TargetBootcampHuman_F
Pop-Up Target 4 TargetP_Inf4_F
Pop-Up Target 4 (Zones) TargetP_Inf4_Acc1_F
Pop-Up Target 4 (Accuracy) TargetP_Inf4_Acc2_F
Moving Target 4 (Side) Target_PopUp4_Moving_F
Moving Target 4 (Side - Zones) Target_PopUp4_Moving_Acc1_F
Moving Target 4 (Side - Accuracy) Target_PopUp4_Moving_Acc2_F
Moving Target 4 (Front) Target_PopUp4_Moving_90deg_F
Moving Target 4 (Front - Zones) Target_PopUp4_Moving_90deg_Acc1_F
Moving Target 4 (Front - Accuracy) Target_PopUp4_Moving_90deg_Acc2_F
Pop-Up Target 5 TargetP_HVT1_F
Moving Target 5 (Side) Target_PopUp_HVT1_Moving_F
Moving Target 5 (Front) Target_PopUp_HVT1_Moving_90deg_F
Pop-Up Target 6 TargetP_HVT2_F
Moving Target 6 (Side) Target_PopUp_HVT2_Moving_F
Moving Target 6 (Front) Target_PopUp_HVT2_Moving_90deg_F
Pop-Up Target 7 TargetP_Inf7_F
Pop-Up Target 7 (Zones) TargetP_Inf7_Acc1_F
Pop-Up Target 7 (Accuracy) TargetP_Inf7_Acc2_F
Moving Target 7 (Side) Target_PopUp7_Moving_F
Moving Target 7 (Side - Zones) Target_PopUp7_Moving_Acc1_F
Moving Target 7 (Side - Accuracy) Target_PopUp7_Moving_Acc2_F
Moving Target 7 (Front) Target_PopUp7_Moving_90deg_F
Moving Target 7 (Front - Zones) Target_PopUp7_Moving_90deg_Acc1_F
Moving Target 7 (Front - Accuracy) Target_PopUp7_Moving_90deg_Acc2_F
Pop-Up Target 8 TargetP_Inf8_F
Pop-Up Target 8 (Zones) TargetP_Inf8_Acc1_F
Pop-Up Target 8 (Accuracy) TargetP_Inf8_Acc2_F
Moving Target 8 (Side) Target_PopUp8_Moving_F
Moving Target 8 (Side - Zones) Target_PopUp8_Moving_Acc1_F
Moving Target 8 (Side - Accuracy) Target_PopUp8_Moving_Acc2_F
Moving Target 8 (Front) Target_PopUp8_Moving_90deg_F
Moving Target 8 (Front - Zones) Target_PopUp8_Moving_90deg_Acc1_F
Moving Target 8 (Front - Accuracy) Target_PopUp8_Moving_90deg_Acc2_F
Pop-Up Target 9 TargetP_Inf9_F
Pop-Up Target 9 (Zones) TargetP_Inf9_Acc1_F
Pop-Up Target 9 (Accuracy) TargetP_Inf9_Acc2_F
Moving Target 9 (Side) Target_PopUp9_Moving_F
Moving Target 9 (Side - Zones) Target_PopUp9_Moving_Acc1_F
Moving Target 9 (Side - Accuracy) Target_PopUp9_Moving_Acc2_F
Moving Target 9 (Front) Target_PopUp9_Moving_90deg_F
Moving Target 9 (Front - Zones) Target_PopUp9_Moving_90deg_Acc1_F
Moving Target 9 (Front - Accuracy) Target_PopUp9_Moving_90deg_Acc2_F
Pop-Up Alien 1 TargetP_Alien1_F
Pop-Up Alien 1 (Zones) TargetP_Alien1_Acc1_F
Moving Alien 1 (Side) Target_PopUp_Alien1_Moving_F
Moving Alien 1 (Side - Zones) Target_PopUp_Alien1_Moving_Acc1_F
Moving Alien 1 (Front) Target_PopUp_Alien1_Moving_90deg_F
Moving Alien 1 (Front - Zones) Target_PopUp_Alien1_Moving_90deg_Acc1_F

popUpTargets = "{| class=""wikitable"" |- ! Display Name !! Class";

{

 if (isClass (_x >> "AnimationSources" >> "Terc")) then
 {
   popUpTargets = popUpTargets + endl + "|-" + endl + "| " + getText (_x >> "displayName") + " || " + "" + configName _x + "";
 };

} forEach ("getNumber (_x >> 'scope') > 1" configClasses (configfile >> "CfgVehicles"));

copyToClipboard (popUpTargets + endl + "|}");