Server INI list for client HUDs

Discussions about Coding and Scripting
User avatar
Barbie
Godlike
Posts: 3313
Joined: Fri Sep 25, 2015 9:01 pm
Location: moved without proper hashing

Server INI list for client HUDs

Post by Barbie »

I'd like to maintain a list of inventory items and their properties (mainly charge time multiplier) so that client HUDs can display inventory properly. Just defining an (config) array in a custom HUD does not work, because it is owned by clients and so the INI file is read local, but the array items have to be defined on server.

Maybe one solution is to define an extra Actor containing the array and replicate it to clients - will this work?
Or is there even another option?

FYI: This reads the array from client's USER.INI:

Code: Select all

class HUDSB expands ChallengeTeamHUD;

struct TChargedInventory {
	var string	AClass;
	var byte	ChargeMultiplicator;
	var byte	ChargeAttention; // Warning: soon running out (default 10)
	var byte	ChargeExhausted; // Alert: running out (default 5)
};
var config TChargedInventory ChargedInventories[8];
"If Origin not in center it be not in center." --Buggie
Buggie
Godlike
Posts: 3547
Joined: Sat Mar 21, 2020 5:32 am

Re: Server INI list for client HUDs

Post by Buggie »

HUD spawn and work on client. So if you need something from server, you need make separate actor which populate info to clients, via replication.

Also, keep in mind, mix replication with config modifier on same variables not goes well.
So you need two pair of variables per each setting.
One is config, second for replication.
Or replication will not work properly.