Company of Heroes: Eastern Front

Author Topic: Some noob questions about modding(EDITED)  (Read 4791 times)

Offline Trebgarta

  • Ingenery
  • *
  • Posts: 13
    • View Profile
Some noob questions about modding(EDITED)
« on: October 18, 2014, 08:14:42 PM »
I really love your mod, but it, along with vCoH, always felt too arcade for me. So I just figured out I'd try sub-modding for myself. I know nearly nothing, and I've just started messing with corsix. Who knows, maybe it may escalate, and I might upload it as a submod one day! (If you guys let me to ofc  ;D)

So, I just made conscripts 12 men, and they only got 4 rifles, 7(or 8, I didnt count,I mean the original number) with upgrade. How can I make the normal number 9, and upgrade number 12?

And, maybe this will be asking for a lot but, if I wanted to add a smoke grenade ability to the squad , what should I do?


Thanks in advance and, if you know some, any tutorial other than corsix webpage would be really appreciated.

Thanks again!

EDIT:
I found a way to those problems posted above, now they sound rather dumb because it was easy and really basic. Now my new question probably is too, but I couldn't manage to find a way for it.

I dont understand target tables. I really dont. I mean, I get that they modify weapon stats with modifiers when target is different, but I cant manage to do it. I gave  panzerfaust 10 times damage against tp_vehicle, yet it still does really low damage. I mean, 120 times 10 is 1200, and a t34 has 600ish health, so it should one shot.

If I was to add a new "type", how would I do that? like, If I added soviet_tank to types of t34, and added a tp_soviet_tank child for panzerfaust target boards, it feels like I am missing a step. I didnt try this yet, but I dont think it iwll work; there should be a rgd file somewhere to be the reference of tp_soviet_tank, right?
« Last Edit: October 20, 2014, 04:46:00 PM by Trebgarta »

Offline Hendrik 'DarcReaver' S.

  • Administrator
  • Poster of the Soviet Union
  • *
  • Posts: 2503
  • ...Fear my Arty...
    • View Profile
Re: Some noob questions about modding(EDITED)
« Reply #1 on: October 21, 2014, 10:40:56 AM »
Adding new target tables to vehicles is a bit more complicated. You not only need to add a target type to the vehicle/unit, but you need to add it to ALL weapons, also (all axis and allied rifles, grenades, tank guns etc.). So, you're better off editing the ones you have already ;)

When we're forced to do this for a new weapon/unit, we use a macro that does this automatically, as there are hundreds of entries to be made for each new target type.

However, if you want to understand the System I'll give you a short Explanation:


Damage from weapons depends on 5 things:

- raw damage value (General damage the weapon deals)
- Area of effect modifiers (how large the area is in which the damage is dealt)
- deflection value (damage the weapon does when the shot doesn't penetrate/bounces off the hull)
- base Penetration (multiplicator for the cover tables)
- Modifiers from target tables

So, in general it's like this:

If penetrates:

raw damage x area of effect modifier x damage modifier from target table = damage against the targeted unit/vehicle

if it doesn't penetrate:

raw damage x area of effect modifier x deflection damage = damage against unit/vehicle

Note: the area of effect modifier is mostly interesting for Units like StuH, ISU, and artillery in general

About Penetration:

It works like this:


frontal Penetration: Basic Penetration x Penetration modifier (from target table) = Chance to penetrate
rear Penetration: Basic Penetration x Penetration modifier x rear Penetration = Chance to penetrate
example:

base Penetration Long range/medium range/short range: 0.68/0.92/1.6

Modifier Tiger 1: Penetration 0.13, rear Penetration 3.2

weapon Penetration against Tiger armour:

0.68x0.13/0.92x0.13/1.6x0.13=0.088/0.119/0.208 Chance to penetrate the front on Long/medium/short range
0.68x0.13x3.2/0.92x0.13x3.2/1.6x0.13x3.2 = 0.281/0.338/0.665 Chance to penetrate the rear armour.

That's how it works basically.

And for your own Thing (make panzerschreck more powerful vs. t34):

The "types" is just for applying categories to vehicles. You can use it to make certain auras/abilities affect the type of Units.

I.e. a  unit's type is "infantry", then it will be affected by global abilities like Blitzkrieg or inspired assault.

To make Panzerschrecks OP :

Just go into the panzerschreck weapon, then switch into target_tables, and search for tp_armour_t34 (or something similar). Then Change the damage modifier from 1.00 to 10.00 and it will 1 shot t34.

Abuse is abuse and has to go.

Offline Trebgarta

  • Ingenery
  • *
  • Posts: 13
    • View Profile
Re: Some noob questions about modding(EDITED)
« Reply #2 on: October 21, 2014, 07:00:43 PM »
Well, thanks for the answer, but I can't find tp_armour_t34, or anything similar. I suspect the tens of meaningless types there (the ones like 0xF8B60D69) to be the tanks added by the mod , am i right? I look at landser_kar98 values and it has a damage modifier of 0.01 against all of them, so they are most probably tanks, but I am not sure.

EDIT: Thinking again, maybe I don't even need to seperate them, as I want Panzerfaust to be OP against all of them. I just need to know if they are tanks or not.

Offline Hendrik 'DarcReaver' S.

  • Administrator
  • Poster of the Soviet Union
  • *
  • Posts: 2503
  • ...Fear my Arty...
    • View Profile
Re: Some noob questions about modding(EDITED)
« Reply #3 on: October 21, 2014, 07:22:30 PM »
No. I was at work while I wrote the post, that's why I couldn't look up the exact location. The 0xF7DDDSA23 target tables are not used at all.

The armourtype from T34-76 is "tp_armour_soviets_t34", the one for the T34-85 is "tp_armour_soviets_t34_85".

Changes to this armourtype on any weapon has an effect on the T34 tanks.

Abuse is abuse and has to go.

Offline Trebgarta

  • Ingenery
  • *
  • Posts: 13
    • View Profile
Re: Some noob questions about modding(EDITED)
« Reply #4 on: October 21, 2014, 08:00:22 PM »
http://i.imgur.com/AoT1j8N.jpg [nofollow]

This is what I was talking about

There is no tp_armour_soviets on the table, just these.

Offline Hendrik 'DarcReaver' S.

  • Administrator
  • Poster of the Soviet Union
  • *
  • Posts: 2503
  • ...Fear my Arty...
    • View Profile
Re: Some noob questions about modding(EDITED)
« Reply #5 on: October 21, 2014, 08:19:59 PM »
Hmm .. strange. Mine looks different:

Dunno why tho xD

Abuse is abuse and has to go.

Offline Trebgarta

  • Ingenery
  • *
  • Posts: 13
    • View Profile
Re: Some noob questions about modding(EDITED)
« Reply #6 on: October 21, 2014, 08:35:03 PM »
Well...  when you guys didn't answer for like 3 days, I went on and asked about it in the armoury of official forums. There, a senior member called celution said he was an ex-EF developer gave me a txt file including the translation of every 0x00059FDA-like code. It will be rather annoying but, I think I will be able to manage.

Thanks for everything!

EDIT: One last thing! Again, can I safely assume that all of those types are tanks, or are they mixed?

EDIT2: Problems never end. Now, Ive increased jager squad to 6 people and reinforcement ability just wont work. In-game it shows up, can be targeted and done, wastes your resource right but no squad enters the battle. I justrestored vanilla ability just to make sure I didnt screw it up, for no avail, so it is relevant to squad size change. But I dont have a clue why it happens, and how to fix it.
« Last Edit: October 21, 2014, 08:58:30 PM by Trebgarta »

Offline Blackbishop

  • Administrator
  • Poster of the Soviet Union
  • *
  • Posts: 12057
  • Community Manager, Programmer and Kicker
    • View Profile
Re: Some noob questions about modding(EDITED)
« Reply #7 on: October 21, 2014, 09:33:04 PM »
Yes, they are mixed, so you can't just think they are in the same order than how Darc shown it.

Also, if celution gave you the txt file with that stuff, isn't that file used by corsix? I'm not sure why would you suffer if it will load the definitions every time you load Corsix MS.

Some values seems to be wrong(just like 3 or 4), but probably you would never might look at them, so at least that will fix the unknown armour list issue.
Mors Indecepta

Might controls everything, and without strength you cannot protect anything. Let alone yourself...

Offline Trebgarta

  • Ingenery
  • *
  • Posts: 13
    • View Profile
Re: Some noob questions about modding(EDITED)
« Reply #8 on: October 21, 2014, 10:00:14 PM »
Celution gave me the txt seperately, and from the answers I've got from him(asked him several questions too here [nofollow]) It seems like its a problem on my mod studio's end. And I have no clue how to fix it.

If what I think is right, the error is the same like, when you define a help text to be in game UI but it doesnt exist in the Locale, so it just shows the number. So, then there should be some locale like file broken somewhere, am I right?

Offline Blackbishop

  • Administrator
  • Poster of the Soviet Union
  • *
  • Posts: 12057
  • Community Manager, Programmer and Kicker
    • View Profile
Re: Some noob questions about modding(EDITED)
« Reply #9 on: October 21, 2014, 10:29:17 PM »
Have you replaced the regular RGD_DIC.TXT in the "dictionaries" folder inside the Corsix Mod Studio folder you are using to mod? Otherwise it will show hex strings(0x00059FDA-like code) instead of the intended values(border_line_color_g).

If you have more than one Corsix MS folder, perhaps you are using the wrong one?
« Last Edit: October 21, 2014, 10:31:26 PM by Enrique 'Blackbishop' E. »
Mors Indecepta

Might controls everything, and without strength you cannot protect anything. Let alone yourself...

Offline Trebgarta

  • Ingenery
  • *
  • Posts: 13
    • View Profile
Re: Some noob questions about modding(EDITED)
« Reply #10 on: October 21, 2014, 10:52:56 PM »
Well, thanks, I just thought of it before coming here one more time. I shouldve got it before though. I overwritten it, and tp_armour_soviets are now there. Though there are some more strings still, celution had told me it was a bit outdated.

I didnt have a clear grasp on how Corsix worked before asking to celution, thats why I couldnt think of it.

EDIT: I just googled "EF RGD dictionary" out of curiousity (and a little desperation) and found one from last year's february, in an old thread on this forum. It has even more RGD translated than the one Celution gave me, but still, there are 7 entities in total not translated on the target table. (Edit no. 2: I just entered racepbs and there is also more like 15 not-translated stuff there.)

Can you please upload your RGD_DIC? It's a major obstacle for me right now, as I'll overhaul tank combat completely and not knowing what is what is annoying.
« Last Edit: October 22, 2014, 02:39:08 PM by Trebgarta »

Offline Trebgarta

  • Ingenery
  • *
  • Posts: 13
    • View Profile
Re: Some noob questions about modding(EDITED)
« Reply #11 on: October 29, 2014, 08:21:07 PM »
Bumping the thread because it is still relevant with the title, and I couldn't guess what you people would feel if I made another thread within 10 days... the forum isn't really active, you know.

I am trying to tweak the AI, and see stuff like UPG.OSTHEER.OH_T2_MODERN in rules_tech_purchase.ai. When tweaking unit purchase rules, I could guess the unit's name; however, there are new upgrades I have made in mod studio, and the name format, or the names in egneral, are different in .ai files than .rgd files. If I wanted to make a conditional for my upgrade in the AI files to make the AI use the upgrade, I would need the upgrade's name in this format I guess. But I don't know how to determine it.

Thanks in advance!

Offline Jeff 'Robotnik' W.

  • Developer
  • Mr. Spam
  • *
  • Posts: 1961
  • Forum historian
    • View Profile
Re: Some noob questions about modding(EDITED)
« Reply #12 on: October 30, 2014, 12:52:50 AM »
Bumping the thread because it is still relevant with the title, and I couldn't guess what you people would feel if I made another thread within 10 days... the forum isn't really active, you know.

I am trying to tweak the AI, and see stuff like UPG.OSTHEER.OH_T2_MODERN in rules_tech_purchase.ai. When tweaking unit purchase rules, I could guess the unit's name; however, there are new upgrades I have made in mod studio, and the name format, or the names in egneral, are different in .ai files than .rgd files. If I wanted to make a conditional for my upgrade in the AI files to make the AI use the upgrade, I would need the upgrade's name in this format I guess. But I don't know how to determine it.

Thanks in advance!

All of that stuff can be found in the luaconsts.scar file

Offline Trebgarta

  • Ingenery
  • *
  • Posts: 13
    • View Profile
Re: Some noob questions about modding(EDITED)
« Reply #13 on: October 30, 2014, 03:21:56 PM »
I just had my first AI fatal error. YAY!

Can things defined in luaconst not having rules in rules_unit_purchase etc. cause crashes?

What about those stuff defined with .rgd instead of .lua in luaconsts file? Why are they like that, and would it crash when I change it to .lua?

Okay, the error is in luaconsts.  I laoded a backup of yours and it worked. Where may I have done a mistake?

I changed several .rgds into .luas and added 3 new units: a ZIS3 (was surprised it wasnt there, copied from ZIS2 so it shouldn't be a problem I guess)
an AT squad (one I did)
a Kingtiger (again, one I did.)


I fixed that one. Done it again and it worked. Must have been a typo or something.

Now I am trying to implement ATC. Is there anything I should know beforehand? It gives fatal Scar error and I am trying to figure out why.
I knew it wouldn't work, but now I am trying to properly implement it.
« Last Edit: October 30, 2014, 05:07:46 PM by Trebgarta »

Offline Trebgarta

  • Ingenery
  • *
  • Posts: 13
    • View Profile
Re: Some noob questions about modding(EDITED)
« Reply #14 on: October 31, 2014, 09:34:52 PM »
Did ATC and Infantry_Only. Now, infantry_only is plagued by crashes. Dunno why.

Here are all the related files. I would appreciate it if you took a look.

https://www.dropbox.com/s/jukan7ts29nxdsa/crashsample.rar?dl=0 [nofollow]