Jump to content
Sign in to follow this  
M.Evans

Respawning into a parachute

Recommended Posts

Hi was just wondering if there was a simple way to respawn into a parachute, I am making an I44 mission and would like to be able to drop on the edge of the town everytime I spawn, or if it would be easier to spawn in a plane, idk, pretty much up for anything you guys have to offer, I tried creating 20 units, and 20 vehicles, and telling the units to get in the parachutes, but to no avail. Like I said, anything will help. thank you.

Share this post


Link to post
Share on other sites

Tried this?

player moveInDriver chute;

Share this post


Link to post
Share on other sites
Tried this?

player moveInDriver chute;

Yes I have, that is what I use to start the mission,

I have 20 parachutes set up and 20 players,

I use

a1 moveindriver para1

for each one, pretty much so when the mission starts we are all at an altitude using the setpos in the parachute itself of about 200 meters, above the ground.

Now if killed is there a way to respawn into that vehicle or create a new parachute over a marker on the map and get the unit into the vehicle. I know there is a way I just dont know how to script it.

but curious though, does the "player" mean that when the player respawns it does something different, or is that just some way you named the unit.

because I have them named a1-a20

Share this post


Link to post
Share on other sites

You could use the MPRespawn eventhandler to 'teleport' people into a parachute when they respawn. You'd setup a function that creates a parachute over whatever marker you wanted to and moves the player into it. Then run that function from the MPRespawn eventhandler.

Share this post


Link to post
Share on other sites

ok, well here is the thing, I would love to try that, but I have no experience writing scripts, so I will give it a shot from the link you gave me, I might totally butcher this but ill try.

unitName addMPEventHandler ["event", {action}];

BASE CODE right? ^^

_pos = GetPos player;
a1 addMPEventHandler ["MPRespawn", {Null = _this execVM "chutespawn.sqf";}]; 

I honestly dont know.

and would that be its own script, or just add that to the description

Edited by M.Evans

Share this post


Link to post
Share on other sites

Close. :)

// Function that creates a parachute over the dropzone marker and moves the player into it.
fnc_letsFly = {
_para = createVehicle ["Parachute_US_EP1", getMarkerPos "mrk_dropZone", [], 0, "FLY"];
_para setPosATL [getPosATL _para select 0, getPosATL _para select 1, 200];
player moveInDriver _para;
};

// This starts the player in the air at gamestart
call fnc_letsFly;

// This adds the MP event to the player
player addMPEventHandler ["MPRespawn",{_this spawn fnc_letsFly;}];

Here's a demo of that code.

Edited by kylania

Share this post


Link to post
Share on other sites

// Function that creates a parachute over the dropzone marker and moves the player into it.

// Randomized location
_locs = ["paraloc1", "paraloc2", "paraloc3", "paraloc4", "paraloc5"];
_mpos = getMarkerPos (_locs select (random(count _locs)));

fnc_letsFly = {
_para = createVehicle ["Parachute_US_EP1", getMarkerPos _mpos, [], 0, "FLY"];
_para setPosATL [getPosATL _para select 0, getPosATL _para select 1, 220];
player moveInDriver _para;
};

// This starts the player in the air at gamestart
call fnc_letsFly;

// This adds the MP event to the player
player addMPEventHandler ["MPRespawn",{_this spawn fnc_letsFly;}];

Alright, thanks and with some modification we made it so that it randomizes a drop zone would our additions work, or is there a problem with this.

Share this post


Link to post
Share on other sites

You can actually do that within the createVehicle array command itself.

_para = createVehicle ["Parachute_US_EP1", getMarkerPos "paraloc1", ["paraloc2", "paraloc3", "paraloc4", "paraloc5"], 0, "FLY"];

Share this post


Link to post
Share on other sites

thank you so much! works perfectly, now the problem is (didnt think about this earlier, but I need the respawn location to move up to a new set of markers after they capture the main town,

I believe I would need to set a trigger to Opfor none present and when that happens, and it would initiate the script which would move the new markers up from these markers

_para = createVehicle ["Parachute_US_EP1", getMarkerPos "paraloc1", ["paraloc2", "paraloc3", "paraloc4", "paraloc5"], 0, "FLY"];

to something like

getMarkerPos "paraloc6", ["paraloc7", "paraloc8", "paraloc9", "paraloc10"],

would this just be an expansion on the init lines, or something completely different, and would I need to set something else in the trigger like some script exec or something.

Thanks

Share this post


Link to post
Share on other sites
You could use the MPRespawn eventhandler to 'teleport' people into a parachute when they respawn. You'd setup a function that creates a parachute over whatever marker you wanted to and moves the player into it. Then run that function from the MPRespawn eventhandler.

this answers a question i have. So, i put this code in init.sqf right? i ask cause the attached misison is in pbo format so i cant see. thanks!

Share this post


Link to post
Share on other sites
this answers a question i have. So, i put this code in init.sqf right? i ask cause the attached misison is in pbo format so i cant see. thanks!

Yup that code is the init.sqf for that demo. Description.ext is:

respawn = "BASE";
respawnDelay = 5;

and the only thing in the mission was just this as the player's init field:

this call fnc_letsFly;

Share this post


Link to post
Share on other sites

SORRY BUT CAN SOMEONE GIVE ME AN EXAMPLE TO APPLY, THE PARACHUTE RESPAWN BUT ON A MISSION TEAM MULTI`PLAYER?

what happens is that the parachute opfor also reappear, and I try to only reappear BLUFOR parachute team.

and had a normal spawn opfor ground

translated by google in

Share this post


Link to post
Share on other sites

@Topic:

Simply set the Players height up in the air on spawning (use setPos ATL) and use this code to have the Player in a steerable parachute:

[player] spawn BIS_fnc_halo;

No need to create a new function that spawns a parachute and then uses moveInDriver for the player etc.

@ariel777111

Why do You yell at us?

I don't know how Your respawn works, but a little switch would probably do the work.

Here is a example:

switch(playerSide)do{
case east:{
//OpFor ground spawn code here
};
case west:{
//BluFor parachute spawn code here
};
};

I hope this information is helpful.

Greez KiloSwiss

Edited by KiloSwiss
Typos

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  

×