Author Topic: Problem with armor.tbl  (Read 2489 times)

0 Members and 1 Guest are viewing this topic.

Offline Wanderer

  • Wiki Warrior
  • 211
  • Mostly harmless
Problem with armor.tbl
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?
Do not meddle in the affairs of coders for they are soggy and hard to light

 

Offline FireCrack

  • 210
  • meh...
Is cutoff a valid calculation?
actualy, mabye not.
"When ink and pen in hands of men Inscribe your form, bipedal P They draw an altar on which God has slaughtered all stability, no eyes could ever soak in all the places you anoint, and yet to see you all at once we only need the point. Flirting with infinity, your geometric progeny that fit inside you oh so tight with triangles that feel so right."
3.141592653589793238462643383279502884197169399375105820974944 59230781640628620899862803482534211706...
"Your ever-constant homily says flaw is discipline, the patron saint of imperfection frees us from our sin. And if our transcendental lift shall find a final floor, then Man will know the death of God where wonder was before."

 

Offline Wanderer

  • Wiki Warrior
  • 211
  • Mostly harmless
According to this, 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.
« Last Edit: October 04, 2005, 09:48:12 am by 2625 »
Do not meddle in the affairs of coders for they are soggy and hard to light

 

Offline Goober5000

  • HLP Loremaster
  • Moderator
  • 214
    • Goober5000 Productions
Re: Problem with armor.tbl
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. ;)

 

Offline FireCrack

  • 210
  • meh...
Hmm.. neat, but is there realy a pooint for reverse cutoffs? couldn't uou just pultiply by -1 first?
actualy, mabye not.
"When ink and pen in hands of men Inscribe your form, bipedal P They draw an altar on which God has slaughtered all stability, no eyes could ever soak in all the places you anoint, and yet to see you all at once we only need the point. Flirting with infinity, your geometric progeny that fit inside you oh so tight with triangles that feel so right."
3.141592653589793238462643383279502884197169399375105820974944 59230781640628620899862803482534211706...
"Your ever-constant homily says flaw is discipline, the patron saint of imperfection frees us from our sin. And if our transcendental lift shall find a final floor, then Man will know the death of God where wonder was before."

 

Offline Wanderer

  • Wiki Warrior
  • 211
  • Mostly harmless
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 ;)
Do not meddle in the affairs of coders for they are soggy and hard to light

 

Offline karajorma

  • King Louie - Jungle VIP
  • Administrator
  • 214
    • Karajorma's Freespace FAQ
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.
Karajorma's Freespace FAQ. It's almost like asking me yourself.

[ Diaspora ] - [ Seeds Of Rebellion ] - [ Mind Games ]

 
wtf did we get armor .tbl>???

oo i feel like a nub now...

 

Offline Wanderer

  • Wiki Warrior
  • 211
  • Mostly harmless
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).
« Last Edit: October 04, 2005, 12:21:32 pm by 2625 »
Do not meddle in the affairs of coders for they are soggy and hard to light

 

Offline Kazan

  • PCS2 Wizard
  • 212
  • Soul lives in the Mountains
    • http://alliance.sourceforge.net
sounds like a bug
PCS2 2.0.3 | POF CS2 wiki page | Important PCS2 Threads | PCS2 Mantis

"The Mountains are calling, and I must go" - John Muir

 

Offline WMCoolmon

  • Purveyor of space crack
  • 213
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.
-C

 

Offline Wanderer

  • Wiki Warrior
  • 211
  • Mostly harmless
Reported to Mantis, bug nro.  0000574

Using multiple calculations seems to be OK, if they are under the only damage type entry.
Do not meddle in the affairs of coders for they are soggy and hard to light

 

Offline WMCoolmon

  • Purveyor of space crack
  • 213
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);
}
-C

 

Offline Wanderer

  • Wiki Warrior
  • 211
  • Mostly harmless
With few quick tests armor.tbl seems to work properly with CVS build 13/10
Do not meddle in the affairs of coders for they are soggy and hard to light

 

Offline WMCoolmon

  • Purveyor of space crack
  • 213
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.
-C

  

Offline Wanderer

  • Wiki Warrior
  • 211
  • Mostly harmless
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...
« Last Edit: October 16, 2005, 04:45:11 pm by 2625 »
Do not meddle in the affairs of coders for they are soggy and hard to light