I want Help

Have modding questions or discovered something new? Post here.
Post Reply
Hero of All
Grunt
Grunt
Posts: 12
Joined: Sat Jun 29, 2019 4:57 am
Egypt

I want Help

Post by Hero of All »

Hello!
1-How to make the grunt swim? HOW?

2-How to make any object collect plastic and Electric

please help me
User avatar
TommyCD1
Moderator
Moderator
Posts: 1146
Joined: Tue Jun 04, 2013 8:55 am
Location: East Coast
Contact:
United States of America

Re: I want Help

Post by TommyCD1 »

I'm not sure what you mean by the grunt swimming? Do you mean walking through water patches, or going through deep water completely submerged? If you just want him to walk on water, then make sure your water is 2.5 meters deep or less, and the game will automatically allow ground units to walk or drive through the shallow water. If you want the grunt to move into deeper water, then you'll have to first edit his traction type to something custom, and then you'll have to define said traction in the base.x file named 'types_traction.cfg'. If you want some examples of how I did this you can check out my DR2 converted worlds. Each has a custom types_traction file that has new traction types for DR2 units and props.

If you want a unit to collect resources, first you'll need to go into the unit's .cfg file. Once there, you'll need to change the type of unit it is.

Code: Select all

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

#include "fx_army_unit_dumptruck.cfg"

// UNIT
CreateObjectType("army.unit.dumptruck", "Collector")
{
  GameObj()
  {
    ThinkInterval(1);
    IdleTask("Tasks::Collector");
    Properties()
    {
      Add("Filter::Army");
      Add("Filter::Mechanical");
      Add("Filter::Unit");
      Add("Client::NoGroupSelect");
    }
  }
See here how the dumptruck is defined as a "Collector" unit. This is what you will need your new unit to be. You'll also need your unit to use the idletask of "Tasks::Collector". This lets the unit actively search for and collect resources while it is idle.
Next, towards the end of your config, underneath the GameObj and MapObj modules, you'll need to add a new module for collector units.

Code: Select all

  CollectorObj()
  {
    Capacity() // How much of each resource can we carry? These are separate and do not combine.
    {
      Add("Plastic", 150); // How much plastic can we carry?
      Add("Electricity", 150); // How much electricity can we carry?
    }
    UnloadRate() // How quickly do we unload our cargo into the resource depot?
    {
      Add("Plastic", 150); // A number that matches max cargo will unload instantly into the depot.
      Add("Electricity", 150); // A number less than max cargo will unload into the depot in increments.
    }
    AssignmentRatio() // Assignment ratio refers to the optimal ratio of plastic to electricity you have in reserve. They should add up to 100.
    {
      Add("Plastic", 60); // If both numbers are different, then the collector will begin collecting the resource that is less in comparison to the ratio
      Add("Electricity", 40); // If one number is 100 and the other is 0, then the collector will only collect the number at 100, while ignoring the other source.
    }
    Minimums() // Minimums. Not sure what this does.
    {
      Add("Plastic", 500);
      Add("Electricity", 500);
    }
    CollectionDistanceStatic(32); // How far away can we collect a static resource? (Unused, unless you have custom resources.)
    CollectionDistanceCollectable(16); // How far away can we collect a plastic blob?
    ControlNode("CP-BARREL"); // What bone on the model do we use to collect resources? If this bone does not exist, the game will crash. TRY NOT TO MESS WITH THIS
    ControlNodeRate(40); // How quickly can we rotate our collection bone?
    BeamNode("HP-FIRE"); // From what hard point does our collection beam emit from?
    WaitTime(10); // WaitTime. Not sure what this does either.
    CollectableCoverageDistance(32); // Also not sure what this does.
    BalanceRate(1.0); // No clue.
    IgnoreTime(180.0); // Still no clue.
    CollectableDistanceModifier(1.5); // And no clue again. Maybe mess around with them and see what happens?

    Cargo() // The cargo that fills up as we reach our max capacity.
    {
      Mesh("army_dumptruck_plastic.god"); // What model to use to represent our cargo. If this .god does not exist, the game will crash.
      Offset(0.0, 2.4, 0.0); // How far in meters the cargo will be rendered from the collector's model root.
    }
  }
You can copy and paste from the dumptruck's .cfg and it should work fine. However, you may also tweak the parameters around as you see fit for a custom unit. I've added comments to this example to help you figure out what each thing does.
I may not make the best maps, or be the best player, but I put a lot of time, effort, and care into my stuff. That counts for something, right? No.
Image
"Can we order a pizza?"
GameRanger ID: 913974
User avatar
unikc
Half Track
Half Track
Posts: 53
Joined: Tue Apr 16, 2019 11:56 am
Location: Indonesia
Contact:
Indonesia

Re: I want Help

Post by unikc »

Buuuut
In task:collector
Grunt wont shoot??
Another day another idea 8) :C
BTW I Love Easy Modding.
User avatar
TommyCD1
Moderator
Moderator
Posts: 1146
Joined: Tue Jun 04, 2013 8:55 am
Location: East Coast
Contact:
United States of America

Re: I want Help

Post by TommyCD1 »

No. A unit with the collector thought process will not target enemies and collect resources at the same time unless told manually.
I may not make the best maps, or be the best player, but I put a lot of time, effort, and care into my stuff. That counts for something, right? No.
Image
"Can we order a pizza?"
GameRanger ID: 913974
User avatar
unikc
Half Track
Half Track
Posts: 53
Joined: Tue Apr 16, 2019 11:56 am
Location: Indonesia
Contact:
Indonesia

Re: I want Help

Post by unikc »

Noice
Another day another idea 8) :C
BTW I Love Easy Modding.
Post Reply

Who is online

Users browsing this forum: No registered users and 0 guests