IRONFRONT FANS FORUM
Sign up Latest Topics
 
 
 


Reply
  Author   Comment  
Tayuk

Avatar / Picture

Admin
Registered:
Posts: 455
Reply with quote  #1 
Download based on Tays 3rd post: Paradrop using a Mapclick location

Iv'e put together a couple of scripts to allow parachuting anywhere on the map based on a single-mapclick, I am not a scripter so all this is borrowed, stolen etc from whats been done before

Ok on an object, for this example its a flag pole in your base. In it's initiation box type:-
this addaction ["(Paradrop)","mapclick.sqs"];


Then create a file called "mapclick.sqs" with the following code:-
_first = _this select 0
_text = "Open your map and single-click where you want to parachute, make sure the location is safe!!!"
?(format["%1",_first] == "Again"):
TitleText [_text,"Plain"]
#Marker_1
onMapSingleClick "_StartLocation = player setPos _pos;[_StartLocation] exec ""Paradrop.sqf""; onMapSingleClick """""
;
exit

Then create a file called "Paradrop.sqf" with the following code:-
_veh = createVehicle ["parachutewest", position Player, [], 0, "FLY"];
_veh setposATL [getPosATL player select 0, getPosATL player select 1, 150];
_veh setVehicleInit "parachute1 = this; player moveIndriver parachute1";
sleep 1;
processInitCommands;


Both the files go in your mission folder and thats it.


0
Tayuk

Avatar / Picture

Admin
Registered:
Posts: 455
Reply with quote  #2 
I have since with alot of help from BS made it into this which works basically the same as above but there is now a transport plane spawned over you which flies off and gets destroyed by simulated flak. This method should only be used really in a single player mission as there is the chance that a few players may use the action at the same time and there be as many planes as there is players and would look a bit daft



And this is whats used:-
In the init line of my flag

this addAction["Paradrop", "mapclick.sqs"];


Mapclick.sqs
openmap true
_first = _this select 0
_text = "Single-click where you want to parachute, make sure the location is safe!!!"
?(format["%1",_first] == "Again"):
TitleText [_text,"Plain"]
#Marker_1
onMapSingleClick "_StartLocation = player setPos _pos;[_StartLocation] execVM ""Paradrop.sqf""; onMapSingleClick """""
;
exit


The Paradrop.sqf
 

// modified by B.S.

private ["_wait_time","_damage"];

_veh1 = createVehicle ["LIB_li2", position player, [], 0, "FLY"]; 
_veh1 setposATL [getPosATL player select 0, getPosATL player select 1, 170];


[_veh1, 150] execVM "flakfire.sqf";

_wait_time = time;

_veh = createVehicle ["parachutewest", position Player, [], 0, "FLY"];
_veh setposATL [getPosATL player select 0, getPosATL player select 1, 150];
_veh setVehicleInit "parachute1 = this; player moveIndriver parachute1";
sleep 1;
openmap false;
processInitCommands;

sleep 1; //!!
_damage = 0.1;

// used 10 secs
while { (time <= (_wait_time + 10)) AND (alive _veh1)} do
{
_veh1 setDamage _damage;
_damage = _damage + 0.1; // <- 0.05
sleep 1;
};
// make it a sure death...
_veh1 setDamage 1


Then finally the Flakfire.sqf

// Flak simulation script by *[600]*The Itch
// modified by B.S.
// usage (in a trigger or in the units init line): [plane1, 150] execVM "flakfire.sqf"
// where plane is the name of the unit and 150 is the amount of flak rounds

private ["_unit","_flaktype","_amountflak","_i","_flakLoc","_flakLocX","_flakLocY","_flakLocZ","_flak1","_flak2"];

_flaktype = "SmallSecondary";
_unit = _this select 0;
_amountflak = _this select 1;
_amountflak = _amountflak / 2;

sleep 0.1;
_i = 0;
while { (_i < _amountflak) AND (alive _unit)} do
{
_flakLoc = getPos _unit;
_flakLocX = _flakLoc select 0;
_flakLocY = _flakLoc select 1;
_flakLocZ = _flakLoc select 2;

_flak1 = _flaktype createVehicle [ _flakLocX + 0 - random 80, _flakLocY + random 60, _flakLocZ + random 80];
sleep 0.7;
_flak2 = _flaktype createVehicle [ _flakLocX + 0 + random 80 - random 20, _flakLocY + random 50 - random 10, _flakLocZ - random 80];
sleep 0.35;

_i = _i + 1;
};



0
Tayuk

Avatar / Picture

