Giter Site home page Giter Site logo

mapbase-source / source-sdk-2013 Goto Github PK

View Code? Open in Web Editor NEW

This project forked from valvesoftware/source-sdk-2013

218.0 27.0 135.0 597.97 MB

This is Mapbase's public GitHub repo. It contains all of the code, but not the assets.

Home Page: https://www.moddb.com/mods/mapbase

License: Other

C++ 95.66% C 3.56% Shell 0.01% Batchfile 0.03% Perl 0.22% Makefile 0.06% GLSL 0.29% Assembly 0.01% Objective-C++ 0.01% Squirrel 0.04% CMake 0.01% Python 0.01% ReScript 0.11%

source-sdk-2013's Introduction

//=========================================================================================================================

               Mapbase v7.2 - Source 2013
	https://github.com/mapbase-source/source-sdk-2013
		https://www.moddb.com/mods/mapbase
	
//=========================================================================================================================

This repository contains code from Mapbase, a modification of the Source 2013 SDK which serves as a combined package
of general-purpose improvements, fixes, and utility features for mods.

Mapbase's main content in this repository may include:

- 80+ custom entities (new logic entities, filters, etc.)
- Hundreds of Inputs/Outputs/KeyValues additions and modifications
- Custom SDK_ shaders with improvements adapted from Alien Swarm SDK code, including projected texture fixes and radial fog
- Custom VScript implementation based on public Squirrel API and Alien Swarm SDK interfaces/descriptions
- Additional gameplay control for Half-Life 2 mods, including grenade features for more NPCs and singleplayer respawning
- More map-specific capabilities for maps unable to branch into their own mods, e.g. MP mods or map compilations
- View rendering changes for drawing 3D skyboxes and RT-based entities
- Countless other fixes and improvements

For more information, view this page:
https://github.com/mapbase-source/source-sdk-2013/wiki/Introduction-to-Mapbase

//=========================================================================================================================

Mapbase is an open-source project and its contents can be distributed and used at the discretion of its users. However, this project contains content from
a vast number of different sources which have their own licensing or attribution requirements. We try to handle most of that ourselves, but users who plan on
distributing Mapbase content are expected to comply with certain rules.

	Up-to-date information about Mapbase content usage and credit are addressed in this article on Mapbase's wiki:
		https://github.com/mapbase-source/source-sdk-2013/wiki/Using-Mapbase-Content

//=========================================================================================================================

>>>>>>>> EXTERNAL CONTENT USED IN MAPBASE <<<<<<<<

The Mapbase project is a combination of original code from its creators, code contributed by other Source modders, and code borrowed from open-source articles
and repositories (especially ones which are specifically published as free source code). One of Mapbase's goals is to make the most popular fixes and the most obscure
or complicated code changes accessible and easy to use for level designers and other kinds of Source modders who would otherwise have no idea how to implement them.

*** DISCLAIMER: Mapbase has a strict no-leak-content policy and only allows content created directly by contributors or content originating from open-source repositories.
If you believe any content in Mapbase originates from any leak or unauthorized source (Valve or otherwise), please contact Blixibon immediately.
Mapbase is intended to be usable by everyone, including licensed Source projects and Steam mods. ***

Mapbase uses content from the following non-Source SDK 2013 Valve games or SDKs:

-- Alien Swarm SDK (Used to backport features and code from newer branches of Source into a Source 2013/Half-Life 2 environment)
-- Source SDK 2007 Code (Used to implement some of Tony Sergi's code changes)

-- Alien Swarm (Used to port assets from the aforementioned SDK code features, e.g. game instructor icons)
-- Left 4 Dead (Used to port certain animations as well as assets from the aforementioned SDK code features, e.g. particle rain)
-- Half-Life: Source (Used to port friction tool textures)

Valve allows assets from these titles to be distributed for modding purposes. Note that ported assets are only used in the release build, not the code repository.

Mapbase may also contain new third-party software distributed under specific licensing. Please see the bottom of thirdpartylegalnotices.txt for more information.

Here's a list of Mapbase's other external code sources:

- https://github.com/95Navigator/insolence-2013 (Initial custom shader code and projected texture improvements; also used to implement ASW SDK particle precipitation code)
-- https://github.com/Biohazard90/g-string_2013 (Custom shadow filters, included indirectly via Insolence repo)
-- https://github.com/KyleGospo/City-17-Episode-One-Source (Brush phong and projected texture changes, included indirectly via Insolence repo)
- https://github.com/DownFall-Team/DownFall (Multiple skybox code and fix for ent_fire delay not using floats; Also used as a guide to port certain Alien Swarm SDK changes to Source 2013,
including radial fog, rope code, and treesway)
- https://github.com/momentum-mod/game (Used as a guide to port postprocess_controller and env_dof_controller to Source 2013 from the Alien Swarm SDK)
- https://github.com/DeathByNukes/source-sdk-2013 (VBSP manifest fixes)
- https://github.com/entropy-zero/source-sdk-2013 (skill_changed game event)
- https://github.com/Nbc66/source-sdk-2013-ce/tree/v142 (Base for VS2019 toolset support)

//-------------------------------------------------------------------------------------------------------------------------

Valve Developer Community (VDC) sources:

- https://developer.valvesoftware.com/wiki/Dynamic_RTT_shadow_angles_in_Source_2007 (Dynamic RTT shadow angles by Saul Rennison)
- https://developer.valvesoftware.com/wiki/Parallax_Corrected_Cubemaps (Parallax corrected cubemaps implementation from Brian Charles)
- https://developer.valvesoftware.com/wiki/Adding_the_Game_Instructor (ASW SDK game instructor adapted to Source 2013 by Kolesias123; was implemented based on a translated article)
- https://developer.valvesoftware.com/wiki/Brush_ladders (Functional func_ladders in Source 2013)
- https://developer.valvesoftware.com/wiki/CAreaPortalOneWay (func_areaportal_oneway)
- https://developer.valvesoftware.com/wiki/Implementing_Discord_RPC (Discord RPC implementation; Mapbase has its own framework originally based on this article)
- https://developer.valvesoftware.com/wiki/Rain_splashes (NOTE: This code is not completely used in Mapbase, but may still exist in its codebase)
- https://developer.valvesoftware.com/wiki/Hand_Viewmodels (NOTE: This code is not completely supported by default because Mapbase does not yet have weapon viewmodels which support
interchangeable arms; this may change in the future)

