Tutorial: Running Las Venturas Playground on your Windows computer
Before you can start developing, it's important to have the gamemode running on your own computer. The Las Venturas Playground code has been set up to make this as easy as possible, and includes utility scripts for Windows making this a one-click action. This tutorial explains how you can get from 0 to having a running server on your computer, but also how to get the LVP Pawn Editor and the LVP PreCompiler set up to make your first compile.
If you have questions or comments, feel free to reply to this topic. It's important to keep this work-flow working as it is very important that new contributors can easily set up their configurations and start to code. There are minor differences between the descriptions for Windows and Linux, which will be covered in a later tutorial.
Check out the source code using subversion
write this
Writing code: the LVP Pawn Editor and the LVP PreCompiler
Because of the size of the gamemode, Las Venturas Playground has her own tools for editing and compiling the scripts. While other tutorials will go in detail about what exactly you can do with them, being able to find and launch them is a good first step.
We'll start off with describing what the tools are. The LVP Pawn Editor is our own editor, and has been made to closely match all of LVP's needs. It features everything you expect from a decent editor, good integration with Pawn and project support with auto-complete for our gamemode. The LVP PreCompiler is a tool we use to enrich the default Pawn syntax by adding support for classes, specialized debugging, among many other features. This is required to be able to build the gamemode itself.
Getting set up with the LVP Pawn Editor for all your .pwn files is easy:
Running Las Venturas Playground
You've got all the source code checked out on your computer, so now we're ready to getting the server up and running. You may have noticed a "server" directory in the main directory, but starting the server will throw a number of errors because plugins and the gamemode are not available. Furthermore, because of the ever changing list of necessary plugins, filterscripts and NPC scripts, it will be hard to maintain this by hand.
For that reason, we've created a deploy script. Running this script will set up everything that needs to happen in order to get your server running. It will verify that all required directories are there, and will then copy over plugins and create symbolic links for each file that you may be working on in your code. Running it is easy:
Assuming everything worked, you can now go back to the server/ directory in your repository. Double clicking on samp-server.exe will now work well, and you can connect to localhost:7777 to play on the server.
Writing code: Opening the Las Venturas Playground gamemode
Time to get started! The Las Venturas Playground gamemode is contained in a project file because of the many files and settings it depends on. Before you'll be able to compile it though, there is one more manual step which you have to take, because the server needs to know who you are in order to get statistics right.
Writing code: Sending code back to the LVP Repository
Because we need to keep synchronized with the code used that makes Las Venturas Playground, you will have to commit your changes after you've made them. This will send them to the subversion server, which will allow other developers to pick them up.
Let's make your first change, and then send it to the LVP Repository.
You're now ready to start coding, fixing bugs and adding new features. Be sure to check out the other tutorials, especially ones on syntax and our style guide. Before anything, you should read this tutorial to get a feel about how classes work in the LVP gamemode! Thank you for reading!
Before you can start developing, it's important to have the gamemode running on your own computer. The Las Venturas Playground code has been set up to make this as easy as possible, and includes utility scripts for Windows making this a one-click action. This tutorial explains how you can get from 0 to having a running server on your computer, but also how to get the LVP Pawn Editor and the LVP PreCompiler set up to make your first compile.
If you have questions or comments, feel free to reply to this topic. It's important to keep this work-flow working as it is very important that new contributors can easily set up their configurations and start to code. There are minor differences between the descriptions for Windows and Linux, which will be covered in a later tutorial.
Check out the source code using subversion
write this
Writing code: the LVP Pawn Editor and the LVP PreCompiler
Because of the size of the gamemode, Las Venturas Playground has her own tools for editing and compiling the scripts. While other tutorials will go in detail about what exactly you can do with them, being able to find and launch them is a good first step.
We'll start off with describing what the tools are. The LVP Pawn Editor is our own editor, and has been made to closely match all of LVP's needs. It features everything you expect from a decent editor, good integration with Pawn and project support with auto-complete for our gamemode. The LVP PreCompiler is a tool we use to enrich the default Pawn syntax by adding support for classes, specialized debugging, among many other features. This is required to be able to build the gamemode itself.
Getting set up with the LVP Pawn Editor for all your .pwn files is easy:
- Go to the tools/PawnEditor/releases/latest/ directory in your repository.
- Right click on PawnEditor.exe, and select Send To -> Desktop. This will create a shortcut on your desktop for convenience.
- Double click on PawnEditor.exe, which will open the program.
- In the top menu, click on Options and click on both the Associate with *.pwn files and Associate with *.ppr files items.
- Start typing some basic pawn in the editor. Something like "main(){}" is fine. Or, alternatively, open an existing file.
- Click on either F5 on your keyboard or the empty white window icon on the toolbar to compile your script to an .amx.
Running Las Venturas Playground
You've got all the source code checked out on your computer, so now we're ready to getting the server up and running. You may have noticed a "server" directory in the main directory, but starting the server will throw a number of errors because plugins and the gamemode are not available. Furthermore, because of the ever changing list of necessary plugins, filterscripts and NPC scripts, it will be hard to maintain this by hand.
For that reason, we've created a deploy script. Running this script will set up everything that needs to happen in order to get your server running. It will verify that all required directories are there, and will then copy over plugins and create symbolic links for each file that you may be working on in your code. Running it is easy:
- Go to the gamemode/ directory in your repository.
- Double click on the deploy.bat file, or right click -> run as administrator if you aren't an admin user.
Assuming everything worked, you can now go back to the server/ directory in your repository. Double clicking on samp-server.exe will now work well, and you can connect to localhost:7777 to play on the server.
Writing code: Opening the Las Venturas Playground gamemode
Time to get started! The Las Venturas Playground gamemode is contained in a project file because of the many files and settings it depends on. Before you'll be able to compile it though, there is one more manual step which you have to take, because the server needs to know who you are in order to get statistics right.
- Go to the gamemode/trunk/ directory in your repository.
- Create a new file named "AUTHOR" (in capitals, no file extension), containing nothing but the e-mail address you signed up to LVP with.
- Double click on the lvp.ppr file. This will open the LVP Pawn Editor with the project interface.
- Click F5 to immediately compile the LVP. This can take roughly a minute depending on your computer.
Writing code: Sending code back to the LVP Repository
Because we need to keep synchronized with the code used that makes Las Venturas Playground, you will have to commit your changes after you've made them. This will send them to the subversion server, which will allow other developers to pick them up.
Let's make your first change, and then send it to the LVP Repository.
- Around line 30 of the "lvp.pwn" file, add your name to the acknowledgement list.
- Go to the gamemode/trunk/ directory in your repository.
- Right click anywhere on the folder (not on files, though), and click on SVN Commit. In this dialog, one file will show up as being edited, which is lvp.pwn.
- Very important: Enter a clear description of what you have changed. In this case, "Add [your nickname] to the acknowledgement list." will be good enough.
- Click on the OK button at the bottom-right corner of the dialog.
You're now ready to start coding, fixing bugs and adding new features. Be sure to check out the other tutorials, especially ones on syntax and our style guide. Before anything, you should read this tutorial to get a feel about how classes work in the LVP gamemode! Thank you for reading!