Can't add hats as weapons, like devs did in PBs

Started by Sebastian, Oct 28, 2014, 05:48 PM

Previous topic - Next topic

Sebastian

I tried today to add a hat to my (ongoing) server, but I couldn't figure out how to make it work...
When I spawn the "weapon", I just get the camera without getting the hat with it's icon.

Can somebody give me an example of .xml to work as a hat ?
If no one knows, does anyone still have the "store" from Public Beta #2 / #3 ? If yes, please upload it to somewhere and give me a link. :)

Kratos_

#1
If the hat isn't appearing that means you haven't added the 3d model file [ .dff] and texture file [.txd]. Actually, Seby along with writing weapon id = 81, we need to give the .dff & .txd
files so that weapon could physically exist. Have you done those things?
Yeah, I'm quite sure that you have written the .XML document in the correct way. The weapon mod must be given plus a png image showing the hat icon as you said it's blank.
You just missed these things:-
1.A 3d model (.dff) file which represents a weapon's structure(shape) etc.
2.A Texture (.txd) file which wrap that dff model.
3.A png image showing the weapon icon.
Stormeus had described these things:-

weaponname_icon.png (optional)
The icon for the weapon that will be used in-game. If not specified, a blank icon is used.
weaponname.dff (optional)
The model for the weapon. If not given, the client will use the same model as the logical weapon ID, i.e. the baseball bat in this example.
weaponname.txd (optional)
The texture for the weapon. If not given, the client will use default textures for the logical weapon ID
Yeah, Stormeus called the txd as optional. But, you  should use new txd in case you use a new weapon like AK47 ( New weapon 3d model (.dff)) so that gun look like AK47.

Actually, you can create your  own hat (3d model + texture) using 3d studio max. Here's the link for the same:-
3D Studio Max Tutorial & Plugins
All types of mods( vehicles/weapons/buildings/Peds etc) can be created using this.
If you're having problem with XML variables ( about what variables actually mean), you can goto this link:-
Weapons Attributes
Actually, that is the documentation by which weapons are declared in Vice-City game. You can check out variables sense.
They're almost identical to 0.4 except their variables are declared in binary file (.DAT) and here we use XML.
Regards ^^Kratos^^.
In the middle of chaos , lies opportunity.

Sebastian

I think I'm smart enough to not miss such files, since I have made these video tutorials and tested the examples myself.
Anyway, the .xml file was the one wrong. I have found the SantaHat in the chinese server "store" folder and used it for "my" model.
It finally shown up, but it's not on the head as it should be, it's on the body... I moved the model (in a .dff editor) and added what was "missing" from santahat example, but it is still not moving. I have changed the Z coord in .xml too, but it is still not moving...
If anyone have any idea for moving it to the head, feel free to tell me.

Thijn


Sebastian

Hm, didn't see Thijn's reply.
Here is my reply: It also doesn't work.

I really believe it's model's fault. (there must be more settings I should take care, to place it on head)
A modeller would know the answer...

Thijn

Quote from: sseebbyy on Nov 18, 2014, 07:02 PMHm, didn't see Thijn's reply.
Here is my reply: It also doesn't work.

I really believe it's model's fault. (there must be more settings I should take care, to place it on head)
A modeller would know the answer...
The file I linked was the actual model of the PB server. So there's nothing wrong with that.

Care to take a screenshot of where the hat actually goes to?

Sebastian

Yes, I know. I recognized it.

Actually, I wanted to port it to 0.4 before Halloween...
So here it is:


There is nothing wrong with any file instead model.dff ... there is something to do about positions, or idk.

Stormeus

Try playing around with the offset option for the hat. There is also a rotation option, identical to offset (Vector), that rotates the hat as well, and a scale option (float) that resizes the hat.

Thijn

Why is it white? Looks like some texture files aren't being loaded properly.

MacTavish


Grand Hunting Project
Join #SLC, #KAKAN, #Doom, #GHP @LUnet

Retired VC:MP Player/Scripter :P

Sebastian

Quote from: stormeus on Nov 18, 2014, 09:14 PMTry playing around with the offset option for the hat. There is also a rotation option, identical to offset (Vector), that rotates the hat as well, and a scale option (float) that resizes the hat.

I will try, once I recover my motivation.

Quote from: Thijn on Nov 19, 2014, 08:59 PMWhy is it white? Looks like some texture files aren't being loaded properly.

I didn't add any texture on it, yet.

Quote from: RATHORE on Nov 20, 2014, 05:56 AMTry this working for me awesome Clicky

I already have the file, but thanks. ;)



Thanks all for the replies ! :)