Matrix Games Forums

Forums  Register  Login  Photo Gallery  Member List  Search  Calendars  FAQ 

My Profile  Inbox  Address Book  My Subscription  My Forums  Log Out

Mod Artillery Names for Gun Type

 
View related threads: (in this forum | in all forums)

Logged in as: Guest
Users viewing this topic: none
  Printable Version
All Forums >> [New Releases from Matrix Games] >> Gary Grigsby's War in the West >> Scenario Design and Modding >> Mod Artillery Names for Gun Type Page: [1]
Login
Message << Older Topic   Newer Topic >>
Mod Artillery Names for Gun Type - 12/18/2020 11:10:45 PM   
GeneralDad

 

Posts: 111
Joined: 1/7/2018
Status: offline
# Python 3 script w/ pandas library.
# Renames US and French artillery so that the gun type is in the unit name.
# eliminates the digging needed to find out what type of guns you have.
# Use with witw editor csv functions.
# Enjoy - maybe I can find time to post some modded scenario files for those
# who don't know python.
# Change filenames for the scenario you want & verify the artillery types in the
# ob file ('_ob' file, OB Types) before running.
# Takes a minute to run.
# Mod this as you wish. You may need to fix the spacing and tabs, due to the forum presentation of the text.
# Some text did not come thru the forum editor, such as i (index var) in square brackets - sorry.
# 'square bracket i close square bracket' is missing in many places after 'iloc' for example.
# If there is interest, I can post the code to GitHub to eliminate the problem.
import pandas as pd

ART_TYPES = {
1367: ' (unk)',
1368: ' (M7-105H)',
1369: ' (M12-155G)',
1370: ' (75PkH)',
1371: ' (75PkH)',
1372: ' (unk)',
1373: ' (105H)',
1374: ' (4.5G)',
1375: ' (155H)',
1376: ' (155G)',
1377: ' (8inH)',
1378: ' (8inG)',
1379: ' (240H)',
1420: ' (105H)',
1421: ' (155G)'
}

df = pd.read_csv(r'C:\Program Files (x86)\Steam\steamapps\common\Gary Grigsbys War in the West\Dat\CSV\1944-45 Campaign (D-Day Start)_unit.csv',
low_memory=False,
encoding='Windows-1252')
unit_names = df['name'].values

for i in df.index:
if df.type.iloc in ART_TYPES.keys():
if df.nat.iloc == 13:
unit_names += ART_TYPES[df.type.iloc]

elif df.nat.iloc == 22:
unit_names += ART_TYPES[df.type.iloc]

df['name'] = unit_names
df.to_csv(r'C:\Program Files (x86)\Steam\steamapps\common\Gary Grigsbys War in the West\Dat\CSV\1944-45 Campaign (D-Day Start)_unit.csv',
index=False,
encoding='Windows-1252')
print('Done!!!')
# Gen Dad

< Message edited by GeneralDad -- 12/18/2020 11:20:32 PM >
Post #: 1
RE: Mod Artillery Names for Gun Type - 12/18/2020 11:13:49 PM   
GeneralDad

 

Posts: 111
Joined: 1/7/2018
Status: offline
Forgot the picture of the result!




Attachment (1)

(in reply to GeneralDad)
Post #: 2
Page:   [1]
All Forums >> [New Releases from Matrix Games] >> Gary Grigsby's War in the West >> Scenario Design and Modding >> Mod Artillery Names for Gun Type Page: [1]
Jump to:





New Messages No New Messages
Hot Topic w/ New Messages Hot Topic w/o New Messages
Locked w/ New Messages Locked w/o New Messages
 Post New Thread
 Reply to Message
 Post New Poll
 Submit Vote
 Delete My Own Post
 Delete My Own Thread
 Rate Posts


Forum Software © ASPPlayground.NET Advanced Edition 2.4.5 ANSI

1.125