Tex wrote:atvaark wrote:I took some notes on these files when I was checking out Ground Zeroes in January.
...
Thanks atvaark
Thinking it through more, while it does seem like there's a nice system there, mention of prefabs with names that sound like common ui widgets/controls, but seems most of the actual 'driving' of the uis are in the exe, if evidence from the lua scripts and the last patch are any indication.
In the lua scripts all interaction seems to be via the engine object TppUiCommand, the function names indicate a pretty piecemeal approach to specfic ui functionality rather than any kind of flexible ui control system (or at least if they do they didn't extend it into the lua side).
A few TppUICommand function examples for example
AnnounceLogViewLangId(string langId,langParameter ...) -- can accept a variable number of parameters, which fit into the lang string parameters ala standard string formatting.
SetErrorPopupParam(unknown param)
IsShowPopup()
GetTapeLangIdByTrackId(t)
IsEndMissionTelop()
RegisterIconUniqueInformation{markerId=gameId,iconLangId=iconLangId,goalLangId=goalLangId}
There's a few luas dedicated to uis, but again they are very specifcally set up, likewise there are some that seem to be dedicated to providing specific data for the uis (ie the engine is pulling a lua function rather than lua calling engine), example being all the landing zones from initial deployment.
Anyhoo, not having access to good control over ui is a big limitation.
There was one other thing I was going to ask help for, but I worked out some of it. Basically was wondering how langId like
AnnounceLogViewLangId("announce_map_update")
mapped to lng2(xml) entry
<Entry Key="225449528" Value="Map Info Updated" />
I guessed it would match to the output of an engine function - Fox.StrCode32(string) returns number - that's actually used a lot in the lua (to create numeric indexes to arrays from strings and such as well as said langid use).
Then confirmed it by spitting them through StrCode32 in game (through announcelog so I could see the output).
Though I'm wondering if a decoding function can be worked out by someone if it hasn't already somewhere? It would be useful for debugging, and convenience in creating our own keys without having to run the game every time (though I still have to test adding new strings to lng files with this to see if it actually works)
There's DEBUG_StrCode32ToString, but all that seems to do is set up a reverse lookup table using Fox.StrCode32 to the unencoded string.
Heres some more examples, hopefully no transcription errors
"announce_target_extract
<Entry Key="2225007113" Value="Target Secured" />
"announce_target_eliminate"
<Entry Key="3205446798" Value="Target Eliminated" />
"announce_target_destroy"
<Entry Key="3738767267" Value="Target Destroyed
" />
basically announce_* lang id strings in the lua scripts match in tpp_announce_log.<language>.lng2 . Though now I'm wondering where the ui to particlar lng2 file mapping is. the lng2 is in lang_default_data_<language code>.fpk Ideally we'd be able to add another lng2 file rather than appending to the existing.