Errors with WCP Pascal

Jason_Ryock

Vice Admiral
The tutorials from Killerwaves site links to the UE site tutorial. So I started reading and working and came up with the following line:

#include wcp, consts, pilots;

What is this line, what does it do, why is it here, and why do the Secret Ops sample mission texts still use "wcp"?

Also, some of the sample code off of KillerWaves site is buggy, but after I fixed a few errors, I ran and compiled smoothly. So I hopped into Secret Ops to check it out, and it gave me an error:

CPropertyList::parse bogus property

I have no idea what it means, I took a screen shot of it (Ask me for it and I'll post it) and no idea how to get rid of it. Any help with either of these?
 
I can't be sure without seeing the actual source code, but it sounds like somewhere, you've given an object a property that either doesn't exist or doesn't apply to that object type. You may have simply made a spelling mistake somewhere.
 
If you want to see my code...

...at Killerwaves site he has a link to sample mission text, and that's it right there.

I was under the impression that sample mission code like that didn't have errors in it.
 
Errors happen everywhere... they're just more embarrasing when they appear in sample code :p. But in this particular case, I don't see any error, at least not at first glance. Did you make any changes to the code before you compiled it?
 
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; // 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 (neutral, 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); // 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;


The first few times I tried to compile and build an IFF file it gave me four errors, so I worked backward to eliminate them, and this is what I ended up with.
 
Hmm, try removing the "MS_RunGameflow(0); // start gameflow" line. I'm not sure if that's the problem, and too lazy to check myself, but it shouldn't be there in a sim mission, so it might be what you're looking for.
 
It's right off the website, I changed about four lines because WCPPascal was giving me errors.

I'll go try to compile and run it again.
 
Okay, well just to clarify, the problem doesn't come up when I try to compile and build, only when I try to run it, and it's still doing it.

=/
 
http://tcsdiligent.solsector.net/screens/untitled.bmp

The error message in question.

I load up WCP. Input the code. Compile and Build IFF. Open Secret Ops. Run the Sim, and as soon as I click for the sim to start, black screen and that box, hit okay and it dumps me back to windows.

Just to be safe (Becasue I've...slightly...edited my copy of Secret Ops), I cleaned it from my system, did a fresh install and loaded up a differant version of the simulator (one with differant missions) and went through the whole process again.

No go.

I tried deleting the s0.mis and s0.iff files, so that went it built new ones it was clean.

No go.

I tried every possible combination of the prefrences in WCPPascal, or at least, as close as I could get to it. Optimized and Non-optimized etc etc etc.

I have no clue anymore and it's very frustrating, I'd like to know why I can't make such a simple mission work on my computer. I'm hesitant to explore anymore with programming missions if I can't even make the sample one work correctly...help...anyone?
 
This is very unusual. I didn't have one wit of trouble when I played the mission.

Hmmm.... :confused:

What files do you have in your secret ops directory excluding icons, applications, folders, .tre files, text documents, application extensions, and anything with ue in it? (I have my SO folder organized by type and shown in groups-which makes it much easier to find specific "." files like .tre and .eng)
 
Like I said, I did a clean wipe and then reinstalled the program, no mods. The only files in the directory that didn't come with the Secret Ops Download are the files for the mission Simulator.

I'm slightly confused those, I was looking at the WCPPascal Tutorial at the UE site (That was where I was sent when I clicked on Killer-wave's tutorial listing for WCPPascal) and in reading the instructions came across direstion to compiling tistr.pas into the /language directory.

Everytime I attempted to do this I got an error message. Could that be the source of my problems? WCPPascal didn't come with any installation instructions, and I've yet to find any, so I have no idea if I even have all the files to run it.

Initially when I DLed it I had only the two EXE's (Thomas's site is...slightly confusing I DLed an updated instead) but I have since corrected that and have all I need, I'm sure, just not what to do with all of them.

...any help?
 
Jason_Ryock said:
Everytime I attempted to do this I got an error message. Could that be the source of my problems? WCPPascal didn't come with any installation instructions, and I've yet to find any, so I have no idea if I even have all the files to run it.
You must make sure that the folder actually exists. WCPPas isn't capable of creating folders, so if it's told to output something into a nonexistent path, it goes crazy and tries to kill you :p.

I think I worked out what the problem is. Nothing to do with the source code - it's just that you're using the latest version of WCPPas (24d). This version has a rather annoying bug in it. Missions get compiled fine, but then they don't quite work fine with SO. Try downgrading to 24c, compile the mission again, and see if it works then.
 
Okay, I downgraded and compiled, ran SO, and it didn't crash. It DID however, load a blank screen. I remembered reading in a thread somewhere about that and slapped the F1 key and the mission started up just fine...so now my question is, how do I get rid of that blank screen?

Thanks for walking me through that problem with WCPPascal.
 
You can get rid of this problem by putting the command "SF_PlayerSwitchToCam(CamID_cockpit, Player);" at the start of the player's main function.
 
Back
Top