From fa01f03a088f231675f40cfde13f300042453c0b Mon Sep 17 00:00:00 2001 From: Blixibon Date: Sat, 13 Jun 2020 00:27:10 -0500 Subject: [PATCH] Updated Using VScript as a HL2 mapper (markdown) --- Using-VScript-as-a-HL2-mapper.md | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/Using-VScript-as-a-HL2-mapper.md b/Using-VScript-as-a-HL2-mapper.md index 1f88bde..0120b2e 100644 --- a/Using-VScript-as-a-HL2-mapper.md +++ b/Using-VScript-as-a-HL2-mapper.md @@ -1,18 +1,20 @@ 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. -There are three main ways in which VScript can be used: +**You don't need any previous programming experience to use VScript.** VScript is only as complex as you want it to be. + +There are three main ways in which VScript can be used in Mapbase: * [**Using VScript to simplify map logic**](Using-VScript-as-a-HL2-mapper#Using-VScript-to-simplify-map-logic) * [**Using VScript to do what's not possible with I/O**](Using-VScript-as-a-HL2-mapper#using-vscript-to-do-whats-not-possible-with-io) * [**Using VScript to modify game behavior**](Using-VScript-as-a-HL2-mapper#Using-VScript-to-modify-game-behavior) -Each of these sections have their own tutorial which starts as if you've never used VScript before. +Each of these sections have their own tutorial(s) which start as if you've never used VScript before. Mapbase's implementation of VScript started with reductor's custom Squirrel integration and code ported from the Alien Swarm SDK; it has been expanded to include functions adjusted specifically for Half-Life 2-related purposes as well as some more access to Valve's mathlib and utility functions. ## Using VScript to simplify map logic -Most mappers think VScript is too complicated since it's basically in-map programming and most mappers are not programmers. For that crowd, it actually works best when it makes things *less* complicated. +Although VScript can make things very complex, it actually works really well for making things *less* complex. 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 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. @@ -22,16 +24,18 @@ If you want to learn how to use VScript, it may be best to start by doing it *al ## Using VScript to do what's not possible with I/O +A lot more can be done with VScript than what can normally be done with logic entities and I/O, even with Mapbase's enhancements. + 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. Of course, if you're already a programmer, then using this side of VScript may come naturally. If not, then it may seem a bit more complex, but if you think you can benefit from what it's capable of, then it would definitely be worth the trouble. [Click here to go to a tutorial which makes it simple and easy to understand.](https://github.com/mapbase-source/source-sdk-2013/wiki/VScript-:-Basic-Entity-Code-Tutorial) ## Using VScript to modify game behavior -In some of Valve's games, VScript had unique abilities to modify game-specific behavior. This often replaced dedicated logic entities or even the regular keyvalue-based `scripts` files. +In some of Valve's games, VScript had unique abilities to modify game-specific behavior. This often replaced dedicated logic entities (e.g. `tf_gamerules`) or even the regular keyvalue-based `scripts` files. For example, in Left 4 Dead 2, you can use VScript to influence or detect the behavior of the AI director which controls zombie spawning. This is often used to choreograph campaign finales. -Half-Life 2 doesn't have any of those kinds of complex built-in game systems, but Mapbase still adds hooks to modify certain HL2-related elements. For instance, Mapbase adds `NPC_TranslateActivity` and `NPC_TranslateSchedule` hooks for modifying NPC behavior. +Half-Life 2 doesn't have any of those kinds of complex built-in game systems, but Mapbase still adds hooks to modify certain HL2-related elements. For example, Mapbase adds `NPC_TranslateActivity` and `NPC_TranslateSchedule` hooks for modifying NPC behavior. `NPC_TranslateActivity` allows VScript to modify the animations a NPC plays during its AI without requiring `scripted_sequence`. (TODO: Tutorial) \ No newline at end of file