New to Modding the game, really confused
Posted: Sun Jun 04, 2017 8:35 am
So, I'm trying to add a new unit. Simply a generic flamethrower guy, based off of Scorch obviously, but when I add
To the unit it does not add them into the Barracks' build card. However, it seems like I can properly change what buildings an existing unit can be build at. I changed the Constructor line on the Bazooka soldier to be built at the Garage and that properly changed. Here is all of the code, in case someone wants to look at it:
EDIT: There appears to have been some map-specific shenanigans going on. I had to modify the map in order to make the unit appear in the map I was using to test, which was one of the Great Battle maps. The Multiplayer Maps don't seem to have this same weird coding convention that the Gardens map does though, I think.
Code: Select all
Constructor("army.building.barracks1");
Code: Select all
///////////////////////////////////////////////////////////////////////////////
//
// Pandemic Studios
//
#include "fx_army_unit_scorch.cfg"
#includeonce "fx_grunt_damage.cfg"
// UNIT
CreateObjectType("army.unit.flame", "Unit")
{
GameObj()
{
ThinkInterval(1);
IdleTask("Tasks::UnitIdle");
Properties()
{
Add("Filter::Army");
Add("Filter::Biological");
Add("Filter::Unit");
Add("Filter::Weapon");
Add("Filter::Transportable");
}
}
MapObj()
{
GodFile("army_scorch.god");
PhysicsModel("Walker");
TractionType("ground");
GrainSize(1);
TypeDisplay()
{
Image()
{
Image("if_game_portraits.tga", 210, 210, 42, 42);
Mode("Centre");
}
}
ArmourClass("infantry");
HitPoints(200);
GenericFX()
{
Add("UnitObj::ActivelyOnTeam", "flameidle");
Add("Weapon::Fire", "weapon.flame.fire");
Add("MapObj::AddToMap", "damage.grunt");
Add("MapObj::Death", "death.infantry");
Add("Restore::Target::Process", "restore-small");
Add("MapObj::AddToMap2", "restore-small-puff");
Add("Wounded::Start", "herowound");
// Add("UnitObj::Engine", "water.ripple");
}
ShadowFile("army_grunt-shadow.tga");
RotateShadow(0); // default is 1
}
UnitObj()
{
TopSpeed(40);
TurnSpeed(8640); // was1440);
SeeingRange(65);
ResponseEvents()
{
Add("Attack")
{
Add("army.unit.scorch_attack-0.wav");
Add("army.unit.scorch_attack-1.wav");
}
Add("Attacked")
{
Add("army.unit.scorch_attacked-0.wav");
}
Add("Move")
{
Add("army.unit.scorch_move-0.wav");
Add("army.unit.scorch_move-1.wav");
Add("army.unit.scorch_move-2.wav");
}
Add("Select")
{
Add("army.unit.scorch_select-0.wav");
Add("army.unit.scorch_select-1.wav");
Add("army.unit.scorch_select-2.wav");
}
Add("Spotted")
{
Add("army.unit.scorch_spotted-0.wav");
}
}
Constructor("army.building.barracks1");
ConstructionTime(30);
CreateSource("resource.blob.infantry1");
CommandCost(1);
ResourceCost()
{
Add("Plastic", 200);
Add("Electricity", 25);
}
Prereqs()
{
Add("army.building.barracks2");
}
CommandCost(1);
Weapon("army.weapon.flame");
}
}
// WEAPON
CreateWeaponType("army.weapon.flame")
{
Style("Instant");
MaxRange(48);
HorizAngle(90);
HorizSeparation(5);
VertAngle(90);
VertSeparation(45);
Delay(0.3);
LeadAngle(1);
Speed(200);
Damage()
{
Amount(15);
Effective("infantry", 100%);
Effective("vehicle", 50%);
Effective("structure", 50%);
Effective("flyer", 0%);
Effective("mine", 50%);
}
FirePoints()
{
Add("HP-fire");
}
}