Jump to content
MrCrazyDude115

[Question] Spawn players in "cinematic" helicopter?

Recommended Posts

Hey everyone!

 

So basically what I'm trying to do is make it so that all dead players will respawn in waves, and when it's time to respawn all players will spawn in a helicopter which will follow a set-path and land at the spawn point. Afterwards, the players will disembark using a cinematic animation, not just "eject" like they do in the game. Make sense? Then the helicopter will fly away.

 

I want this to repeat everytime it's time for the next respawn wave until the end of the game.

 

I know how to implement wave-spawning, and I know how to use the UnitCapture and UnitPlay commands for the helicopter movement. But I just want to know how to spawn/despawn said helicopters, as well as do the "cinematic" animations I mentioned.

 

Think of the intro cinematics at the start of a MP match in the latest Call of Duty, but I want it to repeat every time there's a spawn wave.

 

Any ideas?

 

Thanks!

Share this post


Link to post
Share on other sites

to spawn the _heli:
 

private _spawn = [[0,0,100], 180, "RHS_CH_47F", west] call bis_fnc_spawnvehicle;
private _heli = _spawn select 0;

then spawn the unitPlay on the heli.
Since you have recorded the path its easy to time when it will reach LZ and when you want to despawn it, use any kind of sleep for that and deleteVehicle when you want it to despawn.
As for the animations. What animations do you have in mind ?
Are you using cba?
Extra remark : to move the players by script in the Heli you will have to use moveInCargo, and in MP the command is higly buggy: if you remote exec it it will not work properly, (maybe one of the latest update has fixed that but I wouldn't conut on it). The best workaround for this issue is to use cba target events hence the above question.

  • Like 2

Share this post


Link to post
Share on other sites
8 hours ago, Mr H. said:

to spawn the _heli:
 


private _spawn = [[0,0,100], 180, "RHS_CH_47F", west] call bis_fnc_spawnvehicle;
private _heli = _spawn select 0;

then spawn the unitPlay on the heli.
Since you have recorded the path its easy to time when it will reach LZ and when you want to despawn it, use any kind of sleep for that and deleteVehicle when you want it to despawn.
As for the animations. What animations do you have in mind ?
Are you using cba?
Extra remark : to move the players by script in the Heli you will have to use moveInCargo, and in MP the command is higly buggy: if you remote exec it it will not work properly, (maybe one of the latest update has fixed that but I wouldn't conut on it). The best workaround for this issue is to use cba target events hence the above question.

 

Okay so do I execute that code to spawn the Chinook from RHS? Should I make it so this script executes every time the spawn wave occurs? For the animations I just want to use one that makes it look cool and cinematic when the characters disembark. Yes, I am using CBA as the scenario uses mods that require it, but I have no experience with the CBA commands.

 

Also another thing, should I make an empty marker called "spawn" or "heli"? How does this script decide where it'll spawn?

Share this post


Link to post
Share on other sites

You can spawn it anywhere ( in my example it spawns at coordinates 0,0 at a height of a 100m to be flying) it doesn't matter where since the unit play will place it where you want. 

  • Thanks 1

Share this post


Link to post
Share on other sites
On 11/30/2019 at 9:18 PM, Mr H. said:

You can spawn it anywhere ( in my example it spawns at coordinates 0,0 at a height of a 100m to be flying) it doesn't matter where since the unit play will place it where you want. 

 

Thanks! One last thing, what if the server has A LOT of players. What would an "if" condition that would check how many players are dead, and if there are more dead players than available seats in the heli, it'll spawn a second heli and garrison the remaining players into that second heli, which will follow a different path and land on a second pre-defined location?

Share this post


Link to post
Share on other sites

You have to get the cargo room for the helicopter and then count the number of dead players compare them and you're set.

  • Thanks 1

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

×