Hard Light Productions Forums

Modding, Mission Design, and Coding => FS2 Open Coding - The Source Code Project (SCP) => Topic started by: Wanderer on October 04, 2005, 07:11:49 am

Title: Problem with armor.tbl
Post by: Wanderer on October 04, 2005, 07:11:49 am
I tried to build a functional armor system using the samples from the fsdoc. First of all, table should be named armor.tbl not armour.tbl (like its in the fsdoc), all 'calculation type:'s should be just 'calculation:'s (according to table errors) but thats not the true issue.

I finally got it to a state where i didn't got table errors but then i really didn't get functional armor either.

Shortened armor.tbl:

#Armor Type
$Name: Medium30

$Damage Type:  Standard
+Calculation: Additive
+Value: -30
+Calculation: Cutoff
+Value: 0

$Damage Type: Test
+Calculation: Additive
+Value: 8000
#End

I also made the required changes to the weapons.tbl and ships.tbl but i really did't see any difference. I'm using mainly 20/09 build. The entries didn't change anything.

This is propably result of one (or few) of my own tabling mishaps but could some one point it out for me so that i could fix it?
Title: Problem with armor.tbl
Post by: FireCrack on October 04, 2005, 07:24:47 am
Is cutoff a valid calculation?
Title: Problem with armor.tbl
Post by: Wanderer on October 04, 2005, 08:20:41 am
According to this (http://www.hard-light.net/forums/index.php/topic,32796.0.html), it should be. Or was that stuff something that was never implemented?

If i do not use the 'cutoff' are the weapons going to heal the target (ie. cause negative dmage)?

EDIT: Retried this with following entries

EDIT: EDIT: Removed until i can thoroughly test it. Trying to find what went wrong.
Title: Re: Problem with armor.tbl
Post by: Goober5000 on October 04, 2005, 09:59:29 am
Quote
Originally posted by Wanderer
First of all, table should be named armor.tbl not armour.tbl (like its in the fsdoc)
:lol: What should be done is this: the game checks for both, and then reads whichever one it finds. ;)
Title: Problem with armor.tbl
Post by: FireCrack on October 04, 2005, 10:12:25 am
Hmm.. neat, but is there realy a pooint for reverse cutoffs? couldn't uou just pultiply by -1 first?
Title: Problem with armor.tbl
Post by: Wanderer on October 04, 2005, 10:18:13 am
Hmm i got it to work if i have only one entry in the armor.tbl (cruiser took total of four hits before exploding as expected). However if there are two or more entries none of them works. I mean i couldn't get two different damage types to work.

And it seems that negative damage doesn't heal the target so i can drop the 'cutoff' away.

Goober5000: What i meant is that it doens't work with file named armour.tbl. I really don't care if people want to use armor.tbl or armour.tbl. I would just like to have a functional armo(u)r.tbl,

though i like the armor is better ;)
Title: Problem with armor.tbl
Post by: karajorma on October 04, 2005, 10:57:05 am
What happens when you run this in a FRED debug build with two entries? What about with one?

It sounds like the parser is looking for another entry it can't find to me.
Title: Problem with armor.tbl
Post by: deep_eyes on October 04, 2005, 11:00:33 am
wtf did we get armor .tbl>???

oo i feel like a nub now...
Title: Problem with armor.tbl
Post by: Wanderer on October 04, 2005, 11:47:12 am
Result with FRED-d:

Warning: Invalid armor name Heavy200 specified in ship class GTPc Aeolus
File:C:\fs2_open\code\ship\Ship.cpp
Line: 2715
[This filename points to the location of a file on the computer that built this executable]

