WCP Pascal Questions

Jason_Ryock

Vice Admiral
Whew...months later, finally getting somewhere, I think. And at the same time I've moved backwards. It's been a few months since I looked at WCP and my threads, and my data, so I'm a little bit rusty.

Frankly, I'm reading back over the questions I asked before going, "What the hell did I mean?"

So here's my latest problem...I lack the targetid.eng file in my language directory. It says to compile tistr.pas, but I don't seem to have that file either, and all my attemtps to use treman.exe to extract the files in mission.tre have met with no end. I looked at the threads discussing the .tre files, about the "attrib -r mission.tre" note, and it still didn't work.

So what do I do now? And can I get the tistr.pas file from anywhere else? Am I even looking in the right place?
 
Okay...got it working right, yay! Just took me some fooling around with it, anyway, I could use some direction with my experimentation now if anyone has any ideas...

I also have some questions about ship editing.

Like, say I wanted to create my own entire list of ships to fly and fight in a series (SRS style) of missions. How exactly would I go about doing that?
 
Have you read the "srs" tutorial creation from Killrawave page?
There you can find how you can do a .srs file and a lot more.
SRS store global vars and game flow missions.

TanGO
 
I know what they are...what I want to know is:

1) How do I create my own list of ships for Secret Ops to use, instead of the standard ones?
2) How do I group a set of missions into a SRS file to make them playable with linear play rather then the simulator?

(( Probably answerable through the SRS tutorial which I haven't really looked at yet. ))

3) How do I add a non-Midway Capital Ship into a mission?
4) Is there a list somewhere of all the possible "obj" variables for the Capship creation code?

(( FYI: I'm using WCPascal ))

5) How can I edit the ship id list (Alpha 1, Alpha 2 etc. etc.) to add in my own strings for capships and fighter wings?
 
1) How do I create my own list of ships for Secret Ops to use, instead of the standard ones?
The ship list is /game/ship.iff, a file where you define every ship. to view a example use "decode iff" from WCPascal and select a original file extracted from SO with treman.exe

2) How do I group a set of missions into a SRS file to make them playable with linear play rather then the simulator?
(( Probably answerable through the SRS tutorial which I haven't really looked at yet. ))

Yes, you answer the question, first you have to read some tutorials and if anything you don't understand, I can respond if me know the response of course. :), you imagine I couldn't write here several pages of information...

3) How do I add a non-Midway Capital Ship into a mission?
Well, look a wcpascal example where you define "objects", the "name" of the object is the name of the ship file (without iff extension), i.e. review the "ships" folder where all ship files are (don't confuse ship.iff in game folder file with ships folder), ships folder hold all ships that game need, if you extract SO files with treman.exe, this create a ships folder with all SO ships. For example you could view a "cerberus.iff" file, to define the cerberus on your mission you have to replace "midway" to "cerberus" on the object definition. (To object definitions you have to read Thomas Bruckner tutorials)

4) Is there a list somewhere of all the possible "obj" variables for the Capship creation code?
Answered in last question, capship are not a list, the "object name" is the "name file without .iff extension

5) How can I edit the ship id list (Alpha 1, Alpha 2 etc. etc.) to add in my own strings for capships and fighter wings?
All names of the game are in "language" folder, there you can view files with ".eng" extension, in wcpascal go at bottom and select open string file.
Really each name is mannaged by your ID number (the string position in the list).

Remember, first you decode that iff files from original SO then you can view the contents and begin to discover every thing what means.


TanGO
 
1) Just to confirm, I can decode the IFF I extract from SO, edit it into my own ships list, put the .tre back together and run the game and it will use my own list?
2) To use a capship that's not the midway, but is instead one that I am putting into the game (EX: Thomas Bruckner has a WC4 Transport for download on his page) do I first need to add it to the ship lest extracted from the .tre in SO?
3) What I've noticied about the targetid strings list is that I can't add anymore to the bottom, I have to edit out strings in the middle. Is that correct or is there a way to add more strings at the end (Or the beginning for that matter)?
 
1) Just to confirm, I can decode the IFF I extract from SO, edit it into my own ships list, put the .tre back together and run the game and it will use my own list?
Yes, to test purposes you don't need create again the .tre file, simply put the new file into the folder where SO is installed, the engine replace any file founded into the SO install folder instead tre files. Next, to release propouses you'll create a .tre file by mean of tremake.

2) To use a capship that's not the midway, but is instead one that I am putting into the game (EX: Thomas Bruckner has a WC4 Transport for download on his page) do I first need to add it to the ship lest extracted from the .tre in SO?
I believe you question was answered in last response. You don't need put again the tre file, you copy capship file .iff into /ships folder on SO. BTW, warning with some capships that you get from other sites, sometimes they seem capships but they are not. You can learn ship/capships differences on Killerwave pages.

