Welcome to Tactical Gamer

Results 1 to 11 of 11
Discussion: ArmA - Development / ArmA - Mission Development - Scripts Scripts and More Scripts - Im putting this to start a sort of collaboration of different scripts we have. In
  1. #1


    Join Date
    Jun 2007
    Posts
    351

    Scripts Scripts and More Scripts

    Im putting this to start a sort of collaboration of different scripts we have. In the spirit of the thread I ask that you make a post for each script just to keep it easy to read. If you have questions regarding a script, please take it to a separate thread. I hope the admins don't smite me for these requests,
    ---Bellicosity---


  2.  
  3. #2


    Join Date
    Jun 2007
    Posts
    351

    taskUpdate.sqf

    Basically a script to just complete a task. Gives the nice little update on the hud and updates it in their map.

    Code:
    _task = _this select 0;
    _status = _this select 1;
    
    _task setTaskState _status;
    null = [objNull, ObjNull, _task, _status] execVM "CA\Modules\MP\data\scriptCommands\taskHint.sqf";
    Its called by using:

    Code:
    null = [Arg1, Arg2] execVM "taskUpdate.sqf";
    Arg1 - The task name to be completed
    Arg2 - The state of the task. It can be "SUCCEEDED", "FAILED" or "CANCELED",
    ---Bellicosity---


  4.  
  5. #3


    Join Date
    Jun 2007
    Posts
    351

    Post Plane Smoke Trails

    Want a fighter or bomber to stream smoke? Use this:

    streamSmoke.sqf
    Code:
    _leftsmoke = _this select 0;
    _middleSmoke = _this select 1;
    _rightSmoke = _this select 2;
    _density = _this select 3;
    _aircraft = _this select 4;
    
    for [{_x = 1}, {_x <= _density}, {_x = _x + 1}] do 
    {
    	_smoke1 = _rightSmoke createVehicle getPos player; 
    	_smoke1 attachTo [_aircraft, [0,-5,0]]; 
    	_smoke2 = _middleSmokeSmoke createVehicle getPos player; 
    	_smoke2 attachTo [_aircraft, [-5,-5,0]];
    	_smoke3 = _leftSmoke createVehicle getPos player; 
    	_smoke3 attachTo [_aircraft, [5,5,0]];
    	sleep 1;
    };
    to call it use:
    Code:
    null = [Arg1, Arg2, Arg3, Arg4, Arg5] execVM "streamSmoke.sqf";
    Arg1 - The right smoke to be produced ("SmokeShellBlue" for instance)
    Arg2 - The middle smoke
    Arg3 - The left smoke
    Arg4 - The density. I've noticed it works best with a number around 10.
    Arg5 - The aircraft to attach it to
    ---Bellicosity---


  6.  

     
  7. #4

    Fincuan's Avatar

    Join Date
    Jan 2009
    Location
    Helsinki, Finland
    Posts
    772

    Eject all passengers out of a C130

    Kick all guys out of a C130 at certain intervals, first to one side, second one to another, third one to the other, etc... Should also work with any other air and ground asset, I've only used it with a C130.

    Arg1 - The plane which should be emptied

    Example:
    Code:
    [myc130] execVM "emptyThePlane.sqf";
    emptyThePlane.sqf
    Code:
    if (!isServer) exitWith{};
    
    FIN_ysiohjelma =
    {
    	//New coordinates with direction and heading from old coordinates
    	private["_pos","_suunta","_etaisyys","_newX","_newY"];
    	//A position	
    	_pos = _this select 0;
    	//Direction
    	_suunta = _this select 1;
    	//Heading
    	_etaisyys = _this select 2;
    
    	_newX = (_pos select 0) + (sin _suunta) * _etaisyys;
    	_newY = (_pos select 1) + (cos _suunta) * _etaisyys;
    	
    	[_newX,_newY,(_pos select 2)]
    };
    
    //Paradrop all except the pilot out of a C130
    _plane = _this select 0;
    _units = (crew _plane) - [(driver _plane)];
    
    _unit = objnull;
    //How much to the side of the planes centerline does the unit eject
    _offset = 3;
    //To which dir from planes heading.
    _dir = (getDir _plane) + 90;
    //At which intervals do we kick the guys out of the plane
    _interval = 0.25;
    _pos = [];
    
    for[ {_i = 0}, {_i < count _units},{_i = _i + 1} ] do
    {
    	_unit = (_units select _i);
    	
    	[_unit,_plane,_pos,_dir,_offset] spawn
    	{
    		private["_unit","_plane","_pos","_dir","_offset"];
    		_unit = _this select 0;
    		_plane = _this select 1;
    		_pos = _this select 2;
    		_dir = _this select 3;
    		_offset = _this select 4;
    		
    		_unit action["eject", _plane];
    		
    		waitUntil{ (vehicle _unit) != _plane };
    		_pos = getPosASL _unit;
    		_unit setPosASL ([_pos, _dir, _offset] call FIN_ysiohjelma);
    	
    		//Sync for MP
    		_unit setPos (getPos _unit);
    	};
    	
    	//Drop the next guy to the other side
    	_dir = _dir + 180;
    	sleep _interval;
    };
    Last edited by Fincuan; 07-30-2009 at 05:46 PM.

  8.  
  9. #5

    Inkompetent's Avatar

    Join Date
    Jan 2006
    Location
    Sweden
    Posts
    847

    Automated Firing Script

    Nice ones. Here comes my work-in-progress contribution. First released version.

    It is a script designed to be a one-for-all solution for scripted fires, be it just for good looks, for actual pre-planned fires, or for coordinated response fires.

    One script, easily called with a number of parameters, able to target both markers and objects.

    Note that at the moment it is not suitable for anything but rapid-firing weapons though. Will be adressed in future versions.

    The script can be found here




  10.  
  11. #6

    Inkompetent's Avatar

    Join Date
    Jan 2006
    Location
    Sweden
    Posts
    847

    Re: Scripts Scripts and More Scripts

    Updated (and renamed) my Automated Firing Script.

    The new Simple Firing Script can be found here!




  12.  

     
  13. #7

    Inkompetent's Avatar

    Join Date
    Jan 2006
    Location
    Sweden
    Posts
    847

    Re: Scripts Scripts and More Scripts

    Also a very easy-to-use and basic script for map-click artillery calls.

    Put an Artillery Module (F7) in the editor, name it, create the guns (with AI gunners) you want in the battery and group them together, then sync them to the artillery module.

    Put a radio-activated trigger in the game and put the following into the On Activation field:
    Code:
    onMapSingleClick "artyCall = [_pos,ArtilleryModuleName] execVM ""callArty.sqf""; true;"; hint "Click on the map to select target location.";

    callArty.sqf:
    Code:
    _pos = _this select 0;
    _battery = _this select 1;
    _fMission = ["IMMEDIATE", "HE", 2, 4];
    
    [_battery, 100] call BIS_ARTY_F_SetDispersion;
    [_battery, _pos, _fMission] call BIS_ARTY_F_ExecuteTemplateMission;
    hint "Bat1: Firing.";

    Variables to be changed depending on mission and use are bolded. See http://community.bistudio.com/wiki/Artillery_Module for more info on the different variables for the artillery module.




  14.  
  15. #8

    Mikee's Avatar

    Join Date
    Jun 2009
    Location
    Naugatuck, CT | USA
    Posts
    619

    Re: Scripts Scripts and More Scripts

    I'm looking for a script that will let players to spawn on their SquadLeader position. There is one mission on TG Server that uses this script. However, I was unable to find it...

  16.  
  17. #9


    Join Date
    Jun 2009
    Location
    Orlando, FL
    Posts
    68

    Re: Scripts Scripts and More Scripts

    Remembered there was a thread on spawning at the squad leader at ofpec so I found it:
    http://www.ofpec.com/forum/index.php?topic=33628.0
    There's either Rommel's script or Spooner's script and both are at the bottom of the first page. There are a couple flaws in it that they point out in the second page but they don't post a fully fixed script so you can fix it or I could do it late tomorrow or somebody else here could look at it.

  18.  

     
  19. #10

    FrankManik's Avatar

    Join Date
    Feb 2008
    Location
    Minneapolis
    Posts
    724

    Re: Scripts Scripts and More Scripts

    How would I get one of these scripts up and running in game? Specifically, where do I put each bit of code?

  20.  
  21. #11

    Inkompetent's Avatar

    Join Date
    Jan 2006
    Location
    Sweden
    Posts
    847

    Re: Scripts Scripts and More Scripts

    Quote Originally Posted by FrankManik View Post
    How would I get one of these scripts up and running in game? Specifically, where do I put each bit of code?
    That completely depends on how or when you want what script to activate. I'd even take it so far as to advertise the TG Editors' Skype chat to make it easier to help




  22.  

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  


  
 

Back to top