|
Re: Slow Motion Camera
[Re: 461]
#203143
04/19/08 19:48
04/19/08 19:48
|
Malice
Unregistered
|
Malice
Unregistered
|
that depends on if you always want slow mo or if you want it triggered
|
|
|
Re: Slow Motion Camera
[Re: 461]
#203203
04/20/08 12:15
04/20/08 12:15
|
Joined: Oct 2007
Posts: 116
sydan
Member
|
Member
Joined: Oct 2007
Posts: 116
|
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:
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
For some reason, my ambition always seems to beat my ability.
|
|
|
Re: Slow Motion Camera
[Re: 461]
#203826
04/24/08 12:03
04/24/08 12:03
|
Joined: Oct 2007
Posts: 116
sydan
Member
|
Member
Joined: Oct 2007
Posts: 116
|
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
For some reason, my ambition always seems to beat my ability.
|
|
|
Re: Slow Motion Camera
[Re: sydan]
#203998
04/25/08 15:44
04/25/08 15:44
|
Joined: Jan 2006
Posts: 59 Desert Zone
WolfCoder
Junior Member
|
Junior Member
Joined: Jan 2006
Posts: 59
Desert Zone
|
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:
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.
|
|
|
Re: Slow Motion Camera
[Re: WolfCoder]
#204081
04/26/08 10:48
04/26/08 10:48
|
Joined: Oct 2007
Posts: 116
sydan
Member
|
Member
Joined: Oct 2007
Posts: 116
|
Thanks! Yeah now I think about it properly it is useless.
For some reason, my ambition always seems to beat my ability.
|
|
|
Moderated by mk_1, Perro, rayp, Realspawn, Rei_Ayanami, rvL_eXile, Spirit, Superku, Tobias, TSG_Torsten, VeT
|