OFPEC Forum

Editors Depot - Mission Editing and Scripting => ArmA - Editing/Scripting General => Topic started by: HedgeHog on 16 Oct 2008, 15:57:39

Title: How to prevent the player from crashing during cutscene
Post by: HedgeHog on 16 Oct 2008, 15:57:39
If I need to make a cutscene start while the player is flying in a plane/chopper, which commands should I use at the beginning of the camscript to avoid the player's crash?

I would be pleased if you could also remind me some other "useful commands" to make the player not to move/being shot at during an ongoing mid-mission cutscene.

And if the cutscene starts during a wild gunfight (as the trigger's conditions turn true) what do you think is good to momentarily stop the fight? To turn captive all the soldiers involved? A bit tricky, I suppose!

Thank you in advance! :D

Title: Re: How to prevent the player from crashing during cutscene
Post by: Luke on 17 Oct 2008, 01:42:54
Dunno about the crashing, but for stopping the gunfight use the following:

Code: [Select]
west setFriend [east,1];
east setFriend [west,1];

This will make ALL east and west units love each other very much (or at least not shoot each other).

to undo this use the same code, replacing the 1 values with a value lower than .6

Luke
Title: Re: How to prevent the player from crashing during cutscene
Post by: Wolfrug on 17 Oct 2008, 07:55:36
Try something like this:

Make sure the plane has a name, say, aPplane, then add this to the beginning of the camscript:

Code: [Select]
aPplane setvectorup [0,0,1];
apPlane setpos [(getpos aPplane select 0), (getpos aPlane select 1), 200];
_vel = velocity apPlane;
_dir = direction apPlane;
_speed = 100;
apPlane setVelocity [(_vel select 0)+(sin _dir*_speed),(_vel select 1)+ (cos _dir*_speed),(_vel select 2)];

Now the vector up of the plane should be level, at a height of 200 meters, and given a little "push" of speed to make sure it keeps on flying even if the player was just about to crash it or whatever.

Try it!

Wolfrug out.
Title: Re: How to prevent the player from crashing during cutscene
Post by: HedgeHog on 17 Oct 2008, 12:57:38
Very nice! :D


I'll try as soon as possible!

Thank you! :D