Jump to content
Sign in to follow this  
gonza

HALO, how to add it ?

Recommended Posts

trying to work around the issue where AI drops miles away by using slightly differnt code for AI and I came up with the following.

s1 sideChat "Ok we're at the dropzone - BAIL OUT";

//rest is server side only
if (isServer) then {
_group = _this select 0;
_vehicle = _this select 1;

sleep 2;



   {
           if (isPlayer _x) then {   
          unassignvehicle _x;
           _x action ["EJECT", _vehicle];
           _x setvelocity [0,0,0];            
           [_x] exec "ca\air2\halo\data\Scripts\HALO_getout.sqs";
       sleep 1;
           }

           else {

       unassignvehicle _x;
       _x setpos [ getPos _x select 0, getPos _x select 1, 250];
       _x flyinheight 250;
       _x setvelocity [0,0,0];
       [_x] exec "ca\air2\halo\data\Scripts\HALO_init.sqs";
       sleep 1;
           }


   } foreach units _group;
};

called via trigger grouped to c130

xhandle=[s1,c130] execVM "scripts\halo.sqf"; 

Now this works ok but generates the following error in Arma2.rpt

Error in expression <it select 0, getpos _HALOunit select 1, _HALOunitaltitude]>
 Error position: <_HALOunitaltitude]>
 Error Undefined variable in expression: _halounitaltitude

can anyone shed any light on this?

Share this post


Link to post
Share on other sites

[_x, [color="Red"]2500[/color]] exec "ca\air2\halo\data\Scripts\HALO_init.sqs";

You are missing the altitude value for the HALO_init.sqs script.

Your main problem though is that 250m up is essentially death for a HALO drop. Try 2500m instead. :) At 250m just use eject and the normal parachutes.

Share this post


Link to post
Share on other sites
Your main problem though is that 250m up is essentially death for a HALO drop. Try 2500m instead. :) At 250m just use eject and the normal parachutes.

That just it though - the plane is at 2500 but when using any variation of halo on AI means at that height the land anywhere within 5000m I setpos them lower to give them less scope to drift away from the planned dropzone.

Again this is just for AI - player controlled get the full 2500m halo.

However thx for the insight..

Share this post


Link to post
Share on other sites

That's odd, since you stop them so they should just fall down...

Share this post


Link to post
Share on other sites

dePbo'd the official scripts and noticed the units have speed added to them as part of that script - ended up using the following which is exactly what I needed

Script Call in Trigger

xhandle=[s1,c130] execVM "scripts\halo.sqf";

halo.sqf

s1 sideChat "Ok we're at the dropzone - BAIL OUT";

//rest is server side only
if (isServer) then {
_group = _this select 0;
_vehicle = _this select 1;

sleep 2;



   {               
          unassignvehicle _x;
           _x action ["EJECT", _vehicle];
           _x setvelocity [0,0,0];            
           [_x] exec "scripts\HALO_getout.sqs";
       sleep 1;

   } foreach units _group;
};

HALO_getout.sqs

_HALOunit = _this select 0


;// wait that the player drive the normal parachute
@ (typeOf (vehicle _HALOunit)) in ["ParachuteWest","ParachuteEast","ParachuteG","ParachuteC","Parachute"]

;// Delete the default parachute    
_defaultparachute = vehicle _HALOunit
deleteVehicle _defaultparachute


;// Smooth transition
titleCut ["", "BLACK FADED", 100];
~1.0
titleCut ["", "BLACK IN", 2];


;// Do the effects
? (_HALOunit == player) : playsound "BIS_HALO_Flapping"

;// Lauch the script for the AI or for PLAYER 
? (_HALOunit == player) : [_HALOunit] exec "scripts\HALO.sqs"
? (_HALOunit != player) : [_HALOunit] exec "scripts\HALO_AI.sqs"

_HALOunit setdammage 0;


exit

HALO.sqs

_HALOunit = _this select 0


BIS_HALO_unit_dir = 0
BIS_HALO_unit_speed = 0
BIS_HALO_turnR = 0