- https://developer.valvesoftware.com/wiki/General_SDK_Snippets_%26_Fixes (Various snippets on the article, including the dropship gun fix)
- https://developer.valvesoftware.com/wiki/Memory_Leak_Fixes (Most of these snippets were applied in later SDK updates, but some were not and have been added to Mapbase)
- https://developer.valvesoftware.com/wiki/Env_projectedtexture/fixes (Misc. env_projectedtexture fixes; Some of these are superceded by Alien Swarm-based changes and not used)
- https://developer.valvesoftware.com/wiki/Scenes.image (Original raw VCD file support; Code was improved for Mapbase and the article was later updated with it)
- https://developer.valvesoftware.com/wiki/Extending_Prop_Sphere (prop_sphere customization)
- https://developer.valvesoftware.com/wiki/TF2_Glow_Effect_(2013_SDK) (Glow effect)
- https://developer.valvesoftware.com/wiki/CFuncMoveLinear_ParentingFix (func_movelinear parenting fix; Code was improved for Mapbase and the article was later updated with it)
- https://developer.valvesoftware.com/wiki/Viewmodel_Prediction_Fix (Viewmodel prediction fix)
- https://developer.valvesoftware.com/wiki/Owner#Collisions_with_owner (FSOLID_COLLIDE_WITH_OWNER flag)
- https://developer.valvesoftware.com/wiki/Npc_clawscanner#Strider_Scout_Issue (npc_clawscanner strider scout fix)
- https://developer.valvesoftware.com/wiki/Ambient_generic:_stop_and_toggle_fix (Fixes for stopping/toggling ambient_generic)
- https://developer.valvesoftware.com/wiki/Func_clip_vphysics ("Start Disabled" keyvalue fix)
- https://developer.valvesoftware.com/wiki/Importing_CSS_Weapons_Into_HL2 (CS:S viewmodel chirality)

//-------------------------------------------------------------------------------------------------------------------------

Direct contributions:

- #3 ("playvideo" command playback fix from Avanate)
- #5 (Custom VScript implementation by ReDucTor; was placed into feature branch before being merged in a subsequent PR)
- #60 (Adjustment by RoyaleNoir to one of Saul's VDC changes)
- #84 (CS:S viewmodel chirality from 1upD)
- #116 (vgui_movie_display mute keyvalue from Alivebyte/rzkid)
- #140 (logic_substring entity and icon created by moofemp)
- #143 (Propper features for VBSP from Matty-64)
- #174 (Fix for multiply defined symbols in later toolsets from und)
- #201 (env_projectedtexture shadow filter keyvalue from celisej567)
- #193 (RTB:R info_particle_system_coordinate by arbabf and Iridium77)
- #193 (Infinite prop_interactable cooldown by arbabf)
- #229 (Extended point_bugbait functionality by arbabf)
- #236 (Toggleable prop sprinting by Crimson-X1)
- #237 (Commander goal trace fix by Agrimar)
- #245 (ViewPunch random fix by Mr0maks)
- #248 (soundlevel_t conversation warning fix by Mechami)
- mapbase-source/mapbase-game-src#1 (Advanced video options duplicate field name fix by arbabf; This is asset-based and not reflected in the code)
- Demo autorecord code provided by Klems
- cc_emit crash fix provided by 1upD
- Custom HL2 ammo crate models created by Rykah (Textures created by Blixibon; This is asset-based and, aside from the SLAM crate, not reflected in the code)
- Combine lock hardware on door01_left.mdl created by Kralich (This is asset-based and not reflected in the code)
- npc_vehicledriver fixes provided by CrAzY
- npc_combine cover behavior patches provided by iohnnyboy
- logic_playmovie icon created by URAKOLOUY5 (This is asset-based and not reflected in the code)
- Dropship APC save/load fix provided by Cvoxulary

== Contributions from samisalreadytaken:
=-- #47 (VScript utility/consistency changes)
=-- #59 (New VScript functions and singletons based on API documentation in later Source/Source 2 games)
=-- #80 (More VScript changes, including support for extremely flexible client/server messaging)
=-- #105 (VScript fixes and optimizations, Vector class extensions, custom convars/commands)
=-- #114 (VScript fixes and extensions)
=-- #122 (Minor VScript-related adjustments)
=-- #148 (Minor fixup)
=-- #167 (Security fixes)
=-- #168 (Squirrel update)
=-- #169 (VScript VGUI)
=-- #171 (VScript documentation sorting)
=-- #173 (VScript fixes and optimizations)
=-- #192 (VScript hook manager and fixes)
=-- #206 (Fix CScriptNetMsgHelper::WriteEntity())
=-- #213 (VScript HUD visibility control, optimizations for 3D skybox angles/fake worldportals)
=-- #229 (VScript VGUI HUD viewport parenting, game_text and vgui_text_display VScript font fallback)
=-- #261 (Misc VScript additions)
=-- #279 (weapon_custom_scripted fixes)

== Contributions from z33ky:
=-- #21 (Various GCC/Linux compilation fixes)
=-- #95 (Additional GCC/Linux compilation fixes)
=-- #117 (Additional GCC/Linux compilation fixes)
=-- #124 (Memory error fixes)
=-- #130 (Memory error fixes)
=-- #131 (env_projectedtexture target shadows fix)
=-- #132 (Console error fix)
=-- #152 (Additional GCC/Linux compilation fixes)
=-- #159 (Additional GCC/Linux compilation fixes)
=-- #162 (VS2019 exception specification fix)
=-- #170 (HL2 non-Episodic build fix)

