Welcome, Guest. Please login or register.
Did you miss your activation email?
September 20, 2024, 03:49:17 AM
Home Help Login Register
News: Trouble in Terrorist Town? Site here, forum here.

Zombie Master  |  Other  |  Trouble in Terrorist Town  |  Topic: Custom hats in TTT? Like a santa hat.
Pages: [1]
Author Topic: Custom hats in TTT? Like a santa hat.  (Read 5187 times)
Redcow
Poster

Posts: 87


« on: December 23, 2010, 03:34:08 AM »

How would you do it?

We wanted santa hats for the server but it wasn't working.

What I tried to do was copy the detective entity (ttt_hat_deerstalker), and rename it to ttt_santa.

I copied the function in weaponry, and made a seperate convar to enable ttt_santa.

Next, I set the model in ttt_santa so it was the correct model.

What happened was that it kept spawning inside of the characters stomach.  I tried changing the offset so it would spawn on the head but it didn't move the hat at all... any idea?
Manmax75
Poster

Posts: 254


Programming Guy


« Reply #1 on: December 23, 2010, 10:29:40 AM »

Its because the model you are using dosen't have a "bone" theres a function in there called that merges the hatbone with the bone of your player's head. But since your model dosen't have a bone, it snaps to the stomach.

Ride Forward and Thrust Your Pelvis In The Dark Void. The One Induced By Pleasure Yet Cast By The Bigger Picture.
Redcow
Poster

Posts: 87


« Reply #2 on: December 28, 2010, 02:50:36 AM »

So if I get the bone name from the hat model and replace it with the santahat model's bone, it will work?

I only see it mentioning ("ValveBiped.Bip01_Head1"), which I presume is the head of the player.

I can't find the bone for the model it'sself.
« Last Edit: December 28, 2010, 02:53:12 AM by Redcow »
Manmax75
Poster

Posts: 254


Programming Guy


« Reply #3 on: December 28, 2010, 03:01:13 AM »

You can see if the model has a bone by looking at it through "Model Viewer" (i think its called that) in the Source SDK, if the hat dosen't have a bone... well you can't use it then.

Ride Forward and Thrust Your Pelvis In The Dark Void. The One Induced By Pleasure Yet Cast By The Bigger Picture.
Redcow
Poster

Posts: 87


« Reply #4 on: December 28, 2010, 03:21:17 AM »

Yeah but in the lua file for the original hat shared.lua.

I don't know where I would replace the bone name because I don't see anything mentioning the bone that isn't the player's head.

Here's the pastebin of the original hat incase you don't feel like finding the file.

http://pastebin.com/85jFWxjf

Also, the model I'm trying to use has the bone "bip_head"
« Last Edit: December 28, 2010, 03:25:37 AM by Redcow »
Bad King Urgrain
Administrator
*****
Posts: 12276



« Reply #5 on: December 28, 2010, 10:08:20 AM »

The bones need to be the same name. The player model has that Head01 bone, and the hat model needs to have that too. Then the engine bonemerges them to position the hat.

You may be better off looking at other hat systems people have made. The current detective hat code is not the way it is because it works well, but because it happened to be the latest thing I had tried before I decided hats are more trouble than they are worth. So not necessarily a good example to learn from or copy.
Raneman
Poster

Posts: 219

Shitposter


« Reply #6 on: December 28, 2010, 05:40:38 PM »

BKU, if you release the hat code you use, I could compare it with some other hat systems in gmod and see how I can improve it.
Bad King Urgrain
Administrator
*****
Posts: 12276



« Reply #7 on: December 28, 2010, 06:06:43 PM »

Release? It's right there, in TTT.
Manmax75
Poster

Posts: 254


Programming Guy


« Reply #8 on: December 28, 2010, 11:59:53 PM »

Alot of other hat systems seem to produce unwanted results upon lag, source engine or garrysmod need a sorta of hat attaching function....

Ride Forward and Thrust Your Pelvis In The Dark Void. The One Induced By Pleasure Yet Cast By The Bigger Picture.
Kazaki
Poster

Posts: 25



« Reply #9 on: February 01, 2011, 01:39:55 PM »

Anyone know any effecient Hat system? would rly like to know.

http://ldt-clan.com/forum/forum.php
Liru
Poster

Posts: 36



« Reply #10 on: February 01, 2011, 04:04:20 PM »

Out of curiousity, how does TF2's hat system work compared to the TTT one?

Redditor? Join the TTT reddit:
http://ttt.reddit.com
Manmax75
Poster

Posts: 254


Programming Guy


« Reply #11 on: February 01, 2011, 08:56:34 PM »

The most best way is to position the hat perfectly, but with multiple hats... this gets annoying.

Ride Forward and Thrust Your Pelvis In The Dark Void. The One Induced By Pleasure Yet Cast By The Bigger Picture.
Pages: [1]
Zombie Master  |  Other  |  Trouble in Terrorist Town  |  Topic: Custom hats in TTT? Like a santa hat. « previous next »
Jump to:  


Login with username, password and session length

Powered by SMF 1.1.21 | SMF © 2015, Simple Machines
Page created in 0.009 seconds with 18 queries.