Do weapons support categories for damage?
Moderator: Moderators
Do weapons support categories for damage?
I'm new here and have just skimmed over the tutorials. One of my pet peeves with modding TA was that you couldn't tell weapons that they could only affect certain unit categories. Instead one had to define every unit under the sun if they had slightly different effects per unit. And when creating games with 3rd party units you had to meticulously go back through every weapon to make sure they were within the weapons files. I've always thought that it would of been more wise to say something anti-air has so much effect on air units. Something anti-vehicle has so much anti-vehicle, and so on.
Does Spring fix this?
Does Spring fix this?
- PauloMorfeo
- Posts: 2004
- Joined: 15 Dec 2004, 20:53
Just keep in mind that the system is broken as you can read in this thread:
http://taspring.clan-sy.com/phpbb/viewt ... 632#128632
To sum it up, a unit can only efectively belong to one class in Armor.txt.
http://taspring.clan-sy.com/phpbb/viewt ... 632#128632
To sum it up, a unit can only efectively belong to one class in Armor.txt.
Its explained like mud in that thread unfortunately. I would think it would build an array with weapons in one coordinate and unit names in another. When it builds the array I'd think it would first look through damage according to a unit category (in this case its per unit in the armor.txt file?) and then individual listings under the specified damage lists. I'd think the latter value would overwrite the former value.
Argh, can you explain this in simple layman's terms?
Argh, can you explain this in simple layman's terms?
Firstly, go download NanoBlobs 0.63... it is full of things that will teach you how mods should be structured, how to use many advanced features of Spring, has commented animation scripts, and much more. If you still have questions after looking through it, let me know.
- PauloMorfeo
- Posts: 2004
- Joined: 15 Dec 2004, 20:53
I'm sorry Argh, but you are quite wrong. As i stated in that thread .Argh wrote:Just because you're not doing it right does not mean it doesn't work, as I stated in that thread
https://taspring.clan-sy.com/svn/spring ... /UnitDef.h
Code: Select all
struct UnitDef
{
...
int armorType;
...
}
Code: Select all
void CUnitDefHandler::ParseTAUnit(std::string file, int id)
{
ud.armorType=damageArrayHandler->GetTypeFromName(ud.name);
}
I swear, this is the last time i will bother explaining that it is broken...
It is not broken... you're just expecting it to do something it wasn't designed to do. Why is using one Armor class so hard? You can just adjust by weapon, like I did in NanoBlobs... no problems. If you have a very special case you need a very special value for, then create that special case. It's not that hard
- PauloMorfeo
- Posts: 2004
- Joined: 15 Dec 2004, 20:53
- The documentation in the wiki explains diferently.Argh wrote:It is not broken... you're just expecting it to do something it wasn't designed to do. ...
- It was meant to work diferently (don't know how it actually did in oTA).
- It sucks...
And it sucks because, imagine this: i have a Bulldog. I want it to belong to all of these classes:Argh wrote:... Why is using one Armor class so hard? ...
- GroundUnits
- BattleTanks
- Lvl2Units
- Lvl2BattleTanks
So i can make weapons give dif dmg to all ground units, or only to battletanks, or ..., or ...
Not that it bothers me that much, you know, because i have always been all for using the least amount (few or none) of special damages. (i don't like rock/paper/scissors) But i think it is important to be noted because i know for sure that newcoming moderss, like the original poster, will try to put units into more than one class in armor.txt and will end up wondering why it doesn't works (if it notices at all).
Well, multiple armour classes does create the problem of which to choose when a weapon has damages defined for two different classes that the target is both a member of.
Really, single class would be enough _if_ your classes and various other stats are being generated through an external script. If you're hand coding, it's not really expressive enough if you have complex armour classing system.
Really, single class would be enough _if_ your classes and various other stats are being generated through an external script. If you're hand coding, it's not really expressive enough if you have complex armour classing system.
Paulo... if you have a Bulldog, and you need it to have a very special class... just make a class called "Bulldog"... add it to the weapons... and you're done. Then the Bulldog either takes default damage, or Bulldog damage, if it exists. This is how it was done in OTA, and since weapons can only apply one type of damage to one type of object, I still don't see the problem here.
If you assigned a Bulldog to multiple damage categories, then... how would the engine decide which one to apply? For example:
The first one? The last one? A random one? Give me a break! If you really need to have that Bulldog take special damage from a certain weapon, make class like this:
[BULLDOG]
{
Bulldog=99;
}
Then have any weapons that do special damage to the Bulldog have a Bulldog category in their damage table, otherwise have them do default It's really that easy. I don't see adding a Bulldog category, in the very few cases that might call for it in a mod that doesn't make very strong use of RPS balance ... as a major big deal. In NanoBlobs, where I do very strongly make use of RPS, I solved the problem by simply thinking through my categories logically, and reducing them to the lowest possible number that made game-design sense. Any small wrinkles that showed up are soooooo easily corrected by hitpoint adjustments to the unit that is having problems that it really isn't an issue at all.
If you assigned a Bulldog to multiple damage categories, then... how would the engine decide which one to apply? For example:
Code: Select all
[DAMAGE]
{
default=1000;
GroundUnits=200;
BattleTanks=2000;
Lvl2Units=1500;
Lvl2BattleTanks=1000;
}
[BULLDOG]
{
Bulldog=99;
}
Then have any weapons that do special damage to the Bulldog have a Bulldog category in their damage table, otherwise have them do default It's really that easy. I don't see adding a Bulldog category, in the very few cases that might call for it in a mod that doesn't make very strong use of RPS balance ... as a major big deal. In NanoBlobs, where I do very strongly make use of RPS, I solved the problem by simply thinking through my categories logically, and reducing them to the lowest possible number that made game-design sense. Any small wrinkles that showed up are soooooo easily corrected by hitpoint adjustments to the unit that is having problems that it really isn't an issue at all.
I am going to have flesh, light, heavy, and fortified armors
Flesh is kinda simple, huh?
Light covers light vehicles and airplanes.
Heavy covers my tanks and other stuff.
Fortified is for buildings and extremely large units..
Flesh is kinda simple, huh?
Light covers light vehicles and airplanes.
Heavy covers my tanks and other stuff.
Fortified is for buildings and extremely large units..
Last edited by Snipawolf on 28 Oct 2006, 00:58, edited 1 time in total.
As Argh says, units can only exist in one category if you want things to work right. That's all there is to it.
The reason the wiki says otherwise can be found in the list of users who contributed to that particular page and the dates on which they did so. They were individuals who had little or not experience in modding Spring at the time.
The reason the wiki says otherwise can be found in the list of users who contributed to that particular page and the dates on which they did so. They were individuals who had little or not experience in modding Spring at the time.