3) What I've noticied about the targetid strings list is that I can't add anymore to the bottom, I have to edit out strings in the middle. Is that correct or is there a way to add more strings at the end (Or the beginning for that matter)?
First, the string order is important because they are mannaged by ID (depend how you decalre that into the wcpascal). Now to security propouses you can replace someone, and if you need add more, yes could be, in the .eng file, at first you find a number specifing how many lines have the file, now I suggest don't touch that, the better way is replace some ones.
 
Yeah Tango, you were right, the WC4 transport I was having issues with isn't in fact a capital ship. I tried adding it as just a regular seperate ship and it worked out just fine.

So here's my next quesiton, and this one is a big one:

If I clean install Secret Ops to a seperate directory, run into my ships directory and delete all the ships and leave only the ones I want to use, and then create some missions and an .srs file to use them, will my game still run properly?
 
Gots another question about capital ships.

It's possible I know to have a ship be visible at all nav points. Discovered this on accident, forget some bit of code and you can always see your home carrier no matter which nav you are at.

Question is:

How do I set this for an enemy capital ship at say, Nav 4? So you can always see the carrier you launched from, and you can always see the "target" for example, that you are heading for.

Seems to me it'd be interesting for larger supposed fleet-to-fleet battles, or at least more anticipating to have it done that way.

Mission is:
Nav 1: Home Carriers, no enemy
Nav 2: Enemy Fighter Patrol
Nav 3: Enemy capital ships/Enemy fighters
Nav 4: Return home
GOAL: Eliminate Capital ships at Nav 3

The idea is to play a fighter pilot in a simple squad escorting some bombers. Haven't worked it all out yet. Code below:

((NOTE: Hellcat/Longbow models off of CIC SO ships database, Fralthi "barrowed" from UE ships...will return it when done.))

// Sim Mission 1 - Victory Test
mission s0;

#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;
#strings targetid;

#SetOutputPath ("$wcso$\mission\");

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;

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: hellcat; //wingman ship
x: 1400; // x coord
y: 1800; // y coord
z: 5000; // 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: hellcat;
x: 1400;
y: 1700;
z: 5000;
main: M_Wingman;
targstr: targetid["Alpha 3"];
pilot: Pilot_Foxtrot;
end;

object Wingman_3(Ship)
obj: hellcat;
x: 1400;
y: 1600;
z: 5000;
main: M_Wingman;
targstr: targetid["Alpha 4"];
pilot: Pilot_Maestro;
end;

object Wingman_11(Ship)
obj: hellcat;
x: 1400;
y: 1600;
z: 5000;
main: M_Wingman;
targstr: targetid["Bravo 1"];
pilot: Pilot_Maestro;
end;

object Wingman_4(Ship)
obj: hellcat;
x: 1400;
y: 1600;
z: 5000;
main: M_Wingman;
targstr: targetid["Bravo 2"];
pilot: Pilot_Maestro;
end;

object Wingman_7(Ship)
obj: longbow;
x: 1400;
y: 1600;
z: 5000;
main: M_Wingman;
targstr: targetid["Charlie 1"];
pilot: Pilot_Maestro;
end;

object Wingman_8(Ship)
obj: longbow;
x: 1400;
y: 1600;
z: 5000;
main: M_Wingman;
targstr: targetid["Charlie 2"];
pilot: Pilot_Maestro;
end;

object Wingman_9(Ship)
obj: longbow;
x: 1400;
y: 1600;
z: 5000;
main: M_Wingman;
targstr: targetid["Charlie 3"];
pilot: Pilot_Maestro;
end;

object Wingman_10(Ship)
obj: longbow;
x: 1400;
y: 1600;
z: 5000;
main: M_Wingman;
targstr: targetid["Charlie 4"];
pilot: Pilot_Maestro;
end;

object Diligent(CapShip)
obj: "midway";
x: 1800;
y: 600;
z: 1200;
main: M_Carriers;
pilot: PILOT_Confed;
targstr: targetid["TCS Adelaide"];
end;

object Diligent2(CapShip)
obj: "midway";
x: 400;
y: 600;
z: 1200;
main: M_Carriers;
pilot: PILOT_Confed;
targstr: targetid["TCS Adelaide"];
end;

object kfleet(CapShip)
obj: "fralthi";
x: 3000;
y: 600;
z: 1200;
main: M_Kfleet;
pilot: PILOT_Confed;
targstr: targetid["K'ha'haf"];
end;

object kfleet2(CapShip)
obj: "fralthi";
x: 2000;
y: 600;
z: 1200;
main: M_Kfleet;
pilot: PILOT_Confed;
targstr: targetid["K'ha'haf"];
end;

