-
07-29-2009, 09:21 PM #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---

-
07-29-2009, 09:22 PM #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.
Its called by using: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";
Arg1 - The task name to be completedCode:null = [Arg1, Arg2] execVM "taskUpdate.sqf";
Arg2 - The state of the task. It can be "SUCCEEDED", "FAILED" or "CANCELED",---Bellicosity---

-
07-29-2009, 09:35 PM #3
- Join Date
- Jun 2007
- Posts
- 351
Plane Smoke Trails
Want a fighter or bomber to stream smoke? Use this:
streamSmoke.sqf
to call it use: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; };
Arg1 - The right smoke to be produced ("SmokeShellBlue" for instance)Code:null = [Arg1, Arg2, Arg3, Arg4, Arg5] execVM "streamSmoke.sqf";
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---

-
07-30-2009, 05:31 PM #4
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:
emptyThePlane.sqfCode:[myc130] execVM "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.
-
07-31-2009, 05:17 AM #5
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




-
08-12-2009, 04:36 PM #6
Re: Scripts Scripts and More Scripts
Updated (and renamed) my Automated Firing Script.
The new Simple Firing Script can be found here!




-
08-21-2009, 02:20 PM #7
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.




-
08-21-2009, 05:41 PM #8
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...
-
08-21-2009, 06:00 PM #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.
-
08-29-2009, 10:34 PM #10
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?
-
08-30-2009, 12:29 AM #11
Re: Scripts Scripts and More Scripts
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








Reply With Quote


Bookmarks