Admin
Registered:
Posts: 455
Reply with quote  #3 
In the above scripts there was a slight delay between using the action on the flagpole to being in the parachute, this has been solved by BS in the following:-

Quote:
First I named the flagpole -> flagpole
Then I inserted into the flagpole iniline : ClickOnMapCounter = 0; this addaction ["(Paradrop)","mapclick.sqf"];

I changed mapclick.sqf:

private ["_StartLocation"];

flagpole removeAction ClickOnMapCounter;

openmap true;
hintsilent format["%1Single-click where you want to parachute, make sure the location is safe!!!"];
onMapSingleClick "_StartLocation = _pos; [_StartLocation] execVM ""Paradrop.sqf""; clicked = 1; openmap false; onMapSingleClick ''; true;";
waitUntil {(clicked == 1)};
hint"";


Quote:
then I changed Paradrop.sqf

// modified by B.S.

private ["_wait_time","_damage","_pos"];

_pos = _this select 0;

_veh1 = createVehicle ["LIB_li2", _pos, [], 0, "FLY"]; 
_veh1 setposATL [_pos select 0, _pos select 1, 170];

sleep 0.2;
[_veh1, 150] execVM "flakfire.sqf";

_wait_time = time;

_veh = createVehicle ["parachutewest", _pos, [], 0, "FLY"];
_veh setposATL [_pos select 0, _pos select 1, 150];

_veh setVehicleInit "parachute1 = this; player moveIndriver parachute1";
sleep 0.5;
processInitCommands;

sleep 0.5;
_damage = 0.1;
while { (time <= (_wait_time + 10)) AND (alive _veh1)} do
{
_veh1 setDamage _damage;
_damage = _damage + 0.1;
sleep 1;
};
// make it sure...
_veh1 setDamage 1;

//waitUntil { ( (getPos player) select 2 < 1.5 ) };
//hint "landed";
ClickOnMapCounter = ClickOnMapCounter + 1;
flagpole addaction ["(Paradrop)","mapclick.sqf"];


Quote:
This is working fine for me and I hope I made no mistake while copying this here.
The ClickOnMapCounter, removeAction ClickOnMapCounter and addAction ClickOnMapCounter part may not be needed in this case, I used that to learn the how to.
There may be several ways to handle this different, it's just what I found out.
0
Gunter Severloh

Avatar / Picture

Admin
Registered:
Posts: 2,748
Reply with quote  #4 
I have a script for halo that does does this, you go up to a flagpole and it will add an action to your menu, and then a hint will popup and ask you where you want to halo,
then you click on your map and you halo there, you will get the option to parachute when you feel your low enough to deploy it,
could be useful for Fallshirmjaeger type missions, shall I post it?

__________________
0
Tayuk

Avatar / Picture

Admin
Registered:
Posts: 455
Reply with quote  #5 
Yes mate post that, I would like to have a play
0
Gunter Severloh

Avatar / Picture

Admin
Registered:
Posts: 2,748
Reply with quote  #6 
Ok, i haven't tested it in IF, but have used it a few times in Arma2CO.

Insert by Halo

1. Go ingame and create a test mission and place either a flagpole or an object that would make
it seem believable for a halo/paradrop

2. add this code in the initialization line of the object:
this addAction["Insert by HALO","HALO.sqf"];


note on this code: where it says Insert by halo, you can word that whatever you want, as when you
walk up to the flagpole or object you used, that same message will appear on the screen and action menu.

Note on the code:
where it says Click on the map where you'd like to HALO in the script again you can word that
how you like to be more fitting for the WW2 theater.

click on the map as it says and then once you close your map you will be teleported 1000m (m=meters) up in the air
at your exact location you chose on the map.

The 1000m set in the script as you can see  where it says [player, 1000], you can change that number to what you want,
I would not recommend anything lower then 500,
as you fall fast, and you will probably have not any time to pull your chute, you decide test it out.
In your action menu it will say parachute, you can freefall as long as you want, but i'd suggest using the parachute way
before you get to low as it has to open up.

3. create this script:

HALO.sqf
haloed = true;
hintSilent "Click on the map where you'd like to HALO.";
onMapSingleClick "player setPos _pos; [player, 1000] exec 'ca\air2\halo\data\Scripts\HALO_init.sqs';haloed = false;hint 'Close the map and don''t forget to open your chute!'";
waitUntil{!haloed};
onMapSingleClick "";


4. Put the script in the same folder as your mission, script works in sp and MP!

__________________
0
Tayuk

Avatar / Picture

