Slow Motion Camera

Posted By: 461

Slow Motion Camera - 04/19/08 18:38

Does anyone have a slow motion script for camera? Like the slow motion in F.E.A.R
or matrix (?)

Thanks,

Virtuamark
Posted By: Michael_Schwarz

Re: Slow Motion Camera - 04/19/08 18:42

time_factor = 0.2;
Posted By: 461

Re: Slow Motion Camera - 04/19/08 19:14

Thanks for your reply. But where do i have to type this? Camera.wdl ? Give me a tip, please. I am a newbie. THKS.

virtuamark
Posted By: Anonymous

Re: Slow Motion Camera - 04/19/08 19:48

that depends on if you always want slow mo or if you want it triggered
Posted By: sydan

Re: Slow Motion Camera - 04/20/08 12:15

I havent't seen the slow motion in F.E.A.R but if you want the slow motion to be triggered by a key press (an held, Im not going through toggle) then you will need code that looks like this probably placed in your player action:

 Code:
if(key_z == 1) //this checks to see if the z key is pressed, any key can be used
{
   time_factor = 0.2;
}
else
{
   if(key_z == 0)
   {
      time_factor = 1;
   }
}


For this you will have to put *time after all your speed changes. By this I mean

ent_move(vector(my.speed_x*time,0,0),nullvector)

the *time ensures that all speeds are changed by time.

Sydan
Posted By: 461

Re: Slow Motion Camera - 04/24/08 03:54

The firs part of the code work, but need some changes.
The part I don't get it is the one you wrote down as follow:

ent_move(vector(my.speed_x*time,0,0),nullvector)

Where do I have to type this. Also in player action o where?

Thanks

virtuamark
Posted By: sydan

Re: Slow Motion Camera - 04/24/08 12:03

Sorry I didn't explain this very well. When making a game the speed at which the computer runs (called the fps rate) will change (you probably already know this) when it does the game will slow down or speed up as the computer does. To stop this from happening you have to multiply all the speeds in your game by a value called time or time_step this stops the game from slowing down or speeding up with the computer. If you multiply your speeds by time then you can change time with time_factor. However ONLY values multiplied by time will be affected so the slow motion will only work for those. ent_move... is simply a movement function. In something like this you need the time factor so that the speed of an object is effected by time. Ent_move may also appear as c_move.

Also if your using templates then they should already have time in the correct places. If they don't its a tricky process of putting it in.

I hope that was a bit better (probably not though knowing my capability to explain)

Thanks Sydan
Posted By: WolfCoder

Re: Slow Motion Camera - 04/25/08 15:44

 Originally Posted By: sydan
I havent't seen the slow motion in F.E.A.R but if you want the slow motion to be triggered by a key press (an held, Im not going through toggle) then you will need code that looks like this probably placed in your player action:

 Code:
if(key_z == 1) //this checks to see if the z key is pressed, any key can be used
{
   time_factor = 0.2;
}
else
{
   if(key_z == 0)
   {
      time_factor = 1;
   }
}


For this you will have to put *time after all your speed changes. By this I mean

ent_move(vector(my.speed_x*time,0,0),nullvector)

the *time ensures that all speeds are changed by time.

Sydan


You don't need the if(key_z == 0) if you use an else, if the key isn't being pressed already, then it is not being pressed and that if statement at the end isn't needed.
Posted By: sydan

Re: Slow Motion Camera - 04/26/08 10:48

Thanks! Yeah now I think about it properly it is useless.
© 2024 lite-C Forums