_HALOunit_pitch = -90
_i1 = 50
_i2 = 0

playsound "BIS_HALO_Flapping"
_HALOunit switchMove "HaloFreeFall_non"


keyspressed = compile preprocessFile "ca\air2\halo\data\Scripts\f\keyspressed.sqf"

(findDisplay 46) displaySetEventHandler ["KeyDown","_this call keyspressed"]


_open_chute_action = _HALOunit addAction [localize "STR_HALO_OPEN_CHUTE", "ca\air2\halo\data\Scripts\HALO_Parachute.sqs"]

_HALOunit switchMove "HaloFreeFall_non"


_HALOunit allowdammage false;


#loop
~0.001
_i1 = _i1 + 1
_i2 = _i2 + 1


_HALOunit setdir BIS_HALO_unit_dir


_vel = velocity _HALOunit
_dir = direction _HALOunit
_HALOunit setVelocity [(sin _dir*BIS_HALO_unit_speed),(cos _dir*BIS_HALO_unit_speed),(_vel select 2)]


;// Anims system
? (BIS_HALO_unit_speed > 50) && (_i2 > 80) :  _HALOunit playMove "HaloFreeFall_F"; _i2 = 0
? (BIS_HALO_unit_speed < 50) && (_i2 > 250) :  _HALOunit playMove "HaloFreeFall_non"; _i2 = 0


? (BIS_HALO_unit_speed > 80) :  BIS_HALO_unit_speed = 80
? (BIS_HALO_unit_speed < 1)  :  BIS_HALO_unit_speed = 0



"RadialBlur" ppEffectAdjust [(BIS_HALO_unit_speed * 0.0002), (BIS_HALO_unit_speed * 0.0002), 0.06, 0.06]
"RadialBlur" ppEffectCommit 0.01
"RadialBlur" ppEffectEnable true   



? (_i1 > 50) : playsound "BIS_HALO_Flapping"; _i1 = 0


hintsilent format [localize "STR_HALO_ALTITUDE_SPEED", (round (getpos _HALOunit select 2)), BIS_HALO_unit_speed]



? (position _HALOunit select 2 < 2) : _HALOunit playmove ""; _HALOunit switchmove ""; _HALOunit setvelocity [0,0,0]; _HALOunit setdammage 1; _HALOunit allowdammage true; exit
? (alive _HALOunit) && (vehicle _HALOunit == _HALOunit) && (position player select 2 >= 2) : goto "loop"
? (vehicle _HALOunit != _HALOunit) : exit


exit

HALO_AI.sqs

_HALOunit = _this select 0
_waypointreached = 0
_chuteopeningaltitude = 150 + (random 100);
_speed = 0


_HALOunit switchMove "HaloFreeFall_non"


_HALOunit allowdammage false;



;// Turn the AI unit to this first waypoint direction 
_pos1 = getpos _HALOunit
_waypointpos = getWPPos [group _HALOunit,1]
_pos2 = [_waypointpos select 0,  _waypointpos select 1, getpos _HALOunit select 2]

_ret = ((_pos2 select 0) - (_pos1 select 0)) atan2 ((_pos2 select 1) - (_pos1 select 1))
_ret = _ret % 360

_HALOunit setdir _ret



#loop
~0.001

_pos1 = [getpos _HALOunit select 0,  getpos _HALOunit select 1];
_pos2 = [_waypointpos select 0,  _waypointpos select 1];


;// Add speed to the unit in the air
_vel = velocity _HALOunit
_dir = direction _HALOunit


? (_waypointreached == 0) : _HALOunit setVelocity [(sin _dir*_speed),(cos _dir*_speed),(_vel select 2)];
? (_waypointreached == 1) : _HALOunit setVelocity [0, 0,(_vel select 2)];



;// Arrived close to the waypoint?
? (( _pos1 distance _pos2) < 50) : _waypointreached = 1                                       


;// Conditions to continue the loop
? (alive _HALOunit) && (vehicle _HALOunit == _HALOunit) && (position _HALOunit select 2 > _chuteopeningaltitude) : goto "loop"



