Skip to content

How To Add New Housing

IrishDarkshadow edited this page Oct 2, 2019 · 1 revision

=============================================================== Original discussion thread text for search result purposes:

SWGSOURCE FORUMS MARK FORUMS READ SEARCH FORUMS SUBSCRIBED FORUMS SUBSCRIBED THREADS NEW THREADS SHOWCASESWG FILESMEMBERSCHAT1 / 5 /

Forums SWG NGE Source Server Development FAQ & Guides How To: Add New Housing (i.e. TCG Houses NOT in game) Discussion in 'FAQ & Guides' started by Cekis, May 26, 2017.

Subscribe to Thread Cekis Cekis Well-Known Member Joined:Sep 3, 2016 Messages:93 Likes Received:32 #1Cekis, May 26, 2017 Last edited: May 27, 2017 THIS IS NOT A COMPLETE GUIDE... lots needs to be done to ensure it's possible. However, this should get you started and get you MOST of the way there.

While chatting today I decided to see if the missing houses could be added easily. Well, I wouldn't call it easy, but I would call it detailed and potentially problematic. I don't have the patience or the time right now to see this through, but if you want to take a stab at it, this is what I found out when trying to add Yoda's Hut to the game.

First, we need to somehow recreate the missing files from their compiled versions that live in the client TRE files.

Since they're not in the codebase, you will need to pull them from the Client side files stored in the TRE files. Some research using Sytner's IFF Editor (SIE) shows that the Yoda Hut is found in patch_55_shared_00.tre. In that patch file, you'll see we need to add several new files to the codebase. But how do you find them? One rule I've learned is, "always start with object/tangible"... we know it's a player structure, and we know it's a TCG item... so let's start in the TCG folder structure in object/tangible, specifically our series folder (which remember from above is "series8"). Boom... there is a file in that folder called, "shared_deco_yoda_house.iff"... we know from experience that we should have a corresponding file in our sys.server folder structure so let's go create that first. Create a new file in dsrc/sku.0/sys.server/compiled/game/object/tangible/tcg/series8/deco_yoda_house.tpf . Using existing housing in game (i.e. the Diner, Relaxation Pool, etc) we can use these as starting points to mirror from. Let's choose the Diner for our example. Copy the contents from the Diner's version of this file (found in the series1 folder) which is "shared_structure_deed_diner.tpf" into the new yoda version you just created. Next, let's make sure our structure mirrors that of the Diner's files.

Open dsrc/sku.0/sys.server/compiled/game/object/tangible/tcg/series1/structure_deed_diner.tpf You'll first need to create a NEW file for Yoda's house... let's make sure we put it in a new folder for the Series 8 TCG stuff at the same level as the other series folders... call it "series8". Just copy/paste the contents from the diner's file in that new file you created in the new series8 folder. Name it structure_deed_yoda_house.tpf In the Diner's file you'll see a reference to a "sharedTemplate"... this is the template that exists in the sys.shared structure and as it is also "SHARED" with the client template. (things that exist in both server and client are considered "shared" and link to both in one way or another). In your new file, first change the sharedTemplate to match: sharedTemplate = "object/tangible/tcg/series8/shared_structure_deed_yoda_house.iff" Now go to the sys.shared structure: dsrc/sku.0/sys.shared/compiled/game/object/tangible/tcg/ Add a NEW folder in that directory called "series8". Add a NEW file in that directory called shared_structure_deed_yoda_house.iff Copy the contents from the diner's version of that file (again, still in the sys.shared side of things), "series1/shared_structure_deed_diner.iff" into the contents of the yoda file from the previous step. This file has 2 settings we need to change. The first setting is the "objectName"... This is the name of the object as derived from the client string files (that also exist in the TRE's)... looking at the TRE's we can derive what this value SHOULD be (more covered on this later): item_tcg_loot_reward_series8_yoda_house_deed The second setting, "detailedDescription" is also a reference to the client side string files. It should be changed to item_tcg_loot_reward_series8_yoda_house_deed The third setting is a reference to the appearance file... this is what the deed will look like in game. You can use SIE to determine what appearance you want it to use, but for now, let's stick with the default deed look. We're now done with this part of the effort. Ok, now that we have the beginning structure in place I would say that we can be done, but there’s more to adding a structure to the game than that.

