Hey guys, I got contacted by some SP modders (http://www.youtube.com/user/BeachpartyClan) who were interested in my health blur effect, so I sent them this response, and I figured some people here might like to hear it as well.
This script (along with a ton of other stuff) was going to go public in a month or so anyway, depending on when I finish setting up the new BCE website.
Anyways, it uses (cinematic_screen_effect_set_convolution). I had to reverse engineer how this function works; here's the arguments:
(cinematic_screen_effect_set_convolution a b c d e)
a: integer, number of passes (more makes smoother image, lower framerate)
b: integer, blur type (there are a couple of types that look different; you might play around with that a bit)
c: real, starting blur (percent; the screen will jump instantly to this blur amount)
d: real, ending blur (percent; the screen will then fade to this amount of blur)
e: real, number of seconds for the transition from c to d
In order for this to actually do anything, you need to call
(cinematic_screen_effect_start 1) to enable the blur effect (note, this will break weapon scope bitmaps! I'm still working on a workaround for that)
Just use (cinematic_screen_effect_start 0) to turn it off again when you need to.
The complete health blur script looks like this:
Code:
(global real health_blur 0.0)
(global real prev_health_blur 0.0)
(global unit playerunit (unit (list_get (players) 0)))
(script continuous healthblur
(begin
(set health_blur
;if you play with the parameters in this section you can change the amount
;of the blur and its dependency on health and shields
(* 10.0
(* 2.0 (max 0.0 (- 0.7 (unit_get_shield playerunit) ) ) )
(- 1.5 (unit_get_health playerunit ) )
)
)
(if (!= prev_health_blur health_blur)
(begin
(cinematic_screen_effect_set_convolution 1 2
prev_health_blur health_blur 1)
(set prev_health_blur health_blur)
)
)
(sleep 30)
)
)
(script startup main
(cinematic_screen_effect_start 1)
)
The red effect that grows around the edges of the screen is actually a custom shield meter bitmap in the HUD. It's the inverse of your normal shield meter (instead of shrinking when you take damage it grows). When the new BCE site goes live the bitmap and the associated tags will be available, but I think at this point you know enough to figure it out on your own.
I always love hearing people are working on single player campaigns. It took a while, but Halo is finally starting to really mature into the SP modding phase.
Cheers, guys!
-Rob
Update:
So, I want to encourage the sharing of ideas amongst our community (if I wasn't, I'd hoard this script all to myself) so I'm going to specify two conditions for you to use this script and any other items I post related to BCE. Once the website goes up this will be made an official license agreement for most of the available downloads, based on the Gnu General Public License. I'm not going to enforce this in any way except to maybe send you an angry e-mail if you piss me off, but please guys, we're a community; share.
#1: Cite the name of everybody who worked on or otherwise contributed to a resource you explicitly feature. (an example of this is this youtube video; if you're making a big deal out of something, please don't imply that it is yours alone)
#2: Share your modified resource. This is the main point here. I'm sharing this and other things with the assumption that it will be shared by the community, so the primary condition for you being allowed to modify anything is that you make the modifications available in the same way the original was. The example here is that if you modify the health blur script, please post your modified version here.
So, I'm not trying to be a copyright nazi or a self-absorbed prick here; the whole reason for these requirements is again to promote sharing of ideas amongst the community. Happy modding!
Bookmarks