Cargo Export: Difference between revisions

From Veloren Wiki
Content added Content deleted
m (saving progress)
m (Added the page to a category)
 
(14 intermediate revisions by one other user not shown)
Line 1: Line 1:
The guide will cover how to get armor-stats via Cargo command on Windows. Step by step, for real beginner as myself :
The guide will cover how to get the csv of armor-stats via Cargo command on Windows.
Step by step, for real beginner as myself. There is 3 commands for getting the game's data :
* <code>cargo csv-export armor-stats</code>
* <code>cargo csv-export weapon-stats</code>
* <code>cargo csv-export all-items</code>


{{Note| Don't do anything yet, just read those steps}}
Windows


To be able to execute those godsend commands, you need administrator's right and, strictly in this order :
== Installing Cargo ==
#Install Visual Studio Build Tools with :
First, to be able to use any command <code>cargo</code> you need to install Cargo :
#*"Desktop development with C++" So windows 10 SDK is installed.
#*English language pack
#Install Cargo
#And then Install : CMake, Ninja Build System and Python3 using the power shell with this command :
<pre>
iwr -useb get.scoop.sh | iex
scoop install cmake ninja python
</pre>
Once you installed them :
#Install Git and Git LFS
#Create a folder for your game file : .<code>.../MyDocument/Git</code>
#Open the power shell in <code>.../MyDocument/Git</code>
#Clone the game's file from git with :
<pre>
git clone https://gitlab.com/veloren/veloren.git
</pre>
Once the copy is finished :
#go to <code>.../MyDocument/Git/veloren/</code> and open the PowerShell in <code>.../MyDocument/Git/veloren/</code>
#Execute the command and export the table
{{Note|You can also read [https://book.veloren.net/contributors/introduction.html Veloren's manual], let's start !}}
==Installing Visual Studio Build Tool==


If you tried to install first Cargo, you will get this windows :
Cargo is the Rust package manager. Cargo downloads your Rust package's dependencies, compiles your packages, makes distributable packages, and uploads them to crates.io, the Rust community’s package registry. You can contribute to this book on GitHub.
If you didn't understand a word it's fine : It's a librarian that will search a pile of files and put them together to craft your book.
https://doc.rust-lang.org/cargo/getting-started/installation.html


[[File:Veloren_Cargo_Install1.png|link=|alt=Cargo installation's windows when requirements are amiss.]]
It will tell you to download the file : https://win.rustup.rs/


Upon executing this file, you will get this windows :
PICTURE
It tells you :
It tells you :
# Don't install me yet.
#Don't install me yet.
# Install Microsoft Visual C++ Build Tool 2019 :
#Install Microsoft Visual C++ Build Tool 2019 :
#* [https://visualstudio.microsoft.com/visual-cpp-build-tools/]
#*https://visualstudio.microsoft.com/visual-cpp-build-tools/
# Check its box for "Desktop development with C++" So windows 10 SDK is installed.
#Check its box for "Desktop development with C++" So windows 10 SDK is installed.
# Install English language pack
# Install English language pack
<gallery>
TWO PICTUREs
File:Veloren_VS_Install1.png|Installation of Visual Studio, step 1
Once Visual Studio is installed, reclick on rustup-init.exe
File:Veloren VS Install2.png|Language pack installation, step 2
</gallery>

== Installing Cargo (Rust) ==
Once Visual Studio is installed, download : https://win.rustup.rs/, if your installed visual editor, and the required tools you should get this screen :

[[File:Veloren Cargo Install2.png|alt=Cargo installation's windows when requirements are meet. ]]

Choose the default installation with by typing 1 and pushing enter. If your installation went well you should get this new message :

[[File:Veloren_Cargo_Install3.png]]

Congrat ! Cargo is installed !

==Install CMake, Ninja and Python3==
Now, we will use few commands to speed up installation process. Open the apps list with the touch {{Key|Windows}} and search : PowerShell then {{Key|Enter}}. In the power shell copy-paste this command :
<pre>
iwr -useb get.scoop.sh | iex
scoop install cmake ninja python
</pre>
You may get a warning :
<pre>PowerShell requires an execution policy in [Unrestricted, RemoteSigned, ByPass]to run Scoop.</pre>
That warning just mean that windows won't execute any external script or programs that aren't verified. To remove the execution policy, type : <pre>
Set-ExecutionPolicy RemoteSigned -Scope CurrentUser
</pre>and type {{Key|Y}}.
[[File:Veloren Install CMake Ninja Python3.png|alt=Installation of CMake, Ninja, Python3 via Scoop in the PowerShell|none|frame|Installation of CMake, Python 3, Ninja via Scope ine the PowerShell|link=]]

==Installing Git and Git-lfs==
Go there, and install it :https://gitforwindows.org/
The box will ask you lot of things where, if you are not a DEV, you can't tell the difference. Just go for the default and recommended parameters.
Install also [https://git-lfs.github.com/ git-lsf]

== Exporting csv file==
Finally, everything is setup. Open file Explorer, choose a place where you want to copy game's file. Here we chose <code>.../MyDocument/Git</code> Open Git folder. Then go to the button '''File''' at the top menu and open PowerShell.

[[File:Veloren Opening Powershell Directory.png]]


And let's copy the game file from git with :
<pre>
git clone https://gitlab.com/veloren/veloren.git
</pre>
It will takes a while. Once the download is finished, let's tell the terminal PowerShell to open the new folder veloren :

<pre>cd veloren</pre>

From there, in <code>.../MyDocument/Git/veloren</code> you can execute any commands, try :
<pre>cargo csv-export "armor-stats"</pre>
[[File:Veloren Cargo CSV Export.png]]
==Cleaning up the csv==
{{Note|And that's the end of the first part of this guide. You got the csv table, the next part will convert how to clean-up the csv to a more pratical tool : [[CSV Clean-up |a builder]]}}

[[Category: Guides]]

Latest revision as of 18:27, 5 February 2023

The guide will cover how to get the csv of armor-stats via Cargo command on Windows. Step by step, for real beginner as myself. There is 3 commands for getting the game's data :

  • cargo csv-export armor-stats
  • cargo csv-export weapon-stats
  • cargo csv-export all-items
Don't do anything yet, just read those steps

To be able to execute those godsend commands, you need administrator's right and, strictly in this order :

  1. Install Visual Studio Build Tools with :
    • "Desktop development with C++" So windows 10 SDK is installed.
    • English language pack
  2. Install Cargo
  3. And then Install : CMake, Ninja Build System and Python3 using the power shell with this command :
iwr -useb get.scoop.sh | iex
scoop install cmake ninja python

Once you installed them :

  1. Install Git and Git LFS
  2. Create a folder for your game file : ..../MyDocument/Git
  3. Open the power shell in .../MyDocument/Git
  4. Clone the game's file from git with :
git clone https://gitlab.com/veloren/veloren.git

Once the copy is finished :

  1. go to .../MyDocument/Git/veloren/ and open the PowerShell in .../MyDocument/Git/veloren/
  2. Execute the command and export the table
You can also read Veloren's manual, let's start !

Installing Visual Studio Build Tool

If you tried to install first Cargo, you will get this windows :

Cargo installation's windows when requirements are amiss.

It tells you :

  1. Don't install me yet.
  2. Install Microsoft Visual C++ Build Tool 2019 :
  3. Check its box for "Desktop development with C++" So windows 10 SDK is installed.
  4. Install English language pack

Installing Cargo (Rust)

Once Visual Studio is installed, download : https://win.rustup.rs/, if your installed visual editor, and the required tools you should get this screen :

Cargo installation's windows when requirements are meet.

Choose the default installation with by typing 1 and pushing enter. If your installation went well you should get this new message :

Congrat ! Cargo is installed !

Install CMake, Ninja and Python3

Now, we will use few commands to speed up installation process. Open the apps list with the touch Windows and search : PowerShell then Enter. In the power shell copy-paste this command :

iwr -useb get.scoop.sh | iex
scoop install cmake ninja python

You may get a warning :

PowerShell requires an execution policy in [Unrestricted, RemoteSigned, ByPass]to run Scoop.

That warning just mean that windows won't execute any external script or programs that aren't verified. To remove the execution policy, type :

Set-ExecutionPolicy RemoteSigned -Scope CurrentUser

and type Y.

Installation of CMake, Ninja, Python3 via Scoop in the PowerShell
Installation of CMake, Python 3, Ninja via Scope ine the PowerShell

Installing Git and Git-lfs

Go there, and install it :https://gitforwindows.org/ The box will ask you lot of things where, if you are not a DEV, you can't tell the difference. Just go for the default and recommended parameters. Install also git-lsf

Exporting csv file

Finally, everything is setup. Open file Explorer, choose a place where you want to copy game's file. Here we chose .../MyDocument/Git Open Git folder. Then go to the button File at the top menu and open PowerShell.


And let's copy the game file from git with :

git clone https://gitlab.com/veloren/veloren.git

It will takes a while. Once the download is finished, let's tell the terminal PowerShell to open the new folder veloren :

cd veloren

From there, in .../MyDocument/Git/veloren you can execute any commands, try :

cargo csv-export "armor-stats"

Cleaning up the csv

And that's the end of the first part of this guide. You got the csv table, the next part will convert how to clean-up the csv to a more pratical tool : a builder
Cookies help us deliver our services. By using our services, you agree to our use of cookies.