I'm assuming this subforum is as close to a modding subforum as we get?
I've tried to both change existing and add new strings for tutorial popup boxes, but the changes are not reflected in the game. Indeed, all popupboxes are empty. Is this related to localization? So that I basically can't change/add strings for popup messages?
Popup messages
Moderator: Panzer Corps 2 Moderators
-
- Colonel - Fallschirmjäger
- Posts: 1405
- Joined: Mon Feb 24, 2014 5:15 pm
Popup messages
Green Knight
https://www.youtube.com/c/GreenKnight2001
https://www.youtube.com/c/GreenKnight2001
Re: Popup messages
As far as I know you have to write a LUA script for in-game messages.
But this is not easy to use at all.
But this is not easy to use at all.
My Italian Panzer Corps campaign Italia Victor!:
http://www.streitmacht.com/downloads.php?view=detail&df_id=53
http://www.streitmacht.com/downloads.php?view=detail&df_id=53
-
- Colonel - Fallschirmjäger
- Posts: 1405
- Joined: Mon Feb 24, 2014 5:15 pm
Re: Popup messages
Heard from Rudankort.
Problem: The localization system in Unreal treats US English as just another localization. So if you mod in strings using LUA, the new strings will not be displayed.
Solution: Rename the 'localization' folder (I called mine Xlocalization). Now the game gets strings directly from LUA. The downside is that this effectively kills all localizations. But I play in English anyway, so not really a problem.
Green Knight
https://www.youtube.com/c/GreenKnight2001
https://www.youtube.com/c/GreenKnight2001
Re: Popup messages
As I don't need the ingame messages in English, I solved it with LUA.
In the editor you need to enable it in "Edit -> Triggers".
I used EndTurnAction as condition. It works generally but triggers one round too early.
Addititional to the message I placed a plane (which is the real purpose of my script).
The LUA script can be like (please ignore the German commends behind "--"):
function cond1() -- Bedingung im Editor: Trigger Rundenende
return world.round == 6 -- Runde 5 definieren
end
titel = "Warnung"
message1 = "Es wurden neue Feindflugzeuge im Westen gesichtet."
function F1() -- neue Einheit erzeugen und platzieren + Ausgabe Nachricht
local feld = {3,15} -- Ort
local einheit = "I16" -- ID von I-16, siehe units.csv
local player = world:GetPlayer(1) -- welcher Spieler? (hier: 2.Spieler=Feind)
local create_action = world:MakePurchaseAction(player, einheit, "", 0) -- Einkauf welcher Einheit?
create_action.auxiliary = false -- Hilfs- oder Kerneinheit? (Kerneinheit)
create_action.cost = 0 -- Preis? 0
world:Exec(create_action) -- Kaufaktion!
local unit = world:GetUnit(create_action.id) -- welche Einheit?
local hex = world:GetHex(feld) -- welches Hex?
if (hex:GetUnit(0) == nil) then -- prüfen, ob Hex frei ist
deploy_action = world:MakeDeployAction(unit,feld) -- definieren, was wo platziert wird
world:Exec(deploy_action) -- Platzierung der Einheit!
end
MessageBox(titel, message1) -- Ausgabe Nachricht
end
In the editor you need to enable it in "Edit -> Triggers".
I used EndTurnAction as condition. It works generally but triggers one round too early.
Addititional to the message I placed a plane (which is the real purpose of my script).
The LUA script can be like (please ignore the German commends behind "--"):
function cond1() -- Bedingung im Editor: Trigger Rundenende
return world.round == 6 -- Runde 5 definieren
end
titel = "Warnung"
message1 = "Es wurden neue Feindflugzeuge im Westen gesichtet."
function F1() -- neue Einheit erzeugen und platzieren + Ausgabe Nachricht
local feld = {3,15} -- Ort
local einheit = "I16" -- ID von I-16, siehe units.csv
local player = world:GetPlayer(1) -- welcher Spieler? (hier: 2.Spieler=Feind)
local create_action = world:MakePurchaseAction(player, einheit, "", 0) -- Einkauf welcher Einheit?
create_action.auxiliary = false -- Hilfs- oder Kerneinheit? (Kerneinheit)
create_action.cost = 0 -- Preis? 0
world:Exec(create_action) -- Kaufaktion!
local unit = world:GetUnit(create_action.id) -- welche Einheit?
local hex = world:GetHex(feld) -- welches Hex?
if (hex:GetUnit(0) == nil) then -- prüfen, ob Hex frei ist
deploy_action = world:MakeDeployAction(unit,feld) -- definieren, was wo platziert wird
world:Exec(deploy_action) -- Platzierung der Einheit!
end
MessageBox(titel, message1) -- Ausgabe Nachricht
end
My Italian Panzer Corps campaign Italia Victor!:
http://www.streitmacht.com/downloads.php?view=detail&df_id=53
http://www.streitmacht.com/downloads.php?view=detail&df_id=53