Topic: Question to Dave (Nuclear) Wessels  (Read 3268 times)

0 Members and 1 Guest are viewing this topic.

Pi-R

  • Guest
Question to Dave (Nuclear) Wessels
« on: January 24, 2003, 03:49:27 pm »
Hi Dave,

I´m trying to learn to use Visual C++ and the SFC2EAW API (v1.3). I´m using your Mission Scripting Information document for this.

I´m trying to re-create your example 1. Everything went well up tol step 12.1.1: the script was build without errrors and warnings and it played well in the game. In the next step 12.1.2 you are adding a mission timer and in-game messages. I followed your instructies, for as far as I can tell, but when I try to build at the end of this step I get an error. It appears when PlayerShipBaseState.cpp is being build and states kPlayerTeam is an undeclared identifier. How can this be? kPlayerTeam was declared in Commondefs.cpp and was used several times before PlayerShipState.cpp was build. So it seems like it suddenly disappears.

By the way the code the error refers to is:
void tPlayerShipBaseState::mOnDisengaged( tShipInfo* ship )
{
   // display a taunt if the player disengages
   fMissionInfo->mDisplayMessage(static_cast<eTeamID>( kPlayerTeam ), kRunaway_msg);
}


The other strange thing about this, according to me, is that kPlayerTeam is used two times further on in this same file and there no errors appear.

Could you please explain this?

NuclearWessels

  • Guest
Re: Question to Dave (Nuclear) Wessels
« Reply #1 on: January 24, 2003, 04:04:16 pm »
It's probably just be a missing include file at the top of PlayerShipBaseState.cpp.

I can't remember which one off the top of my head, but if you right-click on
the identifier it's complaining about then you can choose to see which file
it's defined in, then just #include that file.

(BTW, you'll only get the "has not been declared" error message for
the first instance of the identifier - it's not any happier about
the later uses of it, just doesn't repeat the complaint.)

dave
 

FPF_TraceyG

  • Guest
Re: Question to Dave (Nuclear) Wessels
« Reply #2 on: January 24, 2003, 08:54:08 pm »
The missing include you need is:

#include "CommonDefs.h"

assuming this is where you declared your eTeamTypes. My CommonDefs.h contains the following:

enum eTeamTypes
{
   kPlayerTeam = kTeam1,       // Primary (drafting) player
    kPlayerAlly1Team = kTeam2,  // Drafted or AI ally team1
   kPlayerAlly2Team = kTeam3,  // Drafted or AI ally team2
   kEnemyTeam = kTeam4,        // Primary Opponent (drafted) player
   kEnemyAlly1Team = kTeam5,   // Drafted or AI enemy ally team1
    kEnemyAlly2Team = kTeam6,   // Drafted or AI enemy ally team2
   kTotalTeams,
};

Yours won't look exactly like this because I've changed the identifiers for each of my teams as opposed to those used by the script wizard, but this is the deceleration your error message is looking for.
« Last Edit: December 31, 1969, 06:00:00 pm by Tracey Greenough »

Pi-R

  • Guest
Thanks Dave and Tracey for the help
« Reply #3 on: February 20, 2003, 01:49:25 am »
Sorry, a little late (almost a month), but I had some problems with my computer and little time to solve it.

But now I finally have and due to the help of you, I completed the example from Dave's fine document with success. No errors and it works fine.

So now I can start the real work: develop something myself. Too bad I don't have a lot of time for this.

Thanks for your help