Coder Social home page Coder Social logo

unity-source-tools's Introduction

Unity-Source-Tools

Plugin to import resources from the Source engine in Unity3D.

Instructions:

Step 1: Load scene respective to what game you are extracting from, and click the WorldManager gameobject.

Step 2: Set the Export Location to where you would want to export the map.(This is optional)

Step 3: Set Map Name to the name of your map you want to import.

Step 4: Set Model Name to the name of your model you want to import(untested).

Step 5: Tick "Load Map" or "Load Model", depending on what you're doing.

Step 6: Tick Skip Sky. Otherwise, your sky will be full of garbage.

Step 7: Scroll down to uSrcSettings.

Step 8: Set the Path to wherever your game folder is(example: D:\SteamLibrary\steamapps\common\GarrysMod )

Step 9: Depending on what you're doing, adjust the game, have mod, and mod settings.

Example for Garrysmod

(This makes the script look for materials/models in D:\SteamLibrary\steamapps\common\GarrysMod\garrysmod)

Step 10: Tick Textures, Displacements, Props, Props Dynamic, Entities, and Gen Colliders.

P.S: Lightmaps may not work correctly.

That should work! If I got this wrong, please leave an issue.

Original Readme Below

Author: lewa_j

Contributors:

antimYT

Fronkln

StamatisP

VK Public: vk.com/uSrcTools

Supported formats:

bsp - maps

vmt - materials

vtf - textures

mdl - models

vvd - models vertices

vtx - model indices

==============================================

uSource UnitySourceTools uSrcTools

unity-source-tools's People

Contributors

antim0118 avatar fronkln avatar kevin43 avatar lewa-j avatar stamatisp 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

unity-source-tools's Issues

Error messages when importing

