DayZ
Community-Online-Tools
elanc 2020년 9월 11일 오전 2시 52분
simple python script for generate vehicles sets from TraderVehicleParts
import os import sys original_stdout = sys.stdout if not os.path.exists('result'): os.makedirs('result') data = {} vehicle = "" parts = [] inputfile = open("TraderVehicleParts.txt", "r") inputlines = inputfile.readlines() inputfile.close() for line in inputlines: line = line.strip() index = line.find("//") if index == 0: continue if index != -1: line = line[:index].strip() index = line.find("<VehicleParts>") if index != -1: if vehicle != "": data[vehicle] = parts.copy() parts.clear() vehicle = line[index + 14:].strip() continue if line.find("<") == 0 or len(line) == 0: continue parts.append(line) data[vehicle] = parts.copy() parts.clear() for key in data: with open("result/%s.json" % key, 'w') as outputfile: sys.stdout = outputfile print("""{ "VehicleName": \"""", end='') print(key, end='') print("""", "DisplayName": "", "Parts": [""") length = len(data[key]) parts = data[key] for i in range(length): print(" \"%s\"" % (parts), end="")
if i + 1 != length:
print(",", end="")
print("")
print(""" ]
}""", end='');
sys.stdout = original_stdout
outputfile.close()
elanc 님이 마지막으로 수정; 2020년 9월 11일 오전 2시 54분
< >
전체 댓글 6개 중 1~6개 표시 중
Matrix 2020년 9월 17일 오후 3시 20분 
what file do you post that in?
Matrix 2020년 9월 24일 오전 5시 16분 
Does this also work if i want to spawn a helicopter???
elanc 2020년 9월 24일 오전 6시 43분 
matrix501 님이 먼저 게시:
Does this also work if i want to spawn a helicopter???
if you can buy helicopter at trader then that will work..
Matrix 2020년 9월 24일 오전 8시 37분 
i'm sorry i should have been more clear in my question what i mean is can i spawn a helicopter in single player offline mode? Or is this made for online only?
Matrix 님이 마지막으로 수정; 2020년 9월 24일 오전 8시 37분
elanc 2020년 9월 24일 오후 1시 06분 
matrix501 님이 먼저 게시:
i'm sorry i should have been more clear in my question what i mean is can i spawn a helicopter in single player offline mode? Or is this made for online only?
sorry! my english is bad.. my script was created for convert files of Trader mod to COT vehicle's sets..
Matrix 2020년 9월 25일 오전 5시 31분 
Oh ok thank you! Now i understand why it's not working it was never meant for offline single player! Thank you letting me know!
< >
전체 댓글 6개 중 1~6개 표시 중
페이지당 표시 개수: 1530 50