Print variables from source code to external file
-
- Posts: 1
- Joined: Sun Oct 31, 2021 9:45 am
Print variables from source code to external file
I'm looking for a method to get variables about a player such as his speed, location from the source file onto a text file or any external file. As goal to get useful information about the players while recording the games with the demomanager I found online. Is this possible to achieve as I'm new into unreal script.
-
- Godlike
- Posts: 3008
- Joined: Fri Sep 25, 2015 9:01 pm
- Location: moved without proper hashing
Re: Print variables from source code to external file
Writing to a free chosen file is not possible in UScript, but you can use the LOG() function to write that to the log file. Ofc you have to extract these lines afterwards.
"If Origin not in center it be not in center." --Buggie
-
- Skilled
- Posts: 178
- Joined: Sat Nov 30, 2019 10:56 pm
Re: Print variables from source code to external file
Now i wonder how NexGen does it... There should be a way...
-
- Experienced
- Posts: 125
- Joined: Mon Oct 19, 2020 6:53 pm
Re: Print variables from source code to external file
This way is a 'native function' in external library on C++.
-
- Godlike
- Posts: 5499
- Joined: Wed Feb 27, 2008 6:24 pm
- Personal rank: Work In Progress
- Location: Liandri
Re: Print variables from source code to external file
Well, technically, you can indeed write to external files using UScript.
There's a whole thread about it, feel free to search it. (:
There's a whole thread about it, feel free to search it. (:
-
- Skilled
- Posts: 178
- Joined: Sat Nov 30, 2019 10:56 pm
Re: Print variables from source code to external file
Of course, with custom external library it is not any problem to do this.
But NexGen does not use any custom external libraries. Maybe there are some undocumented native functions existing in standard libraries...
Automatically merged
No questions here anymore.
Automatically merged
-
- Godlike
- Posts: 3258
- Joined: Sat Mar 21, 2020 5:32 am
Re: Print variables from source code to external file
Pure uscript:
1. Make class with few config text fields, set separate ini file for config.
Each time when need save data call SaveConfig.
2. Or use Log, as mention above.
3. UT able make simple HTTP requests, so you can setup local webserver and call some requests for send data.
4. UT able work with IRC server, so you can setup local IRC server and use it for receive data.
5. Not sure, but look like UT able work with sockets in some way, like it do for query master server. This too can be used for send data.
If this need on server:
6. If you able modify GameType - can send some data as answer for query server.
7. You can use internal web server for answer on requests via HTTP.
1. Make class with few config text fields, set separate ini file for config.
Each time when need save data call SaveConfig.
2. Or use Log, as mention above.
3. UT able make simple HTTP requests, so you can setup local webserver and call some requests for send data.
4. UT able work with IRC server, so you can setup local IRC server and use it for receive data.
5. Not sure, but look like UT able work with sockets in some way, like it do for query master server. This too can be used for send data.
If this need on server:
6. If you able modify GameType - can send some data as answer for query server.
7. You can use internal web server for answer on requests via HTTP.
-
- Godlike
- Posts: 1868
- Joined: Sun Mar 04, 2012 6:47 pm