PDA

View Full Version : HPC Multiplayer Health Blur Script - Client side



EagerYoungSpaceCadet
August 2nd, 2010, 04:00 PM
Hi everyone,
since I'm an eye candy addict, and found that Health Blur looked cool, I thought putting it into Blood Gulch on Halo PC (since most people can't/won't/they're too lazy to get Halo CE).
Based on Sasc's Multiplayer Health Blur Script (which was based on Rob Oplawar's Singleplayer Health Blur Script):


(global short num7 0)
(global short num6 0)
(global short num5 0)
(global short num4 0)
(global short num3 0)
(global short num2 0)
(global short num1 0)
(global short numhb 0)

(script continuous zoom_true
(if
(and
(= (player_action_test_zoom) true)
(= (unit_get_health (unit srvr_check)) -1))
(begin
(cinematic_screen_effect_stop)
(player_action_test_reset)
)
)
)

(script continuous fullhealth
(if
(and
(= (unit_get_health (unit (list_get (players) 0))) 1)
(= (unit_get_health (unit srvr_check)) -1))
(begin
(set num7 0)
(set num6 0)
(set num5 0)
(set num4 0)
(set num3 0)
(set num2 0)
(set num1 0)
(set numhb 0)
)
)
)

(script continuous nohealth
(if
(or
(= (unit_get_health (unit (list_get (players) 0))) 0)
(= (unit_get_health (unit (list_get (players) 0))) -1))
(cinematic_screen_effect_stop)
)
)

(script continuous health7bar
(if
(and
(< (unit_get_health (unit (list_get (players) 0))) 1)
(>= (unit_get_health (unit (list_get (players) 0))) 0.876)
(!= (unit_get_health (unit (list_get (players) 0))) 0)
(!= (unit_get_health (unit (list_get (players) 0))) -1)
(= (unit_get_health (unit srvr_check)) -1)
(= num7 0))
(begin
(set num7 1)
(cinematic_screen_effect_start 1)
(cinematic_screen_effect_set_convolution 1 2 3 0 1.4)
)
)
)

(script continuous health6bar
(if
(and
(< (unit_get_health (unit (list_get (players) 0))) 0.875)
(>= (unit_get_health (unit (list_get (players) 0))) 0.751)
(!= (unit_get_health (unit (list_get (players) 0))) 0)
(!= (unit_get_health (unit (list_get (players) 0))) -1)
(= (unit_get_health (unit srvr_check)) -1)
(= num6 0))
(begin
(set num6 1)
(cinematic_screen_effect_start 1)
(cinematic_screen_effect_set_convolution 1 2 5 0 1)
)
)
)

(script continuous health5bar
(if
(and
(< (unit_get_health (unit (list_get (players) 0))) 0.75)
(>= (unit_get_health (unit (list_get (players) 0))) 0.626)
(!= (unit_get_health (unit (list_get (players) 0))) 0)
(!= (unit_get_health (unit (list_get (players) 0))) -1)
(= (unit_get_health (unit srvr_check)) -1)
(= num5 0))
(begin
(set num5 1)
(cinematic_screen_effect_start 1)
(cinematic_screen_effect_set_convolution 2 2 6 0 1.1)
)
)
)

(script continuous health4bar
(if
(and
(< (unit_get_health (unit (list_get (players) 0))) 0.625)
(>= (unit_get_health (unit (list_get (players) 0))) 0.501)
(!= (unit_get_health (unit (list_get (players) 0))) 0)
(!= (unit_get_health (unit (list_get (players) 0))) -1)
(= (unit_get_health (unit srvr_check)) -1)
(= num4 0))
(begin
(set num4 1)
(cinematic_screen_effect_start 1)
(cinematic_screen_effect_set_convolution 5 2 8 0 1.2)
)
)
)

(script continuous health3bar
(if
(and
(< (unit_get_health (unit (list_get (players) 0))) 0.5)
(>= (unit_get_health (unit (list_get (players) 0))) 0.376)
(!= (unit_get_health (unit (list_get (players) 0))) 0)
(!= (unit_get_health (unit (list_get (players) 0))) -1)
(= (unit_get_health (unit srvr_check)) -1)
(= num3 0))
(begin
(set num3 1)
(cinematic_screen_effect_start 1)
(cinematic_screen_effect_set_convolution 8 2 10 0 1.5)
)
)
)

