Page 1 of 1

Popup messages

Posted: Sun Jul 19, 2020 12:13 pm
by nexusno2000
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?

Re: Popup messages

Posted: Tue Jul 21, 2020 8:33 am
by peterw
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.

Re: Popup messages

Posted: Tue Jul 21, 2020 9:03 am
by nexusno2000
peterw wrote:
Tue Jul 21, 2020 8:33 am
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.
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.

Re: Popup messages

Posted: Thu Jul 23, 2020 6:04 am
by peterw
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

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( -- 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!

MessageBox(titel, message1) -- Ausgabe Nachricht