Bullet Time by killenjoke

Have something important that other people might find usefull? Well, drop it here and help others!
User avatar
LucidStew
Level 3
Level 3
Posts: 180

Bullet Time by killenjoke

Post#1 » Mon Aug 15, 2016 7:03 pm

moved over from projectspark.com

this has been brought up a couple of times which got me thinking of a couple of methods to do this, and I decided to finalize the Kode I had been mentally working on. Here it is

Code:

Projectile:

W:[once]D:
>W:D:[Timer][=][90]
>W:D:[Speed multiplier(#var.)][=][1]
W:D:[Play fx][projectile trail][scale(fx modifier)][scale]
W:D:[position][=][Position][+][(][forward][X][(][Speed multiplier][X][World pace][)][)]
W:D:[timer(#var.)][decrement by][1][X][world pace]
W:[timer][less than or equal to][0]D:[Destroy]

Player:

W:[Y][Pressed]D:[Shoot][IWP(custom projectile)][lifetime][9000][at speed][0]


the lifetime of the projectile must be high because world pace does not affect the game clock, if the lifetime were default it could easily be destroyed while world pace was 0. The [Timer] Kode in the projectile acts like the new lifetime timer and it IS affected by world pace.

the shoot speed being set to 0 in the player brain is done for 2 reasons.

1. when a projectile is stopped and then started again it stops being a projectile and shoot speed no longer affects it's movement, that's also the reason I'm not using the [is projectile] tile in the projectile brain, since any Kode under this tile would stop working once world pace was stopped then reset

2. the shoot speed does not match the projectile speed but affect it, so when the object stops then starts there would be a noticeable difference in the speed, it's better to allow the projectile to control its own speed.


the FX scale Kode is simply there so this can be dropped into any projectile from 9mm pistol rounds to Tank shells and missiles.

since speed and lifetime are affected by world pace this projectile will work with any world pace modification, either slowing it or speeding it up. so it's possible to create Bullet time mechanics like that of Max Payne.


feel free to ask any questions and let me know if you use the Kode, I'd like to see what people do with it.
End of line.

Return to “Tutorials and guides”

Who is online

Users browsing this forum: No registered users and 1 guest

cron