[Guide - Content] Adding The BARC to the Emu core3

Lasko

Moderator
Staff member
Moderator
Joined
Feb 13, 2012
Messages
295
This guide assumes you know how to manipulate SWG .tre files, that is, examine, extract and create new .tre's with all of the files needed to add items to the Pre-CU Core. If you are not familiar with this process you REALLY should be because pretty much anything to do with adding new things to the Emu core starts with being able to do this. So check out the guides on this forum about tre file manipulation, especially Duff's guide on consolidating tre files here:

http://www.modthegalaxy.com/forums/thread-consolidating-tre-files

**EDIT**
Just noticed Kinshi's Barc tre files are in the beta release section for downloading.

Also to point out this process actually adds these items to your SWGEmu development server, it is not just a simple mod. Also thie process is very similar for all additional items you may like to add.

Right, on to the BARC:)


Tools needed, or at least what I used.

Edit: Just use Sytner's IFF Editor now for all editing.

Adding the Barc speeder can basically be split into three parts.

    1.  Tre file manipulation. Creating custom tre with the relevant Barc Speeder files and the CRC string file ammended in section 2.(Not covered in detail in this guide as it's covered elsewhere in this forum).

    2.  Amending the /object_template_crc_string_table.iff file to add the template CRC to the object list.

    3.  Scripting the Lua files which again fall into three types.

        Object template file.

        Player control device.

        Deed file.



1.  Using SIE, open the NGE TOC file /sku0.client.toc and extract the necessary files for the BARC speeder to a folder on your HD called barc.tre.
       a.  Start with /object/mobile/vehicle/shared_barc_speeder.iff Right click and "Export File Chain". This should grab most of the files needed but more than likely will miss some. Almost certainly you will need to grab the player           control device files so.
       b.  Find /object/intangible/vehicle/shared_barc_speeder_pcd.iff and export file chain.
       c.  Finally export the file chain from /object/tangible/deed/vehicle_deed/shared_barc_speeder_deed.iff and you should now be good to go.

For the sake of this exercise we'll assume your just going to make a .tre file with only one item in it and it will be called barc.tre. Once you have gathered all of the files, your almost ready to repack your custom tre, but dont compile it yet.

2.  Find the file /misc/object_template_crc_string_table.iff in the Pre-CU tre files. The latest version of this file sould be in patch_14.00 (if you have not added anything to your server). Right click and export to a folder called /misc in the /barctre folder you created earlier. This file contains all of the CRC information for every object template that is currently in your Pre-CU server. There are other versions elsewhere in the .tre files but do not use an earlier version. Once extracted to your HD, open the crc editor. From the menu select file & open the /misc/object_template_crc_string_table.iff you just extracted, it should now be shown next to the editing heading. Below it there should be an empty box to add your object .iff file, of which you are going to enter three.

   a.  First type in the box object/tangible/deed/vehicle_deed/shared_barc_speeder_deed.iff next click Add

   b.  Next type object/mobile/vehicle/shared_barc_speeder.iff and click Add.

   c.  Lastly type object/intangible/vehicle/shared_barc_speeder_pcd.iff and Add. Now click file and Save.

Double check spelling here, because if it is incorrect you speeder will not work and you will get lots of errors from your server. Also the CRCtool will not give you the option to save if you just exit so make sure you save before you do!!

Once complete, you can now pack your custom tre using SIE. This will now need to be added to both your server and client tre folder and added to the config.lua and the swgemu_live.cfg files. That completes the tre work, now just the server scripts to add.

*****NOTE*****
When copying and adding CRC's to the object_template_crc_string_table.iff file you must pay particular attention to what version your using and what has been added and what has not!!! It's very easy to omit/forget/badly screw up this file and end up with errors on both server and client.

*****NOTE2*****
When copying and adding CRC's to the object_template_crc_string_table.iff file you must pay particular attention to what version your using and what has been added and what has not!!! It's very easy to omit/forget/badly screw up this file and end up with errors on both server and client. Yes check twice at least............You get the point!!!!!!!

3i.  Server Lua files.
   
    a.  Object template files. Create the following file.  /object/mobile/vehicle/barc_speeder.lua  Then copy into the file:

object_mobile_vehicle_barc_speeder = object_mobile_vehicle_shared_barc_speeder:new {
}
ObjectTemplates:addTemplate(object_mobile_vehicle_barc_speeder, "object/mobile/vehicle/barc_speeder.iff")


   b.  Add to the following file.  /object/mobile/vehicle/objects.lua 

object_mobile_vehicle_shared_barc_speeder = SharedCreatureObjectTemplate:new {
clientTemplateFileName = "object/mobile/vehicle/shared_barc_speeder.iff"
}
ObjectTemplates:addClientTemplate(object_mobile_vehicle_shared_barc_speeder, "object/mobile/vehicle/shared_barc_speeder.iff")


   c.  Add this line to the following file.  /object/mobile/vehicle/serverobjects.lua

includeFile("mobile/vehicle/barc_speeder.lua")

3ii. Player Control Device Files.

   a.  Create the following file. object/intangible/vehicle/barc_speeder_pcd.lua Then copy into the file:

object_intangible_vehicle_barc_speeder_pcd = object_intangible_vehicle_shared_barc_speeder_pcd:new {
}
ObjectTemplates:addTemplate(object_intangible_vehicle_barc_speeder_pcd, "object/intangible/vehicle/barc_speeder_pcd.iff")


   b.  Add to the following file.  /object/intangible/vehicle/objects.lua

object_intangible_vehicle_shared_barc_speeder_pcd = SharedIntangibleObjectTemplate:new {
clientTemplateFileName = "object/intangible/vehicle/shared_barc_speeder_pcd.iff"
}
ObjectTemplates:addClientTemplate(object_intangible_vehicle_shared_barc_speeder_pcd, "object/intangible/vehicle/shared_barc_speeder_pcd.iff")


   c.  Add this line to the following file.  /object/intangible/vehicle/serverobjects.lua

includeFile("intangible/vehicle/barc_speeder_pcd.lua")

You can now see a pattern to whats happening here. Lastly.

3iii.  Deed File.

   a.  Create the following file. object/tangible/deed/vehicle_deed/barc_speeder_deed.lua Then copy into the file:

object_tangible_deed_vehicle_deed_barc_speeder_deed = object_tangible_deed_vehicle_deed_shared_barc_speeder_deed:new {

templateType = VEHICLEDEED,

controlDeviceObjectTemplate = "object/intangible/vehicle/barc_speeder_pcd.iff",
generatedObjectTemplate = "object/mobile/vehicle/barc_speeder.iff",

numberExperimentalProperties = {1, 1, 1},
experimentalProperties = {"XX", "XX", "SR"},
experimentalWeights = {1, 1, 1},
experimentalGroupTitles = {"null", "null", "exp_durability"},
experimentalSubGroupTitles = {"null", "null", "hit_points"},
experimentalMin = {0, 0, 28000},
experimentalMax = {0, 0, 30000},
experimentalPrecision = {0, 0, 0},
experimentalCombineType = {0, 0, 1},
}

ObjectTemplates:addTemplate(object_tangible_deed_vehicle_deed_barc_speeder_deed, "object/tangible/deed/vehicle_deed/barc_speeder_deed.iff")


   b.  Add to the following file.  /object/tangible/deed/vehicle_deed/objects.lua

object_tangible_deed_vehicle_deed_shared_barc_speeder_deed = SharedTangibleObjectTemplate:new {
clientTemplateFileName = "object/tangible/deed/vehicle_deed/shared_barc_speeder_deed.iff"
}
ObjectTemplates:addClientTemplate(object_tangible_deed_vehicle_deed_shared_barc_speeder_deed, "object/tangible/deed/vehicle_deed/shared_barc_speeder_deed.iff")


   c.  Add this line to the following file.  /object/tangible/deed/vehicle_deed/serverobjects.lua

includeFile("tangible/deed/vehicle_deed/barc_speeder_deed.lua")

Once all this is completed, restart server and client and the BARC is now added to your server.

Please note that although the speeder is now added there is no way to actually obtain it unless you add it to your frog, create a screenplay or manually generate the item. All of these methods are covered in gudes elsewhere both here and on the Emu forums.

Complete set of BARC Lua files.

Happy speeding:)