(script continuous health2bar
(if
(and
(< (unit_get_health (unit (list_get (players) 0))) 0.375)
(>= (unit_get_health (unit (list_get (players) 0))) 0.251)
(!= (unit_get_health (unit (list_get (players) 0))) 0)
(!= (unit_get_health (unit (list_get (players) 0))) -1)
(= (unit_get_health (unit srvr_check)) -1)
(= num2 0))
(begin
(set num2 1)
(cinematic_screen_effect_start 1)
(cinematic_screen_effect_set_convolution 8 2 11 0 1.8)
)
)
)

(script continuous health1bar
(if
(and
(< (unit_get_health (unit (list_get (players) 0))) 0.25)
(>= (unit_get_health (unit (list_get (players) 0))) 0)
(!= (unit_get_health (unit (list_get (players) 0))) 0)
(!= (unit_get_health (unit (list_get (players) 0))) -1)
(= (unit_get_health (unit srvr_check)) -1)
(= num1 0))
(begin
(set num1 1)
(cinematic_screen_effect_start 1)
(cinematic_screen_effect_set_convolution 8 2 12 0 2.5)
)
)
)

(script continuous healthheartbeat
(if
(and
(< (unit_get_health (unit (list_get (players) 0))) 0.25)
(!= (unit_get_health (unit (list_get (players) 0))) 0)
(!= (unit_get_health (unit (list_get (players) 0))) -1)
(= (unit_get_health (unit srvr_check)) -1))
;This script repeats as there is no num variable changing
(begin
(if
(= numhb 0)
(begin
(set numhb 1)
(sleep 80)
)
)
(cinematic_screen_effect_start 1)
(cinematic_screen_effect_set_convolution 1 2 8 0 0.5)
(sleep 25)
)

)
)
I have modified it to look like this (found that some things Sapien can't compile):

(global short num7 0)
(global short num6 0)
(global short num5 0)
(global short num4 0)
(global short num3 0)
(global short num2 0)
(global short num1 0)
(global short numhb 0)

(script continuous zoom_true
(if
(= (player_action_test_zoom) true)
(begin
(cinematic_screen_effect_stop)
(player_action_test_reset)
)
)
)

(script continuous fullhealth
(if
(= (unit_get_health (unit (list_get (players) 0))) 1)
(begin
(set num7 0)
(set num6 0)
(set num5 0)
(set num4 0)
(set num3 0)
(set num2 0)
(set num1 0)
(set numhb 0)
)
)
)

(script continuous nohealth
(if
(or
(= (unit_get_health (unit (list_get (players) 0))) 0)
(= (unit_get_health (unit (list_get (players) 0))) -1))
(cinematic_screen_effect_stop)
)
)

(script continuous health7bar
(if
(and
(< (unit_get_health (unit (list_get (players) 0))) 1)
(>= (unit_get_health (unit (list_get (players) 0))) 0.876)
(!= (unit_get_health (unit (list_get (players) 0))) 0)
(!= (unit_get_health (unit (list_get (players) 0))) -1)
(= num7 0))
(begin
(set num7 1)
(cinematic_screen_effect_start 1)
(cinematic_screen_effect_set_convolution 1 2 3 0 1.4)
)
)
)

(script continuous health6bar
(if
(and
(< (unit_get_health (unit (list_get (players) 0))) 0.875)
(>= (unit_get_health (unit (list_get (players) 0))) 0.751)
(!= (unit_get_health (unit (list_get (players) 0))) 0)
(!= (unit_get_health (unit (list_get (players) 0))) -1)
(= num6 0))
(begin
(set num6 1)
(cinematic_screen_effect_start 1)
(cinematic_screen_effect_set_convolution 1 2 5 0 1)
)
)
)

(script continuous health5bar
(if
(and
(< (unit_get_health (unit (list_get (players) 0))) 0.75)
(>= (unit_get_health (unit (list_get (players) 0))) 0.626)
(!= (unit_get_health (unit (list_get (players) 0))) 0)
(!= (unit_get_health (unit (list_get (players) 0))) -1)
(= num5 0))
(begin
(set num5 1)
(cinematic_screen_effect_start 1)
(cinematic_screen_effect_set_convolution 2 2 6 0 1.1)
)
)
)

(script continuous health4bar
(if
(and
(< (unit_get_health (unit (list_get (players) 0))) 0.625)
(>= (unit_get_health (unit (list_get (players) 0))) 0.501)
(!= (unit_get_health (unit (list_get (players) 0))) 0)
(!= (unit_get_health (unit (list_get (players) 0))) -1)
(= num4 0))
(begin
(set num4 1)
(cinematic_screen_effect_start 1)
(cinematic_screen_effect_set_convolution 5 2 8 0 1.2)
)
)
)

(script continuous health3bar
(if
(and
(< (unit_get_health (unit (list_get (players) 0))) 0.5)
(>= (unit_get_health (unit (list_get (players) 0))) 0.376)
(!= (unit_get_health (unit (list_get (players) 0))) 0)
(!= (unit_get_health (unit (list_get (players) 0))) -1)
(= num3 0))
(begin
(set num3 1)
(cinematic_screen_effect_start 1)
(cinematic_screen_effect_set_convolution 8 2 10 0 1.5)
)
)
)

(script continuous health2bar
(if
(and
(< (unit_get_health (unit (list_get (players) 0))) 0.375)
(>= (unit_get_health (unit (list_get (players) 0))) 0.251)
(!= (unit_get_health (unit (list_get (players) 0))) 0)
(!= (unit_get_health (unit (list_get (players) 0))) -1)
(= num2 0))
(begin
(set num2 1)
(cinematic_screen_effect_start 1)
(cinematic_screen_effect_set_convolution 8 2 11 0 1.8)
)
)
)

(script continuous health1bar
(if
(and
(< (unit_get_health (unit (list_get (players) 0))) 0.25)
(>= (unit_get_health (unit (list_get (players) 0))) 0)
(!= (unit_get_health (unit (list_get (players) 0))) 0)
(!= (unit_get_health (unit (list_get (players) 0))) -1)
(= num1 0))
(begin
(set num1 1)
(cinematic_screen_effect_start 1)
(cinematic_screen_effect_set_convolution 8 2 12 0 2.5)
)
)
)

(script continuous healthheartbeat
(if
(and
(< (unit_get_health (unit (list_get (players) 0))) 0.25)
(!= (unit_get_health (unit (list_get (players) 0))) 0)
(!= (unit_get_health (unit (list_get (players) 0))) -1))
(begin
(if
(= numhb 0)
(begin
(set numhb 1)
(sleep 80)
)
)
(cinematic_screen_effect_start 1)
(cinematic_screen_effect_set_convolution 1 2 8 0 0.5)
(sleep 25)
)

)
)

Compiled that in Sapien, built the cache file in Tool and tested it, and it worked!

But here is the problem:

I turned it into a Halo PC map file using Harbinger and put it in the maps folder.
Whenever I tried to run Blood Gulch, the game crashed - exception!

Is it really that Halo PC MP maps don't support scripts, or I am doing something wrong?

Limited
August 2nd, 2010, 04:52 PM
Okay, what exactly did you 'create'?, all you did was remove this line.


(= (unit_get_health (unit srvr_check)) -1)Big whoop.

Also, how exactly is this MP, when you cannot edit an MP map and play it with people who dont have the map?

This is MP, works on any map.
avgGx5A5c1E

Inferno
August 2nd, 2010, 05:38 PM
No. No. No. No. No.

Do not port CE assets to stock maps that way.

Compile your map in CE with the new script in it.
Convert the header of the CE map to PC. ( forgot the offset for that )
Open PC Bloodgulch and your CE Bloodgulch in HMTv3.5
Extract the meta for the scenario from your bloodgulch.
Inject it over the meta of the stock bloodgulch.
???
Profit.


If that doesn't work (if scenario meta injection causes problems). Try to PMI Rebuilding to put the scenario in.

EagerYoungSpaceCadet
August 3rd, 2010, 04:26 AM
Uh, Limited, it's for Halo PC, not CE, I know that it wouldn't work in CE.

And Inferno, thanks for the tip, PMI rebuilding worked! (+ rep)


EDIT:Well, I can run the map, that's a start.
But there are some things that are really unusual: Sometimes I get random parts of my screen flashing in red, grey horizontal lines covering the game screen (but not the weapon), and most of the time the script does not check my health, but another player's health.
Is there a way to fix that?

staticchanger
August 3rd, 2010, 12:18 PM
Gonna have to say Limited's app makes more since than trying to script it in.

Inferno
August 3rd, 2010, 04:04 PM
Well the problem is that when another player joins the game it shifts the player list.

(player 0) and (player 1) aren't static they are dynamic.

EagerYoungSpaceCadet
August 4th, 2010, 01:56 AM
That's what has come to my mind!
Either figure out how the player numbers change, or make a program that checks the local health bar (Limited's app probably works that way)...

I don't know, and I bet I couldn't figure it out now, I am going on vacation...

See you later,


EagerYoungSpaceCadet

GAIGHER
August 4th, 2010, 03:23 PM
Good the script
I isolated the convolution effect
(when there 1bar of life)
And i think have synchronize for the Multiplayer , to tested ...

The Scripte

(script continuous coeur_convolution
(if
(and
(< (unit_get_health (unit (list_get (players) 0))) 0.25)
(!= (unit_get_health (unit (list_get (players) 0))) 0)
(!= (unit_get_health (unit (list_get (players) 0))) -1)
)
(begin
(cinematic_screen_effect_start 1)
(cinematic_screen_effect_set_convolution 1 2 6 0 0.5)
(sleep 14)
(cinematic_screen_effect_start 1)
(cinematic_screen_effect_set_convolution 1 2 9 0 0.5)
(sleep 11)
)
)
(if
(and
(< (unit_get_health (unit (list_get (players) 1))) 0.25)
(!= (unit_get_health (unit (list_get (players) 1))) 0)
(!= (unit_get_health (unit (list_get (players) 1))) -1)
)
(begin
(cinematic_screen_effect_start 1)
(cinematic_screen_effect_set_convolution 1 2 6 0 0.5)
(sleep 14)
(cinematic_screen_effect_start 1)
(cinematic_screen_effect_set_convolution 1 2 9 0 0.5)
(sleep 11)
)
)
(if
(and
(< (unit_get_health (unit (list_get (players) 2))) 0.25)
(!= (unit_get_health (unit (list_get (players) 2))) 0)
(!= (unit_get_health (unit (list_get (players) 2))) -1)
)
(begin
(cinematic_screen_effect_start 1)
(cinematic_screen_effect_set_convolution 1 2 6 0 0.5)
(sleep 14)
(cinematic_screen_effect_start 1)
(cinematic_screen_effect_set_convolution 1 2 9 0 0.5)
(sleep 11)
)
)
(if
(and
(< (unit_get_health (unit (list_get (players) 3))) 0.25)
(!= (unit_get_health (unit (list_get (players) 3))) 0)
(!= (unit_get_health (unit (list_get (players) 3))) -1)
)
(begin
(cinematic_screen_effect_start 1)
(cinematic_screen_effect_set_convolution 1 2 6 0 0.5)
(sleep 14)
(cinematic_screen_effect_start 1)
(cinematic_screen_effect_set_convolution 1 2 9 0 0.5)
(sleep 11)
)
)
(if
(and
(< (unit_get_health (unit (list_get (players) 4))) 0.25)
(!= (unit_get_health (unit (list_get (players) 4))) 0)
(!= (unit_get_health (unit (list_get (players) 4))) -1)
)
(begin
(cinematic_screen_effect_start 1)
(cinematic_screen_effect_set_convolution 1 2 6 0 0.5)
(sleep 14)
(cinematic_screen_effect_start 1)
(cinematic_screen_effect_set_convolution 1 2 9 0 0.5)
(sleep 11)
)
)
(if
(and
(< (unit_get_health (unit (list_get (players) 5))) 0.25)
(!= (unit_get_health (unit (list_get (players) 5))) 0)
(!= (unit_get_health (unit (list_get (players) 5))) -1)
)
(begin
(cinematic_screen_effect_start 1)
(cinematic_screen_effect_set_convolution 1 2 6 0 0.5)
(sleep 14)
(cinematic_screen_effect_start 1)
(cinematic_screen_effect_set_convolution 1 2 9 0 0.5)
(sleep 11)
)
)
(if
(and
(< (unit_get_health (unit (list_get (players) 6))) 0.25)
(!= (unit_get_health (unit (list_get (players) 6))) 0)
(!= (unit_get_health (unit (list_get (players) 6))) -1)
)
(begin
(cinematic_screen_effect_start 1)
(cinematic_screen_effect_set_convolution 1 2 6 0 0.5)
(sleep 14)
(cinematic_screen_effect_start 1)
(cinematic_screen_effect_set_convolution 1 2 9 0 0.5)
(sleep 11)
)
)
(if
(and
(< (unit_get_health (unit (list_get (players) 7))) 0.25)
(!= (unit_get_health (unit (list_get (players) 7))) 0)
(!= (unit_get_health (unit (list_get (players) 7))) -1)
)
(begin
(cinematic_screen_effect_start 1)
(cinematic_screen_effect_set_convolution 1 2 6 0 0.5)
(sleep 14)
(cinematic_screen_effect_start 1)
(cinematic_screen_effect_set_convolution 1 2 9 0 0.5)
(sleep 11)
)
)
(if
(and
(< (unit_get_health (unit (list_get (players) 8))) 0.25)
(!= (unit_get_health (unit (list_get (players) 8))) 0)
(!= (unit_get_health (unit (list_get (players) 8))) -1)
)
(begin
(cinematic_screen_effect_start 1)
(cinematic_screen_effect_set_convolution 1 2 6 0 0.5)
(sleep 14)
(cinematic_screen_effect_start 1)
(cinematic_screen_effect_set_convolution 1 2 9 0 0.5)
(sleep 11)
)
)
(if
(and
(< (unit_get_health (unit (list_get (players) 9))) 0.25)
(!= (unit_get_health (unit (list_get (players) 9))) 0)
(!= (unit_get_health (unit (list_get (players) 9))) -1)
)
(begin
(cinematic_screen_effect_start 1)
(cinematic_screen_effect_set_convolution 1 2 6 0 0.5)
(sleep 14)
(cinematic_screen_effect_start 1)
(cinematic_screen_effect_set_convolution 1 2 9 0 0.5)
(sleep 11)
)
)
(if
(and
(< (unit_get_health (unit (list_get (players) 10))) 0.25)
(!= (unit_get_health (unit (list_get (players) 10))) 0)
(!= (unit_get_health (unit (list_get (players) 10))) -1)
)
(begin
(cinematic_screen_effect_start 1)
(cinematic_screen_effect_set_convolution 1 2 6 0 0.5)
(sleep 14)
(cinematic_screen_effect_start 1)
(cinematic_screen_effect_set_convolution 1 2 9 0 0.5)
(sleep 11)
)
)
(if
(and
(< (unit_get_health (unit (list_get (players) 11))) 0.25)
(!= (unit_get_health (unit (list_get (players) 11))) 0)
(!= (unit_get_health (unit (list_get (players) 11))) -1)
)
(begin
(cinematic_screen_effect_start 1)
(cinematic_screen_effect_set_convolution 1 2 6 0 0.5)
(sleep 14)
(cinematic_screen_effect_start 1)
(cinematic_screen_effect_set_convolution 1 2 9 0 0.5)
(sleep 11)
)
)
(if
(and
(< (unit_get_health (unit (list_get (players) 12))) 0.25)
(!= (unit_get_health (unit (list_get (players) 12))) 0)
(!= (unit_get_health (unit (list_get (players) 12))) -1)
)
(begin
(cinematic_screen_effect_start 1)
(cinematic_screen_effect_set_convolution 1 2 6 0 0.5)
(sleep 14)
(cinematic_screen_effect_start 1)
(cinematic_screen_effect_set_convolution 1 2 9 0 0.5)
(sleep 11)
)
)
(if
(and
(< (unit_get_health (unit (list_get (players) 13))) 0.25)
(!= (unit_get_health (unit (list_get (players) 13))) 0)
(!= (unit_get_health (unit (list_get (players) 13))) -1)
)
(begin
(cinematic_screen_effect_start 1)
(cinematic_screen_effect_set_convolution 1 2 6 0 0.5)
(sleep 14)
(cinematic_screen_effect_start 1)
(cinematic_screen_effect_set_convolution 1 2 9 0 0.5)
(sleep 11)
)
)
(if
(and
(< (unit_get_health (unit (list_get (players) 14))) 0.25)
(!= (unit_get_health (unit (list_get (players) 14))) 0)
(!= (unit_get_health (unit (list_get (players) 14))) -1)
)
(begin
(cinematic_screen_effect_start 1)
(cinematic_screen_effect_set_convolution 1 2 6 0 0.5)
(sleep 14)
(cinematic_screen_effect_start 1)
(cinematic_screen_effect_set_convolution 1 2 9 0 0.5)
(sleep 11)
)
)
(if
(and
(< (unit_get_health (unit (list_get (players) 15))) 0.25)
(!= (unit_get_health (unit (list_get (players) 15))) 0)
(!= (unit_get_health (unit (list_get (players) 15))) -1)
)
(begin
(cinematic_screen_effect_start 1)
(cinematic_screen_effect_set_convolution 1 2 6 0 0.5)
(sleep 14)
(cinematic_screen_effect_start 1)
(cinematic_screen_effect_set_convolution 1 2 9 0 0.5)
(sleep 11)
)
)
)


I was not able fix the bug of scope :-3
(the texture of sight does not appear)
http://img375.imageshack.us/img375/9334/noscope.jpg


When I add

(player_action_test_zoom)
(cinematic_screen_effect_stop)
(player_action_test_reset)

In the "(begin"
like that:

(begin
(cinematic_screen_effect_start 1)
(cinematic_screen_effect_set_convolution 1 2 6 0 0.5)
(sleep 14)
(cinematic_screen_effect_start 1)
(cinematic_screen_effect_set_convolution 1 2 9 0 0.5)
(sleep 11)
(player_action_test_zoom)
(cinematic_screen_effect_stop)
(player_action_test_reset)
)

The scope flashes :raise: