Rok/Sandbox – User

From Bohemia Interactive Community
< User:Rok(Redirected from Rok's Sandbox)
Jump to navigation Jump to search

This is Rok's Sandbox with some code snippets.


Radio Trigger Debugger

sleep 1; simOn = true; debugMode = false; showFPS = false; showUnits = false; // Show FPS in hint box [] spawn { while {true} do { while {!showFPS} do {sleep .5;}; while {showFPS} do { hintSilent str (round diag_fps); sleep .5; }; hintSilent ""; }; }; // Show units on map [] spawn { _mrkU = createMarkerLocal ["Mk1", [0,0]]; _mrkU setMarkerShapeLocal "ICON"; "Mk1" setMarkerTypeLocal "mil_dot"; "Mk1" setMarkerColorLocal "ColorRed"; while {true} do { while {!showUnits} do {sleep .5;}; while {showUnits} do { {"Mk1" setMarkerPosLocal getPos(_x); sleep .1;} forEach allUnits; sleep .1; }; "Mk1" setMarkerPosLocal [0,0]; }; }; // Radio Triggers while {true} do { _tJ = createTrigger["EmptyDetector",[0,0]]; _tJ setTriggerActivation["JULIET","PRESENT",true]; _tJ setTriggerStatements["this", "debugMode = true", ""]; _tJ setTriggerText "Debug Mode On"; while {!debugMode} do {sleep .5}; deleteVehicle _tJ; // First Page _tA = createTrigger["EmptyDetector",[0,0]]; _tA setTriggerActivation["ALPHA","PRESENT",true]; _tA setTriggerStatements["this", "simOn = !simOn; {_x enableSimulation simOn;} forEach allUnits; player enableSimulation true;", ""]; _tA setTriggerText "Toggle Simulation"; _tB = createTrigger["EmptyDetector",[0,0]]; _tB setTriggerActivation["BRAVO","PRESENT",true]; _tB setTriggerStatements["this", "player exec 'camera.sqs';", ""]; _tB setTriggerText "Camera"; _tC = createTrigger["EmptyDetector",[0,0]]; _tC setTriggerActivation["CHARLIE","PRESENT",true]; _tC setTriggerStatements["this", "(vehicle player) setFuel 0;", ""]; _tC setTriggerText "Fuel Empty"; _tD = createTrigger["EmptyDetector",[0,0]]; _tD setTriggerActivation["DELTA","PRESENT",true]; _tD setTriggerStatements["this", "(vehicle player) setFuel 1;", ""]; _tD setTriggerText "Fuel Full"; _tE = createTrigger["EmptyDetector",[0,0]]; _tE setTriggerActivation["ECHO","PRESENT",true]; _tE setTriggerStatements["this", "showFPS = !showFPS;", ""]; _tE setTriggerText "Toggle FPS"; _tF = createTrigger["EmptyDetector",[0,0]]; _tF setTriggerActivation["FOXTROT","PRESENT",true]; _tF setTriggerStatements["this", "(vehicle player) setHitPointDamage ['HitEngine',1];", ""]; _tF setTriggerText "Damage Engine"; _tG = createTrigger["EmptyDetector",[0,0]]; _tG setTriggerActivation["GOLF","PRESENT",true]; _tG setTriggerStatements["this", "(vehicle player) setHitPointDamage ['HitVRotor',1];", ""]; _tG setTriggerText "Damage Tailrotor"; _tH = createTrigger["EmptyDetector",[0,0]]; _tH setTriggerActivation["HOTEL","PRESENT",true]; _tH setTriggerStatements["this", "2 fadeSound 1;", ""]; _tH setTriggerText "Sound Resume"; _tI = createTrigger["EmptyDetector",[0,0]]; _tI setTriggerActivation["INDIA","PRESENT",true]; _tI setTriggerStatements["this", "showUnits = !showUnits;", ""]; _tI setTriggerText "Mark Units On Map"; _tJ = createTrigger["EmptyDetector",[0,0]]; _tJ setTriggerActivation["JULIET","PRESENT",true]; _tJ setTriggerStatements["this", "debugMode = false", ""]; _tJ setTriggerText "Next Page >>"; while {debugMode} do {sleep .5}; {deleteVehicle _x} forEach [_tA, _tB, _tC, _tD, _tE, _tF, _tG, _tH, _tI, _tJ]; debugMode = true; // Second Page _tA = createTrigger["EmptyDetector",[0,0]]; _tA setTriggerActivation["ALPHA","PRESENT",true]; _tA setTriggerStatements["this", "playMusic 'Track01_Proteus';", ""]; _tA setTriggerText "Music: Track01_Proteus"; _tB = createTrigger["EmptyDetector",[0,0]]; _tB setTriggerActivation["BRAVO","PRESENT",true]; _tB setTriggerStatements["this", "playMusic 'Track02_SolarPower';", ""]; _tB setTriggerText "Music: Track02_SolarPower"; _tC = createTrigger["EmptyDetector",[0,0]]; _tC setTriggerActivation["CHARLIE","PRESENT",true]; _tC setTriggerStatements["this", "playMusic 'Track03_OnTheRoad';", ""]; _tC setTriggerText "Music: Track03_OnTheRoad"; _tD = createTrigger["EmptyDetector",[0,0]]; _tD setTriggerActivation["DELTA","PRESENT",true]; _tD setTriggerStatements["this", "playMusic 'Track04_Underwater1';", ""]; _tD setTriggerText "Music: Track04_Underwater1"; _tE = createTrigger["EmptyDetector",[0,0]]; _tE setTriggerActivation["ECHO","PRESENT",true]; _tE setTriggerStatements["this", "playMusic 'Track05_Underwater2';", ""]; _tE setTriggerText "Music: Track05_Underwater2"; _tF = createTrigger["EmptyDetector",[0,0]]; _tF setTriggerActivation["FOXTROT","PRESENT",true]; _tF setTriggerStatements["this", "playMusic 'Track06_CarnHeli';", ""]; _tF setTriggerText "Music: Track06_CarnHeli"; _tG = createTrigger["EmptyDetector",[0,0]]; _tG setTriggerActivation["GOLF","PRESENT",true]; _tG setTriggerStatements["this", "playMusic 'Track07_ActionDark';", ""]; _tG setTriggerText "Music: Track07_ActionDark"; _tH = createTrigger["EmptyDetector",[0,0]]; _tH setTriggerActivation["HOTEL","PRESENT",true]; _tH setTriggerStatements["this", format["playMusic 'RadioAmbient%1';", (10 + floor(random 15))], ""]; _tH setTriggerText "Music: Random Ambient"; _tI = createTrigger["EmptyDetector",[0,0]]; _tI setTriggerActivation["INDIA","PRESENT",true]; _tI setTriggerStatements["this", format["playMusic 'RadioAmbient%1';", (1 + floor(random 10))], ""]; _tI setTriggerText "Music: Random Ambient 2"; _tJ = createTrigger["EmptyDetector",[0,0]]; _tJ setTriggerActivation["JULIET","PRESENT",true]; _tJ setTriggerStatements["this", "debugMode = false", ""]; _tJ setTriggerText "Debug Mode Off"; while {debugMode} do {sleep .5}; {deleteVehicle _x} forEach [_tA, _tB, _tC, _tD, _tE, _tF, _tG, _tH, _tI, _tJ]; };


Debug Teleport

onMapSingleClick " if ((local player) and (player == leader player) and _alt) then { (vehicle player) setPos _pos; }";


Ambient Combat Module (Arma 2)

// BIS_ACM is module name. waitUntil {!isNil {BIS_ACM getVariable "initDone"}}; waitUntil {BIS_ACM getVariable "initDone"}; sleep 5; // Sets frequency and number of patrols (between 0 and 1. 0 is lowest and 1 is highest). // Default: 0.5 // [1, BIS_ACM] call BIS_ACM_setIntensityFunc; // Min/max spawn distance. // Default: 500, 1000 // [BIS_ACM, 400, 1000] call BIS_ACM_setSpawnDistanceFunc; // Factions to be spawned. Pick from: USMC, CDF, RU, INS, GUE. // Default: "USMC", "CDF", "RU", "INS", "GUE" // [["RU", "INS", "GUE"], BIS_ACM] call BIS_ACM_setFactionsFunc; // Min/max skill range for spawned units (from 0 to 1. 0 is lowest and 1 is highest). // Default skill levels are based on difficulty setting. // cadet mode: 0, 0.5 // Other difficulty settings: 0.3, 0.9 // [0.1, 0.5, BIS_ACM] call BIS_ACM_setSkillFunc; // Min/max amount of ammo that units will possess (From 0 to 1. 0 is lowest and 1 is highest). // Default 1, 1 // [0.55, 0.85, BIS_ACM] call BIS_ACM_setAmmoFunc; // Type of patrol. With 0 meaning no chance of appearing, and 1 meaning 100% chance. -1 removes patrol type completely. // Default: 0.75 // ["ground_patrol", 1, BIS_ACM] call BIS_ACM_setTypeChanceFunc; // Type of patrol. With 0 meaning no chance of appearing, and 1 meaning 100% chance. -1 removes patrol type completely. // Default: 0.25 // ["air_patrol", 1, BIS_ACM] call BIS_ACM_setTypeChanceFunc; // Add classes to a custom database and use that instead. // You can pass both actual CfgGroups Config entries or class name Strings. // [(Module name), (Array of classes)] call BIS_ACM_addGroupClassesFunc; // Default: Not configured, which means all classes will be used. // [BIS_ACM, ["INS_MilitiaSquad", "INS_MotInfSquad", "RU_Mi24PSquadron", "RU_InfSection", "RU_MotInfSection_Recon", "GUE_InfSquad_Assault"]] call BIS_ACM_addGroupClassesFunc; // Remove classes from the custom class database during a mission. // Example: [BIS_ACM, ["USMC_TankPlatoon", "INS_TankSection"]] call BIS_ACM_removeGroupClassesFunc; // // Leave array empty to switch back to all classes: // Example: [BIS_ACM, []] call BIS_ACM_removeGroupClassesFunc;


Briefing.html (Arma 1)

<html>

<head>
<meta http-equiv="Content-Type" content="text/html; charset=windows-1250">
<title></title>
</head>

<body bgcolor="#FFFFFF">

<! --- ----------------------------->
<! --- Notes >
<! --- -----------------------------> 
<h2><a name="Main"></a></h2>

<p>
Write some text here - it will be in the "Notes" section.
<br><br>
You can use some <a href="marker:MarkerName">links</a> too.
When the player clicks on it, the map will center to the marker.
</p>

<hr>
<! --- End of Notes>

<! --- ----------------------------->
<! --- Missions plan >
<! --- ----------------------------->

<p><a name="Plan"></a>
Short description of the mission.
</p>
<hr>

<p><a name = "OBJ_1"></a>First objective.
</p>
<hr>

<p><a name = "OBJ_2"></a>Second objective.
</p>
<hr>
<! --- End of Missions plan>

<! --- ----------------------------->
<! --- Debriefings --->
<! --- ----------------------------->
<hr>

<br>
<h2><p><a name="Debriefing:End1">Mission Completed</a></p></h2>
<br>
<p>
Write description of End1 here.
</p>
<br>

<hr>

<br>
<h2><p><a name="Debriefing:End2">Mission Failed</a></p></h2>
<br>
<p> 
Write description of End2 here.
</p>
<br>

<! --- End of Debriefings --->

</body>
</html>