*****NOTE*****

If you follow the above procedure, you will end up with the same problem as howdlej below. The main reason is that when pulling new assets from the NGE Toc files you can sometimes introduce non-compatible files to the Emu core, mainly for shaders and the like. The simplest remedy is to go through the NGE assets you have gathered and check for files that already exist in the original Emu tre's. Sounds complicated, but look at Duff's guide on tre file consolidation and it begins to explain the process.

The other thing is the naming issue..... Yeah I forgot about that one.

Any item you bring from the CU or NGE wont have a string file entry so the names will default to an error message.

The easiest way to find the string file is to open the object tre file in the SIE, in this case the "shared_barc_speeder.tre" and look down the list of XXXX chunks on the left hand side. In one of them you'll see an entry for the look at and stf text, in this case, monster detailis in "monster_name.stf.

Two choices here, copy the NGE string file or add the entry to the Pre-CU version. I'm going to cover the strings in more depth in another guide.
 

howdlej

New Member
Joined
Jun 15, 2014
Messages
3
RE: Adding The BARC to the Emu core3

[Apologies for 'bumping' an old thread?]

Hey! I'm new on these forums and to modding in general with SWG / SWGEmu and I've been spending the past week or so trying to figure how things work in terms of files structures, what files do and what to edit to achieve a desired effect.

I was going along with this guide a few days ago just for the experience, the guide managed to get the item in game but not without a few issues, I managed to get in game however for some reason there was some weird issue with the textures, the base texture would be a default plain gray, and the trim would be a bright red, not sure what caused this but it may have just been that the file chain didn't grab all the textures and I missed some myself.

Either way after that some other issues I encounter were getting the correct riding animation and getting customization with the vehicle customization tool to work.

However! I'v managed to resolve all my issues and happy to say I've learn a fair amount from using information from different guides and information threads on here so thanks it's been educational :)