Call stack:
------------------------------------------------------------------
    fred2_open_d-20050929.exe 005039b2()
    fred2_open_d-20050929.exe 00503cfe()
    fred2_open_d-20050929.exe 0044fc2d()
    fred2_open_d-20050929.exe 00448141()
    fred2_open_d-20050929.exe 009110c2()
    fred2_open_d-20050929.exe 00910a24()
    fred2_open_d-20050929.exe 0090e5c9()
    fred2_open_d-20050929.exe 0090ea65()
    USER32.dll 77d38734()
    USER32.dll 77d3d05b()
    USER32.dll 77d3b4c0()
    USER32.dll 77d3fd29()
    ntdll.dll 7c90eae3()
    USER32.dll 77d401f7()
    USER32.dll 77d40291()
------------------------------------------------------------------

Armor.tbl:
#Armor Type
$Name: Heavy200
$Damage Type: Standard
        +Calculation: Additive
        +Value: 100000
$Damage Type: Tavallinen
        +Calculation: Additive
        +Value: -100000
#End

Entry in ships.tbl is
$Armor Type: Heavy200

It seemed to drop the same debug report every time, no matter what was written to the armor.tbl

Once i removed the armor entry from the ships.tbl it didn't complain about anything anymore.

EDIT: I also tried with single entry and two different entries for same armor type (with different damage types).
Title: Problem with armor.tbl
Post by: Kazan on October 04, 2005, 12:09:53 pm
sounds like a bug
Title: Problem with armor.tbl
Post by: WMCoolmon on October 04, 2005, 10:23:10 pm
M-m-m-mantis it!

Can't think up anything off the top of my head to cause this. But I'll take a look at it.
Title: Problem with armor.tbl
Post by: Wanderer on October 04, 2005, 11:57:38 pm
Reported to Mantis, bug nro.  0000574

Using multiple calculations seems to be OK, if they are under the only damage type entry.
Title: Problem with armor.tbl
Post by: WMCoolmon on October 13, 2005, 08:51:10 pm
While checking over the code, I found this little gem:

Code: [Select]
void parse_armor_type()
{
char name_buf[NAME_LENGTH];
ArmorType tat("");

required_string("$Name:");
stuff_string(name_buf, F_NAME, NULL);

tat = ArmorType(name_buf);

//now parse the actual table
tat.ParseData();

//Add it to global armor types
Armor_types.push_back(tat);
}
Title: Problem with armor.tbl
Post by: Wanderer on October 14, 2005, 12:35:24 am
With few quick tests armor.tbl seems to work properly with CVS build 13/10
Title: Problem with armor.tbl
Post by: WMCoolmon on October 14, 2005, 02:15:42 am
Aesome. :) It turned out to be a fairly simple bug...I accidentally cleared damage types inside the parsing loop, rather than before it, so every time a damage type was parsed it would clear everything.
Title: Problem with armor.tbl
Post by: Wanderer on October 16, 2005, 02:26:40 pm
I now did a more complete test with the armor.tbl and found that it still doesn't read the second or later damage type entries under the same armor type entry. However the first one in the list works fine even if the later ones doesn't work:

#Armor Type
$Name: Heavy25
$Damage Type: Piercing
        +Calculation: Additive
        +Value: 10000
$Damage Type: Standard
        +Calculation: Additive
        +Value: -25
$Damage Type: Penetrating
        +Calculation: Additive
        +Value: 10000
#End

I tested it by giving the armor to a friendly cruiser and then shooting it a couple of times with weapon that had properly set damage type.

With the above the cruiser took over 10000+ damage with 'Piercing' weapons but only normal damage from 'Penetrating' weapons. If i would swap the names the 'Piercing' wouldn't do anything etc.

Even setting every damage type under their own armor type entry (each damage & armor pairs had their own entries armor type & end) didn't help. Current tests were done with CVS 13/10 and 16/10. Sorry that i missed this when i was testing armor table, I checked only the general function and that multiple armor types were functional.

:hammer:
:ick:

Currently it works with different armor type entries (i have about 30 of them) with each of them having only single damage type entry included (i would like to use atleast three). It wouldn't hurt to have some one else to test the table as well... :nervous:

EDIT: ...with each of them having only single damage type entry included... ...with each of them having only single functional damage type entry...