Thursday 23 January 2014

Compiling

Now for the compiling. This bit took me quite a while to figure out. I followed this guide which helped a lot... http://www.aplinet.org/realsim/index.php?option=com_content&view=article&id=236:tutorial-mas2exe-modmakerchm-how-make-a-mod-for-rfactor2&catid=62:herramientas&Itemid=154

To package the files together you use a program called the MAS utility. I used this way back to unpack mas files to sort out my file structure. All the gmt and dds texture files go into one file which you do by dragging and dropping them and saving as a mas file. Then all the code goes in another and then the teams folder which specifies different paint jobs for different drivers. But so far I only have one. And then im left with 3 mas files..

hakosuka (code)
hakosuka_common (textures and gmt's)
hakosuka_teams

Then comes the packing which is done using the same program. This is pretty easy, just browsing to all 3 mas files. Setting the name of the mod which I called Hakosuka. Setting where I want the mod to go which is in the packages folder like any other mod. Then choosing what type of mod which this is a vehicle. Then pressing the package button and then install to install the mod. That green square will show if this is done without any errors. Here's a pic of what that whole process is like.

Then I tried launching the game with my mod but once I got to the loading screen for the race I got several errors...

I was confused by this for quite a while. That file was in my mas files I packaged but it didn't work. Finally I just merged the mas file I already had when I followed the tutorial with my own mas file (this was the hakosuka_common file). This got it working which is great. My file names and structure is not very good. But to change it now might break things which might take a while to fix so I'm just going to leave them for now. The only visible problem I have now is the rear wheels on the players car are invisible. But on the AI they are visible. This is quite puzzling but as the player wont be racing in 3rd person this is fine for now. Also the texture for my tachometer is the default one, not the one I made. Anyway here's what my car looks like in game on Croft circuit which is a local racetrack. I also applied a HDR preset which makes the visuals quite dramatic.





Monday 20 January 2014

Windows

For the windows firstly I had the model them as I hadn't done this already. This was the easy step, just extruding from the window frames with a quick unwrap. Now the hard part was setting up the material. I spent around 3 hours trying to get this to work in game. The windows would either be invisible or opaque. So I played around with pretty much every setting in the max material editor to get it to work. I also did some extensive searching on the forums and read all the posts about alpha channels. This is what my material setup looked like in max.


The one setting that finally got the material working was the material alpha value which was originally set at 255. It was just the normal setup in the code like all the other objects. I made the windows 2 sided originally but this made it quite distracting while driving with all the reflections. So I just have this for the outside view. Which may look strange but you don't even notice when driving about. So here is what that looks like in dev mode. Up next is compiling all this so I can play in the main single player with all the racetracks!