Anyway I thought I'd share a zip file with all the files I had in my custom .tre that finally got the BARC in game fully working to help out anyone else with similar issues including:

-Full correct string name for the BARC as well as description.
-Correct animation for the BARC when you're mounted and riding.
-Customization works for both base and trim (took me forever to figure out why this wouldn't work xD) with default Patch 15 palette.

Link: https://drive.google.com/file/d/0B7C6RS-1PRjIVXFhWlFHMUNOMUE/edit?usp=sharing (To download whole archive File > Download)

Apologies for bumping an old thread / guide I wasn't sure if this was against any sort of site rule as I didn't see any specific xD
 

Phoenix

Moderator
Staff member
Moderator
Joined
Sep 25, 2010
Messages
235
RE: Adding The BARC to the Emu core3

What fixed customization? Please enumerate on this.
 

howdlej

New Member
Joined
Jun 15, 2014
Messages
3
RE: Adding The BARC to the Emu core3

Phoenix said:
What fixed customization? Please enumerate on this.
Sorry for the very late reply and bumping this thread. There was an issue with pallet the BARC used for customisation it would cause a weird texture issue and claim it didn't exist but I fixed it I believe by using an older version of a pallet with the same colours worked as replacement however It's been a while since I did this.
 

Phoenix

Moderator
Staff member
Moderator
Joined
Sep 25, 2010
Messages
235
RE: Adding The BARC to the Emu core3

oye. If you can figure it out let me know. Very interested
 

Arioch

Member
Joined
Apr 22, 2014
Messages
123
RE: Adding The BARC to the Emu core3

Howdlej - I used your files and my barc is invisible with no errors in the terminal :p. Other than that, its great. Shows in the datapad, I can call and ride it. But I have to target it by name and use the radial to mount. Also, it target a very small box and sinks my character halfway into the ground and still uses the animal mount posture. Ill post a fix when I get one in case this happens to anyone else.

EDIT - Well, easy fix.. had a mod I had checked out still installed that interfered with it.
 

howdlej

New Member
Joined
Jun 15, 2014
Messages
3
The file I uploaded seems to cause the swoop (and maybe other) particle effects to vanish from the back, I'll probably clear out the file again once I have some time. I'm too busy studying and other personal projects atm to do much in regards to swgemu. Will hopefully get back within a few weeks or sooner.

General issue is wasn't and still not so much up to speed with how swg client files work but I know a bit more now from working with the server source and reading threads so I'll see what I can do to update it is more compatible.
 

billyblair

New Member
Joined
Oct 3, 2015
Messages
24
Halyn said:
SIE has a built-in CRC tool that works better.
Thx Halyn.

Found and downloaded Sytner's IFF editor. Seems to be the 'Swiss Army Knife' of editing tools. This work also?

Edit: Just realised what SIE stands for /facepalm
 

billyblair

New Member
Joined
Oct 3, 2015
Messages
24
The only thing I'm struggling with is probably the most obvious to you guys so for that I apologise. I have done everything apart from repack the files to create a new .tre

How I do this please? Just cannot work it out using SIE :/
 

Lasko

Moderator
Staff member
Moderator
Joined
Feb 13, 2012
Messages
295
NP's at all:)

First of all put your new files in one root folder using the same structure as in the tre files.

In SIE from the SWG Repository tab. There's a menu across the top, second from right is TOC/Tre builder and an arrow, click the arrow and from the drop-down click create .tre from directory on disk.

Then find your root folder in the explorer window that opens and ok that.

That should be it:)

It'll look like it's frozen for a while depending on how big your new tre file is (there's no progress counter), you should get a message to see if you'd like to open the file you just built.

If you dont have that drop down menu, you may be using an older version in which case DL the latest version from the tools page.
 

billyblair

New Member
Joined
Oct 3, 2015
Messages
24
Lasko said:
NP's at all:)

First of all put your new files in one root folder using the same structure as in the tre files.

In SIE from the SWG Repository tab. There's a menu across the top, second from right is TOC/Tre builder and an arrow, click the arrow and from the drop-down click create .tre from directory on disk.

Then find your root folder in the explorer window that opens and ok that.

That should be it:)

It'll look like it's frozen for a while depending on how big your new tre file is (there's no progress counter), you should get a message to see if you'd like to open the file you just built.

If you dont have that drop down menu, you may be using an older version in which case DL the latest version from the tools page.
Tyvm for your response Lasko.
I'm just being dumb. Sorted it  :D
 

Attachments

Halyn

That One Guy
Staff member
Moderator
Joined
Jan 11, 2015
Messages
257
Location
Empire in Flames
Lasko! Getting hit with a "wrong vehicle object template" error when attempting to generate from deed. Suggestions?
 

Polariszene

Member
Joined
Feb 19, 2017
Messages
101
here is a noob question for ya ..... where do i put all these files on my server to make this barc speeder work?
sorry im so new to this
 

Lasko

Moderator
Staff member
Moderator
Joined
Feb 13, 2012
Messages
295
Create a new tre file with your files and add it to the server and client tre files.

Dont forget to add it to the config.lua and swgemu_live.cfg
 
Top Bottom