Install Steam
login
|
language
简体中文 (Simplified Chinese)
繁體中文 (Traditional Chinese)
日本語 (Japanese)
한국어 (Korean)
ไทย (Thai)
Български (Bulgarian)
Čeština (Czech)
Dansk (Danish)
Deutsch (German)
Español - España (Spanish - Spain)
Español - Latinoamérica (Spanish - Latin America)
Ελληνικά (Greek)
Français (French)
Italiano (Italian)
Bahasa Indonesia (Indonesian)
Magyar (Hungarian)
Nederlands (Dutch)
Norsk (Norwegian)
Polski (Polish)
Português (Portuguese - Portugal)
Português - Brasil (Portuguese - Brazil)
Română (Romanian)
Русский (Russian)
Suomi (Finnish)
Svenska (Swedish)
Türkçe (Turkish)
Tiếng Việt (Vietnamese)
Українська (Ukrainian)
Report a translation problem
Maybe it works after you reinstall both mods; the map and the mod...?
And then:
- Start Transport Fever 2
- Click FREE GAME
- Click PLAY MAP
- Select War Express. Make sure there is only 1 mod listed in the mod list (the war express mod).
- Click START.
Does it still crash?
After checking file integrity and again reinstalling the map and the mod, the game still uploading into the map crashes before the map loads in.
This is hard for me to fix because I don't have this problem on my pc. Could you change the following code in the war_express.lua file, which is situated in C:/Users/Owner/AppData/Roaming/Transport Fever 2/mods/2329762188_mod_for_the_war_express_3_0/res/config/game_script/war_express.lua or "C:\Program Files (x86)\Steam\steamapps\workshop\content\1066780\2329762188\res\config\game_script\war_express.lua" or something similar:
OLD:
for _,quest in pairs(gui_info.quests) do
battles[quest.entity] = true
end
NEW:
if gui_info.quests ~= nil then
for _,quest in pairs(gui_info.quests) do
battles[quest.entity] = true
end
end
Does it still crash? And if so, could you post the error message?
OLD:
-- Post news in popup
if #gui_info.news_for_gui > last_popup and gui_info.news_for_gui then
NEW:
-- Post news in popup
if gui_info.news_for_gui ~= nil then
if #gui_info.news_for_gui > last_popup and gui_info.news_for_gui then
OLD:
gui_info.news_for_gui = {}
end
end
-- Time and speed
NEW:
gui_info.news_for_gui = {}
end
end
end
-- Time and speed
Let me know :)
https://imgur.com/12UUPYE
OLD
if data_to_save ~= nil then
-- Check quest progress: if battle is won or lost
NEW
if data_to_save ~= nil then
if data_to_save.quests ~= nil then
-- Check quest progress: if battle is won or lost
OLD
end
end
end
end
end,
save = function()
NEW
end
end
end
end
end
end,
save = function()
if data_to_save ~= nil then
if data_to_save.quests ~= nil then
-- Check quest progress: if battle is won or lost
local quests_completed = {}
for quest_no,quest in pairs(data_to_save.quests) do
if current_date.day == quest.day and current_date.month == quest.month and current_date.year == quest.year then
-- Battle lost
api.cmd.sendCommand(api.cmd.make.setName(game.interface.getEntity(quest.entity).simBuildings[1], 'Battlefront '..quest.from_city..'-'..quest.to_city))
city_surrenders(quest.from_city, data_to_save.opposite_side)
city_surrenders(quest.to_city, data_to_save.opposite_side)
quests_completed[quest_no] = true
elseif os.time({day=current_date.day, month=current_date.month, year=current_date.year+100}) < os.time({day=quest.day, month=quest.month, year=quest.year+100}) and game.interface.getEntity(quest.entity).params.productionLevel >= quest.level then
-- Battle won
api.cmd.sendCommand(api.cmd.make.setName(game.interface.getEntity(quest.entity).simBuildings[1], 'Battlefront '..quest.from_city..'-'..quest.to_city))
city_surrenders(quest.from_city, data_to_save.side)
city_surrenders(quest.to_city, data_to_save.side)
quests_completed[quest_no] = true
end
end
for quest_no,_ in pairs(quests_completed) do
data_to_save.quests[quest_no] = nil
end
-- Make new quests (being attacked)
math.randomseed(os.time())
if current_date.day == 1 and params.quest_months[current_date.month] == true then
local yearmonth = tostring(current_date.year).."-"..tostring(current_date.month)
if data_to_save.quest_months_done[yearmonth] == nil then
local warfronts = {}
for from_city,cities in pairs(params.industries.battlefront) do
for to_city,entity in pairs(cities) do
if data_to_save.side_per_city[from_city] ~= data_to_save.side_per_city[to_city] then
local entity_found = false
for _,quest in pairs(data_to_save.quests) do
if quest.entity == entity then
entity_found = true
end
end
if entity_found == false then
warfronts[#warfronts+1] = {entity=entity, from_city=from_city, to_city=to_city}
end
end
end
end
if #warfronts > 0 then
local warfront = warfronts[math.random(1,#warfronts)]
new_quest(warfront, false)
end
end
data_to_save.quest_months_done[yearmonth] = true
end
-- Make new quests (attacking)
for from_city,cities in pairs(params.industries.battlefront) do
for to_city,entity in pairs(cities) do
if data_to_save.side_per_city[from_city] ~= data_to_save.side_per_city[to_city] then
if #api.engine.system.simCargoSystem.getSimCargosForTarget(entity) > 0 then
local entity_found = false
for _,quest in pairs(data_to_save.quests) do
if quest.entity == entity then
entity_found = true
end
end
if entity_found == false then
warfront = {entity=entity, from_city=from_city, to_city=to_city}
-- Attacked city found
new_quest(warfront, true)
end
end
end
end
end
-- Check for vehicles in opponents area
local cost = 0
local model_id = nil
local cond = 1
local price = 0
local vehicles_to_destroy = {}
for _,vehicle in pairs(game.interface.getVehicles()) do
for zone,area in pairs(params.zones) do
if data_to_save.side_per_city[zone] ~= data_to_save.side then
if polygonutil.contains(area,game.interface.getEntity(vehicle).position) then
cost = 0
-- Get costs
for _,vehicle_table in pairs(game.interface.getEntity(vehicle).vehicles) do
if vehicle_table then
model_id = api.res.modelRep.find(vehicle_table.fileName)
if model_id then
price = api.res.modelRep.get(model_id).metadata.cost.price or 0
cond = vehicle_table.condition or 1
cost = cost + cond * price
end
end
end
vehicles_to_destroy[vehicle] = cost
end
end
end
end
local vehicles_destroyed = 0
for vehicle,cost in pairs(vehicles_to_destroy) do
-- Sell vehicle
api.cmd.sendCommand(api.cmd.make.sellVehicle(vehicle))
-- Book costs
game.interface.book(-cost, false)
vehicles_destroyed = vehicles_destroyed + 1
end
if vehicles_destroyed == 1 then
data_to_save.news_for_gui[#data_to_save.news_for_gui+1] = {entity = nil, text = tostring(vehicles_destroyed)..' of your vehicles was destroyed by the '
..data_to_save.opposite_side..' forces! Do not operate vehicles in their territory.', music='missionFailure'}
elseif vehicles_destroyed > 1 then
data_to_save.news_for_gui[#data_to_save.news_for_gui+1] = {entity = nil, text = tostring(vehicles_destroyed)..' of your vehicles were destroyed by the '
..data_to_save.opposite_side..' forces! Do not operate vehicles in their territory.', music='missionFailure'}
end
-- Check of the player has won or lost the war
if current_date.year > params.start_date.year then
if data_to_save.war_over == false then
local war_lost = true
local war_won = true
for city,side in pairs(data_to_save.side_per_city) do
if side == data_to_save.side then
war_lost = false
else
war_won = false
end
end
local number_of_days = math.floor(os.difftime(
os.time({day=current_date.day, month=current_date.month, year=current_date.year+100,}),
os.time({day=params.start_date.day, month=params.start_date.month, year=params.start_date.year+100,})
) / (24*60*60))
if war_lost == true then
data_to_save.news_for_gui[#data_to_save.news_for_gui+1] = {entity = nil, text = 'You lost the war after '..tostring(number_of_days)..
' days! Europe is now ruled by the '..data_to_save.opposite_side..' forces... Try again another time. Thanks for playing War Express.', music='missionFailure'}
data_to_save.war_over = true
end
if war_won == true then
data_to_save.news_for_gui[#data_to_save.news_for_gui+1] = {entity = nil, text = 'Congratulations, you won the war after '..tostring(number_of_days)..
' days! Thanks to you, the '..data_to_save.side..' forces emerged victorious. Peace has returned to Europe: from now on, it is free play. '..
'Thanks for playing War Express!', music='missionSuccess'}
data_to_save.war_over = true
end
end
end
end
end
end,
save = function()
-- Send news to GUI
return data_to_save
end,