Topic: Mission scripting difference between EAW and OP problem  (Read 2262 times)

0 Members and 1 Guest are viewing this topic.

FPF_TraceyG

  • Guest
Mission scripting difference between EAW and OP problem
« on: August 09, 2003, 04:32:41 am »
Player ships are created within a mission script using the information passed to the script from the server. The info is stored in 'shipScriptDescription' and used by the mCreateShip function to reproduce the same ship a player has. Within shipScriptDescription is a parameter called shipScriptDescription.fClassType. In EAW, this parameter accurately reports the class type of the player, and makes it very easy then to use it, to create matching AI of a similar hull type, by storing it somewhere and using it later. I used it extensively in the EAW scripts I wrote.
I noticed, however, that when I ported the scripts over to OP, all the AI being generated were now Frigates, regardless of what ship I was flying. When I checked the shipScriptDescription.fClassType parameter, it was returning '-1'. Fortunately, I had included boundary checking on the hull type (even though up until now it had never been used) before creating ships, and so my code was generating Frigates instead.
Has anyone encountered this little problem before, or am I the only one to use that parameter? I had to go an rewrite all the CreateShip functions to find a work around for it. I'm having to use the ship->mGetHullType(), which of course can only be used once the ship is created and there is an initialised pointer to the ship. I'm finding that where ships are not created' in time', I have no way of accessing the desired hull type for my 'target ship' that I'm balancing AI for. The other alternative is to wait until after the mission starts and create all the AI then, but I'm reluctant to do that, since it would require extensive rewriting of all my scripts. Any suggestions?

FireSoul

  • Guest
Re: Mission scripting difference between EAW and OP problem
« Reply #1 on: August 09, 2003, 10:45:09 am »
Quote:

Player ships are created within a mission script using the information passed to the script from the server. The info is stored in 'shipScriptDescription' and used by the mCreateShip function to reproduce the same ship a player has. Within shipScriptDescription is a parameter called shipScriptDescription.fClassType. In EAW, this parameter accurately reports the class type of the player, and makes it very easy then to use it, to create matching AI of a similar hull type, by storing it somewhere and using it later. I used it extensively in the EAW scripts I wrote.
I noticed, however, that when I ported the scripts over to OP, all the AI being generated were now Frigates, regardless of what ship I was flying. When I checked the shipScriptDescription.fClassType parameter, it was returning '-1'. Fortunately, I had included boundary checking on the hull type (even though up until now it had never been used) before creating ships, and so my code was generating Frigates instead.
Has anyone encountered this little problem before, or am I the only one to use that parameter? I had to go an rewrite all the CreateShip functions to find a work around for it. I'm having to use the ship->mGetHullType(), which of course can only be used once the ship is created and there is an initialised pointer to the ship. I'm finding that where ships are not created' in time', I have no way of accessing the desired hull type for my 'target ship' that I'm balancing AI for. The other alternative is to wait until after the mission starts and create all the AI then, but I'm reluctant to do that, since it would require extensive rewriting of all my scripts. Any suggestions?  




I have never used that information. Sorry. I think you are indeed breaking new grounds.