Using cockroaches as units?

Have modding questions or discovered something new? Post here.
Post Reply
User avatar
Nullen
Tank
Tank
Posts: 81
Joined: Sat May 21, 2011 11:09 pm
Location: Mandeville
Jamaica

Using cockroaches as units?

Post by Nullen »

So I've been attempting to make the cockroach as a unit and set the correct "constructor" values, but the roach won't appear on the HQ's menu. Could anyone please tell me how to solve this issue?

Btw here's a copy of my modified cockroach

Code: Select all

///////////////////////////////////////////////////////////////////////////////
//
// Pandemic Studios
//

#include "fx_insect_unit_cockroach.cfg"

// UNIT
CreateObjectType("insect.unit.cockroach", "Unit")
{
  GameObj()
  {
    ThinkInterval(1);
    IdleTask("Tasks::UnitIdle");
    Properties()
    {
      Add("Filter::Army");
      Add("Filter::Biological");
      Add("Filter::Unit");
      Add("Filter::Weapon");
      Add("Filter::Heroes");
      Add("Filter::Transportable");
    }
  }

  MapObj()
  {
    GodFile("cockroach.god");
    PhysicsModel("Walker");
    TractionType("ground");
    GrainSize(1);

    ArmourClass("infantry");
    HitPoints(300);

    TypeDisplay()
    {
      Image("if_game_portraits.tga", 86, 86, 43, 43);
      Mode("Centre");
    }
    GenericFX()
    {
      Add("Weapon::Fire", "weapon.cockroach.fire");
      Add("MapObj::Death", "death.cockroach.worker");
      Add("Restore::Target::Process", "restore-small");
      Add("MapObj::AddToMap2", "restore-small-puff");
    }
  }

  UnitObj()
  {
    TopSpeed(50);
    TurnSpeed(1440);

    SeeingRange(81);

    Weapon("insect.weapon.cockroach");
  }
}

    Constructor("army.building.hq1");
    ConstructionTime(1);
    CreateSource("resource.blob.infantry1");
    CommandCost(1);
    ResourceCost()
    {
      Add("Plastic", 1);
      Add("Electricity", 0);
    }
    Prereqs()
    {
      Add("army.building.hq1");
    }

    Weapon("insect.weapon.cockroach");
  }
}


// WEAPON
CreateWeaponType("insect.weapon.cockroach")
{
  Style("Projectile");
  TargetStyle("Closest");

  MaxRange(30);

  VertSeparation(90);

  Delay(1);
  Fixed(1);
  LeadAngle(1);
  AimAtBox(1);


  Damage()
  {
    Amount(50);

    Effective("infantry", 100%);
    Effective("vehicle", 100%);
    Effective("structure", 100%);
    Effective("flyer", 100%);
    Effective("mine", 100%);
  }

  FirePoints()
  {
    Add("HP-FIRE");
  }
}


Keep calm and get angry
User avatar
Anti-SniperTank
Half Track
Half Track
Posts: 62
Joined: Tue May 10, 2011 10:34 pm
Location: Some where on this world
Contact:

Re: Using cockroaches as units?

Post by Anti-SniperTank »

Thats done allready same with the ants. in...
Smith's maps
[FuR] maps
W.W's maps

And more in i think.

You can build them but not from HQ. "other buildings"
Here to download all maps.
ImageImageImage
User avatar
{EMC}Methuselah96
Programmer
Programmer
Posts: 723
Joined: Sat May 08, 2010 3:22 pm
Location: Philadelphia, PA, United States
Contact:

Re: Using cockroaches as units?

Post by {EMC}Methuselah96 »

Those things you added have to be inside the brackets so it's going to look like this:

Code: Select all

//////////////////////////////////////////////////////////////////////

/////////
//
// Pandemic Studios
//

#include "fx_insect_unit_cockroach.cfg"