Admin
Registered:
Posts: 455
Reply with quote  #7 
I don't think is going to work, as it uses 'ca\air2\halo\data\Scripts\HALO_init.sqs', this script within ironfront doesn't exist, but will check when I get in later.
0
Tayuk

Avatar / Picture

Admin
Registered:
Posts: 455
Reply with quote  #8 
Ok Gunter I've "found" the Halo_init.sqs file  and now have it working, so it seems we can halo in IF after all

Ok in the init of a flag put
this addAction["Insert by HALO","HALO.sqf"];


The halo.sqf is now this
haloed = true;hintSilent "Click on the map where you'd like to HALO.";onMapSingleClick "player setPos _pos; 
[player, 1000] exec 'HALO_init.sqs';
haloed = false;hint 'Close the map and don''t forget to open your chute!'";
waitUntil{!haloed};onMapSingleClick "";


And the Halo_Init.sqs is this
_isEP1 = isclass(configfile >> "cfgvehicles" >> "ParachuteWest");
if (!_isEP1) then {goto "A2"};

;--- Improved HALO script
_HALOunit = _this select 0;
_HALOunitaltitude = _this select 1;

if (isnil "bis_fnc_init") then {createcenter sidelogic; _grp = creategroup sidelogic; _logicFnc = _grp createunit ["FunctionsManager",position player,[],0,"none"];};

@!isnil "bis_fnc_init"
_nil = [_HALOunit,_HALOunitaltitude] spawn bis_fnc_halo;

exit;
;-----------------------The rest of the script is commented out as it is not needed.
;#A2

;_HALOunit = _this select 0
;_HALOunitaltitude = _this select 1

;// Set the unit pos in the air
;_HALOunit setpos [getpos _HALOunit select 0, getpos _HALOunit select 1, _HALOunitaltitude]

;// Run player or AI script
;~0.05
;? (_HALOunit == player) : playsound "BIS_HALO_Flapping"; setAperture 0.05; setAperture -1; _HALOunit switchMove "para_pilot"; [_HALOunit] exec "ca\air2\halo\data\Scripts\HALO.sqs"
;? ! (isplayer _HALOunit) : [_HALOunit] exec "ca\air2\halo\data\Scripts\HALO_AI.sqs"

;exit


The 2 script files just go in your mission folder and you will have Halo in IF.
I am not sure exactly what some of the script does as it only needs the part upto the 1st exit.  There is no sound for the halo which feels alittle odd, but once in the chute is opend all things are the same as being on a chute in the game anyway........except the chute is now steerable.

I do have all the other scripts that I unpbo'd as part of the whole Arma halo package and  the sound file for the flapping cloths as you halo, but unfortunatley I do no know how that all works together. But should anyone else like this package or know how to add the sound file to the above please let me know.

Anyway, those not familiar with Halo, this is what it looks like
 

 

0
Gunter Severloh

Avatar / Picture

Admin
Registered:
Posts: 2,748
Reply with quote  #9 
Cool, glad you got it working. The sound when you halo is in Arma2CO, so maybe same sound is not in IF, considering its only WW2 so maybe
they not expect anyone to do such manover, but rather just paradrop, dont know.

__________________
0
Tayuk

Avatar / Picture

Admin
Registered:
Posts: 455
Reply with quote  #10 
I have now updated the halo scripts and created a template mission that can be downloaded from here:-

>>>Halo template<<<

It now has the sound while haloing and also has an altimeter (Not very realistic I know, but some may find a use for it)



In the video I have used some of Joarius's Fallschirmj├Ąger textures, but the template is standard.

0
Gunter Severloh

Avatar / Picture

Admin
Registered:
Posts: 2,748
Reply with quote  #11 
Both scripts and templates are now hosted on the MR:

Download
Paradrop using a Mapclick location

Insert by Halo w/ mission template



__________________
0
GavC

Private
Registered:
Posts: 3
Reply with quote  #12 
hi folks,

how would i go about setting this up to run once from the flagpole and then opening a map upon player respawn so they can click where to respawn in a halo drop.

i've put execVM "halo.sqf"; into the onPlayerRespawn.sqf but it just gives the option to open the map when the player spawns back onto the grround. Should i be calling the sqs file in stead?

Thanks

Gav
0
Gunter Severloh

Avatar / Picture

Admin
Registered:
Posts: 2,748
Reply with quote  #13 
Download the demo mission and see how its done, then copy n paste from there.
__________________
0
Previous Topic | Next Topic
Print
Reply

Quick Navigation:

Easily create a Forum Website with Website Toolbox.