How to start making missions?

culler

Spaceman
Hi

want to try making missions, any pointers for beginners?
Have downloaded WCPascal, socv101, misb21 and somm.

Compiled one of the sample missions in misb21, tried to use somm to put the mission in, and it gives some error about "uncertain status"
 
Use wcppas, it takes more time to learn, but gives more liberty in mission design. Also, there is plenty documentation at Thomas page.
 
the documentation well... sucks to be honest

the SF_* functions aren't covered anywhere, there's little in the way of sample missions / .PAS files..

unless I'm missing something
 
It is a documentation, not a tutorial. So its very good. All the functions are there.
Start with a simple mission, then go on adding features and changing it. There is always someone that can give you some info over here, if you need it.
If you're interested, i could post a simple mission code for you to play with.
 
I wasn't trying to knock the documentation, sorry if it was taken the wrong way, I just thought it wasn't very intuitive for a beginner. It looks like good reference type material rather than a howto.

I was hoping I could find something simple like maybe a 2 navpoint patrol sweep, and then start from there. I'd be interested in any simple mission code.

I've been toying with the idea of doing a Vision engine mod of WC4 from the Black Lance's point of view, so just need to get started somewhere
 
You are right, the documentation isn't very useful for beginners - it describes the program's basic functions, not how to use it. Unfortunately, nobody ever seems to have time to write a proper how-to guide (I've been trying to do it for... KW, how long? ;))
Of course, if you have even a tiny amount of experience with a programming language, you should be able to get the hang of it pretty quickly. Most WCP functions can be understood just by looking at their name and the variables they require.

On a sidenote though, any BL-related project would be better off in WC4 than WCP, because cloaking is not supported in WCP.
 
Too long Q :p

Sample mission source:

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

#AddToSearchPath ("$soscr$"); // 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; // nav id, diameter
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 Nav4(Navpoint)
x: 80000;
y: -20000;
z: -62000;
main: M_NAV4;
name: Spacefli["Nav 3"];
navdata: 4, 30000;
end;

object Wingman_1(Ship) //wingman
obj: panther; //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 Wingman_2(Ship)
obj: panther;
x: 400;
y: 600;
z: 1200;
main: M_Wingman;
targstr: targetid["Alpha 3"];
pilot: Pilot_Foxtrot;
end;

object Wingman_3(Ship)
obj: panther;
x: 400;
y: 600;
z: 1200;
main: M_Wingman;
targstr: targetid["Alpha 4"];
pilot: Pilot_Maestro;
end;

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

// ********** BEGIN Spwaning Routines for Alien **********

function M_SpawnNearObjectAlien(shipId, count, obj); forward;

var
m_AliveAliens,
m_DeadAliens;

function S_Alien;
begin
SF_SetObjectFlag(OF_alignment, ALIGN_ALIEN);
SF_BindToActionSphere(0);
SF_ActivateSelf(0);
m_AliveAliens := m_AliveAliens + 1;

while (1) do
AI_WaitSeconds(1);
end;

function S_AlienDeath;
begin
m_DeadAliens := m_DeadAliens + 1;
end;

function M_SpawnAlien(shipId, count, x, y, z);
var
ox, oy, oz;
begin
while(count > 0) do begin
ox := x + SYS_Random(600) - 300;
oy := y + SYS_Random(600) - 300;
oz := z + SYS_Random(600) - 300;

NAV_CreateShip(2, PILOT_Confed, 0, @S_Alien, @S_AlienDeath, ox, oy, oz);
AI_WaitMilliseconds(275);
count := count - 1;
end;
end;

function M_SpawnNearObjectAlien(shipId, count, obj);
var
x, y, z,
ox, oy, oz;
begin
x := SF_GetXObj(Player);
y := SF_GetYObj(Player);
z := SF_GetZObj(Player);

while(count > 0) do begin
ox := x + SYS_Random(600) + 500;
oy := y + SYS_Random(600) + 500;
oz := z + SYS_Random(600) + 500;

NAV_CreateShip(shipId, PILOT_Alien1, 0, @S_Alien, @S_AlienDeath, ox, oy, oz);
AI_WaitMilliseconds(275);
count := count - 1;
end;
end;

function M_CountAliens;
begin
Result := m_AliveAliens - m_DeadAliens;
end;

function M_WaitUntilDeadAlien;
begin
until(m_DeadAliens = m_AliveAliens) do
AI_WaitSeconds(1);
end;
// *********** END Spwaning Routines for Alien ***********


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;
M_SpawnNearObjectAlien(SHIP_Moray, 3, Player);
//spawn rotine (shipid, number, spwan near ship)
NAV_SetPlayerNav(3);
while(NAV_WithinSphere(Player)) do begin
AI_WaitSeconds(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;
AI_WaitSeconds(1);
M_SpawnNearObjectAlien(SHIP_Manta, 3, Player);
NAV_SetPlayerNav(4);
while(NAV_WithinSphere(Player)) do begin
AI_WaitSeconds(1);
end;
NAV_DeactivateSelf;
end;
AI_WaitSeconds(1);
end;
end;

function M_NAV4;
begin
while(1) do begin
if (NAV_WithinSphere(Player)) then begin
NAV_ActivateSelf;
AI_WaitSeconds(1);
M_SpawnNearObjectAlien(SHIP_AAceship, 3, Player);
M_WaitUntilDeadAlien; // wait until all enemies are dead
AI_WaitSeconds(4);
SF_SetMissionSuccess; // set the mission as a success
AI_WaitSeconds(4);
SF_Exit; // end the mission
while(NAV_WithinSphere(Player)) do begin
AI_WaitSeconds(1);
end;
NAV_DeactivateSelf;
end;
AI_WaitSeconds(1);
end;
end;


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

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

function MAIN; // game main function
begin
MS_RunGameflow(0); // start gameflow
MS_RunSpaceflight(0); // start engine
end;
---------------------------------------------
 
Back
Top