Can you update the code?
I made a blank project then directly imported it, Unity warned me that it was obsolete but i proceed, then unity came up with two error messages.
`Shader error in 'WorldVertexTransition': undeclared identifier 'mix' at line 30 (on d3d11)

Compiling Vertex program with DIRECTIONAL
Platform defines: UNITY_ENABLE_REFLECTION_BUFFERS UNITY_USE_DITHER_MASK_FOR_ALPHABLENDED_SHADOWS UNITY_PBS_USE_BRDF1 UNITY_SPECCUBE_BOX_PROJECTION UNITY_SPECCUBE_BLENDING UNITY_ENABLE_DETAIL_NORMALMAP SHADER_API_DESKTOP UNITY_LIGHT_PROBE_PROXY_VOLUME
Assets/Code/Read/SourceBSPLoader.cs(574,138): error CS0170: Use of possibly unassigned field texdata'
Unity version: 5.6.3f1 personal 64 bit
Thank you.

Named Lights' Lightmap Pages Doesn't Load (Data Is Read But Not Used)

Alright, before posting this issue i 100% checked this out.
In Source, named lights have their own lightmap pages(when a light entity gets turned off, its page is also turned off, that's why)

So i made a test map.

image

In the map, there are three lights, light 1 and 2 are named lights so they have their own lightmap page.
Light 3 is a unnamed light.

Loading the map in Source to Unity provides us with only the unnamed light loaded.
image

Unity Source Tools reports the lightmap pages as 1.
image

BSP Version: 20 (Source SDK 2013)
usrc_lightmappages.zip

Now here is the most important part. Removing one of the named lights from the BSP reduces lightmap lump which Unity Source tools accurately reports. But it doesn't seem to do anything with the lumps of named lights.

CSGO Map Textures not loading

Hey,

any ideas why the textures of the csgo maps I try to load are not loading? It loads up most of the geometry but all of them without textures. If you need more details let me know. Thought this might maybe be a known issue.

prop_static version 6 will not get loaded

background01 - a Half-Life 2 map, has a static prop version of 4 and a BSP version of 19. Which loads fine.

However, if you make a new map with the hammer editor that comes with HL2 (SDK 2013)
Your map's prop static version will be 6 and BSP version will be 20

The map loader will incorrectly report the amount of static props (0)

Collisions

Is it possible to make the map collidable?
My character is just falling through the map and without collision, there is no point in importing a map that you cant play on.

Material Load issue

image

Loading maps from Gmod with CSS content addons doesn't seem to load textures and or props well.

Distrubute on Steam Exception

I noticed the license is GPLv2, do you allow exceptions for devs creating games for Steam that want to include the tools in their Source SDK depots?

Looking for a HL1/Source SDK license.

TODO: Re-implement Commented Out Light Code

I recently have re-implemented commented out lighting code to recreate lighting entities and have it only apply to objects that are not a part of the map lightmap the results are very nice. Should be worth to have it added to this

Before:
image
After:
image

Note: the bloom effect comes from Post-Processing Stack v2

Error while importing GM_Construct

Hey im trying to import gm_construct to test this tool using unity 2019 LTS. This is the error i get
NullReferenceException: Object reference not set to an instance of an object uSrcTools.SourceBSPLoader.LoadEntity (System.Int32 index) (at Assets/Code/Read/SourceBSPLoader.cs:286) uSrcTools.SourceBSPLoader.Load (System.String mapName) (at Assets/Code/Read/SourceBSPLoader.cs:144) uSrcTools.Test.Load () (at Assets/Code/Test.cs:74) uSrcTools.MapLoader.OnInspectorGUI () (at Assets/Code/Test.cs:18) UnityEditor.UIElements.InspectorElement+<>c__DisplayClass58_0.<CreateIMGUIInspectorFromEditor>b__0 () (at <a259d3c004024353a2c217da97495055>:0) UnityEngine.GUIUtility:ProcessEvent(Int32, IntPtr)

No textures loading, only grey grid

I'm trying to get in portal maps, and I've extracted everything out of the portal_pak_dir.vpk, but it won't see the textures and spawns in the map with a grey dev material. I have no clue what to do, any help would be appreciated

(Question) Source Entities with Functionality

Do we plan to add support for Source entity functionality as well? What i mean by that is stuff like trigger_once actually doing something instead of being just loaded without any functionality, i have quite a few of them coded in my project and was wondering if it was okay to commit them here

all entities dont load

every single map i try to load doesnt load all of the entities and props in the map. instead it only loads a few, and most of that few has a blank grey texture

Half-Life 2 Beta BSP(v18) Array index error despite the map data loading

ti = map.texinfosLump[face.texinfo];

This line generates an array index out of range error even though map data has been loaded perfectly.

Load: 501 TextureData's
Load: 16544 Vertexes
Load: 5602 TexInfos
Load: 11773 Faces
Load :45263 Edges
Load :72666 SurfEdges
Load: 86 Models
Load: 43 DispInfos
Load: 3019 DispVerts
Load: 3 GameLumps
Load :48153 TexDataStringData
Load :876 TexDataStringsTable

The error happens when it starts loading the faces.

image

Map's texinfo seems to be loaded.

Clip brushes

EN: i cant understand how to create clip brushes, looks like they're skipped by some part of code. any clue?

RU: не могу понять как импортировать клип-браши, будто что-то игнорирует их. есть идеи?

Props don't get put in the correct location

I was importing a Gmod map into Unity with this tool and when it imported, while everything loaded up properly, the props are just floating in the air not even in the area where they're supposed to be. Does anyone know what could be causing the problem?

Cannot import map.

I am very new to Unity3d I have followed all the steps of copying the files in, loading the (portal) scene and setting the settings. But what button do i press now to import the map?

Incorrect Rotation for Skybox Textures

Just making an "issue" for this so this get's more attention, on my skybox loading code, due to how Source handles skybox textures, the up texture of skybox will have incorrect rotation and will not match with the rest of the skybox.

The solution is simple:

Rotate the Skybox Up Texture2D by 90 degrees clockwise

The issue:
I do not know how to do this

So if any of you coders out there can do this it would greatly help loading Skyboxes from the game

Without Batching Doesn't Work

Normally gives index outside the bounds of the array, so i added this line in the circle

image

That fixed the error, but now no mesh is built.

Unable to Export maps

I am unable to export maps or just do not know how, Any help will be appreciated.

info_overlay

Does someone have the time and wants to implement "info_overlay"? Would be awesome.

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.