UI reverts upon loading game

I’ve done exactly what Rayya’s Children does in their manifest and all works fine until I save the game and load it again. Expected results would be to still see my UI changes the same way Rayya’s Children does.

box_o_vox = {
constants = require ‘constants’
}
local player_service_trace = nil

local function check_override_ui(players, player_id)
– Load ui mod
if not player_id then
player_id = _radiant.client.get_player_id()
end

local client_player = players[player_id]
if client_player then
if client_player.kingdom == “box_o_vox:kingdoms:boxlings” then
– hot load box_o_vox ui mod
_radiant.res.apply_manifest(“/box_o_vox/ui/manifest.json”)
end
end
end

local function trace_player_service()
_radiant.call(‘stonehearth:get_service’, ‘player’)
:done(function(r)
local player_service = r.result
check_override_ui(player_service:get_data().players)
player_service_trace = player_service:trace(‘box_o_vox ui change’)
:on_changed(function(o)
check_override_ui(player_service:get_data().players)
end)
end)
end

radiant.events.listen(box_o_vox, ‘radiant:init’, function()
radiant.events.listen(radiant, ‘radiant:client:server_ready’, function()
trace_player_service()
end)
end)

return box_o_vox

No clue why mine won’t display once I reload a saved game. Thanks in advance to anyone who knows a thing :wink:

Probably something in the ui manifest

again mine is essentially identical to Rayya’s Children with the only differences being my file names instead of “rayyas_children” So I’m really confused.

You need a different namespace and add this:

  "deferred_load": true,
  "client_only": true,
1 Like

I didn’t have

“client_only”: true

I’ll try that now

I don’t think client_only should matter, unless I misunderstand what it does. My understanding is that it tells the game that the mod only interacts with the client part of the game, not the server part (different from client/host for multiplayer). But I don’t think it enables any mod functionality, only limits it (so that it ideally can be used in multiplayer situations where the host doesn’t have to run it).

Well I don’t understand how any of it works… I’m very derpy derp_112x112(VECTOR) but adding that client_only fixed it. So thanks very much @BrunoSupremo legit you have been so much help to this mod :wink:

3 Likes