Hello everybody!
Can anyone describe how to add console commands to the game? Desirable detail on a simple example.
Thank you.
How to add console commands to the game?
7 posts
Page 1 of 1
Re: How to add console commands to the game?
Go to the folder that has your log.txt and open the game.xml with something like notepad++ and look for a line with development in it, change that and console from false to true and then save the file. Open the game and then tap the key beside 0 and over tab to get the console to appear.
Re: How to add console commands to the game?
I know that. I need information how to create new console commands for the game.Guil wrote: ↑Thu Mar 29, 2018 2:47 pm Go to the folder that has your log.txt and open the game.xml with something like notepad++ and look for a line with development in it, change that and console from false to true and then save the file. Open the game and then tap the key beside 0 and over tab to get the console to appear.
Re: How to add console commands to the game?
There was a mod called "console extension" for FS15 and a really crappy conversion to FS 17, maybe those can help you get further.
Search for those, it's the best hint i can give you. Be aware though, the FS 17 version is probably on one of those not-so-trustworthy sites.
Search for those, it's the best hint i can give you. Be aware though, the FS 17 version is probably on one of those not-so-trustworthy sites.
Tutorials: log.txt, Giants Bilderhoster, erweiterter Texteditor, Konsole (PC) / Direktlink Giants Imagehoster
[PC] [Mac] [XB1] [PS4] in the thread title keeps the Forum clean / im Threadtitel hält das Forum übersichtlich
Playing on PC
[PC] [Mac] [XB1] [PS4] in the thread title keeps the Forum clean / im Threadtitel hält das Forum übersichtlich
Playing on PC
Re: How to add console commands to the game?
This is a clue! I'll look. We will understand the incomprehensible moments here.juf.de wrote: ↑Thu Mar 29, 2018 7:02 pm There was a mod called "console extension" for FS15 and a really crappy conversion to FS 17, maybe those can help you get further.
Search for those, it's the best hint i can give you. Be aware though, the FS 17 version is probably on one of those not-so-trustworthy sites.
Re: How to add console commands to the game?
All perfectly! I figured out how to add my console commands to the game! And to facilitate the life of future generations of programmers under the Farming Simulator I will describe this process in detail.
So. To add your console command to the game, there is a special function with parameters (or procedure, I plainly did not understand yet):
Where:
"Command" - text that will be entered in the console to call the function executing the command.
"Description" - the text that will be displayed when you call help on the command by type: help command.
"Function" - name of the called function executing the command.
"Object" - optional object called by the function (this is what Stefan Geiger writes on the GDN forum: "If you have a global or static function, that needs no "self" parameter, you can have nil as the 4th parameter"). I myself have not yet fully understood the fourth parameter. Who knows exactly correct me if I'm wrong. I will be grateful.
In the end, all the addition of the command to the game is as follows:
The parameters defined in the function are then read from the command you typed by the type: command parameter parameter, etc.
Thank you for helping everyone who helped me with advice in solving this problem.
I apologize for my Google English. I hope this is useful to someone.
So. To add your console command to the game, there is a special function with parameters (or procedure, I plainly did not understand yet):
Code: Select all
addConsoleCommand("command", "description", "function", object);
"Command" - text that will be entered in the console to call the function executing the command.
"Description" - the text that will be displayed when you call help on the command by type: help command.
"Function" - name of the called function executing the command.
"Object" - optional object called by the function (this is what Stefan Geiger writes on the GDN forum: "If you have a global or static function, that needs no "self" parameter, you can have nil as the 4th parameter"). I myself have not yet fully understood the fourth parameter. Who knows exactly correct me if I'm wrong. I will be grateful.
In the end, all the addition of the command to the game is as follows:
Code: Select all
addConsoleCommand("command", "description", "functionName", nil);
function functionName(parameter1, parameter2, ...)
your code
end;
Thank you for helping everyone who helped me with advice in solving this problem.
I apologize for my Google English. I hope this is useful to someone.
Last edited by АНТИКЛАН on Sat Mar 31, 2018 2:21 am, edited 4 times in total.
Re: How to add console commands to the game?
I'm glad to read, you made some progress here.
So we will see some more mods from your side
So we will see some more mods from your side
Tutorials: log.txt, Giants Bilderhoster, erweiterter Texteditor, Konsole (PC) / Direktlink Giants Imagehoster
[PC] [Mac] [XB1] [PS4] in the thread title keeps the Forum clean / im Threadtitel hält das Forum übersichtlich
Playing on PC
[PC] [Mac] [XB1] [PS4] in the thread title keeps the Forum clean / im Threadtitel hält das Forum übersichtlich
Playing on PC
7 posts
Page 1 of 1