Warningshot3
January 28th, 2008, 10:04 PM
Is it possible? Yes it is!
Ok this is what I did.
1st I created a new scenario file with h2tool because tool includes one script. the only visable scripts in h2sapien with the debug_scripting is startup ones, HG must have made the others invisible to try and stop us but don’t be fooled they are there.
2nd I opened the scenario in h2sapien
3rd I opened winhex and opened up the ram, h2sapien, entire memory.
4th found the offset to the hex value that holds the size of the pre compiled scripts, it was 3C, changed it to 01FF, saved winhex, went to sapien and saved that too. (see h2sapien fragments the scenario file in the ram so when I changed the hex value and saved sapien it would go pass the end of the fragmented part and take extra bytes with it and then restructures the .scenario file with the extra 65000 bytes. Much faster then having to do it manually. Luckily for me the fragmented part ended right after the existing script in the scenario otherwise this wouldn’t work.
5th I opened up the .scenario file into winhex and zeroed out the extra bytes in the script area. It starts with (script static unit player0 (unit (list_get (players) 0))) and ended about 65000 bytes later.
6th I entered my stupidly long scripts into the zeroed out area and made sure that there is no 00 terminators in the script area, the 00 hex value will make sapien stop reading the scipts. Oh yeah I then saved winhex.
My stupidly long script
(script static unit player0 (unit (list_get (players) 0)))
(script static void cinematic_fade_from_white_bars
(begin
(cinematic_stop)
(cinematic_show_letterbox_immediate True)
(camera_control False)
(fade_in 1 1 1 15)
(sleep 15)
(player_enable_input True)
(player_camera_control True)
)
)
(script startup mission_01a
(begin
(player_disable_movement false)
(player_camera_control true)
(if (game_is_cooperative)
(game_won))
(objectives_clear)
(ai_allegiance player human)
(fade_out 1 1 1 0)
(hud_enable_training False)
(ai_dialogue_enable False)
(unit_set_maximum_vitality (player0) 30 1)
(camera_control true)
(sleep 1)
(cache_block_for_one_frame)
(sleep 2)
(cinematic_fade_from_white_bars)
(hud_cinematic_fade 1 0.5)
(cinematic_show_letterbox False)
)
)
7th fired up h2sapien and did “debug_scripting 1”, “script_recompile” and sometimes I do “run_game_scripts” if I need to test the scipts. I then saved h2sapien.
8th built a cache file aka packaged the level, put it into h2 vista map directory and replaced a singleplayer map, opened up h2, loaded up the map and blam! a working singleplayer map.
The only way to quit the map is to quit h2, that’s cuz I don’t have the sp UI tags and even if I did h2tool wont add them to the map cuz im packaging the map as multiplayer and that’s the only kind of map h2tool allows.
Ok this is what I did.
1st I created a new scenario file with h2tool because tool includes one script. the only visable scripts in h2sapien with the debug_scripting is startup ones, HG must have made the others invisible to try and stop us but don’t be fooled they are there.
2nd I opened the scenario in h2sapien
3rd I opened winhex and opened up the ram, h2sapien, entire memory.
4th found the offset to the hex value that holds the size of the pre compiled scripts, it was 3C, changed it to 01FF, saved winhex, went to sapien and saved that too. (see h2sapien fragments the scenario file in the ram so when I changed the hex value and saved sapien it would go pass the end of the fragmented part and take extra bytes with it and then restructures the .scenario file with the extra 65000 bytes. Much faster then having to do it manually. Luckily for me the fragmented part ended right after the existing script in the scenario otherwise this wouldn’t work.
5th I opened up the .scenario file into winhex and zeroed out the extra bytes in the script area. It starts with (script static unit player0 (unit (list_get (players) 0))) and ended about 65000 bytes later.
6th I entered my stupidly long scripts into the zeroed out area and made sure that there is no 00 terminators in the script area, the 00 hex value will make sapien stop reading the scipts. Oh yeah I then saved winhex.
My stupidly long script
(script static unit player0 (unit (list_get (players) 0)))
(script static void cinematic_fade_from_white_bars
(begin
(cinematic_stop)
(cinematic_show_letterbox_immediate True)
(camera_control False)
(fade_in 1 1 1 15)
(sleep 15)
(player_enable_input True)
(player_camera_control True)
)
)
(script startup mission_01a
(begin
(player_disable_movement false)
(player_camera_control true)
(if (game_is_cooperative)
(game_won))
(objectives_clear)
(ai_allegiance player human)
(fade_out 1 1 1 0)
(hud_enable_training False)
(ai_dialogue_enable False)
(unit_set_maximum_vitality (player0) 30 1)
(camera_control true)
(sleep 1)
(cache_block_for_one_frame)
(sleep 2)
(cinematic_fade_from_white_bars)
(hud_cinematic_fade 1 0.5)
(cinematic_show_letterbox False)
)
)
7th fired up h2sapien and did “debug_scripting 1”, “script_recompile” and sometimes I do “run_game_scripts” if I need to test the scipts. I then saved h2sapien.
8th built a cache file aka packaged the level, put it into h2 vista map directory and replaced a singleplayer map, opened up h2, loaded up the map and blam! a working singleplayer map.
The only way to quit the map is to quit h2, that’s cuz I don’t have the sp UI tags and even if I did h2tool wont add them to the map cuz im packaging the map as multiplayer and that’s the only kind of map h2tool allows.