A Community discussion forum for Halo Custom Edition, Halo 2 Vista, Portal and Halo Machinima

Home  Search Register  Login Member ListRecent Posts
  
 
»Forums Index »Halo Custom Edition (Bungie/Gearbox) »Halo CE General Discussion »Turning on Health with unit_set_maximum/current_vitality for player

Author Topic: Turning on Health with unit_set_maximum/current_vitality for player (7 messages, Page 1 of 1)
Moderators: Dennis

Dabouss 15x
Joined: Aug 9, 2016

Annnd Its Gone!


Posted: Jan 3, 2019 09:02 PM    Msg. 1 of 7       
After examining the scripts for The Pillar of Autumn i found how they turn the players health on and gradually increases using this script

*this was at top of script* (global bool mark_tutorial_hud_health false)

(hud_show_health true)
(hud_blink_health true)
(unit_set_maximum_vitality tutorial_hud_health 100.00 0.00)
(unit_set_current_vitality tutorial_hud_health 12.50 0.00)
(sleep 45)
(unit_set_current_vitality tutorial_hud_health 25.00 0.00)
(sleep 15)
(unit_set_current_vitality tutorial_hud_health 37.50 0.00)
(sleep 15)
(unit_set_current_vitality tutorial_hud_health 50.00 0.00)
(sleep 15)
(unit_set_current_vitality tutorial_hud_health 62.50 0.00)
(sleep 15)
(unit_set_current_vitality tutorial_hud_health 75.00 0.00)
(sleep 15)
(unit_set_current_vitality tutorial_hud_health 87.50 0.00)
(sleep 15)
(unit_set_current_vitality tutorial_hud_health 100.00 0.00)
(sleep 15)
(hud_blink_health false)


My question is how would I do the same? because after copying this into one of my script files it says tutorial_hud_health is not an object. So how would i change this so that it is the player who this happens to?


MatthewDratt
Joined: Sep 11, 2010

Newly redesigned MattDratt.com


Posted: Jan 3, 2019 10:38 PM    Msg. 2 of 7       
Add this to your script

(script static unit tutorial_hud_health
(unit (list_get (players) 0))
)


Dabouss 15x
Joined: Aug 9, 2016

Annnd Its Gone!


Posted: Jan 3, 2019 11:10 PM    Msg. 3 of 7       
I added it to my script but when trying to compile in sapien it just gave me this.

[scripts line 89] this is not a valid object name.: tutorial_hud_health 100.00 0.00)

recompiling scripts after scenarios were merged.

[scripts line 84] this left parenthesis is unmatched.: (script dormant health


MatthewDratt
Joined: Sep 11, 2010

Newly redesigned MattDratt.com


Posted: Jan 4, 2019 12:14 PM    Msg. 4 of 7       
Put it at the start


Dabouss 15x
Joined: Aug 9, 2016

Annnd Its Gone!


Posted: Jan 4, 2019 01:07 PM    Msg. 5 of 7       
Here is my current script right now

(global boolean mark_tutorial_hud_health false)

(global sound nightfall sound\music\ReachST\Nightfall\Nightfall)

(global sound package sound\music\ReachST\The_Package\The_Package)

(script static unit tutorial_hud_health
(unit
(list_get
(players) 0))
)

(script static boolean cinematic_skip_start
(begin
(cinematic_skip_start_internal)
(game_save_totally_unsafe)
(sleep_until
(not
(game_saving)) 1)
(not
(game_reverted))))

(script startup intro
(cinematic_start)
(switch_bsp 7)
(ai_allegiance human player)
(player_enable_input 0)
(camera_control 1)
(fade_in 1.00 1.00 1.00 60)
(sound_impulse_start package none 1)
(object_create patrol_a)
(ai_place cap_bridge_intro)
(ai_place nav_intro)
(ai_place tac_intro)
(vehicle_load_magic space_chair_1 "" (ai_actors nav_intro/nav_intro))
(vehicle_load_magic space_chair_2 "" (ai_actors tac_intro/tac_intro))
(camera_set intro_fly1 0)
(sleep 60)
(cinematic_set_title Introline1)
(device_set_position patrol_a 1.00)
(device_set_position patrol_b 1.00)
(camera_set intro_fly2 369)
(sleep 90)
(cinematic_set_title Introline2)
(sleep 369)
(fade_out 0 0 0 60)
(sleep 60)
(fade_in 0 0 0 90)
(camera_set intro_fly3 0)
(sleep 60)
(cinematic_set_title Introline3)
(camera_set intro_fly4 270)
(sleep 270)
(camera_set intro_close1 0)
(sleep 60)
(cinematic_set_title Introline4)
(camera_set intro_close2 150)
(sleep 120)
(camera_set intro_close3 60)
(sleep 30)
(camera_set intro_close4 90)
(sleep 60)
(camera_set intro_close5 120)
(sleep 120)
(cinematic_set_title Introline5)
(sleep 60)
(fade_out 1 1 1 120)
(sleep 120)
(ai_erase cap_bridge_intro)
(ai_erase tac_intro)
(ai_erase nav_intro)
(sound_impulse_stop sound\music\ReachST\The_Package\The_Package)
(switch_bsp 1)
(camera_control 0)
(player_enable_input 1)
(cinematic_stop)
(switch_bsp 0)
)

(script dormant music
(sound_impulse_start nightfall none 1)
)

(script dormant health
(sleep_until mark_tutorial_hud_health 1)
(wake music)
(hud_show_health true)
(hud_blink_health true)
(unit_set_maximum_vitality tutorial_hud_health 100.00 0.00)
(unit_set_current_vitality tutorial_hud_health 12.50 0.00)
(sleep 45)
(unit_set_current_vitality tutorial_hud_health 25.00 0.00)
(sleep 15)
(unit_set_current_vitality tutorial_hud_health 37.50 0.00)
(sleep 15)
(unit_set_current_vitality tutorial_hud_health 50.00 0.00)
(sleep 15)
(unit_set_current_vitality tutorial_hud_health 62.50 0.00)
(sleep 15)
(unit_set_current_vitality tutorial_hud_health 75.00 0.00)
(sleep 15)
(unit_set_current_vitality tutorial_hud_health 87.50 0.00)
(sleep 15)
(unit_set_current_vitality tutorial_hud_health 100.00 0.00)
(sleep 15)
(hud_blink_health false)
(set mark_tutorial_hud_health true)))

(script startup cryobay
(fade_in 1 1 1 60)
(hud_show_health false)
(hud_show_motion_sensor false)
(hud_show_shield false)
(sleep_until
(volume_test_objects health
(players)) 15)
(wake health)
)


DeadHamster
Joined: Jun 8, 2014


Posted: Jan 4, 2019 05:10 PM    Msg. 6 of 7       
From the script you show Bungie used a global and not a Static script.

People use static scripts because in modern maps they may switch the players biped to accomplish certain tasks via script that are otherwise not possible. Also, in multiplayer maps the player's position in the list (players) changes as users join and quit. For that reason, a static script is preferred; as opposed to assigning once like a global script does, it's instead assigned each time it's referenced.

However, the syntax for using a static script is different then a global value, so bungie's original script needs a tweak;

Anywhere there is tutorial_hud_health, replace it with (tutorial_hud_health)

That's all.


Dabouss 15x
Joined: Aug 9, 2016

Annnd Its Gone!


Posted: Jan 4, 2019 05:46 PM    Msg. 7 of 7       
Thanks, it worked! I guess the syntax has changed since the game came out.

 

 
Previous Older Thread    Next newer Thread







Time: Mon January 21, 2019 10:12 PM 344 ms.
A Halo Maps Website