lewa-j / Unity-Source-Tools

Plugin to import resources from the Source engine in Unity3D.
GNU General Public License v2.0
109 stars 22 forks source link

Cannot import map. #3

Closed MrBruz closed 6 years ago

MrBruz commented 6 years ago

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?

StamatisP commented 6 years ago

You can press the play button in Unity, and it'll try to load it.

MrBruz commented 6 years ago

Thank you. I thing i know what you are talking about. the "game" tab in unity!

MrBruz commented 6 years ago

Update found what u meant by the play button. got the script to run but there is a lot of problems. here is a google drive link with two pictures showing the setup and what happened. https://drive.google.com/drive/folders/1y6O0mgrd04DxqgZnN884fAj2ulDM4mu1?usp=sharing

StamatisP commented 6 years ago

From what I see, the version of Unity you're using is older than the current version of the repo, which is 2018.2.1f1, though I don't believe that would cause this. Personally, I don't have much idea what's going on, since it could be anything.

MrBruz commented 6 years ago

well could you load the first portal map into unity yourself then send me the project?

MrBruz commented 6 years ago

Also could you try to load portal in unity with this plugin? The thing is my project is to port all of portal to unity so I can make it run on android. I have three ways to importing the map. 1. craft by nems tools. It doesnt really export everything into the obj the object are 90* the wrong way and even when i rotate it the textures are still the wrong way around. 2. This plugin. I really hope this works in the end!! 3. https://github.com/aleksijuvani/unity-vmf-loader I followed instuctions but it corupted my project and didnt work.

StamatisP commented 6 years ago

This script is really not preferable for mobile devices, due to how intensive the process can be on the CPU. You would have better luck recreating the maps in probuilder, I believe.

MrBruz commented 6 years ago

I will not be "recreating the maps" I would like to convert them. I believe there is a problem with your script. Could you try it yourself?

StamatisP commented 6 years ago

I've tried to find ways to convert the map, but all of them leave a less than perfect product. The worst problem I have is that lighting tends to go through walls. Theoretically, Portal maps should work, since it's the same BSP version as Gmod, which I have tested. Do you have all the textures extracted from the game? That's how you get the textures to show.

MrBruz commented 6 years ago

Yes. :) I have tried it without doing that and it just gives me warnings saying it can't find the materials so I just extracted them with gcfscape like I did to get craft(by nems tools) working. But when it has the textures it stops early in because of an error. it says the parameter "source" cannot be null. where can I change this so it is correct? Or is it a problem in your script. If you cannot help to get this work with your tool could you help me get the other tool working? https://github.com/aleksijuvani/unity-vmf-loader I tried using it but it says it uses old plugins so I say use em and it is supposed to make a toolkit apper next to the inspector but I cannot find it.

MrBruz commented 6 years ago

update https://www.reddit.com/r/Unity3D/comments/7kjis0/gmod_asset_loader/ He makes a comment he uses and another plugin combined to get gmod in unity. Will I need both to get portal in unity?

"throwaway5noreasonHobbyist[S] 6 points 10 months ago sorry if its blurry, i had to upload it through gfycat to get it onto imgur cuz i couldnt figure out how to upload directly to imgur as video to gif

made by combining https://github.com/lewa-j/Unity-Source-Tools and https://github.com/SteamDatabase/ValvePak"

StamatisP commented 6 years ago

VMF loader has worked terribly for me, do not recommend personally, though you can still try it. I have actually dm'ed the author of the post you mentioned, and they never replied back to me. ValvePak is for opening VPK's for whatever reason he did. I have no idea why it wouldn't be working for you, unless you didn't update your Unity. Sorry for the quality of help, but I'm busy with a lot right now.

MrBruz commented 6 years ago

welp. Could you help me get your tool working? I am not in a rush. Christmas would be my deadline.

StamatisP commented 6 years ago

Well, a first step would be clicking on that 'source' error you get and observe where in the code that happens. Maybe set up some print messages to check 100% if functions are running correctly. That's what I did, at least.

MrBruz commented 6 years ago

Sure thing. Will do it asap.

MrBruz commented 6 years ago

Got a more detailed picture of the unrecoverable error https://drive.google.com/file/d/17MnVd_2q1bvioni0Sl5PwnkCgyTJZmld/view?usp=sharing hope this is what you wanted! :)

StamatisP commented 6 years ago

Well, it says one of the materials are missing, or null. Check to make sure all materials are assigned and accounted for.

lewa-j commented 6 years ago

Look at uSrcSettings script on the object. What is in the variable diffuseMaterial? help2a

StamatisP commented 6 years ago

You need a diffuse material. Make a material and assign it.

MrBruz commented 6 years ago

Ahh ok. What should i set it to? (im a noob)

MrBruz commented 6 years ago

i set it to the default diffuse material. it kinda works now. https://drive.google.com/file/d/1l4WYDE1jzD-wyNpC62XuLXAUxQG_YDFm/view?usp=sharing what now?

StamatisP commented 6 years ago

I can't help with a problem I don't know. Just click on the error and do whatever it needs.

MrBruz commented 6 years ago

Ahhh :(

MrBruz commented 6 years ago

The error doesnt tell me what to do. It just tells me more detail of it. Can lewa-j help me?

lewa-j commented 6 years ago

These must be set too. help4a Assets/Materials/Transparent Assets/Materials/TransparentCutout Assets/Materials/Diffuse

StamatisP commented 6 years ago

You must create materials for them too. It is in the name, just create transparent and vertex lit materials(vertex lit is the same as diffuse pretty much).

MrBruz commented 6 years ago

thank you.