Dynaverse.net
Taldrenites => Starfleet Command Mission Scripting => Topic started by: FPF-SCM_TraceyG_XC on December 21, 2004, 09:08:42 am
-
In the OP API, the class tShipInfo contains a method called mGetClassType(). It is supposed to return an enumerated value of eClassTypes.
eg. eClassTypes fHullClass = Ship->mGetClassType();
The returned value, however, is incorrect in the OP API (although I believe it works normally in EAW).
Fortunately there is a fix for it. I have used the following function to 'restores' the value returned from above to its correct value.
eClassTypes mDebugGetClassType(eClassTypes hullclass)
{
switch(hullclass)
{
case kClassShuttle :
return kClassShuttle;
break;
case kClassPseudoFighter :
return kClassPseudoFighter;
break;
case kClassFreighter :
return kClassFreighter;
break;
case kClassFrigate :
return kClassCarrier;
break;
case kClassDestroyer :
return kClassFrigate;
break;
case kClassWarDestroyer :
return kClassDestroyer;
break;
case kClassLightCruiser :
return kClassWarDestroyer;
break;
case kClassHeavyCruiser :
return kClassLightCruiser;
break;
case kClassNewHeavyCruiser :
return kClassNewHeavyCruiser;
break;
case kClassHeavyBattlecruiser :
return kClassHeavyCruiser;
break;
case kClassCarrier :
return kClassHeavyBattlecruiser;
break;
case kClassDreadnought :
return kClassDreadnought;
break;
case kClassBattleship :
return kClassBattleship;
break;
case kClassListeningPost :
return kClassListeningPost;
break;
case kClassBaseStation :
return kClassBaseStation;
break;
case kClassBattleStation :
return kClassBattleStation;
break;
case kClassStarBase :
return kClassStarBase;
break;
case kClassMonster :
return kClassMonster;
break;
case kClassPlanets :
return kClassPlanets;
break;
case kClassSpecial :
return kClassSpecial;
break;
default :
return kClassShuttle;
break;
}
}
I have declared this as a global function simply by placing it into my CommonDefs.cpp file (with appropriate prototype in Commondefs.h) but it can be placed anywhere.
In the above example, the code would now look like this:
eClassTypes fHullClass = Ship->mGetClassType();
fHullClass = mDebugGetClassType(fHullClass);
The above function must be called whenever mGetClassType() is used (until we can correct the source code).
Feel free to use the above code.
-
Hey TraceyG,
MagnumMan's ShipList library will save you from going through all this trouble.
Feel free to contact me if you intend to use it.
-
Thanks for that CV. Unfortunately Magnum Man's shiplist library was not designed for custom shiplists and will not work properly if the shiplist is heavily modded. For this reason I have avoided using it until we can rewrite it so it will work with any shiplist.
-
Unfortunately Magnum Man's shiplist library was not designed for custom shiplists and will not work properly if the shiplist is heavily modded. For this reason I have avoided using it until we can rewrite it so it will work with any shiplist.
I have used MagnumMan's library for heavily modded shiplist. FleetPick, for example, could have not been created w/o it. The only draw back is the load time but there are a few lines of code you can add to take care of that.[/b]
-
I heard that if you do not have the Federation listed first in the shiplist, then it doesn't work properly. Also, Firesoul is working on a new shiplist API that should remedy that (along with a few other additions). Magnum Man's shiplist scripting tool is certainly very useful though and opens up new possibilities. I also heard that the load time is increased for a mission, as you say. Coop ace also uses the it, (I think) and the mission runs fine on GSA, although Dave Wessels said he tried using it for D2 missions and it caused an increased incidence of player drops. I will certainly look you up if I have any questions :)