News UnrealEd Files Mods FragBU Liandri Archives
BeyondUnreal Forums

Go Back   BeyondUnreal Forums > Unreal Development > Coding

Reply
 
Thread Tools Display Modes
Old 28th Mar 2005, 01:42 AM   #1
mouserpg
Registered User
 
Join Date: Mar. 28th, 2005
Posts: 8
GetBoneCords()

How do I get the bone coordinates of a certain bone? I need to get the coordinates from the player's feet. I know how to get this if I were using the player mesh, but not if I am using a model without a bone.

example:

Code:
var something lol;
local coords rofl;

rofl = GetBoneCoords('Bip01 L Foot');
lol = Spawn(class'classtospawn', self,, rofl.origin);
This should work for the players foot... if the mesh was being used by the file. Is there any way to call the player meshes so I can use the default bones? I need to bind something to the players feet, and this will be very helpful. Currently, if I use this code, the object will spawn over 500m away from me.

Am I going about this all wrong?
mouserpg is offline   Reply With Quote
Old 28th Mar 2005, 01:56 AM   #2
mouserpg
Registered User
 
Join Date: Mar. 28th, 2005
Posts: 8
Let me try to explain this a little better:

I'm trying to attach the surfboard to the player's feet, and the particle emitter at the very end of the surfboard. Currently, the particle emits slightly above the surfboard, and the surfboard doesn't bind to the players feet.



That's what it looks like when you get the right angle, but I want it to have the right angle 24/7.
mouserpg is offline   Reply With Quote
Old 28th Mar 2005, 01:23 PM   #3
meowcat
nothing new under the sun
 
meowcat's Avatar
 
Join Date: Jun. 7th, 2001
Posts: 750
quick question: where does the surfing/flying physics take place? in the surf board or in the player?

