Guest User

Untitled

a guest
Apr 2nd, 2018
97
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 7.81 KB | None | 0 0
  1. Written by Borrie BoBaka / Helmed Raven
  2. April 2nd, 2018
  3.  
  4. There are X files that make up a singular structure in the game. In relevance to this, we'll be using the Generic Guild Hall as an example, but this applies to all structures.
  5.  
  6. 1. The POB File (Portal Object. This is the appearance entry for the object)
  7. appearance/ply_all_assoc_hall_civ_s01.pob
  8. 2. The MSH File (Mesh. We can edit what we need within SIE, no need for 3DS max or anything)
  9. appearance/mesh/ply_all_assoc_hall_civ_s01_r0_mesh_l0.msh
  10. 3. The LOD File (Level of Detail. This determines which model is used when you're far away, etc)
  11. appearance/lod/ply_all_assoc_hall_civ_s01_r0_mesh.lod
  12. 4. The Building IFF File (Object for the structure)
  13. object/building/player/shared_player_guildhall_generic_style_01.iff
  14. 5. The Deed IFF File (Object for the deed)
  15. object/tangible/deed/guild_deed/shared_corellia_guild_deed.iff
  16.  
  17. Then, we have multiple textures and shaders used by the mesh to determine its surface appearance. Since we're only editing the banners in this tutorial, we'll keep it simple. You're only going to need two files, of which we can use the originals as a template.
  18. A. A Texture DDS File
  19. texture/all_banner_assoc_a.dds
  20. B. A SHT (Shader) File.
  21. shader/all_banner_assoc_a_asb13.sht
  22.  
  23. Step 1: Create your custom Banner Texture
  24. My best advice is to just take the banner .dds, export it, and edit it in photoshop. DON'T WORRY ABOUT THE THREAD DETAILS, the game's shader will actually apply this automatically! Just worry about the colors, and maybe some background texture. After you're done, you'll want this texture to be uniquely named, and in the texture folder.
  25.  
  26. Step 2: Create a Shader File for that texture
  27. This is easy. Open the appropriate shader file in SIE, and find the NAME entry that is in the same tree as the DATA node "MAIN", for the Generic Guild Hall Banner's shader file, this is the first instance of NAME in the list. In this node, replace the original texture with the path of your new texture. For example, "texture/cool_new_banner.dds" - Save the file to the "shader" folder, and you're set.
  28.  
  29. Step 3: Create/Edit the MSH File
  30. This isn't as complicated as one might think. All you're doing here is swapping the shader reference from the original, to your new shader. This is the fourth NAME node, in 0004. You can use SIE's search function however and simply search for "banner" to find it. Once you've found the entry for the shader, simply replace the current entry with your new shader, i.e. "shader/cool_new_shader.sht". Save this in the path "appearance/mesh" and you're set!
  31.  
  32. Step 4: Create/Edit the LOD File
  33. Again, this is just simple work. Locate the three nodes called CHILD under the node DATA, and replace all the paths with your new mesh file. You can go back and add individual new meshes for different LODs, but here's the fact: This is a tedious process, might not look all that great, and in 2018, most computers will be absolutely and utterly fine dealing with a full level of detail Guild Hall, even at range and in mass. LOD really doesn't mean much anymore with this game. Save this file to the "appearance/lod" folder.
  34.  
  35. Step 5: Create/Edit the POB File
  36. This one might actually look intimidating, but its the exact same as before. Here we're going to find the first CELL node with the Name "r0", and like before, you can search in SIE for "r0" to locate it. Here, just replace ONLY the APPEARANCE field with your new lod file in full path, just like shown in the example file. This is all you need to do with the POB file. Save it to the "appearance" folder.
  37.  
  38. Step 6: Edit the Object IFF File
  39. Yet Another Simple Edit. Open the file and scroll down to the SHOT node, and under that, 0008. You'll need to scroll to the XXXX Node that is labled "portalLayoutFilename" - You'll need to replace the file path with your new structure, but THERE IS A CATCH! Notice that space infront of the appearance name? That's not actually a space, that's an unknown character that is vital to this object working. I don't know what it does yet, but we can replace the name of the file without losing it. I personally recommend selecting everything after "appearance/" and place in the correct file so it is all correct. Once again, save this in "object/building/player/", but with ANOTHER CATCH! (Not so simple, I guess?) you MUST have the prefix "shared_" infront of your file name. So, Super_Cool_Guild_Hall.iff must be saved as "shared_super_cool_guild_hall.iff". Once its done and saved, copy the full pathway of the file to a notepad or somewhere. You're going to need it.
  40.  
  41. Step 7: Create a Deed Object
  42. If you want players to actually place this object, and you want to be able to spawn in the deed for them to do that, you're going to need the deed as an entry in the TRE files. Unfortunately, we cannot make objects in SWG purely on server side, as far as I know. This part of the tutorial is super easy, though. All you need to do is copy the object, and rename it to something relevant, like shared_super_cool_guild_hall_deed.iff, and save it in the appropriate directory of "object/tangible/deed/guild_deed/". That's it. That's all that is needed for the deed object. Like Step 6, save the full path of this file. You'll need it for the next step.
  43.  
  44. Step 8: Add the object entries to the "object_template_crc_string_table.iff" table.
  45. Every object must have an entry in this table for the client, and the server, to recognize it. Failing to do so may result in crashes or invisible objects. To add these things, simply take the paths of any IFF objects added (In this case, the structure and the deed) and paste them into the large space below. You can do two at a time, if they're on different lines. Hit the Blue + button to add them. After they're added, save this new table to the "misc" folder. Include this in your patch.
  46.  
  47. Once all of that is done, you are all done with the TRE side of adding a guild hall! It is a bit tedious, but not overly difficult. Now, I'll show you how to add the objects to the server. This will require editing 6 Lua files in total.
  48.  
  49. Step 1. Create a new Lua file for the Structure
  50. This is located in "MMOCoreORB/bin/scripts/object/building/player". You'll want to copy the player_guildhall_generic_style_01.lua file, and name it to match the IFF File you named for the structure, but omit the "shared" prefix. Inside this file, simply rename the lua file variables on lines 44 and 74, to reflect your new structure's name, in the same style.
  51.  
  52. Step 2. Add this new object entry to the objects.lua file
  53. In that same folder, simply copy the entry of the building you originally copied, and do the same like you did in Step 1 of this process. Follow the naming conventions exactly. You'll notice that "shared" is used in this particular context.
  54.  
  55. Step 3. Add the new entry to the serverobjects.lua file
  56. Simply copy an existing entry, and replace the file name with your new file. That's it!
  57.  
  58. Step 4. Create the new Building Deed lua file
  59. Located in "MMOCoreORB/bin/scripts/object/tangible/deed/guild_deed/", will be the deed file of the building you copied. Copy this file, and open it up. Replace the top and bottom lines to match your new file names, and copy the syntax of these lines exactly. Unlike the building deed however, we need to alter the contents of this file to reflect our new structure. Simply replace the value for the variable "generatedObjectTemplate" (by default on line 47) to match the path of your new structure, sans the shared_ prefix.
  60.  
  61. Step 5. Repeat Steps 2 and 3, but instead do this for your new deed object.
  62.  
  63. And you're DONE! The structure is added and functional within your server. Simply spawn the deed using /object, and hand it out. You could make this craftable, but that's a whole new tutorial, and I don't really know much about that at the time of this writing, but I imagine it is all very similar to what we've done here.
  64.  
  65. Happy new banners!
Add Comment
Please, Sign In to add comment