Jump to content
Sign in to follow this  
sausagekingofchicago

Retexturing models and testing them in game

Recommended Posts

This guide will get you through a simple retexturing of an item found in the dayz_communityassets.pbo. Once you're able to do this you'll be well on your way to adding your own items to the game. This guide will only get the items in game via the 3d editor but the pathing and practice is compatible with Elvaron's guide to setting up a test server.

Tools you'll need:

BITools (guide to install)

Notepad++

Eliteness and DePbo.dll (place DePbo.dll in whatever dir you unrar Eliteness in)

The DayZ build from Github (I recommend 1.7.6 since it's what I know works)

A tool to decompress .zipped files.

Your texture (check out Ingasmeeg's thread)

Assuming you installed the BITools correctly, you should have a P:\ drive. Go ahead and create a \z\addons directory on your p:\ drive. Unzip everything from the DayZ build's \SQF directory into your p:\z\addons directory.

6yjUaYF.jpg

Open your texture in Photoshop or your favorite image editing software and save it as .tga format to a folder of your choice. You can name it anything you like but I'm going to use soda_example_CO.tga in this guide. **Note the _CO part This is important.** Open soda_example_CO.tga in TexView2 (BITool) and save it as soda_example_CO.paa and place it in your P:\z\addons\DayZ_Communityassets\textures directory. (You may need to type in the full file name for it save properly)

Open the \z\addons\dayz_communityassets\models directory. Double click soda_clays_clean_full.p3d. It should open up in Oxygen2 (BITool). Go ahead and save this .p3d as soda_example_full.p3d in the \models folder.

With the model selected, press "E". The Face Properites menu should open up. On the bottom right you'll see a section for Textures & Materials. Click the folder for Texture and navigate to your texture in \z\addons\dayz_communityassets\textures. Click Apply, then click OK. Do not worry about the Material setting right now as we're going to use the .rvmat supplied and it should already be set.

766ItcE.jpg

Now do the same thing for the 1.000 and 2.000 LODs. (you'll need to double click to select them)

Click View > Viewers > Buldozer > Start/Reset to view your model in Buldozer.

i1lk0pz.jpg

The can is small so you'll need to zoom in on it. When you do you'll notice your texture is blurry. This is okay and will not effect how the model will look in game but you'll still want a small clear image of your item for the inventory screen. Close Buldozer and save your model again.

This post will guide you through how to rescale the model so the texture is clear:

http://dayzmod.com/f...80#entry1240850

I find it easiest to take a screenshot of the item while in Buldozer. Try finding an angle that makes sense and hit the print screen key. Open photoshop and create a new image with the dimensions of 256x256. Paste in your image, resize it, and delete the background color. Save this image as soda_example_CA.png so the transparent background is preserved. Open it in TexView2 and save it as soda_example_CA.paa and place it in your \z\addons\dayz_communityassets\pictures directory.

Editing the Code

Navigate to \z\addons\dayz_code. Open the cfg_magazines.hpp in Notepad++. Scroll down to the ItemSodaMtngreen class. Highlight and copy both the full and empty entries. Paste this right below. The first thing you want to do is change the class name to ItemExampleSoda.

Go ahead and change the display name to "$STR_ITEMSODA_FULL_CLEAN_CODE_NAME_13".

Change the descriptionShort to "$STR_ITEMSODA_FULL_CLEAN_CODE_DESC_13".

Now you need to tell the game where to find your model. Change "soda_mtngreen_clean_full.p3d" to "soda_example_full.p3d". Change "equip_soda_mtngreen_clean_full_ca.paa" to "soda_example_ca.paa".

If you also created an empty model texture, repeat the processing steps above and point the next entry to your empty can model and picture.

fbR8Z5t.jpg

Save the CfgMagazines.hpp file. Now open the stringtable.xml file in Notepad++.

Find the ST_ITEM_SODA_FULL_CLEAN_CODE_12 entry.

Copy and paste it below and change the Name and Description to reflect your items. If you're awesome, translate everything. Make sure you change the ID numbers from 12 to 13. Save this file now.

7KElgVs.jpg

You're ready to pack your .pbos files.

Open up Eliteness. Go to the Options and check "Allow unbinarised p3ds". You may also want to check and change the output folder to any temp or working folder you use.

Bs29Zxw.jpg

Hit Ok and navigate to your p:\z\addons directory.

bKk9Pqo.jpg

Right click on the dayz_code folder and select "CreatePbo". Click OK. You should get a "no errors were found" message. Right click on the dayz_communityassets folder and select "CreatePbo". You should now have a dayz_code.pbo and dayz_communityassets.pbo in whatever output folder you told EliteNess to use. Locate your @dayz folder and make a copy. Rename the copy @dayzmodding or whatever floats your boat. Navigate to your newly created .pbos and copy them into your @dayZmodding\addons\ folder. Go ahead and overwrite the files.

Trying out your item in game

You may want to launch DayZ without having to mess with Steam. If you haven't already, open your Programfiles\Steam\SteamApps\Common\Arma 2 Operation Arrowhead\ directory, find the _runA2CO_beta file, and create a shortcut to it. Place the shortcut on your desktop.

Right click on the shortcut, select edit, and find the

"%_ARMA2OAPATH%\Expansion\beta\ARMA2OA.exe" "-mod=%_ARMA2PATH%;EXPANSION;ca;

line.

Add @dayzmodding at the end.

"%_ARMA2OAPATH%\Expansion\beta\ARMA2OA.exe" "-mod=%_ARMA2PATH%;EXPANSION;ca;@dayzmodding"

Save the file and launch DayZ by double clicking your _runA2CO shortcut you placed on your desktop. When you see the main menu, press Ctrl-E. A new window will pop up asking you to pick a map. I pick Utes because it seems to load a little faster but any map will do.

[NOTE: Make sure you launch dayz your normal way or make sure you edit the _runA2CO_beta file to point to the PROPER @DayZ folder if you want to play online. DO NOT connect with modified files!!!!!]

When it's done loading you see a series of options in the upper right corner:

ezSWavL.jpg

Select "Center" and doubleclick on the map. Click OK. Select "Group" and doubleclick. Click OK. Now select "Unit" and double click. Select "bandit" from the 'Type' drop down and click OK. Click preview and you'll be able to run around on the map. When you're done messing about, hit escape and then 'edit in 2d map'.

Right click on the green icon respresenting your character. Select "edit object".

8EIBjwZ.jpg

In the Init Expression text box, add:


removeAllWeapons this; this addMagazine "ItemExampleSoda"; this addMagazine "ItemExampleSoda"; this addMagazine "ItemExampleSoda"; this addMagazine "ItemExampleSoda"; this addMagazine "ItemExampleSoda";

This will add five Example Sodas to your inventory. You can add more if you like but you only have so much inventory space.

JMkQLph.jpg

Click OK, click Restart, and then go ahead and save the mission file so you won't need to recreate it each time you want to test. Now click "Preview". Press 'G' and you should see your item icon, description, and title.

y176ZqN.jpg

Drop your items to view them in the world.

r8Ztrzm.jpg

So there you go. You can now re-texture just about anything you can get your hands on. A lot of the steps here can be used to add completely new items to the world. Follow the steps carefully and you shouldn't run into any major problems.

Edited by SausageKingofChicago
  • Like 19

Share this post


Link to post
Share on other sites

STICKY!!!!

  • Like 1

Share this post


Link to post
Share on other sites

Hello there

I don't think I'm allowed to touch sticky buttons. but as we are having clear guides now, it might be time for some rearrangement. we'll have to wait for Griff to get back perhaps.

L

  • Like 1

Share this post


Link to post
Share on other sites

Could i please have a can of Steak and Potatoes ?

  • Like 4

Share this post


Link to post
Share on other sites

If you're editing a preexisting model you only need to open the appropriate .rvmat file. Double clicking on it will open the Material Editor. Then just scroll down until you see the _smdi already applied and change it to yours. You can also open the .rvmat in notepad++ and edit the text. Both ways will work but you should save the _smdi with a new file name so you don't accidentally mess up something else. This means you have to open the model, press E when the mesh is highlighted, and edit the Material setting in the Face Properties menu. If you don't already know what the models .rvmat is called you can find the name here too. Just make sure you save your model with a new name too. :D

_smdi files and .rvmats should be saved in your \z\addons\dayz_communityassets\textures directory.

gMECExB.jpg

http://i.imgur.com/1NPqcPl.jpg

http://i.imgur.com/GwZ9uhO.jpg

Edited by SausageKingofChicago
  • Like 1

Share this post


Link to post
Share on other sites

OK, cheers! I'm just trying to get some decent pics in Buldozer and it's looking weird because it has no material. I'll do a quick edit of the .rvmat and make sure it's all correct, take the shot and put it back.

It worked! Thanks.

  • Like 1

Share this post


Link to post
Share on other sites

@ SausageKingofChicago & Ingasmeeg

Listen you two, do you want to combine your threads or something ?

They/it could go in the Tech/Programing Forum.

As it/they are split between this and the Gallery, seems just a bit messy and inefficient to me !

I'll get smasht to do something, he's good at that sort of stuff, or just send him a PM yourselfs.

If you want, that is.

  • Like 1

Share this post


Link to post
Share on other sites

@ SausageKingofChicago & Ingasmeeg

Listen you two, do you want to combine your threads or something ?

They/it could go in the Tech/Programing Forum.

As it/they are split between this and the Gallery, seems just a bit messy and inefficient to me !

I'll get smasht to do something, he's good at that sort of stuff, or just send him a PM yourselfs.

If you want, that is.

Well it might be an idea, but then no-one would see it over there. :(

I wouldn't mind having a larger community assets thread with tutorials, blank and example textures, etc, although if our threads were combined now it would just leave a mess.

Share this post


Link to post
Share on other sites

Well it might be an idea, but then no-one would see it over there. :(

I wouldn't mind having a larger community assets thread with tutorials, blank and example textures, etc, although if our threads were combined now it would just leave a mess.

The Topics could be cleaned leaving only the essential !

Have a word with Sausage and see if it would be worth it. Just seems a shame, I mean you are both in and out of each others Threads like a pair of lusty lovers !

If not, carry on, this is the wild west after all !

Share this post


Link to post
Share on other sites

Na, i really don't mind at all, just nice to see something constuctive happening.

Have some :beans: :thumbsup: ,,, the pair of you.

Share this post


Link to post
Share on other sites

Well, the guide wasn't meant purely for retexturing cans but.. that is pretty much what it guides a person through. I used the same process to retexture character models and other nonsense but a lot of people asked about the cans so that's where I went with it. You're right, there's only a handful of us actively discussing and working on this, on these forums at least. Your call on the merge. I don't mind either way if it helps someone out.

  • Like 2

Share this post


Link to post
Share on other sites

It would be nice to have a place for these. Push 'em right up, I say.

  • Like 1

Share this post


Link to post
Share on other sites

When I try starting the buldozer viewer (viewers > buldozer > start/restart) to look at my "can" I get??:

buldozererror.png

  • Like 1

Share this post


Link to post
Share on other sites

Did you follow the BItools guide completely? It looks like Buldozer is looking for the \ca directory on your p:\ drive. I just tested this by renaming my \ca folder and that is the error I get when loading the example can up. If you followed the steps already we can troubleshoot it further.

http://community.bistudio.com/wiki/ArmA_2_Terrain_Tutorial#Extract_BI_addons_to_P:

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
Sign in to follow this  

×