I'm Live!
Watch Now

Creating Anakins Radon-Ulzer Podracer in game – Part 2

`Please note that this tutorial continues to use the IPG-X1131 Longtail Podracer as the source template for creating the Anakin’s Radon-Ulzer Podracer.
The paths and files will require that you are using the SR Code Repository if you want to follow it exactly.

As we’re adding new objects, we need to remember common causes of them not working:
draft schematics – not adding the schematic IFF to the bin/scripts/managers/crafting/schematics.lua file.
objects – if you have created an object in a location that did not previously exist, that folder needs to be added to the bin/scripts/object/allobjects.lua file.


Let’s add the tangible object (in this case mobile).

copy bin/scripts/object/custom_content/mobile/vehicle/podracer_ipg_x1131_longtail.lua
to bin/scripts/object/custom_content/mobile/vehicle/podracer_anakin.lua

Edit the file and change all occurrences of ipg_x1131_longtail with anakin

object_mobile_vehicle_podracer_anakin = object_mobile_vehicle_shared_podracer_anakin:new {
templateType = VEHICLE,
decayRate = 15, -- Damage tick per decay cycle
decayCycle = 600 -- Time in seconds per cycle
}
ObjectTemplates:addTemplate(object_mobile_vehicle_podracer_anakin, "object/mobile/vehicle/podracer_anakin.iff")

include this file in the serverobjects.lua in the same folder

includeFile("custom_content/mobile/vehicle/podracer_anakin.lua")

and add to the objects.lua in the same folder

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

Let’s set up the Deed file next.

copy bin/scripts/object/custom_content/tangible/deed/vehicle_deed/podracer_ipg_x1131_longtail_deed.lua
to bin/scripts/object/custom_content/tangible/deed/vehicle_deed/podracer_anakin_deed.lua

Edit the file and change all occurrences of ipg_x1131_longtail with anakin
Modify the max/min hitpoints here if you wish

include this file in the serverobjects.lua in the same folder

includeFile("custom_content/tangible/deed/vehicle_deed/podracer_anakin_deed.lua")

and add to the objects.lua in the same folder

object_tangible_deed_vehicle_deed_shared_podracer_anakin_deed = SharedCreatureObjectTemplate:new {
clientTemplateFileName = "object/tangible/deed/vehicle_deed/shared_podracer_anakin_deed.iff"
}
ObjectTemplates:addClientTemplate(object_tangible_deed_vehicle_deed_shared_podracer_anakin_deed, "object/tangible/deed/vehicle_deed/shared_podracer_anakin_deed.iff")

Now for the control device (intangible) object

copy bin/scripts/object/custom_content/intangible/vehicle/podracer_ipg_x1131_longtail_pcd.lua
to bin/scripts/object/custom_content/intangible/vehicle/podracer_anakin_pcd.lua

Edit the file and change all occurrences of ipg_x1131_longtail with anakin
Modify the max/min hitpoints here if you wish

include this file in the serverobjects.lua in the same folder

includeFile("custom_content/intangible/vehicle/podracer_anakin_pcd.lua")

and add to the objects.lua in the same folder

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

Loot schematic is at the top of the pile

copy bin/scripts/object/custom_content/tangible/loot/loot_schematic/vehicles/podracer_ipg_x1131_longtail_schematic.lua
to bin/scripts/object/custom_content/tangible/loot/loot_schematic/vehicles/podracer_anakin_schematic.lua

Edit the file and change all occurrences of ipg_x1131_longtail with anakin

include this file in the serverobjects.lua in the same folder

includeFile("custom_content/tangible/loot/loot_schematic/vehicles/podracer_ipg_x1131_longtail_schematic.lua")

and add to the objects.lua in the same folder

object_tangible_loot_loot_schematic_vehicles_podracer_anakin_schematic = object_tangible_loot_loot_schematic_vehicles_shared_podracer_anakin_schematic:new {
templateType = LOOTSCHEMATIC,
objectName = "Anakin's Radon-Ulzer Podracer Schematic",
customName = "Anakin's Radon-Ulzer Podracer Schematic",
objectMenuComponent = "LootSchematicMenuComponent",
attributeListComponent = "LootSchematicAttributeListComponent",
requiredSkill = "crafting_artisan_master",
targetDraftSchematic = "object/draft_schematic/vehicle/civilian/podracer_anakin.iff",
targetUseCount = 2,
}
ObjectTemplates:addTemplate(object_tangible_loot_loot_schematic_vehicles_podracer_anakin_schematic, "object/tangible/loot/loot_schematic/vehicles/podracer_anakin_schematic.iff")

Finally, the Draft Schematic is here to cause you headaches

copy bin/scripts/object/custom_content/draft_schematic/vehicle/civilian/podracer_ipg_x1131_longtail.lua
to bin/scripts/object/custom_content/draft_schematic/vehicle/civilian/podracer_anakin.lua

Edit the file and change all occurrences of ipg_x1131_longtail with anakin

object_draft_schematic_vehicle_civilian_podracer_anakin = object_draft_schematic_vehicle_civilian_shared_podracer_anakin:new {
templateType = DRAFTSCHEMATIC,

craftingToolTab = 16, -- (See DraftSchematicObjectTemplate.h)
complexity = 25,
size = 1,
factoryCrateSize = 0,

xpType = "crafting_general",
xp = 1800,

assemblySkill = "general_assembly",
experimentingSkill = "general_experimentation",
customizationSkill = "clothing_customization",

customizationOptions = {},
customizationStringNames = {},
customizationDefaults = {},

ingredientTemplateNames = {"craft_vehicle_ingredients_n", "craft_vehicle_ingredients_n", "craft_vehicle_ingredients_n", "craft_vehicle_ingredients_n", "craft_vehicle_ingredients_n"},
ingredientTitleNames = {"vehicle_body", "structural_frame", "mekuun_speeder_lift_core", "mekuun_torque_drive", "kalibac_industries_hover_module"},
ingredientSlotType = {0, 0, 1, 1, 1},
resourceTypes = {"metal_nonferrous", "metal_ferrous", "object/tangible/component/vehicle/shared_mekuun_speeder_lift_core.iff", "object/tangible/component/vehicle/shared_mekuun_torque_drive.iff", "object/tangible/component/vehicle/shared_kalibac_industries_hover_module.iff"},
resourceQuantities = {2000, 4200, 1, 1, 1},
contribution = {100, 100, 100, 100, 100},

targetTemplate = "object/tangible/deed/vehicle_deed/podracer_anakin_deed.iff",
additionalTemplates = {}
}

ObjectTemplates:addTemplate(object_draft_schematic_vehicle_civilian_podracer_anakin, "object/draft_schematic/vehicle/civilian/podracer_anakin.iff")

Here you can change if the schematic is factory-runnable – factoryCrateSize

The schematic is also defined here, with the resources required and the type of resource needed.

include this file in the serverobjects.lua in the same folder

includeFile("custom_content/draft_schematic/vehicle/civilian/sith_speeder.lua")

and add to the objects.lua in the same folder

object_draft_schematic_vehicle_civilian_shared_podracer_anakin = SharedDraftSchematicObjectTemplate:new {
clientTemplateFileName = "object/draft_schematic/vehicle/civilian/shared_podracer_anakin.iff"
}
ObjectTemplates:addClientTemplate(object_draft_schematic_vehicle_civilian_shared_podracer_anakin, "object/draft_schematic/vehicle/civilian/shared_podracer_anakin.iff")

Now add the schematic to bin/scripts/managers/crafting/schematics.lua

 {path="object/draft_schematic/vehicle/civilian/podracer_anakin.iff"},

I think we’re done, I’m off to see if it worked.

Affiliates