Refueling Mission

Jason_Ryock

Vice Admiral
In WC:SO there is a ship called the Refueler and a command for the AI to replenish your fuel and missiles, and a Refueling cutscene.

My question is, how do I edit this things together into something WC:SO will recognize as a valid mission?

I would very much like to add in a refueling point, I think it would be nice to see that as part of the game, but I would like some help figuring out how.

As long as we're on the subject, is it possible to code in a misison where the entire objective is to escort a shuttle, and in the middle of the mission have that shuttle say, pick up an ejected pilot? ((NOTE: Not one ejected during hte mission, but an ejected pilot placed there before the mission starts, IE: he ejected prior to the mission and this mission's objective is to recover him.))

Seems to me the two topics are related, as both would call on the AI to display a cutscene.
 
Here's what I tried (Don't worry, it's short!):



mission s0; // S0 = Slot 0 on the sim

#AddToSearchPath ("$wcso$"); // SO path
#AddToSearchPath("$wcso$\language\"); // SO /language path
#sector: "a.sec"; //sector file
#include wcp;
#include consts; //wcppas constants list
#include comms; //comms files
#include pilots; //pilots list
#include ships; //ships list


#strings spacefli; // spacefli.eng
#strings targetid; // targets id

#SetOutputPath ("$wcso$\mission\"); // output path

object Nav1(Navpoint) //navpoint
x: 500; // x coord
y: 200; // y coord
z: 1000; // z coord
main: M_NAV1; // navpoint main function
name: Spacefli["Nav 1"]; // points to a string on spacefli.eng
navdata: 1, 30000;
end; //end object function

object Nav2(Navpoint)
x: -1000;
y: 0;
z: 62000;
main: M_NAV2;
name: Spacefli["Nav 1"];
navdata: 2, 30000;
end;

object Nav3(Navpoint)
x: 80000;
y: 40000;
z: -62000;
main: M_NAV3;
name: Spacefli["Nav 2"];
navdata: 3, 30000;
end;

object Wingman_1(Ship) //wingman
obj: refueler; //wingman ship
x: 200; // x coord
y: 600; // y coord
z: 1200; // z coord
main: M_Wingman; // wingman main function
targstr: targetid["Alpha 2"]; // points to a string in targetid.eng
pilot: Pilot_Veil; // pilot
end; // end object function

object Player(Player) // player function, indispensable
obj: panther; // player ship
x: 300; // x coord
y: 400; // y coord
z: 1200; // z coord
main: M_Player; // player main function
pilot: Pilot_Casey1; // pilot
end; // end object function

function M_NAV1; // nav1 main function
var
setup = true;
begin
while(1) do begin
if (NAV_WithinSphere(Player)) then begin
NAV_ActivateSelf; // if player within nav1 sphere, activate it
AI_WaitSeconds(1);
NAV_SetPlayerNav(2); // set new autopilot coords
while(NAV_WithinSphere(Player)) do begin
AI_WaitSeconds(1);
end;
NAV_DeactivateSelf; //deactivate navpoint
end;
AI_WaitSeconds(1);
end;
end;

function M_NAV2;
begin
while(1) do begin
if (NAV_WithinSphere(Player)) then begin
NAV_ActivateSelf;
NAV_SetPlayerNav(3);
while(NAV_WithinSphere(Player)) do begin
AI_WaitSeconds(1);
AI_ReplenishMissilesAndFuel;

AI_RefuelCutscene(player, Wingman_1);
end;
NAV_DeactivateSelf;
end;
AI_WaitSeconds(1);
end;
end;

function M_NAV3;
begin
while(1) do begin
if (NAV_WithinSphere(Player)) then begin
NAV_ActivateSelf;
while(NAV_WithinSphere(Player)) do begin
AI_WaitSeconds(4);
SF_SetMissionSuccess;
end;
NAV_DeactivateSelf;
end;
AI_WaitSeconds(1);
end;
end;


function M_Wingman; //wingman main function
begin
SF_SetObjectFlag(OF_Alignment, ALIGN_CONFED);
//ship alignment (neutral, confed, alien, or evil-kilrathi)
AI_WaitSeconds(1);
SF_BindToActionSphere(0);
//navpoints where the player will appear (0=all)
SF_ActivateSelf(0);
while(1) do AI_WaitSeconds(1);
end;

function M_Player; //player main function
begin
SF_SetObjectFlag(OF_Alignment, ALIGN_CONFED); //alignment
SF_BindToActionSphere(0); // navpoint it will appear,always 0 (0=all)
SF_ActivateSelf(0); // automatic activate the object
while(1) do AI_WaitSeconds(1);
end;

function MAIN; // game main function
begin
MS_RunGameflow(0); // start gameflow
MS_RunSpaceflight(0); // start engine
end;
 
Jason_Ryock said:
In WC:SO there is a ship called the Refueler and a command for the AI to replenish your fuel and missiles, and a Refueling cutscene.

My question is, how do I edit this things together into something WC:SO will recognize as a valid mission?.

Yes, simply you use that AI function in the point of the mission where you want and the game will show the cutscene.


Jason_Ryock said:
As long as we're on the subject, is it possible to code in a misison where the entire objective is to escort a shuttle, and in the middle of the mission have that shuttle say, pick up an ejected pilot? ((NOTE: Not one ejected during hte mission, but an ejected pilot placed there before the mission starts, IE: he ejected prior to the mission and this mission's objective is to recover him.))

Seems to me the two topics are related, as both would call on the AI to display a cutscene.

Yes I did a simulator mission where the SAR pickup ejected pilots using common wcpascal functions (without cutscenes). Ejected Pilots can be declared as objects and the SAR have to enough code to approach to ejected pilot slowly while you play a SYS_PlayFX to listen the pickupup sound, when the SAR is enough near of the ej, pilot, you deactivate it. Difference with cutscene is that you can not look the blue ray between SAR and ej, pilot but this is only a detail. :)
 
LOL

I made it work a little bit too well, it loads the cutscene now, but er...well it doesn't stop loading the cutscene, just keeps looping over and over again...
 
Jason_Ryock said:
LOL

I made it work a little bit too well, it loads the cutscene now, but er...well it doesn't stop loading the cutscene, just keeps looping over and over again...

mmm, you have called the function into a while statament? :cool:
 
You must do the game only read that function only once besides it reside on a while.
Put a function var at the begin function:
var setup = true;

while (1) do begin
if (setup) then begin
Refuel call function here...
setup := false;
end;
AI_WaitSeconds(1);
end;

So, you prevent of execute any function few times. This is a typical statament used in wcpascal technical.
 
TanGO said:
Yes I did a simulator mission where the SAR pickup ejected pilots using common wcpascal functions (without cutscenes). Ejected Pilots can be declared as objects and the SAR have to enough code to approach to ejected pilot slowly while you play a SYS_PlayFX to listen the pickupup sound, when the SAR is enough near of the ej, pilot, you deactivate it. Difference with cutscene is that you can not look the blue ray between SAR and ej, pilot but this is only a detail. :)
To expand on what Tango says here (or rather, what he doesn't say :p), there is no way to activate the ejected pilot pick-up cutscene that you see if you yourself eject. That's why you have to script this event yourself.
 
Back
Top