== Contributions from Petercov:
=-- #182 (NPCs load dynamic interactions from all animation MDLs)
=-- #184 (Projected texture horizontal FOV shadow fix)
=-- #185 (Fix enemyfinders becoming visible when they wake)
=-- #186 (Fix for brightly glowing teeth)
=-- #183 (Enhanced custom weapons support)
=-- #230 (Caption fixes)
=-- #231 (Sentence source bug fix)

//-------------------------------------------------------------------------------------------------------------------------

Other sources:

- Various code from Source SDK 2013 pull requests on the GitHub repository (https://github.com/ValveSoftware/source-sdk-2013/pulls):
-- ValveSoftware#441 (Smooth scrape sound oversight fix)
-- ValveSoftware#436 (VRAD debug counter fix + thread bump)
-- ValveSoftware#416 (Ragdoll null pointer dereference fix)
-- ValveSoftware#401 (func_rot_button "Starts locked" flag fix)
-- ValveSoftware#391 (VBSP func_detail smoothing group fix)
-- ValveSoftware#362 (npc_manhack npc_maker fix; Adjusted for formatting and save/restore in Mapbase)
-- https://github.com/Petercov/Source-PlusPlus/commit/ecdf50c48cd31dec4dbdb7fea2d0780e7f0dd8ec (used as a guide for porting the Alien Swarm SDK response system)
- https://github.com/momentum-mod/game/blob/1d066180b3bf74830c51e6914d46c40b0bea1fc2/mp/src/game/server/player.cpp#L6543 (spec_goto fix)
- Poison zombie barnacle crash fix implemented based on a snippet from HL2: Plus posted by Agent Agrimar on Discord (Mapbase makes the barnacle recognize it as poison just like poison headcrabs)
- https://gamebanana.com/skins/172192 (Airboat handling fix; This is asset-based and not reflected in the code)
- Vortigaunt LOS fix originally created by dky.tehkingd.u for HL2:CE
- https://combineoverwiki.net/wiki/File:Combine_main_symbol.svg ("icon_combine" instructor icon in "materials/vgui/hud/gameinstructor_hl2_1"; This is asset-based and not reflected in the code)

//-------------------------------------------------------------------------------------------------------------------------

If there is anything missing from this list, please contact Blixibon.

//=========================================================================================================================

Aside from the content list above, Mapbase has more descriptive and up-to-date credits on this wiki article:
https://github.com/mapbase-source/source-sdk-2013/wiki/Mapbase-Credits

Other relevant articles:
* https://github.com/mapbase-source/source-sdk-2013/wiki/Mapbase-Disclaimers
* https://github.com/mapbase-source/source-sdk-2013/wiki/Frequently-Asked-Questions-(FAQ)

//-------------------------------------------------------------------------------------------------------------------------

In memory of Holly Liberatore (moofemp)

//=========================================================================================================================

Please see the Source SDK 2013 license below:



               SOURCE 1 SDK LICENSE

Source SDK Copyright(c) Valve Corp.  

THIS DOCUMENT DESCRIBES A CONTRACT BETWEEN YOU AND VALVE 
CORPORATION ("Valve").  PLEASE READ IT BEFORE DOWNLOADING OR USING 
THE SOURCE ENGINE SDK ("SDK"). BY DOWNLOADING AND/OR USING THE 
SOURCE ENGINE SDK YOU ACCEPT THIS LICENSE. IF YOU DO NOT AGREE TO 
THE TERMS OF THIS LICENSE PLEASE DON�T DOWNLOAD OR USE THE SDK.  

  You may, free of charge, download and use the SDK to develop a modified Valve game 
running on the Source engine.  You may distribute your modified Valve game in source and 
object code form, but only for free. Terms of use for Valve games are found in the Steam 
Subscriber Agreement located here: http://store.steampowered.com/subscriber_agreement/ 

  You may copy, modify, and distribute the SDK and any modifications you make to the 
SDK in source and object code form, but only for free.  Any distribution of this SDK must 
include this LICENSE file and thirdpartylegalnotices.txt.  
 
  Any distribution of the SDK or a substantial portion of the SDK must include the above 
copyright notice and the following: 

    DISCLAIMER OF WARRANTIES.  THE SOURCE SDK AND ANY 
    OTHER MATERIAL DOWNLOADED BY LICENSEE IS PROVIDED 
    "AS IS".  VALVE AND ITS SUPPLIERS DISCLAIM ALL 
    WARRANTIES WITH RESPECT TO THE SDK, EITHER EXPRESS 
    OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, IMPLIED 
    WARRANTIES OF MERCHANTABILITY, NON-INFRINGEMENT, 
    TITLE AND FITNESS FOR A PARTICULAR PURPOSE.  

    LIMITATION OF LIABILITY.  IN NO EVENT SHALL VALVE OR 
    ITS SUPPLIERS BE LIABLE FOR ANY SPECIAL, INCIDENTAL, 
    INDIRECT, OR CONSEQUENTIAL DAMAGES WHATSOEVER 
    (INCLUDING, WITHOUT LIMITATION, DAMAGES FOR LOSS OF 
    BUSINESS PROFITS, BUSINESS INTERRUPTION, LOSS OF 
    BUSINESS INFORMATION, OR ANY OTHER PECUNIARY LOSS) 
    ARISING OUT OF THE USE OF OR INABILITY TO USE THE 
    ENGINE AND/OR THE SDK, EVEN IF VALVE HAS BEEN 
    ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.  
 
       
If you would like to use the SDK for a commercial purpose, please contact Valve at 
[email protected].

source-sdk-2013's People

Contributors

agentagrimar avatar alanedwardes avatar alfred-valve avatar alivebyte avatar arbabf avatar avanate avatar blixibon avatar bruced-valve avatar crimson-x1 avatar joeludwig avatar jorgenpt avatar jstasiak avatar matty-64 avatar mechami avatar mikesartain avatar moofemp avatar mr0maks avatar narendraumate avatar neico avatar nephyrin avatar petercov avatar plesiecki avatar psychonic avatar reductor avatar royalenoir avatar rzkid avatar samisalreadytaken avatar sortie avatar untodesu avatar z33ky avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

source-sdk-2013's Issues

[MP] Fixes for NPCs in multiplayer

Is your feature request related to a problem? Please describe.

Source SDK 2013's multiplayer does not support NPCs in virtually any capacity. The code relies on UTIL_GetLocalPlayer() and AI_GetSinglePlayer() too much, often not accounting for when either of the two don't exist.

Describe the solution you'd like

Partial integration of SecobMod is the most common and probably the best solution in this case. Some of the more subjective features (e.g. the portal gun) are not needed, but the actual fixes are exactly what seem to be needed.

Describe alternatives you've considered

SecobMod's NPC fixes originate from Winston's AI Multiplayer patch, which could probably be used on its own instead, although I don't know the differences.


Additional context

SecobMod's repo is here, although there's also a Steam discussion with a newer patch.

Default params in VScript functions are always saved/restored as null

Whenever a function is saved, its default parameter values are always restored as null even if their default values are something different.

For example, this function has two non-null default parameters:

function TestDefaultParam(set1 = 0.5, set2 = "string")
{
	printl("set1 is " + set1 + ", set2 is " + set2);
}

Whenever TestDefaultParam() is called with no parameters, it normally outputs this into the console:

set1 is 0.5, set2 is string

However, whenever a game is saved/loaded, these parameter values appear to be lost and the function instead outputs this:

set1 is null, set2 is null

This is a problem for functions like EntFire or EntFireByHandle, which rely on the delay parameter having a default of 0.0.

Bumpmapped teeth fog exaggerating under intense values

SDK_Teeth materials with a bumpmap specified experience intense fog inconsistent with the fog controller parameters. This issue is most visible on Alyx's teeth.

Most likely related to radial fog. May be related to fog distances being used incorrectly?

c_arms support for Half-Life 2 viewmodels

Mapbase has support for custom hand viewmodels in the form of logic_playerproxy inputs and KV, but it can't actually be used with the default viewmodels. Mods can have their own viewmodels which use it, but having Mapbase come with its own version of the default HL2 models with proper c_arms support would be beneficial to mappers who want to portray different protagonists without going to all of the effort of getting new viewmodels or pretending that the HEV suit arms are something else.

Water reflections sometimes don't display correctly/consistently between the original Water shader and new Water shader

Reflections on some water materials display differently or don't display at all when using SDK_Water instead of Water. This may be an issue with the shader, although further investigation is needed to confirm that this is testing Mapbase with the old shader and not just testing regular Source 2013 with the old shader. If reports come from the latter, it could be an issue with Mapbase's clientside view-rendering instead of the shader.

Expanding env_wind to control specific effects, including func_precipitation

This was originally going to be a contribution in a PR (#35), but we decided that we would go for a more flexible and robust wind effect selection system instead which wouldn't affect existing maps.

I meant to make this right after v4.3's release, but I forgot about it and didn't get the chance after the inclusion of the other v5.0 features. It will probably be experimented with in the next Mapbase update.

V_AppendSlash ran out of space

I've been seeing this error a lot from people who have been using Mapbase, although they don't seem to make a big deal about it.

I have no idea where it comes from or what causes it to happen; It may not be an issue unique to Mapbase or one that we can fix, but I'm putting it here anyway because I feel like I've only seen this from people using Mapbase and not people using regular Source 2013.

VScript Save/Restore - Crash when restoring vectors in a table

The game can crash when restoring a Squirrel VM state with a Vector instance inside of a table. This does not appear to happen with other instance types, like entity handles.

For example, the following code will crash upon restoring a VM state:

tableTest <-
{
     vecTest = Vector( 24, 32, 17 )
}

However, the following code will not crash when restoring a VM state:

vecTest <- Vector( 24, 32, 17 )

The crash occurs on this line in SquirrelVM::ReadObject(), when the typetag is assumed to be a script description and checked for SCRIPT_SINGLETON:

        SQUserPointer typetag;
        sq_gettypetag(vm_, -1, &typetag);

        if (typetag && typetag != TYPETAG_VECTOR &&
            ((ScriptClassDesc_t*)typetag)->m_pszDescription[0] == SCRIPT_SINGLETON[0]) <<<<<<<<<<<<<<<<<
        {
            sq_poptop(vm_);

            Assert(sq_isclass(klass));

This suggests vectors are somehow losing their typetag upon being restored. There is not supposed to be any difference between instances outside of tables and instances inside of tables, but it only appears to happen with instances inside of tables.

This could be an underlying issue with the way the restore code interacts with embedded tables.

Lost Coast soldier model crashes when loaded in Mapbase

Based on an issue a user was having, the Lost Coast version of the Combine soldier model apparently crashes when loaded into Mapbase. Default HL2 content is prioritized over Lost Coast content in the default gameinfo.txt structure, so this doesn't cause any major issues by default, but it could potentially involve an underlying problem (e.g. previous .mdl versions not working with the $includemodel custom animation technique).

This might also just be from loading old Half-Life 2/lostcoast models into Source 2013 in general.

Actbusy manifest override is loaded before creation of string register of activities

Assertion in server\ai_activity.cpp line 73: m_pActivitySR is null
Can be reproduced by loading mapbase_demo01

  1. When IGameSystem::LevelInitPreEntityAllSystems called, all LevelInitPreEntity functions
    of all game systems are executed in addition order.
  2. m_pActivitySR is created by CAI_SystemHook::LevelInitPreEntity,
    but it is called after CMapbaseSystem::LevelInitPreEntity
  3. That function load and registers actbusies from file specified in manifest using CActBusyAnimData::ParseAnimDataFile.
  4. And ParseAnimDataFile uses CAI_BaseNPC::GetActivityID, which fails on Assert( m_pActivitySR );

There is also a call of CActBusyAnimData::ParseAnimDataFile from CActBusyAnimData::LevelInitPostEntity, which loads default ActBusy.txt file without any errors.

$bumpmask missing from SDK_LightmappedGeneric

It appears that the shader code copied from Insolence has dismantled the $bumpmask parameter. This causes some HL2 materials (e.g. nature/toxicslime002a) to stop working correctly.

I had never heard of this parameter before. I'm not even getting any results for it on the VDC. Even though it's an obscure mask type used for very specific purposes, this is a feature used in Half-Life 2 that is now broken. The removal of $bumpmask is not a desired change for Mapbase.

Is this disabled because of code copied from Alien Swarm? If so, why was it disabled? Is there any risk for re-enabling it?

VScript no type check causes crash on invalid input

SquirrelVM::GetInstanceValue needs to check the type of hInstance against pExpectedType to ensure it returns only if the types match. It could also possibly recursively check for base types too.

Recreate by passing unexpected HSCRIPT value

player.SetOwner( 1 )
player.SetOwner( "" )
player.SetParent( 0, "" )
EntFireByHandle( [], "" ) etc.

NPCs turn invisible and crash upon ragdolling (rare)

This is a rare issue thought to be caused by Mapbase's "$includemodel hierarchy" method for adding custom animations to NPCs.

In this issue, a random NPC's model suddenly turns invisible. The "randomness" may depend directly on the state of the entity list at the time; sometimes this issue occurs on the same NPC across multiple playthroughs. The issue often stops happening after additional compiles in the involved map, although this may depend on what was changed from the original compile.

When the NPC turns into a ragdoll (e.g. after dying) in this invisible state, the game crashes with a dump typically leading to a central studio.cpp function, often involving the model's "virtual model".


This issue is very rare; in fact, it wasn't even thought to be caused by Mapbase because it was previously only reported to have happened in two mods with shared code with no reports involving any other Mapbase mod. However, it has now been observed to occur in another mod using Mapbase, so the leading hypothesis now is that it's a rare issue with Mapbase itself involving Mapbase's custom animations.

Potential causes:

  • Engine-side limitations of $includemodel nesting which could not be fixed.
  • Something involving the .ani files on the original models interfering with the new animations.

Misc. phenomena involving this issue:

  • The issue has so far only been observed to happen on NPCs.
  • Removing EF_NODRAW or setting the render mode to "None" on a model made invisible by this issue do not do anything.
    • The model might not actually be invisible. It might just be offset to an invalid position. (need further testing on that)
  • The model can return to normal and ragdoll with no problems if the involved model is hidden by vis (possibly only by area portals?) for an extended period of time.

Blended selfillum and transparency not showing up on water reflection or refraction

$selfillum and $translucent/$alphatest blending does not function when rendered through water. The selfillum is always at 100% intensity and the transparency always ends up fully transparent. This does not happen with mirrors.


NOTE: $translucent/$alphatest blending shows up correctly when "Reflect all" is enabled rather than "Reflect world". $selfillum blending still seems to show up incorrectly during refraction.

IsValid() is missing from VScript

IsValid() checks to make sure the handle is pointing to a valid entity. Using handle != null only checks if the handle itself is null. This would check to see if the handle is pointing to a valid entity.

This doesn't seem to be in the Alien Swarm SDK, which suggests it might be something in the VScript library. This needs more research

postprocess_controller support

This is an entity from later versions of Source which is available in the Alien Swarm SDK.

Momentum has this ported to Source 2013, so it's possible and there's a reference available; Needs further research

Lua VM support

It has been proposed that a Lua VScript VM could be added in addition to Squirrel. This would be great for people coming from a Gmod Lua background, people approaching Source 2 VScript, etc.

This would not happen until the Squirrel VM is in a confidently stable state.

Remaining questions:

  • Will the known benefits be worth the time and effort?
  • Should this be done before or after v4.0? (should it be a part of the initial full VScript release)

Some class functions not restored properly after save/restore

I'm having an issue with CTakeDamageInfo's functions not being registered after being restored from a save file. (CTakeDamageInfo is a class exposed by my own changes)

First, I spawned a citizen running a script file named test_takedamage_1:

function TakeDamage()
{
    local ent = Entities.FindByName(null,"devzombies")
    local info = CreateDamageInfo(ent, ent, Vector(0, 0, 100000), Vector(0,0,0), 1000, 0)
    if (ent)
    {
        printl("Found zombie, applying damage " + info.GetDamage())
        ent.TakeDamage(info)
    }
    else
    {
        printl("Can't find zombie")
    }

    DestroyDamageInfo(info)
}

Then, after saving the game and loading the save, I spawned a zombie named devzombies and ran the following command on the citizen:

ent_fire !picker runscriptcode "TakeDamage()"

This code fails to run, with the console containing the following error:

(16.35) input : devcitizen.runscriptcode(TakeDamage())

CALLSTACK
*FUNCTION [TakeDamage()] test_takedamage_1.nut line [9]

AN ERROR HAS OCCURRED [the index 'GetDamage' does not exist]
*FUNCTION [main()] InputRunScript line [1]
[this] TABLE

LOCALS
[vargv] ARRAY
[info] NULL
[this] TABLE
[ent] INSTANCE
 Entity devcitizen encountered an error in RunScript()

This is the case with any entity running any code involving CTakeDamageInfo from that point forward, but it curiously does not happen if there is no script in the level involving CTakeDamageInfo when the game is saved and its first involvement is after the save is loaded.

This has not been tested with other classes.


Steps to reproduce

  1. Load mapbase_demo02
  2. Spawn a citizen by typing the following command into the console: npc_create npc_citizen devcitizen vscripts "test_takedamage_1" (NOTE: Assumes the script above was saved as test_takedamage_1 in scripts/vscripts)
  3. Save the game
  4. Load the save
  5. Spawn a zombie by typing the following command into the console: npc_create npc_zombie devzombies
  6. Run the following command in the console: ent_fire devcitizen runscriptcode "TakeDamage()"

CTakeDamageInfo script desc

BEGIN_SCRIPTDESC_ROOT( CTakeDamageInfo, "Damage information handler." )
	DEFINE_SCRIPTFUNC_NAMED( ScriptGetInflictor, "GetInflictor", "Gets the inflictor." )
	DEFINE_SCRIPTFUNC_NAMED( ScriptSetInflictor, "SetInflictor", "Sets the inflictor." )
	DEFINE_SCRIPTFUNC_NAMED( ScriptGetWeapon, "GetWeapon", "Gets the weapon." )
	DEFINE_SCRIPTFUNC_NAMED( ScriptSetWeapon, "SetWeapon", "Sets the weapon." )
	DEFINE_SCRIPTFUNC_NAMED( ScriptGetAttacker, "GetAttacker", "Gets the attacker." )
	DEFINE_SCRIPTFUNC_NAMED( ScriptSetAttacker, "SetAttacker", "Sets the attacker." )

	DEFINE_SCRIPTFUNC( GetDamage, "Gets the damage." )
	DEFINE_SCRIPTFUNC( SetDamage, "Sets the damage." )
	DEFINE_SCRIPTFUNC( GetMaxDamage, "Gets the max damage." )
	DEFINE_SCRIPTFUNC( SetMaxDamage, "Sets the max damage." )
	DEFINE_SCRIPTFUNC( ScaleDamage, "Scales the damage." )
	DEFINE_SCRIPTFUNC( AddDamage, "Adds to the damage." )
	DEFINE_SCRIPTFUNC( SubtractDamage, "Removes from the damage." )
	DEFINE_SCRIPTFUNC( GetDamageBonus, "Gets the damage bonus." )
	DEFINE_SCRIPTFUNC( SetDamageBonus, "Sets the damage bonus." )

	DEFINE_SCRIPTFUNC( GetBaseDamage, "Gets the base damage." )
	DEFINE_SCRIPTFUNC( BaseDamageIsValid, "Checks if the base damage is valid." )

	DEFINE_SCRIPTFUNC( GetDamageForce, "Gets the damage force." )
	DEFINE_SCRIPTFUNC( SetDamageForce, "Sets the damage force." )
	DEFINE_SCRIPTFUNC( ScaleDamageForce, "Scales the damage force." )

	DEFINE_SCRIPTFUNC( GetDamagePosition, "Gets the damage position." )
	DEFINE_SCRIPTFUNC( SetDamagePosition, "Sets the damage position." )

	DEFINE_SCRIPTFUNC( GetReportedPosition, "Gets the reported damage position." )
	DEFINE_SCRIPTFUNC( SetReportedPosition, "Sets the reported damage position." )

	DEFINE_SCRIPTFUNC( GetDamageType, "Gets the damage type." )
	DEFINE_SCRIPTFUNC( SetDamageType, "Sets the damage type." )
	DEFINE_SCRIPTFUNC( AddDamageType, "Adds to the damage type." )
	DEFINE_SCRIPTFUNC( GetDamageCustom, "Gets the damage custom." )
	DEFINE_SCRIPTFUNC( SetDamageCustom, "Sets the damage custom." )
	DEFINE_SCRIPTFUNC( GetDamageStats, "Gets the damage stats." )
	DEFINE_SCRIPTFUNC( SetDamageStats, "Sets the damage stats." )
	DEFINE_SCRIPTFUNC( IsForceFriendlyFire, "Gets force friendly fire." )
	DEFINE_SCRIPTFUNC( SetForceFriendlyFire, "Sets force friendly fire." )

	DEFINE_SCRIPTFUNC( GetAmmoType, "Gets the ammo type." )
	DEFINE_SCRIPTFUNC( SetAmmoType, "Sets the ammo type." )
	DEFINE_SCRIPTFUNC( GetAmmoName, "Gets the ammo type name." )

	DEFINE_SCRIPTFUNC( GetPlayerPenetrationCount, "Gets the player penetration count." )
	DEFINE_SCRIPTFUNC( SetPlayerPenetrationCount, "Sets the player penetration count." )

	DEFINE_SCRIPTFUNC( GetDamagedOtherPlayers, "Gets whether other players have been damaged." )
	DEFINE_SCRIPTFUNC( SetDamagedOtherPlayers, "Sets whether other players have been damaged." )
END_SCRIPTDESC();

Reactivate and fix partially-cut entities

There are some entities in Source SDK, which are exists in code but not included into .vpc file and not compiled to .dll file:

  • npc_assassin - sp/src/game/server/hl2/npc_assassin.[h/cpp]
    HL2 Combine Female Assassin (model exists in HL2 Leak)
  • npc_blob - sp/src/game/server/hl2/npc_blob.cpp
    Some experimental blob monster
  • npc_bullsquid - sp/src/game/server/hl2/npc_bullsquid.[h/cpp]
    HL1-HL2 bullsquid (model exists in HL1 and HL2 Leak)
  • npc_houndeye - sp/src/game/server/hl2/npc_houndeye.[h/cpp]
    HL1-HL2 houndeye (model exists in HL1, broken in vanilla HL2 Leak)
  • npc_hydra - sp/src/game/server/hl2/npc_hydra.cpp + sp/src/game/client/c_npc_hydra.cpp
    HL2 Hydra monster (model exists in HL2 Leak, probably will have shader issues)
  • npc_spotlight - sp/src/game/server/hl2/npc_spotlight.cpp
    Spotlight with AI, fires output when player/npc is spotted (no model)
  • prop_vehicle_jetski - sp/src/game/server/hl2/vehicle_jetski.cpp
    Predecessor of the HL2 Airboat
  • weapon_cguard - sp/src/game/server/hl2/weapon_cguard.cpp
    Weapon of the cut Combine Guard (model exists in HL2 Leak)
  • weapon_ar1 - sp/src/game/hl2/weapon_ar1.cpp
    AK-47 cut from HL2 (model exists in HL2 Leak)
  • weapon_extinguisher - sp/src/game/server/hl2/weapon_extinguisher.cpp
    Extinguisher, also cut from HL2 (model also exists in HL2 Leak)
  • weapon_manhack - sp/src/game/server/hl2/weapon_manhack.cpp
    Just a manhack blades
  • weapon_molotov - sp/src/game/server/hl2/weapon_molotov.[h/cpp]
    Model exists in HL2 Leak, needs sp/src/game/server/hl2/grenade_molotov.[h/cpp] for projectile
  • weapon_flaregun - sp/src/game/server/hl2/weapon_flaregun.[h/cpp]
    Already fixed a bit (model exists in HL2 Leak)
  • weapon_irifle - sp/src/game/server/hl2/weapon_irifle.cpp
    Another flaregun, uses AR2 model
  • weapon_immolator - sp/src/game/server/hl2/weapon_immolator.cpp
    Cut combine flamethrower (model exists in HL2 Leak)
  • weapon_sniperrifle - sp/src/game/server/hl2/weapon_sniperrifle.cpp
    (model exists in HL2 Leak)
  • weapon_smg2 - sp/src/game/server/hl2/weapon_smg2.cpp
    Another SMG (model exists in HL2 Leak)
  • weapon_thumper - sp/src/game/server/hl2/weapon_thumper.cpp
    Portative Thumper (placeholder model exists in HL2 Leak)
  • weapon_tripwire - sp/src/game/server/hl2/weapon_tripwire.cpp
    Some tripwire (like SLAM)

Some of those entities could be fixed.

[MISC] "vscript" response in Response System

Is your feature request related to a problem? Please describe.

The Response System is currently limited to a few specific speech-related response types which are (for the most part) pretty flexible on their own, but it's hard to do anything ground-breaking with it without heavily modifying the source code.

Describe the solution you'd like

A response type which could run the response name as VScript code could make the Response System more flexible than ever.

Potential benefits:

  • VScript can be used to play scenes, wave files, and sentences on its own, so it can allow for response-specific behavior. It can also allow other dynamic behavior unrelated to the response.
  • VScript can be used to influence entities in the map, so this would make it much easier to use the Response System for non-speech applications.

Describe alternatives you've considered

Later games have a choreo event for VScript code, although it's not possible to edit Source 2013 Faceposer to use it and its limits aren't fully understood. The code being run directly from the response also allows it to create a scene to play, which would be difficult to replicate in a scene which already exists.

A generic AI event can also be added to Faceposer, although it falls under the same reasoning when it comes to flexibility and ease of use.


Additional context

It would probably be best to address this after the Alien Swarm SDK Response System (#43) is implemented.

VS2013 compiler has a lot of non-error warnings while compiling vscript.lib

In the VS2013 compiler, compiling vscript.lib causes several warnings stemming from the Squirrel API. It still compiles, but it's very likely to confuse SDK users who are used to warnings which cause compilation to fail entirely.

Here is a list of every warning given on my end, with irrelevant parts of the file paths cut out:

1>e:\...\sp\src\vscript\squirrel\squirrel\sqclass.cpp(192): warning C4100: 'v' : unreferenced formal parameter
1>e:\...\sp\src\vscript\squirrel\squirrel\sqcompiler.cpp(177): warning C4611: interaction between '_setjmp' and C++ object destruction is non-portable
1>e:\...\sp\src\vscript\squirrel\squirrel\sqapi.cpp(183): warning C4100: 'v' : unreferenced formal parameter
1>e:\...\sp\src\vscript\squirrel\squirrel\sqcompiler.cpp(895): warning C4127: conditional expression is constant
1>e:\...\sp\src\vscript\squirrel\squirrel\sqcompiler.cpp(1061): warning C4127: conditional expression is constant
1>e:\...\sp\src\vscript\squirrel\squirrel\sqcompiler.cpp(1071): warning C4127: conditional expression is constant
1>e:\...\sp\src\vscript\squirrel\squirrel\sqbaselib.cpp(44): warning C4100: 'v' : unreferenced formal parameter
1>e:\...\sp\src\vscript\squirrel\squirrel\sqbaselib.cpp(823): warning C4100: 'r' : unreferenced formal parameter
1>e:\...\sp\src\vscript\squirrel\squirrel\sqbaselib.cpp(823): warning C4100: 'l' : unreferenced formal parameter
1>e:\...\sp\src\vscript\squirrel\squirrel\sqbaselib.cpp(953): warning C4244: '=' : conversion from 'int' to 'SQChar', possible loss of data
1>e:\...\sp\src\vscript\squirrel\squirrel\sqbaselib.cpp(954): warning C4244: '=' : conversion from 'int' to 'SQChar', possible loss of data
1>e:\...\sp\src\vscript\squirrel\squirrel\sqapi.cpp(57): warning C4702: unreachable code
1>e:\...\sp\src\vscript\squirrel\squirrel\sqbaselib.cpp(136): warning C4706: assignment within conditional expression
1>e:\...\sp\src\vscript\squirrel\squirrel\sqmem.cpp(8): warning C4100: 'oldsize' : unreferenced formal parameter
1>e:\...\sp\src\vscript\squirrel\squirrel\sqmem.cpp(10): warning C4100: 'size' : unreferenced formal parameter
1>e:\...\sp\src\vscript\vscript_squirrel.cpp(805): warning C4800: 'SQBool' : forcing value to bool 'true' or 'false' (performance warning)
1>e:\...\sp\src\vscript\vscript_squirrel.cpp(914): warning C4800: 'SQBool' : forcing value to bool 'true' or 'false' (performance warning)
1>e:\...\sp\src\vscript\squirrel\squirrel\sqlexer.cpp(511): warning C4244: 'argument' : conversion from 'int' to 'const SQChar', possible loss of data
1>e:\...\sp\src\vscript\squirrel\squirrel\sqtable.h(87): warning C4706: assignment within conditional expression
1>e:\...\sp\src\vscript\squirrel\squirrel\sqlexer.cpp(276): warning C4702: unreachable code
1>e:\...\sp\src\vscript\squirrel\sqstdlib\sqstdaux.cpp(34): warning C4706: assignment within conditional expression
1>e:\...\sp\src\vscript\squirrel\squirrel\sqobject.cpp(210): warning C4706: assignment within conditional expression
1>e:\...\sp\src\vscript\squirrel\squirrel\sqstate.cpp(244): warning C4100: 'vm' : unreferenced formal parameter
1>e:\...\sp\src\vscript\squirrel\sqstdlib\sqstdblob.cpp(123): warning C4100: 'size' : unreferenced formal parameter
1>e:\...\sp\src\vscript\squirrel\sqstdlib\sqstdio.cpp(118): warning C4100: 'size' : unreferenced formal parameter
1>e:\...\sp\src\vscript\squirrel\sqstdlib\sqstdstring.cpp(389): warning C4100: 'size' : unreferenced formal parameter
1>e:\...\sp\src\vscript\squirrel\sqstdlib\sqstdrex.cpp(567): warning C4611: interaction between '_setjmp' and C++ object destruction is non-portable
1>e:\...\sp\src\vscript\squirrel\sqstdlib\sqstdrex.cpp(382): warning C4706: assignment within conditional expression
1>e:\...\sp\src\vscript\squirrel\sqstdlib\sqstdrex.cpp(407): warning C4706: assignment within conditional expression
1>e:\...\sp\src\vscript\squirrel\sqstdlib\sqstdrex.cpp(444): warning C4706: assignment within conditional expression
1>e:\...\sp\src\vscript\squirrel\sqstdlib\sqstdrex.cpp(452): warning C4706: assignment within conditional expression
1>e:\...\sp\src\vscript\squirrel\sqstdlib\sqstdrex.cpp(479): warning C4706: assignment within conditional expression
1>e:\...\sp\src\vscript\squirrel\sqstdlib\sqstdrex.cpp(486): warning C4706: assignment within conditional expression
1>e:\...\sp\src\vscript\squirrel\sqstdlib\sqstdrex.cpp(550): warning C4702: unreachable code
1>e:\...\sp\src\vscript\squirrel\squirrel\sqtable.h(73): warning C4706: assignment within conditional expression
1>e:\...\sp\src\vscript\squirrel\squirrel\sqvm.cpp(524): warning C4100: 'arg_2' : unreferenced formal parameter
1>e:\...\sp\src\vscript\squirrel\squirrel\sqvm.cpp(1619): warning C4100: 'mm' : unreferenced formal parameter
1>e:\...\sp\src\vscript\squirrel\squirrel\sqvm.cpp(265): warning C4702: unreachable code
1>e:\...\sp\src\vscript\squirrel\squirrel\sqvm.cpp(593): warning C4706: assignment within conditional expression
1>e:\...\sp\src\vscript\squirrel\squirrel\sqvm.cpp(607): warning C4706: assignment within conditional expression
1>e:\...\sp\src\vscript\squirrel\squirrel\sqvm.cpp(1174): warning C4706: assignment within conditional expression
1>e:\...\sp\src\vscript\squirrel\squirrel\sqvm.cpp(1616): warning C4702: unreachable code

func_precipitation particle rain from Alien Swarm SDK

This is something that has been heavily requested for Mapbase, but it hasn't been implemented yet.

I've been working on other features and I'm afraid to go down this rabbithole again, so I have the "Help wanted" label on this issue in case anyone wants to add this on their own accord.

Nodegraph might not be loaded when reloading a save under certain circumstances

There have been at least two cases of a map's nodegraph not being loaded currently on map load under the following circumstances:

  • The map is being loaded from a save
  • The map had not been loaded beforehand (OR: The map is the first nodegraphed map being loaded since the game was started?)

The nodegraph will not load and AI will be disabled when the save is finished loading. If the player restarts the map from the beginning and then reloads the save, the nodegraph will be loaded correctly.

Both reports of this came from mods utilizing Mapbase (Entropy : Zero 2 and Map Labs: FusionVille 2). It is not known if this bug is unique to Mapbase or if it can be replicated in regular Source 2013.

Potentially letting point_camera "Don't render skybox" sky mode write alpha to RT texture

I couldn't get "Don't render skybox" working for point_camera's new "Sky Mode" keyvalue, but I think that's just because I was trying to input SKYBOX_NOT_VISIBLE when something like DF_DRAWSKYBOX was already ticked.

Now, I realize that the lack of a skybox could possibly be used to write the void as alpha, similar to how the 3D skybox works. If so, that would allow for transparent RT textures which allow entities using the RT texture to render what's behind them alongside what's in the RT texture without actually losing opacity.

This means you could have, say, 2D Breen ghosts. Or something.

This could also be expanded to func_reflective_glass and the new func_fake_worldportal entity, especially since doing this with the latter would allow for script_intro-like rendering effects.

This idea did not make it into v5.0, but it will probably be experimented with in the next Mapbase update.

Implement Alien Swarm SDK Response System

The Alien Swarm SDK features the rewritten Response System from Left 4 Dead and later. This system is more efficient and contains new features, such as info_remarkable and follow-up responses.

This is its own component in the SDK (todo: is it a library?) and needs further research. Some mods already change the existing Source 2013 response system as well and implementing this in Mapbase may cause issues with those mods. If this were to be implemented, it would need to be carefully planned or even just considered a completely optional feature.

Fix debug build asserts

When running the debug build there are a lot of asserts that occur, it would be good to resolve these so then its easier to do testing and development by using debug builds.

The current work around is to ignore these asserts when they arise however they continue to spam the console even when they are ignored.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.