Updated Using VScript as a HL2 mapper (markdown)

Blixibon 2020-05-29 13:28:09 -05:00
parent b9ff8c7ca6
commit 9215855bb5

@ -1,15 +1,17 @@
As a Half-Life 2/Source 2013 mapper, VScript may seem unfamiliar or complicated for you since it's basically in-map programming. For that crowd, it actually works best when it makes things *less* complicated. This article is for Half-Life 2/Source 2013 mappers who have no experience with VScript to learn what it is and how they can use it in their maps.
## Using VScript to simplify map logic ## Using VScript to simplify map logic
Source's logic entities (and Mapbase's expansions to them) work to make the I/O system a flexible tool for doing complex things, doing everything from basic math to storage. However, this can often get very complicated very quickly, as several different outputs fire several different inputs on several different entities as one big, messy jumble of icons in the 3D view. As a Half-Life 2/Source 2013 mapper, VScript may seem unfamiliar or complicated for you since it's basically in-map programming. For that crowd, it actually works best when it makes things *less* complicated.
VScript can be used to simplify these types of creations, as things like storing numbers, adding/subtracting numbers, finding entities, etc. can happen using just one line of text. This can be done to just make it seem less complicated, but sometimes it's actually necessary to reduce the entity count/overhead. Source's logic entities *(and Mapbase's expansions to them)* make the I/O system a flexible tool for doing complex things, like math or storage. However, this can often get very complicated very quickly, as several different outputs fire several different inputs on several different entities as one big, messy jumble of icons in Hammer's 3D view.
VScript can be used to simplify these types of logic creations, as things like storing numbers, adding/subtracting numbers, finding entities, etc. can happen using just one line of text. This can be done to just make map logic seem less complicated, but sometimes it's actually necessary to reduce the entity count/overhead.
If this is your first time using VScript, it's best to use it *alongside* the I/O system, especially for interacting with non-logic entities. [Click here to go to a tutorial on how you can use VScript to interact with the I/O system.](https://github.com/mapbase-source/source-sdk-2013/wiki/VScript-:-Basic-I:O-Tutorial) If this is your first time using VScript, it's best to use it *alongside* the I/O system, especially for interacting with non-logic entities. [Click here to go to a tutorial on how you can use VScript to interact with the I/O system.](https://github.com/mapbase-source/source-sdk-2013/wiki/VScript-:-Basic-I:O-Tutorial)
## Using VScript to do what's not possible with I/O ## Using VScript to do what's not possible with I/O
While you can just use VScript to simplify map logic, it also unlocks a lot of potential in other areas. It's a pathway to many abilities some mappers would consider...unnatural. If you're already a programmer, then this may come naturally. If not, get ready to become one. While you can just use VScript to simplify map logic, it also unlocks a lot of potential in other areas. It's a pathway to many abilities some mappers would consider...unnatural. If you're already a programmer, then it may already be natural. If not, then it may seem a bit more complex.
(WIP) [Click here to go to a tutorial which makes it simpler and easier to understand.](https://github.com/mapbase-source/source-sdk-2013/wiki/VScript-:-Basic-Entity-Code-Tutorial)