Writing to client's log

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

Writing to client's log

Post by Barbie »

I want to write something to client's log only, and not to server's log.
Example: A mutator is running on server and also send to client via ServerPackages. The mutate command should be mirrored to client's log.

Code: Select all

function Mutate(string MutateString, PlayerPawn Sender) {
	log("This should go to Sender's log file: You have issued the mutate command" @ MutateString);
	Super.Mutate(MutateString, Sender);
}
Is there a way without using replication?
"Multiple exclamation marks," he went on, shaking his head, "are a sure sign of a diseased mind." --Terry Pratchett
Buggie
Godlike
Posts: 1921
Joined: Sat Mar 21, 2020 5:32 am

Re: Writing to client's log

Post by Buggie »

No. Mutate call called only on server so you need use replication for send it back.
And you need actor Owned by Sender for do this RPC.
User avatar
sektor2111
Godlike
Posts: 6133
Joined: Sun May 09, 2010 6:15 pm
Location: On the roof.

Re: Writing to client's log

Post by sektor2111 »

Buggie wrote: Wed Apr 14, 2021 12:10 am No. Mutate call called only on server so you need use replication for send it back.
Who said that you cannot spawn a temporary Info actor owned by "Sender" delegated to do some blabbering in client and even to adjust whatever stuff ?
Not only in ModifyPlayer you can assign an inventory or whatever actor having simulated functions and replication declared - THINK OUT of box, boys :mrgreen: .

Other example
You can even load a weapon using mutate command without trashing game with weaponry all over the place - HealGun idea by example is a typical use of a feature which can be heavily abused as long as nobody cares about doing a check before adding X tons of weapons in spot.
I think if you pick up spawned weapon you can see a pickup message - as client. Why would not have a log as well in certain state/situation ? More or less Hard-Coded. Hard-coded stuff natively replicated won't even need any replication block declared - once again, see hooligan mutator who vandalizes doors in CTF-Niven. All need it's a code working authoritative when actor spawned has a native copy in client and aiming client-side.

A message also can be directly sent on Sender's screen too and this won't need anything - messages being replicated by UT ( and is it readable in console later or not ? ).