Home   Help Search Login Register  

Author Topic: How to prevent the player from crashing during cutscene  (Read 1183 times)

0 Members and 1 Guest are viewing this topic.

Offline HedgeHog

  • Members
  • *
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


Offline Luke

  • Members
  • *
  • Thank God! The OFPEC Staff are here!
Re: How to prevent the player from crashing during cutscene
« Reply #1 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
Pesky Human!!
Wort Wort Wort.

Offline Wolfrug

  • Addons Depot
  • Former Staff
  • ****
  • Official OFPEC Old Timer
Re: How to prevent the player from crashing during cutscene
« Reply #2 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.
"When 900 years YOU reach, look as good you will not!"

Offline HedgeHog

  • Members
  • *
Re: How to prevent the player from crashing during cutscene
« Reply #3 on: 17 Oct 2008, 12:57:38 »
Very nice! :D


I'll try as soon as possible!

Thank you! :D