;// Run Parachute AI script
[_HALOunit] exec "ca\air2\halo\data\Scripts\HALO_Parachute.sqs"



exit

Share this post


Link to post
Share on other sites

Great - that's excellent. I only noticed this myself yesterday - I was having to set the halo jump up away from where I actually wanted the AI to land to counter the drift. Then I noticed that for some reason the 'drfit' affected the units differently when run hosted as apposed to dedicated. I was starting to think I would need to write some work-around code!

Presumably in your modified scripts you have removed the speed added by BIS?

Share this post


Link to post
Share on other sites
Presumably in your modified scripts you have removed the speed added by BIS?

correct :) although I'm re-working them again into Sqf format..

Share this post


Link to post
Share on other sites

I slightly modified them as I don't use waypoints for the AI in my mission, but they work as advertised. My AI fellows now HALO to where I want them rather than somewhere in the next country!! Thanks for your efforts!

Share this post


Link to post
Share on other sites
My AI fellows now HALO to where I want them rather than somewhere in the next country!! Thanks for your efforts!

No worries - when i've finished converting to sqf and tweaked it to my liking I'll put together a quick demo mission for other n00bs like us trying to get this working for the first time.

Share this post


Link to post
Share on other sites

im wondering how to load a whole unit in a static c 130 with the proper sound and have them halo jump out of the back ramp of the c 130 n can this be done in a moving c 130

Share this post


Link to post
Share on other sites
im wondering how to load a whole unit in a static c 130 with the proper sound and have them halo jump out of the back ramp of the c 130 n can this be done in a moving c 130

Yes in a roundabout way as long as you are in the C130. The only C130 with a cargo space you can walk in is the static C130. If you look around there are scripts which attach it to a flying C130 and you get a good HALO effect. As you jump it deletes the static aircraft and the other moves away. Search and ye shall find.

Share this post


Link to post
Share on other sites

Hello,

I would like to know where I can get this addon/script please?

Share this post


Link to post
Share on other sites
Hello,

I would like to know where I can get this addon/script please?

I don't think it was ever released, it's not a script, it's a custom addon.

There is another here but do not bother the developer please as he has obviously had a lot to cope with during the past year, take it as is, it will probably be released in Arma3?:

http://forums.bistudio.com/showthread.php?119925-USEC-Parachutist-H-A-L-O-Series/page11&highlight=aduke+HALO

See 1st post in that thread for images.

Share this post


Link to post
Share on other sites

Much appreciated!!

Thank you, I will give it a try tonight. I am building a HALO/Jump school. It would be nice if the guys had some actual parachutes on thier backs LOL.

S/F

Share this post


Link to post
Share on other sites

im sorry if this has already been answered previously but i am busy and dont have time to read through all the threads posted but how do you make ai's walk out of the back of a static c130? whenever i try to jump with them they just walk around and somehow walk through the walls of the c130[i have already tried setting waypoints]. so could someone please help me out on how to give my units the quote "green light" to walk off the ramp.

Share this post


Link to post
Share on other sites

JTK_HALO script by Kempco

Includes custom dual purpose GPS, Bailout 02 simulation, and gear management system. Works in both single player (shown) and multiplayer (hosted and dedicated). Requires Arma 2 Operation Arrowhead and CBA. ACE however is strongly recommended ATM (More on ACE below). The Bailout 02 masks used in the script require the Desert Mercenaries and BlackOps addon by SchnapsdroSel. NOTE: The script does not require the Desert mercs addon, however the mask models will not appear on units wearing them if the addon is not used. The mask overlay simulating the mask outline will still show up. Also, if you are not Using ACE then the mask models will be neglected altogether as the script will not have an Identity to reference once the mask is removed. (Same goes for ACE users without their user configs set). The Non-ACE version is still a WIP. The script works W/O it, however parachute models are configured differently and you will not be able to switch your GPS mode when your chute is open.

Edited by Kempco

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
Sign in to follow this  

×