Create mods using the popular game Farming Simulator with Lua, a versatile scripting language that can run on various platforms and applications. This open access book is best suited for programmers who want to learn how to use Lua to write scripts that can enhance and extend the gameplay experience.
You'll start by reviewing the basics of programming in Lua and then move on to advanced topics, such as object-oriented programming, vehicle and placeable specializations, network synchronization, and creating custom user interfaces. With step-by-step instructions and detailed explanations, you'll see how to create scripts that modify game mechanics and add new features to the game.
The practical examples and projects are ideal for providing hands-on experience with Lua scripting. Whether you are a creator looking to take your skills to the next level or a game developer interested in learning a new programming language, Scripting Farming Simulator with Luais the ultimate guide to mastering Lua scripting.
What You'll Learn
- Understand the fundamentals of programming in LUA
- Implement a basic “Hello-World” mod
- Add a new graphical user interface to your mod
- Use hook scripts to extend base game features
- Publish your mod on the official Farming Simulator ModHub
Who This Book Is For
Creators who want to add new features to Farming Simulator; game developers who want to learn a new programming language for modding purposes, and anyone who wants to expand their knowledge of programming and scripting.
Conditions of Use
This book is licensed under a Creative Commons License (CC BY). You can download the ebook Scripting Farming Simulator with Lua for free.
- Title
- Scripting Farming Simulator with Lua
- Subtitle
- Unlocking the Virtual Fields
- Publisher
- Apress
- Author(s)
- Manuel Leithner, Zander Brumbaugh
- Published
- 2023-12-30
- Edition
- 1
- Format
- eBook (pdf, epub, mobi)
- Pages
- 356
- Language
- English
- ISBN-10
- B0CJHM5JV3
- ISBN-13
- 9798868800603
- License
- CC BY
- Book Homepage
- Free eBook, Errata, Code, Solutions, etc.
Table of Contents About the Authors About the Technical Reviewer Introduction Foreword Chapter 1: Introduction, GDN, ModHub, Modding Tutorial Videos, LuaDoc, FarmCon… Technical Requirements Exploring the GDN Modding Resources Video Tutorials Documentation Community Forum Downloads LuaDoc YouTube Looking at the ModHub Financial Opportunities of Mod Creation How to Attend FarmCon Participating in the Mod Contest Summary Chapter 2: Getting Started with the GIANTS Editor Technical Requirements Installing the GIANTS Editor The Viewport Movement and Camera Manipulation Viewport Options Camera Framed Rotate First-Person Mode Shading Modes Show and Selectable Grid Polycount The Scenegraph Panel Entities and the Parent-Child Hierarchy Application Menus The File Menu The Edit Menu The Create Menu The View Menu The Scripts Menu The Window Menu The Help Menu The Attributes Panel The Toolbar File Section Play Section Mode Section Local/World Mode Snapping Translation Mode Rotation Mode Scaling Mode Miscellaneous Section Terrain Section Scripting The Console Summary Chapter 3: The Lua Programming Language Technical Requirements Learning About Data Types and Creating Variables Data Types Setting and Manipulating Variables Numbers Booleans Strings Tables Dictionaries Conditional Statements Declaring and Using Loops for Loops Iterator Function while Loops repeat Loops Learning About Functions Functions in Programming Recursion Classes Demonstrating Programming Style and Efficiency General Programming Style Rules Summary Chapter 4: The GIANTS Studio Technical Requirements Installing the GIANTS Studio Application Menus The File Menu The Edit Menu The View Menu The Debug Menu The Window Menu The Help Menu New Project Starting the Game Debugging Scripts Using Breakpoints Using the Locals Tab and the Callstack Summary Chapter 5: Making a Diner with a Rotating Sign Technical Requirements Preparing the Mod Folder Structure Creating Mod Scripts Creating XML Files Creating Lua Files Testing the Mod Summary Chapter 6: Rotating Mower Mod Technical Requirements Creating Mod Scripts Creating XML Files Creating Lua Files Testing the Mod Summary Chapter 7: Speed Trap Trailer Mod Speed Trap Trailer Mod Technical Requirements Creating Mod Scripts Creating XML Files Creating Lua Files Testing the Mod Summary Chapter 8: Mileage Counter HUD Mod Technical Requirements Creating Mod Scripts Creating XML Files Creating Lua Files Testing the Mod Summary Chapter 9: Multibale Spawner Mod Technical Requirements Creating Mod Scripts Creating XML Files Creating Lua Files Testing the Mod Summary Chapter 10: Money Cheat Mod Technical Requirements Creating Mod Scripts Creating XML Files Creating Lua Files Testing the Mod Summary Chapter 11: Publishing on the ModHub Technical Requirements What Is the ModHub? Creating an Account ModHub Creation Guidelines Using the TestRunner Uploading Your First Mod Getting Feedback and Updating Your Mod Rewards and Awards Summary Chapter 12: Documentation and Appendix Debugging print Arguments printCallstack Position, Orientation, and Size getWorldTranslation Arguments Returns setWorldTranslation Arguments setTranslation Arguments getTranslation Arguments Returns worldToLocal Arguments Returns localToWorld Arguments Returns localToLocal Arguments Returns setRotation Arguments Returns getRotation Arguments Returns getWorldRotation Arguments Returns setWorldRotation Arguments localRotationToWorld Arguments Returns worldRotationToLocal Arguments Returns worldDirectionToLocal Arguments Returns localDirectionToLocal Arguments Returns localDirectionToWorld Arguments Returns setDirection Arguments setScale Arguments getScale Arguments Returns Entities clone Arguments Returns createTransformGroup Arguments Returns setName Arguments getName Arguments Returns setVisibility Arguments getVisibility Arguments Returns setUserAttribute Arguments getUserAttribute Arguments Returns getHasClassId Arguments Returns ClassIds Enum Entity Relations link Arguments unlink Arguments getParent Arguments Returns getChild Arguments Returns getChildAt Arguments Returns getNumOfChildren Arguments Returns getRootNode Returns Camera getCamera Returns setCamera Arguments I3D loadI3DFile Arguments Returns loadSharedI3DFile Arguments Returns LoadI3dFailedReason Enum streamI3DFile Arguments Returns cancelStreamI3DFile Arguments streamSharedI3DFile Arguments Returns releaseSharedI3DFile Arguments Physics getRigidBodyType Arguments Returns RigidBodyType Enum setRigidBodyType Arguments getCenterOfMass Arguments Returns setCenterOfMass Arguments getMass Arguments Returns setMass Arguments raycastAll Arguments Returns raycastClosest Arguments Returns raycastCallback overlapBox Arguments Returns overlapSphere Arguments Returns overlapCallback Network streamReadBool Arguments Returns streamReadFloat32 Arguments Returns streamReadInt16 Arguments Returns streamReadInt32 Arguments Returns streamReadInt8 Arguments Returns streamReadIntN Arguments Returns streamReadString Arguments Returns streamReadUInt16 Arguments Returns streamReadUInt8 Arguments Returns streamReadUIntN Arguments Returns streamWriteBool Arguments Returns streamWriteFloat32 Arguments streamWriteInt16 Arguments streamWriteInt32 Arguments streamWriteInt8 Arguments streamWriteIntN Arguments streamWriteString Arguments streamWriteUInt16 Arguments streamWriteUInt8 Arguments streamWriteUIntN Arguments Index