Jump to content

Padjur

Member
  • Content Count

    94
  • Joined

  • Last visited

  • Medals

Posts posted by Padjur


  1. @lightning glad you got it sorted, By the way (just for info) and apologies if you already know this, you can move the whole squad in by putting

     {_x moveInCargo c1} foreach units this;

    into the squad leader's init line.

    For HALO(steerable) put in a trigger across the flightpath

    S1 action [ "eject", c1]; S1 setvelocity [0,0,0]; [s1] exec "ca\air2\halo\data\Scripts\HALO_getout.sqs";
    S2 action [ "eject", c1]; S2 setvelocity [0,0,0]; [s3] exec "ca\air2\halo\data\Scripts\HALO_getout.sqs";

    and so on for each unit

    (make sure the flyinHeight is +500 as its High Altitude)

    http://forums.bistudio.com/showthread.php?t=73401 for more on HALO

    you can use attachto command to attach a unit to a chute, seen a thread somewhere can't think where now.

    @ cobra4v320 Your welcome, all credits should go to Rommel, as it is his excellent jump script, I got it from this thread http://forums.bistudio.com/showthread.php?t=76545&highlight I have had no problems, such as you mention with it, works like clockwork every time, (though some troops may get injured or die by landing in a bunch of trees or something but that often happens in reality anyway :D )


  2. I wouldn't want to knock sqs if that's what your use to but if your just learning about scripts you'd be better learning with sqf which has superseded sqs.

    open the mission folder "blah" (where "blah" is the save name for your mission in the editor) found at,

    C:\Documents and Settings\Padjur\My Documents\ArmA 2\MPMissions\blah.

    make a new text document, copy and paste the code and save as jump.sqf.

    put a trigger across the flight path with

    _xhandle=[squad1,C1] execVM  "jump.sqf"; _xhandle=[squad2,C2] execVM  "jump.sqf";

    in the on act. where squad1 is the name of your squad, c1 is the name of your plane.


  3. Or there's the sqf method, jump.sqf in mission folder

    if (isServer) then {
    _group =  _this select 0;
    _vehicle = _this select 1;
    
    sleep 2;
    
    {
    unassignvehicle _x;
    _x action ["EJECT", _vehicle];
    sleep 0.5
    } foreach units _group;
    };

    call the script at the jump point with:

    _xhandle=[squad1,C1] execVM  "jump.sqf"; _xhandle=[squad2,C2] execVM  "jump.sqf";


  4. @Bascule42 My Bad!!! sorry.. typo error in west group script _unit= _squad1 should read _unit= squad1. corrected now.

    Good point by kylania about needing to place a unit on the editor first. See: http://community.bistudio.com/wiki/createGroup

    This thread has good stuff on group spawns + add waypoints and UPS and functions http://forums.bistudio.com/showthread.php?t=79874

    If you want your chopper to fly try

    helo1=CreateGroup WEST;
    AH1= createvehicle ["AH1Z",[(getmarkerpos "Spawn") select 0,(getmarkerpos "Spawn") select 1,0], [],0,"FLY"];
    Pilot1=helo1 createunit ["USMC_Soldier_Pilot", [0,0,1], [], 0, 	"CAN_COLLIDE"];
    Pilot1 moveInDriver AH1;

     for [{_i = 0}, {_i <= 11}, {_i = _i + 1}] do

    basically means : _i starts at 0 add one to _i until _i is more than 11 or to put it another way... do this 12 times.

    you may find this useful for more on loops http://www.ofpec.com/forum/index.php?topic=33595.0 and this http://www.ofpec.com/ed_depot/index.php?action=details&id=390&game=ArmA

    @Murklor Yes mate I agree totally Your script is much better than mine. Mine were just very basic stuff, real beginners scripts, spawn your first unit, create a simple group etc. I read the question and thought that maybe this was what Bascule42 was looking for.......then again maybe I just misunderstood ;) .

    @Fenrir Your trying to create a load of different Vehicles, so your bringing in complexity, they will be all empty so you would need to create crews as well, more complexity. So these basic scripts become very cumbersome. Therefore you would need to use something like Murklor's script. But if you just want to spawn a tank use

     GrpEast= Creategroup EAST;
    _tank1="T90" createvehicle getmarkerpos "Hostile zone 2";

    (By the way all.. I'm still taking the title of the thread as meaning Very Basic stuff, apologies if my answers are not what your looking for) kylania's tip about bis functions is well worth looking into for sure.


  5. Would this be what your looking for? They all work.

    unit.sqf

     Grp1=createGroup WEST;	
    
    _unit1 = Grp1 createUnit ["USMC_Soldier", [(getMarkerPos "spawn") select 0,(getMarkerPos "spawn") select 1,0], [], 0, "form"]; 

    group could be WEST (bluefor) or EAST (opfor) or CIV or GUER, class names are available here http://forums.bistudio.com/showthread.php?t=73241 Put an empty marker in the editor name it whatever e.g. "spawn" and put in a trigger

     nul=execVM "unit.sqf";

    to execute the script.

    For a simple group of one type.

    group.sqf

     squad1=creategroup WEST;	
    
    
    for [{_i = 0}, {_i <= 11}, {_i = _i + 1}] do
    
    {
    _unit= squad1 createUnit ["USMC_Soldier", [(getMarkerPos "spawn") select 
    
    0,(getMarkerPos "spawn") select 1,0], [], 0, "form"];
    }; 

    or a group with different unit class types:

    Esec1= Creategroup EAST;
    
    _Unit1= Esec1 createUnit ["RU_Soldier_TL",[(getMarkerPos "Es1") select 0,(getMarkerPos "Es1") select 1,0],[],0,"FORM"];
    
    for [{_i = 0}, {_i <= 4}, {_i = _i + 1}] do
    {
    _Unit2= Esec1 createUnit ["RU_Soldier",[(getMarkerPos "Es1") select 0,(getMarkerPos "Es1") select 1,0],[],0,"FORM"];
    };
    
    _Unit3= Esec1 createUnit ["RU_Soldier_GL",[(getMarkerPos "Es1") select 0,(getMarkerPos "Es1") select 1,0],[],0,"FORM"];
    
    _Unit4= Esec1 createUnit ["RU_Soldier_Medic",[(getMarkerPos "Es1") select 0,(getMarkerPos "Es1") select 1,0],[],0,"FORM"];
    
    _Unit5= Esec1 createUnit ["RU_Soldier_AR",[(getMarkerPos "Es1") select 0,(getMarkerPos "Es1") select 1,0],[],0,"FORM"];
    
    _unit3 setunitrank "CORPORAL";
    
    _unit1 setunitrank "SERGEANT";
    
    _unit1=leader Esec1;

    for vehicles use createVehicle instead of createUnit.


  6. Hey zach72,

    This is how I would do it:

    Put this in init.sqf

    nul= [] execVM "C130.sqf";

    create a file save as C130.sqf in mission folder:

     if (isServer) then {
    
    GrpC130=CreateGroup WEST;
    C1= createvehicle ["C130J",[(getmarkerpos "C1Spawn") select 0, 	(getmarkerpos "C1Spawn") select 1,0], [],0,"FLY"];
    C1 flyinHeight 250;
    
    Pilot1=GrpC130 createunit ["USMC_Soldier_Pilot", [0,0,1], [], 0, 	"CAN_COLLIDE"];
    Pilot1 moveInDriver C1;
    Pilot1 flyInHeight 250;
    A1 moveincargo [c1,5];
    
    
    
    C2= createvehicle ["C130J",[(getmarkerpos "C2Spawn") select 0, 	(getmarkerpos "C2Spawn") select 1,0], [],0,"FLY"];
    C2 flyInHeight 250;
    
    Pilot2=GrpC130 createunit ["USMC_Soldier_Pilot", [0,0,1], [], 0, 	"CAN_COLLIDE"];
    Pilot2 moveInDriver C2;
    Pilot2 flyInHeight 250;
    
    
    C3= createvehicle ["C130J",[(getmarkerpos "C3Spawn") select 0, 	(getmarkerpos "C3Spawn") select 1,0], [],0,"FLY"];
    C3 flyInHeight 250;
    
    Pilot3=GrpC130 createunit ["USMC_Soldier_Pilot", [0,0,1], [], 0, 	"CAN_COLLIDE"];
    Pilot3 moveInDriver C3;
    Pilot3 flyInHeight 250;
    
    
    
    
    wp0=GrpC130 addwaypoint [(getmarkerpos "wp0") ,200];
    wp0 setwaypointspeed "FULL";
    wp0 setwaypointtype "MOVE";
    wp0 setWaypointFormation "WEDGE";
    
    wp1=GrpC130 addwaypoint [(getmarkerpos "wp1") ,200];
    wp1 setwaypointspeed "FULL";
    wp1 setwaypointtype "MOVE";
    wp1 setWaypointFormation "WEDGE";
    
    
    squad1=creategroup WEST;	
    
    
    for [{_i = 0}, {_i <= 24}, {_i = _i + 1}] do
    
    {
    _unit= squad1 createUnit ["USMC_Soldier", [0,0,2], [], 0, "form"];
    };
    
    {_x moveInCargo c1} foreach units squad1;
    
    
    
    squad2=creategroup WEST;	
    
    
    for [{_i = 0}, {_i <= 24}, {_i = _i + 1}] do
    
    {
    _unit= squad2 createUnit ["USMC_Soldier", [0,0,2], [], 0, "form"];
    };
    
    {_x moveInCargo c2} foreach units squad2;
    
    
    squad3=creategroup WEST;	
    
    
    for [{_i = 0}, {_i <= 24}, {_i = _i + 1}] do
    
    {
    _unit= squad3 createUnit ["USMC_Soldier", [0,0,2], [], 0, "form"];
    };
    
    {_x moveInCargo c3} foreach units squad3;
    };
    

    I noticed you had moved a unit player in, the way I have done it is to place a unit in the Editor as player named A1 and put in the C130.sqf

     A1 moveincargo [C1,5]

    where 5 is the position in the plane.

    Also in the editor put 5 markers (or more for more waypoints). 3 in a line reasonable close to each other where the planes will spawn ( I put the markers in order C3spawn, C1spawn, C2spawn so the planes are already in formation when they spawn). and a marker over the drop zone for the first waypoint and a marker for the deletewaypoint. put a trigger some way before the drop zone, in the on act

    _xhandle=[squad1,C1] execVM  "jump.sqf"; _xhandle=[squad2,C2] execVM  "jump.sqf";_xhandle=[squad3,C3] execVM  "jump.sqf"; _xhandle=[A1,C1] execVM  "jump.sqf";

    create a file save as jump.sqf in mission folder

    if (isServer) then {
    _group =  _this select 0;
    _vehicle = _this select 1;
    
    sleep 2;
    
    {
    unassignvehicle _x;
    _x action ["EJECT", _vehicle];
    sleep 0.5
    } foreach units _group;
    };
    

    if you want the jump to take place during the game call the code in a trigger, maybe slow the planes to limited over the drop zone to to keep the drop tighter and put a deleteVehicle trigger over the last waypoint to get rid of the planes. Hope this helps.


  7. No I've tried assorts of combinations last night,this morning and this evening and it doesn't seem to work JDog. In the mission I'm making the team is extracted after their raid and then given a new task while in the chopper before they get back to base. Its nice because it flows without any cut to a new scene stuff. While flying to the drop zone, players have a chance to look at the new mission and arm or rearm on board the chopper and then HALO drop to their next target. This is the problem though, I want them in the cargo seats of the chopper because they will die when ejected from the chopper if their still in the boat. Tried it loads of times and they die every time, I die too if I stay in the boat so I'm sure that's the problem. I'm trying to learn as fast as I can about scripting because it is so powerful in mission editing and although I kinda know what this script is doing (two weeks ago I'd just go cross eyed at it) I'm not sure how to adapt it. I hope you find the time to come up with something because this is a great Idea with the Chinook which is a great piece of kit, especially for covert, special forces stuff. In the meantime its back the forums and picking scripts apart to see what I can learn.


  8. Thanks JDog for replying. Understand about the rendering, no problem.

    Thanks for the update on the flying boat.

    Tried several different ways to use moveincargo but no luck with it. I'm doing something wrong but I don't know what. Could you show me where to put the moveincargo for the other units. Sorry my knowledge of scripting is still pretty basic, I'm not sure how to write it in the code.

    _object = _this select 0;
    _caller = _this select 1;
    _id = _this select 2;
    _heli = _this select 3;
    
    _object removeAction _id;
    _caller setPos position _caller;
    _caller moveInCargo _heli;
    


  9. Tried it with an osprey and the game doesn't like it at all, it goes crazy. dunno how else to describe it Anyway you can't walk or drive a vehicle into the back of an Osprey, even if you animate the doors, because of the collision detection on an osprey. Which is the nice thing about the Chinook mod, you can walk or drive anything that fits up the ramp, once in you can use the attachto command.


  10. Thanks for the help so far everybody, been reading all the threads I can find on HALO and got it to work up to a point. That is to say I have a 4 man team (each individually named), player as the leader with

    {_x moveInCargo c1} foreach units this;

    in his init line. I have a chopper c1, flying at 500 plus, with waypoints and a trigger, Blufor present, with

    TL action [ "eject", c1]; TL setvelocity [0,0,0]; [TL] exec "ca\air2\halo\data\Scripts\HALO_getout.sqs"; DS action [ "eject", c1]; DS setvelocity [0,0,0]; [DS] exec "ca\air2\halo\data\Scripts\HALO_getout.sqs"; AR action [ "eject", c1]; AR setvelocity [0,0,0]; [AR] exec "ca\air2\halo\data\Scripts\HALO_getout.sqs"; AG action [ "eject", c1]; AG setvelocity [0,0,0]; [AG] exec "ca\air2\halo\data\Scripts\HALO_getout.sqs";

    so all works good enough....But the AI's seem to drop almost vertically down, even landing behind the position of the trigger whereas I am moving forward with the natural velocity of jumping from an aircraft, as you would expect, so that we land a Km or more away from each other. Unless I turn and head towards them. Is there anyway to mark the landing zone for the AI's to head for while parachuting. So that I can keep the team together and accurately land at a precise spot and not get separated in the Drop.


  11. JDog love the script thanks. Its perfect for the mission I'm writing. One small problem though, how can I modify the swapseats.sqf to move the whole team into the chopper seats.

    When I swap seats I go into a chopper seat no problem but the other three team members (AI's) stay in the boat which is inside the chopper but they are not in cargo of the chopper they're in the boat which is inside the chopper (if you get me).

    I'm a newbie, so still trying to figure out scripting, so any help would be much appreciated thanks.


  12. Name your vehicle,place a squad with a "Get In" waypoint to lets say the chopper named H1 , name each unit in your squad and put in the leaders init line,

    U1 assignAsCargo H1; U2 assignAsCargo H1;  U3 assignAsCargo H1; U4 assignAsCargo H1;

    I can't get forEach blah blah to work for assignAsCargo.The entry in the wiki says

    Before usage of this command a subordinate unit hasn't got the option to get into the cargo space of the vehicle.[/Quote] I think reading between the lines the wiki means that you have to assign each unit to the vehicle individually can anyone confirm this? The only thing I can find to move a group in to a vehicle is this
     "_group moveincargo boat1" 
    [/Code]

    I just tried

    [Code] _group=group _unit; _group addVehicle _vehicle;_group moveInCargo _vehicle;[/Code]

    which also works (annimated) with

    [Code] _group leave _vehicle;[/Code]

    But this does mean that the crew get out to, which is OK for boats or APC's and such if you want everybody out but not choppers as usually you want the crew to stay in the chopper, plus the squad head back to the airfield or where they got in. So therefore I think assignAsCargo and unassignVehicle better for choppers.


  13. How do I cancel transport support when the the chopper arrives to "pick me up", so that it returns to its start point (ready if I call it again) without me getting in it. I know it sounds stupid but if the chopper had a full squad in it they could get out at my position as renforcements, and chopper flies back to base and is ready for use again as needed. I can spawn the squad with a radio trigger and the chopper comes where ever I want it; no need for waypoints all over the map. I'm new to scripting (and ArmA) so please forgive my ignorance on this: There is a abort sqf in the missions pbo\som\data\scripts\secops folder, would this allow me to cancel the transport request halfway through? and if so could someone tell me how to modify it. Thanks.

      /*
    File: abort.sqf
    Author: Joris-Jan van 't Land
    
    Description:
    Aborting the SecOp normally.
    
    Parameter(s):
    _this select 0: SecOp ID (Number)
    _this select 1: SecOp scope (Object)
    _this select 2: SOM main scope (Object)
    */
    
    private ["_id", "_scope", "_mainScope"];
    _id = _this select 0;
    _scope = _this select 1;
    _mainScope = _this select 2;
    
    //Your phase content goes here:
    
    
    //Telling the system to go to the next phase.
    [_id, _mainScope] call BIS_SOM_nextSecOpPhaseFunc;
    
    true    

×