The game needs reference points. It needs references to the deed (which we’ve given it already), but it also needs references to the house that the deed generates. Therefore, we need to connect the deed to a physical house… and construction of that house (the red box and terminal that shows up when you generate a house from a deed)… and entry to the house… and rooms heights, elevators, signs and terminal locations… etc.

First things first… let’s make sure the deed correctly shows the construction markers when generated. We’ll need to copy what the Diner does to do this:

Let’s first open the player_structure.tab and make sure the game knows how to build the house. Open dsrc/sku.0/sys.server/compiled/game/datatables/structure/player_structure.tab Add a new line, copying from what is listed for the diner, and change the following values: Change the first value to object/building/player/player_house_tcg_8_yoda_house.iff . This is the structure template file. Change the next value to object/building/player/construction/construction_player_house_tcg_8_yoda_house.iff This is the construction template file. Change the “Lot_Reduction” value to “2” – this should be how many lots are deducted when placed. Change the “Eject_Range” value to 32. Change the “Maint_Rate” to 13. This is how much the building costs in maintenance. Adjust the other values as you see fit. On the next line, the terminal is defined. Play with the values and make sure it’s in the right cell (should probably be “entry”) in order to spawn it correctly as it likely doesn’t spawn correctly when using the diner’s values. Come back to this once you can place the building. Once the building is placed, you'll be able to first see what room/cell the terminal SHOULD be in (by using Ctrl-Shift-G when in game) and then you can figure out where you'd like to place it (i.e. by figuring out coordinates when in game). If you plan to hang signs, you’ll need to add values in the “player_structure_sign.tab” file in the same folder. I’ll leave this for experimentation, but remember sign placement is also done by the code as well depending on what building it's being placed on. The exact script that controls this escapes me at the moment - do a file search for the template name of the sign you wish to hang and you'll likely find it. Open the Diner’s construction file located here: dsrc/sku.0/sys.server/compiled/game/object/building/player/construction/construction_player_diner.tpf Create a new file for Yoda’s Hut in the SAME folder… name it construction_player_tcg_8_yoda_house.tpf Copy the contents of the diner’s construction file into the new Yoda construction file you just created. You’ll need to change 1 property setting in this file called, “sharedTemplate” Make sure it’s set to object/building/player/construction/shared_construction_player_tcg_8_yoda_house.iff Now, go to that location and create a new file there with the same name as that setting. You’ll find it in dsrc/sku.0/sys.shared/compiled/game/object/building/player/construction Again, copy the contents from the diner’s version of this file into the new file you just created in the previous step. In this file you’ll notice a few things… first, it has a reference to a “footprint” file called “structureFootprintFileName”. This is the reference to the actual footprint (the space the building takes up on the ground when under construction – the red box) for the building. You’ll see a few other properties in this file, but you don’t need to change any of them as they all pertain to ONLY the construction phase and are temporary. We need to figure out what our name SHOULD be for our footprint… so… back to the patch_56 TRE file. The patch_56 TRE file shows a file in that folder called footprint/building/player/shared_player_house_tcg_yoda_house.sfp so make sure “structureFootprintFileName” is set to this value. Let’s go create that file in our sys.shared folder structure. Create a new file in dsrc/sku.0/sys.shared/compiled/game/footprint/building/player called, shared_player_house_tcg_yoda_house.mif (notice the new “MIF” extension? Good!). This file is essentially the “template” for the client side version of the file… it specifies what the fields are and what values should be stuffed into those fields. Copy the contents of the Diner’s version into this file and let’s get to work! First, all values will need to be modified here. Let’s open SIE again and look at the footprint file, footprint/building/player/shared_player_city_diner.spf to get an understanding of the values and how they work. Make sure you actually have the patch files AND the TOC versions of them in the same folder or else you won’t actually be able to view them in SIE. Looking at the diner file in SIE we see the structure has a FOOT element, a 0000 element, a INFO element and a PRNT element. Wow, so does our footprint file in our codebase! You guessed it, they line up nicely with the hex values in the footprint compiled file. Yoda’s footprint file shows the following values: Width is 5. Height is 5. Pivot X is 2. Pivot Y is 2. Since the float values are 8.0 in the diner’s file and the float hex is the same between diner and yoda’s house, I’m making an assumption they should not be changed from 8.0 (but don’t expect me to figure out why right now). Make sure the “PRNT” element is structured the same way as it shows in the SPF file… basically, you should have 5 cstring values each set to “HFFFFFH”. Next, we need to also make sure the Construction Restriction file is set appropriately (this was learned when I was modifying the “item_stats.tab” file) Create a file in the dsrc/sku.0/sys.server/compiled/game/building/player/city folder called yoda_house_no_planet_restriction.tpf and copy the Diner’s file version contents into it (diner’s file version is “diner_no_planet_restriction.tpf”). Change the “sharedTemplate” to be “object/building/player "/city/shared_yoda_house_no_planet_restriction.iff” Go create that file in dsrc/sku.0/sys.shared/compiled/game/object/building/player/city Copy the diner’s shared version into that new file. Next, we need to change the “hooks” into the client files to now point to the correct things. Change “structureFootprintFileName” to equal “footprint/building/player/shared_player_city_yoda_house.sfp” (note, this file may not actually exist in the client files) Change “portalLayoutFilename” to equal "appearance/poi_all_yoda_house.pob” (per looking in patch_56’s appearance folder and seeing what other files live there) Change “objectName” to equal “building_name” and “player_house_tcg_8_yoda_house_n” (this is a string value tied into the client string file: “string/en/building_name.stf”) Change “detailedDescription” to equal “building_detail” and “player_house_tcg_8_yoda_house_d” (this is a string value tied into the client string file: “string/en/building_detail.stf”) Change “lookAtText” to equal “building_name” and “player_house_tcg_8_yoda_house_d” Change “clientDataFile” to equal “clientdata/building/shared_player_house_tatooine_small_style_01.cdf”. Here’s where things get a bit dicey… basically, there is no clientdatafile for the Yoda house (I couldn’t find one anyway), so we’re going to use another file in place of it and HOPE that it works. We’re now done with the Construction Phase file mods.

