News:

One Minute Game Review by The Happy Friar: https://ugetube.com/@OneMinteGameReviews
Also on Rumble: https://rumble.com/c/c-1115371

idTech 4 (aka Doom 3 tech) Discord Server! https://discord.gg/9wtCGHa

Main Menu

How to bind weapon to player?

Started by bitterman, June 13, 2017, 11:47:00 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

bitterman

In .def file:

Quote"joint_attach"        "SOUL_ATTACHER"

or PISTOL_, SHOTGUN_ etc.

But "SOUL_ATTACHER" it's not bone's name or joint's name in .md5mesh.

In 'export fred' section of player.def I see:

Quotemesh...
options ... - Rhand SOUL_ATTACHER PISTOL_ATTACHER...

I really don't understand this thing. 'Rhand' is bone's name in player.md5mesh. I don't need to create .mb (maya) and then export it to md5mesh via .def (I already have exported md5mesh).

What is "..._ATTACHER" and how to create this thing when export md5mesh from .blend file or others?

Thanks.

The Happy Friar

Check the weapon's md5mesh.  That could be the one used in the weapon model, not the player.

bitterman

#2
No, it is in player.md5mesh. Sorry, my fault.

No need to deal with 'export' option.

bitterman

Sorry for that, but how to bind an entity to player in editor?

I have only empty room and info_player_start. And seems like k/v "bind" "player1" is not working for me.

The Happy Friar

I thought I did that once but can't find my old .map file.  What I have done in the last several maps I wanted something similar was have a map script that would take the player's coordinates and move a func_mover to those coordinates.  That worked surprisingly well.

I did a test once with a helmet that was either bound to the player or used a script.  It was iffy.  I think I bound it.  I want to say that for any md5mesh that is bound to needs you to specify the entity name AND the bone you bind to.  That would mean it wouldn't be "bind" "player1".  it would be "bind" "player1:head" (if there's a head bone).  Or similar.

bitterman

#5
In level script it can be done this way:

$entity.bind($player1);

But there is a problem - I need that binded entity to always stay in player's view but it's not happend.

When I looking around then entity losts from PVS.

Is it possible to bind entity to player's view (to moving with it)?
Perhaps some bones in player's head are tracking player's view?

Thanks.


The Happy Friar

Anything you can do in the editor you can do in script either directly (like you said in level script) or by setting up entity spawn parameters and spawning that entity with those parameters.

You can always copy the player's location & view angles & apply those to an entity via script.

bitterman

Yes, thanks. Scripts are fine too.

$entity.bintToJoint($player1_head, "Head", true);

Entity will always stay in player's view (depends on distance between player and entity).