object kfleet3(CapShip)
obj: "fralthi";
x: 1000;
y: 600;
z: 1200;
main: M_Kfleet;
pilot: PILOT_Confed;
targstr: targetid["K'ha'haf"];
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;
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_Dralthi, 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(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_Carriers; //wingman main function
begin
SF_SetObjectFlag(OF_Alignment, ALIGN_CONFED);
//ship alignment (neutral, confed, alien, or evil-kilrathi)
AI_WaitSeconds(1);
SF_ActivateSelf(0);
while(1) do AI_WaitSeconds(1);
end;

function M_Kfleet; //wingman main function
begin
SF_SetObjectFlag(OF_Alignment, ALIGN_ALIEN);
//ship alignment (neutral, confed, alien, or evil-kilrathi)
AI_WaitSeconds(1);
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(2); // 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:
If I clean install Secret Ops to a seperate directory, run into my ships directory and delete all the ships and leave only the ones I want to use, and then create some missions and an .srs file to use them, will my game still run properly?
if you have a clean SO installation, if me memory not fail, the "ships" folder don't exists because all ships are loaded from the tre file. I don't understand why you say "delete all the ships" because there are not ships there.
Listen, try learn how the game load any file:
1) On root SO directory there are a text file saying what tre files the game will load.
2) The engine load this files (.tre files)
3) tre files has many files into, it decalred with your output folder for each one.
3)but....!!!, if you replace a file "in the appropriate place" (folder/file) then the game load that file instead the .tre file. :)

This is applicable to "any" game file.
 
Eh well, for editing purposes I installed the Sosim (Mission Simulator) package into my SO directory, which created the ships folder, I believe.

That coupled with the ability to finally extract all the files in data.tre means I have a "Ships" folder in my directory...however, I now understand better some of what I was trying to put my nail on but didn't know enough to talk about...

Secret Ops ships are stored in two loations. #1 is a ships list, inside data.tre. #2 is a folder inside data.tre.

To edit new ships into the game they have to appear in both places, which I can do with WCPascal. Then, if I was going to (And I have no plans to) distribute my "mod" to Secret Ops, I would repack the .tre with my ships and files in it to make it run properly.

Now, Something else.

For ships to be "spawnable" (for lack of a better word) they HAVE to appear on the ships list. At least, that's the problem I've run into.

So now my question is:

How do I make the shiplist point to another .iff file?

EX: If the shiplist says "SHIP_Hellcat" in the "SHIP_Moray" line, the MORAY.IFF file is still called up by the game.

****Edit****

Oh yeah...I fixed the mission above to work correctly. I simply set the nav points all in a straight line 60000 from each other, and then set the Fralthis to activate at all Nav's, and placed them the correct distance so at to be present at the Third Nav.

New problem:
How do I make it so that the mission does not suceed until all the capships are destroyed?
 
Jason_Ryock said:
Gots another question about capital ships.

It's possible I know to have a ship be visible at all nav points. Discovered this on accident, forget some bit of code and you can always see your home carrier no matter which nav you are at.

Question is:

How do I set this for an enemy capital ship at say, Nav 4? So you can always see the carrier you launched from, and you can always see the "target" for example, that you are heading for.

You have to learn the use of SF_BindtoActionSphere function combined with Activate and Deactivate the Nav Points
With 0 value the object will be attached to all nav points (next depend of if the nav point is active, visible, etc;)
Value <> 0 will be the nav point where the object is attached.
Now you can combine this with WaitUntilActive and ActivateObject function, i.e. only active you capship when the player arrive to Nav4 (using Nav4 main function)

Don't you wait for me read all your code no? :D
 
Jason_Ryock said:
For ships to be "spawnable" (for lack of a better word) they HAVE to appear on the ships list. At least, that's the problem I've run into.

So now my question is:

How do I make the shiplist point to another .iff file?

EX: If the shiplist says "SHIP_Hellcat" in the "SHIP_Moray" line, the MORAY.IFF file is still called up by the game.

New problem:
How do I make it so that the mission does not suceed until all the capships are destroyed?

Spawnable ships are declared in /game/ship.iff, exactly there you define ID ship vs. "file" ship, this is a ship file name without extension, look up the original ship.iff (decoding iff of course) and you will view that. You will view "morray" at ID 2 if ne remember ok, simply replace "morray" by your ship name file then the game will try locate you file instead the morray.iff
 
But see, I WANTED to be able to see the capships at all the Nav's...thanks for telling me how to do it right though, I'm sure that will come in handy later...
 
OK, now I have a question... why I did 4 post here and all are the same number?, so I can not get a rank ascend! :)
forget I look now that are the total post :D :rolleyes:
 
Back
Top