On to the BUILDING itself…

This is where I went, “Hmm… ok, this is stuff I don’t want to necessarily dive into”. But… let me get you started down the path.

The most difficult thing is knowing how to create a final structure in game. Each structure has a set entry, set cells, some have elevators, etc. Cell heights come in to play as well (think of the Naboo structures and how high their ceilings are. So, here’s what I found:

First, create an entry for the building in the master_item.tab file. Copy what the diner has and adjust accordingly: First cell should be the name that you use to generate the deed: item_tcg_loot_reward_series8_yoda_house Next cell should be the name of the template that is generated: object/tangible/tcg/series8/deco_yoda_house.iff Change the text, “Structure Deed: Diner” to “Structure Deed: Yoda House” Change the description (the stuff in quotes) to whatever you want. Next, create an entry in the item_stats.tab file. Again, copy what the diner has and adjust accordingly: First cell should be the name that you use to generate the deed: “item_tcg_loot_reward_series8_yoda_house” Next cell should be the construction restriction file: Code:Select All "string/player_structure.deed.template=object/building/player/city/yoda_house_no_planet_restriction.iff,int:player_structure.deed.buildtime=90" You’ll need to modify the cell heights if they don’t line up properly (or the house doesn’t spawn). Modify dsrc/sku.0/sys.server/compiled/game/datatables/structure/cell_height.tab and add a line for the floor height and the ceiling height. Since it’s a small structure, my guess is you can use what is set for a generic single story Tatooine house (roughly 4.6 max, 0.75 min). Next, modify the ejection point table, dsrc/sku.0/sys.server/compiled/game/datatables/pob/pob_ejection_point.tab and add a line for the Yoda House that tells the game where to put people when they’ve been ejected from the house (i.e. a house that has been suddenly marked private). Copy what is there for the diner and adjust the filenames appropriately (you may need to play with the values to get it to work right).

That should get the building to spawn in game… you’ll need to give it the regular spawn commands to spawn it… remember you need to recompile all of the TPF’s, MIF’s, etc to make things work properly. You can find this info out in the SB guides posted earlier…

Happy Adding! REPORT BOOKMARKLIKE + QUOTE REPLY Erusman and IrishDarkshadow like this. Erusman Erusman Well-Known Member Joined:May 9, 2016 Messages:673 Likes Received:298 #2Erusman, May 26, 2017 Last edited: May 26, 2017 Awesome job with making this guide. Yeah a lot of the later TCG items were added via patch updates from SOE as you noted. I have some later client and shared patches 58, 59, etc. I have to look but I have a complete client from Dec 2011 when they shut the servers down. Its basically the same if you download projectswg client. They have everything from final.

One thing I noticed with SB latest client (its the same as v2.1 of NGE one I posted for everyone); I noticed you guys added after patch_55 a patch_70? Is this a custom consolidated .tre you guys put together? I haven't had a chance to look to see its contents.

Plus, it is possible if we fix or modify the dsrc server-side. You can compress those server files to .sot and load entire client from them. This was first introduced in the win32 build and v1.6 NGE client I uploaded. Darth later implemented those changes that I introduced and had the SB server run from 6 .sot files. Essentially this cuts down on patches and ensures the greatest compatibility. Client would load from 6 .sot files. And actually loads faster. Something to think about. One theory I had was to go in and modify the compression technique to just one huge 4gb .sot file. Your entire server and client would run from just that one file. Your NGE client folder would basically have just a dozen files in it. (1 .sot; 5 .cfg; 4 .dll; 2 .exe) REPORT BOOKMARKLIKE + QUOTE REPLY Cekis Cekis Well-Known Member Joined:Sep 3, 2016 Messages:93 Likes Received:32 #3Cekis, May 27, 2017 Patch 70 was a patch I created, but it was never updated properly so it's out of date (I still have the latest). It basically takes things from patch_56 and adds them to the game... we fixed a lot of issues this way (but I'm drawing a blank on what exactly). It allowed me to pick and choose without trumping other things found in patch_56 that did not need updating.

I won't be making SOT's... I don't believe in them. :p Reasons why is because of what you just stated... you have to re-download the entire thing with each update (each updated SOT) which would be a MUCH LARGER download than the individual patch files... we're still too fluid on that in order to make a single large package. So, I dig the patch files that SOE originally came up with FOR NOW. I know others feel otherwise, but I'm just not a fan of that method YET. REPORT BOOKMARKLIKE + QUOTE REPLY Erusman Erusman Well-Known Member Joined:May 9, 2016 Messages:673 Likes Received:298 #4Erusman, May 27, 2017 Cekis said: ↑ Patch 70 was a patch I created, but it was never updated properly so it's out of date (I still have the latest). It basically takes things from patch_56 and adds them to the game... we fixed a lot of issues this way (but I'm drawing a blank on what exactly). It allowed me to pick and choose without trumping other things found in patch_56 that did not need updating.

I won't be making SOT's... I don't believe in them. :p Reasons why is because of what you just stated... you have to re-download the entire thing with each update (each updated SOT) which would be a MUCH LARGER download than the individual patch files... we're still too fluid on that in order to make a single large package. So, I dig the patch files that SOE originally came up with FOR NOW. I know others feel otherwise, but I'm just not a fan of that method YET. Yeah I went in with tre explorer to see what you done on the patch 70 late last night. Soon as we get a src to work from we can start adding a lot of the content from the other patches. A good reference is projectswg for last tre's used up to Dec 15th 2011. They are actually using Client 0.0.223.189 which was the last before closure. I would like to see that as a goal for the vanilla server.

Yep, the SOT is more geared toward server admins and ability to use one single file for updates rather then hundreds of thousands. There are some speed improvements for load times on server and client. Its something for us to think about later. OR those who wish to use the technique on their own personal server. I would recommend keeping it as an option in our future source projects for those who wish to use it. However, sticking with SOE original technique for anything we do live. REPORT BOOKMARKLIKE + QUOTE REPLY Seefoe Seefoe Member Joined:Nov 21, 2017 Messages:7 Likes Received:0 #5Seefoe, Nov 24, 2017 Erusman said: ↑ They are actually using Client 0.0.223.189 which was the last before closure. I would like to see that as a goal for the vanilla server. There are some packet changes between the client from the source and final release client, we'd have to figure out which packets changed in order to use it. In my honest opinion, I don't think using the final release client is a good idea since we don't have the source to it. REPORT BOOKMARKLIKE + QUOTE REPLY Write your reply...

Write your reply...

Users Who Are Viewing This Thread (Users: 1, Guests: 0) Users Who Have Read This Thread (Total: 0) Share This Page ABOUT US Community for sharing and guides on how to get a SWG Server up and running. Our goal is to allow people to share information freely and publicly and to preserve that information.

QUICK JUMP Home About Forums Downloads USEFUL LINKS Alpha Delta Omega REGULATIONS Forum software by XenForo™ ©2010-2017 XenForo Ltd.

SWGSource Home Help Terms and Rules

===============================================================

Clone this wiki locally