Jump to content

=Odin=

Member
  • Content Count

    108
  • Joined

  • Last visited

  • Medals

Posts posted by =Odin=


  1. Hello,

    This is a city to city patrol script I made a few years back that you can use, as it has waypoints spawn bis groups in it allready, or just read it and copy what bits work for you :)

    //////////////////////////////////////////////////////////////////
    // Function file for [ARMA2/Combined Ops]
    // Created by: [(AEF) Odin]
    //////////////////////////////////////////////////////////////////
    
    //////////////////////////////////////////////////////////////////
    // Function file for ARMA2
    // Created by: Odin aka (AEF)Odin
    // Visit http://www.aef-hq.com.au/aef3 
    // USAGE ==>
    //
    // Create a rectangle marker and name it what you like.
    // Add a function module.
    // Add a "CityCenter" Logic.
    // Be sure to add a Russian rifleman somewhere on the map (set probabilaty of presence to 0),
    // Or change the units side to represent the patrol groups side.
    // YOU MUST have at these lines in you init.sqf
    //
    // if (!isServer) exitWith{};
    // waitUntil {!isNil "bis_fnc_init"};
    //
    // To call this script you must include the "MarkerName" and one of  the 6 different groups.
    // "INF"
    // "MOTO"
    // "MECH"
    // "TANK"
    // "AIR"
    // "2GROUPS"
    // Now add this line to your init
    // call{["MarkerName","YourChoiceOfGroup"] execVM "CityToCityPatrol.sqf"};
    // EXAMPLE ==>
    // call{["pat","AIR"] execVM "CityFlatPatrol.sqf"};
    //
    // This script has been set up to spawn East groups, if you want another group uncomment the desired
    // side and re add comment "//" to previous Group
    // To change from East to West EXAMPLE==>
    //	_InfGrp = [_zone_pos, east, (configFile >> "CfgGroups" >> "East" >> "RU" >> "Infantry" >> "RU_InfSquad")] call BIS_fnc_spawnGroup;	
    //	//_InfGrp = [_zone_pos, east, (configFile >> "CfgGroups" >> "East" >> "INS" >> "Infantry" >> "INS_InfSquad")] call BIS_fnc_spawnGroup;	
    //	//_InfGrp = [_zone_pos, west, (configFile >> "CfgGroups" >> "West" >> "USMC" >> "Infantry" >> "USMC_InfSquad")] call BIS_fnc_spawnGroup;				
    //	//_InfGrp = [getMarkerPos _zone, west, (configFile >> "CfgGroups" >> "West" >> "CDF" >> "Infantry" >> "CDF_InfSquad")] call BIS_fnc_spawnGroup;				
    //	//_InfGrp = [_zone_pos, resistance, (configFile >> "CfgGroups" >> "Guerrila" >> "GUE" >> "Infantry" >> "GUE_InfSquad")] call BIS_fnc_spawnGroup;				
    //	//_InfGrp = [_zone_pos, civilian, (configFile >> "CfgGroups" >> "Civilian" >> "CIV" >> "Infantry" >> "CIV_Crowd")] call BIS_fnc_spawnGroup;	
    // 
    // Would look like this
    //
    //	//_InfGrp = [_zone_pos, east, (configFile >> "CfgGroups" >> "East" >> "RU" >> "Infantry" >> "RU_InfSquad")] call BIS_fnc_spawnGroup;	
    //	//_InfGrp = [_zone_pos, east, (configFile >> "CfgGroups" >> "East" >> "INS" >> "Infantry" >> "INS_InfSquad")] call BIS_fnc_spawnGroup;	
    //	_InfGrp = [_zone_pos, west, (configFile >> "CfgGroups" >> "West" >> "USMC" >> "Infantry" >> "USMC_InfSquad")] call BIS_fnc_spawnGroup;				
    //	//_InfGrp = [getMarkerPos _zone, west, (configFile >> "CfgGroups" >> "West" >> "CDF" >> "Infantry" >> "CDF_InfSquad")] call BIS_fnc_spawnGroup;				
    //	//_InfGrp = [_zone_pos, resistance, (configFile >> "CfgGroups" >> "Guerrila" >> "GUE" >> "Infantry" >> "GUE_InfSquad")] call BIS_fnc_spawnGroup;				
    //	//_InfGrp = [_zone_pos, civilian, (configFile >> "CfgGroups" >> "Civilian" >> "CIV" >> "Infantry" >> "CIV_Crowd")] call BIS_fnc_spawnGroup;	
    // 
    // Use the Included ClassName refernce list "GroupClasses.txt" to change the GroupClasses.
    //
    //////////////////////////////////////////////////////////////////
    
    if (!isServer) exitWith{};
    Private ["_start","_zone","_zone_size","_zone_size_x","_zone_size_y","_type"];
    
    _start = false;
    
    _zone = _this select 0;
    //_zone_pos = getMarkerPos _zone;
    _zone_size = MarkerSize _zone;
    _zone_size_x = (_zone_size select 0);
    _zone_size_y = (_zone_size select 1);
    
    sleep 0.05;
    _start = true;
    
      _type = _this select 1;
    
      if (_start) then
      {
    
    Private ["_init","_search","_zone_pos","_InfGrp","_MotoGrp","_MechGrp","_TankGrp","_AirGrp","_Grp1","_Grp2","_UnitLeader","_list","_typeVar","_neighbors","_name","_x","_wp1","_wp2","_wp3","_wp4","_wp5","_wp6","_wp7","_cond1","_cond2"];
    _init = switch (_type) do {
    
    	case "INF": {
    
    		_search = createMarker ["_spawn",getMarkerPos _zone];
    		_search setMarkerType "Empty";
    		_search setMarkerColor "Default";
    		_search setMarkerSize [0.5, 0.5];
    		sleep 0.001;
    		_search setMarkerPos [(getMarkerPos _search select 0)+ Random _zone_size_x,(getMarkerPos _search select 1)- Random _zone_size_x];
    		_zone_pos = getMarkerPos _search;			
    
     		_InfGrp = [_zone_pos, east, (configFile >> "CfgGroups" >> "East" >> "RU" >> "Infantry" >> "RU_InfSquad")] call BIS_fnc_spawnGroup;	
     		//_InfGrp = [_zone_pos, east, (configFile >> "CfgGroups" >> "East" >> "INS" >> "Infantry" >> "INS_InfSquad")] call BIS_fnc_spawnGroup;	
    		//_InfGrp = [_zone_pos, west, (configFile >> "CfgGroups" >> "West" >> "USMC" >> "Infantry" >> "USMC_InfSquad")] call BIS_fnc_spawnGroup;				
    		//_InfGrp = [_zone_pos, west, (configFile >> "CfgGroups" >> "West" >> "CDF" >> "Infantry" >> "CDF_InfSquad")] call BIS_fnc_spawnGroup;				
    	 	//_InfGrp = [_zone_pos, resistance, (configFile >> "CfgGroups" >> "Guerrila" >> "GUE" >> "Infantry" >> "GUE_InfSquad")] call BIS_fnc_spawnGroup;				
    		//_InfGrp = [_zone_pos, civilian, (configFile >> "CfgGroups" >> "Civilian" >> "CIV" >> "Infantry" >> "CIV_Crowd")] call BIS_fnc_spawnGroup;							_UnitLeader = leader _InfGrp; 
    
    		_UnitLeader = leader _InfGrp; 
    		_list = ["CityCenter",[getMarkerPos _zone,_zone_size_y],true] call bis_fnc_locations;
    			while {true} do {
    
    					{
    					sleep 0.02;
    					_typeVar = _x getVariable "type";
    					_neighbors = _x getVariable "neighbors";
    					_name = _x getVariable "name";
    					sleep 0.02;
    
    					_wp1 =  _InfGrp addWaypoint [getpos _x, 0];
    					[_InfGrp, 1] setWaypointBehaviour "COMBAT";
    					[_InfGrp, 1] setWaypointSpeed "FULL";
    					[_InfGrp, 1] setWaypointType "MOVE";
     						 waitUntil{currentWaypoint _InfGrp != 1};
      						sleep 0.2;
      						deleteWaypoint _wp1; 
    			} forEach _list;
    	};
    		};  
    	case "MOTO": {
    
    		_search = createMarker ["_spawn1",getMarkerPos _zone];
    		_search setMarkerType "Empty";
    		_search setMarkerColor "Default";
    		_search setMarkerSize [0.5, 0.5];
    		sleep 0.001;
    		_search setMarkerPos [(getMarkerPos _search select 0)+ Random _zone_size_x,(getMarkerPos _search select 1)- Random _zone_size_x];
    		_zone_pos = getMarkerPos _search;			
    
    		_MotoGrp = [_zone_pos, east, (configFile >> "CfgGroups" >> "East" >> "RU" >> "Motorized" >> "RU_MotInfSquad")] call BIS_fnc_spawnGroup;	
    		//_MotoGrp = [_zone_pos, east, (configFile >> "CfgGroups" >> "East" >> "INS" >> "Motorized" >> "INS_MotInfSquad")] call BIS_fnc_spawnGroup;	
    		//_MotoGrp = [_zone_pos, west, (configFile >> "CfgGroups" >> "West" >> "USMC" >> "Motorized" >> "USMC_MotInfSection")] call BIS_fnc_spawnGroup;	
    		//_MotoGrp = [_zone_pos, west, (configFile >> "CfgGroups" >> "West" >> "CDF" >> "Motorized" >> "CDF_MotInfSquad")] call BIS_fnc_spawnGroup;	
    		//_MotoGrp = [_zone_pos, resistance, (configFile >> "CfgGroups" >> "Guerrila" >> "GUE" >> "Motorized" >> "GUE_MotInfSection")] call BIS_fnc_spawnGroup;				
    
    		_UnitLeader = leader _MotoGrp; 
    		_list = ["CityCenter",[getMarkerPos _zone,_zone_size_y],true] call bis_fnc_locations;
    			while {true} do {
    
    					{
    					sleep 0.02;
    					_typeVar = _x getVariable "type";
    					_neighbors = _x getVariable "neighbors";
    					_name = _x getVariable "name";
    					sleep 0.02;
    
    					_wp2 =  _MotoGrp addWaypoint [getpos _x, 0];
    					[_MotoGrp, 1] setWaypointBehaviour "COMBAT";
    					[_MotoGrp, 1] setWaypointSpeed "FULL";
    					[_MotoGrp, 1] setWaypointType "MOVE";
     						 waitUntil{currentWaypoint _MotoGrp != 1};
      						sleep 0.2;
      						deleteWaypoint _wp2; 
    			} forEach _list;
    	};
    		};
    	case "MECH": {
    
    		_search = createMarker ["_spawn2",getMarkerPos _zone];
    		_search setMarkerType "Empty";
    		_search setMarkerColor "Default";
    		_search setMarkerSize [0.5, 0.5];
    		sleep 0.001;
    		_search setMarkerPos [(getMarkerPos _search select 0)+ Random _zone_size_x,(getMarkerPos _search select 1)- Random _zone_size_x];
    		_zone_pos = getMarkerPos _search;	
    
    		_MechGrp = [_zone_pos, east, (configFile >> "CfgGroups" >> "East" >> "RU" >> "Mechanized" >> "RU_MechInfSquad_1")] call BIS_fnc_spawnGroup;	
    		//_MechGrp = [_zone_pos, east, (configFile >> "CfgGroups" >> "East" >> "INS" >> "Mechanized" >> "INS_MechInfSquad")] call BIS_fnc_spawnGroup;	
    		//_MechGrp = [_zone_pos, west, (configFile >> "CfgGroups" >> "West" >> "USMC" >> "Mechanized" >> "USMC_MechInfSquad")] call BIS_fnc_spawnGroup;	
    		//_MechGrp = [_zone_pos, west, (configFile >> "CfgGroups" >> "West" >> "CDF" >> "Mechanized" >> "CDF_MechInfSquad")] call BIS_fnc_spawnGroup;	
    		//_MechGrp = [_zone_pos, resistance, (configFile >> "CfgGroups" >> "Guerrila" >> "GUE" >> "Mechanized" >> "GUE_MechInfSection")] call BIS_fnc_spawnGroup;	
    
    		_UnitLeader = leader _MechGrp; 
    		_list = ["CityCenter",[getMarkerPos _zone,_zone_size_y],true] call bis_fnc_locations;
    			while {true} do {
    
    					{
    					sleep 0.02;
    					_typeVar = _x getVariable "type";
    					_neighbors = _x getVariable "neighbors";
    					_name = _x getVariable "name";
    					sleep 0.02;
    
    					_wp3 =  _MechGrp addWaypoint [getpos _x, 0];
    					[_MechGrp, 1] setWaypointBehaviour "COMBAT";
    					[_MechGrp, 1] setWaypointSpeed "FULL";
    					[_MechGrp, 1] setWaypointType "MOVE";
     						 waitUntil{currentWaypoint _MechGrp != 1};
      						sleep 0.2;
      						deleteWaypoint _wp3; 
    			} forEach _list;
    	};
    		}; 			
    
    	case "TANK": {
    
    		_search = createMarker ["_spawn3",getMarkerPos _zone];
    		_search setMarkerType "Empty";
    		_search setMarkerColor "Default";
    		_search setMarkerSize [0.5, 0.5];
    		sleep 0.001;
    		_search setMarkerPos [(getMarkerPos _search select 0)+ Random _zone_size_x,(getMarkerPos _search select 1)- Random _zone_size_x];
    		_zone_pos = getMarkerPos _search;
    
    		_TankGrp = [_zone_pos, east, (configFile >> "CfgGroups" >> "East" >> "RU" >> "Armored" >> "RU_TankPlatoon")] call BIS_fnc_spawnGroup;	
    		//_TankGrp = [_zone_pos, east, (configFile >> "CfgGroups" >> "East" >> "INS" >> "Armored" >> "INS_TankSection")] call BIS_fnc_spawnGroup;	
    		//_TankGrp = [_zone_pos, west, (configFile >> "CfgGroups" >> "West" >> "USMC" >> "Armored" >> "USMC_TankPlatoon")] call BIS_fnc_spawnGroup;	
    		//_TankGrp = [_zone_pos, west, (configFile >> "CfgGroups" >> "West" >> "CDF" >> "Armored" >> "CDF_TankPlatoon")] call BIS_fnc_spawnGroup;	
    		//_TankGrp = [_zone_pos, resistance, (configFile >> "CfgGroups" >> "Guerrila" >> "GUE" >> "Armored" >> "GUE_TankSection")] call BIS_fnc_spawnGroup;	
    
    		_UnitLeader = leader _TankGrp; 
    		_list = ["CityCenter",[getMarkerPos _zone,_zone_size_y],true] call bis_fnc_locations;
    			while {true} do {
    
    					{
    					sleep 0.02;
    					_typeVar = _x getVariable "type";
    					_neighbors = _x getVariable "neighbors";
    					_name = _x getVariable "name";
    					sleep 0.02;
    
    					_wp4 =  _TankGrp addWaypoint [getpos _x, 0];
    					[_TankGrp, 1] setWaypointBehaviour "COMBAT";
    					[_TankGrp, 1] setWaypointSpeed "FULL";
    					[_TankGrp, 1] setWaypointType "MOVE";
     						 waitUntil{currentWaypoint _TankGrp != 1};
      						sleep 0.2;
      						deleteWaypoint _wp4; 
    			} forEach _list;
    	};
    		}; 
    
    	case "AIR": {
    
    		_search = createMarker ["_spawn4",getMarkerPos _zone];
    		_search setMarkerType "Empty";
    		_search setMarkerColor "Default";
    		_search setMarkerSize [0.5, 0.5];
    		sleep 0.001;
    		_search setMarkerPos [(getMarkerPos _search select 0)+ Random _zone_size_x,(getMarkerPos _search select 1)- Random _zone_size_x];
    		_zone_pos = getMarkerPos _search;	
    
    		_AirGrp = [_zone_pos, east, (configFile >> "CfgGroups" >> "East" >> "RU" >> "Air" >> "RU_Mi24VSquadron")] call BIS_fnc_spawnGroup;	
    		//_AirGrp = [_zone_pos, east, (configFile >> "CfgGroups" >> "East" >> "INS" >> "Air" >> "INS_Mi8Squadron")] call BIS_fnc_spawnGroup;	
    		//_AirGrp = [_zone_pos, west, (configFile >> "CfgGroups" >> "West" >> "USMC" >> "Air" >> "USMC_UH1YSquadron")] call BIS_fnc_spawnGroup;	
    		//_AirGrp = [_zone_pos, west, (configFile >> "CfgGroups" >> "West" >> "CDF" >> "Air" >> "CDF_Mi24DSquadron")] call BIS_fnc_spawnGroup;	
    
    		_UnitLeader = leader _AirGrp; 
    		_list = ["CityCenter",[getMarkerPos _zone,_zone_size_y],true] call bis_fnc_locations;
    			while {true} do {
    
    					{
    					sleep 0.02;
    					_typeVar = _x getVariable "type";
    					_neighbors = _x getVariable "neighbors";
    					_name = _x getVariable "name";
    					sleep 0.02;
    
    					_wp5 =  _AirGrp addWaypoint [getpos _x, 0];
    					[_AirGrp, 1] setWaypointBehaviour "COMBAT";
    					[_AirGrp, 1] setWaypointSpeed "FULL";
    					[_AirGrp, 1] setWaypointType "MOVE";
     						 waitUntil{currentWaypoint _AirGrp != 1};
      						sleep 0.2;
      						deleteWaypoint _wp5; 
    			} forEach _list;
    	};
    		}; 
    
    	case "2GROUPS": {
    
    		_search = createMarker ["_spawn5",getMarkerPos _zone];
    		_search setMarkerType "Empty";
    		_search setMarkerColor "Default";
    		_search setMarkerSize [0.5, 0.5];
    		sleep 0.001;
    		_search setMarkerPos [(getMarkerPos _search select 0)+ Random _zone_size_x,(getMarkerPos _search select 1)- Random _zone_size_x];
    		_zone_pos = getMarkerPos _search;				
    
    		_Grp1 = [_zone_pos, east, (configFile >> "CfgGroups" >> "East" >> "RU" >> "Motorized" >> "RU_MotInfSquad")] call BIS_fnc_spawnGroup;
    		sleep 1;
    		_Grp2 = [_zone_pos, east, (configFile >> "CfgGroups" >> "East" >> "RU" >> "Infantry" >> "RU_InfSquad")] call BIS_fnc_spawnGroup; 
    
    		_UnitLeader = leader _Grp1;						 
    		_list = ["CityCenter",[getMarkerPos _zone,_zone_size_y],true] call bis_fnc_locations;
    			while {true} do {
    
    				{
    
    				sleep 0.02;
    				_typeVar = _x getVariable "type";
    				_neighbors = _x getVariable "neighbors";
    				_name = _x getVariable "name";
    				sleep 0.02;
    
    				_wp6 =  _Grp1 addWaypoint [getpos _x, 0];
    				[_Grp1, 1] setWaypointBehaviour "COMBAT";
    				[_Grp1, 1] setWaypointSpeed "FULL";
    				[_Grp1, 1] setWaypointType "MOVE";
    
    				_wp7 =  _Grp2 addWaypoint [getpos _x, 0];
    				[_Grp2, 1] setWaypointBehaviour "COMBAT";
    				[_Grp2, 1] setWaypointSpeed "FULL";
    				[_Grp2, 1] setWaypointType "MOVE";
    
     					 waitUntil{
       				_cond1 =currentWaypoint _Grp1 != 1;
       				_cond2 =currentWaypoint _Grp2 != 0;
      	   				_cond1 && _cond2
        	   				};
      					sleep 0.2;
      					deleteWaypoint _wp6;
      					deleteWaypoint _wp7; 
    			} forEach _list;
    		};			
    	};
    	};
    };
    Sleep 0.1;

    Or this is the link to a newer version that supports ACE with a demo mission

    http://www.armaholic.com/page.php?id=10292

    Hope that helps.

    Odin


  2. Heya Sarge,

    I may be a bit rusty at scripting, but in your 1st line of the siren.sqf

    _this = _this select 3;

    you are using one of the Magic Variables ==>http://community.bistudio.com/wiki/Magic_Variables, Maybe change that and all corrisponding references to a new name e.g.

    _sarge = _this select 3;[//CODE]

    Also a [color=#0000FF]select 3 [/color]should follow [color=#0000FF]select 0;[/color] it may not be law but I think it helps.

    Like I say I am a bit rusty but try that and see if it helps.

    Odin


  3. Maybe try it like this, this is based on a working version I have used for switching betwwen players squads,

    waitUntil {!(isNull player)};
    waitUntil {player==player};
    switch ((side player)) do
    {
    case WEST:
    {
    player createDiaryRecord ["Diary",["Extraction","You will be made aware of your extraction location apon completion of your first task."]];
    player createDiaryRecord ["Diary",["Info 2","Multiple hostiles, several light vehicles spotted by CDF. The shipment of Tunguskas was at the docks of Bereznio. They are thought to be awaiting transport and not expected to be manned."]];
    player createDiaryRecord ["Diary",["Info 1","Mission is failed pending any player's death."]];
    MAG_tskObj1=player createSimpleTask ["Extraction"];
    MAG_tskObj1 setSimpleTaskDescription ["Move to the extraction point","Extraction","Extraction"];
    MAG_tskObj1 setSimpleTaskDestination (getMarkerPos "extraction");
    MAG_tskObj0=player createSimpleTask ["Destroy Tunguskas"];
    MAG_tskObj0 setSimpleTaskDescription ["Destroy the three Tunguskas that arrived on a recient shipment to Bereznio","Destroy Tunguskas","Destroy Tunguskas"];
    };
    case EAST:
    {
    };
    case RESISTANCE:
    {
    };
    case CIVILIAN:
    {
    };
    };

    Also as far as I know you can't use the old html coding within a .sqf ie:

    <marker name='extraction'>extraction</marker>

    I am not sure on this but I think you should probably remove the "setCurrentTask" line out of the briefing and add it to your init.sqf. I assume it may cause problems where it is


  4. crB Zone Alarm Demo - v0.1

    This mission is to demonstrate the use of the Zone Alarm script, upon activation an alarm will sound with a hint message as well as a marker that will blink on and off. this script can be used by multiple triggers and markers, refer to the Parameter guide. Use the radio for teleport and camera functions.

    Image7.jpg

    Usage;

    Description.ext is required for the crB_Zone_Alarm script!

    Create a trigger that encompasses the area you need for the Alarm to cover, the demo missions area is a 30x30 rectangle.

    AxisA ==> 30 (Change the size to the area you need for the Alarm to cover)

    AxisB ==> 30 (Change the side to the area you need for the Alarm to cover)

    Shape ==> Rectangle (Change the shape to suit your mission, I find Rectangle is the best for this set up)

    activation ==> Opfor-Repeatedly (Change the side to suit your mission but leave it set at Repeatedly)

    type ==> none

    name ==>

    Condition ==> this

    On Act. ==> Opfgo = true;call {["zone", 30, 30, "Rectangle", "ColorRed"] execVM "crB_scripts\crB_Zone_Alarm.sqf";};

    <<REFER TO THE PARAMETER GUIDE IF YOU NEED TO CHANGE THE SIZE< SHAPE<OR COLOR OF THE ALARM MARKER>>

    On Dea ==> Opfgo = False;

    Parameter Guide:

    - the name of the marker that will act as the Flashing marker - eg a Marker called zone

    - the x axis size for the marker - eg 30

    - the Y axis size for the marker - eg 30

    - the shape of the marker - eg "Rectangle"- NOTE: "Rectangle" or "ellipse" are the only shapes you can use

    - the color of the marker - eg "ColorRed" - refer to http://community.bistudio.com/wiki/setMarkerColor for a compete list of colors

    You will also need to add an empty marker called zone and place it on top of the centre of the trigger

    COMPONENT CHECKLIST:

    One Trigger

    one marker called zone

    Initial release v0.1

    Created by: (AEF)Odin [2CAV]

    Developer notes ==>

    Also included is one extra alarm sound in the sounds folder. If you add your own sound, try and make sure any custom sounds are of the same time length as the ones provided.

    DOWNLOAD HERE - http://creobellum.org/sites/creobellum.org/files/crB_Zone_Alarm.zip

    Visit us at http://creoBellum.org


  5. it is too complicated to do by script. I changed I thing in editor and now it workds fine. (except, CDF units are marked green on map for west players, but really they are hostiles to west now)

    The method I suggested is not a script. It is done in the editor, Probabilaty of presence is a slider box located at the bottom of each unit properties box. The group function is acessed by using the f2 key, and drag a line between the CDF units to the east officer.


  6. G'day, Not sure if this will help you but it is basicaly what you asked for.

    I addapted my old teammate SurdistPriest's nearExplosion.sqf, which gave a few effects and played a sound. I have added/removed a bit from his original work to do the same thing your after, its a function file so is called by the init.sqf and dosent need a damaged,hit or fired EH. But for some reason once the player is dead it wont start again on Respawn, so I had to add a Killed EH on the player to recall the function. So if any one can fix this problem it could be Better.

    Any way add this to your init

    <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">player addEventHandler ["killed", {handle = [(_this select 0)] execVM "readdfunction.sqf"}];

    if (alive player and (canStand player)) then

    {

    [20] call compile (preprocessFileLineNumbers "hit.sqf")

    };

    The [20] part is the distance the projectile is from player, for the script to run.

    hit.sqf

    <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">_d = _this select 0;

    Hit_list = //this function detects explosions near the player of certain ammo

     //and starts the effect script

    {

    private["_shell"];

    _shell = _this select 0;

    //_shell is a string containing the ammo name

    _projectile = nearestObject [player, _shell];

    while {(_projectile distance player) < _d} do

    {

    sleep 0.01;

    //_projectile = nearestObject [player, _shell];

    if (isnull _projectile) then

    {

    if (alive player) then

    {

    sleep 0.1;

        player sideChat format["Wounded by a, %1",_shell];

        player say "wheeze";

      };

    if (not(alive player)) then

    {

    sleep 0.1;

        player sideChat format["Killed by a, %1",_shell];

      };

    }; //if

    }; //while

    }; //function Hit_list

    while {alive player} do

    {

    sleep 0.01;

    //call the function ones for each type of ammo

    ["RocketCore"] call Hit_list;

    ["MissileCore"] call Hit_list;

    ["ShellCore"] call Hit_list;

    ["MineCore"] call Hit_list;

    ["TimeBombCore"] call Hit_list;

    ["G_40mm_HE"] call Hit_list;

    ["G_30mm_HE"] call Hit_list;

    ["G_40mm_HE_6G30"] call Hit_list;

    ["GrenadeHandTimed"] call Hit_list;

    ["GrenadeHand"] call Hit_list;

    ["B_556x45_Ball"] call Hit_list;

    ["B_556x45_SD "] call Hit_list;

    ["B_9x19_Ball"] call Hit_list;

    ["B_9x19_SD"] call Hit_list;

    ["B_762x51_Ball"] call Hit_list;

    ["B_127x99_Ball_noTracer"] call Hit_list;

    ["B_545x39_Ball"] call Hit_list;

    ["B_545x39_SD"] call Hit_list;

    ["B_762x54_Ball"] call Hit_list;

    ["B_762x54_noTracer"] call Hit_list;

    ["B_127x108_Ball"] call Hit_list;

    ["B_9x18_Ball"] call Hit_list;

    ["B_9x18_SD"] call Hit_list;

    ["B_127x107_Ball"] call Hit_list;

    ["B_127x99_Ball"] call Hit_list;

    ["FuelExplosion"] call Hit_list;

    }; //while alive player

    exit;

    I still have a few bullet types to add ie;- twin vikers and a few vehicle mounted MG.

    you need this to restart the function.

    readdfunction.sqf

    <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">waitUntil {alive player};

    if (alive player and (canStand player)) then

    {

    [20] call compile (preprocessFileLineNumbers "hit.sqf");

    };

    Now you just need to create a folder called sounds and create a .ogg soundfile and save as wheeze.ogg and add it to your new folder, then define the sound and source in your description file

    Description.ext

    <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">class CfgSounds

    {

    // List of sounds (.ogg files without the .ogg extension)

    sounds[] = {wheeze};

    // Definition for each sound

    class wheeze

    {

    name = "wheeze";

    sound[] = {"\sounds\wheeze.ogg", db-5, 1.0};

    titles[] = {};

    };

    };

    Hope this helps.

    Odin


  7. Or this it works

    <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">_exp = "SH_125_HE" createvehicle getpos (kr1),"SH_125_HE" createvehicle getpos(kr2),"SH_125_HE" createvehicle getpos(kr23);

    _exp setdamage 1;

    Odin


  8. G'day, give this a go , its a crudley fasioned .sqs loop that works wink_o.gif

    flare.sqs

    <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">_cnt = 0;

    flare1 = "F_40mm_Red" createVehicle [getPos tresflare1 select 0, getPos tresflare1 select 1, 35];

    ~3.5

    #loop

    ; _cnt == "amount of times loop is run befor it ends"

    ?(_cnt == 400) : goto "end";

    flare1 setPosASL [ (getPosASL tresflare1 select 0) + 0.199, (getPosASL tresflare1 select 1) - 0.199, (getPosASL tresflare1 select 2) + 2];

    ~0.001

    _cnt = _cnt + 1;

    goto "loop"

    ~1

    #end

    exit

    the (_cnt == 400) part lasts around 20 secs

    GL

    Odin

×