   Jim Adams RPG book first/second edition problem
  Ok so i bought (rather stupidly) both editions of the book thinking it was a different book, silly of me but even having both i cannot for love or money manage to get the nodetree/mappingICS source to compile (it gives errors on GenerateSkinnedMesh but this was fixed with a couple of null values being passed.Next issue was D3DXIntersect, this again i tried null values for the last two parameters, the project now compiles, yay!it compiles then before anything can be seen gives a bad memory reference error and asks to break or continue, continue just brings up the same message constantly and break breaks.i tried to visit jims site for the updated code etc but his site no longer exists!Ok the D3DXIntersect error is C2660 : 'D3DXIntersect ' : function does not take 8 parameters.The successfully compiled memory error message is:The instruction at "0x0044cbb3" referenced memory at "0x00000000". The memory could not be "written"DX9 version gives a list of ID3DXFont errors.so the question is, does anyone know how to fix the errors etc as when the debug gives me messages i can fix, bad memory references, im unsure how to sort or can anyone give me the updated code/fixes etc?Thanks in advance![Edited by - CapNick on November 18, 2010 1:32:04 PM]
  For my own purposes of clarification:Programming Role Playing Games, 2nd Ed. by Jim Adams is the name of the book, right?Okay, your error code there is telling me that whatever is trying to be pulled up is NULL at the time it is called.What's more, you're telling me that you have a function that is taking too few parameters when you get a code that says D3DXIntersect doesn't take 8 parameters.So, let's take a look.*opens book*It’s the D3DXIntersect function, which has the following prototype:HRESULT D3DXIntersect(LPD3DXBASEMESH pMesh, // Mesh to check intersectionCONST D3DXVECTOR3 *pRayPos, // Ray originCONST D3DXVECTOR3 *pRayDir, // Direction to cast rayBOOL *pHit, // Flag if intersection occursDWORD *pFaceIndex, // Which face ray intersectsFLOAT *pU,FLOAT *pV,FLOAT *pDist, // Distance to intersectionLPD3DXBUFFER *ppAllHits, // Set to NULLDWORD *pCountOfHits); // Set to NULLCan you show me the actual function call? You could have an improper function call order, so something's not initialized when this D3DXIntersect() is called.   ;  Thanks for the reply Mr_Windblade, The error is actually for the first edition version than the second edition, the second edition gives a completely different list of errors regarding ID3DFont.The name of the book im trying to fix the errors for isProgramming Role Playing Games, 1st Ed. by Jim Adams.Unfortunately i dont have the code with me at the moment but i know its a case of there being two missing parameters as shown below, the rest do all have values passed. I will update the post with the actual code when i get home later.HRESULT D3DXIntersect(LPD3DXBASEMESH pMesh, // Mesh to check intersectionCONST D3DXVECTOR3 *pRayPos, // Ray originCONST D3DXVECTOR3 *pRayDir, // Direction to cast rayBOOL *pHit, // Flag if intersection occursDWORD *pFaceIndex, // Which face ray intersectsFLOAT *pU,FLOAT *pV,FLOAT *pDist, // Distance to intersectionLPD3DXBUFFER *ppAllHits, // Set to NULL- Missing ParameterDWORD *pCountOfHits); // Set to NULL   - Missing Parameterok so i have found the code in question... it is:float cNodeTreeMesh::GetHeightBelow(float XPos, float YPos, float ZPos){  BOOL  Hit;  float u, v, Dist;  DWORD FaceIndex;  D3DXIntersect(m_Mesh->m_Mesh, &D3DXVECTOR3(XPos,YPos,ZPos), &D3DXVECTOR3(0.0f, -1.0f, 0.0f), &Hit, &FaceIndex, &u, &v, &Dist);  if(Hit == TRUE)    return YPos-Dist;  return YPos;}float cNodeTreeMesh::GetHeightAbove(float XPos, float YPos, float ZPos){   BOOL  Hit;  float u, v, Dist;  DWORD FaceIndex;  D3DXIntersect(m_Mesh->m_Mesh, &D3DXVECTOR3(XPos,YPos,ZPos), &D3DXVECTOR3(0.0f, 1.0f, 0.0f), &Hit, &FaceIndex, &u, &v, &Dist);  if(Hit == TRUE)    return YPos+Dist;  return YPos;}BOOL cNodeTreeMesh::CheckIntersect(float XStart, float YStart, float ZStart,float XEnd,   float YEnd,   float ZEnd,float *Length){  BOOL  Hit;  float u, v, Dist;  float XDiff, YDiff, ZDiff, Size;  DWORD FaceIndex;  D3DXVECTOR3 vecDir;  XDiff = XEnd - XStart;  YDiff = YEnd - YStart;  ZDiff = ZEnd - ZStart;  D3DXVec3Normalize(&vecDir, &D3DXVECTOR3(XDiff, YDiff, ZDiff));  D3DXIntersect(m_Mesh->m_Mesh, &D3DXVECTOR3(XStart,YStart,ZStart), &vecDir, &Hit, &FaceIndex, &u, &v, &Dist);  if(Hit == TRUE) {    Size = (float)sqrt(XDiff*XDiff+YDiff*YDiff+ZDiff*ZDiff);    if(Dist > Size) Hit = FALSE;    else { if(Length != NULL)   *Length = Dist;    }  }  return Hit;}[Edited by - CapNick on November 19, 2010 9:08:20 AM]