Advertisement
FtDLulz

[Halo CE - TSC:E] Scripts in your map - FULL

Jun 12th, 2015
706
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 13.47 KB | None | 0 0
  1. [b]•--- Installing ---•[/b]
  2. First, you're going to have to make sure you downloaded the CMT scripts release AND the player bonus test scripts, both of which you can pick up from the posts http://forum.halomaps.org/index.cfm?page=topic&topicID=47823&start=811 and http://forum.halomaps.org/index.cfm?page=topic&topicID=47823&start=898. If you edited them and didn't make backups, re-download them as it'll just confuse you.
  3.  
  4. I'll be calling the scripts release folder the SRF and the bonus scripts release folder BSRF, for simplicity. Whenever the name of your map needs to be somewhere, I'll show it by typing MAPNAME.
  5.  
  6. Note that when using MAPNAME for this, it has to be less than 12 characters or script names become too long for Halo to process. It doesn't matter too much; if your MAPNAME is too long, just shorten it for this. It won't matter, as your actual map name and .scenario name can stay the same, this is just required for the folder names and find-replace we'll be doing.
  7.  
  8. Also, you should be using OS_Sapien and OS_Tool for your map to get this to work. If you don't, the map will not compile correctly.
  9.  
  10. You're also going to want to make sure that you have https://www.python.org/ftp/python/3.4.3/python-3.4.3.msi installed. And Notepad++ too, although you said you had that already.
  11.  
  12.  
  13. [b]•--- Folder and File Creation ---•[/b]
  14. Once you're done with all of that and have installed python, choose a location and create a folder named whatever you want (I'll be calling it MFOLDER, short for merged folder) and then copy (right-click drag) the 'scripts' folder in the SRF and the 'scripts' folder of the BSRF to the MFOLDER. Basically, create a folder somewhere, and then drag the scripts folders into it, dragging the SRF\scripts first and then the BSRF\scripts second, overwriting if it asks you to.
  15.  
  16. That was the easy part.
  17. Pay close attention, as this is where things get a bit complicated.
  18.  
  19. [b]•--- File Editing / Find-Replacing ---•[/b]
  20.  
  21. Open up the merged 'scripts' folder, the one that should be in MFOLDER. (The path\location of it should be MFOLDER\scripts.) Duplicate the 'hspp_test_pb.bat' file that's in that folder (copy, and then paste in the same location to 'duplicate') and name it 'hspp_MAPNAME.bat'. (If you don't see the .bat extension on the file names, do not include it when renaming the file. That just means you don't have view extensions enabled on your computer.)
  22.  
  23. Right click on your 'hspp_MAPNAME.bat' and edit it with Notepad++. Hold Ctrl + H and in Find, type in 'player_bonus_test' (without the two ' of course) and in Replace type in MAPNAME. Make sure 'Match case' is checked and 'Match whole word' is unchecked. Replace all.
  24.  
  25. This might get a bit confusing as I'm using 'MAPNAME' and 'mapname'. Remember, 'MAPNAME' in caps like that is where you put the name of your map. Do not do that for 'mapname' in lowercase.
  26.  
  27. Now, open up the 'src' folder, then go to the 'scenarios' folder. Duplicate the 'player_bonus_test' folder and name it 'MAPNAME'.
  28.  
  29. Here's where you drag the template files in. Open up the downloaded .zip, open up the mapfile_pb folder in there, and then drag everything into your 'MAPNAME' folder.
  30.  
  31. Go into that folder, and rename everything from 'mapname_pb_' to 'MAPNAME_'. Anything after the map name should be kept as it is. For example, 'mapname_pb_component.hsh' should be renamed to 'MAPNAME_component.hsh'. Note that anything WITHOUT the 'mapname_pb' in front of it should be kept the same. Open up the 'cmt_features' folder and do the same thing to the files in there.
  32.  
  33. Open up Notepad++. Hold Ctrl + Shift + F. In the find box, type 'MAPNAME_PB'.
  34. In the replace box, type 'MAPNAME'. (When you put in your map's name, put it in CAPS. Also, I don't think it allows hyphens [-].)
  35.  
  36. Make sure 'Match case' is checked, and 'Match whole word' is unchecked. The 'Filters' box should have *.* in it. You don't have to, but in that box you can type '*.hs *.hsh' to be safe(r).
  37.  
  38. Click the '...' button. Browse to the folder you duplicated and named MAPNAME, and select it as the directory. Replace in files. Confirm.
  39.  
  40. Now do Ctrl + Shift + F again. This time, type mapname_pb into the find box, and MAPNAME (this time, just put your map's name in lowercase) into the replace box. Replace in files. Confirm.
  41.  
  42. [b]•--- Preprocessing ---•[/b]
  43.  
  44. You're almost finished. Try double-clicking your 'hspp_MAPNAME.bat' file now. If it says cannot create output file, system cannot find the path specified, or anything similar, you've done something wrong. If it completes successfully you should be able to go to the MFOLDER\out and see your scenario folder there. Opening it up, and then opening the folder 'main', it should have about six .hsc files in it.
  45.  
  46. Those are the final script files that you'll drag into your Halo CE \data\levels\MAPNAME\scripts directory. We can symlink these so you don't have to drag them into your scripts directory every time you make a script change, but I'll talk about that later.
  47.  
  48. Here it gets a bit easier, but it's still quite tedious.
  49.  
  50. [b]•--- Level Globals ---•[/b]
  51.  
  52. Navigate to tags\cmt\scenarios\b30_revamp\ and copy the globals folder to tags\levels\MAPNAME. Rename everything in there to your liking. Open the .project_yellow file in OS_Guerilla. In the globals override box, change it to 'cmt\globals\evolved\evolved_altmc'. Change the scenario explicit references to the .tag_collection in the globals folder you copied. Click 'Open' next to that box. In the Tag References dropdown there should be three items. Select the first. Change the tag to the .effect_postprocess_collection in the globals folder you copied. Do the same for the next one, except it should be the .shader_postprocess_collection. Same for the last one, except use .actor_transform_collection (IIRC). Save and close Guerilla.
  53.  
  54. Now to get it working in your map.
  55.  
  56. [b]•--- Sapien Prep ---•[/b]
  57.  
  58. Open your map in OS_Sapien. Click 'Mission'. To the right, there's a box labelled 'project yellow definitions'. Click '...' and navigate to your globals folder you copied. Select the .project_yellow file. Save, but don't close yet.
  59.  
  60. You'll need a few objects in your map. The first, a flag named 'the_void'. Do that now, and place it in a place inaccessible to players.
  61.  
  62. Next, you'll need the following weapons in your map named the exact way I show. Do not include the 's, that's just to show where the name begins and ends. Doing this wrong will make your map not compile scripts. First is the path you'll find the weapon at in 'cmt\weapons', second is what you should name the placed weapon in Sapien.
  63.  
  64. • human\pistol\pistol.weapon - 'backpack_hp'
  65. • human\assault_rifle\assault_rifle.weapon - 'backpack_ar'
  66. • human\assault_rifle\_assault_rifle_grenade\assault_rifle_grenade - 'backpack_ar_gl'
  67. • human\battle_rifle\battle_rifle - 'backpack_br'
  68. • human\shotgun\shotgun - 'backpack_sg'
  69. • human\sniper_rifle\sniper_rifle - 'backpack_sr'
  70. • human\rocket_launcher\rocket_launcher - 'backpack_rl'
  71. • human\dmr\dmr - 'backpack_dmr'
  72. • human\pistol\spistol - 'backpack_spistol'
  73.  
  74. • covenant\plasma_pistol\plasma_pistol - 'backpack_pp'
  75. • covenant\plasma_rifle\plasma_rifle - 'backpack_pr'
  76. • covenant\needler\needler - 'backpack_ne'
  77. • covenant\carbine\carbine - 'backpack_cbn'
  78. • covenant\spiker\spiker - 'backpack_spkr'
  79. • covenant\brute_shot\brute_shot - 'backpack_bs'
  80. • covenant\shredder\shredder - 'backpack_shrd'
  81.  
  82. Another thing you might need if planning on vehicles in your map is a 'marker_test' object. It's an invisible scenery object, and can be found at 'tags\cmt\globals\_shared\empty_objects\empty_scenery.scenery'. Just put this in your map (it won't show up at all, not even a marker, from my experience) and name it 'marker_test'. If you accidentally click off of it, find it in the scenery list (it'll show as 'empty_scenery') and rename from there.
  83.  
  84. [b]•--- Vehicles ---•[/b]
  85. Putting vehicles into your map also requires a tad bit of script work.
  86. Any time you put a vehicle in, you're going to want to give it a good and unique name. Once done, open up the cmt_features folder in MFOLDER\scripts\src\scenarios\MAPNAME\cmt_features\. Open the MAPNAME_cmt_features.hs. In it, you'll find a script called MAPNAME_vehicle_updater. Find your respective vehicle under one of the helpfully labelled script comments. Duplicate what's there, uncomment it by deleting the ;; before it, and replace 'VEHICLE_name' with the name you named your vehicle. For example, if I placed a ghost in my map named 'casper', I'd duplicate ';;VEHICLE_UPDATE_GHOST(ghost_name)' and make it look like 'VEHICLE_UPDATE_GHOST(casper)'. The only time you DON'T need to do this is with a warthog. Don't ask why, I don't know.
  87.  
  88. Scroll down to 'MAPNAME_player_vehicle_updater'. Do the exact same as you did above, EVEN IF YOU HAVE A WARTHOG. Don't mind the comment saying obsolete, do it anyway. (That's my bad, too lazy to reupload.)
  89.  
  90. Now just save your scripts and you should be good to go.
  91.  
  92. [b]•--- Shades and Phantoms ---•[/b]
  93. Shades and phantoms are a bit different. Shades consist of two parts: the base (which is a device_machine) and the ball turret. When naming your shade turret, suffix it with _base or _ball, to make it easier to identify. Do the same things as above, except in the spot it says for the names, put the ball name first and a comma, then the base name. You don't have to do this for the PLAYER_UPDATE, just put the shade ball name.
  94.  
  95. Phantoms are the most different from them all. They consist of six parts: the base vehicle, the gravity lift, the two troop doors, and then the two gun doors (the middle of the troop doors). Each one needs to be specifically suffixed. When placing the doors in Sapien, suffix one with '_troop_l' and the other with '_troop_r'. Same thing with the gun doors, except suffix them with '_gun_l' and '_gun_r'. The gravity lift needs a suffix of '_grav'. I'm pretty sure you have to name them the same as the base vehicle, and adding the suffixes on to that name.
  96.  
  97. Example:
  98. • shade_name_ball
  99. • shade_name_base
  100. • VEHICLE_UPDATE_SHADE(shade_name_ball, shade_name_base)
  101.  
  102. Example:
  103. • phantom_name
  104. • phantom_name_grav
  105. • phantom_name_troop_r
  106. • phantom_name_troop_l
  107. • phantom_name_gun_r
  108. • phantom_name_gun_l
  109.  
  110. After doing that, just put the base name in the scripts like you would any other vehicle. You don't need a PLAYER_UPDATE for it, even though the default player can drive them (yes, they can!)
  111.  
  112. [b]•--- Armor Abilities (Modules?) ---•[/b]
  113. Armor abilities (I like modules better!) are device_control objects you can place down. To make them work, be sure to give them a name! Then, go into your cmt_features file, and scroll down until you see 'MAPNAME_player_am_updater'. Same thing as the vehicles above, copy one of the PLAYER_AM_TRY_PICKUP that you have in your map, and replace the first parameter (aa_ARMORABIL_name) with the name of your device_control armor module in your map. For example, if I had a visr in my map named 'odst_visr', I would copy ';;PLAYER_AM_TRY_PICKUP(aa_visr_name, PLAYER_AA_INDICES_VISR)' and make it say 'PLAYER_AM_TRY_PICKUP(odst_visr, PLAYER_AA_INDICES_VISR)'. Note that I did not change the second parameter. That basically tells the scripts what type of armor ability it is. Save the scripts and that should work as-is.
  114.  
  115. [b]•--- Health Blips ---•[/b]
  116. Above the armor ability script, you might've noticed 'MAPNAME_player_health_updater'. This has the ability to show waypoint blips when you're at low health and near a health object.
  117.  
  118. If you're using a .device_control health pack instead of an .equipment one, copy ';;PLAYER_HEALTH_DEVICE_TRY_PICKUP(health_name)' and replace the name to that of your device_control health pack in your map. If using a standard .equipment, or even a .device_control health or regeneration, duplicate ';;PLAYER_HEALTH_BLIP_OBJ_ADD(aa_health_name [or any object name])'. It doesn't matter which one, as long as you replace the parameter with the name of your health object. You can even use it for warthogs (as they carry two health packs)!
  119.  
  120. [b]•--- Map End ---•[/b]
  121.  
  122. I think that's it for the map. Every time you make a script change, be sure to run the .bat you made to preprocess them, and then compile scripts in Sapien.
  123. Tip: in Sapien, press ` for the console and type script_recompile. This is like compiling scripts but is a bit faster.
  124.  
  125. [b]•--- Symlinking ---•[/b]
  126. This can mess up your computer bad, so be very careful. I, of course, take no responsibility to what you screw up when using this.
  127.  
  128. 1. Download 'http://schinagl.priv.at/nt/hardlinkshellext/linkshellextension.html#download'.
  129.  
  130. 2. Install it.
  131.  
  132. 3. Go to out\scenarios\MAPNAME\main\.
  133.  
  134. 4. Select all of the .hsc files, and right click on one. Select 'Pick Link Source'.
  135.  
  136. 5. Go to your Halo root directory, and then data\levels\MAPNAME\scripts\.
  137.  
  138. 6. Right click, and then click 'Create Link As...'. Choose Symbolic Link.
  139.  
  140. 7. That should be it. You should see your .hsc files there, all zero bytes. When Sapien goes to compile scripts, it'll see those and find your actual .hsc scripts in the out\ directory. This means you don't have to drag them into your scripts folder every time you make a change. You do still have to run the .bat you made to preprocess them first.
  141.  
  142. [b]•--- End ---•[/b]
  143.  
  144. That should do it, I believe. If I missed anything, PLEASE let me know. I have to congratulate the Evolved team one last time. I may have made this needlessly a bit complicated, so if there are parts you get stuck on or need help, or even a place where I could make it less confusing or simplified, just reply and I'll do my best.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement