Quote: --- Original message by: Xoronatus
lte's say I have an encouunter in Sapien called "blah." If I want the player to be able to play that encounter on any difficulty, do I have to make 4 different encounters and script an individual encounter to play on a certain difficulty, or do I only need 1 encounter to act for all of the difficulty levels?
You only need to create one encounter for all the difficulties. "game_difficulty_set" just tells the ai how to operate and how much damage they deal out.
You can though have only certain things happen on legendary though. For instance take a look at the d40 script:
(script static "void" x70_finale
(cinematic_suppress_bsp_object_creation true )
(player_effect_start 1 0 )
(player_effect_set_max_translation 0 0 0 )
(player_effect_set_max_rotation 0 0 0 )
(player_effect_set_max_rumble 0 0 )
(sound_looping_start "sound\sinomatixx_music\x70_music" none 1 )
(sound_looping_start "sound\sinomatixx_foley\x70_foley1" none 1 )
(object_destroy_containing "nipple" )
(fade_out 1 1 1 50 )
(sleep 30 )
(cinematic_start )
(camera_control true )
(switch_bsp 7 )
(object_teleport (player0 )player0_finale_pause )
(object_teleport (player1 )player1_finale_pause )
(unit_suspended (player0 )true )
(unit_suspended (player1 )true )
(hangar_1 )
(hangar_2 )
(sound_class_set_gain "weapon_fire" 0 0 )
(sound_class_set_gain "projectile_detonation" 0 0 )
(sound_class_set_gain "projectile_impact" 0 0 )
(sound_class_set_gain "unit_dialog" 0 0 )
(hangar_3 )
(if (= easy (game_difficulty_get_real ))(begin (switch_bsp 8 )(launch_1 )
(sound_class_set_gain "unit_footsteps" 0 0 )
(launch_2 )
(fade_out 0 0 0 0 )
(switch_bsp 9 )
(fade_in 0 0 0 0 )
(rasterizer_model_ambient_reflection_tint 1 1 1 1 )
(int_1 )
(space_1 )
(fade_in 1 1 1 15 )
(int_2 )
(space_2 )
(int_3 )
(space_3 )
(int_4 )
(fade_out 0 0 0 120 )
(sleep 520 )
(cinematic_screen_effect_stop )
(rasterizer_model_ambient_reflection_tint 0 0 0 0 )(print "cue credits" )))
(if (= normal (game_difficulty_get_real ))(begin (switch_bsp 8 )(launch_1 )
(sound_class_set_gain "unit_footsteps" 0 0 )
(launch_2 )
(fade_out 0 0 0 0 )
(switch_bsp 9 )
(fade_in 0 0 0 0 )
(rasterizer_model_ambient_reflection_tint 1 1 1 1 )
(int_1 )
(space_1 )
(fade_in 1 1 1 15 )
(int_2 )
(space_2 )
(int_3 )
(space_3 )
(int_4 )
(fade_out 0 0 0 120 )
(sleep 520 )
(cinematic_screen_effect_stop )
(rasterizer_model_ambient_reflection_tint 0 0 0 0 )(print "cue credits" )))
(if (= hard (game_difficulty_get_real ))(begin (switch_bsp 8 )(launch_1 )
(sound_class_set_gain "unit_footsteps" 0 0 )
(launch_2 )
(fade_out 0 0 0 0 )
(switch_bsp 9 )
(fade_in 0 0 0 0 )
(rasterizer_model_ambient_reflection_tint 1 1 1 1 )
(int_1 )
(space_1 )
(fade_in 1 1 1 15 )
(int_2 )
(space_2 )
(int_3 )
(space_3 )
(int_4 )
(fade_out 0 0 0 120 )
(sleep 520 )
(cinematic_screen_effect_stop )
(rasterizer_model_ambient_reflection_tint 0 0 0 0 )(print "cue credits" )))
(if (= impossible (game_difficulty_get_real ))(begin (print "happy easter" )(switch_bsp 8 )
(happy_easter )
(switch_bsp 9 )
(fade_in 0 0 0 0 )
(rasterizer_model_ambient_reflection_tint 1 1 1 1 )
(int_1 )
(space_1 )
(fade_in 1 1 1 15 )
(int_2 )
(space_2 )
(int_3 )
(space_3 )
(int_4 )
(fade_out 0 0 0 120 )
(sleep 520 )
(cinematic_screen_effect_stop )
(rasterizer_model_ambient_reflection_tint 0 0 0 0 )(print "cue credits" ))))
This is the script for all of the different endings on d40, including the legendary ending in the halo campaign. Notice the parts I bolded. It is a "if" statement. Basically saying:
"If the game is on easy difficulty execute this ending cutscene"
"If the game is on normal difficulty execute this ending cutscene"
"If the game is on hard difficulty execute this ending cutscene"
"If the game is on impossible difficulty execute this ending cutscene"
You could do this with anything, encounters, cutscenes, weapons, equitment, vehicles, ect.
But do not be confused with the fact that you cannot switch the difficulties against the AI mid-game.
I can go more in-depth with this if you need me too.
Edit: There is obviously a lot more to the script than just that, I shortened it for times sake.
Edited by pepzee on Jul 7, 2011 at 12:59 AM