// UNIT
CreateObjectType("insect.unit.cockroach", "Unit")
{
  GameObj()
  {
    ThinkInterval(1);
    IdleTask("Tasks::UnitIdle");
    Properties()
    {
      Add("Filter::Insect");
      Add("Filter::Biological");
      Add("Filter::Unit");
    }
  }

  MapObj()
  {
    GodFile("cockroach.god");
    PhysicsModel("Walker");
    TractionType("ground");
    GrainSize(1);

    ArmourClass("infantry");
    HitPoints(300);

    TypeDisplay()
    {
      Image("if_game_portraits.tga", 86, 86, 43, 43);
      Mode("Centre");
    }
    GenericFX()
    {
      Add("Weapon::Fire", "weapon.cockroach.fire");
      Add("MapObj::Death", "death.cockroach.worker");
      Add("Restore::Target::Process", "restore-small");
      Add("MapObj::AddToMap2", "restore-small-puff");
    }
  }

  UnitObj()
  {
    TopSpeed(50);
    TurnSpeed(1440);

    SeeingRange(81);

    Weapon("insect.weapon.cockroach");
    Constructor("army.building.hq1");
    ConstructionTime(1);
    CreateSource("resource.blob.infantry1");
    CommandCost(1);
    ResourceCost()
    {
      Add("Plastic", 1);
      Add("Electricity", 0);
    }
    Prereqs()
    {
      Add("army.building.hq1");
    }
  }
}

// WEAPON
CreateWeaponType("insect.weapon.cockroach")
{
  Style("Projectile");
  TargetStyle("Closest");

  MaxRange(30);

  VertSeparation(90);

  Delay(1);
  Fixed(1);
  LeadAngle(1);
  AimAtBox(1);


  Damage()
  {
    Amount(50);

    Effective("infantry", 100%);
    Effective("vehicle", 100%);
    Effective("structure", 100%);
    Effective("flyer", 0%);
    Effective("mine", 100%);
  }

  FirePoints()
  {
    Add("HP-FIRE");
  }
  Projectile("insect.proj.cockroach");
}

//
// PROJECTILE DEFINITION
//
CreateObjectType("insect.proj.cockroach", "Projectile")
{
  MapObj()
  {
    Mesh();
    GenericFX()
    {
      Add("ProjectileObj::Trail", "weapon.cockroach.proj");
      Add("ProjectileObj::Hit", "weapon.cockroach.exp");
    }
  }
  ProjectileObj()
  {
    TopSpeed(200);
    ProjectileModel("GuidedTrajectory");
    HomingRate(120);
    AccelerationTime(2);
    //Explosion("weapon.cockroach.exp");

  }
}
Image
User avatar
Nullen
Tank
Tank
Posts: 81
Joined: Sat May 21, 2011 11:09 pm
Location: Mandeville
Jamaica

Re: Using cockroaches as units?

Post by Nullen »

It still won't show up
Keep calm and get angry
User avatar
{EMC}Methuselah96
Programmer
Programmer
Posts: 723
Joined: Sat May 08, 2010 3:22 pm
Location: Philadelphia, PA, United States
Contact:

Re: Using cockroaches as units?

Post by {EMC}Methuselah96 »

I tested it on mine and it worked.
And btw the icon will look like a dum-dum.
Image
User avatar
Nullen
Tank
Tank
Posts: 81
Joined: Sat May 21, 2011 11:09 pm
Location: Mandeville
Jamaica

Re: Using cockroaches as units?

Post by Nullen »

Ah. It did appear on the menu but I wasn't paying attention (thanks a lot). Also what is the entity name of those block guys from the Fist Full of Plastic level?
Keep calm and get angry
User avatar
{EMC}Methuselah96
Programmer
Programmer
Posts: 723
Joined: Sat May 08, 2010 3:22 pm
Location: Philadelphia, PA, United States
Contact:

Re: Using cockroaches as units?

Post by {EMC}Methuselah96 »

livingrm.prop.blocko_person-1

You have to be using the world Livingroom.
Image
Post Reply

Who is online

Users browsing this forum: No registered users and 0 guests