Topic: Scripting Question: OP  (Read 3554 times)

0 Members and 1 Guest are viewing this topic.

Offline Lieutenant_Q

  • Lt. Commander
  • *
  • Posts: 1669
  • Gender: Male
Scripting Question: OP
« on: December 21, 2005, 10:03:46 pm »
Is it possible for a Mission Script to change the status of your ship in the dynaverse?  When a ship comes out of a script damaged, it retains the same amount of damage that it had sustained in the previous mission, going into the next mission.

My questions are, is it possible for a script to be written that could repair a starship?  Like a mission where you flew into your own drydock, lowered your shields.  The Dry Dock Tractors you to hold you in place and begins to repair you.  While you are being repaired, its possible for an enemy attack force to attack the drydock.  You can't do anything but watch...and hope that the repairs are done in time, while your team mates are desperately trying to buy you enough time to get repairs completed.

Now the bigger question, is it possible for the Mission scripts to CHANGE the ship you are flying?  For example, you're flying a D7C, and the K- refit becomes available.  Rather than purchase a new D7L and then selling your D7C, could a script be written that would allow you to fly into a drydock press the "refit" button on the communications panel and after the mission is over you have a D7L instead of the D7C?
"Your mighty GDI forces have been emasculated, and you yourself are a killer of children.  Now of course it's not true.  But the world only believes what the media tells them to believe.  And I tell the media what to believe, its really quite simple." - Kane (Joe Kucan) Command & Conquer Tiberium Dawn (1995)

Offline Bonk

  • Commodore
  • *
  • Posts: 13298
  • You don't have to live like a refugee.
Re: Scripting Question: OP
« Reply #1 on: December 24, 2005, 11:22:49 am »
Theoretically I beleive this is possible. (though I am not an experienced scripter). Check out Dave's Master's Series missions where one or two of the scripts substitute your current ship for the mission if I recall correctly.

Offline NuclearWessels

  • Evil Dave
  • Serverkit Development Team
  • Lt. Commander
  • *
  • Posts: 1249
  • Scripter and general nuisance
    • NukeDocs
Re: Scripting Question: OP
« Reply #2 on: December 28, 2005, 02:20:24 pm »
<disclaimer> I'm REALLY rusty on the scripting, but IIRC </disclaimer>

it is possible to change the damage and supply status of your ship (that I'm sure of), but it isn't possible to change the actual type of ship (not even basic refits).  The script can give you a different ship for the duration of the mission, but once you leave the mission you'll be back in your old vessel.

Essentially the server keeps track of what ship it thinks you have, and (more or less) exchanges a status string with the mission, identifying the level of damage and supplies.   At the end of the mission the server applies the status string to the type of ship it thinks you have in order to update your damage/supplies (which is why your ship is unaffected if you drop out of a mission - the updated status never gets applied). 

That said, if the SQL server kit was debugged and in use then it probably would be possible to do the exchange by having the script connect directly to the database and issue the appropriate SQL commands.

dave the rusty