lfnetwork.com mark read register faq members calendar

Thread: Why can't bone angles be adjusted by value of variables??
Thread Tools Display Modes
Post a new thread. Add a reply to this thread. Indicate all threads in this forum as read. Subscribe to this forum. RSS feed: this forum RSS feed: all forums
Old 07-20-2006, 03:32 PM   #1
Vruki Salet
Junior Member
 
Vruki Salet's Avatar
 
Join Date: Aug 2005
Location: Somewhere else entirely
Posts: 443
Why can't bone angles be adjusted by value of variables??

I'm messing with setting bone angles in BG_G2PlayerAngles and a weird thing happens.

This doesn't work:

Code:
static vec3_t rhangAngle;
float p = 20.0f;

VectorCopy(vec3_origin, rhangAngle);
rhangAngle[PITCH] +=  p;

--snip irrelevant if(){} for being in a vehicle--

strap_G2API_SetBoneAngles(ghoul2, 0, "rhang_tag_bone", rhangAngle, BONE_ANGLES_POSTMULT, POSITIVE_X, NEGATIVE_Y, NEGATIVE_Z, 0, 0, time);
This does:

Code:
static vec3_t rhangAngle;
float p = 20.0f;

VectorCopy(vec3_origin, rhangAngle);
rhangAngle[PITCH] +=  20.0f;

--snip irrelevant if(){} for being in a vehicle--

strap_G2API_SetBoneAngles(ghoul2, 0, "rhang_tag_bone", rhangAngle, BONE_ANGLES_POSTMULT, POSITIVE_X, NEGATIVE_Y, NEGATIVE_Z, 0, 0, time);
See the only difference is in the first I added "p" (float value of 20.0) to rhangAngle[PITCH] and in the second I just added a float of 20.0 directly.

What gives?
Vruki Salet is offline   you may: quote & reply,
Old 07-20-2006, 11:42 PM   #2
Vruki Salet
Junior Member
 
Vruki Salet's Avatar
 
Join Date: Aug 2005
Location: Somewhere else entirely
Posts: 443
It turns out it was a problem involving the split between game and cgame and a failure of communication between them leading to my seeing something onscreen other that what the game was actually doing.

Anyone trying to deal with similar stuff is welcome to get in touch with me.
Vruki Salet is offline   you may: quote & reply,
Old 07-21-2006, 02:13 PM   #3
razorace
Impressive, Terran!
 
razorace's Avatar
 
Join Date: May 2002
Posts: 9,176
Yeah, getting both the cgame and game to work together is tricky for some of this stuff Good luck!


---Jedi Guardian of the Newbie Questions
---Masters of the Force Team Leader / Creator
---Open Jedi Project Lead Moderator / Co-Founder
razorace is offline   you may: quote & reply,
Old 07-21-2006, 04:28 PM   #4
Vruki Salet
Junior Member
 
Vruki Salet's Avatar
 
Join Date: Aug 2005
Location: Somewhere else entirely
Posts: 443
Thanks I got it. I was sending the playerstate data to s in the wrong place or wrong way but it works now. It sure is tricky because it's hard to know if what you do doesn't work at all or if it works on the server but doesn't show on the client.
Vruki Salet is offline   you may: quote & reply,
Old 07-26-2006, 02:34 PM   #5
ensiform
The Stig
 
ensiform's Avatar
 
Join Date: Nov 2004
Location: Sawtooth Cauldron
Posts: 1,241
Current Game: Borderlands 2
whats the difference between strap_G2API_SetBoneAngles and trap_G2API_SetBoneAngles ?


iojamp project lead / coder
ensiform is offline   you may: quote & reply,
Old 07-26-2006, 04:01 PM   #6
Vruki Salet
Junior Member
 
Vruki Salet's Avatar
 
Join Date: Aug 2005
Location: Somewhere else entirely
Posts: 443
You tell me, heh. It looks like all those strap_ commands just return equivalent trap_'s. It says they're "shared" but i see that the plain trap_'s are used in cgame and game so...? The reason client wasn't showing my changes was because the variable p was set just to 20.0f in game so cgame thought it was 0, while of course an actual number had its own real value whereever it was.

I was just setting angles directly in BG_G2PlayerAngles, not with traps. (No it wasn't obvious at first, i'm still taking baby steps here.) If you like to try wacky stuff with bone angles, check out the IK stuff in the game. You can sort of retroactively set bone angles to make a particular point on the body try to reach a given point in the game world. Restraining the joints to natural looking positions is hard though.
Vruki Salet is offline   you may: quote & reply,
Old 07-26-2006, 10:12 PM   #7
razorace
Impressive, Terran!
 
razorace's Avatar
 
Join Date: May 2002
Posts: 9,176
Yep, that's the key reason why realistic IK is so difficult to pull off.


---Jedi Guardian of the Newbie Questions
---Masters of the Force Team Leader / Creator
---Open Jedi Project Lead Moderator / Co-Founder
razorace is offline   you may: quote & reply,
Post a new thread. Add a reply to this thread. Indicate all threads in this forum as read. Subscribe to this forum. RSS feed: this forum RSS feed: all forums
Go Back   LucasForums > Network > JediKnight Series > Editing Central > JA Coding > Why can't bone angles be adjusted by value of variables??

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 Off
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 03:23 AM.

LFNetwork, LLC ©2002-2011 - All rights reserved.
Powered by vBulletin®
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.