Most stuff that gets attached to anything else must have its collision variables modified. Take a look at the code in the pawn class (and inventory attachment class) for how third person weapon attachments are hooked up the player model. Also if there is no a bone to attach something to (as in the case of an actor that is rendered as a static mesh) you can use the 'setbase' function (http://udn.epicgames.com/Two/ActorFunctions#SetBase) after first placing the actor you want to attach in the correct position relative the actor it will be attached to.
__________________
"What do you mean it doesn't exist clientside?"
Meowcat's Mods for UT2K4:
Yet Another Real-life Mod: Class-based play, generic realistic weapons, unoriginal gameplay, w/ cheap COD4 knockoff, parkour player moves
TD Vehicles v125: HMMWV, MI4Hound, Black Hawk & AH-6 Helicopters, Motorcycle, IFAV Jeep, Abrams Tank
Jetpacks for UT2k4!
meowcat is offline   Reply With Quote
Old 28th Mar 2005, 02:57 PM   #4
mouserpg
Registered User
 
Join Date: Mar. 28th, 2005
Posts: 8
The surfing physics takes place in the surfboard classes. Thanks for the help, I'm gonna check it out. =)
mouserpg is offline   Reply With Quote
Old 28th Mar 2005, 03:19 PM   #5
meowcat
nothing new under the sun
 
meowcat's Avatar
 
Join Date: Jun. 7th, 2001
Posts: 750
So is the surfboard a subclass of vehicle? If so, you don't want to attach the surfboard to the player, you want to attach the player to the surfboard (there is a difference). There are several mods (Chaos Evolution and Colossians come to mind) that implement this type of vehicle. You may want to see how they went about doing it. But the basics will involve changing the KDriverEnter function to attach the player to the board (using setbase as opposed to attachtobone).
__________________
"What do you mean it doesn't exist clientside?"
Meowcat's Mods for UT2K4:
Yet Another Real-life Mod: Class-based play, generic realistic weapons, unoriginal gameplay, w/ cheap COD4 knockoff, parkour player moves
TD Vehicles v125: HMMWV, MI4Hound, Black Hawk & AH-6 Helicopters, Motorcycle, IFAV Jeep, Abrams Tank
Jetpacks for UT2k4!
meowcat is offline   Reply With Quote
Old 28th Mar 2005, 03:22 PM   #6
mouserpg
Registered User
 
Join Date: Mar. 28th, 2005
Posts: 8
It's not a vehicle, no.
mouserpg is offline   Reply With Quote
Old 28th Mar 2005, 03:28 PM   #7
mouserpg
Registered User
 
Join Date: Mar. 28th, 2005
Posts: 8
Hmm, I'm pretty much lost here. I still can't figure out how to attach it to the player's bone. Only a certain vect, which I'm currently using (it doesn't work right, btw).
mouserpg is offline   Reply With Quote
Old 28th Mar 2005, 05:33 PM   #8
meowcat
nothing new under the sun
 
meowcat's Avatar
 
Join Date: Jun. 7th, 2001
Posts: 750
I guess I should ask, since the board is not a vehicle, who actually does the movement and who follows. You said the physics takes place in the board, or is it that the board sets the controlling pawn's physics to something else, and the pawn does the actual movement(with the board following)? Also what class does the board derive from (this would be good to know to tell what its default properties might be)?

on another note, where exactly do you call attachtobone ?
If the board attaches itself to the player then you could simply place a line of code like:

Surferpawn.AttachToBone( self, 'The_FootBoneName_YouWant');

in the surfboard class. of course you need to set the rotation of the board as well (maybe by using SetRelativeRotation). As long as you know that a bone by that name exists in the player mesh skeleton, you should be OK.
__________________
"What do you mean it doesn't exist clientside?"
Meowcat's Mods for UT2K4:
Yet Another Real-life Mod: Class-based play, generic realistic weapons, unoriginal gameplay, w/ cheap COD4 knockoff, parkour player moves
TD Vehicles v125: HMMWV, MI4Hound, Black Hawk & AH-6 Helicopters, Motorcycle, IFAV Jeep, Abrams Tank
Jetpacks for UT2k4!
meowcat is offline   Reply With Quote
Old 28th Mar 2005, 06:21 PM   #9
mouserpg
Registered User
 
Join Date: Mar. 28th, 2005
Posts: 8
That still doesn't work. I still need to get the bone coordinates to update it.

EDIT: Here, this is what I'm currently using


rofl = Spawn(class'traileffect', self);
rofl.SetBase(self);

If I used getbonecoords, I could add var.origin to it, and it should snap. Otherwise, I'd have to add bones to my meshes, but I have no clue on how to do that.

Last edited by mouserpg; 28th Mar 2005 at 06:57 PM.
mouserpg is offline   Reply With Quote
Old 28th Mar 2005, 06:58 PM   #10
meowcat
nothing new under the sun
 
meowcat's Avatar
 
Join Date: Jun. 7th, 2001
Posts: 750
Quote:
Originally Posted by mouserpg
That still doesn't work. I still need to get the bone coordinates to update it.
hmm... so does it spawn in the right location but does not stay there, or does it just not spawn or attach at all? You might want to log the the location that the board is spawning at to see if it is even getting the coordinates of the bone
__________________
"What do you mean it doesn't exist clientside?"
Meowcat's Mods for UT2K4:
Yet Another Real-life Mod: Class-based play, generic realistic weapons, unoriginal gameplay, w/ cheap COD4 knockoff, parkour player moves
TD Vehicles v125: HMMWV, MI4Hound, Black Hawk & AH-6 Helicopters, Motorcycle, IFAV Jeep, Abrams Tank
Jetpacks for UT2k4!
meowcat is offline   Reply With Quote
Old 28th Mar 2005, 07:00 PM   #11
mouserpg
Registered User
 
Join Date: Mar. 28th, 2005
Posts: 8
I tried logging it, but it showed up as: 0.0,0.0,0.0 every time. So it's not getting the coordinates of it.

EDIT: It doesn't spawn in the right location. But it does stay there. Right now I'm not using GetBoneCoords();. The trail emitter is directly above the surfboard, and it stays there no matter what.

Last edited by mouserpg; 28th Mar 2005 at 07:02 PM.
mouserpg is offline   Reply With Quote
Old 28th Mar 2005, 07:29 PM   #12
meowcat
nothing new under the sun
 
meowcat's Avatar
 
Join Date: Jun. 7th, 2001
Posts: 750
Quote:
Originally Posted by mouserpg
I tried logging it, but it showed up as: 0.0,0.0,0.0 every time. So it's not getting the coordinates of it....
So where are you calling get GetBoneCoords? in the board or in the pawn? You probably already know this, but if you are calling it from the board you need to get a reference to the pawn (call it SurferPawn for instance), then have the line something like you had before:
Code:
local coords rofl;
rofl = Surferpawn.GetBoneCoords('Bip01 L Foot');

// or how about
rofl = Surferpawn.GetBoneCoords('lfoot');
If that is what you are already doing then you might have to check the spelling of the bone name. If that fails i don't know what else to suggest.

[EDIT] You know I seem to recall that the naming conventions with spaces were not always accepted by some of the functions. Just to try all possibillities, instead of 'Bip01 L Foot' try 'lfoot' instead. lfoot is one of the attach aliases for the base UT2Kx skeletons ).
__________________
"What do you mean it doesn't exist clientside?"
Meowcat's Mods for UT2K4:
Yet Another Real-life Mod: Class-based play, generic realistic weapons, unoriginal gameplay, w/ cheap COD4 knockoff, parkour player moves
TD Vehicles v125: HMMWV, MI4Hound, Black Hawk & AH-6 Helicopters, Motorcycle, IFAV Jeep, Abrams Tank
Jetpacks for UT2k4!

Last edited by meowcat; 28th Mar 2005 at 07:56 PM.
meowcat is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -5. The time now is 10:11 PM.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2014, vBulletin Solutions, Inc.

Copyright ©1998 - 2012, BeyondUnreal, Inc.
Privacy Policy | Terms of Use
Bandwidth provided by AtomicGamer