From: Keith F. <ven...@us...> - 2006-03-22 06:12:10
|
Update of /cvsroot/planeshift/planeshift/src/npcclient In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv26140/src/npcclient Modified Files: npcclient.cpp pathmanager.cpp Log Message: New tutorial system implementation, wherein events on the server are intercepted by the TutorialManager and judged on a character by character (player character) basis to see if the character needs an explanation of that event. If so, a message with that explanation is sent to the client and the player has the opportunity to popup that explanation. Index: npcclient.cpp =================================================================== RCS file: /cvsroot/planeshift/planeshift/src/npcclient/npcclient.cpp,v retrieving revision 1.89 retrieving revision 1.90 diff -C2 -d -r1.89 -r1.90 *** npcclient.cpp 27 Feb 2006 22:03:34 -0000 1.89 --- npcclient.cpp 22 Mar 2006 06:12:04 -0000 1.90 *************** *** 468,472 **** continue; - // This is a widget so read it's factory to create it. if ( strcmp( node->GetValue(), "loctype" ) == 0 || strcmp( node->GetValue(), "region" ) == 0) --- 468,471 ---- *************** *** 502,506 **** continue; - // This is a widget so read it's factory to create it. if (!strcmp( node->GetValue(), "waypointlist" )) { --- 501,504 ---- Index: pathmanager.cpp =================================================================== RCS file: /cvsroot/planeshift/planeshift/src/npcclient/pathmanager.cpp,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** pathmanager.cpp 28 Dec 2005 16:28:19 -0000 1.7 --- pathmanager.cpp 22 Mar 2006 06:12:04 -0000 1.8 *************** *** 1,20 **** /* ! * pathmanager.cpp - author: Keith Fulton <ke...@pa...> ! * ! * Copyright (C) 2003 Atomic Blue (in...@pl..., http://www.atomicblue.org) ! * ! * ! * This program is free software; you can redistribute it and/or ! * modify it under the terms of the GNU General Public License ! * as published by the Free Software Foundation (version 2 of the License) ! * This program is distributed in the hope that it will be useful, ! * but WITHOUT ANY WARRANTY; without even the implied warranty of ! * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ! * GNU General Public License for more details. ! * You should have received a copy of the GNU General Public License ! * along with this program; if not, write to the Free Software ! * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. ! * ! */ #include <psconfig.h> --- 1,20 ---- /* ! * pathmanager.cpp - author: Keith Fulton <ke...@pa...> ! * ! * Copyright (C) 2003 Atomic Blue (in...@pl..., http://www.atomicblue.org) ! * ! * ! * This program is free software; you can redistribute it and/or ! * modify it under the terms of the GNU General Public License ! * as published by the Free Software Foundation (version 2 of the License) ! * This program is distributed in the hope that it will be useful, ! * but WITHOUT ANY WARRANTY; without even the implied warranty of ! * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ! * GNU General Public License for more details. ! * You should have received a copy of the GNU General Public License ! * along with this program; if not, write to the Free Software ! * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. ! * ! */ #include <psconfig.h> *************** *** 40,58 **** continue; ! // This is a widget so read it's factory to create it. ! if ( strcmp( node->GetValue(), "path" ) == 0) ! { ! Spline *spline = new Spline; ! if (spline->Load(node)) ! { ! paths.Insert(spline); ! } ! else { ! delete spline; ! return false; } } - } return true; } --- 40,58 ---- continue; ! // This is a widget so read it's factory to create it. ! if ( strcmp( node->GetValue(), "path" ) == 0) { ! Spline *spline = new Spline; ! if (spline->Load(node)) ! { ! paths.Insert(spline); ! } ! else ! { ! delete spline; ! return false; ! } } } return true; } *************** *** 73,99 **** if (found) { ! csPath *path = new csPath( found->points.Length() ); ! csVector3 *v = new csVector3[found->points.Length()]; ! int i; ! for (i=0; i<found->points.Length(); i++) ! v[i] = found->points[i]->pos; ! path->SetPositionVectors(v); ! for (i=0; i<found->points.Length(); i++) ! v[i] = found->points[i]->pos - found->points[(i+1)%found->points.Length()]->pos; ! path->SetForwardVectors(v); ! for (i=0; i<found->points.Length(); i++) ! v[i] = found->points[i]->up; ! path->SetUpVectors(v); ! delete [] v; ! float *f = new float[ found->points.Length() ]; ! for (i=0; i<found->points.Length(); i++) ! f[i] = found->points[i]->time_value; ! path->SetTimeValues(f); ! delete [] f; ! return path; } return NULL; --- 73,99 ---- if (found) { ! csPath *path = new csPath( found->points.Length() ); ! csVector3 *v = new csVector3[found->points.Length()]; ! int i; ! for (i=0; i<found->points.Length(); i++) ! v[i] = found->points[i]->pos; ! path->SetPositionVectors(v); ! for (i=0; i<found->points.Length(); i++) ! v[i] = found->points[i]->pos - found->points[(i+1)%found->points.Length()]->pos; ! path->SetForwardVectors(v); ! for (i=0; i<found->points.Length(); i++) ! v[i] = found->points[i]->up; ! path->SetUpVectors(v); ! delete [] v; ! float *f = new float[ found->points.Length() ]; ! for (i=0; i<found->points.Length(); i++) ! f[i] = found->points[i]->time_value; ! path->SetTimeValues(f); ! delete [] f; ! return path; } return NULL; *************** *** 105,110 **** if (name.Length() == 0) { ! Error1("Path does not have a name attribute specified.\n"); ! return false; } --- 105,110 ---- if (name.Length() == 0) { ! Error1("Path does not have a name attribute specified.\n"); ! return false; } *************** *** 112,117 **** if (name.Length() == 0) { ! Error1("Path does not have a sector attribute specified.\n"); ! return false; } --- 112,117 ---- if (name.Length() == 0) { ! Error1("Path does not have a sector attribute specified.\n"); ! return false; } *************** *** 130,170 **** continue; ! // This is a widget so read it's factory to create it. ! if ( strcmp( node->GetValue(), "spline_pt" ) == 0) ! { ! SplinePoint *pt = new SplinePoint; ! pt->pos.x = node->GetAttributeValueAsFloat("x"); ! pt->pos.y = node->GetAttributeValueAsFloat("y"); ! pt->pos.z = node->GetAttributeValueAsFloat("z"); ! pt->up.x = node->GetAttributeValueAsFloat("up_x"); ! pt->up.y = node->GetAttributeValueAsFloat("up_y"); ! pt->up.z = node->GetAttributeValueAsFloat("up_z"); ! if (node->GetAttributeValue("anim")) ! pt->action = node->GetAttributeValue("anim"); ! else ! pt->action = "default"; ! if (constant_vel) ! { ! if (last) ! { ! float dist = (last->pos-pt->pos).Norm(); ! time_so_far += (dist/constant_vel); ! pt->time_value = time_so_far; ! } ! else ! { ! pt->time_value = 0; ! } ! last = pt; ! } ! else ! { ! pt->time_value = node->GetAttributeValueAsFloat("time"); } - points.Push(pt); - } } return true; --- 130,170 ---- continue; ! // This is a widget so read it's factory to create it. ! if ( strcmp( node->GetValue(), "spline_pt" ) == 0) ! { ! SplinePoint *pt = new SplinePoint; ! pt->pos.x = node->GetAttributeValueAsFloat("x"); ! pt->pos.y = node->GetAttributeValueAsFloat("y"); ! pt->pos.z = node->GetAttributeValueAsFloat("z"); ! pt->up.x = node->GetAttributeValueAsFloat("up_x"); ! pt->up.y = node->GetAttributeValueAsFloat("up_y"); ! pt->up.z = node->GetAttributeValueAsFloat("up_z"); ! if (node->GetAttributeValue("anim")) ! pt->action = node->GetAttributeValue("anim"); ! else ! pt->action = "default"; ! if (constant_vel) ! { ! if (last) ! { ! float dist = (last->pos-pt->pos).Norm(); ! time_so_far += (dist/constant_vel); ! pt->time_value = time_so_far; ! } ! else ! { ! pt->time_value = 0; ! } ! last = pt; ! } ! else ! { ! pt->time_value = node->GetAttributeValueAsFloat("time"); ! } ! points.Push(pt); } } return true; |