Buildable Sand-bags.

Have modding questions or discovered something new? Post here.
Post Reply
User avatar
Arisen
Mortar Man
Mortar Man
Posts: 33
Joined: Fri Feb 17, 2017 6:16 am
American Samoa

Buildable Sand-bags.

Post by Arisen »

so, while I'm figuring out how to use Notepad + to get in new objects. I found something neat. In the config files there are Sandbags that are used in a couple of missions by the tans. But they don't have any hitpoints or anything, and are not apparently buildable. So I made them buildable by the bulldozer, altered their stats to give them Hitpoints, and edited the .types cfg file to allow them to be built within the map I'm editing. (Basement baloney)

and viola!


Image

Image


Image

Image

interestingly, although they can connect to the gaurd towers, they seem to have trouble connecting to each other and do not connect from behind... why this is like this is beyond me. *shrug* just thought it would be neat to show you guys,

I've been trying with moderate success to create a whole new faction (haven't decided on a name yet) with their own units and buildings. got about 5 units so far, but the buildings have been troublesome, things like textures not appearing and whatnot. Also cannot seem to create anything like a resource-depot or anything that builds units. I think that might require some fancy footwork.


I'll be posting any other building edits I will make here in this thread. (unless you guys would prefer I just make one mega-thread for this)
User avatar
TommyCD1
Moderator
Moderator
Posts: 1144
Joined: Tue Jun 04, 2013 8:55 am
Location: East Coast
Contact:
United States of America

Re: Buildable Sand-bags.

Post by TommyCD1 »

The reason the sandbags have trouble connecting is because of the way the game handles fence posts. A fence post projects it's fence from the models origin, and this origin can only be within a single cell of the model. Normally this single cell happens to be the only cell the building occupies, in the case of Guard Towers and Barbed Wire. The sandbags however occupy four cells, meaning the origin can only be located within one of these cells. So by rounding, it chooses the top right most cell to place the fence at.

Now that you know how it works, we can see why it gets blocked.

The game determines if a fence can occupy a cell depending on whether it is occupied by a zipped object, excluding a fence post's origin cell. So for example, we have two barbed wires.
sHd6PE5.png
sHd6PE5.png (4.97 KiB) Viewed 2427 times
sHd6PE5.png
sHd6PE5.png (4.97 KiB) Viewed 2427 times
Since none of the cells surrounding them are occupied, and they themselves only occupy one cell, they can project their fence on all the green cells. But now what happens when something like a resource occupies cells?
Ju1L6rF.png
Ju1L6rF.png (7.18 KiB) Viewed 2427 times
Ju1L6rF.png
Ju1L6rF.png (7.18 KiB) Viewed 2427 times
Here, the battery occupies the two cells in red. These red cells prevent fences from being projected across themselves, so in this example the fence post at the top can connect to both left and right, but the left post cannot connect to the right post, and vice versa.

The issue comes in when a fence post occupies more than one cell.
QSKY6Lh.png
QSKY6Lh.png (12.51 KiB) Viewed 2427 times
QSKY6Lh.png
QSKY6Lh.png (12.51 KiB) Viewed 2427 times
In this example, the sandbags occupy four cells. Since the game only allows the cell that contains the origin to have fences on it, the remaining cells that do not contain the origin are labeled as occupied and therefore block fences. So in this example, the sandbags can connect to the north and east fence posts as there are no red cells in between the origin cells. However the west and south fence posts are blocked by the sandbags' own cells.
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
Arisen
Mortar Man
Mortar Man
Posts: 33
Joined: Fri Feb 17, 2017 6:16 am
American Samoa

Re: Buildable Sand-bags.

Post by Arisen »

*slow clap* thanks for the educational breakdown on the subject, now I'm a lot less confused. :kittty:

As for my other issues, do you know whether or not any other object or building (aside from the usual barracks/garage ect) can be used to produce units? In the past I attempted to take .god files from the campaign maps. Things like the beetles/praying mantis and whatnot, and tried replacing their .god file with an infantry unit to make a new insect unit, and when I did I got an error about how the engine "could not find the node" for firing with the weapon. So I assume for units to fire weapons (and create units) they have to have a "node" in the .god file. similar to a weapon bone on a units skeleton... and without that node they cant fire or produce things. Is there any way to add that node in?



Update; apprently not... as I tried and got this error X-(

Image

Image
User avatar
TommyCD1
Moderator
Moderator
Posts: 1144
Joined: Tue Jun 04, 2013 8:55 am
Location: East Coast
Contact:
United States of America

Re: Buildable Sand-bags.

Post by TommyCD1 »

Yes, buildings must require hard points that are coded or modeled directly into the mesh itself, which is impossible to edit. As such we can't use any new buildings or props to build units from, only what we have.

As for the weapon, while a hard point for the weapon makes it look nice like it actually emanates from the gun's barrel, this is not necessary and can be easily removed from the unit's .cfg file.

Code: Select all

// WEAPON
CreateWeaponType("army.weapon.grunt")
{
  Style("Instant");

  MaxRange(56);

  Delay(1);

  Damage()
  {
    Amount(8);

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

  FirePoints()
  {
    Add("HP-FIRE");
  }
}
Here we have weapon code. You can see the lines that define the FirePoints() towards the bottom. This is what tells to game to shoot bullets from a specific hardpoint on the mesh. By removing these lines, the game engine will default to firing from the mesh's origin point, which is something all models have, therefore allowing anything you want to shoot projectiles.
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
Arisen
Mortar Man
Mortar Man
Posts: 33
Joined: Fri Feb 17, 2017 6:16 am
American Samoa

Re: Buildable Sand-bags.

Post by Arisen »

TommyCD1 wrote: Sat Aug 18, 2018 10:15 pm Yes, buildings must require hard points that are coded or modeled directly into the mesh itself, which is impossible to edit. As such we can't use any new buildings or props to build units from, only what we have.

As for the weapon, while a hard point for the weapon makes it look nice like it actually emanates from the gun's barrel, this is not necessary and can be easily removed from the unit's .cfg file.

Code: Select all

// WEAPON
CreateWeaponType("army.weapon.grunt")
{
  Style("Instant");

  MaxRange(56);

  Delay(1);

  Damage()
  {
    Amount(8);

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

  FirePoints()
  {
    Add("HP-FIRE");
  }
}
Here we have weapon code. You can see the lines that define the FirePoints() towards the bottom. This is what tells to game to shoot bullets from a specific hardpoint on the mesh. By removing these lines, the game engine will default to firing from the mesh's origin point, which is something all models have, therefore allowing anything you want to shoot projectiles.

Image


Well, there we have it... Scorch, the fire-throwing ladybug. It has believable walking animation. Unfortunatley has no firing animation. If only there were a way to call to it's "wing-flapping" animation the way that is done in the intelligence files, we might be able to get something... but, progress is progress. :SWEET:
User avatar
Rarefy (R.SX)
Half Track
Half Track
Posts: 60
Joined: Tue Aug 02, 2016 9:04 pm
Location: United States
Contact:
Mexico

Re: Buildable Sand-bags.

Post by Rarefy (R.SX) »

Hey how's this mod going?... any updates?.. if so, id like to give the additional insect mod a try :ROCK:
Post Reply

Who is online

Users browsing this forum: No registered users and 0 guests